Allow favorites from multiple apps to coexist

This commit is contained in:
Nathan Gray 2013-04-10 08:00:31 +00:00
parent 188ebbaec6
commit 4c54745cbb
4 changed files with 10 additions and 9 deletions

View File

@ -846,7 +846,7 @@ class etemplate_widget_nextmatch extends etemplate_widget
public static function favorite_list($app, $default)
{
if(!$app) return '';
$target = 'favorite_sidebox';
$target = 'favorite_sidebox_'.$app;
$pref_prefix = 'favorite_';
$filters = array(
'blank' => array(
@ -858,7 +858,7 @@ class etemplate_widget_nextmatch extends etemplate_widget
$default_filter = $GLOBALS['egw_info']['user']['preferences'][$app][$default];
if(!$default_filter) $default_filter = "blank";
$html = "<span id='$target' class='ui-helper-clearfix'><ul class='ui-menu ui-widget-content ui-corner-all favorites' role='listbox'>\n";
$html = "<span id='$target' class='ui-helper-clearfix sidebox-favorites'><ul class='ui-menu ui-widget-content ui-corner-all favorites' role='listbox'>\n";
foreach($GLOBALS['egw_info']['user']['preferences'][$app] as $pref_name => $pref)
{
if(strpos($pref_name, $pref_prefix) === 0)

View File

@ -1409,7 +1409,8 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
var widget_options = {
default_pref: "nextmatch-" + this.nextmatch.options.settings.columnselection_pref + "-favorite",
app: list[0],
filters: filters
filters: filters,
sidebox_target:'favorite_sidebox_'+list[0]
};
this.favorites = et2_createWidget('favorites', widget_options, this);

View File

@ -89,7 +89,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],{
if(this.sidebox_target.length == 0 && egw_getFramework() != null)
{
var egw_fw = egw_getFramework();
this.sidebox_target = $j("#favorite_sidebox",egw_fw.sidemenuDiv);
this.sidebox_target = $j("#"+this.options.sidebox_target,egw_fw.sidemenuDiv);
}
var apps = egw().user('apps');

View File

@ -791,25 +791,25 @@ label input, label span, label div, label select, label textarea {
/* TODO: This is template specific */
background-image: url(../../../phpgwapi/templates/idots/images/orange-ball.png);
}
#favorite_sidebox ul {
.sidebox-favorites ul.favorites {
width: 99%;
padding: 0px;
border: none;
background: white;
}
#favorite_sidebox .ui-menu .ui-menu-item a {
.sidebox-favorites ul .ui-menu .ui-menu-item a {
line-height: inherit;
padding: 2px 0px;
}
#favorite_sidebox .ui-menu .ui-menu-item a:hover {
.sidebox-favorites ul .ui-menu .ui-menu-item a:hover {
text-decoration: underline;
}
#favorite_sidebox div.ui-icon-heart{
.sidebox-favorites .favorites div.ui-icon-heart{
float: left;
display:inline-block;
margin: -3px 1px 0px 1px;
}
#favorite_sidebox div.ui-icon-trash{
.sidebox-favorites .favorites div.ui-icon-trash{
margin-top: -3px;
}
.nextmatch_sortheader {