Exemplo n.º 1
0
 /**
  * @return array
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
  */
 public function getDetail()
 {
     $arguments = $this->getRequestArguments();
     $id = $arguments['id'];
     $assignments = [];
     if ($this->settings['paging']['detailPagePaging'] && array_key_exists('underlyingQuery', $arguments)) {
         // If underlying query has been sent, fetch more data to enable paging arrows.
         $underlyingQueryInfo = $arguments['underlyingQuery'];
         $index = FrontendUtility::getIndexes($underlyingQueryInfo);
         foreach ($arguments['underlyingQuery'] as $key => $value) {
             $arguments[$key] = $value;
         }
         $this->createQueryForArguments($arguments);
         $this->query->setStart($index['previousIndex']);
         $this->query->setRows($index['nextIndex'] - $index['previousIndex'] + 1);
         $assignments = $this->getRecordsWithUnderlyingQuery($assignments, $index, $id, $arguments);
     } else {
         // Without underlying query information, just get the record specified.
         $assignments = $this->getTheRecordSpecified($id, $assignments);
     }
     return $assignments;
 }
Exemplo n.º 2
0
 /**
  * Single Item View action.
  */
 public function detailAction()
 {
     $arguments = $this->searchProvider->getRequestArguments();
     if (array_key_exists('id', $arguments) && !empty($arguments['id'])) {
         $detail = $this->searchProvider->getDetail();
         if ($this->request->hasArgument('underlyingQuery')) {
             $underlyingQueryInfo = $this->request->getArgument('underlyingQuery');
             $this->response->addAdditionalHeaderData(FrontendUtility::addQueryInformationAsJavaScript($underlyingQueryInfo['q'], (int) $underlyingQueryInfo['position'], $arguments, $this->settings));
         }
         $this->addStandardAssignments();
         $this->view->assignMultiple($detail);
         $this->view->assign('arguments', $arguments);
     } else {
         // id argument missing or empty
         LoggerUtility::logError('find: Non-empty argument »id« is required for action »detail«.', ['arguments' => $arguments]);
         $this->forward('index');
     }
 }