Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_tags/lib/kolab_tags_engine.php
Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | class kolab_tags_engine | ||||
} | } | ||||
/** | /** | ||||
* Template object building tags list/cloud | * Template object building tags list/cloud | ||||
*/ | */ | ||||
public function taglist($attrib) | public function taglist($attrib) | ||||
{ | { | ||||
$taglist = $this->backend->list_tags(); | $taglist = $this->backend->list_tags(); | ||||
// Performance: Save the list for later | |||||
if ($this->rc->action == 'show' || $this->rc->action == 'preview') { | |||||
$this->taglist = $taglist; | |||||
} | |||||
$taglist = array_map(array($this, 'parse_tag'), $taglist); | $taglist = array_map(array($this, 'parse_tag'), $taglist); | ||||
$this->rc->output->set_env('tags', $taglist); | $this->rc->output->set_env('tags', $taglist); | ||||
$this->rc->output->add_gui_object('taglist', $attrib['id']); | $this->rc->output->add_gui_object('taglist', $attrib['id']); | ||||
return html::tag('ul', $attrib, '', html::$common_attrib); | return html::tag('ul', $attrib, '', html::$common_attrib); | ||||
} | } | ||||
Show All 35 Lines | public function messages_list_handler($args) | ||||
return $args; | return $args; | ||||
} | } | ||||
/** | /** | ||||
* Handler for a single message (add tag-boxes in subject line) | * Handler for a single message (add tag-boxes in subject line) | ||||
*/ | */ | ||||
public function message_headers_handler($args) | public function message_headers_handler($args) | ||||
{ | { | ||||
$taglist = $this->backend->list_tags(); | $taglist = $this->taglist ?: $this->backend->list_tags(); | ||||
$uid = $args['uid']; | $uid = $args['uid']; | ||||
$folder = $args['folder']; | $folder = $args['folder']; | ||||
$tags = array(); | $tags = array(); | ||||
foreach ($taglist as $tag) { | foreach ($taglist as $tag) { | ||||
$tag = $this->parse_tag($tag, true); | $tag = $this->parse_tag($tag, true); | ||||
if (in_array($uid, (array)$tag['uids'][$folder])) { | if (in_array($uid, (array)$tag['uids'][$folder])) { | ||||
unset($tag['uids']); | unset($tag['uids']); | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |