Browse Source

fixes and tweaks to Smarty processing

pull/581/head
Zach Prezkuta 8 years ago
parent
commit
609c45e791
29 changed files with 64 additions and 66 deletions
  1. +2
    -3
      boot.php
  2. +5
    -5
      include/text.php
  3. +5
    -2
      mod/display.php
  4. +1
    -2
      mod/group.php
  5. +1
    -1
      mod/message.php
  6. +5
    -2
      mod/profiles.php
  7. +1
    -7
      object/Item.php
  8. +2
    -2
      view/contacts-template.tpl
  9. +2
    -2
      view/group_edit.tpl
  10. +2
    -2
      view/mail_display.tpl
  11. +2
    -2
      view/nogroup-template.tpl
  12. +2
    -2
      view/photos_recent.tpl
  13. +2
    -2
      view/poco_xml.tpl
  14. +2
    -2
      view/smarty3/contacts-template.tpl
  15. +2
    -2
      view/smarty3/group_edit.tpl
  16. +2
    -2
      view/smarty3/mail_display.tpl
  17. +2
    -2
      view/smarty3/nogroup-template.tpl
  18. +2
    -2
      view/smarty3/photos_recent.tpl
  19. +2
    -2
      view/smarty3/poco_xml.tpl
  20. +2
    -2
      view/smarty3/viewcontact_template.tpl
  21. +2
    -2
      view/theme/diabook/mail_display.tpl
  22. +2
    -2
      view/theme/diabook/smarty3/mail_display.tpl
  23. +2
    -2
      view/theme/frost-mobile/contacts-template.tpl
  24. +2
    -2
      view/theme/frost-mobile/smarty3/contacts-template.tpl
  25. +2
    -2
      view/theme/frost/contacts-template.tpl
  26. +2
    -2
      view/theme/frost/smarty3/contacts-template.tpl
  27. +2
    -2
      view/theme/quattro/mail_display.tpl
  28. +2
    -2
      view/theme/quattro/smarty3/mail_display.tpl
  29. +2
    -2
      view/viewcontact_template.tpl

+ 2
- 3
boot.php View File

@ -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,


+ 5
- 5
include/text.php View File

@ -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;
}}


+ 5
- 2
mod/display.php View 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');


+ 1
- 2
mod/group.php View File

@ -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);
}


+ 1
- 1
mod/message.php View File

@ -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' => '',


+ 5
- 2
mod/profiles.php View File

@ -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]))) {


+ 1
- 7
object/Item.php View File

@ -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];
}
/**


+ 2
- 2
view/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/group_edit.tpl View File

@ -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 }}

+ 2
- 2
view/mail_display.tpl View File

@ -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 }}


+ 2
- 2
view/nogroup-template.tpl View File

@ -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>


+ 2
- 2
view/photos_recent.tpl View File

@ -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>

+ 2
- 2
view/poco_xml.tpl View File

@ -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>


+ 2
- 2
view/smarty3/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/smarty3/group_edit.tpl View File

@ -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}}

+ 2
- 2
view/smarty3/mail_display.tpl View File

@ -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}}


+ 2
- 2
view/smarty3/nogroup-template.tpl View File

@ -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>


+ 2
- 2
view/smarty3/photos_recent.tpl View File

@ -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>

+ 2
- 2
view/smarty3/poco_xml.tpl View File

@ -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>


+ 2
- 2
view/smarty3/viewcontact_template.tpl View File

@ -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>


+ 2
- 2
view/theme/diabook/mail_display.tpl View File

@ -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 }}


+ 2
- 2
view/theme/diabook/smarty3/mail_display.tpl View File

@ -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}}


+ 2
- 2
view/theme/frost-mobile/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/theme/frost-mobile/smarty3/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/theme/frost/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/theme/frost/smarty3/contacts-template.tpl View File

@ -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>


+ 2
- 2
view/theme/quattro/mail_display.tpl View File

@ -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 }}


+ 2
- 2
view/theme/quattro/smarty3/mail_display.tpl View File

@ -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}}


+ 2
- 2
view/viewcontact_template.tpl View File

@ -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…
Cancel
Save