/** * Returns the time portion of the given UNIX timestamp in the format specified in plugin.tx_seminars.timeFormat. * * @param int $timestamp the UNIX timestamp to convert, must be >= 0 * * @return string the time portion of the UNIX timestamp formatted according to the format in plugin.tx_seminars.timeFormat */ protected function getAsTime($timestamp) { return strftime($this->configuration->getAsString('timeFormat'), $timestamp); }
/** * Sets the page's content type to CSV and the page's content disposition to the given filename. * * Adds the data directly to the page header. * * @param string $csvFileName the name for the page which is used as storage name, must not be empty * * @return void */ private function setPageTypeAndDisposition($csvFileName) { tx_oelib_headerProxyFactory::getInstance()->getHeaderProxy()->addHeader('Content-type: text/csv; header=present; charset=' . $this->configuration->getAsString('charsetForCsv')); tx_oelib_headerProxyFactory::getInstance()->getHeaderProxy()->addHeader('Content-disposition: attachment; filename=' . $csvFileName); }
/** * Reads the language key from a configuration and sets it as current language. * Also sets the alternate language if one is configured. * * The language key is read from the "language" key and the alternate language is read * from the language_alt key. * * @param Tx_Oelib_Configuration $configuration the configuration to read * * @return void */ private function setLanguageKeyFromConfiguration(Tx_Oelib_Configuration $configuration) { if (!$configuration->hasString('language')) { return; } $this->languageKey = $configuration->getAsString('language'); if ($configuration->hasString('language_alt')) { $this->alternativeLanguageKey = $configuration->getAsString('language_alt'); } }
/** * @test */ public function sendRemindersToOrganizersSendsReminderWithMessageWithEventsBeginDate() { $this->addSpeaker($this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_PLANNED))); $this->fixture->sendCancellationDeadlineReminders(); self::assertContains(strftime($this->configuration->getAsString('dateFormatYMD'), $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY), $this->mailer->getFirstSentEmail()->getBody()); }