summaryrefslogtreecommitdiff
path: root/plugins/help/help.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/help/help.php')
-rw-r--r--plugins/help/help.php29
1 files changed, 21 insertions, 8 deletions
diff --git a/plugins/help/help.php b/plugins/help/help.php
index 2606b27c5..0c70b3a69 100644
--- a/plugins/help/help.php
+++ b/plugins/help/help.php
@@ -14,6 +14,10 @@ class help extends rcube_plugin
{
// all task excluding 'login' and 'logout'
public $task = '?(?!login|logout).*';
+ // we've got no ajax handlers
+ public $noajax = true;
+ // skip frames
+ public $noframe = true;
function init()
{
@@ -21,19 +25,28 @@ class help extends rcube_plugin
$this->add_texts('localization/', false);
+ // register task
+ $this->register_task('help');
+
// register actions
- $this->register_action('plugin.help', array($this, 'action'));
- $this->register_action('plugin.helpabout', array($this, 'action'));
- $this->register_action('plugin.helplicense', array($this, 'action'));
+ $this->register_action('', array($this, 'action'));
+ $this->register_action('about', array($this, 'action'));
+ $this->register_action('license', array($this, 'action'));
// add taskbar button
$this->add_button(array(
'name' => 'helptask',
'class' => 'button-help',
'label' => 'help.help',
- 'href' => './?_task=dummy&_action=plugin.help',
+ 'href' => './?_task=help',
+ 'onclick' => sprintf("return %s.command('help')", JS_OBJECT_NAME)
), 'taskbar');
+ $rcmail->output->add_script(
+ JS_OBJECT_NAME . ".enable_command('help', true);\n" .
+ JS_OBJECT_NAME . ".help = function () { location.href = './?_task=help'; }",
+ 'head');
+
$skin = $rcmail->config->get('skin');
if (!file_exists($this->home."/skins/$skin/help.css"))
$skin = 'default';
@@ -53,9 +66,9 @@ class help extends rcube_plugin
'helpcontent' => array($this, 'content'),
));
- if ($rcmail->action == 'plugin.helpabout')
+ if ($rcmail->action == 'about')
$rcmail->output->set_pagetitle($this->gettext('about'));
- else if ($rcmail->action == 'plugin.helplicense')
+ else if ($rcmail->action == 'license')
$rcmail->output->set_pagetitle($this->gettext('license'));
else
$rcmail->output->set_pagetitle($this->gettext('help'));
@@ -67,10 +80,10 @@ class help extends rcube_plugin
{
$rcmail = rcmail::get_instance();
- if ($rcmail->action == 'plugin.helpabout') {
+ if ($rcmail->action == 'about') {
return @file_get_contents($this->home.'/content/about.html');
}
- else if ($rcmail->action == 'plugin.helplicense') {
+ else if ($rcmail->action == 'license') {
return @file_get_contents($this->home.'/content/license.html');
}