Cleanup: Set SVN end of line property
authorOliver Hader <oliver.hader@typo3.org>
Sun, 13 Jun 2010 14:56:44 +0000 (14:56 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 13 Jun 2010 14:56:44 +0000 (14:56 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7906 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
ChangeLog
t3lib/interfaces/interface.t3lib_pageselect_getpageoverlayhook.php
t3lib/interfaces/interface.t3lib_pageselect_getrecordoverlayhook.php
t3lib/js/extjs/ux/flashmessages.js
t3lib/utility/class.t3lib_utility_mail.php
tests/t3lib/utility/t3lib_utility_mailTest.php
typo3/sysext/cms/tslib/interfaces/interface.tslib_menu_filterMenuPagesHook.php
typo3/sysext/impexp/task/class.tx_impexp_task.php
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/smileys/mozilla_public_license.txt
typo3/sysext/sys_action/task/class.tx_sysaction_task.php
typo3/sysext/t3skin/pngfix/iepngfix.js
typo3/sysext/t3skin/pngfix/iepngfix.php

index 24f4dff..58c538d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-06-13  Oliver Hader  <oliver@typo3.org>
 
        * Cleanup: Updated copyright comments
+       * Cleanup: Set SVN end of line property
 
 2010-06-13  Benjamin Mack  <benni@typo3.org>
 
index e773a70..e4cf769 100644 (file)
@@ -1,50 +1,50 @@
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>\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
-*  A copy is found in the textfile GPL.txt and important notices to the license\r
-*  from the author is found in LICENSE.txt distributed with these scripts.\r
-*\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
- * interface for classes which hook into t3lib_pageSelect\r
- *\r
- * @author     Tolleiv Nietsch <nietsch@aoemedia.de>\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- */\r
-interface t3lib_pageSelect_getPageOverlayHook {\r
-\r
-       /**\r
-        * enables to preprocess the pageoverlay\r
-        *\r
-        * @param array                         $pageInput      - the page record\r
-        * @param integer                       $lUid           - the overlay language\r
-        * @param t3lib_pageSelect      $parent         - the calling parent object\r
-        * @return void\r
-        */\r
-       public function getPageOverlay_preProcess(&$pageInput, &$lUid, t3lib_pageSelect $parent);\r
-\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>
+*  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!
+***************************************************************/
+
+
+/**
+ * interface for classes which hook into t3lib_pageSelect
+ *
+ * @author     Tolleiv Nietsch <nietsch@aoemedia.de>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+interface t3lib_pageSelect_getPageOverlayHook {
+
+       /**
+        * enables to preprocess the pageoverlay
+        *
+        * @param array                         $pageInput      - the page record
+        * @param integer                       $lUid           - the overlay language
+        * @param t3lib_pageSelect      $parent         - the calling parent object
+        * @return void
+        */
+       public function getPageOverlay_preProcess(&$pageInput, &$lUid, t3lib_pageSelect $parent);
+
+}
+
+?>
index 2f7d37e..f98af52 100644 (file)
@@ -1,63 +1,63 @@
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>\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
-*  A copy is found in the textfile GPL.txt and important notices to the license\r
-*  from the author is found in LICENSE.txt distributed with these scripts.\r
-*\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
- * interface for classes which hook into t3lib_pageSelect\r
- *\r
- * @author     Tolleiv Nietsch <nietsch@aoemedia.de>\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- */\r
-\r
-interface t3lib_pageSelect_getRecordOverlayHook {\r
-\r
-       /**\r
-        * Enables to preprocess a record overlay\r
-        *\r
-        * @param string $table\r
-        * @param array $row\r
-        * @param integer $sys_language_content\r
-        * @param string $OLmode\r
-        * @param t3lib_pageSelect $parent\r
-        */\r
-       public function getRecordOverlay_preProcess($table, &$row, &$sys_language_content, $OLmode, t3lib_pageSelect $parent);\r
-\r
-       /**\r
-        * Enables to postprocess a record overlay\r
-        *\r
-        * @param string $table\r
-        * @param array $row\r
-        * @param integer $sys_language_content\r
-        * @param string $OLmode\r
-        * @param t3lib_pageSelect $parent\r
-        */\r
-       public function getRecordOverlay_postProcess($table, &$row, &$sys_language_content, $OLmode, t3lib_pageSelect $parent);\r
-\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>
+*  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!
+***************************************************************/
+
+
+/**
+ * interface for classes which hook into t3lib_pageSelect
+ *
+ * @author     Tolleiv Nietsch <nietsch@aoemedia.de>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+
+interface t3lib_pageSelect_getRecordOverlayHook {
+
+       /**
+        * Enables to preprocess a record overlay
+        *
+        * @param string $table
+        * @param array $row
+        * @param integer $sys_language_content
+        * @param string $OLmode
+        * @param t3lib_pageSelect $parent
+        */
+       public function getRecordOverlay_preProcess($table, &$row, &$sys_language_content, $OLmode, t3lib_pageSelect $parent);
+
+       /**
+        * Enables to postprocess a record overlay
+        *
+        * @param string $table
+        * @param array $row
+        * @param integer $sys_language_content
+        * @param string $OLmode
+        * @param t3lib_pageSelect $parent
+        */
+       public function getRecordOverlay_postProcess($table, &$row, &$sys_language_content, $OLmode, t3lib_pageSelect $parent);
+
+}
+
+?>
index d9dc0be..66cca1b 100644 (file)
@@ -1,81 +1,81 @@
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2010 Steffen Kamper <info@sk-typo3.de>\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
- * Flashmessage rendered by ExtJS\r
- *\r
- *\r
- * @author Steffen Kamper <info@sk-typo3.de>\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- * @version $Id: $\r
- */\r
-Ext.ns('TYPO3');\r
-\r
-/**\r
- * @class TYPO3.Flashmessage\r
- * Passive popup box singleton\r
- * @singleton\r
- *\r
- * Example (Information message):\r
- * TYPO3.Flashmessage.display(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3);\r
- */\r
-TYPO3.Flashmessage = function() {\r
-       var messageContainer;\r
-       var severities = ['notice', 'information', 'ok', 'warning', 'error'];\r
-\r
-       function createBox(severity, title, message){\r
-               return ['<div class="typo3-message message-', severity, '" style="width: 400px">',\r
-                               '<div class="header-container">',\r
-                               '<div class="message-header">', title, '</div>',\r
-                               '</div>',\r
-                               '<div class="message-body">', message, '</div>',\r
-                               '</div>'].join('');\r
-       }\r
-\r
-       return {\r
-               /**\r
-                * Shows popup\r
-                * @member TYPO3.Flashmessage\r
-                * @param int severity (0=notice, 1=information, 2=ok, 3=warning, 4=error)\r
-                * @param string title\r
-                * @param string message\r
-                * @param float duration in sec (default 5)\r
-                */\r
-               display : function(severity, title, message, duration){\r
-                       duration = duration || 5;\r
-                       if(!messageContainer){\r
-                               messageContainer = Ext.DomHelper.insertFirst(document.body, {\r
-                                       id   : 'msg-div',\r
-                                       style: 'position:absolute;z-index:10000'\r
-                               }, true);\r
-                       }\r
-\r
-                       var box = Ext.DomHelper.append(messageContainer, {\r
-                               html: createBox(severities[severity], title, message)\r
-                       }, true);\r
-                       messageContainer.alignTo(document, 't-t');\r
-                       box.slideIn('t').pause(duration).ghost('t', {remove:true});\r
-               }\r
-       }\r
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 Steffen Kamper <info@sk-typo3.de>
+ *  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.
+ *
+ *  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!
+ ***************************************************************/
+
+/**
+ * Flashmessage rendered by ExtJS
+ *
+ *
+ * @author Steffen Kamper <info@sk-typo3.de>
+ * @package TYPO3
+ * @subpackage t3lib
+ * @version $Id: $
+ */
+Ext.ns('TYPO3');
+
+/**
+ * @class TYPO3.Flashmessage
+ * Passive popup box singleton
+ * @singleton
+ *
+ * Example (Information message):
+ * TYPO3.Flashmessage.display(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3);
+ */
+TYPO3.Flashmessage = function() {
+       var messageContainer;
+       var severities = ['notice', 'information', 'ok', 'warning', 'error'];
+
+       function createBox(severity, title, message){
+               return ['<div class="typo3-message message-', severity, '" style="width: 400px">',
+                               '<div class="header-container">',
+                               '<div class="message-header">', title, '</div>',
+                               '</div>',
+                               '<div class="message-body">', message, '</div>',
+                               '</div>'].join('');
+       }
+
+       return {
+               /**
+                * Shows popup
+                * @member TYPO3.Flashmessage
+                * @param int severity (0=notice, 1=information, 2=ok, 3=warning, 4=error)
+                * @param string title
+                * @param string message
+                * @param float duration in sec (default 5)
+                */
+               display : function(severity, title, message, duration){
+                       duration = duration || 5;
+                       if(!messageContainer){
+                               messageContainer = Ext.DomHelper.insertFirst(document.body, {
+                                       id   : 'msg-div',
+                                       style: 'position:absolute;z-index:10000'
+                               }, true);
+                       }
+
+                       var box = Ext.DomHelper.append(messageContainer, {
+                               html: createBox(severities[severity], title, message)
+                       }, true);
+                       messageContainer.alignTo(document, 't-t');
+                       box.slideIn('t').pause(duration).ghost('t', {remove:true});
+               }
+       }
 }();
\ No newline at end of file
index 0b651fc..73d878e 100644 (file)
@@ -1,78 +1,78 @@
-<?php\r
-/***************************************************************\r
- * Copyright notice\r
- *\r
- * (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>\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
- * A copy is found in the textfile GPL.txt and important notices to the license\r
- * from the author is found in LICENSE.txt distributed with these scripts.\r
- *\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
- * Class to handle mail specific functionality\r
- *\r
- * $Id: class.t3lib_utility_mail.php 6536 2009-11-25 14:07:18Z stucki $\r
- *\r
- *\r
- * @author      Tolleiv Nietsch <nietsch@aoemedia.de>\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- */\r
-final class t3lib_utility_Mail {\r
-\r
-       /**\r
-        * Proxy for the PHP mail() function. Adds possibility to hook in and send the mails in a different way.\r
-        * The hook can be used by adding function to the configuration array:\r
-        * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery']\r
-        *\r
-        * @param       string          Email address to send to.\r
-        * @param       string          Subject line, non-encoded. (see PHP function mail())\r
-        * @param       string          Message content, non-encoded. (see PHP function mail())\r
-        * @param       string          Additional headers for the mail (see PHP function mail())\r
-        * @param       string          Additional flags for the sending mail tool (see PHP function mail())\r
-        * @return      boolean         Indicates whether the mail has been sent or not\r
-        * @see         PHP function mail() []\r
-        * @link        http://www.php.net/manual/en/function.mail.php\r
-        */\r
-       public static function mail($to, $subject, $messageBody, $additionalHeaders = null, $additionalParameters = null) {\r
-               $success = TRUE;\r
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) {\r
-                       $parameters = array(\r
-                               'to' => $to,\r
-                               'subject' => $subject,\r
-                               'messageBody' => $messageBody,\r
-                               'additionalHeaders' => $additionalHeaders,\r
-                               'additionalParameters' => $additionalParameters,\r
-                       );\r
-                       $fakeThis = FALSE;\r
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'] as $hookMethod) {\r
-                               $success = $success && t3lib_div::callUserFunction($hookMethod, $parameters, $fakeThis);\r
-                       }\r
-               } else {\r
-                       $success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);\r
-               }\r
-\r
-               if (!$success) {\r
-                       t3lib_div::sysLog('Mail to "' . $email . '" could not be sent (Subject: "' . $subject . '").', 'Core', 3);\r
-               }\r
-               return $success;\r
-       }\r
-}\r
-?>\r
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>
+ * 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!
+ ***************************************************************/
+
+/**
+ * Class to handle mail specific functionality
+ *
+ * $Id: class.t3lib_utility_mail.php 6536 2009-11-25 14:07:18Z stucki $
+ *
+ *
+ * @author      Tolleiv Nietsch <nietsch@aoemedia.de>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+final class t3lib_utility_Mail {
+
+       /**
+        * Proxy for the PHP mail() function. Adds possibility to hook in and send the mails in a different way.
+        * The hook can be used by adding function to the configuration array:
+        * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery']
+        *
+        * @param       string          Email address to send to.
+        * @param       string          Subject line, non-encoded. (see PHP function mail())
+        * @param       string          Message content, non-encoded. (see PHP function mail())
+        * @param       string          Additional headers for the mail (see PHP function mail())
+        * @param       string          Additional flags for the sending mail tool (see PHP function mail())
+        * @return      boolean         Indicates whether the mail has been sent or not
+        * @see         PHP function mail() []
+        * @link        http://www.php.net/manual/en/function.mail.php
+        */
+       public static function mail($to, $subject, $messageBody, $additionalHeaders = null, $additionalParameters = null) {
+               $success = TRUE;
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) {
+                       $parameters = array(
+                               'to' => $to,
+                               'subject' => $subject,
+                               'messageBody' => $messageBody,
+                               'additionalHeaders' => $additionalHeaders,
+                               'additionalParameters' => $additionalParameters,
+                       );
+                       $fakeThis = FALSE;
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'] as $hookMethod) {
+                               $success = $success && t3lib_div::callUserFunction($hookMethod, $parameters, $fakeThis);
+                       }
+               } else {
+                       $success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);
+               }
+
+               if (!$success) {
+                       t3lib_div::sysLog('Mail to "' . $email . '" could not be sent (Subject: "' . $subject . '").', 'Core', 3);
+               }
+               return $success;
+       }
+}
+?>
index 8633824..db8f4bb 100644 (file)
@@ -1,98 +1,98 @@
-<?php\r
-/***************************************************************\r
-* Copyright notice\r
-*\r
-* (c) 2010 Oliver Klee (typo3-coding@oliverklee.de)\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
- * Testcase for the t3lib_utility_Mail class.\r
- *\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- *\r
- * @author Oliver Klee <typo3-coding@oliverklee.de>\r
- */\r
-class t3lib_utility_mailTest extends tx_phpunit_testcase {\r
-       /**\r
-        * backed-up TYPO3_CONF_VARS SC_OPTIONS\r
-        *\r
-        * @var array\r
-        */\r
-       private $scOptionsBackup = array();\r
-\r
-       /**\r
-        * backed-up T3_VAR callUserFunction\r
-        *\r
-        * @var array\r
-        */\r
-       private $callUserFunctionBackup = array();\r
-\r
-       public function setUp() {\r
-               $this->scOptionsBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'];\r
-               $this->callUserFunctionBackup = $GLOBALS['T3_VAR']['callUserFunction'];\r
-       }\r
-\r
-       public function tearDown() {\r
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] = $this->scOptionsBackup;\r
-               $GLOBALS['T3_VAR']['callUserFunction'] = $this->callUserFunctionBackup;\r
-       }\r
-\r
-\r
-       //////////////////////////\r
-       // Tests concerning mail\r
-       //////////////////////////\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function mailCallsHook() {\r
-               $to = 'john@example.com';\r
-               $subject = 'Good news everybody!';\r
-               $messageBody = 'The hooks works!';\r
-               $additionalHeaders = 'Reply-to: jane@example.com';\r
-               $additionalParameters = '-f postmaster@example.com';\r
-\r
-               $mockMailer = $this->getMock('mockMailer', array('mail'));\r
-               $mockMailer->expects($this->once())->method('mail')\r
-                       ->with(\r
-                               array(\r
-                                       'to' => $to,\r
-                                       'subject' => $subject,\r
-                                       'messageBody' => $messageBody,\r
-                                       'additionalHeaders' => $additionalHeaders,\r
-                                       'additionalParameters' => $additionalParameters,\r
-                               ),\r
-                               FALSE\r
-                       );\r
-               $GLOBALS['T3_VAR']['callUserFunction']['mockMailer->mail']\r
-                       = array('obj' => $mockMailer, 'method' => 'mail');\r
-\r
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']\r
-                       ['t3lib/utility/class.t3lib_utility_mail.php']\r
-                       ['substituteMailDelivery'] = array('mockMailer->mail');\r
-\r
-               t3lib_utility_Mail::mail(\r
-                       $to, $subject, $messageBody, $additionalHeaders,\r
-                       $additionalParameters\r
-               );\r
-       }\r
-}\r
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2010 Oliver Klee (typo3-coding@oliverklee.de)
+* 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.
+*
+* 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!
+***************************************************************/
+
+/**
+ * Testcase for the t3lib_utility_Mail class.
+ *
+ * @package TYPO3
+ * @subpackage t3lib
+ *
+ * @author Oliver Klee <typo3-coding@oliverklee.de>
+ */
+class t3lib_utility_mailTest extends tx_phpunit_testcase {
+       /**
+        * backed-up TYPO3_CONF_VARS SC_OPTIONS
+        *
+        * @var array
+        */
+       private $scOptionsBackup = array();
+
+       /**
+        * backed-up T3_VAR callUserFunction
+        *
+        * @var array
+        */
+       private $callUserFunctionBackup = array();
+
+       public function setUp() {
+               $this->scOptionsBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'];
+               $this->callUserFunctionBackup = $GLOBALS['T3_VAR']['callUserFunction'];
+       }
+
+       public function tearDown() {
+               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] = $this->scOptionsBackup;
+               $GLOBALS['T3_VAR']['callUserFunction'] = $this->callUserFunctionBackup;
+       }
+
+
+       //////////////////////////
+       // Tests concerning mail
+       //////////////////////////
+
+       /**
+        * @test
+        */
+       public function mailCallsHook() {
+               $to = 'john@example.com';
+               $subject = 'Good news everybody!';
+               $messageBody = 'The hooks works!';
+               $additionalHeaders = 'Reply-to: jane@example.com';
+               $additionalParameters = '-f postmaster@example.com';
+
+               $mockMailer = $this->getMock('mockMailer', array('mail'));
+               $mockMailer->expects($this->once())->method('mail')
+                       ->with(
+                               array(
+                                       'to' => $to,
+                                       'subject' => $subject,
+                                       'messageBody' => $messageBody,
+                                       'additionalHeaders' => $additionalHeaders,
+                                       'additionalParameters' => $additionalParameters,
+                               ),
+                               FALSE
+                       );
+               $GLOBALS['T3_VAR']['callUserFunction']['mockMailer->mail']
+                       = array('obj' => $mockMailer, 'method' => 'mail');
+
+               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']
+                       ['t3lib/utility/class.t3lib_utility_mail.php']
+                       ['substituteMailDelivery'] = array('mockMailer->mail');
+
+               t3lib_utility_Mail::mail(
+                       $to, $subject, $messageBody, $additionalHeaders,
+                       $additionalParameters
+               );
+       }
+}
 ?>
