]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12429 Applied and tested François' patches to 1.8, 1.9 and head.
authornicolasconnault <nicolasconnault>
Fri, 4 Jan 2008 06:45:55 +0000 (06:45 +0000)
committernicolasconnault <nicolasconnault>
Fri, 4 Jan 2008 06:45:55 +0000 (06:45 +0000)
lib/weblib.php

index 224ff4932e1cf050a36015514a98a0e0fe756ae1..8681aca0268f251f4f2fe8e2feeacb732341f029 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas  http://dougiamas.com       //
+// Copyright (C) 1999 onwards Martin Dougiamas  http://dougiamas.com     //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
 // it under the terms of the GNU General Public License as published by  //
@@ -6852,15 +6852,16 @@ function doc_link($path='', $text='', $iconpath='') {
     if (empty($CFG->docroot)) {
         return '';
     }
+    
+    $lang = str_replace('_utf8', '', current_language());
+    $url = $CFG->docroot. '/' .$lang. '/' .$path;
 
     $target = '';
     if (!empty($CFG->doctonewwindow)) {
-        $target = ' target="_blank"';
+        $target = " onclick=\"window.open('$url'); return false;\""; 
     }
 
-    $lang = str_replace('_utf8', '', current_language());
-
-    $str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '"' .$target. '>';
+    $str = "<a href=\"$url\"$target>";
 
     if (empty($iconpath)) {
         $iconpath = $CFG->httpswwwroot . '/pix/docs.gif';