Author: jablko
Date: Sun Oct 24 14:21:00 2010
New Revision: 8434

Log:
s/$term/$resource

Modified:
   trunk/apps/qubit/modules/term/actions/indexAction.class.php
   trunk/apps/qubit/modules/term/templates/indexSuccess.php

Modified: trunk/apps/qubit/modules/term/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/indexAction.class.php Sun Oct 24 
14:17:50 2010        (r8433)
+++ trunk/apps/qubit/modules/term/actions/indexAction.class.php Sun Oct 24 
14:21:00 2010        (r8434)
@@ -21,16 +21,16 @@
 {
   public function execute($request)
   {
-    $this->term = QubitTerm::getById($request->id);
+    $this->resource = QubitTerm::getById($request->id);
 
-    if (!$this->term instanceof QubitTerm)
+    if (!$this->resource instanceof QubitTerm)
     {
       $this->forward404();
     }
 
-    $request->setAttribute('term', $this->term);
+    $request->setAttribute('term', $this->resource);
 
-    if (QubitAcl::check($this->term, 'update'))
+    if (QubitAcl::check($this->resource, 'update'))
     {
       $validatorSchema = new sfValidatorSchema;
       $validatorSchema->name = new sfValidatorCallback(array('callback' => 
array($this, 'checkForRepeatedNames')));
@@ -38,7 +38,7 @@
       try
       {
         $validatorSchema->clean(array(
-          'name' => $this->term->getName(array('cultureFallback' => true))));
+          'name' => $this->resource->getName(array('cultureFallback' => 
true))));
       }
       catch (sfValidatorErrorSchema $e)
       {
@@ -46,13 +46,13 @@
       }
     }
 
-    $this->scopeNotes = $this->term->getNotesByType($options = 
array('noteTypeId' => QubitTerm::SCOPE_NOTE_ID));
-    $this->sourceNotes = $this->term->getNotesByType($options = 
array('noteTypeId' => QubitTerm::SOURCE_NOTE_ID));
-    $this->displayNotes = $this->term->getNotesByType($options = 
array('noteTypeId' => QubitTerm::DISPLAY_NOTE_ID));
+    $this->scopeNotes = $this->resource->getNotesByType($options = 
array('noteTypeId' => QubitTerm::SCOPE_NOTE_ID));
+    $this->sourceNotes = $this->resource->getNotesByType($options = 
array('noteTypeId' => QubitTerm::SOURCE_NOTE_ID));
+    $this->displayNotes = $this->resource->getNotesByType($options = 
array('noteTypeId' => QubitTerm::DISPLAY_NOTE_ID));
 
-    $this->children = $this->term->getChildren(array('sortBy' => 'name'));
+    $this->children = $this->resource->getChildren(array('sortBy' => 'name'));
 
-    $this->associateRelations = 
QubitRelation::getBySubjectOrObjectId($this->term->id, array('typeId' => 
QubitTerm::TERM_RELATION_ASSOCIATIVE_ID));
+    $this->associateRelations = 
QubitRelation::getBySubjectOrObjectId($this->resource->id, array('typeId' => 
QubitTerm::TERM_RELATION_ASSOCIATIVE_ID));
 
     QubitTreeView::addAssets($this->response);
   }
@@ -61,8 +61,8 @@
   {
     $criteria = new Criteria;
     $criteria->addJoin(QubitTerm::ID, QubitTermI18n::ID);
-    $criteria->add(QubitTerm::ID, $this->term->id, Criteria::NOT_EQUAL);
-    $criteria->add(QubitTerm::TAXONOMY_ID, $this->term->taxonomyId);
+    $criteria->add(QubitTerm::ID, $this->resource->id, Criteria::NOT_EQUAL);
+    $criteria->add(QubitTerm::TAXONOMY_ID, $this->resource->taxonomyId);
     $criteria->add(QubitTermI18n::CULTURE, $this->context->user->getCulture());
     $criteria->add(QubitTermI18n::NAME, $value);
 

Modified: trunk/apps/qubit/modules/term/templates/indexSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/indexSuccess.php    Sun Oct 24 
14:17:50 2010        (r8433)
+++ trunk/apps/qubit/modules/term/templates/indexSuccess.php    Sun Oct 24 
14:21:00 2010        (r8434)
@@ -1,6 +1,6 @@
 <h1><?php echo __('View term') ?></h1>
 
-<?php echo link_to_if(QubitAcl::check($term, 'update'), '<h1 
class="label">'.render_title($term).'</h1>', array($term, 'module' => 'term', 
'action' => 'edit'), array('title' => __('Edit term'))) ?>
+<?php echo link_to_if(QubitAcl::check($resource, 'update'), '<h1 
class="label">'.render_title($resource).'</h1>', array($resource, 'module' => 
'term', 'action' => 'edit'), array('title' => __('Edit term'))) ?>
 
 <?php if (isset($errorSchema)): ?>
   <div class="messages error">
