Author: rhari
Date: Fri Apr 27 11:13:24 2007
New Revision: 377

URL: http://svn.gna.org/viewcvs/phplinker?rev=377&view=rev
Log:

#132
Enregistrement des suppressions de catégories

Modified:
    trunk/smarty/default/templates/admin/category.tpl
    trunk/www/admin/category.php
    trunk/www/js/drag-drop-folder-tree.js
    trunk/www/lib/category.php

Modified: trunk/smarty/default/templates/admin/category.tpl
URL: 
http://svn.gna.org/viewcvs/phplinker/trunk/smarty/default/templates/admin/category.tpl?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- trunk/smarty/default/templates/admin/category.tpl (original)
+++ trunk/smarty/default/templates/admin/category.tpl Fri Apr 27 11:13:24 2007
@@ -40,7 +40,7 @@
 
 //*********************************Hari 20070425***lastmodif 
20070425***********
 
-var idNewCateg = 999999999;
+var deleteIds = "";
 
 
//******************************************************************************
 
@@ -184,7 +184,12 @@
                  xajax_linker_upd_category(id, id_parent, tag, texte);
              }
          }
+
+         if (deleteIds != ""){
+             xajax_linker_del_CategInIds(deleteIds);
+         }
 //       alert(count);
+//       alert(deleteIds);
          alert("Modifications enregistrées");
         }
 

Modified: trunk/www/admin/category.php
URL: 
http://svn.gna.org/viewcvs/phplinker/trunk/www/admin/category.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- trunk/www/admin/category.php (original)
+++ trunk/www/admin/category.php Fri Apr 27 11:13:24 2007
@@ -34,6 +34,7 @@
 $xajax->registerFunction("linker_add_tag");
 $xajax->registerFunction("linker_upd_category");
 $xajax->registerFunction("linker_add_category");
+$xajax->registerFunction("linker_del_CategInIds");
 
 // Utilisation de xajax pour traiter les requetes
 

Modified: trunk/www/js/drag-drop-folder-tree.js
URL: 
http://svn.gna.org/viewcvs/phplinker/trunk/www/js/drag-drop-folder-tree.js?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- trunk/www/js/drag-drop-folder-tree.js (original)
+++ trunk/www/js/drag-drop-folder-tree.js Fri Apr 27 11:13:24 2007
@@ -789,6 +789,12 @@
                        var ajaxIndex = JSTreeObj.ajaxObjects.length;
                        JSTreeObj.ajaxObjects[ajaxIndex] = new sack();
                        JSTreeObj.ajaxObjects[ajaxIndex].method = "GET";
+                       //***************************hari 20070427
+                       if (deleteIds == "")
+                           deleteIds = saveString;
+                       else
+                           deleteIds = deleteIds + "," + saveString;
+                       //************************************************
                        JSTreeObj.ajaxObjects[ajaxIndex].setVar("deleteIds", 
saveString);
                        
JSTreeObj.__addAdditionalRequestParameters(JSTreeObj.ajaxObjects[ajaxIndex], 
JSTreeObj.additionalDeleteRequestParameters);
                        JSTreeObj.ajaxObjects[ajaxIndex].requestFile = 
JSTreeObj.filePathDeleteItem;    // Specifying which file to get

Modified: trunk/www/lib/category.php
URL: 
http://svn.gna.org/viewcvs/phplinker/trunk/www/lib/category.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- trunk/www/lib/category.php (original)
+++ trunk/www/lib/category.php Fri Apr 27 11:13:24 2007
@@ -285,8 +285,18 @@
   }
 }
 
+function linker_del_CategInIds ($deleteIds) {
+   $objResponse = new xajaxResponse();
+
+  $tmpIds = explode(",", $deleteIds);
+  foreach ($tmpIds as $tmpId)
+    linker_del_category($tmpId, false);
+
+   return   $objResponse;
+}
+
 function linker_del_category ($id_categ, $recursive = false) {
-   if(linker_check_unsigned_int($id_categ) ){
+   if(linker_check_unsigned_int($id_categ)){
      if ($recursive){
        $qry1 = "SELECT id FROM category WHERE id_parent = ".$id_categ;
        $qry1 = sql_query('die',__FILE__,__LINE__,__FUNCTION__, $qry1);


_______________________________________________
PHPLinker-commits mailing list
[email protected]
https://mail.gna.org/listinfo/phplinker-commits

Reply via email to