diff --git a/lib/weblib.php b/lib/weblib.php index f6a5a4f42ec..9b57dbb7246 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5842,11 +5842,13 @@ function print_error($errorcode, $module='error', $link='', $a=NULL, $extralocat } if (!empty($CFG->errordocroot)) { - $errordocroot = $CFG->errordocroot; - } else if (!empty($CFG->docroot)) { - $errordocroot = $CFG->docroot; + $errordoclink = $CFG->errordocroot.'/en'; } else { - $errordocroot = 'http://docs.moodle.org'; + $errordoclink = get_doc_root(); + if (is_null($errordoclink)) { + $lang = current_language(); + $errordoclink = 'http://docs.moodle.org/19/'.$lang; //no doc links set. point to default. + } } if (defined('FULLME') && FULLME == 'cron') { @@ -5863,7 +5865,7 @@ function print_error($errorcode, $module='error', $link='', $a=NULL, $extralocat $message = clean_text('
'. ''. - ''. + ''. get_string('moreinformation').'
'); if (! defined('HEADER_PRINTED')) { @@ -6957,17 +6959,39 @@ function page_doc_link($text='', $iconpath='') { function doc_link($path='', $text='', $iconpath='') { global $CFG; - if (empty($CFG->docroot)) { - return ''; - } - $target = ''; if (!empty($CFG->doctonewwindow)) { $target = ' target="_blank"'; } - $lang = str_replace('_utf8', '', current_language()); + if (is_null($docroot = get_doc_root())) { + return ''; + } + $str = ''; + + if (empty($iconpath)) { + $iconpath = $CFG->httpswwwroot . '/pix/docs.gif'; + } + + // alt left blank intentionally to prevent repetition in screenreaders + $str .= '