@@ -722,8 +722,7 @@ public static function create_section_image($tempfile, $storedfilerecord, $secti
722
722
// Set up the displayed image:...
723
723
$ sectionimage ->newimage = $ storedfilerecord ['filename ' ];
724
724
$ settings = $ courseformat ->get_settings ();
725
- $ icbc = self ::hex2rgb ($ settings ['imagecontainerbackgroundcolour ' ]);
726
- self ::setup_displayed_image ($ sectionimage , $ storedfilerecord ['contextid ' ], $ courseformat ->get_courseid (), $ settings , $ icbc , $ mime );
725
+ self ::setup_displayed_image ($ sectionimage , $ storedfilerecord ['contextid ' ], $ courseformat ->get_courseid (), $ settings , $ mime );
727
726
} else {
728
727
print_error ('imagecannotbeused ' , 'format_grid ' , $ CFG ->wwwroot . "/course/view.php?id= " . $ courseformat ->get_courseid ());
729
728
}
@@ -743,11 +742,10 @@ public static function create_section_image($tempfile, $storedfilerecord, $secti
743
742
* @param int $contextid The context id to which the image relates.
744
743
* @param int $courseid The course id to which the image relates.
745
744
* @param array $settings The course settings to apply.
746
- * @param array $icbc The 'imagecontainerbackgroundcolour' as an RGB array.
747
745
* @param string $mime The mime type if already known.
748
746
* @return array The updated $sectionimage data.
749
747
*/
750
- public static function setup_displayed_image ($ sectionimage , $ contextid , $ courseid , $ settings , $ icbc , $ mime = null ) {
748
+ public static function setup_displayed_image ($ sectionimage , $ contextid , $ courseid , $ settings , $ mime = null ) {
751
749
global $ CFG , $ DB ;
752
750
require_once ($ CFG ->dirroot . '/repository/lib.php ' );
753
751
require_once ($ CFG ->libdir . '/gdlib.php ' );
@@ -786,7 +784,7 @@ public static function setup_displayed_image($sectionimage, $contextid, $coursei
786
784
'sectionimage_displayedimageindex ' => $ sectionimage ->displayedimageindex ,
787
785
'sectionimage_newimage ' => $ sectionimage ->newimage
788
786
);
789
- $ data = self ::generate_image ($ tmpfilepath , $ displayedimageinfo ['width ' ], $ displayedimageinfo ['height ' ], $ crop , $ icbc , $ newmime , $ debugdata );
787
+ $ data = self ::generate_image ($ tmpfilepath , $ displayedimageinfo ['width ' ], $ displayedimageinfo ['height ' ], $ crop , $ newmime , $ debugdata );
790
788
if (!empty ($ data )) {
791
789
// Updated image.
792
790
$ sectionimage ->displayedimageindex ++;
@@ -976,12 +974,11 @@ public static function update_displayed_images($courseid, $contextid, $settings,
976
974
977
975
$ sectionimages = self ::get_images ($ courseid );
978
976
if (is_array ($ sectionimages )) {
979
- $ icbc = self ::hex2rgb ($ settings ['imagecontainerbackgroundcolour ' ]);
980
977
$ t = $ DB ->start_delegated_transaction ();
981
978
foreach ($ sectionimages as $ sectionimage ) {
982
979
if ($ sectionimage ->displayedimageindex > 0 ) {
983
980
$ sectionimage ->newimage = $ sectionimage ->image ;
984
- $ sectionimage = self ::setup_displayed_image ($ sectionimage , $ contextid , $ courseid , $ settings, $ icbc );
981
+ $ sectionimage = self ::setup_displayed_image ($ sectionimage , $ contextid , $ courseid , $ settings );
985
982
}
986
983
}
987
984
$ t ->allow_commit ();
@@ -1001,13 +998,12 @@ public static function update_displayed_images($courseid, $contextid, $settings,
1001
998
* @param int $requestedwidth the width of the requested image.
1002
999
* @param int $requestedheight the height of the requested image.
1003
1000
* @param bool $crop false = scale, true = crop.
1004
- * @param array $icbc The 'imagecontainerbackgroundcolour' as an RGB array.
1005
1001
* @param string $mime The mime type.
1006
1002
* @param array $debugdata Debug data if the image generation fails.
1007
1003
*
1008
1004
* @return string|bool false if a problem occurs or the image data.
1009
1005
*/
1010
- private static function generate_image ($ filepath , $ requestedwidth , $ requestedheight , $ crop , $ icbc , $ mime , $ debugdata ) {
1006
+ private static function generate_image ($ filepath , $ requestedwidth , $ requestedheight , $ crop , $ mime , $ debugdata ) {
1011
1007
if (empty ($ filepath ) or empty ($ requestedwidth ) or empty ($ requestedheight )) {
1012
1008
return false ;
1013
1009
}
0 commit comments