update addons to support Smarty3

This commit is contained in:
Zach Prezkuta 2012-12-22 13:36:35 -07:00
parent 66334ec5cb
commit 3da6f1471c
62 changed files with 778 additions and 468 deletions

View file

@ -93,8 +93,14 @@ function blackout_plugin_admin(&$a, &$o) {
if (! is_string($myend)) { $myend = "YYYY-MM-DD:hhmm"; }
$myurl = get_config('blackout','url');
if (! is_string($myurl)) { $myurl = "http://www.example.com"; }
$t = file_get_contents( dirname(__file__)."/admin.tpl" );
$o = replace_macros($t, array(
$t = get_markup_template( "admin.tpl", "addon/blackout/" );
$includes = array(
'$field_input' => 'field_input.tpl',
);
$includes = set_template_includes($a->theme['template_engine'], $includes);
$o = replace_macros($t, $includes + array(
'$submit' => t('Submit'),
'$rurl' => array("rurl", "Redirect URL", $myurl, "all your visitors from the web will be redirected to this URL"),
'$startdate' => array("startdate", "Begin of the Blackout<br />(YYYY-MM-DD hh:mm)", $mystart, "format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute"),

View file

@ -1,6 +1,6 @@
{{ inc field_input.tpl with $field=$startdate }}{{ endinc }}
{{ inc field_input.tpl with $field=$enddate }}{{ endinc }}
{{ inc field_input.tpl with $field=$rurl }}{{ endinc }}
{{ inc $field_input with $field=$startdate }}{{ endinc }}
{{ inc $field_input with $field=$enddate }}{{ endinc }}
{{ inc $field_input with $field=$rurl }}{{ endinc }}
<div style="border: 2px solid #f00; padding: 10px; margin:
10px;font-size: 1.2em;"><strong>Note</strong>: The redirect will be active from the moment you

View file

@ -0,0 +1,11 @@
{{include file="file:{{$field_input}}" field=$startdate}}
{{include file="file:{{$field_input}}" field=$enddate}}
{{include file="file:{{$field_input}}" field=$rurl}}
<div style="border: 2px solid #f00; padding: 10px; margin:
10px;font-size: 1.2em;"><strong>Note</strong>: The redirect will be active from the moment you
press the submit button. Users currently logged in will <strong>not</strong> be
thrown out but can't login again after logging out should the blackout is
still in place.</div>
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>