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 db60d3cfa9
commit b81f663ec4
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": { "readonly": {
"ignore": true "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 = {}; _attrs = {};
} }
if (_attrs.attributes)
{
jQuery.extend(_attrs, _attrs.attributes);
}
// Initialize all important parameters // Initialize all important parameters
this._mgrs = {}; this._mgrs = {};
this._inst = null; this._inst = null;

View File

@ -410,7 +410,14 @@ class mail_hooks
'label' => 'Toggled on actions', 'label' => 'Toggled on actions',
'help' => 'List of actions to be switched/activated on by default', 'help' => 'List of actions to be switched/activated on by default',
'name' => 'toggledOnActions', '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']); if (!$GLOBALS['egw_info']['apps']['stylite']) unset($settingsArray['attachVCardAtCompose']);

View File

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

View File

@ -15,7 +15,7 @@
<description for="@${row}[name]" id="${row}[label]"/> <description for="@${row}[name]" id="${row}[label]"/>
</box> </box>
<box class="prefValueColumn"> <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"/> <description id="${row}[default]" no_lang="1" class="prefDefault"/>
</box> </box>
<box class="prefHelpColumn"> <box class="prefHelpColumn">