add( 'admin', l10n('admin'), $my_base_url.'&tab=admin' ); $tabsheet->add( 'texture', l10n('texture'), $my_base_url.'&tab=texture' ); $tabsheet->add( 'test', l10n('test'), $my_base_url.'&tab=test' ); if (!isset($_GET['tab'])) $page['tab'] = 'admin'; else $page['tab'] = $_GET['tab']; $tabsheet->select($page['tab']); $tabsheet->assign(); /************************* * *************************/ 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 (isset($_POST['submit'])){ $val_id=$_POST['submit']; $save_options=true ; } if (isset($_POST['compiled-templates']) ){ $template->delete_compiled_templates(); $FileCombiner = new FileCombiner("tpl") ; $FileCombiner::clear_combined_files(); array_push($page['infos'],l10n('parent') . ":" . $_POST['compiled-templates']); // array_push($page['infos'], l10n('delete_compiled')); $parent=$_POST['compiled-templates']; $save_options=true ; } for($id=0;$id<$nb_template;$id++){ if (!isset($params["chk_cuise_$id"])){ $_POST['default']=true ; } } $id=0; $name_tpl = array("fondBG","fondBp","Menu_bar","thumbnail","Header" ); $params = array_merge(unserialize($conf['cuise'])); if (isset($_POST['default']) || !isset($params['chk_cuise_0']) ){ $params['parent']= $parent ; $params['theme']= 'cuise' ; $name_img=array("cbmt.gif","bpv.png","bp3.jpg","bph.png","header.png"); for($id=0;$id<$nb_template;$id++){ $params = array_merge($params,array( "bg_cuise_$id" => '#d4d4d4', "bgho_cuise_$id" => '#A0A0A0', "bd_cuise_$id" => '#4F4F4F', "bdho_cuise_$id" => '#4F4F4F', "bd_width_cuise_$id" => '0px', "co_cuise_$id" => '#4F4F4F', "coho_cuise_$id" => '#5f5f5f', "img_cuise_$id" => $name_img[$id], "chk_cuise_x_$id" => 'checked', "chk_cuise_y_$id" => '', "rayon_cuise_$id" => '8px', "chk_cuise_$id" => '' )); } $id=0; // array_push($page['warnings'], cl_print_var($params)); $save_options=true ; } if ($save_options==true) { // array_push($page['warnings'], print_r($_POST,true)); $i="0"; $New_params=array(); $j=$i; for($i=0;$i<$nb_template;$i++){ if( isset($_POST["bg_cuise_$i"]) ) { $img_src= (isset($_POST["img_cuise_$i"])&&$_POST["img_cuise_$i"]!="")?$_POST["img_cuise_$i"]:$params["img_cuise_$i"] ; $New_params = array( "bg_cuise_$i" => isset($_POST["bg_cuise_$i"])?$_POST["bg_cuise_$i"]:$params["bg_cuise_$i"], "bgho_cuise_$i" => isset($_POST["bgho_cuise_$i"])?$_POST["bgho_cuise_$i"]:$params["bgho_cuise_$i"], "bd_cuise_$i" => isset($_POST["bd_cuise_$i"])?$_POST["bd_cuise_$i"]:$params["bd_cuise_$i"], "bdho_cuise_$id" => isset($_POST["bdho_cuise_$i"])?$_POST["bdho_cuise_$i"]:$params["bdho_cuise_$i"], "bd_width_cuise_$id" => isset($_POST["bd_width_cuise_$i"])?$_POST["bd_width_cuise_$i"]:$params["bd_width_cuise_$i"], "co_cuise_$i" => isset($_POST["co_cuise_$i"])?$_POST["co_cuise_$i"]:$params["co_cuise_$i"], "coho_cuise_$i" => isset($_POST["coho_cuise_$i"])?$_POST["coho_cuise_$i"]:$params["coho_cuise_$i"], "img_cuise_$i" =>$img_src, "rayon_cuise_$i" => isset($_POST["rayon_cuise_$i"])?$_POST["rayon_cuise_$i"]:$params["rayon_cuise_$i"], "chk_cuise_$i" => isset($_POST["chk_cuise_$i"])?"checked":"no", "chk_cuise_x_$i" => isset($_POST["chk_cuise_x_$i"])?"checked":"no", "chk_cuise_y_$i" => isset($_POST["chk_cuise_y_$i"])?"checked":"no", ); $id=$i; break; } } $i=$j; $params = array_merge($params,$New_params ,array('parent' => $parent, "theme" => PHPWG_THEMES_PATH.$themeconf['name']."/" )); // conf_update_param('cuise', pwg_db_real_escape_string(serialize($params))); array_push($page['infos'], l10n('Your configuration settings are saved')); load_conf_from_db(); $params = array_merge(unserialize($conf['cuise'])); $keys=$params; } // array_push($page['warnings'], print_r($parent,true) ); // array_push($page['warnings'], print_r($params,true)); $params = array_merge(unserialize($conf['cuise'])); if(isset($val_id)){ $ids = explode("_",$val_id) ; $id= ( isset($ids[1]) ) ? $ids[1] :0; } $id= isset( $_POST["sel_tab"] ) ? $_POST["sel_tab"]: $id; if(!isset($id)) $id=0; //============================================== // $list_themes = get_list_dirs("themes"); get_list_theme(); $arguments=""; foreach ($params as $key => $value) { $value = str_replace("#", "_", $value); $arguments .= "$key=$value&"; } $arguments .="redraw=ok"; $template->assign(array( 'THEME_CUISE_ABS' => realpath(PHPWG_THEMES_PATH.'cuise/admin/'), 'root' => PHPWG_ROOT_PATH, 'theme' => PHPWG_THEME_PATH, "classeRoot" => PHPWG_THEMES_PATH.'cuise/admin/classes/' , 'parent' => $parent, 'nb_template' => $nb_template, 'ind' => $id, 'name_tpl' => $name_tpl, 'selected_bg_cuise' => $params['bg_cuise_'.$id], 'selected_bgho_cuise' => $params['bgho_cuise_'.$id], 'selected_bd_cuise' => $params['bd_cuise_'.$id], 'selected_bdho_cuise' => $params['bdho_cuise_'.$id], 'selected_bd_width_cuise' => $params['bd_width_cuise_'.$id], 'selected_co_cuise' => $params['co_cuise_'.$id], 'selected_coho_cuise' => $params['coho_cuise_'.$id], 'selected_img_cuise' => $params['img_cuise_'.$id], 'selected_rayon_cuise' => $params['rayon_cuise_'.$id], 'selected_chk_x_cuise' => ($params['chk_cuise_x_'.$id]=="checked")?"checked":"", 'selected_chk_y_cuise' => ($params['chk_cuise_y_'.$id]=="checked")?"checked":"", 'selected_chk_cuise' => ($params['chk_cuise_'.$id]=="checked")?"checked":"", 'params' => $arguments )); //=============================================== if (isset($_GET['hlp'])){ global $BGIMGcss, $BGcolcss; if ($_GET['hlp']=="1") $theme_css= "themes/".$themeconf['name']."/theme.css.css"; else if ($_GET['hlp']=="2") $theme_css= "themes/".$themeconf['parent']."/theme.css"; else if ($_GET['hlp']=="3") $theme_css= "themes/".$themeconf['name']."/theme.css.php"; else { $path="themes/".$themeconf['name']."/"; $theme_css=$path."theme.css.php"; if(!file_exists($theme_css)){ $theme_css=$path."css/style.css"; if(!file_exists($theme_css)){ $theme_css=$path."css/theme.css"; if(!file_exists($theme_css)){ $theme_css=$path."style.css"; if(!file_exists($theme_css)){ $theme_css=$path."theme.css"; } } } } } $arguments = $conf['cuise']; $Css =css($theme_css); $message =$theme_css."