├── Plugin.php ├── README.md ├── assets └── css │ └── main.css ├── controllers ├── Groups.php ├── Properties.php ├── groups │ ├── _field_properties.htm │ ├── _list_toolbar.htm │ ├── config_form.yaml │ ├── config_list.yaml │ ├── config_relation.yaml │ ├── create.htm │ ├── index.htm │ ├── preview.htm │ └── update.htm └── properties │ ├── _list_toolbar.htm │ ├── _reorder_toolbar.htm │ ├── config_form.yaml │ ├── config_list.yaml │ ├── config_reorder.yaml │ ├── create.htm │ ├── index.htm │ ├── preview.htm │ ├── reorder.htm │ └── update.htm ├── docs ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── 5.png ├── lang ├── en │ └── lang.php └── ru │ └── lang.php ├── models ├── Group.php ├── Property.php ├── group │ ├── columns.yaml │ └── fields.yaml └── property │ ├── columns.yaml │ └── fields.yaml ├── plugin.yaml └── updates ├── builder_table_create_shohabbos_customfields_groups.php ├── builder_table_create_shohabbos_customfields_properties.php ├── builder_table_update_shohabbos_customfields_groups.php ├── builder_table_update_shohabbos_customfields_groups_2.php ├── builder_table_update_shohabbos_customfields_groups_3.php ├── builder_table_update_shohabbos_customfields_groups_4.php ├── builder_table_update_shohabbos_customfields_properties.php ├── builder_table_update_shohabbos_customfields_properties_10.php ├── builder_table_update_shohabbos_customfields_properties_11.php ├── builder_table_update_shohabbos_customfields_properties_12.php ├── builder_table_update_shohabbos_customfields_properties_2.php ├── builder_table_update_shohabbos_customfields_properties_3.php ├── builder_table_update_shohabbos_customfields_properties_4.php ├── builder_table_update_shohabbos_customfields_properties_5.php ├── builder_table_update_shohabbos_customfields_properties_6.php ├── builder_table_update_shohabbos_customfields_properties_7.php ├── builder_table_update_shohabbos_customfields_properties_8.php ├── builder_table_update_shohabbos_customfields_properties_9.php └── version.yaml /Plugin.php: -------------------------------------------------------------------------------- 1 | addCss('/plugins/shohabbos/customfields/assets/css/main.css'); 26 | }); 27 | 28 | Page::extend(function($model) { 29 | // add method 30 | $model->addDynamicMethod('getCustomfieldsAttribute', function() use ($model) { 31 | $pageId = str_replace(".htm", "", $model->fileName); 32 | return Group::where('page', $pageId)->get(); 33 | }); 34 | 35 | // add method 36 | $model->addDynamicMethod('listLayoutSyntaxFields', function() use ($model) { 37 | $layout = $model->layout; 38 | 39 | if (!$layout) { 40 | $layouts = $model->getLayoutOptions(); 41 | $layout = count($layouts) ? array_keys($layouts)[0] : null; 42 | } 43 | 44 | if (!$layout) { 45 | return []; 46 | } 47 | 48 | $layout = Layout::load($model->theme, $layout); 49 | if (!$layout) { 50 | return []; 51 | } 52 | 53 | $syntax = SyntaxParser::parse($layout->markup, ['tagPrefix' => 'page:']); 54 | $result = $syntax->toEditor(); 55 | 56 | return $result; 57 | }); 58 | 59 | // add translatable fields 60 | $model->bindEvent('model.afterFetch', function() use ($model) { 61 | $translatable = $model->translatable; 62 | 63 | foreach ($model->customfields as $value) { 64 | if ($value->is_repeater) { 65 | $translatable[] = $value->code; 66 | continue; 67 | } 68 | 69 | foreach ($value->properties as $property) { 70 | if ($property->is_translatable) { 71 | $translatable[] = $value->code."_".$property->name; 72 | } 73 | } 74 | } 75 | 76 | foreach ($model->listLayoutSyntaxFields() as $fieldCode => $fieldConfig) { 77 | $translatable[] = "layout_".$fieldCode; 78 | } 79 | 80 | $model->addDynamicProperty('translatable', $translatable); 81 | }); 82 | 83 | $model->bindEvent('model.beforeSave', function () use ($model) { 84 | 85 | if ($model->markup != $model->original['markup']) { 86 | $model->markup == $model->original['markup']; 87 | } 88 | 89 | if ($model->code != $model->original['code']) { 90 | $model->code == $model->original['code']; 91 | } 92 | 93 | }); 94 | 95 | }); 96 | 97 | 98 | \Event::listen('backend.form.extendFieldsBefore', function ($widget) { 99 | if (!$widget->model instanceof \Cms\Classes\Page) { 100 | return; 101 | } 102 | 103 | if (!($theme = Theme::getEditTheme())) { 104 | throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); 105 | } 106 | 107 | if ($widget->isNested) { 108 | return; 109 | } 110 | 111 | // add layout syntax fields 112 | $fields = $widget->model->listLayoutSyntaxFields(); 113 | foreach ($fields as $fieldCode => $fieldConfig) { 114 | if ($fieldConfig['type'] == 'fileupload') continue; 115 | 116 | if ($fieldConfig['type'] == 'repeater') { 117 | $fieldConfig['form']['fields'] = array_get($fieldConfig, 'fields', []); 118 | unset($fieldConfig['fields']); 119 | } 120 | 121 | $fieldConfig['comment'] = isset($fieldConfig['comment']) 122 | ? $fieldConfig['comment']."{{ this.page.layout_{$fieldCode} }}" 123 | : "{{ this.page.layout_{$fieldCode} }}"; 124 | 125 | $widget->tabs['fields']['settings[layout_' . $fieldCode . ']'] = $fieldConfig; 126 | } 127 | 128 | // add custom fields 129 | $customfields = $widget->model->customfields; 130 | if (empty($customfields)) { 131 | return; 132 | } 133 | 134 | foreach ($customfields as $value) { 135 | if ($value->is_repeater) { 136 | $repeater = [ 137 | 'label' => $value->name, 138 | 'type' => 'repeater', 139 | 'comment' => "{{ viewBag.{$value->code} }}", 140 | 'tab' => $value->name, 141 | 'form' => ['fields' => []], 142 | 'cssClass' => 'custom-field', 143 | ]; 144 | 145 | foreach ($value->properties as $property) { 146 | $repeater['form']['fields'][$property->name] = [ 147 | 'label' => $property->label, 148 | 'type' => $property->type, 149 | 'comment' => $property->comment, 150 | 'default' => $property->default, 151 | ]; 152 | } 153 | 154 | if ($value->position == 'secondary') { 155 | $widget->secondaryTabs['fields']["viewBag[{$value->code}]"] = $repeater; 156 | } else { 157 | $widget->tabs['fields']["viewBag[{$value->code}]"] = $repeater; 158 | } 159 | continue; 160 | } 161 | 162 | foreach ($value->properties as $property) { 163 | $field = [ 164 | 'label' => $property->label, 165 | 'type' => $property->type, 166 | 'comment' => $property->comment." - {{ this.page.{$value->code}_{$property->name} }}", 167 | 'default' => $property->default, 168 | 'tab' => $value->name, 169 | 'cssClass' => 'custom-field', 170 | ]; 171 | 172 | if ($value->position == 'secondary') { 173 | $widget->secondaryTabs['fields']["settings[{$value->code}_{$property->name}]"] = $field; 174 | } else { 175 | $widget->tabs['fields']["settings[{$value->code}_{$property->name}]"] = $field; 176 | } 177 | } 178 | } 179 | 180 | // hide code content 181 | $user = \BackendAuth::getUser(); 182 | if (!$user->hasAccess('manage_cms_code_content')) { 183 | $widget->secondaryTabs['cssClass'] = 'hidden'; 184 | } 185 | 186 | }); 187 | 188 | } 189 | 190 | 191 | 192 | } 193 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # oc-customfields-plugin 2 | This plugin allows add custom fields to CMS page 3 | -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | .secondary-tabs .custom-field { 2 | padding: 20px; 3 | } -------------------------------------------------------------------------------- /controllers/Groups.php: -------------------------------------------------------------------------------- 1 | relationRender('properties') ?> -------------------------------------------------------------------------------- /controllers/groups/_list_toolbar.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 | 18 |
19 | -------------------------------------------------------------------------------- /controllers/groups/config_form.yaml: -------------------------------------------------------------------------------- 1 | name: Groups 2 | form: $/shohabbos/customfields/models/group/fields.yaml 3 | modelClass: Shohabbos\Customfields\Models\Group 4 | defaultRedirect: shohabbos/customfields/groups 5 | create: 6 | redirect: 'shohabbos/customfields/groups/update/:id' 7 | redirectClose: shohabbos/customfields/groups 8 | update: 9 | redirect: shohabbos/customfields/groups 10 | redirectClose: shohabbos/customfields/groups 11 | -------------------------------------------------------------------------------- /controllers/groups/config_list.yaml: -------------------------------------------------------------------------------- 1 | list: $/shohabbos/customfields/models/group/columns.yaml 2 | modelClass: Shohabbos\Customfields\Models\Group 3 | title: Groups 4 | noRecordsMessage: 'backend::lang.list.no_records' 5 | showSetup: true 6 | showCheckboxes: true 7 | recordsPerPage: 20 8 | toolbar: 9 | buttons: list_toolbar 10 | search: 11 | prompt: 'backend::lang.list.search_prompt' 12 | recordUrl: 'shohabbos/customfields/groups/update/:id' 13 | -------------------------------------------------------------------------------- /controllers/groups/config_relation.yaml: -------------------------------------------------------------------------------- 1 | # =================================== 2 | # Relation Behavior Config 3 | # =================================== 4 | 5 | properties: 6 | label: Property 7 | manage: 8 | form: $/shohabbos/customfields/models/property/fields.yaml 9 | list: $/shohabbos/customfields/models/property/columns.yaml 10 | view: 11 | list: $/shohabbos/customfields/models/property/columns.yaml 12 | toolbarButtons: create|delete -------------------------------------------------------------------------------- /controllers/groups/create.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 | 'layout']) ?> 11 | 12 |
13 | formRender() ?> 14 |
15 | 16 |
17 |
18 | 26 | 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | 44 |

fatalError)) ?>

