From f4baeef0b18b60c38b803eb5a6ce5e79e23ea09a Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 18 Sep 2021 15:41:35 +1000 Subject: [PATCH] Changed wording again --- assets/js/builder.index.entity.modelform.js | 4 ++-- behaviors/IndexModelFormOperations.php | 18 +++++++++--------- ...htm => _add-database-fields-popup-form.htm} | 4 ++-- .../partials/_toolbar.htm | 4 ++-- lang/en/lang.php | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) rename behaviors/indexmodelformoperations/partials/{_add-fields-from-database-popup-form.htm => _add-database-fields-popup-form.htm} (87%) diff --git a/assets/js/builder.index.entity.modelform.js b/assets/js/builder.index.entity.modelform.js index d3e86abe..46a65a5b 100644 --- a/assets/js/builder.index.entity.modelform.js +++ b/assets/js/builder.index.entity.modelform.js @@ -34,7 +34,7 @@ ModelForm.prototype.cmdSaveForm = function(ev) { var $target = $(ev.currentTarget), $form = $target.closest('form'), - $rootContainer = $('[data-root-control-wrapper] > [data-control-container]', $form), + $rootContainer = $('[data-root-control-wrapper] > [data-control-container]', $form), $inspectorContainer = $form.find('.inspector-container'), controls = $.oc.builder.formbuilder.domToPropertyJson.convert($rootContainer.get(0)) @@ -63,7 +63,7 @@ ) } - ModelForm.prototype.cmdAddFieldsFromDatabase = function (ev) { + ModelForm.prototype.cmdAddDatabaseFields = function (ev) { var $target = $(ev.currentTarget) // Always use the first placeholder to add controls diff --git a/behaviors/IndexModelFormOperations.php b/behaviors/IndexModelFormOperations.php index 80243b3a..67f5319b 100644 --- a/behaviors/IndexModelFormOperations.php +++ b/behaviors/IndexModelFormOperations.php @@ -129,19 +129,19 @@ public function onModelFormGetModelFields() ]; } - public function onModelShowAddFieldsFromDatabasePopup() + public function onModelShowAddDatabaseFieldsPopup() { $columns = ModelModel::getModelColumnsAndTypes($this->getPluginCode(), Input::get('model_class')); - $config = $this->makeConfig($this->getAddFieldsFromDatabaseDataTableConfig()); + $config = $this->makeConfig($this->getAddDatabaseFieldsDataTableConfig()); - $field = new FormField('add_fields_from_database', 'add_fields_from_database'); - $field->value = $this->getAddFieldsFromDatabaseDataTableValue($columns); + $field = new FormField('add_database_fields_datatable', 'add_database_fields_datatable'); + $field->value = $this->getAddDatabaseFieldsDataTableValue($columns); $datatable = new DataTable($this->controller, $field, $config); - $datatable->alias = 'add_fields_from_database_datatable'; + $datatable->alias = 'add_database_fields_datatable'; $datatable->bindToController(); - return $this->makePartial('add-fields-from-database-popup-form', [ + return $this->makePartial('add-database-fields-popup-form', [ 'datatable' => $datatable, 'pluginCode' => $this->getPluginCode()->toCode(), ]); @@ -206,11 +206,11 @@ protected function mergeRegistryDataIntoResult(&$result, $model, $modelClass) /** * Returns the configuration for the DataTable widget that - * is used in the "add fields from database" popup. + * is used in the "add database fields" popup. * * @return array */ - protected function getAddFieldsFromDatabaseDataTableConfig() + protected function getAddDatabaseFieldsDataTableConfig() { // Get all registered controls and build an array that uses the control types as key and value for each entry. $controls = ControlLibrary::instance()->listControls(); @@ -249,7 +249,7 @@ protected function getAddFieldsFromDatabaseDataTableConfig() * * @return array */ - protected function getAddFieldsFromDatabaseDataTableValue(array $columns) + protected function getAddDatabaseFieldsDataTableValue(array $columns) { // Map database column types to widget types. $typeMap = [ diff --git a/behaviors/indexmodelformoperations/partials/_add-fields-from-database-popup-form.htm b/behaviors/indexmodelformoperations/partials/_add-database-fields-popup-form.htm similarity index 87% rename from behaviors/indexmodelformoperations/partials/_add-fields-from-database-popup-form.htm rename to behaviors/indexmodelformoperations/partials/_add-database-fields-popup-form.htm index fbad9d33..8e5d4876 100644 --- a/behaviors/indexmodelformoperations/partials/_add-fields-from-database-popup-form.htm +++ b/behaviors/indexmodelformoperations/partials/_add-database-fields-popup-form.htm @@ -1,10 +1,10 @@ 'modelForm:cmdAddFieldsFromDatabase' + 'data-builder-command'=>'modelForm:cmdAddDatabaseFields' ]) ?>