From 290130b3f848d54511f0d540ebe1e7dd4e2c58d4 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 28 Mar 2005 06:47:54 +0000 Subject: [PATCH] Some clean up of the styles used in the course listings on the front page --- course/lib.php | 33 ++++++++++++++++++-------------- theme/standard/styles_fonts.css | 27 +++++++++++++------------- theme/standard/styles_layout.css | 14 +++++++++----- 3 files changed, 42 insertions(+), 32 deletions(-) diff --git a/course/lib.php b/course/lib.php index 251898c1a83..e82ef58a600 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1235,19 +1235,19 @@ function print_category_info($category, $depth) { } echo ''.$catimage.''; - echo ''; + echo ''; echo ''.$category->name.''; echo ''; - echo ' '; + echo ' '; echo ''; if ($courses && !(isset($CFG->max_category_depth)&&($depth>=$CFG->max_category_depth-1))) { foreach ($courses as $course) { $linkcss = $course->visible ? '' : ' class="dimmed" '; echo ' '; - echo ''; + echo ''; echo ''.$course->fullname.''; - echo ''; + echo ''; if ($course->guest ) { echo ''; echo ''.$strallowguests.''; @@ -1279,10 +1279,10 @@ function print_category_info($category, $depth) { echo ''; } - echo ''; + echo ''; echo ''.$category->name.''; echo ''; - echo ''; + echo ''; if ($category->coursecount) { echo $category->coursecount; } @@ -1314,7 +1314,6 @@ function print_courses($category, $width="100%") { if ($courses) { foreach ($courses as $course) { print_course($course, $width); - echo "
\n"; } } else { print_heading(get_string("nocoursesyet")); @@ -1340,12 +1339,12 @@ function print_course($course, $width="100%") { echo ""; echo ''; - echo '
'; + echo ''; echo ''. $course->fullname.'
'; if ($teachers = get_course_teachers($course->id)) { - echo "\n"; + echo "\n"; foreach ($teachers as $teacher) { if ($teacher->authority > 0) { if (!$teacher->role) { @@ -1361,7 +1360,7 @@ function print_course($course, $width="100%") { echo $enrol->get_access_icons($course); - echo '
'; + echo ''; $options = NULL; $options->noclean = true; $options->para = false; @@ -1389,7 +1388,6 @@ function print_my_moodle() { continue; } print_course($course, "100%"); - echo "
\n"; } if (count_records("course") > (count($courses) + 1) ) { // Some courses not being displayed @@ -1518,16 +1516,23 @@ function set_coursemodule_visible($id, $visible) { return set_field("course_modules", "visible", $visible, "id", $id); } +/* + * Delete a course module and any associated data at the course level (events) + * Until 1.5 this function simply marked a deleted flag ... now it + * deletes it completely. + * + */ function delete_course_module($id) { - $cm = get_record('course_modules', 'id', $id); + if (!$cm = get_record('course_modules', 'id', $id)) { + return true; + } $modulename = get_field('modules', 'name', 'id', $cm->module); if ($events = get_records_select('event', "instance = '$cm->instance' AND modulename = '$modulename'")) { foreach($events as $event) { delete_event($event); } } - return set_field("course_modules", "visible", 0, "id", $id); - return set_field("course_modules", "deleted", 1, "id", $id); + return delete_records('course_modules', 'id', $cm->id); } function delete_mod_from_section($mod, $section) { diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index 09b30fa882d..41978ea22f0 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -95,9 +95,9 @@ h4 { font-weight: bold; } -.categoryname, -.categorynumber { - font-size:larger; +.categorybox .category, +.categorybox .category { + font-size:1.2em; font-weight:bold; } @@ -261,33 +261,34 @@ table.minicalendar { ***/ .activitydate, .activityhead { - font-size:x-small; + font-size:0.7em; } .weeklydatetext { - font-size:medium; + font-size:0.9em; font-weight:bold; } -.courseboxinfo { - font-size:medium; +.coursebox .info { + font-size:1em; } -.courseboxteachers, -.courseboxcost { - font-size:smaller; +.coursebox .teachers, +.coursebox .cost { + font-size:0.8em; } -.courseboxsummary { - font-size:small; +.coursebox .summary { + font-size:0.7em; } + + #course-view .section .left { font-weight:bold; } - /*** *** Doc ***/ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 8a9556c3ff4..8246b6fe256 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -665,11 +665,6 @@ table.calendar-controls .next { width:80px; } -.headingblock .link { - text-align:right; -} - - body#course-view .unread { margin-left: 3em; } @@ -709,6 +704,15 @@ body#course-user .section h2 { padding:5px; } +.headingblock .link { + text-align:right; +} + +body#site-index .headingblock { + margin-bottom: 8px; +} + + .categoryboxcontent, .courseboxcontent { border-width:1px;