Permalink
Browse files

Now docs are showed in a new window based on $CFG->doctonewwindow

  • Loading branch information...
1 parent 294c6ad commit 54374e63f0b8f6d38fe1b08586c55cfc71aad7a1 stronk7 committed Jun 20, 2006
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/weblib.php
View
@@ -4885,6 +4885,11 @@ function page_doc_link($text='', $iconpath='') {
$CFG->pagepath = $ME;
}
+ $target = '';
+ if (!empty($CFG->doctonewwindow)) {
+ $target = ' target="_blank"';
+ }
+
$path = str_replace($CFG->httpswwwroot.'/','', $CFG->pagepath); // Because the page could be HTTPSPAGEREQUIRED
$path = str_replace('.php', '', $path);
@@ -4894,7 +4899,7 @@ function page_doc_link($text='', $iconpath='') {
$lang = str_replace('_utf8', '', current_language());
- $str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '">';
+ $str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '"' .$target. '>';
if (empty($iconpath)) {
$iconpath = $CFG->wwwroot . '/pix/docs.gif';

0 comments on commit 54374e6

Please sign in to comment.