summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-09-06 16:35:14 +0000
committeralecpl <alec@alec.pl>2011-09-06 16:35:14 +0000
commitf8e48df71540b268ceac058d32b8ee848fc2ab6b (patch)
treed2e8ea19086014e8a89f761a9444e72d84145164 /program/steps/addressbook/func.inc
parent66df084203a217ab74a416064c459cc3420a648c (diff)
- Merge devel-saved_search branch (Addressbook Saved Searches)
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r--program/steps/addressbook/func.inc29
1 files changed, 28 insertions, 1 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 55d4255aa..b290bbb2d 100644
--- a/program/steps/addressbook/func.inc
+++ b/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',
));