Beispiel #1
0
    function render()
    {
        $this->view->headLink()->appendStylesheet('/css/express-table/style.css');
        $formGroups = $this->_config->getFormGroups($this->_uiName);
        // print_r($formGroups);
        ?>
		<style >
dt{
	display:none;
}
        </style>
        
        <form id='<?php 
        echo $this->_form_id;
        ?>
' method="post" class='form-horizontal' role="form" action="<?php 
        echo $this->view->url();
        ?>
" >
   
          
      
        <?php 
        $index = 0;
        foreach ($formGroups as $groups) {
            ?>
           
           <fieldset>
      <h5><?php 
            echo $groups['label'];
            ?>
</h5> 
      
          <?php 
            foreach ($this->_config->getFormGroupElements($this->_uiName, $index) as $elementid) {
                $prop = $this->_config->getPropByName($elementid);
                $element = $this->getFormElement($elementid, $prop);
                $isRequired = true;
                if ($element instanceof Zend_Form_Element) {
                    $isRequired = $element->isRequired();
                }
                if (!$prop->isAllowEdit) {
                    continue;
                }
                $style = "";
                if ($prop->input == 'hidden') {
                    $style = 'display: none;';
                }
                ?>
         <div class="form-group">
                <label for="<?php 
                echo $elementid;
                ?>
" class="col-sm-2 control-label">
               <?php 
                echo $this->view->translate($prop->label);
                ?>
 
               <?php 
                if ($isRequired and $prop->modification == 'changeable') {
                    echo "<span style='color: red;'>*<span>";
                }
                ?>
                </label>
              
               <div class="col-sm-10">
               <?php 
                if (true == $this->_form->isEditForm()) {
                    if ('readonly' == $prop->modification) {
                        $value = $element->getValue();
                        echo $this->_config->fieldTranform($elementid, $value);
                        echo "<input id='{$elementid}' name='{$elementid}' type='hidden' value='{$value}'>";
                    } else {
                        echo $element;
                    }
                } else {
                    echo $element;
                }
                ?>
  </div>
         </div>
         <?php 
            }
            ?>
        
        
        
        
        
        </fieldset>
        <?php 
            $index += 1;
        }
        ?>
        
        
        </form>
<?php 
        $this->view->jQuery()->onLoadCaptureStart();
        ?>
$('form#<?php 
        echo $this->_form_id;
        ?>
').find('dt').remove();

	   $('#SaveButton').unbind().bind('click',function(){ 
          $('form#<?php 
        echo $this->_form_id;
        ?>
').submit();
	      
	      });
	      

<?php 
        $this->view->jQuery()->onLoadCaptureEnd();
        ?>


<?php 
    }