Ejemplo n.º 1
0
 /**
  * @param $route
  * @param $title
  * @param $label
  * @return string
  */
 protected function moveButton($route, $title, $label)
 {
     $content = '';
     $content .= $this->formBuilder->open(['method' => 'patch', 'url' => $route, 'class' => 'inline-block']);
     $content .= $this->htmlBuilder->tag('button', ['class' => 'btn btn-default btn-sm', 'type' => 'submit', 'data-toggle' => 'tooltip', 'title' => $title], $label);
     $content .= $this->formBuilder->close();
     return $content;
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function render()
 {
     $content = [];
     $content[] = $this->formBuilder->model($this->instance, ['method' => $this->method, 'url' => $this->saveUrl, 'errors' => $this->errors]);
     foreach ($this->items as $item) {
         $content[] = $item->render();
     }
     $content[] = $this->formBuilder->submitGroup($this->backUrl);
     $content[] = $this->formBuilder->close();
     return implode('', $content);
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function renderInline()
 {
     $content = [];
     $id = uniqid();
     $content[] = $this->formBuilder->model($this->instance, ['method' => $this->method, 'url' => $this->saveUrl, 'errors' => $this->errors, 'class' => 'form-horizontal form-bordered', 'id' => $id, 'onsubmit' => 'return inlineFormSubmit(event, \'' . $id . '\');']);
     foreach ($this->inlineItems as $item) {
         if (method_exists($item, 'inlineEdit')) {
             $item->inlineEdit(true);
         }
         $content[] = $item->render();
     }
     if (count($this->inlineItems) == 1) {
         if ($this->inlineItems[0] instanceof Checkbox) {
         } else {
             $content[] = view('admin::model/inline_edit_form_controls')->with('inline_controls', true);
         }
     } else {
         $content[] = view('admin::model/inline_edit_form_controls')->with('inline_controls', false);
     }
     $content[] = $this->formBuilder->close();
     $response = implode('', $content);
     return $response;
 }