Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F223760
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
18 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugins/help/config.inc.php.dist b/plugins/help/config.inc.php.dist
index d440dbbcc..0fd321eca 100644
--- a/plugins/help/config.inc.php.dist
+++ b/plugins/help/config.inc.php.dist
@@ -1,5 +1,30 @@
<?php
// Help content iframe source
-// $rcmail_config['help_source'] = 'http://trac.roundcube.net/wiki';
-$rcmail_config['help_source'] = '';
+// %l will be replaced by the language code resolved using the 'help_language_map' option
+$rcmail_config['help_source'] = 'http://roundcube.net/doc/help/0.9/%l/';
+
+// Map task/action combinations to deep-links
+// Use '<task>/<action>' or only '<task>' strings as keys
+// The values will be appended to the 'help_source' URL
+$rcmail_config['help_index_map'] = array(
+ 'login' => 'login.html',
+ 'mail' => 'mail/index.html',
+ 'mail/compose' => 'mail/compose.html',
+);
+
+// Map to translate Roundcube language codes into help document languages
+// The '*' entry will be used as default
+$rcmail_config['help_language_map'] = array('*' => 'en_US');
+
+// Enter an absolute URL to a page displaying information about this webmail
+// Alternatively, create a HTML file under <this-plugin-dir>/content/about.html
+$rcmail_config['help_about_url'] = null;
+
+// Enter an absolute URL to a page displaying information about this webmail
+// Alternatively, put your license text to <this-plugin-dir>/content/license.html
+$rcmail_config['help_license_url'] = null;
+
+// Determine whether to open the help in a new window
+$rcmail_config['help_open_extwin'] = false;
+
diff --git a/plugins/help/content/about.html b/plugins/help/content/about.html
deleted file mode 100644
index 6e9632bec..000000000
--- a/plugins/help/content/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="helpabout" class="readtext">
-<h2 align="center">Copyright © 2005-2012, The Roundcube Dev Team</h2>
-
-<p>
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License (with exceptions
-for skins & plugins) as published by the Free Software Foundation,
-either version 3 of the License, or (at your option) any later version.
-</p>
-<p>
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-</p>
-<p>
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a>.
-</p>
-
-<p>
-For more details about licensing and the expections for skins and plugins
-see <a href="http://roundcube.net/license">roundcube.net/license</a>.
-</p>
-
-<p><br/>Website: <a href="http://roundcube.net">roundcube.net</a></p>
-</div>
diff --git a/plugins/help/help.js b/plugins/help/help.js
new file mode 100644
index 000000000..0fb36bd00
--- /dev/null
+++ b/plugins/help/help.js
@@ -0,0 +1,25 @@
+/*
+ * Help plugin client script
+ * @version 1.4
+ */
+
+// hook into switch-task event to open the help window
+if (window.rcmail) {
+ rcmail.addEventListener('beforeswitch-task', function(prop) {
+ // catch clicks to help task button
+ if (prop == 'help') {
+ if (rcmail.task == 'help') // we're already there
+ return false;
+
+ var url = rcmail.url('help/index', { _rel: rcmail.task + (rcmail.env.action ? '/'+rcmail.env.action : '') });
+ if (rcmail.env.help_open_extwin) {
+ rcmail.open_window(url, false, false);
+ }
+ else {
+ rcmail.redirect(url, false);
+ }
+
+ return false;
+ }
+ });
+}
diff --git a/plugins/help/help.php b/plugins/help/help.php
index 69da6828e..66c4256a0 100644
--- a/plugins/help/help.php
+++ b/plugins/help/help.php
@@ -1,94 +1,131 @@
<?php
/**
- * Help Plugin
+ * Roundcube Help Plugin
*
* @author Aleksander 'A.L.E.C' Machniak
+ * @author Thomas Bruederli <thomas@roundcube.net>
* @license GNU GPLv3+
*
* Configuration (see config.inc.php.dist)
*
**/
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()
{
+ $this->load_config();
$this->add_texts('localization/', false);
// register task
$this->register_task('help');
// register actions
$this->register_action('index', array($this, 'action'));
$this->register_action('about', array($this, 'action'));
$this->register_action('license', array($this, 'action'));
+ $rcmail = rcmail::get_instance();
+
// add taskbar button
$this->add_button(array(
'command' => 'help',
'class' => 'button-help',
'classsel' => 'button-help button-selected',
'innerclass' => 'button-inner',
'label' => 'help.help',
), 'taskbar');
+ $this->include_script('help.js');
+ $rcmail->output->set_env('help_open_extwin', $rcmail->config->get('help_open_extwin', false), true);
+
// add style for taskbar button (must be here) and Help UI
$skin_path = $this->local_skin_path();
if (is_file($this->home . "/$skin_path/help.css")) {
$this->include_stylesheet("$skin_path/help.css");
}
}
function action()
{
$rcmail = rcmail::get_instance();
- $this->load_config();
-
// register UI objects
$rcmail->output->add_handlers(array(
'helpcontent' => array($this, 'content'),
));
if ($rcmail->action == 'about')
$rcmail->output->set_pagetitle($this->gettext('about'));
else if ($rcmail->action == 'license')
$rcmail->output->set_pagetitle($this->gettext('license'));
else
$rcmail->output->set_pagetitle($this->gettext('help'));
$rcmail->output->send('help.help');
}
function content($attrib)
{
$rcmail = rcmail::get_instance();
- if ($rcmail->action == 'about') {
- return @file_get_contents($this->home.'/content/about.html');
- }
- else if ($rcmail->action == 'license') {
- return @file_get_contents($this->home.'/content/license.html');
+ switch ($rcmail->action) {
+ case 'about':
+ if (is_readable($this->home . '/content/about.html')) {
+ return @file_get_contents($this->home . '/content/about.html');
+ }
+ $src = $rcmail->config->get('help_about_url', $rcmail->url(array('_task' => 'settings', '_action' => 'about')));
+ break;
+
+ case 'license':
+ if (is_readable($this->home . '/content/license.html')) {
+ return @file_get_contents($this->home . '/content/license.html');
+ }
+ $src = $rcmail->config->get('help_license_url', 'http://www.gnu.org/licenses/gpl-3.0-standalone.html');
+ break;
+
+ default:
+ $src = $rcmail->config->get('help_source');
+
+ // resolve task/action for depp linking
+ $index_map = $rcmail->config->get('help_index_map', array());
+ $rel = $_REQUEST['_rel'];
+ list($task,$action) = explode('/', $rel);
+ if ($add = $index_map[$rel])
+ $src .= $add;
+ else if ($add = $index_map[$task])
+ $src .= $add;
+ break;
}
// default content: iframe
- if ($src = $rcmail->config->get('help_source'))
- $attrib['src'] = $src;
+ if (!empty($src)) {
+ $attrib['src'] = $this->resolve_language($src);
+ }
if (empty($attrib['id']))
$attrib['id'] = 'rcmailhelpcontent';
$attrib['name'] = $attrib['id'];
return $rcmail->output->frame($attrib);
}
+
+ private function resolve_language($path)
+ {
+ // resolve language placeholder
+ $rcmail = rcmail::get_instance();
+ $langmap = $rcmail->config->get('help_language_map', array('*' => 'en_US'));
+ $lang = !empty($langmap[$_SESSION['language']]) ? $langmap[$_SESSION['language']] : $langmap['*'];
+ return str_replace('%l', $lang, $path);
+ }
}
diff --git a/plugins/help/localization/de_DE.inc b/plugins/help/localization/de_DE.inc
index 70c50646e..250657da6 100644
--- a/plugins/help/localization/de_DE.inc
+++ b/plugins/help/localization/de_DE.inc
@@ -1,24 +1,24 @@
<?php
/*
+-----------------------------------------------------------------------+
| plugins/help/localization/<lang>.inc |
| |
| Localization file of the Roundcube Webmail Help plugin |
| Copyright (C) 2012-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
| |
+-----------------------------------------------------------------------+
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-help/
*/
$labels = array();
$labels['help'] = 'Hilfe';
-$labels['about'] = 'Über';
+$labels['about'] = 'Über';
$labels['license'] = 'Lizenz';
?>
diff --git a/plugins/help/package.xml b/plugins/help/package.xml
index 889efd17d..d39143ba1 100644
--- a/plugins/help/package.xml
+++ b/plugins/help/package.xml
@@ -1,93 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd">
<name>help</name>
<channel>pear.roundcube.net</channel>
- <summary>Help for Roundcube</summary>
+ <summary>Online Help for Roundcube</summary>
<description>Plugin adds a new item (Help) in taskbar.</description>
<lead>
<name>Aleksander Machniak</name>
<user>alec</user>
<email>alec@alec.pl</email>
<active>yes</active>
</lead>
- <date>2012-11-11</date>
+ <date>2013-07-03</date>
<version>
- <release>1.3</release>
- <api>1.2</api>
+ <release>1.4</release>
+ <api>1.4</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license>
<notes>-</notes>
<contents>
<dir baseinstalldir="/" name="/">
<file name="help.php" role="php">
<tasks:replace from="@name@" to="name" type="package-info"/>
<tasks:replace from="@package_version@" to="version" type="package-info"/>
</file>
<file name="config.inc.php.dist" role="data"></file>
- <file name="content/about.html" role="data"></file>
<file name="content/license.html" role="data"></file>
<file name="localization/bs_BA.inc" role="data"></file>
<file name="localization/ca_ES.inc" role="data"></file>
<file name="localization/cs_CZ.inc" role="data"></file>
<file name="localization/cy_GB.inc" role="data"></file>
<file name="localization/da_DK.inc" role="data"></file>
<file name="localization/de_CH.inc" role="data"></file>
<file name="localization/de_DE.inc" role="data"></file>
<file name="localization/en_GB.inc" role="data"></file>
<file name="localization/en_US.inc" role="data"></file>
<file name="localization/eo.inc" role="data"></file>
<file name="localization/es_ES.inc" role="data"></file>
<file name="localization/et_EE.inc" role="data"></file>
<file name="localization/fa_IR.inc" role="data"></file>
<file name="localization/fi_FI.inc" role="data"></file>
<file name="localization/fr_FR.inc" role="data"></file>
<file name="localization/gl_ES.inc" role="data"></file>
<file name="localization/he_IL.inc" role="data"></file>
<file name="localization/hu_HU.inc" role="data"></file>
<file name="localization/hy_AM.inc" role="data"></file>
<file name="localization/it_IT.inc" role="data"></file>
<file name="localization/ja_JP.inc" role="data"></file>
<file name="localization/ko_KR.inc" role="data"></file>
<file name="localization/lt_LT.inc" role="data"></file>
<file name="localization/nb_NB.inc" role="data"></file>
<file name="localization/nl_NL.inc" role="data"></file>
<file name="localization/pl_PL.inc" role="data"></file>
<file name="localization/pt_BR.inc" role="data"></file>
<file name="localization/pt_PT.inc" role="data"></file>
<file name="localization/ru_RU.inc" role="data"></file>
<file name="localization/sk_SK.inc" role="data"></file>
<file name="localization/sl_SI.inc" role="data"></file>
<file name="localization/sr_CS.inc" role="data"></file>
<file name="localization/sv_SE.inc" role="data"></file>
<file name="localization/tr_TR.inc" role="data"></file>
<file name="localization/vi_VN.inc" role="data"></file>
<file name="localization/zh_CN.inc" role="data"></file>
<file name="localization/zh_TW.inc" role="data"></file>
<file name="skins/classic/help.css" role="data"></file>
<file name="skins/classic/help.gif" role="data"></file>
<file name="skins/classic/templates/help.html" role="data"></file>
<file name="skins/larry/help.css" role="data"></file>
<file name="skins/larry/help.png" role="data"></file>
<file name="skins/larry/templates/help.html" role="data"></file>
</dir>
<!-- / -->
</contents>
<dependencies>
<required>
<php>
<min>5.2.1</min>
</php>
<pearinstaller>
<min>1.7.0</min>
</pearinstaller>
</required>
</dependencies>
<phprelease/>
</package>
diff --git a/plugins/help/skins/classic/templates/help.html b/plugins/help/skins/classic/templates/help.html
index 2e430ecf3..8a398e7b3 100644
--- a/plugins/help/skins/classic/templates/help.html
+++ b/plugins/help/skins/classic/templates/help.html
@@ -1,36 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/this/help.css" />
<script type="text/javascript">
function help_init_settings_tabs()
{
var action, tab = '#helptabdefault';
if (window.rcmail && (action = rcmail.env.action)) {
- tab = '#helptab' + (action ? action : 'default');
+ tab = '#helptab' + (action ? action : 'default');
}
$(tab).addClass('tablink-selected');
}
</script>
</head>
-<body>
+<roundcube:if condition="env:extwin" /><body class="extwin"><roundcube:else /><body><roundcube:endif />
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<div id="tabsbar">
<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>
+<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>
<div id="mainscreen" class="box help-box">
<roundcube:object name="helpcontent" id="helpcontentframe" width="100%" height="100%" frameborder="0" src="/watermark.html" />
</div>
</body>
</html>
diff --git a/plugins/help/skins/larry/templates/help.html b/plugins/help/skins/larry/templates/help.html
index 39caaa62f..592a94c66 100644
--- a/plugins/help/skins/larry/templates/help.html
+++ b/plugins/help/skins/larry/templates/help.html
@@ -1,32 +1,32 @@
<roundcube:object name="doctype" value="html5" />
<html>
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
</head>
-<body>
+<roundcube:if condition="env:extwin" /><body class="extwin"><roundcube:else /><body><roundcube:endif />
<roundcube:include file="/includes/header.html" />
<div id="mainscreen">
<div id="helptoolbar" class="toolbar">
<roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" class="button help" />
<roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="button about" />
<roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="button license" />
<roundcube:container name="helptabs" id="helptabsbar" />
</div>
<div id="pluginbody" class="uibox offset">
<div class="iframebox help_<roundcube:var name='env:action' />">
<roundcube:object name="helpcontent" id="helpcontentframe" style="width:100%; height:100%" frameborder="0" src="/watermark.html" />
</div>
<roundcube:object name="message" id="message" class="statusbar" />
</div>
</div>
<roundcube:include file="/includes/footer.html" />
</body>
</html>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Mar 1, 5:25 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
165985
Default Alt Text
(18 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment