mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add optional parameter $plain to exitError()
if set, the resulting html will only be a html fragment to be embedded in a page
This commit is contained in:
parent
34ce80eb3d
commit
3fbfadeebd
|
@ -128,12 +128,12 @@ class UI extends UI_Default {
|
|||
return $themes;
|
||||
} /* }}} */
|
||||
|
||||
static function exitError($pagetitle, $error) {
|
||||
static function exitError($pagetitle, $error, $noexit=false, $plain=false) {
|
||||
global $theme, $dms;
|
||||
$tmp = 'ErrorDlg';
|
||||
$view = UI::factory($theme, $tmp);
|
||||
$view->setParam('dms', $dms);
|
||||
$view->exitError($pagetitle, $error);
|
||||
$view->exitError($pagetitle, $error, $noexit, $plain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1438,20 +1438,24 @@ $('#clearfilename<?php print $formName ?>').click(function(ev) {
|
|||
echo "</div>\n";
|
||||
} /* }}} */
|
||||
|
||||
function exitError($pagetitle, $error, $noexit=false) { /* {{{ */
|
||||
|
||||
$this->htmlStartPage($pagetitle);
|
||||
$this->globalNavigation();
|
||||
$this->contentStart();
|
||||
function exitError($pagetitle, $error, $noexit=false, $plain=false) { /* {{{ */
|
||||
|
||||
if(!$plain) {
|
||||
$this->htmlStartPage($pagetitle);
|
||||
$this->globalNavigation();
|
||||
$this->contentStart();
|
||||
}
|
||||
|
||||
print "<div class=\"alert alert-error\">";
|
||||
print "<h4>".getMLText('error')."!</h4>";
|
||||
print htmlspecialchars($error);
|
||||
print "</div>";
|
||||
print "<div><button class=\"btn history-back\">".getMLText('back')."</button></div>";
|
||||
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
if(!$plain) {
|
||||
print "<div><button class=\"btn history-back\">".getMLText('back')."</button></div>";
|
||||
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
}
|
||||
|
||||
// add_log_line(" UI::exitError error=".$error." pagetitle=".$pagetitle, PEAR_LOG_ERR);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user