From aa6c1ced0a9669115f6d7e97f22e9556b61ca81a Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 4 Nov 2009 08:11:02 +0000 Subject: [PATCH] MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup --- calendar/event_form.php | 2 +- calendar/export.php | 2 +- calendar/lib.php | 28 +- calendar/preferences.html | 12 +- calendar/view.php | 96 +- course/completion.js | 10 +- course/delete_category_form.php | 4 +- course/edit.php | 1 - course/edit_form.php | 6 +- course/editcategory.php | 2 +- course/editcategory_form.php | 6 +- course/editsection_form.php | 2 +- course/enrol.php | 1 - course/external.php | 4 +- course/format/README.txt | 86 +- course/format/scorm/config.php | 4 +- course/format/scorm/format.php | 4 +- course/format/scorm/lib.php | 2 +- course/format/social/config.php | 4 +- course/format/social/format.php | 2 +- course/format/social/lib.php | 2 +- course/format/topics/ajax.php | 2 +- course/format/topics/config.php | 3 +- course/format/topics/format.php | 12 +- course/format/topics/lib.php | 2 +- course/format/weeks/ajax.php | 2 +- course/format/weeks/config.php | 3 +- course/format/weeks/format.php | 22 +- course/format/weeks/lib.php | 2 +- course/import.php | 2 +- course/import/activities/import_form.php | 4 +- course/import/activities/index.php | 1 - course/import/activities/mod.php | 4 +- course/import/groups/import_form.php | 4 +- course/import/groups/index.php | 1 - course/import/groups/mod.php | 1 - course/importstudents.html | 6 +- course/importstudents.php | 2 +- course/info.php | 4 +- course/jumpto.php | 3 +- course/lib.php | 14 +- course/loginas.php | 4 +- course/mod.php | 2 +- course/modedit.php | 6 +- course/moodleform_mod.php | 56 +- course/pending.php | 4 +- course/recent.php | 1 - course/recent_form.php | 2 +- course/report.php | 4 +- course/report/log/db/access.php | 4 +- course/report/log/graph.php | 1 - course/report/log/index.php | 4 +- course/report/log/indexlive.php | 6 +- course/report/log/lib.php | 30 +- course/report/log/live.php | 8 +- course/report/log/mod.php | 6 +- course/report/log/version.php | 4 +- course/report/outline/db/access.php | 4 +- course/report/outline/index.php | 2 +- course/report/outline/mod.php | 3 +- course/report/outline/version.php | 4 +- course/report/participation/db/access.php | 4 +- course/report/participation/index.php | 8 +- course/report/participation/mod.php | 4 +- course/report/participation/version.php | 4 +- course/report/progress/db/access.php | 4 +- course/report/progress/index.php | 2 +- course/report/progress/mod.php | 4 +- course/report/progress/textrotate.js | 12 +- course/report/progress/version.php | 4 +- course/report/stats/db/access.php | 4 +- course/report/stats/graph.php | 1 - course/report/stats/index.php | 4 +- course/report/stats/mod.php | 4 +- course/report/stats/report.php | 4 +- course/report/stats/version.php | 4 +- course/request.php | 2 +- course/request_form.php | 2 +- course/reset.php | 2 +- course/reset_form.php | 2 +- course/resources.php | 4 +- course/rest.php | 2 +- course/scales.php | 1 - course/search.php | 8 +- course/simpletest/broken_testexternal.php | 6 +- course/simpletest/testcourselib.php | 2 +- course/switchrole.php | 1 - course/togglecompletion.php | 1 - course/unenrol.php | 1 - course/user.php | 1 - course/view.php | 18 +- repository/repository_ajax.php | 2 +- theme/anomaly/config.php | 62 +- theme/anomaly/footer.html | 16 +- theme/anomaly/header.html | 2 +- theme/chameleon/README.html | 20 +- theme/chameleon/config.php | 64 +- theme/chameleon/footer.html | 2 +- theme/chameleon/pix/mod/README.txt | 4 +- theme/chameleon/styles_ie7.css | 2 +- theme/chameleon/ui/ChameleonCSS.class.php | 42 +- .../ui/ChameleonFileBrowser.class.php | 16 +- theme/chameleon/ui/chameleon.php | 6 +- theme/chameleon/ui/chameleon_js.php | 926 +++++++++--------- theme/chameleon/ui/chameleon_ui.css | 20 +- theme/chameleon/ui/css.php | 2 +- theme/chameleon/ui/sarissa.js | 60 +- theme/chameleon/user_styles.css | 6 +- theme/colors/colors.css | 24 +- theme/colors/config.php | 58 +- theme/colors/footer.html | 6 +- theme/colors/gradients.css | 8 +- theme/colors/header.html | 10 +- theme/colors/js/CSSClass.js | 2 +- theme/colors/js/js.php | 12 +- theme/colors/pix/mod/README.txt | 4 +- theme/cornflower/config.php | 47 +- theme/cornflower/cornflower.css | 50 +- theme/custom_corners/config.php | 2 +- theme/custom_corners/footer.html | 12 +- theme/custom_corners/header.html | 14 +- theme/custom_corners/js/CSSClass.js | 2 +- theme/custom_corners/js/js.php | 10 +- theme/custom_corners/user_styles.css | 4 +- theme/formal_white/config.php | 60 +- theme/formal_white/fw_color.css | 40 +- theme/formal_white/fw_fonts.css | 8 +- theme/formal_white/fw_layout.css | 50 +- theme/index.php | 2 +- theme/lines/config.php | 58 +- theme/lines/footer.html | 6 +- theme/lines/header.html | 10 +- theme/lines/js/CSSClass.js | 2 +- theme/lines/js/js.php | 12 +- theme/lines/js/yui.php | 4 +- theme/lines/lines.css | 22 +- theme/metal/README.txt | 2 +- theme/metal/colors.css | 44 +- theme/metal/config.php | 50 +- theme/metal/gradients.css | 10 +- theme/oceanblue/config.php | 48 +- theme/oceanblue/styles_color.css | 10 +- theme/orangewhite/config.php | 48 +- theme/orangewhite/csshover.htc | 10 +- theme/orangewhite/styles_color.css | 22 +- theme/orangewhite/styles_fonts.css | 8 +- theme/orangewhite/styles_layout.css | 16 +- theme/orangewhitepda/config.php | 46 +- theme/orangewhitepda/styles_pda.css | 20 +- theme/standard/README.html | 2 +- theme/standard/rtl.css | 12 +- theme/standard/styles_color.css | 50 +- theme/standard/styles_layout.css | 4 +- theme/standardblue/config.php | 50 +- theme/standardblue/gradients.css | 14 +- theme/standardgreen/config.php | 50 +- theme/standardgreen/gradients.css | 14 +- theme/standardlogo/config.php | 50 +- theme/standardred/config.php | 50 +- theme/standardred/gradients.css | 14 +- theme/standardwhite/config.php | 12 +- theme/standardwhite/footer.html | 4 +- theme/standardwhite/gradients.css | 14 +- theme/styles.php | 2 +- theme/wood/README.html | 12 +- theme/wood/config.php | 50 +- theme/wood/styles_color.css | 8 +- user/action_redir.php | 1 - user/addnote.php | 2 +- user/edit.php | 1 - user/edit_form.php | 2 +- user/editadvanced.php | 1 - user/editadvanced_form.php | 4 +- user/editlib.php | 4 +- user/extendenrol.php | 4 +- user/external.php | 8 +- user/filters/courserole.php | 2 +- user/filters/date.php | 3 +- user/filters/globalrole.php | 2 +- user/filters/lib.php | 6 +- user/filters/profilefield.php | 18 +- user/filters/select.php | 2 +- user/filters/simpleselect.php | 2 +- user/filters/text.php | 2 +- user/filters/user_filter_forms.php | 2 +- user/filters/yesno.php | 2 +- user/groupextendenrol.php | 2 +- user/index.php | 20 +- user/messageselect.php | 1 - user/policy.php | 1 - user/portfolio.php | 1 - user/portfoliologs.php | 2 +- user/profile/definelib.php | 4 +- user/profile/field/checkbox/define.class.php | 4 +- user/profile/field/checkbox/field.class.php | 6 +- user/profile/field/menu/define.class.php | 4 +- user/profile/field/menu/field.class.php | 4 +- user/profile/field/text/define.class.php | 4 +- user/profile/field/text/field.class.php | 4 +- user/profile/field/textarea/define.class.php | 2 +- user/profile/field/textarea/field.class.php | 2 +- user/profile/index.php | 4 +- user/profile/index_category_form.php | 4 +- user/profile/index_field_form.php | 4 +- user/profile/lib.php | 18 +- user/repository.php | 2 +- user/selector/lib.php | 11 +- user/selector/script.js | 14 +- user/selector/search.php | 1 - user/tabs.php | 4 +- user/view.php | 4 +- 211 files changed, 1677 insertions(+), 1704 deletions(-) diff --git a/calendar/event_form.php b/calendar/event_form.php index 890439253fce4..157c0b4c7d28d 100644 --- a/calendar/event_form.php +++ b/calendar/event_form.php @@ -30,7 +30,7 @@ /** * The mform class for creating and editing a calendar - * + * * @copyright 2009 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/calendar/export.php b/calendar/export.php index e6f7983bef3b2..e3ef48ce0203a 100644 --- a/calendar/export.php +++ b/calendar/export.php @@ -56,7 +56,7 @@ $mon = optional_param('cal_m', 0, PARAM_INT); $yr = optional_param('cal_y', 0, PARAM_INT); if ($courseid = optional_param('course', 0, PARAM_INT)) { - $course = $DB->get_record('course', array('id'=>$courseid)); + $course = $DB->get_record('course', array('id'=>$courseid)); } else { $course = NULL; } diff --git a/calendar/lib.php b/calendar/lib.php index 1102ada551997..ec291bdf172b4 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -452,7 +452,7 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve } if ($event->modulename == 'assignment'){ // TODO: rewrite this hack somehow - if (!calendar_edit_event_allowed($event)){ // cannot manage entries, eg. student + if (!calendar_edit_event_allowed($event)){ // cannot manage entries, eg. student if (!$assignment = $DB->get_record('assignment', array('id'=>$event->instance))) { // print_error("invalidid", 'assignment'); continue; @@ -572,9 +572,9 @@ function calendar_print_event($event, $showactions=true) { if (isset($event->cssclass)) { echo ''; } else { - echo ''; + echo ''; } - + echo $event->description; if (calendar_edit_event_allowed($event) && $showactions) { echo '
'; @@ -860,7 +860,7 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL, $courses } else { $content .= ''.get_string('hide').''; $content .= ''.get_string('course', 'calendar').''."\n"; - + } @@ -1190,7 +1190,7 @@ function calendar_session_vars($course=null) { if ($course !== null) { // speedup hack for calendar related blocks $SESSION->cal_courses_shown = array($course->id => $course); - } else { + } else { $SESSION->cal_courses_shown = calendar_get_default_courses(true); } if(empty($SESSION->cal_users_shown)) { @@ -1219,9 +1219,9 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU $SESSION->cal_courses_shown = intval($SESSION->cal_courses_shown); } if($courseeventsfrom === NULL) { - $courseeventsfrom = $SESSION->cal_courses_shown; + $courseeventsfrom = $SESSION->cal_courses_shown; } - + // MDL-9059, $courseeventsfrom can be an int, or an array of ints, or an array of course objects // convert all to array of objects // we probably should do some clean up and make sure that session is set to use the proper form @@ -1233,8 +1233,8 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU foreach ($courseeventsfrom as $i=>$courseid) { // TODO: this seems wrong, the array is often constructed as [courseid] => 1 ??? if (is_int($courseid)) { $courseeventsfrom[$i] = $DB->get_record('course', array('id'=>$courseid)); - } - } + } + } } if($groupeventsfrom === NULL) { @@ -1325,7 +1325,7 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU $courserecord = $courseeventsfrom[$courseid]; } else { $courserecord = $DB->get_record('course', array('id'=>$courseid)); - } + } $courserecord = $DB->get_record('course', array('id'=>$courseid)); if ($courserecord->groupmode != NOGROUPS || !$courserecord->groupmodeforce) { $groupids[] = $courseid; @@ -1592,7 +1592,7 @@ function calendar_get_allowed_types(&$allowed) { if(has_capability('moodle/calendar:manageentries', $coursecontext)) { $allowed->courses = array($course->id => 1); - + if($course->groupmode != NOGROUPS || !$course->groupmodeforce) { $allowed->groups = groups_get_all_groups($SESSION->cal_course_referer); } @@ -1877,7 +1877,7 @@ protected function get_description() { /** * Return the number of repeat events there are in this events series - * + * * @return int */ public function count_repeats() { @@ -1965,7 +1965,7 @@ public function update($data) { $DB->set_field('event', 'description', $this->properties->description, array('id'=>$this->properties->id)); } - + // Log the event entry. add_to_log($this->properties->courseid, 'calendar', 'add', 'event.php?action=edit&id='.$this->properties->id, $this->properties->name); @@ -2209,7 +2209,7 @@ public function properties($prepareeditor=false) { } else { $draftiddescription = 0; } - + // Structure the description field as the editor requires $properties->description = array('text'=>$properties->description, 'format'=>$properties->format, 'itemid'=>$draftiddescription); } diff --git a/calendar/preferences.html b/calendar/preferences.html index ea6da9921eb70..8ca47f1beaf03 100644 --- a/calendar/preferences.html +++ b/calendar/preferences.html @@ -10,7 +10,7 @@ $options[CALENDAR_TF_12] = get_string('timeformat_12', 'calendar'); $options[CALENDAR_TF_24] = get_string('timeformat_24', 'calendar'); $select = html_select::make($options, "timeformat", $prefs->timeformat, false); - $select->nothingvalue = ''; + $select->nothingvalue = ''; echo $OUTPUT->select($select); ?>

@@ -30,7 +30,7 @@ $options[5] = get_string('friday', 'calendar'); $options[6] = get_string('saturday', 'calendar'); $select = html_select::make($options, 'startwday', $prefs->startwday, false); - $select->nothingvalue = ''; + $select->nothingvalue = ''; echo $OUTPUT->select($select); ?>

@@ -46,7 +46,7 @@ $options[$i] = $i; } $select = html_select::make($options, "maxevents", $prefs->maxevents, false); - $select->nothingvalue = ''; + $select->nothingvalue = ''; echo $OUTPUT->select($select); ?>

@@ -62,7 +62,7 @@ $options[$i] = $i; } $select = html_select::make($options, "lookahead", $prefs->lookahead, false); - $select->nothingvalue = ''; + $select->nothingvalue = ''; echo $OUTPUT->select($select); ?>

@@ -72,9 +72,9 @@ : - get_string('no'), 1 => get_string('yes')), 'persistflt', $prefs->persistflt, false); - $select->nothingvalue = ''; + $select->nothingvalue = ''; echo $OUTPUT->select($select); ?>