\ No newline at end of file
index f49fb16..40ae332 100644 (file)
@@ -1,50 +1,50 @@
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>\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
-*  A copy is found in the textfile GPL.txt and important notices to the license\r
-*  from the author is found in LICENSE.txt distributed with these scripts.\r
-*\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
- * interface for classes which hook into tslib_menu\r
- *\r
- * @author     Tolleiv Nietsch <nietsch@aoemedia.de>\r
- * @package TYPO3\r
- */\r
-\r
-interface tslib_menu_filterMenuPagesHook {\r
-\r
-       /**\r
-        * Checks if a page is OK to include in the final menu item array.\r
-        *\r
-        * @param       array           Array of menu items\r
-        * @param       array           Array of page uids which are to be excluded\r
-        * @param       boolean         If set, then the page is a spacer.\r
-        * @param       tslib_tmenu     The menu object\r
-        * @return      boolean         Returns true if the page can be safely included.\r
-        */\r
-       public function tslib_menu_filterMenuPagesHook (array &$data, array $banUidArray, $spacer, tslib_tmenu $obj);\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>
+*  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!
+***************************************************************/
+
+
+/**
+ * interface for classes which hook into tslib_menu
+ *
+ * @author     Tolleiv Nietsch <nietsch@aoemedia.de>
+ * @package TYPO3
+ */
+
+interface tslib_menu_filterMenuPagesHook {
+
+       /**
+        * Checks if a page is OK to include in the final menu item array.
+        *
+        * @param       array           Array of menu items
+        * @param       array           Array of page uids which are to be excluded
+        * @param       boolean         If set, then the page is a spacer.
+        * @param       tslib_tmenu     The menu object
+        * @return      boolean         Returns true if the page can be safely included.
+        */
+       public function tslib_menu_filterMenuPagesHook (array &$data, array $banUidArray, $spacer, tslib_tmenu $obj);
+}
+
+?>
index 41a6545..25638f4 100644 (file)
-<?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
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
+*  (c) 2010 Georg Ringer (typo3@ringerge.org)
+*  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.
+*
+*  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!
+***************************************************************/
+
+
+/**
+ * This class provides a textarea to save personal notes
+ *
+ * @author             Kasper Skaarhoj <kasper@typo3.com>
+ * @author             Georg Ringer <typo3@ringerge.org>
+ * @package            TYPO3
+ * @subpackage impexp
+ *
+ */
+class tx_impexp_task implements tx_taskcenter_Task {
+       /**
+        * Back-reference to the calling reports module
+        *
+        * @var tx_reports_Module       $taskObject
+        */
+       protected $taskObject;
+
+       /**
+        * Constructor
+        */
+       public function __construct(SC_mod_user_task_index $taskObject) {
+               $this->taskObject = $taskObject;
+               $GLOBALS['LANG']->includeLLFile('EXT:impexp/locallang_csh.xml');
+       }
+
+       /**
+        * This method renders the report
+        *
+        * @return      string  The status report as HTML
+        */
+       public function getTask() {
+               return $this->main();
+       }
+
+       /**
+        * Render an optional additional information for the 1st view in taskcenter.
+        * Empty for this task
+        *
+        * @return      string          Overview as HTML
+        */
+       public function getOverview() {
+               return '';
+       }
+
+
+
+       /**
+        * Main Task center module
+        *
+        * @return      string          HTML content.
+        */
+       public function main() {
+               $content = '';
+               $id = intval(t3lib_div::_GP('display'));
+
+                       // if a preset is found, it is rendered using an iframe
+               if($id > 0) {
+                       $url = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id;
+                       return $this->taskObject->urlInIframe($url, 1);
+               } else {
+                               // header
+                       $content .= $this->taskObject->description(
+                                                       $GLOBALS['LANG']->getLL('.alttitle'),
+                                                       $GLOBALS['LANG']->getLL('.description')
+                                               );
+
+                       $thumbnails = $lines = array();
+
+                               // Thumbnail folder and files:
+                       $tempDir = $this->userTempFolder();
+                       if ($tempDir) {
+                               $thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1);
+                       }
+
+                       $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
+                       $usernames = t3lib_BEfunc::getUserNames();
+
+                               // Create preset links:
+                       $presets = $this->getPresets();
+
+                               // if any presets found
+                       if (is_array($presets)) {
+                               foreach($presets as $key => $presetCfg) {
+                                       $configuration = unserialize($presetCfg['preset_data']);
+                                       $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
+                                       $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '['.$presetCfg['uid'].']';
+
+                                       if ($thumbnailFile && 1==2) {
+                                               // @todo: create icon or maybe completly remove it because where to display?
+                                               $src=  '../' . $GLOBALS['BACK_PATH'] .  substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile);
+                                               $icon = $src;
+                                       } else {
+                                               $icon = 'EXT:impexp/export.gif';
+                                       }
+
+                                       $description = array();
+
+                                               // is public?
+                                       if ($presetCfg['public']) {
+                                               $description[] = $GLOBALS['LANG']->getLL('task.public') . ': ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
+                                       }
+
+                                               // owner
+                                       $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']) . ']');
+
+                                               // page & path
+                                       if ($configuration['pagetree']['id']) {
+                                               $description[] = $GLOBALS['LANG']->getLL('task.page') . ': ' . $configuration['pagetree']['id'];
+                                               $description[] = $GLOBALS['LANG']->getLL('task.path') . ': ' . htmlspecialchars(t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'], $clause, 20));
+                                       } else {
+                                               $description[] = $GLOBALS['LANG']->getLL('single-record');
+                                       }
+
+                                               // Meta information
+                                       if ($configuration['meta']['title'] || $configuration['meta']['description'] || $configuration['meta']['notes']) {
+                                               $metaInformation = '';
+                                               if ($configuration['meta']['title']) {
+                                                       $metaInformation .= '<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />';
+                                               }
+                                               if ($configuration['meta']['description']) {
+                                                       $metaInformation .= htmlspecialchars($configuration['meta']['description']);
+                                               }
+                                               if ($configuration['meta']['notes']) {
+                                                       $metaInformation .= '<br /><br />
+                                                                                               <strong>' . $GLOBALS['LANG']->getLL('notes') . ': </strong>
+                                                                                               <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>';
+                                               }
+
+                                               $description[] = '<br />' . $metaInformation;
+                                       }
+
+                                               // collect all preset information
+                                       $lines[$key] = array(
+                                               'icon' => $icon,
+                                               'title' => htmlspecialchars($title),
+                                               'descriptionHtml' => implode('<br />', $description),
+                                               'link' => 'mod.php?M=user_task&SET[function]=impexp.tasks&display=' . $presetCfg['uid']
+                                       );
+
+                               }
+
+                                       // render preset list
+                               $content .= $this->taskObject->renderListMenu($lines);
+                       } else {
+                                       // no presets found
+                               $flashMessage = t3lib_div::makeInstance(
+                                       't3lib_FlashMessage',
+                                       $GLOBALS['LANG']->getLL('no-presets'),
+                                       '',
+                                       t3lib_FlashMessage::NOTICE
+
+                               );
+                               $content .= $flashMessage->render();
+                       }
+               }
+
+               return $content;
+       }
+
+
+       /**
+        * Select presets for this user
+        *
+        * @return      array           Array of preset records
+        */
+       function getPresets() {
+               $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               '*',
+                               'tx_impexp_presets',
+                               '(public > 0 OR user_uid=' . $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.
+        */
+       function userTempFolder() {
+               foreach($GLOBALS['FILEMOUNTS'] as $filePathInfo) {
+                       $tempFolder = $filePathInfo['path'] . '_temp_/';
+                       if (@is_dir($tempFolder)) {
+                               return $tempFolder;
+                       }
+               }
+       }
+
+
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']);
+}
+
 ?>
