TYPO3 CMS  TYPO3_6-2
ModulesController.php
Go to the documentation of this file.
1 <?php
3 
25 
31  public function indexAction() {
32  $warnings = array();
33  // Hook for additional warnings
34  if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
35  foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $classRef) {
37  if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
38  $hookObj->displayWarningMessages_postProcess($warnings);
39  }
40  }
41  }
42  if (count($warnings)) {
43  if (count($warnings) > 1) {
44  $securityWarnings = '<ul><li>' . implode('</li><li>', $warnings) . '</li></ul>';
45  } else {
46  $securityWarnings = '<p>' . implode('', $warnings) . '</p>';
47  }
49  'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
50  $securityWarnings,
51  $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.header'),
52  \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
53  );
54  $contentWarnings = '<div style="margin: 20px 0px;">' . $securityMessage->render() . '</div>';
55  unset($warnings);
56  }
57 
58  $this->view->assignMultiple(
59  array(
60  'TYPO3Version' => TYPO3_version,
61  'copyRightNotice' => \TYPO3\CMS\Backend\Utility\BackendUtility::TYPO3_copyRightNotice(),
62  'warningMessages' => $contentWarnings,
63  'modules' => $this->getModulesData()
64  )
65  );
66  }
67 
74  protected function getModulesData() {
76  $loadedModules = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
77  $loadedModules->observeWorkspaces = TRUE;
78  $loadedModules->load($GLOBALS['TBE_MODULES']);
79  $mainModulesData = array();
80  foreach ($loadedModules->modules as $moduleName => $moduleInfo) {
81  $mainModuleData = array();
82  $moduleKey = $moduleName . '_tab';
83  $mainModuleData['name'] = $moduleName;
84  $mainModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$moduleKey];
85  if (is_array($moduleInfo['sub']) && count($moduleInfo['sub']) > 0) {
86  $mainModuleData['subModules'] = $this->getSubModuleData($moduleName, $moduleInfo['sub']);
87  }
88  $mainModulesData[] = $mainModuleData;
89  }
90  return $mainModulesData;
91  }
92 
100  protected function getSubModuleData($moduleName, array $subModulesInfo = array()) {
101  $subModulesData = array();
102  foreach ($subModulesInfo as $subModuleName => $subModuleInfo) {
103  $subModuleKey = $moduleName . '_' . $subModuleName . '_tab';
104  $subModuleData = array();
105  $subModuleData['name'] = $subModuleName;
106  $subModuleData['icon'] = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($GLOBALS['LANG']->moduleLabels['tabs_images'][$subModuleKey]);
107  $subModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$subModuleKey];
108  $subModuleData['shortDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'label'];
109  $subModuleData['longDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'descr'];
110  $subModulesData[] = $subModuleData;
111  }
112  return $subModulesData;
113  }
114 
115 }
$moduleName
Definition: mod.php:22
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getSubModuleData($moduleName, array $subModulesInfo=array())