Index: /trunk/include/template.class.php =================================================================== --- /trunk/include/template.class.php (revision 23262) +++ /trunk/include/template.class.php (revision 23263) @@ -22,4 +22,5 @@ // +-----------------------------------------------------------------------+ +define('BUTTONS_RANK_NEUTRAL', 50); class Template { @@ -862,10 +863,10 @@ } - function add_picture_button($content, $rank) + function add_picture_button($content, $rank=BUTTONS_RANK_NEUTRAL) { $this->picture_buttons[$rank][] = $content; } - function add_index_button($content, $rank) + function add_index_button($content, $rank=BUTTONS_RANK_NEUTRAL) { $this->index_buttons[$rank][] = $content; @@ -877,7 +878,10 @@ { ksort($this->picture_buttons); - foreach ($this->picture_buttons as $ranked) - foreach ($ranked as $content) - $this->concat('PLUGIN_PICTURE_ACTIONS', $content); + $this->assign('PLUGIN_PICTURE_BUTTONS', + array_reduce( + $this->picture_buttons, + create_function('$v,$w', 'return array_merge($v, $w);'), + array() + )); } } @@ -888,7 +892,10 @@ { ksort($this->index_buttons); - foreach ($this->index_buttons as $ranked) - foreach ($ranked as $content) - $this->concat('PLUGIN_INDEX_ACTIONS', $content); + $this->assign('PLUGIN_INDEX_BUTTONS', + array_reduce( + $this->index_buttons, + create_function('$v,$w', 'return array_merge($v, $w);'), + array() + )); } } Index: /trunk/themes/default/template/index.tpl =================================================================== --- /trunk/themes/default/template/index.tpl (revision 23262) +++ /trunk/themes/default/template/index.tpl (revision 23263) @@ -112,4 +112,5 @@ {/strip} {/if} +{foreach from=$PLUGIN_INDEX_BUTTONS item=button}