Author: david
Date: 2008-10-27 13:20:50 -0700 (Mon, 27 Oct 2008)
New Revision: 1504

Added:
   trunk/qubit/lib/response/
   trunk/qubit/lib/response/QubitWebResponse.class.php
Modified:
   trunk/qubit/apps/qubit/config/factories.yml
   trunk/qubit/apps/qubit/config/view.yml
Log:
Use settings > site_information title and description to set site title in html 
<title> tag.  Fixes issue #485.

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

Modified: trunk/qubit/apps/qubit/config/view.yml
===================================================================
--- trunk/qubit/apps/qubit/config/view.yml      2008-10-27 16:57:48 UTC (rev 
1503)
+++ trunk/qubit/apps/qubit/config/view.yml      2008-10-27 20:20:50 UTC (rev 
1504)
@@ -3,7 +3,7 @@
     content-type: text/html
 
   metas:
-    title:        Qubit - open information management toolkit
+    #title:        Qubit - open information management toolkit
     #description:  Qubit
     #keywords:     Qubit
     #language:     en

Added: trunk/qubit/lib/response/QubitWebResponse.class.php
===================================================================
--- trunk/qubit/lib/response/QubitWebResponse.class.php                         
(rev 0)
+++ trunk/qubit/lib/response/QubitWebResponse.class.php 2008-10-27 20:20:50 UTC 
(rev 1504)
@@ -0,0 +1,48 @@
+<?php
+/*
+ * This file is part of the Qubit Toolkit.
+ * Copyright (C) 2006-2008 Peter Van Garderen <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+/**
+ * Extend the symfony sfWebResponse class to allow overwriting of getTitle() 
+ * method
+ */
+class QubitWebResponse extends sfWebResponse
+{
+  /**
+   * Retrieves title for the current web response.
+   *
+   * @return string Title
+   */
+  public function getTitle()
+  {
+    $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;
+    }
+    
+    return (strlen($title)) ? $title : '';
+  }
+}
\ No newline at end of file


Property changes on: trunk/qubit/lib/response/QubitWebResponse.class.php
___________________________________________________________________
Added: svn:keywords
   + Author Id Revision
Added: svn:eol-style
   + native


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