public function getTitle() { if (!$this->_event) { return _("Not Found"); } if (is_string($this->_event)) { return $this->_event; } return sprintf(_("Edit %s"), $this->_event->getTitle()); }
public function getTitle() { if (!$this->_event) { return _("Not Found"); } if (is_string($this->_event)) { return $this->_event; } return $this->_event->getTitle(); }
/** * @param string $tabname * @param Kronolith_Event $event */ public static function eventTabs($tabname, $event) { if (!$event->initialized) { return; } $GLOBALS['page_output']->addScriptFile('views.js'); $tabs = new Horde_Core_Ui_Tabs('event', Horde_Variables::getDefaultVariables()); $date = self::currentDate(); $tabs->preserve('datetime', $date->dateString()); $tabs->addTab(htmlspecialchars($event->getTitle()), $event->getViewUrl(), array('tabname' => 'Event', 'id' => 'tabEvent', 'onclick' => 'return ShowTab(\'Event\');')); /* We check for read permissions, because we can always save a copy if * we can read the event. */ if ((!$event->private || $event->creator == $GLOBALS['registry']->getAuth()) && $event->hasPermission(Horde_Perms::READ) && self::getDefaultCalendar(Horde_Perms::EDIT)) { $tabs->addTab($event->hasPermission(Horde_Perms::EDIT) ? _("_Edit") : _("Save As New"), $event->getEditUrl(), array('tabname' => 'EditEvent', 'id' => 'tabEditEvent', 'onclick' => 'return ShowTab(\'EditEvent\');')); } if ($event->hasPermission(Horde_Perms::DELETE)) { $tabs->addTab(_("De_lete"), $event->getDeleteUrl(array('confirm' => 1)), array('tabname' => 'DeleteEvent', 'id' => 'tabDeleteEvent', 'onclick' => 'return ShowTab(\'DeleteEvent\');')); } $tabs->addTab(_("Export"), $event->getExportUrl(), array('tabname' => 'ExportEvent', 'id' => 'tabExportEvent')); echo $tabs->render($tabname); }