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...
nebgor committed Jun 2, 2011
1 parent dba2410 commit c372808e97ca60f4e1388d1bfa01e0b7b505cde6
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/weblib.php
View
@@ -2816,10 +2816,14 @@ function convert_tabrows_to_tree($tabrows, $selected, $inactive, $activated) {
*/
function get_docs_url($path) {
global $CFG;
+ //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];
if (!empty($CFG->docroot)) {
- return $CFG->docroot . '/' . current_language() . '/' . $path;
+ return $CFG->docroot . '/' . $branch . '/' . current_language() . '/' . $path;
} else {
- return 'http://docs.moodle.org/en/'.$path;
+ return 'http://docs.moodle.org/'. $branch . '/en/' . $path;
}
}

0 comments on commit c372808

Please sign in to comment.