summaryrefslogtreecommitdiff
path: root/plugins/kolab_activesync
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-03-03 08:37:06 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-03-03 08:37:06 (GMT)
commit724ecc44bfac3874ccccda5178f73313db7abae9 (patch)
tree2671c4d4f9181ba99b2887ec1039fc3a27bd429b /plugins/kolab_activesync
parent09f979a248e47a078c1cbd450a21b4448a1f16a0 (diff)
downloadroundcubemail-plugins-kolab-724ecc44bfac3874ccccda5178f73313db7abae9.tar.gz
Make ActiveSync devices configuration page configurable (#4770)
and change default url to http://docs.kolab.org/client-configuration/
Diffstat (limited to 'plugins/kolab_activesync')
-rw-r--r--plugins/kolab_activesync/config.inc.php.dist4
-rw-r--r--plugins/kolab_activesync/kolab_activesync.php2
-rw-r--r--plugins/kolab_activesync/kolab_activesync_ui.php29
-rw-r--r--plugins/kolab_activesync/localization/en_US.inc2
-rw-r--r--plugins/kolab_activesync/skins/classic/templates/configempty.html2
-rw-r--r--plugins/kolab_activesync/skins/larry/templates/configempty.html2
6 files changed, 37 insertions, 4 deletions
diff --git a/plugins/kolab_activesync/config.inc.php.dist b/plugins/kolab_activesync/config.inc.php.dist
new file mode 100644
index 0000000..adcc378
--- /dev/null
+++ b/plugins/kolab_activesync/config.inc.php.dist
@@ -0,0 +1,4 @@
+<?php
+
+// The page with Activesync clients configuration manual
+$config['activesync_setup_url'] = 'http://docs.kolab.org/client-configuration/';
diff --git a/plugins/kolab_activesync/kolab_activesync.php b/plugins/kolab_activesync/kolab_activesync.php
index ebef64c..f886c8d 100644
--- a/plugins/kolab_activesync/kolab_activesync.php
+++ b/plugins/kolab_activesync/kolab_activesync.php
@@ -226,7 +226,7 @@ class kolab_activesync extends rcube_plugin
$this->ui = new kolab_activesync_ui($this);
if (!empty($_GET['_init'])) {
- return $this->rc->output->send('kolab_activesync.configempty');
+ return $this->ui->init_message();
}
$this->register_handler('plugin.deviceconfigform', array($this->ui, 'device_config_form'));
diff --git a/plugins/kolab_activesync/kolab_activesync_ui.php b/plugins/kolab_activesync/kolab_activesync_ui.php
index 257ec2a..edf6411 100644
--- a/plugins/kolab_activesync/kolab_activesync_ui.php
+++ b/plugins/kolab_activesync/kolab_activesync_ui.php
@@ -29,6 +29,9 @@ class kolab_activesync_ui
private $plugin;
public $device = array();
+ const SETUP_URL = 'http://docs.kolab.org/client-configuration';
+
+
public function __construct($plugin)
{
$this->plugin = $plugin;
@@ -245,4 +248,30 @@ class kolab_activesync_ui
return $table->show();
}
+
+ /**
+ * Displays initial page (when no devices are registered)
+ */
+ function init_message()
+ {
+ $this->plugin->load_config();
+
+ $this->rc->output->add_handlers(array(
+ 'initmessage' => array($this, 'init_message_content')
+ ));
+
+ $this->rc->output->send('kolab_activesync.configempty');
+ }
+
+ /**
+ * Handler for initmessage template object
+ */
+ function init_message_content()
+ {
+ $url = $this->rc->config->get('activesync_setup_url', self::SETUP_URL);
+ $vars = array('url' => $url);
+ $msg = $this->plugin->gettext(array('name' => 'nodevices', 'vars' => $vars));
+
+ return $msg;
+ }
}
diff --git a/plugins/kolab_activesync/localization/en_US.inc b/plugins/kolab_activesync/localization/en_US.inc
index 6d4e0bf..683488f 100644
--- a/plugins/kolab_activesync/localization/en_US.inc
+++ b/plugins/kolab_activesync/localization/en_US.inc
@@ -16,7 +16,7 @@ $labels['task'] = 'Tasks';
$labels['note'] = 'Notes';
$labels['configuration'] = 'Configuration';
$labels['deletedevice'] = 'Delete device';
-$labels['nodevices'] = 'There are currently no devices registered.<br/><br/>In order to register a device, please connect it to the server first, using <a href="http://wiki.kolab.org/Setup_ActiveSync">the instructions in the Wiki</a>. Afterwards the device should become available for configuration here.';
+$labels['nodevices'] = 'There are currently no devices registered.<br/><br/>In order to register a device, please connect it to the server first, using instructions from <a href="$url" target="_blank">this page</a>. Afterwards the device should become available for configuration here.';
$labels['savingdata'] = 'Saving data...';
$labels['savingerror'] = 'Failed to save configuration';
$labels['notsupported'] = 'Your server does not support metadata/annotations';
diff --git a/plugins/kolab_activesync/skins/classic/templates/configempty.html b/plugins/kolab_activesync/skins/classic/templates/configempty.html
index 5afd3ce..e36fc17 100644
--- a/plugins/kolab_activesync/skins/classic/templates/configempty.html
+++ b/plugins/kolab_activesync/skins/classic/templates/configempty.html
@@ -9,7 +9,7 @@
<div id="preferences-details" class="boxcontent">
<div id="introtext">
<div class="inner">
- <roundcube:label name="kolab_activesync.nodevices" html="true" />
+ <roundcube:object name="initmessage" />
</div>
<div class="pointer-left"></div>
</div>
diff --git a/plugins/kolab_activesync/skins/larry/templates/configempty.html b/plugins/kolab_activesync/skins/larry/templates/configempty.html
index 5d1a062..8d9aaff 100644
--- a/plugins/kolab_activesync/skins/larry/templates/configempty.html
+++ b/plugins/kolab_activesync/skins/larry/templates/configempty.html
@@ -9,7 +9,7 @@
<div id="preferences-details" class="boxcontent">
<div id="introtext">
<div class="inner">
- <roundcube:label name="kolab_activesync.nodevices" html="true" />
+ <roundcube:object name="initmessage" />
</div>
<div class="pointer-left"></div>
</div>