From afcf50a585317115aa86f2de836df4f1ac76df0b Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Fri, 31 Oct 2014 19:57:07 +1100 Subject: [PATCH] noExternalParameter -> showExternalParameter --- .../backend/assets/js/october.inspector.js | 10 ++++----- modules/cms/classes/ComponentHelpers.php | 21 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/backend/assets/js/october.inspector.js b/modules/backend/assets/js/october.inspector.js index 8c7917b9d..e1057eb68 100644 --- a/modules/backend/assets/js/october.inspector.js +++ b/modules/backend/assets/js/october.inspector.js @@ -29,8 +29,8 @@ * - placeholder - placholder text, for text and dropdown properties * - depends - a list of properties the property depend on, for dropdown lists * - options - an option list for dropdown lists, optional. If not provided the options are loaded with AJAX. - * - noExternalParameter - disables the external parameter feature for the property. - * Example of the configuration string (a single property): + * - showExternalParameter - specifies the visibility of the external parameter feature for the property. Default: true. + * Example of the configuration string (a single property): * [{"property":"max-width","title":"Max width","type":"string"}] * * The Inspector requires the inspectable element to contain a hidden input element with the attribute "data-inspector-values". @@ -38,8 +38,8 @@ * names and values matching property values. * * Any HTML element that wraps the inspectable element can have the data-inspector-external-parameters property that enables the external - * parameters support. External parameters saved with the special syntax {{paramName}}. The external parameter feature can be disabled - * on per-property basis with the noExternalParameter option. + * parameters support. External parameters saved with the special syntax {{ paramName }}. The external parameter feature can be toggled + * on per-property basis with the showExternalParameter option, visible by default. * * Events * - change - the event is triggered on the inspectable element when it's properties are updated. @@ -161,7 +161,7 @@ if (this.itemType == 'property' && this.groupIndex !== undefined) result += self.groupExpanded(this.group) ? ' expanded' : ' collapsed' - if (this.itemType == 'property' && this.noExternalParameter) + if (this.itemType == 'property' && !this.showExternalParameter) result += ' no-external-parameter' return result diff --git a/modules/cms/classes/ComponentHelpers.php b/modules/cms/classes/ComponentHelpers.php index b65e4c95e..8c848e9c6 100644 --- a/modules/cms/classes/ComponentHelpers.php +++ b/modules/cms/classes/ComponentHelpers.php @@ -20,22 +20,23 @@ class ComponentHelpers $result = []; $property = [ - 'property' => 'oc.alias', - 'title' => Lang::get('cms::lang.component.alias'), - 'description' => Lang::get('cms::lang.component.alias_description'), - 'type' => 'string', - 'validationPattern' => '^[a-zA-Z]+[0-9a-z\_]*$', - 'validationMessage' => Lang::get('cms::lang.component.validation_message'), - 'noExternalParameter' => true + 'property' => 'oc.alias', + 'title' => Lang::get('cms::lang.component.alias'), + 'description' => Lang::get('cms::lang.component.alias_description'), + 'type' => 'string', + 'validationPattern' => '^[a-zA-Z]+[0-9a-z\_]*$', + 'validationMessage' => Lang::get('cms::lang.component.validation_message'), + 'showExternalParameter' => false ]; $result[] = $property; $properties = $component->defineProperties(); foreach ($properties as $name => $params) { $property = [ - 'property' => $name, - 'title' => isset($params['title']) ? $params['title'] : $name, - 'type' => isset($params['type']) ? $params['type'] : 'string' + 'property' => $name, + 'title' => array_get($params, 'title', $name), + 'type' => array_get($params, 'type', 'string'), + 'showExternalParameter' => array_get($params, 'showExternalParameter', true) ]; foreach ($params as $name => $value) {