Make ActiveSync devices configuration page configurable (#4770)

and change default url to http://docs.kolab.org/client-configuration/
This commit is contained in:
Aleksander Machniak 2015-03-03 03:37:06 -05:00
parent 09f979a248
commit 724ecc44bf
6 changed files with 37 additions and 4 deletions

View file

@ -0,0 +1,4 @@
<?php
// The page with Activesync clients configuration manual
$config['activesync_setup_url'] = 'http://docs.kolab.org/client-configuration/';

View file

@ -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'));

View file

@ -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;
}
}

View file

@ -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';

View file

@ -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>

View file

@ -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>