Skip to content

Commit

Permalink
MDL-12221 custom themes revisited - implemented container concept; me…
Browse files Browse the repository at this point in the history
…rged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Nov 23, 2007
1 parent 220f149 commit 9f7f1a7
Show file tree
Hide file tree
Showing 48 changed files with 616 additions and 695 deletions.
16 changes: 6 additions & 10 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/pagelib.php');

if (!empty($THEME->customcorners)) {
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
}

if ($site = get_site()) {
require_login();
}
Expand Down Expand Up @@ -132,14 +128,14 @@
switch ($column) {
case 'left':
echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
break;
case 'middle':
echo '<td id="middle-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
echo '<a name="startofcontent"></a>';

if ($statusmsg != '') {
Expand All @@ -162,15 +158,15 @@
echo '</div>';
echo '</form>';

if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
break;
case 'right':
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
}
break;
Expand Down
16 changes: 6 additions & 10 deletions admin/stickyblocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
require_once($CFG->dirroot.'/lib/pagelib.php');
require_once($CFG->dirroot.'/lib/blocklib.php');

if (!empty($THEME->customcorners)) {
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
}

$pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and -

$pagetypes = array(PAGE_MY_MOODLE => array('id' => PAGE_MY_MOODLE,
Expand Down Expand Up @@ -58,12 +54,12 @@
echo '<tr valign="top">';

echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="left-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $blocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
echo '<td valign="top" id="middle-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();

} else {
require_once($CFG->libdir.'/adminlib.php');
Expand All @@ -80,12 +76,12 @@


if (!empty($pt)) {
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="right-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $blocks, BLOCK_POS_RIGHT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
echo '</tr></table>';
print_footer();
Expand Down
6 changes: 3 additions & 3 deletions blog/footer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
</td>
</tr>
</table>
<?php if (!empty($THEME->customcorners)) print_custom_corners_end(); ?>
<?php print_container_end(); ?>
</td>
<?php
print '<!-- End page content -->'."\n";
Expand All @@ -10,10 +10,10 @@
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
echo '<td style="vertical-align: top; width: '. $preferred_width_right .'px;" id="right-column">';
echo '<!-- Begin right side blocks -->'."\n";
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
print_spacer(1, 120, true);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '<!-- End right side blocks -->'."\n";
echo '</td>';
}
Expand Down
10 changes: 3 additions & 7 deletions blog/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
require_once($CFG->libdir .'/blocklib.php');
require_once($CFG->dirroot .'/course/lib.php');

if (!empty($THEME->customcorners)) {
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
}

$blockaction = optional_param('blockaction','', PARAM_ALPHA);
$instanceid = optional_param('instanceid', 0, PARAM_INT);
$blockid = optional_param('blockid', 0, PARAM_INT);
Expand Down Expand Up @@ -263,17 +259,17 @@
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
print '<td style="vertical-align: top; width: '. $preferred_width_left .'px;" id="left-column">' . "\n";
print '<!-- Begin left side blocks -->' . "\n";
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
print '<!-- End left side blocks -->' . "\n";
print '</td>' . "\n";
}

/// Start main column
print '<!-- Begin page content -->' . "\n";
print '<td>';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
?>
<table width="100%">
<tr>
Expand Down
16 changes: 6 additions & 10 deletions course/format/social/format.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php // $Id$
// format.php - course format featuring social forum
// included from view.php

if (!empty($THEME->customcorners)) {
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
}

// Bounds for block widths
// more flexible for theme designers taken from theme config.php
Expand Down Expand Up @@ -32,14 +28,14 @@

if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
}

echo '<td id="middle-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
echo skip_main_destination();
if ($forum = forum_get_course_forum($course->id, 'social')) {
print_heading_block(get_string('socialheadline'));
Expand All @@ -52,15 +48,15 @@
} else {
notify('Could not find or create a social forum here');
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';

// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print_container_end();
echo '</td>';
}

Expand Down
Loading

0 comments on commit 9f7f1a7

Please sign in to comment.