Refactoring
authorAlex Kellner <alexander.kellner@in2code.de>
Thu, 30 Jan 2014 14:43:05 +0000 (15:43 +0100)
committerAlex Kellner <alexander.kellner@in2code.de>
Thu, 30 Jan 2014 14:43:05 +0000 (15:43 +0100)
.idea/workspace.xml
Classes/Utility/EidClearSession.php
Classes/Utility/EidReadSession.php
Classes/Utility/EidSaveInSession.php
Classes/Utility/OldEidReadSession.php [deleted file]

index 4b7c7bd..654ef72 100644 (file)
@@ -1,14 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <project version="4">\r
   <component name="ChangeListManager">\r
-    <list default="true" readonly="true" id="500e5988-e13b-4ba1-8a60-e63a97f737a1" name="Default" comment="Working Copy">\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Classes/Utility/OldEidReadSession.php" />\r
-      <change type="DELETED" beforePath="D:\phpstormprojects\powermailCond\Classes\Utility\OldEidGetFieldlist.php" afterPath="" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Classes/Utility/EidGetFieldlist.php" afterPath="$PROJECT_DIR$/Classes/Utility/EidGetFieldlist.php" />\r
+    <list default="true" readonly="true" id="500e5988-e13b-4ba1-8a60-e63a97f737a1" name="Default" comment="">\r
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Classes/Utility/EidClearSession.php" />\r
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Classes/Utility/EidReadSession.php" afterPath="$PROJECT_DIR$/Classes/Utility/EidReadSession.php" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ext_localconf.php" afterPath="$PROJECT_DIR$/ext_localconf.php" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/powermail_cond@powermailt347.in2code.de.iml" afterPath="$PROJECT_DIR$/.idea/powermail_cond@powermailt347.in2code.de.iml" />\r
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php" afterPath="$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php" />\r
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />\r
+      <change type="MOVED" beforePath="D:\phpstormprojects\powermailCond\Classes\Utility\OldEidReadSession.php" afterPath="$PROJECT_DIR$/Classes/Utility/EidClearSession.php" />\r
     </list>\r
     <ignored path="powermail_cond@powermailt347.in2code.de.iws" />\r
     <ignored path=".idea/workspace.xml" />\r
     <favorites_list name="powermail_cond@powermailt347.in2code.de" />\r
   </component>\r
   <component name="FileEditorManager">\r
-    <leaf>\r
-      <file leaf-file-name="OldEidReadSession.php" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/Classes/Utility/OldEidReadSession.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="37" column="34" selection-start="1517" selection-end="1517" vertical-scroll-proportion="-3.8076923" vertical-offset="173" max-vertical-offset="1394">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="EidReadSession.php" pinned="false" current="true" current-in-tab="true">\r
-        <entry file="file://$PROJECT_DIR$/Classes/Utility/EidReadSession.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="43" column="6" selection-start="1344" selection-end="1344" vertical-scroll-proportion="0.39016393" vertical-offset="0" max-vertical-offset="1190">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="ext_localconf.php" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="28" column="4" selection-start="892" selection-end="892" vertical-scroll-proportion="-18.307692" vertical-offset="0" max-vertical-offset="612">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="EidGetFieldlist.php" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/Classes/Utility/EidGetFieldlist.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="11.769231" vertical-offset="306" max-vertical-offset="5882">\r
-              <folding>\r
-                <element signature="e#6#984#0" expanded="true" />\r
-              </folding>\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-    </leaf>\r
+    <leaf />\r
   </component>\r
   <component name="FindManager">\r
     <FindUsagesManager>\r
   <component name="IdeDocumentHistory">\r
     <option name="changedFiles">\r
       <list>\r
-        <option value="$PROJECT_DIR$/ext_tables.php" />\r
-        <option value="$PROJECT_DIR$/Configuration/TypoScript/setup.txt" />\r
-        <option value="$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php" />\r
-        <option value="$PROJECT_DIR$/Classes/Utility/EidClearSession.php" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/Div.php" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
         <option value="$PROJECT_DIR$/Configuration/TCA/Condition.php" />\r
         <option value="$PROJECT_DIR$/ext_localconf.php" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/EidGetFieldlist.php" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/OldEidReadSession.php" />\r
+        <option value="$PROJECT_DIR$/Classes/Utility/OldEidClearSession.php" />\r
+        <option value="$PROJECT_DIR$/Classes/Utility/EidClearSession.php" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/EidReadSession.php" />\r
+        <option value="$PROJECT_DIR$/Classes/Utility/OldEidSaveInSession.php" />\r
+        <option value="$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php" />\r
       </list>\r
     </option>\r
   </component>\r
       <created>1391090666900</created>\r
       <updated>1391090666900</updated>\r
     </task>\r
