function render () { // Extra data will be used to render multiple lines // If not set, create a single line if (!$this->extra) { $this->extra = sprintf('<tr>%s</tr>', $this->render_fields()); } return parent::render(); }
function PrintEditForm($id) { if ($data = $this->implementation->Read($id)) { $action = $this::$name . '/' . $id; $model = $this->PrepareModel(); $form = new ModelForm($model, "edit-form", $action, "PUT", $this::$name); $form->import_object($data); $form->render(); } else { echo "<div class=\"listtitle\"><span>Error - invalid id provided</span></div>"; } }
function editVideoPage() { $tp = $this->task_parts; $data = $this->implementation->Read($tp[1]); $model = $this->PrepareModel(); //$model['title'] = 'Cheese'; $action = 'video/' . $tp[1]; $form = new ModelForm($model, "add_form", $action, "PUT", 'video', "loadVideoPreview('" . $data->{'_id'} . "');"); $form->import_object($data); ?> <div class="row"> <div class="small-12 medium-12 large-8 column"> <?php $form->render(); ?> </div> <div class="small-12 medium-12 large-4 column video-info" id="video-preview-section"> <div class="video-preview-parent"> <div class="video-preview-container"> <div class="video-preview"></div> </div> </div> <div class="video-info-text"> </div> <div class="video-info-actions theme-color"></div> </div> <script> loadVideoPreview('<?php echo $data->{'_id'}; ?> '); </script> </div> <?php }