diff --git a/admin/index.php b/admin/index.php index 2303c24699f..c3325fc98f8 100644 --- a/admin/index.php +++ b/admin/index.php @@ -193,6 +193,25 @@ } +/// Insert default values for any important configuration variables + + include_once("$CFG->dirroot/lib/defaults.php"); + + foreach ($defaults as $name => $value) { + if (!isset($CFG->$name)) { + $CFG->$name = $value; + set_config($name, $value); + $configchange = true; + } + } + +/// If any new configurations were found then send to the config page to check + + if (!empty($configchange)) { + redirect("config.php"); + } + + /// Upgrade backup/restore system if necessary require_once("$CFG->dirroot/backup/lib.php"); upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards @@ -312,25 +331,6 @@ } -/// Insert default values for any important configuration variables - - include_once("$CFG->dirroot/lib/defaults.php"); - - foreach ($defaults as $name => $value) { - if (!isset($CFG->$name)) { - $CFG->$name = $value; - set_config($name, $value); - $configchange = true; - } - } - - -/// If any new configurations were found then send to the config page to check - - if (!empty($configchange)) { - redirect("config.php"); - } - /// Set up the overall site name etc. if (! $site = get_site()) { redirect("site.php"); diff --git a/admin/site.php b/admin/site.php index 02ea4c53f23..d76248e076c 100644 --- a/admin/site.php +++ b/admin/site.php @@ -65,6 +65,7 @@ $form->shortname = ""; $form->summary = ""; $form->newsitems = 3; + $form->numsections = 0; $form->id = ""; $form->category = 0; $form->format = "social"; diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index ec2c56726c6..5be560390fb 100644 --- a/blocks/course_list/block_course_list.php +++ b/blocks/course_list/block_course_list.php @@ -2,7 +2,7 @@ class CourseBlock_course_list extends MoodleBlock { function CourseBlock_course_list ($course) { - $this->title = get_string('mycourses'); + $this->title = get_string('courses'); $this->content_type = BLOCK_TYPE_LIST; $this->course = $course; $this->version = 2005052600; diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 8ce4593b534..50b182ec0f1 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -15,10 +15,14 @@ class CourseBlock_site_main_menu extends MoodleBlock { function get_content() { global $USER, $CFG; - if($this->content !== NULL) { + if ($this->content !== NULL) { return $this->content; } + if (empty($this->course)) { + return ''; + } + $this->content = New stdClass; $this->content->items = array(); $this->content->icons = array(); diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index e5bdd5baf10..8190b58bf8b 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -15,9 +15,12 @@ class CourseBlock_social_activities extends MoodleBlock { function get_content() { global $USER, $CFG; - if($this->content !== NULL) { + if ($this->content !== NULL) { return $this->content; } + if (empty($this->course)) { + return ''; + } $this->content = New object; $this->content->items = array(); diff --git a/calendar/lib.php b/calendar/lib.php index cf48e484bbc..e68ca2dc5b7 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -628,7 +628,11 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL) { $getvars = '&from='.$type; break; case 'course': - $getvars = '&from=course&id='.$_GET['id']; + if (isset($_GET['id'])) { + $getvars = '&from=course&id='.$_GET['id']; + } else { + $getvars = '&from=course'; + } if (isset($course->groupmode) and !$course->groupmode and $course->groupmodeforce) { $groupevents = false; } diff --git a/course/lib.php b/course/lib.php index 26ebd62582d..ba418173cee 100644 --- a/course/lib.php +++ b/course/lib.php @@ -438,6 +438,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per if ($course->category) { $joins[] = "l.course='$course->id'"; } else { + $courses[0] = ''; if ($ccc = get_courses("all", "c.id ASC", "c.id,c.shortname")) { foreach ($ccc as $cc) { $courses[$cc->id] = "$cc->shortname"; @@ -500,6 +501,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per } $count=0; + $ldcache = array(); $tt = getdate(time()); $today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]); @@ -512,31 +514,37 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&"); - echo "
| course\">".$courses[$log->course]." | "; + echo ''.$courses[$log->course].' | '; } - echo "".userdate($log->time, "%a")." | "; - echo "".userdate($log->time, $strftimedatetime)." | "; - echo ""; - link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700); - echo " | "; + echo ''.userdate($log->time, '%a').' | '; + echo ''.userdate($log->time, $strftimedatetime).' | '; + echo ''; + link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", 'ipatlas',$log->ip, 400, 700); + echo ' | '; $fullname = fullname($log, $isteacher); - echo "userid&course=$log->course\">$fullname | "; - echo ""; - link_to_popup_window( make_log_url($log->module,$log->url), "fromloglive","$log->module $log->action", 400, 600); - echo " | "; - echo "$log->info | "; - echo "userid&course=$log->course".'">'.$fullname.' | '; + echo ''; + link_to_popup_window( make_log_url($log->module,$log->url), 'fromloglive',"$log->module $log->action", 400, 600); + echo ' | '; + echo ''.$log->info.' | '; + echo ''; } - echo "