From b42c3e4c1b91cd2c2e15465a4e70666fbcac7b8c Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 29 Oct 2010 08:44:34 +0000 Subject: - 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 --- plugins/help/help.php | 29 +++++++++++++++++++------- plugins/help/skins/default/templates/help.html | 13 ++++++------ 2 files changed, 27 insertions(+), 15 deletions(-) (limited to 'plugins') 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'); } diff --git a/plugins/help/skins/default/templates/help.html b/plugins/help/skins/default/templates/help.html index 42f1a4a93..98beb6655 100644 --- a/plugins/help/skins/default/templates/help.html +++ b/plugins/help/skins/default/templates/help.html @@ -8,10 +8,9 @@ -- cgit v1.2.3