Changeset 19990 for extensions/cuise/admin/admin.inc.php
- Timestamp:
- Jan 8, 2013, 12:46:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/cuise/admin/admin.inc.php
r19486 r19990 36 36 ); 37 37 38 38 $tabsheet->add( 'test', 39 l10n('test'), 40 $my_base_url.'&tab=test' 41 ); 39 42 40 43 if (!isset($_GET['tab'])) … … 69 72 $FileCombiner = new FileCombiner("tpl") ; 70 73 $FileCombiner::clear_combined_files(); 71 //array_push($page['infos'],l10n('parent') . ":" . $_POST['compiled-templates']);72 array_push($page['infos'], l10n('delete_compiled'));74 array_push($page['infos'],l10n('parent') . ":" . $_POST['compiled-templates']); 75 // array_push($page['infos'], l10n('delete_compiled')); 73 76 $parent=$_POST['compiled-templates']; 74 77 $save_options=true ; … … 80 83 } 81 84 $id=0; 82 83 85 $name_tpl = array("fondBG","fondBp","Menu_bar","thumbnail","Header" ); 86 $params = array_merge(unserialize($conf['cuise'])); 84 87 if (isset($_POST['default']) || !isset($params['chk_cuise_0']) ){ 85 88 86 89 $params['parent']= $parent ; 87 90 $params['theme']= 'cuise' ; 88 $name =array("cbmt.gif","bpv.png","bp3.jpg","bph.png","header.png");91 $name_img=array("cbmt.gif","bpv.png","bp3.jpg","bph.png","header.png"); 89 92 for($id=0;$id<$nb_template;$id++){ 90 $params = array_merge($params,array( 91 "bg_cuise_$id" => '#FFA800', 92 "bgho_cuise_$id" => '#0072FF', 93 "bd_cuise_$id" => '#4F4F4F', 94 "co_cuise_$id" => '#4F4F4F', 95 "coho_cuise_$id" => '#F4F4F4', 96 "img_cuise_$id" => $name[$id], 97 "rayon_cuise_$id" => '8px', 98 "chk_cuise_$id" => '', 99 "chk_cuise_x_$id" => '', 100 "chk_cuise_y_$id" => '', 93 $params = array_merge($params,array( 94 "bg_cuise_$id" => '#d4d4d4', 95 "bgho_cuise_$id" => '#A0A0A0', 96 "bd_cuise_$id" => '#4F4F4F', 97 "bdho_cuise_$id" => '#4F4F4F', 98 "bd_width_cuise_$id" => '0px', 99 "co_cuise_$id" => '#4F4F4F', 100 "coho_cuise_$id" => '#5f5f5f', 101 "img_cuise_$id" => $name_img[$id], 102 "chk_cuise_x_$id" => 'checked', 103 "chk_cuise_y_$id" => '', 104 "rayon_cuise_$id" => '8px', 105 "chk_cuise_$id" => '' 101 106 102 107 )); 103 108 } 104 109 $id=0; 105 array_push($page['warnings'], cl_print_var($params));110 // array_push($page['warnings'], cl_print_var($params)); 106 111 $save_options=true ; 107 112 108 113 } 109 $params = array_merge(unserialize($conf['cuise']));110 111 112 114 if ($save_options==true) { 115 // array_push($page['warnings'], print_r($_POST,true)); 113 116 $i="0"; 114 117 $New_params=array(); … … 123 126 "bgho_cuise_$i" => isset($_POST["bgho_cuise_$i"])?$_POST["bgho_cuise_$i"]:$params["bgho_cuise_$i"], 124 127 "bd_cuise_$i" => isset($_POST["bd_cuise_$i"])?$_POST["bd_cuise_$i"]:$params["bd_cuise_$i"], 128 "bdho_cuise_$id" => isset($_POST["bdho_cuise_$i"])?$_POST["bdho_cuise_$i"]:$params["bdho_cuise_$i"], 129 "bd_width_cuise_$id" => isset($_POST["bd_width_cuise_$i"])?$_POST["bd_width_cuise_$i"]:$params["bd_width_cuise_$i"], 125 130 "co_cuise_$i" => isset($_POST["co_cuise_$i"])?$_POST["co_cuise_$i"]:$params["co_cuise_$i"], 126 131 "coho_cuise_$i" => isset($_POST["coho_cuise_$i"])?$_POST["coho_cuise_$i"]:$params["coho_cuise_$i"], 127 132 "img_cuise_$i" =>$img_src, 128 133 "rayon_cuise_$i" => isset($_POST["rayon_cuise_$i"])?$_POST["rayon_cuise_$i"]:$params["rayon_cuise_$i"], 129 "chk_cuise_$i" => isset($_POST["chk_cuise_$i"])?"checked":"no",134 "chk_cuise_$i" => isset($_POST["chk_cuise_$i"])?"checked":"no", 130 135 "chk_cuise_x_$i" => isset($_POST["chk_cuise_x_$i"])?"checked":"no", 131 136 "chk_cuise_y_$i" => isset($_POST["chk_cuise_y_$i"])?"checked":"no", … … 141 146 )); 142 147 143 // array_push($page['warnings'], print_r($params,true));148 // 144 149 conf_update_param('cuise', pwg_db_real_escape_string(serialize($params))); 145 150 array_push($page['infos'], l10n('Your configuration settings are saved')); … … 154 159 $params = array_merge(unserialize($conf['cuise'])); 155 160 156 $name_tpl = array("fondBG","fondBp","fondHoriz","fondVert","Header" ); 161 157 162 158 163 … … 169 174 170 175 get_list_theme(); 171 172 176 $arguments=""; 177 foreach ($params as $key => $value) { 178 $value = str_replace("#", "_", $value); 179 180 $arguments .= "$key=$value&"; 181 } 182 $arguments .="redraw=ok"; 173 183 $template->assign(array( 174 'root' => PHPWG_ROOT_PATH, 175 'theme' => PHPWG_THEME_PATH, 176 "classeRoot" => PHPWG_THEMES_PATH.'cuise/admin/classes/' , 177 'parent' => $parent, 184 'THEME_CUISE_ABS' => realpath(PHPWG_THEMES_PATH.'cuise/admin/'), 185 'root' => PHPWG_ROOT_PATH, 186 'theme' => PHPWG_THEME_PATH, 187 "classeRoot" => PHPWG_THEMES_PATH.'cuise/admin/classes/' , 188 'parent' => $parent, 178 189 179 'nb_template' => $nb_template,180 'ind' => $id,181 'name_tpl' => $name_tpl,190 'nb_template' => $nb_template, 191 'ind' => $id, 192 'name_tpl' => $name_tpl, 182 193 'selected_bg_cuise' => $params['bg_cuise_'.$id], 183 'selected_bgho_cuise' 194 'selected_bgho_cuise' => $params['bgho_cuise_'.$id], 184 195 'selected_bd_cuise' => $params['bd_cuise_'.$id], 185 'selected_co_cuise' => $params['co_cuise_'.$id], 196 'selected_bdho_cuise' => $params['bdho_cuise_'.$id], 197 'selected_bd_width_cuise' => $params['bd_width_cuise_'.$id], 198 199 'selected_co_cuise' => $params['co_cuise_'.$id], 186 200 'selected_coho_cuise' => $params['coho_cuise_'.$id], 187 201 'selected_img_cuise' => $params['img_cuise_'.$id], 188 'selected_x_cuise' => $params['chk_cuise_x_'.$id],189 'selected_y_cuise' => $params['chk_cuise_y_'.$id], 190 'selected_ rayon_cuise' => $params['rayon_cuise_'.$id],191 202 'selected_rayon_cuise' => $params['rayon_cuise_'.$id], 203 204 'selected_chk_x_cuise' => ($params['chk_cuise_x_'.$id]=="checked")?"checked":"", 205 'selected_chk_y_cuise' => ($params['chk_cuise_y_'.$id]=="checked")?"checked":"", 192 206 'selected_chk_cuise' => ($params['chk_cuise_'.$id]=="checked")?"checked":"", 193 'params' => pwg_db_real_escape_string(serialize($params)),207 'params' => $arguments 194 208 195 209 )); … … 222 236 } 223 237 $arguments = $conf['cuise']; 224 238 225 239 $Css =css($theme_css); 226 240 227 241 $message =$theme_css."<br>"; 228 //$message .= cl_print_var($Css)."<br>";242 $message .= cl_print_var($Css)."<br>"; 229 243 //$message .= cl_print_var($BGIMGcss)."<br>"; 230 $message .= cl_print_var($BGcolcss)."<br>";244 //$message .= cl_print_var($BGcolcss)."<br>"; 231 245 232 246 array_push($page['infos'], $message); … … 244 258 $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); 245 259 break ; 246 260 case 'test': 261 $template->set_filenames(array('theme_admin_content' => dirname(__FILE__) . '/cuise_test.tpl')); 262 $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); 263 break ; 247 264 } 248 265 … … 279 296 $replace = array('}|' ,'' ,'' ,'' ,'' ,'' ); 280 297 $string = preg_replace($order, $replace,$string); 281 echo ($string)."<br>";298 282 299 // $string = preg_replace('#/\*.*?\*/#s',"",$string); 283 300 return $string; … … 285 302 286 303 $ret = file_get_contents ($mycssfile); 287 echo $ret;304 // echo $ret; 288 305 289 306 $string= remove_comments( $ret); 290 echo ($string);307 // echo ($string); 291 308 292 309 $newstr = explode('|',$ret); … … 305 322 306 323 if($value){ 307 echo $value."<br>"; 324 308 325 $css2=Array(); 309 326 $key = explode("{",$value); … … 327 344 if(preg_match("/url/",$key2[1])){ 328 345 $head = preg_replace("#(.*)url.(.*?)\)(.*)#is", '$2', $key2[1]); 329 echo $head." ".$key2[0]." ".$key_id."<br>";346 330 347 $BGIMGcss[$head]=array_merge(array( 331 348 "head" => $head, … … 336 353 }elseif(preg_match("/(color)/",$key2[0])){ 337 354 $head = preg_replace("#(.*)color.(.*?);(.*)#is", '$2', $key2[1]); 338 echo $head." ".$key2[0]." ".$key_id."<br>";355 339 356 340 357 $BGcolcss[$head]=array_merge(array( … … 355 372 } 356 373 } 357 echo cl_print_var($css); 358 die(); 374 359 375 return $css; 360 376 }
Note: See TracChangeset
for help on using the changeset viewer.