From 526d8006a16bd8b666d94aaf152346537045a0a5 Mon Sep 17 00:00:00 2001 From: grum Date: Thu, 7 Aug 2008 21:52:45 +0000 Subject: updating files for the Menu class (test_menu) + add functionnalities updating files for the AMenuManager plugin + fixes some bugs + add functionnalities updating common classes grum_plugins_classes-2 (needed for the AMenuManager plugin) + add functionalities for google_translator use git-svn-id: http://piwigo.org/svn/trunk@2468 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/test_menu/menu.class.inc.php | 19 ++- plugins/test_menu/menu_templates/menubar.tpl | 165 ---------------------- plugins/test_menu/menu_templates/menubar_menu.tpl | 18 ++- plugins/test_menu/menubar.inc.php | 42 +++++- 4 files changed, 63 insertions(+), 181 deletions(-) delete mode 100644 plugins/test_menu/menu_templates/menubar.tpl (limited to 'plugins/test_menu') diff --git a/plugins/test_menu/menu.class.inc.php b/plugins/test_menu/menu.class.inc.php index d37a8345e..7eece66bd 100644 --- a/plugins/test_menu/menu.class.inc.php +++ b/plugins/test_menu/menu.class.inc.php @@ -1,9 +1,9 @@ registered_file=$registered_path.$this->registered_file; + } $this->load_registered(); } /* public functions */ + public function get_registered_filename() + { + // return filename of file for maintain of registered sections + return($this->registered_file); + } + public function add($section_datas) { // add a section to the menu ; datas can be made with the Section class diff --git a/plugins/test_menu/menu_templates/menubar.tpl b/plugins/test_menu/menu_templates/menubar.tpl deleted file mode 100644 index 0bc538e87..000000000 --- a/plugins/test_menu/menu_templates/menubar.tpl +++ /dev/null @@ -1,165 +0,0 @@ -{* $Id: menubar.tpl 2409 2008-07-01 02:09:21Z rvelices $ *} - - diff --git a/plugins/test_menu/menu_templates/menubar_menu.tpl b/plugins/test_menu/menu_templates/menubar_menu.tpl index 9d42eeea5..7b80881ed 100644 --- a/plugins/test_menu/menu_templates/menubar_menu.tpl +++ b/plugins/test_menu/menu_templates/menubar_menu.tpl @@ -2,16 +2,20 @@
{$section.NAME|@translate}
-
-

- -

-
- + {if isset($section.ITEMS.qsearch) and $section.ITEMS.qsearch=='y'} +
+

+ +

+
+ + {/if}
diff --git a/plugins/test_menu/menubar.inc.php b/plugins/test_menu/menubar.inc.php index 0bcca0a08..5a504ce6d 100644 --- a/plugins/test_menu/menubar.inc.php +++ b/plugins/test_menu/menubar.inc.php @@ -110,7 +110,30 @@ if ('tags' == @$page['section']) //---------------------------------------------------------- special categories -// favorites categories +/* + ** note for usage with Menu class ** + items of Special section are defined with a named key rather than a + numeric key + + Example : + $datas['special']=array( + 'favorite_cat' => array( ... ), + 'most_visited_cat' => array( ... ), + 'best_rated_cat' => array( ... ), + [...] + ); + + This permits to easily find datas and modify content with a callback on the + 'loc_begin_menubar' event. + + Example : + $section_special=$menu->section('mbSpecial'); + unset($section['ITEMS']['favorite_cat']); + $menu->replace($section_special); + + this code permit to remove the items "favorite_cat" from the + section "mbSpecial" +*/ $datas['special']=array(); if ( !is_a_guest() ) { @@ -213,16 +236,25 @@ else //--------------------------------------------------------------- menu summaries +/* + ** note for usage with Menu class ** + items of menu section are defined with a named key rather than a numeric key + + see notes from "sepcial categories" for more informations +*/ $datas['menu']=array(); +//qsearch input zone visible y/n ; if set to 'n' the qsearch zone isn't visible +$datas['menu']['qsearch']='y'; + // tags link -$datas['menu']['tags']=array( +$datas['menu']['Tags']=array( 'TITLE' => l10n('See available tags'), 'NAME' => l10n('Tags'), 'U_SUMMARY'=> get_root_url().'tags.php', ); // search link -$datas['menu']['search']=array( +$datas['menu']['Search']=array( 'TITLE'=>l10n('hint_search'), 'NAME'=>l10n('Search'), 'U_SUMMARY'=> get_root_url().'search.php', @@ -237,14 +269,14 @@ $datas['menu']['comments']=array( ); // about link -$datas['menu']['about']=array( +$datas['menu']['About']=array( 'TITLE' => l10n('about_page_title'), 'NAME' => l10n('About'), 'U_SUMMARY' => get_root_url().'about.php', ); // notification -$datas['menu']['notification']=array( +$datas['menu']['Notification']=array( 'TITLE'=>l10n('RSS feed'), 'NAME'=>l10n('Notification'), 'U_SUMMARY'=> get_root_url().'notification.php', -- cgit v1.2.3