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

Source for file _ajax_sort.php

Documentation is available at _ajax_sort.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage admin
  5.  * @author Simon Georget <simon@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10. include_once('../config/define.php');
  11.  
  12. //////////// Check Droits utilisateur ////////////
  13. if (!$l21auth->hasRight($_REQUEST['rub'])) ReloadIndex('admin');
  14. ////////////
  15.  
  16. if(!isset($_REQUEST['rub'])) die();
  17.  
  18. include_once('../languages/' U_L '/lang_common.' CHARSET '.php');
  19.  
  20.  
  21. switch ($_REQUEST['rub']{
  22.   case "project":
  23.     $items $_REQUEST['sort-table'];
  24.     include_once('../class/class.project.php');
  25.     $o new project;
  26.     break;
  27.   case "news":
  28.     $items $_REQUEST['sort-table'];
  29.     include_once('../class/class.news.php');
  30.     $o new news;
  31.     break;
  32.   case "publication":
  33.     if(isset($_REQUEST['sort-table'])) {
  34.       $items $_REQUEST['sort-table'];
  35.       include_once('../class/class.publication.php');
  36.       $o new publication;
  37.     }
  38.     if(isset($_REQUEST['sort-part'])) {
  39.       $items $_REQUEST['sort-part'];
  40.       $extra 'publication';
  41.       include_once('../class/class.contents.php');
  42.       $o new contents;
  43.     }
  44.     if(isset($_REQUEST['sort-link'])) {
  45.       $items $_REQUEST['sort-link'];
  46.       $extra 'link';
  47.       include_once('../class/class.resources.php');
  48.       $o new resources;
  49.     }
  50.     if(isset($_REQUEST['sort-biblio'])) {
  51.       $items $_REQUEST['sort-biblio'];
  52.       $extra 'biblio';
  53.       include_once('../class/class.resources.php');
  54.       $o new resources;
  55.     }
  56.     if(isset($_REQUEST['sort-multi'])) {
  57.       $items $_REQUEST['sort-multi'];
  58.       $extra 'multi';
  59.       include_once('../class/class.resources.php');
  60.       $o new resources;
  61.     }
  62.     break;
  63.   case "workshop":
  64.     $items $_REQUEST['sort-table'];
  65.     include_once('../class/class.workshop.php');
  66.     $o new workshop;
  67.     break;
  68.   case "workshoprep":
  69.     if(isset($_REQUEST['sort-part'])) {
  70.       $items $_REQUEST['sort-part'];
  71.       $extra 'workshop';
  72.       include_once('../class/class.contents.php');
  73.       $o new contents;
  74.     }
  75.     if(isset($_REQUEST['sort-link'])) {
  76.       $items $_REQUEST['sort-link'];
  77.       $extra 'link';
  78.       include_once('../class/class.resources.php');
  79.       $o new resources;
  80.     }
  81.     if(isset($_REQUEST['sort-biblio'])) {
  82.       $items $_REQUEST['sort-biblio'];
  83.       $extra 'biblio';
  84.       include_once('../class/class.resources.php');
  85.       $o new resources;
  86.     }
  87.     if(isset($_REQUEST['sort-multi'])) {
  88.       $items $_REQUEST['sort-multi'];
  89.       $extra 'multi';
  90.       include_once('../class/class.resources.php');
  91.       $o new resources;
  92.     }
  93.     break;
  94.   default:
  95.     $class'error';
  96.   $msg 'incorrect $_REQUEST["rub"] parameter';
  97.   break;
  98.  
  99. }
  100.  
  101. $data sortItems($_REQUEST['rub']$items);
  102.  
  103. if(isset($extra)) {
  104.   $res $o->changeRanges($data$GLOBALS['sql_object']$extra);
  105. else {
  106.   $res $o->changeRanges($data$GLOBALS['sql_object']);
  107. }
  108.  
  109.  
  110. if($res == 1{
  111.   $class "succeed";
  112.   $msg _t('msg''update_successful');
  113. else {
  114.   $class "failed";
  115.   $msg _t('msg''update_failed');
  116. }
  117.  
  118. $a array("class"=>$class,"msg"=>$msg);
  119.  
  120. echo json_encode($a);
  121. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:45 +0100 by phpDocumentor 1.4.1