Added Feature #13982: Feature: Renewal of the taskcenter Part I (thanks to Georg...
authorSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 16:39:08 +0000 (16:39 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 16:39:08 +0000 (16:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7342 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/impexp/app/index.php
typo3/sysext/impexp/ext_autoload.php [new file with mode: 0644]
typo3/sysext/impexp/ext_emconf.php
typo3/sysext/impexp/ext_tables.php
typo3/sysext/impexp/locallang_csh.xml
typo3/sysext/impexp/task/class.tx_impexp_task.php [new file with mode: 0644]

index 40e8c6c..7f85eb6 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
 
 2010-04-13  Steffen Kamper  <info@sk-typo3.de>
 
+       * Added Feature #13982: Feature: Renewal of the taskcenter Part I (thanks to Georg Ringer)
        * Fixed bug #14061: Do not die, be the exception!
        * Added Feature #13799: ExtJS driven fading in/out Flashmessages
        * Corrected spelling errors in felogin manual
index 82de257..65bc75d 100755 (executable)
@@ -1299,7 +1299,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                                        if ($inData['import_file'])     {
                                                if (!count($extKeysToInstall))  {
                                                        $import->importData($this->id);
-                                                       t3lib_BEfunc::setUpdateSignal('updatePageTree');
+                                                       t3lib_BEfunc::getSetUpdateSignal('updatePageTree');
                                                } else {
                                                        t3lib_utility_Http::redirect($emURL);
                                                }
diff --git a/typo3/sysext/impexp/ext_autoload.php b/typo3/sysext/impexp/ext_autoload.php
new file mode 100644 (file)
index 0000000..bb5bd22
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/*
+ * Register necessary class names with autoloader
+ *
+ */
+$extensionPath = t3lib_extMgm::extPath('impexp');
+return array(
+       'tx_impexp_task' => $extensionPath . 'task/class.tx_impexp_task.php',
+);
+?>
\ No newline at end of file
index 9e36a62..4ba15e9 100755 (executable)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "impexp".
 #
-# Auto generated 25-11-2009 22:01
+# Auto generated 13-04-2010 13:49
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -34,9 +34,10 @@ $EM_CONF[$_EXTKEY] = array(
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
        'version' => '0.3.0',
-       '_md5_values_when_last_written' => 'a:42:{s:19:"class.tx_impexp.php";s:4:"3441";s:29:"class.tx_impexp_clickmenu.php";s:4:"75f1";s:10:"export.gif";s:4:"3b59";s:14:"ext_tables.php";s:4:"5508";s:14:"ext_tables.sql";s:4:"c4c7";s:10:"import.gif";s:4:"374c";s:17:"locallang_csh.xml";s:4:"63eb";s:13:"app/clear.gif";s:4:"cc11";s:12:"app/conf.php";s:4:"6593";s:13:"app/index.php";s:4:"60dd";s:17:"app/locallang.xml";s:4:"a173";s:17:"app/template.html";s:4:"29f0";s:22:"cshimages/diffview.png";s:4:"ee3c";s:24:"cshimages/excludebox.png";s:4:"6ece";s:20:"cshimages/export.png";s:4:"e850";s:21:"cshimages/export1.png";s:4:"8e9a";s:21:"cshimages/export2.png";s:4:"ec12";s:20:"cshimages/extdep.png";s:4:"9349";s:24:"cshimages/fileformat.png";s:4:"eed0";s:21:"cshimages/htmlcss.png";s:4:"1f13";s:20:"cshimages/impexp.png";s:4:"eef2";s:25:"cshimages/impexp_misc.png";s:4:"f8c7";s:26:"cshimages/impexp_misc1.png";s:4:"80d3";s:26:"cshimages/impexp_misc2.png";s:4:"f530";s:26:"cshimages/impexp_misc3.png";s:4:"3c82";s:26:"cshimages/impexp_misc4.png";s:4:"2ea9";s:20:"cshimages/import.png";s:4:"35fc";s:31:"cshimages/import_selectfile.png";s:4:"7df9";s:22:"cshimages/metadata.png";s:4:"de32";s:25:"cshimages/pagetreecfg.png";s:4:"3ed8";s:20:"cshimages/phpext.png";s:4:"06c7";s:24:"cshimages/references.png";s:4:"ed7c";s:25:"cshimages/references1.png";s:4:"e817";s:25:"cshimages/references2.png";s:4:"960f";s:26:"cshimages/singlerecord.png";s:4:"885b";s:20:"cshimages/static.png";s:4:"db15";s:21:"cshimages/static1.png";s:4:"83ea";s:23:"cshimages/tablelist.png";s:4:"6b64";s:20:"cshimages/update.png";s:4:"e013";s:12:"doc/TODO.txt";s:4:"1967";s:37:"modfunc1/class.tx_impexp_modfunc1.php";s:4:"a85b";s:22:"modfunc1/locallang.xml";s:4:"3fe4";}',
+       '_md5_values_when_last_written' => 'a:44:{s:19:"class.tx_impexp.php";s:4:"3441";s:29:"class.tx_impexp_clickmenu.php";s:4:"75f1";s:10:"export.gif";s:4:"3b59";s:16:"ext_autoload.php";s:4:"e335";s:14:"ext_tables.php";s:4:"6707";s:14:"ext_tables.sql";s:4:"c4c7";s:10:"import.gif";s:4:"374c";s:17:"locallang_csh.xml";s:4:"ec50";s:13:"app/clear.gif";s:4:"cc11";s:12:"app/conf.php";s:4:"6593";s:13:"app/index.php";s:4:"60dd";s:17:"app/locallang.xml";s:4:"a173";s:17:"app/template.html";s:4:"29f0";s:22:"cshimages/diffview.png";s:4:"ee3c";s:24:"cshimages/excludebox.png";s:4:"6ece";s:20:"cshimages/export.png";s:4:"e850";s:21:"cshimages/export1.png";s:4:"8e9a";s:21:"cshimages/export2.png";s:4:"ec12";s:20:"cshimages/extdep.png";s:4:"9349";s:24:"cshimages/fileformat.png";s:4:"eed0";s:21:"cshimages/htmlcss.png";s:4:"1f13";s:20:"cshimages/impexp.png";s:4:"eef2";s:25:"cshimages/impexp_misc.png";s:4:"f8c7";s:26:"cshimages/impexp_misc1.png";s:4:"80d3";s:26:"cshimages/impexp_misc2.png";s:4:"f530";s:26:"cshimages/impexp_misc3.png";s:4:"3c82";s:26:"cshimages/impexp_misc4.png";s:4:"2ea9";s:20:"cshimages/import.png";s:4:"35fc";s:31:"cshimages/import_selectfile.png";s:4:"7df9";s:22:"cshimages/metadata.png";s:4:"de32";s:25:"cshimages/pagetreecfg.png";s:4:"3ed8";s:20:"cshimages/phpext.png";s:4:"06c7";s:24:"cshimages/references.png";s:4:"ed7c";s:25:"cshimages/references1.png";s:4:"e817";s:25:"cshimages/references2.png";s:4:"960f";s:26:"cshimages/singlerecord.png";s:4:"885b";s:20:"cshimages/static.png";s:4:"db15";s:21:"cshimages/static1.png";s:4:"83ea";s:23:"cshimages/tablelist.png";s:4:"6b64";s:20:"cshimages/update.png";s:4:"e013";s:12:"doc/TODO.txt";s:4:"1967";s:37:"modfunc1/class.tx_impexp_modfunc1.php";s:4:"a85b";s:22:"modfunc1/locallang.xml";s:4:"3fe4";s:29:"task/class.tx_impexp_task.php";s:4:"8421";}',
        'constraints' => array(
                'depends' => array(
+                       'taskcenter' => '1.0.0-0.0.0',
                        'php' => '5.1.0-0.0.0',
                        'typo3' => '4.3.0-0.0.0',
                ),
index 0bdd97c..cd2ce46 100755 (executable)
@@ -1,17 +1,20 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
 
-if (TYPO3_MODE=='BE')  {
-       $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][]=array(
+if (TYPO3_MODE == 'BE')        {
+       $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][] = array (
                'name' => 'tx_impexp_clickmenu',
                'path' => t3lib_extMgm::extPath($_EXTKEY).'class.tx_impexp_clickmenu.php'
        );
 
-       t3lib_extMgm::insertModuleFunction(
-               'user_task',
-               'tx_impexp_modfunc1',
-               t3lib_extMgm::extPath($_EXTKEY).'modfunc1/class.tx_impexp_modfunc1.php',
-               'LLL:EXT:impexp/app/locallang.xml:moduleFunction.tx_impexp_modfunc1'
+
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['impexp']['tasks'] = array (
+               'title'       => 'LLL:EXT:impexp/locallang_csh.xml:.alttitle',
+               'description' => 'LLL:EXT:impexp/locallang_csh.xml:.description',
+               'icon'            => 'EXT:impexp/export.gif',
+               'task'            => 'tx_impexp_task',
        );
 
        t3lib_extMgm::addLLrefForTCAdescr('xMOD_tx_impexp','EXT:impexp/locallang_csh.xml');
index ef0fe05..ff0d2a7 100755 (executable)
@@ -170,6 +170,19 @@ Before importing make sure you change any editable soft references that are show
                        <label index="upload.alttitle">Upload import file</label>
                        <label index="upload.description">Select a file to import from your local computer and upload it here. If the upload completes succesfully you can immediately see its content displayed in the preview display.</label>
                        <label index="upload.details">Notice that there are usually limits set by the server (PHP) to the size of uploaded files at around 2 MB in which case nothing will happen.</label>
+
+                       <label index="task.title">Preset title</label>
+                       <label index="task.icon">Icon</label>
+                       <label index="task.public">Public</label>
+                       <label index="task.owner">Owner</label>
+                       <label index="task.page">Page</label>
+                       <label index="task.path">Path</label>
+                       <label index="task.meta">Meta data</label>
+                       <label index="task.own">Own</label>
+                       <label index="notes">Notes</label>
+                       <label index="single-record">Single record</label>
+                       <label index="no-presets">No presets found!</label>
+
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
diff --git a/typo3/sysext/impexp/task/class.tx_impexp_task.php b/typo3/sysext/impexp/task/class.tx_impexp_task.php
new file mode 100644 (file)
index 0000000..41a6545
--- /dev/null
@@ -0,0 +1,226 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)\r
+*  (c) 2010 Georg Ringer (typo3@ringerge.org)\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * This class provides a textarea to save personal notes\r
+ *\r
+ * @author             Kasper Skaarhoj <kasper@typo3.com>\r
+ * @author             Georg Ringer <typo3@ringerge.org>\r
+ * @package            TYPO3\r
+ * @subpackage impexp\r
+ *\r
+ */\r
+class tx_impexp_task implements tx_taskcenter_Task {\r
+       /**\r
+        * Back-reference to the calling reports module\r
+        *\r
+        * @var tx_reports_Module       $taskObject\r
+        */\r
+       protected $taskObject;\r
+\r
+       /**\r
+        * Constructor\r
+        */\r
+       public function __construct(SC_mod_user_task_index $taskObject) {\r
+               $this->taskObject = $taskObject;\r
+               $GLOBALS['LANG']->includeLLFile('EXT:impexp/locallang_csh.xml');\r
+       }\r
+\r
+       /**\r
+        * This method renders the report\r
+        *\r
+        * @return      string  The status report as HTML\r
+        */\r
+       public function getTask() {\r
+               return $this->main();\r
+       }\r
+\r
+       /**\r
+        * Render an optional additional information for the 1st view in taskcenter.\r
+        * Empty for this task\r
+        *\r
+        * @return      string          Overview as HTML\r
+        */\r
+       public function getOverview() {\r
+               return '';\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Main Task center module\r
+        *\r
+        * @return      string          HTML content.\r
+        */\r
+       public function main() {\r
+               $content = '';\r
+               $id = intval(t3lib_div::_GP('display'));\r
+\r
+                       // if a preset is found, it is rendered using an iframe\r
+               if($id > 0) {\r
+                       $url = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id;\r
+                       return $this->taskObject->urlInIframe($url, 1);\r
+               } else {\r
+                               // header\r
+                       $content .= $this->taskObject->description(\r
+                                                       $GLOBALS['LANG']->getLL('.alttitle'),\r
+                                                       $GLOBALS['LANG']->getLL('.description')\r
+                                               );\r
+\r
+                       $thumbnails = $lines = array();\r
+\r
+                               // Thumbnail folder and files:\r
+                       $tempDir = $this->userTempFolder();\r
+                       if ($tempDir) {\r
+                               $thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1);\r
+                       }\r
+\r
+                       $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);\r
+                       $usernames = t3lib_BEfunc::getUserNames();\r
+\r
+                               // Create preset links:\r
+                       $presets = $this->getPresets();\r
+\r
+                               // if any presets found\r
+                       if (is_array($presets)) {\r
+                               foreach($presets as $key => $presetCfg) {\r
+                                       $configuration = unserialize($presetCfg['preset_data']);\r
+                                       $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];\r
+                                       $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '['.$presetCfg['uid'].']';\r
+\r
+                                       if ($thumbnailFile && 1==2) {\r
+                                               // @todo: create icon or maybe completly remove it because where to display?\r
+                                               $src=  '../' . $GLOBALS['BACK_PATH'] .  substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile);\r
+                                               $icon = $src;\r
+                                       } else {\r
+                                               $icon = 'EXT:impexp/export.gif';\r
+                                       }\r
+\r
+                                       $description = array();\r
+\r
+                                               // is public?\r
+                                       if ($presetCfg['public']) {\r
+                                               $description[] = $GLOBALS['LANG']->getLL('task.public') . ': ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');\r
+                                       }\r
+\r
+                                               // owner\r
+                                       $description[] = $GLOBALS['LANG']->getLL('task.owner') . ': ' . (($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid']) ? $GLOBALS['LANG']->getLL('task.own') : '[' . htmlspecialchars($usernames[$presetCfg['user_uid']]['username']) . ']');\r
+\r
+                                               // page & path\r
+                                       if ($configuration['pagetree']['id']) {\r
+                                               $description[] = $GLOBALS['LANG']->getLL('task.page') . ': ' . $configuration['pagetree']['id'];\r
+                                               $description[] = $GLOBALS['LANG']->getLL('task.path') . ': ' . htmlspecialchars(t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'], $clause, 20));\r
+                                       } else {\r
+                                               $description[] = $GLOBALS['LANG']->getLL('single-record');\r
+                                       }\r
+\r
+                                               // Meta information\r
+                                       if ($configuration['meta']['title'] || $configuration['meta']['description'] || $configuration['meta']['notes']) {\r
+                                               $metaInformation = '';\r
+                                               if ($configuration['meta']['title']) {\r
+                                                       $metaInformation .= '<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />';\r
+                                               }\r
+                                               if ($configuration['meta']['description']) {\r
+                                                       $metaInformation .= htmlspecialchars($configuration['meta']['description']);\r
+                                               }\r
+                                               if ($configuration['meta']['notes']) {\r
+                                                       $metaInformation .= '<br /><br />\r
+                                                                                               <strong>' . $GLOBALS['LANG']->getLL('notes') . ': </strong>\r
+                                                                                               <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>';\r
+                                               }\r
+\r
+                                               $description[] = '<br />' . $metaInformation;\r
+                                       }\r
+\r
+                                               // collect all preset information\r
+                                       $lines[$key] = array(\r
+                                               'icon' => $icon,\r
+                                               'title' => htmlspecialchars($title),\r
+                                               'descriptionHtml' => implode('<br />', $description),\r
+                                               'link' => 'mod.php?M=user_task&SET[function]=impexp.tasks&display=' . $presetCfg['uid']\r
+                                       );\r
+\r
+                               }\r
+\r
+                                       // render preset list\r
+                               $content .= $this->taskObject->renderListMenu($lines);\r
+                       } else {\r
+                                       // no presets found\r
+                               $flashMessage = t3lib_div::makeInstance(\r
+                                       't3lib_FlashMessage',\r
+                                       $GLOBALS['LANG']->getLL('no-presets'),\r
+                                       '',\r
+                                       t3lib_FlashMessage::NOTICE\r
+\r
+                               );\r
+                               $content .= $flashMessage->render();\r
+                       }\r
+               }\r
+\r
+               return $content;\r
+       }\r
+\r
+\r
+       /**\r
+        * Select presets for this user\r
+        *\r
+        * @return      array           Array of preset records\r
+        */\r
+       function getPresets() {\r
+               $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\r
+                               '*',\r
+                               'tx_impexp_presets',\r
+                               '(public > 0 OR user_uid=' . $GLOBALS['BE_USER']->user['uid'] . ')',\r
+                               '',\r
+                               'item_uid DESC, title'\r
+                       );\r
+\r
+               return $presets;\r
+       }\r
+\r
+       /**\r
+        * Returns first temporary folder of the user account (from $FILEMOUNTS)\r
+        *\r
+        * @return      string          Absolute path to first "_temp_" folder of the current user, otherwise blank.\r
+        */\r
+       function userTempFolder() {\r
+               foreach($GLOBALS['FILEMOUNTS'] as $filePathInfo) {\r
+                       $tempFolder = $filePathInfo['path'] . '_temp_/';\r
+                       if (@is_dir($tempFolder)) {\r
+                               return $tempFolder;\r
+                       }\r
+               }\r
+       }\r
+\r
+\r
+}\r
+\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']) {\r
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']);\r
+}\r
+\r
+?>
\ No newline at end of file