BaseEventTypeController::actionView PHP Method

actionView() public method

View the event specified by $id.
public actionView ( $id )
$id
    public function actionView($id)
    {
        $this->setOpenElementsFromCurrentEvent('view');
        // Decide whether to display the 'edit' button in the template
        if ($this->editable) {
            $this->editable = $this->checkEditAccess();
        }
        $this->logActivity('viewed event');
        $this->event->audit('event', 'view');
        $this->event_tabs = array(array('label' => 'View', 'active' => true));
        if ($this->editable) {
            $this->event_tabs[] = array('label' => 'Edit', 'href' => Yii::app()->createUrl($this->event->eventType->class_name . '/default/update/' . $this->event->id));
        }
        if ($this->checkDeleteAccess()) {
            $this->event_actions = array(EventAction::link('Delete', Yii::app()->createUrl($this->event->eventType->class_name . '/default/delete/' . $this->event->id), array('level' => 'delete')));
        } elseif ($this->checkRequestDeleteAccess()) {
            $this->event_actions = array(EventAction::link('Delete', Yii::app()->createUrl($this->event->eventType->class_name . '/default/requestDeletion/' . $this->event->id), array('level' => 'delete')));
        }
        $viewData = array_merge(array('elements' => $this->open_elements, 'eventId' => $id), $this->extraViewProperties);
        $this->jsVars['OE_event_last_modified'] = strtotime($this->event->last_modified_date);
        $this->render('view', $viewData);
    }

Usage Example

Esempio n. 1
0
 public function actionView($id)
 {
     $this->extraViewProperties['print'] = Yii::app()->session['printConsent'];
     unset(Yii::app()->session['printConsent']);
     parent::actionView($id);
 }
All Usage Examples Of BaseEventTypeController::actionView
BaseEventTypeController