Location: PHPKode > projects > Simple Way to Usenet > swun/libs/core/themes/thm_failsave.class.php
<?php
/**
 *  
 * @author  Benjamin Gillissen <hide@address.com>
 * 
 *	**************************************************************

	Copyright (C) 2009  Benjamin Gillissen
	
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details at:
	http://www.gnu.org/copyleft/gpl.html

 *	**************************************************************
 */
class thm_failsave extends thm_helper {
		
	private static $theme = 'failsave';
		
	public function __construct(){ 
		parent::__construct(Array('debug'));
	}

	public function special_events(){}
	
	public function send_header($data){
		if (!isset($data['title']) ){ $data['title'] = ''; }
		$o = '<!DOCTYPE html 
	PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="'.langs::lang().'">
<head>
	<title id="title">'.$data['title'].'</title>
	<meta http-equiv="Content-Type" content="text/html; charset='.langs::charset().'" />
	<style type="text/css">
	body     { 
		margin:0px;
		font-size:13px;
	}
	.blockvis {}
	.blockvis:hover {
		color:white;
		cursor:pointer
	}
	.event_header{
		margin-top:		5px;
		margin-left:	10px;
		border-bottom:	1px solid gray
	}
	.event_content_open { 
		background-color:	gray;
		margin-left:	20px;
		visibility:		visible;
		height:			auto;
		border-bottom:	1px solid gray;
		border-left:	1px solid gray

	}
	.event_content_close { 
		overflow:	hidden;
		height:		0px;
		visibility:	hidden
	}
	</style>
</head>
<body>
<script type="text/javascript">'."
function swap_backtrace(id, class){
	var \$obj;
	obj = document.getElementById(id);
	if ( obj.className == class + 'open' ){ //open so we close
		obj.className = class + 'close';
	} else { //closed so we open
		obj.className = class + 'open';
	}
}
</script>".'
<p align=center style="font-size:16px">CORE Failsave Theme</p>
<hr/>
';
		langs::output_for_client($o);
		return TRUE;
	}
	
	public function send_content(&$content){
		langs::output_for_client( $content );
		unset($content);
		return TRUE;
	}
	
	public function send_footer($data){
		unset($data);
		langs::output_for_client('<hr/>Request DEBUG :<br/>');
		$c=0;
		while( $event = errors::fetch_debugchan() ){
			$o = '<div class="event_container">
				<div class="event_header">
					<span class="blockvis" onclick="javascript:swap_backtrace(\'event_'.$c.'\', \'event_content_\');">[&plusmn;]</span> '.$event['event'].'
				</div>
				<div id="event_'.$c.'" class="event_content_close">'.$event['backtrace'].'</div>
			</div>';
			langs::output_for_client($o);
			unset($o);
			$c++;
		}
		langs::output_for_client('</body></html>');
		return TRUE;
				
	}

}
return 1;
Return current item: Simple Way to Usenet