45 |

46 | -------------------------------------------------------------------------------- /controllers/groups/index.htm: -------------------------------------------------------------------------------- 1 | listRender() ?> 2 | -------------------------------------------------------------------------------- /controllers/groups/preview.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 |
11 | formRenderPreview() ?> 12 |
13 | 14 | 15 |

fatalError) ?>

16 | 17 | 18 |

19 | 20 | 21 | 22 |

-------------------------------------------------------------------------------- /controllers/groups/update.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 | 'layout']) ?> 11 | 12 |
13 | formRender() ?> 14 |
15 | 16 |
17 |
18 | 27 | 36 | 43 | 44 | 45 | 46 | 47 |
48 |
49 | 50 | 51 | 52 |

fatalError)) ?>

53 |

54 | -------------------------------------------------------------------------------- /controllers/properties/_list_toolbar.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 19 |
20 | -------------------------------------------------------------------------------- /controllers/properties/_reorder_toolbar.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /controllers/properties/config_form.yaml: -------------------------------------------------------------------------------- 1 | name: Properties 2 | form: $/shohabbos/customfields/models/property/fields.yaml 3 | modelClass: Shohabbos\Customfields\Models\Property 4 | defaultRedirect: shohabbos/customfields/properties 5 | create: 6 | redirect: 'shohabbos/customfields/properties/update/:id' 7 | redirectClose: shohabbos/customfields/properties 8 | update: 9 | redirect: shohabbos/customfields/properties 10 | redirectClose: shohabbos/customfields/properties 11 | -------------------------------------------------------------------------------- /controllers/properties/config_list.yaml: -------------------------------------------------------------------------------- 1 | list: $/shohabbos/customfields/models/property/columns.yaml 2 | modelClass: Shohabbos\Customfields\Models\Property 3 | title: Properties 4 | noRecordsMessage: 'backend::lang.list.no_records' 5 | showSetup: true 6 | showCheckboxes: true 7 | recordsPerPage: 20 8 | toolbar: 9 | buttons: list_toolbar 10 | search: 11 | prompt: 'backend::lang.list.search_prompt' 12 | recordUrl: 'shohabbos/customfields/properties/update/:id' 13 | -------------------------------------------------------------------------------- /controllers/properties/config_reorder.yaml: -------------------------------------------------------------------------------- 1 | title: Properties 2 | modelClass: Shohabbos\Customfields\Models\Property 3 | toolbar: 4 | buttons: reorder_toolbar 5 | -------------------------------------------------------------------------------- /controllers/properties/create.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 | 'layout']) ?> 11 | 12 |
13 | formRender() ?> 14 |
15 | 16 |
17 |
18 | 26 | 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | 44 |

