From: Vincent Vanwaelscappel Date: Tue, 21 May 2019 16:07:49 +0000 (+0200) Subject: #2783 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8ad83be8b50a484c88131a1e84f0d262ed3a7879;p=cubist_cms-back.git #2783 --- diff --git a/src/app/Http/Controllers/CubistCrud.php b/src/app/Http/Controllers/CubistCrud.php new file mode 100644 index 0000000..1396beb --- /dev/null +++ b/src/app/Http/Controllers/CubistCrud.php @@ -0,0 +1,27 @@ + $field['name'], 'label' => $field['label'], 'type' => 'text']; + if (isset($field['column'])) { + unset($field['column']); + } + if (isset($field['column_label'])) { + $column_data['label'] = $field['column_label']; + unset($field['column_label']); + } + if (isset($field['column_type'])) { + $column_data['type'] = $field['column_type']; + unset($column_data['type']); + } + $this->crud->addColumn($column_data); + } + $this->crud->addField($field, $form); + } +} diff --git a/src/app/Http/Controllers/CubistCrudController.php b/src/app/Http/Controllers/CubistCrudController.php deleted file mode 100644 index b974569..0000000 --- a/src/app/Http/Controllers/CubistCrudController.php +++ /dev/null @@ -1,27 +0,0 @@ - $field['name'], 'label' => $field['label'], 'type' => 'text']; - if (isset($field['column'])) { - unset($field['column']); - } - if (isset($field['column_label'])) { - $column_data['label'] = $field['column_label']; - unset($field['column_label']); - } - if (isset($field['column_type'])) { - $column_data['type'] = $field['column_type']; - unset($column_data['type']); - } - $this->crud->addColumn($column_data); - } - $this->crud->addField($field, $form); - } -} diff --git a/src/app/Http/Controllers/CubistModelCrudController.php b/src/app/Http/Controllers/CubistModelCrudController.php index c944fbe..f4d3417 100644 --- a/src/app/Http/Controllers/CubistModelCrudController.php +++ b/src/app/Http/Controllers/CubistModelCrudController.php @@ -16,7 +16,7 @@ use Backpack\CRUD\CrudPanel; */ class CubistModelCrudController extends CrudController { - use CubistCrudController; + use CubistCrud; public function setup() { diff --git a/src/app/Http/Controllers/CubistPageCrudController.php b/src/app/Http/Controllers/CubistPageCrudController.php index 28e167c..853f414 100644 --- a/src/app/Http/Controllers/CubistPageCrudController.php +++ b/src/app/Http/Controllers/CubistPageCrudController.php @@ -8,6 +8,7 @@ use Illuminate\Support\Str; class CubistPageCrudController extends PageCrudController { + use CubistCrud; protected static $_templates = null; /** @@ -38,7 +39,7 @@ class CubistPageCrudController extends PageCrudController /** * Add the fields defined for a specific template. * - * @param string $template_name The name of the template that should be used in the current form. + * @param string $template_name The name of the template that should be used in the current form. */ public function useTemplate($template_name = false) {