Author: sevein
Date: Thu Dec  3 16:19:59 2009
New Revision: 4072

Log:
Putting single and multiple uploads together (issue 1097).

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

Modified: trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Thu Dec 
 3 16:18:11 2009        (r4071)
+++ trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Thu Dec 
 3 16:19:59 2009        (r4072)
@@ -135,13 +135,29 @@
         $this->forward404();
       }
 
+      // Single upload
       $this->form->setValidator('file', new sfValidatorFile);
       $this->form->setWidget('file', new sfWidgetFormInputFile);
 
+      // Multi-upload
       $this->form->setValidator('informationObject', new sfValidatorPass);
       $this->form->setWidget('informationObject', new sfWidgetFormInputHidden);
       $this->form->setDefault('informationObject', 
$this->informationObject->id);
 
+      $this->form->setValidator('title', new sfValidatorPass);
+      $this->form->setWidget('title', new sfWidgetFormInput(array(), 
array('onkeyup' => 'renumerateUploads()')));
+      $this->form->setDefault('title', 'image %dd%');
+      $this->form->setValidator('levelOfDescription', new sfValidatorString);
+
+      $choices = array();
+      $choices[null] = null;
+      foreach 
(QubitTaxonomy::getTermsById(QubitTaxonomy::LEVEL_OF_DESCRIPTION_ID) as $term)
+      {
+        $choices[$this->context->routing->generate(null, array('module' => 
'term', 'action' => 'show', 'id' => $term->id))] = $term;
+      }
+
+      $this->form->setWidget('levelOfDescription', new 
sfWidgetFormSelect(array('choices' => $choices)));
+
       $this->setTemplate('uploadForm');
     }
 

Modified: trunk/apps/qubit/modules/digitalobject/templates/uploadFormSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/uploadFormSuccess.php      
Thu Dec  3 16:18:11 2009        (r4071)
+++ trunk/apps/qubit/modules/digitalobject/templates/uploadFormSuccess.php      
Thu Dec  3 16:19:59 2009        (r4072)
@@ -4,11 +4,43 @@
 <?php echo $form->renderFormTag(url_for(array('module' => 'digitalobject', 
'action' => 'create'))) ?>
 <?php echo $form->renderHiddenFields() ?>
 
-<div class="form-item">
-<?php echo $form->file->label(__('Select a digital object to 
upload'))->renderLabel() ?>
-<?php echo $form->file->render() ?>
-<span class="note"><?php echo __('max. file size ~%1%', array('%1%' => 
hr_filesize($maxUploadSize))) ?></span>
-</div>
+<fieldset class="collapsible">
+  <legend><?php echo __('Upload a single digital object') ?></legend>
+
+  <div class="form-item">
+  <?php echo $form->file->label(__('Select a digital object to 
upload'))->renderLabel() ?>
+  <?php echo $form->file->render() ?>
+  <span class="note"><?php echo __('max. file size ~%1%', array('%1%' => 
hr_filesize($maxUploadSize))) ?></span>
+  </div>
+
+</fieldset>
+
+<fieldset class="collapsible">
+  <legend><?php echo __('Import multiple digital objects') ?></legend>
+
+  <div class="form-item">
+    <?php echo $form->title->label(__('Title'))->renderLabel() ?></label>
+    <?php echo $form->title->render() ?>
+    <span class="note"><?php echo __('The "<b>%dd%</b>" placeholder will be 
replaced with a incremental number (e.g. \'image <b>01</b>\', \'image 
<b>02</b>\')')?></span>
+  </div>
+
+  <div class="form-item">
+    <?php echo $form->levelOfDescription->label(__('Level of 
description'))->renderLabel() ?></label>
+    <?php echo $form->levelOfDescription->render() ?>
+  </div>
+
+  <div class="form-item">
+    <div id="uploads"></div>
+    <br style="clear: both" />
+    <div id="uiElements" style="display:inline;">
+      <div id="uploaderContainer">
+         <div id="uploaderOverlay" style="position:absolute; z-index:2"></div>
+         <div id="selectFilesLink" style="z-index:1"><a id="selectLink" 
href="#">Select Files</a></div>
+      </div>
+    </div>
+  </div>
+
+</fieldset>
 
 <ul class="actions">
   <li><?php echo link_to(__('Cancel'), array('module' => 'informationobject', 
'action' => 'show', 'id' => $informationObject->id)) ?></li>

--

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