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

@ -1,3 +0,0 @@
{{ inc field_input.tpl with $field=$tmsserver }}{{ endinc }}
{{ inc field_input.tpl with $field=$zoom }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div>

View file

@ -58,7 +58,8 @@ function openstreetmap_location($a, &$item) {
function openstreetmap_plugin_admin (&$a, &$o) {
$t = file_get_contents( dirname(__file__)."/admin.tpl");
# $t = file_get_contents( dirname(__file__)."/admin.tpl");
$t = get_markup_template( "admin.tpl", "addon/openstreetmap/" );
$tmsserver = get_config('openstreetmap','tmsserver');
if(! $tmsserver)
$tmsserver = 'http://openstreetmap.org';
@ -66,7 +67,12 @@ function openstreetmap_plugin_admin (&$a, &$o) {
if(! $zoom)
$zoom = 17;
$o = replace_macros( $t, array(
$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'),
'$tmsserver' => array('tmsserver', t('Tile Server URL'), $tmsserver, t('A list of <a href="http://wiki.openstreetmap.org/wiki/TMS" target="_blank">public tile servers</a>')),
'$zoom' => array('zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest)')),

View file

@ -0,0 +1,3 @@
{{ inc $field_input with $field=$tmsserver }}{{ endinc }}
{{ inc $field_input with $field=$zoom }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div>

View file

@ -0,0 +1,3 @@
{{include file="file:{{$field_input}}" field=$tmsserver}}
{{include file="file:{{$field_input}}" field=$zoom}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>