<?php
/**
 * @package linea21.core
 * @subpackage scale
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

//////////// Check Inclusion de pages //////////// 
if (!function_exists('AuthenthificationProcess')){ 
include_once("../lib/lib_common.php");
ReloadIndex('admin');
}
////////////

$current_title=$GLOBALS['lang']['scale']['list'];

$result=$sql_object->DBSelect($req_list2);


function display_scale($table, $depth, $root, $rub_link) {

	$link_sup=$rub_link."&amp;todo=sup&amp;id=";
	$link_mod=$rub_link."&amp;todo=mod&amp;id=";
	$link_det=$rub_link."&amp;todo=det&amp;id=";
   	for($i=0; $i<count($table); $i++) { 
	  	$current_dep=$table[$i]['scale_dependencies'];
		$current_root=$table[$i]['scale_root'];
		$current_id=$table[$i]['scale_id'];
		$current_denomination=formatText($table[$i]['scale_denomination'], '2HTML');
		$list=	"<li class=\"li".$current_dep."\">\n".
				"\t<a href=\"".$link_det.$current_id."\">".$current_denomination."</a>\n";

		//if ($table[$i]['scale_statut']=='D') $list.="<span class=\"state\">".$GLOBALS['lang']['statut']['draft']."</span>\n";
		
		if ($root<>0) $list.="\t<a href=\"".$link_sup.$current_id."\" class=\"ico_sup\" title=\"".$GLOBALS['lang']['scale']['sup']."\"></a>\n";
		$list.="\t<a href=\"".$link_mod.$current_id."\" class=\"ico_mod\" title=\"".$GLOBALS['lang']['scale']['mod']."\"></a>\n";	
		$list.=	"</li>\n";
				
	    if ($table[$i]["scale_dependencies"] == $depth  && $root == $table[$i]["scale_root"])  {
			echo $list;   
	     	display_scale($table, $depth+1, $table[$i]['scale_id'], $rub_link); 
	     } 
   }
}
?>
<div id="chemin">
	<ul>
		<li>
			<a href="index.php"><? echo $GLOBALS['lang']['way']['home']; ?></a>
		</li>
		<li>
			<a href="<?php echo $rub_link; ?>"><? echo $GLOBALS['lang']['menu']['scale']; ?></a>
		</li>
		<li>
			<span><? echo formatnavTitle($current_title); ?></span>
		</li>
	</ul>
</div>
<!--end barre haute -->
<?php
include_once("quickicons.php");
?>
<div class="contentcontainer">
<?php	include_once($dir."/menurub.php");	?>
<div id="content">
<h2><span class="semnone"><? echo formatTitleh2($current_title) ;?></span></h2>
<?
echo "<ul>\n";
display_scale($result, 0, 0, $rub_link);
echo "</ul>\n";
?>
</div>
<?php include_once($dir."/help.php"); ?>
</div>
  
