<?php
// list tous les articles et formulaire sauf bak et formualire
function list_site_links_interne($form=true,$bak=false,$type_s=false,$id='url1',$img=false,$js=''){
	static $s;
	define('BAK', $bak);
	if (!function_exists('list_file')) {
	function list_file($dir){
		$di = (empty($dir)) ? ADD_PATH_ADMIN.REP_DATA : $dir ;
		$s='';
		$nom=NewFct('cstr_liste',$di,"") ;
		if (is_array($nom))while ( $rows =each($nom)){
			$r=eregi_replace("([.][a-z]{3})","",$rows['value']);

			if  (is_dir(ADD_PATH_ADMIN.REP_DATA.str_replace("\.\./".REP_DATA,'',$di)."/".$rows['value'])) {
				if ( ($rows['value'] !='bak') OR (($rows['value'] =='bak') AND (BAK)) ) {
					$s .=sprintf("  <option value='".eregi_replace("(\.\.\/|".REP_DATA."|\/[a-z]{2}\/)",'',$di."/")."%1\$s' >(".str_replace(ADD_PATH_ADMIN.REP_DATA,'',$di).") ".TXT_RUB_BASE." %2\$s</option>  \n", $r, $r);
					$s .=list_file(ADD_PATH_ADMIN.REP_DATA.str_replace(ADD_PATH_ADMIN.REP_DATA.LANG,'',$di)."/".$rows['value']);
					}
				}
			else{
				$n=NewFct('extract_nom_dater_evoluer',$rows['value'],"");
				$s .=sprintf("  <option value='".eregi_replace("(\.\.\/|".REP_DATA."|\/[a-z]{2}\/)",'',$di."/")."%1\$s' >%2\$s</option>  \n", $r,"(".str_replace(ADD_PATH_ADMIN.REP_DATA,'',$di).") ".$n['titre']);
				}
			}
		return $s;
	}
	}
	$b="  <select name='".$id."' id='".$id."'  ".$js.">\n"."<option value='' >".CHOOSE_LINK_INTERNE."</option>\n";
	## Prise en charge des formulaires
	if ( ( (defined('PX_CONFIG_MODULE_FORM'))AND (PX_CONFIG_MODULE_FORM=='true') )AND ($form) ) { //
		$nom=NewFct('cstr_liste',ADD_PATH_ADMIN."include/modules/form/formulaires/","") ;
		while ( $rows =each($nom)){
			$r=eregi_replace("([.][a-z]{3})","",$rows['value']);
			$b .=sprintf("  <option value='form&f=%1\$s' >".TXT_FORM_BASE." %2\$s</option>  \n", $r, $r);
		}
	}
	$b .="  <option value='sitemap' >".TXT_SITE_MAP."</option>  \n";
	## $s static, la liste principal n'est listé qu'une seul fois
	if (empty($s)){
		$s .=list_file('');
	}
	$b .=$s;
	$b .="  </select>\n";

	if ($type_s) print $b;
	else return $b;
}
?>