noExternalParameter -> showExternalParameter

This commit is contained in:
Sam Georges 2014-10-31 19:57:07 +11:00
parent 832a92e925
commit afcf50a585
2 changed files with 16 additions and 15 deletions

View File

@ -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

View File

@ -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) {