Permalink
Browse files

MDL-27695 Documentation : updated the moodle docs link at the footer …

…of pages to point to new docs url
  • Loading branch information...
1 parent 59d8944 commit 7bfc8766bcda93114e060f99aa1db06b15978247 @nebgor nebgor committed Jun 2, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/weblib.php
View
7 lib/weblib.php
@@ -6968,7 +6968,12 @@ function doc_link($path='', $text='', $iconpath='') {
$lang = str_replace('_utf8', '', current_language());
- $str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '"' .$target. '>';
+ //derive branch from the first three letters of version.php's $release with the period taken out.($CFG->release isn't populated yet during upgrade)
+ include($CFG->dirroot.'/version.php');
+ preg_match('/^(.)\.(.)/', $release, $matches);
+ $branch = $matches[1].$matches[2];
+
+ $str = '<a href="' .$CFG->docroot. '/' .$branch. '/' .$lang. '/' .$path. '"' .$target. '>';
if (empty($iconpath)) {
$iconpath = $CFG->httpswwwroot . '/pix/docs.gif';

0 comments on commit 7bfc876

Please sign in to comment.