diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 4e40eced7d..f8630b686b 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -29,14 +29,8 @@ class addressbook_hooks if ($location == 'sidebox_menu') { // Magic etemplate2 favorites menu (from nextmatch widget) - display_sidebox($appname,lang('Favorites'),array( - array( - 'no_lang' => true, - 'text'=> egw_framework::favorite_list('addressbook','addressbook.addressbook_ui.get_rows'), - 'link'=>false, - 'icon' => false - ) - )); + display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list('addressbook')); + $file = array( 'Add' => "javascript:egw_openWindowCentered2('". egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.edit'),false). diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index c43e8e0976..10248404ce 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -567,15 +567,7 @@ class calendar_ui { $link_vars = array(); // Magic etemplate2 favorites menu (from nextmatch widget) - display_sidebox('calendar',lang('Favorites'),array( - 'menuOpened' => true, // menu open by default - array( - 'no_lang' => true, - 'text'=> egw_framework::favorite_list('calendar',false), - 'link'=>false, - 'icon' => false - ) - )); + display_sidebox('calendar', lang('Favorites'), egw_framework::favorite_list('calendar')); $file = array('menuOpened' => true); // menu open by default $n = 0; // index for file-array diff --git a/etemplate/js/et2_widget_favorites.js b/etemplate/js/et2_widget_favorites.js index 6e8123fcb4..e406cab104 100644 --- a/etemplate/js/et2_widget_favorites.js +++ b/etemplate/js/et2_widget_favorites.js @@ -135,11 +135,10 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader], // Update sidebox, if there if(self.sidebox_target.length) { - self.sidebox_target.find(".ui-icon-heart") - .replaceWith(""); - $j("li[data-id='"+self.preferred+"'] img",self.sidebox_target) + self.sidebox_target.find("div.ui-icon-heart") + .replaceWith("
"); + $j("li[data-id='"+self.preferred+"'] div.sideboxstar",self.sidebox_target) .replaceWith(""); - } // Close the menu @@ -221,7 +220,6 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader], options[name] = ""+ (filters[name].name != undefined ? filters[name].name : name) + - (filters[name].group != false ? " ♦" :"") + (filters[name].group != false && !this.is_admin || name == 'blank' ? "" : ""); } @@ -307,7 +305,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader], } if(filter_name == 'add') return false; - + app[this.options.app].setState(this.stored_filters[filter_name]); return false; }, diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index 6ec20cb069..4b87167ac3 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -34,14 +34,8 @@ class filemanager_hooks static function sidebox_menu($args) { // Magic etemplate2 favorites menu (from nextmatch widget) - display_sidebox(self::$appname,lang('Favorites'),array( - array( - 'no_lang' => true, - 'text'=> egw_framework::favorite_list(self::$appname,'filemanager.filemanager_ui.get_rows'), - 'link'=>false, - 'icon' => false - ) - )); + display_sidebox(self::$appname, lang('Favorites'), egw_framework::favorite_list(self::$appname)); + $location = is_array($args) ? $args['location'] : $args; $rootpath = '/'; $basepath = '/home'; diff --git a/infolog/inc/class.infolog_hooks.inc.php b/infolog/inc/class.infolog_hooks.inc.php index 93b769c826..548c8d573a 100644 --- a/infolog/inc/class.infolog_hooks.inc.php +++ b/infolog/inc/class.infolog_hooks.inc.php @@ -93,14 +93,8 @@ class infolog_hooks if ($location == 'sidebox_menu') { // Magic etemplate2 favorites menu (from nextmatch widget) - display_sidebox($appname,lang('Favorites'),array( - array( - 'no_lang' => true, - 'text'=> egw_framework::favorite_list($appname,'infolog.infolog_ui.get_rows'), - 'link'=>false, - 'icon' => false - ) - )); + display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list($appname)); + $file = array( 'infolog list' => egw::link('/index.php',array( 'menuaction' => 'infolog.infolog_ui.index', diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index aa2ba93250..5ff2d0356f 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -1907,15 +1907,17 @@ abstract class egw_framework * get the favorite list when a nextmatch is _not_ on the page. If * a nextmatch is on the page, it will update / replace this list. * - * @param $app String Current application, needed to find preferences - * @param $default String Preference name for default favorite + * @param string $app application, needed to find preferences + * @param string $default=null preference name for default favorite, default "nextmatch-$app.index.rows-favorite" * - * @return String HTML fragment for the list + * @return array with a single sidebox menu item (array) containing html for favorites */ - public static function favorite_list($app, $default) + public static function favorite_list($app, $default=null) { if(!$app) return ''; + if (!$default) $default = "nextmatch-$app.index.rows-favorite"; + // This target is used client-side to find & enable adding new favorites $target = 'favorite_sidebox_'.$app; $pref_prefix = 'favorite_'; @@ -1960,7 +1962,7 @@ abstract class egw_framework $html .= "