{$this->err}
" ; if (!empty($this->info)) echo "{$this->info}
" ; if (!empty($this->warn)) echo "{$this->warn}
" ; echo 'info = '' ;
else $this->info = $info ;
if (empty($warn)) $this->warn = '' ;
else $this->warn = $warn ;
if (empty($err)) $this->err = '' ;
else $this->err = $err ;
}
function __destruct(){
}
function htmlHelper($info, $warn, $err) {
if(version_compare(PHP_VERSION,"5.0.0","<")){
$this->__construct($info, $warn, $err);
register_shutdown_function(array($this,"__destruct"));
}
}
function setInfo($info='') {
if (empty($info)) $this->info = '' ;
else $this->info = $info ;
}
function setWarn($warn='') {
if (empty($warn)) $this->warn = '' ;
else $this->warn = $warn ;
}
function setErr($err='') {
if (empty($err)) $this->err = '' ;
else $this->err = $err ;
}
function mkActionURL($a) {
$isPro = file_exists("pro/pro.php") ;
$name = addslashes(htmlspecialchars($a['name'])) ;
$help = sprintf( ' onmouseover="Tip(\'%s\', WIDTH, 300, TITLE, \'%s\', ' .
'FIX, [this, 5, 2])" onmouseout="UnTip()" ', $a['help'], $name);
if (!$isPro) $ret = "'http://buy.thulasidas.com/$name' onclick='return confirm(\"$name is a paid package. Would you like to purchase the $name package (\${$a['price']})?\");' target='_blank' $help" ;
return $ret ;
}
function showActions($actions, $button=false) {
$ret = '' ;
foreach ($actions as $a) {
$name = $a['name'] ;
if ($button)
$nameButton = "" ;
else
$nameButton = $name ;
$url = $this->mkActionURL($a) ;
$ret .= " $nameButton \n" ;
}
return $ret ;
}
function ezppHeader($heading, $welcome, $pwd='.', $custom=false, $onload='') {
$actions = array() ;
$actions["pro"] = array(
"name" => "PHP Validator Pro",
"price" => "0.99",
"help" => "The Lite version of this plugin is fully functional. It will show undefined functions and methods as the Pro version does. The Pro version adds the ability show line numbers as well, which may make editing a bit easier.") ;
$actions["standalone"] = array(
"name" => "phpValidator",
"price" => "1.45",
"help" => "This plugin is also available as a stand-alone package. The Standalone version has all the features of the Pro version, but works as a stand-alone package, independent of WordPress. You can install it on your local development box and invoke it directly from a browser to compile your PHP code. It will list undefined functions and methods with line numbers.") ;
$this->info = "Upgrade PHP Validator: " . $this->showActions($actions, true) ;
printf("
{$this->err}
" ; if (!empty($this->info)) echo "{$this->info}
" ; if (!empty($this->warn)) echo "{$this->warn}
" ; echo '$target. Please reinstall phpValidator!") ;
}
}
}
}
?>