fatalError)) ?>

45 |

46 | -------------------------------------------------------------------------------- /controllers/properties/index.htm: -------------------------------------------------------------------------------- 1 | listRender() ?> 2 | -------------------------------------------------------------------------------- /controllers/properties/preview.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 |
11 | formRenderPreview() ?> 12 |
13 | 14 | 15 |

fatalError) ?>

16 | 17 | 18 |

19 | 20 | 21 | 22 |

-------------------------------------------------------------------------------- /controllers/properties/reorder.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | reorderRender() ?> -------------------------------------------------------------------------------- /controllers/properties/update.htm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | fatalError): ?> 9 | 10 | 'layout']) ?> 11 | 12 |
13 | formRender() ?> 14 |
15 | 16 |
17 |
18 | 27 | 36 | 43 | 44 | 45 | 46 | 47 |
48 |
49 | 50 | 51 | 52 |

fatalError)) ?>

53 |

54 | -------------------------------------------------------------------------------- /docs/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoxabbos/oc-customfields-plugin/011150bf4f6148cb392e91561b213ca9091cf2a1/docs/1.png -------------------------------------------------------------------------------- /docs/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoxabbos/oc-customfields-plugin/011150bf4f6148cb392e91561b213ca9091cf2a1/docs/2.png -------------------------------------------------------------------------------- /docs/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoxabbos/oc-customfields-plugin/011150bf4f6148cb392e91561b213ca9091cf2a1/docs/3.png -------------------------------------------------------------------------------- /docs/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoxabbos/oc-customfields-plugin/011150bf4f6148cb392e91561b213ca9091cf2a1/docs/4.png -------------------------------------------------------------------------------- /docs/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoxabbos/oc-customfields-plugin/011150bf4f6148cb392e91561b213ca9091cf2a1/docs/5.png -------------------------------------------------------------------------------- /lang/en/lang.php: -------------------------------------------------------------------------------- 1 | [ 3 | 'name' => 'CustomFields', 4 | 'description' => 'This plugin allows add custom fields to CMS page', 5 | ], 6 | 'editor' => [ 7 | 'custom_fields_tab' => 'Custom fields', 8 | ], 9 | 'property' => [ 10 | 'type' => 'Type', 11 | 'comment' => 'Comment', 12 | 'default' => 'Default value', 13 | 'name' => 'Property name (ex: footer_text)', 14 | 'label' => 'Label', 15 | 'is_translatable' => 'Is translatable field', 16 | ], 17 | 'group' => [ 18 | 'is_repeater' => 'Is repeater', 19 | 'name' => 'Tab name', 20 | 'page' => 'Page', 21 | 'properties' => 'Fields', 22 | 'code' => 'Code', 23 | 'updated_at' => 'Updated at', 24 | 'created_at' => 'Created at', 25 | 'position' => 'Tab position', 26 | ], 27 | 'permession' => [ 28 | 'manage_properties' => 'Manage properties', 29 | 'manage_groups' => 'Manage groups', 30 | 'manager_cms_code_content' => 'Edit cms code content', 31 | ], 32 | 'menu' => [ 33 | 'groups' => 'Groups', 34 | ], 35 | ]; -------------------------------------------------------------------------------- /lang/ru/lang.php: -------------------------------------------------------------------------------- 1 | [ 3 | 'name' => 'CustomFields', 4 | 'description' => 'This plugin allows add custom fields to CMS page', 5 | ], 6 | 'editor' => [ 7 | 'custom_fields_tab' => 'Custom fields', 8 | ], 9 | 'property' => [ 10 | 'type' => 'Тип', 11 | 'comment' => 'Комментарий', 12 | 'default' => 'По умолчанию', 13 | 'name' => 'Название свойства (Только на английском)', 14 | 'label' => 'Название', 15 | 'is_translatable' => 'Переводимое поле', 16 | ], 17 | 'group' => [ 18 | 'is_repeater' => 'Повторяющий', 19 | 'name' => 'Название вкладки', 20 | 'page' => 'Страница', 21 | 'properties' => 'Настраиваемые поля', 22 | 'code' => 'Код', 23 | 'updated_at' => 'Дата обновления', 24 | 'created_at' => 'Дата создания', 25 | 'position' => 'Позиция вкладки', 26 | ], 27 | 'permession' => [ 28 | 'manage_properties' => 'Управление свойствами', 29 | 'manage_groups' => 'Управление группами', 30 | 'manager_cms_code_content' => 'Edit cms code content', 31 | ], 32 | 'menu' => [ 33 | 'groups' => 'Группа полей', 34 | ], 35 | ]; -------------------------------------------------------------------------------- /models/Group.php: -------------------------------------------------------------------------------- 1 | 'name']; 18 | 19 | /** 20 | * @var string The database table used by the model. 21 | */ 22 | public $table = 'shohabbos_customfields_groups'; 23 | 24 | /** 25 | * @var array Validation rules 26 | */ 27 | public $rules = [ 28 | ]; 29 | 30 | public function getPageOptions() 31 | { 32 | return Page::sortBy('baseFileName')->lists('title', 'baseFileName'); 33 | } 34 | 35 | public $hasMany = [ 36 | 'properties' => Property::class 37 | ]; 38 | 39 | } -------------------------------------------------------------------------------- /models/Property.php: -------------------------------------------------------------------------------- 1 | lists('title', 'baseFileName'); 28 | } 29 | 30 | public $belongsTo = [ 31 | 'group' => Group::class 32 | ]; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /models/group/columns.yaml: -------------------------------------------------------------------------------- 1 | columns: 2 | id: 3 | label: id 4 | type: number 5 | name: 6 | label: 'shohabbos.customfields::lang.group.name' 7 | type: text 8 | code: 9 | label: code 10 | type: text 11 | page: 12 | label: 'shohabbos.customfields::lang.group.page' 13 | type: text 14 | created_at: 15 | label: 'shohabbos.customfields::lang.group.created_at' 16 | type: datetime 17 | updated_at: 18 | label: 'shohabbos.customfields::lang.group.updated_at' 19 | type: datetime 20 | is_repeater: 21 | label: 'shohabbos.customfields::lang.group.is_repeater' 22 | type: text 23 | -------------------------------------------------------------------------------- /models/group/fields.yaml: -------------------------------------------------------------------------------- 1 | fields: 2 | name: 3 | label: 'shohabbos.customfields::lang.group.name' 4 | span: auto 5 | type: text 6 | page: 7 | label: 'shohabbos.customfields::lang.group.page' 8 | span: auto 9 | type: dropdown 10 | position: 11 | label: 'shohabbos.customfields::lang.group.position' 12 | options: 13 | primary: Primary 14 | secondary: Secondary 15 | showSearch: true 16 | span: auto 17 | type: dropdown 18 | is_repeater: 19 | label: 'shohabbos.customfields::lang.group.is_repeater' 20 | span: auto 21 | type: switch 22 | tabs: 23 | fields: 24 | properties: 25 | span: full 26 | path: field_properties 27 | type: partial 28 | tab: 'shohabbos.customfields::lang.group.properties' 29 | -------------------------------------------------------------------------------- /models/property/columns.yaml: -------------------------------------------------------------------------------- 1 | columns: 2 | id: 3 | label: id 4 | type: number 5 | name: 6 | label: 'shohabbos.customfields::lang.property.name' 7 | type: text 8 | type: 9 | label: 'shohabbos.customfields::lang.property.type' 10 | type: text 11 | label: 12 | label: 'shohabbos.customfields::lang.property.label' 13 | type: text 14 | comment: 15 | label: 'shohabbos.customfields::lang.property.comment' 16 | type: text 17 | invisible: true 18 | created_at: 19 | label: 'shohabbos.customfields::lang.group.created_at' 20 | type: datetime 21 | invisible: true 22 | updated_at: 23 | label: 'shohabbos.customfields::lang.group.updated_at' 24 | type: datetime 25 | invisible: true 26 | -------------------------------------------------------------------------------- /models/property/fields.yaml: -------------------------------------------------------------------------------- 1 | fields: 2 | name: 3 | label: 'Input name (ex: footer_text)' 4 | span: auto 5 | type: text 6 | type: 7 | label: 'shohabbos.customfields::lang.property.type' 8 | options: 9 | text: 'Text input' 10 | number: Number 11 | password: Password 12 | richeditor: RichEditor 13 | codeeditor: Codeeditor 14 | colorpicker: Colorpicker 15 | datepicker: Datepicker 16 | mediafinder: Mediafinder 17 | checkbox: Checkbox 18 | textarea: Textarea 19 | section: Section 20 | taglist: Taglist 21 | span: auto 22 | type: dropdown 23 | label: 24 | label: 'shohabbos.customfields::lang.property.label' 25 | span: auto 26 | type: text 27 | comment: 28 | label: 'shohabbos.customfields::lang.property.comment' 29 | span: auto 30 | type: text 31 | default: 32 | label: 'shohabbos.customfields::lang.property.default' 33 | span: auto 34 | type: text 35 | is_translatable: 36 | label: 'shohabbos.customfields::lang.property.is_translatable' 37 | span: auto 38 | type: switch 39 | -------------------------------------------------------------------------------- /plugin.yaml: -------------------------------------------------------------------------------- 1 | plugin: 2 | name: 'shohabbos.customfields::lang.plugin.name' 3 | description: 'shohabbos.customfields::lang.plugin.description' 4 | author: Shohabbos 5 | icon: oc-icon-code 6 | homepage: '' 7 | permissions: 8 | manage_properties: 9 | tab: 'shohabbos.customfields::lang.plugin.name' 10 | label: 'Manage properties' 11 | manage_groups: 12 | tab: 'shohabbos.customfields::lang.plugin.name' 13 | label: 'Manage groups' 14 | manage_cms_code_content: 15 | tab: 'shohabbos.customfields::lang.plugin.name' 16 | label: 'shohabbos.customfields::lang.permession.manager_cms_code_content' 17 | roles: 18 | - publisher 19 | navigation: 20 | customfields: 21 | label: 'shohabbos.customfields::lang.plugin.name' 22 | url: shohabbos/customfields/groups 23 | icon: icon-code 24 | permissions: 25 | - manage_groups 26 | - manage_properties 27 | sideMenu: 28 | customfields-groups: 29 | label: 'shohabbos.customfields::lang.menu.groups' 30 | url: shohabbos/customfields/groups 31 | icon: icon-sitemap 32 | permissions: 33 | - manage_groups 34 | -------------------------------------------------------------------------------- /updates/builder_table_create_shohabbos_customfields_groups.php: -------------------------------------------------------------------------------- 1 | engine = 'InnoDB'; 13 | $table->increments('id')->unsigned(); 14 | $table->string('name'); 15 | $table->string('code')->nullable(); 16 | $table->text('description')->nullable(); 17 | $table->string('page'); 18 | $table->timestamp('created_at')->nullable(); 19 | $table->timestamp('updated_at')->nullable(); 20 | }); 21 | } 22 | 23 | public function down() 24 | { 25 | Schema::dropIfExists('shohabbos_customfields_groups'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /updates/builder_table_create_shohabbos_customfields_properties.php: -------------------------------------------------------------------------------- 1 | engine = 'InnoDB'; 13 | $table->increments('id')->unsigned(); 14 | $table->string('page'); 15 | }); 16 | } 17 | 18 | public function down() 19 | { 20 | Schema::dropIfExists('shohabbos_customfields_properties'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_groups.php: -------------------------------------------------------------------------------- 1 | dropColumn('description'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_groups', function($table) 19 | { 20 | $table->text('description')->nullable(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_groups_2.php: -------------------------------------------------------------------------------- 1 | boolean('is_repeator')->default(0); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_groups', function($table) 19 | { 20 | $table->dropColumn('is_repeator'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_groups_3.php: -------------------------------------------------------------------------------- 1 | renameColumn('is_repeator', 'is_repeater'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_groups', function($table) 19 | { 20 | $table->renameColumn('is_repeater', 'is_repeator'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_groups_4.php: -------------------------------------------------------------------------------- 1 | string('position', 20); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_groups', function($table) 19 | { 20 | $table->dropColumn('position'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties.php: -------------------------------------------------------------------------------- 1 | timestamp('created_at')->nullable(); 13 | $table->timestamp('updated_at')->nullable(); 14 | $table->string('page')->change(); 15 | }); 16 | } 17 | 18 | public function down() 19 | { 20 | Schema::table('shohabbos_customfields_properties', function($table) 21 | { 22 | $table->dropColumn('created_at'); 23 | $table->dropColumn('updated_at'); 24 | $table->string('page', 191)->change(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_10.php: -------------------------------------------------------------------------------- 1 | dropColumn('value'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_properties', function($table) 19 | { 20 | $table->text('value'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_11.php: -------------------------------------------------------------------------------- 1 | boolean('is_translatable')->default(0); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_properties', function($table) 19 | { 20 | $table->dropColumn('is_translatable'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_12.php: -------------------------------------------------------------------------------- 1 | integer('group_id')->nullable()->unsigned(false)->change(); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_properties', function($table) 19 | { 20 | $table->integer('group_id')->nullable(false)->unsigned()->change(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_2.php: -------------------------------------------------------------------------------- 1 | renameColumn('page', 'name'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_properties', function($table) 19 | { 20 | $table->renameColumn('name', 'page'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_3.php: -------------------------------------------------------------------------------- 1 | boolean('active'); 13 | $table->string('slug'); 14 | $table->string('code')->nullable(); 15 | $table->string('description')->nullable(); 16 | $table->string('type'); 17 | $table->text('settings')->nullable(); 18 | $table->integer('sort_order')->nullable(); 19 | }); 20 | } 21 | 22 | public function down() 23 | { 24 | Schema::table('shohabbos_customfields_properties', function($table) 25 | { 26 | $table->dropColumn('active'); 27 | $table->dropColumn('slug'); 28 | $table->dropColumn('code'); 29 | $table->dropColumn('description'); 30 | $table->dropColumn('type'); 31 | $table->dropColumn('settings'); 32 | $table->dropColumn('sort_order'); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_4.php: -------------------------------------------------------------------------------- 1 | integer('group_id'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::table('shohabbos_customfields_properties', function($table) 19 | { 20 | $table->dropColumn('group_id'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_5.php: -------------------------------------------------------------------------------- 1 | string('label'); 13 | $table->string('comment'); 14 | $table->integer('group_id')->unsigned()->change(); 15 | $table->dropColumn('created_at'); 16 | $table->dropColumn('updated_at'); 17 | $table->dropColumn('active'); 18 | $table->dropColumn('slug'); 19 | $table->dropColumn('code'); 20 | $table->dropColumn('description'); 21 | $table->dropColumn('settings'); 22 | $table->dropColumn('sort_order'); 23 | }); 24 | } 25 | 26 | public function down() 27 | { 28 | Schema::table('shohabbos_customfields_properties', function($table) 29 | { 30 | $table->dropColumn('label'); 31 | $table->dropColumn('comment'); 32 | $table->integer('group_id')->unsigned(false)->change(); 33 | $table->timestamp('created_at')->nullable(); 34 | $table->timestamp('updated_at')->nullable(); 35 | $table->boolean('active'); 36 | $table->string('slug', 191); 37 | $table->string('code', 191)->nullable(); 38 | $table->string('description', 191)->nullable(); 39 | $table->text('settings')->nullable(); 40 | $table->integer('sort_order')->nullable(); 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_6.php: -------------------------------------------------------------------------------- 1 | string('label')->change(); 13 | $table->string('comment')->change(); 14 | }); 15 | } 16 | 17 | public function down() 18 | { 19 | Schema::table('shohabbos_customfields_properties', function($table) 20 | { 21 | $table->string('label', 191)->change(); 22 | $table->string('comment', 191)->change(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_7.php: -------------------------------------------------------------------------------- 1 | timestamp('created_at')->nullable(); 13 | $table->timestamp('updated_at')->nullable(); 14 | $table->string('label')->change(); 15 | $table->string('comment')->change(); 16 | }); 17 | } 18 | 19 | public function down() 20 | { 21 | Schema::table('shohabbos_customfields_properties', function($table) 22 | { 23 | $table->dropColumn('created_at'); 24 | $table->dropColumn('updated_at'); 25 | $table->string('label', 191)->change(); 26 | $table->string('comment', 191)->change(); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_8.php: -------------------------------------------------------------------------------- 1 | string('default')->nullable(); 13 | $table->string('label')->change(); 14 | $table->string('comment')->change(); 15 | }); 16 | } 17 | 18 | public function down() 19 | { 20 | Schema::table('shohabbos_customfields_properties', function($table) 21 | { 22 | $table->dropColumn('default'); 23 | $table->string('label', 191)->change(); 24 | $table->string('comment', 191)->change(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /updates/builder_table_update_shohabbos_customfields_properties_9.php: -------------------------------------------------------------------------------- 1 | text('value'); 13 | $table->string('label')->change(); 14 | $table->string('comment')->change(); 15 | $table->string('default')->change(); 16 | }); 17 | } 18 | 19 | public function down() 20 | { 21 | Schema::table('shohabbos_customfields_properties', function($table) 22 | { 23 | $table->dropColumn('value'); 24 | $table->string('label', 191)->change(); 25 | $table->string('comment', 191)->change(); 26 | $table->string('default', 191)->change(); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /updates/version.yaml: -------------------------------------------------------------------------------- 1 | 1.0.1: 2 | - 'Initialize plugin.' 3 | 1.0.2: 4 | - 'Created table shohabbos_customfields_properties' 5 | - builder_table_create_shohabbos_customfields_properties.php 6 | 1.0.3: 7 | - 'Updated table shohabbos_customfields_properties' 8 | - builder_table_update_shohabbos_customfields_properties.php 9 | 1.0.4: 10 | - 'Updated table shohabbos_customfields_properties' 11 | - builder_table_update_shohabbos_customfields_properties_2.php 12 | 1.0.5: 13 | - 'Updated table shohabbos_customfields_properties' 14 | - builder_table_update_shohabbos_customfields_properties_3.php 15 | 1.0.6: 16 | - 'Created table shohabbos_customfields_groups' 17 | - builder_table_create_shohabbos_customfields_groups.php 18 | 1.0.7: 19 | - 'Updated table shohabbos_customfields_properties' 20 | - builder_table_update_shohabbos_customfields_properties_4.php 21 | 1.0.8: 22 | - 'Updated table shohabbos_customfields_properties' 23 | - builder_table_update_shohabbos_customfields_properties_5.php 24 | 1.0.9: 25 | - 'Updated table shohabbos_customfields_properties' 26 | - builder_table_update_shohabbos_customfields_properties_6.php 27 | 1.0.10: 28 | - 'Updated table shohabbos_customfields_properties' 29 | - builder_table_update_shohabbos_customfields_properties_7.php 30 | 1.0.11: 31 | - 'Updated table shohabbos_customfields_properties' 32 | - builder_table_update_shohabbos_customfields_properties_8.php 33 | 1.0.12: 34 | - 'Updated table shohabbos_customfields_properties' 35 | - builder_table_update_shohabbos_customfields_properties_9.php 36 | 1.0.13: 37 | - 'Updated table shohabbos_customfields_groups' 38 | - builder_table_update_shohabbos_customfields_groups.php 39 | 1.0.14: 40 | - 'Updated table shohabbos_customfields_properties' 41 | - builder_table_update_shohabbos_customfields_properties_10.php 42 | 1.0.15: 43 | - 'Updated table shohabbos_customfields_groups' 44 | - builder_table_update_shohabbos_customfields_groups_2.php 45 | 1.0.16: 46 | - 'Updated table shohabbos_customfields_groups' 47 | - builder_table_update_shohabbos_customfields_groups_3.php 48 | 1.0.17: 49 | - 'Fixed bug when saving pages' 50 | 1.0.18: 51 | - 'Add Is translatable field to property form' 52 | 1.0.19: 53 | - 'Update version.yaml file' 54 | - builder_table_update_shohabbos_customfields_properties_11.php 55 | 1.0.20: 56 | - 'Fixed the error that appears when creating a group with fields together' 57 | - builder_table_update_shohabbos_customfields_properties_12.php 58 | 1.1.0: 59 | - 'Added the ability to change the position of the tabs' 60 | - builder_table_update_shohabbos_customfields_groups_4.php 61 | --------------------------------------------------------------------------------