summaryrefslogtreecommitdiff
path: root/plugins/kolab_activesync
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-03-14 09:08:58 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-03-14 09:08:58 (GMT)
commita1335b963f47c160c916d88898e92ac5456e858b (patch)
tree761d13d9aec7fb047df0b890c3704bc350977814 /plugins/kolab_activesync
parent985286cbcbe07e779010764a09c2b30fc59cff71 (diff)
downloadroundcubemail-plugins-kolab-a1335b963f47c160c916d88898e92ac5456e858b.tar.gz
Add Settings section in PHP not javascript, small improvements
Diffstat (limited to 'plugins/kolab_activesync')
-rw-r--r--plugins/kolab_activesync/kolab_activesync.js22
-rw-r--r--plugins/kolab_activesync/kolab_activesync.php24
2 files changed, 23 insertions, 23 deletions
diff --git a/plugins/kolab_activesync/kolab_activesync.js b/plugins/kolab_activesync/kolab_activesync.js
index d9e2943..1f625e6 100644
--- a/plugins/kolab_activesync/kolab_activesync.js
+++ b/plugins/kolab_activesync/kolab_activesync.js
@@ -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);
diff --git a/plugins/kolab_activesync/kolab_activesync.php b/plugins/kolab_activesync/kolab_activesync.php
index 05e1f35..a7ee101 100644
--- a/plugins/kolab_activesync/kolab_activesync.php
+++ b/plugins/kolab_activesync/kolab_activesync.php
@@ -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;
}
/**