Hallo,
ich habe gerade mein erstes Contao Projekt und friemel mich gerade in den efg und form rein.
Ich habe nach dem Vorbild des Moduls "countryselect" mein eigenes Select-Modul entwickelt und das funktioniert auch soweit. Einzig in der E-Mail nach dem abschicken wird nichts ausgegeben. Woran kann das liegen bzw. was mache ich falsch?
PHP-Code:
class DynamicSelect2 extends FormSelectMenu
{
public function addAttributes($arrAttributes)
{
$this->import('Database');
$result2 = $this->Database->prepare("SELECT * FROM tl_calendar_events WHERE (published=1 AND recurring=1) ORDER BY PID ASC, TITLE ASC")->execute();
setlocale(LC_TIME, "de_DE.utf8");
$dt_min = new DateTime(); // Edit
$dt_min->modify('+3 day'); // Edit
$dt_max = clone($dt_min);
$dt_max->modify('+6 days');
parent::addAttributes($arrAttributes);
$arrOptions = array(array('label' => ($this->placeholder == '' ? '-' : $this->placeholder), 'value' => '', 'pid' => ''));
while($result2->next())
{
$startTime = strftime("%a %H:%M",$result2->startTime);
$endTime = strftime("%H:%M",$result2->endTime);
$day = strftime("%a",$result2->startTime);
$startTime2 = $dt_min->format('Y-m-d');
$startTime2Time = strtotime($dt_min->format('Y-m-d'));
$startDate = '';
for ($i=0; $i<=7; $i++) {
$endTimeDay = strftime('%a', strtotime("+$i day", $startTime2Time));
$endTime2 = strtotime("+$i day", $startTime2Time);
if ($endTimeDay == $day) {
$startDate = strftime("%d.%m.%Y",$endTime2);
$arrOptions[] = array('label' => $result2->title . ' ' . $startTime . ' - ' . $endTime . ' ' . $startDate, 'value' => $result2->id, 'pid' => $result2->pid);
break;
}
}
}
$this->arrOptions = $arrOptions;
}
}
Vielen Dank schon mal für eine Antwort.
EDIT
Es kommt nur nichts in der EFG E-Mail an. Mmh. Muss man den noch kompatibel dafür machen?
In der normalen E-Mail Ausgabe bekomme ich folgendes:
Kursauswahl: auswahl90
Also immer nur die Values. Ich brauche aber die Title bzw. Label.
Auch doof.
Lesezeichen