summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-24 14:21:14 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-24 14:21:14 +0200
commit71a522f103a41b2f38f5d96ab476384efe3002e8 (patch)
treeac29d78305921f3c3f500641b051968834153b7a /program/steps/addressbook/func.inc
parent36a10247c0b05d518f4c2c8f7bf74e3181ea5050 (diff)
Separate list of saved searched from addressbooks list
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r--program/steps/addressbook/func.inc43
1 files changed, 28 insertions, 15 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 8955488bd..f09deeb10 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -112,7 +112,7 @@ if ($undo = $_SESSION['contact_undo']) {
// 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',
@@ -251,6 +251,26 @@ function rcmail_directory_list($attrib)
$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',
@@ -263,26 +283,19 @@ function rcmail_directory_list($attrib)
$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);
}