34 lines
No EOL
860 B
PHP
34 lines
No EOL
860 B
PHP
<?php
|
|
require_once("template.php");
|
|
|
|
class Info{
|
|
var $type = array (
|
|
"warning" => array("#F0FF69","#FFFB3E"),
|
|
"error" => array("#FFDDCC","#FF0000"),
|
|
"info" => array("#9BFB66","#039C00")
|
|
);
|
|
var $defaultStyle = "
|
|
<div id=\"info\" style=\"border:2px solid {'message_color_border'}; padding:5px;margin:10px;background:{'message_color'} none repeat scroll 0%;font-size:13px;\">
|
|
<center>{'message'}</center>
|
|
</div>
|
|
";
|
|
|
|
function buildMessage($msg, $t="warning"){
|
|
GLOBAL $template;
|
|
if(isset($template["message"])){
|
|
$temp = new Template($template["message"]);
|
|
}
|
|
else{
|
|
$temp = new Template($this->defaultStyle);
|
|
}
|
|
|
|
$temp->replace_tags(array(
|
|
"message_color" => $this->type[$t][0],
|
|
"message_color_border" => $this->type[$t][1],
|
|
"message" => $msg
|
|
));
|
|
|
|
return $temp->getOutput();
|
|
}
|
|
}
|
|
?>
|