\ No newline at end of file
index 6481118..82e4754 100644 (file)
@@ -1,18 +1,18 @@
-FOR TRANSLATIONS OF THIS LICENSE INTO SELECTED LANGUAGES, PLEASE VISIT WWW.MOZILLA.ORG/LICENSING.\r
-\r
-  MOZILLA FOUNDATION\r
-  MOZILLA THUNDERBIRD END-USER SOFTWARE LICENSE AGREEMENT\r
-\r
-A SOURCE CODE VERSION OF CERTAIN THUNDERBIRD E-MAIL FUNCTIONALITY THAT YOU MAY USE, MODIFY AND DISTRIBUTE IS AVAILABLE TO YOU FREE-OF-CHARGE FROM WWW.MOZILLA.ORG UNDER THE MOZILLA PUBLIC LICENSE and other open source software licenses. \r
-The accompanying executable code version of Mozilla Thunderbird and related documentation (the "Product") is made available to you under the terms of this MOZILLA THUNDERBIRD END-USER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT").  BY CLICKING THE "ACCEPT" BUTTON, OR BY INSTALLING OR USING THE MOZILLA THUNDERBIRD E-MAIL CLIENT, YOU ARE CONSENTING TO BE BOUND BY THE AGREEMENT.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT CLICK THE "ACCEPT" BUTTON, AND DO NOT INSTALL OR USE ANY PART OF THE MOZILLA THUNDERBIRD E-MAIL CLIENT.\r
-DURING THE MOZILLA THUNDERBIRD INSTALLATION PROCESS, AND AT LATER TIMES, YOU MAY BE GIVEN THE OPTION OF INSTALLING ADDITIONAL COMPONENTS FROM THIRD-PARTY SOFTWARE PROVIDERS.  THE INSTALLATION AND USE OF THOSE THIRD-PARTY COMPONENTS MAY BE GOVERNED BY ADDITIONAL LICENSE AGREEMENTS.\r
-1. LICENSE GRANT. The Mozilla Foundation grants you a non-exclusive license to use the executable code version of the Product.  This Agreement will also govern any software upgrades provided by Mozilla that replace and/or supplement the original Product, unless such upgrades are accompanied by a separate license, in which case the terms of that license will govern.\r
-2.  TERMINATION.  If you breach this Agreement your right to use the Product will terminate immediately and without notice, but all provisions of this Agreement except the License Grant (Paragraph 1) will survive termination and continue in effect.  Upon termination, you must destroy all copies of the Product.\r
-3.  PROPRIETARY RIGHTS.  Portions of the Product are available in source code form under the terms of the Mozilla Public License and other open source licenses (collectively, "Open Source Licenses") at http://www.mozilla.org.  Nothing in this Agreement will be construed to limit any rights granted under the Open Source Licenses.  Subject to the foregoing, Mozilla, for itself and on behalf of its licensors, hereby reserves all intellectual property rights in the Product, except for the rights expressly granted in this Agreement.  You may not remove or alter any trademark, logo, copyright or other proprietary notice in or on the Product.  This license does not grant you any right to use the trademarks, service marks or logos of Mozilla or its licensors. \r
-4.  DISCLAIMER OF WARRANTY.  THE PRODUCT IS PROVIDED "AS IS" WITH ALL FAULTS.  TO THE EXTENT PERMITTED BY LAW, MOZILLA AND MOZILLA'S LICENSORS HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE AND NON-INFRINGING.  YOU BEAR ENTIRE RISK AS TO SELECTING THE PRODUCT FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT.  THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.   SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.\r
-5.  LIMITATION OF LIABILITY.  EXCEPT AS REQUIRED BY LAW, MOZILLA AND ITS DIRECTORS, LICENSORS, CONTRIBUTORS AND AGENTS (COLLECTIVELY, THE "MOZILLA GROUP") WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED.  THE MOZILLA GROUP'S COLLECTIVE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE GREATER OF $500 (FIVE HUNDRED DOLLARS) AND THE FEES PAID BY YOU UNDER THIS LICENSE (IF ANY).  SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.\r
-6.  EXPORT CONTROLS.  This license is subject to all applicable export restrictions.  You must comply with all export and import laws and restrictions and regulations of any United States or foreign agency or authority relating to the Product and its use.  \r
-7.  U.S. GOVERNMENT END-USERS.  The Product is a "commercial item," as that term is defined in 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995) and 48 C.F.R. 227.7202 (June 1995). Consistent with 48 C.F.R. 12.212, 48 C.F.R. 27.405(b)(2) (June 1998) and 48 C.F.R. 227.7202, all U.S. Government End Users acquire the Product with only those rights as set forth herein.\r
-8.  MISCELLANEOUS.  (a) This Agreement constitutes the entire agreement between Mozilla and you concerning the subject matter hereof, and it may only be modified by a written amendment signed by an authorized executive of Mozilla.  (b) Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions.  (c) This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods.  (d) If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties' original intent, and the remaining portions will remain in full force and effect.  (e) A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof.  (f) Except as required by law, the controlling language of this Agreement is English.  (g) You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms; the Mozilla Foundation may assign its rights under this Agreement without condition.  (h) This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns.  \r
-\r
-\r
+FOR TRANSLATIONS OF THIS LICENSE INTO SELECTED LANGUAGES, PLEASE VISIT WWW.MOZILLA.ORG/LICENSING.
+
+  MOZILLA FOUNDATION
+  MOZILLA THUNDERBIRD END-USER SOFTWARE LICENSE AGREEMENT
+
+A SOURCE CODE VERSION OF CERTAIN THUNDERBIRD E-MAIL FUNCTIONALITY THAT YOU MAY USE, MODIFY AND DISTRIBUTE IS AVAILABLE TO YOU FREE-OF-CHARGE FROM WWW.MOZILLA.ORG UNDER THE MOZILLA PUBLIC LICENSE and other open source software licenses. 
+The accompanying executable code version of Mozilla Thunderbird and related documentation (the "Product") is made available to you under the terms of this MOZILLA THUNDERBIRD END-USER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT").  BY CLICKING THE "ACCEPT" BUTTON, OR BY INSTALLING OR USING THE MOZILLA THUNDERBIRD E-MAIL CLIENT, YOU ARE CONSENTING TO BE BOUND BY THE AGREEMENT.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT CLICK THE "ACCEPT" BUTTON, AND DO NOT INSTALL OR USE ANY PART OF THE MOZILLA THUNDERBIRD E-MAIL CLIENT.
+DURING THE MOZILLA THUNDERBIRD INSTALLATION PROCESS, AND AT LATER TIMES, YOU MAY BE GIVEN THE OPTION OF INSTALLING ADDITIONAL COMPONENTS FROM THIRD-PARTY SOFTWARE PROVIDERS.  THE INSTALLATION AND USE OF THOSE THIRD-PARTY COMPONENTS MAY BE GOVERNED BY ADDITIONAL LICENSE AGREEMENTS.
+1. LICENSE GRANT. The Mozilla Foundation grants you a non-exclusive license to use the executable code version of the Product.  This Agreement will also govern any software upgrades provided by Mozilla that replace and/or supplement the original Product, unless such upgrades are accompanied by a separate license, in which case the terms of that license will govern.
+2.  TERMINATION.  If you breach this Agreement your right to use the Product will terminate immediately and without notice, but all provisions of this Agreement except the License Grant (Paragraph 1) will survive termination and continue in effect.  Upon termination, you must destroy all copies of the Product.
+3.  PROPRIETARY RIGHTS.  Portions of the Product are available in source code form under the terms of the Mozilla Public License and other open source licenses (collectively, "Open Source Licenses") at http://www.mozilla.org.  Nothing in this Agreement will be construed to limit any rights granted under the Open Source Licenses.  Subject to the foregoing, Mozilla, for itself and on behalf of its licensors, hereby reserves all intellectual property rights in the Product, except for the rights expressly granted in this Agreement.  You may not remove or alter any trademark, logo, copyright or other proprietary notice in or on the Product.  This license does not grant you any right to use the trademarks, service marks or logos of Mozilla or its licensors. 
+4.  DISCLAIMER OF WARRANTY.  THE PRODUCT IS PROVIDED "AS IS" WITH ALL FAULTS.  TO THE EXTENT PERMITTED BY LAW, MOZILLA AND MOZILLA'S LICENSORS HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE AND NON-INFRINGING.  YOU BEAR ENTIRE RISK AS TO SELECTING THE PRODUCT FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT.  THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.   SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
+5.  LIMITATION OF LIABILITY.  EXCEPT AS REQUIRED BY LAW, MOZILLA AND ITS DIRECTORS, LICENSORS, CONTRIBUTORS AND AGENTS (COLLECTIVELY, THE "MOZILLA GROUP") WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED.  THE MOZILLA GROUP'S COLLECTIVE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE GREATER OF $500 (FIVE HUNDRED DOLLARS) AND THE FEES PAID BY YOU UNDER THIS LICENSE (IF ANY).  SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+6.  EXPORT CONTROLS.  This license is subject to all applicable export restrictions.  You must comply with all export and import laws and restrictions and regulations of any United States or foreign agency or authority relating to the Product and its use.  
+7.  U.S. GOVERNMENT END-USERS.  The Product is a "commercial item," as that term is defined in 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995) and 48 C.F.R. 227.7202 (June 1995). Consistent with 48 C.F.R. 12.212, 48 C.F.R. 27.405(b)(2) (June 1998) and 48 C.F.R. 227.7202, all U.S. Government End Users acquire the Product with only those rights as set forth herein.
+8.  MISCELLANEOUS.  (a) This Agreement constitutes the entire agreement between Mozilla and you concerning the subject matter hereof, and it may only be modified by a written amendment signed by an authorized executive of Mozilla.  (b) Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions.  (c) This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods.  (d) If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties' original intent, and the remaining portions will remain in full force and effect.  (e) A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof.  (f) Except as required by law, the controlling language of this Agreement is English.  (g) You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms; the Mozilla Foundation may assign its rights under this Agreement without condition.  (h) This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns.  
+
+
index b150590..e9f601e 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@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 task for the taskcenter\r
- *\r
- * @author             Kasper Skaarhoj <kasperYYYY@typo3.com>\r
- * @author             Georg Ringer <typo3@ringerge.org>\r
- * @package            TYPO3\r
- * @subpackage tx_sysaction\r
- *\r
- */\r
-class tx_sysaction_task implements tx_taskcenter_Task {\r
-\r
-       protected $taskObject;\r
-       var $t3lib_TCEforms;\r
-\r
-       /**\r
-        * Constructor\r
-        */\r
-       public function __construct(SC_mod_user_task_index $taskObject) {\r
-               $this->taskObject = $taskObject;\r
-               $GLOBALS['LANG']->includeLLFile('EXT:sys_action/locallang.xml');\r
-       }\r
-\r
-\r
-       /**\r
-        * This method renders the task\r
-        *\r
-        * @return      string  The task as HTML\r
-        */\r
-       public function getTask() {\r
-               $content = '';\r
-               $show = intval(t3lib_div::_GP('show'));\r
-\r
-                       // if no task selected, render the menu\r
-               if ($show == 0) {\r
-                       $content .= $this->taskObject->description(\r
-                                                       $GLOBALS['LANG']->getLL('sys_action'),\r
-                                                       $GLOBALS['LANG']->getLL('description')\r
-                                               );\r
-\r
-                       $content .= $this->renderActionList();\r
-               } else {\r
-                       $record = t3lib_BEfunc::getRecord('sys_action', $show);\r
-\r
-                               // if the action is not found\r
-                       if (count($record) == 0) {\r
-                               $flashMessage = t3lib_div::makeInstance(\r
-                                       't3lib_FlashMessage',\r
-                                       $GLOBALS['LANG']->getLL('action_error-not-found', true),\r
-                                       $GLOBALS['LANG']->getLL('action_error'),\r
-                                       t3lib_FlashMessage::ERROR\r
-                               );\r
-                               $content .= $flashMessage->render();\r
-                       } else {\r
-                                       // render the task\r
-                               $content .= $this->taskObject->description($record['title'], $record['description']);\r
-\r
-                                       // output depends on the type\r
-                               switch ($record['type']) {\r
-                                       case 1:\r
-                                               $content .= $this->viewNewBackendUser($record);\r
-                                               break;\r
-                                       case 2:\r
-                                               $content .= $this->viewSqlQuery($record);\r
-                                               break;\r
-                                       case 3:\r
-                                               $content .= $this->viewRecordList($record);\r
-                                               break;\r
-                                       case 4:\r
-                                               $content .= $this->viewEditRecord($record);\r
-                                               break;\r
-                                       case 5:\r
-                                               $content .= $this->viewNewRecord($record);\r
-                                               break;\r
-                                       default:\r
-                                               $flashMessage = t3lib_div::makeInstance(\r
-                                                       't3lib_FlashMessage',\r
-                                                       $GLOBALS['LANG']->getLL('action_noType', true),\r
-                                                       $GLOBALS['LANG']->getLL('action_error'),\r
-                                                       t3lib_FlashMessage::ERROR\r
-                                               );\r
-                                               $content .= '<br />' . $flashMessage->render();\r
-                               }\r
-                       }\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Gemeral overview over the task in the taskcenter menu\r
-        *\r
-        * @return      string Overview as HTML\r
-        */\r
-       public function getOverview() {\r
-               $content = '<p>' . $GLOBALS['LANG']->getLL('description') . '</p>';\r
-\r
-                       // get the actions\r
-               $lines = $this->getActions();\r
-               if (count($lines) > 0) {\r
-                       $items = '';\r
-\r
-                               // render a single action menu item\r
-                       foreach ($lines as $line) {\r
-                               $active = (t3lib_div::_GP('show') === $line['uid']) ? ' class="active" ' : '';\r
-                               $items .= '<li' . $active . '>\r
-                                                               <a href="' . $line['link'] . '" title="' . htmlspecialchars($line['description']) . '">' .\r
-                                                                       htmlspecialchars($line['title']) .\r
-                                                               '</a>\r
-                                                       </li>';\r
-                       }\r
-                       $content .= '<ul>' . $items . '</ul>';\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Get all actions of an user. Admins can see any action, all others only those\r
-        * whic are allowed in sys_action record itself.\r
-        *\r
-        * @param       boolean         $toOverview: If true, the link redirects to the taskcenter\r
-        * @return      array Array holding every needed information of a sys_action\r
-        */\r
-       protected function getActions() {\r
-               $lines = array();\r
-\r
-                       // admins can see any record\r
-               if ($GLOBALS['BE_USER']->isAdmin()) {\r
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r
-                               '*',\r
-                               'sys_action',\r
-                               '',\r
-                               '',\r
-                               'sys_action.sorting'\r
-                       );\r
-               } else {\r
-                               // editors can only see the actions which are assigned to a usergroup they belong to\r
-                       $additionalWhere = 'be_groups.uid IN (' . ($GLOBALS['BE_USER']->groupList ? $GLOBALS['BE_USER']->groupList : 0) . ')';\r
-\r
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\r
-                               'sys_action.*',\r
-                               'sys_action',\r
-                               'sys_action_asgr_mm',\r
-                               'be_groups',\r
-                               ' AND sys_action.hidden=0 AND ' . $additionalWhere,\r
-                               'sys_action.uid',\r
-                               'sys_action.sorting'\r
-                       );\r
-               }\r
-\r
-               while($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
-                       $editActionLink = '';\r
-\r
-                               // admins are allowed to edit sys_action records\r
-                       if ($GLOBALS['BE_USER']->isAdmin()) {\r
-                               $returnUrl = rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));\r
-                               $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl . '&edit[sys_action][' . $actionRow['uid'] . ']=edit';\r
-\r
-                               $editActionLink = '<a class="edit" href="' . $link . '">' .\r
-                                               '<img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif') . ' title="' . $GLOBALS['LANG']->getLL('edit-sys_action') . '" alt="" />' .\r
-                                                       $GLOBALS['LANG']->getLL('edit-sys_action') .\r
-                                               '</a>';\r
-                       }\r
-\r
-                       $lines[] = array(\r
-                               'uid'                           => $actionRow['uid'],\r
-                               'title'                         => $actionRow['title'],\r
-                               'description'           => $actionRow['description'],\r
-                               'descriptionHtml'       => nl2br(htmlspecialchars($actionRow['description'])) . $editActionLink,\r
-                               'link'                          => 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . $actionRow['uid'],\r
-                               'icon'                          => 'EXT:sys_action/sys_action.gif'\r
-                       );\r
-               }\r
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);\r
-\r
-               return $lines;\r
-       }\r
-\r
-       /**\r
-        * Render the menu of sys_actions\r
-        *\r
-        * @return      string list of sys_actions as HTML\r
-        */\r
-       protected function renderActionList() {\r
-               $content = '';\r
-\r
-                       // get the sys_action records\r
-               $lines = $this->getActions();\r
-\r
-                       // if any actions are found for the current users\r
-               if (count($lines) > 0) {\r
-                       $content .= $this->taskObject->renderListMenu($lines);\r
-               } else {\r
-                       $flashMessage = t3lib_div::makeInstance (\r
-                               't3lib_FlashMessage',\r
-                               $GLOBALS['LANG']->getLL('action_not-found-description', true),\r
-                               $GLOBALS['LANG']->getLL('action_not-found'),\r
-                               t3lib_FlashMessage::INFO\r
-                       );\r
-                       $content .= $flashMessage->render();\r
-               }\r
-\r
-                       // Admin users can create a new action\r
-               if ($GLOBALS['BE_USER']->isAdmin()) {\r
-                       $returnUrl = rawurlencode('mod.php?M=user_task');\r
-                       $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl. '&edit[sys_action][0]=new';\r
-\r
-                       $content .= '<br />\r
-                                                <a href="' . $link . '" title="' . $GLOBALS['LANG']->getLL('new-sys_action') . '">' .\r
-                                                       '<img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_record.gif') . ' title="' . $GLOBALS['LANG']->getLL('new-sys_action') . '" alt="" /> ' .\r
-                                                       $GLOBALS['LANG']->getLL('new-sys_action') .\r
-                                                '</a>';\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Action to create a new BE user\r
-        *\r
-        * @param       array           $record: sys_action record\r
-        * @return      string form to create a new user\r
-        */\r
-       protected function viewNewBackendUser($record) {\r
-               $content = '';\r
-\r
-               $beRec = t3lib_BEfunc::getRecord('be_users', intval($record['t1_copy_of_user']));\r
-                       // a record is neeed which is used as copy for the new user\r
-               if (!is_array($beRec)) {\r
-                       $flashMessage = t3lib_div::makeInstance(\r
-                               't3lib_FlashMessage',\r
-                               $GLOBALS['LANG']->getLL('action_notReady', true),\r
-                               $GLOBALS['LANG']->getLL('action_error'),\r
-                               t3lib_FlashMessage::ERROR\r
-                       );\r
-                       $content .= $flashMessage->render();\r
-\r
-                       return $content;\r
-               }\r
-\r
-               $userRecord = array();\r
-               $newFlag = 0;\r
-               $vars = t3lib_div::_POST('data');\r
-               $key = 'NEW';\r
-\r
-               if ($vars['sent'] == 1) {\r
-                       $errors = array();\r
-\r
-                               // basic error checks\r
-                       if (!empty($vars['email']) && !t3lib_div::validEmail($vars['email'])) {\r
-                               $errors[] = $GLOBALS['LANG']->getLL('error-wrong-email');\r
-                       }\r
-                       if (empty($vars['username'])) {\r
-                               $errors[] = $GLOBALS['LANG']->getLL('error-username-empty');\r
-                       }\r
-                       if (empty($vars['password'])) {\r
-                               $errors[] = $GLOBALS['LANG']->getLL('error-password-empty');\r
-                       }\r
-                       if ($vars['key'] !== 'NEW' && !$this->isCreatedByUser($vars['key'], $record)) {\r
-                               $errors[] = $GLOBALS['LANG']->getLL('error-wrong-user');\r
-                       }\r
-\r
-                               // show errors if there are any\r
-                       if (count($errors) > 0) {\r
-                               $flashMessage = t3lib_div::makeInstance (\r
-                                       't3lib_FlashMessage',\r
-                                       implode('<br />', $errors),\r
-                                       $GLOBALS['LANG']->getLL('action_error'),\r
-                                       t3lib_FlashMessage::ERROR\r
-                               );\r
-                               $content .= $flashMessage->render() . '<br />';\r
-                       } else {\r
-                                       // save user\r
-                               $key = $this->saveNewBackendUser($record, $vars);\r
-\r
-                                       // success messsage\r
-                               $flashMessage = t3lib_div::makeInstance (\r
-                                       't3lib_FlashMessage',\r
-                                       ($vars['key'] === 'NEW' ? $GLOBALS['LANG']->getLL('success-user-created') : $GLOBALS['LANG']->getLL('success-user-updated')),\r
-                                       $GLOBALS['LANG']->getLL('success'),\r
-                                       t3lib_FlashMessage::OK\r
-                               );\r
-                               $content .= $flashMessage->render() . '<br />' ;\r
-                       }\r
-\r
-               }\r
-\r
-\r
-                       // load BE user to edit\r
-               if (intval(t3lib_div::_GP('be_users_uid')) > 0) {\r
-                       $tmpUserId = intval(t3lib_div::_GP('be_users_uid'));\r
-\r
-                       $rawRecord = $this->isCreatedByUser($tmpUserId, $record);\r
-\r
-                       if ($rawRecord) {\r
-                                       // delete user\r
-                               if (t3lib_div::_GP('delete') == 1) {\r
-                                       $this->deleteUser($tmpUserId, $record['uid']);\r
-                               }\r
-\r
-                               $key = $tmpUserId;\r
-                               $vars = $rawRecord;\r
-                       }\r
-\r
-               }\r
-\r
-               $this->JScode();\r
-               $loadDB = t3lib_div::makeInstance('t3lib_loadDBGroup');\r
-               $loadDB->start($vars['db_mountpoints'], 'pages');\r
-\r
-               $content .= '<form action="" method="post" enctype="multipart/form-data">\r
-                                               <fieldset class="fields">\r
-                                                       <legend>General fields</legend>\r
-                                                       <div class="row">\r
-                                                               <label for="disable">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.disable') . '</label>\r
-                                                               <input type="checkbox" id="disable" name="data[disable]" value="1" class="checkbox" ' . ($vars['disable'] == 1 ? ' checked="checked" ' : '') . ' />\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <label for="realname">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.name') . '</label>\r
-                                                               <input type="text" id="realname" name="data[realName]" value="' . htmlspecialchars($vars['realName']) .'" />\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <label for="username">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.username') . '</label>\r
-                                                               <input type="text" id="username" name="data[username]" value="' . htmlspecialchars($vars['username']) .'" />\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <label for="password">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.password') . '</label>\r
-                                                               <input type="password" id="password" name="data[password]" value="" />\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <label for="email">' .$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.email') . '</label>\r
-                                                               <input type="text" id="email" name="data[email]" value="' . htmlspecialchars($vars['email']) .'" />\r
-                                                       </div>\r
-                                               </fieldset>\r
-                                               <fieldset class="fields">\r
-                                                       <legend>Configuration</legend>\r
-\r
-                                                       <div class="row">\r
-                                                               <label for="usergroup">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.usergroup') . '</label>\r
-                                                               <select id="usergroup" name="data[usergroup][]" multiple="multiple">\r
-                                                                       ' . $this->getUsergroups($record, $vars) . '\r
-                                                               </select>\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <label for="db_mountpoints">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.options_db_mounts') . '</label>\r
-                                                               ' . $this->t3lib_TCEforms->dbFileIcons('data[db_mountpoints]', 'db', 'pages', $loadDB->itemArray, '', array('size' => 3)) . '\r
-                                                       </div>\r
-                                                       <div class="row">\r
-                                                               <input type="hidden" name="data[key]" value="' . $key . '" />\r
-                                                               <input type="hidden" name="data[sent]" value="1" />\r
-                                                               <input type="submit" value="' . ($key === 'NEW' ? $GLOBALS['LANG']->getLL('action_Create') : $GLOBALS['LANG']->getLL('action_Update')) . '" />\r
-                                                       </div>\r
-                                               </fieldset>\r
-                                       </form>';\r
-\r
-               $content .= $this->getCreatedUsers($record, $key);\r
-\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Delete a BE user and redirect to the action by its id\r
-        *\r
-        * @param       int             $userId: Id of the BE user\r
-        * @param       int             $actionId: Id of the action\r
-        * @return      void\r
-        */\r
-       protected function deleteUser($userId, $actionId) {\r
-               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\r
-                       'be_users',\r
-                       'uid=' . $userId,\r
-                       array (\r
-                               'deleted' => 1,\r
-                               'tstamp' => $GLOBALS['ACCESS_TIME']\r
-                       )\r
-               );\r
-\r
-                       // redirect to the original task\r
-               $redirectUrl = 'mod.php?M=user_task&show=' . $actionId;\r
-               t3lib_utility_Http::redirect($redirectUrl);\r
-       }\r
-\r
-       /**\r
-        * Check if a BE user is created by the current user\r
-        *\r
-        * @param       int             $id: Id of the BE user\r
-        * @param       array           $action: sys_action record.\r
-        * @return      mixed the record of the BE user if found, otherwise false\r
-        */\r
-       protected function isCreatedByUser($id, $action) {\r
-               $record = t3lib_BEfunc::getRecord(\r
-                       'be_users',\r
-                       $id,\r
-                       '*',\r
-                       ' AND cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . intval($action['uid'])\r
-               );\r
-\r
-               if (is_array($record)) {\r
-                       return $record;\r
-               } else {\r
-                       return FALSE;\r
-               }\r
-       }\r
-\r
-\r
-       /**\r
-        * Render all users who are created by the current BE user including a link to edit the record\r
-        *\r
-        * @param       array           $action: sys_action record.\r
-        * @param       int             $selectedUser: Id of a selected user\r
-        * @return      html list of users\r
-        */\r
-       protected function getCreatedUsers($action, $selectedUser) {\r
-               $content = '';\r
-               $lines = array();\r
-\r
-                       // List of users\r
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r
-                       '*',\r
-                       'be_users',\r
-                       'cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . intval($action['uid']) . t3lib_BEfunc::deleteClause('be_users'),\r
-                       '',\r
-                       'username'\r
-               );\r
-\r
-                       // render the user records\r
-               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
-                       $icon = t3lib_iconworks::getIconImage('be_users', $row, $GLOBALS['BACK_PATH'], 'title="uid=' . $row['uid'] . '" hspace="2" align="top"');\r
-                       $line = $icon . $this->action_linkUserName($row['username'], $row['realName'], $action['uid'], $row['uid']);\r
-\r
-                               // selected user\r
-                       if  ($row['uid'] == $selectedUser) {\r
-                               $line = '<strong>' . $line . '</strong>';\r
-                       }\r
-\r
-                       $lines[] = $line;\r
-               }\r
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);\r
-\r
-                       // if any records found\r
-               if (count($lines)) {\r
-                       $content .= '<br />' . $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t1_listOfUsers'), implode('<br />', $lines));\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-\r
-       /**\r
-        * Create a link to edit a user\r
-        *\r
-        * @param       string          $username: Username\r
-        * @param       string          $realName: Real name of the user\r
-        * @param       int             $sysActionUid: Id of the sys_action record\r
-        * @param       int             $userId: Id of the user\r
-        * @return      html link\r
-        */\r
-       protected function action_linkUserName($username, $realName, $sysActionUid, $userId) {\r
-               if (!empty($realName)) {\r
-                       $username .= ' (' . $realName . ')';\r
-               }\r
-\r
-                       // link to update the user record\r
-               $href = 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . intval($sysActionUid) . '&be_users_uid=' . intval($userId);\r
-               $link = '<a href="' . $href . '">' . htmlspecialchars($username) . '</a>';\r
-\r
-                       // link to delete the user record\r
-               $onClick = ' onClick="return confirm('.$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL("lDelete_warning")).');"';\r
-               $link .= '\r
-                               <a href="' . $href . '&delete=1" ' . $onClick . '>\r
-                                       <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/delete_record.gif') . ' alt="" />\r
-                               </a>';\r
-               return $link;\r
-       }\r
-\r
-       /**\r
-        * Save/Update a BE user\r
-        *\r
-        * @param       array           $record: Current action record\r
-        * @param       array           $vars: POST vars\r
-        * @return      int Id of the new/updated user\r
-        */\r
-       protected function saveNewBackendUser($record, $vars) {\r
-               $content = '';\r
-\r
-                       // check if the db mount is a page the current user is allowed to.);\r
-               $vars['db_mountpoints'] = $this->fixDbMount($vars['db_mountpoints']);\r
-                       // check if the usergroup is allowed\r
-               $vars['usergroup'] = $this->fixUserGroup($vars['usergroup'], $record);\r
-                       // check if md5 is used as password encryption\r
-               if (strpos($GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], 'md5') !== FALSE) {\r
-                       $vars['password'] = md5($vars['password']);\r
-               }\r
-\r
-               $key = $vars['key'];\r
-               $data = '';\r
-               $newUserId = 0;\r
-\r
-               if ($key === 'NEW') {\r
-                       $beRec = t3lib_BEfunc::getRecord('be_users', intval($record['t1_copy_of_user']));\r
-                       if (is_array($beRec)) {\r
-                               $data = array();\r
-                               $data['be_users'][$key] = $beRec;\r
-                               $data['be_users'][$key]['username']                     = $this->fixUsername($vars['username'], $record['t1_userprefix']);\r
-                               $data['be_users'][$key]['password']                     = (trim($vars['password']));\r
-                               $data['be_users'][$key]['realName']                     = $vars['realName'];\r
-                               $data['be_users'][$key]['email']                        = $vars['email'];\r
-                               $data['be_users'][$key]['disable']                      = intval($vars['disable']);\r
-                               $data['be_users'][$key]['admin']                        = 0;\r
-                               $data['be_users'][$key]['usergroup']            = $vars['usergroup'];\r
-                               $data['be_users'][$key]['db_mountpoints']       = $vars['db_mountpoints'];\r
-                               $data['be_users'][$key]['createdByAction']      = $record['uid'];\r
-                       }\r
-               } else {\r
-                               // check ownership\r
-                       $beRec = t3lib_BEfunc::getRecord('be_users', intval($key));\r
-                       if (is_array($beRec) && $beRec['cruser_id'] == $GLOBALS['BE_USER']->user['uid']) {\r
-                               $data=array();\r
-                               $data['be_users'][$key]['username'] = $this->fixUsername($vars['username'], $record['t1_userprefix']);\r
-                               if (trim($vars['password'])) {\r
-                                       $data['be_users'][$key]['password'] = (trim($vars['password']));\r
-                               }\r
-\r
-                               $data['be_users'][$key]['realName']                     = $vars['realName'];\r
-                               $data['be_users'][$key]['email']                        = $vars['email'];\r
-                               $data['be_users'][$key]['disable']                      = intval($vars['disable']);\r
-                               $data['be_users'][$key]['admin']                        = 0;\r
-                               $data['be_users'][$key]['usergroup']            = $vars['usergroup'];\r
-                               $data['be_users'][$key]['db_mountpoints']       = $vars['db_mountpoints'];\r
-                               $newUserId = $key;\r
-                       }\r
-               }\r
-\r
-                       // save/update user by using TCEmain\r
-               if (is_array($data)) {\r
-                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");\r
-                       $tce->stripslashes_values = 0;\r
-                       $tce->start($data, array(), $GLOBALS['BE_USER']);\r
-                       $tce->admin = 1;\r
-                       $tce->process_datamap();\r
-                       $newUserId = intval($tce->substNEWwithIDs['NEW']);\r
-\r
-                       if ($newUserId) {\r
-                                       // Create\r
-                               $this->action_createDir($newUserId);\r
-                       } else {\r
-                                       // update\r
-                               $newUserId = intval($key);\r
-                       }\r
-                       unset($tce);\r
-               }\r
-               return $newUserId;\r
-       }\r
-\r
-       /**\r
-        * Create the username based on the given username and the prefix\r
-        *\r
-        * @param       string          $username: username\r
-        * @param       string          $prefix: prefix\r
-        * @return string       Combined username\r
-        */\r
-       private function fixUsername($username, $prefix) {\r
-               return trim($prefix) . trim($username);\r
-       }\r
-\r
-       /**\r
-        * Clean the to be applied usergroups from not allowed ones\r
-        *\r
-        * @param       array           $appliedUsergroups: array of to be applied user groups\r
-        * @return array        Cleaned array\r
-        */\r
-       protected function fixUserGroup($appliedUsergroups, $actionRecord) {\r
-               if (is_array($appliedUsergroups)) {\r
-                       $cleanGroupList = array();\r
-\r
-                               // create an array from the allowed usergroups using the uid as key\r
-                       $allowedUsergroups = array_flip(explode(',', $actionRecord['t1_allowed_groups']));\r
-\r
-                               // walk through the array and check every uid if it is undder the allowed ines\r
-                       foreach ($appliedUsergroups as $group) {\r
-                               if (isset($allowedUsergroups[$group])) {\r
-                                       $cleanGroupList[] = $group;\r
-                               }\r
-                       }\r
-                       $appliedUsergroups = $cleanGroupList;\r
-               }\r
-\r
-               return $appliedUsergroups;\r
-       }\r
-\r
-       /**\r
-        * Clean the to be applied DB-Mounts from not allowed ones\r
-        *\r
-        * @param       string          $appliedDbMounts: List of pages like pages_123,pages456\r
-        * @return string       Cleaned list\r
-        */\r
-       protected function fixDbMount($appliedDbMounts) {\r
-                       // Admins can see any page, no need to check there\r
-               if (!empty($appliedDbMounts) && !$GLOBALS['BE_USER']->isAdmin()) {\r
-                       $cleanDbMountList = array();\r
-                       $dbMounts = t3lib_div::trimExplode(',', $appliedDbMounts, 1);\r
-\r
-                               // walk through every wanted DB-Mount and check if it allowed for the current user\r
-                       foreach ($dbMounts as $dbMount) {\r
-                               $uid = intval(substr($dbMount,  (strrpos($dbMount, '_') + 1)));\r
-                               $page = t3lib_BEfunc::getRecord('pages', $uid);\r
-\r
-                                       // check rootline and access rights\r
-                               if ($this->checkRootline($uid) && $GLOBALS['BE_USER']->calcPerms($page)) {\r
-                                       $cleanDbMountList[] = 'pages' . $uid;\r
-                               }\r
-                       }\r
-                               // build the clean list\r
-                       $appliedDbMounts = implode(',', $cleanDbMountList);\r
-               }\r
-\r
-               return $appliedDbMounts;\r
-       }\r
-\r
-       /**\r
-        * Check if a page is inside the rootline the current user can see\r
-        *\r
-        * @param       int             $pageId: Id of the the page to be checked\r
-        * @return boolean      Access to the page\r
-        */\r
-       protected function checkRootline($pageId) {\r
-               $access = FALSE;\r
-\r
-               $dbMounts =  array_flip(explode(',', trim($GLOBALS['BE_USER']->dataLists['webmount_list'], ',')));\r
-               $rootline = t3lib_BEfunc::BEgetRootLine($pageId);\r
-               foreach ($rootline as $page) {\r
-                       if (isset($dbMounts[$page['uid']]) && !$access) {\r
-                               $access = TRUE;\r
-                       }\r
-               }\r
-               return $access;\r
-       }\r
-\r
-       /**\r
-        * Add additional JavaScript to use the tceform select box\r
-        *\r
-        * @param       int             $uid: Id of the user record\r
-        * @return void\r
-        */\r
-       protected function JScode() {\r
-               $this->t3lib_TCEforms = t3lib_div::makeInstance("t3lib_TCEforms");\r
-               $this->t3lib_TCEforms->backPath = $GLOBALS['BACK_PATH'];\r
-               $js = $this->t3lib_TCEforms->dbFileCon();\r
-               $this->taskObject->doc->JScodeArray[] = $js;\r
-\r
-               return $js;\r
-       }\r
-\r
-       /**\r
-        * Create a user directory if defined\r
-        *\r
-        * @param       int             $uid: Id of the user record\r
-        * @return void\r
-        */\r
-       protected function action_createDir($uid) {\r
-               $path = $this->action_getUserMainDir();\r
-               if ($path) {\r
-                       t3lib_div::mkdir($path . $uid);\r
-                       t3lib_div::mkdir($path . $uid . '/_temp_/');\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Get the path to the user home directory which is set in the localconf.php\r
-        *\r
-        * @return string path\r
-        */\r
-       protected function action_getUserMainDir() {\r
-               $path = $GLOBALS['TYPO3_CONF_VARS']['BE']['userHomePath'];\r
-\r
-                       // if path is set and a valid directory\r
-               if ($path && @is_dir($path) &&\r
-                               $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] &&\r
-                               t3lib_div::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath']) &&\r
-                               substr($path,-1) == '/'\r
-                       ) {\r
-                       return $path;\r
-               }\r
-       }\r
-\r
-       protected function getUsergroups($record, $vars) {\r
-               $content = '';\r
-                       // do nothing if no groups are allowed\r
-               if (empty($record['t1_allowed_groups'])) {\r
-                       return $content;\r
-               }\r
-\r
-               $content .= '<option value=""></option>';\r
-               $grList = t3lib_div::trimExplode(',',  $record['t1_allowed_groups'], 1);\r
-               foreach($grList as $group) {\r
-                       $checkGroup = t3lib_BEfunc::getRecord('be_groups', $group);\r
-                       if (is_array($checkGroup)) {\r
-                               $selected = (is_array($vars['usergroup']) && t3lib_div::inList(implode(',', $vars['usergroup']), $checkGroup['uid'])) ? ' selected="selected" ' : '';\r
-                               $content .= '<option ' . $selected . 'value="' . $checkGroup['uid'] . '">' . htmlspecialchars($checkGroup['title']) . '</option>';\r
-                       }\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-\r
-       /**\r
-        * Action to create a new record\r
-        *\r
-        * @param       array           $record: sys_action record\r
-        * @return      redirect to form to create a record\r
-        */\r
-       protected function viewNewRecord($record) {\r
-               $returnUrl = rawurlencode('mod.php?M=user_task');\r
-               $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl. '&edit[' . $record['t3_tables'] . '][' . intval($record['t3_listPid']) . ']=new';\r
-               t3lib_utility_Http::redirect($link);\r
-       }\r
-\r
-       /**\r
-        * Action to edit records\r
-        *\r
-        * @param       array           $record: sys_action record\r
-        * @return      string list of records\r
-        */\r
-       protected function viewEditRecord($record) {\r
-               $content = '';\r
-               $lines = array();\r
-\r
-               $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');\r
-               $dbAnalysis->fromTC = 0;\r
-               $dbAnalysis->start($record['t4_recordsToEdit'], '*');\r
-               $dbAnalysis->getFromDB();\r
-\r
-                       // collect the records\r
-               foreach ($dbAnalysis->itemArray as $el) {\r
-                       $path = t3lib_BEfunc::getRecordPath ($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']);\r
-                       $record = t3lib_BEfunc::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);\r
-                       $title = t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);\r
-                       $description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], 1);\r
-                       if (isset($record['crdate'])) { // @todo: which information could be  needfull\r
-                               $description .= ' - ' . t3lib_BEfunc::dateTimeAge($record['crdate']);\r
-                       }\r
-\r
-                       $lines[$el['id']] = array(\r
-                               'title'                         => $title,\r
-                               'description'           => t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]),\r
-                               'descriptionHtml'       => $description,\r
-                               'link'                          => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit',\r
-                               'icon'                          => t3lib_iconworks::getIconImage($el['table'], $dbAnalysis->results[$el['table']][$el['id']], $GLOBALS['BACK_PATH'], 'hspace="2" align="top" title="' . htmlspecialchars($path) . '"')\r
-                       );\r
-               }\r
-\r
-                       // render the record list\r
-               $content .= $this->taskObject->renderListMenu($lines);\r
-\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Action to view the result of a SQL query\r
-        *\r
-        * @param       array           $record: sys_action record\r
-        * @return      string result of the query\r
-        */\r
-       protected function viewSqlQuery($record) {\r
-               $content = '';\r
-\r
-               if (t3lib_extMgm::isLoaded('lowlevel')) {\r
-                       $sql_query = unserialize($record['t2_data']);\r
-\r
-                       if (is_array($sql_query) && strtoupper(substr(trim($sql_query['qSelect']), 0, 6)) == 'SELECT') {\r
-                               $actionContent = '';\r
-\r
-                               $fullsearch = t3lib_div::makeInstance("t3lib_fullsearch");\r
-                               $fullsearch->formW = 40;\r
-                               $fullsearch->noDownloadB = 1;\r
-\r
-\r
-                               $type = $sql_query['qC']['search_query_makeQuery'];\r
-                               $res = $GLOBALS['TYPO3_DB']->sql_query($sql_query['qSelect']);\r
-\r
-                               if (!$GLOBALS['TYPO3_DB']->sql_error()) {\r
-                                       $fullsearch->formW = 48;\r
-                                               // additional configuration\r
-                                       $GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels'] = 1;\r
-                                       $cP = $fullsearch->getQueryResultCode($type, $res, $sql_query['qC']['queryTable']);\r
-                                       $actionContent = $cP['content'];\r
-\r
-                                               // if the result is rendered as csv or xml, show a download link\r
-                                       if ($type == 'csv' || $type == 'xml' ) {\r
-                                               $actionContent .= '<br /><br /><a href="' . t3lib_div::getIndpEnv('REQUEST_URI') . '&download_file=1"><strong>' . $GLOBALS['LANG']->getLL('action_download_file') . '</strong></a>';\r
-                                       }\r
-                               } else {\r
-                                       $actionContent .= $GLOBALS['TYPO3_DB']->sql_error();\r
-                               }\r
-\r
-                               // Admin users are allowed to see and edit the query\r
-                               if ($GLOBALS['BE_USER']->isAdmin()) {\r
-                                       $actionContent .= '<hr /> ' . $fullsearch->tableWrap($sql_query['qSelect']);\r
-                                       $actionContent .= '<br /><a title="' . $GLOBALS['LANG']->getLL('action_editQuery') . '" href="'.$GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('lowlevel') . 'dbint/index.php?id='.\r
-                                               '&SET[function]=search' .\r
-                                               '&SET[search]=query' .\r
-                                               '&storeControl[STORE]=-' . $record['uid'] .\r
-                                               '&storeControl[LOAD]=1' .\r
-                                               '">\r
-                                               <img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif') . ' alt="" />' .\r
-                                                       $GLOBALS['LANG']->getLL('action_editQuery') . '</a><br /><br />';\r
-                               }\r
-\r
-                               $content .= $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t2_result'), $actionContent, 0, 1);\r
-                       } else {\r
-                                       // query is not configured\r
-                               $flashMessage = t3lib_div::makeInstance (\r
-                                       't3lib_FlashMessage',\r
-                                       $GLOBALS['LANG']->getLL('action_notReady', true),\r
-                                       $GLOBALS['LANG']->getLL('action_error'),\r
-                                       t3lib_FlashMessage::ERROR\r
-                               );\r
-                               $content .= '<br />' . $flashMessage->render();\r
-                       }\r
-               } else {\r
-                               // required sysext lowlevel is not installed\r
-                       $flashMessage = t3lib_div::makeInstance (\r
-                               't3lib_FlashMessage',\r
-                               $GLOBALS['LANG']->getLL('action_lowlevelMissing', true),\r
-                               $GLOBALS['LANG']->getLL('action_error'),\r
-                               t3lib_FlashMessage::ERROR\r
-                       );\r
-                       $content .= '<br />' . $flashMessage->render();\r
-               }\r
-               return $content;\r
-       }\r
-\r
-       /**\r
-        * Action to create a list of records of a specific table and pid\r
-        *\r
-        * @param       array           $record: sys_action record\r
-        * @return      string list of records\r
-        */\r
-       protected function viewRecordList($record) {\r
-               $content = '';\r
-\r
-               $this->id               = intval($record['t3_listPid']);\r
-               $this->table    = $record['t3_tables'];\r
-\r
-               if ($this->id == 0 || $this->table == '') {\r
-                       $flashMessage = t3lib_div::makeInstance(\r
-                               't3lib_FlashMessage',\r
-                               $GLOBALS['LANG']->getLL('action_lowlevelMissing', true),\r
-                               $GLOBALS['LANG']->getLL('action_error'),\r
-                               t3lib_FlashMessage::ERROR\r
-                       );\r
-                       $content .= '<br />' . $flashMessage->render();\r
-\r
-                       return $content;\r
-               }\r
-\r
-               require_once($GLOBALS['BACK_PATH'] . 'class.db_list.inc');\r
-               require_once($GLOBALS['BACK_PATH'] . 'class.db_list_extra.inc');\r
-\r
-\r
-                       // Start document template object:\r
-//             $this->doc = t3lib_div::makeInstance('template');\r
-\r
-                       // Loading current page record and checking access:\r
-               $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->taskObject->perms_clause);\r
-               $access = is_array($this->pageinfo) ? 1 : 0;\r
-\r
-\r
-                       // If there is access to the page, then render the list contents and set up the document template object:\r
-               if ($access) {\r
-                               // Initialize the dblist object:\r
-                       $dblist = t3lib_div::makeInstance('localRecordList');\r
-                       $dblist->script = t3lib_div::getIndpEnv('REQUEST_URI');\r
-                       $dblist->backPath = $GLOBALS['BACK_PATH'];\r
-                       $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);\r
-                       $dblist->thumbs = $GLOBALS['BE_USER']->uc['thumbnailsByDefault'];\r
-                       $dblist->returnUrl=$this->taskObject->returnUrl;\r
-                       $dblist->allFields = 1;\r
-                       $dblist->localizationView = 1;\r
-                       $dblist->showClipboard = 0;\r
-                       $dblist->disableSingleTableView = 1;\r
-                       $dblist->pageRow = $this->pageinfo;\r
-                       $dblist->counter++;\r
-                       $dblist->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');\r
-                       $dblist->modTSconfig = $this->taskObject->modTSconfig;\r
-                       $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->taskObject->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current=='normal' && !$GLOBALS['BE_USER']->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];\r
-\r
-                               // Initialize the listing object, dblist, for rendering the list:\r
-                       $this->pointer = t3lib_div::intInRange($this->taskObject->pointer,0,100000);\r
-                       $dblist->start($this->id,$this->table,$this->pointer,$this->taskObject->search_field,$this->taskObject->search_levels,$this->taskObject->showLimit);\r
-                       $dblist->setDispFields();\r
-\r
-                               // Render the list of tables:\r
-                       $dblist->generateList();\r
-\r
-                               // Add JavaScript functions to the page:\r
-                       $this->taskObject->doc->JScode=$this->taskObject->doc->wrapScriptTags('\r
-\r
-                               function jumpToUrl(URL) {\r
-                                       window.location.href = URL;\r
-                                       return false;\r
-                               }\r
-                               function jumpExt(URL,anchor) {\r
-                                       var anc = anchor?anchor:"";\r
-                                       window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;\r
-                                       return false;\r
-                               }\r
-                               function jumpSelf(URL) {\r
-                                       window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");\r
-                                       return false;\r
-                               }\r
-\r
-                               function setHighlight(id) {\r
-                                       top.fsMod.recentIds["web"]=id;\r
-                                       top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank;    // For highlighting\r
-\r
-                                       if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {\r
-                                               top.content.nav_frame.refresh_nav();\r
-                                       }\r
-                               }\r
-\r
-                               ' . $dblist->CBfunctions() . '\r
-                               function editRecords(table,idList,addParams,CBflag) {\r
-                                       window.location.href="' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) .\r
-                                               '&edit["+table+"]["+idList+"]=edit"+addParams;\r
-                               }\r
-                               function editList(table,idList) {\r
-                                       var list="";\r
-\r
-                                               // Checking how many is checked, how many is not\r
-                                       var pointer=0;\r
-                                       var pos = idList.indexOf(",");\r
-                                       while (pos!=-1) {\r
-                                               if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {\r
-                                                       list+=idList.substr(pointer,pos-pointer)+",";\r
-                                               }\r
-                                               pointer=pos+1;\r
-                                               pos = idList.indexOf(",",pointer);\r
-                                       }\r
-                                       if (cbValue(table+"|"+idList.substr(pointer))) {\r
-                                               list+=idList.substr(pointer)+",";\r
-                                       }\r
-\r
-                                       return list ? list : idList;\r
-                               }\r
-                               T3_THIS_LOCATION = "' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '";\r
-\r
-                               if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';\r
-                       ');\r
-\r
-                               // Setting up the context sensitive menu:\r
-                       $this->taskObject->doc->getContextMenuCode();\r
-\r
-\r
-                               // Begin to compile the whole page\r
-                       $content .= '<form action="'.htmlspecialchars($dblist->listURL()).'" method="post" name="dblistForm">' .\r
-                                                       $dblist->HTMLcode .\r
-                                                       '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" />\r
-                                               </form>';\r
-\r
-                               // If a listing was produced, create the page footer with search form etc:\r
-                       if ($dblist->HTMLcode) {\r
-\r
-                                       // Making field select box (when extended view for a single table is enabled):\r
-                               if ($dblist->table) {\r
-                                       $tmpBackpath = $GLOBALS['BACK_PATH'];\r
-                                       $GLOBALS['BACK_PATH'] = '';\r
-                                       $content .= $dblist->fieldSelectBox($dblist->table);\r
-                                       $GLOBALS['BACK_PATH'] = $tmpBackpath;\r
-                               }\r
-                       }\r
-               } else {\r
-                               // not enough rights to access the list view or the page\r
-                       $flashMessage = t3lib_div::makeInstance(\r
-                               't3lib_FlashMessage',\r
-                               $GLOBALS['LANG']->getLL('action_error-access', true),\r
-                               $GLOBALS['LANG']->getLL('action_error'),\r
-                               t3lib_FlashMessage::ERROR\r
-                       );\r
-                       $content .= $flashMessage->render();\r
-               }\r
-\r
-               return $content;\r
-       }\r
-\r
-}\r
-\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_task.php']) {\r
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_task.php']);\r
-}\r
-\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 2010 Georg Ringer <typo3@ringerge.org>
+*  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.
+*
+*  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!
+***************************************************************/
+
+
+/**
+ * This class provides a task for the taskcenter
+ *
+ * @author             Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author             Georg Ringer <typo3@ringerge.org>
+ * @package            TYPO3
+ * @subpackage tx_sysaction
+ *
+ */
+class tx_sysaction_task implements tx_taskcenter_Task {
+
+       protected $taskObject;
+       var $t3lib_TCEforms;
+
+       /**
+        * Constructor
+        */
+       public function __construct(SC_mod_user_task_index $taskObject) {
+               $this->taskObject = $taskObject;
+               $GLOBALS['LANG']->includeLLFile('EXT:sys_action/locallang.xml');
+       }
+
+
+       /**
+        * This method renders the task
+        *
+        * @return      string  The task as HTML
+        */
+       public function getTask() {
+               $content = '';
+               $show = intval(t3lib_div::_GP('show'));
+
+                       // if no task selected, render the menu
+               if ($show == 0) {
+                       $content .= $this->taskObject->description(
+                                                       $GLOBALS['LANG']->getLL('sys_action'),
+                                                       $GLOBALS['LANG']->getLL('description')
+                                               );
+
+                       $content .= $this->renderActionList();
+               } else {
+                       $record = t3lib_BEfunc::getRecord('sys_action', $show);
+
+                               // if the action is not found
+                       if (count($record) == 0) {
+                               $flashMessage = t3lib_div::makeInstance(
+                                       't3lib_FlashMessage',
+                                       $GLOBALS['LANG']->getLL('action_error-not-found', true),
+                                       $GLOBALS['LANG']->getLL('action_error'),
+                                       t3lib_FlashMessage::ERROR
+                               );
+                               $content .= $flashMessage->render();
+                       } else {
+                                       // render the task
+                               $content .= $this->taskObject->description($record['title'], $record['description']);
+
+                                       // output depends on the type
+                               switch ($record['type']) {
+                                       case 1:
+                                               $content .= $this->viewNewBackendUser($record);
+                                               break;
+                                       case 2:
+                                               $content .= $this->viewSqlQuery($record);
+                                               break;
+                                       case 3:
+                                               $content .= $this->viewRecordList($record);
+                                               break;
+                                       case 4:
+                                               $content .= $this->viewEditRecord($record);
+                                               break;
+                                       case 5:
+                                               $content .= $this->viewNewRecord($record);
+                                               break;
+                                       default:
+                                               $flashMessage = t3lib_div::makeInstance(
+                                                       't3lib_FlashMessage',
+                                                       $GLOBALS['LANG']->getLL('action_noType', true),
+                                                       $GLOBALS['LANG']->getLL('action_error'),
+                                                       t3lib_FlashMessage::ERROR
+                                               );
+                                               $content .= '<br />' . $flashMessage->render();
+                               }
+                       }
+               }
+
+               return $content;
+       }
+
+       /**
+        * Gemeral overview over the task in the taskcenter menu
+        *
+        * @return      string Overview as HTML
+        */
+       public function getOverview() {
+               $content = '<p>' . $GLOBALS['LANG']->getLL('description') . '</p>';
+
+                       // get the actions
+               $lines = $this->getActions();
+               if (count($lines) > 0) {
+                       $items = '';
+
+                               // render a single action menu item
+                       foreach ($lines as $line) {
+                               $active = (t3lib_div::_GP('show') === $line['uid']) ? ' class="active" ' : '';
+                               $items .= '<li' . $active . '>
+                                                               <a href="' . $line['link'] . '" title="' . htmlspecialchars($line['description']) . '">' .
+                                                                       htmlspecialchars($line['title']) .
+                                                               '</a>
+                                                       </li>';
+                       }
+                       $content .= '<ul>' . $items . '</ul>';
+               }
+
+               return $content;
+       }
+
+       /**
+        * Get all actions of an user. Admins can see any action, all others only those
+        * whic are allowed in sys_action record itself.
+        *
+        * @param       boolean         $toOverview: If true, the link redirects to the taskcenter
+        * @return      array Array holding every needed information of a sys_action
+        */
+       protected function getActions() {
+               $lines = array();
+
+                       // admins can see any record
+               if ($GLOBALS['BE_USER']->isAdmin()) {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               '*',
+                               'sys_action',
+                               '',
+                               '',
+                               'sys_action.sorting'
+                       );
+               } else {
+                               // editors can only see the actions which are assigned to a usergroup they belong to
+                       $additionalWhere = 'be_groups.uid IN (' . ($GLOBALS['BE_USER']->groupList ? $GLOBALS['BE_USER']->groupList : 0) . ')';
+
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
+                               'sys_action.*',
+                               'sys_action',
+                               'sys_action_asgr_mm',
+                               'be_groups',
+                               ' AND sys_action.hidden=0 AND ' . $additionalWhere,
+                               'sys_action.uid',
+                               'sys_action.sorting'
+                       );
+               }
+
+               while($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $editActionLink = '';
+
+                               // admins are allowed to edit sys_action records
+                       if ($GLOBALS['BE_USER']->isAdmin()) {
+                               $returnUrl = rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
+                               $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl . '&edit[sys_action][' . $actionRow['uid'] . ']=edit';
+
+                               $editActionLink = '<a class="edit" href="' . $link . '">' .
+                                               '<img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif') . ' title="' . $GLOBALS['LANG']->getLL('edit-sys_action') . '" alt="" />' .
+                                                       $GLOBALS['LANG']->getLL('edit-sys_action') .
+                                               '</a>';
+                       }
+
+                       $lines[] = array(
+                               'uid'                           => $actionRow['uid'],
+                               'title'                         => $actionRow['title'],
+                               'description'           => $actionRow['description'],
+                               'descriptionHtml'       => nl2br(htmlspecialchars($actionRow['description'])) . $editActionLink,
+                               'link'                          => 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . $actionRow['uid'],
+                               'icon'                          => 'EXT:sys_action/sys_action.gif'
+                       );
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
+               return $lines;
+       }
+
+       /**
+        * Render the menu of sys_actions
+        *
+        * @return      string list of sys_actions as HTML
+        */
+       protected function renderActionList() {
+               $content = '';
+
+                       // get the sys_action records
+               $lines = $this->getActions();
+
+                       // if any actions are found for the current users
+               if (count($lines) > 0) {
+                       $content .= $this->taskObject->renderListMenu($lines);
+               } else {
+                       $flashMessage = t3lib_div::makeInstance (
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('action_not-found-description', true),
+                               $GLOBALS['LANG']->getLL('action_not-found'),
+                               t3lib_FlashMessage::INFO
+                       );
+                       $content .= $flashMessage->render();
+               }
+
+                       // Admin users can create a new action
+               if ($GLOBALS['BE_USER']->isAdmin()) {
+                       $returnUrl = rawurlencode('mod.php?M=user_task');
+                       $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl. '&edit[sys_action][0]=new';
+
+                       $content .= '<br />
+                                                <a href="' . $link . '" title="' . $GLOBALS['LANG']->getLL('new-sys_action') . '">' .
+                                                       '<img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_record.gif') . ' title="' . $GLOBALS['LANG']->getLL('new-sys_action') . '" alt="" /> ' .
+                                                       $GLOBALS['LANG']->getLL('new-sys_action') .
+                                                '</a>';
+               }
+
+               return $content;
+       }
+
+       /**
+        * Action to create a new BE user
+        *
+        * @param       array           $record: sys_action record
+        * @return      string form to create a new user
+        */
+       protected function viewNewBackendUser($record) {
+               $content = '';
+
+               $beRec = t3lib_BEfunc::getRecord('be_users', intval($record['t1_copy_of_user']));
+                       // a record is neeed which is used as copy for the new user
+               if (!is_array($beRec)) {
+                       $flashMessage = t3lib_div::makeInstance(
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('action_notReady', true),
+                               $GLOBALS['LANG']->getLL('action_error'),
+                               t3lib_FlashMessage::ERROR
+                       );
+                       $content .= $flashMessage->render();
+
+                       return $content;
+               }
+
+               $userRecord = array();
+               $newFlag = 0;
+               $vars = t3lib_div::_POST('data');
+               $key = 'NEW';
+
+               if ($vars['sent'] == 1) {
+                       $errors = array();
+
+                               // basic error checks
+                       if (!empty($vars['email']) && !t3lib_div::validEmail($vars['email'])) {
+                               $errors[] = $GLOBALS['LANG']->getLL('error-wrong-email');
+                       }
+                       if (empty($vars['username'])) {
+                               $errors[] = $GLOBALS['LANG']->getLL('error-username-empty');
+                       }
+                       if (empty($vars['password'])) {
+                               $errors[] = $GLOBALS['LANG']->getLL('error-password-empty');
+                       }
+                       if ($vars['key'] !== 'NEW' && !$this->isCreatedByUser($vars['key'], $record)) {
+                               $errors[] = $GLOBALS['LANG']->getLL('error-wrong-user');
+                       }
+
+                               // show errors if there are any
+                       if (count($errors) > 0) {
+                               $flashMessage = t3lib_div::makeInstance (
+                                       't3lib_FlashMessage',
+                                       implode('<br />', $errors),
+                                       $GLOBALS['LANG']->getLL('action_error'),
+                                       t3lib_FlashMessage::ERROR
+                               );
+                               $content .= $flashMessage->render() . '<br />';
+                       } else {
+                                       // save user
+                               $key = $this->saveNewBackendUser($record, $vars);
+
+                                       // success messsage
+                               $flashMessage = t3lib_div::makeInstance (
+                                       't3lib_FlashMessage',
+                                       ($vars['key'] === 'NEW' ? $GLOBALS['LANG']->getLL('success-user-created') : $GLOBALS['LANG']->getLL('success-user-updated')),
+                                       $GLOBALS['LANG']->getLL('success'),
+                                       t3lib_FlashMessage::OK
+                               );
+                               $content .= $flashMessage->render() . '<br />' ;
+                       }
+
+               }
+
+
+                       // load BE user to edit
+               if (intval(t3lib_div::_GP('be_users_uid')) > 0) {
+                       $tmpUserId = intval(t3lib_div::_GP('be_users_uid'));
+
+                       $rawRecord = $this->isCreatedByUser($tmpUserId, $record);
+
+                       if ($rawRecord) {
+                                       // delete user
+                               if (t3lib_div::_GP('delete') == 1) {
+                                       $this->deleteUser($tmpUserId, $record['uid']);
+                               }
+
+                               $key = $tmpUserId;
+                               $vars = $rawRecord;
+                       }
+
+               }
+
+               $this->JScode();
+               $loadDB = t3lib_div::makeInstance('t3lib_loadDBGroup');
+               $loadDB->start($vars['db_mountpoints'], 'pages');
+
+               $content .= '<form action="" method="post" enctype="multipart/form-data">
+                                               <fieldset class="fields">
+                                                       <legend>General fields</legend>
+                                                       <div class="row">
+                                                               <label for="disable">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.disable') . '</label>
+                                                               <input type="checkbox" id="disable" name="data[disable]" value="1" class="checkbox" ' . ($vars['disable'] == 1 ? ' checked="checked" ' : '') . ' />
+                                                       </div>
+                                                       <div class="row">
+                                                               <label for="realname">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.name') . '</label>
+                                                               <input type="text" id="realname" name="data[realName]" value="' . htmlspecialchars($vars['realName']) .'" />
+                                                       </div>
+                                                       <div class="row">
+                                                               <label for="username">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.username') . '</label>
+                                                               <input type="text" id="username" name="data[username]" value="' . htmlspecialchars($vars['username']) .'" />
+                                                       </div>
+                                                       <div class="row">
+                                                               <label for="password">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.password') . '</label>
+                                                               <input type="password" id="password" name="data[password]" value="" />
+                                                       </div>
+                                                       <div class="row">
+                                                               <label for="email">' .$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xml:LGL.email') . '</label>
+                                                               <input type="text" id="email" name="data[email]" value="' . htmlspecialchars($vars['email']) .'" />
+                                                       </div>
+                                               </fieldset>
+                                               <fieldset class="fields">
+                                                       <legend>Configuration</legend>
+
+                                                       <div class="row">
+                                                               <label for="usergroup">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.usergroup') . '</label>
+                                                               <select id="usergroup" name="data[usergroup][]" multiple="multiple">
+                                                                       ' . $this->getUsergroups($record, $vars) . '
+                                                               </select>
+                                                       </div>
+                                                       <div class="row">
+                                                               <label for="db_mountpoints">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xml:be_users.options_db_mounts') . '</label>
+                                                               ' . $this->t3lib_TCEforms->dbFileIcons('data[db_mountpoints]', 'db', 'pages', $loadDB->itemArray, '', array('size' => 3)) . '
+                                                       </div>
+                                                       <div class="row">
+                                                               <input type="hidden" name="data[key]" value="' . $key . '" />
+                                                               <input type="hidden" name="data[sent]" value="1" />
+                                                               <input type="submit" value="' . ($key === 'NEW' ? $GLOBALS['LANG']->getLL('action_Create') : $GLOBALS['LANG']->getLL('action_Update')) . '" />
+                                                       </div>
+                                               </fieldset>
+                                       </form>';
+
+               $content .= $this->getCreatedUsers($record, $key);
+
+               return $content;
+       }
+
+       /**
+        * Delete a BE user and redirect to the action by its id
+        *
+        * @param       int             $userId: Id of the BE user
+        * @param       int             $actionId: Id of the action
+        * @return      void
+        */
+       protected function deleteUser($userId, $actionId) {
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                       'be_users',
+                       'uid=' . $userId,
+                       array (
+                               'deleted' => 1,
+                               'tstamp' => $GLOBALS['ACCESS_TIME']
+                       )
+               );
+
+                       // redirect to the original task
+               $redirectUrl = 'mod.php?M=user_task&show=' . $actionId;
+               t3lib_utility_Http::redirect($redirectUrl);
+       }
+
+       /**
+        * Check if a BE user is created by the current user
+        *
+        * @param       int             $id: Id of the BE user
+        * @param       array           $action: sys_action record.
+        * @return      mixed the record of the BE user if found, otherwise false
+        */
+       protected function isCreatedByUser($id, $action) {
+               $record = t3lib_BEfunc::getRecord(
+                       'be_users',
+                       $id,
+                       '*',
+                       ' AND cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . intval($action['uid'])
+               );
+
+               if (is_array($record)) {
+                       return $record;
+               } else {
+                       return FALSE;
+               }
+       }
+
+
+       /**
+        * Render all users who are created by the current BE user including a link to edit the record
+        *
+        * @param       array           $action: sys_action record.
+        * @param       int             $selectedUser: Id of a selected user
+        * @return      html list of users
+        */
+       protected function getCreatedUsers($action, $selectedUser) {
+               $content = '';
+               $lines = array();
+
+                       // List of users
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       '*',
+                       'be_users',
+                       'cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . intval($action['uid']) . t3lib_BEfunc::deleteClause('be_users'),
+                       '',
+                       'username'
+               );
+
+                       // render the user records
+               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $icon = t3lib_iconworks::getIconImage('be_users', $row, $GLOBALS['BACK_PATH'], 'title="uid=' . $row['uid'] . '" hspace="2" align="top"');
+                       $line = $icon . $this->action_linkUserName($row['username'], $row['realName'], $action['uid'], $row['uid']);
+
+                               // selected user
+                       if  ($row['uid'] == $selectedUser) {
+                               $line = '<strong>' . $line . '</strong>';
+                       }
+
+                       $lines[] = $line;
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
+                       // if any records found
+               if (count($lines)) {
+                       $content .= '<br />' . $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t1_listOfUsers'), implode('<br />', $lines));
+               }
+
+               return $content;
+       }
+
+
+       /**
+        * Create a link to edit a user
+        *
+        * @param       string          $username: Username
+        * @param       string          $realName: Real name of the user
+        * @param       int             $sysActionUid: Id of the sys_action record
+        * @param       int             $userId: Id of the user
+        * @return      html link
+        */
+       protected function action_linkUserName($username, $realName, $sysActionUid, $userId) {
+               if (!empty($realName)) {
+                       $username .= ' (' . $realName . ')';
+               }
+
+                       // link to update the user record
+               $href = 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . intval($sysActionUid) . '&be_users_uid=' . intval($userId);
+               $link = '<a href="' . $href . '">' . htmlspecialchars($username) . '</a>';
+
+                       // link to delete the user record
+               $onClick = ' onClick="return confirm('.$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL("lDelete_warning")).');"';
+               $link .= '
+                               <a href="' . $href . '&delete=1" ' . $onClick . '>
+                                       <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/delete_record.gif') . ' alt="" />
+                               </a>';
+               return $link;
+       }
+
+       /**
+        * Save/Update a BE user
+        *
+        * @param       array           $record: Current action record
+        * @param       array           $vars: POST vars
+        * @return      int Id of the new/updated user
+        */
+       protected function saveNewBackendUser($record, $vars) {
+               $content = '';
+
+                       // check if the db mount is a page the current user is allowed to.);
+               $vars['db_mountpoints'] = $this->fixDbMount($vars['db_mountpoints']);
+                       // check if the usergroup is allowed
+               $vars['usergroup'] = $this->fixUserGroup($vars['usergroup'], $record);
+                       // check if md5 is used as password encryption
+               if (strpos($GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], 'md5') !== FALSE) {
+                       $vars['password'] = md5($vars['password']);
+               }
+
+               $key = $vars['key'];
+               $data = '';
+               $newUserId = 0;
+
+               if ($key === 'NEW') {
+                       $beRec = t3lib_BEfunc::getRecord('be_users', intval($record['t1_copy_of_user']));
+                       if (is_array($beRec)) {
+                               $data = array();
+                               $data['be_users'][$key] = $beRec;
+                               $data['be_users'][$key]['username']                     = $this->fixUsername($vars['username'], $record['t1_userprefix']);
+                               $data['be_users'][$key]['password']                     = (trim($vars['password']));
+                               $data['be_users'][$key]['realName']                     = $vars['realName'];
+                               $data['be_users'][$key]['email']                        = $vars['email'];
+                               $data['be_users'][$key]['disable']                      = intval($vars['disable']);
+                               $data['be_users'][$key]['admin']                        = 0;
+                               $data['be_users'][$key]['usergroup']            = $vars['usergroup'];
+                               $data['be_users'][$key]['db_mountpoints']       = $vars['db_mountpoints'];
+                               $data['be_users'][$key]['createdByAction']      = $record['uid'];
+                       }
+               } else {
+                               // check ownership
+                       $beRec = t3lib_BEfunc::getRecord('be_users', intval($key));
+                       if (is_array($beRec) && $beRec['cruser_id'] == $GLOBALS['BE_USER']->user['uid']) {
+                               $data=array();
+                               $data['be_users'][$key]['username'] = $this->fixUsername($vars['username'], $record['t1_userprefix']);
+                               if (trim($vars['password'])) {
+                                       $data['be_users'][$key]['password'] = (trim($vars['password']));
+                               }
+
+                               $data['be_users'][$key]['realName']                     = $vars['realName'];
+                               $data['be_users'][$key]['email']                        = $vars['email'];
+                               $data['be_users'][$key]['disable']                      = intval($vars['disable']);
+                               $data['be_users'][$key]['admin']                        = 0;
+                               $data['be_users'][$key]['usergroup']            = $vars['usergroup'];
+                               $data['be_users'][$key]['db_mountpoints']       = $vars['db_mountpoints'];
+                               $newUserId = $key;
+                       }
+               }
+
+                       // save/update user by using TCEmain
+               if (is_array($data)) {
+                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                       $tce->stripslashes_values = 0;
+                       $tce->start($data, array(), $GLOBALS['BE_USER']);
+                       $tce->admin = 1;
+                       $tce->process_datamap();
+                       $newUserId = intval($tce->substNEWwithIDs['NEW']);
+
+                       if ($newUserId) {
+                                       // Create
+                               $this->action_createDir($newUserId);
+                       } else {
+                                       // update
+                               $newUserId = intval($key);
+                       }
+                       unset($tce);
+               }
+               return $newUserId;
+       }
+
+       /**
+        * Create the username based on the given username and the prefix
+        *
+        * @param       string          $username: username
+        * @param       string          $prefix: prefix
+        * @return string       Combined username
+        */
+       private function fixUsername($username, $prefix) {
+               return trim($prefix) . trim($username);
+       }
+
+       /**
+        * Clean the to be applied usergroups from not allowed ones
+        *
+        * @param       array           $appliedUsergroups: array of to be applied user groups
+        * @return array        Cleaned array
+        */
+       protected function fixUserGroup($appliedUsergroups, $actionRecord) {
+               if (is_array($appliedUsergroups)) {
+                       $cleanGroupList = array();
+
+                               // create an array from the allowed usergroups using the uid as key
+                       $allowedUsergroups = array_flip(explode(',', $actionRecord['t1_allowed_groups']));
+
+                               // walk through the array and check every uid if it is undder the allowed ines
+                       foreach ($appliedUsergroups as $group) {
+                               if (isset($allowedUsergroups[$group])) {
+                                       $cleanGroupList[] = $group;
+                               }
+                       }
+                       $appliedUsergroups = $cleanGroupList;
+               }
+
+               return $appliedUsergroups;
+       }
+
+       /**
+        * Clean the to be applied DB-Mounts from not allowed ones
+        *
+        * @param       string          $appliedDbMounts: List of pages like pages_123,pages456
+        * @return string       Cleaned list
+        */
+       protected function fixDbMount($appliedDbMounts) {
+                       // Admins can see any page, no need to check there
+               if (!empty($appliedDbMounts) && !$GLOBALS['BE_USER']->isAdmin()) {
+                       $cleanDbMountList = array();
+                       $dbMounts = t3lib_div::trimExplode(',', $appliedDbMounts, 1);
+
+                               // walk through every wanted DB-Mount and check if it allowed for the current user
+                       foreach ($dbMounts as $dbMount) {
+                               $uid = intval(substr($dbMount,  (strrpos($dbMount, '_') + 1)));
+                               $page = t3lib_BEfunc::getRecord('pages', $uid);
+
+                                       // check rootline and access rights
+                               if ($this->checkRootline($uid) && $GLOBALS['BE_USER']->calcPerms($page)) {
+                                       $cleanDbMountList[] = 'pages' . $uid;
+                               }
+                       }
+                               // build the clean list
+                       $appliedDbMounts = implode(',', $cleanDbMountList);
+               }
+
+               return $appliedDbMounts;
+       }
+
+       /**
+        * Check if a page is inside the rootline the current user can see
+        *
+        * @param       int             $pageId: Id of the the page to be checked
+        * @return boolean      Access to the page
+        */
+       protected function checkRootline($pageId) {
+               $access = FALSE;
+
+               $dbMounts =  array_flip(explode(',', trim($GLOBALS['BE_USER']->dataLists['webmount_list'], ',')));
+               $rootline = t3lib_BEfunc::BEgetRootLine($pageId);
+               foreach ($rootline as $page) {
+                       if (isset($dbMounts[$page['uid']]) && !$access) {
+                               $access = TRUE;
+                       }
+               }
+               return $access;
+       }
+
+       /**
+        * Add additional JavaScript to use the tceform select box
+        *
+        * @param       int             $uid: Id of the user record
+        * @return void
+        */
+       protected function JScode() {
+               $this->t3lib_TCEforms = t3lib_div::makeInstance("t3lib_TCEforms");
+               $this->t3lib_TCEforms->backPath = $GLOBALS['BACK_PATH'];
+               $js = $this->t3lib_TCEforms->dbFileCon();
+               $this->taskObject->doc->JScodeArray[] = $js;
+
+               return $js;
+       }
+
+       /**
+        * Create a user directory if defined
+        *
+        * @param       int             $uid: Id of the user record
+        * @return void
+        */
+       protected function action_createDir($uid) {
+               $path = $this->action_getUserMainDir();
+               if ($path) {
+                       t3lib_div::mkdir($path . $uid);
+                       t3lib_div::mkdir($path . $uid . '/_temp_/');
+               }
+       }
+
+       /**
+        * Get the path to the user home directory which is set in the localconf.php
+        *
+        * @return string path
+        */
+       protected function action_getUserMainDir() {
+               $path = $GLOBALS['TYPO3_CONF_VARS']['BE']['userHomePath'];
+
+                       // if path is set and a valid directory
+               if ($path && @is_dir($path) &&
+                               $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] &&
+                               t3lib_div::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath']) &&
+                               substr($path,-1) == '/'
+                       ) {
+                       return $path;
+               }
+       }
+
+       protected function getUsergroups($record, $vars) {
+               $content = '';
+                       // do nothing if no groups are allowed
+               if (empty($record['t1_allowed_groups'])) {
+                       return $content;
+               }
+
+               $content .= '<option value=""></option>';
+               $grList = t3lib_div::trimExplode(',',  $record['t1_allowed_groups'], 1);
+               foreach($grList as $group) {
+                       $checkGroup = t3lib_BEfunc::getRecord('be_groups', $group);
+                       if (is_array($checkGroup)) {
+                               $selected = (is_array($vars['usergroup']) && t3lib_div::inList(implode(',', $vars['usergroup']), $checkGroup['uid'])) ? ' selected="selected" ' : '';
+                               $content .= '<option ' . $selected . 'value="' . $checkGroup['uid'] . '">' . htmlspecialchars($checkGroup['title']) . '</option>';
+                       }
+               }
+
+               return $content;
+       }
+
+
+       /**
+        * Action to create a new record
+        *
+        * @param       array           $record: sys_action record
+        * @return      redirect to form to create a record
+        */
+       protected function viewNewRecord($record) {
+               $returnUrl = rawurlencode('mod.php?M=user_task');
+               $link = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . $returnUrl. '&edit[' . $record['t3_tables'] . '][' . intval($record['t3_listPid']) . ']=new';
+               t3lib_utility_Http::redirect($link);
+       }
+
+       /**
+        * Action to edit records
+        *
+        * @param       array           $record: sys_action record
+        * @return      string list of records
+        */
+       protected function viewEditRecord($record) {
+               $content = '';
+               $lines = array();
+
+               $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
+               $dbAnalysis->fromTC = 0;
+               $dbAnalysis->start($record['t4_recordsToEdit'], '*');
+               $dbAnalysis->getFromDB();
+
+                       // collect the records
+               foreach ($dbAnalysis->itemArray as $el) {
+                       $path = t3lib_BEfunc::getRecordPath ($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']);
+                       $record = t3lib_BEfunc::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
+                       $title = t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
+                       $description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], 1);
+                       if (isset($record['crdate'])) { // @todo: which information could be  needfull
+                               $description .= ' - ' . t3lib_BEfunc::dateTimeAge($record['crdate']);
+                       }
+
+                       $lines[$el['id']] = array(
+                               'title'                         => $title,
+                               'description'           => t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]),
+                               'descriptionHtml'       => $description,
+                               'link'                          => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit',
+                               'icon'                          => t3lib_iconworks::getIconImage($el['table'], $dbAnalysis->results[$el['table']][$el['id']], $GLOBALS['BACK_PATH'], 'hspace="2" align="top" title="' . htmlspecialchars($path) . '"')
+                       );
+               }
+
+                       // render the record list
+               $content .= $this->taskObject->renderListMenu($lines);
+
+               return $content;
+       }
+
+       /**
+        * Action to view the result of a SQL query
+        *
+        * @param       array           $record: sys_action record
+        * @return      string result of the query
+        */
+       protected function viewSqlQuery($record) {
+               $content = '';
+
+               if (t3lib_extMgm::isLoaded('lowlevel')) {
+                       $sql_query = unserialize($record['t2_data']);
+
+                       if (is_array($sql_query) && strtoupper(substr(trim($sql_query['qSelect']), 0, 6)) == 'SELECT') {
+                               $actionContent = '';
+
+                               $fullsearch = t3lib_div::makeInstance("t3lib_fullsearch");
+                               $fullsearch->formW = 40;
+                               $fullsearch->noDownloadB = 1;
+
+
+                               $type = $sql_query['qC']['search_query_makeQuery'];
+                               $res = $GLOBALS['TYPO3_DB']->sql_query($sql_query['qSelect']);
+
+                               if (!$GLOBALS['TYPO3_DB']->sql_error()) {
+                                       $fullsearch->formW = 48;
+                                               // additional configuration
+                                       $GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels'] = 1;
+                                       $cP = $fullsearch->getQueryResultCode($type, $res, $sql_query['qC']['queryTable']);
+                                       $actionContent = $cP['content'];
+
+                                               // if the result is rendered as csv or xml, show a download link
+                                       if ($type == 'csv' || $type == 'xml' ) {
+                                               $actionContent .= '<br /><br /><a href="' . t3lib_div::getIndpEnv('REQUEST_URI') . '&download_file=1"><strong>' . $GLOBALS['LANG']->getLL('action_download_file') . '</strong></a>';
+                                       }
+                               } else {
+                                       $actionContent .= $GLOBALS['TYPO3_DB']->sql_error();
+                               }
+
+                               // Admin users are allowed to see and edit the query
+                               if ($GLOBALS['BE_USER']->isAdmin()) {
+                                       $actionContent .= '<hr /> ' . $fullsearch->tableWrap($sql_query['qSelect']);
+                                       $actionContent .= '<br /><a title="' . $GLOBALS['LANG']->getLL('action_editQuery') . '" href="'.$GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('lowlevel') . 'dbint/index.php?id='.
+                                               '&SET[function]=search' .
+                                               '&SET[search]=query' .
+                                               '&storeControl[STORE]=-' . $record['uid'] .
+                                               '&storeControl[LOAD]=1' .
+                                               '">
+                                               <img class="icon"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif') . ' alt="" />' .
+                                                       $GLOBALS['LANG']->getLL('action_editQuery') . '</a><br /><br />';
+                               }
+
+                               $content .= $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t2_result'), $actionContent, 0, 1);
+                       } else {
+                                       // query is not configured
+                               $flashMessage = t3lib_div::makeInstance (
+                                       't3lib_FlashMessage',
+                                       $GLOBALS['LANG']->getLL('action_notReady', true),
+                                       $GLOBALS['LANG']->getLL('action_error'),
+                                       t3lib_FlashMessage::ERROR
+                               );
+                               $content .= '<br />' . $flashMessage->render();
+                       }
+               } else {
+                               // required sysext lowlevel is not installed
+                       $flashMessage = t3lib_div::makeInstance (
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('action_lowlevelMissing', true),
+                               $GLOBALS['LANG']->getLL('action_error'),
+                               t3lib_FlashMessage::ERROR
+                       );
+                       $content .= '<br />' . $flashMessage->render();
+               }
+               return $content;
+       }
+
+       /**
+        * Action to create a list of records of a specific table and pid
+        *
+        * @param       array           $record: sys_action record
+        * @return      string list of records
+        */
+       protected function viewRecordList($record) {
+               $content = '';
+
+               $this->id               = intval($record['t3_listPid']);
+               $this->table    = $record['t3_tables'];
+
+               if ($this->id == 0 || $this->table == '') {
+                       $flashMessage = t3lib_div::makeInstance(
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('action_lowlevelMissing', true),
+                               $GLOBALS['LANG']->getLL('action_error'),
+                               t3lib_FlashMessage::ERROR
+                       );
+                       $content .= '<br />' . $flashMessage->render();
+
+                       return $content;
+               }
+
+               require_once($GLOBALS['BACK_PATH'] . 'class.db_list.inc');
+               require_once($GLOBALS['BACK_PATH'] . 'class.db_list_extra.inc');
+
+
+                       // Start document template object:
+//             $this->doc = t3lib_div::makeInstance('template');
+
+                       // Loading current page record and checking access:
+               $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->taskObject->perms_clause);
+               $access = is_array($this->pageinfo) ? 1 : 0;
+
+
+                       // If there is access to the page, then render the list contents and set up the document template object:
+               if ($access) {
+                               // Initialize the dblist object:
+                       $dblist = t3lib_div::makeInstance('localRecordList');
+                       $dblist->script = t3lib_div::getIndpEnv('REQUEST_URI');
+                       $dblist->backPath = $GLOBALS['BACK_PATH'];
+                       $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);
+                       $dblist->thumbs = $GLOBALS['BE_USER']->uc['thumbnailsByDefault'];
+                       $dblist->returnUrl=$this->taskObject->returnUrl;
+                       $dblist->allFields = 1;
+                       $dblist->localizationView = 1;
+                       $dblist->showClipboard = 0;
+                       $dblist->disableSingleTableView = 1;
+                       $dblist->pageRow = $this->pageinfo;
+                       $dblist->counter++;
+                       $dblist->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');
+                       $dblist->modTSconfig = $this->taskObject->modTSconfig;
+                       $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->taskObject->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current=='normal' && !$GLOBALS['BE_USER']->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
+
+                               // Initialize the listing object, dblist, for rendering the list:
+                       $this->pointer = t3lib_div::intInRange($this->taskObject->pointer,0,100000);
+                       $dblist->start($this->id,$this->table,$this->pointer,$this->taskObject->search_field,$this->taskObject->search_levels,$this->taskObject->showLimit);
+                       $dblist->setDispFields();
+
+                               // Render the list of tables:
+                       $dblist->generateList();
+
+                               // Add JavaScript functions to the page:
+                       $this->taskObject->doc->JScode=$this->taskObject->doc->wrapScriptTags('
+
+                               function jumpToUrl(URL) {
+                                       window.location.href = URL;
+                                       return false;
+                               }
+                               function jumpExt(URL,anchor) {
+                                       var anc = anchor?anchor:"";
+                                       window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
+                                       return false;
+                               }
+                               function jumpSelf(URL) {
+                                       window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
+                                       return false;
+                               }
+
+                               function setHighlight(id) {
+                                       top.fsMod.recentIds["web"]=id;
+                                       top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank;    // For highlighting
+
+                                       if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
+                                               top.content.nav_frame.refresh_nav();
+                                       }
+                               }
+
+                               ' . $dblist->CBfunctions() . '
+                               function editRecords(table,idList,addParams,CBflag) {
+                                       window.location.href="' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) .
+                                               '&edit["+table+"]["+idList+"]=edit"+addParams;
+                               }
+                               function editList(table,idList) {
+                                       var list="";
+
+                                               // Checking how many is checked, how many is not
+                                       var pointer=0;
+                                       var pos = idList.indexOf(",");
+                                       while (pos!=-1) {
+                                               if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
+                                                       list+=idList.substr(pointer,pos-pointer)+",";
+                                               }
+                                               pointer=pos+1;
+                                               pos = idList.indexOf(",",pointer);
+                                       }
+                                       if (cbValue(table+"|"+idList.substr(pointer))) {
+                                               list+=idList.substr(pointer)+",";
+                                       }
+
+                                       return list ? list : idList;
+                               }
+                               T3_THIS_LOCATION = "' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '";
+
+                               if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
+                       ');
+
+                               // Setting up the context sensitive menu:
+                       $this->taskObject->doc->getContextMenuCode();
+
+
+                               // Begin to compile the whole page
+                       $content .= '<form action="'.htmlspecialchars($dblist->listURL()).'" method="post" name="dblistForm">' .
+                                                       $dblist->HTMLcode .
+                                                       '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" />
+                                               </form>';
+
+                               // If a listing was produced, create the page footer with search form etc:
+                       if ($dblist->HTMLcode) {
+
+                                       // Making field select box (when extended view for a single table is enabled):
+                               if ($dblist->table) {
+                                       $tmpBackpath = $GLOBALS['BACK_PATH'];
+                                       $GLOBALS['BACK_PATH'] = '';
+                                       $content .= $dblist->fieldSelectBox($dblist->table);
+                                       $GLOBALS['BACK_PATH'] = $tmpBackpath;
+                               }
+                       }
+               } else {
+                               // not enough rights to access the list view or the page
+                       $flashMessage = t3lib_div::makeInstance(
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('action_error-access', true),
+                               $GLOBALS['LANG']->getLL('action_error'),
+                               t3lib_FlashMessage::ERROR
+                       );
+                       $content .= $flashMessage->render();
+               }
+
+               return $content;
+       }
+
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_task.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_task.php']);
+}
+
 ?>
