[BUGFIX] Faulty and superfluous code in import/export module 02/25302/3
authorOliver Hader <oliver@typo3.org>
Tue, 12 Nov 2013 11:56:43 +0000 (12:56 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 1 Dec 2013 10:52:03 +0000 (11:52 +0100)
There is faulty and superfluous code in import/export module:
* ModuleFunctionController does not work at all, this points
  back to issue #22921 during TYPO3 4.4 development
* ImportExportTask fetches thumbnail files from a (faulty)
  storage that are not used at all

Since the required class "mod_user_task" has been removed in
TYPO3 4.4, the module function component was broken since then.
Thus, it will be removed completely with this change.

Fixes: #53555
Releases: 6.2, 6.1, 6.0
Change-Id: I1cbdd967dc47ac2fcd256e7eefc756278822ad84
Reviewed-on: https://review.typo3.org/25302
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/impexp/Classes/Controller/ModuleFunctionController.php [deleted file]
typo3/sysext/impexp/Migrations/Code/ClassAliasMap.php
typo3/sysext/impexp/app/locallang.xlf
typo3/sysext/impexp/doc/TODO.txt
typo3/sysext/impexp/modfunc1/class.tx_impexp_modfunc1.php [deleted file]
typo3/sysext/impexp/modfunc1/locallang.xlf [deleted file]

index 6fef177..3ce9984 100644 (file)
@@ -5254,11 +5254,6 @@ class SC_mod_tools_log_index extends \TYPO3\CMS\Impexp\Controller\ImportExportCo
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class tx_impexp_modfunc1 extends \TYPO3\CMS\Impexp\Controller\ModuleFunctionController {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class tx_impexp extends \TYPO3\CMS\Impexp\ImportExport {}
 
 /**
diff --git a/typo3/sysext/impexp/Classes/Controller/ModuleFunctionController.php b/typo3/sysext/impexp/Classes/Controller/ModuleFunctionController.php
deleted file mode 100644 (file)
index 12dca6e..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php
-namespace TYPO3\CMS\Impexp\Controller;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Export Preset listing for the task center
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class ModuleFunctionController extends mod_user_task {
-
-       /**
-        * Create preset overview for task center overview.
-        *
-        * @return string HTML for the task center overview listing.
-        * @todo Define visibility
-        */
-       public function overview_main() {
-               global $LANG;
-               // Create preset links:
-               $presets = $this->getPresets();
-               $opt = array();
-               if (is_array($presets)) {
-                       foreach ($presets as $presetCfg) {
-                               $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
-                               $opt[] = '
-                                       <tr class="bgColor4">
-                                               <td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($title, 30)) . '</a>&nbsp;</td>
-                                               <td>' . ($presetCfg['item_uid'] ? $presetCfg['item_uid'] : '&nbsp;') . '</td>
-                                               <td>' . ($presetCfg['public'] ? '[Public]' : '&nbsp;') . '</td>
-                                               <td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? '[Own]' : '&nbsp;') . '</td>
-                                       </tr>';
-                       }
-                       if (sizeof($opt) > 0) {
-                               $presets = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">' . implode('', $opt) . '</table>';
-                               $presets .= '<a href="index.php?SET[function]=tx_impexp"><em>' . $LANG->getLL('link_allRecs') . '</em></a>';
-                       } else {
-                               $presets = '';
-                       }
-                       $icon = '<img src="' . $this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'export.gif" width="18" height="16" class="absmiddle" alt="" />';
-                       $config = $this->mkMenuConfig($icon . $this->headLink('tx_impexp_modfunc1', 1), '', $presets);
-               }
-               return $config;
-       }
-
-       /**
-        * Main Task center module
-        *
-        * @return string HTML content.
-        * @todo Define visibility
-        */
-       public function main() {
-               if ($id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('display')) {
-                       return $this->urlInIframe($this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id, 1);
-               } else {
-                       // Thumbnail folder and files:
-                       $tempDir = $this->userTempFolder();
-                       if ($tempDir) {
-                               $thumbnails = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($tempDir, 'png,gif,jpg', 1);
-                       }
-                       $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-                       $usernames = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
-                       // Create preset links:
-                       $presets = $this->getPresets();
-                       $opt = array();
-                       $opt[] = '
-                       <tr class="bgColor5 tableheader">
-                               <td>Icon:</td>
-                               <td>Preset Title:</td>
-                               <td>Public</td>
-                               <td>Owner:</td>
-                               <td>Page:</td>
-                               <td>Path:</td>
-                               <td>Meta data:</td>
-                       </tr>';
-                       if (is_array($presets)) {
-                               foreach ($presets as $presetCfg) {
-                                       $configuration = unserialize($presetCfg['preset_data']);
-                                       $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
-                                       $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
-                                       $opt[] = '
-                                       <tr class="bgColor4">
-                                               <td>' . ($thumbnailFile ? '<img src="' . $this->backPath . '../' . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile) . '" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br />' : '&nbsp;') . '</td>
-                                               <td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($title, 30)) . '</a>&nbsp;</td>
-                                               <td>' . ($presetCfg['public'] ? 'Yes' : '&nbsp;') . '</td>
-                                               <td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
-                                               <td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : '&nbsp;') . '</td>
-                                               <td>' . htmlspecialchars(($configuration['pagetree']['id'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($configuration['pagetree']['id'], $clause, 20) : '[Single Records]')) . '</td>
-                                               <td>
-                                                       <strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />' . htmlspecialchars($configuration['meta']['description']) . ($configuration['meta']['notes'] ? '<br /><br /><strong>Notes:</strong> <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>' : '') . '
-                                               </td>
-                                       </tr>';
-                               }
-                               $content = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">' . implode('', $opt) . '</table>';
-                       }
-               }
-               // Output:
-               $theOutput .= $this->pObj->doc->spacer(5);
-               $theOutput .= $this->pObj->doc->section('Export presets', $content, 0, 1);
-               return $theOutput;
-       }
-
-       /*****************************
-        * Helper functions
-        *****************************/
-
-       /**
-        * Select presets for this user
-        *
-        * @return array Array of preset records
-        * @todo Define visibility
-        */
-       public function getPresets() {
-               $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_impexp_presets', '(public>0 OR user_uid=' . intval($GLOBALS['BE_USER']->user['uid']) . ')', '', 'item_uid DESC, title');
-               return $presets;
-       }
-
-       /**
-        * Returns first temporary folder of the user account (from $FILEMOUNTS)
-        *
-        * @return string Absolute path to first "_temp_" folder of the current user, otherwise blank.
-        * @todo Define visibility
-        */
-       public function userTempFolder() {
-               global $FILEMOUNTS;
-               foreach ($FILEMOUNTS as $filePathInfo) {
-                       $tempFolder = $filePathInfo['path'] . '_temp_/';
-                       if (@is_dir($tempFolder)) {
-                               return $tempFolder;
-                       }
-               }
-       }
-
-}
index 0e54e16..3dc4974 100644 (file)
@@ -2,7 +2,6 @@
 return array(
        'tx_impexp_clickmenu' => 'TYPO3\\CMS\\Impexp\\Clickmenu',
        'SC_mod_tools_log_index' => 'TYPO3\\CMS\\Impexp\\Controller\\ImportExportController',
-       'tx_impexp_modfunc1' => 'TYPO3\\CMS\\Impexp\\Controller\\ModuleFunctionController',
        'tx_impexp' => 'TYPO3\\CMS\\Impexp\\ImportExport',
        'tx_impexp_localPageTree' => 'TYPO3\\CMS\\Impexp\\LocalPageTree',
        'tx_impexp_task' => 'TYPO3\\CMS\\Impexp\\Task\\ImportExportTask',
index 43bea0f..69f723b 100644 (file)
@@ -12,9 +12,6 @@
                        <trans-unit id="title" xml:space="preserve">
                                <source>Import / Export</source>
                        </trans-unit>
-                       <trans-unit id="moduleFunction.tx_impexp_modfunc1" xml:space="preserve">
-                               <source>Export Presets</source>
-                       </trans-unit>
                        <trans-unit id="tableselec_configuration" xml:space="preserve">
                                <source>Configuration</source>
                        </trans-unit>
index 2ae7a4a..2bdd02e 100755 (executable)
@@ -12,21 +12,6 @@ Import of files:
 IMPORT:
 - Better logging to system
 
-TemplateArchive:
-- Add the modfunc module which will import a template from archive.
-       - Project group for this?
-       - Available repositories:
-               - typo3.org text list?
-               - Local configuration of URLs in localconf.
-       - Available templates
-               - Apache file list
-                       file / icon / description.txt
-               - index.php gives XML with
-                       - file-ref (rel/abs)
-                       - icon-ref (rel/abs)
-                       - title / description
-                       - testUrl
-
 *********
 NOTES:
 *********
diff --git a/typo3/sysext/impexp/modfunc1/class.tx_impexp_modfunc1.php b/typo3/sysext/impexp/modfunc1/class.tx_impexp_modfunc1.php
deleted file mode 100755 (executable)
index 0e1969b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Export Preset listing
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp', 1);
-/*
- * @deprecated since 6.0, the classname tx_impexp_modfunc1 and this file is obsolete
- * and will be removed with 6.2. The class was renamed and is now located at:
- * typo3/sysext/impexp/Classes/Controller/ModuleFunctionController.php
- */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('impexp') . 'classes/Controller/ModuleFunctionController.php';
diff --git a/typo3/sysext/impexp/modfunc1/locallang.xlf b/typo3/sysext/impexp/modfunc1/locallang.xlf
deleted file mode 100644 (file)
index 55c8548..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
-       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:33Z" product-name="impexp">
-               <header/>
-               <body>
-                       <trans-unit id="link_allRecs" xml:space="preserve">
-                               <source>Show details of all presets</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>