/** * */ function calendar_list($attrib = array()) { $li = ''; foreach ($this->cal->get_calendars() as $id => $prop) { $driver = $this->cal->get_driver_by_cal($id); if ($attrib['activeonly'] && !$prop['active']) { continue; } unset($prop['user_id']); $prop['alarms'] = $driver->alarms; $prop['attendees'] = $driver->attendees; $prop['freebusy'] = $driver->freebusy; $prop['attachments'] = $driver->attachments; $prop['undelete'] = $driver->undelete; $prop['feedurl'] = $this->cal->get_url(array('_cal' => $this->cal->ical_feed_hash($id) . '.ics', 'action' => 'feed')); if (!$prop['virtual']) { $jsenv[$id] = $prop; } $html_id = html_identifier($id); $class = 'cal-' . asciiwords($id, true); $title = $prop['name'] != $prop['listname'] ? html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : ''; if ($prop['virtual']) { $class .= ' virtual'; } else { if ($prop['readonly']) { $class .= ' readonly'; } } if ($prop['class_name']) { $class .= ' ' . $prop['class_name']; } $disabled = array(); if (!$prop['unsubscribe']) { $disabled = array('disabled' => 'disabled'); } $li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' => $class), ($prop['virtual'] ? '' : html::tag('input', array_merge($disabled, array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active'])), '') . html::span('handle', ' ')) . html::span(array('class' => 'calname', 'title' => $title), $prop['listname'])); } $this->rc->output->set_env('calendars', $jsenv); $this->rc->output->add_gui_object('folderlist', $attrib['id']); return html::tag('ul', $attrib, $li, html::$common_attrib); }
/** * */ function tasklists($attrib = array()) { $lists = $this->plugin->driver->get_lists(); $li = ''; foreach ((array) $lists as $id => $prop) { if ($attrib['activeonly'] && !$prop['active']) { continue; } unset($prop['user_id']); $prop['alarms'] = $this->plugin->driver->alarms; $prop['undelete'] = $this->plugin->driver->undelete; $prop['sortable'] = $this->plugin->driver->sortable; $prop['attachments'] = $this->plugin->driver->attachments; $jsenv[$id] = $prop; $html_id = html_identifier($id); $class = 'tasks-' . asciiwords($id, true); if (!$prop['editable']) { $class .= ' readonly'; } if ($prop['class_name']) { $class .= ' ' . $prop['class_name']; } $li .= html::tag('li', array('id' => 'rcmlitasklist' . $html_id, 'class' => $class), html::tag('input', array('type' => 'checkbox', 'name' => '_list[]', 'value' => $id, 'checked' => $prop['active'])) . html::span('handle', ' ') . html::span('listname', $prop['name'])); } $this->rc->output->set_env('tasklists', $jsenv); $this->rc->output->add_gui_object('folderlist', $attrib['id']); return html::tag('ul', $attrib, $li, html::$common_attrib); }
/** * Handler for ACL delete action */ private function action_delete() { $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); //UTF7-IMAP $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); $user = explode(',', $user); foreach ($user as $u) { $u = trim($u); if ($this->rc->storage->delete_acl($mbox, $u)) { $this->rc->output->command('acl_remove_row', html_identifier($u)); } else { $error = true; } } if (!$error) { $this->rc->output->show_message('acl.deletesuccess', 'confirmation'); } else { $this->rc->output->show_message('acl.deleteerror', 'error'); } }