/** * 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); }
/** * Creates an HTML link to the registration or login page. * * @param tx_oelib_templatehelper $plugin the pi1 object with configuration data * @param tx_seminars_seminar $event the seminar to create the registration link for * * @return string the HTML tag, will be empty if the event needs no registration, nobody can register to this event or the * currently logged in user is already registered to this event and the event does not allow multiple * registrations by one user */ public function getRegistrationLink(tx_oelib_templatehelper $plugin, tx_seminars_seminar $event) { if (!$event->needsRegistration() || !$this->canRegisterIfLoggedIn($event)) { return ''; } return $this->getLinkToRegistrationOrLoginPage($plugin, $event); }