content[error] = array(); $this->content[warning] = array(); $this->content[info] = array(); $this->content[success] = array(); $this->content[text] = array(); $this->content[debug][] = array(); */ $this->content['content_header'] = ""; $this->content['content_footer'] = ""; $this->content['title'] = ""; $this->content['charset'] = ""; $this->content['header'] = array(); $this->content['css'] = array(); $this->content['body'] = array(); $this->static_title = $staticTitle; } function addHeader($header) { $this->content['header'][] = $header; } function switchOffBuffer() { $this->buffering = false; } function addCss($msg) { $this->content['css'][] = $msg; } function addContentHeader($msg) { $tmp = '
'.$msg.'
'. "\n"; if ($this->buffering) { $this->content['content_header'][] = $tmp; } else { print $tmp; } } function addContentFooter($msg) { $tmp = ''. "\n"; if ($this->buffering) { $this->content['content_footer'][] = $tmp; } else { print $tmp; } } function setTitle($msg) { $this->content['title'] = $msg; } function setCharset($msg) { $this->content['charset'] = $msg; } function addError($msg, $title="") { if ($title != "") { $tmp = '

Error: '.$title.'

'."\n".'
'.$msg.'
'."\n"; } else { $tmp = '
Error: '.$msg.'
'."\n"; } if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function addWarning($msg, $title = "") { if ($title != "") { $tmp = '

Warning: '.$title.'

'."\n".'
'.$msg.'
'."\n"; } else { $tmp = '
Warning: '.$msg.'
'."\n"; } if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function addInfo($msg, $title = "") { if ($title != "") { $tmp = '

Info: '.$title.'

'."\n".'
'.$msg.'
'."\n"; } else { $tmp = '
Info: '.$msg.'
'."\n"; } if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function addText($msg, $title = "", $css_class="") { if ($css_class != "") $css_class = ' class="'.$css_class.'"'; if ($title != "") $title = ''.$title.''; $tmp = $title.''.$msg.''; if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function addDebug($msg, $title = '') { if ($title != "") { $tmp = '

Debug: '.$title.'

'."\n".'
'.$msg.'
'."\n"; } else { $tmp = '
Debug: '.$msg.'
'."\n"; } if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function addSuccess($msg, $title = '') { if ($title != "") { $tmp = '

Successful: '.$title.'

'."\n".'
'.$msg.'
'."\n"; } else { $tmp = '
Successful: '.$msg.'
'."\n"; } if ($this->buffering) { $this->content['body'][] = $tmp; } else { print $tmp; } } function getFooterLayout() { if ($this->buffering) return ''; $res = ''; if(($this->content['content_footer'] != "") && count($this->content['content_footer']) > 0) { foreach ($this->content['content_footer'] as $id => $line) { $res .= ''. "\n"; } } $res .= ""; $res .= ""; return $res; } function getHeaderLayout() { if ($this->buffering) return ''; $res = ''."\n"; $res .= ''."\n"; $res .= ''.$this->static_title .' ' . $this->content['title'].''."\n"; // header if(($this->content['header'] != "") && count($this->content['header']) > 0) { foreach ($this->content['header'] as $id => $head) { $res .= $head . "\n"; } } // css $res .= ''."\n"; //end of head $res .= ''."\n"; $res .= '

'.$this->content['title'].'

'; if(($this->content['content_header'] != "") && count($this->content['content_header'])>0) { foreach ($this->content['content_header'] as $id => $line) { $res .= $line . "\n"; } } return $res; } function getContent() { if (! $this->buffering) { $res = ''."\n"; $res .= ''."\n"; $res .= ''.$this->static_title .' ' . $this->content['title'].''."\n"; // header if(($this->content['header'] != "") && count($this->content['header']) > 0) { foreach ($this->content['header'] as $id => $head) { $res .= $head . "\n"; } } // css $res .= ''."\n"; //end of head $res .= ''."\n"; $res .= '

'.$this->content['title'].'

'; if(($this->content['content_header'] != "") && count($this->content['content_header'])>0) { foreach ($this->content['content_header'] as $id => $line) { $res .= $line . "\n"; } } if(($this->content['body'] != "") && count($this->content['body']) > 0) { foreach ($this->content['body'] as $id => $line) { $res .= $line . "\n"; } } if(($this->content['content_footer'] != "") && count($this->content['content_footer']) > 0) { foreach ($this->content['content_footer'] as $id => $line) { $res .= ''. "\n"; } } $res .= ""; $res .= ""; } else { $res = ''; } return $res; } } ?>