Some trivial changes to lib.php to conform to Moodle coding guidelines

This commit is contained in:
Mark Nelson 2013-07-25 12:32:39 +08:00
parent cf0bdf7580
commit 04cf229d16

28
lib.php
View file

@ -257,9 +257,9 @@ function customcert_user_outline($course, $user, $mod, $customcert) {
* @return string the user complete information * @return string the user complete information
*/ */
function customcert_user_complete($course, $user, $mod, $customcert) { function customcert_user_complete($course, $user, $mod, $customcert) {
global $DB, $OUTPUT; global $DB, $OUTPUT;
if ($issue = $DB->get_record('customcert_issues', array('customcertid' => $customcert->id, 'userid' => $user->id))) { if ($issue = $DB->get_record('customcert_issues', array('customcertid' => $customcert->id, 'userid' => $user->id))) {
echo $OUTPUT->box_start(); echo $OUTPUT->box_start();
echo get_string('issued', 'customcert') . ": "; echo get_string('issued', 'customcert') . ": ";
echo userdate($issue->timecreated); echo userdate($issue->timecreated);
@ -284,14 +284,20 @@ function customcert_user_complete($course, $user, $mod, $customcert) {
*/ */
function customcert_supports($feature) { function customcert_supports($feature) {
switch ($feature) { switch ($feature) {
case FEATURE_GROUPS: return true; case FEATURE_GROUPS:
case FEATURE_GROUPINGS: return true; return true;
case FEATURE_GROUPMEMBERSONLY: return true; case FEATURE_GROUPINGS:
case FEATURE_MOD_INTRO: return true; return true;
case FEATURE_COMPLETION_TRACKS_VIEWS: return true; case FEATURE_GROUPMEMBERSONLY:
case FEATURE_BACKUP_MOODLE2: return true; return true;
case FEATURE_MOD_INTRO:
default: return null; return true;
case FEATURE_COMPLETION_TRACKS_VIEWS:
return true;
case FEATURE_BACKUP_MOODLE2:
return true;
default:
return null;
} }
} }
@ -749,7 +755,7 @@ function customcert_get_conditional_issues_sql($cm, $groupmode) {
$allowedusers = $groupusers; $allowedusers = $groupusers;
} else if ($restricttogroup && $restricttogrouping) { } else if ($restricttogroup && $restricttogrouping) {
$allowedusers = array_intersect($groupusers, $groupingusers); $allowedusers = array_intersect($groupusers, $groupingusers);
} else { } else {
$allowedusers = $groupingusers; $allowedusers = $groupingusers;
} }