Bug #21570 » 12614-debug_flashmessages.diff
t3lib/class.t3lib_div.php (working copy) | ||
---|---|---|
if (ob_get_level()==0) {
|
||
ob_start();
|
||
}
|
||
$debug = '';
|
||
if ($brOrHeader && !t3lib_div::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 />';}
|
||
}
|
||
if (is_array($var)) {
|
||
t3lib_div::print_array($var);
|
||
$debug .= t3lib_div::view_array($var);
|
||
} elseif (is_object($var)) {
|
||
echo '<b>|Object:<pre>';
|
||
print_r($var);
|
||
echo '</pre>|</b>';
|
||
$debug .= '<b>|Object:<pre>';
|
||
$debug .= print_r($var, TRUE);
|
||
$debug .= '</pre>|</b>';
|
||
} elseif ((string)$var!='') {
|
||
echo '<b>|'.htmlspecialchars((string)$var).'|</b>';
|
||
$debug .= '<b>|'.htmlspecialchars((string)$var).'|</b>';
|
||
} else {
|
||
echo '<b>| debug |</b>';
|
||
$debug .= '<b>| debug |</b>';
|
||
}
|
||
if ($brOrHeader && !t3lib_div::testInt($brOrHeader)) {
|
||
echo '</td></tr></table>';
|
||
} elseif ($brOrHeader>0) {
|
||
for($a=0;$a<intval($brOrHeader);$a++){echo '<br />';}
|
||
}
|
||
$flashMessage = t3lib_div::makeInstance(
|
||
't3lib_FlashMessage',
|
||
$debug,
|
||
'DEBUG: ' . ($brOrHeader === 0 ? '' : htmlspecialchars($brOrHeader)) ,
|
||
t3lib_FlashMessage::INFO
|
||
);
|
||
t3lib_FlashMessageQueue::addMessage($flashMessage);
|
||
}
|
||
/**
|
t3lib/class.t3lib_pagerenderer.php (working copy) | ||
---|---|---|
protected $cssInline = array ();
|
||
protected $bodyContent;
|
||
protected $showFlashMessages = TRUE;
|
||
protected $templateFile;
|
||
... | ... | |
$this->bodyContent = $content;
|
||
}
|
||
/**
|
||
* Sets Flag showFlashMessages (set to FALSE supress flashmessages
|
||
*
|
||
* @param boolean $showFlashMessages
|
||
* @return void
|
||
*/
|
||
public function setShowFlashMessages($showFlashMessages) {
|
||
$this->showFlashMessages = $showFlashMessages;
|
||
}
|
||
/*****************************************************/
|
||
/* */
|
||
/* Public Enablers */
|
||
... | ... | |
return $this->bodyContent;
|
||
}
|
||
/**
|
||
* Gets Flag showFlashMessages
|
||
*
|
||
* @return boolean
|
||
*/
|
||
public function getShowFlashMessages() {
|
||
return $this->showFlashMessages;
|
||
}
|
||
/*****************************************************/
|
||
/* */
|
||
/* Public Function to add Data */
|
||
... | ... | |
$jsInline = '';
|
||
}
|
||
if ($this->showFlashMessages) {
|
||
$flashMessages = t3lib_FlashMessageQueue::renderFlashMessages();debug($flashMessages);
|
||
if (!empty($flashMessages)) {
|
||
$this->bodyContent = '<div id="typo3-messages">' . $flashMessages . '</div>' . $this->bodyContent;
|
||
}
|
||
}
|
||
$markerArray = array(
|
||
'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType,
|
||
'HTMLTAG' => $this->htmlTag,
|
typo3/template.php (working copy) | ||
---|---|---|
// Construct page header.
|
||
$str = $this->pageRenderer->render(t3lib_PageRenderer::PART_HEADER);
|
||
if ($this->pageRenderer->getShowFlashMessages() && $this->showFlashMessages) {
|
||
// render flashmessages for old modules
|
||
$flashMessages = t3lib_FlashMessageQueue::renderFlashMessages();debug($flashMessages);
|
||
if (!empty($flashMessages)) {
|
||
$str .= '<div id="typo3-messages">' . $flashMessages . '</div>';
|
||
}
|
||
}
|
||
$this->JScodeLibArray = array();
|
||
$this->JScode = $this->extJScode = '';
|
||
$this->JScodeArray = array();
|
||
... | ... | |
function setModuleTemplate($filename) {
|
||
// Load Prototype lib for IE event
|
||
$this->pageRenderer->loadPrototype();
|
||
$this->pageRenderer->setShowFlashMessages(FALSE);
|
||
$this->loadJavascriptLib('js/iecompatibility.js');
|
||
$this->moduleTemplate = $this->getHtmlTemplate($filename);
|
||
}
|