\ No newline at end of file
index bb233de..3526a2e 100644 (file)
-// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support\r
-// (c) 2008-2009 Angus Turnbull http://www.twinhelix.com\r
-\r
-// This is licensed under the GNU LGPL, version 2.1 or later.\r
-// For details, see: http://creativecommons.org/licenses/LGPL/2.1/\r
-\r
-var IEPNGFix = window.IEPNGFix || {};\r
-\r
-IEPNGFix.tileBG = function(elm, pngSrc, ready) {\r
-       // Params: A reference to a DOM element, the PNG src file pathname, and a\r
-       // hidden "ready-to-run" passed when called back after image preloading.\r
-\r
-       var data = this.data[elm.uniqueID],\r
-               elmW = Math.max(elm.clientWidth, elm.scrollWidth),\r
-               elmH = Math.max(elm.clientHeight, elm.scrollHeight),\r
-               bgX = elm.currentStyle.backgroundPositionX,\r
-               bgY = elm.currentStyle.backgroundPositionY,\r
-               bgR = elm.currentStyle.backgroundRepeat;\r
-\r
-       // Cache of DIVs created per element, and image preloader/data.\r
-       if (!data.tiles) {\r
-               data.tiles = {\r
-                       elm: elm,\r
-                       src: '',\r
-                       cache: [],\r
-                       img: new Image(),\r
-                       old: {}\r
-               };\r
-       }\r
-       var tiles = data.tiles,\r
-               pngW = tiles.img.width,\r
-               pngH = tiles.img.height;\r
-\r
-       if (pngSrc) {\r
-               if (!ready && pngSrc != tiles.src) {\r
-                       // New image? Preload it with a callback to detect dimensions.\r
-                       tiles.img.onload = function() {\r
-                               this.onload = null;\r
-                               IEPNGFix.tileBG(elm, pngSrc, 1);\r
-                       };\r
-                       return tiles.img.src = pngSrc;\r
-               }\r
-       } else {\r
-               // No image?\r
-               if (tiles.src) ready = 1;\r
-               pngW = pngH = 0;\r
-       }\r
-       tiles.src = pngSrc;\r
-\r
-       if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&\r
-               bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {\r
-               return;\r
-       }\r
-\r
-       // Convert English and percentage positions to pixels.\r
-       var pos = {\r
-                       top: '0%',\r
-                       left: '0%',\r
-                       center: '50%',\r
-                       bottom: '100%',\r
-                       right: '100%'\r
-               },\r
-               x,\r
-               y,\r
-               pc;\r
-       x = pos[bgX] || bgX;\r
-       y = pos[bgY] || bgY;\r
-       if (pc = x.match(/(\d+)%/)) {\r
-               x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));\r
-       }\r
-       if (pc = y.match(/(\d+)%/)) {\r
-               y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));\r
-       }\r
-       x = parseInt(x);\r
-       y = parseInt(y);\r
-\r
-       var repeatX = false;\r
-       var repeatY = false;\r
-       \r
-       // Go!\r
-       this.hook.enabled = 0;\r
-       if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {\r
-               elm.style.position = 'relative';\r
-       } \r
-       var count = 0,\r
-               xPos,\r
-               maxX = repeatX ? elmW : x + 0.1,\r
-               yPos,\r
-               maxY = repeatY ? elmH : y + 0.1,\r
-               d,\r
-               s,\r
-               isNew;\r
-       if (pngW && pngH) {\r
-               for (xPos = x; xPos < maxX; xPos += pngW) {\r
-                       for (yPos = y; yPos < maxY; yPos += pngH) {\r
-                               isNew = 0;\r
-                               if (!tiles.cache[count]) {\r
-                                       tiles.cache[count] = document.createElement('div');\r
-                                       isNew = 1;\r
-                               }\r
-                               var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),\r
-                                       clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);\r
-                               d = tiles.cache[count];\r
-                               s = d.style;\r
-                               s.behavior = 'none';\r
-                               s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';\r
-                               s.top = yPos + 'px';\r
-                               s.width = clipR + 'px';\r
-                               s.height = clipB + 'px';\r
-                               s.clip = 'rect(' +\r
-                                       (yPos < 0 ? 0 - yPos : 0) + 'px,' +\r
-                                       clipR + 'px,' +\r
-                                       clipB + 'px,' +\r
-                                       (xPos < 0 ? 0 - xPos : 0) + 'px)';\r
-                               s.display = 'block';\r
-                               if (isNew) {\r
-                                       s.position = 'absolute';\r
-                                       s.zIndex = -999;\r
-                                       if (elm.firstChild) {\r
-                                               elm.insertBefore(d, elm.firstChild);\r
-                                       } else {\r
-                                               elm.appendChild(d);\r
-                                       }\r
-                               }\r
-                               this.fix(d, pngSrc, 0);\r
-                               count++;\r
-                       }\r
-               }\r
-       }\r
-       while (count < tiles.cache.length) {\r
-               this.fix(tiles.cache[count], '', 0);\r
-               tiles.cache[count++].style.display = 'none';\r
-       }\r
-\r
-       this.hook.enabled = 1;\r
-\r
-       // Cache so updates are infrequent.\r
-       tiles.old = {\r
-               w: elmW,\r
-               h: elmH,\r
-               x: bgX,\r
-               y: bgY,\r
-               r: bgR\r
-       };\r
-};\r
-\r
-\r
-IEPNGFix.update = function() {\r
-       // Update all PNG backgrounds.\r
-       for (var i in IEPNGFix.data) {\r
-               var t = IEPNGFix.data[i].tiles;\r
-               if (t && t.elm && t.src) {\r
-                       IEPNGFix.tileBG(t.elm, t.src);\r
-               }\r
-       }\r
-};\r
-IEPNGFix.update.timer = 0;\r
-\r
-if (window.attachEvent && !window.opera) {\r
-       window.attachEvent('onresize', function() {\r
-               clearTimeout(IEPNGFix.update.timer);\r
-               IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);\r
-       });\r
-}\r
+// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
+// (c) 2008-2009 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+var IEPNGFix = window.IEPNGFix || {};
+
+IEPNGFix.tileBG = function(elm, pngSrc, ready) {
+       // Params: A reference to a DOM element, the PNG src file pathname, and a
+       // hidden "ready-to-run" passed when called back after image preloading.
+
+       var data = this.data[elm.uniqueID],
+               elmW = Math.max(elm.clientWidth, elm.scrollWidth),
+               elmH = Math.max(elm.clientHeight, elm.scrollHeight),
+               bgX = elm.currentStyle.backgroundPositionX,
+               bgY = elm.currentStyle.backgroundPositionY,
+               bgR = elm.currentStyle.backgroundRepeat;
+
+       // Cache of DIVs created per element, and image preloader/data.
+       if (!data.tiles) {
+               data.tiles = {
+                       elm: elm,
+                       src: '',
+                       cache: [],
+                       img: new Image(),
+                       old: {}
+               };
+       }
+       var tiles = data.tiles,
+               pngW = tiles.img.width,
+               pngH = tiles.img.height;
+
+       if (pngSrc) {
+               if (!ready && pngSrc != tiles.src) {
+                       // New image? Preload it with a callback to detect dimensions.
+                       tiles.img.onload = function() {
+                               this.onload = null;
+                               IEPNGFix.tileBG(elm, pngSrc, 1);
+                       };
+                       return tiles.img.src = pngSrc;
+               }
+       } else {
+               // No image?
+               if (tiles.src) ready = 1;
+               pngW = pngH = 0;
+       }
+       tiles.src = pngSrc;
+
+       if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
+               bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
+               return;
+       }
+
+       // Convert English and percentage positions to pixels.
+       var pos = {
+                       top: '0%',
+                       left: '0%',
+                       center: '50%',
+                       bottom: '100%',
+                       right: '100%'
+               },
+               x,
+               y,
+               pc;
+       x = pos[bgX] || bgX;
+       y = pos[bgY] || bgY;
+       if (pc = x.match(/(\d+)%/)) {
+               x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
+       }
+       if (pc = y.match(/(\d+)%/)) {
+               y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
+       }
+       x = parseInt(x);
+       y = parseInt(y);
+
+       var repeatX = false;
+       var repeatY = false;
+       
+       // Go!
+       this.hook.enabled = 0;
+       if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
+               elm.style.position = 'relative';
+       } 
+       var count = 0,
+               xPos,
+               maxX = repeatX ? elmW : x + 0.1,
+               yPos,
+               maxY = repeatY ? elmH : y + 0.1,
+               d,
+               s,
+               isNew;
+       if (pngW && pngH) {
+               for (xPos = x; xPos < maxX; xPos += pngW) {
+                       for (yPos = y; yPos < maxY; yPos += pngH) {
+                               isNew = 0;
+                               if (!tiles.cache[count]) {
+                                       tiles.cache[count] = document.createElement('div');
+                                       isNew = 1;
+                               }
+                               var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),
+                                       clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);
+                               d = tiles.cache[count];
+                               s = d.style;
+                               s.behavior = 'none';
+                               s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';
+                               s.top = yPos + 'px';
+                               s.width = clipR + 'px';
+                               s.height = clipB + 'px';
+                               s.clip = 'rect(' +
+                                       (yPos < 0 ? 0 - yPos : 0) + 'px,' +
+                                       clipR + 'px,' +
+                                       clipB + 'px,' +
+                                       (xPos < 0 ? 0 - xPos : 0) + 'px)';
+                               s.display = 'block';
+                               if (isNew) {
+                                       s.position = 'absolute';
+                                       s.zIndex = -999;
+                                       if (elm.firstChild) {
+                                               elm.insertBefore(d, elm.firstChild);
+                                       } else {
+                                               elm.appendChild(d);
+                                       }
+                               }
+                               this.fix(d, pngSrc, 0);
+                               count++;
+                       }
+               }
+       }
+       while (count < tiles.cache.length) {
+               this.fix(tiles.cache[count], '', 0);
+               tiles.cache[count++].style.display = 'none';
+       }
+
+       this.hook.enabled = 1;
+
+       // Cache so updates are infrequent.
+       tiles.old = {
+               w: elmW,
+               h: elmH,
+               x: bgX,
+               y: bgY,
+               r: bgR
+       };
+};
+
+
+IEPNGFix.update = function() {
+       // Update all PNG backgrounds.
+       for (var i in IEPNGFix.data) {
+               var t = IEPNGFix.data[i].tiles;
+               if (t && t.elm && t.src) {
+                       IEPNGFix.tileBG(t.elm, t.src);
+               }
+       }
+};
+IEPNGFix.update.timer = 0;
+
+if (window.attachEvent && !window.opera) {
+       window.attachEvent('onresize', function() {
+               clearTimeout(IEPNGFix.update.timer);
+               IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
+       });
+}
index 7fabd5e..a557b23 100644 (file)
@@ -1,11 +1,11 @@
-<?php\r
-\r
-// Use this file in your CSS in place of the .HTC file if it works offline but not online.\r
-// It will send the correct MIME type so that IE will execute the script correctly.\r
-\r
-header('Content-Type: text/x-component');\r
-header('Expires: '.gmdate('D, d M Y H:i:s', time()+60*60*24*365).' GMT');\r
-header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime('iepngfix.htc')).' GMT');\r
-include('iepngfix.htc');\r
-\r
-?>\r
+<?php
+
+// Use this file in your CSS in place of the .HTC file if it works offline but not online.
+// It will send the correct MIME type so that IE will execute the script correctly.
+
+header('Content-Type: text/x-component');
+header('Expires: '.gmdate('D, d M Y H:i:s', time()+60*60*24*365).' GMT');
+header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime('iepngfix.htc')).' GMT');
+include('iepngfix.htc');
+
+?>