Skip to content

Commit

Permalink
PHPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jun 4, 2024
1 parent 3269e6b commit 5f951f2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
2 changes: 2 additions & 0 deletions classes/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
*/
class format_vsf_course_renderer extends \core_course_renderer {

/** @var bool the module view button */
protected $moduleviewbutton = false;
/** @var bool the module description tooltip */
protected $moduledescriptiontooltip = false;

/**
Expand Down
5 changes: 4 additions & 1 deletion classes/output/format_renderer_migration_toolbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

namespace format_vsf\output;

/**
* Migration trait.
*/
trait format_renderer_migration_toolbox {

/**
Expand Down Expand Up @@ -59,7 +62,7 @@ protected function vsf_section_activity_summary($section, $course, $mods) {
* @return string
*/
public function section_availability($section) {
// TODO: Update to a template!
// Todo: Update to a template!
$widgetclass = $this->courseformat->get_output_classname('content\\section\\availability');
$widget = new $widgetclass($this->courseformat, $section);
return $this->render($widget);
Expand Down
17 changes: 14 additions & 3 deletions classes/output/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,32 @@

require_once($CFG->dirroot.'/course/format/lib.php'); // For course_get_format.

/**
* The renderer.
*/
class renderer extends section_renderer {
use format_renderer_migration_toolbox;

/** @var array section completion percentage */
private $sectioncompletionpercentage = [];
/** @var array section completion markup */
private $sectioncompletionmarkup = [];
/** @var array section completion calculated */
private $sectioncompletioncalculated = [];

/** @var bool show completion button */
private $showcontinuebutton = false;

private $courseformat = null; // Our course format object as defined in lib.php.
/** @var class Our course format object as defined in lib.php */
private $courseformat = null;
/** @var class Course with settings */
private $course; // Course with settings.

private $moduleview; // Showing the modules in a grid.
/** @var bool Showing the modules in a grid? */
private $moduleview;

protected $editing; // Are we editing?
/** @var bool Are we editing? */
protected $editing;

/** @var section control menu output class */
protected $controlmenuclass;
Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:nop';
}
}
20 changes: 14 additions & 6 deletions js/vsf_colourpopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
/**
* Progress Section Format
*
* @package course/format
* @subpackage vsf
* @version See the value of '$plugin->version' in version.php.
* @package format_vsf
* @copyright © 2017-onwards G J Barnard in respect to modifications of standard topics format.
* @author G J Barnard - gjbarnard at gmail dot com and {@link http://moodle.org/user/profile.php?id=442195}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

// phpcs:disable moodle.NamingConventions.ValidVariableName.MemberNameUnderscore
// phpcs:disable moodle.NamingConventions.ValidVariableName.VariableNameLowerCase
// phpcs:disable moodle.NamingConventions.ValidFunctionName.LowercaseMethod
// phpcs:disable PSR2.Methods.MethodDeclaration.Underscore

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

global $CFG;
Expand All @@ -33,19 +37,23 @@
* HTML class for a colorpopup type element
*
* @author Iain Checkland - modified from ColourPicker by Jamie Pratt [thanks]
* @access public
*/
class MoodleQuickForm_vsfcolourpopup extends HTML_QuickForm_text implements templatable {
use templatable_form_element {
export_for_template as export_for_template_base;
}

/*
/**
* html for help button, if empty then no help
*
* @var string
*/
public $_helpbutton = '';
/**
* Hidden label?
*
* @var bool
*/
public $_hiddenLabel = false;

public function __construct($elementName = null, $elementLabel = null, $attributes = null, $options = null) {
Expand Down
3 changes: 3 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot. '/course/format/lib.php');

/**
* Format class.
*/
class format_vsf extends core_courseformat\base {
/**
* Returns true if this course format uses sections
Expand Down

0 comments on commit 5f951f2

Please sign in to comment.