-    <option name="localTasksCounter" value="24" />\r
+    <task id="LOCAL-00024" summary="Refactoring">\r
+      <created>1391092574461</created>\r
+      <updated>1391092574461</updated>\r
+    </task>\r
+    <option name="localTasksCounter" value="25" />\r
     <servers />\r
   </component>\r
   <component name="ToolWindowManager">\r
     <frame x="1592" y="-262" width="1936" height="1096" extended-state="6" />\r
-    <editor active="true" />\r
+    <editor active="false" />\r
     <layout>\r
       <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32655653" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
       <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32917964" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />\r
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.15894467" sideWeight="0.3448276" order="1" side_tool="true" content_ui="tabs" />\r
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.14461046" sideWeight="0.67344344" order="0" side_tool="false" content_ui="combo" />\r
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.14461046" sideWeight="0.67344344" order="0" side_tool="false" content_ui="combo" />\r
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />\r
       <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />\r
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />\r
     <MESSAGE value="Working Copy" />\r
     <MESSAGE value="Initial Commit" />\r
     <MESSAGE value="Cleaning EidGetFieldlist" />\r
-    <option name="LAST_COMMIT_MESSAGE" value="Cleaning EidGetFieldlist" />\r
+    <MESSAGE value="Refactoring" />\r
+    <option name="LAST_COMMIT_MESSAGE" value="Refactoring" />\r
   </component>\r
   <component name="XDebuggerManager">\r
     <breakpoint-manager />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidClearSession.php">\r
-      <provider selected="true" editor-type-id="text-editor">\r
-        <state line="63" column="64" selection-start="2085" selection-end="2085" vertical-scroll-proportion="0.50328946" vertical-offset="0" max-vertical-offset="0" />\r
-      </provider>\r
-    </entry>\r
     <entry file="file://$PROJECT_DIR$/ext_tables.sql">\r
       <provider selected="true" editor-type-id="text-editor">\r
         <state line="1" column="68" selection-start="31" selection-end="70" vertical-scroll-proportion="0.018123668" vertical-offset="0" max-vertical-offset="0" />\r
         <state line="32" column="6" selection-start="1188" selection-end="1188" vertical-scroll-proportion="0.023224045" vertical-offset="0" max-vertical-offset="0" />\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php">\r
-      <provider selected="true" editor-type-id="text-editor">\r
-        <state line="31" column="19" selection-start="1308" selection-end="1308" vertical-scroll-proportion="0.023224045" vertical-offset="0" max-vertical-offset="0" />\r
-      </provider>\r
-    </entry>\r
     <entry file="file://$PROJECT_DIR$/Resources/Public/Css/PowermailCond.css">\r
       <provider selected="true" editor-type-id="text-editor">\r
         <state line="8" column="1" selection-start="135" selection-end="135" vertical-scroll-proportion="0.17941953" vertical-offset="0" max-vertical-offset="0" />\r
         </state>\r
       </provider>\r
     </entry>\r
+    <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="28" column="4" selection-start="892" selection-end="892" vertical-scroll-proportion="0.52021855" vertical-offset="0" max-vertical-offset="915">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidReadSession.php">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="85" column="5" selection-start="2479" selection-end="2479" vertical-scroll-proportion="0.8142077" vertical-offset="326" max-vertical-offset="1241">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
     <entry file="file://$PROJECT_DIR$/Classes/Utility/EidGetFieldlist.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="11.769231" vertical-offset="306" max-vertical-offset="5882">\r
+        <state line="340" column="18" selection-start="9891" selection-end="9891" vertical-scroll-proportion="2.2262294" vertical-offset="3743" max-vertical-offset="5882">\r
           <folding>\r
             <element signature="e#6#984#0" expanded="true" />\r
           </folding>\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Classes/Utility/OldEidReadSession.php">\r
+    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidClearSession.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="37" column="34" selection-start="1517" selection-end="1517" vertical-scroll-proportion="-3.8076923" vertical-offset="173" max-vertical-offset="1394">\r
+        <state line="46" column="46" selection-start="1410" selection-end="1476" vertical-scroll-proportion="0.16393442" vertical-offset="258" max-vertical-offset="1173">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
+    <entry file="file://$PROJECT_DIR$/Classes/Utility/OldEidSaveInSession.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="28" column="4" selection-start="892" selection-end="892" vertical-scroll-proportion="-18.307692" vertical-offset="0" max-vertical-offset="612">\r
+        <state line="65" column="28" selection-start="1972" selection-end="2578" vertical-scroll-proportion="-10.346154" vertical-offset="479" max-vertical-offset="1649">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidReadSession.php">\r
+    <entry file="file://$PROJECT_DIR$/Classes/Utility/EidSaveInSession.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="43" column="6" selection-start="1344" selection-end="1344" vertical-scroll-proportion="0.39016393" vertical-offset="0" max-vertical-offset="1190">\r
+        <state line="72" column="0" selection-start="2013" selection-end="2013" vertical-scroll-proportion="0.44262296" vertical-offset="445" max-vertical-offset="1360">\r
           <folding />\r
         </state>\r
       </provider>\r
