From 682ce4af85b4b88feadcede793736e98149103a0 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 27 Feb 2017 12:28:01 +1300 Subject: [PATCH] Fix coding guideline stuff found by plugins db check. --- calendar.js | 16 ++++---- classes/attendance_webservices_handler.php | 5 ++- db/upgrade.php | 4 +- externallib.php | 3 +- module.js | 2 +- styles.css | 44 +++++++++++----------- tests/attendance_webservices_test.php | 3 +- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/calendar.js b/calendar.js index 42a2771..73da827 100644 --- a/calendar.js +++ b/calendar.js @@ -3,7 +3,7 @@ YUI().use('yui2-container', 'yui2-calendar', function(Y) { document.body.className += ' yui-skin-sam'; - YAHOO.util.Event.onDOMReady(function(){ + YAHOO.util.Event.onDOMReady(function() { var Event = YAHOO.util.Event, Dom = YAHOO.util.Dom, @@ -36,12 +36,12 @@ YUI().use('yui2-container', 'yui2-calendar', function(Y) { }); dialog = new YAHOO.widget.Dialog("attcalendarcontainer", { - visible:false, - context:["show", "tl", "bl"], - buttons:[{text: M.str.attendance.caltoday, handler: resetHandler, isDefault:true}, + visible: false, + context: ["show", "tl", "bl"], + buttons: [{text: M.str.attendance.caltoday, handler: resetHandler, isDefault: true}, {text: M.str.attendance.calclose, handler: closeHandler}], - draggable:false, - close:false + draggable: false, + close: false }); dialog.setHeader(''); dialog.setBody('
'); @@ -61,8 +61,8 @@ YUI().use('yui2-container', 'yui2-calendar', function(Y) { if (!calendar) { calendar = new YAHOO.widget.Calendar("cal", { - iframe:false, // Turn iframe off, since container has iframe support. - hide_blank_weeks:true // Enable, to demonstrate how we handle changing height, using changeContent. + iframe: false, // Turn iframe off, since container has iframe support. + hide_blank_weeks: true // Enable, to demonstrate how we handle changing height, using changeContent. }); calendar.cfg.setProperty("start_weekday", M.attendance.cal_start_weekday); diff --git a/classes/attendance_webservices_handler.php b/classes/attendance_webservices_handler.php index d7fdd5a..6b2d0b9 100644 --- a/classes/attendance_webservices_handler.php +++ b/classes/attendance_webservices_handler.php @@ -14,12 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** + * Web Services for Attendance plugin. * - * @package local_attendance + * @package mod_attendance * @copyright 2015 Caio Bressan Doneda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + require_once(dirname(__FILE__).'/../../../config.php'); require_once(dirname(__FILE__).'/../locallib.php'); require_once(dirname(__FILE__).'/structure.php'); diff --git a/db/upgrade.php b/db/upgrade.php index 405b08e..3c28bd4 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -46,7 +46,7 @@ function xmldb_attendance_upgrade($oldversion=0) { $dbman->add_field($table, $field); } - upgrade_mod_savepoint($result, 2014112000, 'attendance'); + upgrade_mod_savepoint(true, 2014112000, 'attendance'); } if ($oldversion < 2014112001) { @@ -85,7 +85,7 @@ function xmldb_attendance_upgrade($oldversion=0) { // Delete old capabilities. $DB->delete_records_select('capabilities', 'component = ?', array('mod_attforblock')); - upgrade_plugin_savepoint($result, 2014112001, 'mod', 'attendance'); + upgrade_mod_savepoint(true, 2014112001, 'attendance'); } if ($oldversion < 2015040501) { diff --git a/externallib.php b/externallib.php index eabe7ee..b4ea90f 100644 --- a/externallib.php +++ b/externallib.php @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** + * Externallib.php file for attendance plugin. * - * @package local_attendance + * @package mod_attendance * @copyright 2015 Caio Bressan Doneda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/module.js b/module.js index ee83b79..45b6f55 100644 --- a/module.js +++ b/module.js @@ -12,7 +12,7 @@ M.mod_attendance.init_manage = function(Y) { this.set('checked', ''); }); } - }, '#cb_selector' ); + }, '#cb_selector'); }; M.mod_attendance.set_preferences_action = function(action) { diff --git a/styles.css b/styles.css index 7e7782d..5c4ed93 100644 --- a/styles.css +++ b/styles.css @@ -1,5 +1,5 @@ .path-mod-attendance .attbtn { - border:1px solid #AAAAAA; + border: 1px solid #aaa; border-radius: 5px; margin-left: 2px; margin-right: 2px; @@ -14,27 +14,27 @@ .path-mod-attendance .attfiltercontrols { margin-bottom: 10px; - margin-left:auto; - margin-right:auto; - width:90%; + margin-left: auto; + margin-right: auto; + width: 90%; } -.path-mod-attendance .attfiltercontrols #currentdate{ +.path-mod-attendance .attfiltercontrols #currentdate { display: inline; } .path-mod-attendance .attwidth { margin: auto; - width:90%; + width: 90%; } .path-mod-attendance .userwithoutenrol, -.path-mod-attendance .userwithoutenrol a{ +.path-mod-attendance .userwithoutenrol a { color: gray; } .path-mod-attendance .userwithoutdata, -.path-mod-attendance .userwithoutdata a{ +.path-mod-attendance .userwithoutdata a { color: red; } @@ -43,8 +43,8 @@ } .path-mod-attendance .takelist .userpicture { - margin:0 3px; - vertical-align:middle; + margin: 0 3px; + vertical-align: middle; } .path-mod-attendance .takegrid input { @@ -74,14 +74,14 @@ } /* for IE7*/ .path-mod-attendance .filtercontrols td { - padding:6px; + padding: 6px; } .path-mod-attendance .takecontrols { margin: 0 auto 20px auto; width: 800px; } -.path-mod-attendance .takecontrols table{ +.path-mod-attendance .takecontrols table { margin: 0 auto; } .path-mod-attendance .takecontrols .c0 { @@ -99,11 +99,11 @@ } .path-mod-attendance table.userinfobox { - border: 1px solid #EEEEEE; + border: 1px solid #eee; padding: 0; } .path-mod-attendance table.userinfobox td.left { - background-color: #EEEEEE; + background-color: #eee; padding: 30px 10px; } .path-mod-attendance table.attlist td.c0 { @@ -152,11 +152,11 @@ } .path-mod-attendance .attendancestatus-E { - color: #00AEE3; + color: #00aee3; } .path-mod-attendance .attendancestatus-L { - color: #F7931E; + color: #f7931e; } .path-mod-attendance .attendancestatus-A { @@ -164,25 +164,25 @@ } .path-mod-attendance .attreport .contrast { - background-color: #EAEAEA; + background-color: #eaeaea; } .path-mod-attendance .attreport .center { - text-align:center; + text-align: center; } .path-mod-attendance .attreport .left { - text-align:left; + text-align: left; } .path-mod-attendance .attreport .bottom { - vertical-align:bottom; + vertical-align: bottom; } .path-mod-attendance .attreport .nowrap { - white-space:nowrap; + white-space: nowrap; } .path-mod-attendance .attreport .narrow { - width:1px; + width: 1px; } diff --git a/tests/attendance_webservices_test.php b/tests/attendance_webservices_test.php index 5191c2e..3b239c6 100644 --- a/tests/attendance_webservices_test.php +++ b/tests/attendance_webservices_test.php @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** + * Webservices test for attendance plugin. * - * @package local_attendance + * @package mod_attendance * @copyright 2015 Caio Bressan Doneda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */