Permalink
Browse files

weekly moodle 2.1.5+ update

  • Loading branch information...
burningTyger committed Mar 29, 2012
1 parent 473165d commit 28af3a147ebb8c9de775f32d79d719a28de0253c
@@ -107,7 +107,7 @@ function definition() {
$mform->setType('id', PARAM_INT);
if (!empty($service->id)) {
- $buttonlabel = get_string('editaservice', 'webservice');
+ $buttonlabel = get_string('savechanges');
} else {
$buttonlabel = get_string('addaservice', 'webservice');
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -40,6 +40,7 @@
$string['databasename'] = 'Datanbanknaam:';
$string['databasetypehead'] = 'Kies databankdriver';
$string['dataroot'] = 'Gegevensmap';
+$string['datarootpermission'] = 'Toestemming datamappen';
$string['dbprefix'] = 'Tabelvoorvoegsel';
$string['dirroot'] = 'Moodle-map';
$string['environmenthead'] = 'Omgeving controleren ...';
View
@@ -66,6 +66,7 @@
$string['backuptype'] = 'Type';
$string['backuptypeactivity'] = 'Activity';
$string['backuptypecourse'] = 'Course';
+$string['backuptypesection'] = 'Section';
$string['backupversion'] = 'Backup version';
$string['cannotfindassignablerole'] = 'The {$a} role in the backup file cannot be mapped to any of the roles that you are allowed to assign.';
$string['choosefilefromcoursebackup'] = 'Course backup area';
@@ -182,7 +182,6 @@ main_class.prototype.mk_button = function(tag, imgSrc, text, attributes, imgAttr
image.setAttribute('src', imgSrc);
image.setAttribute('alt', text);
- //image.setAttribute('title', '');
container.appendChild(image);
if (attributes != null) {
View
@@ -161,6 +161,7 @@ function print_javascript($courseid, $return=false) {
}
$output .= " main.portal.icons['spacerimg']='".$OUTPUT->pix_url('spacer')."';\n";
$output .= " main.portal.icons['marker']='".$OUTPUT->pix_url('i/marker')."';\n";
+ $output .= " main.portal.icons['marked']='".$OUTPUT->pix_url('i/marked')."';\n";
$output .= " main.portal.icons['ihide']='".$OUTPUT->pix_url('i/hide')."';\n";
$output .= " main.portal.icons['move_2d']='".$OUTPUT->pix_url('i/move_2d')."';\n";
$output .= " main.portal.icons['show']='".$OUTPUT->pix_url('t/show')."';\n";
@@ -92,7 +92,13 @@ section_class.prototype.init_buttons = function() {
}
if (main.getString('courseformat', this.sectionId) != "weeks" && this.sectionId > 0) {
- var highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId));
+ var highlightbutton = '';
+ //If current topic, then initalised as marked else marker
+ if (YAHOO.util.Dom.hasClass(this.getEl(),'current')) {
+ highlightbutton = main.mk_button('div', main.portal.icons['marked'], main.getString('marked', this.sectionId));
+ } else {
+ highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId));
+ }
YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true);
commandContainer.appendChild(highlightbutton);
this.highlightButton = highlightbutton;
@@ -331,7 +337,10 @@ section_class.prototype.toggle_hide = function(e,target,superficial) {
YAHOO.util.Dom.removeClass(this.getEl(), 'hidden');
this.viewButton.childNodes[0].src = this.viewButton.childNodes[0].src.replace(/show/i, 'hide');
this.viewButton.childNodes[0].alt = this.viewButton.childNodes[0].alt.replace(strshow, strhide);
- this.viewButton.childNodes[0].title = this.viewButton.childNodes[0].title.replace(strshow, strhide); //IE hack.
+ // mk_button set title only in ie, so check before setting it
+ if (this.viewButton.childNodes[0].title) {
+ this.viewButton.childNodes[0].title = this.viewButton.childNodes[0].title.replace(strshow, strhide); //IE hack.
+ }
this.viewButton.title = this.viewButton.title.replace(strshow, strhide);
this.hidden = false;
@@ -347,7 +356,9 @@ section_class.prototype.toggle_hide = function(e,target,superficial) {
YAHOO.util.Dom.addClass(this.getEl(), 'hidden');
this.viewButton.childNodes[0].src = this.viewButton.childNodes[0].src.replace(/hide/i, 'show');
this.viewButton.childNodes[0].alt = this.viewButton.childNodes[0].alt.replace(strhide, strshow);
- this.viewButton.childNodes[0].title = this.viewButton.childNodes[0].title.replace(strhide, strshow); //IE hack.
+ if (this.viewButton.childNodes[0].title) {
+ this.viewButton.childNodes[0].title = this.viewButton.childNodes[0].title.replace(strhide, strshow); //IE hack.
+ }
this.viewButton.title = this.viewButton.title.replace(strhide, strshow);
this.hidden = true;
@@ -363,11 +374,27 @@ section_class.prototype.toggle_hide = function(e,target,superficial) {
section_class.prototype.toggle_highlight = function() {
+ var strmarker = main.portal.strings['marker'];
+ var strmarked = main.portal.strings['marked'];
+
if (this.highlighted) {
YAHOO.util.Dom.removeClass(this.getEl(), 'current');
+ this.highlightButton.childNodes[0].src = main.portal.icons['marker'];
+ this.highlightButton.childNodes[0].alt = strmarker;
+ // mk_button set title only in ie, so check before setting it
+ if (this.highlightButton.childNodes[0].title) {
+ this.highlightButton.childNodes[0].title = strmarker; //for IE
+ }
+ this.highlightButton.title = strmarker;
this.highlighted = false;
} else {
YAHOO.util.Dom.addClass(this.getEl(), 'current');
+ this.highlightButton.childNodes[0].src = main.portal.icons['marked'];
+ this.highlightButton.childNodes[0].alt = strmarked;
+ if (this.highlightButton.childNodes[0].title) {
+ this.highlightButton.childNodes[0].title = strmarked; //for IE
+ }
+ this.highlightButton.title = strmarked;
this.highlighted = true;
}
};
View
@@ -1555,9 +1555,19 @@ function get_mimetype_description($mimetype, $capitalise=false) {
*/
function send_file_not_found() {
global $CFG, $COURSE;
- header('HTTP/1.0 404 not found');
+ send_header_404();
print_error('filenotfound', 'error', $CFG->wwwroot.'/course/view.php?id='.$COURSE->id); //this is not displayed on IIS??
}
+/**
+ * Helper function to send correct 404 for server.
+ */
+function send_header_404() {
+ if (substr(php_sapi_name(), 0, 3) == 'cgi') {
+ header("Status: 404 Not Found");
+ } else {
+ header('HTTP/1.0 404 not found');
+ }
+}
/**
* Check output buffering settings before sending file.
@@ -1612,7 +1622,7 @@ function send_temp_file($path, $filename, $pathisstring=false) {
if (!$pathisstring) {
if (!file_exists($path)) {
- header('HTTP/1.0 404 not found');
+ send_header_404();
print_error('filenotfound', 'error', $CFG->wwwroot.'/');
}
// executed after normal finish or abort
View
@@ -129,7 +129,7 @@ function message_send($eventdata) {
} else {
//MDL-25114 They supplied an $eventdata->component $eventdata->name combination which doesn't
//exist in the message_provider table (thus there is no default settings for them)
- $preferrormsg = get_string('couldnotfindpreference', 'message', $preferencename);
+ $preferrormsg = get_string('couldnotfindpreference', 'message', $defaultpreference);
throw new coding_exception($preferrormsg,'blah');
}
View
@@ -2413,7 +2413,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if (get_user_preferences('auth_forcepasswordchange') && !session_is_loggedinas()) {
$userauth = get_auth_plugin($USER->auth);
if ($userauth->can_change_password() and !$preventredirect) {
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
if ($changeurl = $userauth->change_password_url()) {
//use plugin custom url
redirect($changeurl);
@@ -2436,7 +2438,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('User not fully set-up');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/user/edit.php?id='. $USER->id .'&course='. SITEID);
}
@@ -2456,13 +2460,17 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('Policy not agreed');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/user/policy.php');
} else if (!empty($CFG->sitepolicyguest) and isguestuser()) {
if ($preventredirect) {
throw new require_login_exception('Policy not agreed');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/user/policy.php');
}
}
@@ -2629,7 +2637,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('Not enrolled');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/enrol/index.php?id='. $course->id);
}
}
View
@@ -1508,7 +1508,7 @@ function message_search_users($courseid, $searchtext, $sort='', $exceptions='')
// everyone who has a role assignment in this course or higher
$params = array($USER->id, "%$searchtext%");
- $users = $DB->get_records_sql("SELECT $ufields, mc.id as contactlistid, mc.blocked
+ $users = $DB->get_records_sql("SELECT DISTINCT $ufields, mc.id as contactlistid, mc.blocked
FROM {user} u
JOIN {role_assignments} ra ON ra.userid = u.id
LEFT JOIN {message_contacts} mc
@@ -28,6 +28,7 @@ function definition() {
// visible elements
$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']);
+ $mform->addRule('files_filemanager', get_string('uploadnofilefound'), 'required', null, 'client');
// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
@@ -30,6 +30,7 @@ function definition() {
//$mform->addElement('filemanager', 'newfile', get_string('uploadafile'));
//$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']);
$mform->addElement('filepicker', 'assignment_file', get_string('uploadafile'), null, $instance['options']);
+ $mform->addRule('assignment_file', get_string('uploadnofilefound'), 'required', null, 'client');
// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
View
@@ -100,16 +100,16 @@
echo $OUTPUT->box(format_module_intro('choice', $choice, $cm->id), 'generalbox', 'intro');
}
+ $timenow = time();
$current = false; // Initialise for later
- //if user has already made a selection, and they are not allowed to update it, show their selected answer.
+ //if user has already made a selection, and they are not allowed to update it or if choice is not open, show their selected answer.
if (isloggedin() && ($current = $DB->get_record('choice_answers', array('choiceid' => $choice->id, 'userid' => $USER->id))) &&
- empty($choice->allowupdate) ) {
+ (empty($choice->allowupdate) || ($timenow > $choice->timeclose)) ) {
echo $OUTPUT->box(get_string("yourselection", "choice", userdate($choice->timeopen)).": ".format_string(choice_get_option_text($choice, $current->optionid)), 'generalbox', 'yourselection');
}
/// Print the form
$choiceopen = true;
- $timenow = time();
if ($choice->timeclose !=0) {
if ($choice->timeopen > $timenow ) {
echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "generalbox notopenyet");
@@ -201,6 +201,7 @@ function lesson_unseen_branch_jump($lesson, $userid) {
// this function searches through the lesson pages to find all the branch tables
// that follow the flagged branch table
$pageid = $lessonpages[$start]->nextpageid; // move down from the flagged branch table
+ $branchtables = array();
while ($pageid != 0) { // grab all of the branch table till eol
if ($lessonpages[$pageid]->qtype == LESSON_PAGE_BRANCHTABLE) {
$branchtables[] = $lessonpages[$pageid]->id;
@@ -79,6 +79,10 @@ public static function get_jumptooptions($firstpage, $lesson) {
$jump[LESSON_NEXTPAGE] = get_string("nextpage", "lesson");
$jump[LESSON_PREVIOUSPAGE] = get_string("previouspage", "lesson");
$jump[LESSON_EOL] = get_string("endoflesson", "lesson");
+ $jump[LESSON_UNSEENBRANCHPAGE] = get_string("unseenpageinbranch", "lesson");
+ $jump[LESSON_RANDOMPAGE] = get_string("randompageinbranch", "lesson");
+ $jump[LESSON_RANDOMBRANCH] = get_string("randombranch", "lesson");
+
if (!$firstpage) {
if (!$apageid = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "prevpageid" => 0))) {
print_error('cannotfindfirstpage', 'lesson');
View
@@ -193,21 +193,19 @@
// if there are any questions have been answered correctly in this attempt
$corrrectattempts = $lesson->get_attempts($retries, true);
- if ($corrrectattempts>0) {
- foreach ($corrrectattempts as $attempt) {
- $jumpto = $DB->get_field('lesson_answers', 'jumpto', array('id' => $attempt->answerid));
- // convert the jumpto to a proper page id
- if ($jumpto == 0) { // unlikely value!
- $lastpageseen = $attempt->pageid;
- } elseif ($jumpto == LESSON_NEXTPAGE) {
- if (!$lastpageseen = $DB->get_field('lesson_pages', 'nextpageid', array('id' => $attempt->pageid))) {
- // no nextpage go to end of lesson
- $lastpageseen = LESSON_EOL;
- }
- } else {
- $lastpageseen = $jumpto;
+ if (!empty($corrrectattempts)) {
+ $attempt = end($corrrectattempts);
+ $jumpto = $DB->get_field('lesson_answers', 'jumpto', array('id' => $attempt->answerid));
+ // convert the jumpto to a proper page id
+ if ($jumpto == 0) { // unlikely value!
+ $lastpageseen = $attempt->pageid;
+ } elseif ($jumpto == LESSON_NEXTPAGE) {
+ if (!$lastpageseen = $DB->get_field('lesson_pages', 'nextpageid', array('id' => $attempt->pageid))) {
+ // no nextpage go to end of lesson
+ $lastpageseen = LESSON_EOL;
}
- break; // only look at the latest correct attempt
+ } else {
+ $lastpageseen = $jumpto;
}
}
View
@@ -909,6 +909,10 @@ function scorm_pluginfile($course, $cm, $context, $filearea, $args, $forcedownlo
$fs = get_file_storage();
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
+ if ($filearea === 'content') { //return file not found straight away to improve performance.
+ send_header_404();
+ die;
+ }
return false;
}
@@ -657,13 +657,13 @@ M.core_filepicker.init = function(Y, options) {
params['author'] = author.get('value');
}
- if (this.options.env == 'editor') {
+ if (this.options.externallink && this.options.env == 'editor') {
// in editor, images are stored in '/' only
params.savepath = '/';
// when image or media button is clicked
if ( this.options.return_types != 1 ) {
- var linkexternal = Y.one('#linkexternal-'+client_id).get('checked');
- if (linkexternal) {
+ var linkexternal = Y.one('#linkexternal-'+client_id);
+ if (linkexternal && linkexternal.get('checked')) {
params['linkexternal'] = 'yes';
}
} else {
@@ -370,4 +370,15 @@ h2.headingblock {
float: right;
}
-.pagelayout-redirect {background-position:0 0;}
+.pagelayout-redirect {
+ background-position:0 0;
+}
+
+#page-mod-assignment-submissions #wrapper {
+ padding: 0 1%;
+}
+
+#page-mod-assignment-submissions #attempts td,
+#page-mod-assignment-submissions #attempts th.header {
+ font-size: 80%;
+}
View
@@ -661,8 +661,8 @@
$row->cells[2]->text .= implode('', $links);
- if (!empty($messageselect)) {
- $row->cells[2]->text .= '<br /><input type="checkbox" name="user'.$user->id.'" /> ';
+ if ($bulkoperations) {
+ $row->cells[2]->text .= '<br /><input type="checkbox" class="usercheckbox" name="user'.$user->id.'" /> ';
}
$table->data = array($row);
echo html_writer::table($table);
View
@@ -30,10 +30,10 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011070105.02; // 20110701 = branching date YYYYMMDD - do not modify!
+$version = 2011070105.03; // 20110701 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
-$release = '2.1.5+ (Build: 20120323)'; // Human-friendly version name
+$release = '2.1.5+ (Build: 20120329)'; // Human-friendly version name
$maturity = MATURITY_STABLE; // this version's maturity level

0 comments on commit 28af3a1

Please sign in to comment.