]> git.mjollnir.org Git - moodle.git/commitdiff
Now docs are showed in a new window based on $CFG->doctonewwindow
authorstronk7 <stronk7>
Tue, 20 Jun 2006 13:53:09 +0000 (13:53 +0000)
committerstronk7 <stronk7>
Tue, 20 Jun 2006 13:53:09 +0000 (13:53 +0000)
Merged from MOODLE_16_STABLE

lib/weblib.php

index 9fc171dad8f3c24b03ed340f8499e359a2f38b6b..82f12df2116b2d78e430f9d3d70f4d084dc1af16 100644 (file)
@@ -4908,6 +4908,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);
 
@@ -4917,7 +4922,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';