summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-09-06 16:35:14 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-09-06 16:35:14 +0000
commitd44cc4df994ab7f11cb9ac49f8b654860e832ab4 (patch)
treede79b78c9ca6b77829d97c0cf16e2491c139deed /roundcubemail/program/steps/addressbook/func.inc
parent865419e2224bfd654af0a943a43febd4523f8dee (diff)
- Merge devel-saved_search branch (Addressbook Saved Searches)
git-svn-id: https://svn.roundcube.net/trunk@5182 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/addressbook/func.inc')
-rw-r--r--roundcubemail/program/steps/addressbook/func.inc29
1 files changed, 28 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc
index 55d4255aa..b290bbb2d 100644
--- a/roundcubemail/program/steps/addressbook/func.inc
+++ b/roundcubemail/program/steps/addressbook/func.inc
@@ -227,7 +227,32 @@ function rcmail_directory_list($attrib)
$out = $groupdata['out'];
}
- $OUTPUT->set_env('contactgroups', $jsdata);
+ $line_templ = html::tag('li', array(
+ 'id' => 'rcmliS%s', 'class' => '%s'),
+ html::a(array('href' => '#', 'rel' => 'S%s',
+ 'onclick' => "return ".JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s'));
+
+ // Saved searches
+ $sources = $RCMAIL->user->list_searches(rcube_user::SEARCH_ADDRESSBOOK);
+ foreach ($sources as $j => $source) {
+ $id = $source['id'];
+ $js_id = JQ($id);
+
+ // set class name(s)
+ $class_name = 'contactsearch';
+ if ($current === $id)
+ $class_name .= ' selected';
+ if ($source['class_name'])
+ $class_name .= ' ' . $source['class_name'];
+
+ $out .= sprintf($line_templ,
+ html_identifier($id),
+ $class_name,
+ $id,
+ $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id)));
+ }
+
+ $OUTPUT->set_env('contactgroups', $jsdata);
$OUTPUT->add_gui_object('folderlist', $attrib['id']);
// add some labels to client
$OUTPUT->add_label('deletegroupconfirm', 'groupdeleting', 'addingmember', 'removingmember');
@@ -745,4 +770,6 @@ $RCMAIL->register_action_map(array(
'group-delete' => 'groups.inc',
'group-addmembers' => 'groups.inc',
'group-delmembers' => 'groups.inc',
+ 'search-create' => 'search.inc',
+ 'search-delete' => 'search.inc',
));