'Autosize', 'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php'))); return $menu; } //function cl_autosize_admin /************************** * loc_begin_picture * ***************************/ static public function init_0(){ global $events ; $hasContent=(empty($content) )?'false':'true'; if(empty($events)) $events = (object) ''; $events->ligne=40; $events->event +=1; $events->function="init_0"; $events->content=$hasContent; self::AfficheDebug(); } /************************** * autosize_calcContent * **************************/ static public function autosize_calcContent($content,$element_info){ global $conf,$page, $template,$picture,$user; global $defined_types,$pictureSelType,$pictureMap ,$pictureDeriv ,$liste_type,$SRC_IMG; global $autosize_parametres,$user_status,$events,$error_message, $imgSizeWH; //============================================================================== global $infos_message,$error_message; $ma_page=isset($page['body_id'])?$page['body_id']:"" ; if ($ma_page !='thePicturePage') return ; if(!realpath($element_info['path'])){$error_message .= "Error path";}; //========================================================== $current = $template->get_template_vars('current'); if (!isset($current)) return ; $default_size = $conf['derivative_default_size']; //============================================================ $types = array_intersect(array_keys(ImageStdParams::get_defined_type_map()), array("Autosize","SelMaxi")); if (count($types)==0){ include_once (AUTOSIZE_PATH.'maintain.inc.php'); if (isset($conf['cl_derivatives_sav'])) { plugin_deactivate() ; } plugin_activate(); unset ( $_COOKIE['autosize_reload']) ; } //============================================================== $autosize_parametres = cl_autosize_Get_Options(); self::get_cookies(); //============================================================= $derivative = $current['src_image'] ; $imgSizeWH = $derivative->get_size(); $SRC_IMG = $derivative->get_url(); $picture['current']['scaled_width']=$imgSizeWH[0]; $picture['current']['scaled_height']= $imgSizeWH[1]; $picture['current']['high_url']= $SRC_IMG; $picture['current']['image_url']=$SRC_IMG; $picture['current']['thumbnail']=$SRC_IMG; $hasContent=(empty($content) )?'false':'true'; //============================================================== if(empty($events)) $events= (object) ''; $events->ligne=89; $events->event +=1; $events->function="autosize_calcContent"; $events->content=$hasContent; self::AfficheDebug(); return false ; }//calc_content ; /********************* * INIT *********************/ static public function init_1($content, $image) { global $conf, $template, $page; global $theContainerHeight,$theContainerWidth; global $theMainImageWidth,$theMainImageHeight ; global $infos_message,$error_message; if(!realpath($image['path'])) return $content; if( isset($conf['AS_panorama']) && is_array($conf['AS_panorama'])) { $asp = & $conf['AS_panorama']; if(!isset($asp['in_mode_360'])) $asp['in_mode_360']=""; if(!isset($asp['in_mode_180'])) $asp['in_mode_180']=""; if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content; $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theContainerLeft']-$_COOKIE['theContainerRight']; $asp['viewport_height']=$_COOKIE['windowHeight']-130 ; $asp['start_position']= 10; } if ( strstr( $content,"iframe")||strstr($content,"charlie" )){ $ncount=1; $pattern = array(); $pattern[0] = '/width\:(.*)(\d+)px/';$replacement[0] = ""; // style charlie $pattern[1] = '/height\:(.*)(\d+)px/';$replacement[1] = ""; $pattern[2] = '/width=\"(\d+)\"/';$replacement[2] = ' '; $pattern[3] = '/height=\"(\d+)\"/';$replacement[3] = ' '; $pattern[4] = '/WIDTH=\"(\d+)\"/';$replacement[4] = ' '; $pattern[5] = '/HEIGHT=\"(\d+)\"/';$replacement[5] = ' '; // raz dimensions $content= preg_replace($pattern, $replacement, $content); $remplace=" width='100%' height='". $theMainImageHeight ."' "; // if (strstr($content,"charlie" )){ global $charlie; if(isset($charlie)){ // $theMainImageWidth= $charlie['video_default_width'] ; // $theMainImageHeight = $charlie['video_default_height']; } $content=str_replace( ""; } global $events; $hasContent=(empty($content) )?'false':'true'; if(empty($events)) $events= (object) ''; $events->ligne=151; $events->event +=1; $events->function="init_1"; $events->content=$hasContent; self::AfficheDebug(); return $content; }//init_1 /*********************/ static public function init($content,$element_info){ global $template,$user,$conf; global $version,$icon_path,$page,$picture; global $Css,$css_slideshow,$css_display,$liste_type; global $pictureSelType,$pictureDeriv,$pictureMap; global $warnings_message; global $set_miniature,$imgSizeWH; global $theContainerHeight,$theContainerWidth; global $theMainImageWidth,$theMainImageHeight ; global $theContainerLeft,$theContainerTop,$windowWidth,$windowHeight,$theMainImageSize; //======================================================= if(!realpath($element_info['path'])) return $content; $theme=$user['theme']; $Css = self::css($theme."-rules.css"); $css_slideshow=isset($Css['.Autosize']['slideshow'])?$Css['.Autosize']['slideshow']:"yes"; $css_display= isset($Css['.Autosize']['display'])?$Css['.Autosize']['display']:"block"; $default_size = $conf['derivative_default_size']; //===================================================================== $current = $template->get_template_vars('current'); //=== Zone affichage == if( !isset($_COOKIE['windowWidth'] ) || !isset($_COOKIE['windowHeight'] ) ){ return ; }else{ $windowWidth = $_COOKIE['windowWidth'] ; $windowHeight = $_COOKIE['windowHeight'] ; } //========================================================================================================= $theContainerMargeWidth = isset($_COOKIE['theContainerMargeWidth']) ? $_COOKIE['theContainerMargeWidth']:0; $theContainerMargeHeight = isset($_COOKIE['theContainerMargeHeight'])?$_COOKIE['theContainerMargeHeight']:0; $theContainerWidth = isset($_COOKIE['theContainerWidth'])?$_COOKIE['theContainerWidth']:$windowWidth-$theContainerMargeWidth; $theContainerHeight = isset($_COOKIE['theContainerHeight'])?$_COOKIE['theContainerHeight']:$windowHeight-$theContainerMargeHeight; $theContainerTop= isset($_COOKIE['theContainerTop'])?$_COOKIE['theContainerTop']:0; $theContainerLeft=isset($_COOKIE['theContainerLeft'])?$_COOKIE['theContainerLeft']:0; $theContainerRight=isset($_COOKIE['theContainerRight'])?$_COOKIE['theContainerRight']:$theContainerWidth; $theContainerBottom=isset($_COOKIE['theContainerBottom'])?$_COOKIE['theContainerBottom']:$theContainerHeight; $theMainImageWidth = isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']:$theContainerWidth; $theMainImageHeight = isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$theContainerHeight ; if (isset($element_info['is_gvideo']) && $element_info['is_gvideo'] ){ $pictureDeriv = $default_size; }else{ $retour = self::get_min_max() ; $theMainImageSize = $retour->get_size(); $theRealImageWidth = $theMainImageSize[0]; $theRealImageHeight = $theMainImageSize[1] ; if($theContainerHeight!=0 && $theContainerWidth!=0){ $pictureDeriv = $retour->type ; }else{ $pictureDeriv = $default_size; } } $hasContent=( empty($content) )?"false":'true'; self::save_cookies(); //=============================================================================== global $events ; $events->ligne=210; $events->event +=1; $events->function="INIT"; $events->content= $hasContent; self::AfficheDebug(); return $content; }//INIT /************************ * INIT 2 *************************/ static public function init2($content,$element_info){ global $template,$version,$icon_path,$page,$picture,$conf; global $user,$Css,$css_slideshow,$css_display,$liste_type; global $infos_message; //content = photo //===================================================================== global $has_pamoorama,$pictureSelType,$pictureDeriv; global $theContainerHeight,$theContainerWidth;$theContainerLeft; global $theContainerTop,$windowWidth,$windowHeight,$theMainImageSize; global $theMainImageWidth,$theMainImageHeight ; //===================================================================== if(!realpath($element_info['path'])) return $content; //-- si Autosize correction redim --------------- $current = $template->get_template_vars('current'); if (!isset($current)) return ; $has_pamoorama = isset($template->files['pamooramics_content'])?"true":"false"; $pattern = array();$replacement = array(); $hasContent=(empty($content) )?'false':"true"; if($hasContent=="true"){ if($has_pamoorama=="true"){ $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width: '. $theMainImageWidth .', ' ; if(($theContainerWidth!=0)){ $content= preg_replace($pattern, $replacement, $content,1 ); } }else if( preg_match("|\ " . $img_type ."
"; $SelType_image->type=$img_type; $SelType_image->url=$img_url; $SelType_image=$img_select; } if( $img_type=="Original" && $theImage_def==0 ){ $theImage_def +=1; $img_type = $last_derivative ; $img_url= $derivative->get_path(); $imgWH = $derivative->get_size(); $default_image->type=$img_type; $default_image->url=$img_url; $default_image=$img_select; } $test= ($imgWH[1] >= $theMainImageHeight); if($has_pamoorama!=true){ $test=( $imgWH[0] >= $theMainImageWidth) && $test; } //=================================================== if( $test==true ){ $theImage_maxi +=1; $maxi_image->type = $img_type; $img_type=$img_select->get_type(); if($img_type=="Original") $maxi_image = $last_image; else $maxi_image = $img_select; $maxi_image->url = $maxi_image->get_path(); } else { $mini_image->type=$img_type; $mini_image->url=$img_url; $mini_image = $img_select; $mini_image->url = $mini_image->get_path(); } if(preg_match("|get_infos|", $DEBUG_autosize, $val)){ if($test) $infos_message .=""; $infos_message .= " Maxi_Url :" . $maxi_image->url . " ImageUrl: $img_url " . " Mini_Url :" . $mini_image->url . $max_crop ." -> " . $img_type . "
" . print_r($imgWH,true). "
"; if ($test) $infos_message .="
"; } } // for //================================================ $img_url = $img_select->src_image->get_url(); $imgSizeWH = $img_select->src_image->get_size(); if(isset($liste_type["SelMaxi"])) die(); $liste_type["SelMaxi"] = "SelMaxi".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; $liste_type["Autosize"] = "Autosize".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; $liste_type["Original"] = "Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; $retour=(object)'' ; if ($pictureSelType=="Autosize") $retour = $maxi_image ; else if ($pictureSelType=="SelMaxi") $retour = $mini_image ; else{ $types = array_intersect(array_keys($liste_type), array($pictureSelType)); if(!count($types)){ $pictureSelType="Original"; } $retours = explode(",",$liste_type[$pictureSelType]); $retour = $SelType_image; $retour->type=$retours[0]; $retour->url=$retours[1]; } if (!isset( $retour->type)){ $retour=$last_image; $retour->type = $retour->get_type(); $retour->url = $retour->get_path(); } if (isset( $retour->type) && $retour->type=="Original" ){ $retour=$last_image; $retour->type = $last_derivative; $retour->url = $retour->get_path(); } if($nofile > 0){ $set_miniature=$No_files ; } if(preg_match("|get_minfos|", $DEBUG_autosize, $val)) $infos_message .= $pictureSelType . " -> " . $retour->type . " : " . $retour->url .cl_print_var($liste_type) . cl_print_var($retour->get_size()) . "
"; return $retour ; } //================================================================= static public function Get_Size($Img_Select){ global $max_crop; $imgWH = $Img_Select->get_size(); $img_type = $Img_Select->get_type(); if( $img_type =="Original") return ; $smaller = ImageStdParams::get_by_type($img_type); $max_crop=0; if($smaller->sizing->max_crop==1){ $imgWH =$smaller->sizing->min_size; $max_crop=1; } return $imgWH ; } //================================================================== static public function cl_autosize_nofile($img_all){ //=== verification fichiers absents === global $infos_message,$error_message; global $theContainerHeight,$theContainerWidth,$theContainerLeft,$theContainerTop,$windowWidth,$windowHeight,$theMainImageSize; global $pictureDeriv; $ok=false ; $nofiles=array(); $file_no=(object) ''; $nosrc=false ; $ok=true ; $listes=""; foreach ($img_all as $img_select){ $img_url = $img_select->get_url(); if(!file_exists(PHPWG_ROOT_PATH.$img_url)){ $img_type = $img_select->get_type(); $file_id=explode("?",$img_url); if(count($file_id) ==1){ $file_id[]=$file_id[0] ; } if ( !preg_match("|".$file_id[1]."|", $listes) ){ $listes .= $file_id[1] ."
"; $file_no->url= $file_id[1] ; $id = $img_select->src_image->id; $file_no->id=$id ; $file_no->type=$img_type ; array_push($nofiles,serialize($file_no)) ; if( $img_type == $pictureDeriv){ break ; } } $ok=false ; } } $exec_miniatures=""; if(count($nofiles)>0){ //======================================================================================= if($nosrc!=true ){ $script_miniatures = ""; $script_miniatures .= ""; $nosrc=true ; } $exec_miniatures =""; $script_miniatures .= "\n" ; $script_miniatures .= ""; //================================================================================== return $script_miniatures ; } } /*************************** * get_cookies ****************************/ static public function get_cookies(){ global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap,$conf,$autosize_parametres,$user; $userst = $user['status']."_enabled" ; $userst = $autosize_parametres-> $userst ; $usertype = $user['status']."_type" ; $default_size = $conf['derivative_default_size']; $usertype = $autosize_parametres->$usertype ; $pictureSelType =$default_size ; if($userst==$user['status']."_enabled" ){ }else{ if($usertype!="Autosize" && $usertype!="SelMaxi" ){ }else if($autosize_parametres->defaut_type=="off"){ $pictureSelType = pwg_get_session_var('picture_sel_type',"SelMaxi"); }else { $pictureSelType = pwg_get_session_var('picture_sel_type',"Autosize"); } } if(!isset($_COOKIE['picture_deriv'])){ $pictureDeriv = pwg_get_session_var('picture_deriv',$default_size); $pictureSelType = pwg_get_session_var('picture_sel_type',$pictureSelType); $pictureMap = pwg_get_session_var('picture_map') | $pictureDeriv; } $pictureDeriv = isset( $_COOKIE['picture_deriv']) ? $_COOKIE['picture_deriv']:$pictureDeriv; $pictureSelType = isset( $_COOKIE['picture_sel_type'])?$_COOKIE['picture_sel_type']:$pictureSelType; $pictureMap = isset($_COOKIE['picture_map'])?$_COOKIE['picture_map']:$pictureDeriv; self::save_cookies(); if( !isset($_COOKIE['picture_deriv'] )) unset($_COOKIE['autosize_reload']); if (!isset($_COOKIE['autosize_reload']) ) self::reload("#1044"); } /*************************** * save_cookies ****************************/ static public function save_cookies(){ global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap; pwg_set_session_var('picture_deriv', $pictureDeriv); pwg_set_session_var('picture_sel_type',$pictureSelType); pwg_set_session_var('picture_map', $pictureDeriv); //============================================================ setcookie( 'picture_sel_type', $pictureSelType, time()+10, cookie_path() ); //============================================================= setcookie( 'picture_map', $pictureDeriv, time()+10, cookie_path() ); //============================================================ setcookie( 'picture_deriv', $pictureDeriv, time()+10, cookie_path() ); $_COOKIE['picture_sel_type'] = $pictureSelType; $_COOKIE['picture_deriv'] = $pictureDeriv; $_COOKIE['picture_map'] = $pictureDeriv; } //========================================================= static function AfficheDebug(){ global $DEBUG_autosize,$infos_message,$error_message,$events,$autosize_parametres; global $theContainerWidth, $theContainerHeight ,$theMainImageWidth,$theMainImageHeight ; if(empty($events)) $events= (object) ''; if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ; //$infos_message .= cl_print_var($events) ; if($events->event==2){ if(preg_match("|help|", $DEBUG_autosize, $val)){ $infos_message .= "HELP
"; $infos_message .="get_infos
"; $infos_message .="event
"; $infos_message .="cookies_x
"; $infos_message .="session_x
"; $infos_message .="theMainImage_x -> theMainImage size
"; $infos_message .="c1_x -> theContainer size
"; $infos_message .="test_x -> GET,POST,SERVER
"; $infos_message .="noresize
"; $infos_message .="newreload
"; $infos_message .="parametres
"; $infos_message .="end_x -> Fin
"; $infos_message .= "
"; } if(preg_match("|cookies|", $DEBUG_autosize, $val) && !preg_match("|cookies_|", $DEBUG_autosize, $val) ) $infos_message .= "COOKIE:$events->function[$events->event]" . cl_print_var($_COOKIE) ; if(preg_match("|newreload|", $DEBUG_autosize, $val)) { unset($_COOKIE['autosize_reload']); return ; } if(preg_match("|parametres|", $DEBUG_autosize, $val)) $infos_message .= "$events->function[$events->event]" . cl_print_var($autosize_parametres); } if(preg_match("|event|", $DEBUG_autosize, $val)){ $infos_message .= "$events->function [$events->event] $events->content, " ; } if(preg_match("|cookies_$events->event|", $DEBUG_autosize, $val)) $infos_message .= "COOKIE:$events->function[$events->event]" . cl_print_var($_COOKIE) ; if(preg_match("|session_$events->event|", $DEBUG_autosize, $val)) $infos_message .= "SESSION:" . cl_print_var($_SESSION) ; if(preg_match("|theMainImage_$events->event|", $DEBUG_autosize, $val)) { $infos_message .= "theMainImage:".$theMainImageWidth."x".$theMainImageHeight; } if(preg_match("|c1_$events->event|", $DEBUG_autosize, $val)) { $infos_message .="theContainerWidth Infos: " . $theContainerWidth . " x " . $theContainerHeight . " I1: " . $theMainImageWidth ." x ".$theMainImageHeight ; } if(preg_match("|test_$events->event|", $DEBUG_autosize, $val)) { $infos_message .= "$events->function:
"; $infos_message .= "GET:" . cl_print_var($_GET) ; $infos_message .= "POST:" . cl_print_var($_POST) ; $infos_message .= "SERVER:" . cl_print_var($_SERVER["HTTP_HOST"]) ; } if(preg_match("|end_$events->function|", $DEBUG_autosize, $val)) { self::Fin_php("#1099: " . $DEBUG_autosize); } } //========================================================= static public function Fin_php($message_,$reload = true ){ global $infos_message; echo $infos_message."
"; die("End :".$message_."
"); } //================================================== } // class /************************************* * *************************************/ function cl_autosize_Get_Options() { global $conf,$autosize_parametres; $autosize_parametres =""; if (!isset($conf['cl_autosize'])) { $conf['cl_autosize']=""; $q = ' INSERT INTO '.CONFIG_TABLE.' (param, value, comment) VALUES ("cl_autosize","","Parametres du plugin Autosize") ;'; pwg_query($q); } $autosize_parametres = unserialize($conf['cl_autosize']); // $autosize_parametres = self::Get_Options($autosize_parametres,'cl_autosize'); $autosize_parametres = cl_autosize_Set_Options(); return $autosize_parametres; } /* * */ function cl_autosize_Set_Options() { global $autosize_parametres; //============================================================================= $my_para=$autosize_parametres; if (empty($my_para)) $my_para = (object) ''; $my_para->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($my_para->query )) ? $my_para->query : 'Qt' ) ; $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type: 'Ty') ; $my_para->webmaster_type =(isset($_POST['webmaster_type'])) ? $_POST['webmaster_type'] : ((isset($my_para->webmaster_type )) ? $my_para->webmaster_type : 'Autosize' ) ; $my_para->admin_type =(isset($_POST['admin_type'])) ? $_POST['admin_type'] : ((isset($my_para->admin_type )) ? $my_para->admin_type : 'Autosize' ) ; $my_para->generic_type =(isset($_POST['generic_type'])) ? $_POST['generic_type'] : ((isset($my_para->generic_type )) ? $my_para->generic_type : 'Autosize' ) ; $my_para->guest_type =(isset($_POST['guest_type'])) ? $_POST['guest_type'] : ((isset($my_para->guest_type )) ? $my_para->guest_type : 'Autosize' ) ; $my_para->normal_type =(isset($_POST['normal_type'])) ? $_POST['normal_type'] : ((isset($my_para->normal_type )) ? $my_para->normal_type : 'Autosize' ) ; $my_para->mini_height =(isset($_POST['mini_height'])) ? $_POST['mini_height'] : ((isset($my_para->mini_height )) ? $my_para->mini_height : '150' ) ; $my_para->mini_width=(isset($_POST['mini_width']))? $_POST['mini_width']: ((isset($my_para->mini_width)) ? $my_para->mini_width: '300') ; $my_para->mini_height2 =(isset($_POST['mini_height2'])) ? $_POST['mini_height2'] : ((isset($my_para->mini_height2 )) ? $my_para->mini_height2 : '150' ) ; $my_para->mini_width2=(isset($_POST['mini_width2']))? $_POST['mini_width2']: ((isset($my_para->mini_width2)) ? $my_para->mini_width2: '300') ; $my_para->echelle_max=(isset($_POST['echelle_max']))? $_POST['echelle_max'] : ((isset($my_para->echelle_max)) ? $my_para->echelle_max : '1.0'); $my_para->marge_basse=(isset($_POST['marge_basse']))? $_POST['marge_basse']: ((isset($my_para->marge_basse)) ? $my_para->marge_basse : '0'); $my_para->fade_in=(isset($_POST['fade_in']))? $_POST['fade_in']: ((isset($my_para->fade_in)) ? $my_para->fade_in : '0'); //=============================================================================== if ( isset($_POST['submit'] ) && $_POST['submit'] == l10n('cl_autosize_save') ) { $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ; $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : "off" ; $my_para->defaut_type= isset($_POST['defaut_type']) ? $_POST['defaut_type'] : "off" ; $my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : "off" ; $my_para->admin_enabled = isset($_POST['admin_enabled']) ? $_POST['admin_enabled'] : "off" ; $my_para->generic_enabled = isset($_POST['generic_enabled']) ? $_POST['generic_enabled'] : "off" ; $my_para->guest_enabled = isset($_POST['guest_enabled']) ? $_POST['guest_enabled'] : "off" ; $my_para->normal_enabled = isset($_POST['normal_enabled']) ? $_POST['normal_enabled'] : "off" ; }else{ $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v : 'off') ; $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : ( ( isset($my_para->check_icon_v) ) ? $my_para->check_icon_v : 'off') ; $my_para->defaut_type = isset($_POST['defaut_type']) ? $_POST['defaut_type'] : ( ( isset($my_para->defaut_type) ) ? $my_para->defaut_type : 'off') ; $my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : ( ( isset($my_para->webmaster_enabled) ) ? $my_para->webmaster_enabled : 'on') ; $my_para->admin_enabled = isset($_POST['admin_enabled ']) ? $_POST['admin_enabled '] : ( ( isset($my_para->admin_enabled ) ) ? $my_para->admin_enabled : 'on') ; $my_para->generic_enabled = isset($_POST['generic_enabled']) ? $_POST['generic_enabled'] : ( ( isset($my_para->generic_enabled) ) ? $my_para->generic_enabled : 'on') ; $my_para->guest_enabled = isset($_POST['guest_enabled']) ? $_POST['guest_enabled'] : ( ( isset($my_para->guest_enabled) ) ? $my_para->guest_enabled : 'on') ; $my_para->normal_enabled = isset($_POST['normal_enabled']) ? $_POST['normal_enabled'] : ( ( isset($my_para->normal_enabled) ) ? $my_para->normal_enabled : 'on') ; } return $my_para; } /* * */ function cl_autosize_sauve_options_inf() { global $options,$infos_message,$conf,$autosize_parametres ; $infos_message .=l10n("cl_autosize_save_config")."
"; $autosize_parametres=cl_autosize_Set_Options(); if ( isset($autosize_parametres) ) { $query = ' UPDATE '.CONFIG_TABLE.' SET value="'.addslashes(serialize($autosize_parametres)).'" WHERE param = "cl_autosize" LIMIT 1'; pwg_query($query); } if (!isset($conf['cl_derivatives_sav'])) { $q = ' INSERT INTO '.CONFIG_TABLE.' (param, value, comment) VALUES ("cl_derivatives_sav","","sauvegarde derivatives") ;'; pwg_query($q); } } /************************* * *************************/ if(!function_exists("cl_print_var")){ function cl_print_var($variables){ ob_start(); echo '
';
		print_r($variables);
		echo '
'; $m= ob_get_contents(); ob_end_clean(); return $m; } } /****************** * ******************/ if(!function_exists("cl_aff_infos_plus")){ function cl_aff_infos_plus() { global $template,$infos_message,$error_message,$warnings_message, $user ; global $conf,$lang,$page ; //============================================================== if (isset($error_message)) { if ($error_message <> ""){ $error_message=str_replace("\n",'
',$error_message) ; $template->assign('errors',$error_message); $error_message=""; } } //============================================================== if (isset($warnings_message)) { if ($warnings_message <> ""){ $warnings_message=str_replace("\n",'
',$warnings_message) ; $template->assign('warnings',$warnings_message); $warnings_message=""; } } //============================================= if (isset($infos_message)){ if ($infos_message <> ""){ $infos_message=str_replace("\n",'
',$infos_message) ; $template->assign('infos',$infos_message); $infos_message=""; } } //============================================================= return; } // function cl_autosize_aff_infos_plus //=============================================================== } ?>