simplify by making Smarty include directives behave like Friendica native ones

This commit is contained in:
Zach Prezkuta 2012-12-25 11:48:02 -07:00
commit 11c06e21b7
73 changed files with 376 additions and 587 deletions

View file

@ -1,7 +1,7 @@
<div id="twittersettings" style="display:none">
<form id="twittersettingsform" action="network" method="post" >
{{inc $field_input with $field=$TSearchTerm}}{{endinc}}
{{inc field_input.tpl with $field=$TSearchTerm}}{{endinc}}
<div class="settings-submit-wrapper">
<input id="twittersub" type="submit" value="$sub" class="settings-submit" name="diabook-settings-sub"></input>
</div>
@ -13,9 +13,9 @@
<div id="layermanager" style="width: 350px;position: relative;float: right;right:20px;height: 300px;"></div>
<div id="map2" style="height:350px;width:350px;"></div>
<div id="mouseposition" style="width: 350px;"></div>
{{inc $field_input with $field=$ELZoom}}{{endinc}}
{{inc $field_input with $field=$ELPosX}}{{endinc}}
{{inc $field_input with $field=$ELPosY}}{{endinc}}
{{inc field_input.tpl with $field=$ELZoom}}{{endinc}}
{{inc field_input.tpl with $field=$ELPosX}}{{endinc}}
{{inc field_input.tpl with $field=$ELPosY}}{{endinc}}
<div class="settings-submit-wrapper">
<input id="mapsub" type="submit" value="$sub" class="settings-submit" name="diabook-settings-map-sub"></input>
</div>
@ -35,16 +35,16 @@ just contact me, if you are intesrested in joining</p>
<div id="boxsettings" style="display:none">
<form id="boxsettingsform" action="network" method="post" >
<fieldset><legend>$boxsettings.title.1</legend>
{{inc $field_select with $field=$close_pages}}{{endinc}}
{{inc $field_select with $field=$close_profiles}}{{endinc}}
{{inc $field_select with $field=$close_helpers}}{{endinc}}
{{inc $field_select with $field=$close_services}}{{endinc}}
{{inc $field_select with $field=$close_friends}}{{endinc}}
{{inc $field_select with $field=$close_lastusers}}{{endinc}}
{{inc $field_select with $field=$close_lastphotos}}{{endinc}}
{{inc $field_select with $field=$close_lastlikes}}{{endinc}}
{{inc $field_select with $field=$close_twitter}}{{endinc}}
{{inc $field_select with $field=$close_mapquery}}{{endinc}}
{{inc field_select.tpl with $field=$close_pages}}{{endinc}}
{{inc field_select.tpl with $field=$close_profiles}}{{endinc}}
{{inc field_select.tpl with $field=$close_helpers}}{{endinc}}
{{inc field_select.tpl with $field=$close_services}}{{endinc}}
{{inc field_select.tpl with $field=$close_friends}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastusers}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastphotos}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastlikes}}{{endinc}}
{{inc field_select.tpl with $field=$close_twitter}}{{endinc}}
{{inc field_select.tpl with $field=$close_mapquery}}{{endinc}}
<div class="settings-submit-wrapper">
<input id="boxsub" type="submit" value="$sub" class="settings-submit" name="diabook-settings-box-sub"></input>
</div>

View file

