Location: PHPKode > scripts > hnwb_ListView for WinBinder > hnwb_listview-for-winbinder/examples/config.php
<?PHP


/*******************************************************************************
 *
 *   PLEASE TYPE IN THE _DIRECTORY-PATH_ TO YOUR winbinder.php
***/
	$PATH_2_WINBINDER_PHP = "C:/path/to-your/WinBinder-DIRECTORY/";
/*
 ******************************************************************************/



/*******************************************************************************
 *
 *   Should we use an ErrorHandler with PopUp-Messages?
***/
	define('UseOwnErrorHandler', TRUE);
/*
 ******************************************************************************/







################################################################################


//----------------------------------------------------------- BASIC DEPENDENCIES

require_once('../hn_basic.class.php');
require_once('../hn_ini.class.php');
require_once('../hnwb_listview.class.php');
$hn = new hn_basic();

if(defined('UseOwnErrorHandler') && UseOwnErrorHandler===TRUE)
	set_error_handler('WB_Error_Handler');


//------------------------------------------------------------ SYSTEM PARAMETERS

define('PATH_WB',      $hn->hn_BuildFolderStr($PATH_2_WINBINDER_PHP));
define('PATH_INC',     PATH_WB . 'include/');
define('PATH_RES',     PATH_WB . 'resources/');
define('PATH_SCRIPT',  $hn->nobacks(dirname(__FILE__).'/'));


//------------------------------------------------------- WINBINDER DEPENDENCIES

include PATH_INC . 'winbinder.php';


//----------------------------------------------------------------- ErrorHandler

function WB_Error_Handler($errlevel, $description, $file, $line, $context)
{
#	if($errlevel===8) return;  // E_NOTICE
$msg1 = <<< EOF1
ERROR!
Do you want to stop execution?

[$errlevel] ErrorDescription
$description

File:Line
$file:$line

EOF1;
$msg2 = <<< EOF2
ERROR!
Execution is stopped!

[$errlevel] ErrorDescription
$description

File:Line
$file:$line

EOF2;
$msg3 = <<< EOF3

[$errlevel] ErrorDescription
$description

File:Line
$file:$line


EOF3;
	$msg = '';
	if(class_exists('hn_basic'))
	{
		$hn = new hn_basic();
		$a = explode("\n",str_replace(array("\r\n",'&gt;','&quot;','&#10;'), array("\n",'>','"',''), strip_tags($GLOBALS['hn']->my_var_dump($context,3))));
		$s = "\r\n###############################\r\n". date('Y-m-d - H:i:s') ."\r\n". $msg3 . implode("\r\n",$a);
		$file = __FILE__ .'._lastError_.txt';
		$hn->string2file($s,$file,TRUE);
		if(count($a)<15) $msg = implode("\n",$a);
	}
	switch($errlevel)
	{
		case 1:			// E_ERROR
		case 2:			// E_WARNING
		case 256:		// E_USER_ERROR
			wb_message_box(null,$msg2 . $msg,'FATAL ERROR', WBC_STOP);
			die();
			break;
		case 512:		// E_USER_WARNING
			if(wb_message_box(null,$msg1 . $msg,'WARNING', WBC_YESNO | WBC_WARNING)) die();
			break;
		case 8:			// E_NOTICE
		case 1024:		// E_USER_NOTICE
			if(wb_message_box(null,$msg1 . $msg,'NOTICE', WBC_YESNO | WBC_INFO)) die();
			break;
		default:
			if(wb_message_box(null,$msg1 . $msg,'UNKNOWN ERROR', WBC_YESNO | WBC_WARNING)) die();
			break;
	}
}


?>
Return current item: hnwb_ListView for WinBinder