mirror of
https://github.com/friendica/friendica
synced 2024-11-17 21:43:41 +00:00
Merge pull request #581 from fermionic/20130112-backport-red-smarty-improvements
fixes and tweaks to Smarty processing
This commit is contained in:
commit
8b643d4c88
29 changed files with 64 additions and 66 deletions
5
boot.php
5
boot.php
|
@ -622,7 +622,6 @@ if(! class_exists('App')) {
|
|||
*/
|
||||
if(!isset($this->page['htmlhead']))
|
||||
$this->page['htmlhead'] = '';
|
||||
$tpl = get_markup_template('head.tpl');
|
||||
|
||||
// If we're using Smarty, then doing replace_macros() will replace
|
||||
// any unrecognized variables with a blank string. Since we delay
|
||||
|
@ -633,6 +632,7 @@ if(! class_exists('App')) {
|
|||
else
|
||||
$stylesheet = '$stylesheet';
|
||||
|
||||
$tpl = get_markup_template('head.tpl');
|
||||
$this->page['htmlhead'] = replace_macros($tpl,array(
|
||||
'$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
|
||||
'$local_user' => local_user(),
|
||||
|
@ -1381,8 +1381,6 @@ if(! function_exists('profile_sidebar')) {
|
|||
}
|
||||
|
||||
|
||||
$tpl = get_markup_template('profile_vcard.tpl');
|
||||
|
||||
$p = array();
|
||||
foreach($profile as $k => $v) {
|
||||
$k = str_replace('-','_',$k);
|
||||
|
@ -1392,6 +1390,7 @@ if(! function_exists('profile_sidebar')) {
|
|||
if($a->theme['template_engine'] === 'internal')
|
||||
$location = template_escape($location);
|
||||
|
||||
$tpl = get_markup_template('profile_vcard.tpl');
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$profile' => $p,
|
||||
'$connect' => $connect,
|
||||
|
|
|
@ -489,12 +489,12 @@ function get_template_file($a, $filename, $root = '') {
|
|||
if($root !== '' && $root[strlen($root)-1] !== '/')
|
||||
$root = $root . '/';
|
||||
|
||||
if(file_exists($root . "view/theme/$theme/$filename"))
|
||||
$template_file = $root . "view/theme/$theme/$filename";
|
||||
elseif (x($a->theme_info,"extends") && file_exists($root . "view/theme/".$a->theme_info["extends"]."/$filename"))
|
||||
$template_file = $root . "view/theme/".$a->theme_info["extends"]."/$filename";
|
||||
if(file_exists("{$root}view/theme/$theme/$filename"))
|
||||
$template_file = "{$root}view/theme/$theme/$filename";
|
||||
elseif (x($a->theme_info,"extends") && file_exists("{$root}view/theme/{$a->theme_info["extends"]}/$filename"))
|
||||
$template_file = "{$root}view/theme/{$a->theme_info["extends"]}/$filename";
|
||||
else
|
||||
$template_file = $root . "view/$filename";
|
||||
$template_file = "{$root}view/$filename";
|
||||
|
||||
return $template_file;
|
||||
}}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
function display_init(&$a) {
|
||||
|
||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||
notice( t('Public access denied.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,6 +15,11 @@ function display_init(&$a) {
|
|||
|
||||
function display_content(&$a, $update = 0) {
|
||||
|
||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||
notice( t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
|
|
|
@ -220,16 +220,15 @@ function group_content(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
$context['$groupeditor'] = $groupeditor;
|
||||
$context['$desc'] = t('Click on a contact to add or remove.');
|
||||
|
||||
if($change) {
|
||||
$context['$groupeditor'] = $groupeditor;
|
||||
$tpl = get_markup_template('groupeditor.tpl');
|
||||
echo replace_macros($tpl, $context);
|
||||
killme();
|
||||
}
|
||||
|
||||
$context['$groupedit_info'] = $groupeditor;
|
||||
return replace_macros($tpl, $context);
|
||||
|
||||
}
|
||||
|
|
|
@ -516,7 +516,7 @@ function message_content(&$a) {
|
|||
'$to' => t('To:'),
|
||||
'$showinputs' => '',
|
||||
'$subject' => t('Subject:'),
|
||||
'$subjtxt' => template_escape($message['title']),
|
||||
'$subjtxt' => $subjtxt_e,
|
||||
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
|
||||
'$yourmessage' => t('Your message:'),
|
||||
'$text' => '',
|
||||
|
|
|
@ -6,8 +6,6 @@ function profiles_init(&$a) {
|
|||
nav_set_selected('profiles');
|
||||
|
||||
if(! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -565,6 +563,11 @@ function profile_activity($changed, $value) {
|
|||
|
||||
function profiles_content(&$a) {
|
||||
|
||||
if(! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$o = '';
|
||||
|
||||
if(($a->argc > 1) && (intval($a->argv[1]))) {
|
||||
|
|
|
@ -497,13 +497,7 @@ class Item extends BaseObject {
|
|||
return false;
|
||||
}
|
||||
|
||||
if($a->theme['template_engine'] === 'smarty3') {
|
||||
$template_file = get_template_file($a, 'smarty3/' . $this->available_templates[$name]);
|
||||
}
|
||||
else {
|
||||
$template_file = $this->available_templates[$name];
|
||||
}
|
||||
$this->template = $template_file;
|
||||
$this->template = $this->available_templates[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
$tabs
|
||||
|
||||
|
||||
{{ for $contacts as $c }}
|
||||
{{ inc contact_template.tpl with $contact=$c }}{{ endinc }}
|
||||
{{ for $contacts as $contact }}
|
||||
{{ inc contact_template.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
<div id="contact-edit-end"></div>
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
</div>
|
||||
|
||||
|
||||
{{ if $groupedit_info }}
|
||||
{{ if $groupeditor }}
|
||||
<div id="group-update-wrapper">
|
||||
{{ inc groupeditor.tpl with $groupeditor=$groupedit_info }}{{ endinc }}
|
||||
{{ inc groupeditor.tpl }}{{ endinc }}
|
||||
</div>
|
||||
{{ endif }}
|
||||
{{ if $desc }}<div id="group-edit-desc">$desc</div>{{ endif }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
{{ for $mails as $mail_item }}
|
||||
{{ inc mail_conv.tpl with $mail=$mail_item }}{{endinc}}
|
||||
{{ for $mails as $mail }}
|
||||
{{ inc mail_conv.tpl }}{{endinc}}
|
||||
{{ endfor }}
|
||||
|
||||
{{ if $canreply }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h1>$header</h1>
|
||||
|
||||
{{ for $contacts as $c }}
|
||||
{{ inc contact_template.tpl with $contact=$c }}{{ endinc }}
|
||||
{{ for $contacts as $contact }}
|
||||
{{ inc contact_template.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
<div id="contact-edit-end"></div>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
{{ endif }}
|
||||
|
||||
<div class="photos">
|
||||
{{ for $photos as $ph }}
|
||||
{{ inc photo_top.tpl with $photo=$ph }}{{ endinc }}
|
||||
{{ for $photos as $photo }}
|
||||
{{ inc photo_top.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
</div>
|
||||
<div class="photos-end"></div>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
|
||||
{{ if $response.totalResults }}
|
||||
{{ for $response.entry as $ent }}
|
||||
{{ inc poco_entry_xml.tpl with $entry=$ent }}{{ endinc }}
|
||||
{{ for $response.entry as $entry }}
|
||||
{{ inc poco_entry_xml.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
{{ else }}
|
||||
<entry></entry>
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
{{$tabs}}
|
||||
|
||||
|
||||
{{foreach $contacts as $c}}
|
||||
{{include file="contact_template.tpl" contact=$c}}
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact_template.tpl"}}
|
||||
{{/foreach}}
|
||||
<div id="contact-edit-end"></div>
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
</div>
|
||||
|
||||
|
||||
{{if $groupedit_info}}
|
||||
{{if $groupeditor}}
|
||||
<div id="group-update-wrapper">
|
||||
{{include file="groupeditor.tpl" groupeditor=$groupedit_info}}
|
||||
{{include file="groupeditor.tpl"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if $desc}}<div id="group-edit-desc">{{$desc}}</div>{{/if}}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
*
|
||||
*}}
|
||||
|
||||
{{foreach $mails as $mail_item}}
|
||||
{{include file="mail_conv.tpl" mail=$mail_item}}
|
||||
{{foreach $mails as $mail}}
|
||||
{{include file="mail_conv.tpl"}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $canreply}}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*}}
|
||||
<h1>{{$header}}</h1>
|
||||
|
||||
{{foreach $contacts as $c}}
|
||||
{{include file="contact_template.tpl" contact=$c}}
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact_template.tpl"}}
|
||||
{{/foreach}}
|
||||
<div id="contact-edit-end"></div>
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
{{/if}}
|
||||
|
||||
<div class="photos">
|
||||
{{foreach $photos as $ph}}
|
||||
{{include file="photo_top.tpl" photo=$ph}}
|
||||
{{foreach $photos as $photo}}
|
||||
{{include file="photo_top.tpl"}}
|
||||
{{/foreach}}
|
||||
</div>
|
||||
<div class="photos-end"></div>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
|
||||
{{if $response.totalResults}}
|
||||
{{foreach $response.entry as $ent}}
|
||||
{{include file="poco_entry_xml.tpl" entry=$ent}}
|
||||
{{foreach $response.entry as $entry}}
|
||||
{{include file="poco_entry_xml.tpl"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
<entry></entry>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*}}
|
||||
<h3>{{$title}}</h3>
|
||||
|
||||
{{foreach $contacts as $c}}
|
||||
{{include file="contact_template.tpl" contact=$c}}
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact_template.tpl"}}
|
||||
{{/foreach}}
|
||||
|
||||
<div id="view-contact-end"></div>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<a href="message/dropconv/$thread_id" onclick="return confirmDelete();" title="$delete" class="mail-delete icon s22 delete"></a>
|
||||
</div>
|
||||
|
||||
{{ for $mails as $mail_item }}
|
||||
{{ for $mails as $mail }}
|
||||
<div id="tread-wrapper-$mail_item.id" class="tread-wrapper">
|
||||
{{ inc mail_conv.tpl with $mail=$mail_item }}{{endinc}}
|
||||
{{ inc mail_conv.tpl }}{{endinc}}
|
||||
</div>
|
||||
{{ endfor }}
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
<a href="message/dropconv/{{$thread_id}}" onclick="return confirmDelete();" title="{{$delete}}" class="mail-delete icon s22 delete"></a>
|
||||
</div>
|
||||
|
||||
{{foreach $mails as $mail_item}}
|
||||
{{foreach $mails as $mail}}
|
||||
<div id="tread-wrapper-{{$mail_item.id}}" class="tread-wrapper">
|
||||
{{include file="mail_conv.tpl" mail=$mail_item}}
|
||||
{{include file="mail_conv.tpl"}}
|
||||
</div>
|
||||
{{/foreach}}
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ $tabs
|
|||
|
||||
|
||||
<div id="contacts-display-wrapper">
|
||||
{{ for $contacts as $c }}
|
||||
{{ inc contact_template.tpl with $contact=$c }}{{ endinc }}
|
||||
{{ for $contacts as $contact }}
|
||||
{{ inc contact_template.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
</div>
|
||||
<div id="contact-edit-end"></div>
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
|
||||
<div id="contacts-display-wrapper">
|
||||
{{foreach $contacts as $c}}
|
||||
{{include file="contact_template.tpl" contact=$c}}
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact_template.tpl"}}
|
||||
{{/foreach}}
|
||||
</div>
|
||||
<div id="contact-edit-end"></div>
|
||||
|
|
|
@ -15,8 +15,8 @@ $tabs
|
|||
|
||||
|
||||
<div id="contacts-display-wrapper">
|
||||
{{ for $contacts as $c }}
|
||||
{{ inc contact_template.tpl with $contact=$c }}{{ endinc }}
|
||||
{{ for $contacts as $contact }}
|
||||
{{ inc contact_template.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
</div>
|
||||
<div id="contact-edit-end"></div>
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
|
||||
<div id="contacts-display-wrapper">
|
||||
{{foreach $contacts as $c}}
|
||||
{{include file="contact_template.tpl" contact=$c}}
|
||||
{{foreach $contacts as $contact}}
|
||||
{{include file="contact_template.tpl"}}
|
||||
{{/foreach}}
|
||||
</div>
|
||||
<div id="contact-edit-end"></div>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<a href="message/dropconv/$thread_id" onclick="return confirmDelete();" title="$delete" class="mail-delete icon s22 delete"></a>
|
||||
</div>
|
||||
|
||||
{{ for $mails as $mail_item }}
|
||||
{{ for $mails as $mail }}
|
||||
<div id="tread-wrapper-$mail_item.id" class="tread-wrapper">
|
||||
{{ inc mail_conv.tpl with $mail=$mail_item }}{{endinc}}
|
||||
{{ inc mail_conv.tpl }}{{endinc}}
|
||||
</div>
|
||||
{{ endfor }}
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
<a href="message/dropconv/{{$thread_id}}" onclick="return confirmDelete();" title="{{$delete}}" class="mail-delete icon s22 delete"></a>
|
||||
</div>
|
||||
|
||||
{{foreach $mails as $mail_item}}
|
||||
{{foreach $mails as $mail}}
|
||||
<div id="tread-wrapper-{{$mail_item.id}}" class="tread-wrapper">
|
||||
{{include file="mail_conv.tpl" mail=$mail_item}}
|
||||
{{include file="mail_conv.tpl"}}
|
||||
</div>
|
||||
{{/foreach}}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h3>$title</h3>
|
||||
|
||||
{{ for $contacts as $c }}
|
||||
{{ inc contact_template.tpl with $contact=$c }}{{ endinc }}
|
||||
{{ for $contacts as $contact }}
|
||||
{{ inc contact_template.tpl }}{{ endinc }}
|
||||
{{ endfor }}
|
||||
|
||||
<div id="view-contact-end"></div>
|
||||
|
|
Loading…
Reference in a new issue