@ -147,16 +147,8 @@ function diabook_form(&$a, $font_size, $line_height, $resolution, $color, $TSear
// $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
$t = get_markup_template("theme_settings.tpl" );
$includes = array(
'$field_select' => 'field_select.tpl',
'$field_input' => 'field_input.tpl',
);
$includes = set_template_includes($a->theme['template_engine'], $includes);
$o .= replace_macros($t, $includes + array(
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$title' => t("Theme settings"),

View file

@ -3,13 +3,13 @@
<input type="hidden" name="auth-params" value="login" />
<div id="login_standard">
{{ inc $field_input with $field=$lname }}{{ endinc }}
{{ inc $field_password with $field=$lpassword }}{{ endinc }}
{{ inc field_input.tpl with $field=$lname }}{{ endinc }}
{{ inc field_password.tpl with $field=$lpassword }}{{ endinc }}
</div>
{{ if $openid }}
<div id="login_openid">
{{ inc $field_openid with $field=$lopenid }}{{ endinc }}
{{ inc field_openid.tpl with $field=$lopenid }}{{ endinc }}
</div>
{{ endif }}

View file

@ -5,8 +5,8 @@
{{ for $mails as $mail_item }}
<div id="tread-wrapper-$mail_item.id" class="tread-wrapper">
{{ inc $mail_conv with $mail=$mail_item }}{{endinc}}
{{ inc mail_conv.tpl with $mail=$mail_item }}{{endinc}}
</div>
{{ endfor }}
{{ inc $prv_message with $reply=$reply_info }}{{ endinc }}
{{ inc prv_message.tpl with $reply=$reply_info }}{{ endinc }}

View file

@ -48,7 +48,7 @@
{{ if $homepage }}<dl class="homepage"><dt class="homepage-label">$homepage</dt><dd class="homepage-url"><a href="$profile.homepage" target="external-link">$profile.homepage</a></dd></dl>{{ endif }}
{{ inc $diaspora_vcard with $diaspora=$diaspora_info }}{{ endinc }}
{{ inc diaspora_vcard.tpl with $diaspora=$diaspora_info }}{{ endinc }}
<div id="profile-extra-links">
<ul>

View file

@ -656,21 +656,16 @@ if ($color=="dark") $color_path = "/diabook-dark/";
set_pconfig(local_user(), 'diabook', 'close_lastlikes', $_POST['diabook_close_lastlikes']);
}
}
$close = t('Settings');
$aside['$close'] = $close;
//get_baseurl
$url = $a->get_baseurl($ssl_state);
$aside['$url'] = $url;
$close = t('Settings');
$aside['$close'] = $close;
//get_baseurl
$url = $a->get_baseurl($ssl_state);
$aside['$url'] = $url;
//print right_aside
$tpl = get_markup_template('communityhome.tpl');
$includes = array(
'$field_select' => 'field_select.tpl',
'$field_input' => 'field_input.tpl',
);
$includes = set_template_includes($a->theme['template_engine'], $includes);
$a->page['right_aside'] = replace_macros($tpl, $includes + $aside);
$a->page['right_aside'] = replace_macros($tpl, $aside);
}

View file

@ -1,33 +1,33 @@
{{inc $field_select with $field=$color}}{{endinc}}
{{inc field_select.tpl with $field=$color}}{{endinc}}
{{inc $field_select with $field=$font_size}}{{endinc}}
{{inc field_select.tpl with $field=$font_size}}{{endinc}}
{{inc $field_select with $field=$line_height}}{{endinc}}
{{inc field_select.tpl with $field=$line_height}}{{endinc}}
{{inc $field_select with $field=$resolution}}{{endinc}}
{{inc field_select.tpl with $field=$resolution}}{{endinc}}
<div class="settings-submit-wrapper">
<input type="submit" value="$submit" class="settings-submit" name="diabook-settings-submit" />
</div>
<br>
<h3>Show/hide boxes at right-hand column</h3>
{{inc $field_select with $field=$close_pages}}{{endinc}}
{{inc $field_select with $field=$close_profiles}}{{endinc}}
{{inc $field_select with $field=$close_helpers}}{{endinc}}
{{inc $field_select with $field=$close_services}}{{endinc}}
{{inc $field_select with $field=$close_friends}}{{endinc}}
{{inc $field_select with $field=$close_lastusers}}{{endinc}}
{{inc $field_select with $field=$close_lastphotos}}{{endinc}}
{{inc $field_select with $field=$close_lastlikes}}{{endinc}}
{{inc $field_select with $field=$close_twitter}}{{endinc}}
{{inc $field_input with $field=$TSearchTerm}}{{endinc}}
{{inc $field_select with $field=$close_mapquery}}{{endinc}}
{{inc field_select.tpl with $field=$close_pages}}{{endinc}}
{{inc field_select.tpl with $field=$close_profiles}}{{endinc}}
{{inc field_select.tpl with $field=$close_helpers}}{{endinc}}
{{inc field_select.tpl with $field=$close_services}}{{endinc}}
{{inc field_select.tpl with $field=$close_friends}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastusers}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastphotos}}{{endinc}}
{{inc field_select.tpl with $field=$close_lastlikes}}{{endinc}}
{{inc field_select.tpl with $field=$close_twitter}}{{endinc}}
{{inc field_input.tpl with $field=$TSearchTerm}}{{endinc}}
{{inc field_select.tpl with $field=$close_mapquery}}{{endinc}}
{{inc $field_input with $field=$ELPosX}}{{endinc}}
{{inc field_input.tpl with $field=$ELPosX}}{{endinc}}
{{inc $field_input with $field=$ELPosY}}{{endinc}}
{{inc field_input.tpl with $field=$ELPosY}}{{endinc}}
{{inc $field_input with $field=$ELZoom}}{{endinc}}
{{inc field_input.tpl with $field=$ELZoom}}{{endinc}}
<div class="settings-submit-wrapper">
<input type="submit" value="$submit" class="settings-submit" name="diabook-settings-submit" />