Author: jablko
Date: Tue Oct 26 16:29:03 2010
New Revision: 8521

Log:
Add title

Modified:
   trunk/apps/qubit/modules/term/actions/editAction.class.php
   trunk/apps/qubit/modules/term/actions/indexAction.class.php
   trunk/apps/qubit/modules/term/config/view.yml

Modified: trunk/apps/qubit/modules/term/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/editAction.class.php  Tue Oct 26 
16:27:36 2010        (r8520)
+++ trunk/apps/qubit/modules/term/actions/editAction.class.php  Tue Oct 26 
16:29:03 2010        (r8521)
@@ -45,6 +45,8 @@
     $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
 
     $this->resource = new QubitTerm;
+    $title = $this->context->i18n->__('Add new term');
+
     if (isset($this->getRoute()->resource))
     {
       $this->resource = $this->getRoute()->resource;
@@ -64,8 +66,17 @@
       $this->form->setValidator('serialNumber', new sfValidatorInteger);
       $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
 
+      if (1 > strlen($title = $this->resource))
+      {
+        $title = $this->context->i18n->__('Untitled');
+      }
+
+      $title = "Edit $title";
+
       QubitTreeView::addAssets($this->response);
     }
+
+    $this->response->setTitle("$title - {$this->response->getTitle()}");
   }
 
   protected function addField($name)

Modified: trunk/apps/qubit/modules/term/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/indexAction.class.php Tue Oct 26 
16:27:36 2010        (r8520)
+++ trunk/apps/qubit/modules/term/actions/indexAction.class.php Tue Oct 26 
16:29:03 2010        (r8521)
@@ -42,6 +42,13 @@
       $this->forward404();
     }
 
+    if (1 > strlen($title = $this->resource))
+    {
+      $title = $this->context->i18n->__('Untitled');
+    }
+
+    $this->response->setTitle("$title - {$this->response->getTitle()}");
+
     if (QubitAcl::check($this->resource, 'update'))
     {
       $validatorSchema = new sfValidatorSchema;

Modified: trunk/apps/qubit/modules/term/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/term/config/view.yml       Tue Oct 26 16:27:36 
2010        (r8520)
+++ trunk/apps/qubit/modules/term/config/view.yml       Tue Oct 26 16:29:03 
2010        (r8521)
@@ -14,15 +14,15 @@
   components:
     sidebar: [term, contextMenu]
 
+indexSuccess:
+  components:
+    sidebar: [term, contextMenu]
+  javascripts:
+    blank:
+
 listSuccess:
   javascripts:
     /plugins/sfDrupalPlugin/vendor/drupal/misc/jquery.once.js:
     /plugins/sfDrupalPlugin/vendor/drupal/misc/collapse:
     /plugins/sfDrupalPlugin/vendor/drupal/misc/form:
     /plugins/sfDrupalPlugin/vendor/drupal/misc/tableheader:
-
-indexSuccess:
-  components:
-    sidebar: [term, contextMenu]
-  javascripts:
-    blank:

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