Separate list of saved searched from addressbooks list
| | |
| | | this.command('list'); |
| | | } |
| | | |
| | | if (this.gui_objects.savedsearchlist) { |
| | | this.savedsearchlist = new rcube_treelist_widget(this.gui_objects.savedsearchlist, { |
| | | id_prefix: 'rcmli', |
| | | id_encode: this.html_identifier_encode, |
| | | id_decode: this.html_identifier_decode |
| | | }); |
| | | |
| | | this.savedsearchlist.addEventListener('select', function(node) { |
| | | ref.triggerEvent('selectfolder', { folder:node.id, prefix:'rcmli' }); }); |
| | | } |
| | | |
| | | this.set_page_buttons(); |
| | | |
| | | if (this.env.cid) { |
| | |
| | | // init treelist widget |
| | | if (this.gui_objects.folderlist && window.rcube_treelist_widget) { |
| | | this.treelist = new rcube_treelist_widget(this.gui_objects.folderlist, { |
| | | selectable: true, |
| | | id_prefix: 'rcmli', |
| | | id_encode: this.html_identifier_encode, |
| | | id_decode: this.html_identifier_decode, |
| | |
| | | $(this.gui_objects.addresslist_title).html(this.get_label('contacts')); |
| | | } |
| | | |
| | | if (!this.env.search_id) |
| | | this.select_folder(folder, '', true); |
| | | |
| | | // load contacts remotely |
| | |
| | | |
| | | // find list (UL) element |
| | | if (type == 'contactsearch') |
| | | ul = this.gui_objects.folderlist; |
| | | ul = this.gui_objects.savedsearchlist; |
| | | else |
| | | ul = $('ul.groups', this.get_folder_li(this.env.source,'',true)); |
| | | |
| | |
| | | .html(prop.name); |
| | | |
| | | this.env.contactfolders[key] = this.env.contactgroups[key] = prop; |
| | | this.treelist.insert({ id:key, html:link, classes:['contactgroup'] }, prop.source, true); |
| | | this.treelist.insert({ id:key, html:link, classes:['contactgroup'] }, prop.source, 'contactgroup'); |
| | | |
| | | this.triggerEvent('group_insert', { id:prop.id, source:prop.source, name:prop.name, li:this.treelist.get_item(key) }); |
| | | }; |
| | |
| | | .html(name), |
| | | prop = { name:name, id:id }; |
| | | |
| | | this.treelist.insert({ id:key, html:link, classes:['contactsearch'] }, null, 'contactsearch'); |
| | | this.savedsearchlist.insert({ id:key, html:link, classes:['contactsearch'] }, null, 'contactsearch'); |
| | | this.select_folder(key,'',true); |
| | | this.enable_command('search-delete', true); |
| | | this.env.search_id = id; |
| | |
| | | this.remove_search_item = function(id) |
| | | { |
| | | var li, key = 'S'+id; |
| | | if (this.treelist.remove(key)) { |
| | | if (this.savedsearchlist.remove(key)) { |
| | | this.triggerEvent('search_delete', { id:id, li:li }); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | this.reset_qsearch(); |
| | | |
| | | if (this.savedsearchlist) { |
| | | this.treelist.select(''); |
| | | this.savedsearchlist.select('S'+id); |
| | | } |
| | | else |
| | | this.select_folder('S'+id, '', true); |
| | | |
| | | // reset vars |
| | |
| | | // mark a mailbox as selected and set environment variable |
| | | this.select_folder = function(name, prefix, encode) |
| | | { |
| | | if (this.savedsearchlist) { |
| | | this.savedsearchlist.select(''); |
| | | } |
| | | |
| | | if (this.treelist) { |
| | | this.treelist.select(name); |
| | | } |
| | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |
| | | 'directorylist' => 'rcmail_directory_list', |
| | | // 'groupslist' => 'rcmail_contact_groups', |
| | | 'savedsearchlist' => 'rcmail_savedsearch_list', |
| | | 'addresslist' => 'rcmail_contacts_list', |
| | | 'addresslisttitle' => 'rcmail_contacts_list_title', |
| | | 'addressframe' => 'rcmail_contact_frame', |
| | |
| | | $out .= '</li>'; |
| | | } |
| | | |
| | | $OUTPUT->set_env('contactgroups', $jsdata); |
| | | $OUTPUT->set_env('collapsed_abooks', (string)$RCMAIL->config->get('collapsed_abooks','')); |
| | | $OUTPUT->add_gui_object('folderlist', $attrib['id']); |
| | | $OUTPUT->include_script('treelist.js'); |
| | | |
| | | // add some labels to client |
| | | $OUTPUT->add_label('deletegroupconfirm', 'groupdeleting', 'addingmember', 'removingmember'); |
| | | |
| | | return html::tag('ul', $attrib, $out, html::$common_attrib); |
| | | } |
| | | |
| | | |
| | | function rcmail_savedsearch_list($attrib) |
| | | { |
| | | global $RCMAIL, $OUTPUT; |
| | | |
| | | if (!$attrib['id']) |
| | | $attrib['id'] = 'rcmsavedsearchlist'; |
| | | |
| | | $out = ''; |
| | | $line_templ = html::tag('li', array( |
| | | 'id' => 'rcmli%s', 'class' => '%s'), |
| | | html::a(array('href' => '#', 'rel' => 'S%s', |
| | |
| | | $js_id = rcube::JQ($id); |
| | | |
| | | // set class name(s) |
| | | $class_name = 'contactsearch'; |
| | | if ($current === $id) |
| | | $class_name .= ' selected'; |
| | | if ($source['class_name']) |
| | | $class_name .= ' ' . $source['class_name']; |
| | | $classes = array('contactsearch'); |
| | | if (!empty($source['class_name'])) |
| | | $classes[] = $source['class_name']; |
| | | |
| | | $out .= sprintf($line_templ, |
| | | rcube_utils::html_identifier('S'.$id, true), |
| | | $class_name, |
| | | join(' ', $classes), |
| | | $id, |
| | | $js_id, (!empty($source['name']) ? rcube::Q($source['name']) : rcube::Q($id))); |
| | | $js_id, (!empty($source['name']) ? rcube::Q($source['name']) : rcube::Q($id)) |
| | | ); |
| | | } |
| | | |
| | | $OUTPUT->set_env('contactgroups', $jsdata); |
| | | $OUTPUT->set_env('collapsed_abooks', (string)$RCMAIL->config->get('collapsed_abooks','')); |
| | | $OUTPUT->add_gui_object('folderlist', $attrib['id']); |
| | | $OUTPUT->include_script('treelist.js'); |
| | | |
| | | // add some labels to client |
| | | $OUTPUT->add_label('deletegroupconfirm', 'groupdeleting', 'addingmember', 'removingmember'); |
| | | $OUTPUT->add_gui_object('savedsearchlist', $attrib['id']); |
| | | |
| | | return html::tag('ul', $attrib, $out, html::$common_attrib); |
| | | } |
| | |
| | | width: 280px; |
| | | } |
| | | |
| | | #directorylist li a |
| | | #directorylist li a, |
| | | #savedsearchlist li a |
| | | { |
| | | cursor: default; |
| | | display: block; |
| | |
| | | background-position: 22px -143px; |
| | | } |
| | | |
| | | #directorylist li.contactsearch a |
| | | #savedsearchlist li.contactsearch a |
| | | { |
| | | background-position: 6px -162px; |
| | | } |
| | |
| | | <div id="directorylist-title" class="boxtitle"><roundcube:label name="groups" /></div> |
| | | <div id="directorylist-content" class="boxlistcontent"> |
| | | <roundcube:object name="directorylist" id="directorylist" class="treelist" /> |
| | | <roundcube:object name="savedsearchlist" id="savedsearchlist" class="treelist" /> |
| | | </div> |
| | | <div id="directorylist-footer" class="boxfooter"> |
| | | <roundcube:button command="group-create" type="link" title="newgroup" class="buttonPas addgroup" classAct="button addgroup" content=" " /> |
| | |
| | | } |
| | | |
| | | #directorylist li a, |
| | | .treelist li.contactsearch a, |
| | | #contacts-table .contact td.name { |
| | | background-image: url(images/listicons.png); |
| | | background-position: -100px 0; |
| | |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | #directorylist li.virtual { |
| | | background-image: none !important; |
| | | } |
| | | |
| | | #directorylist li.virtual > a { |
| | | color: #aaa; |
| | | background-image: none; |
| | | height: 16px; |
| | | padding-top: 3px; |
| | | padding-bottom: 3px; |
| | | } |
| | | |
| | | #directorylist li.virtual > .treetoggle { |
| | | top: 6px !important; |
| | | } |
| | | |
| | | #directorylist ul li.virtual > .treetoggle { |
| | | } |
| | | |
| | | #directorylist li.addressbook a { |
| | | background-position: 6px -766px; |
| | | } |
| | | |
| | | #directorylist ul li.addressbook a { |
| | | background-position: 32px -766px; |
| | | } |
| | | |
| | | #directorylist ul ul li.addressbook a { |
| | | background-position: 58px -766px; |
| | | } |
| | | |
| | | #directorylist li.addressbook.selected > a { |
| | | background-color: transparent; |
| | | background-position: 6px -791px; |
| | | } |
| | | |
| | | #directorylist li.addressbook ul.groups li { |
| | | width: 100%; |
| | | #directorylist ul li.addressbook.selected > a { |
| | | background-position: 32px -791px; |
| | | } |
| | | |
| | | #directorylist ul ul li.addressbook.selected > a { |
| | | background-position: 58px -791px; |
| | | } |
| | | |
| | | #directorylist li.contactgroup a { |
| | | background-position: 32px -1555px; |
| | | } |
| | | |
| | | #directorylist ul ul li.contactgroup a { |
| | | background-position: 58px -1555px; |
| | | } |
| | | |
| | | #directorylist ul ul ul li.contactgroup a { |
| | | background-position: 84px -1555px; |
| | | } |
| | | |
| | | #directorylist li.contactgroup.selected a { |
| | | background-position: 32px -1579px; |
| | | } |
| | | |
| | | #directorylist ul ul li.contactgroup.selected a { |
| | | background-position: 58px -1579px; |
| | | } |
| | | |
| | | #directorylist ul ul ul li.contactgroup.selected a { |
| | | background-position: 84px -1579px; |
| | | } |
| | | |
| | | #directorylist li.contactgroup input { |
| | | margin-left: 36px; |
| | | } |
| | | |
| | | #directorylist li.contactsearch a { |
| | | .treelist li.contactsearch a { |
| | | background-position: 6px -1651px; |
| | | } |
| | | |
| | | #directorylist li.contactsearch.selected a { |
| | | .treelist li.contactsearch.selected a { |
| | | background-position: 6px -1675px; |
| | | } |
| | | |
| | | #directorylist li.contactsearch input { |
| | | .treelist li.contactsearch input { |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | #directorylist li.addressbook div.collapsed, |
| | | #directorylist li.addressbook div.expanded { |
| | | top: 15px; |
| | | left: 20px; |
| | | } |
| | | |
| | | #contacts-table .contact.readonly td { |
| | |
| | | padding-left: 36px; |
| | | } |
| | | |
| | | ul.treelist.iconized li ul li a { |
| | | ul.treelist.iconized ul li a { |
| | | padding-left: 62px; |
| | | } |
| | | |
| | | ul.treelist.iconized ul ul li a { |
| | | padding-left: 88px; |
| | | } |
| | | |
| | | ul.treelist.iconized ul ul ul li a { |
| | | padding-left: 114px; |
| | | } |
| | | |
| | | ul.treelist li div.treetoggle { |
| | |
| | | left: 19px; |
| | | } |
| | | |
| | | ul.treelist.iconized li ul li div.treetoggle { |
| | | left: 35px; |
| | | ul.treelist.iconized ul li div.treetoggle { |
| | | left: 45px; |
| | | } |
| | | |
| | | ul.treelist.iconized ul ul li div.treetoggle { |
| | | left: 71px; |
| | | } |
| | | |
| | | ul.treelist li div.treetoggle.expanded { |
| | |
| | | <h2 id="directorylist-header" class="boxtitle"><roundcube:label name="groups" /></h2> |
| | | <div id="directorylist-content" class="scroller withfooter"> |
| | | <roundcube:object name="directorylist" id="directorylist" class="treelist listing iconized" /> |
| | | <h3 class="boxtitle voice"><roundcube:label name="savedsearches" /></h3> |
| | | <roundcube:object name="savedsearchlist" id="savedsearchlist" class="treelist listing iconized" /> |
| | | </div> |
| | | <div id="directorylist-footer" class="boxfooter"> |
| | | <roundcube:button command="group-create" type="link" title="newgroup" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" label="addgroup" /><roundcube:button name="groupoptions" id="groupoptionslink" type="link" title="moreactions" class="listbutton groupactions" onclick="return UI.toggle_popup('groupoptions',event)" innerClass="inner" label="arialabelabookgroupoptions" aria-haspopup="true" aria-expanded="false" aria-owns="groupoptionsmenu" /> |