diff --git a/calendar/view.php b/calendar/view.php index e02dc607296ea..8b4cbc617d891 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -399,7 +399,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course } } } - + // Extract information: events vs. time calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday, $courses); @@ -539,54 +539,54 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course echo "\n"; // Tabular display of days ends - // OK, now for the filtering display - echo '
'; - - // Global events - if($SESSION->cal_show_global) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - - // Course events - if(!empty($SESSION->cal_show_course)) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - - echo "\n"; - + // OK, now for the filtering display + echo '
'.get_string('globalevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('globalevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('courseevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('courseevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'; + + // Global events + if($SESSION->cal_show_global) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + + // Course events + if(!empty($SESSION->cal_show_course)) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + + echo "\n"; + if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) { - echo ''; - // Group events - if($SESSION->cal_show_groups) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - // User events - if($SESSION->cal_show_user) { - echo ''."\n"; - } - else { - echo ''."\n"; - } - echo "\n"; - } - + echo ''; + // Group events + if($SESSION->cal_show_groups) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + // User events + if($SESSION->cal_show_user) { + echo ''."\n"; + } + else { + echo ''."\n"; + } + echo "\n"; + } + echo '
'.get_string('globalevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('globalevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('courseevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('courseevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'.get_string('groupevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('groupevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('userevents', 'calendar').': '; - echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('userevents', 'calendar').': '; - echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'.get_string('groupevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('groupevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')'.get_string('userevents', 'calendar').': '; + echo get_string('shown', 'calendar').' ('.get_string('clickhide', 'calendar').')'.get_string('userevents', 'calendar').': '; + echo get_string('hidden', 'calendar').' ('.get_string('clickshow', 'calendar').')
'; } diff --git a/course/completion.js b/course/completion.js index 5144238d259d2..3c7dd0383daca 100644 --- a/course/completion.js +++ b/course/completion.js @@ -2,9 +2,9 @@ function completion_init() { // Check the reload-forcing var changeDetector=document.getElementById('completion_dynamic_change'); if(changeDetector.value==1) { - changeDetector.value=0; + changeDetector.value=0; window.location.reload(); - return; + return; } var toggles=YAHOO.util.Dom.getElementsByClassName('togglecompletion', 'form'); @@ -13,7 +13,7 @@ function completion_init() { completion_init_toggle(toggles[i]); } } -} +} function completion_init_toggle(form) { // Store all necessary references for easy access @@ -22,7 +22,7 @@ function completion_init_toggle(form) { switch(inputs[i].name) { case 'id' : form.cmid=inputs[i].value; break; case 'completionstate' : form.otherState=inputs[i].value; break; - } + } if(inputs[i].type=='image') { form.image=inputs[i]; } @@ -84,7 +84,7 @@ function completion_handle_failure(o) { function completion_toggle(e) { YAHOO.util.Event.preventDefault(e); - // By setting completion_wwwroot you can cause it to use absolute path + // By setting completion_wwwroot you can cause it to use absolute path // otherwise script assumes it is called from somewhere in /course var target = moodle_cfg.wwwroot + '/course/togglecompletion.php'; YAHOO.util.Connect.asyncRequest('POST',target, diff --git a/course/delete_category_form.php b/course/delete_category_form.php index 9c3fb34a8af8d..8c18dbcbb1bea 100644 --- a/course/delete_category_form.php +++ b/course/delete_category_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); require_once($CFG->libdir.'/questionlib.php'); @@ -141,4 +141,4 @@ function validation($data, $files) { return $errors; } } -?> + diff --git a/course/edit.php b/course/edit.php index ffe46964b3852..c02dcde6dfe47 100644 --- a/course/edit.php +++ b/course/edit.php @@ -163,4 +163,3 @@ echo $OUTPUT->footer(); -?> \ No newline at end of file diff --git a/course/edit_form.php b/course/edit_form.php index 859178188c1c8..a833a7260ebde 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -52,7 +52,7 @@ function definition() { $coursecontext = null; $context = $categorycontext; } - + /// form definition with new course defaults //-------------------------------------------------------------------------------- $mform->addElement('header','general', get_string('general', 'form')); @@ -114,7 +114,7 @@ function definition() { $mform->setConstants('idnumber', $course->idnumber); } - + $mform->addElement('editor','summary_editor', get_string('summary'), null, $editoroptions); $mform->setHelpButton('summary_editor', array('text2', get_string('helptext')), true); $mform->setType('summary_editor', PARAM_RAW); @@ -496,4 +496,4 @@ function validation($data, $files) { return $errors; } } -?> + diff --git a/course/editcategory.php b/course/editcategory.php index 522cc283503ec..c02e9b03602e0 100644 --- a/course/editcategory.php +++ b/course/editcategory.php @@ -116,4 +116,4 @@ $mform->display(); echo $OUTPUT->footer(); -?> + diff --git a/course/editcategory_form.php b/course/editcategory_form.php index 8da5a95803198..a5b9cdd09b6d6 100644 --- a/course/editcategory_form.php +++ b/course/editcategory_form.php @@ -1,4 +1,4 @@ -dirroot.'/course/moodleform_mod.php'); class editcategory_form extends moodleform { @@ -41,5 +41,5 @@ function definition() { $this->add_action_buttons(true, $strsubmit); } -} -?> +} + diff --git a/course/editsection_form.php b/course/editsection_form.php index ef825af0ad625..b517ec7f2498f 100644 --- a/course/editsection_form.php +++ b/course/editsection_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); diff --git a/course/enrol.php b/course/enrol.php index 7844da73a9ddc..0cce490f287d2 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -131,4 +131,3 @@ /// Easy! -?> \ No newline at end of file diff --git a/course/external.php b/course/external.php index ecd51aac93025..c3abbe370b2ed 100644 --- a/course/external.php +++ b/course/external.php @@ -689,7 +689,7 @@ static function get_course_modules($params, $type=null) { } $activities = get_array_of_activities($id); - + foreach ($activities as $activity) { if (empty($type)) { $module = array('id' => $activity->id, 'courseid' => $id, 'name' => $activity->name, 'type' => $activity->mod); @@ -746,4 +746,4 @@ static function get_course_resources($params) { } -?> + diff --git a/course/format/README.txt b/course/format/README.txt index e8fecdb5eeb79..4543dafccd95d 100644 --- a/course/format/README.txt +++ b/course/format/README.txt @@ -3,33 +3,33 @@ Course formats To create a new course format, make another folder in here. -If you want a basic format, you only need to write the 'standard files' listed -below. +If you want a basic format, you only need to write the 'standard files' listed +below. If you want to store information in the database for your format, or control access to features of your format, you need some of the optional files too. -All names below assume that your format is called 'yourformat'. +All names below assume that your format is called 'yourformat'. Standard files -------------- -* yourformat/format.php +* yourformat/format.php - Code that actually displays the course view page. See existing formats for + Code that actually displays the course view page. See existing formats for examples. - -* yourformat/config.php - Configuration file, mainly controlling default blocks for the format. +* yourformat/config.php + + Configuration file, mainly controlling default blocks for the format. See existing formats for examples. - + * yourformat/lang/en_utf8/format_yourformat.php Language file containing basic language strings for your format. Here is a minimal language file: - + requires = 2006092801; // Required Moodle version ?> - + Optional files (backup) ----------------------- @@ -94,44 +94,44 @@ the course. You can't back up the course format data independently. function yourformat_backup_format_data($bf,$preferences) { ... - + * yourformat/restorelib.php Similar to restore code for other plugins. Must have a function: - + function yourformat_restore_format_data($restore,$data) { ... - + ($data is the xmlized data underneath FORMATDATA in the backup XML file. Do print_object($data); while testing to see how it looks.) - - -Optional file (capabilities) + + +Optional file (capabilities) ---------------------------- - + If this file exists, Moodle refreshes your format's capabilities (checks that they are all included in the database) whenever you increase the version in yourformat/version.php. - + * yourformat/db/access.php - Contains capability entries similar to other access.php files. - + Contains capability entries similar to other access.php files. + The array definition must look like: - - $format_yourformat_capabilities = array( + + $format_yourformat_capabilities = array( ... - - Format names must look like: - + + Format names must look like: + format/yourformat:specialpower - + Capability definitions in your language file must look like: - + $string['yourformat:specialpower']='Revolutionise the world'; - - + + Optional file (styles) ---------------------- diff --git a/course/format/scorm/config.php b/course/format/scorm/config.php index ca02d73b12582..13bd6d636a980 100755 --- a/course/format/scorm/config.php +++ b/course/format/scorm/config.php @@ -1,4 +1,4 @@ - + diff --git a/course/format/scorm/format.php b/course/format/scorm/format.php index d92ea4f2f2ce6..465f7f7ca4d4e 100644 --- a/course/format/scorm/format.php +++ b/course/format/scorm/format.php @@ -1,4 +1,4 @@ -notification('The module '. $module. ' does not support single activity course format'); } diff --git a/course/format/scorm/lib.php b/course/format/scorm/lib.php index 01605e555d997..09eba86d80758 100644 --- a/course/format/scorm/lib.php +++ b/course/format/scorm/lib.php @@ -52,4 +52,4 @@ function callback_scorm_display_content() { return false; } -?> + diff --git a/course/format/social/config.php b/course/format/social/config.php index d2d8a9ca76a5d..d89f0e8eafbf3 100755 --- a/course/format/social/config.php +++ b/course/format/social/config.php @@ -1,4 +1,4 @@ - + diff --git a/course/format/social/format.php b/course/format/social/format.php index 659ae065b6433..65b77377e8e00 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -1,4 +1,4 @@ - + diff --git a/course/format/topics/ajax.php b/course/format/topics/ajax.php index 2280eddd8154b..0dbea4e12239f 100644 --- a/course/format/topics/ajax.php +++ b/course/format/topics/ajax.php @@ -7,4 +7,4 @@ $CFG->ajaxcapable = true; $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); -?> + diff --git a/course/format/topics/config.php b/course/format/topics/config.php index cf58f2db92760..1a429b4e45987 100755 --- a/course/format/topics/config.php +++ b/course/format/topics/config.php @@ -2,10 +2,9 @@ // // Optional course format configuration file // -// This file contains any specific configuration settings for the +// This file contains any specific configuration settings for the // format. // // The default blocks layout for this course format: $format['defaultblocks'] = ':search_forums,news_items,calendar_upcoming,recent_activity'; // -?> \ No newline at end of file diff --git a/course/format/topics/format.php b/course/format/topics/format.php index a3b20eb2de970..9a1e56a48993d 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -4,25 +4,25 @@ // Included from "view.php" /** * Evaluation topics format for course display - NO layout tables, for accessibility, etc. - * - * A duplicate course format to enable the Moodle development team to evaluate - * CSS for the multi-column layout in place of layout tables. + * + * A duplicate course format to enable the Moodle development team to evaluate + * CSS for the multi-column layout in place of layout tables. * Less risk for the Moodle 1.6 beta release. * 1. Straight copy of topics/format.php * 2. Replace and \n"; $fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id))); echo "\n";; echo "\n"; @@ -518,7 +518,7 @@ function print_mnet_log($hostid, $course, $user=0, $date=0, $order="l.time ASC", echo "\n"; $fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id))); echo ""; } -?> \ No newline at end of file diff --git a/course/view.php b/course/view.php index 562f78a239f77..7855be202ec99 100644 --- a/course/view.php +++ b/course/view.php @@ -1,4 +1,4 @@ -dirroot .'/course/externservercourse.php')) { include $CFG->dirroot .'/course/externservercourse.php'; if (function_exists('extern_server_course')) { @@ -141,7 +141,7 @@ // AJAX-capable course format? - $useajax = false; + $useajax = false; $ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php'; $bodytags = ''; @@ -178,13 +178,13 @@ $completion = new completion_info($course); if ($completion->is_enabled() && ajaxenabled()) { $PAGE->requires->yui_lib('connection')->asap(); - $PAGE->requires->js('course/completion.js')->asap(); + $PAGE->requires->js('course/completion.js')->asap(); $PAGE->requires->js_function_call('completion_init')->on_dom_ready(); $PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion')); $PAGE->requires->data_for_js('completion_strtitley', get_string('completion-title-manual-y', 'completion')); $PAGE->requires->data_for_js('completion_strtitlen', get_string('completion-title-manual-n', 'completion')); $PAGE->requires->data_for_js('completion_stralty', get_string('completion-alt-manual-y', 'completion')); - $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion')); + $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion')); } // The "Editing On" button will be appearing only in the "main" course screen @@ -242,12 +242,12 @@ // Content wrapper end. echo "\n\n"; - // Use AJAX? + // Use AJAX? if ($useajax && has_capability('moodle/course:manageactivities', $context)) { // At the bottom because we want to process sections and activities // after the relevant html has been generated. We're forced to do this - // because of the way in which lib/ajax/ajaxcourse.js is written. - + // because of the way in which lib/ajax/ajaxcourse.js is written. + echo '\n"; $COURSE->javascriptportal->print_javascript($course->id); @@ -256,4 +256,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/repository/repository_ajax.php b/repository/repository_ajax.php index c0c57f564e0cb..8887b3ecf1d72 100755 --- a/repository/repository_ajax.php +++ b/repository/repository_ajax.php @@ -1,4 +1,4 @@ -sheets = array('styles', 'styles_select'); -/// This variable is an array containing the names of all the +/// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order //////////////////////////////////////////////////////////////////////////////// -$THEME->standardsheets = true; +$THEME->standardsheets = true; /// This variable can be set to an array containing -/// filenames from the *STANDARD* theme. If the -/// array exists, it will be used to choose the +/// filenames from the *STANDARD* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color'); //////////////////////////////////////////////////////////////////////////////// -$THEME->parent = ''; +$THEME->parent = ''; /// This variable can be set to the name of a parent theme /// which you want to have included before the current theme. -/// This can make it easy to make modifications to another +/// This can make it easy to make modifications to another /// theme without having to actually change the files -/// If this variable is empty or false then a parent theme +/// If this variable is empty or false then a parent theme /// is not used. //////////////////////////////////////////////////////////////////////////////// -$THEME->parentsheets = false; +$THEME->parentsheets = false; /// This variable can be set to an array containing -/// filenames from a chosen *PARENT* theme. If the -/// array exists, it will be used to choose the +/// filenames from a chosen *PARENT* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color'); @@ -61,23 +61,23 @@ $THEME->metainclude = false; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from this theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from this theme into the /// part of the page. $THEME->standardmetainclude = true; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the standard theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the standard theme into the /// part of the page. $THEME->parentmetainclude = false; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the parent theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the parent theme into the /// part of the page. @@ -88,7 +88,7 @@ $THEME->navmenuwidth = 50; -/// You can use this to control the cutoff point for strings +/// You can use this to control the cutoff point for strings /// in the navmenus (list of activities in popup menu etc) /// Default is 50 characters wide. @@ -97,22 +97,22 @@ /// By setting this to true, then you will have access to a /// new variable in your header.html and footer.html called -/// $navmenulist ... this contains a simple XHTML menu of -/// all activities in the current course, mostly useful for +/// $navmenulist ... this contains a simple XHTML menu of +/// all activities in the current course, mostly useful for /// creating popup navigation menus and so on. -$THEME->resource_mp3player_colors = +$THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; -/// With this you can control the colours of the "big" MP3 player +/// With this you can control the colours of the "big" MP3 player /// that is used for MP3 resources. -$THEME->filter_mediaplugin_colors = +$THEME->filter_mediaplugin_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'waitForPlay=yes'; @@ -122,10 +122,10 @@ $THEME->custompix = false; -/// If true, then this theme must have a "pix" -/// subdirectory that contains copies of all +/// If true, then this theme must have a "pix" +/// subdirectory that contains copies of all /// files from the moodle/pix directory, plus a -/// "pix/mod" directory containing all the icons +/// "pix/mod" directory containing all the icons /// for all the activity modules. @@ -134,7 +134,7 @@ ///$CFG->block_search_button = link_arrow_right(get_string('search'), $url='', $accesshide=true); /// /// Accessibility: Right and left arrow-like characters are -/// used in the breadcrumb trail, course navigation menu +/// used in the breadcrumb trail, course navigation menu /// (previous/next activity), calendar, and search forum block. /// /// If the theme does not set characters, appropriate defaults @@ -143,4 +143,4 @@ /// use < > » - these are confusing for blind users. //////////////////////////////////////////////////////////////////////////////// -?> + diff --git a/theme/anomaly/footer.html b/theme/anomaly/footer.html index 153cbfe5c9502..2f9d6f927791a 100644 --- a/theme/anomaly/footer.html +++ b/theme/anomaly/footer.html @@ -10,7 +10,7 @@ @@ -55,11 +55,11 @@ diff --git a/theme/anomaly/header.html b/theme/anomaly/header.html index fa145b966d30c..671059fdff2a6 100644 --- a/theme/anomaly/header.html +++ b/theme/anomaly/header.html @@ -34,7 +34,7 @@ if ($home) { // This is what gets printed on the home page only ?> container_start('clearfix header-home'); ?> - +
diff --git a/theme/chameleon/README.html b/theme/chameleon/README.html index a6a1bb8ed26ef..7303d0295db20 100644 --- a/theme/chameleon/README.html +++ b/theme/chameleon/README.html @@ -2,15 +2,15 @@

Chameleon, the flexible Moodle theme.

- Chameleon is a Moodle theme with an option to interactively change your theme within your browser page. - You click on an element to change it's style. Please read the - Chameleon Moodle Docs explanation + Chameleon is a Moodle theme with an option to interactively change your theme within your browser page. + You click on an element to change it's style. Please read the + Chameleon Moodle Docs explanation for more information about Chameleon's interactive theme work.

- To enable editing you change "$THEME->chameleonenabled = false;" in the config.php file - in your Chameleon theme folder to true. It is recommended to change "$THEME->chameleonenabled = true;" - back to false again once you're satisfied with your theme because the editing engine loads several + To enable editing you change "$THEME->chameleonenabled = false;" in the config.php file + in your Chameleon theme folder to true. It is recommended to change "$THEME->chameleonenabled = true;" + back to false again once you're satisfied with your theme because the editing engine loads several extra files into the browser. Therefore the page loading speed is reduced.

@@ -19,14 +19,14 @@

- If you want to hand code styles you must not write hooks as comma separated lists of elements like + If you want to hand code styles you must not write hooks as comma separated lists of elements like

-td#middle-column div.bt, 
+td#middle-column div.bt,
 div#middle-column div.bt {
     ...
 }
 
- in Chameleon themes because the Chameleon engine can't handle these comma lists. + in Chameleon themes because the Chameleon engine can't handle these comma lists. Please write two separate statements instead.
 td#middle-column div.bt {
@@ -39,6 +39,6 @@ 

- A Moodle Theme from Urs Hunkler, unodo + A Moodle Theme from Urs Hunkler, unodo and Andrew Walker, Alton College.

\ No newline at end of file diff --git a/theme/chameleon/config.php b/theme/chameleon/config.php index 6c6c01b7a8900..19c5efaaafe72 100644 --- a/theme/chameleon/config.php +++ b/theme/chameleon/config.php @@ -1,14 +1,14 @@ -sheets = array('user_styles'); -/// This variable is an array containing the names of all the +/// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order //////////////////////////////////////////////////////////////////////////////// @@ -16,38 +16,38 @@ $THEME->standardsheets = array('styles_layout', 'styles_color'); /// This variable can be set to an array containing -/// filenames from the *STANDARD* theme. If the -/// array exists, it will be used to choose the +/// filenames from the *STANDARD* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color'); //////////////////////////////////////////////////////////////////////////////// -$THEME->parent = ''; +$THEME->parent = ''; /// This variable can be set to the name of a parent theme /// which you want to have included before the current theme. -/// This can make it easy to make modifications to another +/// This can make it easy to make modifications to another /// theme without having to actually change the files -/// If this variable is empty or false then a parent theme +/// If this variable is empty or false then a parent theme /// is not used. //////////////////////////////////////////////////////////////////////////////// -$THEME->parentsheets = false; +$THEME->parentsheets = false; /// This variable can be set to an array containing -/// filenames from a chosen *PARENT* theme. If the -/// array exists, it will be used to choose the +/// filenames from a chosen *PARENT* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color'); @@ -62,28 +62,28 @@ $THEME->metainclude = true; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from this theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from this theme into the /// part of the page. $THEME->standardmetainclude = true; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the standard theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the standard theme into the /// part of the page. $THEME->parentmetainclude = false; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the parent theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the parent theme into the /// part of the page. $THEME->navmenuwidth = 50; -/// You can use this to control the cutoff point for strings +/// You can use this to control the cutoff point for strings /// in the navmenus (list of activities in popup menu etc) /// Default is 50 characters wide. @@ -92,34 +92,34 @@ /// By setting this to true, then you will have access to a /// new variable in your header.html and footer.html called -/// $navmenulist ... this contains a simple XHTML menu of -/// all activities in the current course, mostly useful for +/// $navmenulist ... this contains a simple XHTML menu of +/// all activities in the current course, mostly useful for /// creating popup navigation menus and so on. $THEME->chameleonenabled = false; /// By setting this to true it enables editing of the stylsheets. -/// It is recommended to set this to false again once you're +/// It is recommended to set this to false again once you're /// satisfied with your theme. $THEME->chameleonteachereditenabled = false; -/// If you use chameleon as a course theme setting this to true -/// will allow teachers on that course to edit the theme. +/// If you use chameleon as a course theme setting this to true +/// will allow teachers on that course to edit the theme. -$THEME->resource_mp3player_colors = +$THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; -/// With this you can control the colours of the "big" MP3 player +/// With this you can control the colours of the "big" MP3 player /// that is used for MP3 resources. -$THEME->filter_mediaplugin_colors = +$THEME->filter_mediaplugin_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'waitForPlay=yes'; @@ -129,11 +129,11 @@ $THEME->custompix = true; -/// If true, then this theme must have a "pix" -/// subdirectory that contains copies of all +/// If true, then this theme must have a "pix" +/// subdirectory that contains copies of all /// files from the moodle/pix directory, plus a -/// "pix/mod" directory containing all the icons +/// "pix/mod" directory containing all the icons /// for all the activity modules. //////////////////////////////////////////////////////////////////////////////// -?> + diff --git a/theme/chameleon/footer.html b/theme/chameleon/footer.html index bd6794bc8ede4..7e0916fc3d4f0 100644 --- a/theme/chameleon/footer.html +++ b/theme/chameleon/footer.html @@ -16,7 +16,7 @@

diff --git a/theme/chameleon/pix/mod/README.txt b/theme/chameleon/pix/mod/README.txt index 6dadbc92bafbe..d9ddd912d457b 100644 --- a/theme/chameleon/pix/mod/README.txt +++ b/theme/chameleon/pix/mod/README.txt @@ -13,7 +13,7 @@ Each of these modules contains a number of expected components: icon.gif: a 16x16 icon for the module db/mysql.sql: an SQL dump of all the required db tables and data - + index.php: a page to list all instances in a course view.php: a page to view a particular instance @@ -37,6 +37,6 @@ Each of these modules contains a number of expected components: If you are a developer and interested in developing new Modules see: - + Moodle Documentation: http://moodle.org/doc Moodle Community: http://moodle.org/community diff --git a/theme/chameleon/styles_ie7.css b/theme/chameleon/styles_ie7.css index bab24079c68b6..5cfebaa745c3f 100644 --- a/theme/chameleon/styles_ie7.css +++ b/theme/chameleon/styles_ie7.css @@ -1,7 +1,7 @@ /* * These styles are ONLY included for IE 7 (via meta.php) */ - + input[type="submit"] { padding: 0 2px; } diff --git a/theme/chameleon/ui/ChameleonCSS.class.php b/theme/chameleon/ui/ChameleonCSS.class.php index 0713e86e5e539..560c22bb406e0 100644 --- a/theme/chameleon/ui/ChameleonCSS.class.php +++ b/theme/chameleon/ui/ChameleonCSS.class.php @@ -3,22 +3,22 @@ class ChameleonCSS { var $error; var $base; - + var $perm; var $temp; - function ChameleonCSS($base, $perm, $temp) { + function ChameleonCSS($base, $perm, $temp) { $this->base = $base; $this->perm = $perm; $this->temp = $temp; } - + function update($file, $content = '') { if (!is_writable($this->base . $this->$file)) { $this->error = $this->$file . ' is not writeable, the file permissions are currently ' . $this->getfilepermissions($this->$file); return false; } - + if (!$fp = fopen($this->base . $this->$file, 'w')) { $this->error = 'couldn\'t open file'; return false; @@ -27,7 +27,7 @@ function update($file, $content = '') { fclose($fp); return true; } - + function getfilepermissions($file) { return substr(sprintf('%o', fileperms($this->base . $file)), -4); } @@ -35,29 +35,29 @@ function getfilepermissions($file) { function read() { $permcss = file_get_contents($this->base . $this->perm); $tempcss = file_get_contents($this->base . $this->temp); - + if ($permcss === false || $tempcss === false) { $this->error = 'Couldn\'t read file'; return false; } - + $permcss = trim($permcss); $tempcss = trim($tempcss); - + if ($tempcss == '') { return $permcss; } return $this->_merge($permcss, $tempcss); } - - - - + + + + function _merge($permcss, $tempcss) { $csssrcs = array($this->_toobj($permcss), $this->_toobj($tempcss)); - + $merged = array(); - + for ($i = 0; $i < 2; ++$i) { foreach ($csssrcs[$i] as $sel => $rule) { $newsel = false; @@ -84,13 +84,13 @@ function _merge($permcss, $tempcss) { } } } - + return $this->_tostr($merged); } - - - - + + + + function _toobj($cssstr) { $cssobj = array(); $end = strpos($cssstr, '}'); @@ -120,8 +120,8 @@ function _toobj($cssstr) { } return $cssobj; } - - + + function _tostr($cssobj) { $cssstr = ''; foreach ($cssobj as $sel => $rule) { diff --git a/theme/chameleon/ui/ChameleonFileBrowser.class.php b/theme/chameleon/ui/ChameleonFileBrowser.class.php index 7b1aca510b3f1..4b1dca53b6f80 100644 --- a/theme/chameleon/ui/ChameleonFileBrowser.class.php +++ b/theme/chameleon/ui/ChameleonFileBrowser.class.php @@ -5,13 +5,13 @@ class ChameleonFileBrowser { var $path; var $dir; var $IMAGE_TYPES; - + var $founddirs = array(); var $foundfiles = array(); function ChameleonFileBrowser() { $this->IMAGE_TYPES = array('jpeg', 'jpg', 'gif', 'png'); - + $tmp = explode('/', str_replace('\\', '/', __FILE__)); array_pop($tmp); array_pop($tmp); @@ -25,11 +25,11 @@ function sanitisepath($path) { if ($path == 'root') { return 'pix'; } - + if (substr($path, 0, 3) != 'pix') { $this->send('Not a valid directory'); } - + return preg_replace('/[.]+/', '', $path); } @@ -44,8 +44,8 @@ function readfiles() { if (!is_dir($this->dir)) { $this->send('Not a valid directory'); } - - $handle = opendir($this->dir); + + $handle = opendir($this->dir); while (false !== ($file = readdir($handle))) { if ($file == '.' || $file == '..') { continue; @@ -72,10 +72,10 @@ function sendfiles() { $out .= " $this->path/$file\n"; } $out .= ""; - + $this->send($out); } - + function send($out) { header("Content-type: application/xml; charset=utf-8"); die($out); diff --git a/theme/chameleon/ui/chameleon.php b/theme/chameleon/ui/chameleon.php index 195bee7d05d54..10461a906c5f2 100644 --- a/theme/chameleon/ui/chameleon.php +++ b/theme/chameleon/ui/chameleon.php @@ -1,6 +1,6 @@ chameleonenabled)) { $chameleon_isadmin = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); $chameleon_isteacher = false; @@ -10,8 +10,8 @@ $chameleon_courseparam = '?id=' . $COURSE->id; $chameleon_isteacher = !empty($COURSE->theme) and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $COURSE->id)); } - - if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) { + + if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) { // either we're an admin or we're a teacher and this is being used as the course theme // if we're on a page using a course theme edit that, otherwise edit the main chameleon theme $chameleon_theme = $PAGE->theme->name; diff --git a/theme/chameleon/ui/chameleon_js.php b/theme/chameleon/ui/chameleon_js.php index 5368180a59226..b7f373a1e4529 100644 --- a/theme/chameleon/ui/chameleon_js.php +++ b/theme/chameleon/ui/chameleon_js.php @@ -37,7 +37,7 @@ var struct = []; var hotspotMode = null; - + var Config = { THEME_ROOT: '', REMOTE_URI: '/css.php', @@ -52,7 +52,7 @@ UNITS: ['px', 'pt', 'em', '%'], PROPS_LIST: ['color', 'background-color', 'background-image', 'background-attachment', 'background-position', 'font-family', 'font-size', 'font-weight', 'font-style', 'line-height', 'margin', 'padding', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'] }; - + var Util = { @@ -65,7 +65,7 @@ obj.setAttribute('id', id); return obj; }, - + removeElement: function(obj) { if (!obj || !obj.parentNode) return false; @@ -73,7 +73,7 @@ if (!kids.length && typeof obj.all != 'undefined') { kids = obj.all; } - + var n = kids.length; while (n--) { if (kids[n].id && Util.__registry[kids[n].id]) { @@ -83,23 +83,23 @@ if (Util.__registry[obj.id]) { Util.__removeAllEvents(obj); } - obj.parentNode.removeChild(obj); + obj.parentNode.removeChild(obj); }, - + clearElement: function(obj) { while (obj.hasChildNodes()) { obj.removeChild(obj.firstChild); } - }, + }, addEvent: function(obj, ev, fn) { if (!Util.__addToRegistry(obj, ev, fn)) return; - + if (obj.addEventListener) { obj.addEventListener(ev, fn, false); } else if (obj.attachEvent) { obj['e' + ev + fn] = fn; - obj[ev + fn] = function() { + obj[ev + fn] = function() { obj['e' + ev + fn](window.event); }; obj.attachEvent('on' + ev, obj[ev + fn]); @@ -112,7 +112,7 @@ obj.removeEventListener(ev, fn, false); } else if (obj.detachEvent) { obj.detachEvent('on' + ev, obj[ev + fn]); - obj[ev + fn] = null; + obj[ev + fn] = null; } }, @@ -150,9 +150,9 @@ }, __removeFromRegistry: function(obj, ev, fn) { var id = Util.__getEventId(obj); - + if (!id) return false; - + var pos = Util.__findEvent(id, ev, fn); if (pos != -1) { Util.__registry[id][ev].splice(pos, 1); @@ -203,26 +203,26 @@ return {x: x, y: y}; } }; - - - + + + var CSS = { - + __localCSS: {}, __remoteCSS: {}, - + __localSaveRequired: false, __remoteSaveRequired: false, - - + + requireRemoteSave: function() { - CSS.__remoteSaveRequired = true; + CSS.__remoteSaveRequired = true; }, - + clearTheme: function() { /*var links = document.getElementsByTagName('link'); var n = links.length; @@ -233,7 +233,7 @@ } }*/ }, - + loadRemote: function(doSetup) { if (!Sarissa.IS_ENABLED_XMLHTTP) { @@ -260,34 +260,34 @@ xmlhttp.send(null); return true; }, - - + + updateTemp: function(e, reset) { if (!CSS.__localSaveRequired && !reset) { UI.statusMsg('There are no changes that need saving!', 'chameleon-notice'); return; } - + if (!reset) { UI.statusMsg('Updating temporary styles on the server...', 'chameleon-working'); } else { UI.statusMsg('Deleting temporary styles from the server...', 'chameleon-working'); } - + var css = CSS.toString(); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { if (xmlhttp.responseText.indexOf('CHAMELEON_ERROR') != -1) { UI.statusMsg('There was an error saving to the server:\n' + xmlhttp.responseText.replace(/CHAMELEON_ERROR /, '') + '.', 'chameleon-error'); - + } else { CSS.__localSaveRequired = false; if (!reset) { UI.statusMsg('Temporary styles have been updated.', 'chameleon-ok'); } else { UI.statusMsg('Temporary styles have been cleared.', 'chameleon-ok'); - } + } } xmlhttp = null; } @@ -296,14 +296,14 @@ xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send('css=' + css); }, - + updateRemote: function() { if (!CSS.__remoteSaveRequired) { UI.statusMsg('There are no changes that need saving!', 'chameleon-notice'); return; } - + var css = CSS.toString(CSS.__localCSS); UI.statusMsg('Updating styles on the server...', 'chameleon-working'); @@ -325,33 +325,33 @@ xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send('css=' + css); }, - - - - - - + + + + + + hardReset: function(e, noPrompt) { if (noPrompt || confirm('Are you sure? This will erase all styles that have not been permanently saved to the server.')) { CSS.__localCSS = {}; CSS.updateTemp(null, true); - + CSS.__localCSS = CSS.__clone(CSS.__remoteCSS); CSS.__localSaveRequired = false; CSS.__remoteSaveRequired = false; CSS.preview(); } }, - - - + + + setPropValue: function(prop, value, selector) { if (!selector) var selector = CSS.Selector.get(); if (!CSS.__localCSS[selector]) { CSS.__localCSS[selector] = {}; } - + var matches = prop.match(/^border\-([^\-]+)$/); if (value) { var func = CSS.__requiresFunction(prop); @@ -375,12 +375,12 @@ CSS.unsetProp(prop, selector); } } - + CSS.__localSaveRequired = true; CSS.__remoteSaveRequired = true; CSS.preview(selector); }, - + getPropValue: function(prop, selector) { if (!selector) var selector = CSS.Selector.get(); @@ -403,8 +403,8 @@ delete CSS.__localCSS[selector]; } }, - - + + __hasProps: function(selector) { for (var prop in CSS.__localCSS[selector]) { if (prop) { @@ -413,8 +413,8 @@ } return false; }, - - + + __cleanFunctions: function(val) { @@ -444,7 +444,7 @@ fixPath: function(val) { if (val == 'none') return val; - + var tmp = val.split('('); if (tmp.length > 1) { tmp[1] = Config.THEME_ROOT + '/' + tmp[1]; @@ -452,27 +452,27 @@ } return Config.THEME_ROOT + '/' + val; }, - - - + + + preview: function(sel) { var styleId = 'chameleon-preview-styles'; var h = document.getElementsByTagName('head')[0]; var s = document.getElementById(styleId); - + if (!s) { var s = Util.createElement('style', styleId); s.setAttribute('type', 'text/css'); h.appendChild(s); } - + if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && !window.opera && document.styleSheets && document.styleSheets.length > 0) { var lastStyle = document.styleSheets[document.styleSheets.length - 1]; - + var ieCrashProtector = /[^a-z0-9 #_:\.\-\*]/i; // some characters appearing in a selector can cause addRule to crash IE in spectacular style - if the selector contains any character outside this list don't try to add to the preview var ieWarning = false; - + if (sel) { var matchedSelectors = []; if (typeof sel == 'string') { @@ -490,7 +490,7 @@ sel.splice(ns, 1); break; } - + if (lastStyle.rules[n].selectorText.toLowerCase() == sel[ns].toLowerCase()) { matchedSelectors.push(sel[ns]); sel.splice(ns, 1); @@ -509,7 +509,7 @@ while (n--) { lastStyle.removeRule(n); } - + for (var sel in CSS.__localCSS) { if (sel.match(ieCrashProtector)) { ieWarning = true; @@ -519,18 +519,18 @@ lastStyle.addRule(sel, dec); } } - + if (ieWarning) { UI.statusMsg('The edited CSS contains content that can not be previewed by Internet Explorer', 'chameleon-notice'); } - + } else { Util.clearElement(s); s.appendChild(document.createTextNode(CSS.toString(CSS.__localCSS, true))); // I think innerHTML would be faster here, but it doesn't work in KHTML browsers (Safari etc) } }, - - + + __merge: function() { var merged = {}; @@ -565,7 +565,7 @@ } return merged; }, - + __clone: function(src) { var cloned = {}; for (var sel in src) { @@ -578,30 +578,30 @@ } return cloned; }, - - + + toString: function(css, fixpath) { if (!css) var css = CSS.__localCSS; - + var dec = ''; for (var sel in css) { dec += sel + ' ' + CSS.__propsToString(css[sel], fixpath, sel); } return dec; }, - + __propsToString: function(css, fixpath) { CSS.__Shorthand.border = {}; - + var hasBorder = false; var col = false; var importantBorders = []; var dec = '{\n'; for (var prop in css) { - + var includeProp = true; - + if (prop.indexOf('border') != -1 && prop.indexOf('spacing') == -1 && prop.indexOf('collapse') == -1) { if (css[prop].indexOf('!important') == -1) { CSS.__Shorthand.recordBorder(prop, css[prop]); @@ -611,7 +611,7 @@ includeProp = false; hasBorder = true; } - + if (prop == 'color') { col = css[prop]; } @@ -624,7 +624,7 @@ } } } - + if (hasBorder) { dec += CSS.__Shorthand.getBorderString(col); } @@ -634,14 +634,14 @@ dec += ' ' + importantBorders[n].prop + ': ' + importantBorders[n].css + ';\n'; } } - + dec += '}\n'; return dec; }, - - - - + + + + toObject: function(css) { var cssObj = {}; var end; @@ -655,7 +655,7 @@ } else { var selectorArr = [selector]; } - + var rules = parts.pop().trim(); rules = rules.split(';'); for (var i = 0; i < rules.length; ++i) { @@ -665,22 +665,22 @@ var rule = rules[i].split(':'); var prop = rule.shift().trim(); var val = rule.pop().trim(); - + for (var j = 0; j < selectorArr.length; ++j) { var noFontPropReset = {}; - + selector = selectorArr[j].trim(); if (!cssObj[selector]) { cssObj[selector] = {}; } - + if (prop != 'font' && (prop.indexOf('font') != -1 || prop == 'line-height')) { noFontPropReset[prop] = true; } - + if (prop == 'background') { CSS.__Shorthand.setBackground(cssObj, selector, val); - } else if (prop == 'font') { + } else if (prop == 'font') { CSS.__Shorthand.setFont(cssObj, selector, val, noFontPropReset); } else if ((prop == 'border' || prop.match(/^border\-([^-]+)$/)) && prop.indexOf('spacing') == -1 && prop.indexOf('collapse') == -1) { CSS.__Shorthand.setBorder(cssObj, selector, val, prop); @@ -693,11 +693,11 @@ } return cssObj; }, - - - - - + + + + + getSelectorCSS: function(selector, asObject) { if (!selector) var selector = CSS.Selector.get(); @@ -707,36 +707,36 @@ } return selector + ' ' + CSS.__propsToString(css); }, - - - + + + saveRequired: function() { return CSS.__localSaveRequired || CSS.__serverSaveRequired; }, - - + + checkSpec: function(e, selector) { if (!selector) var selector = CSS.Selector.get(); if (selector == '') { UI.statusMsg('First you have to choose which item to style!', 'chameleon-notice'); return; } - + var splitSelector = function(selector) { var selectorEnd = selector.split(' ').pop(); selectorEnd = selectorEnd.replace(/([\.:#])/g, '|$1'); return selectorEnd.split('|'); }; - + var similar = []; - + var selectorBits = splitSelector(selector); - + for (var sel in CSS.__localCSS) { var selBits = splitSelector(sel); - + var n = selectorBits.length; - + while (n--) { var match = selectorBits[n]; var m = selBits.length; @@ -758,15 +758,15 @@ } } } - + if (similar.length) { UI.Selector.__displayOverview(null, similar, selector); } else { UI.statusMsg('Your file currently contains no selectors that appear similar to "' + selector + '"', 'chameleon-notice'); - } + } }, - - + + unloadPrompt: function() { if (CSS.__localSaveRequired) { if (confirm('You have made changes to the CSS on this page since the last time it was saved, these changes will be lost unless you save them now. Select OK to save a temporary copy or Cancel to continue and discard the unsaved CSS.')) { @@ -779,18 +779,18 @@ } }; - - - + + + CSS.Selector = { - + trimmed: [], full: [], selector: '', - + create: function() { CSS.Selector.trimmed = []; - + var n = struct.length; while (n--) { if (CSS.Selector.full[n]) { @@ -799,11 +799,11 @@ } CSS.Selector.set(CSS.Selector.trimmed.join(' ')); }, - + modify: function(e) { var target = e.target || e.srcElement; var p = target.position; - + var sel = CSS.Selector.full; if (!sel[p]) { @@ -821,27 +821,27 @@ CSS.Selector.create(); UI.Selector.displaySelector(CSS.Selector.trimmed); }, - + set: function(sel) { CSS.Selector.selector = sel; }, - + get: function() { - return CSS.Selector.selector; + return CSS.Selector.selector; }, reset: function() { CSS.Selector.trimmed = []; CSS.Selector.full = []; CSS.Selector.set(''); - } + } }; - - - + + + CSS.__Shorthand = { border: {}, - + recordBorder: function(prop, value) { var pr = prop.split('-') var p = pr.pop(); @@ -858,19 +858,19 @@ CSS.__Shorthand.border[p].push({prop: prop, value: value}); CSS.__Shorthand.border[s][p] = value; }, - + getBorderString: function(col) { var cb = CSS.__Shorthand.border; - + var useHowManyProps = function(prop) { if (!cb['top'] || !cb['right'] || !cb['bottom'] || !cb['left']) { return false; } - + if (!(cb['top'][prop] && cb['right'][prop] && cb['bottom'][prop] && cb['left'][prop])) { return false; } - + if (cb['top'][prop] == cb['right'][prop] && cb['top'][prop] == cb['bottom'][prop] && cb['top'][prop] == cb['left'][prop]) { return 1; } @@ -882,13 +882,13 @@ } return 4; }; - + var getPropShorthand = function(prop) { var num = useHowManyProps(prop); if (!num) { return ''; } - + if (prop.indexOf('color') != -1) { var l = inheritColor(cb['left'][prop]); var r = inheritColor(cb['right'][prop]); @@ -900,7 +900,7 @@ var t = cb['top'][prop]; var b = cb['bottom'][prop]; } - + var propShorthand = ''; if (num == 1) { propShorthand += ' border-' + prop + ': ' + l; @@ -913,7 +913,7 @@ } return propShorthand + ';\n'; }; - + var propsStr = function(props) { var str = ''; for (var i = 0; i < props.length; ++i) { @@ -921,29 +921,29 @@ } return str; }; - + var inheritColor = function(val) { - if (!col || val != 'inherit') return val; + if (!col || val != 'inherit') return val; return col; }; - + var setImportant = function(str) { if (!str) return ''; if (str.indexOf('!important') == -1) return str; str = str.replace(/ *\!important */g, ' '); return str.substr(0, str.lastIndexOf(';')) + ' !important;\n'; }; - + var widthEqual = (cb['width']) ? CSS.__Shorthand.__allPropsEqual(cb['width']) : false; var styleEqual = (cb['style']) ? CSS.__Shorthand.__allPropsEqual(cb['style']) : false; var colorEqual = (cb['color']) ? CSS.__Shorthand.__allPropsEqual(cb['color']) : false; - + if (widthEqual && styleEqual && colorEqual) { - var propStr = setImportant(cb['width'][0].value + ' ' + cb['style'][0].value + ' ' + inheritColor(cb['color'][0].value) + ';\n'); + var propStr = setImportant(cb['width'][0].value + ' ' + cb['style'][0].value + ' ' + inheritColor(cb['color'][0].value) + ';\n'); if (cb['left'] && cb['top'] && cb['right'] && cb['bottom']) { return ' border: ' + propStr; } - + var sideShorthand = ''; if (cb['top']) { sideShorthand += ' border-top: ' + propStr; @@ -959,7 +959,7 @@ } return sideShorthand; } - + var widthProps = getPropShorthand('width'); if (!widthProps) { widthProps = (cb['width']) ? propsStr(cb['width']) : ''; @@ -972,15 +972,15 @@ if (!colorProps) { colorProps = (cb['color']) ? propsStr(cb['color']) : ''; } - + return setImportant(widthProps) + setImportant(styleProps) + setImportant(colorProps); }, - - - - - + + + + + setBorder: function(css, selector, value, prop) { var props = {}; var p = ''; @@ -997,10 +997,10 @@ regexp: /^((rgb\(\d{1,3} *, *\d{1,3} *, *\d{1,3} *\))|(#[A-F0-9]{3}([A-F0-9]{3})?)|([a-z]+))$/i, def: 'inherit' }; - + var bits = value.split(' '); var imp = (bits[bits.length - 1] == '!important') ? ' ' + bits.pop() : ''; - + if (prop == 'border') { for (var i in props) { css[selector]['border-top-' + i] = props[i].def; @@ -1029,7 +1029,7 @@ bits.splice(j, 1); break; } - } + } } imp = ''; @@ -1073,18 +1073,18 @@ } } } - + }, - - - - + + + + setBackground: function(css, selector, value) { var imp = (value.indexOf('!important') != -1) ? ' !important' : ''; if (imp != '') { value = value.replace(/ *\!important */g, ''); } - + var urlPos = value.indexOf('url('); if (urlPos == -1 && value.indexOf('none') == -1) { css[selector]['background-color'] = value + imp; @@ -1104,12 +1104,12 @@ return; } css[selector]['background-image'] = 'url(' + bits[1].substr(0, endImg).replace(/["']+/g, '') + ')' + imp; //" - + var pos = []; - + var bgOptions = bits[1].substring(endImg + 1).split(' '); var n = bgOptions.length; - + for (var i = 0; i < n; ++i) { var opt = bgOptions[i].trim(); if (opt.indexOf('repeat') != -1) { @@ -1128,13 +1128,13 @@ css[selector]['background-color'] = col + imp; } }, - + setFont: function(css, selector, value, noreset) { var imp = (value.indexOf('!important') != -1) ? ' !important' : ''; if (imp != '') { value = value.replace(/ *\!important */g, ''); } - + var order = ['font-style', 'font-variant', 'font-weight', 'font-size', 'font-family']; var numProps = order.length; var allowedVals = {}; @@ -1143,13 +1143,13 @@ allowedVals['font-weight'] = /(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)/; allowedVals['font-size'] = /([^ ]+)/; allowedVals['font-family'] = /(.+$)/; - + if (!noreset['font-style']) css[selector]['font-style'] = 'normal'; if (!noreset['font-variant']) css[selector]['font-variant'] = 'normal'; if (!noreset['font-weight']) css[selector]['font-weight'] = 'normal'; if (!noreset['font-size']) css[selector]['font-size'] = 'medium'; if (!noreset['line-height']) css[selector]['line-height'] = 'normal'; - + var expandShorthand = function(bits) { var numBits = bits.length; var startProp = 0; @@ -1172,7 +1172,7 @@ } } }; - + var removeCommaListSpaces = function(str) { var comma = str.indexOf(','); if (comma != -1) { @@ -1180,29 +1180,29 @@ } return str; }; - + var hasQuote = value.match(/(["'])/); //" if (hasQuote) { var tmp = value.split(hasQuote[1]); var bits = removeCommaListSpaces(tmp.shift()).split(' '); var startFont = bits.pop(); - + expandShorthand(bits); - - css[selector]['font-family'] = startFont + hasQuote[1] + tmp.join(hasQuote[1]) + imp; + + css[selector]['font-family'] = startFont + hasQuote[1] + tmp.join(hasQuote[1]) + imp; } else { - value = removeCommaListSpaces(value); + value = removeCommaListSpaces(value); expandShorthand(value.split(' ')); } }, - - - + + + __allPropsEqual: function(props) { var num = props.length - 1; if (num < 3) return false; - + for (var i = 0; i < num; ++i) { if (props[i].value != props[i + 1].value) { return false; @@ -1211,19 +1211,19 @@ return true; } }; - - - + + + CSS.FreeEdit = { - + __initial: {}, - + setInitial: function(e) { var target = e.target || e.srcElement; CSS.FreeEdit.__initial = CSS.toObject(target.value); }, - + saveComplete: function(e) { var target = e.target || e.srcElement; target.value = CSS.FreeEdit.__stripComments(target.value); @@ -1235,11 +1235,11 @@ CSS.preview(); }, - + saveSelector: function(e) { var target = e.target || e.srcElement; target.value = CSS.FreeEdit.__stripComments(target.value); - + var changedSelectors = []; var css = CSS.toObject(target.value); for (var sel in css) { @@ -1266,25 +1266,25 @@ } } } - + CSS.__localSaveRequired = true; CSS.__remoteSaveRequired = true; CSS.preview(changedSelectors); }, - + __stripComments: function(str) { return str.replace(/\/\*([\s\S])*?\*\//g, ''); } - + }; - - - - - - + + + + + + var FileHandler = { - + getFiles: function(path) { if (!path) path = ''; var xmlhttp = new XMLHttpRequest(); @@ -1299,11 +1299,11 @@ return true; } }; - - - - - + + + + + var UI = { boxes: [], boxOffsetX: 35, @@ -1314,7 +1314,7 @@ statusMsg: function(msg, cls) { UI.clearStatusMsg(); - + var target = UI.__getBox(); if (!target) { var box = Util.createElement('div', 'chameleon-status-msg'); @@ -1322,26 +1322,26 @@ box.style.zIndex = ++UI.zIndex; UI.addToDoc(box); } else { - + var statusTable = Util.createElement('table', 'chameleon-status-msg'); var statusTableBody = Util.createElement('tbody'); var statusRow = Util.createElement('tr'); var statusIconCell = Util.createElement('td'); var statusMsgCell = Util.createElement('td'); var statusBtnCell = Util.createElement('td'); - + if (cls) { statusIconCell.className = cls; } statusMsgCell.appendChild(document.createTextNode(msg)); statusBtnCell.appendChild(UI.createButton('chameleon-status-msg-btn', 'OK', 'Clear this message', UI.clearStatusMsg)); - + statusRow.appendChild(statusIconCell); statusRow.appendChild(statusMsgCell); statusRow.appendChild(statusBtnCell); statusTableBody.appendChild(statusRow); statusTable.appendChild(statusTableBody); - + target.appendChild(statusTable); } }, @@ -1362,7 +1362,7 @@ var offset = x + 525 - screen.width; x -= offset; } - + var box = Util.createElement('div', id); box.style.left = x + 'px'; box.style.top = y + 'px'; @@ -1373,7 +1373,7 @@ closeBtn.appendChild(document.createTextNode('x')); closeBtn.setAttribute('title', 'Close'); topBar.setAttribute('title', 'Drag me!'); - + UI.__dragTargetId = id + '-handle'; Util.addEvent(closeBtn, 'click', UI.closeBoxes); @@ -1383,12 +1383,12 @@ topBar.appendChild(closeBtn); box.appendChild(topBar); - + UI.boxes.push(id); return box; }, - + closeAllBoxes: function() { var n = UI.boxes.length; while (n--) { @@ -1403,7 +1403,7 @@ var target = e.target || e.srcElement; var box = target.parentNode.parentNode; } - + var n = UI.boxes.length; while (n--) { if (UI.boxes[n] == box.id) { @@ -1422,7 +1422,7 @@ var mouseCoords = Pos.getMouse(e); var elementCoords = Pos.getElement(target); target.mouseX = mouseCoords.x - elementCoords.x; - target.mouseY = mouseCoords.y - elementCoords.y; + target.mouseY = mouseCoords.y - elementCoords.y; UI.__dragTargetId = target.id; @@ -1439,7 +1439,7 @@ var mouseCoords = Pos.getMouse(e); target.parentNode.style.left = (mouseCoords.x - target.mouseX) + 'px'; target.parentNode.style.top = (mouseCoords.y - target.mouseY) + 'px'; - + if (e.preventDefault) { e.preventDefault(); } else if (window.event) { @@ -1451,7 +1451,7 @@ var target = e.target || e.srcElement; target.parentNode.style.zIndex = ++UI.zIndex; }, - + __getBox: function() { var obj = document.getElementById(UI.__dragTargetId); if (obj && obj.parentNode) { @@ -1459,10 +1459,10 @@ } return false; }, - - - - + + + + setupPane: function(tabs, parentId, tabId, active) { for (var i = 0; i < tabs.length; ++i) { var obj = document.getElementById(tabId + '-tab-' + tabs[i]); @@ -1477,7 +1477,7 @@ } return parent; }, - + setupButtons: function() { var parentId = arguments[0]; var parent = document.getElementById(parentId); @@ -1496,7 +1496,7 @@ } } }, - + createButton: function(id, value, title, fn, hidden) { var btn = Util.createElement('input', id); btn.setAttribute('type', 'submit'); @@ -1518,15 +1518,15 @@ } } }; - - + + UI.Selector = { controlsId: 'chameleon-selector-controls', viewedProp: null, displayPropWatch: false, sections: ['choose', 'overview', 'free-edit'], - - + + editWindow: function(e) { if (!e.shiftKey) { return; @@ -1537,7 +1537,7 @@ if (typeof tmpStruct == 'string') { return; } - + hotspotMode = false; var box = document.getElementById('chameleon-selector-box'); @@ -1558,7 +1558,7 @@ var tabsContainer = Util.createElement('table', 'chameleon-selector-tabs'); var tabsBody = Util.createElement('tbody'); var tabs = Util.createElement('tr'); - + tabs.appendChild(UI.Selector.__createTab('Choose', UI.Selector.__editSelector, true, 'Choose')); tabs.appendChild(UI.Selector.__createTab('Overview', UI.Selector.__displayOverview, false, 'Overview')); tabs.appendChild(UI.Selector.__createTab('Free Edit', UI.Selector.__editCode, false, 'Free Edit')); @@ -1575,18 +1575,18 @@ UI.addToDoc(box); UI.Selector.__editSelector(); - + if (e.preventDefault) { e.preventDefault(); } else if (window.event) { window.event.returnValue = false; } }, - - + + __listProps: function(e) { var target = e.target || e.srcElement; - + Util.removeElement(document.getElementById('chameleon-selector-element-list')); UI.Selector.viewedProp = target.options[target.selectedIndex].value; if (!document.getElementById('chameleon-selector-list')) { @@ -1595,7 +1595,7 @@ target.parentNode.parentNode.insertBefore(UI.Selector.__elementList(target.options[target.selectedIndex].value), document.getElementById('chameleon-selector-list')); } }, - + __editSelector: function() { var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'choose'); UI.setupButtons('chameleon-selector-buttons', 'edit', 'check'); @@ -1605,17 +1605,17 @@ var instructions = Util.createElement('p'); instructions.appendChild(document.createTextNode('Please choose the element you wish to style.')); container.appendChild(instructions); - + var options = Util.createElement('p'); - + if (UI.Selector.__displayPropWatch) { - + var selectProp = Util.createElement('select', 'chameleon-selector-prop-select'); var optionProp = Util.createElement('option'); optionProp.appendChild(document.createTextNode('Select a CSS property to view')); optionProp.setAttribute('value', ''); selectProp.appendChild(optionProp); - + for (var i = 0; i < Config.PROPS_LIST.length; ++i) { optionProp = Util.createElement('option'); optionProp.setAttribute('value', Config.PROPS_LIST[i]); @@ -1623,52 +1623,52 @@ optionProp.setAttribute('selected', 'selected'); } optionProp.appendChild(document.createTextNode(Config.PROPS_LIST[i])); - selectProp.appendChild(optionProp); + selectProp.appendChild(optionProp); } - + Util.addEvent(selectProp, 'change', UI.Selector.__listProps); - + options.appendChild(selectProp); - + } - + var togglePropWatch = Util.createElement('a'); togglePropWatch.setAttribute('title', 'The property inspector allows you to check the current value of a range of CSS properties for these elements'); togglePropWatch.appendChild(document.createTextNode(' (' + (UI.Selector.__displayPropWatch ? 'Hide property inspector' : 'Show property inspector') + ')')); Util.addEvent(togglePropWatch, 'click', UI.Selector.__togglePropWatch); options.appendChild(togglePropWatch); - - + + container.appendChild(options); - + container.appendChild(UI.Selector.__elementList()); parent.appendChild(container); UI.Selector.displaySelector(CSS.Selector.trimmed); }, - + __togglePropWatch: function() { UI.Selector.__displayPropWatch = !UI.Selector.__displayPropWatch; UI.Selector.__editSelector(); }, - + __displayOverview: function(e, selectors, selector) { var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'overview'); UI.setupButtons('chameleon-selector-buttons'); - + var container = Util.createElement('div', 'chameleon-style-overview-container'); parent.appendChild(container); // doing it this way is much faster than creating the table then applying the overflow UI.setOverflow(container, 350, true); - + var overviewTable = Util.createElement('table', 'chameleon-style-overview'); var overviewTableBody = Util.createElement('tbody'); - + if (!selectors) { for (var sel in CSS.__localCSS) { var overviewTableRow = Util.createElement('tr'); - + var overviewTableCell = Util.createElement('th'); overviewTableCell.className = 'selector'; overviewTableCell.appendChild(document.createTextNode(sel)); @@ -1698,12 +1698,12 @@ } } } else { - + var n = selectors.length; - + if (!CSS.__localCSS[selector]) { var overviewTableRow = Util.createElement('tr'); - + var overviewTableCell = Util.createElement('th'); overviewTableCell.className = 'current-selector'; overviewTableCell.appendChild(document.createTextNode(selector)); @@ -1720,12 +1720,12 @@ overviewTableRow.appendChild(overviewTableCell); overviewTableBody.appendChild(overviewTableRow); } - + for (var i = 0; i < n; ++i) { var sel = selectors[i]; - + var overviewTableRow = Util.createElement('tr'); - + var overviewTableCell = Util.createElement('th'); overviewTableCell.className = (sel == selector) ? 'current-selector' : 'selector'; overviewTableCell.appendChild(document.createTextNode(sel)); @@ -1741,7 +1741,7 @@ overviewTableRow.appendChild(overviewTableCell); overviewTableBody.appendChild(overviewTableRow); - + for (var prop in CSS.__localCSS[sel]) { overviewTableRow = Util.createElement('tr'); overviewTableCell = Util.createElement('td'); @@ -1755,18 +1755,18 @@ overviewTableBody.appendChild(overviewTableRow); } } - + } - overviewTable.appendChild(overviewTableBody); + overviewTable.appendChild(overviewTableBody); container.appendChild(overviewTable); }, - + __elementList: function(showComputedStyle) { if (!showComputedStyle && UI.Selector.viewedProp) { showComputedStyle = UI.Selector.viewedProp; } - + var list = Util.createElement('ol', 'chameleon-selector-element-list'); var n = struct.length; var classStr = ''; @@ -1783,7 +1783,7 @@ tag.appendChild(document.createTextNode(struct[n].tagname)); tag.selectorValue = struct[n].tagname; tag.position = n; - + UI.Selector.__autoHighlight(tag); Util.addEvent(tag, 'click', CSS.Selector.modify); @@ -1792,8 +1792,8 @@ if (idStr = struct[n].id) { var id = Util.createElement('span', 'chameleon-id-attr-' + n); - id.selectorValue = struct[n].tagname + '#' + idStr; - id.position = n; + id.selectorValue = struct[n].tagname + '#' + idStr; + id.position = n; id.appendChild(document.createTextNode('#' + idStr)); UI.Selector.__autoHighlight(id); @@ -1807,7 +1807,7 @@ for (var i = 0; i < classArr.length; ++i) { var cn = Util.createElement('span', 'chameleon-class-attr-' + n + '-' + i); cn.selectorValue = struct[n].tagname + '.' + classArr[i]; - cn.position = n; + cn.position = n; cn.appendChild(document.createTextNode('.' + classArr[i])); UI.Selector.__autoHighlight(cn); @@ -1821,7 +1821,7 @@ var pc = Util.createElement('span', 'chameleon-pseudo-class' + n + '-' + i); pc.selectorValue = struct[n].tagname + ':' + pseudoClasses[i]; - pc.position = n; + pc.position = n; pc.appendChild(document.createTextNode(':' + pseudoClasses[i])); UI.Selector.__autoHighlight(pc); @@ -1830,17 +1830,17 @@ item.appendChild(pc); } } - + if (showComputedStyle) { var sides = ['top', 'right', 'bottom', 'left']; - + if (document.defaultView && document.defaultView.getComputedStyle) { if (showComputedStyle == 'margin' || showComputedStyle == 'padding') { var styleVal = []; - for (var i = 0; i < 4; ++i) { + for (var i = 0; i < 4; ++i) { styleVal.push(document.defaultView.getComputedStyle(struct[n].el, null).getPropertyValue(showComputedStyle + '-' + sides[i])) } - + if (styleVal[0] == styleVal[1] && styleVal[1] == styleVal[2] && styleVal[2] == styleVal[3]) { styleVal = styleVal[0]; } else if (styleVal[0] == styleVal[2] && styleVal[1] == styleVal[3]) { @@ -1850,40 +1850,40 @@ } else { styleVal = styleVal.join(' '); } - } else { + } else { var styleVal = document.defaultView.getComputedStyle(struct[n].el, null).getPropertyValue(showComputedStyle); } - + if (styleVal.indexOf('rgb') != -1) { styleVal = UI.Selector.__formatColor(styleVal); } - + } else if (struct[n].el.currentStyle) { var propBits = showComputedStyle.split('-'); for (var i = 1; i < propBits.length; ++i) { propBits[i] = propBits[i].charAt(0).toUpperCase() + propBits[i].substring(1); } - var styleVal = struct[n].el.currentStyle[propBits.join('')]; + var styleVal = struct[n].el.currentStyle[propBits.join('')]; } - + var sp = Util.createElement('span'); sp.className = 'prop-value'; sp.appendChild(document.createTextNode(styleVal)); - + item.appendChild(sp); } - + list.appendChild(item); } - + return list; }, - - + + __formatColor: function(color) { - var newColor = ''; + var newColor = ''; colorBits = color.replace(/rgb\(|[ \)]/g, '').split(','); var hexCol = (colorBits[0] << 16 | colorBits[1] << 8 | colorBits[2]).toString(16); while (hexCol.length < 6) { @@ -1891,15 +1891,15 @@ } return '#' + hexCol; }, - - + + __editCode: function() { var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'free-edit'); UI.setupButtons('chameleon-selector-buttons', 'revert', 'save-local', 'save-server'); var container = Util.createElement('div'); var textarea = Util.createElement('textarea', 'chameleon-free-edit-all-field'); - + textarea.style.width = '100%'; textarea.style.height = '350px'; Util.addEvent(textarea, 'blur', CSS.FreeEdit.saveComplete); @@ -1909,17 +1909,17 @@ parent.appendChild(container); textarea.value = CSS.toString(); // avoid Konqueror bug }, - - - - + + + + __selectorList: function() { return Util.createElement('ol', 'chameleon-selector-list'); }, - - - - + + + + __createTab: function(str, fn, active, title) { var id = 'chameleon-selector-tab-' + str.replace(/ +/, '-').toLowerCase(); var tab = Util.createElement('td', id); @@ -1941,10 +1941,10 @@ return p; }, - - - - + + + + __autoHighlight: function(el) { if (CSS.Selector.full[el.position] && CSS.Selector.full[el.position].val == el.selectorValue) { UI.Selector.highlight(el); @@ -1952,7 +1952,7 @@ UI.Selector.unhighlight(el); } }, - + highlight: function(el) { UI.Selector.unhighlight(el); el.className += 'active-selector'; @@ -1961,10 +1961,10 @@ unhighlight: function(el) { el.className = el.className.replace(/\bactive-selector\b/, ''); }, - - - - + + + + displaySelector: function(selector) { var n = selector.length; @@ -1991,13 +1991,13 @@ item.appendChild(document.createTextNode('That are descended from ' + UI.Selector.__describe(selector[n]))); list.appendChild(item); } - + UI.setOverflow(list, 100); }, __describe: function(txt) { if (!txt) return ''; - + if (txt.indexOf(':') != -1) { var parts = txt.split(':'); var pc = ' the "' + parts.pop() + '" state of '; @@ -2017,23 +2017,23 @@ return pc + txt + ' tags'; } }; - - - + + + UI.CSS = { redraw: null, colorType: null, controlsId: 'chameleon-style-controls', sections: ['text', 'backgrounds', 'borders-all', 'borders-separate', 'free-edit'], - + __borderEditGroup: true, - + editWindow: function(e) { if (CSS.Selector.get() == '') { UI.statusMsg('First you have to choose which item to style!', 'chameleon-notice'); return; } - + var box = document.getElementById('chameleon-style-box'); if (box) UI.closeBoxes(true, box); @@ -2052,7 +2052,7 @@ var tabsContainer = Util.createElement('table', 'chameleon-style-tabs'); var tabsBody = Util.createElement('tbody'); var tabs = Util.createElement('tr'); - + tabs.appendChild(UI.CSS.__createTab('Text', UI.CSS.__editText, true, 'Text')); tabs.appendChild(UI.CSS.__createTab('Backgrounds', UI.CSS.__editBackgrounds, false, 'Backgrounds')); tabs.appendChild(UI.CSS.__createTab('Borders (All)', UI.CSS.__editBordersAll, false, 'Borders (All)')); @@ -2069,19 +2069,19 @@ box.appendChild(UI.CSS.__addButtons()); UI.addToDoc(box); - + UI.CSS.__editText(); }, - - - + + + launchEditWindow: function(e) { var target = e.target || e.srcElement; CSS.Selector.set(target.value); UI.CSS.editWindow(e); }, - - + + __editText: function(e, redraw) { UI.CSS.redraw = arguments.callee; UI.CSS.colorType = 'color'; @@ -2096,7 +2096,7 @@ container.appendChild(row.node); row = UI.CSS.__selectBox('font-family', '-select-font-family', Check.fontFamily, Config.FONTS_LIST); - container.appendChild(row.node); + container.appendChild(row.node); row = UI.CSS.__inputField('font-family', '-input-font-family', Check.fontFamily, !row.meta.sel); container.appendChild(row.node); @@ -2112,7 +2112,7 @@ row = UI.CSS.__selectBox('font-style', '-select-font-style', Check.fontStyle, Config.FONT_STYLES); container.appendChild(row.node); - + row = UI.CSS.__selectBox('text-align', '-select-text-align', Check.textAlign, Config.TEXT_ALIGN); container.appendChild(row.node); @@ -2127,7 +2127,7 @@ } } }, - + __editBackgrounds: function(e, redraw) { UI.CSS.redraw = arguments.callee; UI.CSS.colorType = 'background-color'; @@ -2145,12 +2145,12 @@ container.appendChild(row.node); var extraFields = row.meta; - + row = UI.CSS.__selectBox('background-repeat', '-select-background-repeat', Check.backgroundRepeat, Config.REPEAT_LIST, !extraFields); container.appendChild(row.node); row = UI.CSS.__selectBox('background-position', '-select-background-position', Check.backgroundPosition, Config.POSITION_LIST, !extraFields); - container.appendChild(row.node); + container.appendChild(row.node); containerTable.appendChild(container); parent.appendChild(containerTable); @@ -2180,24 +2180,24 @@ imgPreview.setAttribute('height', '20'); } }, - + __editBordersAll: function(e, redraw) { UI.CSS.redraw = arguments.callee; UI.CSS.colorType = 'border-color'; - + var containerTable = document.getElementById('chameleon-style-edit-borders-all-container'); if (!containerTable) { - + var parent = UI.setupPane(UI.CSS.sections, UI.CSS.controlsId, 'chameleon-style', 'borders-all'); containerTable = Util.createElement('table', 'chameleon-style-edit-borders-all-container'); var container = Util.createElement('tbody'); var row = UI.CSS.__inputField('border-width', '-input-border-width', Check.borderWidth); container.appendChild(row.node); - + row = UI.CSS.__inputField('border-color', '-input-border-color', Check.color); container.appendChild(row.node); - + row = UI.CSS.__selectBox('border-style', '-select-border-style', Check.borderStyle, Config.BORDER_LIST); container.appendChild(row.node); @@ -2209,10 +2209,10 @@ } } }, - + __editBordersSeparate: function(e, redraw) { UI.CSS.redraw = arguments.callee; - + var containerTable = document.getElementById('chameleon-style-edit-borders-separate-container'); if (!containerTable) { var parent = UI.setupPane(UI.CSS.sections, UI.CSS.controlsId, 'chameleon-style', 'borders-separate'); @@ -2221,24 +2221,24 @@ var row = UI.CSS.__inputField('border-top-width', '-input-border-top-width', Check.borderWidth); container.appendChild(row.node); - + row = UI.CSS.__inputField('border-top-color', '-input-border-top-color', Check.color, false, UI.CSS.__setColorType); container.appendChild(row.node); - + row = UI.CSS.__selectBox('border-top-style', '-select-border-top-style', Check.borderStyle, Config.BORDER_LIST); - container.appendChild(row.node); + container.appendChild(row.node); row = UI.CSS.__inputField('border-right-width', '-input-border-right-width', Check.borderWidth); container.appendChild(row.node); - + row = UI.CSS.__inputField('border-right-color', '-input-border-right-color', Check.color, false, UI.CSS.__setColorType); container.appendChild(row.node); row = UI.CSS.__selectBox('border-right-style', '-select-border-right-style', Check.borderStyle, Config.BORDER_LIST); - container.appendChild(row.node); + container.appendChild(row.node); + - row = UI.CSS.__inputField('border-bottom-width', '-input-border-bottom-width', Check.borderWidth); container.appendChild(row.node); @@ -2246,9 +2246,9 @@ container.appendChild(row.node); row = UI.CSS.__selectBox('border-bottom-style', '-select-border-bottom-style', Check.borderStyle, Config.BORDER_LIST); - container.appendChild(row.node); + container.appendChild(row.node); + - row = UI.CSS.__inputField('border-left-width', '-input-border-left-width', Check.borderWidth); container.appendChild(row.node); @@ -2257,7 +2257,7 @@ row = UI.CSS.__selectBox('border-left-style', '-select-border-left-style', Check.borderStyle, Config.BORDER_LIST); container.appendChild(row.node); - + containerTable.appendChild(container); parent.appendChild(containerTable); } else { @@ -2266,7 +2266,7 @@ } } }, - + __editCode: function(e) { UI.CSS.redraw = arguments.callee; @@ -2274,7 +2274,7 @@ var container = Util.createElement('div'); var textarea = Util.createElement('textarea', 'chameleon-free-edit-field'); - + textarea.style.width = '100%'; textarea.style.height = '350px'; @@ -2285,32 +2285,32 @@ parent.appendChild(container); textarea.value = CSS.getSelectorCSS(); // avoid Konqueror bug }, - - - - - - - + + + + + + + __getPropValue: function(prop) { var val = UI.CSS.__getBorderPropValue(prop); if (val === '') { return false; } - + if (val === false) { val = CSS.getPropValue(prop); } return val; }, - - + + __setColorDisplay: function(prop, value, field, picker) { if (!field) var field = document.getElementById(UI.CSS.controlsId + '-input-' + prop); if (!picker) var picker = document.getElementById(UI.CSS.controlsId + '-color-picker-' + prop); - + if (!field || !picker) return; - + field.value = value; try { picker.style.backgroundColor = (value != '') ? value.replace(/[ ]*\!important/, '') : '#000'; @@ -2321,22 +2321,22 @@ UI.statusMsg(value + ' is an Invalid color!', 'chameleon-error'); } }, - + __setImageDisplay: function(value, field, picker) { if (!field) var field = document.getElementById(UI.CSS.controlsId + '-input-background-image'); if (!picker) var picker = document.getElementById(UI.CSS.controlsId + '-background-image-picker'); - + var preview = document.getElementById('chameleon-image-preview'); - + if (!field || !picker) return; - + field.value = value; if (value != '') { if (!preview) { preview = Util.createElement('img', 'chameleon-image-preview'); picker.appendChild(preview); } - + if (field.value != 'none') { preview.setAttribute('src', CSS.fixPath(value.replace(/[ ]*\!important/, ''))); } else { @@ -2354,57 +2354,57 @@ picker.setAttribute('title', 'Open image picker'); Util.addEvent(picker, 'click', UI.CSS.__loadImagePicker); } - - + + }, - + __shorthandWarningIcon: function() { var img = Util.createElement('img'); img.setAttribute('src', CSS.fixPath('ui/images/notice.gif')); img.style.margin = '0 2px -5px 0'; - img.setAttribute('title', 'Currently this property has specific values set for one or more individual sides. Updating the value here will set this property for all sides, overwriting these individual values.'); + img.setAttribute('title', 'Currently this property has specific values set for one or more individual sides. Updating the value here will set this property for all sides, overwriting these individual values.'); return img; }, - + __inputField: function(prop, id, validate, hidden, init) { var row = Util.createElement('tr', UI.CSS.controlsId + '-row' + id); id = UI.CSS.controlsId + id; - + var labelCell = Util.createElement('td'); var fieldCell = Util.createElement('td'); var field = Util.createElement('input', id); field.setAttribute('type', 'text'); field.className = 'chameleon-input-text'; - - + + var val = UI.CSS.__getPropValue(prop); if (val !== false) { field.value = val; } else { labelCell.appendChild(UI.CSS.__shorthandWarningIcon()); } - + Util.addEvent(field, 'blur', validate); if (init) { Util.addEvent(field, 'focus', init); } - + labelCell.appendChild(document.createTextNode(UI.CSS.__formatProp(prop) + ': ')); labelCell.className = 'label'; fieldCell.appendChild(field); - + row.appendChild(labelCell); row.appendChild(fieldCell); - + if (prop == 'color' || prop.indexOf('-color') != -1) { var colorCell = Util.createElement('td'); var colorPicker = Util.createElement('div', UI.CSS.controlsId + '-color-picker-' + prop); colorPicker.setAttribute('title', 'Open color picker'); UI.CSS.__setColorDisplay(prop, field.value, field, colorPicker); - + Util.addEvent(colorPicker, 'click', UI.CSS.__displayColorPicker); if (init) { Util.addEvent(colorPicker, 'click', init); @@ -2415,12 +2415,12 @@ } else if (prop.indexOf('-image') != -1) { var imgCell = Util.createElement('td'); var imgPicker = Util.createElement('div', UI.CSS.controlsId + '-background-image-picker'); - + UI.CSS.__setImageDisplay(field.value, field, imgPicker); imgCell.appendChild(imgPicker); row.appendChild(imgCell); - + } else { fieldCell.setAttribute('colspan', '2'); } @@ -2429,8 +2429,8 @@ } return {node: row, meta: (field.value == 'none') ? false : field.value}; }, - - + + __selectBox: function(prop, id, validate, src, hidden) { var row = Util.createElement('tr', UI.CSS.controlsId + '-row' + id); id = UI.CSS.controlsId + id; @@ -2438,7 +2438,7 @@ var labelCell = Util.createElement('td'); var fieldCell = Util.createElement('td'); fieldCell.setAttribute('colspan', '2'); - + var currentValue = UI.CSS.__getPropValue(prop); if (currentValue === false) { labelCell.appendChild(UI.CSS.__shorthandWarningIcon()); @@ -2456,7 +2456,7 @@ var selected = false; var otherSelected = false; - + for (var i = 0; i < src.length; ++i) { op = Util.createElement('option'); op.setAttribute('value', src[i]); @@ -2484,9 +2484,9 @@ return {node: row, meta: {sel: otherSelected, value: currentValue}}; }, - - - + + + __createTab: function(str, fn, active, title) { var id = 'chameleon-style-tab-' + str.replace(/[\( ]+/, '-').replace(/[\)]+/, '').toLowerCase(); var tab = Util.createElement('td', id); @@ -2495,7 +2495,7 @@ Util.addEvent(tab, 'click', fn); return tab; }, - + __addButtons: function() { var p = Util.createElement('p', 'chameleon-style-buttons'); p.style.textAlign = 'right'; @@ -2506,7 +2506,7 @@ return p; }, - + __formatProp: function(txt) { if (txt.length > 15 && txt.indexOf('-') != -1) { return txt.split('-').slice(1).join('-'); @@ -2519,7 +2519,7 @@ __loadImagePicker: function(e) { var target = e.target || e.srcElement; - + if (target.value) { UI.statusMsg('Loading file list for ' + target.value + '...', 'chameleon-working'); FileHandler.getFiles(target.value); @@ -2528,7 +2528,7 @@ FileHandler.getFiles('root'); } }, - + displayImagePicker: function(xmldata) { UI.clearStatusMsg(); @@ -2537,15 +2537,15 @@ var coords = Pos.getElement(document.getElementById('chameleon-style-box')); box = UI.makeDraggableBox('chameleon-file-box', coords.x + UI.boxOffsetX, coords.y + UI.boxOffsetY); - + if (xmldata.firstChild.nodeName.toLowerCase() == 'chameleon_error') { UI.statusMsg('There was an error reading files from the server:\n' + xmldata.firstChild.firstChild.nodeValue + '.', 'chameleon-error'); return; } - + var files = xmldata.firstChild; var hasFiles = false; - + var infoTable = Util.createElement('table'); var infoTableBody = Util.createElement('tbody'); var infoTableRow = Util.createElement('tr'); @@ -2561,7 +2561,7 @@ Util.addEvent(parentLink, 'click', UI.CSS.__loadImagePicker); parentCell.appendChild(parentLink); infoTableRow.appendChild(parentCell); - } + } var location = Util.createElement('td', 'chameleon-files-location'); var locationPara = Util.createElement('p'); @@ -2575,7 +2575,7 @@ infoTableBody.appendChild(infoTableRow); infoTable.appendChild(infoTableBody); box.appendChild(infoTable); - + var fileList = Util.createElement('div'); for (var i = 0; i < files.childNodes.length; ++i) { @@ -2609,14 +2609,14 @@ UI.setOverflow(fileList, 350); }, - - - - + + + + __displayColorPicker: function(e) { var box = document.getElementById('chameleon-color-box'); if (box) UI.closeBoxes(true, box); - + var extraColors = ['000000', '333333', '666666', '999999', 'cccccc', 'ffffff', 'ff0000', '00ff00', '0000ff', 'ffff00', 'ff00ff', '00ffff']; var coords = Pos.getElement(document.getElementById('chameleon-style-box')); @@ -2633,9 +2633,9 @@ while (col.length < 6) { col = '0' + col; } - + yi = (xx > 17) ? 5 : 0; - + var colorTab = Util.createElement('div'); colorTab.style.position = 'absolute'; colorTab.style.left = ((15 * x) + 17) + 'px'; @@ -2646,7 +2646,7 @@ colorTab.setAttribute('title', '#' + col); container.appendChild(colorTab); - + if (x == 17) { x = 0; if (xx == 35) { @@ -2659,10 +2659,10 @@ ++x; ++xx; } - } + } } } - + for (var i = 0; i < extraColors.length; ++i) { var colorTab = Util.createElement('div'); colorTab.style.position = 'absolute'; @@ -2675,23 +2675,23 @@ container.appendChild(colorTab); } - + Util.addEvent(container, 'click', Check.color); container.style.height = (((y + yi) * 15) + 20) + 'px'; UI.addToDoc(box); }, - - - + + + __setColorType: function(e) { var target = e.target || e.srcElement; UI.CSS.colorType = UI.CSS.getBorderProp(target.id); }, - - + + getBorderProp: function(id) { var separators = ['color-picker', 'input', 'select']; for (var i = 0; i < separators.length; ++i) { @@ -2712,36 +2712,36 @@ if (!p1 && !p2 && !p3 && !p4) { return false; } - + if (!(p1 && p2 && p3 && p4)) { return ''; } - - return (p1 == p2 && p2 == p3 && p3 == p4) ? p1 : ''; + + return (p1 == p2 && p2 == p3 && p3 == p4) ? p1 : ''; } return false; } - + }; - - - + + + UI.HotSpots = { __selectors: null, __counter: 0, __lookup: {}, - + init: function() { var box = Util.createElement('div', 'chameleon-launch-hotspots'); box.appendChild(document.createTextNode('Load hotspots')); box.style.zIndex = ++UI.zIndex; - + box.hotSpotsOn = false; Util.addEvent(box, 'click', UI.HotSpots.__load); - + UI.addToDoc(box); }, - + getString: function() { var sel = CSS.Selector.get(); if (UI.HotSpots.__selectors[sel]) { @@ -2749,21 +2749,21 @@ } return '"' + sel + '"'; }, - + __load: function(e) { var target = e.target || e.srcElement; target.hotSpotsOn = !target.hotSpotsOn; - + UI.HotSpots.__counter = 0; UI.HotSpots.__lookup = {}; - + if (!target.hotSpotsOn) { target.firstChild.nodeValue = 'Show hotspots'; UI.HotSpots.__clear(); return; } target.firstChild.nodeValue = 'Hide hotspots'; - + if (!UI.HotSpots.__selectors) { UI.HotSpots.__selectors = {}; UI.HotSpots.__selectors['body'] = 'The body of the page (all pages)'; @@ -2798,55 +2798,55 @@ UI.HotSpots.__selectors['table.generaltable tr.r0'] = 'Odd numbered table rows'; UI.HotSpots.__selectors['table.generaltable tr.r1'] = 'Even numbered table rows'; } - + UI.HotSpots.__parse(); }, - + __parse: function() { var pos = {}; - + for (var sel in UI.HotSpots.__selectors) { var matches = cssQuery(sel); var nm = matches.length; if (!nm) { continue; } - + for (var j = 0; j < nm; ++j) { if (matches[j].hasAttribute && matches[j].hasAttribute('id') && matches[j].getAttribute('id').indexOf('chameleon') != -1) { continue; } - + if (!matches[j].chameleonHotspotId) { var coords = Pos.getElement(matches[j]); coords.x = 20 * Math.round(coords.x / 20); coords.y = 20 * Math.round(coords.y / 20); - + while (pos[coords.x + '-' + coords.y]) { coords.x += 20; } pos[coords.x + '-' + coords.y] = true; - + var button = UI.HotSpots.__makeButton(UI.HotSpots.__selectors[sel], coords.x, coords.y); UI.addToDoc(button); - + matches[j].chameleonHotspotId = button.id; UI.HotSpots.__lookup[button.id] = sel; break; } else { UI.HotSpots.__lookup[matches[j].chameleonHotspotId] += '|' + sel; document.getElementById(matches[j].chameleonHotspotId).title += ", " + UI.HotSpots.__selectors[sel]; - + break; } } } - + pos = null; matches = null; }, - - + + __clear: function() { for (var sel in UI.HotSpots.__selectors) { var matches = cssQuery(sel); @@ -2854,7 +2854,7 @@ if (!nm) { continue; } - + for (var j = 0; j < nm; ++j) { if (matches[j].chameleonHotspotId) { UI.HotSpots.__lookup[matches[j].chameleonHotspotId] = null; @@ -2863,10 +2863,10 @@ break; } } - } + } }, - - + + __makeButton: function(title, x, y) { var d = Util.createElement('img', 'chameleon-hotspot-' + ++UI.HotSpots.__counter); d.style.width = d.style.height = '20px'; @@ -2874,33 +2874,33 @@ d.style.left = (x - 5) + 'px'; d.style.top = (y + 15) + 'px'; d.style.cursor = 'pointer'; - + d.setAttribute('src', CSS.fixPath('ui/images/hotspot.gif')); d.setAttribute('title', title); Util.addEvent(d, 'click', UI.HotSpots.__launch); return d; }, - + __launch: function(e) { var target = e.target || e.srcElement; var selectors = UI.HotSpots.__lookup[target.id].split('|'); - + var coords = Pos.getMouse(e); - + hotspotMode = true; - + var box = document.getElementById('chameleon-selector-box'); if (box) UI.closeBoxes(true, box); - + var box = UI.makeDraggableBox('chameleon-selector-box', coords.x, coords.y); - + if (selectors.length > 1) { var instructions = Util.createElement('p'); instructions.appendChild(document.createTextNode('This element matches more than one selector, please choose which you would like to style.')); instructions.className = 'chameleon-instructions'; box.appendChild(instructions); } - + var selList = Util.createElement('ul'); for (var i = 0; i < selectors.length; ++i) { var item = Util.createElement('li'); @@ -2908,38 +2908,38 @@ itemLink.appendChild(document.createTextNode('Add/Edit styles for ' + UI.HotSpots.__selectors[selectors[i]])); itemLink.value = selectors[i]; Util.addEvent(itemLink, 'click', UI.HotSpots.__launchCSSEditor); - + item.appendChild(itemLink); - + selList.appendChild(item); - - box.appendChild(selList); + + box.appendChild(selList); } UI.addToDoc(box); }, - + __launchCSSEditor: function(e, value) { var target = e.target || e.srcElement; - + if (!value) { var value = target.value; } CSS.Selector.set(value); UI.CSS.editWindow(e); } - + }; - - - - - + + + + + var Check = { color: function(e) { var target = e.target || e.srcElement; if (e.type == 'click' && !target.value) return; - + var originalColor = UI.CSS.__getPropValue(UI.CSS.colorType); if (originalColor != target.value) { CSS.setPropValue(UI.CSS.colorType, target.value); @@ -2949,7 +2949,7 @@ UI.closeBoxes(true, target.parentNode.parentNode); } }, - + backgroundImage: function(e) { var target = e.target || e.srcElement; @@ -2958,20 +2958,20 @@ if (e.type == 'click') { UI.closeBoxes(true, document.getElementById('chameleon-file-box')); } - }, - + }, + backgroundRepeat: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('background-repeat', value); }, - + backgroundPosition: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('background-position', value); }, - + borderWidth: function(e) { var target = e.target || e.srcElement; @@ -2991,41 +2991,41 @@ } else if (!hasUnits) { target.value = val + 'px'; } - CSS.setPropValue(UI.CSS.getBorderProp(target.id), target.value); + CSS.setPropValue(UI.CSS.getBorderProp(target.id), target.value); }, - + borderStyle: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue(UI.CSS.getBorderProp(target.id), value); }, - + fontStyle: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('font-style', value); }, - + fontWeight: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('font-weight', value); }, - + fontSize: function(e) { var target = e.target || e.srcElement; CSS.setPropValue('font-size', target.value); }, - + lineHeight: function(e) { var target = e.target || e.srcElement; CSS.setPropValue('line-height', target.value); }, - + fontFamily: function(e) { var target = e.target || e.srcElement; var n = target.nodeName.toLowerCase(); - + if (n == 'select') { var value = target.options[target.options.selectedIndex].value.toLowerCase(); var fontFamilyInputRow = target.parentNode.parentNode.nextSibling; @@ -3045,21 +3045,21 @@ CSS.setPropValue('font-family', target.value); } }, - + textDecoration: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('text-decoration', value); }, - + textAlign: function(e) { var target = e.target || e.srcElement; var value = target.options[target.options.selectedIndex].value.toLowerCase(); CSS.setPropValue('text-align', value); } }; - - + + @@ -3106,18 +3106,18 @@ var setup = function() { UI.clearStatusMsg(); - + // UI.HotSpots.init(); - + var crumb = new cookie('chameleon_server_save_required'); if (crumb.read() == 1) { CSS.requireRemoteSave(); } - + Util.addEvent(window, 'unload', CSS.unloadPrompt); Util.addEvent(window, 'unload', Util.cleanUp); Util.addEvent(document, 'mousedown', UI.Selector.editWindow); - + //CSS.clearTheme(); }; diff --git a/theme/chameleon/ui/chameleon_ui.css b/theme/chameleon/ui/chameleon_ui.css index 63ef82d5a0e96..51a479d70b641 100644 --- a/theme/chameleon/ui/chameleon_ui.css +++ b/theme/chameleon/ui/chameleon_ui.css @@ -1,9 +1,9 @@ -/* sorry about the massive abuse of !important ;-) this tries to prevent user changes in CSS being +/* sorry about the massive abuse of !important ;-) this tries to prevent user changes in CSS being inherited by the user interface */ /* general box styles */ -#chameleon-selector-box, #chameleon-style-box, -#chameleon-color-box, #chameleon-file-box, +#chameleon-selector-box, #chameleon-style-box, +#chameleon-color-box, #chameleon-file-box, #chameleon-export-box { position: absolute !important; left: 0; top: 0; @@ -55,8 +55,8 @@ inherited by the user interface */ } /* drag handles */ -#chameleon-selector-box #chameleon-selector-box-handle, -#chameleon-style-box #chameleon-style-box-handle, +#chameleon-selector-box #chameleon-selector-box-handle, +#chameleon-style-box #chameleon-style-box-handle, #chameleon-color-box #chameleon-color-box-handle, #chameleon-file-box #chameleon-file-box-handle, #chameleon-export-box #chameleon-export-box-handle { @@ -64,8 +64,8 @@ inherited by the user interface */ background: #ddd !important; } -#chameleon-selector-box #chameleon-selector-box-close, -#chameleon-style-box #chameleon-style-box-close, +#chameleon-selector-box #chameleon-selector-box-close, +#chameleon-style-box #chameleon-style-box-close, #chameleon-color-box #chameleon-color-box-close, #chameleon-file-box #chameleon-file-box-close { padding: 1px 5px !important; @@ -324,9 +324,9 @@ body #chameleon-color-box { /* the buttons */ -#chameleon-selector-box input.chameleon-btn, -#chameleon-style-box input.chameleon-btn, -#chameleon-color-box input.chameleon-btn, +#chameleon-selector-box input.chameleon-btn, +#chameleon-style-box input.chameleon-btn, +#chameleon-color-box input.chameleon-btn, #chameleon-file-box input.chameleon-btn { cursor: pointer !important; margin-bottom: 3px !important; diff --git a/theme/chameleon/ui/css.php b/theme/chameleon/ui/css.php index 57ef7a4bd557d..1553d73b670ee 100644 --- a/theme/chameleon/ui/css.php +++ b/theme/chameleon/ui/css.php @@ -49,7 +49,7 @@ die('CHAMELEON_ERROR ' . $chameleon->error); } } - + } else { $css = $chameleon->read(); diff --git a/theme/chameleon/ui/sarissa.js b/theme/chameleon/ui/sarissa.js index a6e138189b853..1205060ece343 100644 --- a/theme/chameleon/ui/sarissa.js +++ b/theme/chameleon/ui/sarissa.js @@ -28,7 +28,7 @@ * */ /** - *

Sarissa is a utility class. Provides "static" methods for DOMDocument and + *

Sarissa is a utility class. Provides "static" methods for DOMDocument and * XMLHTTP objects, DOM Node serializatrion to XML strings and other goodies.

* @constructor */ @@ -126,14 +126,14 @@ if(_SARISSA_IS_IE){ }; return oDoc; }; - // see non-IE version + // see non-IE version Sarissa.getParseErrorText = function (oDoc) { var parseErrorText = Sarissa.PARSED_OK; if(oDoc.parseError != 0){ - parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason + - "\nLocation: " + oDoc.parseError.url + - "\nLine Number " + oDoc.parseError.line + ", Column " + - oDoc.parseError.linepos + + parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason + + "\nLocation: " + oDoc.parseError.url + + "\nLine Number " + oDoc.parseError.line + ", Column " + + oDoc.parseError.linepos + ":\n" + oDoc.parseError.srcText + "\n"; for(var i = 0; i < oDoc.parseError.linepos;i++){ @@ -147,9 +147,9 @@ if(_SARISSA_IS_IE){ Sarissa.setXpathNamespaces = function(oDoc, sNsSet) { oDoc.setProperty("SelectionLanguage", "XPath"); oDoc.setProperty("SelectionNamespaces", sNsSet); - }; + }; /** - * Basic implementation of Mozilla's XSLTProcessor for IE. + * Basic implementation of Mozilla's XSLTProcessor for IE. * Reuses the same XSLT stylesheet for multiple transforms * @constructor */ @@ -163,7 +163,7 @@ if(_SARISSA_IS_IE){ */ XSLTProcessor.prototype.importStylesheet = function(xslDoc){ // convert stylesheet to free threaded - var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); + var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); converted.loadXML(xslDoc.xml); this.template.stylesheet = converted; this.processor = this.template.createProcessor(); @@ -178,7 +178,7 @@ if(_SARISSA_IS_IE){ XSLTProcessor.prototype.transformToDocument = function(sourceDoc){ this.processor.input = sourceDoc; var outDoc = new ActiveXObject(_SARISSA_DOM_PROGID); - this.processor.output = outDoc; + this.processor.output = outDoc; this.processor.transform(); return outDoc; }; @@ -320,8 +320,8 @@ else{ /* end IE initialization, try to deal with real browsers now ;-) */ }; return oDoc; }; - - + + }//if(window.XMLDocument) else if(document.implementation && document.implementation.hasFeature && document.implementation.hasFeature('LS', '3.0')){ Document.prototype.async = true; @@ -331,13 +331,13 @@ else{ /* end IE initialization, try to deal with real browsers now ;-) */ var parser = document.implementation.createLSParser(this.async ? document.implementation.MODE_ASYNCHRONOUS : document.implementation.MODE_SYNCHRONOUS, null); if(this.async){ var self = this; - parser.addEventListener("load", - function(e) { + parser.addEventListener("load", + function(e) { self.readyState = 4; Sarissa.copyChildNodes(e.newDocument, self.documentElement, false); - self.onreadystatechange.call(); - }, - false); + self.onreadystatechange.call(); + }, + false); }; try { var oDoc = parser.parseURI(sURI); @@ -357,7 +357,7 @@ else{ /* end IE initialization, try to deal with real browsers now ;-) */ */ Sarissa.getDomDocument = function(sUri, sName){ return document.implementation.createDocument(sUri?sUri:"", sName?sName:"", null); - }; + }; }; };//if(_SARISSA_HAS_DOM_CREATE_DOCUMENT) }; @@ -372,10 +372,10 @@ if(!window.DOMParser){ DOMParser = function() { }; if(_SARISSA_IS_SAFARI){ - /** + /** * Construct a new DOM Document from the given XMLstring * @param sXml the given XML string - * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). + * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). * @return a new DOM Document from the given XML string */ DOMParser.prototype.parseFromString = function(sXml, contentType){ @@ -530,7 +530,7 @@ Sarissa.clearChildNodes = function(oNode) { }; /** *

Copies the childNodes of nodeFrom to nodeTo

- *

Note: The second object's original content is deleted before + *

Note: The second object's original content is deleted before * the copy operation, unless you supply a true third parameter

* @argument nodeFrom the Node to copy the childNodes from * @argument nodeTo the Node to copy the childNodes to @@ -559,12 +559,12 @@ Sarissa.copyChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { /** *

Moves the childNodes of nodeFrom to nodeTo

- *

Note: The second object's original content is deleted before + *

Note: The second object's original content is deleted before * the move operation, unless you supply a true third parameter

* @argument nodeFrom the Node to copy the childNodes from * @argument nodeTo the Node to copy the childNodes to * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is - */ + */ Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { if((!nodeFrom) || (!nodeTo)){ throw "Both source and destination nodes must be provided"; @@ -593,9 +593,9 @@ Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { }; }; -/** +/** *

Serialize any object to an XML string. All properties are serialized using the property name - * as the XML element name. Array elements are rendered as array-item elements, + * as the XML element name. Array elements are rendered as array-item elements, * using their index/key as the value of the key attribute.

* @argument anyObject the object to serialize * @argument objectName a name for that object @@ -605,7 +605,7 @@ Sarissa.xmlize = function(anyObject, objectName, indentSpace){ indentSpace = indentSpace?indentSpace:''; var s = indentSpace + '<' + objectName + '>'; var isLeaf = false; - if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String + if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String || anyObject instanceof Boolean || anyObject instanceof Date){ s += Sarissa.escape(""+anyObject); isLeaf = true; @@ -621,7 +621,7 @@ Sarissa.xmlize = function(anyObject, objectName, indentSpace){ return s += (objectName.indexOf(' ')!=-1?"\n":"\n"); }; -/** +/** * Escape the given string chacters that correspond to the five predefined XML entities * @param sXml the string to escape */ @@ -633,8 +633,8 @@ Sarissa.escape = function(sXml){ .replace(/'/g, "'"); }; -/** - * Unescape the given string. This turns the occurences of the predefined XML +/** + * Unescape the given string. This turns the occurences of the predefined XML * entities to become the characters they represent correspond to the five predefined XML entities * @param sXml the string to unescape */ @@ -645,4 +645,4 @@ Sarissa.unescape = function(sXml){ .replace(/</g,"<") .replace(/&/g,"&"); }; -// \ No newline at end of file +// \ No newline at end of file diff --git a/theme/chameleon/user_styles.css b/theme/chameleon/user_styles.css index 289017da76fe3..0a89f2464e00e 100644 --- a/theme/chameleon/user_styles.css +++ b/theme/chameleon/user_styles.css @@ -47,10 +47,10 @@ table.generaltable { background-color: #EEEEEE; } span.arrow { - font-family: Arial, Helvetica, Courier, sans-serif; + font-family: Arial, Helvetica, Courier, sans-serif; } p.arrow_button input { - font-family: Arial, Helvetica, Courier, sans-serif; + font-family: Arial, Helvetica, Courier, sans-serif; } img.resize { width: 1em; @@ -446,7 +446,7 @@ body#grade-index table.grades { background-color: #EEEEEE; border-width: 1px; border-style: solid; - border-color: #FFFFFF #DDDDDD #DDDDDD #FFFFFF; + border-color: #FFFFFF #DDDDDD #DDDDDD #FFFFFF; } body#grade-index .grades td { border-color: #FFFFFF; diff --git a/theme/colors/colors.css b/theme/colors/colors.css index 93a4f822a9ab3..ea8339f1021c1 100755 --- a/theme/colors/colors.css +++ b/theme/colors/colors.css @@ -110,7 +110,7 @@ tr.r1 { .highlight2 { color: #AA0000; } -.headingblock, +.headingblock, h2.headingblock { margin: 0 0 10px; padding: 11px 5px 7px; @@ -120,7 +120,7 @@ h2.headingblock { background-color: #e4e4e4; border-style: none; } -body#site-index .headingblock, +body#site-index .headingblock, body#course-view .headingblock { margin-top: -1px; } @@ -134,12 +134,12 @@ div.generalbox { table.generalbox { border-style: none; } -th.header, +th.header, td.cell { border-bottom: 1px solid #EEE; text-align: left; } -table.generalbox th, +table.generalbox th, table.generalbox td { border-bottom: 1px solid #EEE; text-align: left; @@ -470,7 +470,7 @@ link margin-top: 10px; } .admin th.header.c0 { - + } .rolecap .rolecapheading { background-color: #FAFAFA; @@ -609,11 +609,11 @@ link background-color: #EEE; padding: 1px; } -#left-column .sideblock .header, +#left-column .sideblock .header, #left-column .sideblock h2.header { background-color: #da5a23; } -#right-column .sideblock .header, +#right-column .sideblock .header, #right-column .sideblock h2.header { background-color: #4b95ed; } @@ -692,9 +692,9 @@ div.loginbox.twocolumns div.loginpanel { #course-view .subscribelink { padding: 0 5px; } -.weeks-format #left-column, -.weeks-format #right-column, -.topics-format #left-column, +.weeks-format #left-column, +.weeks-format #right-column, +.topics-format #left-column, .topics-format #right-column { width: 15.5em; } @@ -1099,7 +1099,7 @@ table.glossarypost { border-style: none; border-top: 1px solid #EEE; } -.glossarypost div.concept h3, +.glossarypost div.concept h3, .glossarypost.continuous .concept { display: inline; } @@ -1132,7 +1132,7 @@ body#mod-quiz-report table#attempts td { border-color: #DDD; } .que .incorrect { - + } .que.multianswer .incorrect { background-color: #faa; diff --git a/theme/colors/config.php b/theme/colors/config.php index 7aa870d9a6925..4ca51394af9bb 100755 --- a/theme/colors/config.php +++ b/theme/colors/config.php @@ -1,14 +1,14 @@ -sheets = array('reset', 'colors'); -/// This variable is an array containing the names of all the +/// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order //////////////////////////////////////////////////////////////////////////////// @@ -16,38 +16,38 @@ $THEME->standardsheets = array('styles_layout'); /// This variable can be set to an array containing -/// filenames from the *STANDARD* theme. If the -/// array exists, it will be used to choose the +/// filenames from the *STANDARD* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color'); //////////////////////////////////////////////////////////////////////////////// -$THEME->parent = ''; +$THEME->parent = ''; /// This variable can be set to the name of a parent theme /// which you want to have included before the current theme. -/// This can make it easy to make modifications to another +/// This can make it easy to make modifications to another /// theme without having to actually change the files -/// If this variable is empty or false then a parent theme +/// If this variable is empty or false then a parent theme /// is not used. //////////////////////////////////////////////////////////////////////////////// -$THEME->parentsheets = false; +$THEME->parentsheets = false; /// This variable can be set to an array containing -/// filenames from a chosen *PARENT* theme. If the -/// array exists, it will be used to choose the +/// filenames from a chosen *PARENT* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color'); @@ -62,28 +62,28 @@ $THEME->metainclude = true; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from this theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from this theme into the /// part of the page. $THEME->standardmetainclude = true; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the standard theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the standard theme into the /// part of the page. $THEME->parentmetainclude = false; -/// When this is enabled (or not set!) then Moodle will try -/// to include a file meta.php from the parent theme into the +/// When this is enabled (or not set!) then Moodle will try +/// to include a file meta.php from the parent theme into the /// part of the page. $THEME->navmenuwidth = 50; -/// You can use this to control the cutoff point for strings +/// You can use this to control the cutoff point for strings /// in the navmenus (list of activities in popup menu etc) /// Default is 50 characters wide. @@ -92,21 +92,21 @@ /// By setting this to true, then you will have access to a /// new variable in your header.html and footer.html called -/// $navmenulist ... this contains a simple XHTML menu of -/// all activities in the current course, mostly useful for +/// $navmenulist ... this contains a simple XHTML menu of +/// all activities in the current course, mostly useful for /// creating popup navigation menus and so on. -$THEME->resource_mp3player_colors = +$THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; -/// With this you can control the colours of the "big" MP3 player +/// With this you can control the colours of the "big" MP3 player /// that is used for MP3 resources. -$THEME->filter_mediaplugin_colors = +$THEME->filter_mediaplugin_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'waitForPlay=yes'; @@ -116,11 +116,11 @@ $THEME->custompix = true; -/// If true, then this theme must have a "pix" -/// subdirectory that contains copies of all +/// If true, then this theme must have a "pix" +/// subdirectory that contains copies of all /// files from the moodle/pix directory, plus a -/// "pix/mod" directory containing all the icons +/// "pix/mod" directory containing all the icons /// for all the activity modules. //////////////////////////////////////////////////////////////////////////////// -?> + diff --git a/theme/colors/footer.html b/theme/colors/footer.html index 3788820a19db7..9b207692e65e3 100755 --- a/theme/colors/footer.html +++ b/theme/colors/footer.html @@ -1,5 +1,5 @@ -container_end(); // content container echo $OUTPUT->container_start('clearfix footer'); @@ -13,11 +13,11 @@ $useridarray = array(2, 3 // MD ); - + if (!empty($performanceinfo) && isloggedin() && in_array($USER->id, $useridarray)) { echo $performanceinfo; } - + echo $OUTPUT->container_end(); ?>
diff --git a/theme/colors/gradients.css b/theme/colors/gradients.css index c08d817f72166..2cdca43ea1c56 100755 --- a/theme/colors/gradients.css +++ b/theme/colors/gradients.css @@ -29,7 +29,7 @@ body { #header-home hr { display: none; } -.headermain, +.headermain, h1.headermain { margin: 10px 0 0 10px; } @@ -68,17 +68,17 @@ h1.headermain { .sideblock a { color: #eee; } -.sideblock .header, +.sideblock .header, .sideblock h2.header { padding: 5px; border-style: none; width: 100%; } -#left-column .sideblock .header, +#left-column .sideblock .header, #left-column .sideblock h2.header { background-color: #da5a23; } -#right-column .sideblock .header, +#right-column .sideblock .header, #right-column .sideblock h2.header { background-color: #4b95ed; } diff --git a/theme/colors/header.html b/theme/colors/header.html index 48f4ce8be0f08..daeca682798a8 100755 --- a/theme/colors/header.html +++ b/theme/colors/header.html @@ -9,19 +9,19 @@ > - +
- - container_start('clearfix header-home'); ?>

container_end(); ?> - container_start('clearfix header'); ?>

diff --git a/theme/colors/js/CSSClass.js b/theme/colors/js/CSSClass.js index 1f60ad80e8699..9ae17a4ac9a2a 100755 --- a/theme/colors/js/CSSClass.js +++ b/theme/colors/js/CSSClass.js @@ -1,6 +1,6 @@ /** * CSSClass.js: utilities for manipulating the CSS class of an HTML element. - * + * * This module defines a single global symbol named CSSClass. This object * contains utility functions for working with the class attribute (className * property) of HTML elements. All functions take two arguments: the element diff --git a/theme/colors/js/js.php b/theme/colors/js/js.php index e1ba4dde737aa..aee74e903c341 100755 --- a/theme/colors/js/js.php +++ b/theme/colors/js/js.php @@ -1,14 +1,14 @@ \ No newline at end of file diff --git a/theme/colors/pix/mod/README.txt b/theme/colors/pix/mod/README.txt index 5d28268194598..2ee60bb34e6ce 100755 --- a/theme/colors/pix/mod/README.txt +++ b/theme/colors/pix/mod/README.txt @@ -13,7 +13,7 @@ Each of these modules contains a number of expected components: icon.gif: a 16x16 icon for the module db/mysql.sql: an SQL dump of all the required db tables and data - + index.php: a page to list all instances in a course view.php: a page to view a particular instance @@ -37,6 +37,6 @@ Each of these modules contains a number of expected components: If you are a developer and interested in developing new Modules see: - + Moodle Documentation: http://moodle.org/doc Moodle Community: http://moodle.org/community diff --git a/theme/cornflower/config.php b/theme/cornflower/config.php index de73809ad7073..6c93c72606e61 100644 --- a/theme/cornflower/config.php +++ b/theme/cornflower/config.php @@ -1,53 +1,53 @@ -sheets = array('cornflower'); -/// This variable is an array containing the names of all the +/// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order //////////////////////////////////////////////////////////////////////////////// -$THEME->standardsheets = true; +$THEME->standardsheets = true; /// This variable can be set to an array containing -/// filenames from the *STANDARD* theme. If the -/// array exists, it will be used to choose the +/// filenames from the *STANDARD* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color'); //////////////////////////////////////////////////////////////////////////////// -$THEME->parent = ''; +$THEME->parent = ''; /// This variable can be set to the name of a parent theme /// which you want to have included before the current theme. -/// This can make it easy to make modifications to another +/// This can make it easy to make modifications to another /// theme without having to actually change the files -/// If this variable is empty or false then a parent theme +/// If this variable is empty or false then a parent theme /// is not used. //////////////////////////////////////////////////////////////////////////////// -$THEME->parentsheets = false; +$THEME->parentsheets = false; /// This variable can be set to an array containing -/// filenames from a chosen *PARENT* theme. If the -/// array exists, it will be used to choose the +/// filenames from a chosen *PARENT* theme. If the +/// array exists, it will be used to choose the /// files to include in the standard style sheet. /// When false, then no files are used. /// When true or NON-EXISTENT, then ALL standard files are used. -/// This parameter can be used, for example, to prevent +/// This parameter can be used, for example, to prevent /// having to override too many classes. /// Note that the trailing .css should not be included /// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color'); @@ -62,7 +62,7 @@ $THEME->navmenuwidth = 50; -/// You can use this to control the cutoff point for strings +/// You can use this to control the cutoff point for strings /// in the navmenus (list of activities in popup menu etc) /// Default is 50 characters wide. @@ -71,22 +71,22 @@ /// By setting this to true, then you will have access to a /// new variable in your header.html and footer.html called -/// $navmenulist ... this contains a simple XHTML menu of -/// all activities in the current course, mostly useful for +/// $navmenulist ... this contains a simple XHTML menu of +/// all activities in the current course, mostly useful for /// creating popup navigation menus and so on. -$THEME->resource_mp3player_colors = +$THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; -/// With this you can control the colours of the "big" MP3 player +/// With this you can control the colours of the "big" MP3 player /// that is used for MP3 resources. -$THEME->filter_mediaplugin_colors = +$THEME->filter_mediaplugin_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'waitForPlay=yes'; @@ -96,12 +96,11 @@ $THEME->custompix = false; -/// If true, then this theme must have a "pix" -/// subdirectory that contains copies of all +/// If true, then this theme must have a "pix" +/// subdirectory that contains copies of all /// files from the moodle/pix directory, plus a -/// "pix/mod" directory containing all the icons +/// "pix/mod" directory containing all the icons /// for all the activity modules. //////////////////////////////////////////////////////////////////////////////// -?> \ No newline at end of file diff --git a/theme/cornflower/cornflower.css b/theme/cornflower/cornflower.css index 6ea059ff27a33..50c0b59853faf 100755 --- a/theme/cornflower/cornflower.css +++ b/theme/cornflower/cornflower.css @@ -1,11 +1,11 @@ /******************************************************************* Cornflower CSS - - This CSS file contains all color and layout definitions + + This CSS file contains all color and layout definitions for the Cornflower theme. - + This theme requires the Standard theme to be present. - + *******************************************************************/ /*** @@ -20,7 +20,7 @@ a:visited { a:hover { color:#054377; text-decoration:underline; - + } body { @@ -37,21 +37,21 @@ div.header { .navbar { background-color:#D0E2EE; border-color:#D0E2EE; - + } .generalbox { - border-color:#739FC4; + border-color:#739FC4; } .informationbox { - border-color:#739FC4; + border-color:#739FC4; } .feedbackbox { - border-color: #739FC4; + border-color: #739FC4; } .noticebox { - border-color:#739FC4; + border-color:#739FC4; } .errorbox { @@ -74,7 +74,7 @@ div.header { .unread { background: #78A2CD; -} +} /*** *** Header @@ -89,7 +89,7 @@ height:112px; .headermain { background: transparent url(images/hdbgend.jpg) 100% 0 no-repeat; float: none; - + } @@ -98,16 +98,16 @@ height:112px; ***/ .admin .generalboxcontent { - background-color:#EEEEEE; + background-color:#EEEEEE; } .admin .generalbox { - border-color:#739FC4; + border-color:#739FC4; } .admin .informationbox { - border-color:#739FC4; - background-color:#FFFFFF; + border-color:#739FC4; + background-color:#FFFFFF; } @@ -348,7 +348,7 @@ table.message_search_results td { ***/ .userpicture { - background:#EEEEEE; + background:#EEEEEE; } .userinfobox { @@ -375,21 +375,21 @@ table.message_search_results td { } .forumpost .left { - background:#739FC4; + background:#739FC4; } .forumpost .topic { border-bottom-color: #739FC4; - background:#D0E2EE; + background:#D0E2EE; } .forumpost .starter { - background:#739FC4; + background:#739FC4; } .forumheaderlist .discussion .starter { - background:#D0E2EE; + background:#D0E2EE; } .forumheaderlist td { @@ -408,10 +408,10 @@ table.message_search_results td { } #mod-forum-discuss .unread .forumpost .message { - border-color: #78A2CD; -} + border-color: #78A2CD; +} #mod-forum-discuss .forumthread .unread { -} +} #mod-forum-index .unread { } @@ -548,7 +548,7 @@ h6.main { padding-right:10px; } -div.headermenu +div.headermenu { position: absolute; top: 15px; diff --git a/theme/custom_corners/config.php b/theme/custom_corners/config.php index eed045b1577ab..654ae8ffa5a78 100644 --- a/theme/custom_corners/config.php +++ b/theme/custom_corners/config.php @@ -1,4 +1,4 @@ -container_end(); ?> -container_start('footer'); - + echo ''; - + echo $loggedinas; echo $homelink; $useridarray = array(2 // MD ); - + if (!empty($performanceinfo) && isloggedin() && in_array($USER->id, $useridarray)) { echo $performanceinfo; } diff --git a/theme/custom_corners/header.html b/theme/custom_corners/header.html index 508df7552fd30..d0479dd5338d1 100644 --- a/theme/custom_corners/header.html +++ b/theme/custom_corners/header.html @@ -6,29 +6,29 @@ <?php echo $title ?> - javascript"); include($CFG->themedir.'/custom_corners/js/js.php'); - + // check if page is opened within a popup window if (function_exists('is_in_popup')) { $inpopup = is_in_popup(); } else { $inpopup = false; } - + // get class list preg_match('/class="([^"]*)"/i', $bodytags, $classes); $classlist = explode (' ', $classes[1]); - - + + // add "inpopup" or "notinpopup" to class list if ($inpopup) { array_push($classlist, 'inpopup'); } else { array_push($classlist, 'notinpopup'); } - + //replace classlist with new one $bodytags = str_replace($classes[0], 'class="'.implode(' ', $classlist).'"', $bodytags); ?> @@ -46,7 +46,7 @@
- container_start('clearfix header-home'); ?> diff --git a/theme/custom_corners/js/CSSClass.js b/theme/custom_corners/js/CSSClass.js index 1f60ad80e8699..9ae17a4ac9a2a 100644 --- a/theme/custom_corners/js/CSSClass.js +++ b/theme/custom_corners/js/CSSClass.js @@ -1,6 +1,6 @@ /** * CSSClass.js: utilities for manipulating the CSS class of an HTML element. - * + * * This module defines a single global symbol named CSSClass. This object * contains utility functions for working with the class attribute (className * property) of HTML elements. All functions take two arguments: the element diff --git a/theme/custom_corners/js/js.php b/theme/custom_corners/js/js.php index a2efde31cb85a..e0f1acb447799 100644 --- a/theme/custom_corners/js/js.php +++ b/theme/custom_corners/js/js.php @@ -1,13 +1,13 @@
with DIVs; inline styles. * 3. Reorder columns so that in linear view content is first then blocks; * styles to maintain original graphical (side by side) view. * - * Target: 3-column graphical view using relative widths for pixel screen sizes + * Target: 3-column graphical view using relative widths for pixel screen sizes * 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards. - * + * * http://www.maxdesign.com.au/presentation/em/ Ideal length for content. * http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE. * * @copyright © 2006 The Open University * @author N.D.Freear@open.ac.uk, and others. * @license http://www.gnu.org/copyleft/gpl.html GNU Public License - * @package + * @package */ //TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formattopicscss'] diff --git a/course/format/topics/lib.php b/course/format/topics/lib.php index c91a586972bee..228e21ee132dc 100644 --- a/course/format/topics/lib.php +++ b/course/format/topics/lib.php @@ -70,4 +70,4 @@ function callback_topics_definition() { function callback_topics_request_key() { return 'topic'; } -?> + diff --git a/course/format/weeks/ajax.php b/course/format/weeks/ajax.php index 2280eddd8154b..0dbea4e12239f 100644 --- a/course/format/weeks/ajax.php +++ b/course/format/weeks/ajax.php @@ -7,4 +7,4 @@ $CFG->ajaxcapable = true; $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); -?> + diff --git a/course/format/weeks/config.php b/course/format/weeks/config.php index cf58f2db92760..1a429b4e45987 100755 --- a/course/format/weeks/config.php +++ b/course/format/weeks/config.php @@ -2,10 +2,9 @@ // // Optional course format configuration file // -// This file contains any specific configuration settings for the +// This file contains any specific configuration settings for the // format. // // The default blocks layout for this course format: $format['defaultblocks'] = ':search_forums,news_items,calendar_upcoming,recent_activity'; // -?> \ No newline at end of file diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 8e56aaa55fd3f..7830bcfa8fb4d 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -1,27 +1,27 @@ - and with DIVs; inline styles. * 3. Reorder columns so that in linear view content is first then blocks; * styles to maintain original graphical (side by side) view. * - * Target: 3-column graphical view using relative widths for pixel screen sizes + * Target: 3-column graphical view using relative widths for pixel screen sizes * 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards. - * + * * http://www.maxdesign.com.au/presentation/em/ Ideal length for content. * http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE. * * @copyright © 2006 The Open University * @author N.D.Freear@open.ac.uk, and others. * @license http://www.gnu.org/copyleft/gpl.html GNU Public License - * @package + * @package */ //TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formatweekscss'] @@ -86,9 +86,9 @@ // Note, 'right side' is BEFORE content. echo '
  • '; echo '
     
    '; - echo '
     
    '; + echo '
     
    '; echo '
    '; - + echo '
    '; $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); @@ -103,7 +103,7 @@ ' class="icon edit" alt="'.$streditsummary.'" />

    '; } echo '
    '; - + print_section($course, $thissection, $mods, $modnamesused); if ($PAGE->user_is_editing()) { @@ -177,7 +177,7 @@ // Note, 'right side' is BEFORE content. echo '
    '; - + if ($displaysection == $section) { echo ''. ''.$strshowallweeks.'
    '; diff --git a/course/format/weeks/lib.php b/course/format/weeks/lib.php index 0130dc4560628..ebad925bbb457 100644 --- a/course/format/weeks/lib.php +++ b/course/format/weeks/lib.php @@ -71,4 +71,4 @@ function callback_weeks_definition() { function callback_weeks_request_key() { return 'week'; } -?> + diff --git a/course/import.php b/course/import.php index ffb0d05da8f77..7bef40abf8508 100644 --- a/course/import.php +++ b/course/import.php @@ -71,4 +71,4 @@ } echo $OUTPUT->footer(); -?> + diff --git a/course/import/activities/import_form.php b/course/import/activities/import_form.php index 4e997fe8f25aa..745933fece835 100755 --- a/course/import/activities/import_form.php +++ b/course/import/activities/import_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); @@ -57,4 +57,4 @@ function validation($data, $files) { } } -?> + diff --git a/course/import/activities/index.php b/course/import/activities/index.php index 63f942cd31591..61bd005fa69c2 100644 --- a/course/import/activities/index.php +++ b/course/import/activities/index.php @@ -104,4 +104,3 @@ echo $OUTPUT->footer(); -?> \ No newline at end of file diff --git a/course/import/activities/mod.php b/course/import/activities/mod.php index d021655bafcd5..f1d0a59fa756e 100644 --- a/course/import/activities/mod.php +++ b/course/import/activities/mod.php @@ -1,4 +1,4 @@ -table($table); } -?> + diff --git a/course/import/groups/import_form.php b/course/import/groups/import_form.php index f0a7f1a6d0195..c6bd14f15e132 100755 --- a/course/import/groups/import_form.php +++ b/course/import/groups/import_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); @@ -34,4 +34,4 @@ function get_import_name(){ } } } -?> + diff --git a/course/import/groups/index.php b/course/import/groups/index.php index 60d47f1fc6e39..cd79671cb05d0 100755 --- a/course/import/groups/index.php +++ b/course/import/groups/index.php @@ -232,4 +232,3 @@ function my_file_get_contents($filename, $use_include_path = 0) { return $data; } -?> \ No newline at end of file diff --git a/course/import/groups/mod.php b/course/import/groups/mod.php index 4a73e819d28e6..b264515c26447 100644 --- a/course/import/groups/mod.php +++ b/course/import/groups/mod.php @@ -53,4 +53,3 @@ echo '

    '; -?> \ No newline at end of file diff --git a/course/importstudents.html b/course/importstudents.html index 64636480754db..403c344746532 100644 --- a/course/importstudents.html +++ b/course/importstudents.html @@ -12,7 +12,7 @@ onFocus="getElementById('studentform').add.disabled=true; getElementById('studentform').remove.disabled=false; getElementById('studentform').addselect.selectedIndex=-1;"> - id\">".course_format_name($course,60)."\n"; } @@ -34,7 +34,7 @@ getElementById('studentform').remove.disabled=true; getElementById('studentform').removeselect.selectedIndex=-1;"> \n"; foreach ($searchcourses as $course) { @@ -57,7 +57,7 @@
    - \n"; $link = html_link::make("/iplookup/index.php?ip=$log->ip&user=$log->userid", $log->ip); $link->add_action(new popup_action('click', $link->url, 'iplookup', array('height' => 440, 'width' => 700))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); echo "
  • \n"; @@ -419,7 +419,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per } else { $link = html_link::make(make_log_url($log->module,$log->url), $displayaction); $link->add_action(new popup_action('click', $link->url, 'fromloglive'), array('height' => 440, 'width' => 700)); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } echo "{$log->info}\n"; $link = html_link::make("/iplookup/index.php?ip=$log->ip&user=$log->userid", $log->ip); $link->add_action(new popup_action('click', $link->url, 'iplookup', array('height' => 400, 'width' => 700))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); echo "\n"; @@ -1655,14 +1655,14 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false, if (!empty($resources)) { $select = html_select::make_popup_form($popupurl, 'add', $resources, "ressection$section", null); $select->nothinglabel = $straddresource; - $select->set_help_icon('resource/types', $straddresource); + $select->set_help_icon('resource/types', $straddresource); $output .= $OUTPUT->select($select); } if (!empty($activities)) { $select = html_select::make_popup_form($popupurl, 'add', $activities, "section$section", null); $select->nothinglabel = $straddactivity; - $select->set_help_icon('mods', $straddactivity); + $select->set_help_icon('mods', $straddactivity); $output .= $OUTPUT->select($select); } @@ -2010,7 +2010,7 @@ function print_category_info($category, $depth, $showcourses = false) { $link = html_link::make('/course/info.php?id='.$course->id, ''.$strsummary.''); $link->add_action(new popup_action('click', $link->url, 'courseinfo', array('height' => 400, 'width' => 500))); $link->title = $strsummary; - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); } else { echo ''; } @@ -3700,7 +3700,7 @@ public static function create($data) { // Notify the admin if required. if ($CFG->courserequestnotify) { $users = get_users_from_config($CFG->courserequestnotify, 'moodle/site:approvecourse'); - + $a = new stdClass; $a->link = "$CFG->wwwroot/course/pending.php"; $a->user = fullname($USER); diff --git a/course/loginas.php b/course/loginas.php index 630331123d62f..8a0e7a977f17d 100644 --- a/course/loginas.php +++ b/course/loginas.php @@ -1,4 +1,4 @@ -wwwroot/course/view.php?id=$course->id"); -?> + diff --git a/course/mod.php b/course/mod.php index d4349c6240969..2233f0b94810d 100644 --- a/course/mod.php +++ b/course/mod.php @@ -324,4 +324,4 @@ print_error('unknowaction'); } -?> + diff --git a/course/modedit.php b/course/modedit.php index c1dcbaa4c02bd..ebc5294842d15 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -613,14 +613,14 @@ $currenttab = 'update'; require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php'); } - + $helpicon = new moodle_help_icon(); $helpicon->page = 'mods'; $helpicon->text = $pageheading; $helpicon->module = $module->name; echo $OUTPUT->heading_with_help($helpicon, $OUTPUT->mod_icon_url('icon', $module->name)); - + $mform->display(); - + echo $OUTPUT->footer(); } diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index a2dae5d15610b..fb8f3b7ff2545 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'); if (!empty($CFG->enablecompletion) or !empty($CFG->enableavailability)) { require_once($CFG->libdir.'/completionlib.php'); @@ -59,7 +59,7 @@ function moodleform_mod($current, $section, $cm, $course) { } else { $this->context = get_context_instance(CONTEXT_COURSE, $course->id); } - + // Guess module name $matches = array(); if (!preg_match('/^mod_([^_]+)_mod_form$/', get_class($this), $matches)) { @@ -198,10 +198,10 @@ function definition_after_data() { get_string('completedwarningtext', 'completion', $completedcount)), 'unlockcompletion'); $mform->setHelpButton('completedwarning', array('completionlocked', get_string('help_completionlocked', 'completion'), 'completion')); - + $freeze = true; } - } + } if ($freeze) { $mform->freeze('completion'); @@ -212,7 +212,7 @@ function definition_after_data() { $mform->freeze('completionusegrade'); } $mform->freeze($this->_customcompletionelements); - } + } } // Availability conditions @@ -273,7 +273,7 @@ function validation($data, $files) { $errors['cmidnumber'] = get_string('idnumbertaken'); } } - + // Completion: Don't let them choose automatic completion without turning // on some conditions if (array_key_exists('completion', $data) && $data['completion']==COMPLETION_TRACKING_AUTOMATIC) { @@ -284,12 +284,12 @@ function validation($data, $files) { } // Conditions: Don't let them set dates which make no sense - if (array_key_exists('availablefrom', $data) && - $data['availablefrom'] && $data['availableuntil'] && + if (array_key_exists('availablefrom', $data) && + $data['availablefrom'] && $data['availableuntil'] && $data['availablefrom'] > $data['availableuntil']) { $errors['availablefrom'] = get_string('badavailabledates', 'condition'); } - + return $errors; } @@ -305,7 +305,7 @@ function set_data($default_values) { $default_values = (array)$default_values; } - $this->data_preprocessing($default_values); + $this->data_preprocessing($default_values); parent::set_data($default_values); } @@ -401,14 +401,14 @@ function standard_coursemodule_elements(){ $grouparray[] =& $mform->createElement('static', '', '','% '.get_string('grade_upto','condition').' '); $grouparray[] =& $mform->createElement('text', 'conditiongrademax','',array('size'=>3)); $grouparray[] =& $mform->createElement('static', '', '','%'); - $mform->setType('conditiongrademin',PARAM_FLOAT); - $mform->setType('conditiongrademax',PARAM_FLOAT); - $group = $mform->createElement('group','conditiongradegroup', + $mform->setType('conditiongrademin',PARAM_FLOAT); + $mform->setType('conditiongrademax',PARAM_FLOAT); + $group = $mform->createElement('group','conditiongradegroup', get_string('gradecondition', 'condition'),$grouparray); // Get version with condition info and store it so we don't ask // twice - if(!empty($this->_cm)) { + if(!empty($this->_cm)) { $ci = new condition_info($this->_cm, CONDITION_MISSING_EXTRATABLE); $this->_cm = $ci->get_full_course_module(); $count = count($this->_cm->conditionsgrade)+1; @@ -442,10 +442,10 @@ function standard_coursemodule_elements(){ COMPLETION_COMPLETE_PASS=>get_string('completion_pass','condition'), COMPLETION_COMPLETE_FAIL=>get_string('completion_fail','condition')); - $grouparray = array(); + $grouparray = array(); $grouparray[] =& $mform->createElement('select','conditionsourcecmid','',$completionoptions); $grouparray[] =& $mform->createElement('select','conditionrequiredcompletion','',$completionvalues); - $group = $mform->createElement('group','conditioncompletiongroup', + $group = $mform->createElement('group','conditioncompletiongroup', get_string('completioncondition', 'condition'),$grouparray); $count = empty($this->_cm) ? 1 : count($this->_cm->conditionscompletion)+1; @@ -455,15 +455,15 @@ function standard_coursemodule_elements(){ $mform->setHelpButton('conditioncompletiongroup[0]', array('completioncondition', get_string('help_completioncondition', 'condition'), 'condition')); } - // Do we display availability info to students? - $mform->addElement('select', 'showavailability', get_string('showavailability', 'condition'), - array(CONDITION_STUDENTVIEW_SHOW=>get_string('showavailability_show', 'condition'), + // Do we display availability info to students? + $mform->addElement('select', 'showavailability', get_string('showavailability', 'condition'), + array(CONDITION_STUDENTVIEW_SHOW=>get_string('showavailability_show', 'condition'), CONDITION_STUDENTVIEW_HIDE=>get_string('showavailability_hide', 'condition'))); - $mform->setDefault('showavailability', CONDITION_STUDENTVIEW_SHOW); + $mform->setDefault('showavailability', CONDITION_STUDENTVIEW_SHOW); $mform->setHelpButton('showavailability', array('showavailability', get_string('help_showavailability', 'condition'), 'condition')); } - // Conditional activities: completion tracking section + // Conditional activities: completion tracking section if(!isset($completion)) { $completion = new completion_info($COURSE); } @@ -477,8 +477,8 @@ function standard_coursemodule_elements(){ $mform->addElement('hidden', 'completionunlocked', 0); $mform->setType('completionunlocked', PARAM_INT); - $mform->addElement('select', 'completion', get_string('completion', 'completion'), - array(COMPLETION_TRACKING_NONE=>get_string('completion_none', 'completion'), + $mform->addElement('select', 'completion', get_string('completion', 'completion'), + array(COMPLETION_TRACKING_NONE=>get_string('completion_none', 'completion'), COMPLETION_TRACKING_MANUAL=>get_string('completion_manual', 'completion'))); $mform->setHelpButton('completion', array('completion', get_string('help_completion', 'completion'), 'completion')); $mform->setDefault('completion', $this->_features->defaultcompletion @@ -507,7 +507,7 @@ function standard_coursemodule_elements(){ // Automatic completion according to module-specific rules $this->_customcompletionelements = $this->add_completion_rules(); foreach ($this->_customcompletionelements as $element) { - $mform->disabledIf($element, 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC); + $mform->disabledIf($element, 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC); } $gotcompletionoptions = $gotcompletionoptions || @@ -518,17 +518,17 @@ function standard_coursemodule_elements(){ $mform->getElement('completion')->addOption( get_string('completion_automatic', 'completion'), COMPLETION_TRACKING_AUTOMATIC); - } + } // Completion expected at particular date? (For progress tracking) $mform->addElement('date_selector', 'completionexpected', get_string('completionexpected', 'completion'), array('optional'=>true)); $mform->setHelpButton('completionexpected', array('completionexpected', get_string('help_completionexpected', 'completion'), 'completion')); - $mform->disabledIf('completionexpected', 'completion', 'eq', COMPLETION_TRACKING_NONE); + $mform->disabledIf('completionexpected', 'completion', 'eq', COMPLETION_TRACKING_NONE); } $this->standard_hidden_coursemodule_elements(); } - + /** * Can be overridden to add custom completion rules if the module wishes * them. If overriding this, you should also override completion_rule_enabled. @@ -640,4 +640,4 @@ function add_action_buttons($cancel=true, $submitlabel=null, $submit2label=null) } } -?> + diff --git a/course/pending.php b/course/pending.php index f931f4e71bb84..3fc067ad9c171 100644 --- a/course/pending.php +++ b/course/pending.php @@ -111,10 +111,10 @@ $keyicon->alt = $strrequireskey; $keyicon->add_class('icon'); $keyicon = $OUTPUT->image($keyicon); - + foreach ($pending as $course) { $course = new course_request($course); - + // Check here for shortname collisions and warn about them. $course->check_shortname_collision(); diff --git a/course/recent.php b/course/recent.php index 2c0ab507b2239..dc0dc547d6d53 100644 --- a/course/recent.php +++ b/course/recent.php @@ -304,4 +304,3 @@ function compare_activities_by_time_asc($a, $b) { return ($a->timestamp < $b->timestamp) ? -1 : 1; } -?> \ No newline at end of file diff --git a/course/recent_form.php b/course/recent_form.php index 12723ebca7d1d..d90048a5c6637 100644 --- a/course/recent_form.php +++ b/course/recent_form.php @@ -56,7 +56,7 @@ function definition() { } else { $groups = ''; } - + if ($courseusers = get_users_by_capability($context, 'moodle/course:view', 'u.id, u.firstname, u.lastname', 'lastname ASC, firstname DESC', '', '', $groups)) { foreach ($courseusers as $courseuser) { $options[$courseuser->id] = fullname($courseuser, $viewfullnames); diff --git a/course/report.php b/course/report.php index ad8711bc27d4f..510ecb003710b 100644 --- a/course/report.php +++ b/course/report.php @@ -1,4 +1,4 @@ -footer(); -?> + diff --git a/course/report/log/db/access.php b/course/report/log/db/access.php index cac7b0ed7a48f..43e741acd85ec 100644 --- a/course/report/log/db/access.php +++ b/course/report/log/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/log/graph.php b/course/report/log/graph.php index 59a9cd3ab92ec..eb72edd57131d 100644 --- a/course/report/log/graph.php +++ b/course/report/log/graph.php @@ -212,4 +212,3 @@ break; } -?> \ No newline at end of file diff --git a/course/report/log/index.php b/course/report/log/index.php index 2809042fcf5f2..7ca593c249879 100644 --- a/course/report/log/index.php +++ b/course/report/log/index.php @@ -1,4 +1,4 @@ -footer(); exit; -?> + diff --git a/course/report/log/indexlive.php b/course/report/log/indexlive.php index 63fa96490bd30..abfed36b8ebe3 100644 --- a/course/report/log/indexlive.php +++ b/course/report/log/indexlive.php @@ -1,4 +1,4 @@ -container_start('info'); $link = html_link::make('/course/report/log/live.php?id='. $course->id, get_string('livelogs')); $link->add_action(new popup_action('click', $link->url, 'livelog', array('height' => 500, 'width' => 800))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); echo $OUTPUT->container_end(); echo $OUTPUT->footer(); -?> + diff --git a/course/report/log/lib.php b/course/report/log/lib.php index 80cf0b64f7694..c43016811ee74 100644 --- a/course/report/log/lib.php +++ b/course/report/log/lib.php @@ -28,7 +28,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select global $USER, $CFG, $SITE, $DB, $OUTPUT, $SESSION; require_once $CFG->dirroot.'/mnet/peer.php'; - + $mnet_peer = new mnet_peer(); $mnet_peer->set_id($hostid); @@ -41,9 +41,9 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select if ($numcourses < COURSE_MAX_COURSES_PER_DROPDOWN && !$showcourses) { $showcourses = 1; } - + $sitecontext = get_context_instance(CONTEXT_SYSTEM); - + // Context for remote data is always SITE // Groups for remote data are always OFF if ($hostid == $CFG->mnet_localhost_id) { @@ -254,7 +254,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select echo "\n"; echo "\n"; if (has_capability('coursereport/log:view', $sitecontext) && $showcourses) { - $cid = empty($course->id)? '1' : $course->id; + $cid = empty($course->id)? '1' : $course->id; $select = html_select::make($dropdown, "host_course", $hostid.'/'.$cid); $select->nested = true; echo $OUTPUT->select($select); @@ -299,16 +299,16 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses"; print_string('logtoomanyusers','moodle',$a); } - + echo $OUTPUT->select(html_select::make($dates, "date", $selecteddate, get_string("alldays"))); - + $select = html_select::make($activities, "modid", $selectedactivity); $select->nothinglabel = get_string("allactivities"); $select->nothingvalue = ''; echo $OUTPUT->select($select); - + echo $OUTPUT->select(html_select::make($actions, 'modaction', $modaction, get_string("allactions"))); - + $logformats = array('showashtml' => get_string('displayonpage'), 'downloadascsv' => get_string('downloadtext'), 'downloadasods' => get_string('downloadods'), @@ -329,10 +329,10 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today' if ($numcourses < COURSE_MAX_COURSES_PER_DROPDOWN && !$showcourses) { $showcourses = 1; } - + $sitecontext = get_context_instance(CONTEXT_SYSTEM); $context = get_context_instance(CONTEXT_COURSE, $course->id); - + /// Setup for group handling. if ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { $selectedgroup = -1; @@ -367,7 +367,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today' // this may be a lot of users :-( $courseusers = $DB->get_records('user', array('deleted'=>0), 'lastaccess DESC', 'id, firstname, lastname, idnumber'); } - + if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$showusers) { $showusers = 1; } @@ -530,19 +530,19 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today' print_string('logtoomanyusers','moodle',$a); } echo $OUTPUT->select(html_select::make($dates, "date", $selecteddate, get_string("alldays"))); - + $select = html_select::make($activities, "modid", $selectedactivity); $select->nothinglabel = get_string("allactivities"); $select->nothingvalue = ''; echo $OUTPUT->select($select); - + echo $OUTPUT->select(html_select::make($actions, 'modaction', $modaction, get_string("allactions"))); - + $logformats = array('showashtml' => get_string('displayonpage'), 'downloadascsv' => get_string('downloadtext'), 'downloadasods' => get_string('downloadods'), 'downloadasexcel' => get_string('downloadexcel')); - + echo $OUTPUT->select(html_select::make($logformats, 'logformat', $logformat, false)); echo ''; echo ''; diff --git a/course/report/log/live.php b/course/report/log/live.php index 9ed7d5f5e02db..f59b1a69b38c7 100644 --- a/course/report/log/live.php +++ b/course/report/log/live.php @@ -1,4 +1,4 @@ -id); require_capability('coursereport/log:viewlive', $context); - add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id); + add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id); session_get_instance()->write_close(); // we override the default framename so header/footer - // links open in a new window + // links open in a new window if (empty($CFG->framename) || $CFG->framename==='_top') { $CFG->framename = '_blank'; } @@ -46,4 +46,4 @@ exit; -?> + diff --git a/course/report/log/mod.php b/course/report/log/mod.php index f949ace821f3c..bd38f793b19ea 100644 --- a/course/report/log/mod.php +++ b/course/report/log/mod.php @@ -1,4 +1,4 @@ -'; $link = html_link::make('/course/report/log/live.php?id='. $course->id, get_string('livelogs')); $link->add_action(new popup_action('click', $link->url, 'livelog', array('height' => 500, 'width' => 800))); - echo $OUTPUT->link($link); + echo $OUTPUT->link($link); echo '

    '; } -?> + diff --git a/course/report/log/version.php b/course/report/log/version.php index 7aa04cfbacb98..4c0cf26ff8448 100644 --- a/course/report/log/version.php +++ b/course/report/log/version.php @@ -1,4 +1,4 @@ -version = 2007101504; $plugin->requires = 2007101532; -?> + diff --git a/course/report/outline/db/access.php b/course/report/outline/db/access.php index 05cfadcc3f9d8..81a752302b00c 100644 --- a/course/report/outline/db/access.php +++ b/course/report/outline/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/outline/index.php b/course/report/outline/index.php index 19ba73e5df25e..8b1821e44e886 100644 --- a/course/report/outline/index.php +++ b/course/report/outline/index.php @@ -160,4 +160,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/course/report/outline/mod.php b/course/report/outline/mod.php index 1caf681ac30ef..22a5b66733572 100644 --- a/course/report/outline/mod.php +++ b/course/report/outline/mod.php @@ -1,4 +1,4 @@ -\n"; echo '

    '; } -?> \ No newline at end of file diff --git a/course/report/outline/version.php b/course/report/outline/version.php index 58927423af614..de2beeb5cd863 100644 --- a/course/report/outline/version.php +++ b/course/report/outline/version.php @@ -1,4 +1,4 @@ -version = 2007101501; $plugin->requires = 2007101532; -?> + diff --git a/course/report/participation/db/access.php b/course/report/participation/db/access.php index 420f633f98b0c..d90bc72023609 100644 --- a/course/report/participation/db/access.php +++ b/course/report/participation/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/participation/index.php b/course/report/participation/index.php index a9db751481dd6..6395dc53a1dc7 100644 --- a/course/report/participation/index.php +++ b/course/report/participation/index.php @@ -1,4 +1,4 @@ -dirroot.'/lib/tablelib.php'); @@ -13,7 +13,7 @@ $action = optional_param('action', '', PARAM_ALPHA); $page = optional_param('page', 0, PARAM_INT); // which page to show $perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page - + $PAGE->set_url('course/report/participation/index.php', compact('id', 'roleid', 'instanceid', 'timefrom', 'page', 'perpage')); if ($action != 'view' and $action != 'post') { @@ -185,7 +185,7 @@ } list($actionsql, $params) = $DB->get_in_or_equal($actions, SQL_PARAMS_NAMED, 'action0'); - $actionsql = "l.action $actionsql"; + $actionsql = "l.action $actionsql"; $relatedcontexts = get_related_contexts_string($context); @@ -291,4 +291,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/course/report/participation/mod.php b/course/report/participation/mod.php index 38428141ecd7d..5c1fbffb1474e 100644 --- a/course/report/participation/mod.php +++ b/course/report/participation/mod.php @@ -1,4 +1,4 @@ -\n"; echo '

    '; } -?> + diff --git a/course/report/participation/version.php b/course/report/participation/version.php index 58927423af614..de2beeb5cd863 100644 --- a/course/report/participation/version.php +++ b/course/report/participation/version.php @@ -1,4 +1,4 @@ -version = 2007101501; $plugin->requires = 2007101532; -?> + diff --git a/course/report/progress/db/access.php b/course/report/progress/db/access.php index da27d3f2e3f31..dbb4390dd77fc 100644 --- a/course/report/progress/db/access.php +++ b/course/report/progress/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/progress/index.php b/course/report/progress/index.php index 09286a872e4a4..8c9bc942920b0 100644 --- a/course/report/progress/index.php +++ b/course/report/progress/index.php @@ -291,4 +291,4 @@ function csv_quote($value) { get_string('excelcsvdownload','completion').''; echo $OUTPUT->footer(); -?> + diff --git a/course/report/progress/mod.php b/course/report/progress/mod.php index a2428a2bd1dc7..e8bbadce1eb92 100644 --- a/course/report/progress/mod.php +++ b/course/report/progress/mod.php @@ -1,4 +1,4 @@ -'; } } -?> + diff --git a/course/report/progress/textrotate.js b/course/report/progress/textrotate.js index 1c0a40e7ece12..41dbfbef3ac5c 100644 --- a/course/report/progress/textrotate.js +++ b/course/report/progress/textrotate.js @@ -3,7 +3,7 @@ var SVGNS='http://www.w3.org/2000/svg',XLINKNS='http://www.w3.org/1999/xlink'; function textrotate_make_svg(el) { var string=el.firstChild.nodeValue; - + // Add absolute-positioned string (to measure length) var abs=document.createElement('div'); abs.appendChild(document.createTextNode(string)); @@ -18,7 +18,7 @@ function textrotate_make_svg(el) var width=(textHeight*9)/8; svg.setAttribute('width',width); svg.setAttribute('height',textWidth+20); - + // Add text var text=document.createElementNS(SVGNS,'text'); svg.appendChild(text); @@ -27,7 +27,7 @@ function textrotate_make_svg(el) text.setAttribute('text-anchor','end'); text.setAttribute('transform','rotate(90)'); text.appendChild(document.createTextNode(string)); - + // Is there an icon near the text? var icon=el.parentNode.firstChild; if(icon.nodeName.toLowerCase()=='img') { @@ -41,7 +41,7 @@ function textrotate_make_svg(el) image.setAttribute('height',16); image.setAttributeNS(XLINKNS,'href',icon.src); svg.appendChild(image); - } + } // Replace original content with this new SVG el.parentNode.insertBefore(svg,el); @@ -59,7 +59,7 @@ function textrotate_init() { elements=YAHOO.util.Dom.getElementsByClassName('completion-expected', 'div'); for(var i=0;iversion = 2007101500; $plugin->requires = 2007101532; -?> + diff --git a/course/report/stats/db/access.php b/course/report/stats/db/access.php index 573b38b962eea..29dbd7914b918 100644 --- a/course/report/stats/db/access.php +++ b/course/report/stats/db/access.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/stats/graph.php b/course/report/stats/graph.php index 8a5796c5c1724..d5da0b1fdcc22 100644 --- a/course/report/stats/graph.php +++ b/course/report/stats/graph.php @@ -181,4 +181,3 @@ $graph->draw_stack(); -?> \ No newline at end of file diff --git a/course/report/stats/index.php b/course/report/stats/index.php index 642c72fb8cef1..6ff293ad29dca 100644 --- a/course/report/stats/index.php +++ b/course/report/stats/index.php @@ -1,4 +1,4 @@ -dirroot.'/lib/statslib.php'); @@ -71,4 +71,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/course/report/stats/mod.php b/course/report/stats/mod.php index e1257b4a9f356..1f70b7af2bca3 100644 --- a/course/report/stats/mod.php +++ b/course/report/stats/mod.php @@ -1,4 +1,4 @@ -'; } } -?> + diff --git a/course/report/stats/report.php b/course/report/stats/report.php index 53a9a2cecdce5..4be01a4b6fd94 100644 --- a/course/report/stats/report.php +++ b/course/report/stats/report.php @@ -1,4 +1,4 @@ - + diff --git a/course/report/stats/version.php b/course/report/stats/version.php index 58927423af614..de2beeb5cd863 100644 --- a/course/report/stats/version.php +++ b/course/report/stats/version.php @@ -1,4 +1,4 @@ -version = 2007101501; $plugin->requires = 2007101532; -?> + diff --git a/course/request.php b/course/request.php index 518b7d6b16860..5a3d88610b91c 100644 --- a/course/request.php +++ b/course/request.php @@ -55,7 +55,7 @@ if ($requestform->is_cancelled()){ redirect($returnurl); -} else if ($data = $requestform->get_data()) { +} else if ($data = $requestform->get_data()) { $request = course_request::create($data); // and redirect back to the course listing. diff --git a/course/request_form.php b/course/request_form.php index 5fc5da7cb93e8..604dd8445d0fa 100644 --- a/course/request_form.php +++ b/course/request_form.php @@ -141,4 +141,4 @@ function definition() { $this->add_action_buttons(true, get_string('reject')); } } -?> + diff --git a/course/reset.php b/course/reset.php index 56088f35f81c3..6c26bbe40e53c 100755 --- a/course/reset.php +++ b/course/reset.php @@ -103,4 +103,4 @@ $mform->display(); echo $OUTPUT->footer(); -?> + diff --git a/course/reset_form.php b/course/reset_form.php index 88b19793ffbf1..43f9a30cfb14d 100644 --- a/course/reset_form.php +++ b/course/reset_form.php @@ -1,4 +1,4 @@ -libdir.'/formslib.php'; class course_reset_form extends moodleform { diff --git a/course/resources.php b/course/resources.php index e1fb68a0fca3e..b740707fded97 100644 --- a/course/resources.php +++ b/course/resources.php @@ -18,9 +18,9 @@ /** * List of all resource type modules in course * - * @package moodlecore + * @package moodlecore * @copyright 2009 Petr Skoda (http://skodak.org) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once('../config.php'); diff --git a/course/rest.php b/course/rest.php index d8e5e161d068d..7f072e7be0623 100644 --- a/course/rest.php +++ b/course/rest.php @@ -212,4 +212,4 @@ break; } -?> + diff --git a/course/scales.php b/course/scales.php index 38139bd6ff850..afbae3ff13a3a 100644 --- a/course/scales.php +++ b/course/scales.php @@ -134,4 +134,3 @@ echo $OUTPUT->close_window_button(); echo $OUTPUT->footer(); -?> \ No newline at end of file diff --git a/course/search.php b/course/search.php index 763fed0e31260..38bedc557e4a2 100644 --- a/course/search.php +++ b/course/search.php @@ -1,4 +1,4 @@ -set_url('course/search.php', compact('search', 'page', 'perpage', 'blocklist', 'modulelist', 'edit')); $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); $search = trim(strip_tags($search)); // trim & clean raw searched string @@ -190,7 +190,7 @@ $form = new html_form(); $form->url = new moodle_url("$CFG->wwwroot/course/search.php", array( - 'edit' => $edit, + 'edit' => $edit, 'sesskey' => sesskey(), 'search' => s($search, true), 'page' => $page, @@ -394,4 +394,4 @@ function print_navigation_bar($totalcount,$page,$perpage,$encodedsearch,$modulel } } -?> + diff --git a/course/simpletest/broken_testexternal.php b/course/simpletest/broken_testexternal.php index 1758e58f416e0..497ce1ee1045c 100644 --- a/course/simpletest/broken_testexternal.php +++ b/course/simpletest/broken_testexternal.php @@ -74,7 +74,7 @@ function setUp() { $course->shortname = "TestCourseForCourse"; $course->idnumber = 123456789; $course = create_course($course); - $this->course = $course; + $this->course = $course; } @@ -314,7 +314,7 @@ function test_get_course_modules() { $course["id"] = $this->course->id; $params[] = $course; $activities = course_external::get_course_modules($params); - + $activities = course_external::get_course_activities($params); varlog($activities); chat_delete_instance($chatid); @@ -331,4 +331,4 @@ function test_get_course_modules() { } */ } -?> + diff --git a/course/simpletest/testcourselib.php b/course/simpletest/testcourselib.php index 3afb478fb0020..2104d84491e95 100755 --- a/course/simpletest/testcourselib.php +++ b/course/simpletest/testcourselib.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/course/togglecompletion.php b/course/togglecompletion.php index 5a72f5f4d857f..31f7462121568 100644 --- a/course/togglecompletion.php +++ b/course/togglecompletion.php @@ -81,4 +81,3 @@ function error_or_ajax($message) { redirect($backto); } -?> \ No newline at end of file diff --git a/course/unenrol.php b/course/unenrol.php index 04453d3fc8d81..95aa9c9b8afd9 100644 --- a/course/unenrol.php +++ b/course/unenrol.php @@ -121,4 +121,3 @@ echo $OUTPUT->footer(); -?> \ No newline at end of file diff --git a/course/user.php b/course/user.php index 81c453c6e545d..bc89ef044209b 100644 --- a/course/user.php +++ b/course/user.php @@ -390,4 +390,3 @@ function print_outline_row($mod, $instance, $result) { echo "