Skip to content

Commit

Permalink
MDL-35768 MDL-36017 code style corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 2, 2012
1 parent 8bc3453 commit 92d3866
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion admin/oacleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ function online_assignment_cleanup($output=false) {
$course = course_get_format($course)->get_course();
if (!isset($course->numsections)) {
// Course format does not use numsections
if ($output) echo 'No extra sections<br />';
if ($output) {
echo 'No extra sections<br />';
}
continue;
}
$sql = "SELECT *
Expand Down
8 changes: 5 additions & 3 deletions backup/moodle2/backup_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,11 @@ protected function define_structure() {
LEFT JOIN {user_info_field} uif ON uif.id = csaf.customfieldid
WHERE csaf.coursesectionid = ?', array(backup::VAR_SECTIONID));
$formatoptions->set_source_sql('SELECT cfo.id, cfo.format, cfo.name, cfo.value
FROM {course_format_options} cfo, {course} c
WHERE cfo.sectionid = ? AND cfo.courseid = c.id AND cfo.format = c.format',
array(backup::VAR_SECTIONID));
FROM {course} c
JOIN {course_format_options} cfo
ON cfo.courseid = c.id AND cfo.format = c.format
WHERE c.id = ? AND cfo.sectionid = ?',
array(backup::VAR_COURSEID, backup::VAR_SECTIONID));

// Aliases
$section->set_source_alias('section', 'number');
Expand Down
3 changes: 3 additions & 0 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,12 @@ public function process_availability_field($data) {
public function process_course_format_options($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
unset($data->id);
$data->sectionid = $this->task->get_sectionid();
$data->courseid = $this->get_courseid();
$newid = $DB->insert_record('course_format_options', $data);
$this->set_mapping('course_format_options', $oldid, $newid);
}

protected function after_execute() {
Expand Down
2 changes: 1 addition & 1 deletion course/format/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function get_format_options($section = null) {
*
* This function is called from {@link course_edit_form::definition_after_data()}
*
* @param moodleform $mform form the elements are added to
* @param MoodleQuickForm $mform form the elements are added to
* @param bool $forsection 'true' if this is a section edit form, 'false' if this is course edit form
* @return array array of references to the added form elements
*/
Expand Down
2 changes: 1 addition & 1 deletion course/yui/formatchooser/formatchooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ YUI.add('moodle-course-formatchooser', function(Y) {
var formatselect = Y.one('#'+params.formid+' #id_format');
if (updatebut && formatselect) {
updatebut.setStyle('display', 'none');
formatselect.on('change', function() {
formatselect.on('change', function() {
updatebut.simulate('click');
});
}
Expand Down

0 comments on commit 92d3866

Please sign in to comment.