CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Enable/Disable Includes [PHP]

Print topic Send  topic

Author Message
feha


Posts: 712
Posted: 04/05/2006, 1:22 PM

Create a file Control.php

Depending on your components include the code similar to:
  
<?php  
//============ RENDER TIME =========  
	global $Rendertime_inc;  
	if(defined("SHOW_RENDERTIME") && SHOW_RENDERTIME == 1)  
	{  
	$Rendertime_inc->Visible=True;  
	}  
	else  
	{  
	$Rendertime_inc->Visible=False;  
	}  
//============ Validators =========  
	global $Validators_inc;  
	if(defined("SHOW_VALIDATORS") && SHOW_VALIDATORS == 1 && !eregi("Adm_|LogIn|No_Access",basename ($_SERVER['SCRIPT_NAME'])))  
	{  
	$Validators_inc->Visible=True;  
	}  
	else  
	{  
	$Validators_inc->Visible=False;  
	}  
  
//============ COPYRIGHT =========  
	global $Copyright_inc;  
	if(defined("SHOW_COPYRIGHT") && SHOW_COPYRIGHT == 1)  
	{  
	$Copyright_inc->Visible=True;  
	}  
	else  
	{  
	$Copyright_inc->Visible=False;  
	}  
//============ POWERED BY =========  
	global $Powered_inc;  
	if(defined("SHOW_POWERED_BY") && SHOW_POWERED_BY == 1)  
	{  
	$Powered_inc->Visible=True;  
	}  
	else  
	{  
	$Powered_inc->Visible=False;  
	}  
//============ HEADER =========  
	global $Header_inc;  
	if(defined("SHOW_HEADER") && SHOW_HEADER == 1)  
	{  
	$Header_inc->Visible=True;  
	}  
	else  
	{  
	$Header_inc->Visible=False;  
	}  
  
//============ FOOTER =========  
	global $Footer_inc;  
	if(defined("SHOW_FOOTER") && SHOW_FOOTER == 1)  
	{  
	$Footer_inc->Visible=True;  
	}  
	else  
	{  
	$Footer_inc->Visible=False;  
	}  
//============ PAGE INFO =========  
	global $Page_Info_inc;  
	if(defined("SHOW_PAGE_INFO") && SHOW_PAGE_INFO == 1)  
	{  
	$Page_Info_inc->Visible=True;  
	}  
	else  
	{  
	$Page_Info_inc->Visible=False;  
	}  
//============ LANGUAGE MENU =========  
	global $Languages_inc;  
	if(defined("USE_MULTILANGUAGE") && USE_MULTILANGUAGE == 1)  
	{  
	$Languages_inc->Visible=True;  
	}  
	else  
	{  
	$Languages_inc->Visible=False;  
	}  
?>  
[/php]  
Note: the file Control.php will not work if included in Common.php  
  
You need to include this file on each _events.php ...  
example:  
AfterInitialize event ...  
  
function Page_AfterInitialize(& $sender)  
{  
    $Page_AfterInitialize = true;  
    $Component = & $sender;  
    $Container = CCGetParentContainer($sender);  
    global $Adm_CMS_Configuration; //Compatibility  
//End Page_AfterInitialize  
  
//Custom Code @9-2A29BDB7  
// -------------------------  
    // Write your own code here.  
if(file_exists(RelativePath . "/Control.php"))  
{  
include_once(RelativePath . "/Control.php");  
}  
....  
enjoy :-)
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
feha


Posts: 712
Posted: 04/05/2006, 2:06 PM

Here some screenshots
http://vision.to/Test/
how we made it dynamic and expndable ...
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Damian Hupfeld
Posted: 04/05/2006, 9:39 PM

Nicely done.
This is for your CMS product obviously.
That looks like a great idea.


"feha" <feha@forum.codecharge> wrote in message
news:2544342711d97ca@news.codecharge.com...
> Create a file Control.php
>
> Depending on your components include the code similar to:
>
  
