Author: jablko
Date: Mon Oct 25 12:33:39 2010
New Revision: 8476
Log:
s/$term/$resource/g
Modified:
trunk/apps/qubit/modules/term/actions/browseTermAction.class.php
trunk/apps/qubit/modules/term/actions/contextMenuComponent.class.php
trunk/apps/qubit/modules/term/actions/deleteAction.class.php
trunk/apps/qubit/modules/term/actions/treeViewAction.class.php
trunk/apps/qubit/modules/term/actions/treeViewComponent.class.php
trunk/apps/qubit/modules/term/templates/_contextMenu.php
trunk/apps/qubit/modules/term/templates/_format.php
trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
trunk/apps/qubit/modules/term/templates/deleteSuccess.php
Modified: trunk/apps/qubit/modules/term/actions/browseTermAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/browseTermAction.class.php Mon Oct
25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/actions/browseTermAction.class.php Mon Oct
25 12:33:39 2010 (r8476)
@@ -26,15 +26,15 @@
$request->limit = sfConfig::get('app_hits_per_page');
}
- $this->term = QubitTerm::getById($request->id);
+ $this->resource = QubitTerm::getById($request->id);
- if (!isset($this->term))
+ if (!isset($this->resource))
{
$this->forward404();
}
$criteria = new Criteria;
- $criteria->add(QubitObjectTermRelation::TERM_ID, $this->term->id);
+ $criteria->add(QubitObjectTermRelation::TERM_ID, $this->resource->id);
$criteria->addJoin(QubitObjectTermRelation::OBJECT_ID,
QubitInformationObject::ID);
$criteria->addJoin(QubitInformationObject::ID, QubitObject::ID);
Modified: trunk/apps/qubit/modules/term/actions/contextMenuComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/contextMenuComponent.class.php
Mon Oct 25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/actions/contextMenuComponent.class.php
Mon Oct 25 12:33:39 2010 (r8476)
@@ -30,9 +30,9 @@
{
public function execute($request)
{
- $this->term = $request->getAttribute('term');
+ $this->resource = $request->getAttribute('term');
- if (null === $this->term->id)
+ if (null === $this->resource->id)
{
return sfView::NONE;
}
Modified: trunk/apps/qubit/modules/term/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/deleteAction.class.php Mon Oct
25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/actions/deleteAction.class.php Mon Oct
25 12:33:39 2010 (r8476)
@@ -23,30 +23,30 @@
{
$this->form = new sfForm;
- $this->term = QubitTerm::getById($request->id);
+ $this->resource = QubitTerm::getById($request->id);
- if (!isset($this->term))
+ if (!isset($this->resource))
{
$this->forward404();
}
// Check user authorization
- if (!QubitAcl::check($this->term, 'delete'))
+ if (!QubitAcl::check($this->resource, 'delete'))
{
QubitAcl::forwardUnauthorized();
}
- $request->setAttribute('term', $this->term);
+ $request->setAttribute('term', $this->resource);
if ($request->isMethod('delete'))
{
// Don't delete protected terms
- if ($this->term->isProtected())
+ if ($this->resource->isProtected())
{
$this->forward('admin', 'termPermission');
}
- foreach ($this->term->descendants->andSelf()->orderBy('rgt') as
$descendant)
+ foreach ($this->resource->descendants->andSelf()->orderBy('rgt') as
$descendant)
{
if (QubitAcl::check($descendant, 'delete'))
{
@@ -54,9 +54,9 @@
}
}
- if (isset($this->term->taxonomy))
+ if (isset($this->resource->taxonomy))
{
- $this->redirect(array($this->term->taxonomy, 'module' => 'taxonomy'));
+ $this->redirect(array($this->resource->taxonomy, 'module' =>
'taxonomy'));
}
$this->redirect(array('module' => 'taxonomy', 'action' => 'list'));
Modified: trunk/apps/qubit/modules/term/actions/treeViewAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/treeViewAction.class.php Mon Oct
25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/actions/treeViewAction.class.php Mon Oct
25 12:33:39 2010 (r8476)
@@ -23,7 +23,7 @@
{
$this->response->setHttpHeader('Content-Type', 'application/json;
charset=utf-8');
- $term = QubitTerm::getById($request->id);
+ $this->resource = QubitTerm::getById($request->id);
$options = array();
if (isset($request->limit))
@@ -36,7 +36,7 @@
$options['offset'] = $request->offset;
}
- $treeViewObjects = $term->getChildYuiNodes($options);
+ $treeViewObjects = $this->resource->getChildYuiNodes($options);
return $this->renderText(json_encode($treeViewObjects));
}
Modified: trunk/apps/qubit/modules/term/actions/treeViewComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/treeViewComponent.class.php Mon Oct
25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/actions/treeViewComponent.class.php Mon Oct
25 12:33:39 2010 (r8476)
@@ -21,14 +21,14 @@
{
public function execute($request)
{
- $this->term = $request->getAttribute('term');
- if (!isset($this->term->id))
+ $this->resource = $request->getAttribute('term');
+ if (!isset($this->resource->id))
{
return sfView::NONE;
}
// Get term tree (limit to max 10 siblings and children)
- $this->treeViewObjects = $this->term->getFullYuiTree(10);
+ $this->treeViewObjects = $this->resource->getFullYuiTree(10);
// Check if treeview worth it
if (1 > count($this->treeViewObjects))
@@ -37,7 +37,7 @@
}
$this->treeViewExpands = array();
- foreach ($this->term->ancestors->andSelf()->orderBy('lft') as $item)
+ foreach ($this->resource->ancestors->andSelf()->orderBy('lft') as $item)
{
$this->treeViewExpands[$item->id] = $item->id;
}
Modified: trunk/apps/qubit/modules/term/templates/_contextMenu.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/_contextMenu.php Mon Oct 25
12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/templates/_contextMenu.php Mon Oct 25
12:33:39 2010 (r8476)
@@ -5,4 +5,4 @@
</div>
</div>
-<?php echo get_partial('term/format', array('parent' => $term)) ?>
+<?php echo get_partial('term/format', array('resource' => $resource)) ?>
Modified: trunk/apps/qubit/modules/term/templates/_format.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/_format.php Mon Oct 25 12:02:01
2010 (r8475)
+++ trunk/apps/qubit/modules/term/templates/_format.php Mon Oct 25 12:33:39
2010 (r8476)
@@ -1,20 +1,28 @@
<?php if (in_array('sfSkosPlugin',
$sf_context->getConfiguration()->getPlugins())): ?>
-<div class="section">
-<?php if (QubitAcl::check($parent, 'create')): ?>
- <h2><?php echo __('Import') ?></h2>
- <div class="content">
- <ul class="clearfix">
- <li><?php echo link_to(__('SKOS'), array($parent, 'module' =>
'sfSkosPlugin', 'action' => 'import')) ?></li>
- </ul>
- </div>
-<?php endif; ?>
- <h2><?php echo __('Export') ?></h2>
- <div class="content">
- <ul class="clearfix">
- <li><?php echo link_to(__('SKOS'), array($parent, 'module' =>
'sfSkosPlugin', 'sf_format' => 'xml')) ?></li>
- </ul>
- </div>
+ <?php if (QubitAcl::check($resource, 'create')): ?>
+ <div class="section">
+
+ <h2><?php echo __('Import') ?></h2>
+
+ <div class="content">
+ <ul class="clearfix">
+ <li><?php echo link_to(__('SKOS'), array($resource, 'module' =>
'sfSkosPlugin', 'action' => 'import')) ?></li>
+ </ul>
+ </div>
-</div>
+ </div>
+ <?php endif; ?>
+
+ <div class="section">
+
+ <h2><?php echo __('Export') ?></h2>
+
+ <div class="content">
+ <ul class="clearfix">
+ <li><?php echo link_to(__('SKOS'), array($resource, 'module' =>
'sfSkosPlugin', 'sf_format' => 'xml')) ?></li>
+ </ul>
+ </div>
+
+ </div>
<?php endif; ?>
Modified: trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/browseTermSuccess.php Mon Oct
25 12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/templates/browseTermSuccess.php Mon Oct
25 12:33:39 2010 (r8476)
@@ -1,6 +1,6 @@
<?php use_helper('Text') ?>
-<h1><?php echo render_title($term->taxonomy) ?> - <?php echo
render_title($term) ?></h1>
+<h1><?php echo render_title($resource->taxonomy) ?> - <?php echo
render_title($resource) ?></h1>
<div class="section">
<?php foreach ($informationObjects as $informationObject): ?>
@@ -56,7 +56,7 @@
<div class="content">
<ul class="clearfix links">
- <li><?php echo link_to(__('Browse all %1%', array('%1%' =>
render_title($term->taxonomy))), array($term->taxonomy, 'module' => 'taxonomy',
'action' => 'browse')) ?></li>
+ <li><?php echo link_to(__('Browse all %1%', array('%1%' =>
render_title($resource->taxonomy))), array($resource->taxonomy, 'module' =>
'taxonomy', 'action' => 'browse')) ?></li>
</ul>
</div>
Modified: trunk/apps/qubit/modules/term/templates/deleteSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/deleteSuccess.php Mon Oct 25
12:02:01 2010 (r8475)
+++ trunk/apps/qubit/modules/term/templates/deleteSuccess.php Mon Oct 25
12:33:39 2010 (r8476)
@@ -1,37 +1,37 @@
-<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' =>
render_title($term))) ?></h1>
+<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' =>
render_title($resource))) ?></h1>
-<?php if (0 < $term->getRelatedObjectCount()): ?>
+<?php if (0 < $resource->getRelatedObjectCount()): ?>
- <h2><?php echo __('This term is used in %1% descriptions. The term will be
deleted from these descriptions.', array('%1%' =>
$term->getRelatedObjectCount())) ?></h2>
+ <h2><?php echo __('This term is used in %1% descriptions. The term will be
deleted from these descriptions.', array('%1%' =>
$resource->getRelatedObjectCount())) ?></h2>
<?php echo __('The related object(s) will <strong>not</strong> be deleted')
?>
<?php endif; ?>
-<?php if (0 < count($term->events)): ?>
+<?php if (0 < count($resource->events)): ?>
- <h2><?php echo __('It\'s used in %1% events that will also be deleted',
array('%1%' => count($term->events))) ?></h2>
+ <h2><?php echo __('It\'s used in %1% events that will also be deleted',
array('%1%' => count($resource->events))) ?></h2>
<ul>
- <?php foreach ($term->events as $event): ?>
- <li><?php echo
Qubit::renderDateStartEnd($event->getDateDisplay(array('cultureFallback' =>
true)), $event->startDate, $event->endDate) ?> (<?php echo render_title($term)
?>) <?php echo link_to(render_title($event->informationObject),
array($event->informationObject, 'module' => 'informationobject')) ?></li><?php
endforeach; ?>
+ <?php foreach ($resource->events as $item): ?>
+ <li><?php echo
Qubit::renderDateStartEnd($item->getDateDisplay(array('cultureFallback' =>
true)), $item->startDate, $item->endDate) ?> (<?php echo
render_title($resource) ?>) <?php echo
link_to(render_title($item->informationObject), array($item->informationObject,
'module' => 'informationobject')) ?></li><?php endforeach; ?>
</ul>
<?php endif; ?>
-<?php if (0 < count($term->descendants)): ?>
+<?php if (0 < count($resource->descendants)): ?>
- <h2><?php echo __('It has %1% descendants that will also be deleted',
array('%1%' => count($term->descendants))) ?><h2>
+ <h2><?php echo __('It has %1% descendants that will also be deleted',
array('%1%' => count($resource->descendants))) ?><h2>
<ul>
- <?php foreach ($term->descendants as $descendant): ?>
- <li><?php echo link_to(render_title($descendant), array($descendant,
'module' => 'term')) ?></li>
+ <?php foreach ($resource->descendants as $item): ?>
+ <li><?php echo link_to(render_title($item), array($item, 'module' =>
'term')) ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
-<?php echo $form->renderFormTag(url_for(array($term, 'module' => 'term',
'action' => 'delete')), array('method' => 'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array($resource, 'module' => 'term',
'action' => 'delete')), array('method' => 'delete')) ?>
<div class="actions section">
@@ -39,7 +39,7 @@
<div class="content">
<ul class="clearfix links">
- <li><?php echo link_to(__('Cancel'), array($term, 'module' => 'term'))
?></li>
+ <li><?php echo link_to(__('Cancel'), array($resource, 'module' =>
'term')) ?></li>
<li><input class="form-submit" type="submit" value="<?php echo
__('Confirm') ?>"/></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.