Author: sevein
Date: Tue Aug 16 16:42:26 2011
New Revision: 9512

Log:
Adding right component to digital object representations

Modified:
   trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php
   trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php

Modified: trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Tue Aug 
16 16:41:49 2011        (r9511)
+++ trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Tue Aug 
16 16:42:26 2011        (r9512)
@@ -104,12 +104,20 @@
         $this->form->setValidator($derName, new sfValidatorBoolean);
         $this->form->setWidget($derName, new 
sfWidgetFormInputCheckbox(array(), array('value' => 1)));
       }
+      // Otherwise, load right component
+      else
+      {
+        $this["rightEditComponent_$usageId"] = new 
RightEditComponent($this->context, 'right', 'edit');
+        $this["rightEditComponent_$usageId"]->resource = $representation;
+        $this["rightEditComponent_$usageId"]->execute($this->request);
+      }
     }
   }
 
   public function execute($request)
   {
     $this->form = new sfForm;
+    $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
 
     $this->resource = new QubitDigitalObject;
 

Modified: trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php    Tue Aug 
16 16:41:49 2011        (r9511)
+++ trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php    Tue Aug 
16 16:42:26 2011        (r9512)
@@ -25,7 +25,9 @@
     <?php echo $form->mediaType->renderRow() ?>
 
     <?php if ($showCompoundObjectToggle): ?>
-      <?php echo $form->displayAsCompound->label(__('View children as a 
compound digital object?'))->renderRow() ?>
+      <?php echo $form->displayAsCompound
+        ->label(__('View children as a compound digital object?'))
+        ->renderRow() ?>
     <?php endif; ?>
 
   </fieldset>
@@ -40,6 +42,9 @@
 
         <?php echo get_component('digitalobject', 'editRepresentation', 
array('resource' => $resource, 'representation' => $representation)) ?>
 
+        <?php $rightComponent = "rightEditComponent_$usageId" ?>
+        <?php echo get_partial('right/edit', 
$$rightComponent->getVarHolder()->getAll() + array('tableId' => $usageId)) ?>
+
       <?php else: ?>
 
         <?php echo $form["repFile_$usageId"]

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