mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-12221 custom themes revisited - implemented container concept; merged from MOODLE_19_STABLE
This commit is contained in:
parent
220f149cfc
commit
9f7f1a74a0
48 changed files with 653 additions and 732 deletions
|
@ -7,10 +7,6 @@
|
|||
require_once($CFG->libdir.'/blocklib.php');
|
||||
require_once('pagelib.php');
|
||||
|
||||
if (!empty($THEME->customcorners)) {
|
||||
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
||||
}
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$c = optional_param('c', 0, PARAM_INT);
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
@ -79,9 +75,9 @@
|
|||
|
||||
if(!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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;
|
||||
|
@ -89,7 +85,7 @@
|
|||
case 'middle':
|
||||
|
||||
echo '<td id="middle-column">';
|
||||
if (!empty($THEME->customcorners)) print_custom_corners_start();
|
||||
print_container_start();
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
@ -193,9 +189,7 @@
|
|||
print_simple_box_end();
|
||||
}
|
||||
|
||||
if (!empty($THEME->customcorners)) {
|
||||
print_custom_corners_end();
|
||||
}
|
||||
print_container_end();
|
||||
echo '</td>';
|
||||
|
||||
break;
|
||||
|
|
|
@ -28,12 +28,7 @@
|
|||
require_once("$CFG->libdir/rsslib.php");
|
||||
|
||||
require_once('pagelib.php');
|
||||
|
||||
if (!empty($THEME->customcorners)) {
|
||||
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// One of these is necessary!
|
||||
$id = optional_param('id', 0, PARAM_INT); // course module id
|
||||
$d = optional_param('d', 0, PARAM_INT); // database id
|
||||
|
@ -244,13 +239,13 @@
|
|||
echo '<table id="layout-table"><tr>';
|
||||
if ((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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();
|
||||
}
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
|
@ -554,13 +549,13 @@
|
|||
|
||||
/// If we have blocks, then print the left side here
|
||||
if (!empty($CFG->showblocksonmodpages)) {
|
||||
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
||||
print_container_end();
|
||||
echo '</td>'; // Middle column
|
||||
if ((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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>';
|
||||
}
|
||||
echo '</tr></table>';
|
||||
|
|
|
@ -220,7 +220,7 @@
|
|||
|
||||
case 'eachuser':
|
||||
if (!empty($forum->intro)) {
|
||||
print_custom_corners_box(format_text($forum->intro), 'generalbox', 'intro');
|
||||
print_box(format_text($forum->intro), 'generalbox', 'intro');
|
||||
}
|
||||
echo '<p align="center">';
|
||||
if (forum_user_can_post_discussion($forum)) {
|
||||
|
@ -246,7 +246,7 @@
|
|||
|
||||
default:
|
||||
if (!empty($forum->intro)) {
|
||||
print_custom_corners_box(format_text($forum->intro), 'generalbox', 'intro');
|
||||
print_box(format_text($forum->intro), 'generalbox', 'intro');
|
||||
}
|
||||
echo '<br />';
|
||||
if (!empty($showall)) {
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
require_once($CFG->dirroot.'/mod/quiz/locallib.php');
|
||||
require_once($CFG->dirroot.'/mod/quiz/pagelib.php');
|
||||
|
||||
if (!empty($THEME->customcorners)) {
|
||||
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
||||
}
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
|
||||
$q = optional_param('q', 0, PARAM_INT); // quiz ID
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
@ -68,14 +64,14 @@
|
|||
|
||||
if(!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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();
|
||||
|
||||
// Print the main part of the page
|
||||
|
||||
|
@ -457,7 +453,7 @@
|
|||
|
||||
function finish_page($course) {
|
||||
global $THEME;
|
||||
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
||||
print_container_end();
|
||||
echo '</td></tr></table>';
|
||||
print_footer($course);
|
||||
exit;
|
||||
|
|
|
@ -66,10 +66,6 @@ foreach ($RESOURCE_WINDOW_OPTIONS as $popupoption) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($THEME->customcorners)) {
|
||||
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* resource_base is the base class for resource types
|
||||
*
|
||||
|
@ -170,14 +166,14 @@ class resource_base {
|
|||
|
||||
if((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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 '<div id="resource">';
|
||||
|
||||
}
|
||||
|
@ -195,14 +191,14 @@ class resource_base {
|
|||
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
|
||||
|
||||
echo '</div>';
|
||||
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
||||
print_container_end();
|
||||
echo '</td>';
|
||||
|
||||
if((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'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>';
|
||||
}
|
||||
|
||||
|
|
|
@ -482,10 +482,9 @@ class resource_ims extends resource_base {
|
|||
/// Now, let's print the footer. It's harcoded here to save some space
|
||||
/// because it's impossible to use print_footer() to print NOTHING
|
||||
/// Added programatic support to customcorners themes.
|
||||
if (!empty($THEME->customcorners)) {
|
||||
print_custom_corners_end(false, 'content');
|
||||
}
|
||||
echo '</div></div></body></html>'; /// Close everything.
|
||||
// this is hack!
|
||||
print_container_end(); // container "content" started in header
|
||||
echo '</div></body></html>'; // close page div started in header
|
||||
|
||||
/// log it.
|
||||
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
|
||||
|
|
|
@ -287,8 +287,7 @@
|
|||
</div> <!-- SCORM box -->
|
||||
</div> <!-- SCORM content -->
|
||||
<?php if (!empty($THEME->customcorners)) {
|
||||
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
||||
print_custom_corners_end();
|
||||
print_container_end();
|
||||
} ?>
|
||||
<div class="clearer"> </div>
|
||||
<?php print_footer(); ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue