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

diff --git a/api.php b/api.php
index 39c6319ab5c749d857665830e0bb040f5dfe30e3..76eef437929e267d71adb56e78fccf1191a0e2c7 100644 (file)
--- a/api.php
+++ b/api.php
@@ -195,6 +195,7 @@ function main ($con) {
             if ($_POST ["keep_img"] == "yes") {
                 $imgpath = $feature->imgpath;
             } else {
+                request_error ();
                 $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
             }
 
@@ -235,6 +236,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"];
@@ -254,6 +256,7 @@ function main ($con) {
             success_feature ($feature, "add");
         break;
         case "del":
+            request_error ();
             $id = $_POST ["fid"];
             $feature = $con->getfeature ($id);
             if (!isset ($feature)) {
index b02e5a800ab146d61f4686c59624af8035d8930b..983e80b10e85c2bbc7b70ec1f3a32827ba4317b9 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 02c88e3cb5d0d557815b4f9c49bff6b1701d84e8..03214a000f4f2fbc102a95920f5b6fd04843aa3b 100644 (file)
@@ -255,6 +255,8 @@ var Admin = {
     },
 
     addNewFeature: function () {
+        alert (SypStrings.DisabledForDemo);
+        return;
         function cancel() {
             $(document).unbind("keydown");
             Admin.reset()
@@ -358,6 +360,8 @@ var FeatureMgr = {
     },
 
     del: function (feature) {
+        alert (SypStrings.DisabledForDemo);
+        return;
         var form = $("#feature_delete");
         form.find('input[name="fid"]').val(feature.fid);
         AjaxMgr.add({
@@ -708,6 +712,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.