]> dev.renevier.net Git - syp.git/commitdiff
forbird creation or deletion of item; forbids adding or deleting an image v0.2_demo
authorarno <arenevier@fdn.fr>
Sun, 26 Jul 2009 16:40:31 +0000 (18:40 +0200)
committerarno <arenevier@fdn.fr>
Sat, 8 Aug 2009 15:23:51 +0000 (17:23 +0200)
api.php
inc/templates_admin.php
js/admin.js

diff --git a/api.php b/api.php
index 2054350084a29108e54982d3de468354805b33da..38dc35dab9ef09834ac3120e8e8f74b229a9a868 100644 (file)
--- a/api.php
+++ b/api.php
@@ -216,6 +216,7 @@ function main ($con) {
             if ($_POST ["keep_img"] == "yes") {
                 $imgpath = $feature->imgpath;
             } else {
+                request_error ();
                 $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
             }
 
@@ -256,6 +257,7 @@ function main ($con) {
             success_feature ($new_feature, "update");
         break;
         case "add":
+            request_error ();
             $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
 
             $lon = $_POST ["lon"];
@@ -275,6 +277,7 @@ function main ($con) {
             success_feature ($feature, "add");
         break;
         case "del":
+            request_error ();
             $id = $_POST ["fid"];
             $feature = $con->getfeature ($id);
             if (!isset ($feature)) {
index 3931aa0beee3b0db547b8fd4672bcacf1aad8f5e..3ebce4da4115ea035cc80a98f1b128aa0cf0e705 100644 (file)
@@ -62,7 +62,8 @@ if (!$usrtblexists || !$itemstblexists) {
             UnconsistentError: "<?php ptrans('Server reply was inconsistent.')?>",
             UnknownError: "<?php ptrans('There was an unknown error.')?>",
             DelSucces: "<?php ptrans('Removal took place correctly.')?>",
-            UpdateSucces: "<?php ptrans('Save took place correctly.')?>"
+            UpdateSucces: "<?php ptrans('Save took place correctly.')?>",
+            DisabledForDemo: "<?php ptrans('This feature is not enabled on demo site')?>"
         };
 
         <?php 
index 259c914ae8c446165e8a5c613463687845c5612c..48c1eed55637c4af755de547eca9c3f1a9e5d1cf 100644 (file)
@@ -250,6 +250,8 @@ var Admin = {
     },
 
     addNewFeature: function () {
+        alert (SypStrings.DisabledForDemo);
+        return;
         function cancel() {
             $(document).unbind("keydown");
             Admin.reset()
@@ -353,6 +355,8 @@ var FeatureMgr = {
     },
 
     del: function (feature) {
+        alert (SypStrings.DisabledForDemo);
+        return;
         var form = $("#feature_delete");
         form.find('input[name="fid"]').val(feature.fid);
         AjaxMgr.add({
@@ -706,6 +710,8 @@ $(window).load(function () {
         return false;
     });
     $("#image_delete").click(function() {
+            alert (SypStrings.DisabledForDemo);
+            return;
             $("#img").removeAttr('src');
             // needs to rebuild element otherwise some browsers still
             // display image.