Add new attributes into core widget in order to be able to set widget->type attributes in preferences

This commit is contained in:
Hadi Nategh 2018-06-27 17:40:26 +02:00
parent b64d96f3de
commit 36726c7400
4 changed files with 24 additions and 2 deletions

View File

@ -152,6 +152,16 @@ var et2_widget = (function(){ "use strict"; return ClassWithAttributes.extend(
*/
"readonly": {
"ignore": true
},
/**
* Widget's attributes
*/
attributes: {
"name": "Widget attributes",
"type": "any",
"ignore": true,
"description": "Object of widget attributes"
}
},
@ -188,6 +198,10 @@ var et2_widget = (function(){ "use strict"; return ClassWithAttributes.extend(
_attrs = {};
}
if (_attrs.attributes)
{
jQuery.extend(_attrs, _attrs.attributes);
}
// Initialize all important parameters
this._mgrs = {};
this._inst = null;

View File

@ -411,7 +411,14 @@ class mail_hooks
'label' => 'Toggled on actions',
'help' => 'List of actions to be switched/activated on by default',
'name' => 'toggledOnActions',
'values' => $toggledOnActions
'values' => '',
'attributes' => array(
'allowFreeEntries' => false,
//'multiple' => 'toggle',
'editModeEnabled' => false,
'autocomplete_url' => ' ',
'select_options' => $toggledOnActions
)
)
);
if (!$GLOBALS['egw_info']['apps']['stylite']) unset($settingsArray['attachVCardAtCompose']);

View File

@ -451,6 +451,7 @@ class preferences_settings
'help' => lang($setting['help']), // is html
'default' => (string)$default !== '' ? lang('Default').': '.$default : null,
'onchange' => $setting['onchange'],
'attributes' => $setting['attributes']
);
//error_log("appname=$appname, attribute=$attribute, setting=".array2string($setting));
$content[$tab][$setting['name']] = $GLOBALS['egw']->preferences->{$attribute}[$appname][$setting['name']];

View File

@ -15,7 +15,7 @@
<description for="@${row}[name]" id="${row}[label]"/>
</box>
<box class="prefValueColumn">
<widget type="@${row}[type]" id="@${row}[name]" onchange="@${row}[onchange]" no_lang="1" class="prefValue"/>
<widget type="@${row}[type]" id="@${row}[name]" onchange="@${row}[onchange]" no_lang="1" class="prefValue" attributes="@${row}[attributes]"/>
<description id="${row}[default]" no_lang="1" class="prefDefault"/>
</box>
<box class="prefHelpColumn">