Commit 185a43ad authored by merlinofchaos's avatar merlinofchaos
Browse files

Add base_url keyword

parent 63a03c73
......@@ -444,6 +444,8 @@ function advanced_help_view_topic($module, $topic, $popup = FALSE) {
// @todo is this trusted output?
$output = file_get_contents($file);
// Make some exchanges.
// Change 'topic:' to the URL for another help topic.
if ($popup) {
$output = preg_replace('/href="topic:([^"]+)"/', 'href="' . url('help/$1', array('query' => 'popup=true')) . '"', $output);
$output = preg_replace('/src="topic:([^"]+)"/', 'src="' . url('help/$1', array('query' => 'popup=true')) . '"', $output);
......@@ -455,9 +457,14 @@ function advanced_help_view_topic($module, $topic, $popup = FALSE) {
global $base_path;
// Change 'path:' to the URL to the base help directory.
$output = preg_replace('/href="path:([^"]+)"/', 'href="' . $base_path . $info['path'] . '/$1"', $output);
$output = preg_replace('/src="path:([^"]+)"/', 'src="' . $base_path . $info['path'] . '/$1"', $output);
// Change 'base_url:' to the URL to the site.
$output = preg_replace('/href="base_url:([^"]+)"/', 'href="' . url('$1') . '"', $output);
$output = preg_replace('/src="base_url:([^"]+)"/', 'src="' . url('$1') . '"', $output);
return '<div class="advanced-help-topic">' . $output . '</div>';
}
}
......
......@@ -33,6 +33,8 @@ format will ensure the popup status remains consistent when switching between li
<p>Use <strong>&lt;a href=&quot;path:example.jpg"&gt;</strong> to reference items
within the help directory, such as images you wish to embed within the help text.</p>
<p>If the search module is enabled, the contents of help system will be indexed on cron. If you enable new modules and wish to immediately index its help text, visit the "Administration -> Reports -> Status report" and manually click the "Run cron manually" link.</p>
<p>Use <strong>&lt;a href=&quot;base_url:admin/settings/site-configuration"&gt;</strong> to reference any normal path in the site.</p>
<p>If the search module is enabled, the contents of help system will be indexed on cron. If you enable new modules and wish to immediately index its help text, visit the "Administration -> Reports -> Status report" and click the "Run cron manually" link.</p>
<p>Example: <a href="path:nowhere.jpg">Don't click this!</a></p>
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