MDL-9742 Converting tabs to spaces

This commit is contained in:
poltawski 2007-05-08 15:44:37 +00:00
parent a044c05ddb
commit e73457e4ba
16 changed files with 97 additions and 98 deletions

View File

@ -4,35 +4,35 @@ require_once($CFG->libdir.'/formslib.php');
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;
}
}
}
?>

View File

@ -3,22 +3,22 @@ require_once ('moodleform_mod.php');
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 @@ class mod_chat_mod_form extends moodleform_mod {
$this->standard_coursemodule_elements();
$this->add_action_buttons();
}
}
}
?>
?>

View File

@ -3,19 +3,19 @@ require_once ('moodleform_mod.php');
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 @@ class mod_exercise_mod_form extends moodleform_mod {
//-------------------------------------------------------------------------------
$this->standard_coursemodule_elements();
//-------------------------------------------------------------------------------
// buttons
// buttons
$this->add_action_buttons();
}
}
}
?>
?>

View File

@ -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');
}

View File

@ -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)

View File

@ -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 = " ";
}

View File

@ -50,9 +50,9 @@
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);

View File

@ -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 <body onload="StartUp()">...</body> 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 <body ...> tag
// if it is included in the theme/$CFG->theme/header.html,

View File

@ -3,21 +3,21 @@ require_once ('moodleform_mod.php');
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 @@ class mod_journal_mod_form extends moodleform_mod {
}
//-------------------------------------------------------------------------------
$this->standard_coursemodule_elements();
$this->standard_coursemodule_elements();
//-------------------------------------------------------------------------------
// buttons
// buttons
$this->add_action_buttons();
}
}
}
?>
?>

View File

@ -3,24 +3,24 @@ require_once ('moodleform_mod.php');
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();
}
}
}
?>
?>

View File

@ -12,17 +12,17 @@ require_once ('moodleform_mod.php');
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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
$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 @@ class mod_lesson_mod_form extends moodleform_mod {
if (isset($default_values['password'])) {
unset($default_values['password']);
}
}
}
}
?>

View File

@ -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)) {

View File

@ -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

View File

@ -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='') {
<?php
if ($scorm->hidebrowse == 0) {
print_string('mode','scorm');
echo '<input type="hidden" name="scoid" value="$sco->id" />'."\n";
echo '<input type="hidden" name="scoid" value="$sco->id" />'."\n";
echo ': <input type="radio" id="b" name="mode" value="browse" /><label for="b">'.get_string('browse','scorm').'</label>'."\n";
echo '<input type="radio" id="n" name="mode" value="normal" checked="checked" /><label for="n">'.get_string('normal','scorm')."</label>\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);

View File

@ -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");

View File

@ -302,7 +302,7 @@ String.prototype.trim = function() {
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 @@ String.prototype.trim = function() {
var hasBorder = false;
var col = false;
var importantBorders = [];
var dec = '{\n';
for (var prop in css) {
@ -1775,8 +1775,8 @@ String.prototype.trim = function() {
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);