Author: jablko
Date: 2008-11-05 15:44:36 -0800 (Wed, 05 Nov 2008)
New Revision: 1524

Modified:
   trunk/qubit/apps/qubit/config/routing.yml
   trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php
Log:
Temporarily add routes for each action to routing.yml, pending a way to do this 
automatically. Set routing default parameters so that links to edit and show 
actions get routed to existent actions.


Modified: trunk/qubit/apps/qubit/config/routing.yml
===================================================================
--- trunk/qubit/apps/qubit/config/routing.yml   2008-11-05 23:14:06 UTC (rev 
1523)
+++ trunk/qubit/apps/qubit/config/routing.yml   2008-11-05 23:44:36 UTC (rev 
1524)
@@ -1,3 +1,22 @@
+editDc:
+  url: /:module/edit/dc/*
+  param: { action: editDc }
+
+editIsad:
+  url: /:module/edit/isad/*
+  param: { action: editIsad }
+
+editRad:
+  url: /:module/edit/rad/*
+  param: { action: editRad }
+
+showIsad:
+  url: /:module/show/isad/*
+  param: { action: showIsad }
+
+template:
+  url: /:module/:action/:template/*
+
 homepage:
   url:   /
   param: { module: staticpage, action: static, permalink: homepage }
@@ -13,15 +32,15 @@
 browse:
   url:   /browse
   param: { module: term, action: browse }
-  
+
 repository:
   url:   /repository
   param: { module: repository, action: list }
-  
+
 informationobject:
   url:   /informationobject
   param: { module: informationobject, action: list }
-  
+
 actor:
   url:   /actor
   param: { module: actor, action: list }

Modified: trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php
===================================================================
--- trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php     2008-11-05 
23:14:06 UTC (rev 1523)
+++ trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php     2008-11-05 
23:44:36 UTC (rev 1524)
@@ -24,7 +24,7 @@
   /*
    * execute this filter on every request in case some params have changed 
since the last page load
    */
-  public function execute ($filterChain)
+  public function execute($filterChain)
   {
     // create a function cache object for the QubitSettings method call
     //$fileCache = new sfFileCache(array('cache_dir' => 
sfConfig::get('sf_app_cache_dir').'/settings'));
@@ -41,22 +41,26 @@
     // get settings (from cache if it exists)
     //$settings = $functionCache->call(array(new QubitSetting, 
'getSettingsArray'));
     $settings = QubitSetting::getSettingsArray();
-    
+
     // overwrite/populate settings into sfConfig object
     sfConfig::add($settings);
-    
+
     $this->setSiteTitle();
-    
+
+    // Set routing default parameters so that links to edit and show actions
+    // get routed to existent actions
+    $this->context->getRouting()->setDefaultParameters(array('template' => 
'isad'));
+
     // execute next filter
     $filterChain->execute();
   }
-  
+
   protected function setSiteTitle()
   {
     $title = strip_tags(sfConfig::get('app_site_information_site_title'));
     $desc  = 
strip_tags(sfConfig::get('app_site_information_site_description'));
-    
-    if (strlen($title) && strlen($desc)) 
+
+    if (strlen($title) && strlen($desc))
     {
       $title = $title.' - '.$desc;
     }
@@ -64,7 +68,7 @@
     {
       $title .= $desc;
     }
-    
+
     $this->getContext()->getResponse()->setTitle($title);
   }
-}
\ No newline at end of file
+}


--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to