Skip to content

Commit

Permalink
MDL-14476: Made 'fake blocks' in calendar and elsewhere more consiste…
Browse files Browse the repository at this point in the history
…nt with real blocks (so styling themes is easier)
  • Loading branch information
sam_marshall committed Apr 22, 2008
1 parent a56d985 commit 03beb65
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 41 deletions.
39 changes: 18 additions & 21 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,24 @@
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'id='.$courseid.'&cal_d='.$day.'&cal_m='.$mon.'&cal_y='.$yr; // For filtering

echo '<div class="sideblock">';
echo '<div class="header"><h2>'.get_string('eventskey', 'calendar').'</h2></div>';
echo '<div class="filters">';
echo calendar_filter_controls($view, $getvars, NULL, $courses);
echo '</div>';
echo '</div>';

echo '<div class="sideblock">';
echo '<div class="header"><h2>'.get_string('monthlyview', 'calendar').'</h2></div>';

echo '<div class="minicalendarblock minicalendartop">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</div>';
echo '</div>';
$content='<div class="filters">';
$content.=calendar_filter_controls($view, $getvars, NULL, $courses);
$content.='</div>';

print_side_block(get_string('eventskey', 'calendar'),$content);

$content='<div class="minicalendarblock minicalendartop">';
$content.=calendar_top_controls('display', array('id' => $courseid, 'm' => $prevmon, 'y' => $prevyr));
$content.=calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
$content.='</div><div class="minicalendarblock">';
$content.=calendar_top_controls('display', array('id' => $courseid, 'm' => $mon, 'y' => $yr));
$content.=calendar_get_mini($courses, $groups, $users, $mon, $yr);
$content.='</div><div class="minicalendarblock">';
$content.=calendar_top_controls('display', array('id' => $courseid, 'm' => $nextmon, 'y' => $nextyr));
$content.=calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
$content.='</div>';

print_side_block(get_string('monthlyview', 'calendar'),$content);

echo '</td>';

Expand Down
20 changes: 16 additions & 4 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6334,8 +6334,10 @@ function rebuildnolinktag($text) {
* Prints a nice side block with an optional header. The content can either
* be a block of HTML or a list of text with optional icons.
*
* @param string $heading Block $title embedded in HTML tags, for example <h2>.
* @param string $content ?
* @param string $heading HTML for the heading. Can include full HTML or just
* plain text - plain text will automatically be enclosed in the appropriate
* heading tags.
* @param string $content HTML for the content
* @param array $list ?
* @param array $icons ?
* @param string $footer ?
Expand Down Expand Up @@ -6398,7 +6400,9 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
/**
* Starts a nice side block with an optional header.
*
* @param string $heading ?
* @param string $heading HTML for the heading. Can include full HTML or just
* plain text - plain text will automatically be enclosed in the appropriate
* heading tags.
* @param array $attributes ?
* @todo Finish documenting this function
*/
Expand Down Expand Up @@ -6441,7 +6445,15 @@ function print_side_block_start($heading='', $attributes = array()) {
echo '<div class="wrap">'."\n";
}
if ($heading) {
//Accessibility: H2 more appropriate in moodleblock.class.php: _title_html.
// Some callers pass in complete html for the heading, which may include
// complicated things such as the 'hide block' button; some just pass in
// text. If they only pass in plain text i.e. it doesn't include a
// <div>, then we add in standard tags that make it look like a normal
// page block including the h2 for accessibility
if(strpos($heading,'</div>')===false) {
$heading='<div class="title"><h2>'.$heading.'</h2></div>';
}

echo '<div class="header">';
if (!empty($THEME->customcorners)) {
echo '<div class="bt"><div>&nbsp;</div></div>';
Expand Down
2 changes: 2 additions & 0 deletions theme/custom_corners/js/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
} else {
tagname = 'haslayouttable onlymiddlecolumn';
}
} else if(document.getElementsByTagName('body')[0].id.substring(0,9)=='calendar-') {
tagname='haslayouttable onlyrightcolumn';
}
function setbodytag (tagname) {
Expand Down
3 changes: 3 additions & 0 deletions theme/custom_corners/user_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1482,4 +1482,7 @@ body.grade-report-grader table#user-grades td.course {
.tag_cloud .s2,
.tag_cloud .s1 {
font-size: 0.9em;
}
#calendar .maincalendar {
background:white;
}
4 changes: 0 additions & 4 deletions theme/standard/styles_color.css
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,6 @@ table.minicalendar {
background-color: #EEEEEE;
}

#calendar td.sidecalendar .sideblock {
border-color: #DDDDDD;
}


/***
*** Course
Expand Down
12 changes: 1 addition & 11 deletions theme/standard/styles_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -1531,16 +1531,11 @@ table.minicalendar td {
height: auto;
}

#calendar div.header
#calendar .maincalendar div.header
{
padding: 5px;
}

#calendar .sideblock div.header
{
border:none;
}

#calendar .maincalendar .buttons {
float: right;
}
Expand Down Expand Up @@ -1738,11 +1733,6 @@ table.minicalendar th {
border-width:0px;
}

#calendar td.sidecalendar .sideblock {
border: 1px solid;
margin-bottom:10px;
}

#calendar td.sidecalendar .minicalendartop {
padding-top:10px;
}
Expand Down
1 change: 0 additions & 1 deletion theme/wood/styles_color.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ legend,
#course-user .section,
#site-index .sitetopic .sitetopiccontent,
#calendar .maincalendar .filters table,
#calendar .sidecalendar,
#calendar .sidecalendar .filters table,
.block_calendar_month .filters table,
#calendar .maincalendar .minicalendar,
Expand Down

0 comments on commit 03beb65

Please sign in to comment.