/**
  * Main action for administration
  *
  * @param Tx_News_Domain_Model_Dto_AdministrationDemand $demand
  * @dontvalidate  $demand
  * @return void
  */
 public function indexAction(Tx_News_Domain_Model_Dto_AdministrationDemand $demand = NULL)
 {
     if (is_null($demand)) {
         $demand = $this->objectManager->get('Tx_News_Domain_Model_Dto_AdministrationDemand');
         // Preselect by TsConfig (e.g. tx_news.module.preselect.topNewsRestriction = 1)
         $tsConfig = t3lib_BEfunc::getPagesTSconfig($this->pageUid);
         if (isset($tsConfig['tx_news.']['module.']['preselect.']) && is_array($tsConfig['tx_news.']['module.']['preselect.'])) {
             unset($tsConfig['tx_news.']['module.']['preselect.']['orderByAllowed']);
             foreach ($tsConfig['tx_news.']['module.']['preselect.'] as $propertyName => $propertyValue) {
                 Tx_Extbase_Reflection_ObjectAccess::setProperty($demand, $propertyName, $propertyValue);
             }
         }
     }
     $demand = $this->createDemandObjectFromSettings($demand);
     $categories = $this->categoryRepository->findParentCategoriesByPid($this->pageUid);
     $idList = array();
     foreach ($categories as $c) {
         $idList[] = $c->getUid();
     }
     $this->view->assignMultiple(array('page' => $this->pageUid, 'demand' => $demand, 'news' => $this->newsRepository->findDemanded($demand, FALSE), 'categories' => $this->categoryRepository->findTree($idList), 'dateformat' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']));
 }
 /**
  * Main action for administration
  *
  * @param Tx_News_Domain_Model_Dto_AdministrationDemand $demand
  * @dontvalidate  $demand
  * @return void
  */
 public function indexAction(Tx_News_Domain_Model_Dto_AdministrationDemand $demand = NULL)
 {
     $this->redirectToPageOnStart();
     if (is_null($demand)) {
         $demand = $this->objectManager->get('Tx_News_Domain_Model_Dto_AdministrationDemand');
         // Preselect by TsConfig (e.g. tx_news.module.preselect.topNewsRestriction = 1)
         if (isset($this->tsConfiguration['preselect.']) && is_array($this->tsConfiguration['preselect.'])) {
             unset($this->tsConfiguration['preselect.']['orderByAllowed']);
             foreach ($this->tsConfiguration['preselect.'] as $propertyName => $propertyValue) {
                 \TYPO3\CMS\Extbase\Reflection\ObjectAccess::setProperty($demand, $propertyName, $propertyValue);
             }
         }
     }
     $demand = $this->createDemandObjectFromSettings($demand);
     $categories = $this->categoryRepository->findParentCategoriesByPid($this->pageUid);
     $idList = array();
     foreach ($categories as $c) {
         $idList[] = $c->getUid();
     }
     $assignedValues = array('moduleToken' => $this->getToken(TRUE), 'page' => $this->pageUid, 'demand' => $demand, 'news' => $this->newsRepository->findDemanded($demand, FALSE), 'categories' => $this->categoryRepository->findTree($idList), 'dateformat' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
     $this->emitActionSignal('AdministrationController', self::SIGNAL_ADMINISTRATION_INDEX_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
 }