[Jaws-commits] r9741 - branches/0.8/jaws/html/gadgets/UrlMapper

afz at jaws-project.com afz at jaws-project.com
Fri Oct 31 07:59:08 UTC 2008


Author: afz
Date: 2008-10-31 07:59:08 +0000 (Fri, 31 Oct 2008)
New Revision: 9741

Modified:
   branches/0.8/jaws/html/gadgets/UrlMapper/AdminAjax.php
   branches/0.8/jaws/html/gadgets/UrlMapper/Model.php
Log:
UrlMapper: use PushLastResponse only in Ajax stuff

Modified: branches/0.8/jaws/html/gadgets/UrlMapper/AdminAjax.php
===================================================================
--- branches/0.8/jaws/html/gadgets/UrlMapper/AdminAjax.php	2008-10-31 07:44:03 UTC (rev 9740)
+++ branches/0.8/jaws/html/gadgets/UrlMapper/AdminAjax.php	2008-10-31 07:59:08 UTC (rev 9741)
@@ -69,7 +69,11 @@
         $res = $model->AddMap($gadget, $action, $map, $reg);
         if (!Jaws_Error::IsError($res)) {
             $model->UpdateCustomMaps();
+            $GLOBALS['app']->Session->PushLastResponse(_t('URLMAPPER_MAP_ADDED', $map), RESPONSE_NOTICE);
+        } else {
+            $GLOBALS['app']->Session->PushLastResponse(_t('URLMAPPER_ERROR_MAP_NOT_ADDED'), RESPONSE_ERROR);
         }
+
         return $GLOBALS['app']->Session->PopLastResponse();
     }
 

Modified: branches/0.8/jaws/html/gadgets/UrlMapper/Model.php
===================================================================
--- branches/0.8/jaws/html/gadgets/UrlMapper/Model.php	2008-10-31 07:44:03 UTC (rev 9740)
+++ branches/0.8/jaws/html/gadgets/UrlMapper/Model.php	2008-10-31 07:59:08 UTC (rev 9741)
@@ -40,11 +40,9 @@
 
         $result = $GLOBALS['db']->query($sql, $params);
         if (Jaws_Error::IsError($result)) {
-            $GLOBALS['app']->Session->PushLastResponse(_t('URLMAPPER_ERROR_MAP_NOT_ADDED'), RESPONSE_ERROR);
             return new Jaws_Error(_t('URLMAPPER_ERROR_MAP_NOT_ADDED'), _t('URLMAPPER_NAME'));
         }
 
-        $GLOBALS['app']->Session->PushLastResponse(_t('URLMAPPER_MAP_ADDED', $map), RESPONSE_NOTICE);
         return true;
     }
 



More information about the Jaws-commits mailing list