Skip to content

Commit

Permalink
MDL-20700 coding style cleanup - cvs keywords removed, closign php ta…
Browse files Browse the repository at this point in the history
…g removed, trailing whitespace cleanup
  • Loading branch information
skodak committed Nov 1, 2009
1 parent dfede59 commit e752155
Show file tree
Hide file tree
Showing 42 changed files with 175 additions and 188 deletions.
2 changes: 0 additions & 2 deletions calendar/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,5 +657,3 @@ function calendar_add_event_allowed($event) {
return false;
}
}

?>
4 changes: 0 additions & 4 deletions calendar/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,3 @@
echo '</tr></table>';

echo $OUTPUT->footer();



?>
4 changes: 1 addition & 3 deletions calendar/export_execute.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // $Id$
<?php

require_once('../config.php');
//require_once($CFG->dirroot.'/course/lib.php');
Expand Down Expand Up @@ -168,5 +168,3 @@
header('Content-type: text/calendar');

echo $serialized;

?>
1 change: 0 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1595,4 +1595,3 @@ function calendar_user_can_add_event() {
calendar_get_allowed_types($allowed);
return (bool)($allowed->user || $allowed->groups || $allowed->courses || $allowed->site);
}
?>
2 changes: 0 additions & 2 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,5 +655,3 @@ function calendar_course_filter_selector($getvars = '') {
$select->nothinglabel = false;
return $OUTPUT->select($select);
}

?>
54 changes: 27 additions & 27 deletions mod/assignment/backuplib.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php //$Id$
<?php
//This php script contains all the stuff to backup/restore
//assignment mods

//This is the "graphical" structure of the assignment mod:
//
// assignment
// (CL,pk->id)
// (CL,pk->id)
// |
// |
// |
// assignment_submisions
// assignment_submisions
// (UL,pk->id, fk->assignment,files)
//
// Meaning: pk->primary key field of the table
Expand Down Expand Up @@ -37,16 +37,16 @@ function assignment_backup_mods($bf,$preferences) {
}
}
}
return $status;
return $status;
}

function assignment_backup_one_mod($bf,$preferences,$assignment) {
global $CFG, $DB;

if (is_numeric($assignment)) {
$assignment = $DB->get_record('assignment', array('id'=>$assignment));
}

$status = true;

//Start mod
Expand Down Expand Up @@ -107,19 +107,19 @@ function backup_assignment_submissions ($bf,$preferences,$assignment) {
//Start submission
$status =fwrite ($bf,start_tag("SUBMISSION",5,true));
//Print submission contents
fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
fwrite ($bf,full_tag("DATA1",6,false,$ass_sub->data1));
fwrite ($bf,full_tag("DATA2",6,false,$ass_sub->data2));
fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
fwrite ($bf,full_tag("SUBMISSIONCOMMENT",6,false,$ass_sub->submissioncomment));
fwrite ($bf,full_tag("FORMAT",6,false,$ass_sub->format));
fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));
fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
fwrite ($bf,full_tag("DATA1",6,false,$ass_sub->data1));
fwrite ($bf,full_tag("DATA2",6,false,$ass_sub->data2));
fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
fwrite ($bf,full_tag("SUBMISSIONCOMMENT",6,false,$ass_sub->submissioncomment));
fwrite ($bf,full_tag("FORMAT",6,false,$ass_sub->format));
fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));