> <?php  
> //============ RENDER TIME =========  
> global $Rendertime_inc;  
> if(defined("SHOW_RENDERTIME") && SHOW_RENDERTIME == 1)  
> {  
> $Rendertime_inc->Visible=True;  
> }  
> else  
> {  
> $Rendertime_inc->Visible=False;  
> }  
> //============ Validators =========  
> global $Validators_inc;  
> if(defined("SHOW_VALIDATORS") && SHOW_VALIDATORS == 1 &&  
> !eregi("Adm_|LogIn|No_Access",basename ($_SERVER['SCRIPT_NAME'])))  
> {  
> $Validators_inc->Visible=True;  
> }  
> else  
> {  
> $Validators_inc->Visible=False;  
> }  
>  
> //============ COPYRIGHT =========  
> global $Copyright_inc;  
> if(defined("SHOW_COPYRIGHT") && SHOW_COPYRIGHT == 1)  
> {  
> $Copyright_inc->Visible=True;  
> }  
> else  
> {  
> $Copyright_inc->Visible=False;  
> }  
> //============ POWERED BY =========  
> global $Powered_inc;  
> if(defined("SHOW_POWERED_BY") && SHOW_POWERED_BY == 1)  
> {  
> $Powered_inc->Visible=True;  
> }  
> else  
> {  
> $Powered_inc->Visible=False;  
> }  
> //============ HEADER =========  
> global $Header_inc;  
> if(defined("SHOW_HEADER") && SHOW_HEADER == 1)  
> {  
> $Header_inc->Visible=True;  
> }  
> else  
> {  
> $Header_inc->Visible=False;  
> }  
>  
> //============ FOOTER =========  
> global $Footer_inc;  
> if(defined("SHOW_FOOTER") && SHOW_FOOTER == 1)  
> {  
> $Footer_inc->Visible=True;  
> }  
> else  
> {  
> $Footer_inc->Visible=False;  
> }  
> //============ PAGE INFO =========  
> global $Page_Info_inc;  
> if(defined("SHOW_PAGE_INFO") && SHOW_PAGE_INFO == 1)  
> {  
> $Page_Info_inc->Visible=True;  
> }  
> else  
> {  
> $Page_Info_inc->Visible=False;  
> }  
> //============ LANGUAGE MENU =========  
> global $Languages_inc;  
> if(defined("USE_MULTILANGUAGE") && USE_MULTILANGUAGE == 1)  
> {  
> $Languages_inc->Visible=True;  
> }  
> else  
> {  
> $Languages_inc->Visible=False;  
> }  
> ?>  
> [/php]  
> Note: the file Control.php will not work if included in Common.php  
>  
> You need to include this file on each _events.php ...  
> example:  
> AfterInitialize event ...  
> 
  
> function Page_AfterInitialize(& $sender)  
> {  
>    $Page_AfterInitialize = true;  
>    $Component = & $sender;  
>    $Container = CCGetParentContainer($sender);  
>    global $Adm_CMS_Configuration; //Compatibility  
> //End Page_AfterInitialize  
>  
> //Custom Code @9-2A29BDB7  
> // -------------------------  
>    // Write your own code here.  
> if(file_exists(RelativePath . "/Control.php"))  
> {  
> include_once(RelativePath . "/Control.php");  
> }  
> ...  
> 
> > enjoy > :-) > > _________________ > Regards > feha > Vision.To Design > www.vision.to > wowdev.com > --------------------------------------- > Sent from YesSoftware forum > http://forums.codecharge.com/ >
feha


Posts: 712
Posted: 04/12/2006, 8:21 AM

Hi Damian
Quote :
Nicely done.
This is for your CMS product obviously.
That looks like a great idea.

Yes :-)
Demo:
http://www.vision.to/CMS_BE/

The code for controlling components it now dynamic and generated on the fly ...
This means with no hard coding new components can be added via WebAdmin and can be Enabled-Disabled ...
This ensures future expandability without need to do hard coding ...

When you login check for Control Panel on Admin Menu ...
The panel is created dynamically ...

The code it self is built-in in CMS core.
Dynamic way can be added any sort of configuration dynamically defining constants.

It is very complex and this was a reason for long time development, started in January :-)

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.