array(),self::STYLESHEET_USER=>array(),self::STYLESHEET_ADMIN=>array()); private static $JAVASCRIPTS = array(self::JAVASCRIPT_GENERAL=>array(),self::JAVASCRIPT_USER=>array(),self::JAVASCRIPT_ADMIN=>array()); private static $onLoadEvents = array(); public static function generateHtmlHeaders(array $data = array(), $admin = false){ $conf = GlobalVariables::get("config"); $title = $conf->info->projectName; if (array_key_exists("title", $data)){ $title = $data["title"]; } $description = $conf->info->projectDescription; if (array_key_exists("description", $data)){ $description = $data["description"]; } $author = $conf->info->author; if (array_key_exists("author", $data)){ $author = $data["author"]; } header("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n\n"; echo "\n"; echo "$title\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ''."\n"; echo ''."\n"; foreach (self::$STYLESHEETS[self::STYLESHEET_GENERAL] as $file){ echo ''."\n"; } foreach (self::$JAVASCRIPTS[self::JAVASCRIPT_GENERAL] as $file){ echo ''."\n"; } $othJs = $admin?self::JAVASCRIPT_ADMIN:self::JAVASCRIPT_USER; foreach (self::$JAVASCRIPTS[$othJs] as $file){ echo ''."\n"; } if (sizeof(self::$onLoadEvents)>0){ echo ''."\n"; } echo ''; } public static function redirect($url){ // $tmp = new JavaScriptElement("var index = window.location.href.indexOf('#');window.location.href='".$url."'+(index == -1 ? '' : window.location.href.substr(index));"); // $tmp->render(); echo ''; die(); } public static function redirectPost($url,array $vals = array()){ // $tmp = new JavaScriptElement("var index = window.location.href.indexOf('#');window.location.href='".$url."'+(index == -1 ? '' : window.location.href.substr(index));"); // $tmp->render(); $valArr = array(); if (sizeof($vals)>0){ foreach ($vals as $key=>$val){ $valArr[] = '{"name":"'.$key.'","value":"'.$val.'"}'; } } $valString = '['.implode(",", $valArr).']'; echo ''; die(); } public static function addStylesheet($group, $file){ if (array_key_exists($group, self::$STYLESHEETS)){ self::$STYLESHEETS[$group][] = $file; } else { throw new CoreException("Invalid stylesheet group ($group) passed to GUIHandler::addStylesheet() for file '$file'"); } } public static function addJavascriptLib($group, $file){ if (array_key_exists($group, self::$JAVASCRIPTS)){ self::$JAVASCRIPTS[$group][] = $file; } else { throw new CoreException("Invalid stylesheet group ($group) passed to GUIHandler::addJavascriptLib() for file '$file'"); } } // public static function generateLoadingOverlay(){ // echo '
Caricamento....
Attendere prego

'; // } public static function getBaseUrl(){ $conf = GlobalVariables::get("config"); return $conf->pages->remoteLocationPath; } public static function getImagesUrl(){ return self::getBaseUrl()."images/"; } public static function getStylesheetsUrl(){ return self::getBaseUrl()."style/"; } public static function getJavascriptsUrl(){ return self::getBaseUrl()."js/"; } public static function addOnLoadJsEvent($script){ self::$onLoadEvents[] = $script; } public static function generateHeadPublic(){ $mesi = array(1=>'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre','Dicembre'); $day = date("d"); ?>
- Aggiornato alle
id; return 'window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent("'.$url.'"))'; } public static function getTwitterShareFunction(NotiziaModel $notizia){ $url = self::getBaseUrl()."fbMetadata.php?id=".$notizia->id; return 'window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent("'.$url.'"))'; } public static function getGooglePlusShareFunction(NotiziaModel $notizia){ $url = self::getBaseUrl()."fbMetadata.php?id=".$notizia->id; return 'window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent("'.$url.'"))'; } public static function getLinkedinShareFunction(NotiziaModel $notizia){ $url = self::getBaseUrl()."fbMetadata.php?id=".$notizia->id; return 'window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent("'.$url.'"))'; } } ?>