Project

General

Profile

Feature #23574 » 15754_v3.diff

Administrator Admin, 2010-09-21 16:24

View differences:

t3lib/class.t3lib_pagerenderer.php (Arbeitskopie)
if (TYPO3ViewportInstance !== null) {
TYPO3ViewportInstance.DebugConsole.addTab(message, header, group);
} else if (typeof console === "object") {
console.log(message);
} else {
document.write(message);
}
};
Ext.Direct.on("exception", function(event) {
extDirectDebug(
"<p>" + event.message + "<\/p>" +
"<p style=\"margin-top: 20px;\">" +
var backtrace = "";
if (event.where) {
backtrace = "<p style=\"margin-top: 20px;\">" +
"<strong>Backtrace:<\/strong><br \/>" +
event.where.replace(/#/g, "<br \/>#") +
"<\/p>",
"<\/p>";
}
extDirectDebug(
"<p>" + event.message + "<\/p>" + backtrace,
event.method,
"ExtDirect - Exception"
);
t3lib/extjs/class.t3lib_extjs_extdirecteid.php (Revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
*
* 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!
***************************************************************/
/**
* eID controller for ExtDirect
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package TYPO3
*/
class t3lib_extjs_ExtDirectEid {
/**
* eId controller for ExtDirect
*
* Routes the ExtDirectGetAPI and ExtDirectRoute calls to the related ExtDirect methods.
*
* @return void
*/
public function __construct() {
$ajaxID = t3lib_div::_GP('action');
if (!in_array($ajaxID, array('route', 'getAPI'))) {
return;
}
require_once(PATH_site . 'typo3/sysext/lang/lang.php');
require_once(PATH_site . 't3lib/class.t3lib_cs.php');
require_once(PATH_site . 'typo3/classes/class.typo3ajax.php');
$GLOBALS['LANG'] = t3lib_div::makeInstance('language');
$GLOBALS['LANG']->init();
$GLOBALS['TSFE']->fe_user = tslib_eidtools::initFeUser();
tslib_eidtools::connectDB();
$ajaxScript = $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['ExtDirect::' . $ajaxID];
$ajaxObj = t3lib_div::makeInstance('TYPO3AJAX', 'ExtDirect::' . $ajaxID);
$ajaxParameters = array();
t3lib_div::callUserFunction($ajaxScript, $ajaxParameters, $ajaxObj, FALSE, TRUE);
$ajaxObj->render();
}
}
if (!defined('PATH_typo3conf')) {
die('Could not access this script directly!');
}
t3lib_div::makeInstance('t3lib_extjs_ExtDirectEid');
?>
t3lib/extjs/class.t3lib_extjs_extdirectapi.php (Arbeitskopie)
// look up into the cache
$cacheIdentifier = 'ExtDirectApi';
$cacheHash = md5($cacheIdentifier . $filterNamespace . serialize($this->settings));
$cacheHash = md5($cacheIdentifier . $filterNamespace .
serialize($this->settings) . TYPO3_MODE);
// with no_cache always generate the javascript content
$cacheContent = $noCache ? '' : t3lib_pageSelect::getHash($cacheHash);
......
if (!isset($javascriptNamespaces[$javascriptNamespace])) {
$javascriptNamespaces[$javascriptNamespace] = array(
'url' => t3lib_div::locationHeaderUrl('ajax.php?ajaxID=ExtDirect::route&namespace=') . rawurlencode($javascriptNamespace),
'url' => $this->getRoutingUrl($javascriptNamespace),
'type' => 'remoting',
'actions' => array(),
'namespace' => $javascriptNamespace
......
return $javascriptNamespaces;
}
/**
* Returns the convenient path for the routing Urls based on the TYPO3 mode.
*
* @param string $namespace
* @return string
*/
public function getRoutingUrl($namespace) {
$url = '';
if (TYPO3_MODE === 'FE') {
$url = t3lib_div::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=');
} else {
$url = t3lib_div::locationHeaderUrl('ajax.php?ajaxID=ExtDirect::route&namespace=');
}
$url .= rawurlencode($namespace);
return $url;
}
}
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']);
}
(4-4/6)