Author: sevein
Date: Thu Oct 13 17:12:50 2011
New Revision: 10089

Log:
Regarding to previous commit, add throw404 parameter to QubitResourceRouter 
instead of creating a new class for the same purpose

Deleted:
   trunk/plugins/qtSwordPlugin/lib/qtSwordResourceRoute.class.php
Modified:
   trunk/apps/qubit/config/routing.yml
   trunk/lib/QubitResourceRoute.class.php

Modified: trunk/apps/qubit/config/routing.yml
==============================================================================
--- trunk/apps/qubit/config/routing.yml Thu Oct 13 17:08:01 2011        (r10088)
+++ trunk/apps/qubit/config/routing.yml Thu Oct 13 17:12:50 2011        (r10089)
@@ -11,10 +11,11 @@
 
 sword/action/slug:
   url: /sword/:action/:slug
-  class: qtSwordResourceRoute
+  class: QubitResourceRoute
   param:
     module: qtSwordPlugin
     slug: { pattern: '[^;]+' }
+    throw404: false
 
 sword:
   url: /sword/:action

Modified: trunk/lib/QubitResourceRoute.class.php
==============================================================================
--- trunk/lib/QubitResourceRoute.class.php      Thu Oct 13 17:08:01 2011        
(r10088)
+++ trunk/lib/QubitResourceRoute.class.php      Thu Oct 13 17:12:50 2011        
(r10089)
@@ -26,7 +26,7 @@
     $criteria->addJoin(QubitSlug::OBJECT_ID, QubitObject::ID);
 
     $this->resource = QubitObject::get($criteria)->__get(0);
-    if (!isset($this->resource))
+    if (isset($params['throw404']) && $params['throw404'] == true && 
!isset($this->resource))
     {
       throw new sfError404Exception;
     }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to