<?php
/**
 * @package linea21.core
 * @subpackage theme
 * @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=_t('theme','list');
$result=$sql_object->DBSelect($req_list_theme);
$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=";

$listing="<ul>\n";

$current_sdtheme='';
for ($i=0;$i<count($result);$i++){
	if ($result[$i]['sdtheme_id']!=$current_sdtheme) {
		$current_sdtheme=$result[$i]['sdtheme_id'];
		
		if($i == 0)$listing.="<li class=\"li0\">\n";
		else $listing.="</ul></li><li class=\"li0\">\n";
		$listing.="\t<a href=\"".$link_det."s".$result[$i]['sdtheme_id']."\" title=\""._t('theme','det')."\">".formatText($result[$i]['sdtheme_name'],'2HTML')."</a>";
		$listing.="\t<a href=\"".$link_sup.'s'.$result[$i]['sdtheme_id']."\" class=\"ico_sup\" title=\""._t('theme','sup')."\"></a>\n";
	    $listing.="\t<a href=\"".$link_mod.'s'.$result[$i]['sdtheme_id']."\" class=\"ico_mod\" title=\""._t('theme','mod')."\"></a>\n";
		$listing.="<ul>\n";

	}
	$listing.="<li class=\"li1\">\n";
	$listing.="\t<a href=\"".$link_det.$result[$i]['theme_id']."\" title=\""._t('theme','det')."\">".formatText($result[$i]['theme_name'],'2HTML')."</a>\n";
	if ($result[$i]['theme_statut']=='D') $listing.="<span class=\"state\">"._t('statut','draft')."</span>";
	$listing.="\t<a href=\"".$link_sup.$result[$i]['theme_id']."\" class=\"ico_sup\" title=\""._t('theme','sup')."\"></a>\n";
	$listing.="\t<a href=\"".$link_mod.$result[$i]['theme_id']."\" class=\"ico_mod\" title=\""._t('theme','mod')."\"></a>\n";
	$listing.="</li>\n";
}
$listing.="</ul></li></ul>\n";
?>
<div id="chemin">
	<ul>
		<li>
			<a href="index.php" class="chemin_home"><? echo _t('way','home'); ?></a>
		</li>
		<li>
			   <a href="<?php echo $rub_link; ?>" id="chemin_<? echo $rub; ?>" class="chemin_rub"><? echo _t('menu','theme'); ?></a>
		</li>
		<li>
			<span><? echo formatNavTitle($current_title); ?></span>
		</li>
	</ul>
</div>
  <!--end barre haute -->
<?php
include_once(THEME_ADMIN_PATH."quickicons.php");
?>
<div class="contentcontainer">
<?php	include_once($dir."/menurub.php");	?>
<div id="content">
<div id="tree">
<?
echo $listing;
?>
</div>
</div>
<?php include_once($dir."/help.php"); ?>
</div>
  
