function printView() { if (is_null($this->fields)) { return; } if (empty($this->fields)) { ?> <p><i>No custom fields have been set up in the system yet.</i></p> <?php } $field = new Custom_Field(); $this->fields['_new_'] = $field; ?> <form method="post"> <table id="custom-fields-editor" class="table table-auto-width expandable valign-top"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Type</th> <th>Multi?</th> <th>Parameters</th> <th><i class="icon-trash"></i></th> </tr> </thead> <tbody> <?php $i = 0; foreach ($this->fields as $field) { $prefix = 'fields_' . $i . '_'; ?> <tr> <td class="cursor-move"> <?php echo $field->id; print_hidden_field($prefix . 'id', $field->id); print_hidden_field('index[]', $i); ?> </td> <td> <?php $field->printFieldInterface('name', $prefix); ?> </td> <td> <?php if ($field->id) { $field->printFieldValue('type'); } else { $field->printFieldInterface('type', $prefix); } ?> </td> <td class="center"> <?php $field->printFieldInterface('allow_multiple', $prefix); ?> </td> <td> <?php $field->printFieldInterface('params', $prefix); ?> </td> <td class="center"> <?php if ($field->id) { ?> <input type="checkbox" name="<?php echo $prefix; ?> delete" value="1" data-toggle="strikethrough" data-target="row" title="Click to delete this field" /> <?php } ?> </td> </tr> <?php $i++; } ?> </tbody> </table> <input type="submit" class="btn" value="Save" /> </form> <?php }