3
« il: 28 Ott 2010, 18:25:17 »
Salve, vorrei sapere perchè installando un template Icetheme in locale funziona correttamente e quando invece lo installo in remoto mi da il seguente errore:
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /web/htdocs/www.quiquoquad.it/home/templates/it_paparazzi/icetools/helper.php on line 12
Le ho provate tutte e non so dove sbattere la testa.... che posso fare??? la versione php locale è 5.2.9 e remota è 5.2.14 ....
class IceTemplateHelper {
/**
* @var boolean $DEMOONLY
*
* @static
*/
static $DEMOONLY = true; //<- QUI MI DA L'ERRORE
/**
* @var boolean $DEMOONLY
*
* @static
*/
static $FONTS=array( 'smaller' => '-1' ,
'default' => '0' ,
'larger' => '+1'
);
static $COOKIE_PREFIX = 'it-';
/**
* @var boolean $DEMOONLY
*
* @static
*/
static $DEFAULT_FONT = 12;
static $USER_TOOLS = array( );
/**
* @var boolean $DEMOONLY
*
* @static
*/
static $COLOURS = array( 'style1' => 'Style 1' ,
'style2' => 'Style 2' ,
'style3' => 'Style 3' ,
'style4' => 'Style 4' ,
'style5' => 'Style 5' ,
'style6' => 'Style 6'
);
function templateDefaultSetting( $params ){
IceTemplateHelper::$DEFAULT_FONT=(int)$params->get('font-size',12);
if( $params->get('enable_color','1') ){
IceTemplateHelper::$USER_TOOLS[]='color';
}
if( $params->get('enable_font', '1') ){
IceTemplateHelper::$USER_TOOLS[]='font';
}
}
/**
* Render Layout
*
*/
function renderPanelUserTool( $tools=array(), $style='slider' ){
if( $tools == '' ){
$tools = IceTemplateHelper::$USER_TOOLS;
}
if( !is_array($tools) ){
$tools = array($tools);
}
require_once( dirname(__FILE__).DS.'usertools'.DS.'panel-'.$style.'.php' );
}
/**
* @var boolean $DEMOONLY
*
* @static
*/
function renderClassUserTools(){
$string = '';
if( (int)JRequest::getVar('ice-current-fontsize',IceTemplateHelper::$DEFAULT_FONT,'COOKIE', 'STRING')<= 0 ){
$string = ' ice-fs'.IceTemplateHelper::$DEFAULT_FONT;
}else {
$string = ' ice-fs'.(int)JRequest::getVar('ice-current-fontsize',IceTemplateHelper::$DEFAULT_FONT,'COOKIE', 'STRING' );
}
return $string;
}
/**
* PHP CSS Browser Selector v0.0.1
* Bastian Allgeier (http://bastian-allgeier.de)
* http://bastian-allgeier.de/css_browser_selector
* License: http://creativecommons.org/licenses/by/2.5/
* Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector
*/
function cssBrowserSelector($ua=null) {
$ua = ($ua) ? strtolower($ua) : strtolower($_SERVER['HTTP_USER_AGENT']);
$g = 'gecko';
$w = 'webkit';
$s = 'safari';
$b = array();
// browser
if(!preg_match('/opera|webtv/i', $ua) && preg_match('/msie\s(\d)/', $ua, $array)) {
$b[] = 'ie ie' . $array[1];
} else if(strstr($ua, 'firefox/2')) {
$b[] = $g . ' ff2';
} else if(strstr($ua, 'firefox/3.5')) {
$b[] = $g . ' ff3 ff3_5';
} else if(strstr($ua, 'firefox/3')) {
$b[] = $g . ' ff3';
} else if(strstr($ua, 'gecko/')) {
$b[] = $g;
} else if(preg_match('/opera(\s|\/)(\d+)/', $ua, $array)) {
$b[] = 'opera opera' . $array[2];
} else if(strstr($ua, 'konqueror')) {
$b[] = 'konqueror';
} else if(strstr($ua, 'chrome')) {
$b[] = $w . ' ' . $s . ' chrome';
} else if(strstr($ua, 'iron')) {
$b[] = $w . ' ' . $s . ' iron';
} else if(strstr($ua, 'applewebkit/')) {
$b[] = (preg_match('/version\/(\d+)/i', $ua, $array)) ? $w . ' ' . $s . ' ' . $s . $array[1] : $w . ' ' . $s;
} else if(strstr($ua, 'mozilla/')) {
$b[] = $g;
}
// platform
if(strstr($ua, 'j2me')) {
$b[] = 'mobile';
} else if(strstr($ua, 'iphone')) {
$b[] = 'iphone';
} else if(strstr($ua, 'ipod')) {
$b[] = 'ipod';
} else if(strstr($ua, 'mac')) {
$b[] = 'mac';
} else if(strstr($ua, 'darwin')) {
$b[] = 'mac';
} else if(strstr($ua, 'webtv')) {
$b[] = 'webtv';
} else if(strstr($ua, 'win')) {
$b[] = 'win';
} else if(strstr($ua, 'freebsd')) {
$b[] = 'freebsd';
} else if(strstr($ua, 'x11') || strstr($ua, 'linux')) {
$b[] = 'linux';
}
return join(' ', $b);
}
}