Skip to content

Commit

Permalink
Add general configuration check to the list view
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Lochmüller authored and Tim Lochmüller committed Oct 26, 2015
1 parent d5fde49 commit f875aa4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Classes/Controller/CalendarController.php
Expand Up @@ -10,6 +10,7 @@
use HDNET\Calendarize\Domain\Model\Index;
use HDNET\Calendarize\Register;
use HDNET\Calendarize\Utility\DateTimeUtility;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
Expand Down Expand Up @@ -139,6 +140,8 @@ public function listAction(
$this->forward('detail');
}

$this->checkConfiguration();

$searchMode = false;
if ($startDate || $endDate || $customSearch) {
$searchMode = true;
Expand Down Expand Up @@ -325,4 +328,15 @@ protected function getCurrentConfigurations()
return $return;
}

/**
* Check the configuration
*/
protected function checkConfiguration()
{
if (!isset($this->settings['dateFormat'])) {
$this->addFlashMessage('Basic configuration settings are missing. It seems, that the Static Extension TypoScript is not loaded to your TypoScript configuration. Please add the calendarize TS to your TS settings.',
'Configuration Error', FlashMessage::ERROR);
}
}

}
2 changes: 2 additions & 0 deletions Resources/Private/Templates/Calendar/List.html
Expand Up @@ -2,6 +2,8 @@

<f:section name="Main">

<f:flashMessages />

<f:render partial="List" arguments="{settings: settings, indices: indices}" />

</f:section>

0 comments on commit f875aa4

Please sign in to comment.