Author: jablko
Date: Fri Oct 15 18:19:44 2010
New Revision: 8176

Log:
Use $route->resource

Modified:
   trunk/apps/qubit/modules/function/actions/indexAction.class.php
   trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php

Modified: trunk/apps/qubit/modules/function/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/indexAction.class.php     Fri Oct 
15 18:09:50 2010        (r8175)
+++ trunk/apps/qubit/modules/function/actions/indexAction.class.php     Fri Oct 
15 18:19:44 2010        (r8176)
@@ -21,12 +21,7 @@
 {
   public function execute($request)
   {
-    $this->resource = QubitFunction::getById($request->id);
-
-    if (!isset($this->resource))
-    {
-      $this->forward404();
-    }
+    $this->resource = $this->getRoute()->resource;
 
     $this->parallelNames = $this->resource->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID));
     $this->otherNames = $this->resource->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID));

Modified: trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Fri Oct 
15 18:09:50 2010        (r8175)
+++ trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Fri Oct 
15 18:19:44 2010        (r8176)
@@ -24,8 +24,8 @@
     <h3><?php echo __('Parallel form(s) of name') ?></h3>
     <div>
       <ul>
-        <?php foreach ($parallelNames as $parallelName): ?>
-          <li><?php echo render_value($parallelName) ?></li>
+        <?php foreach ($parallelNames as $item): ?>
+          <li><?php echo render_value($item) ?></li>
         <?php endforeach; ?>
       </ul>
     </div>
@@ -35,8 +35,8 @@
     <h3><?php echo __('Other form(s) of name') ?></h3>
     <div>
       <ul>
-        <?php foreach ($otherNames as $otherName): ?>
-          <li><?php echo render_value($otherName) ?></li>
+        <?php foreach ($otherNames as $item): ?>
+          <li><?php echo render_value($item) ?></li>
         <?php endforeach; ?>
       </ul>
     </div>
@@ -350,22 +350,28 @@
 
 </div> <!-- /.section#controlArea -->
 
-
 <?php if ((QubitAcl::check($resource, 'update')) || 
(QubitAcl::check($resource, 'delete')) || (QubitAcl::check($resource, 
'create'))): ?>
   <div class="actions section">
+
     <h2 class="element-invisible"><?php echo __('Actions') ?></h2>
+
     <div class="content">
       <ul class="clearfix links">
+
         <?php if (QubitAcl::check($resource, 'update')): ?>
           <li><?php echo link_to(__('Edit'), array($resource, 'module' => 
'function', 'action' => 'edit'), array('title' => __('Edit'))) ?></li>
         <?php endif; ?>
+
         <?php if (QubitAcl::check($resource, 'delete')): ?>
           <li><?php echo link_to(__('Delete'), array($resource, 'module' => 
'function', 'action' => 'delete'), array('title' => __('Delete'))) ?></li>
         <?php endif; ?>
+
         <?php if (QubitAcl::check($resource, 'create')): ?>
           <li><?php echo link_to(__('Add new'), array('module' => 'function', 
'action' => 'create'), array('title' => __('Add new'))) ?></li>
         <?php endif; ?>
+
       </ul>
     </div>
+
   </div>
 <?php endif; ?>

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