Skip to content

Commit

Permalink
MDL-20700 coding style cleanup - cvs keywords removed, closign php ta…
Browse files Browse the repository at this point in the history
…g removed, trailing whitespace cleanup
  • Loading branch information
skodak committed Nov 4, 2009
1 parent da3ab9c commit aa6c1ce
Show file tree
Hide file tree
Showing 211 changed files with 1,677 additions and 1,704 deletions.
2 changes: 1 addition & 1 deletion calendar/event_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion calendar/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
28 changes: 14 additions & 14 deletions calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -572,9 +572,9 @@ function calendar_print_event($event, $showactions=true) {
if (isset($event->cssclass)) {
echo '<td class="description '.$event->cssclass.'">';
} else {
echo '<td class="description">';
echo '<td class="description">';
}

echo $event->description;
if (calendar_edit_event_allowed($event) && $showactions) {
echo '<div class="commands">';
Expand Down Expand Up @@ -860,7 +860,7 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL, $courses
} else {
$content .= '<td style="width: 11px;"><img src="'.$OUTPUT->old_icon_url('t/show') . '" class="iconsmall" alt="'.get_string('hide').'" title="'.get_string('tt_showcourse', 'calendar').'" style="cursor:pointer" onclick="location.href='."'".CALENDAR_URL.'set.php?var=showcourses'.$getvars."'".'" /></td>';
$content .= '<td><a href="'.CALENDAR_URL.'set.php?var=showcourses'.$getvars.'" title="'.get_string('tt_showcourse', 'calendar').'">'.get_string('course', 'calendar').'</a></td>'."\n";

}


Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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&amp;id='.$this->properties->id, $this->properties->name);

Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions calendar/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
?>
<p><?php print_string('explain_timeformat', 'calendar'); ?></p>
Expand All @@ -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);
?>
<p><?php print_string('explain_startwday', 'calendar'); ?></p>
Expand All @@ -46,7 +46,7 @@
$options[$i] = $i;
}
$select = html_select::make($options, "maxevents", $prefs->maxevents, false);
$select->nothingvalue = '';
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_maxevents', 'calendar'); ?></p>
Expand All @@ -62,7 +62,7 @@
$options[$i] = $i;
}
$select = html_select::make($options, "lookahead", $prefs->lookahead, false);
$select->nothingvalue = '';
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_lookahead', 'calendar'); ?></p>
Expand All @@ -72,9 +72,9 @@
<tr>
<th scope="row"><?php print_string('pref_persistflt', 'calendar')?>:</th>
<td>
<?php
<?php
$select = html_select::make(array(0 => get_string('no'), 1 => get_string('yes')), 'persistflt', $prefs->persistflt, false);
$select->nothingvalue = '';
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_persistflt', 'calendar'); ?></p>
Expand Down
96 changes: 48 additions & 48 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -539,54 +539,54 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course

echo "</table>\n"; // Tabular display of days ends

// OK, now for the filtering display
echo '<div class="filters"><table><tr>';
// Global events
if($SESSION->cal_show_global) {
echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// Course events
if(!empty($SESSION->cal_show_course)) {
echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
// OK, now for the filtering display
echo '<div class="filters"><table><tr>';

// Global events
if($SESSION->cal_show_global) {
echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}

// Course events
if(!empty($SESSION->cal_show_course)) {
echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}

echo "</tr>\n";

if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// User events
if($SESSION->cal_show_user) {
echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
}
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// User events
if($SESSION->cal_show_user) {
echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
}

echo '</table></div>';
}

Expand Down
10 changes: 5 additions & 5 deletions course/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -13,7 +13,7 @@ function completion_init() {
completion_init_toggle(toggles[i]);
}
}
}
}

function completion_init_toggle(form) {
// Store all necessary references for easy access
Expand All @@ -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];
}
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions course/delete_category_form.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php //$Id$
<?php

require_once($CFG->libdir.'/formslib.php');
require_once($CFG->libdir.'/questionlib.php');
Expand Down Expand Up @@ -141,4 +141,4 @@ function validation($data, $files) {
return $errors;
}
}
?>

1 change: 0 additions & 1 deletion course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,3 @@

echo $OUTPUT->footer();

?>
6 changes: 3 additions & 3 deletions course/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function definition() {
$coursecontext = null;
$context = $categorycontext;
}

/// form definition with new course defaults
//--------------------------------------------------------------------------------
$mform->addElement('header','general', get_string('general', 'form'));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -496,4 +496,4 @@ function validation($data, $files) {
return $errors;
}
}
?>

2 changes: 1 addition & 1 deletion course/editcategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@
$mform->display();

echo $OUTPUT->footer();
?>

6 changes: 3 additions & 3 deletions course/editcategory_form.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class editcategory_form extends moodleform {

Expand Down Expand Up @@ -41,5 +41,5 @@ function definition() {

$this->add_action_buttons(true, $strsubmit);
}
}
?>
}

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

require_once($CFG->libdir.'/formslib.php');

Expand Down
1 change: 0 additions & 1 deletion course/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@

/// Easy!

?>
Loading

0 comments on commit aa6c1ce

Please sign in to comment.