From bae0b2c6b5caf543dac03711e4bad41514c8337c Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:09:55 +0100 Subject: [PATCH] Code checker and release reverted, related to #9. --- classes/course_renderer.php | 4 ++-- js/vsf_colourpopup.php | 23 +++++++++++++++++++++-- version.php | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/classes/course_renderer.php b/classes/course_renderer.php index d461a74..5c7482f 100644 --- a/classes/course_renderer.php +++ b/classes/course_renderer.php @@ -176,7 +176,7 @@ public function course_section_cm_text_vsf($course, cm_info $mod, $vsfavailabili ); } if ($mod->modname == 'folder') { - $folder = $DB->get_record('folder', array('id' => $mod->instance), 'display', MUST_EXIST); + $folder = $DB->get_record('folder', ['id' => $mod->instance], 'display', MUST_EXIST); if ($folder->display == FOLDER_DISPLAY_INLINE) { $modcontent = $mod->get_formatted_content(['overflowdiv' => true, 'noclean' => true]); $output .= html_writer::tag( @@ -362,7 +362,7 @@ public function course_section_cm_vsf($course, &$completioninfo, cm_info $mod, $ * @param array $displayoptions * @return string */ - public function course_section_cm_name(cm_info $mod, $displayoptions = array()) { + public function course_section_cm_name(cm_info $mod, $displayoptions = []) { if (!$mod->is_visible_on_course_page() || !$mod->url) { // Nothing to be displayed to the user. return ''; diff --git a/js/vsf_colourpopup.php b/js/vsf_colourpopup.php index d4f614c..2a59c56 100644 --- a/js/vsf_colourpopup.php +++ b/js/vsf_colourpopup.php @@ -49,6 +49,7 @@ class MoodleQuickForm_vsfcolourpopup extends HTML_QuickForm_text implements temp * @var string */ public $_helpbutton = ''; + /** * Hidden label? * @@ -56,6 +57,9 @@ class MoodleQuickForm_vsfcolourpopup extends HTML_QuickForm_text implements temp */ public $_hiddenLabel = false; + /** + * Constructor. + */ public function __construct($elementName = null, $elementLabel = null, $attributes = null, $options = null) { parent::__construct($elementName, $elementLabel, $attributes); /* Pretend we are a 'static' MoodleForm element so that we get the core_form/element-static template where @@ -64,17 +68,27 @@ public function __construct($elementName = null, $elementLabel = null, $attribut $this->setType('static'); } - /* - * PHP4 constructor method, kept for compatibility + /** + * PHP4 constructor method, kept for compatibility. */ public function MoodleQuickForm_gfcolourpopup($elementName = null, $elementLabel = null, $attributes = null, $options = null) { self::__construct($elementName, $elementLabel, $attributes, $options); } + /** + * Set hidden label. + * + * @param bool $hiddenLabel + */ public function setHiddenLabel($hiddenLabel) { $this->_hiddenLabel = $hiddenLabel; } + /** + * To HTML. + * + * @return string Markup. + */ public function toHtml() { global $CFG, $COURSE, $USER, $PAGE, $OUTPUT; $id = $this->getAttribute('id'); @@ -148,6 +162,11 @@ public function getElementTemplateType() { } } + /** + * Export for template. + * + * @return array Context. + */ public function export_for_template(renderer_base $output) { $context = $this->export_for_template_base($output); $context['html'] = $this->toHtml(); diff --git a/version.php b/version.php index eeb9d28..b585a80 100644 --- a/version.php +++ b/version.php @@ -30,4 +30,4 @@ $plugin->requires = 2024042200.00; // 4.4 (Build: 20240422). $plugin->supported = [404, 404]; $plugin->component = 'format_vsf'; -$plugin->release = '4.4.0.3'; +$plugin->release = '4.4.0.2';