[TASK] Make alt_file_navframe.php dispatched 11/37611/4
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 6 Mar 2015 18:19:53 +0000 (19:19 +0100)
committerBenjamin Mack <benni@typo3.org>
Sun, 22 Mar 2015 17:40:14 +0000 (18:40 +0100)
Resolves: #65293
Releases: master
Change-Id: I4528cdeb58b29ed5528222485254bcc7aba73dc3
Reviewed-on: http://review.typo3.org/37611
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/alt_file_navframe.php
typo3/mod/file/conf.php
typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/backend/Modules/FileSystemNavigationFrame/conf.php [new file with mode: 0644]
typo3/sysext/backend/Modules/FileSystemNavigationFrame/index.php [new file with mode: 0644]
typo3/sysext/backend/ext_tables.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-65293-DeprecateFileNavigationFrame.rst [new file with mode: 0644]

index 5fbe7ba..8252449 100644 (file)
@@ -19,6 +19,8 @@
  */
 require_once 'init.php';
 
+\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('Usage of alt_file_navframe.php is deprecated since TYPO3 CMS 7, and will be removed in TYPO3 CMS 8');
+
 // Make instance if it is not an AJAX call
 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
        $fileSystemNavigationFrameController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\FileSystemNavigationFrameController::class);
index f23fa40..180a35f 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 $MLANG['default']['tabs_images']['tab'] = 'file.gif';
 $MLANG['default']['ll_ref'] = 'LLL:EXT:lang/locallang_mod_file.xlf';
-$MCONF['navFrameScript'] = '../../alt_file_navframe.php';
 $MCONF['access'] = 'group,user';
 $MCONF['name'] = 'file';
 $MCONF['workspaces'] = 'online,custom';
index 240b2eb..58619f4 100644 (file)
@@ -102,7 +102,7 @@ class FileSystemNavigationFrameController {
                        $GLOBALS['SOBE']->browser->act = $this->scopeData['browser']['act'];
                } else {
                        $this->foldertree = GeneralUtility::makeInstance(\TYPO3\CMS\Filelist\FileListFolderTree::class);
-                       $this->foldertree->thisScript = 'alt_file_navframe.php';
+                       $this->foldertree->thisScript = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('file_navframe');
                }
 
                $this->foldertree->ext_IconMode = $GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
index 0c02597..b32262b 100644 (file)
@@ -335,10 +335,20 @@ class ModuleLoader {
 
                // check if there is a navigation component (like the pagetree)
                if (is_array($this->navigationComponents[$name])) {
-                       $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$name]['componentId'];
+                       // the navigation component is a module, so the module URL is taken
+                       if (isset($GLOBALS['TBE_MODULES']['_PATHS'][$this->navigationComponents[$name]['componentId']])) {
+                               $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl($this->navigationComponents[$name]['componentId']);
+                       } else {
+                               $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$name]['componentId'];
+                       }
                // navigation component can be overriden by the main module component
                } elseif ($mainModule && is_array($this->navigationComponents[$mainModule]) && $setupInformation['configuration']['inheritNavigationComponentFromMainModule'] !== FALSE) {
-                       $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$mainModule]['componentId'];
+                       // the navigation component is a module, so the module URL is taken
+                       if (isset($GLOBALS['TBE_MODULES']['_PATHS'][$this->navigationComponents[$mainModule]['componentId']])) {
+                               $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl($this->navigationComponents[$mainModule]['componentId']);
+                       } else {
+                               $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$mainModule]['componentId'];
+                       }
                }
                return $finalModuleConfiguration;
        }
diff --git a/typo3/sysext/backend/Modules/FileSystemNavigationFrame/conf.php b/typo3/sysext/backend/Modules/FileSystemNavigationFrame/conf.php
new file mode 100644 (file)
index 0000000..391a4db
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+$MCONF['script'] = '_DISPATCH';
+$MCONF['name'] = 'file_navframe';
\ No newline at end of file
diff --git a/typo3/sysext/backend/Modules/FileSystemNavigationFrame/index.php b/typo3/sysext/backend/Modules/FileSystemNavigationFrame/index.php
new file mode 100644 (file)
index 0000000..5950dec
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Folder tree in the File main module.
+ *
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+// Make instance if it is not an AJAX call
+if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
+       $fileSystemNavigationFrameController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\FileSystemNavigationFrameController::class);
+       $fileSystemNavigationFrameController->initPage();
+       $fileSystemNavigationFrameController->main();
+       $fileSystemNavigationFrameController->printContent();
+}
\ No newline at end of file
index 679aed8..8f4b403 100644 (file)
@@ -20,6 +20,13 @@ if (TYPO3_MODE === 'BE') {
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Logout/'
        );
 
+       // Register file_navframe
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addCoreNavigationComponent('file', 'file_navframe');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
+               'file_navframe',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/FileSystemNavigationFrame/'
+       );
+
        // Register file_edit
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
                'file_edit',
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65293-DeprecateFileNavigationFrame.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65293-DeprecateFileNavigationFrame.rst
new file mode 100644 (file)
index 0000000..58eb319
--- /dev/null
@@ -0,0 +1,25 @@
+=================================================================
+Deprecation: #65293 - Deprecate file navigation frame entry point
+=================================================================
+
+Description
+===========
+
+The following entry point has been marked as deprecated:
+
+* typo3/alt_file_navframe.php
+
+
+Impact
+======
+
+Using this entry points in a backend module will throw a deprecation message.
+
+
+Migration
+=========
+
+Use ``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()`` instead with the according module name.
+
+typo3/alt_file_navframe.php
+``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('file_navframe')``
\ No newline at end of file