function print_error ($errorcode, $module='', $link='', $a=NULL) { global $CFG; if (empty($module) || $module == 'moodle' || $module == 'core') { $module = 'error'; $modulelink = 'moodle'; } else { $modulelink = $module; } if (!empty($CFG->errordocroot)) { $errordocroot = $CFG->errordocroot; } else if (!empty($CFG->docroot)) { $errordocroot = $CFG->docroot; } else { $errordocroot = 'http://docs.moodle.org'; } $lang = get_record('config', 'name', 'lang'); //getting the configurated language from the database echo $lang = substr($lang->value,0,2); //truncating the string if(!fopen($errordocroot.'/'.$lang.'/error/'.$modulelink.'/'.$errorcode)) $lang = 'en'; //if the document doesn't exists redirect to the english documentation $message = '

'.get_string($errorcode, $module, $a).'

'. '

'. ''. get_string('moreinformation').'

'; error($message, $link); }