Use folder namespace for grouping in client-side treelist
This commit is contained in:
parent
857078428b
commit
b415c512f0
8 changed files with 28 additions and 21 deletions
|
@ -138,7 +138,7 @@ class database_driver extends calendar_driver
|
|||
'color' => $prefs['color'],
|
||||
'showalarms' => (bool)$this->rc->config->get('calendar_birthdays_alarm_type'),
|
||||
'active' => !in_array($id, $hidden),
|
||||
'class_name' => 'birthdays',
|
||||
'group' => 'birthdays',
|
||||
'readonly' => true,
|
||||
'default' => false,
|
||||
'children' => false,
|
||||
|
|
|
@ -149,7 +149,8 @@ class kolab_driver extends calendar_driver
|
|||
'owner' => $cal->get_owner(),
|
||||
'virtual' => false,
|
||||
'readonly' => true,
|
||||
'class_name' => 'user',
|
||||
'group' => 'other',
|
||||
'class' => 'user',
|
||||
);
|
||||
}
|
||||
else if ($cal->virtual) {
|
||||
|
@ -160,6 +161,8 @@ class kolab_driver extends calendar_driver
|
|||
'editname' => $cal->get_foldername(),
|
||||
'virtual' => true,
|
||||
'readonly' => true,
|
||||
'group' => $cal->get_namespace(),
|
||||
'class' => 'folder',
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
@ -171,7 +174,7 @@ class kolab_driver extends calendar_driver
|
|||
'color' => $cal->get_color(),
|
||||
'readonly' => $cal->readonly,
|
||||
'showalarms' => $cal->alarms,
|
||||
'class_name' => $cal->get_namespace(),
|
||||
'group' => $cal->get_namespace(),
|
||||
'default' => $cal->default,
|
||||
'active' => $cal->is_active(),
|
||||
'owner' => $cal->get_owner(),
|
||||
|
@ -198,7 +201,7 @@ class kolab_driver extends calendar_driver
|
|||
'color' => $prefs[$id]['color'],
|
||||
'active' => $prefs[$id]['active'],
|
||||
'showalarms' => (bool)$this->rc->config->get('calendar_birthdays_alarm_type'),
|
||||
'class_name' => 'birthdays',
|
||||
'group' => 'birthdays',
|
||||
'readonly' => true,
|
||||
'default' => false,
|
||||
'children' => false,
|
||||
|
|
|
@ -56,6 +56,7 @@ class kolab_user_calendar extends kolab_calendar
|
|||
$this->id = kolab_storage::folder_id($this->userdata['kolabtargetfolder'], true);
|
||||
$this->imap_folder = $this->userdata['kolabtargetfolder'];
|
||||
$this->name = $this->storage->get_name();
|
||||
$this->parent = ''; // user calendars are top level
|
||||
|
||||
// user-specific alarms settings win
|
||||
$prefs = $this->cal->rc->config->get('kolab_calendars', array());
|
||||
|
@ -94,7 +95,7 @@ class kolab_user_calendar extends kolab_calendar
|
|||
*/
|
||||
public function get_namespace()
|
||||
{
|
||||
return 'user';
|
||||
return 'other user';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ class calendar_ui
|
|||
if ($attrib['activeonly'] && !$prop['active'])
|
||||
continue;
|
||||
|
||||
$html .= html::tag('li', array('id' => 'rcmlical' . $id),
|
||||
$html .= html::tag('li', array('id' => 'rcmlical' . $id, 'class' => $prop['group']),
|
||||
$content = $this->calendar_list_item($id, $prop, $jsenv)
|
||||
);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ class calendar_ui
|
|||
if (strlen($content)) {
|
||||
$out .= html::tag('li', array(
|
||||
'id' => 'rcmlical' . rcube_utils::html_identifier($id),
|
||||
'class' => $prop['virtual'] ? 'virtual' : '',
|
||||
'class' => $prop['group'] . ($prop['virtual'] ? ' virtual' : ''),
|
||||
),
|
||||
$content);
|
||||
}
|
||||
|
@ -287,23 +287,23 @@ class calendar_ui
|
|||
$jsenv[$id] = $prop;
|
||||
}
|
||||
|
||||
$class = 'calendar cal-' . asciiwords($id, true);
|
||||
$classes = array('calendar', 'cal-' . asciiwords($id, true));
|
||||
$title = $prop['name'] != $prop['listname'] || strlen($prop['name']) > 25 ?
|
||||
html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : '';
|
||||
$is_collapsed = false; // TODO: determine this somehow?
|
||||
|
||||
if ($prop['virtual'])
|
||||
$class = 'folder virtual';
|
||||
$classes[] = 'virtual';
|
||||
else if ($prop['readonly'])
|
||||
$class .= ' readonly';
|
||||
$classes[] = 'readonly';
|
||||
if ($prop['subscribed'])
|
||||
$class .= ' subscribed';
|
||||
if ($prop['class_name'])
|
||||
$class .= ' '.$prop['class_name'];
|
||||
$classes[] = ' subscribed';
|
||||
if ($prop['class'])
|
||||
$classes[] = $prop['class'];
|
||||
|
||||
$content = '';
|
||||
if (!$attrib['activeonly'] || $prop['active']) {
|
||||
$content = html::div($class,
|
||||
$content = html::div(join(' ', $classes),
|
||||
html::span(array('class' => 'calname', 'title' => $title), $prop['editname'] ? Q($prop['editname']) : $prop['listname']) .
|
||||
($prop['virtual'] ? '' :
|
||||
html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active']), '') .
|
||||
|
|
|
@ -86,8 +86,9 @@ $labels['nmonthsback'] = '$nr months back';
|
|||
$labels['showurl'] = 'Show calendar URL';
|
||||
$labels['showurldescription'] = 'Use the following address to access (read only) your calendar from other applications. You can copy and paste this into any calendar software that supports the iCal format.';
|
||||
$labels['caldavurldescription'] = 'Copy this address to a <a href="http://en.wikipedia.org/wiki/CalDAV" target="_blank">CalDAV</a> client application (e.g. Evolution or Mozilla Thunderbird) to fully synchronize this specific calendar with your computer or mobile device.';
|
||||
$labels['findcalendars'] = 'Find calendars...';
|
||||
$labels['calsearchresults'] = 'Available Calendars';
|
||||
$labels['calendarsubscribe'] = 'Listed permanently';
|
||||
$labels['calendarsubscribe'] = 'List permanently';
|
||||
|
||||
// agenda view
|
||||
$labels['listrange'] = 'Range to display:';
|
||||
|
|
|
@ -293,7 +293,7 @@ pre {
|
|||
background-position: right -20px;
|
||||
}
|
||||
|
||||
#calendars .treelist div.user span.calname {
|
||||
#calendars .treelist li.user > div > span.calname {
|
||||
background-position: right -38px;
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<h2 class="boxtitle"><roundcube:label name="calendar.calendars" /></h2>
|
||||
<div class="listsearchbox">
|
||||
<div class="searchbox">
|
||||
<input type="text" name="q" id="calendarlistsearch" />
|
||||
<input type="text" name="q" id="calendarlistsearch" placeholder="<roundcube:label name='calendar.findcalendars' />" />
|
||||
<a class="iconbutton searchicon"></a>
|
||||
<roundcube:button command="reset-listsearch" id="calendarlistsearch-reset" class="iconbutton reset" title="resetsearch" content="x" />
|
||||
</div>
|
||||
|
|
|
@ -49,10 +49,12 @@ function kolab_folderlist(node, p)
|
|||
.html(p.search_title ? '<h2 class="boxtitle">' + p.search_title + '</h2>' : '')
|
||||
.insertAfter(me.container);
|
||||
|
||||
search_results_widget = new rcube_treelist_widget('<ul class="treelist listing"></ul>', {
|
||||
search_results_widget = new rcube_treelist_widget('<ul>', {
|
||||
id_prefix: p.id_prefix,
|
||||
selectable: false
|
||||
});
|
||||
// copy classes from main list
|
||||
search_results_widget.container.addClass(me.container.attr('class'));
|
||||
|
||||
// register click handler on search result's checkboxes to select the given item for listing
|
||||
search_results_widget.container
|
||||
|
@ -94,7 +96,7 @@ function kolab_folderlist(node, p)
|
|||
search_results[prop.id] = prop;
|
||||
search_results_widget.insert({
|
||||
id: prop.id,
|
||||
classes: prop.class_name ? String(prop.class_name).split(' ') : [],
|
||||
classes: [ prop.group || '' ],
|
||||
html: item,
|
||||
collapsed: true
|
||||
}, prop.parent);
|
||||
|
@ -142,10 +144,10 @@ function kolab_folderlist(node, p)
|
|||
// move this result item to the main list widget
|
||||
me.insert({
|
||||
id: id,
|
||||
classes: [],
|
||||
classes: [ prop.group || '' ],
|
||||
virtual: prop.virtual,
|
||||
html: dom_node,
|
||||
}, parent_id, parent_id ? true : false);
|
||||
}, parent_id, prop.group);
|
||||
}
|
||||
|
||||
delete prop.html;
|
||||
|
|
Loading…
Add table
Reference in a new issue