Author: sevein
Date: Tue Aug 16 16:41:49 2011
New Revision: 9511
Log:
Make right dialog capable to appear multiple times in the same page
Modified:
trunk/apps/qubit/modules/right/templates/_edit.php
Modified: trunk/apps/qubit/modules/right/templates/_edit.php
==============================================================================
--- trunk/apps/qubit/modules/right/templates/_edit.php Tue Aug 16 15:53:26
2011 (r9510)
+++ trunk/apps/qubit/modules/right/templates/_edit.php Tue Aug 16 16:41:49
2011 (r9511)
@@ -6,9 +6,11 @@
<?php use_helper('Javascript') ?>
+<?php $suffix = isset($tableId) ? "_$tableId" : ''; ?>
+
<div class="section">
- <table id="rightsDisplay">
+ <table id="rightsDisplay<?php echo $suffix ?>">
<caption>
<?php echo __('Rights records') ?>
</caption><thead>
@@ -67,7 +69,7 @@
{
$editButtonJs = <<<editButtonJs
// Add edit button to rows
-jQuery('#rightsDisplay tr[id]', context)
+jQuery('#rightsDisplay$suffix tr[id]', context)
.click(function ()
{
dialog.open(this.id);
@@ -79,12 +81,12 @@
}
echo javascript_tag(<<<content
-Drupal.behaviors.rights = {
+Drupal.behaviors.rights$suffix = {
attach: function (context)
{
// Define dialog
- var dialog = new QubitDialog('updateRights', {
- 'displayTable': 'rightsDisplay',
+ var dialog = new QubitDialog('updateRights$suffix', {
+ 'displayTable': 'rightsDisplay$suffix',
'newRowTemplate': $rowTemplate,
'height': '400px',
'showEvent': function()
@@ -118,7 +120,7 @@
) ?>
<!-- NOTE dialog.js wraps this *entire* table in a YUI dialog -->
- <div class="section" id="updateRights">
+ <div class="section" id="updateRights<?php echo $suffix ?>">
<h3><?php echo __('Rights') ?></h3>
--
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.