Bug #21213 » 12164.diff
t3lib/class.t3lib_extfilefunc.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
function printLogErrorMessages($redirect = '') {
|
||
// fetch the error messages from the DB
|
||
$errorMessages = $this->getErrorMessages();
|
||
$errors = $this->getErrorMessages();
|
||
// only print error messages if there is an error
|
||
if (count($errorMessages)) {
|
||
if ($errors) {
|
||
$errorDoc = t3lib_div::makeInstance('template');
|
||
$errorDoc->backPath = '';
|
||
... | ... | |
$lines[] = '
|
||
<tr class="bgColor5">
|
||
<td colspan="2" align="center"><strong>Errors:</strong></td>
|
||
<td align="center"><strong>Errors:</strong></td>
|
||
</tr>';
|
||
foreach ($errorMessages as $line) {
|
||
$lines[] = '
|
||
<tr class="bgColor4">
|
||
<td valign="top"><img' . t3lib_iconWorks::skinImg('', 'gfx/icon_fatalerror.gif', 'width="18" height="16"') . ' alt="" /></td>
|
||
<td>' . htmlspecialchars($line) . '</td>
|
||
$lines[] = '
|
||
<tr>
|
||
<td>' . t3lib_messageQueue::renderFlashMessages() . '</td>
|
||
</tr>';
|
||
}
|
||
$lines[] = '
|
||
<tr>
|
||
<td colspan="2" align="center"><br />'.
|
||
'<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('window.location.href=\'' . $redirect . '\';return false;').'" /></form>'.
|
||
<td align="center"><br />'.
|
||
'<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('window.location.href=\''.$redirect.'\';return false;').'"></form>'.
|
||
'</td>
|
||
</tr>';
|
||
$content .= '
|
||
<br /><br />
|
||
<table border="0" cellpadding="1" cellspacing="1" width="300" align="center">
|
||
' . implode('', $lines) . '
|
||
$content.= '
|
||
<br/><br/>
|
||
<table border="0" cellpadding="1" cellspacing="2" width="500" align="center">
|
||
'.implode('',$lines).'
|
||
</table>';
|
||
$content .= $errorDoc->endPage();
|
||
die($content);
|
||
echo $content;
|
||
exit;
|
||
}
|
||
}
|
||
/**
|
||
* Returns log error messages from the previous file operations of this script instance
|
||
* Adds log error messages from the previous file operations of this script instance
|
||
* to the messageQueue
|
||
*
|
||
* @return array all errorMessages as a numerical array
|
||
* @return boolean true if there are errors
|
||
*/
|
||
function getErrorMessages() {
|
||
$errorMessages = array();
|
||
$errors = FALSE;
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||
'*',
|
||
'sys_log',
|
||
... | ... | |
);
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$logData = unserialize($row['log_data']);
|
||
$errorMessages[] = $row['error'] . ': ' . sprintf($row['details'], $logData[0], $logData[1], $logData[2], $logData[3], $logData[4]);
|
||
$msg = $row['error'] . ': ' . sprintf($row['details'], $logData[0], $logData[1], $logData[2], $logData[3], $logData[4]);
|
||
$flashMessage = t3lib_div::makeInstance(
|
||
't3lib_FlashMessage',
|
||
$msg,
|
||
'',
|
||
t3lib_FlashMessage::ERROR
|
||
);
|
||
t3lib_MessageQueue::addMessage($flashMessage);
|
||
$errors = TRUE;
|
||
}
|
||
$GLOBALS['TYPO3_DB']->sql_free_result($res);
|
||
return $errorMessages;
|
||
return $errors;
|
||
}
|