Changeset 23263
- Timestamp:
- Jun 16, 2013, 7:15:24 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r23184 r23263 22 22 // +-----------------------------------------------------------------------+ 23 23 24 define('BUTTONS_RANK_NEUTRAL', 50); 24 25 25 26 class Template { … … 862 863 } 863 864 864 function add_picture_button($content, $rank )865 function add_picture_button($content, $rank=BUTTONS_RANK_NEUTRAL) 865 866 { 866 867 $this->picture_buttons[$rank][] = $content; 867 868 } 868 869 869 function add_index_button($content, $rank )870 function add_index_button($content, $rank=BUTTONS_RANK_NEUTRAL) 870 871 { 871 872 $this->index_buttons[$rank][] = $content; … … 877 878 { 878 879 ksort($this->picture_buttons); 879 foreach ($this->picture_buttons as $ranked) 880 foreach ($ranked as $content) 881 $this->concat('PLUGIN_PICTURE_ACTIONS', $content); 880 $this->assign('PLUGIN_PICTURE_BUTTONS', 881 array_reduce( 882 $this->picture_buttons, 883 create_function('$v,$w', 'return array_merge($v, $w);'), 884 array() 885 )); 882 886 } 883 887 } … … 888 892 { 889 893 ksort($this->index_buttons); 890 foreach ($this->index_buttons as $ranked) 891 foreach ($ranked as $content) 892 $this->concat('PLUGIN_INDEX_ACTIONS', $content); 894 $this->assign('PLUGIN_INDEX_BUTTONS', 895 array_reduce( 896 $this->index_buttons, 897 create_function('$v,$w', 'return array_merge($v, $w);'), 898 array() 899 )); 893 900 } 894 901 } -
trunk/themes/default/template/index.tpl
r20982 r23263 112 112 </a>{/strip}</li> 113 113 {/if} 114 {foreach from=$PLUGIN_INDEX_BUTTONS item=button}<li>{$button}</li>{/foreach} 114 115 {if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if} 115 116 </ul> -
trunk/themes/default/template/picture.tpl
r21176 r23263 77 77 </a> 78 78 {/if}{/strip} 79 {foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach} 79 80 {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if} 80 81 {strip}{if isset($favorite)}
Note: See TracChangeset
for help on using the changeset viewer.