converted t3lib/extjs files to unix format.
authorSteffen Kamper <info@sk-typo3.de>
Fri, 5 Feb 2010 09:56:47 +0000 (09:56 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Fri, 5 Feb 2010 09:56:47 +0000 (09:56 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6850 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 9815560..66f631f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-05  Steffen Kamper  <info@sk-typo3.de>
+
+       * converted t3lib/extjs files to unix format.
+
 2010-02-05  Francois Suter  <francois@typo3.org>
 
        * Fixed bug #13323: "Allow preview of whole workspace" misses checkbox
index d1223a2..9e82960 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2010 Sebastian Kurfuerst <sebastian@typo3.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
-*  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
- * Ext Direct API Generator\r
- *\r
- * @author     Sebastian Kurfuerst <sebastian@typo3.org>\r
- * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
- * @package    TYPO3\r
- */\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
-        * "namespace" will be used to filter the configuration.\r
-        *\r
-        * This method makes usage of the reflection mechanism to fetch the methods inside the\r
-        * defined classes together with their amount of parameters. This informations are building\r
-        * the API and are required by ExtDirect.\r
-        *\r
-        * @param array $ajaxParams ajax parameters\r
-        * @param TYPO3AJAX $ajaxObj typo3ajax instance\r
-        * @return void\r
-        */\r
-       public function getAPI($ajaxParams, TYPO3AJAX $ajaxObj) {\r
-               $filterNamespace = t3lib_div::_GET('namespace');\r
-\r
-               $javascriptNamespaces = array();\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
-\r
-                               // only items inside the wanted namespace\r
-                               if (strpos($javascriptNamespace, $filterNamespace) !== 0) {\r
-                                       continue;\r
-                               }\r
-\r
-                               if (!isset($javascriptNamespaces[$javascriptNamespace])) {\r
-                                       $javascriptNamespaces[$javascriptNamespace] = array(\r
-                                           'url' => 'ajax.php?ajaxID=ExtDirect::route&namespace=' . rawurlencode($javascriptNamespace),\r
-                                           'type' => 'remoting',\r
-                                           'actions' => array(),\r
-                                           'namespace' => $javascriptNamespace\r
-                                       );\r
-                               }\r
-\r
-                               $serverObject = t3lib_div::getUserObj($className, FALSE);\r
-                               $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName] = array();\r
-                               foreach (get_class_methods($serverObject) as $methodName) {\r
-                                       $reflectionMethod = new ReflectionMethod($serverObject, $methodName);\r
-                                       $numberOfParameters = $reflectionMethod->getNumberOfParameters();\r
-\r
-                                       $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName][] = array(\r
-                                               'name' => $methodName,\r
-                                               'len' => $numberOfParameters\r
-                                       );\r
-                               }\r
-                       }\r
-               }\r
-\r
-               if (count($javascriptNamespaces)) {\r
-                       $setup = '\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
-                       $ajaxObj->setContentFormat('javascript');\r
-                       $ajaxObj->setJavascriptCallbackWrap($setup . 'Ext.app.ExtDirectAPI = Object.extend(Ext.app.ExtDirectAPI, |);');\r
-               }\r
-       }\r
-}\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectapi.php'])       {\r
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectapi.php']);\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Sebastian Kurfuerst <sebastian@typo3.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.
+*  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!
+***************************************************************/
+
+/**
+ * Ext Direct API Generator
+ *
+ * @author     Sebastian Kurfuerst <sebastian@typo3.org>
+ * @author     Stefan Galinski <stefan.galinski@gmail.com>
+ * @package    TYPO3
+ */
+class t3lib_extjs_ExtDirectApi {
+       /**
+        * Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect']"
+        * and feeds the given typo3ajax instance with the resulting informations. The get parameter
+        * "namespace" will be used to filter the configuration.
+        *
+        * This method makes usage of the reflection mechanism to fetch the methods inside the
+        * defined classes together with their amount of parameters. This informations are building
+        * the API and are required by ExtDirect.
+        *
+        * @param array $ajaxParams ajax parameters
+        * @param TYPO3AJAX $ajaxObj typo3ajax instance
+        * @return void
+        */
+       public function getAPI($ajaxParams, TYPO3AJAX $ajaxObj) {
+               $filterNamespace = t3lib_div::_GET('namespace');
+
+               $javascriptNamespaces = array();
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $javascriptName => $className) {
+                               $splittedJavascriptName = explode('.', $javascriptName);
+                               $javascriptObjectName = array_pop($splittedJavascriptName);
+                               $javascriptNamespace = implode('.', $splittedJavascriptName);
+
+                               // only items inside the wanted namespace
+                               if (strpos($javascriptNamespace, $filterNamespace) !== 0) {
+                                       continue;
+                               }
+
+                               if (!isset($javascriptNamespaces[$javascriptNamespace])) {
+                                       $javascriptNamespaces[$javascriptNamespace] = array(
+                                           'url' => 'ajax.php?ajaxID=ExtDirect::route&namespace=' . rawurlencode($javascriptNamespace),
+                                           'type' => 'remoting',
+                                           'actions' => array(),
+                                           'namespace' => $javascriptNamespace
+                                       );
+                               }
+
+                               $serverObject = t3lib_div::getUserObj($className, FALSE);
+                               $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName] = array();
+                               foreach (get_class_methods($serverObject) as $methodName) {
+                                       $reflectionMethod = new ReflectionMethod($serverObject, $methodName);
+                                       $numberOfParameters = $reflectionMethod->getNumberOfParameters();
+
+                                       $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName][] = array(
+                                               'name' => $methodName,
+                                               'len' => $numberOfParameters
+                                       );
+                               }
+                       }
+               }
+
+               if (count($javascriptNamespaces)) {
+                       $setup = '
+                               if (typeof Ext.app.ExtDirectAPI != "object") {
+                                       Ext.app.ExtDirectAPI = {};
+                               }
+
+
+                               if (typeof Object.extend != "function") {
+                                       Object.extend = function(destination, source) {
+                                               for (var property in source) {
+                                                       destination[property] = source[property];
+                                               }
+                                               return destination;
+                                       }
+                               }
+                       ';
+
+                       $ajaxObj->setContent($javascriptNamespaces);
+                       $ajaxObj->setContentFormat('javascript');
+                       $ajaxObj->setJavascriptCallbackWrap($setup . 'Ext.app.ExtDirectAPI = Object.extend(Ext.app.ExtDirectAPI, |);');
+               }
+       }
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectapi.php'])       {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectapi.php']);
+}
+
+?>
index 6186f2e..26240b2 100644 (file)
-<?php\r
-/***************************************************************\r
-*  Copyright notice\r
-*\r
-*  (c) 2010 Sebastian Kurfuerst <sebastian@typo3.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
-*  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
- * Ext Direct Router\r
- *\r
- * @author     Sebastian Kurfuerst <sebastian@typo3.org>\r
- * @author     Stefan Galinski <stefan.galinski@gmail.com>\r
- * @package    TYPO3\r
- */\r
-class t3lib_extjs_ExtDirectRouter {\r
-       /**\r
-        * Dispatches the incoming calls to methods about the ExtDirect API.\r
-        *\r
-        * @param aray $ajaxParams ajax parameters\r
-        * @param TYPO3AJAX $ajaxObj typo3ajax instance\r
-        * @return void\r
-        */\r
-       public function route($ajaxParams, TYPO3AJAX $ajaxObj) {\r
-               try {\r
-                       $isForm = false;\r
-                       $isUpload = false;\r
-                       $rawPostData = file_get_contents('php://input');\r
-                       $namespace = t3lib_div::_GET('namespace');\r
-\r
-                       if (!empty($rawPostData)) {\r
-                               $ajaxObj->setContentFormat('jsonbody');\r
-                               $request = json_decode($rawPostData);\r
-                       } else {\r
-                               throw new t3lib_error_Exception('ExtDirect: Missing Parameters!');\r
-                       }\r
-\r
-                       $response = null;\r
-                       if (is_array($request)) {\r
-                               $response = array();\r
-                               foreach ($request as $singleRequest) {\r
-                                       $response[] = $this->processRpc($singleRequest, $namespace);\r
-                               }\r
-                       } else {\r
-                               $response = $this->processRpc($request, $namespace);\r
-                       }\r
-\r
-               } catch (t3lib_error_Exception $exception) {\r
-                       $response = array(\r
-                               'type' => 'exception',\r
-                               'message' => $exception->getMessage(),\r
-                               'where' => $exception->getTraceAsString()\r
-                       );\r
-               }\r
-\r
-               $ajaxObj->setContent($response);\r
-       }\r
-\r
-\r
-       /**\r
-        * Processes an incoming extDirect call by executing the defined method. The configuration\r
-        * array "$GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect']" is taken to find the class/method\r
-        * information.\r
-        *\r
-        * @param object $singleRequest request object from extJS\r
-        * @param string $namespace namespace like TYPO3.Backend\r
-        * @return mixed return value of the called method\r
-        */\r
-       protected function processRpc($singleRequest, $namespace) {\r
-               try {\r
-                       $endpointName = $namespace . '.' . $singleRequest->action;\r
-\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']['SC_OPTIONS']['ExtDirect'][$endpointName])) {\r
-                               throw new t3lib_error_Exception('ExtDirect: Call to undefined endpoint: ' . $endpointName);\r
-                       }\r
-\r
-                       $response = array(\r
-                               'type' => 'rpc',\r
-                               'tid' => $singleRequest->tid,\r
-                               'action' => $singleRequest->action,\r
-                               'method' => $singleRequest->method\r
-                       );\r
-\r
-                       $endpointObject = t3lib_div::getUserObj(\r
-                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName],\r
-                               FALSE\r
-                       );\r
-\r
-                       $response['result'] = call_user_func_array(\r
-                               array($endpointObject, $singleRequest->method),\r
-                               is_array($singleRequest->data) ? $singleRequest->data : array()\r
-                       );\r
-\r
-               } catch (t3lib_error_Exception $exception) {\r
-                       $response = array(\r
-                               'type' => 'exception',\r
-                               'message' => $exception->getMessage(),\r
-                               'where' => $exception->getTraceAsString()\r
-                       );\r
-               }\r
-\r
-               return $response;\r
-       }\r
-}\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectrouter.php'])    {\r
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectrouter.php']);\r
-}\r
-\r
-?>\r
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Sebastian Kurfuerst <sebastian@typo3.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.
+*  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!
+***************************************************************/
+
+/**
+ * Ext Direct Router
+ *
+ * @author     Sebastian Kurfuerst <sebastian@typo3.org>
+ * @author     Stefan Galinski <stefan.galinski@gmail.com>
+ * @package    TYPO3
+ */
+class t3lib_extjs_ExtDirectRouter {
+       /**
+        * Dispatches the incoming calls to methods about the ExtDirect API.
+        *
+        * @param aray $ajaxParams ajax parameters
+        * @param TYPO3AJAX $ajaxObj typo3ajax instance
+        * @return void
+        */
+       public function route($ajaxParams, TYPO3AJAX $ajaxObj) {
+               try {
+                       $isForm = false;
+                       $isUpload = false;
+                       $rawPostData = file_get_contents('php://input');
+                       $namespace = t3lib_div::_GET('namespace');
+
+                       if (!empty($rawPostData)) {
+                               $ajaxObj->setContentFormat('jsonbody');
+                               $request = json_decode($rawPostData);
+                       } else {
+                               throw new t3lib_error_Exception('ExtDirect: Missing Parameters!');
+                       }
+
+                       $response = null;
+                       if (is_array($request)) {
+                               $response = array();
+                               foreach ($request as $singleRequest) {
+                                       $response[] = $this->processRpc($singleRequest, $namespace);
+                               }
+                       } else {
+                               $response = $this->processRpc($request, $namespace);
+                       }
+
+               } catch (t3lib_error_Exception $exception) {
+                       $response = array(
+                               'type' => 'exception',
+                               'message' => $exception->getMessage(),
+                               'where' => $exception->getTraceAsString()
+                       );
+               }
+
+               $ajaxObj->setContent($response);
+       }
+
+
+       /**
+        * Processes an incoming extDirect call by executing the defined method. The configuration
+        * array "$GLOBALS['TYPO3_CONF_VARS']['BE']['ExtDirect']" is taken to find the class/method
+        * information.
+        *
+        * @param object $singleRequest request object from extJS
+        * @param string $namespace namespace like TYPO3.Backend
+        * @return mixed return value of the called method
+        */
+       protected function processRpc($singleRequest, $namespace) {
+               try {
+                       $endpointName = $namespace . '.' . $singleRequest->action;
+
+                       // theoretically this can never happen, because of an javascript error on
+                       // the client side due the missing namespace/endpoint
+                       if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName])) {
+                               throw new t3lib_error_Exception('ExtDirect: Call to undefined endpoint: ' . $endpointName);
+                       }
+
+                       $response = array(
+                               'type' => 'rpc',
+                               'tid' => $singleRequest->tid,
+                               'action' => $singleRequest->action,
+                               'method' => $singleRequest->method
+                       );
+
+                       $endpointObject = t3lib_div::getUserObj(
+                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName],
+                               FALSE
+                       );
+
+                       $response['result'] = call_user_func_array(
+                               array($endpointObject, $singleRequest->method),
+                               is_array($singleRequest->data) ? $singleRequest->data : array()
+                       );
+
+               } catch (t3lib_error_Exception $exception) {
+                       $response = array(
+                               'type' => 'exception',
+                               'message' => $exception->getMessage(),
+                               'where' => $exception->getTraceAsString()
+                       );
+               }
+
+               return $response;
+       }
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectrouter.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectrouter.php']);
+}
+
+?>