94 $this->BE_USER =
$GLOBALS[
'BE_USER'];
110 $this->absPathArray = $modulesArray[
'_PATHS'];
111 unset($modulesArray[
'_PATHS']);
113 unset($modulesArray[
'_dispatcher']);
115 unset($modulesArray[
'_configuration']);
116 $this->navigationComponents = $modulesArray[
'_navigationComponents'];
117 unset($modulesArray[
'_navigationComponents']);
125 $paths[
'defMods'] = PATH_typo3 .
'mod/';
127 $paths[
'userMods'] = PATH_typo3 .
'../typo3conf/';
129 foreach ($theMods as $mods => $subMod) {
133 if ($extModRelPath) {
134 $theMainMod = $this->
checkMod($mods, PATH_site . $extModRelPath);
135 if (is_array($theMainMod) || $theMainMod !=
'notFound') {
142 $theMainMod = $this->
checkMod($mods, $paths[
'defMods'] . $mods);
143 if (is_array($theMainMod) || $theMainMod !=
'notFound') {
144 $path = $paths[
'defMods'];
147 $theMainMod = $this->
checkMod($mods, $paths[
'userMods'] . $mods);
148 if (is_array($theMainMod) || $theMainMod !=
'notFound') {
149 $path = $paths[
'userMods'];
154 if ($theMainMod && !is_null($path)) {
155 $this->modules[$mods] = $theMainMod;
157 if (is_array($subMod)) {
158 foreach ($subMod as $valsub) {
160 if ($extModRelPath) {
162 $theTempSubMod = $this->
checkMod($mods .
'_' . $valsub, PATH_site . $extModRelPath);
164 if (is_array($theTempSubMod)) {
165 $this->modules[$mods][
'sub'][$valsub] = $theTempSubMod;
171 $theTempSubMod = $this->
checkMod($mods .
'_' . $valsub, $path . $mods .
'/' . $valsub);
173 if (is_array($theTempSubMod)) {
174 $this->modules[$mods][
'sub'][$valsub] = $theTempSubMod;
175 } elseif ($path == $paths[
'defMods']) {
177 $theTempSubMod = $this->
checkMod($mods .
'_' . $valsub, $paths[
'userMods'] . $mods .
'/' . $valsub);
178 if (is_array($theTempSubMod)) {
179 $this->modules[$mods][
'sub'][$valsub] = $theTempSubMod;
187 if (is_array($subMod)) {
188 foreach ($subMod as $valsub) {
190 $this->
checkMod($mods .
'_' . $valsub, $path . $mods .
'/' . $valsub);
205 if (isset($this->absPathArray[$name])) {
206 return rtrim(\
TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($this->absPathArray[$name]),
'/');
223 if ($name ==
'user_ws' && !\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'version')) {
227 if (is_array(
$GLOBALS[
'TBE_MODULES'][
'_configuration'][$name][
'configureModuleFunction'])) {
228 $obj =
$GLOBALS[
'TBE_MODULES'][
'_configuration'][$name][
'configureModuleFunction'];
229 if (is_callable($obj)) {
230 $MCONF = call_user_func($obj, $name, $fullpath);
238 if (strpos($name,
'_') !== FALSE) {
239 list($mainModule, ) = explode(
'_', $name, 2);
242 $finalModuleConfiguration = array();
249 if (count($setupInformation[
'configuration']) > 0) {
250 if (!$setupInformation[
'configuration'][
'shy'] && $this->
checkModAccess($name, $setupInformation[
'configuration']) && $this->
checkModWorkspace($name, $setupInformation[
'configuration'])) {
251 $finalModuleConfiguration = $setupInformation[
'configuration'];
252 $finalModuleConfiguration[
'name'] = $name;
257 $defaultLabels = $setupInformation[
'labels'][
'default'];
259 if ($defaultLabels[
'tabs_images'][
'tab']) {
262 $altIconKey =
'MOD:' . $name .
'/' . $defaultLabels[
'tabs_images'][
'tab'];
265 if ($altIconAbsPath && @is_file($altIconAbsPath)) {
266 $defaultLabels[
'tabs_images'][
'tab'] = $altIconAbsPath;
269 if (substr($defaultLabels[
'tabs_images'][
'tab'], 0, 4) ===
'EXT:') {
270 list($extensionKey, $relativePath) = explode(
'/', substr($defaultLabels[
'tabs_images'][
'tab'], 4), 2);
273 $defaultLabels[
'tabs_images'][
'tab'] = $fullpath .
'/' . $defaultLabels[
'tabs_images'][
'tab'];
277 $defaultLabels[
'tabs_images'][
'tab'] = $this->
getRelativePath(PATH_typo3, $defaultLabels[
'tabs_images'][
'tab']);
280 if (substr($defaultLabels[
'tabs_images'][
'tab'], 0, 3) ==
'../') {
281 $defaultLabels[
'tabs_images'][
'tab'] = PATH_site . substr($defaultLabels[
'tabs_images'][
'tab'], 3);
283 $defaultLabels[
'tabs_images'][
'tab'] = PATH_typo3 . $defaultLabels[
'tabs_images'][
'tab'];
288 if ($defaultLabels[
'll_ref']) {
290 $defaultLabels[
'labels'][
'tablabel'] =
$GLOBALS[
'LANG']->sL($defaultLabels[
'll_ref'] .
':mlang_labels_tablabel');
291 $defaultLabels[
'labels'][
'tabdescr'] =
$GLOBALS[
'LANG']->sL($defaultLabels[
'll_ref'] .
':mlang_labels_tabdescr');
292 $defaultLabels[
'tabs'][
'tab'] =
$GLOBALS[
'LANG']->sL($defaultLabels[
'll_ref'] .
':mlang_tabs_tab');
293 $GLOBALS[
'LANG']->addModuleLabels($defaultLabels, $name .
'_');
296 $GLOBALS[
'LANG']->addModuleLabels($defaultLabels, $name .
'_');
297 $GLOBALS[
'LANG']->addModuleLabels($setupInformation[
'labels'][
$GLOBALS[
'LANG']->lang], $name .
'_');
302 if ($setupInformation[
'configuration'][
'script'] ===
'_DISPATCH') {
303 if ($setupInformation[
'configuration'][
'extbase']) {
308 } elseif ($setupInformation[
'configuration'][
'script'] && file_exists($setupInformation[
'path'] .
'/' . $setupInformation[
'configuration'][
'script'])) {
309 $finalModuleConfiguration[
'script'] = $this->
getRelativePath(PATH_typo3, $fullpath .
'/' . $setupInformation[
'configuration'][
'script']);
311 $finalModuleConfiguration[
'script'] =
'dummy.php';
315 if ($setupInformation[
'configuration'][
'defaultMod']) {
316 $finalModuleConfiguration[
'defaultMod'] = $setupInformation[
'configuration'][
'defaultMod'];
320 if ($setupInformation[
'configuration'][
'navFrameScript']) {
321 $navFrameScript = explode(
'?', $setupInformation[
'configuration'][
'navFrameScript']);
322 $navFrameScript = $navFrameScript[0];
323 if (file_exists($setupInformation[
'path'] .
'/' . $navFrameScript)) {
324 $finalModuleConfiguration[
'navFrameScript'] = $this->
getRelativePath(PATH_typo3, $fullpath .
'/' . $setupInformation[
'configuration'][
'navFrameScript']);
329 if ($setupInformation[
'configuration'][
'navFrameScriptParam']) {
330 $finalModuleConfiguration[
'navFrameScriptParam'] = $setupInformation[
'configuration'][
'navFrameScriptParam'];
334 if (is_array($this->navigationComponents[$name])) {
335 $finalModuleConfiguration[
'navigationComponentId'] = $this->navigationComponents[$name][
'componentId'];
337 } elseif ($mainModule && is_array($this->navigationComponents[$mainModule]) && $setupInformation[
'configuration'][
'inheritNavigationComponentFromMainModule'] !== FALSE) {
338 $finalModuleConfiguration[
'navigationComponentId'] = $this->navigationComponents[$mainModule][
'componentId'];
344 $finalModuleConfiguration =
'notFound';
347 return $finalModuleConfiguration;
361 $path = preg_replace(
'/\\/[^\\/.]+\\/\\.\\.\\//',
'/', $pathToModuleDirectory);
363 $moduleSetupInformation = array(
364 'configuration' => array(),
369 if (@is_dir($path) && file_exists($path .
'/conf.php')) {
374 include $path .
'/conf.php';
378 $moduleSetupInformation[
'configuration'] =
$MCONF;
380 $moduleSetupInformation[
'configuration'] = array();
382 $moduleSetupInformation[
'labels'] =
$MLANG;
387 $moduleSetupInformation[
'configuration'] = array_merge_recursive($moduleSetupInformation[
'configuration'],
$GLOBALS[
'TBE_MODULES'][
'_configuration'][$moduleName]);
391 if (!isset($moduleSetupInformation[
'configuration'][
'inheritNavigationComponentFromMainModule'])) {
392 $moduleSetupInformation[
'configuration'][
'inheritNavigationComponentFromMainModule'] = TRUE;
395 return $moduleSetupInformation;
408 $access = strtolower(
$MCONF[
'access']);
411 if (strstr($access,
'admin')) {
412 if ($this->BE_USER->isAdmin()) {
417 if (strstr($access,
'user')) {
418 $this->modListUser[] = $name;
420 if (strstr($access,
'group')) {
421 $this->modListGroup[] = $name;
424 if ($this->BE_USER->isAdmin() || $this->BE_USER->check(
'modules', $name)) {
442 if ($this->observeWorkspaces) {
444 if (
$MCONF[
'workspaces']) {
449 } elseif ($this->BE_USER->workspace === -99) {
468 if (is_array($arr)) {
469 foreach ($arr as $mod => $subs) {
475 foreach ($subsArr as $subMod) {
478 $theMods[$mod][] = $subMod;
498 return preg_replace(
'/[^a-z0-9]/i',
'', $str);
511 if ($baseDir == $destDir) {
515 $baseDir = ltrim($baseDir,
'/');
516 $destDir = ltrim($destDir,
'/');
520 $slash_pos = strpos($destDir,
'/');
521 if (substr($destDir, 0, $slash_pos) == substr($baseDir, 0, $slash_pos)) {
522 $baseDir = substr($baseDir, $slash_pos + 1);
523 $destDir = substr($destDir, $slash_pos + 1);
527 }
while ($found == TRUE);
528 $slashes = strlen($baseDir) - strlen(str_replace(
'/',
'', $baseDir));
529 for ($i = 0; $i < $slashes; $i++) {
530 $destDir =
'../' . $destDir;
checkModWorkspace($name, $MCONF)
checkExtensionModule($name)
checkModAccess($name, $MCONF)
static extPath($key, $script='')
$MLANG['default']['tabs_images']['tab']
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
checkMod($name, $fullpath)
getRelativePath($baseDir, $destDir)
getModuleSetupInformation($moduleName, $pathToModuleDirectory)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
load($modulesArray, $BE_USER='')
static resolveBackPath($pathStr)