TYPO3 CMS  TYPO3_6-2
AbstractController.php
Go to the documentation of this file.
1 <?php
3 
23 
27  protected $extensionName = 'Workspaces';
28 
32  protected $pageRenderer;
33 
37  protected $pageId;
38 
42  protected $template;
43 
49  protected function initializeAction() {
50  // @todo Evaluate how the intval() call can be used with Extbase validators/filters
51  $this->pageId = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
52  $icons = array(
53  'language' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('flags-multiple'),
54  'integrity' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'),
55  'success' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-ok'),
56  'info' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'),
57  'warning' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-warning'),
58  'error' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-error')
59  );
60  $this->pageRenderer->addInlineSetting('Workspaces', 'icons', $icons);
61  $this->pageRenderer->addInlineSetting('Workspaces', 'id', $this->pageId);
62  $this->pageRenderer->addInlineSetting('Workspaces', 'depth', $this->pageId === 0 ? 999 : 1);
63  $this->pageRenderer->addInlineSetting('Workspaces', 'language', $this->getLanguageSelection());
64  $this->pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/StyleSheet/module.css');
65  $this->pageRenderer->addInlineLanguageLabelArray(array(
66  'title' => $GLOBALS['LANG']->getLL('title'),
67  'path' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.path'),
68  'table' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.table'),
69  'depth' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_perm.xlf:Depth'),
70  'depth_0' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
71  'depth_1' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
72  'depth_2' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
73  'depth_3' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
74  'depth_4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'),
75  'depth_infi' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
76  ));
77  $this->pageRenderer->addInlineLanguageLabelFile('EXT:workspaces/Resources/Private/Language/locallang.xlf');
78  $this->assignExtensionSettings();
79  }
80 
86  protected function assignExtensionSettings() {
87  $extension = array(
88  'AdditionalColumn' => array(
89  'Definition' => array(),
90  'Handler' => array(),
91  ),
92  );
93 
94  $extension['AdditionalColumn']['Definition'] = $this->getAdditionalColumnService()->getDefinition();
95  $extension['AdditionalColumn']['Handler'] = $this->getAdditionalColumnService()->getHandler();
96  $this->pageRenderer->addInlineSetting('Workspaces', 'extension', $extension);
97  }
98 
107  public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) {
108  $this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
109  $this->pageRenderer = $this->template->getPageRenderer();
110  $GLOBALS['SOBE'] = new \stdClass();
111  $GLOBALS['SOBE']->doc = $this->template;
112  parent::processRequest($request, $response);
113  $pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:module.title'));
114  $pageEnd = $this->template->endPage();
115  $response->setContent($pageHeader . $response->getContent() . $pageEnd);
116  }
117 
123  protected function getLanguageSelection() {
124  $language = 'all';
125  $backendUser = $this->getBackendUser();
126  if (isset($backendUser->uc['moduleData']['Workspaces'][$backendUser->workspace]['language'])) {
127  $language = $backendUser->uc['moduleData']['Workspaces'][$backendUser->workspace]['language'];
128  }
129  return $language;
130  }
131 
135  protected function getAdditionalColumnService() {
136  return $this->objectManager->get('TYPO3\\CMS\\Workspaces\\Service\\AdditionalColumnService');
137  }
138 
142  protected function getAdditionalResourceService() {
143  return $this->objectManager->get('TYPO3\\CMS\\Workspaces\\Service\\AdditionalResourceService');
144  }
145 
149  protected function getBackendUser() {
150  return $GLOBALS['BE_USER'];
151  }
152 
153 }
if(!defined('TYPO3_MODE')) if(TYPO3_MODE=='BE' &&!(TYPO3_REQUESTTYPE &TYPO3_REQUESTTYPE_INSTALL)) $icons
Definition: ext_tables.php:52
processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]