summaryrefslogtreecommitdiff
path: root/plugins/kolab_delegation
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-03-14 09:25:33 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-03-14 09:25:33 (GMT)
commitdf2ed0d8e6417eea9718b92324d56d524173f6e3 (patch)
tree267344885725f75ca9f7c419211c6c0949fa0848 /plugins/kolab_delegation
parenta1335b963f47c160c916d88898e92ac5456e858b (diff)
downloadroundcubemail-plugins-kolab-df2ed0d8e6417eea9718b92324d56d524173f6e3.tar.gz
Add Settings action in PHP not in javascript, small improvements
Diffstat (limited to 'plugins/kolab_delegation')
-rw-r--r--plugins/kolab_delegation/kolab_delegation.js7
-rw-r--r--plugins/kolab_delegation/kolab_delegation.php25
-rw-r--r--plugins/kolab_delegation/skins/larry/style.css4
3 files changed, 25 insertions, 11 deletions
diff --git a/plugins/kolab_delegation/kolab_delegation.js b/plugins/kolab_delegation/kolab_delegation.js
index 1efa70b..d113c71 100644
--- a/plugins/kolab_delegation/kolab_delegation.js
+++ b/plugins/kolab_delegation/kolab_delegation.js
@@ -38,13 +38,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
else if (rcmail.env.task != 'settings')
return;
- // add Delegation section to the list
- var tab = $('<span>').attr('id', 'settingstabplugindelegation').addClass('tablink'),
- button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.delegation')
- .html(rcmail.gettext('tabtitle', 'kolab_delegation'))
- .appendTo(tab);
- rcmail.add_element(tab, 'tabs');
-
if (/^plugin.delegation/.test(rcmail.env.action)) {
rcmail.addEventListener('plugin.delegate_save_complete', function(e) { rcmail.delegate_save_complete(e); });
diff --git a/plugins/kolab_delegation/kolab_delegation.php b/plugins/kolab_delegation/kolab_delegation.php
index 060308f..8b4a5ef 100644
--- a/plugins/kolab_delegation/kolab_delegation.php
+++ b/plugins/kolab_delegation/kolab_delegation.php
@@ -65,9 +65,15 @@ class kolab_delegation extends rcube_plugin
$this->register_action('plugin.delegation-save', array($this, 'controller_action'));
$this->register_action('plugin.delegation-autocomplete', array($this, 'controller_action'));
+ $this->add_hook('settings_actions', array($this, 'settings_actions'));
+
if ($this->rc->action == 'plugin.delegation' || empty($_REQUEST['_framed'])) {
- $this->add_texts('localization/', array('tabtitle', 'deleteconfirm', 'savingdata', 'yes', 'no'));
- $this->include_script('kolab_delegation.js');
+ $this->add_texts('localization/', array('deleteconfirm', 'savingdata', 'yes', 'no'));
+
+ if ($this->rc->action == 'plugin.delegation') {
+ $this->include_script('kolab_delegation.js');
+ }
+
$this->skin_path = $this->local_skin_path();
$this->include_stylesheet($this->skin_path . '/style.css');
}
@@ -79,6 +85,21 @@ class kolab_delegation extends rcube_plugin
}
/**
+ * Adds Delegation section in Settings
+ */
+ function settings_actions($args)
+ {
+ $args['actions'][] = array(
+ 'action' => 'plugin.delegation',
+ 'class' => 'delegation',
+ 'label' => 'tabtitle',
+ 'domain' => 'kolab_delegation',
+ );
+
+ return $args;
+ }
+
+ /**
* Engine object getter
*/
private function engine()
diff --git a/plugins/kolab_delegation/skins/larry/style.css b/plugins/kolab_delegation/skins/larry/style.css
index 35c1bf6..eda61c1 100644
--- a/plugins/kolab_delegation/skins/larry/style.css
+++ b/plugins/kolab_delegation/skins/larry/style.css
@@ -1,10 +1,10 @@
/* Stylesheets for the Kolab Delegation configuration UI */
-#settings-sections #settingstabplugindelegation a {
+#settings-sections span.listitem.delegation a {
background: url(delegation.png) 6px 1px no-repeat;
}
-#settings-sections #settingstabplugindelegation.selected a {
+#settings-sections span.listitem.delegation.selected a {
background-position: 6px -23px;
}