<div class="control-group">
  <label class="control-label" for="module-page_cat_id">Category</label>
  <div class="controls">
    <?= $this->formSelect('module[page_cat_id]', ((empty($this->module->page_cat_id))? $this->page->id : $this->module->page_cat_id), array('class' => 'input-xxlarge required'), $this->categories); ?>
  </div>
</div>


<div class="control-group">
  <label class="control-label" for="module-title">Title</label>
  <div class="controls">
    <?= $this->inputText('module[title]', $this->module->title, array('class' => 'input-xxlarge required')); ?>
  </div>
</div>

<div class="control-group">
  <label class="control-label" for="module-folder">Folder</label>
  <div class="controls">
    <?= $this->inputText('module[folder]', $this->module->folder, array('class' => 'input-xxlarge required')); ?>
  </div>
</div>

<div class="control-group">
  <label class="control-label" for="module-status_id">Level</label>
  <div class="controls">
    <?= $this->formSelect('module[status_id]', $this->module->status_id, array('class' => 'input-xxlarge required'), $this->usergroups); ?>
  </div>
</div>


<div class="control-group">
  <label class="control-label" for="module-extras">Extras</label>
  <div class="controls">
    <label class="checkbox">
      <input type="checkbox" id="hidden" name="module[hidden]" value="1"<?= (($this->module->hidden == '1')? ' checked="yes"': '') ?> /> Hidden
    </label>
    <label class="checkbox">
      <input type="checkbox" id="online" name="module[online]" value="1"<?= (($this->module->online != '0')? ' checked="yes"': '') ?> /> Online
    </label>
  </div>

  <div class="control-group">
    <label class="control-label" for="fileInput">Image</label>
    <div class="controls">
      <input class="input-file" type="file" id="fileInput" name="image" />

     <span class="help-block">
       <? if(!empty($this->module->image)){ ?>
       <input type="hidden" name="module[old_image]" value="<?=$this->module->image;?>"/>
       <a href="<?=$this->urlTo("uploads/cms_pages/".$this->module->image);?>" target="_blank">Ver atual</a>
       <? } ?>
       Dimensions: 40x40px
       </span>
    </div>
  </div>
</div>

<input type='hidden' name='module[id]' value='<?= $this->module->id; ?>'/>