From e73457e4ba8a39752016db87801ce42771effff1 Mon Sep 17 00:00:00 2001 From: poltawski Date: Tue, 8 May 2007 15:44:37 +0000 Subject: [PATCH] MDL-9742 Converting tabs to spaces --- course/import/groups/import_form.php | 24 +++++++-------- mod/chat/mod_form.php | 20 ++++++------- mod/exercise/mod_form.php | 18 ++++++------ mod/forum/post.php | 2 +- mod/hotpot/db/update_to_v2.php | 4 +-- mod/hotpot/index.php | 6 ++-- mod/hotpot/show.php | 6 ++-- mod/hotpot/view.php | 6 ++-- mod/journal/mod_form.php | 24 +++++++-------- mod/label/mod_form.php | 18 ++++++------ mod/lesson/mod_form.php | 44 ++++++++++++++-------------- mod/scorm/datamodels/scorm_12lib.php | 2 +- mod/scorm/db/upgrade.php | 2 +- mod/scorm/locallib.php | 9 +++--- mod/scorm/player.php | 2 +- theme/chameleon/ui/chameleon_js.php | 8 ++--- 16 files changed, 97 insertions(+), 98 deletions(-) diff --git a/course/import/groups/import_form.php b/course/import/groups/import_form.php index 4c327dc183371..f1d937ecdad20 100755 --- a/course/import/groups/import_form.php +++ b/course/import/groups/import_form.php @@ -4,35 +4,35 @@ class course_import_groups_form extends moodleform { - function definition() { + function definition() { - global $CFG, $USER; - $mform =& $this->_form; - $maxuploadsize = $this->_customdata['maxuploadsize']; - $strimportgroups = get_string("importgroups"); + global $CFG, $USER; + $mform =& $this->_form; + $maxuploadsize = $this->_customdata['maxuploadsize']; + $strimportgroups = get_string("importgroups"); $this->set_upload_manager(new upload_manager('userfile', true, false, '', false, $maxuploadsize, true, true)); //$this->set_max_file_size('', $maxuploadsize); $mform->addElement('header', 'general', '');//fill in the data depending on page params - //later using set_data + //later using set_data // buttons $mform->addElement('hidden', 'sesskey'); - $mform->setType('sesskey', PARAM_ALPHA); - $mform->setConstants(array('sesskey'=> $USER->sesskey)); + $mform->setType('sesskey', PARAM_ALPHA); + $mform->setConstants(array('sesskey'=> $USER->sesskey)); - $mform->addElement('file', 'userfile', ''); + $mform->addElement('file', 'userfile', ''); $mform->setHelpButton('userfile', array('attachment', get_string('attachment', 'forum'), 'forum')); $this->add_action_buttons(false, $strimportgroups); - } + } - function validation($data) { + function validation($data) { return true; - } + } } ?> diff --git a/mod/chat/mod_form.php b/mod/chat/mod_form.php index 833bdc3e07e68..71cca2250e78a 100644 --- a/mod/chat/mod_form.php +++ b/mod/chat/mod_form.php @@ -3,22 +3,22 @@ class mod_chat_mod_form extends moodleform_mod { - function definition() { + function definition() { - global $CFG; - $mform =& $this->_form; + global $CFG; + $mform =& $this->_form; //------------------------------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64')); - $mform->setType('name', PARAM_TEXT); - $mform->addRule('name', null, 'required', null, 'client'); + $mform->setType('name', PARAM_TEXT); + $mform->addRule('name', null, 'required', null, 'client'); - $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat')); - $mform->setType('intro', PARAM_RAW); + $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat')); + $mform->setType('intro', PARAM_RAW); $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); - $mform->addRule('intro', get_string('required'), 'required', null, 'client'); + $mform->addRule('intro', get_string('required'), 'required', null, 'client'); $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat')); @@ -50,9 +50,9 @@ function definition() { $this->standard_coursemodule_elements(); $this->add_action_buttons(); - } + } } -?> \ No newline at end of file +?> diff --git a/mod/exercise/mod_form.php b/mod/exercise/mod_form.php index fcf002d2e2df5..6bd33ed108a64 100644 --- a/mod/exercise/mod_form.php +++ b/mod/exercise/mod_form.php @@ -3,19 +3,19 @@ class mod_exercise_mod_form extends moodleform_mod { - function definition() { + function definition() { - global $CFG, $COURSE, $EXERCISE_TYPE, $EXERCISE_ASSESSMENT_COMPS; - $mform =& $this->_form; + global $CFG, $COURSE, $EXERCISE_TYPE, $EXERCISE_ASSESSMENT_COMPS; + $mform =& $this->_form; //------------------------------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('title', 'exercise'), array('size'=>'64')); - $mform->setType('name', PARAM_TEXT); - $mform->addRule('name', null, 'required', null, 'client'); + $mform->setType('name', PARAM_TEXT); + $mform->addRule('name', null, 'required', null, 'client'); - $mform->addElement('static', 'description', get_string('description', 'exercise'), get_string('descriptionofexercise', 'exercise', $COURSE->students)); + $mform->addElement('static', 'description', get_string('description', 'exercise'), get_string('descriptionofexercise', 'exercise', $COURSE->students)); $filesize = array(); $sizelist = array('10Kb', '50Kb', '100Kb', '500Kb', '1Mb', '2Mb', '5Mb', '10Mb', '20Mb', '50Mb'); @@ -100,11 +100,11 @@ function definition() { //------------------------------------------------------------------------------- $this->standard_coursemodule_elements(); //------------------------------------------------------------------------------- - // buttons +// buttons $this->add_action_buttons(); - } + } } -?> \ No newline at end of file +?> diff --git a/mod/forum/post.php b/mod/forum/post.php index d36759dba9cb1..c7ef23f0089d6 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -635,7 +635,7 @@ if ($post->parent) { $crumbs[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'activityinstance'); $crumbs[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'action'); - } else { + } else { $crumbs[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'action'); } diff --git a/mod/hotpot/db/update_to_v2.php b/mod/hotpot/db/update_to_v2.php index 4b8441eb216a3..d5935b6410f0f 100644 --- a/mod/hotpot/db/update_to_v2.php +++ b/mod/hotpot/db/update_to_v2.php @@ -10,7 +10,7 @@ function hotpot_update_to_v2_2() { $index = "{$CFG->prefix}{$table}_{$field}_idx"; } else { $index = "{$table}_{$field}_idx"; - } + } hotpot_db_delete_index("{$CFG->prefix}$table", $index); // add new hotpot_questions.md5key field (and index) @@ -34,7 +34,7 @@ function hotpot_update_to_v2_2() { $index = "{$CFG->prefix}{$table}_{$field}_idx"; } else { $index = "{$table}_{$field}_idx"; - } + } hotpot_db_delete_index("{$CFG->prefix}$table", $index); // add new hotpot_strings.md5key field (and index) diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index e80f3dcfc1f34..35eb2e01b59b2 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -341,9 +341,9 @@ // get best score if (is_numeric($totals[$hotpot->id]->maxscore)) { - $weighting = $hotpot->grade / 100; - $precision = hotpot_get_precision($hotpot); - $bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade"; + $weighting = $hotpot->grade / 100; + $precision = hotpot_get_precision($hotpot); + $bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade"; } else { $bestscore = " "; } diff --git a/mod/hotpot/show.php b/mod/hotpot/show.php index f55a7a7db1556..a87d3318cff0a 100644 --- a/mod/hotpot/show.php +++ b/mod/hotpot/show.php @@ -50,9 +50,9 @@ function copy_contents(id) { print htmlspecialchars($hp->source); break; case 'showxmltree': - if (isset($hp->xml)) { - print_r($hp->xml); - } + if (isset($hp->xml)) { + print_r($hp->xml); + } break; case 'showhtmlsource': print htmlspecialchars($hp->html); diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index 9ec4861c1be57..5f42d9c8a2673 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -283,7 +283,7 @@ for ($i=0; $i<$count; $i++) { if ($pageid) { $styles .= str_replace('TheBody', $pageid, $matches[0][$i])."\n"; - } + } $head = str_replace($matches[0][$i], '', $head); } } @@ -295,7 +295,7 @@ for ($i=0; $i<$count; $i++) { if ($pageid) { $scripts .= str_replace('TheBody', $pageid, $matches[0][$i])."\n"; - } + } $head = str_replace($matches[0][$i], '', $head); } } @@ -308,7 +308,7 @@ $body = $matches[5]; // contents of first ... block if ($pageid) { $body_tags = str_replace(' id="TheBody"', '', $matches[1]); - } + } // workaround to ensure javascript onload routine for quiz is always executed // $body_tags will only be inserted into the tag // if it is included in the theme/$CFG->theme/header.html, diff --git a/mod/journal/mod_form.php b/mod/journal/mod_form.php index c2a6358526f02..942402a8b9cc9 100644 --- a/mod/journal/mod_form.php +++ b/mod/journal/mod_form.php @@ -3,21 +3,21 @@ class mod_journal_mod_form extends moodleform_mod { - function definition() { + function definition() { - global $COURSE; - $mform =& $this->_form; + global $COURSE; + $mform =& $this->_form; //------------------------------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('journalname', 'journal'), array('size'=>'64')); - $mform->setType('name', PARAM_TEXT); - $mform->addRule('name', null, 'required', null, 'client'); + $mform->setType('name', PARAM_TEXT); + $mform->addRule('name', null, 'required', null, 'client'); - $mform->addElement('htmleditor', 'intro', get_string('journalquestion', 'journal')); - $mform->setType('intro', PARAM_RAW); - $mform->addRule('intro', get_string('required'), 'required', null, 'client'); + $mform->addElement('htmleditor', 'intro', get_string('journalquestion', 'journal')); + $mform->setType('intro', PARAM_RAW); + $mform->addRule('intro', get_string('required'), 'required', null, 'client'); $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); @@ -43,14 +43,14 @@ function definition() { } //------------------------------------------------------------------------------- - $this->standard_coursemodule_elements(); + $this->standard_coursemodule_elements(); //------------------------------------------------------------------------------- - // buttons +// buttons $this->add_action_buttons(); - } + } } -?> \ No newline at end of file +?> diff --git a/mod/label/mod_form.php b/mod/label/mod_form.php index dcc59ee31f864..c51f4e4530fb0 100644 --- a/mod/label/mod_form.php +++ b/mod/label/mod_form.php @@ -3,24 +3,24 @@ class mod_label_mod_form extends moodleform_mod { - function definition() { + function definition() { - $mform =& $this->_form; + $mform =& $this->_form; - $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64')); - $mform->setType('content', PARAM_RAW); - $mform->addRule('content', get_string('required'), 'required', null, 'client'); + $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64')); + $mform->setType('content', PARAM_RAW); + $mform->addRule('content', get_string('required'), 'required', null, 'client'); $mform->setHelpButton('content', array('questions', 'richtext'), false, 'editorhelpbutton'); - $this->standard_hidden_coursemodule_elements(); + $this->standard_hidden_coursemodule_elements(); $mform->addElement('modvisible', 'visible', get_string('visible')); //------------------------------------------------------------------------------- - // buttons +// buttons $this->add_action_buttons(); - } + } } -?> \ No newline at end of file +?> diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index afa6e5c146b21..629736b899f81 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -12,17 +12,17 @@ require_once('locallib.php'); class mod_lesson_mod_form extends moodleform_mod { - function definition() { + function definition() { - global $LESSON_NEXTPAGE_ACTION, $COURSE; - $mform =& $this->_form; + global $LESSON_NEXTPAGE_ACTION, $COURSE; + $mform =& $this->_form; //------------------------------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('name'), array('size'=>'64')); - $mform->setType('name', PARAM_TEXT); - $mform->addRule('name', null, 'required', null, 'client'); + $mform->setType('name', PARAM_TEXT); + $mform->addRule('name', null, 'required', null, 'client'); $mform->addElement('selectyesno', 'timed', get_string('timed', 'lesson')); $mform->setDefault('timed', 0); @@ -32,7 +32,7 @@ function definition() { $mform->setDefault('maxtime', 20); $mform->addRule('maxtime', null, 'required', null, 'client'); $mform->addRule('maxtime', null, 'numeric', null, 'client'); - $mform->setType('maxtime', PARAM_INT); + $mform->setType('maxtime', PARAM_INT); $numbers = array(); for ($i=20; $i>1; $i--) { @@ -132,20 +132,20 @@ function definition() { $mform->addRule('width', null, 'required', null, 'client'); $mform->addRule('width', null, 'numeric', null, 'client'); $mform->setHelpButton('width', array('width', get_string('slideshowwidth', 'lesson'), 'lesson')); - $mform->setType('width', PARAM_INT); + $mform->setType('width', PARAM_INT); $mform->addElement('text', 'height', get_string('slideshowheight', 'lesson')); $mform->setDefault('height', 20); $mform->addRule('height', null, 'required', null, 'client'); $mform->addRule('height', null, 'numeric', null, 'client'); $mform->setHelpButton('height', array('height', get_string('slideshowheight', 'lesson'), 'lesson')); - $mform->setType('height', PARAM_INT); + $mform->setType('height', PARAM_INT); $mform->addElement('text', 'bgcolor', get_string('slideshowbgcolor', 'lesson')); $mform->setDefault('bgcolor', '#FFFFFF'); $mform->addRule('bgcolor', null, 'required', null, 'client'); $mform->setHelpButton('bgcolor', array('bgcolor', get_string('slideshowbgcolor', 'lesson'), 'lesson')); - $mform->setType('bgcolor', PARAM_TEXT); + $mform->setType('bgcolor', PARAM_TEXT); $mform->addElement('selectyesno', 'displayleft', get_string('displayleftmenu', 'lesson')); $mform->setHelpButton('displayleft', array('displayleft', get_string('displayleftmenu', 'lesson'), 'lesson')); @@ -174,7 +174,7 @@ function definition() { $mform->setHelpButton('password', array('password', get_string('password', 'lesson'), 'lesson')); $mform->setDefault('password', ''); //never displayed converted to md5 - $mform->setType('password', PARAM_RAW); + $mform->setType('password', PARAM_RAW); $mform->addElement('date_time_selector', 'available', get_string('available', 'lesson')); $mform->setDefault('available', 0); @@ -182,7 +182,7 @@ function definition() { $mform->addElement('date_time_selector', 'deadline', get_string('deadline', 'lesson')); $mform->setDefault('deadline', 0); - //------------------------------------------------------------------------------- +//------------------------------------------------------------------------------- $mform->addElement('header', '', get_string('dependencyon', 'lesson')); $options = array(0=>get_string('none')); @@ -200,14 +200,14 @@ function definition() { $mform->addElement('text', 'timespent', get_string('timespentminutes', 'lesson')); $mform->setDefault('timespent', 0); - $mform->setType('timespent', PARAM_INT); + $mform->setType('timespent', PARAM_INT); $mform->addElement('checkbox', 'completed', get_string('completed', 'lesson')); $mform->setDefault('completed', 0); $mform->addElement('text', 'gradebetterthan', get_string('gradebetterthan', 'lesson')); $mform->setDefault('gradebetterthan', 0); - $mform->setType('gradebetterthan', PARAM_INT); + $mform->setType('gradebetterthan', PARAM_INT); //------------------------------------------------------------------------------- $mform->addElement('header', '', get_string('mediafile', 'lesson')); @@ -215,7 +215,7 @@ function definition() { $mform->addElement('choosecoursefile', 'mediafile', get_string('mediafile', 'lesson'), array('courseid'=>$COURSE->id)); $mform->setHelpButton('mediafile', array('mediafile', get_string('mediafile', 'lesson'), 'lesson')); $mform->setDefault('mediafile', ''); - $mform->setType('mediafile', PARAM_PATH); + $mform->setType('mediafile', PARAM_PATH); $mform->addElement('selectyesno', 'mediaclose', get_string('mediaclose', 'lesson')); $mform->setDefault('mediaclose', 0); @@ -225,14 +225,14 @@ function definition() { $mform->setDefault('mediaheight', 100); $mform->addRule('mediaheight', null, 'required', null, 'client'); $mform->addRule('mediaheight', null, 'numeric', null, 'client'); - $mform->setType('mediaheight', PARAM_INT); + $mform->setType('mediaheight', PARAM_INT); $mform->addElement('text', 'mediawidth', get_string('mediawidth', 'lesson')); $mform->setHelpButton('mediawidth', array('mediawidth', get_string('mediawidth', 'lesson'), 'lesson')); $mform->setDefault('mediawidth', 650); $mform->addRule('mediawidth', null, 'required', null, 'client'); $mform->addRule('mediawidth', null, 'numeric', null, 'client'); - $mform->setType('mediawidth', PARAM_INT); + $mform->setType('mediawidth', PARAM_INT); //------------------------------------------------------------------------------- $mform->addElement('header', '', get_string('other', 'lesson')); @@ -264,22 +264,22 @@ function definition() { $mform->setDefault('maxhighscores', 10); $mform->addRule('maxhighscores', null, 'required', null, 'client'); $mform->addRule('maxhighscores', null, 'numeric', null, 'client'); - $mform->setType('maxhighscores', PARAM_INT); + $mform->setType('maxhighscores', PARAM_INT); $mform->addElement('selectyesno', 'lessondefault', get_string('lessondefault', 'lesson')); $mform->setHelpButton('lessondefault', array('lessondefault', get_string('lessondefault', 'lesson'), 'lesson')); $mform->setDefault('lessondefault', 0); //------------------------------------------------------------------------------- - $this->standard_coursemodule_elements(false); + $this->standard_coursemodule_elements(false); //------------------------------------------------------------------------------- - // buttons +// buttons $this->add_action_buttons(); - } + } - function data_preprocessing(&$default_values){ + function data_preprocessing(&$default_values){ if (isset($default_values['conditions'])) { $conditions = unserialize($default_values['conditions']); $default_values['timespent'] = $conditions->timespent; @@ -289,6 +289,6 @@ function data_preprocessing(&$default_values){ if (isset($default_values['password'])) { unset($default_values['password']); } - } + } } ?> diff --git a/mod/scorm/datamodels/scorm_12lib.php b/mod/scorm/datamodels/scorm_12lib.php index 4f6d1adbd857e..9a18e7b710c49 100644 --- a/mod/scorm/datamodels/scorm_12lib.php +++ b/mod/scorm/datamodels/scorm_12lib.php @@ -219,7 +219,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n } } else{ - $isvisible = true; + $isvisible = true; } if ($parents[$level]!=$sco->parent) { if ($newlevel = array_search($sco->parent,$parents)) { diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index 4da317c8186e3..d421d97af74fd 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -200,7 +200,7 @@ function xmldb_scorm_upgrade($oldversion=0) { $result = $result && create_table($table); } - //Adding new field to table scorm + //Adding new field to table scorm if ($result && $oldversion < 2007011800) { /// Define field format to be added to data_comments diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 5a12e2166ef5b..833ce18ed1db3 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -210,9 +210,9 @@ function scorm_get_sco($id,$what=SCO_ALL) { $sco = ($what == SCO_DATA) ? new stdClass() : $sco; if (($what != SCO_ONLY) && ($scodatas = get_records('scorm_scoes_data','scoid',$id))) { foreach ($scodatas as $scodata) { - $sco->{$scodata->name} = $scodata->value; + $sco->{$scodata->name} = $scodata->value; } - } + } elseif (($what != SCO_ONLY) && (!($scodatas = get_records('scorm_scoes_data','scoid',$id)))){ $sco->parameters = ''; } @@ -551,7 +551,6 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') { $scorm->version = 'scorm_12'; } require_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php'); - $result = scorm_get_toc($user,$scorm,'structlist',$orgidentifier); $incomplete = $result->incomplete; @@ -564,7 +563,7 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') { hidebrowse == 0) { print_string('mode','scorm'); - echo ''."\n"; + echo ''."\n"; echo ': '."\n"; echo '\n"; } else { @@ -595,7 +594,7 @@ function scorm_simple_play($scorm,$user) { if ($scorm->skipview >= 1) { $sco = current($scoes); if (scorm_get_tracks($sco->id,$user->id) === false) { - header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id); + header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id); $result = true; } else if ($scorm->skipview == 2) { header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id); diff --git a/mod/scorm/player.php b/mod/scorm/player.php index d4c6e91c908d3..7790dad0f7ef4 100755 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -14,7 +14,7 @@ $mode = optional_param('mode', 'normal', PARAM_ALPHA); // navigation mode $currentorg = optional_param('currentorg', '', PARAM_RAW); // selected organization $newattempt = optional_param('newattempt', 'off', PARAM_ALPHA); // the user request to start a new attempt - + if (!empty($id)) { if (! $cm = get_coursemodule_from_id('scorm', $id)) { error("Course Module ID was incorrect"); diff --git a/theme/chameleon/ui/chameleon_js.php b/theme/chameleon/ui/chameleon_js.php index 94c3e8208cd63..5368180a59226 100644 --- a/theme/chameleon/ui/chameleon_js.php +++ b/theme/chameleon/ui/chameleon_js.php @@ -302,7 +302,7 @@ if (!CSS.__remoteSaveRequired) { UI.statusMsg('There are no changes that need saving!', 'chameleon-notice'); return; - } + } var css = CSS.toString(CSS.__localCSS); @@ -596,7 +596,7 @@ var hasBorder = false; var col = false; var importantBorders = []; - + var dec = '{\n'; for (var prop in css) { @@ -1775,8 +1775,8 @@ var pseudoClasses = ['link', 'active', 'visited', 'hover', 'focus']; while (n--) { - var row = n % 2; - + var row = n % 2; + var item = Util.createElement('li'); item.className = 'row' + row; var tag = Util.createElement('span', 'chameleon-tag-name-' + n);