Beispiel #1
0
 /**
  * List categories
  *
  * @param array $overwriteDemand
  * @return void
  */
 public function listAction(array $overwriteDemand = NULL)
 {
     $demand = $this->createDemandObjectFromSettings($this->settings);
     if ($this->settings['disableOverrideDemand'] != 1 && $overwriteDemand !== NULL) {
         $demand = $this->overwriteDemandObject($demand, $overwriteDemand);
     }
     $idList = explode(',', $this->settings['categories']);
     $assignedValues = array('categories' => $this->categoryRepository->findTree($idList), 'overwriteDemand' => $overwriteDemand, 'demand' => $demand);
     $this->emitActionSignal('CategoryController', self::SIGNAL_CATEGORY_LIST_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
 }
Beispiel #2
0
 /**
  * List categories
  *
  * @param array $overwriteDemand
  * @return void
  */
 public function listAction(array $overwriteDemand = null)
 {
     $demand = $this->createDemandObjectFromSettings($this->settings);
     $demand->setActionAndClass(__METHOD__, __CLASS__);
     if ($this->settings['disableOverrideDemand'] != 1 && $overwriteDemand !== null) {
         $demand = $this->overwriteDemandObject($demand, $overwriteDemand);
     }
     $idList = explode(',', $this->settings['categories']);
     $startingPoint = null;
     if (!empty($this->settings['startingpoint'])) {
         $startingPoint = $this->settings['startingpoint'];
     }
     $assignedValues = ['categories' => $this->categoryRepository->findTree($idList, $startingPoint), 'overwriteDemand' => $overwriteDemand, 'demand' => $demand];
     $assignedValues = $this->emitActionSignal('CategoryController', self::SIGNAL_CATEGORY_LIST_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
 }
 /**
  * Main action for administration
  *
  * @param \GeorgRinger\News\Domain\Model\Dto\AdministrationDemand $demand
  * @dontvalidate  $demand
  * @return void
  */
 public function indexAction(\GeorgRinger\News\Domain\Model\Dto\AdministrationDemand $demand = null)
 {
     $this->redirectToPageOnStart();
     if (is_null($demand)) {
         $demand = $this->objectManager->get(\GeorgRinger\News\Domain\Model\Dto\AdministrationDemand::class);
         // 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) {
                 ObjectAccess::setProperty($demand, $propertyName, $propertyValue);
             }
         }
         $this->view->assign('hideForm', true);
     }
     $demand = $this->createDemandObject($demand);
     $demand->setActionAndClass(__METHOD__, __CLASS__);
     $categories = $this->categoryRepository->findParentCategoriesByPid($this->pageUid);
     $idList = [];
     foreach ($categories as $c) {
         $idList[] = $c->getUid();
     }
     if (empty($idList) && !$this->getBackendUser()->isAdmin()) {
         $idList = $this->getBackendUser()->getCategoryMountPoints();
     }
     $newsItems = $this->newsRepository->findDemanded($demand, false);
     $assignedValues = ['moduleToken' => $this->getToken(true), 'page' => $this->pageUid, 'demand' => $demand, 'news' => $newsItems, 'showSearchForm' => !is_null($demand) || count($newsItems) > 0, 'categories' => $this->categoryRepository->findTree($idList), 'dateformat' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']];
     $assignedValues = $this->emitActionSignal('AdministrationController', self::SIGNAL_ADMINISTRATION_INDEX_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
 }
Beispiel #4
0
 /**
  * Main action for administration
  *
  * @param \GeorgRinger\News\Domain\Model\Dto\AdministrationDemand $demand
  * @dontvalidate  $demand
  * @return void
  */
 public function indexAction(\GeorgRinger\News\Domain\Model\Dto\AdministrationDemand $demand = NULL)
 {
     $this->redirectToPageOnStart();
     if (is_null($demand)) {
         $demand = $this->objectManager->get('GeorgRinger\\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);
 }