Skip to content
Permalink
Browse files

MDL-12221 :: I added changes to weblib and the forum and glossary vie…

…w pages, the custom_corners and standard theme to get those pages working.

In the view pages I changed the container function call to a simple "echo 'div ...'" to avoid the custom_corners container overhead and page oddity.

In weblib I added "clearfix" handling to the function "print_box_start($classes ...". "clearfix" is handed over to the containing divs. This is a hack, but I didn't know how to handle it without rewriting too much areas.
  • Loading branch information...
urs_hunkler
urs_hunkler committed Jan 9, 2008
1 parent 3dd4e13 commit 8f4a3ae2f10fce0db64424e516169fc239b61e95
@@ -3917,13 +3917,20 @@ function print_box($message, $classes='generalbox', $ids='', $return=false) {
function print_box_start($classes='generalbox', $ids='', $return=false) {
global $THEME;
if (strpos($classes, 'clearfix') !== false) {
$clearfix = true;
$classes = trim(str_replace('clearfix', '', $classes));
} else {
$clearfix = false;
}
if (!empty($THEME->customcorners)) {
$classes .= ' ccbox box';
} else {
$classes .= ' box';
}
return print_container_start(false, $classes, $ids, $return);
return print_container_start($clearfix, $classes, $ids, $return);
}
/**
@@ -111,9 +111,10 @@
}
print_box_start('forumcontrol');
// print_box_start('forumcontrol clearfix');
print_box_start('subscription');
// print_box_start('subscription clearfix');
echo '<div class="subscription">';
if (!empty($USER->id) && !has_capability('moodle/legacy:guest', $context, NULL, false)) {
$SESSION->fromdiscussion = "$FULLME";
@@ -173,16 +174,19 @@
} else {
$userid = $USER->id;
}
print_box_start('rsslink');
// print_box_start('rsslink');
echo '<span class="wrap rsslink">';
rss_print_link($course->id, $userid, "forum", $forum->id, $tooltiptext);
print_box_end(); // subscription
echo '</span>';
// print_box_end(); // subscription
}
print_box_end(); // subscription
// print_box_end(); // subscription
echo '</div>';
print_box_end(); // forumcontrol
// print_box_end(); // forumcontrol
print_box('&nbsp;', 'clearer');
// print_box('&nbsp;', 'clearer');
if (!empty($forum->blockafter) && !empty($forum->blockperiod)) {
@@ -282,7 +282,8 @@
}
/// Start to print glossary controls
print_box_start('glossarycontrol');
// print_box_start('glossarycontrol clearfix');
echo '<div class="glossarycontrol" style="text-align: right">';
echo $availableoptions;
/// If rss are activated at site and glossary level and this glossary has rss defined, show link
@@ -295,23 +296,28 @@
} else {
$userid = $USER->id;
}
print_box_start('rsslink');
// print_box_start('rsslink');
echo '<span class="wrap rsslink">';
rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
print_box_end();
echo '</span>';
// print_box_end();
}
/// The print icon
if ( $showcommonelements and $mode != 'search') {
if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) {
print_box_start('printicon');
// print_box_start('printicon');
echo '<span class="wrap printicon">';
echo " <a title =\"". get_string("printerfriendly","glossary") ."\" href=\"print.php?id=$cm->id&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
print_box_end();
echo '</span>';
// print_box_end();
}
}
/// End glossary controls
print_box_end(); /// glossarycontrol
print_box('&nbsp;', 'clearer');
// print_box_end(); /// glossarycontrol
echo '</div>';
// print_box('&nbsp;', 'clearer');
}
/// Info box
@@ -36,7 +36,11 @@
(strpos($bodytags, ' nocoursepage'))) {
$bodytags = str_replace(' nocoursepage', '', $bodytags);
}


// get class list
preg_match('/class="([^"]*)"/i', $bodytags, $classes);
$classlist = explode (' ', $classes[1]);

// add 'nocoursepage' to the list of CLASSes on several pages
if (strpos($bodytags, 'nocoursepage') === false) {
$includelist = array('admin-roles-assign', 'admin-roles-override',
@@ -47,17 +51,23 @@
// include user roles for the Moodle user settings called
// from the start page
if (($COURSE->id > 1) || ($_GET['contextid'] == 30) || ($_GET['contextid'] == 61)) {
preg_match('/class="([^"]*)"/i', $bodytags, $classes);
$classlist = explode (' ', $classes[1]);
if (!in_array('nocoursepage', $classlist)) {
array_push($classlist, 'nocoursepage');
$bodytags = str_replace($classes[0],
'class="'.implode(' ', $classlist).'"', $bodytags);
}
}
}
}

// add "inpopup" or "notinpopup" to class list
if ($inpopup) {
array_push($classlist, 'inpopup');
} else {
array_push($classlist, 'notinpopup');
}

//replace classlist with new one
$bodytags = str_replace($classes[0], 'class="'.implode(' ', $classlist).'"', $bodytags);

?>
</head>

@@ -71,29 +81,27 @@
<?php if(!empty($infooutput)) { ?>
<div id="infowrapper"><div id="infooverlay"><?php echo $infooutput; ?></div></div>
<?php } ?>
<div id="page"<?php echo (' class="'.(($inpopup) ? 'inpopup' : 'notinpopup').'"'); ?>>
<div id="page">

<?php if (!$inpopup) {
if ($home) { // This is what gets printed on the home page only
?>
<?php print_container_start(true, '', 'header-home'); ?>
<div class="wraphome clearfix">
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
</div>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
<?php } else if ($heading) { // This is what gets printed on any other page with a heading
?>
<?php print_container_start(true, '', 'header'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<div class="navbar clearfix">
<?php if ($navigation) { // This is the navigation table with breadcrumbs
?>
<div class="breadcrumb"><?php print_navigation($navigation); ?></div>
<div class="navbutton"><?php echo $button; ?></div>
<?php } ?>
</div>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<div class="navbar clearfix">
<?php if ($navigation) { // This is the navigation table with breadcrumbs
?>
<div class="breadcrumb"><?php print_navigation($navigation); ?></div>
<div class="navbutton"><?php echo $button; ?></div>
<?php } ?>
</div>
<?php print_container_end(); ?>
<?php }
}
@@ -3,6 +3,8 @@
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var script = {
themepath: '<?php echo $CFG->themewww .'/'. current_theme() ?>',
corrections: function () {
if (top.user) {
top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
@@ -25,6 +27,15 @@
} else {
$('body').addClass('nolayouttable');
}
// set a smaller right and left padding on the admin pages
// with a htmlarea
var htmlarea = $('#adminsettings .form-htmlarea');
var docwidth = $(document).width();
if (htmlarea.length && (docwidth <= 1024)) {
$('#page').css('margin', '0 1%');
}
},
info: function() {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,6 +15,12 @@ div.sideblock div.content * {
div.calendar-controls a.next {
text-align: left;
}
div.bt {
text-align: right;
}
div.bb {
text-align: right;
}
div.sideblock div.header div.bt div {
background-position: 100% 0;
right: -13px;
@@ -216,3 +222,9 @@ body.nocoursepage div#content div.i2 {
body.nocoursepage div#content div.i3 {
/*background: transparent;*/
}
div#content div.ccbox div.i1 {
background-image: url(pix/mask_borders_re.gif);
}
div#content div.ccbox div.i2 {
background-image: url(pix/mask_borders_le.gif);
}
@@ -2,6 +2,13 @@
* These styles are ONLY included for IE 6 (via meta.php)
*/

