diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-10-29 08:44:34 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-10-29 08:44:34 +0000 |
| commit | b42c3e4c1b91cd2c2e15465a4e70666fbcac7b8c (patch) | |
| tree | 391c91d0ae2fc3df0f2fd4efb13435798c3afde7 /plugins | |
| parent | 14666961f7ea8511dbd1a67d791359c9b78cb6b3 (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')
| -rw-r--r-- | plugins/help/help.php | 29 | ||||
| -rw-r--r-- | plugins/help/skins/default/templates/help.html | 13 |
2 files changed, 27 insertions, 15 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'); } 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 @@ <script type="text/javascript"> function help_init_settings_tabs() { - var tab = '#helptabdefault'; - if (window.rcmail && rcmail.env.action) { - var action = rcmail.env.action.replace(/^plugin\.help/, ''); - tab = '#helptab' + (action ? action : 'default'); + var action, tab = '#helptabdefault'; + if (window.rcmail && (action = rcmail.env.action)) { + tab = '#helptab' + (action ? action : 'default'); } $(tab).addClass('tablink-selected'); } @@ -23,9 +22,9 @@ function help_init_settings_tabs() <roundcube:include file="/includes/header.html" /> <div id="tabsbar"> -<span id="helptabdefault" class="tablink"><roundcube:button name="helpdefault" href="?_task=dummy&_action=plugin.help" type="link" label="help.help" title="help.help" /></span> -<span id="helptababout" class="tablink"><roundcube:button name="helpabout" href="?_task=dummy&_action=plugin.helpabout" type="link" label="help.about" title="help.about" class="tablink" /></span> -<span id="helptablicense" class="tablink"><roundcube:button name="helplicense" href="?_task=dummy&_action=plugin.helplicense" type="link" label="help.license" title="help.license" class="tablink" /></span> +<span id="helptabdefault" class="tablink"><roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" /></span> +<span id="helptababout" class="tablink"><roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="tablink" /></span> +<span id="helptablicense" class="tablink"><roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="tablink" /></span> <roundcube:container name="helptabs" id="helptabsbar" /> <script type="text/javascript"> if (window.rcmail) rcmail.add_onload(help_init_settings_tabs);</script> </div> |
