plugins/kolab_activesync

Aleksander Machniak machniak at kolabsys.com
Tue Mar 3 09:38:49 CET 2015


 plugins/kolab_activesync/config.inc.php.dist                      |    4 +
 plugins/kolab_activesync/kolab_activesync.php                     |    2 
 plugins/kolab_activesync/kolab_activesync_ui.php                  |   29 ++++++++++
 plugins/kolab_activesync/localization/en_US.inc                   |    2 
 plugins/kolab_activesync/skins/classic/templates/configempty.html |    2 
 plugins/kolab_activesync/skins/larry/templates/configempty.html   |    2 
 6 files changed, 37 insertions(+), 4 deletions(-)

New commits:
commit 724ecc44bfac3874ccccda5178f73313db7abae9
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Tue Mar 3 03:37:06 2015 -0500

    Make ActiveSync devices configuration page configurable (#4770)
    and change default url to http://docs.kolab.org/client-configuration/

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>




More information about the commits mailing list