[TYPO3-project-seminars] Hintergrundfarbe für Seminare je nach Belegung
Michael Knoll
mimi at kaktusteam.de
Fri Feb 9 02:25:14 CET 2007
I was too fast again. The function getVacanciesClasses() returns not
only the classes but also a surrounding class="..."
So I had to do a little string-replace to get this things deleted.
if ($this->seminar->isOk()) {
$rowClass = array();
$oddEvenClass = ($rowCounter % 2) ? 'listrow-odd' : '';
if ($oddEvenClass != '') { $rowClass[] = $oddEvenClass; }
$vacanciesClass = $this->getVacanciesClasses($this->seminar);
$vacanciesClass = str_replace('class="', '', $vacanciesClass);
$vacanciesClass = str_replace('"', '', $vacanciesClass);
if ($vacanciesClass != '') { $rowClass[] = $vacanciesClass; }
$canceledClass = ($this->seminar->isCanceled()) ?
$this->pi_getClassName('canceled') : '';
if ($canceledClass != '') { $rowClass[] = $canceledClass; }
// Only use the class construct if we actually have a class.
$rowClass = trim( implode(' ', $rowClass) );
if ($rowClass != '' ) { $completeClass = ' style="'. $rowClass .'"'; }
perhaps this helps you...
good night
michael
Oliver Klee schrieb:
> Hi,
>
> Michael Knoll schrieb:
>> does this mean, that only if there are only one or two places left, the
>> table row can be styled?
>
> Currently, the table *row* can not be styled depending on the number of
> vacancies. That's what the bug/feature report is about
>
>> Can I set the number of vacancies when the
>> classes are set? If there are more than 3 vacancies, is there no class
>> that is set?
>
> The class for the "vacancies" table *cell* is set for any number of
> vacancies:
>
> tx-seminars-pi1-vacancies-2 for 2 vacancies
> tx-seminars-pi1-vacancies-12 for 12 vacancies
> tx-seminars-pi1-vacancies-999 for 999 vacancies
>
> etc.
>
>
> Oliver
More information about the TYPO3-project-seminars
mailing list