Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_notes/kolab_notes.php
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | public function startup($args) | ||||
$this->add_hook('message_compose', array($this, 'mail_message_compose')); | $this->add_hook('message_compose', array($this, 'mail_message_compose')); | ||||
if (in_array($args['action'], array('show', 'preview', 'print'))) { | if (in_array($args['action'], array('show', 'preview', 'print'))) { | ||||
$this->add_hook('message_load', array($this, 'mail_message_load')); | $this->add_hook('message_load', array($this, 'mail_message_load')); | ||||
$this->add_hook('template_object_messagebody', array($this, 'mail_messagebody_html')); | $this->add_hook('template_object_messagebody', array($this, 'mail_messagebody_html')); | ||||
} | } | ||||
// add 'Append note' item to message menu | // add 'Append note' item to message menu | ||||
if ($this->api->output->type == 'html' && $_REQUEST['_rel'] != 'note') { | if ($this->api->output->type == 'html' && ($_REQUEST['_rel'] ?? null) != 'note') { | ||||
$this->api->add_content(html::tag('li', array('role' => 'menuitem'), | $this->api->add_content(html::tag('li', array('role' => 'menuitem'), | ||||
$this->api->output->button(array( | $this->api->output->button(array( | ||||
'command' => 'append-kolab-note', | 'command' => 'append-kolab-note', | ||||
'label' => 'kolab_notes.appendnote', | 'label' => 'kolab_notes.appendnote', | ||||
'type' => 'link', | 'type' => 'link', | ||||
'classact' => 'icon appendnote active', | 'classact' => 'icon appendnote active', | ||||
'class' => 'icon appendnote disabled', | 'class' => 'icon appendnote disabled', | ||||
'innerclass' => 'icon note', | 'innerclass' => 'icon note', | ||||
))), | ))), | ||||
'messagemenu'); | 'messagemenu'); | ||||
$this->api->output->add_label('kolab_notes.appendnote', 'kolab_notes.editnote', 'kolab_notes.deletenotesconfirm', 'kolab_notes.entertitle', 'save', 'delete', 'cancel', 'close'); | $this->api->output->add_label('kolab_notes.appendnote', 'kolab_notes.editnote', 'kolab_notes.deletenotesconfirm', 'kolab_notes.entertitle', 'save', 'delete', 'cancel', 'close'); | ||||
$this->include_script('notes_mail.js'); | $this->include_script('notes_mail.js'); | ||||
} | } | ||||
} | } | ||||
if (!$this->rc->output->ajax_call && !$this->rc->output->env['framed']) { | if (!$this->rc->output->ajax_call && !($this->rc->output->env['framed'] ?? null)) { | ||||
$this->load_ui(); | $this->load_ui(); | ||||
} | } | ||||
// get configuration for the Bonnie API | // get configuration for the Bonnie API | ||||
$this->bonnie_api = libkolab::get_bonnie_api(); | $this->bonnie_api = libkolab::get_bonnie_api(); | ||||
// notes use fully encoded identifiers | // notes use fully encoded identifiers | ||||
kolab_storage::$encode_ids = true; | kolab_storage::$encode_ids = true; | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | public function get_lists(&$tree = null) | ||||
'virtual' => true, | 'virtual' => true, | ||||
'editable' => false, | 'editable' => false, | ||||
'rights' => 'l', | 'rights' => 'l', | ||||
'group' => 'other virtual', | 'group' => 'other virtual', | ||||
'class' => 'user', | 'class' => 'user', | ||||
'parent' => $parent_id, | 'parent' => $parent_id, | ||||
); | ); | ||||
} | } | ||||
else if ($folder->virtual) { | else if (!empty($folder->virtual)) { | ||||
$lists[$list_id] = array( | $lists[$list_id] = array( | ||||
'id' => $list_id, | 'id' => $list_id, | ||||
'name' => $fullname, | 'name' => $fullname, | ||||
'listname' => $listname, | 'listname' => $listname, | ||||
'virtual' => true, | 'virtual' => true, | ||||
'editable' => false, | 'editable' => false, | ||||
'rights' => 'l', | 'rights' => 'l', | ||||
'group' => $folder->get_namespace(), | 'group' => $folder->get_namespace(), | ||||
▲ Show 20 Lines • Show All 1,231 Lines • Show Last 20 Lines |