Project

General

Profile

Bug #18734 » 8305_v1.diff

Administrator Admin, 2010-04-30 22:37

View differences:

t3lib/class.t3lib_div.php (Arbeitskopie)
* @param mixed If the parameter is a string it will be used as header. Otherwise number of break tags to apply after (positive integer) or before (negative integer) the output.
* @return void
*/
public static function debug($var='',$brOrHeader=0) {
public static function debug($var = '', $brOrHeader = 0) {
// buffer the output of debug if no buffering started before
if (ob_get_level()==0) {
ob_start();
}
$debug = '';
if ($brOrHeader && !self::testInt($brOrHeader)) {
echo '<table class="typo3-debug" border="0" cellpadding="0" cellspacing="0" bgcolor="white" style="border:0px; margin-top:3px; margin-bottom:3px;"><tr><td style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;">'.htmlspecialchars((string)$brOrHeader).'</td></tr><tr><td>';
} elseif ($brOrHeader<0) {
for($a=0;$a<abs(intval($brOrHeader));$a++){echo '<br />';}
$debug .= '<table class="typo3-debug" border="0" cellpadding="0" cellspacing="0" bgcolor="white" style="border:0px; margin-top:3px; margin-bottom:3px;"><tr><td style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;">'.htmlspecialchars((string)$brOrHeader).'</td></tr><tr><td>';
} elseif ($brOrHeader < 0) {
for ($a = 0; $a < abs(intval($brOrHeader)); $a++) {
$debug .= '<br />';
}
}
if (is_array($var)) {
self::print_array($var);
} elseif (is_object($var)) {
echo '<b>|Object:<pre>';
print_r($var);
echo '</pre>|</b>';
} elseif ((string)$var!='') {
echo '<b>|'.htmlspecialchars((string)$var).'|</b>';
$debug .= self::view_array($var);
} elseif (is_object($var)) {
$debug .= '<b>|Object:<pre>';
$debug .= print_r($var, TRUE);
$debug .= '</pre>|</b>';
} elseif ((string) $var !== '') {
$debug .= '<b>|'.htmlspecialchars((string)$var) . '|</b>';
} else {
echo '<b>| debug |</b>';
$debug .= '<b>| debug |</b>';
}
if ($brOrHeader && !self::testInt($brOrHeader)) {
echo '</td></tr></table>';
} elseif ($brOrHeader>0) {
for($a=0;$a<intval($brOrHeader);$a++){echo '<br />';}
if ($brOrHeader && !self::testInt($brOrHeader)) {
$debug .= '</td></tr></table>';
} elseif ($brOrHeader > 0) {
for($a=0; $a < intval($brOrHeader); $a++) {
$debug .= '<br />';}
}
if (TYPO3_MODE === 'BE') {
$tabHeader = 'Debug';
if ($brOrHeader && !self::testInt($brOrHeader)) {
$tabHeader .= ': ' . $brOrHeader;
}
$debug = str_replace(
array('"', "\n", "\r"),
array('\"', '', ''),
$debug
);
$script = '
var TYPO3ViewportInstance = null;
if (top && typeof top.TYPO3.Backend === "object") {
TYPO3ViewportInstance = top.TYPO3.Backend;
} else if (typeof TYPO3.Backend === "object") {
TYPO3ViewportInstance = TYPO3.Backend;
}
if (TYPO3ViewportInstance !== null) {
if (TYPO3ViewportInstance.DebugConsole.hidden) {
TYPO3ViewportInstance.DebugConsole.show();
} else if (TYPO3ViewportInstance.DebugConsole.collapsed) {
TYPO3ViewportInstance.DebugConsole.expand();
}
var tab = TYPO3ViewportInstance.DebugConsole.add({
title: "' . $tabHeader . '",
html: "' . $debug . '",
border: false,
closable: true,
autoScroll: true
});
TYPO3ViewportInstance.DebugConsole.setActiveTab(tab);
TYPO3ViewportInstance.doLayout();
} else {
document.write("' . $debug . '");
}
';
echo self::wrapJS($script);
} else {
echo $debug;
}
}
/**
typo3/js/extjs/viewportConfiguration.js (Arbeitskopie)
anchor: '100% 100%',
border: false
}]
}, {
region: 'south',
xtype: 'tabpanel',
collapsible: true,
collapseMode: 'mini',
hideCollapseTool: true,
animCollapse: false,
split: true,
autoScroll: true,
hidden: true,
height: 200,
title: 'Debug-Console',
id: 'typo3-debug-console',
border: false
}]
};
typo3/js/extjs/backendsizemanager.js (Arbeitskopie)
var resizeBackend = function() {
var viewportHeight = document.viewport.getHeight();
var topHeight = Ext.get('typo3-topbar').getHeight();
var consoleHeight = Ext.get('typo3-debug-console').getHeight() +
Ext.get('typo3-debug-console-xsplit').getHeight();
var styles = {
height: (viewportHeight - topHeight) + 'px'
height: (viewportHeight - topHeight - consoleHeight) + 'px'
}
Ext.get('typo3-side-menu').setStyle(styles);
Ext.get('content').setStyle(styles);
}
Ext.EventManager.on(window, 'resize', resizeBackend);
Ext.EventManager.onWindowResize(resizeBackend);
Ext.onReady(function() {
TYPO3.Backend.addListener('resize', resizeBackend);
resizeBackend();
});
}();
typo3/js/extjs/viewport.js (Arbeitskopie)
ModuleMenuContainer: null,
/**
* The debug console
*
* @var Ext.TabPanel
*/
DebugConsole: null,
/**
* Initializes the ExtJS viewport with the given configuration.
*
* @return void
......
this.Topbar = Ext.ComponentMgr.get('typo3-topbar');
this.ModuleMenuContainer = Ext.ComponentMgr.get('typo3-module-menu');
// adds the debug console and some listeners to consider the initial hiding of
// the debug console (the viewport needs to be resized if it's expand/collapse)
// -> see the TYPO3.BackendSizeManager
this.DebugConsole = Ext.ComponentMgr.get('typo3-debug-console');
this.DebugConsole.addListener({
'resize': {
scope: this,
fn: function() {
this.fireEvent('resize');
}
},
'collapse': {
scope: this,
fn: function() {
this.fireEvent('resize');
}
}
});
},
/**
(6-6/6)