<?php
$p="<p>%1\$s</p>"; $format="<tr><td>%1\$s</td><td>%2\$s</td><td>%3\$s</td></tr>\n";
$format_ajax="<script type='text/javascript'> upload_ajax('%1\$s','%2\$s','%3\$s','%4\$s'); </script>";
$format_ajax_inline="upload_ajax('%1\$s','%2\$s','%3\$s','%4\$s','%5\$s');";
//  Couche JS Non intrusif pour oblige a enregistrer la pags si click ailleurs que dans element centraux form
array_push($js_lib, "add_click_onload"); array_push($function_js_init, "add_click_onload('menu','navi');");
?>

	<div id="gauche">
		<div id="block_sommaire_gauche" class="a_box">
		 	<h2><?php echo DOCUMENTS_EXISTANT ?></h2>
			 <div id="navi_jax"><?php echo NewFct('liste_navi',$_PX_config,$file_conf, "edit_config.php","");	?></div>
		</div>
	</div>
	<div id="article">
		<div id="menu_inter" class="menu3"><nobr>
		<p style='float:right;'><?php
			 if ( (defined('BO_MOD_BACKUP'))AND (_USER_PERSO__GRP<=2) ){
			## Si Module present
			 print "<a href='#' Onclick=\""
				."montre('form_ajax');montre('backgd'); upload_ajax('form_ajax_txt','include/modules/backup/functions.inc',' zip_complet','',''); add_close('edit_config.php','Close', '' )"
			  ."\" >".BT_ZIPCOMPLET."</a>";
			 print "<a href='#' Onclick=\""
				."montre('form_ajax');montre('backgd'); upload_ajax('form_ajax_txt','include/modules/backup/functions.inc',' zip_config','',''); add_close('edit_config.php','Close', '' )"
			  ."\" >".BT_ZIPCONFIG."</a>";
			 print "<a href='#' Onclick=\""
				."montre('form_ajax');montre('backgd'); upload_ajax('form_ajax_txt','include/modules/backup/functions.inc',' zip_data','',''); add_close('edit_config.php','Close', '' )"
			  ."\" >".BT_ZIPDATA."</a>";
			 }; ?></p>
	</nobr></div>
		<div id="contenu_article">
			<div class="i_box">
					<h1><?php echo FORMULAIRE_DE_MODIFICATION_DE_PAGE; ?></h1>
				</div>
			<?php if (!isset($_GET['file'])) :
				printf ('<div class="a_box"> '.$p.'</div>', AFF_NOT_FILE_SELECTED );
				?>
			 <div id='rep_tmp' class="a_box"><?php
				print "<h2>".LES_FOLDER_TMP."</h2><br />";
				print "<table>\n<tbody>\n"
					."<tr><th>".TABLE_SSTITRE_REP."</th><th>".TABLE_SSTITRE_DETAIL."</th><th>".TABLE_SSTITRE_ACTION."</th></tr>";
				printf($format,"Revision","<p id='supp_rev_tot'>".SIZE .recursive_calcul(ADD_PATH_ADMIN.REP_DATA."bak/",true)." Ko </p>", tep_links('', 'edit_config.php?conf=supp_rev_tot','',VIDER_REP_REVISIONS, false,'', '',ajax_action_spe ('include/inc/advRmDir.inc','advRmDir', "\'".ADD_PATH_ADMIN.REP_DATA."bak/\'", "Revision suppprimés", "supp_rev_tot").Toolip(VIDER_REP_REVISIONS_D)));
				printf($format,"Cache","<p id='vid_cach'>".SIZE .recursive_calcul(ADD_PATH_ADMIN."cache/",true)." Ko</p>", tep_links('', 'edit_config.php?conf=vid_cach','',VIDER_CACHE_PUBLIC, false,'', '',ajax_action_spe ('include/inc/advRmDir.inc','advRmDir', "\'".ADD_PATH_ADMIN."cache/\'", "Revision suppprimés", 'vid_cach').Toolip(VIDER_CACHE_PUBLIC_D)) );
				printf($format,"Cache admin","<p id='vid_cach'>"."<p id='vid_cach_admin'>".SIZE .recursive_calcul("cache/",true)." Ko</p>", tep_links('', 'edit_config.php?conf=vid_cach_admin','',VIDER_CACHE_ADMIN, false,'', '',ajax_action_spe ('include/inc/advRmDir.inc','advRmDir', "\'cache/\'", "Revision suppprimés" ,'vid_cach_admin').Toolip(VIDER_CACHE_ADMIN_D)) );
				printf($format,"minitures","<p id='vid_cach'>".SIZE .recursive_calcul(ADD_PATH_ADMIN.REP_IMG."thumb/",true)." Ko</p>", tep_links('', 'edit_config.php?conf=supp_thumb_img','',VIDER_THUMB_IMG, false,'', '',ajax_action_spe ('include/inc/advRmDir.inc','advRmDir', "\'".ADD_PATH_ADMIN.REP_IMG."thumb/\'", "miniature suppprimés","supp_thumb_img").Toolip(VIDER_THUMB_IMG_D)) );
				print "</tbody>\n</table>\n<br />"; ?>
			</div>
			<?php endif; ?>

			<br />
			  <?php   if (!empty($_GET)) { // prise en charge php action boutons
				  	if (isset($_GET['conf'])){
						switch($_GET['conf']){
						case 'supp_rev_tot': $rep=ADD_PATH_ADMIN.REP_DATA."bak/"; break;
						case 'supp_thumb_img': $rep=ADD_PATH_ADMIN.REP_IMG."thumb/"; break;
						case 'vid_cach_admin': $rep="cache/"; break;
						case 'vid_cach_admin': $rep=ADD_PATH_ADMIN."cache/"; break;
						}
						print NewFct('advRmDir',$rep);
					}
				  }

				  if (isset($_GET['file'])) {
				  ?>
				  <div id="file_jax" class="a_box">
					 <h2><?php echo EDITION_DU_FICHIER.'&nbsp;'.$_GET['file'] ?></h2>
					<p><a href="#" onclick="<?php  printf("upload_ajax('%1\$s','%2\$s','%3\$s','%4\$s');",'file_jax','include/inc/edit_file_mini.inc','edit_file_mini'," \'edit_config.php\',\'".$_GET['file']."\',\'false\',\'\'"); ?>">MODE EXPERT</a></p><br />
				 <?php
				        if ( (!empty($_POST['preview'])) OR (!empty($_POST['confirm'])) ){
				       	 if(isset($_POST['file_tbl_php_form'])||isset($_GET['file_tbl_php_form'])){
						## prise en charge par class
						$class=new file_tbl_php($_GET['file'],'');
					 	$class->up_file($_POST);
					 } elseif (isset($_POST['message'])) {
						 Newfct('op_files',$_GET['file'],'',"ADD",$_POST['message'],"" );
					 }
					}
					$class=new file_tbl_php($_GET['file'],'');
					$class->var_form('','edit_config.php','file='.$_GET['file'],'','');
					$class->edit_file();
				}?>
				</div>

			</div>
		</div>
	</div> <!-- Fin de articles -->