themes lib MDL-24895 Multiple fixes to better handle overflow.

Major tasks undertaken in this patch:
* New format_text argument, overflowdiv.
* New page layout Report.
* Review of all format_text calls.
* Added support for the report layout to all themes.
* Changed forum post display from tables to divs.
This commit is contained in:
Sam Hemelryk 2010-11-05 02:53:47 +00:00
parent 2412f8b882
commit 367a75fae4
125 changed files with 3366 additions and 2062 deletions

View file

@ -167,6 +167,11 @@ $THEME->layouts = array(
'regions' => array(),
'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>false, 'nocustommenu'=>true),
),
'report' => array(
'file' => 'report.php',
'regions' => array('side-post'),
'defaultregion' => 'side-post',
),
);
///////////////////////////////////////////////////////////////

View file

@ -0,0 +1,119 @@
<?php
$hasheading = ($PAGE->heading);
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
$hasfooter = (empty($PAGE->layout_options['nofooter']));
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
$custommenu = $OUTPUT->custom_menu();
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
$bodyclasses = array();
if ($showsidepost) {
$bodyclasses[] = 'side-post-only';
} else if (!$showsidepost) {
$bodyclasses[] = 'content-only';
}
if ($hascustommenu) {
$bodyclasses[] = 'has-custom-menu';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<title><?php echo $PAGE->title ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
<?php echo $OUTPUT->standard_head_html() ?>
</head>
<body id="<?php echo $PAGE->bodyid ?>" class="<?php echo $PAGE->bodyclasses.' '.join(' ', $bodyclasses) ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
<div id="page">
<?php if ($hasheading || $hasnavbar) { ?>
<div id="wrapper" class="clearfix">
<!-- START OF HEADER -->
<div id="page-header" class="inside">
<div id="page-header-wrapper" class="wrapper clearfix">
<?php if ($hasheading) { ?>
<div id="header-left">
<h1 class="headermain inside"><?php echo $PAGE->heading ?></h1>
</div>
<div class="headermenu"><?php
echo $OUTPUT->login_info();
if (!empty($PAGE->layout_options['langmenu'])) {
echo $OUTPUT->lang_menu();
}
echo $PAGE->headingmenu ?>
</div>
<?php } ?>
</div>
</div>
<?php if ($hasnavbar) { ?>
<div class="navbar">
<div class="wrapper clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
<div class="navbutton"> <?php echo $PAGE->button; ?></div>
</div>
</div>
<?php } ?>
<!-- END OF HEADER -->
<?php } ?>
<!-- START OF CONTENT -->
<div id="page-content-wrapper" class="wrapper clearfix">
<div id="page-content" class="clearfix">
<div id="report-main-content">
<div class="region-content">
<?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
</div>
</div>
<?php if ($hassidepost) { ?>
<div id="report-region-wrap">
<div id="report-region-pre" class="block-region">
<div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-post') ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<!-- END OF CONTENT -->
<?php if ($hasheading || $hasnavbar) { ?>
</div>
<?php } ?>
<!-- START OF FOOTER -->
<?php if ($hasfooter) { ?>
<div id="page-footer" class="wrapper">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
<?php
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</div>
<?php } ?>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>

View file

@ -168,7 +168,7 @@ h2.headingblock {
.forumpost .topic {
background: #eee;
border-width: 0;
padding: 0 10px 0;
padding: 4px 10px 4px;
}
.forumpost .subject {
@ -180,10 +180,14 @@ h2.headingblock {
font-style: italic;
}
.forumpost .content {
.forumpost .no-overflow {
border-width: 0 1px 10px;
border-style: solid;
border-color: #aaa #eee #eee;
margin: 0 1px 1px 1px;
}
.forumpost .content .posting {
padding: 5px 10px 10px;
}

View file

@ -1,103 +1,129 @@
/*********************************************************************************************
left column: 250px
right column: 250px
padding left/right column: 10px
padding center column: 30px
left column: 250px
right column: 250px
padding left/right column: 10px
padding center column: 30px
**********************************************************************************************/
body {
margin: auto 0px;
width: auto;
margin: auto 0px;
width: auto;
}
#page {
width: 100%;
overflow: hidden;
width: 100%;
overflow: hidden;
}
#page-header {
float: left;
width: 100%;
float: left;
width: 100%;
}
#page-content {
clear: both;
float: left;
overflow: hidden;
position: relative;
width: 100%;
clear: both;
float: left;
overflow: hidden;
position: relative;
width: 100%;
}
#page-content #region-main-box {
float: left;
margin-left: 0;
position: relative;
width: 200%;
right: 100%;
float: left;
margin-left: 0;
position: relative;
width: 200%;
right: 100%;
}
#page-content #region-main-box #region-post-box {
float: left;
width: 100%;
#page-content #region-post-box {
float: left;
width: 100%;
}
#page-content #region-main-box #region-post-box #region-main-wrap {
float: left;
width: 50%;
#page-content #region-main-wrap {
float: left;
width: 50%;
}
#page-content #region-main-box #region-post-box #region-main-wrap #region-main {
overflow: hidden;
position: relative;
left: 100%;
#page-content #region-main {
overflow: hidden;
position: relative;
left: 100%;
}
#page-content #region-main-box #region-post-box #region-post {
float: right;
position: relative;
#page-content #region-post {
float: right;
position: relative;
}
#page-content #region-main-box #region-post-box #region-main-wrap #region-main .region-content {
overflow: hidden;
padding: 20px 30px 20px 0;
#page-content #region-main .region-content {
overflow: hidden;
padding: 20px 30px 20px 0;
}
#page-content #region-main-box #region-post-box #region-post .region-content {
overflow: hidden;
padding: 20px 0 20px 10px;
#page-content #region-post .region-content {
overflow: hidden;
padding: 20px 0 20px 10px;
}
#page-footer {
clear: both;
float: left;
width: 100%;
clear: both;
float: left;
width: 100%;
}
.has_dock.side-post-only .page-middle #region-main-box #region-post-box #region-main-wrap #region-main {
margin-left: 200px;
.has_dock.side-post-only .page-middle #region-main {
margin-left: 200px;
}
/** No blocks whatsoever **/
.content-only #page-content #region-main-box {
margin-left: 0px;
margin-left: 0px;
}
.content-only #page-content #region-main-box #region-post-box {
margin-left: 0px;
.content-only #page-content #region-post-box {
margin-left: 0px;
}
.content-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {
margin-left: 0px;
.content-only #page-content #region-main {
margin-left: 0px;
}
.content-only #page-content #region-main-box #region-post-box #region-pre {
width: 0px;
.content-only #page-content #region-pre {
width: 0px;
}
.content-only #page-content #region-main-box #region-post-box #region-post {
width: 0px;
}
.content-only #page-content #region-post {
width: 0px;
}
/** Report layout **/
.pagelayout-report #page {width:auto;position:relative;overflow:visible;}
.pagelayout-report #page-header {float:none;}
.pagelayout-report #page-content {float:none;overflow:visible;width:auto;}
.pagelayout-report #report-main-content {float:left;width:100%;}
.pagelayout-report #report-main-content .region-content {margin-left:210px;margin-top:20px;}
.pagelayout-report #report-main-content .region-content table {background-color:#FFF;}
.pagelayout-report #report-region-wrap {width:0;float:right;position:relative;left:-100%;}
.pagelayout-report #report-region-pre {width:200px;margin-top:20px;}
.pagelayout-report #page-footer {float:none;}
.pagelayout-report #page-content .region-content {overflow:visible;}
.pagelayout-report.content-only #report-main-content .region-content {margin-left:0;}
/** Correct for right to left languages **/
.dir-rtl.pagelayout-report #report-main-content .region-content {margin-left:0;margin-right:200px;}
.dir-rtl.pagelayout-report #report-region-wrap {left:0;}
/** Stabalise IE6 behaviour on the report layout **/
.ie6.pagelayout-report #report-main-content,
.ie7.pagelayout-report #report-main-content {float:none;width:auto;}
.ie6.pagelayout-report #report-region-wrap,
.ie7.pagelayout-report #report-region-wrap {float:none;width:200px;left:auto;position:absolute;top:0;}
.ie6.pagelayout-report #report-region-pre,
.ie6.pagelayout-report #report-region-pre .block
.ie7.pagelayout-report #report-region-pre,
.ie7.pagelayout-report #report-region-pre .block {width:100%;}