Author: david
Date: 2008-10-27 13:27:16 -0700 (Mon, 27 Oct 2008)
New Revision: 1505

Removed:
   trunk/qubit/lib/response/
Modified:
   trunk/qubit/apps/qubit/config/factories.yml
   trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php
Log:
Use Jack's suggested method of setting site title in SiteSettingsFilter class 
instead of defining a separate QubitWebResponse class. Fixes issue #485.

Modified: trunk/qubit/apps/qubit/config/factories.yml
===================================================================
--- trunk/qubit/apps/qubit/config/factories.yml 2008-10-27 20:20:50 UTC (rev 
1504)
+++ trunk/qubit/apps/qubit/config/factories.yml 2008-10-27 20:27:16 UTC (rev 
1505)
@@ -26,8 +26,8 @@
 #  request:
 #    class: sfWebRequest
 #
-  response:
-    class: QubitWebResponse
+#  response:
+#    class: QubitWebResponse
 #
 #  user:
 #    class: myUser

Modified: trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php
===================================================================
--- trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php     2008-10-27 
20:20:50 UTC (rev 1504)
+++ trunk/qubit/apps/qubit/lib/SiteSettingsFilter.class.php     2008-10-27 
20:27:16 UTC (rev 1505)
@@ -44,10 +44,29 @@
     
     // overwrite/populate settings into sfConfig object
     sfConfig::add($settings);
-
+    
+    $this->setSiteTitle();
+    
     // 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)) 
+    {
+      $title = $title.' - '.$desc;
+    }
+    else
+    {
+      $title .= $desc;
+    }
+    
+    $this->getContext()->getResponse()->setTitle($title);
+  }
 }
 
 ?>


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