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

@ -25,6 +25,7 @@ class block_course_summary extends block_base {
$this->content = new stdClass();
$options = new stdClass();
$options->noclean = true; // Don't clean Javascripts etc
$options->overflowdiv = true;
$context = get_context_instance(CONTEXT_COURSE, $this->page->course->id);
$this->page->course->summary = file_rewrite_pluginfile_urls($this->page->course->summary, 'pluginfile.php', $context->id, 'course', 'summary', NULL);
$this->content->text = format_text($this->page->course->summary, $this->page->course->summaryformat, $options);

View file

@ -84,6 +84,7 @@ class block_glossary_random extends block_base {
$options = new stdClass();
$options->trusted = $entry->definitiontrust;
$options->overflowdiv = true;
$text .= format_text($entry->definition, $entry->definitionformat, $options);
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;

View file

@ -46,12 +46,11 @@ class block_html extends block_base {
return $this->content;
}
$filteropt = new stdClass;
$filteropt->overflowdiv = true;
if ($this->content_is_trusted()) {
// fancy html allowed only on course, category and system blocks.
$filteropt = new stdClass;
$filteropt->noclean = true;
} else {
$filteropt = null;
}
$this->content = new stdClass;

2
blocks/html/styles.css Normal file
View file

@ -0,0 +1,2 @@
.block.block_html .content {padding:0;}
.block.block_html .content .no-overflow {padding:4px;}

View file

@ -185,7 +185,7 @@
}
$r.='<ul class="list">'."\n";
$r.='<ul class="list no-overflow">'."\n";
$feeditems = $feed->get_items(0, $maxentries);
foreach($feeditems as $item){

View file

@ -34,13 +34,14 @@ class block_site_main_menu extends block_list {
/// extra fast view mode
if (!$isediting) {
if (!empty($modinfo->sections[0])) {
$options = array('overflowdiv'=>true);
foreach($modinfo->sections[0] as $cmid) {
$cm = $modinfo->cms[$cmid];
if (!$cm->uservisible) {
continue;
}
if ($cm->modname == 'label') {
$this->content->items[] = format_text($cm->extra, FORMAT_HTML);
$this->content->items[] = format_text($cm->extra, FORMAT_HTML, $options);
$this->content->icons[] = '';
} else {
$linkcss = $cm->visible ? '' : ' class="dimmed" ';
@ -85,6 +86,7 @@ class block_site_main_menu extends block_list {
if (!empty($section->sequence)) {
$sectionmods = explode(',', $section->sequence);
$options = array('overflowdiv'=>true);
foreach ($sectionmods as $modnumber) {
if (empty($mods[$modnumber])) {
continue;
@ -127,7 +129,7 @@ class block_site_main_menu extends block_list {
}
if ($mod->modname == 'label') {
$this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
$this->content->items[] = format_text($extra, FORMAT_HTML,$options).$editbuttons;
$this->content->icons[] = '';
} else {
//Accessibility: incidental image - should be empty Alt text

View file

@ -36,13 +36,14 @@ class block_social_activities extends block_list {
/// extra fast view mode
if (!$isediting) {
if (!empty($modinfo->sections[0])) {
$options = array('overflowdiv'=>true);
foreach($modinfo->sections[0] as $cmid) {
$cm = $modinfo->cms[$cmid];
if (!$cm->uservisible) {
continue;
}
if ($cm->modname == 'label') {
$this->content->items[] = format_text($cm->extra, FORMAT_HTML);
$this->content->items[] = format_text($cm->extra, FORMAT_HTML, $options);
$this->content->icons[] = '';
} else {
$linkcss = $cm->visible ? '' : ' class="dimmed" ';
@ -94,6 +95,7 @@ class block_social_activities extends block_list {
if (!empty($section) && !empty($section->sequence)) {
$sectionmods = explode(',', $section->sequence);
$options = array('overflowdiv'=>true);
foreach ($sectionmods as $modnumber) {
if (empty($mods[$modnumber])) {
continue;
@ -136,7 +138,7 @@ class block_social_activities extends block_list {
}
if ($mod->modname == 'label') {
$this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
$this->content->items[] = format_text($extra, FORMAT_HTML, $options).$editbuttons;
$this->content->icons[] = '';
} else {
//Accessibility: incidental image - should be empty Alt text