Changeset 23263 for trunk/include
- Timestamp:
- Jun 16, 2013, 7:15:24 PM (11 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.