summaryrefslogtreecommitdiff
path: root/plugins/help/help.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-29 08:44:34 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-29 08:44:34 +0000
commitb42c3e4c1b91cd2c2e15465a4e70666fbcac7b8c (patch)
tree391c91d0ae2fc3df0f2fd4efb13435798c3afde7 /plugins/help/help.php
parent14666961f7ea8511dbd1a67d791359c9b78cb6b3 (diff)
- Disable help plugin in ajax and framed mode
- Add warning when clicking help task while message composition (#1487094) git-svn-id: https://svn.roundcube.net/trunk@4155 208e9e7b-5314-0410-a742-e7e81cd9613c
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');
}