Author: jablko
Date: Wed Sep 2 17:05:54 2009
New Revision: 3151
Log:
Add header, <form> tag, and save and cancel actions to edit digital object page
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 Wed Sep
2 17:04:57 2009 (r3150)
+++ trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Wed Sep
2 17:05:54 2009 (r3151)
@@ -55,6 +55,8 @@
}
}
+ $this->form = new sfForm;
+
// Get 'show as compound digital object' toggle value
$compoundDigitalObject =
QubitProperty::getOneByObjectIdAndName($this->informationObject->getId(),
'display_as_compound_object');
if (!is_null($compoundDigitalObject))
Modified: trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php Wed Sep
2 17:04:57 2009 (r3150)
+++ trunk/apps/qubit/modules/digitalobject/templates/editSuccess.php Wed Sep
2 17:05:54 2009 (r3151)
@@ -1,13 +1,9 @@
-<?php if ($showCompoundObjectToggle): ?>
-<div class="form-item">
- <label for="display_as_compound_object"><?php echo __('view children as a
compound digital object?') ?></label>
- <?php echo radiobutton_tag('display_as_compound_object', '1',
$isCompoundDigitalObject); ?> <?php echo __('yes') ?><br />
- <?php echo radiobutton_tag('display_as_compound_object', '0',
!$isCompoundDigitalObject) ?> <?php echo __('no') ?>
-</div>
-<?php endif; ?>
+<h1><?php echo __('Edit digital object') ?></h1>
+
+<?php if (isset($sf_request->id)): ?>
+
+ <?php echo $form->renderFormTag(url_for(array('module' => 'digitalobject',
'action' => 'edit', 'id' => $sf_request->id))) ?>
-<?php if (count($digitalObject)): ?>
- <!-- Display/edit digital object representations -->
<?php foreach ($representations as $usageId => $representation): ?>
<?php if (is_object($representation) && $representation->getId()): ?>
<?php include_component('digitalobject', 'editRepresentation',
@@ -31,9 +27,33 @@
</div>
<?php endif; ?>
<?php endforeach; ?>
+
<?php else: ?>
+
+ <?php echo $form->renderFormTag(url_for(array('module' => 'digitalobject',
'action' => 'create'))) ?>
+
<div class="form-item">
<label for="upload"><?php echo __('upload') ?></label>
<?php include_component('digitalobject', 'upload',
array('informationObject'=>$informationObject)) ?>
</div>
-<?php endif; ?>
\ No newline at end of file
+
+<?php endif; ?>
+
+<?php if ($showCompoundObjectToggle): ?>
+<div class="form-item">
+ <label for="display_as_compound_object"><?php echo __('view children as a
compound digital object?') ?></label>
+ <?php echo radiobutton_tag('display_as_compound_object', '1',
$isCompoundDigitalObject); ?> <?php echo __('yes') ?><br />
+ <?php echo radiobutton_tag('display_as_compound_object', '0',
!$isCompoundDigitalObject) ?> <?php echo __('no') ?>
+</div>
+<?php endif; ?>
+
+ <ul class="actions">
+ <li><?php echo link_to(__('Cancel'), array('module' =>
'informationobject', 'action' => 'show', 'id' => $informationObject->id))
?></li>
+ <?php if (isset($sf_request->id)): ?>
+ <li><?php echo submit_tag(__('Save')) ?></li>
+ <?php else: ?>
+ <li><?php echo submit_tag(__('Create')) ?></li>
+ <?php endif; ?>
+ </ul>
+
+</form>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---