本文整理汇总了PHP中Kronolith::partToString方法的典型用法代码示例。如果您正苦于以下问题:PHP Kronolith::partToString方法的具体用法?PHP Kronolith::partToString怎么用?PHP Kronolith::partToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kronolith
的用法示例。
在下文中一共展示了Kronolith::partToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param array $config Configuration key-value pairs.
*/
public function __construct($config = array())
{
global $conf, $injector, $registry, $session;
$config['templatePath'] = KRONOLITH_TEMPLATES . '/attendees';
parent::__construct($config);
$this->addHelper('Text');
$this->formInput = Horde_Util::formInput();
$this->view = Horde_Util::getFormData('view', 'Day');
$this->date = $config['start']->dateString();
$this->end = $config['end']->dateString();
$this->freeBusy = $config['fbView']->render($config['start']);
$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create();
if ($auth->hasCapability('list') && ($conf['auth']['list_users'] == 'list' || $conf['auth']['list_users'] == 'both')) {
$this->userList = $auth->listNames();
}
$this->resourcesEnabled = !empty($conf['resources']['enabled']);
if ($registry->hasMethod('contacts/search')) {
$this->addressbookLink = Horde::url('#')->link(array('class' => 'widget', 'onclick' => 'window.open(\'' . Horde::url('contacts.php') . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=270,left=100,top=100\'); return false;')) . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>';
}
$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_Core_Ui_Tabs(null, $vars);
$tabs->addTab(_("Day"), new Horde_Url('javascript:switchView(\'Day\')'), 'Day');
$tabs->addTab(_("Work Week"), new Horde_Url('javascript:switchView(\'Workweek\')'), 'Workweek');
$tabs->addTab(_("Week"), new Horde_Url('javascript:switchView(\'Week\')'), 'Week');
$tabs->addTab(_("Month"), new Horde_Url('javascript:switchView(\'Month\')'), 'Month');
$this->tabs = $tabs->render($this->view);
$attendees = $session->get('kronolith', 'attendees');
if ($attendees) {
$roles = array(Kronolith::PART_REQUIRED, Kronolith::PART_OPTIONAL, Kronolith::PART_NONE);
$responses = array(Kronolith::RESPONSE_ACCEPTED, Kronolith::RESPONSE_DECLINED, Kronolith::RESPONSE_TENTATIVE, Kronolith::RESPONSE_NONE);
$this->attendees = array();
foreach ($attendees as $attendee) {
$viewAttendee = array('id' => $attendee->id, 'name' => strval($attendee), 'deleteLink' => Horde::url('#')->link(array('title' => sprintf(_("Remove %s"), $attendee->displayName), 'onclick' => "performAction('remove', decodeURIComponent('" . rawurlencode($attendee->id) . "')); return false;")) . Horde::img('delete.png') . '</a>');
if ($attendee->user) {
unset($this->userList[$attendee->user]);
} else {
$viewAttendee['editLink'] = Horde::url('#')->link(array('title' => sprintf(_("Edit %s"), $attendee->displayName), 'onclick' => "performAction('edit', decodeURIComponent('" . rawurlencode($attendee->id) . "')); return false;")) . Horde::img('edit.png') . '</a>';
}
foreach ($roles as $role) {
$viewAttendee['roles'][$role] = array('selected' => $attendee->role == $role, 'label' => Kronolith::partToString($role));
}
foreach ($responses as $response) {
$viewAttendee['responses'][$response] = array('selected' => $attendee->response == $response, 'label' => Kronolith::responseToString($response));
}
$this->attendees[] = $viewAttendee;
}
}
$this->resources = $session->get('kronolith', 'resources', Horde_Session::TYPE_ARRAY);
foreach ($this->resources as $id => &$resource) {
$resource['id'] = $id;
$resource['deleteLink'] = Horde::url('#')->link(array('title' => sprintf(_("Remove %s"), $resource['name']), 'onclick' => "performAction('removeResource', decodeURIComponent('" . $id . "')); return false;")) . Horde::img('delete.png') . '</a>';
foreach ($roles as $role) {
$resource['roles'][$role] = array('selected' => $resource['attendance'] == $role, 'label' => Kronolith::partToString($role));
}
foreach ($responses as $response) {
$resource['responses'][$response] = array('selected' => $resource['response'] == $response, 'label' => Kronolith::responseToString($response));
}
}
/* Get list of resources for select list, and remove those we already
* added. */
if ($this->resourcesEnabled) {
$this->allResources = array_diff_key(Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array(), 'name'), $this->resources);
}
}