index 879bf9f..227ab5c 100644 (file)
@@ -2,13 +2,14 @@
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 2012 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.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
+ *  the Free Software Foundation; either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  The GNU General Public License can be found at
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-require_once(PATH_t3lib . 'class.t3lib_befunc.php');
-require_once(PATH_t3lib . 'stddb/tables.php');
-require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
-require_once(PATH_tslib . 'class.tslib_pibase.php');
-require_once(t3lib_extMgm::extPath('powermail_cond') . 'Classes/Utility/Div.php');
-
 /**
- * This class cleans the full session
+ * This class is for reading values from session
  *
  * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
  * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidClearSession
+ * @subpackage Tx_PowermailCond_Utility_EidReadSession
  */
-class Tx_PowermailCond_Utility_EidClearSession extends tslib_pibase {
+class Tx_PowermailCond_Utility_EidClearSession {
 
        /**
         * The extension key
         *
         * @var string
         */
-       public $extKey = 'powermail_cond'; // Extension key
+       public $extKey = 'powermail_cond';
 
        /**
         * Prefix Id
@@ -52,29 +47,28 @@ class Tx_PowermailCond_Utility_EidClearSession extends tslib_pibase {
        public $prefixId = 'tx_powermailcond_pi1';
 
        /**
-        * Write values to session - main method called via AJAX
+        * @var Tx_PowermailCond_Utility_Div
+        */
+       protected $div;
+
+       /**
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
         *
-        * @return      void
+        * @return void
         */
        public function main() {
-               // config
-               $this->getCObj(); // enable TSFE globals
                $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
-               $piVars = t3lib_div::_GP($this->prefixId); // GET param
-               $form = intval($piVars['form']); // uid of current field
+               $piVars = t3lib_div::_GP($this->prefixId);
+               $form = intval($piVars['form']);
                $this->div->cleanfullSession($form);
        }
 
        /**
-        * Initialize cObj and TSFE Globals
-        *
-        * @return      object  cObj
+        * Initialize Extbase
         */
-       private function getCObj() {
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div'); // Create new instance for div class
+       public function __construct($TYPO3_CONF_VARS) {
                $userObj = tslib_eidtools::initFeUser();
-               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
-               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
+               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
                $GLOBALS['TSFE']->connectToDB();
                $GLOBALS['TSFE']->fe_user = $userObj;
                $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
@@ -84,11 +78,9 @@ class Tx_PowermailCond_Utility_EidClearSession extends tslib_pibase {
                $GLOBALS['TSFE']->getConfigArray();
                $GLOBALS['TSFE']->includeTCA();
 
-               return t3lib_div::makeInstance('tslib_cObj');
+               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
        }
-
 }
 
-$SOBE = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidClearSession'); // make instance
-echo $SOBE->main(); // print content
-?>
\ No newline at end of file
+$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidClearSession', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
index 9132d68..79c2df3 100644 (file)
@@ -47,6 +47,11 @@ class Tx_PowermailCond_Utility_EidReadSession {
        public $prefixId = 'tx_powermailcond_pi1';
 
        /**
+        * @var Tx_PowermailCond_Utility_Div
+        */
+       protected $div;
+
+       /**
         * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
         *
         * @return string
@@ -77,9 +82,7 @@ class Tx_PowermailCond_Utility_EidReadSession {
                $GLOBALS['TSFE']->getConfigArray();
                $GLOBALS['TSFE']->includeTCA();
 
-               $this->piVars = t3lib_div::_GET($this->prefixId);
                $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-               $this->session = $this->div->getAllSessionValuesFromForm($this->piVars['formUid']);
        }
 }
 
index 11cddb9..2fd262f 100644 (file)
@@ -2,13 +2,14 @@
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.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
+ *  the Free Software Foundation; either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  The GNU General Public License can be found at
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-require_once(PATH_t3lib . 'class.t3lib_befunc.php');
-require_once(PATH_t3lib . 'stddb/tables.php');
-require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
-require_once(PATH_tslib . 'class.tslib_pibase.php');
-require_once(t3lib_extMgm::extPath('powermail_cond') . 'Classes/Utility/Div.php');
-
 /**
- * This class is for storing values to the session on every fieldchange (via AJAX)
+ * This class is for storing values to session on every fieldchange (via AJAX)
  *
  * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
  * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidSaveInSession
+ * @subpackage Tx_PowermailCond_Utility_EidReadSession
  */
-class Tx_PowermailCond_Utility_EidSaveInSession extends tslib_pibase {
+class Tx_PowermailCond_Utility_EidSaveInSession {
 
        /**
         * The extension key
         *
         * @var string
         */
-       public $extKey = 'powermail_cond'; // Extension key
+       public $extKey = 'powermail_cond';
 
        /**
         * Prefix Id
@@ -52,48 +47,39 @@ class Tx_PowermailCond_Utility_EidSaveInSession extends tslib_pibase {
        public $prefixId = 'tx_powermailcond_pi1';
 
        /**
-        * Debug mode
-        *
-        * @var bool
+        * @var Tx_PowermailCond_Utility_Div
         */
-       private $debug = false;
+       protected $div;
 
        /**
-        * Write values to session - main method called via AJAX
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
         *
-        * @return      void
+        * @return bool
         */
        public function main() {
-               // config
-               $this->getCObj(); // enable TSFE globals
                $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
-               $piVars = t3lib_div::_GP($this->prefixId); // GET param
+               $piVars = t3lib_div::_GP($this->prefixId);
 
-               $uid = intval($piVars['uid']); // uid of current field
-               $form = intval($piVars['form']); // uid of current field
-               $value = htmlspecialchars($piVars['value']); // value from current field
+               $uid = intval($piVars['uid']);
+               $form = intval($piVars['form']);
+               $value = htmlspecialchars($piVars['value']);
 
                // start
                if ($uid === 0 || $form === 0) {
-                       return false;
+                       return FALSE;
                }
-               $this->div->saveValueToSession($value, $form, $uid); // save single value in session
+               // save single value in session
+               $this->div->saveValueToSession($value, $form, $uid);
 
-               if ($this->debug) {
-                       t3lib_utility_Debug::debug($arr, 'powermail_' . $form);
-               }
+               return FALSE;
        }
 
        /**
-        * Initialize cObj and TSFE Globals
-        *
-        * @return      object  cObj
+        * Initialize Extbase
         */
-       private function getCObj() {
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div'); // Create new instance for div class
+       public function __construct($TYPO3_CONF_VARS) {
                $userObj = tslib_eidtools::initFeUser();
-               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
-               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
+               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
                $GLOBALS['TSFE']->connectToDB();
                $GLOBALS['TSFE']->fe_user = $userObj;
                $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
@@ -103,11 +89,9 @@ class Tx_PowermailCond_Utility_EidSaveInSession extends tslib_pibase {
                $GLOBALS['TSFE']->getConfigArray();
                $GLOBALS['TSFE']->includeTCA();
 
-               return t3lib_div::makeInstance('tslib_cObj');
+               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
        }
-
 }
 
-$SOBE = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidSaveInSession'); // make instance
-echo $SOBE->main(); // print content
-?>
\ No newline at end of file
+$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidSaveInSession', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/OldEidReadSession.php b/Classes/Utility/OldEidReadSession.php
deleted file mode 100644 (file)
index 125ebf6..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
- *  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!
- ***************************************************************/
-
-require_once(PATH_t3lib . 'class.t3lib_befunc.php');
-require_once(PATH_t3lib . 'stddb/tables.php');
-require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
-require_once(PATH_tslib . 'class.tslib_pibase.php');
-require_once(t3lib_extMgm::extPath('powermail_cond') . 'Classes/Utility/Div.php');
-
-/**
- * This class is for reading values from session
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidReadSession
- */
-class Tx_PowermailCond_Utility_OldEidReadSession extends tslib_pibase {
-
-       /**
-        * The extension key
-        *
-        * @var string
-        */
-       public $extKey = 'powermail_cond'; // Extension key
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
-        *
-        * @return      void
-        */
-       public function main() {
-               // config
-               $this->getCObj(); // enable TSFE globals
-               $piVars = t3lib_div::_GP($this->prefixId); // GET param
-               $array = $this->div->getAllSessionValuesFromForm($piVars['form']);
-
-               $content = '';
-               foreach ((array) $array as $key => $value) {
-                       $content .= str_replace('field_', '', $key) . ':' . $value . ';';
-               }
-               return $content;
-       }
-
-       /**
-        * Initialize cObj and TSFE Globals
-        *
-        * @return      object  cObj
-        */
-       private function getCObj() {
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div'); // Create new instance for div class
-               $userObj = tslib_eidtools::initFeUser();
-               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
-               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               return t3lib_div::makeInstance('tslib_cObj');
-       }
-
-}
-
-$SOBE = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidReadSession'); // make instance
-echo $SOBE->main(); // print content
-?>
\ No newline at end of file