Horde_Date_Recurrence::getRecurType PHP Method

getRecurType() public method

Returns recurrence type of this event.
public getRecurType ( ) : integer
return integer A RECUR_* constant.
    public function getRecurType()
    {
        return $this->recurType;
    }

Usage Example

Exemplo n.º 1
0
 public function getLink($datetime = null, $icons = true, $from_url = null, $full = false, $encoded = true)
 {
     global $prefs;
     if (is_null($datetime)) {
         $datetime = $this->start;
     }
     if (is_null($from_url)) {
         $from_url = Horde::selfUrl(true, false, true);
     }
     $event_title = $this->getTitle();
     $view_url = $this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full, $encoded);
     $read_permission = $this->hasPermission(Horde_Perms::READ);
     $link = '<span' . $this->getCSSColors() . '>';
     if ($read_permission && $view_url) {
         $link .= Horde::linkTooltip($view_url, $event_title, $this->getStatusClass(), '', '', $this->getTooltip(), '', array('style' => $this->getCSSColors(false)));
     }
     $link .= htmlspecialchars($event_title);
     if ($read_permission && $view_url) {
         $link .= '</a>';
     }
     if ($icons && $prefs->getValue('show_icons')) {
         $icon_color = $this->_foregroundColor == '#000' ? '000' : 'fff';
         $status = '';
         if ($this->alarm) {
             if ($this->alarm % 10080 == 0) {
                 $alarm_value = $this->alarm / 10080;
                 $title = sprintf(ngettext("Alarm %d week before", "Alarm %d weeks before", $alarm_value), $alarm_value);
             } elseif ($this->alarm % 1440 == 0) {
                 $alarm_value = $this->alarm / 1440;
                 $title = sprintf(ngettext("Alarm %d day before", "Alarm %d days before", $alarm_value), $alarm_value);
             } elseif ($this->alarm % 60 == 0) {
                 $alarm_value = $this->alarm / 60;
                 $title = sprintf(ngettext("Alarm %d hour before", "Alarm %d hours before", $alarm_value), $alarm_value);
             } else {
                 $alarm_value = $this->alarm;
                 $title = sprintf(ngettext("Alarm %d minute before", "Alarm %d minutes before", $alarm_value), $alarm_value);
             }
             $status .= Horde::fullSrcImg('alarm-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconAlarm')));
         }
         if ($this->recurs()) {
             $title = Kronolith::recurToString($this->recurrence->getRecurType());
             $status .= Horde::fullSrcImg('recur-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconRecur')));
         } elseif ($this->baseid) {
             $title = _("Exception");
             $status .= Horde::fullSrcImg('exception-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconRecur')));
         }
         if ($this->private) {
             $title = _("Private event");
             $status .= Horde::fullSrcImg('private-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconPrivate')));
         }
         if (!empty($this->attendees)) {
             $status .= Horde::fullSrcImg('attendees-' . $icon_color . '.png', array('attr' => array('alt' => _("Meeting"), 'title' => _("Meeting"), 'class' => 'iconPeople')));
         }
         $space = ' ';
         if (!empty($this->icon)) {
             $link = $status . '<img class="kronolithEventIcon" src="' . $this->icon . '" /> ' . $link;
         } elseif (!empty($status)) {
             $link .= ' ' . $status;
             $space = '';
         }
         if ((!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) && Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) {
             $url = $this->getEditUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full);
             if ($url) {
                 $link .= $space . $url->link(array('title' => sprintf(_("Edit %s"), $event_title), 'class' => 'iconEdit')) . Horde::fullSrcImg('edit-' . $icon_color . '.png', array('attr' => array('alt' => _("Edit")))) . '</a>';
                 $space = '';
             }
         }
         if ($this->hasPermission(Horde_Perms::DELETE)) {
             $url = $this->getDeleteUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full);
             if ($url) {
                 $link .= $space . $url->link(array('title' => sprintf(_("Delete %s"), $event_title), 'class' => 'iconDelete')) . Horde::fullSrcImg('delete-' . $icon_color . '.png', array('attr' => array('alt' => _("Delete")))) . '</a>';
             }
         }
     }
     return $link . '</span>';
 }
All Usage Examples Of Horde_Date_Recurrence::getRecurType