Author: sevein
Date: Wed Aug  1 07:47:29 2012
New Revision: 12023

Log:
Show level of description

Modified:
   trunk/lib/helper/QubitHelper.php

Modified: trunk/lib/helper/QubitHelper.php
==============================================================================
--- trunk/lib/helper/QubitHelper.php    Wed Aug  1 00:02:34 2012        (r12022)
+++ trunk/lib/helper/QubitHelper.php    Wed Aug  1 07:47:29 2012        (r12023)
@@ -102,7 +102,7 @@
 function render_title($value, $html = true)
 {
   // TODO Workaround for PHP bug, http://bugs.php.net/bug.php?id=47522
-  // method_exists is very slow if a string is passed (class lookup), use 
is_object
+  // Also, method_exists is very slow if a string is passed (class lookup), 
use is_object
   if (is_object($value) && method_exists($value, '__toString'))
   {
     $value = $value->__toString();
@@ -200,12 +200,23 @@
   }
   else
   {
-    // Add link
-    $node .= link_to($item->title, array('module' => 'informationobject', 
'slug' => $item->slug));
-
     // Level of description
     $levelOfDescriptionId = $item instanceof QubitObject ? 
$item->levelOfDescriptionId : $item->level_of_description_id;
-    $node .= 
'<strong>'.QubitTerm::getById($levelOfDescriptionId)->getName().'</strong>';
+    if (null !== $levelOfDescription = 
QubitTerm::getById($levelOfDescriptionId))
+    {
+      $node .= '<strong>'.$levelOfDescription->getName().'</strong>';
+    }
+
+    // Title
+    $title = '';
+    if ($item->identifier)
+    {
+      $title = $item->identifier . "&nbsp;-&nbsp;";
+    }
+    $title .= $item->title;
+
+    // Add link
+    $node .= link_to(render_title($title), array('module' => 
'informationobject', 'slug' => $item->slug));
   }
 
   // Close node tag

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