dynamic form rendering for template

bootstrap datetime widget.

jquery update is needed, testing with hosted jquery first.
This commit is contained in:
Naomi 2013-07-26 17:33:17 -04:00
parent c7b5592fa9
commit 46ecdf393d
11 changed files with 10512 additions and 69 deletions

View file

@ -1,3 +1,60 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong" id="edit-history-file">
<?php echo $this->form; ?>
</div>
<form>
<?php $form = $this->element ?>
<dl class="zend_form">
<?php $name = "his_item_id"; ?>
<dd id="<?php echo $name;?>-element">
<?php echo $form->getElement($name); ?>
</dd>
<?php foreach (array("his_item_starts", "his_item_ends") as $name): ?>
<dt id="<?php echo $name;?>-label">
<label for="<?php echo $name;?>"><?php echo $form->getElement($name)->getLabel() ?></label>
</dt>
<dd id="<?php echo $name;?>-element">
<div class="well">
<div id="<?php echo $name;?>_datetimepicker" class="input-append date">
<?php echo $form->getElement($name) ?>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
</div>
<?php if ($form->getElement($name)->hasErrors()) : ?>
<ul class='errors'>
<?php foreach ($form->getElement($name)->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach;?>
<?php foreach ($form->getSubForm('his_item_template') as $index=>$el): ?>
<?php $name = $el->getName(); ?>
<dt id="<?php echo $name;?>-label">
<label for="<?php echo $name;?>"><?php echo $el->getLabel() ?></label>
</dt>
<dd id="<?php echo $name;?>-element">
<?php echo $el ?>
<?php if ($el->hasErrors()): ?>
<ul class='errors'>
<?php foreach($el->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach; ?>
<dd id="submitButtons-element">
<?php foreach (array("his_item_save", "his_item_cancel") as $name): ?>
<?php echo $form->getElement($name); ?>
<?php endforeach;?>
</dd>
</dl>
</form>