/** * Gets the CSS classes (space-separated) for the Vacancies TD. * * @param tx_seminars_seminar $seminar the current seminar object * * @return string class attribute value filled with a list a space-separated CSS classes */ public function getVacanciesClasses(tx_seminars_seminar $seminar) { if (!$seminar->needsRegistration() || !$seminar->hasDate() && !$this->configGetter->getConfValueBoolean('allowRegistrationForEventsWithoutDate')) { return ''; } $classes = array(); if ($seminar->hasDate() && $seminar->hasStarted()) { $classes[] = 'event-begin-date-over'; } if ($seminar->hasVacancies()) { $classes[] = 'vacancies-available'; if ($seminar->hasUnlimitedVacancies()) { $classes[] = 'vacancies-unlimited'; } else { $classes[] = 'vacancies-' . $seminar->getVacancies(); } } else { $classes[] = 'vacancies-0'; if ($seminar->hasRegistrationQueue()) { $classes[] = 'has-registration-queue'; } } // We add this class in addition to the number of vacancies so that // user stylesheets still can use the number of vacancies even for // events for which the registration deadline is over. if ($seminar->hasDate() && $seminar->isRegistrationDeadlineOver()) { $classes[] = 'registration-deadline-over'; } $prefixedClasses = array_map(array($this, 'pi_getClassName'), $classes); return ' ' . implode(' ', $prefixedClasses); }
/** * Sets the markers of a button for confirming an event. The button will * only be visible if * - the current record is either a date or single event record * - the event is not confirmed 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 confirm button for * * @return void */ private function setConfirmButtonMarkers(tx_seminars_seminar $event) { $this->template->unhideSubpartsArray(array('CONFIRM_BUTTON')); $pageData = $this->page->getPageData(); if ($event->getRecordType() != tx_seminars_Model_Event::TYPE_TOPIC && !$event->isHidden() && !$event->isConfirmed() && !$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('confirm_button_url', htmlspecialchars($buttonUrl)); $this->template->setMarker('label_confirm_button', $GLOBALS['LANG']->getLL('eventlist_button_confirm')); } else { $this->template->hideSubpartsArray(array('CONFIRM_BUTTON')); } }