Download Zarafa WebApp - Developers` Manual
Transcript
Chapter 9. Data Models
Figure 9.6. Settings of calendar
The implementation is shown here:
var duration = container.getSettingsModel().
get('zarafa/v1/contexts/calendar/default_appointment_period');
To add your plugin settings to the Zarafa settings model, the injectPluginSettings function
should be implemented on the server-side:
/**
* Called when the core Settings class is initialized and ready to accept
* the sysadmin's default settings. Registers the sysadmin defaults
* for the Spreed plugin.
* @param Array $data Reference to the data of the triggered hook
*/
function injectPluginSettings(&$data) {
$data['settingsObj']->addSysAdminDefaults(Array(
'zarafa' => Array(
'v1' => Array(
'plugins' => Array(
'spreed' => Array(
'enable' => PLUGIN_SPREED_USER_DEFAULT_ENABLE,
'default_timezone' => date_default_timezone_get(),
)
)
)
)
));
}
You can add any other settings as you wish. For example, again in the Spreed plugin:
'spreed' => Array(
'enable' => PLUGIN_SPREED_ENABLE,
'default_timezone' => PLUGIN_SPREED_DEFAULT_TIMEZONE,
40