Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ewallah committed Oct 9, 2023
1 parent 6cd41b9 commit 9b47807
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace format_masonry\privacy;

use \core_privacy\local\metadata\null_provider;
use core_privacy\local\metadata\null_provider;

/**
* Privacy main class.
Expand Down
6 changes: 3 additions & 3 deletions format.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
'itemSelector' => '.section.main',
'columnWidth' => 1,
'isRTL' => right_to_left(),
'gutterWidth' => 0
]],
'gutterWidth' => 0,
], ],
false,
[
'name' => 'course_format_masonry',
'fullpath' => '/course/format/masonry/format.js',
'requires' => ['base', 'node', 'transition', 'event', 'io-base', 'moodle-core-io']
'requires' => ['base', 'node', 'transition', 'event', 'io-base', 'moodle-core-io'],
]
);
}
16 changes: 8 additions & 8 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function section_format_options($foreditform = false) {
'cache' => true,
'cachedefault' => $color,
'help' => 'colordisplay',
'help_component' => 'format_masonry']];
'help_component' => 'format_masonry', ], ];
}

/**
Expand All @@ -139,7 +139,7 @@ public function course_format_options($foreditform = false) {
'coursedisplay' => ['type' => PARAM_INT, 'default' => 1],
'borderwidth' => ['type' => PARAM_INT, 'default' => 1],
'bordercolor' => ['type' => PARAM_TEXT, 'default' => '#F0F0F0'],
'backcolor' => ['type' => PARAM_TEXT, 'default' => '#F0F0F0']];
'backcolor' => ['type' => PARAM_TEXT, 'default' => '#F0F0F0'], ];
}
if ($foreditform && !isset($courseformatoptions['coursedisplay']['label'])) {
$courseconfig = get_config('moodlecourse');
Expand All @@ -152,29 +152,29 @@ public function course_format_options($foreditform = false) {
'numsections' => [
'label' => new \lang_string('numberweeks'),
'element_type' => 'select',
'element_attributes' => [$sectionmenu]],
'element_attributes' => [$sectionmenu], ],
'hiddensections' => [
'label' => 'hidden1',
'element_type' => 'hidden',
'element_attributes' => [[1 => new \lang_string('hiddensectionsinvisible')]]],
'element_attributes' => [[1 => new \lang_string('hiddensectionsinvisible')]], ],
'coursedisplay' => [
'label' => 'hidden2',
'element_type' => 'hidden',
'element_attributes' => [[COURSE_DISPLAY_SINGLEPAGE => new \lang_string('coursedisplay_single')]]],
'element_attributes' => [[COURSE_DISPLAY_SINGLEPAGE => new \lang_string('coursedisplay_single')]], ],
'borderwidth' => [
'label' => new \lang_string('borderwidth', 'format_masonry'),
'element_type' => 'select',
'element_attributes' => [[0 => '0', 1 => '1', 2 => '2']]],
'element_attributes' => [[0 => '0', 1 => '1', 2 => '2']], ],
'bordercolor' => [
'label' => new \lang_string('bordercolor', 'format_masonry'),
'element_type' => 'text',
'element_type' => 'hidden'],
'element_type' => 'hidden', ],
'backcolor' => [
'label' => new \lang_string('bordercolor', 'format_masonry'),
'element_type' => 'text',
'help' => 'colordisplay',
'help_component' => 'format_masonry',
'element_attributes' => [['value' => $courseformatoptions['bordercolor']['default']]]]];
'element_attributes' => [['value' => $courseformatoptions['bordercolor']['default']]], ], ];
$courseformatoptions = array_merge_recursive($courseformatoptions, $courseoptionsedit);
}
return $courseformatoptions;
Expand Down
8 changes: 4 additions & 4 deletions tests/masonry_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function setUp(): void {
$CFG->enableavailability = true;
$gen = $this->getDataGenerator();
$params = ['format' => 'masonry', 'numsections' => 6, 'startdate' => time() - 3000,
'enablecompletion' => 1, 'showactivitydates' => true];
'enablecompletion' => 1, 'showactivitydates' => true, ];
$course = $gen->create_course($params, ['createsections' => true]);
$DB->set_field('course', 'groupmode', SEPARATEGROUPS);
$DB->set_field('course', 'groupmodeforce', 1);
Expand Down Expand Up @@ -137,7 +137,7 @@ public function test_default_course_enddate() {
'category' => $category,
'editoroptions' => [
'context' => context_course::instance($this->course->id),
'subdirs' => 0
'subdirs' => 0,
],
'returnto' => new \moodle_url('/'),
'returnurl' => new \moodle_url('/'),
Expand Down Expand Up @@ -175,10 +175,10 @@ public function test_renderer() {
$page->set_url('/course/view.php?id=' . $this->course->id);
$PAGE->set_url('/course/view.php?id=' . $this->course->id);
$page->requires->js_init_call('M.masonry.init', [[
'node' => '#coursemasonry', 'itemSelector' => '.section.main', 'columnWidth' => 1, 'isRTL' => right_to_left()]],
'node' => '#coursemasonry', 'itemSelector' => '.section.main', 'columnWidth' => 1, 'isRTL' => right_to_left(), ], ],
false,
['name' => 'course_format_masonry', 'fullpath' => '/course/format/masonry/format.js',
'requires' => ['base', 'node', 'transition', 'event', 'io-base', 'moodle-core-io']]);
'requires' => ['base', 'node', 'transition', 'event', 'io-base', 'moodle-core-io'], ]);
$renderer = new \format_masonry\output\renderer($PAGE, null);
$modinfo = get_fast_modinfo($this->course);
$section = $modinfo->get_section_info(1);
Expand Down

0 comments on commit 9b47807

Please sign in to comment.