Commit 3ee69a0c authored by gisle's avatar gisle
Browse files

Issue #3110233 by gisle: Fixed error on %menu_tail for anon

parent f9e1238c
name = Advanced help name = Advanced Help
description = Provide extended help and documentation. description = Provide extended help and documentation.
core = 7.x core = 7.x
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
*/ */
function advanced_help_uninstall() { function advanced_help_uninstall() {
variable_del('advanced_help_last_cron'); variable_del('advanced_help_last_cron');
$sam = variable_get('search_active_modules', NULL);
if (!empty($sam)) {
unset($sam['advanced_help']);
variable_set('search_active_modules', $sam);
}
} }
/** /**
......
...@@ -113,9 +113,13 @@ function advanced_help_menu() { ...@@ -113,9 +113,13 @@ function advanced_help_menu() {
* Implements hook_menu_alter(). * Implements hook_menu_alter().
*/ */
function advanced_help_menu_alter(&$callbacks) { function advanced_help_menu_alter(&$callbacks) {
// We need to fix the menu item provided by search module to restrict access. // Check if it advanced_help is registered.
$callbacks['search/advanced_help/%menu_tail']['access callback'] = 'user_access'; $sam = variable_get('search_active_modules', NULL);
$callbacks['search/advanced_help/%menu_tail']['access arguments'] = array('view advanced help index'); if (!empty($sam['advanced_help']) && 'advanced_help' == $sam['advanced_help']) {
// We need to fix the menu item provided by search module to restrict access.
$callbacks['search/advanced_help/%menu_tail']['access callback'] = 'user_access';
$callbacks['search/advanced_help/%menu_tail']['access arguments'] = array('view advanced help index');
}
} }
/** /**
......
<p>The <strong>Advanced help</strong> module provides a framework that <p>The <strong>Advanced Help</strong> module provides a framework that
allows help texts to be viewed as integrated into a Drupal allows help texts to be viewed as integrated into a Drupal
website.</p> website.</p>
...@@ -29,12 +29,12 @@ project's hierarchy.</p> ...@@ -29,12 +29,12 @@ project's hierarchy.</p>
<p>May be integrated into <code>hook_help()</code> using companion <p>May be integrated into <code>hook_help()</code> using companion
module module
<a href="https://www.drupal.org/project/advanced_help_hint"><strong>Advanced help hint</strong></a>.</p> <a href="https://www.drupal.org/project/advanced_help_hint"><strong>Advanced Help Hint</strong></a>.</p>
<h2 id="demo">Demonstration</h2> <h2 id="demo">Demonstration</h2>
<p>The project comes with a small demo module named <p>The project comes with a small demo module named
<strong>Advanced help example</strong> to demonstrate how it works. <strong>Advanced Help Example</strong> to demonstrate how it works.
This example also shows how to make use of some of the css classes This example also shows how to make use of some of the css classes
provided.</p> provided.</p>
...@@ -43,14 +43,14 @@ advanced help features, see the <strong>Views</strong> project.</p> ...@@ -43,14 +43,14 @@ advanced help features, see the <strong>Views</strong> project.</p>
<p>For an example of translation of help text, see the <p>For an example of translation of help text, see the
directory <code>translations/help/nb</code> in the <strong>Advanced directory <code>translations/help/nb</code> in the <strong>Advanced
help example</strong> submodule. For translation instructions, see the Help Example</strong> submodule. For translation instructions, see the
section named “<a href="&topic:advanced_help/translation&">Translating section named “<a href="&topic:advanced_help/translation&">Translating
advanced help</a>”.</p> advanced help</a>”.</p>
<h2 id="theme">Theme</h2> <h2 id="theme">Theme</h2>
<p>The <strong>Advanced help</strong> and <p>The <strong>Advanced Help</strong> and
<strong>Advanced help example</strong> modules implements <strong>Advanced Help Example</strong> modules implements
<code>hook_admin_paths_alter()</code> to render the help <code>hook_admin_paths_alter()</code> to render the help
texts rendered using the site's administrative theme. texts rendered using the site's administrative theme.
The <code>help.css</code> provided is created with the The <code>help.css</code> provided is created with the
...@@ -71,6 +71,6 @@ help/help_example/* ...@@ -71,6 +71,6 @@ help/help_example/*
</pre> </pre>
<p>You may attach your own custom css to any project that <p>You may attach your own custom css to any project that
uses <strong>Advanced help</strong> to provide help.</p> uses <strong>Advanced Help</strong> to provide help.</p>
<p>To translate a help-file indexed by <strong>Advanced help</strong>, <p>To translate a help-file indexed by <strong>Advanced Help</strong>,
first create a directory first create a directory
<code>translations/help/<em>language</em></code> in the project's <code>translations/help/<em>language</em></code> in the project's
root directory. The <em>language</em> is the language code that root directory. The <em>language</em> is the language code that
...@@ -29,10 +29,10 @@ linked items, if any, will be translated.</p> ...@@ -29,10 +29,10 @@ linked items, if any, will be translated.</p>
<p>If a topic is not translated, the default (untranslated) version <p>If a topic is not translated, the default (untranslated) version
will be shown instead.</p> will be shown instead.</p>
<h2>Translating Advanced help's help files</h2> <h2>Translating Advanced Help's help files</h2>
<p>If you want to help with the translation of <p>If you want to help with the translation of
<strong>Advanced help</strong> help texts for a particular language, look for an issue named named “Translation to XXX” (where <strong>Advanced Help</strong> help texts for a particular language, look for an issue named named “Translation to XXX” (where
“XXX” is the language you want to translate the help texts to) in the <a href="https://www.drupal.org/project/issues/advanced_help">issue queue for Advanced help</a>. “XXX” is the language you want to translate the help texts to) in the <a href="https://www.drupal.org/project/issues/advanced_help">issue queue for Advanced help</a>.
If such an issue does not exist, please can create it. If such an issue does not exist, please can create it.
Choose <em>Category</em> “Task”, Choose <em>Category</em> “Task”,
......
<p>The <strong>Advanced help</strong> module provides a framework that <p>The <strong>Advanced Help</strong> module provides a framework that
allows module and theme developers integrate help texts in a Drupal allows module and theme developers integrate help texts in a Drupal
site.</p> site.</p>
...@@ -20,7 +20,7 @@ help” will show up under “Help”: ...@@ -20,7 +20,7 @@ help” will show up under “Help”:
<h2 id="ah_crehlp">Creating help</h2> <h2 id="ah_crehlp">Creating help</h2>
<p>Modules and themes utilizing <strong>Advanced help</strong> should <p>Modules and themes utilizing <strong>Advanced Help</strong> should
create a subdirectory named <code>help</code> inside their own main create a subdirectory named <code>help</code> inside their own main
directory. Place the file directory. Place the file
<em>MODULENAME</em>.help.ini (resp. <em>THEMENAME</em>.help.ini) in this subdirectory. <em>MODULENAME</em>.help.ini (resp. <em>THEMENAME</em>.help.ini) in this subdirectory.
...@@ -113,8 +113,8 @@ $output .= '&nbsp;' . t('Click the help icon!'); ...@@ -113,8 +113,8 @@ $output .= '&nbsp;' . t('Click the help icon!');
<div class="help-img-caption" style="max-width:180px">Question mark help icon</div> <div class="help-img-caption" style="max-width:180px">Question mark help icon</div>
</div> </div>
<p>See the source code of demo module <strong>Advanced help <p>See the source code of demo module <strong>Advanced Help
example</strong> for link examples.</p> Example</strong> for link examples.</p>
<p>You may link to other help topics inside your HTML help file using <p>You may link to other help topics inside your HTML help file using
this format:</p> this format:</p>
......
name = Advanced help example name = Advanced Help Example
description = A example help module to demonstrate the advanced help module. description = A example help module to demonstrate the advanced help module.
core = 7.x core = 7.x
dependencies[] = advanced_help dependencies[] = advanced_help
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment