From ff1e7a703c194b96193aad77df22949da6a465e7 Mon Sep 17 00:00:00 2001
From: Alexander Bias <alexander.bias@uni-ulm.de>
Date: Thu, 11 Feb 2021 20:59:09 +0100
Subject: [PATCH] Make codechecker happier

---
 amd/src/backtotop.js             |  4 +---
 amd/src/infobanner.js            |  8 +++++---
 classes/output/core_renderer.php | 15 ++++++++++++++-
 lang/en/theme_boost_campus.php   |  4 +---
 layout/columns2.php              |  4 ++++
 layout/login.php                 |  2 ++
 settings.php                     |  2 +-
 7 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/amd/src/backtotop.js b/amd/src/backtotop.js
index 017eef4..fbe02c6 100644
--- a/amd/src/backtotop.js
+++ b/amd/src/backtotop.js
@@ -21,8 +21,6 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-
-
 define(['jquery', 'core/str'], function($, str) {
     "use strict";
 
@@ -31,7 +29,7 @@ define(['jquery', 'core/str'], function($, str) {
      */
     function initBackToTop() {
         // Get the string backtotop from language file.
-        str.get_string('backtotop', 'theme_boost_campus').then(function (string) {
+        str.get_string('backtotop', 'theme_boost_campus').then(function(string) {
             // Add a fontawesome icon after the footer as the back to top button.
             $('#page-footer').after('<i class="fa fa-chevron-up fa-2x d-print-none"' +
                 'id="back-to-top" aria-label="' + string + '"></i>');
diff --git a/amd/src/infobanner.js b/amd/src/infobanner.js
index d2b6df8..daf1b16 100644
--- a/amd/src/infobanner.js
+++ b/amd/src/infobanner.js
@@ -27,6 +27,8 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/n
 
     /**
      * Initialising.
+     *
+     * @param {string} showconfirmationdialogue
      */
     function initInfoBanner(showconfirmationdialogue) {
 
@@ -37,7 +39,7 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/n
             }, {
                 key: 'closingperpetualinfobanner',
                 component: 'theme_boost_campus'
-            } , {
+            }, {
                 key: 'yes_close',
                 component: 'theme_boost_campus'
             }
@@ -53,12 +55,12 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/n
             event.stopPropagation();
 
             if (showconfirmationdialogue == '1') {
-                $.when(stringsPromise, modalPromise).then(function (strings, modal) {
+                $.when(stringsPromise, modalPromise).then(function(strings, modal) {
                     modal.setTitle(strings[0]);
                     modal.setBody(strings[1]);
                     modal.setSaveButtonText(strings[2]);
                     // Saved clicked - the dismissing of the info banner is confirmed.
-                    modal.getRoot().on(ModalEvents.save, function () {
+                    modal.getRoot().on(ModalEvents.save, function() {
                         M.util.set_user_preference('theme_boost_campus_infobanner_dismissed', true);
                         // Now close the alert.
                         $('#themeboostcampusperpinfobanner').alert('close');
diff --git a/classes/output/core_renderer.php b/classes/output/core_renderer.php
index b378ea2..43229ad 100644
--- a/classes/output/core_renderer.php
+++ b/classes/output/core_renderer.php
@@ -109,9 +109,11 @@ class core_renderer extends \core_renderer {
             return $this->image_url('favicon', 'theme');
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START.
         return $this->image_url('favicon', 'theme');
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
     }
 
 
@@ -150,9 +152,11 @@ class core_renderer extends \core_renderer {
             $header->settingsmenu = $this->context_header_settings_menu();
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START
         $header->settingsmenu = $this->context_header_settings_menu();
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
         $header->contextheader = $this->context_header();
         $header->hasnavbar = empty($this->page->layout_options['nonavbar']);
         $header->navbar = $this->navbar();
@@ -180,9 +184,11 @@ class core_renderer extends \core_renderer {
             }
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START
         $header->pageheadingbutton = $this->page_heading_button();
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
         $header->courseheader = $this->course_header();
         $header->headeractions = $this->page->get_header_actions();
         // MODIFICATION START:
@@ -194,9 +200,11 @@ class core_renderer extends \core_renderer {
             $html = $this->render_from_template('theme_boost_campus/full_header', $header);
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START
         return $this->render_from_template('core/full_header', $header);
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
 
         // MODIFICATION START:
         // If the setting showhintcoursehidden is set, the visibility of the course is hidden and
@@ -266,7 +274,8 @@ class core_renderer extends \core_renderer {
                     $html .= html_writer::tag('i', null, array('class' => 'fa fa-sign-in fa-3x fa-pull-left'));
                     $html .= get_string('showhintcourseselfenrol', 'theme_boost_campus',
                             array('name' => $selfenrolinstancename));
-                    // Only show the link to edit the specific self enrolment if the user has the capability to config self enrolments.
+                    // Only show the link to edit the specific self enrolment if the user has the capability
+                    // to config self enrolments.
                     if (has_capability('enrol/self:config', \context_course::instance($COURSE->id))) {
                         $url = new moodle_url('/enrol/editinstance.php', array('courseid' => $COURSE->id,
                                                                                'id' => $selfenrolinstanceid, 'type' => 'self'));
@@ -465,9 +474,11 @@ class core_renderer extends \core_renderer {
             return $this->render_from_template('core/loginform', $context);
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START.
         return $this->render_from_template('core/loginform', $context);
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
     }
 
     /**
@@ -491,9 +502,11 @@ class core_renderer extends \core_renderer {
             return $this->render_from_template('core/help_icon', $context);
         }
         // MODIFICATION END.
+        // @codingStandardsIgnoreStart
         /* ORIGINAL START.
         $context = $helpicon->export_for_template($this);
         return $this->render_from_template('core/help_icon', $context);
         ORIGINAL END. */
+        // @codingStandardsIgnoreEnd
     }
 }
diff --git a/lang/en/theme_boost_campus.php b/lang/en/theme_boost_campus.php
index 5241461..6015083 100644
--- a/lang/en/theme_boost_campus.php
+++ b/lang/en/theme_boost_campus.php
@@ -161,9 +161,7 @@ $string['imageareaitemsattributessetting_desc'] = 'With this optional setting yo
 </ul>
 Each line consists of the file identifier (the file name) the link URL and the alt-text, separated by pipe characters. Each link declaration needs to be written in a new line. <br/>
 For example:<br/>
-```
-moodle.jpg|https://moodle.org|Moodle logo
-```<br/><br/>
+<code>moodle.jpg|https://moodle.org|Moodle logo</code><br/><br/>
 You can declare the additional attributes for an arbitrary amount of your uploaded images. The attributes will be added only to those images that match their filename with the identifier declared in this setting.';
 $string['imageareaitemsmaxheightsetting'] = 'Image area items maximal height';
 $string['imageareaitemsmaxheightsetting_desc'] = 'With this setting you can change the height in pixels for your uploaded images. All images will have the same maximum height and their width will be resized proportionally. The default value is set to 100 pixels.';
diff --git a/layout/columns2.php b/layout/columns2.php
index b3e5322..ec9fb75 100644
--- a/layout/columns2.php
+++ b/layout/columns2.php
@@ -174,9 +174,11 @@ if (get_config('theme_boost_campus', 'showsettingsincourse') == 'yes' && $PAGE->
     $templatecontext['activitynode'] = theme_boost_campus_get_incourse_activity_settings();
 }
 // MODIFICATION END.
+// @codingStandardsIgnoreStart
 /* ORIGINAL START.
 $templatecontext['flatnavigation'] = $nav;
 ORIGINAL END. */
+// @codingStandardsIgnoreEnd
 
 $templatecontext['firstcollectionlabel'] = $nav->get_collectionlabel();
 
@@ -191,6 +193,8 @@ require_once(__DIR__ . '/includes/footnote.php');
 // Render columns2.mustache from boost_campus.
 echo $OUTPUT->render_from_template('theme_boost_campus/columns2', $templatecontext);
 // MODIFICATION END.
+// @codingStandardsIgnoreStart
 /* ORIGINAL START.
 echo $OUTPUT->render_from_template('theme_boost/columns2', $templatecontext);
 ORIGINAL END. */
+// @codingStandardsIgnoreEnd
diff --git a/layout/login.php b/layout/login.php
index 672c992..eb719b2 100644
--- a/layout/login.php
+++ b/layout/login.php
@@ -103,6 +103,8 @@ require_once(__DIR__ . '/includes/footnote.php');
 // Render own template.
 echo $OUTPUT->render_from_template('theme_boost_campus/login', $templatecontext);
 // MODIFICATION END.
+// @codingStandardsIgnoreStart
 /* ORIGINAL START.
 echo $OUTPUT->render_from_template('theme_boost/login', $templatecontext);
 ORIGINAL END. */
+// @codingStandardsIgnoreEnd
diff --git a/settings.php b/settings.php
index 2f76d16..594c8f6 100644
--- a/settings.php
+++ b/settings.php
@@ -849,7 +849,7 @@ if ($ADMIN->fulltree) {
     $settings->hide_if('theme_boost_campus/timedibcss',
             'theme_boost_campus/timedibenable', 'notchecked');
 
-    // This will check for the desired date time format YYYY-MM-DD HH:MM:SS
+    // This will check for the desired date time format YYYY-MM-DD HH:MM:SS.
     $timeregex = '/(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])|^$/';
 
     // Start time for controlled information banner.
-- 
GitLab