Skip to content

Commit

Permalink
Code checker updates (Moodle 3.x) WIP 4
Browse files Browse the repository at this point in the history
  • Loading branch information
james-cnz committed Oct 1, 2023
1 parent 352f92e commit e0787cd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
matrix:
include:
# Moodle 3.4 (old) version.php $plugin -> requires = 2017111300
- php: '7.0' # 7.0-7.2
moodle-branch: 'MOODLE_34_STABLE'
database: mariadb
plugin-ci: ^3
#- php: '7.0' # 7.0-7.2
# moodle-branch: 'MOODLE_34_STABLE'
# database: mariadb
# plugin-ci: ^3
# Moodle 3.5
- php: '7.0' # 7.0-7.2
moodle-branch: 'MOODLE_35_STABLE'
Expand Down
4 changes: 2 additions & 2 deletions classes/courseheader.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function output(): string {
$o = \html_writer::start_tag('div', [
'id' => 'course-header-banner',
'style' => "background-image: url('{$this->imageurl}'); "
. "background-position: center {$this->bannerslice}%;"
. "background-position: center {$this->bannerslice}%;",
]);
$o .= \html_writer::tag('div', $this->coursename, [
'id' => 'course-header-banner-text',
Expand All @@ -106,7 +106,7 @@ public function output(): string {

// Output the attribution.
$o .= \html_writer::start_tag('p', ['id' => 'course-header-banner_attribution',
'style' => 'visibility: ' . ($this->imageurl ? 'visible' : 'hidden') . ';']);
'style' => 'visibility: ' . ($this->imageurl ? 'visible' : 'hidden') . ';', ]);
$o .= format_multitopic_image_attribution($this->imagename, $this->authorwithurl, $this->licencecode);
$o .= \html_writer::end_tag('p');

Expand Down
32 changes: 16 additions & 16 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public function ajax_section_move() : array {
public function get_default_blocks() : array {
return [
BLOCK_POS_LEFT => [],
BLOCK_POS_RIGHT => []
BLOCK_POS_RIGHT => [],
];
}

Expand All @@ -640,13 +640,13 @@ public function course_format_options($foreditform = false) : array {
// INCLUDED /course/format/periods/lib.php function course_format_options 'periodduration'.
'periodduration' => [
'default' => null, // CHANGED.
'type' => PARAM_NOTAGS
'type' => PARAM_NOTAGS,
],
// END INCLUDED.
// ADDED.
'collapsible' => [
'default' => '1',
'type' => PARAM_ALPHANUM
'type' => PARAM_ALPHANUM,
],
// END ADDED.
'hiddensections' => [
Expand Down Expand Up @@ -676,7 +676,7 @@ public function course_format_options($foreditform = false) : array {
null => new lang_string('period_undefined', 'format_multitopic'),
'1 day' => new lang_string('numday', '', 1),
'1 week' => new lang_string('numweek', '', 1),
]],
], ],
// END ADDED.
],
// END INCLUDED.
Expand All @@ -688,7 +688,7 @@ public function course_format_options($foreditform = false) : array {
[
'0' => get_string('no'),
'1' => get_string('yes'),
]
],
],
'help' => 'collapsibledefault',
'help_component' => 'format_multitopic',
Expand All @@ -702,8 +702,8 @@ public function course_format_options($foreditform = false) : array {
'element_attributes' => [
[
0 => new lang_string('hiddensectionscollapsed'),
1 => new lang_string('hiddensectionsinvisible')
]
1 => new lang_string('hiddensectionsinvisible'),
],
],
],
// REMOVED: coursedisplay .
Expand All @@ -724,7 +724,7 @@ public function course_format_options($foreditform = false) : array {
'70%', '71%', '72%', '73%', '74%', '75%', '76%', '77%', '78%', '79%',
'80%', '81%', '82%', '83%', '84%', '85%', '86%', '87%', '88%', '89%',
'90%', '91%', '92%', '93%', '94%', '95%', '96%', '97%', '98%', '99%',
'100%']
'100%', ],
],
],
// END ADDED.
Expand Down Expand Up @@ -768,19 +768,19 @@ public function section_format_options($foreditform = false) : array {
// INCLUDED /course/format/onetopic/lib.php function section_format_options 'level'.
'level' => [
'default' => FORMAT_MULTITOPIC_SECTION_LEVEL_TOPIC, // CHANGED.
'type' => PARAM_INT
'type' => PARAM_INT,
],
// END INCLUDED.
// INCLUDED /course/format/periods/lib.php function section_format_options 'periodduration'.
'periodduration' => [
'default' => null, // ADDED.
'type' => PARAM_NOTAGS
'type' => PARAM_NOTAGS,
],
// END INCLUDED.
// ADDED.
'collapsible' => [
'default' => null,
'type' => PARAM_ALPHANUM
'type' => PARAM_ALPHANUM,
],
// END ADDED.
];
Expand All @@ -796,8 +796,8 @@ public function section_format_options($foreditform = false) : array {
[
FORMAT_MULTITOPIC_SECTION_LEVEL_ROOT + 1 => get_string('asprincipal', 'format_multitopic'), // CHANGED.
FORMAT_MULTITOPIC_SECTION_LEVEL_ROOT + 2 => get_string('aschild', 'format_multitopic'), // CHANGED.
FORMAT_MULTITOPIC_SECTION_LEVEL_TOPIC => get_string('topic') // ADDED.
]
FORMAT_MULTITOPIC_SECTION_LEVEL_TOPIC => get_string('topic'), // ADDED.
],
],
'help' => 'level',
'help_component' => 'format_multitopic',
Expand All @@ -824,7 +824,7 @@ public function section_format_options($foreditform = false) : array {
'2 week' => new lang_string('numweeks', '', 2),
'3 week' => new lang_string('numweeks', '', 3),
'4 week' => new lang_string('numweeks', '', 4),
]],
], ],
// END ADDED.
],
// END INCLUDED.
Expand All @@ -837,7 +837,7 @@ public function section_format_options($foreditform = false) : array {
null => new lang_string('default'),
'0' => get_string('no'),
'1' => get_string('yes'),
]
],
],
'help' => 'collapsibleoverride',
'help_component' => 'format_multitopic',
Expand Down Expand Up @@ -1053,7 +1053,7 @@ public function inplace_editable_render_section_name($section, $linkifneeded = t

$displayvalue = $title = html_writer::tag('i', '', ['class' =>
($section->levelsan < FORMAT_MULTITOPIC_SECTION_LEVEL_TOPIC ? 'icon fa fa-folder-o fa-fw'
: 'icon fa fa-list fa-fw')])
: 'icon fa fa-list fa-fw'), ])
. ' ' . get_section_name($section->course, $section); // CHANGED.
// TODO: Fix collapse icon for AJAX rename, somehow?
if ($linkifneeded) {
Expand Down
4 changes: 2 additions & 2 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected function section_header($section, $course, $onsectionpage, $sectionret
'aria-labelledby' => "sectionid-{$section->id}-title",
'aria-label' => get_section_name($course, $section), // For Sharing Cart.
'data-sectionid' => $section->section,
'data-sectionreturnid' => $section->section // CHANGED.
'data-sectionreturnid' => $section->section, // CHANGED.
]);

// Create a span that contains the section title to be used to create the keyboard section move menu.
Expand Down Expand Up @@ -713,7 +713,7 @@ public function print_multiple_section_page($course, $sections, $mods, $modnames
. ($thissection->currentnestedlevel >= $level ? ' marker' : '')
. ((!$thissection->visible || !$thissection->available) && ($thissection->section != 0)
|| $level > $thissection->pagedepthdirect ? ' dimmed' : ''),
'data-itemid' => $thissection->id
'data-itemid' => $thissection->id,
]),
$sectionname);
$newtab->level = $level - FORMAT_MULTITOPIC_SECTION_LEVEL_ROOT;
Expand Down
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
0 => new lang_string('sunday', 'calendar'),
1 => new lang_string('monday', 'calendar'),
5 => new lang_string('friday', 'calendar'),
6 => new lang_string('saturday', 'calendar')
6 => new lang_string('saturday', 'calendar'),
]
));

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022053002; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2018051700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2017111300; // Requires this Moodle version.
$plugin->component = 'format_multitopic'; // Full name of the plugin (used for diagnostics). // CHANGED: format name.
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit e0787cd

Please sign in to comment.