$courseid = $courseorid;
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
return false;
- }
+ }
}
// frontpage course can not be deleted!!
* @param string $module The module where the key identifier is stored,
* usually expressed as the filename in the language pack without the
* .php on the end but can also be written as mod/forum or grade/export/xls.
- * If none is specified then moodle.php is used.
+ * If none is specified then moodle.php is used.
* @param mixed $a An object, string or number that can be used
* within translation strings
* @param array $extralocations DEPRICATED. An array of strings with other
* locations to look for string files. This used to be used by plugins so
* they could package their language strings in the plugin folder, however,
- * There is now a better way to achieve this. See
+ * There is now a better way to achieve this. See
* http://docs.moodle.org/en/Development:Places_to_search_for_lang_strings.
* @return string The localized string.
*/
if ($module == '') {
$module = 'moodle';
}
-
+
/// If the "module" is actually a pathname, then automatically derive the proper module name
if (strpos($module, '/') !== false) {
$modulepath = split('/', $module);
case 'mod':
$module = $modulepath[1];
break;
-
+
case 'blocks':
case 'block':
$module = 'block_'.$modulepath[1];
break;
-
+
case 'enrol':
$module = 'enrol_'.$modulepath[1];
break;
-
+
case 'format':
$module = 'format_'.$modulepath[1];
break;
-
+
case 'grade':
$module = 'grade'.$modulepath[1].'_'.$modulepath[2];
- break;
+ break;
}
}
if (!empty($extralocations)) {
// This is an old, deprecated mechanism that predates the
- // places_to_search_for_lang_strings mechanism that comes later in
+ // places_to_search_for_lang_strings mechanism that comes later in
// this function. So tell people who use it to change.
debugging('The fourth, $extralocations parameter to get_string is deprecated. ' .
'See http://docs.moodle.org/en/Development:Places_to_search_for_lang_strings ' .
}
/**
- * Checks to see if is the browser operating system matches the specified
+ * Checks to see if is the browser operating system matches the specified
* brand.
- *
+ *
* Known brand: 'Windows','Linux','Macintosh','SGI','SunOS','HP-UX'
*
* @uses $_SERVER
- * @param string $brand The operating system identifier being tested
+ * @param string $brand The operating system identifier being tested
* @return bool true if the given brand below to the detected operating system
*/
function check_browser_operating_system($brand) {
if (preg_match("/$brand/i", $_SERVER['HTTP_USER_AGENT'])) {
return true;
}
-
- return false;
+
+ return false;
}
/**
* Sets maximum expected time needed for upgrade task.
* Please always make sure that upgrade will not run longer!
*
- * The script may be automatically aborted if upgrade times out.
+ * The script may be automatically aborted if upgrade times out.
*
* @param int $max_execution_time in seconds (can not be less than 60 s)
* @return void
$upgraderunning = get_config(null, 'upgraderunning');
} else {
$upgraderunning = $CFG->upgraderunning;
- }
-
+ }
+
if (!$upgraderunning) {
// upgrade not running or aborted
print_error('upgradetimedout', 'admin', "$CFG->wwroot/$CFG->admin/");
if (address_in_subnet($client_ip, $subnet)) {
$inlist = true;
break;
- }
+ }
}
return $inlist;
}
function getremoteaddr() {
global $CFG;
- switch ($CFG->getremoteaddr) {
+ switch ($CFG->getremoteaddrconf) {
case 3:
if (!empty($_SERVER['REMOTE_ADDR'])) {
return cleanremoteaddr($_SERVER['REMOTE_ADDR']);