Commit 939c9547 authored by urs_hunkler's avatar urs_hunkler
Browse files

added/changed custom corners lib and calls to add the necessary divs

parent d94f5802
......@@ -5,6 +5,10 @@ require_once($CFG->libdir.'/adminlib.php');
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();
}
......@@ -128,23 +132,14 @@ if (!empty($SITE->fullname)) {
switch ($column) {
case 'left':
echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
break;
case 'middle':
echo '<td id="middle-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
echo '<a name="startofcontent"></a>';
if ($statusmsg != '') {
......@@ -167,24 +162,15 @@ if (!empty($SITE->fullname)) {
echo '</div>';
echo '</form>';
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_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->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
}
break;
......
......@@ -4,7 +4,11 @@
require_once($CFG->dirroot.'/my/pagelib.php');
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,
......@@ -50,11 +54,13 @@
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();
blocks_print_group($PAGE, $blocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
echo '<td valign="top" id="middle-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
} else {
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('stickyblocks');
......@@ -70,9 +76,12 @@
if (!empty($pt)) {
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="left-column">';
if (!empty($THEME->customcorners)) print_custom_corners_start();
blocks_print_group($PAGE, $blocks, BLOCK_POS_RIGHT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
echo '</tr></table>';
print_footer();
......
</td>
</tr>
</table>
<?php if (!empty($THEME->customcorners)) print_custom_corners_end(); ?>
</td>
<?php
print '<!-- End page content -->'."\n";
......@@ -9,8 +10,10 @@ print '<!-- End page content -->'."\n";
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();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
print_spacer(1, 120, true);
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '<!-- End right side blocks -->'."\n";
echo '</td>';
}
......
......@@ -8,6 +8,10 @@ require_once($CFG->dirroot .'/blog/blogpage.php');
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);
......@@ -215,7 +219,9 @@ print '<tr valign="top">' . "\n";
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();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->customcorners)) print_custom_corners_end();
print '<!-- End left side blocks -->' . "\n";
print '</td>' . "\n";
}
......@@ -223,6 +229,7 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
/// Start main column
print '<!-- Begin page content -->' . "\n";
print '<td>';
if (!empty($THEME->customcorners)) print_custom_corners_start();
?>
<table width="100%">
<tr>
......
......@@ -33,7 +33,11 @@
require_once('config.php');
require_once($CFG->dirroot .'/course/lib.php');
require_once($CFG->dirroot .'/lib/blocklib.php');
if (!empty($THEME->customcorners)) {
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
}
if (empty($SITE)) {
redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
}
......@@ -118,25 +122,16 @@
case 'left':
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
echo '<td style="width: '.$preferred_width_left.'px;" id="left-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
}
break;
case 'middle':
echo '<td id="middle-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
/// Print Section
if ($SITE->numsections > 0) {
......@@ -253,10 +248,7 @@
echo '<br />';
}
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
break;
......@@ -264,19 +256,13 @@
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, SITEID))) {
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
if (!empty($THEME->customcorners)) print_custom_corners_start();
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, SITEID))) {
echo '<div style="text-align:center">'.update_course_icon($SITE->id).'</div>';
echo '<br />';
}
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
if (!empty($THEME->customcorners)) print_custom_corners_end();
echo '</td>';
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment