<?php
/**
 * @package linea21.modules
 * @subpackage sdi
 * @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');
}
////////////

$result=$sql_object->DBSelect($req_list_theme);
$sdi_object= new sdi;
//$result_sdi=$sdi_object->GetListSdi($filter="R", $valueparam=0, $sql_object);
$req_sdi=SQL_getListSdi($filter="R", $valueparam=0);
$result_sdi = $sql_object -> DBSelect($req_sdi);

$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'];
		$listing.="<li class=\"li0\">\n";
		$listing.="\t<div class=\"iconetodo\">\n";
		$listing.="\t<span  class=\"nolink\">".formatText($result[$i]['sdtheme_name'], '2HTML')."</span>";
		$listing.="</div>\n";
		$listing.="</li>\n";
	}
	$listing.="<li class=\"li1\">\n";
	$listing.="<div class=\"iconetodo\">\n";
	$listing.="\t<span class=\"nolink\">".cutText(formatText($result[$i]['theme_name'], '2HTML'), 90, 1)."</span>\n";
	$listing.="</div>\n";
	$listing.="</li>\n";
	for ($j=0;$j<count($result_sdi);$j++){
	if ($result[$i]['theme_id']==$result_sdi[$j]['sdii_theme']) {
	$listing.="<li class=\"li2\">\n";
	$listing.="<div class=\"iconetodo\">\n";
	$listing.="\t<a href=\"".$link_det.$result_sdi[$j]['sdii_id']."\" title=\"".formatText($result_sdi[$j]['sdii_name'], '2HTML')."\">".cutText(formatText($result_sdi[$j]['sdii_name'], '2HTML'), 90, 1)."</a>\n";
	if ($result_sdi[$j]['sdii_statut']=='D') $listing.="<span class=\"state\">".$GLOBALS['lang']['statut']['draft']."</span>";
	$listing.="\t<a href=\"".$link_sup.$result_sdi[$j]['sdii_id']."\" title=\"".$GLOBALS['lang']['sdi']['sup']."\" class=\"ico_sup\"></a>\n";
	$listing.="\t<a href=\"".$link_mod.$result_sdi[$j]['sdii_id']."\" title=\"".$GLOBALS['lang']['sdi']['mod']."\" class=\"ico_mod\"></a>\n";
	$listing.="</div>\n";
	$listing.="</li>\n";   
	}
	}
}
$listing.="</ul>\n";
?>
<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']['sdi'];?></a>
		</li>
		<li>
			<span><? echo $GLOBALS['lang']['sdi']['list']; ?></span>
		</li>
	</ul>
</div>
  <!--end barre haute -->
<?php
include_once("quickicons.php");
?>
<div class="contentcontainer">
<?php	include_once($dir."/menurub.php");	?>
<div id="content">
<?
echo $listing;
?>
</div>
<?php include_once($dir."/help.php"); ?>
</div>
  
