linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file sup.php

Documentation is available at sup.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage theme
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
  20. ////////////
  21.  
  22. if(isset($_POST['id']))    $id=$_POST['id'];
  23. if(isset($_GET['id']))    $id=$_GET['id'];
  24.  
  25. if((is_string($id[0]&& $id[0]=='s'|| isset($_POST['root'])) {
  26.   $id=str_replace('s' ,''$id);
  27.   $query=SQL_getoneCompleteSDtheme($id);
  28.   $root true;
  29.   $mask_mass_del="style=\"visibility:hidden;\"";
  30.   $mask_mass_mod="";
  31.   $mask_del_meth='disabled="disabled"';
  32.   $mask_mod_meth='checked="checked"';
  33.   $form_theme_transfert=-1;
  34. else {
  35.   $query=SQL_getonetheme($id);
  36.   $root false;
  37.   $mask_mass_del="style=\"visibility:hidden;\"";
  38.   $mask_mass_mod="style=\"visibility:hidden;\"";
  39.   $mask_del_meth='';
  40.   $mask_mod_meth='';
  41.   $form_theme_transfert=-1;
  42. }
  43.  
  44.  
  45.  
  46. if(isset($_POST['valider'])) {
  47.   if(isset($_POST['root'])) $root trueelse $root false;
  48.   $integrity=1;
  49.  
  50.   if(isset($_POST['sup_method'])) {
  51.     $sup_method=$_POST['sup_method'];
  52.     if($sup_method=='delete'{
  53.       $type='MASS_DELETE';
  54.       $mask_mass_del="style=\"visibility:visible;\"";
  55.       $mask_del_meth="checked=\"checked\"";
  56.       $form_theme_transfert=-1;
  57.     }
  58.     if($sup_method=='modify'{
  59.       $type='MASS_MODIFY';
  60.       $mask_mod_meth='checked="checked"';
  61.       $mask_mass_mod="style=\"visibility:visible;\"";
  62.       if($_POST['transfert_theme']==-1$integrity=_t('theme','sup_notheme');
  63.       else $form_theme_transfert=$_POST['transfert_theme'];
  64.     }
  65.     if($_SESSION['securityaction']!=md5($_POST['securitycode'])) {
  66.       $integrity=_t('security','message');
  67.     }
  68.     if(!is_string($integrity)) {
  69.       $theme_objectnew theme;
  70.       if($root == true$theme_object->SetRoot();
  71.       $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  72.       $result=$theme_object->DeleteTheme($id$sql_object$type$form_theme_transfert);
  73.       if(is_numeric($result)) header("Location: ".$link_confirm);
  74.       else  system_error();
  75.     }
  76.   }    else  {
  77.     $integrity=_t('theme','sup_nomethod');
  78.   }
  79.  
  80. }
  81.  
  82.  
  83. include_once("../lib/input_helpers.php");
  84. if($root == true{
  85.   // select-box des SD thèmes
  86.   $data=$sql_object->DBSelect(SQL_getSDlist4sup($id));
  87.   $select_theme=SDThemeSelectBox($data"transfert_theme"$form_theme_transfert);
  88. else {
  89.   $req_list=SQL_getlist4sup($id);
  90.   $data=$sql_object->DBSelect($req_list);
  91.   // select-box des thèmes
  92.   $select_theme=ThemeSelectBox($data"transfert_theme"$form_theme_transfert);
  93. }
  94.  
  95.  
  96.  
  97. $result1=$sql_object->DBSelect($query);
  98. $theme_name=formatText($result1[0]['theme_name'],'2HTML');
  99.  
  100. ?>
  101. <div id="chemin">
  102. <ul>
  103.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  104.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','theme')?></a></li>
  105.     <li><span><?php echo formatNavTitle($theme_name)?></span></li>
  106. </ul>
  107. </div>
  108. <!--end barre haute -->
  109. <?php
  110. include_once(THEME_ADMIN_PATH."quickicons.php");
  111. ?>
  112. <div class="contentcontainer"><?php
  113. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  114. ?>
  115. <div id="content">
  116. <?php
  117. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  118. ?> <?php echo "<h2>".formatTitleh2($theme_name)."</h2>"?>
  119. <form id="suptheme" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  120.     <p>
  121.         <input type="radio" name="sup_method" id="sup_method_del" value="delete" onclick="ShowSuppInfo('mass_delete');" <?php echo $mask_del_meth?> />
  122.         <label for="sup_method_del" class="autowidth"><?php echo _t('theme','sup_massd')?></label>
  123.     </p>
  124.     <p>
  125.         <input type="radio" name="sup_method" id="sup_method_mod" value="modify" onclick="ShowSuppInfo('mass_modify');" <?php echo $mask_mod_meth?> />
  126.         <label for="sup_method_mod" class="autowidth"><?php echo _t('theme','sup_massm')?></label>
  127.     </p>
  128.     <p id="transfert" <?php echo $mask_mass_mod?>>
  129.         <label for="transfert_theme"><?php echo _t('theme','sup_transfert')?></label>
  130.         <?php echo $select_theme?>
  131.     </p>
  132.     <p>
  133.     <img src="../lib/securitycode.php" alt="<?php echo _t('security','info2')?>" id="securityimg" />
  134.         <label for="securitycode" class="autowidth"><?php echo _t('security','info')?></label>
  135.         <input type="text" class="shorttextfield" id="securitycode" maxlength="5" name="securitycode" />
  136.     </p>
  137.     <?php
  138.     echo "<div class=\"info\"  id=\"mass_delete\" ".$mask_mass_del.">\n";
  139.     echo "\t"._t('theme','sup_mass_delete')."\n";
  140.     echo "</div>\n";
  141.     echo "<div class=\"info\" id=\"mass_modify\" ".$mask_mass_mod.">\n";
  142.     echo "\t"._t('theme','sup_mass_modify')."\n";
  143.     echo "</div>\n";
  144.     ?> 
  145.     <div>
  146.         <?php if($root == true?> 
  147.         <input name="root" type="hidden" id="root" value="1" /> 
  148.         <?php ?>
  149.         <input name="id" type="hidden" value="<?php echo $id?>" />
  150.         <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  151.         <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  152.         <?php echo cancel_button('javascript:history.go(-1);')?>
  153.         <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  154.     </div>
  155. </form>
  156. </div>
  157. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?>
  158. </div>

Documentation generated on Mon, 08 Apr 2013 18:16:17 +0200 by phpDocumentor 1.4.1