<?php
/**
 * třída je děděna všemi třídami v labrery
 * takze implementuje spolecnou funkcionalitu
 * 
 * @author aaa
 *
 */
abstract class MyWeb_plugin extends MyWeb_Log_ApplicationLogger
{
	static $show_log = TRUE;
	static $show_info = TRUE;
	static $show_method = TRUE;
	static $show_query = TRUE;
	static $show_error = TRUE;
	static $show_csv = TRUE;
	
	//**********************************************************************************
	//pokud je zapnuto logovani tak se zobrazi na strance prvni log init action controlleru
	// a predbehne doctipe a tim prestane fungovat dropdawn menu
	//**********************************************************************************
	
	
	// !!! ukladat nazvy trid do pole a $pole['trida'][show_log] = TRUE
	//												  [show_method] = TRUE
	
	
	public function showMe($text,$type)
	{
		if (self::$show_log === TRUE){
			if($type == 'LOG'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_log === TRUE){
			if($type == 'LOG1'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === TRUE){
			if($type == 'Zend_View_Helper_Table'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === FALSE){
			if($type == 'UserController'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === TRUE){
			if($type == 'Zend_View_Helper_Table'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === FALSE){
			if($type == 'UserController'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === FALSE){
			if($type == 'ArticleController'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === TRUE){
			if($type == 'MyWeb_SourceFileCreator_AutoCreator'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_log === TRUE){
			if($type == 'MyWeb_SourceFileCreator_DbTable_DbTable'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		
		if (self::$show_log === FALSE){
			if($type == 'MyWeb_Model_DbTable_TableModel'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_log === FALSE){
			if($type == 'MyWeb_Model_DbTable_AutoModel'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_log === FALSE){
			if($type == 'MyWeb_Form_AutoTemplateForm_AutoCreateForm'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_log === FALSE){
			if($type == 'MyWeb_Form_AutoTemplateForm_CreateDbTable'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_method === FALSE){
			if($type == 'MyWeb_Controller_AutoTemplateController_AutoCreateController'){
				echo "<p style=\"background-color: white; color: green;\">".$text."</p>";
			}
		}
		if (self::$show_query === FALSE){
			if($type == 'MyWeb_Controller_AutoTemplateController_CreateDbTable'){
				echo "<p style=\"background-color: white; color: blue;\">".$text."</p>";
			}
		}
		
		
		if (self::$show_method === TRUE){
			if($type == 'M'){
				echo "<p style=\"background-color: white; color: green;\">".$text."</p>";
			}
		}
		if (self::$show_query === TRUE){
			if($type == 'Q'){
				echo "<p style=\"background-color: white; color: blue;\">".$text."</p>";
			}
		}
		if (self::$show_info === TRUE){
			if($type == 'info'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
		if (self::$show_error === TRUE){
			if($type == 'ERROR'){
				echo "<div style=\"background-color: white; color: red;\">".$text."</div>";
			}
		}
		if (self::$show_csv === TRUE){
			if($type == 'MyWeb_Model_Database'){
				echo "<b style=\"background-color: white; color: black;\">".$text."<b>";
			}
		}
		
		if (self::$show_log === TRUE){
			if($type == 'MyWeb_DbTable_DbTable_DbTable'){
				echo "<p style=\"background-color: white; color: black;\">".$text."</p>";
			}
		}
	}
	
}