diff --git a/mod/resource/lib.php b/mod/resource/lib.php index ed432f2a859..88de2667ee3 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -82,6 +82,7 @@ class resource_base { global $CFG; global $USER; + global $THEME; require_once($CFG->libdir.'/blocklib.php'); require_once($CFG->libdir.'/pagelib.php'); @@ -109,18 +110,40 @@ class resource_base { echo ''; - if((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) { - echo ''; + $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable; + foreach ($lt as $column) { + $lt1[] = $column; + if ($column == 'middle') break; } + foreach ($lt1 as $column) { + switch ($column) { + case 'left': + if((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) { + echo ''; + } + break; - echo ''; + } + break; + } + } } @@ -130,21 +153,48 @@ class resource_base { function display_course_blocks_end() { global $CFG; + global $THEME; $PAGE = $this->PAGE; $pageblocks = blocks_setup($PAGE); $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210); - echo ''; - print_container_end(); - echo ''; + $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable; + foreach ($lt as $column) { + if ($column != 'middle') { + array_shift($lt); + } else if ($column == 'middle') { + break; + } + } + foreach ($lt as $column) { + switch ($column) { + case 'left': + if((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) { + echo ''; + } + break; - if((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) { - echo ''; + case 'middle': + echo ''; + print_container_end(); + echo ''; + break; + + case 'right': + if((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) { + echo ''; + } + break; + } } echo '
'; - print_container_start(); - blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); - print_container_end(); - echo ''; + print_container_start(); + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); + print_container_end(); + echo ''; - print_container_start(); - echo '
'; + case 'middle': + echo '
'; + print_container_start(false, 'middle-column-wrap'); + echo '
'; + break; + case 'right': + if((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) { + echo '
'; + print_container_start(); + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + print_container_end(); + echo ''; + print_container_start(); + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); + print_container_end(); + echo ''; - print_container_start(); - blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); - print_container_end(); - echo ''; + print_container_start(); + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + print_container_end(); + echo '
'; diff --git a/theme/custom_corners/config.php b/theme/custom_corners/config.php index 5038756d5f8..f7ae3ea3632 100644 --- a/theme/custom_corners/config.php +++ b/theme/custom_corners/config.php @@ -88,6 +88,14 @@ $THEME->block_r_max_width = 210; /// values are taken. +// $THEME->layouttable = array('left', 'middle', 'right'); + +/// $THEME->layouttable defines the way the columns are displayed +/// on the pages. You can rearange the columns to have the content +/// left and the two columns on the right page side. +/// $THEME->layouttable = array('middle', 'left', 'right'); + + $THEME->courseformatsheets = true; /// When this is enabled, this theme will search for files