/** * Sets the markers of a button for canceling an event. The button will only * be visible if * - the current record is either a date or single event record * - the event is not canceled yet * - the event has not started yet * In all other cases the corresponding subpart is hidden. * * @param tx_seminars_seminar $event the event to get the cancel button for * * @return void */ private function setCancelButtonMarkers(tx_seminars_seminar $event) { $this->template->unhideSubpartsArray(array('CANCEL_BUTTON')); $pageData = $this->page->getPageData(); if ($event->getRecordType() != tx_seminars_Model_Event::TYPE_TOPIC && !$event->isHidden() && !$event->isCanceled() && !$event->hasStarted() && $GLOBALS['BE_USER']->check('tables_modify', $this->tableName) && $this->doesUserHaveAccess($event->getPageUid())) { $this->template->setMarker('uid', $event->getUid()); $buttonUrl = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $pageData['uid'])); $this->template->setMarker('cancel_button_url', htmlspecialchars($buttonUrl)); $this->template->setMarker('label_cancel_button', $GLOBALS['LANG']->getLL('eventlist_button_cancel')); } else { $this->template->hideSubpartsArray(array('CANCEL_BUTTON')); } }