Author: david
Date: 2008-11-12 15:55:51 -0800 (Wed, 12 Nov 2008)
New Revision: 1583
Modified:
trunk/qubit/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
Log:
Tweak appearance of actor contextMenu:
- Change list of related events into an HTML unordered list <ul>
- Add grey border that is used for info object and repository context menus
- Don't show _contextMenu template if there are no items to show (hide the grey
box if it's empty)
Modified:
trunk/qubit/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
2008-11-12 23:27:05 UTC (rev 1582)
+++ trunk/qubit/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
2008-11-12 23:55:51 UTC (rev 1583)
@@ -21,6 +21,12 @@
/**
* Actor contextMenu component
+ *
+ * @package qubit
+ * @subpackage actor
+ * @version svn: $Id$
+ * @author Peter Van Garderen <[EMAIL PROTECTED]>
+ * @author David Juhasz <[EMAIL PROTECTED]>
*/
class ActorContextMenuComponent extends sfComponent
{
@@ -32,19 +38,28 @@
$this->repository =
QubitRepository::getById($request->getParameter('id'));
- $this->informationObjectRelations =
$this->actor->getInformationObjectRelations();
+ if (null !== $this->actor)
+ {
+ $this->informationObjectRelations =
$this->actor->getInformationObjectRelations();
- $relatedInfoObjects = array();
- foreach ($this->actor->getInformationObjectRelations() as $relation)
- {
- $relatedInfoObjects[$relation->getType()->getRole()][] = $relation;
+ $relatedInfoObjects = array();
+ foreach ($this->actor->getInformationObjectRelations() as $relation)
+ {
+ $relatedInfoObjects[$relation->getType()->getRole()][] = $relation;
+ }
+ $this->relatedInfoObjects = $relatedInfoObjects;
}
- $this->relatedInfoObjects = $relatedInfoObjects;
}
else
{
$this->relatedInfoObjects = null;
$this->repository = null;
}
+
+ // Don't show anything if there are no related info objects or repository
+ if (count($this->relatedInfoObjects) == 0 && count($this->repository) == 0)
+ {
+ return sfView::NONE;
+ }
}
}
\ No newline at end of file
Modified: trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
2008-11-12 23:27:05 UTC (rev 1582)
+++ trunk/qubit/apps/qubit/modules/actor/templates/_contextMenu.php
2008-11-12 23:55:51 UTC (rev 1583)
@@ -1,4 +1,5 @@
-<div class="contextMenu">
+<div class="context-column-box">
+ <div class="contextMenu">
<?php if ($repository): ?>
<div class="label">
<?php echo __('%1% information', array('%1%' =>
sfConfig::get('app_ui_label_repository'))) ?>
@@ -11,11 +12,12 @@
<div class="label">
<?php echo __('%1% of', array('%1%' => $role)) ?>
</div>
+ <ul>
<?php foreach($relations as $relation): ?>
- <div>
- <?php echo link_to($relation->getInformationObject(),
'informationobject/show?id='.$relation->getInformationObjectId()) ?>
- </div>
+ <li><?php echo link_to($relation->getInformationObject(),
'informationobject/show?id='.$relation->getInformationObjectId()) ?></li>
<?php endforeach; ?>
+ </ul>
<?php endforeach; ?>
<?php endif; ?>
-</div>
+ </div>
+</div>
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---