@@ -12,9 +12,9 @@
   </div>
 <?php endif; ?>
 
-<?php echo render_show(__('Taxonomy'), $term->taxonomy) ?>
+<?php echo render_show(__('Taxonomy'), $resource->taxonomy) ?>
 
-<?php echo render_show(__('Code'), $term->code) ?>
+<?php echo render_show(__('Code'), $resource->code) ?>
 
 <div class="field">
   <h3><?php echo __('Scope note(s)') ?></h3>
@@ -53,12 +53,12 @@
   <h3><?php echo __('Hierarchical terms') ?></h3>
   <div>
 
-    <?php if (QubitTerm::ROOT_ID != $term->parent->id): ?>
+    <?php if (QubitTerm::ROOT_ID != $resource->parent->id): ?>
       <dl>
         <dt>
-          <?php echo render_title($term) ?>
+          <?php echo render_title($resource) ?>
         </dt><dd>
-          <?php echo __('BT %1%', array('%1%' => 
link_to(render_title($term->parent), array($term->parent, 'module' => 
'term')))) ?>
+          <?php echo __('BT %1%', array('%1%' => 
link_to(render_title($resource->parent), array($resource->parent, 'module' => 
'term')))) ?>
         </dd>
       </dl>
     <?php endif; ?>
@@ -66,7 +66,7 @@
     <?php if (0 < count($children)): ?>
       <dl>
         <dt>
-          <?php echo render_title($term) ?>
+          <?php echo render_title($resource) ?>
         </dt>
         <?php foreach ($children as $item): ?>
           <dd>
@@ -83,10 +83,10 @@
   <h3><?php echo __('Equivalent terms') ?></h3>
   <div>
 
-    <?php if (0 < count($altLabels = $term->otherNames)): ?>
+    <?php if (0 < count($altLabels = $resource->otherNames)): ?>
       <dl>
         <dt>
-          <?php echo render_title($term) ?>
+          <?php echo render_title($resource) ?>
         </dt>
         <?php foreach ($altLabels as $altLabel): ?>
           <dd>
@@ -105,11 +105,11 @@
     <?php if (0 < count($associateRelations)): ?>
     <dl>
       <dt>
-        <?php echo render_title($term) ?>
+        <?php echo render_title($resource) ?>
       </dt>
       <?php foreach ($associateRelations as $associateRelation): ?>
         <dd>
-          <?php echo __('RT %1%', array('%1%' => 
link_to(render_title($associateRelation->getOpposedObject($term->id)), 
array($associateRelation->getOpposedObject($term->id), 'module' => 'term')))) ?>
+          <?php echo __('RT %1%', array('%1%' => 
link_to(render_title($associateRelation->getOpposedObject($resource->id)), 
array($associateRelation->getOpposedObject($resource->id), 'module' => 
'term')))) ?>
         </dd>
       <?php endforeach; ?>
     </dl>
@@ -124,19 +124,19 @@
   <div class="content">
     <ul class="clearfix links">
 
-      <?php if (QubitAcl::check($term, 'update') || QubitAcl::check($term, 
'translate')): ?>
-        <li><?php echo link_to (__('Edit'), array($term, 'module' => 'term', 
'action' => 'edit')) ?></li>
+      <?php if (QubitAcl::check($resource, 'update') || 
QubitAcl::check($resource, 'translate')): ?>
+        <li><?php echo link_to (__('Edit'), array($resource, 'module' => 
'term', 'action' => 'edit')) ?></li>
       <?php endif; ?>
 
-      <?php if (QubitAcl::check($term, 'delete') && !$term->isProtected()): ?>
-        <li><?php echo link_to (__('Delete'), array($term, 'module' => 'term', 
'action' => 'delete')) ?></li>
+      <?php if (QubitAcl::check($resource, 'delete') && 
!$resource->isProtected()): ?>
+        <li><?php echo link_to (__('Delete'), array($resource, 'module' => 
'term', 'action' => 'delete')) ?></li>
       <?php endif; ?>
 
-      <?php if (QubitAcl::check($term->taxonomy, 'createTerm')): ?>
-        <li><?php echo link_to(__('Add new'), array('module' => 'term', 
'action' => 'create', 'parent' => url_for(array($term, 'module' => 'term')), 
'taxonomyId' => $term->getTaxonomy()->id)) ?></li>
+      <?php if (QubitAcl::check($resource->taxonomy, 'createTerm')): ?>
+        <li><?php echo link_to(__('Add new'), array('module' => 'term', 
'action' => 'create', 'parent' => url_for(array($resource, 'module' => 
'term')), 'taxonomyId' => $resource->getTaxonomy()->id)) ?></li>
       <?php endif; ?>
 
-      <li><?php echo link_to(__('List all'), array($term->taxonomy, 'module' 
=> 'taxonomy')) ?></li>
+      <li><?php echo link_to(__('List all'), array($resource->taxonomy, 
'module' => 'taxonomy')) ?></li>
 
     </ul>
   </div>

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