echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"filedata\">\n";
if (file_exists("$langdir/$currentfile")) {
- echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
+ echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
} else {
echo ($filetemplate);
}
foreach ($modules as $module) {
$strmodulename = get_string("modulename", "$module->name");
- // Deal with modules which are lacking the language string
- if ($strmodulename == '[[modulename]]') {
- $strmodulename = $module->name;
- }
+ // Deal with modules which are lacking the language string
+ if ($strmodulename == '[[modulename]]') {
+ $strmodulename = $module->name;
+ }
$modulebyname[$strmodulename] = $module;
}
ksort($modulebyname);
$fullname = fullname($USER, true);
$editmyprofile = '<a title="'.$fullname.'" href="'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&course='.$this->instance->pageid.'">'.get_string('editmyprofile').'</a>';
if (empty($USER->description)) {
- //Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
+ //Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
$text = get_string('profile').' '.get_string('missingdescription');
$this->content->items[]= $editmyprofile.' <a title="'.$text.'" class="useredit blink">*<span class="accesshide">'.$text.'</span></a>';
} else {
$editmyprofile = '<a title="'.$fullname.'" href="'.$CFG->wwwroot.'/user/edit.php?id='.
$USER->id.'&course='.$this->instance->pageid.'">'.get_string('editmyprofile').'</a>';
if (empty($USER->description)) {
- //Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
+ //Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
$text = get_string('profile').' '.get_string('missingdescription');
$this->content->items[]= $editmyprofile.' <a title="'.$text.'" class="useredit blink">*<span class="accesshide">'.$text.'</span></a>';
} else {
<td><input type="text" name="title" size="50" value="<?php p($this->config->title) ?>" /></td>
</tr>
-<tr valign=top>
+<tr valign=top>
<td align=right><?php print_string("select_glossary","block_glossary_random") ?>:</td>
<td><?php choose_from_menu($glossaries,"glossary",$this->config->glossary) ?></td>
</tr>
-<tr valign=top>
+<tr valign=top>
<td align=right><?php print_string("refresh","block_glossary_random") ?>:</td>
<td><input type="text" name="refresh" size="5" value="<?php p($this->config->refresh) ?>" /></td>
</tr>
-<tr valign=top>
-<td align=right><?php print_string("type","block_glossary_random") ?>:</td>
+<tr valign=top>
+<td align=right><?php print_string("type","block_glossary_random") ?>:</td>
<td><?php
choose_from_menu($type, "type", $this->config->type, "");
helpbutton("",get_string("type","block_glossary_random"),"moodle",true,false,get_string("typehelp","block_glossary_random"));
?></td>
</tr>
-<tr valign=top>
-<td align=right><?php print_string("showconcept","block_glossary_random") ?>:</td>
+<tr valign=top>
+<td align=right><?php print_string("showconcept","block_glossary_random") ?>:</td>
<td>
<input type="hidden" name="showconcept" value="0" />
<input type="checkbox" name="showconcept" value="1" <?php if(!empty($this->config->showconcept)) echo 'checked="checked"'; ?> /></td>
//Now, we have in users, the list of users to show
//Because they are online
if (!empty($users)) {
- //Accessibility: Don't want 'Alt' text for the user picture; DO want it for the envelope/message link (existing lang string).
- //Accessibility: Converted <div> to <ul>, inherit existing classes & styles.
- $this->content->text .= "<ul class='list'>\n";
+ //Accessibility: Don't want 'Alt' text for the user picture; DO want it for the envelope/message link (existing lang string).
+ //Accessibility: Converted <div> to <ul>, inherit existing classes & styles.
+ $this->content->text .= "<ul class='list'>\n";
foreach ($users as $user) {
- $this->content->text .= '<li class="listentry">';
+ $this->content->text .= '<li class="listentry">';
$timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage
$this->content->text .= print_user_picture($user->id, $this->instance->pageid, $user->picture, 16, true).' ';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a>';
</tr>
<tr>
<td colspan="2" align="center">
- <input type="submit" value="<?php print_string("savechanges"); ?>" />
+ <input type="submit" value="<?php print_string("savechanges"); ?>" />
<input type="button" value="<?php print_string('cancel'); ?>" onclick="javascript:history.go(-1)" /></td>
</tr>
</table>
/// If data submitted, then process and store.
- if ($post = data_submitted()) {
+ if ($post = data_submitted()) {
$pagesize = optional_param('pagesize', 10, PARAM_INT);
if ($pagesize < 1 ) {
print_simple_box_start('center', '', '');
- include('./preferences.html');
+ include('./preferences.html');
print_simple_box_end();
print_footer();
//Accessibility: functionality moved to calendar_get_popup.
if($display->thismonth && $day == $d) {
- $popup = calendar_get_popup(true, $events[$eventid]->timestart, $popupcontent);
+ $popup = calendar_get_popup(true, $events[$eventid]->timestart, $popupcontent);
} else {
- $popup = calendar_get_popup(false, $events[$eventid]->timestart, $popupcontent);
+ $popup = calendar_get_popup(false, $events[$eventid]->timestart, $popupcontent);
}
// Class and cell content
}
// Special visual fx for today
- //Accessibility: hidden text for today, and popup.
+ //Accessibility: hidden text for today, and popup.
if($display->thismonth && $day == $d) {
$class .= ' today';
$today = get_string('today', 'calendar').' '.userdate(time(), get_string('strftimedayshort'));
if(! isset($eventsbyday[$day])) {
- $class .= ' eventnone';
- $popup = calendar_get_popup(true, false);
- $cell = '<a href="#" '.$popup.'>'.$day.'</a>';
+ $class .= ' eventnone';
+ $popup = calendar_get_popup(true, false);
+ $cell = '<a href="#" '.$popup.'>'.$day.'</a>';
}
$cell = '<span class="accesshide">'.$today.' </span>'.$cell;
}
if (false === $event_timestart) {
$popupcaption .= userdate(time(), get_string('strftimedayshort'));
$popupcontent = get_string('eventnone', 'calendar');
-
+
} else {
$popupcaption .= get_string('eventsfor', 'calendar', userdate($event_timestart, get_string('strftimedayshort')));
}
$popupcontent = str_replace("'", "\'", htmlspecialchars($popupcontent));
$popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"';
- return $popup;
+ return $popup;
}
function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxevents, $fromtime=0) {
$strimport = get_string("importdata");
$tcourseids = '';
-
+
if ($teachers = get_records_select('user_teachers', "userid = $USER->id AND editall = 1",'','id,course')) {
foreach ($teachers as $teacher) {
if ($teacher->course != $course->id && $teacher->course != SITEID){
}
$taught_courses = array();
- if (!empty($tcourseids)) {
+ if (!empty($tcourseids)) {
$tcourseids = substr($tcourseids,0,-1);
$taught_courses = get_records_list('course', 'id', $tcourseids);
}
}
else {
foreach ($courses as $course) {
- echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
+ echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
}
}
}
$form = stripslashes_safe($form);
}
- // !! no db access using data from $form beyond this point !!
+ // !! no db access using data from $form beyond this point !!
}
// print_simple_box(get_string('courserequestintro'),'center');
}
if ($oldversion < 2006010200) { // rename an_review_day
- if (isset($CFG->an_review_day)) {
- set_config('an_capture_day', $CFG->an_review_day);
- delete_records('config', 'name', 'an_review_day');
- }
+ if (isset($CFG->an_review_day)) {
+ set_config('an_capture_day', $CFG->an_review_day);
+ delete_records('config', 'name', 'an_review_day');
+ }
}
if ($oldversion < 2006020100) { // rename an_cutoff_hour and an_cutoff_min to an_cutoff
table_column('enrol_authorize', 'transid', 'transid', 'integer', '10', 'unsigned', '0', 'not null');
}
- if ($oldversion < 2006050400) { // Create transid indexes for backup & restore speed.
- execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_transid_idx ON {$CFG->prefix}enrol_authorize(transid);", false);
- execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_refunds_transid_idx ON {$CFG->prefix}enrol_authorize_refunds(transid);", false);
- }
-
return $result;
}
}
if($CFG->enrol_imssourcedidfallback && trim($person->username)==''){
// This is the point where we can fall back to useing the "sourcedid" if "userid" is not supplied
- // NB We don't use an "elseif" because the tag may be supplied-but-empty
+ // NB We don't use an "elseif" because the tag may be supplied-but-empty
$person->username = $person->idnumber;
}
if(preg_match('{<email>(.*?)</email>}is', $tagcontents, $matches)){
require_login();
if (!$site = get_site()) {
- redirect("index.php");
+ redirect("index.php");
}
if (!isadmin()) {
- error("Only the admin can use this page");
+ error("Only the admin can use this page");
}
/// get language strings
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
print_header("$site->shortname: $str->enrolments", "$site->fullname",
- "<a href=\"../../admin/index.php\">$str->administration</a> ->
- <a href=\"../../admin/users.php\">$str->users</a> ->
- $str->enrolments -> IMS import");
+ "<a href=\"../../admin/index.php\">$str->administration</a> ->
+ <a href=\"../../admin/users.php\">$str->users</a> ->
+ $str->enrolments -> IMS import");
require_once('enrol.php');
unlink( "{$this->temp_dir}/$filename.gif" );
unlink( "{$this->temp_dir}/$filename.aux" );
unlink( "{$this->temp_dir}/$filename.log" );
- return;
+ return;
}
}
`uniquelogins` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
modify_database("","CREATE TABLE prefix_stats_weekly (
`uniquelogins` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
modify_database("","CREATE TABLE prefix_stats_monthly (
`uniquelogins` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
modify_database("","CREATE TABLE prefix_stats_user_daily (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
modify_database("","CREATE TABLE prefix_stats_user_weekly (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
modify_database("","CREATE TABLE prefix_stats_user_monthly (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);");
}
PRIMARY KEY (`id`),
KEY `category` (`category`),
KEY `idnumber` (`idnumber`),
- KEY `shortname` (`shortname`)
+ KEY `shortname` (`shortname`)
) TYPE=MyISAM;
# --------------------------------------------------------
`uniquelogins` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);
CREATE TABLE prefix_stats_monthly (
`uniquelogins` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);
CREATE TABLE prefix_stats_user_daily (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);
CREATE TABLE prefix_stats_user_weekly (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);
CREATE TABLE prefix_stats_user_monthly (
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
KEY `roleid` (`roleid`),
- KEY `timeend` (`timeend`)
+ KEY `timeend` (`timeend`)
);
#
if ($oldversion < 2005012500) { // add new table for meta courses.
/*
modify_database("","CREATE TABLE prefix_meta_course (
- id SERIAL primary key,
- parent_course integer NOT NULL,
- child_course integer NOT NULL
+ id SERIAL primary key,
+ parent_course integer NOT NULL,
+ child_course integer NOT NULL
);");
modify_database("","CREATE INDEX prefix_meta_course_parent_idx ON prefix_meta_course (parent_course);");
execute_sql("ALTER TABLE {$CFG->prefix}course DROP COLUMN meta_course",false); // drop silently
modify_database("","CREATE TABLE prefix_course_meta (
- id SERIAL primary key,
- parent_course integer NOT NULL,
- child_course integer NOT NULL
+ id SERIAL primary key,
+ parent_course integer NOT NULL,
+ child_course integer NOT NULL
);");
modify_database("","CREATE INDEX prefix_course_meta_parent_idx ON prefix_course_meta (parent_course);");
CREATE INDEX prefix_course_display_courseuserid_idx ON prefix_course_display (course,userid);
CREATE TABLE prefix_course_meta (
- id SERIAL primary key,
- parent_course integer NOT NULL,
- child_course integer NOT NULL
+ id SERIAL primary key,
+ parent_course integer NOT NULL,
+ child_course integer NOT NULL
);
CREATE INDEX prefix_course_meta_parent_idx ON prefix_course_meta (parent_course);
}
/// All this work has to be done ONLY it it hasn't been done before
- if (!$linkobject->work_calculated) {
+ if (!$linkobject->work_calculated) {
if (!isset($linkobject->hreftagbegin) or !isset($linkobject->hreftagend)) {
$linkobject->work_hreftagbegin = '<span class="highlight"';
$linkobject->work_hreftagend = '</span>';
$timestr = str_replace('user_','',$timestr); // just in case.
$fun = 'stats_get_base_'.$timestr;
-
+
$now = $fun();
$times = array();
global $CFG;
if (empty($courseid)) {
- $courseid = SITEID;
+ $courseid = SITEID;
}
$latestday = stats_get_start_from('daily');
if (empty($goodreferer)) {
$goodreferer = qualified_me();
// try to remove everything after ? because POST url may contain GET parameters (SID rewrite, etc.)
- $pos = strpos($goodreferer, '?');
+ $pos = strpos($goodreferer, '?');
if ($pos !== FALSE) {
$goodreferer = substr($goodreferer, 0, $pos);
}
if ($navigation) {
//Accessibility: breadcrumb links now in a list, » replaced with image.
- $nav_text = get_string('youarehere','access');
- echo '<h2 class="accesshide">'.$nav_text.",</h2><ul>\n";
+ $nav_text = get_string('youarehere','access');
+ echo '<h2 class="accesshide">'.$nav_text.",</h2><ul>\n";
if (! $site = get_site()) {
$site->shortname = get_string('home');
}
// Handles the case of another Moodle site linking into a page on this site
include($CFG->dirroot.'/login/weblinkauth.php');
if (function_exists(weblink_auth)) {
- $user = weblink_auth($SESSION->wantsurl);
+ $user = weblink_auth($SESSION->wantsurl);
}
if ($user) {
- $frm->username = $user->username;
+ $frm->username = $user->username;
} else {
$frm = data_submitted($loginurl);
}
<?php
$course->maxbytes = get_field('course', 'maxbytes', 'id', $this->data->course);
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
- choose_from_menu ($choices, "param3", $this->field->param3, "");
+ choose_from_menu ($choices, "param3", $this->field->param3, "");
?>
</td>
</tr>