Kronolith::statusToString PHP Méthode

statusToString() public static méthode

Maps a Kronolith meeting status string to a translated string suitable for display.
public static statusToString ( integer $status ) : string
$status integer The meeting status; one of the Kronolith::STATUS_XXX constants.
Résultat string The translated displayable meeting status string.
    public static function statusToString($status)
    {
        switch ($status) {
            case self::STATUS_CONFIRMED:
                return _("Confirmed");
            case self::STATUS_CANCELLED:
                return _("Cancelled");
            case self::STATUS_FREE:
                return _("Free");
            case self::STATUS_TENTATIVE:
            default:
                return _("Tentative");
        }
    }

Usage Example

Exemple #1
0
 public function html($active = true)
 {
     if (!$this->_event) {
         echo '<h3>' . _("Event not found") . '</h3>';
         exit;
     }
     if (is_string($this->_event)) {
         echo '<h3>' . $this->_event . '</h3>';
         exit;
     }
     global $conf, $prefs;
     $this->_event->loadHistory();
     $creatorId = $this->_event->creator;
     $description = $this->_event->description;
     $location = $this->_event->location;
     $eventurl = $this->_event->url;
     $private = $this->_event->isPrivate();
     $owner = Kronolith::getUserName($creatorId);
     $status = Kronolith::statusToString($this->_event->status);
     $attendees = $this->_event->attendees;
     $resources = $this->_event->getResources();
     if ($datetime = Horde_Util::getFormData('datetime')) {
         $datetime = new Horde_Date($datetime);
         $month = $datetime->month;
         $year = $datetime->year;
     } else {
         $month = (int) Horde_Util::getFormData('month', date('n'));
         $year = (int) Horde_Util::getFormData('year', date('Y'));
     }
     $dateFormat = $prefs->getValue('date_format');
     $timeFormat = $prefs->getValue('twentyFour') ? 'G:i' : 'g:ia';
     // Tags
     $tags = implode(', ', $this->_event->tags);
     echo '<div id="Event"' . ($active ? '' : ' style="display:none"') . '>';
     require KRONOLITH_TEMPLATES . '/view/view.inc';
     echo '</div>';
     if ($active && $GLOBALS['browser']->hasFeature('dom')) {
         /* We check for read permissions, because we can always save a
          * copy if we can read the event. */
         if ($this->_event->hasPermission(Horde_Perms::READ) && Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) {
             $edit = new Kronolith_View_EditEvent($this->_event);
             $edit->html(false);
         }
         if ($this->_event->hasPermission(Horde_Perms::DELETE)) {
             $delete = new Kronolith_View_DeleteEvent($this->_event);
             $delete->html(false);
         }
     }
 }
All Usage Examples Of Kronolith::statusToString