Follow-up to #13313: ExtDirect API
authorSteffen Kamper <info@sk-typo3.de>
Tue, 2 Feb 2010 12:02:14 +0000 (12:02 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 2 Feb 2010 12:02:14 +0000 (12:02 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6836 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/config_default.php
t3lib/extjs/class.t3lib_extjs_extdirectapi.php
t3lib/extjs/class.t3lib_extjs_extdirectrouter.php

index a68b89e..4137eeb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-02  Steffen Kamper  <info@sk-typo3.de>
+
+       * Follow-up to #13313: ExtDirect API
+
 2010-02-01  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #13388: Missing colon in locallang for DB and File mount (thanks to Georg Ringer)
 2010-02-01  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #13388: Missing colon in locallang for DB and File mount (thanks to Georg Ringer)
index 1376a90..5cff35c 100644 (file)
@@ -280,10 +280,9 @@ $TYPO3_CONF_VARS = array(
                        'BackendLogin::getChallenge'            => 'typo3/classes/class.ajaxlogin.php:AjaxLogin->getChallenge',
                        'WorkspaceMenu::toggleWorkspacePreview' => 'typo3/classes/class.workspaceselector.php:WorkspaceSelector->toggleWorkspacePreview',
                        'WorkspaceMenu::setWorkspace'           => 'typo3/classes/class.workspaceselector.php:WorkspaceSelector->setWorkspace',
                        'BackendLogin::getChallenge'            => 'typo3/classes/class.ajaxlogin.php:AjaxLogin->getChallenge',
                        'WorkspaceMenu::toggleWorkspacePreview' => 'typo3/classes/class.workspaceselector.php:WorkspaceSelector->toggleWorkspacePreview',
                        'WorkspaceMenu::setWorkspace'           => 'typo3/classes/class.workspaceselector.php:WorkspaceSelector->setWorkspace',
-                       'ExtDirect::getAPI' => 't3lib/extjs/class.t3lib_extjs_extdirectapi.php:t3lib_ExtJs_ExtDirectAPI->getAPI',
-                       'ExtDirect::route' => 't3lib/extjs/class.t3lib_extjs_extdirectrouter.php:t3lib_ExtJs_ExtDirectRouter->route',
+                       'ExtDirect::getAPI' => 't3lib/extjs/class.t3lib_extjs_extdirectapi.php:t3lib_extjs_ExtDirectApi->getAPI',
+                       'ExtDirect::route' => 't3lib/extjs/class.t3lib_extjs_extdirectrouter.php:t3lib_extjs_ExtDirectRouter->route',
                ),
                ),
-               'ExtDirect' => array(),                                 // array of key value pairs (provider -> location:className) that holds the classes for the ExtDirect functionality
                'XCLASS' => array(),                                    // See 'Inside TYPO3' document for more information.
        ),
        'FE' => array(                  // Configuration for the TypoScript frontend (FE). Nothing here relates to the administration backend!
                'XCLASS' => array(),                                    // See 'Inside TYPO3' document for more information.
        ),
        'FE' => array(                  // Configuration for the TypoScript frontend (FE). Nothing here relates to the administration backend!
@@ -366,7 +365,8 @@ $TYPO3_CONF_VARS = array(
                        'frontendEditingController' => array(
                                'default' => 't3lib/class.t3lib_frontendedit.php:t3lib_frontendedit'
                        )
                        'frontendEditingController' => array(
                                'default' => 't3lib/class.t3lib_frontendedit.php:t3lib_frontendedit'
                        )
-               )
+               ),
+               'ExtDirect' => array(),                                 // array of key value pairs (provider -> location:className) that holds the classes for the ExtDirect functionality
        ),
        'EXTCONF' => array(             // Here you may add manually set configuration options for your extensions. Eg. $TYPO3_CONF_VARS['EXTCONF']['my_extension_key']['my_option'] = 'my_value';
 //             '--key--' => array()
        ),
        'EXTCONF' => array(             // Here you may add manually set configuration options for your extensions. Eg. $TYPO3_CONF_VARS['EXTCONF']['my_extension_key']['my_option'] = 'my_value';
 //             '--key--' => array()
index 30232c8..d1223a2 100644 (file)
@@ -32,7 +32,7 @@
  * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
  * @package    TYPO3\r
  */\r
  * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
  * @package    TYPO3\r
  */\r
-class t3lib_ExtJs_ExtDirectAPI {\r
+class t3lib_extjs_ExtDirectApi {\r
        /**\r
         * Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect']"\r
         * and feeds the given typo3ajax instance with the resulting informations. The get parameter\r
        /**\r
         * Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect']"\r
         * and feeds the given typo3ajax instance with the resulting informations. The get parameter\r
@@ -50,8 +50,8 @@ class t3lib_ExtJs_ExtDirectAPI {
                $filterNamespace = t3lib_div::_GET('namespace');\r
 \r
                $javascriptNamespaces = array();\r
                $filterNamespace = t3lib_div::_GET('namespace');\r
 \r
                $javascriptNamespaces = array();\r
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect'])) {\r
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect'] as $javascriptName => $className) {\r
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {\r
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $javascriptName => $className) {\r
                                $splittedJavascriptName = explode('.', $javascriptName);\r
                                $javascriptObjectName = array_pop($splittedJavascriptName);\r
                                $javascriptNamespace = implode('.', $splittedJavascriptName);\r
                                $splittedJavascriptName = explode('.', $javascriptName);\r
                                $javascriptObjectName = array_pop($splittedJavascriptName);\r
                                $javascriptNamespace = implode('.', $splittedJavascriptName);\r
@@ -79,7 +79,7 @@ class t3lib_ExtJs_ExtDirectAPI {
                                        $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName][] = array(\r
                                                'name' => $methodName,\r
                                                'len' => $numberOfParameters\r
                                        $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName][] = array(\r
                                                'name' => $methodName,\r
                                                'len' => $numberOfParameters\r
-                                       );      \r
+                                       );\r
                                }\r
                        }\r
                }\r
                                }\r
                        }\r
                }\r
@@ -89,6 +89,16 @@ class t3lib_ExtJs_ExtDirectAPI {
                                if (typeof Ext.app.ExtDirectAPI != "object") {\r
                                        Ext.app.ExtDirectAPI = {};\r
                                }\r
                                if (typeof Ext.app.ExtDirectAPI != "object") {\r
                                        Ext.app.ExtDirectAPI = {};\r
                                }\r
+\r
+\r
+                               if (typeof Object.extend != "function") {\r
+                                       Object.extend = function(destination, source) {\r
+                                               for (var property in source) {\r
+                                                       destination[property] = source[property];\r
+                                               }\r
+                                               return destination;\r
+                                       }\r
+                               }\r
                        ';\r
 \r
                        $ajaxObj->setContent($javascriptNamespaces);\r
                        ';\r
 \r
                        $ajaxObj->setContent($javascriptNamespaces);\r
index cb25f76..6186f2e 100644 (file)
@@ -32,7 +32,7 @@
  * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
  * @package    TYPO3\r
  */\r
  * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
  * @package    TYPO3\r
  */\r
-class t3lib_ExtJs_ExtDirectRouter {\r
+class t3lib_extjs_ExtDirectRouter {\r
        /**\r
         * Dispatches the incoming calls to methods about the ExtDirect API.\r
         *\r
        /**\r
         * Dispatches the incoming calls to methods about the ExtDirect API.\r
         *\r
@@ -88,10 +88,10 @@ class t3lib_ExtJs_ExtDirectRouter {
        protected function processRpc($singleRequest, $namespace) {\r
                try {\r
                        $endpointName = $namespace . '.' . $singleRequest->action;\r
        protected function processRpc($singleRequest, $namespace) {\r
                try {\r
                        $endpointName = $namespace . '.' . $singleRequest->action;\r
-                       \r
+\r
                        // theoretically this can never happen, because of an javascript error on\r
                        // the client side due the missing namespace/endpoint\r
                        // theoretically this can never happen, because of an javascript error on\r
                        // the client side due the missing namespace/endpoint\r
-                       if (!isset($GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect'][$endpointName])) {\r
+                       if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName])) {\r
                                throw new t3lib_error_Exception('ExtDirect: Call to undefined endpoint: ' . $endpointName);\r
                        }\r
 \r
                                throw new t3lib_error_Exception('ExtDirect: Call to undefined endpoint: ' . $endpointName);\r
                        }\r
 \r
@@ -103,10 +103,10 @@ class t3lib_ExtJs_ExtDirectRouter {
                        );\r
 \r
                        $endpointObject = t3lib_div::getUserObj(\r
                        );\r
 \r
                        $endpointObject = t3lib_div::getUserObj(\r
-                               $GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect'][$endpointName],\r
+                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName],\r
                                FALSE\r
                        );\r
                                FALSE\r
                        );\r
-                       \r
+\r
                        $response['result'] = call_user_func_array(\r
                                array($endpointObject, $singleRequest->method),\r
                                is_array($singleRequest->data) ? $singleRequest->data : array()\r
                        $response['result'] = call_user_func_array(\r
                                array($endpointObject, $singleRequest->method),\r
                                is_array($singleRequest->data) ? $singleRequest->data : array()\r