$class = 'assignment_' . $assignment->assignmenttype;
require_once($CFG->dirroot . '/mod/assignment/lib.php');
Expand All @@ -138,7 +138,7 @@ function backup_assignment_submissions ($bf,$preferences,$assignment) {
//and files are user info's level
function backup_assignment_files($bf,$preferences) {
global $CFG, $DB;

$status = true;

//First we check to moddata exists and create it as necessary
Expand All @@ -155,11 +155,11 @@ function backup_assignment_files($bf,$preferences) {

return $status;

}
}

function backup_assignment_files_instance($bf,$preferences,$instanceid) {
global $CFG, $DB;

$status = true;

//First we check to moddata exists and create it as necessary
Expand All @@ -177,7 +177,7 @@ function backup_assignment_files_instance($bf,$preferences,$instanceid) {

return $status;

}
}

//Return an array of info (name,value)
function assignment_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {
Expand All @@ -199,7 +199,7 @@ function assignment_check_backup_mods($course,$user_data=false,$backup_unique_co
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("submissions","assignment");
if ($ids = assignment_submission_ids_by_course ($course)) {
if ($ids = assignment_submission_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
Expand Down Expand Up @@ -243,15 +243,15 @@ function assignment_encode_content_links ($content,$preferences) {

// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE

//Returns an array of assignments id
//Returns an array of assignments id
function assignment_ids ($course) {
global $CFG, $DB;

return $DB->get_records_sql ("SELECT a.id, a.course
FROM {assignment} a
WHERE a.course = ?", array($course));
}

//Returns an array of assignment_submissions id
function assignment_submission_ids_by_course ($course) {
global $CFG, $DB;
Expand All @@ -271,4 +271,4 @@ function assignment_submission_ids_by_instance ($instanceid) {
FROM {assignment_submissions} s
WHERE s.assignment = ?", array($instanceid));
}
?>

2 changes: 1 addition & 1 deletion mod/assignment/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
),
);

?>

2 changes: 1 addition & 1 deletion mod/assignment/db/install.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php //$Id$
<?php

// This file replaces:
// * STATEMENTS section in db/install.xml
Expand Down
4 changes: 2 additions & 2 deletions mod/assignment/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php //$Id$
<?php

// This file keeps track of upgrades to
// the assignment module
Expand Down Expand Up @@ -161,4 +161,4 @@ function xmldb_assignment_upgrade($oldversion) {
return $result;
}

?>

26 changes: 13 additions & 13 deletions mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

/**
* Standard base class for all assignment submodules (assignment types).
*
*
* @package mod-assignment
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down Expand Up @@ -764,14 +764,14 @@ function update_main_listing($submission) {
$url = new moodle_url('/mod/assignment/submissions.php', array(
'id' => $this->cm->id,
'userid' => $submission->userid,
'mode' => 'single',
'mode' => 'single',
'offset' => (optional_param('offset', '', PARAM_INT)-1)));

$link = html_link::make($url, $buttontext);
$link->add_action(new popup_action('click', $link->url, 'grade'.$submission->userid, array('height' => 450, 'width' => 700)));
$link->title = $buttontext;
$button = $OUTPUT->link($link);
$button = $OUTPUT->link($link);

$output.= 'opener.document.getElementById("up'.$submission->userid.'").innerHTML="'.addslashes_js($button).'";';
}

Expand Down Expand Up @@ -1358,7 +1358,7 @@ function display_submissions($message='') {
$link = html_link::make($popup_url, $buttontext);
$link->add_action(new popup_action('click', $link->url, 'grade'.$auser->id, array('height' => 600, 'width' => 700)));
$link->title = $buttontext;
$button = $OUTPUT->link($link);
$button = $OUTPUT->link($link);

$status = '<div id="up'.$auser->id.'" class="s'.$auser->status.'">'.$button.'</div>';

Expand Down Expand Up @@ -2544,7 +2544,7 @@ function assignment_get_participants($assignmentid) {
*/
function assignment_pluginfile($course, $cminfo, $context, $filearea, $args, $forcedownload) {
global $CFG, $DB;

if (!$assignment = $DB->get_record('assignment', array('id'=>$cminfo->instance))) {
return false;
}
Expand Down Expand Up @@ -3077,9 +3077,9 @@ function assignment_types() {
$types[$name] = get_string('type'.$name, 'assignment');

// ugly hack to support pluggable assignment type titles..
if ($types[$name] == '[[type'.$name.']]') {
if ($types[$name] == '[[type'.$name.']]') {
$types[$name] = get_string('type'.$name, 'assignment_'.$name);
}
}
}
asort($types);
return $types;
Expand Down Expand Up @@ -3130,13 +3130,13 @@ function assignment_print_overview($courses, &$htmlarray) {
$strreviewed = get_string('reviewed','assignment');


// NOTE: we do all possible database work here *outside* of the loop to ensure this scales
// NOTE: we do all possible database work here *outside* of the loop to ensure this scales
//
list($sqlassignmentids, $assignmentidparams) = $DB->get_in_or_equal($assignmentids);

// build up and array of unmarked submissions indexed by assigment id/ userid
// for use where the user has grading rights on assigment
$rs = $DB->get_recordset_sql("SELECT id, assignment, userid
$rs = $DB->get_recordset_sql("SELECT id, assignment, userid
FROM {assignment_submissions}
WHERE teacher = 0 AND timemarked = 0
AND assignment $sqlassignmentids", $assignmentidparams);
Expand All @@ -3151,7 +3151,7 @@ function assignment_print_overview($courses, &$htmlarray) {
// get all user submissions, indexed by assigment id
$mysubmissions = $DB->get_records_sql("SELECT assignment, timemarked, teacher, grade
FROM {assignment_submissions}
WHERE userid = ? AND
WHERE userid = ? AND
assignment $sqlassignmentids", array_merge(array($USER->id), $assignmentidparams));

foreach ($assignments as $assignment) {
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function definition() {
// hack to support pluggable assignment type titles
if ($typetitle === '[[type'.$type.']]') {
$typetitle = get_string('type'.$type, 'assignment_'.$type);
}
}

$mform->addElement('header', 'typedesc', $typetitle);

Expand Down
Loading

0 comments on commit e752155

Please sign in to comment.