diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml
index 9998a35..9551c16 100644
--- a/.github/workflows/cron.yml
+++ b/.github/workflows/cron.yml
@@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
moodle-branch: ['MOODLE_311_STABLE']
- php: ['7.4']
+ php: ['8.0']
database: ['mysqli']
steps:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 191d076..bd5cbb8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- moodle-branch: ['master']
+ moodle-branch: ['MOODLE_400_STABLE', 'master']
php: ['8.0', '7.4']
database: ['mysqli']
diff --git a/classes/output/renderer.php b/classes/output/renderer.php
index 8af7222..c870df0 100644
--- a/classes/output/renderer.php
+++ b/classes/output/renderer.php
@@ -79,10 +79,10 @@ public function render_content($widget) {
$str .= 'background-color:' . $options->backcolor . ' !important;';
$str .= 'border: ' . trim($options->borderwidth) . 'px solid '. $options->bordercolor . ' !important;}';
$moduleinfo = $format->get_modinfo();
- $sections = $moduleinfo->get_sections();
- foreach ($sections as $sectionnumber => $section) {
- $options = (object) $format->get_format_options($sectionnumber);
- $str .= '#section-' . $sectionnumber . ' {';
+ $sections = array_keys($moduleinfo->get_sections());
+ foreach ($sections as $section) {
+ $options = (object) $format->get_format_options($section);
+ $str .= '#section-' . $section . ' {';
$str .= 'background-color:' . $options->backcolor . ' !important;} ';
}
$extra = "";
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index 20fd0bd..d76e443 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -18,21 +18,21 @@
* Privacy main class.
*
* @package format_masonry
- * @copyright 2018 Renaat Debleu (www.eWallah.net)
+ * @copyright 2018 eWallah.net
+ * @author Renaat Debleu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace format_masonry\privacy;
-defined('MOODLE_INTERNAL') || die();
-
use \core_privacy\local\metadata\null_provider;
/**
* Privacy main class.
*
* @package format_masonry
- * @copyright 2018 Renaat Debleu (www.eWallah.net)
+ * @copyright 2018 eWallah.net
+ * @author Renaat Debleu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements null_provider {
diff --git a/db/upgrade.php b/db/upgrade.php
index c8fe985..adc49d2 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -19,12 +19,10 @@
*
* @package format_masonry
* @copyright 2018 eWallah.net
- * @author Renaat Debleu (www.ewallah.net)
+ * @author Renaat Debleu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-defined('MOODLE_INTERNAL') || die();
-
/**
* Upgrade script for format_masonry
*
diff --git a/format.js b/format.js
index 8eeac66..f4189a7 100644
--- a/format.js
+++ b/format.js
@@ -25,7 +25,7 @@ M.masonry.init = function(Y, cfg) {
setter: function(node) {
var n = Y.one(node);
if (!n) {
- n = Y.one('#coursemasonry');
+ n = Y.one('.masonry');
}
if (!n) {
Y.fail('Masonry: Invalid Node Given: ' + node);
@@ -41,7 +41,7 @@ M.masonry.init = function(Y, cfg) {
isFitWidth: {value: true},
containerStyle: {value: {position: 'relative'}},
columnWidth: {value: 2},
- itemSelector: {value: '.section.main'}
+ itemSelector: {value: '.masonry-brick'}
};
Y.extend(Masonry, Y.Base, {
@@ -49,6 +49,7 @@ M.masonry.init = function(Y, cfg) {
initializer: function() {
this._create();
this._init();
+ this._reLayout();
},
destructor: function() {
diff --git a/templates/content.mustache b/templates/content.mustache
index bba1cfc..7533dc7 100644
--- a/templates/content.mustache
+++ b/templates/content.mustache
@@ -138,10 +138,14 @@
{{{title}}}
{{#initialsection}}
- {{> format_masonry/section }}
+ -
+ {{> format_masonry/section }}
+
{{/initialsection}}
{{#sections}}
- {{> format_masonry/section }}
+ -
+ {{> format_masonry/section }}
+
{{/sections}}
diff --git a/templates/section.mustache b/templates/section.mustache
index 31779d6..3486b16 100644
--- a/templates/section.mustache
+++ b/templates/section.mustache
@@ -26,6 +26,7 @@
"controlmenu": "[tools menu]",
"header": {
"name": "Section title",
+ "title": "Section title",
"url": "#",
"ishidden": false
},
@@ -79,23 +80,21 @@
"sitehome": false
}
}}
-
-