From f41207400bf8fe8f2f201d979ed725e4bda78c6c Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 1 Nov 2018 14:04:27 +0800 Subject: [PATCH] MDL-63836 course: No course header images This feature may be added in future, but for now we are not going to include it. --- admin/settings/courses.php | 3 --- lang/en/moodle.php | 3 --- lib/db/upgrade.php | 14 +++++----- lib/outputrenderers.php | 9 +------ lib/templates/course_header_image.mustache | 29 --------------------- theme/boost/scss/moodle/course.scss | 9 ------- theme/boost/style/moodle.css | 7 ----- theme/bootstrapbase/less/moodle/course.less | 11 -------- theme/bootstrapbase/style/moodle.css | 10 ------- version.php | 2 +- 10 files changed, 10 insertions(+), 87 deletions(-) delete mode 100644 lib/templates/course_header_image.mustache diff --git a/admin/settings/courses.php b/admin/settings/courses.php index 40063a6d2fe..f23bf5f3c22 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -121,9 +121,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { $temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0, array(0 => new lang_string('no'), 1 => new lang_string('yes')))); - $temp->add(new admin_setting_configcheckbox('moodlecourse/showcourseimages', get_string('showcourseimages'), - get_string('showcourseimages_desc'), 1)); - // Files and uploads. $temp->add(new admin_setting_heading('filesanduploadshdr', new lang_string('filesanduploads'), '')); diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 2a4bb15f62a..163e3d89671 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -327,7 +327,6 @@ $string['courseformatdata'] = 'Course format data'; $string['courseformats'] = 'Course formats'; $string['courseformatoptions'] = 'Formatting options for {$a}'; $string['courseformatudpate'] = 'Update format'; -$string['courseheaderimage'] = 'Course header image'; $string['courseprofiles'] = 'Course profiles'; $string['coursepreferences'] = 'Course preferences'; $string['coursegrades'] = 'Course grades'; @@ -1823,8 +1822,6 @@ $string['showallusers'] = 'Show all users'; $string['showblockcourse'] = 'Show list of courses containing block'; $string['showcategory'] = 'Show {$a}'; $string['showchartdata'] = 'Show chart data'; -$string['showcourseimages'] = 'Show course images'; -$string['showcourseimages_desc'] = 'Show the course image or image placeholder in the course header.'; $string['showcomments'] = 'Show/hide comments'; $string['showcommentsnonjs'] = 'Show comments'; $string['showdescription'] = 'Display description on course page'; diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index edd43ccc046..9b9fb47a21e 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2666,12 +2666,6 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2018102900.00); } - if ($oldversion < 2018102900.01) { - // Show course images by default. - set_config('showcourseimages', 1, 'moodlecourse'); - upgrade_main_savepoint(true, 2018102900.01); - } - if ($oldversion < 2018110500.01) { // Define fields to be added to the 'badge' table. $tablebadge = new xmldb_table('badge'); @@ -2769,5 +2763,13 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2018110500.01); } + if ($oldversion < 2018110700.01) { + // This config setting added and then removed. + unset_config('showcourseimages', 'moodlecourse'); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2018110700.01); + } + return true; } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c3fd597f3f5..75f8e3af5de 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -4153,7 +4153,7 @@ EOD; } public function context_header($headerinfo = null, $headinglevel = 1) { - global $DB, $USER, $CFG, $COURSE; + global $DB, $USER, $CFG; require_once($CFG->dirroot . '/user/lib.php'); $context = $this->page->context; $heading = null; @@ -4165,13 +4165,6 @@ EOD; $heading = $headerinfo['heading']; } - // Show a course image if enabled. - if ($context->contextlevel == CONTEXT_COURSE && get_config('moodlecourse', 'showcourseimages')) { - $exporter = new core_course\external\course_summary_exporter($COURSE, ['context' => $context]); - $courseinfo = $exporter->export($this); - $imagedata = $this->render_from_template('core/course_header_image', $courseinfo); - } - // The user context currently has images and buttons. Other contexts may follow. if (isset($headerinfo['user']) || $context->contextlevel == CONTEXT_USER) { if (isset($headerinfo['user'])) { diff --git a/lib/templates/course_header_image.mustache b/lib/templates/course_header_image.mustache deleted file mode 100644 index 52ab679b126..00000000000 --- a/lib/templates/course_header_image.mustache +++ /dev/null @@ -1,29 +0,0 @@ -{{! - This file is part of Moodle - http://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template core/course_header_image - - Example context (json): - { - "courseimage": "http://domain.name/pluginfile.php/123/course/overviewfiles/kitten.jpg" - } -}} -
-
-
{{#str}}courseheaderimage, core{{/str}}
-
-
\ No newline at end of file diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss index 00cc1e6b69c..0bc6d4ca78a 100644 --- a/theme/boost/scss/moodle/course.scss +++ b/theme/boost/scss/moodle/course.scss @@ -1139,15 +1139,6 @@ span.editinstructions { opacity: 0.5; } -.course-header-image-wrapper { - width: 100px; - height: 100px; - .course-header-image { - background-size: cover; - background-position: center; - } -} - /** * Display sizes: * Large displays 1200 + diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 68934ab02e4..47230229d23 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -12434,13 +12434,6 @@ span.editinstructions { .course-being-dragged { opacity: 0.5; } -.course-header-image-wrapper { - width: 100px; - height: 100px; } - .course-header-image-wrapper .course-header-image { - background-size: cover; - background-position: center; } - /** * Display sizes: * Large displays 1200 + diff --git a/theme/bootstrapbase/less/moodle/course.less b/theme/bootstrapbase/less/moodle/course.less index 0b0dcebc05e..9c26f9a228f 100644 --- a/theme/bootstrapbase/less/moodle/course.less +++ b/theme/bootstrapbase/less/moodle/course.less @@ -1124,17 +1124,6 @@ span.editinstructions { .opacity(50); } -.course-header-image-wrapper { - width: 100px; - height: 100px; - .course-header-image { - width: 100%; - height: 100%; - background-size: cover; - background-position: center; - } -} - /** * Display sizes: * Large displays 1200 + diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index b31fdb8470b..0f5535c768a 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -7004,16 +7004,6 @@ span.editinstructions { opacity: 0.5; filter: alpha(opacity=50); } -.course-header-image-wrapper { - width: 100px; - height: 100px; -} -.course-header-image-wrapper .course-header-image { - width: 100%; - height: 100%; - background-size: cover; - background-position: center; -} /** * Display sizes: * Large displays 1200 + diff --git a/version.php b/version.php index ed3c32b6844..2c47582bb41 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2018110700.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2018110700.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.