From 367a75fae457c8a49787e335ea89269ffdcb76bf Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Fri, 5 Nov 2010 02:53:47 +0000 Subject: [PATCH] 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. --- admin/report/spamcleaner/index.php | 2 +- backup/util/ui/renderer.php | 2 +- .../course_summary/block_course_summary.php | 1 + .../glossary_random/block_glossary_random.php | 1 + blocks/html/block_html.php | 5 +- blocks/html/styles.css | 2 + blocks/rss_client/block_rss_client.php | 2 +- .../site_main_menu/block_site_main_menu.php | 6 +- .../block_social_activities.php | 6 +- blog/locallib.php | 3 +- cohort/index.php | 4 +- comment/index.php | 2 +- comment/lib.php | 5 +- comment/locallib.php | 3 +- course/category.php | 1 + course/format/topics/format.php | 2 + course/format/weeks/format.php | 6 +- course/info.php | 2 +- course/lib.php | 3 + course/report/outline/index.php | 3 +- grade/edit/tree/grade.php | 1 + grade/lib.php | 6 +- grade/report/grader/index.php | 7 +- grade/report/user/index.php | 5 +- grade/report/user/lib.php | 2 +- grade/report/user/styles.css | 67 +- group/members.php | 4 +- group/overview.php | 2 + help.php | 1 + index.php | 1 + lib/adminlib.php | 9 +- lib/pagelib.php | 8 +- lib/tablelib.php | 2 +- lib/weblib.php | 22 +- mnet/service/enrol/course.php | 1 + mod/assignment/styles.css | 2 - mod/assignment/type/online/all.php | 2 +- .../type/online/assignment.class.php | 4 +- mod/assignment/type/online/file.php | 2 +- .../type/upload/assignment.class.php | 2 +- mod/assignment/type/upload/notes.php | 2 +- mod/data/index.php | 2 +- mod/feedback/complete.php | 2 +- mod/feedback/complete_guest.php | 2 +- mod/feedback/item/label/lib.php | 2 +- mod/feedback/view.php | 2 +- mod/forum/lib.php | 399 ++++--- mod/forum/styles.css | 61 +- mod/glossary/lib.php | 15 +- mod/glossary/locallib.php | 1 + mod/lesson/locallib.php | 1 + mod/lesson/pagetypes/multichoice.php | 1 + mod/lesson/report.php | 2 + mod/page/view.php | 2 +- mod/quiz/report.php | 1 + mod/quiz/report/overview/report.php | 4 +- mod/quiz/report/statistics/report.php | 4 +- mod/quiz/styles.css | 1 - mod/wiki/edit.php | 4 + mod/wiki/locallib.php | 2 +- mod/wiki/pagelib.php | 8 +- mod/wiki/renderer.php | 1 + mod/workshop/assessment.php | 2 +- mod/workshop/exassessment.php | 2 +- mod/workshop/exsubmission.php | 2 +- mod/workshop/renderer.php | 4 +- mod/workshop/submission.php | 2 +- mod/workshop/view.php | 4 +- notes/lib.php | 2 +- question/editlib.php | 1 + tag/locallib.php | 1 + theme/anomaly/config.php | 5 + theme/anomaly/layout/report.php | 80 ++ theme/arialist/config.php | 5 + theme/arialist/layout/report.php | 119 ++ theme/arialist/style/core.css | 8 +- theme/arialist/style/pagelayout.css | 136 ++- theme/base/config.php | 6 + theme/base/layout/report.php | 89 ++ theme/base/style/core.css | 7 + theme/base/style/pagelayout.css | 63 +- theme/binarius/config.php | 5 + theme/binarius/layout/report.php | 118 ++ theme/binarius/style/pagelayout.css | 131 +- theme/boxxie/style/core.css | 13 +- theme/brick/config.php | 46 +- theme/brick/style/core.css | 515 ++++---- theme/brick/style/pagelayout.css | 29 +- theme/canvas/config.php | 35 +- theme/canvas/layout/general.php | 126 +- theme/canvas/layout/report.php | 109 ++ theme/canvas/style/pagelayout.css | 44 +- theme/formal_white/config.php | 5 + theme/formal_white/layout/report.php | 127 ++ theme/formal_white/lib.php | 2 + theme/formal_white/style/general.css | 13 +- theme/formal_white/style/settings.css | 16 +- theme/formfactor/style/mods.css | 5 +- theme/fusion/config.php | 36 +- theme/fusion/style/pagelayout.css | 23 +- theme/leatherbound/config.php | 14 +- theme/leatherbound/layout/general.php | 32 +- theme/leatherbound/layout/report.php | 91 ++ theme/leatherbound/style/core.css | 205 ++-- theme/magazine/config.php | 6 +- theme/magazine/style/colors.css | 32 +- theme/magazine/style/core.css | 1064 +++++++++-------- theme/magazine/style/layout.css | 29 +- theme/nonzero/config.php | 28 +- theme/nonzero/style/pagelayout.css | 153 ++- theme/overlay/config.php | 46 +- theme/serenity/style/core.css | 166 +-- theme/sky_high/config.php | 30 +- theme/sky_high/layout/report.php | 136 +++ theme/sky_high/style/core.css | 341 +++--- theme/sky_high/style/pagelayout.css | 162 +-- theme/splash/config.php | 7 +- theme/splash/layout/report.php | 149 +++ theme/splash/style/sl.css | 35 +- theme/standard/style/css3.css | 1 + theme/standard/style/modules.css | 24 +- user/index.php | 3 +- user/profile.php | 3 +- user/profile/field/textarea/field.class.php | 2 +- user/view.php | 3 +- 125 files changed, 3366 insertions(+), 2062 deletions(-) create mode 100644 blocks/html/styles.css create mode 100644 theme/anomaly/layout/report.php create mode 100644 theme/arialist/layout/report.php create mode 100644 theme/base/layout/report.php create mode 100644 theme/binarius/layout/report.php create mode 100644 theme/canvas/layout/report.php create mode 100644 theme/formal_white/layout/report.php create mode 100644 theme/leatherbound/layout/report.php create mode 100644 theme/sky_high/layout/report.php create mode 100644 theme/splash/layout/report.php diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php index fc9c8d31423..eeb2f05986a 100755 --- a/admin/report/spamcleaner/index.php +++ b/admin/report/spamcleaner/index.php @@ -267,7 +267,7 @@ function print_user_entry($user, $keywords, $count) { $user->descriptionformat = FORMAT_MOODLE; } - $html .= ''.format_text($user->description, $user->descriptionformat).''; + $html .= ''.format_text($user->description, $user->descriptionformat, array('overflowdiv'=>true)).''; $html .= ''; $html .= '
'; $html .= ''; diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index 058ed790083..413e2ca12fd 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -587,7 +587,7 @@ class core_backup_renderer extends plugin_renderer_base { $row->cells = array( html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'targetid', 'value'=>$category->id)), $category->name, - format_text($category->description, $category->descriptionformat) + format_text($category->description, $category->descriptionformat, array('overflowdiv'=>true)) ); $table->data[] = $row; } diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index 52424c61c2c..7905822233c 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -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); diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index 2bfcce07c57..9e1eaa87aae 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -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; diff --git a/blocks/html/block_html.php b/blocks/html/block_html.php index 1248a2f449c..de484a507ee 100755 --- a/blocks/html/block_html.php +++ b/blocks/html/block_html.php @@ -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; diff --git a/blocks/html/styles.css b/blocks/html/styles.css new file mode 100644 index 00000000000..de90b14227a --- /dev/null +++ b/blocks/html/styles.css @@ -0,0 +1,2 @@ +.block.block_html .content {padding:0;} +.block.block_html .content .no-overflow {padding:4px;} \ No newline at end of file diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index d7324090e8b..01b06de41d9 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -185,7 +185,7 @@ } - $r.='