2009-08-28 Ingo Renner <ingo@typo3.org>
* Added feature #11784: Change existing messages in the Template Object Browser top use flash messages
+ * Added feature #11783: Change existing warning boxes to use flash messages
2009-08-28 Steffen Kamper <info@sk-typo3.de>
if (count($warnings)) {
$style = ' style="margin-bottom:10px;"';
- $content = '<table border="0" cellpadding="0" cellspacing="0" class="warningbox"><tr><td>' .
- $GLOBALS['TBE_TEMPLATE']->icons(3) . '<span class="warningboxheader">' .
- $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.header') .
- '</span><br /><ul><li' . $style.'>' .
- implode('</li><li' . $style . '>', $warnings) . '</li></ul>' .
- '</td></tr></table>';
+ $securityWarnings = '<ul><li' . $style . '>'
+ . implode('</li><li' . $style . '>', $warnings)
+ . '</li></ul>';
+
+ $securityMessage = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ $securityWarnings,
+ $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.header'),
+ t3lib_FlashMessage::ERROR
+ );
+ $content = '<div style="margin: 20px 0px;">'
+ . $securityMessage->render()
+ . '</div>';
unset($warnings);
return $content;
}
// Display "is-locked" message:
- if ($lockInfo = t3lib_BEfunc::isRecordLocked($table,$rec['uid'])) {
- $lockIcon = '
-
- <!-- Warning box: -->
- <table border="0" cellpadding="0" cellspacing="0" class="warningbox">
- <tr>
- <td><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' alt="" /></td>
- <td>'.htmlspecialchars($lockInfo['msg']).'</td>
- </tr>
- </table>
- ';
- } else $lockIcon = '';
+ if ($lockInfo = t3lib_BEfunc::isRecordLocked($table, $rec['uid'])) {
+ $lockedMessage = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ htmlspecialchars($lockInfo['msg']),
+ '',
+ t3lib_FlashMessage::WARNING
+ );
+ $this->doc->pushFlashMessage($lockedMessage);
+ }
// Combine it all:
- $editForm.= $lockIcon.$panel;
+ $editForm .= $panel;
}
$thePrevUid = $rec['uid'];
public function doEdit() {
global $BE_USER,$LANG;
- if ($BE_USER->workspace!=0) {
+ if ($BE_USER->workspace != 0) {
// Adding section with the permission setting matrix:
- $this->content.=$this->doc->divider(5);
- $this->content.=$this->doc->section($LANG->getLL('WorkspaceWarning'),'<div class="warningbox">'.$LANG->getLL('WorkspaceWarningText').'</div>',0,1,3);
+ $lockedMessage = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ $LANG->getLL('WorkspaceWarningText'),
+ $LANG->getLL('WorkspaceWarning'),
+ t3lib_FlashMessage::WARNING
+ );
+ $this->doc->pushFlashMessage($lockedMessage);
}
// Get usernames and groupnames
$theCode=$tceforms->printNeededJSFunctions_top().$theCode.$tceforms->printNeededJSFunctions();
// Add warning sign if record was "locked":
- if ($lockInfo=t3lib_BEfunc::isRecordLocked($this->eRParts[0],$rec['uid'])) {
- $lockIcon='
-
- <!--
- Warning box:
- -->
- <table border="0" cellpadding="0" cellspacing="0" class="warningbox">
- <tr>
- <td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning3.gif','width="17" height="12"').' alt="" /></td>
- <td>'.htmlspecialchars($lockInfo['msg']).'</td>
- </tr>
- </table>
- ';
- } else $lockIcon='';
+ if ($lockInfo = t3lib_BEfunc::isRecordLocked($this->eRParts[0], $rec['uid'])) {
+ $lockedMessage = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ htmlspecialchars($lockInfo['msg']),
+ '',
+ t3lib_FlashMessage::WARNING
+ );
+ $this->doc->pushFlashMessage($lockedMessage);
+ }
// Add whole form as a document section:
- $content.=$this->doc->section('',$lockIcon.$theCode);
+ $content .= $this->doc->section('', $theCode);
}
} else {
// If no edit access, print error message:
implode('', $languageOptions) . '
</select>';
if ($GLOBALS['BE_USER']->uc['lang'] && !@is_dir(PATH_typo3conf . 'l10n/' . $GLOBALS['BE_USER']->uc['lang'])) {
- $languageCode .= '<table border="0" cellpadding="0" cellspacing="0" class="warningbox"><tr><td>'.
- $this->doc->icons(3) .
- 'The selected language is not available before the language pack is installed.<br />'.
- ($GLOBALS['BE_USER']->isAdmin() ? 'You can use the Extension Manager to easily download and install new language packs.':'Please ask your system administrator to do this.') .
- '</td></tr></table>';
+ $languageUnavailableWarning = 'The selected language is not available before the language pack is installed.<br />'
+ . ($GLOBALS['BE_USER']->isAdmin() ?
+ 'You can use the Extension Manager to easily download and install new language packs.'
+ : 'Please ask your system administrator to do this.');
+
+
+ $languageUnavailableMessage = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ $languageUnavailableWarning,
+ '',
+ t3lib_FlashMessage::WARNING
+ );
+
+ $languageCode = $languageUnavailableMessage->render() . $languageCode;
}
return $languageCode;