allow msg after headers were sent
darcs-hash:20050123182938-9977f-4404c519f6b05550c6ba3d43cea24f246b137dad.gz
This commit is contained in:
parent
f59b22f06f
commit
0396becba6
|
@ -142,7 +142,12 @@ function pageinfo(){
|
|||
}
|
||||
|
||||
/**
|
||||
* adds a message to the global message array
|
||||
* print a message
|
||||
*
|
||||
* If HTTP headers were not sent yet the message is added
|
||||
* to the global message array else it's printed directly
|
||||
* using html_msgarea()
|
||||
*
|
||||
*
|
||||
* Levels can be:
|
||||
*
|
||||
|
@ -151,6 +156,7 @@ function pageinfo(){
|
|||
* 1 success
|
||||
*
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
* @see html_msgarea
|
||||
*/
|
||||
function msg($message,$lvl=0){
|
||||
global $MSG;
|
||||
|
@ -158,8 +164,14 @@ function msg($message,$lvl=0){
|
|||
$errors[0] = 'info';
|
||||
$errors[1] = 'success';
|
||||
|
||||
if(!isset($MSG)) $MSG = array();
|
||||
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
|
||||
if(!headers_sent){
|
||||
if(!isset($MSG)) $MSG = array();
|
||||
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
|
||||
}else{
|
||||
$MSG = array();
|
||||
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
|
||||
html_msgarea();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -158,7 +158,6 @@ div.error{
|
|||
font-size: 90%;
|
||||
margin: 0px;
|
||||
padding-left: 3em;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
div.info{
|
||||
|
@ -167,7 +166,6 @@ div.info{
|
|||
font-size: 90%;
|
||||
margin: 0;
|
||||
padding-left: 3em;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
div.success{
|
||||
|
@ -176,7 +174,6 @@ div.success{
|
|||
font-size: 90%;
|
||||
margin: 0;
|
||||
padding-left: 3em;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
/* ---------------------------- Diff rendering --------------------------*/
|
||||
|
|
Loading…
Reference in New Issue