Add Settings section in PHP not javascript, small improvements

This commit is contained in:
Aleksander Machniak 2014-03-14 10:08:58 +01:00
parent 985286cbcb
commit a1335b963f
2 changed files with 23 additions and 23 deletions

View file

@ -159,25 +159,5 @@ function kolab_activesync_config()
window.rcmail && rcmail.addEventListener('init', function(evt) {
// add button to tabs list
var tab = $('<span>').attr('id', 'settingstabpluginactivesync').addClass('tablink'),
button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.activesync')
.html(rcmail.gettext('tabtitle', 'kolab_activesync'))
.appendTo(tab);
rcmail.add_element(tab, 'tabs');
if (/^plugin.activesync/.test(rcmail.env.action))
activesync_object = new kolab_activesync_config();
activesync_object = new kolab_activesync_config();
});
// extend jQuery
(function($){
$.fn.serializeJSON = function(){
var json = {};
jQuery.map($(this).serializeArray(), function(n, i) {
json[n['name']] = n['value'];
});
return json;
};
})(jQuery);

View file

@ -52,8 +52,28 @@ class kolab_activesync extends rcube_plugin
$this->register_action('plugin.activesync-config', array($this, 'config_frame'));
$this->register_action('plugin.activesync-json', array($this, 'json_command'));
$this->add_texts('localization/', true);
$this->include_script('kolab_activesync.js');
$this->add_hook('settings_actions', array($this, 'settings_actions'));
$this->add_texts('localization/', array('devicedeleteconfirm', 'savingdata'));
if (strpos($this->rc->action, 'plugin.activesync') === 0) {
$this->include_script('kolab_activesync.js');
}
}
/**
* Adds Activesync section in Settings
*/
function settings_actions($args)
{
$args['actions'][] = array(
'action' => 'plugin.activesync',
'class' => 'activesync',
'label' => 'tabtitle',
'domain' => 'kolab_activesync',
);
return $args;
}
/**