<?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 (!class_exists('auth')){
  include_once("../lib/lib_common.php");
  ReloadIndex('admin');
}
////////////


//////////// Check Droits utilisateur ////////////
if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
////////////

if (isset($_GET['id']))	$id=$_GET['id'];
if (isset($_POST['id'])) $id=$_POST['id'];


$root = false;

if(is_string($id[0]) && $id[0]=='s') {
  $is_sd=1;
  $id=str_replace('s' ,''  , $id);
  $req_det= SQL_getoneCompleteSDtheme($id);
  $result=$sql_object->DBSelect($req_det);
  $root = true;
  // formattage des données
  $current_title=formatText($result[0]['theme_name'], '2HTML');
  $description=empty_nc(formatText($result[0]['theme_description'],'2HTML'));
  $date_crea=$result[0]['theme_date_crea_display'];
  $last_modify=$result[0]['theme_last_modify_display'];

  $link_det=$rub_link."&amp;todo=det&amp;id=";
  $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  ?>
<div id="chemin">
<ul>
	<li><a href="index.php" class="chemin_home"><?php echo _t('way','home'); ?></a></li>
	<li><a href="<?php echo $rub_link; ?>" id="chemin_<?php echo $rub; ?>" class="chemin_rub"><?php echo _t('menu','theme'); ?></a></li>
	<li><span><?php echo formatNavTitle(_t('sdtheme','det'). " : " .$current_title); ?></span></li>
</ul>
</div>
<!--end barre haute -->
  <?php
  include_once(THEME_ADMIN_PATH."quickicons.php");
  ?>
<div class="contentcontainer"><?php
include_once(override($dir.'/menurub.php', THEME_ADMIN_PATH));
?>
<div id="content"><?php
echo "<h2>";
echo formatTitleh2($current_title);
echo "</h2>\n";
echo "\t<a href=\"".$link_sup.'s'.$id."\" title=\""._t('theme','sup')."\" class=\"ico_sup2\"></a>\n";
echo "\t<a href=\"".$link_mod.'s'.$id."\" title=\""._t('theme','mod')."\" class=\"ico_mod2\"></a>\n";
echo "<dl class=\"dl3\">\n";
echo "<dt>".mb_ucfirst(_t('theme','description'))." :</dt>\n";
echo "<dd>".$description."</dd>\n";
echo "<dt>".mb_ucfirst(_t('divers','last_modify'))." :</dt>\n";
echo "<dd>". $last_modify."</dd>\n";
echo "<dt>".mb_ucfirst(_t('divers','date_crea'))." :</dt>\n";
echo "<dd>". $date_crea."</dd>\n";
echo "</dl>\n";

}	else 	{

  $req_det= SQL_getonetheme($id);
  $result=$sql_object->DBSelect($req_det);
  $current_title=formatText($result[0]['theme_name'],'2HTML');

  // formattage des données
  $desc_project=empty_none(formatText($result[0]['theme_desc_project'], '2HTML'));
  $desc_dashboard=empty_none(formatText($result[0]['theme_desc_dashboard'], '2HTML'));
  $desc_publi=empty_none(formatText($result[0]['theme_desc_publication'], '2HTML'));
  $desc_workshop=empty_none(formatText($result[0]['theme_desc_workshop'], '2HTML'));
  $desc_news=empty_none(formatText($result[0]['theme_desc_news'], '2HTML'));
  $date_crea=$result[0]['theme_date_crea'];
  $last_modify=$result[0]['theme_last_modify'];

  $link_det=$rub_link."&amp;todo=det&amp;id=";
  $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  ?>
<div id="chemin">
<ul>
	<li><a href="index.php" class="chemin_home"><?php echo _t('way','home'); ?></a></li>
	<li><a href="<?php echo $rub_link; ?>" id="chemin_<?php echo $rub; ?>" class="chemin_rub"><?php echo _t('menu','theme');?></a></li>
	<li><span><?php echo formatNavTitle(_t('theme','det'). " : " .$current_title)?></span></li>
</ul>
</div>
<!--end barre haute --> <?php
include_once(THEME_ADMIN_PATH."quickicons.php");
?>
<div class="contentcontainer"><?php
include_once(override($dir.'/menurub.php', THEME_ADMIN_PATH));
?>
<div id="content"><?php
echo "<h2>";
echo formatTitleh2($current_title);
echo "</h2>\n";
echo "\t<a href=\"".$link_sup.$id."\" title=\""._t('theme','sup')."\" class=\"ico_sup2\"></a>\n";
echo "\t<a href=\"".$link_mod.$id."\" title=\""._t('theme','mod')."\" class=\"ico_mod2\"></a>\n";
echo "<dl class=\"dl3\">\n";
echo "<dt>".formatText(mb_ucfirst(_t('theme','sdtheme')), '2HTML'). " :</dt>\n";
echo "<dd><a href=\"".$link_det."s".$result[0]['sdtheme_id']."\">".formatText($result[0]['sdtheme_name'],'2HTML')."</a></dd>\n";
if(defined('MOD_PROJECT')) {
  echo "<dt>".formatText(mb_ucfirst(_t('theme','desc_det_project')), '2HTML')." :</dt>\n";
  echo "<dd>".$desc_project."</dd>\n";
}
if(defined('MOD_SDI')) {
  echo "<dt>".formatText(mb_ucfirst(_t('theme','desc_det_dashboard')), '2HTML')." :</dt>\n";
  echo "<dd>".$desc_dashboard."</dd>\n";
}
if(defined('MOD_PUBLICATION')) {
  echo "<dt>".formatText(mb_ucfirst(_t('theme','desc_det_publication')), '2HTML')." :</dt>\n";
  echo "<dd>".$desc_publi."</dd>\n";
}
if(defined('MOD_WORKSHOP')) {
  echo "<dt>".formatText(mb_ucfirst(_t('theme','desc_det_workshop')), '2HTML')." :</dt>\n";
  echo "<dd>".$desc_workshop."</dd>\n";
}
if(defined('MOD_NEWS')) {
  echo "<dt>".formatText(mb_ucfirst(_t('theme','desc_det_news')), '2HTML')." :</dt>\n";
  echo "<dd>".$desc_news."</dd>\n";
}
echo "<dt>".formatText(mb_ucfirst(_t('divers','last_modify')), '2HTML')." :</dt>\n";
echo "<dd>".$last_modify."</dd>\n";
echo "<dt>".formatText(mb_ucfirst(_t('divers','date_crea')), '2HTML')." :</dt>\n";
echo "<dd>".$date_crea."</dd>\n";
/** PAS DE GESTION DES STATUTS
 echo "<dt>".formatText(_t('divers','statut'), '2HTML') ." :</dt>\n";
 echo "<dd>".display_statut($result[0]['theme_statut']). "</dd>\n";
 **/
echo "</dl>\n";
}
?></div>
<?php include_once(override($dir.'/help.php', THEME_ADMIN_PATH)); ?></div>