.sep.arrow {
padding-left: 0.5em;
}
.tabrow0 div,
.tabrow0 ul {
top: 4.2em;
}
div.navbar {
height: 2em;
}
@@ -29,6 +36,28 @@ body {
background-image: none;
background-color: #F1ECE6;
}
th.header {
background-image: url(pix/header.gif);
}
table.forumpost tr.header {
background-image: url(pix/header.gif);
}
.loginbox h2 {
font-size: 1.5em;
}
div.sideblock ul.list li {
clear: left;
padding-left: 18px;
margin-left: 19px;
}
#notes-index #content-i3,
#mod-chat-view #content-i3 {
padding-bottom: 15px;
}
#notes-index #content-i3 .ccbox,
#mod-chat-view #content-i3 .ccbox {
margin-bottom: 0;
}
/*div.block_calendar_month div.calendar-controls span.hide {
display: none
}
@@ -44,6 +73,10 @@ div.block_calendar_month div.calendar-controls a.previous {
div.block_calendar_month div.calendar-controls a.next {
float: right;
}*/
#header div.bt,
#header div.bb {
position: relative;
}
div.sideblock div.bt div {
background-image: url(pix/box.gif);
}
@@ -89,6 +122,10 @@ td#middle-column div.bt div {
body.dir-rtl td#middle-column div.bt div {
right: -12px;
}
body.dir-rtl #header div.bt,
body.dir-rtl #header div.bb {
left: 0;
}
td#middle-column div.bt {
background-image: url(pix/box.gif);
}
@@ -206,9 +243,33 @@ body.nocoursepage div#content div.bb {
body.nocoursepage.dir-rtl div#content div.bb {
right: -12px;
}
th.header {
background-image: url(pix/header.gif);
div#content div.ccbox div.bt div {
background-image: url(pix/mask_box.gif);
}
table.forumpost tr.header {
background-image: url(pix/header.gif);
div#content div.ccbox div.bt {
background-image: url(pix/mask_box.gif);
}
div#content div.ccbox div.i1 {
background-image: url(pix/mask_borders_le.gif);
}
div#content div.ccbox div.i2 {
background-image: url(pix/mask_borders_re.gif);
}
div#content div.ccbox div.bb div {
background-image: url(pix/mask_box.gif);
}
div#content div.ccbox div.bb {
background-image: url(pix/mask_box.gif);
}
div#content div.ccbox div.i3 {
border-color: #f9f6f3;
}
body.dir-rtl div#content div.ccbox div.i1 {
background-image: url(pix/mask_borders_re.gif);
}
body.dir-rtl div#content div.ccbox div.i2 {
background-image: url(pix/mask_borders_le.gif);
}
div#content div.ccbox {
border-style: none;
}
@@ -1,18 +1,30 @@

/*
* These styles are ONLY included for IE 7 (via meta.php)
*/

div.navbar {
height: 2em;
.sep.arrow {
padding-left: 0.5em;
}
div.sideblock ul.list li {
margin: 0.4em 0;
.tabrow0 div,
.tabrow0 ul {
top: 2.9em;
}
div.navbar {
height: 2em;
}
div.i1 {
min-width: 0;
min-width: 0;
}
div#header div.i3 {
min-width: 0;
div#header div.i3,
div#header-home div.i3 {
min-width: 0;
}
div.sideblock ul.list li {
margin: 0.4em 0;
}
.loginbox h2 {
font-size: 1.5em;
}
div.block_calendar_month div.calendar-controls span.hide {
display: none
@@ -34,4 +46,12 @@ body.dir-rtl div.block_calendar_month div.calendar-controls a.previous {
}
body.dir-rtl div.block_calendar_month div.calendar-controls a.next {
float: left;
}
#notes-index #content-i3,
#mod-chat-view #content-i3 {
padding-bottom: 15px;
}
#notes-index #content-i3 .ccbox,
#mod-chat-view #content-i3 .ccbox {
margin-bottom: 0;
}

0 comments on commit 8f4a3ae

Please sign in to comment.
You can’t perform that action at this time.