2 namespace TYPO3\CMS\Reports\Controller;
57 if (!isset($vars[
'redirect']) && $vars[
'action'] !==
'index' && !isset($vars[
'extension']) && is_array(
$GLOBALS[
'BE_USER']->uc[
'reports'][
'selection'])) {
58 $previousSelection =
$GLOBALS[
'BE_USER']->uc[
'reports'][
'selection'];
59 if (!empty($previousSelection[
'extension']) && !empty($previousSelection[
'report'])) {
60 $this->
redirect(
'detail',
'Report', null, array(
61 'extension' => $previousSelection[
'extension'],
62 'report' => $previousSelection[
'report'],
81 parent::initializeView($view);
82 $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
95 'reports',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports']
110 $content = ($error =
'');
113 isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension])
114 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension])
115 && isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension][$report])
116 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension][$report])
117 && isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension][$report][
'report'])
119 $reportClass =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension][$report][
'report'];
123 if ($reportClass === null) {
129 $content = $reportInstance->getReport();
132 $error = $reportClass .
' does not implement the Report Interface which is necessary to be displayed here.';
134 $this->view->assignMultiple(array(
135 'content' => $content,
137 'report' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][$extension][$report],
147 $lang->includeLLFile(
'EXT:reports/Resources/Private/Language/locallang.xlf');
148 $menu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
149 $menu->setIdentifier(
'WebFuncJumpMenu');
153 $this->uriBuilder->reset()->uriFor(
'index', null,
'Report')
155 ->setTitle(
$lang->getLL(
'reports_overview'));
156 $menu->addMenuItem($menuItem);
157 $this->shortcutName =
$lang->getLL(
'reports_overview');
158 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'] as $extKey => $reports) {
159 foreach ($reports as $reportName => $report) {
162 ->setHref($this->uriBuilder->reset()->uriFor(
'detail',
163 array(
'extension' => $extKey,
'report' => $reportName),
'Report'))
165 if ($this->arguments->hasArgument(
'extension') && $this->arguments->hasArgument(
'report')) {
166 if ($this->arguments->getArgument(
'extension')->getValue() === $extKey && $this->arguments->getArgument(
'report')->getValue() === $reportName) {
167 $menuItem->setActive(
true);
168 $this->shortcutName = $menuItem->getTitle();
171 $menu->addMenuItem($menuItem);
174 $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
182 $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
183 $moduleName = $this->request->getPluginName();
184 $getVars = $this->request->hasArgument(
'getVars') ? $this->request->getArgument(
'getVars') : [];
185 $setVars = $this->request->hasArgument(
'setVars') ? $this->request->getArgument(
'setVars') : [];
186 if (count($getVars) === 0) {
187 $modulePrefix = strtolower(
'tx_' . $this->request->getControllerExtensionName() .
'_' . $moduleName);
188 $getVars = array(
'id',
'M', $modulePrefix);
190 $shortcutButton = $buttonBar->makeShortcutButton()
191 ->setModuleName($moduleName)
192 ->setGetVariables($getVars)
193 ->setDisplayName($this->shortcutName)
194 ->setSetVariables($setVars);
195 $buttonBar->addButton($shortcutButton);
206 protected function saveState($extension =
'', $report =
'')
208 $GLOBALS[
'BE_USER']->uc[
'reports'][
'selection'] = array(
209 'extension' => $extension,