Feature #23574 » 15754_v1.diff
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() {
|
||
$action = t3lib_div::_GP('action');
|
||
$ajaxID = '';
|
||
if ($action === 'ExtDirectRoute') {
|
||
$ajaxID = 'ExtDirect::route';
|
||
|
||
} elseif ($action === 'ExtDirectGetAPI') {
|
||
$ajaxID = 'ExtDirect::getAPI';
|
||
}
|
||
if ($ajaxID !== '') {
|
||
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'][$ajaxID];
|
||
$ajaxObj = t3lib_div::makeInstance('TYPO3AJAX', 'ExtDirect::getAPI');
|
||
$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 ($filterNamespace) {
|
||
// namespace error
|
||
$errorMessage = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:ExtDirect.namespaceError'),
|
||
__CLASS__, $filterNamespace
|
||
__CLASS__, $filterNamespace
|
||
);
|
||
}
|
||
else {
|
||
// no namespace given
|
||
$errorMessage = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:ExtDirect.noNamespace'),
|
||
__CLASS__
|
||
__CLASS__
|
||
);
|
||
}
|
||
// make js multiline message
|
||
$msg = t3lib_div::trimExplode(LF, str_replace('"', '\"', $errorMessage), TRUE);
|
||
$errorMessage = '';
|
||
... | ... | |
$errorMessage .= '"' . $line . '" + ' . LF;
|
||
}
|
||
$errorMessage = substr(trim($errorMessage), 0, -1);
|
||
//generate the javascript
|
||
$ajaxObj->setContentFormat('javascript');
|
||
$ajaxObj->setJavascriptCallbackWrap('
|
||
... | ... | |
if (!isset($javascriptNamespaces[$javascriptNamespace])) {
|
||
$javascriptNamespaces[$javascriptNamespace] = array(
|
||
'url' => t3lib_div::locationHeaderUrl('ajax.php?ajaxID=ExtDirect::route&namespace=') . rawurlencode($javascriptNamespace),
|
||
'url' => $this->getLocationHeaderUrl() . rawurlencode($javascriptNamespace),
|
||
'type' => 'remoting',
|
||
'actions' => array(),
|
||
'namespace' => $javascriptNamespace
|
||
... | ... | |
return $javascriptNamespaces;
|
||
}
|
||
/**
|
||
* Returns the convenient path for the routing Urls based on the TYPO3 mode.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getLocationHeaderUrl() {
|
||
$url = '';
|
||
if (TYPO3_MODE === 'BE') {
|
||
$url = t3lib_div::locationHeaderUrl('ajax.php?ajaxID=ExtDirect::route&namespace=');
|
||
} elseif (TYPO3_MODE === 'FE') {
|
||
$url = t3lib_div::locationHeaderUrl('?eID=TYPO3&action=ExtDirectRoute&namespace=');
|
||
}
|
||
return $url;
|
||
}
|
||
}
|
||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extjs_extdirectapi.php']) {
|