Skip to content

Commit

Permalink
Some clean up of the styles used in the course listings on the front …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
moodler committed Mar 28, 2005
1 parent 2d99362 commit 290130b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 32 deletions.
33 changes: 19 additions & 14 deletions course/lib.php
Expand Up @@ -1235,19 +1235,19 @@ function print_category_info($category, $depth) {
}

echo '<td valign="top">'.$catimage.'</td>';
echo '<td valign="top" width="100%" class="categoryname">';
echo '<td valign="top" width="100%" class="category name">';
echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'.$category->name.'</a>';
echo '</td>';
echo '<td class="categoryname">&nbsp;</td>';
echo '<td class="category info">&nbsp;</td>';
echo '</tr>';

if ($courses && !(isset($CFG->max_category_depth)&&($depth>=$CFG->max_category_depth-1))) {
foreach ($courses as $course) {
$linkcss = $course->visible ? '' : ' class="dimmed" ';
echo '<tr><td valign="top" width="30">&nbsp;';
echo '</td><td valign="top" width="100%" class="coursename">';
echo '</td><td valign="top" width="100%" class="course name">';
echo '<a '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->fullname.'</a>';
echo '</td><td align="right" valign="top" nowrap="nowrap" class="coursename">';
echo '</td><td align="right" valign="top" nowrap="nowrap" class="course info">';
if ($course->guest ) {
echo '<a title="'.$strallowguests.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
echo '<img hspace="1" alt="'.$strallowguests.'" height="16" width="16" border="0" src="'.$CFG->pixpath.'/i/guest.gif" /></a>';
Expand Down Expand Up @@ -1279,10 +1279,10 @@ function print_category_info($category, $depth) {
echo '</td>';
}

echo '<td valign="top" width="100%" class="categoryname">';
echo '<td valign="top" width="100%" class="category name">';
echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'.$category->name.'</a>';
echo '</td>';
echo '<td valign="top" class="categorynumber">';
echo '<td valign="top" class="category number">';
if ($category->coursecount) {
echo $category->coursecount;
}
Expand Down Expand Up @@ -1314,7 +1314,6 @@ function print_courses($category, $width="100%") {
if ($courses) {
foreach ($courses as $course) {
print_course($course, $width);
echo "<br />\n";
}
} else {
print_heading(get_string("nocoursesyet"));
Expand All @@ -1340,12 +1339,12 @@ function print_course($course, $width="100%") {

echo "<table width=\"100%\">";
echo '<tr valign="top">';
echo '<td valign="top" width="50%" class="courseboxinfo">';
echo '<td valign="top" width="50%" class="info">';
echo '<b><a title="'.get_string('entercourse').'"'.
$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.
$course->fullname.'</a></b><br />';
if ($teachers = get_course_teachers($course->id)) {
echo "<span class=\"courseboxteachers\">\n";
echo "<span class=\"teachers\">\n";
foreach ($teachers as $teacher) {
if ($teacher->authority > 0) {
if (!$teacher->role) {
Expand All @@ -1361,7 +1360,7 @@ function print_course($course, $width="100%") {

echo $enrol->get_access_icons($course);

echo '</td><td valign="top" width="50%" class="courseboxsummary">';
echo '</td><td valign="top" width="50%" class="summary">';
$options = NULL;
$options->noclean = true;
$options->para = false;
Expand Down Expand Up @@ -1389,7 +1388,6 @@ function print_my_moodle() {
continue;
}
print_course($course, "100%");
echo "<br />\n";
}

if (count_records("course") > (count($courses) + 1) ) { // Some courses not being displayed
Expand Down Expand Up @@ -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) {
Expand Down
27 changes: 14 additions & 13 deletions theme/standard/styles_fonts.css
Expand Up @@ -95,9 +95,9 @@ h4 {
font-weight: bold;
}

.categoryname,
.categorynumber {
font-size:larger;
.categorybox .category,
.categorybox .category {
font-size:1.2em;
font-weight:bold;
}

Expand Down Expand Up @@ -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
***/
Expand Down
14 changes: 9 additions & 5 deletions theme/standard/styles_layout.css
Expand Up @@ -665,11 +665,6 @@ table.calendar-controls .next {
width:80px;
}

.headingblock .link {
text-align:right;
}


body#course-view .unread {
margin-left: 3em;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 290130b

Please sign in to comment.