Author: jablko
Date: Wed Oct 27 21:21:34 2010
New Revision: 8598

Log:
HACK Route according to class

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 Wed Oct 27 20:53:45 2010        (r8597)
+++ trunk/apps/qubit/config/routing.yml Wed Oct 27 21:21:34 2010        (r8598)
@@ -9,6 +9,14 @@
     action: index
     slug: home
 
+slug:
+  url: /:slug
+  class: QubitResourceRoute
+  param:
+    module: staticpage
+    action: index
+    slug: { pattern: '[^;]+' }
+
 dc:
   url: /:slug;dc
   class: QubitResourceRoute
@@ -359,13 +367,5 @@
   param:
     action: add
 
-# After default_index to avoid matching /;foo
-slug:
-  url: /:slug
-  class: QubitResourceRoute
-  param:
-    module: staticpage
-    action: index
-
 default:
   url:   /;:module/:action

Modified: trunk/lib/QubitResourceRoute.class.php
==============================================================================
--- trunk/lib/QubitResourceRoute.class.php      Wed Oct 27 20:53:45 2010        
(r8597)
+++ trunk/lib/QubitResourceRoute.class.php      Wed Oct 27 21:21:34 2010        
(r8598)
@@ -31,6 +31,28 @@
       throw new sfError404Exception;
     }
 
+    // HACK Clean this up one day
+    if ('staticpage' == $params['module'])
+    {
+      switch (true)
+      {
+        case $this->resource instanceof QubitActor:
+          $params['module'] = 'sfIsaarPlugin';
+
+          break;
+
+        case $this->resource instanceof QubitFunction:
+          $params['module'] = 'sfIsdfPlugin';
+
+          break;
+
+        case $this->resource instanceof QubitInformationObject:
+          $params['module'] = 'sfIsadPlugin';
+
+          break;
+      }
+    }
+
     return parent::bind($context, $params);
   }
 }

-- 
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