Author: jablko
Date: Fri Oct 29 12:35:58 2010
New Revision: 8663

Log:
Add title

Modified:
   trunk/apps/qubit/modules/staticpage/actions/editAction.class.php
   trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php

Modified: trunk/apps/qubit/modules/staticpage/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/editAction.class.php    Fri Oct 
29 12:28:02 2010        (r8662)
+++ trunk/apps/qubit/modules/staticpage/actions/editAction.class.php    Fri Oct 
29 12:35:58 2010        (r8663)
@@ -30,10 +30,21 @@
     $this->form->getWidgetSchema()->setIdFormat('edit-%s');
 
     $this->resource = new QubitStaticPage;
+    $title = $this->context->i18n->__('Add new page');
+
     if (isset($this->getRoute()->resource))
     {
       $this->resource = $this->getRoute()->resource;
+
+      if (1 > strlen($title = $this->resource))
+      {
+        $title = $this->context->i18n->__('Untitled');
+      }
+
+      $title = $this->context->i18n->__('Edit %1%', array('%1%' => $title));
     }
+
+    $this->response->setTitle("$title - {$this->response->getTitle()}");
   }
 
   protected function addField($name)

Modified: trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php   Fri Oct 
29 12:28:02 2010        (r8662)
+++ trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php   Fri Oct 
29 12:35:58 2010        (r8663)
@@ -23,6 +23,13 @@
   {
     $this->resource = $this->getRoute()->resource;
 
+    if (1 > strlen($title = $this->resource))
+    {
+      $title = $this->context->i18n->__('Untitled');
+    }
+
+    $this->response->setTitle("$title - {$this->response->getTitle()}");
+
     // HACK factor this into routing one day?
     switch (true)
     {

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