aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/calendar_base.class.php40
-rw-r--r--plugins/AMenuManager/menu_templates/menubar_links.tpl2
-rw-r--r--plugins/test_menu/menu_templates/menubar_identification.tpl6
-rw-r--r--plugins/test_menu/menubar.inc.php2
-rw-r--r--template/yoga/calendar_navbar.tpl13
5 files changed, 41 insertions, 22 deletions
diff --git a/include/calendar_base.class.php b/include/calendar_base.class.php
index bd3d2b180..96eeb19b1 100644
--- a/include/calendar_base.class.php
+++ b/include/calendar_base.class.php
@@ -137,9 +137,9 @@ class CalendarBase
$class_prefix, $show_any,
$show_empty=false, $labels=null)
{
- global $conf, $page;
+ global $conf, $page, $template;
- $nav_bar = '';
+ $nav_bar_datas=array();
if ($conf['calendar_show_empty'] and $show_empty and !empty($labels) )
{
@@ -162,42 +162,48 @@ class CalendarBase
}
if ($nb_images==-1)
{
- $nav_bar .= '<span class="'.$class_prefix.'Empty">';
- $nav_bar .= $label;
+ $tmp_datas=array(
+ 'classname' => $class_prefix."Empty",
+ 'label'=> $label
+ );
}
else
{
- $nav_bar .= '<span class="'.$class_prefix.'">';
$url = duplicate_index_url(
array('chronology_date'=>array_merge($date_components,array($item))),
array( 'start' )
);
- $nav_bar .= '<a href="'.$url.'">';
- $nav_bar .= $label;
- $nav_bar .= '</a>';
+ $tmp_datas=array(
+ 'classname' => $class_prefix,
+ 'label'=> $label,
+ 'url' => $url
+ );
}
if ($nb_images > 0)
{
- $nav_bar .= '('.$nb_images.')';
+ $tmp_datas['nb_images']=$nb_images;
}
- $nav_bar.= '</span>';
+ $nav_bar_datas[]=$tmp_datas;
+
}
if ($conf['calendar_show_any'] and $show_any and count($items)>1 and
count($date_components)<count($this->calendar_levels)-1 )
{
- $label = l10n('calendar_any');
- $nav_bar .= '<span class="'.$class_prefix.'">';
$url = duplicate_index_url(
array('chronology_date'=>array_merge($date_components,array('any'))),
array( 'start' )
);
- $nav_bar .= '<a href="'.$url.'">';
- $nav_bar .= $label;
- $nav_bar .= '</a>';
- $nav_bar.= '</span>';
+ $nav_bar_datas[]=array(
+ 'label' => l10n('calendar_any'),
+ 'classname' => $class_prefix,
+ 'url' => $url
+ );
}
- return $nav_bar;
+
+ $template->set_filenames( array( 'nav_bar' => 'calendar_navbar.tpl',));
+ $template->assign('datas', $nav_bar_datas);
+ return($template->parse('nav_bar', true));
}
/**
diff --git a/plugins/AMenuManager/menu_templates/menubar_links.tpl b/plugins/AMenuManager/menu_templates/menubar_links.tpl
index 7d9360c5a..927a0f2cd 100644
--- a/plugins/AMenuManager/menu_templates/menubar_links.tpl
+++ b/plugins/AMenuManager/menu_templates/menubar_links.tpl
@@ -4,7 +4,7 @@
<dt>{$section.NAME|@translate}</dt>
{/if}
<dd>
- <ul>
+ <ul {if $section.ITEMS.icons=='y'}style="padding-left:4px;list-style:none;"{/if}>
{foreach from=$section.ITEMS.LINKS item=link}
<li>
{if $section.ITEMS.icons=='y'}<img src='{$link.icon}' style="position:relative;top:3px;"/>{/if}
diff --git a/plugins/test_menu/menu_templates/menubar_identification.tpl b/plugins/test_menu/menu_templates/menubar_identification.tpl
index a09f12425..c0c3891fe 100644
--- a/plugins/test_menu/menu_templates/menubar_identification.tpl
+++ b/plugins/test_menu/menu_templates/menubar_identification.tpl
@@ -35,18 +35,18 @@
<label>
{'Username'|@translate}
- <input type="text" name="username" size="15" value="">
+ <input type="text" name="username" size="15" value="" id="iusername">
</label>
<label>
{'Password'|@translate}
- <input type="password" name="password" size="15">
+ <input type="password" name="password" size="15" id="ipassword">
</label>
{if $section.ITEMS.AUTHORIZE_REMEMBERING}
<label>
{'remember_me'|@translate}
- <input type="checkbox" name="remember_me" value="1">
+ <input type="checkbox" name="remember_me" value="1" id="iremember_me">
</label>
{/if}
<p>
diff --git a/plugins/test_menu/menubar.inc.php b/plugins/test_menu/menubar.inc.php
index 5a504ce6d..45da0dc13 100644
--- a/plugins/test_menu/menubar.inc.php
+++ b/plugins/test_menu/menubar.inc.php
@@ -286,7 +286,7 @@ $datas['menu']['Notification']=array(
-$section = new Section('mbLinks', 'links', MENU_TEMPLATES_PATH.'menubar_links.tpl');
+$section = new Section('mbLinks', 'Links', MENU_TEMPLATES_PATH.'menubar_links.tpl');
$section->set_items($datas['links']);
$menu->add($section->get());
diff --git a/template/yoga/calendar_navbar.tpl b/template/yoga/calendar_navbar.tpl
new file mode 100644
index 000000000..8e35c766b
--- /dev/null
+++ b/template/yoga/calendar_navbar.tpl
@@ -0,0 +1,13 @@
+
+{foreach from=$datas item=data}
+ <span class="{$data.classname}">
+ {if isset($data.url) and $data.url!=""}
+ <a href="{$data.url}">{$data.label}</a>
+ {else}
+ {$data.label}
+ {/if}
+ {if isset($data.nb_images) and $data.nb_images!=""}
+ ({$data.nb_images})
+ {/if}
+ </span>
+{/foreach} \ No newline at end of file