Author: sevein
Date: Wed Feb 16 10:20:59 2011
New Revision: 8984
Log:
Add "Subject of" block to context menu for authority records. Fixes issue 1132.
Thanks to Wu.
Modified:
trunk/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
trunk/apps/qubit/modules/actor/templates/_contextMenu.php
trunk/apps/qubit/modules/informationobject/templates/_nameAccessPoints.php
Modified: trunk/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
Wed Feb 16 00:02:26 2011 (r8983)
+++ trunk/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
Wed Feb 16 10:20:59 2011 (r8984)
@@ -49,5 +49,15 @@
{
$this->relatedInfoObjects[$item->type->getRole()][] =
$item->informationObject;
}
+
+ $criteria = new Criteria;
+ $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
+ $criteria->add(QubitRelation::TYPE_ID, QubitTerm::NAME_ACCESS_POINT_ID);
+
+ $this->subjectInfoObjects = array();
+ foreach (QubitRelation::getBySubjectOrObjectId($this->resource->id) as
$item)
+ {
+ $this->subjectInfoObjects[] = $item->subject;
+ }
}
}
Modified: trunk/apps/qubit/modules/actor/templates/_contextMenu.php
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/_contextMenu.php Wed Feb 16
00:02:26 2011 (r8983)
+++ trunk/apps/qubit/modules/actor/templates/_contextMenu.php Wed Feb 16
10:20:59 2011 (r8984)
@@ -1,3 +1,14 @@
+<div class="section">
+ <h3><?php echo __('Subject of') ?></h3>
+ <div>
+ <ul>
+ <?php foreach ($subjectInfoObjects as $item): ?>
+ <li><?php echo link_to(render_title($item), array($item, 'module' =>
'informationobject')) ?></li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+</div>
+
<?php foreach ($relatedInfoObjects as $role => $informationObjects): ?>
<div>
<h3><?php echo __('%1% of', array('%1%' => $role)) ?></h3>
Modified:
trunk/apps/qubit/modules/informationobject/templates/_nameAccessPoints.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_nameAccessPoints.php
Wed Feb 16 00:02:26 2011 (r8983)
+++ trunk/apps/qubit/modules/informationobject/templates/_nameAccessPoints.php
Wed Feb 16 10:20:59 2011 (r8984)
@@ -11,7 +11,7 @@
<?php foreach ($resource->relationsRelatedBysubjectId as $item): ?>
<?php if (QubitTerm::NAME_ACCESS_POINT_ID == $item->type->id): ?>
- <li><?php echo link_to(render_title($item->object),
array($item->object, 'module' => 'actor')) ?></li>
+ <li><?php echo link_to(render_title($item->object),
array($item->object, 'module' => 'actor')) ?><span class="note2"> (<?php echo
__('Subject') ?>)</span></li>
<?php endif; ?>
<?php endforeach; ?>
--
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.