Permalink
Browse files

Merge remote branch 'moodle/MOODLE_20_STABLE' into m20_MDL-18392_slas…

…h_cleanup
  • Loading branch information...
2 parents 26daa23 + 50467e5 commit dbb6157aa12b346c4189c0ed93aaa686b748dc63 @danmarsden danmarsden committed Apr 13, 2011
Showing with 1,571 additions and 668 deletions.
  1. +1 −1 admin/cli/upgrade.php
  2. +1 −1 admin/index.php
  3. +14 −5 admin/settings/frontpage.php
  4. +26 −28 admin/settings/users.php
  5. +1 −1 admin/uploaduser.php
  6. +1 −13 backup/util/ui/backup_ui.class.php
  7. +3 −3 backup/util/ui/backup_ui_stage.class.php
  8. +15 −0 backup/util/ui/base_ui.class.php
  9. +2 −2 backup/util/ui/restore_ui_stage.class.php
  10. +3 −0 blocks/comments/block_comments.php
  11. +3 −2 comment/comment.js
  12. +163 −77 comment/lib.php
  13. +6 −0 enrol/ajax.php
  14. +2 −0 enrol/locallib.php
  15. +6 −2 enrol/renderer.php
  16. +3 −1 enrol/users.php
  17. +15 −1 enrol/yui/enrolmentmanager/enrolmentmanager.js
  18. +1 −3 lang/en/admin.php
  19. +1 −0 lang/en/enrol.php
  20. +1 −0 lang/en/repository.php
  21. +4 −4 lib/accesslib.php
  22. +10 −0 lib/completionlib.php
  23. +2 −2 lib/form/filemanager.js
  24. +6 −5 lib/form/filemanager.php
  25. +84 −8 lib/gradelib.php
  26. +116 −163 lib/grouplib.php
  27. +3 −3 lib/htmlpurifier/HTMLPurifier.php
  28. +2 −0 lib/htmlpurifier/HTMLPurifier.safe-includes.php
  29. +138 −13 lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php
  30. +9 −0 lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/URI.php
  31. +6 −0 lib/htmlpurifier/HTMLPurifier/AttrDef/URI/Host.php
  32. +41 −0 lib/htmlpurifier/HTMLPurifier/AttrTransform/Nofollow.php
  33. +2 −1 lib/htmlpurifier/HTMLPurifier/AttrTransform/SafeParam.php
  34. +8 −2 lib/htmlpurifier/HTMLPurifier/Bootstrap.php
  35. +21 −0 lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
  36. +181 −52 lib/htmlpurifier/HTMLPurifier/Config.php
  37. +7 −1 lib/htmlpurifier/HTMLPurifier/ConfigSchema.php
  38. BIN lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser
  39. +12 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt
  40. +9 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt
  41. +11 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt
  42. +7 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt
  43. +1 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt
  44. +15 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt
  45. +11 −0 lib/htmlpurifier/HTMLPurifier/Definition.php
  46. +24 −11 lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php
  47. 0 lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README
  48. +1 −1 lib/htmlpurifier/HTMLPurifier/EntityLookup/entities.ser
  49. +38 −13 lib/htmlpurifier/HTMLPurifier/Generator.php
  50. +19 −0 lib/htmlpurifier/HTMLPurifier/HTMLModule/Nofollow.php
  51. +1 −1 lib/htmlpurifier/HTMLPurifier/HTMLModule/SafeEmbed.php
  52. +0 −1 lib/htmlpurifier/HTMLPurifier/HTMLModule/SafeObject.php
  53. +4 −4 lib/htmlpurifier/HTMLPurifier/HTMLModuleManager.php
  54. +3 −3 lib/htmlpurifier/HTMLPurifier/Lexer.php
  55. +52 −22 lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php
  56. +79 −22 lib/htmlpurifier/HTMLPurifier/Strategy/MakeWellFormed.php
  57. +9 −7 lib/htmlpurifier/HTMLPurifier/TagTransform/Font.php
  58. +2 −1 lib/htmlpurifier/HTMLPurifier/Token/Tag.php
  59. +62 −31 lib/htmlpurifier/HTMLPurifier/URI.php
  60. +54 −7 lib/htmlpurifier/HTMLPurifier/URIScheme.php
  61. +4 −1 lib/htmlpurifier/HTMLPurifier/URIScheme/data.php
  62. +8 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/file.php
  63. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/ftp.php
  64. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/http.php
  65. +2 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/mailto.php
  66. +2 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/news.php
  67. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/nntp.php
  68. +2 −3 lib/htmlpurifier/readme_moodle.txt
  69. +1 −1 lib/installlib.php
  70. +4 −0 lib/setuplib.php
  71. +133 −0 lib/simpletest/testpurifier.php
  72. +0 −25 lib/simpletest/testweblib.php
  73. +1 −1 lib/thirdpartylibs.xml
  74. +14 −12 lib/weblib.php
  75. +3 −11 lib/xhprof/xhprof_moodle.php
  76. +11 −13 message/output/email/message_output_email.php
  77. +1 −1 mod/assignment/mod_form.php
  78. +4 −3 mod/chat/view.php
  79. +4 −5 mod/choice/view.php
  80. +1 −0 mod/data/templates.php
  81. +4 −5 mod/data/view.php
  82. +4 −4 mod/feedback/complete.php
  83. +4 −4 mod/feedback/lib.php
  84. +5 −2 mod/forum/view.php
  85. +4 −5 mod/glossary/view.php
  86. +1 −1 mod/lesson/locallib.php
  87. +4 −4 mod/lesson/view.php
  88. +4 −6 mod/quiz/view.php
  89. +4 −4 mod/scorm/player.php
  90. +4 −3 mod/workshop/view.php
  91. +11 −10 tag/lib.php
  92. +0 −6 theme/canvas/style/editor.css
  93. +0 −6 theme/canvas/style/text.css
  94. +2 −2 version.php
View
@@ -94,7 +94,7 @@
$newversion = "$release ($version)";
// test environment first
-if (!check_moodle_environment($version, $environment_results, false, ENV_SELECT_RELEASE)) {
+if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) {
$errors = environment_get_errors($environment_results);
cli_heading(get_string('environment', 'admin'));
foreach ($errors as $error) {
View
@@ -152,7 +152,7 @@
echo $OUTPUT->box($releasenoteslink, 'generalbox releasenoteslink');
require_once($CFG->libdir.'/environmentlib.php');
- if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
+ if (!check_moodle_environment(normalize_version($release), $environment_results, true, ENV_SELECT_RELEASE)) {
print_upgrade_reload("index.php?agreelicense=1&lang=$CFG->lang");
} else {
echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
@@ -52,13 +52,22 @@
$temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
// front page default role
- $roleoptions = array(0=>get_string('none')); // roles to choose from
- if ($roles = get_all_roles()) {
- foreach ($roles as $role) {
- $roleoptions[$role->id] = strip_tags(format_string($role->name, true));
+ $options = array(0=>get_string('none')); // roles to choose from
+ $defaultfrontpageroleid = 0;
+ foreach (get_all_roles() as $role) {
+ if (empty($role->archetype) or $role->archetype === 'guest' or $role->archetype === 'frontpage' or $role->archetype === 'student') {
+ $options[$role->id] = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
+ if ($role->archetype === 'frontpage') {
+ $defaultfrontpageroleid = $role->id;
+ }
}
}
- $temp->add(new admin_setting_configselect('defaultfrontpageroleid', get_string('frontpagedefaultrole', 'admin'), '', 0, $roleoptions));
+ if ($defaultfrontpageroleid and (!isset($CFG->defaultfrontpageroleid) or $CFG->defaultfrontpageroleid)) {
+ //frotpage role may not exist in old upgraded sites
+ unset($options[0]);
+ }
+ $temp->add(new admin_setting_configselect('defaultfrontpageroleid', get_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
+
$ADMIN->add('frontpage', $temp);
View
@@ -38,76 +38,74 @@
if ($ADMIN->fulltree) {
if (!during_initial_install()) {
$context = get_context_instance(CONTEXT_SYSTEM);
- $allroles = array();
- $generalroles = array();
+
+ $otherroles = array();
$guestroles = array();
$userroles = array();
- $studentroles = array();
- $teacherroles = array();
$creatornewroles = array();
+ $defaultteacherid = null;
+ $defaultuserid = null;
+ $defaultguestid = null;
+
foreach (get_all_roles() as $role) {
$rolename = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
- $allroles[$role->id] = $rolename;
switch ($role->archetype) {
case 'manager':
$creatornewroles[$role->id] = $rolename;
break;
case 'coursecreator':
break;
case 'editingteacher':
- $teacherroles[$role->id] = $rolename;
+ $defaultteacherid = isset($defaultteacherid) ? $defaultteacherid : $role->id;
$creatornewroles[$role->id] = $rolename;
break;
case 'teacher':
$creatornewroles[$role->id] = $rolename;
break;
case 'student':
- $studentroles[$role->id] = $rolename;
break;
case 'guest':
+ $defaultguestid = isset($defaultguestid) ? $defaultguestid : $role->id;
$guestroles[$role->id] = $rolename;
break;
case 'user':
+ $defaultuserid = isset($defaultuserid) ? $defaultuserid : $role->id;
$userroles[$role->id] = $rolename;
break;
case 'frontpage':
break;
default:
$creatornewroles[$role->id] = $rolename;
- $generalroles[$role->id] = $rolename;
+ $otherroles[$role->id] = $rolename;
break;
}
}
- reset($guestroles);
- $defaultguestid = key($guestroles);
- reset($studentroles);
- $defaultstudentid = key($studentroles);
- reset($teacherroles);
- $defaultteacherid = key($teacherroles);
-
- if ($userroles) {
- reset($userroles);
- $defaultuserid = key($userroles);
- } else {
- $userroles = array('0'=>get_string('none'));
+ if (empty($guestroles)) {
+ $guestroles[0] = get_string('none');
+ $defaultguestid = 0;
+ }
+
+ if (empty($userroles)) {
+ $userroles[0] = get_string('none');
$defaultuserid = 0;
}
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
- get_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $generalroles)));
+ get_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
- get_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $generalroles)));
+ get_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
- get_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $generalroles)));
- }
-
- $temp->add(new admin_setting_configcheckbox('nodefaultuserrolelists', get_string('nodefaultuserrolelists', 'admin'), get_string('confignodefaultuserrolelists', 'admin'), 0));
-
- if (!during_initial_install()) {
+ get_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
$temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
get_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
+
+ // release memory
+ unset($otherroles);
+ unset($guestroles);
+ unset($userroles);
+ unset($creatornewroles);
}
$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
View
@@ -774,7 +774,7 @@
}
}
- $manual->enrol_user($manualcache[$courseid], $user->id, $rid, $today, $timeend, true);
+ $manual->enrol_user($manualcache[$courseid], $user->id, $rid, $today, $timeend);
$a = new stdClass();
$a->course = $shortname;
@@ -130,19 +130,7 @@ public function execute() {
}
return $backupid;
}
- /**
- * Cancels the current backup and redirects the user back to the relevant place
- */
- public function cancel_backup() {
- global $PAGE;
- // Determine the approriate URL to redirect the user to
- if ($PAGE->context->contextlevel == CONTEXT_MODULE && $PAGE->cm !== null) {
- $relevanturl = new moodle_url('/mod/'.$PAGE->cm->modname.'/view.php', array('id'=>$PAGE->cm->id));
- } else {
- $relevanturl = new moodle_url('/course/view.php', array('id'=>$PAGE->course->id));
- }
- redirect($relevanturl);
- }
+
/**
* Gets an array of progress bar items that can be displayed through the backup renderer.
* @return array Array of items for the progress bar
@@ -81,7 +81,7 @@ public function process(base_moodleform $m = null) {
$form = $this->initialise_stage_form();
if ($form->is_cancelled()) {
- $this->ui->cancel_backup();
+ $this->ui->cancel_process();
}
$data = $form->get_data();
@@ -180,7 +180,7 @@ public function process(base_moodleform $form = null) {
$form = $this->initialise_stage_form();
// Check it wasn't cancelled
if ($form->is_cancelled()) {
- $this->ui->cancel_backup();
+ $this->ui->cancel_process();
}
// Check it has been submit
@@ -288,7 +288,7 @@ public function process(base_moodleform $form = null) {
$form = $this->initialise_stage_form();
// Check it hasn't been cancelled
if ($form->is_cancelled()) {
- $this->ui->cancel_backup();
+ $this->ui->cancel_process();
}
$data = $form->get_data();
@@ -226,6 +226,21 @@ public function enforce_changed_dependencies() {
public static function load_controller($uniqueid=false) {
throw new coding_exception('load_controller() method needs to be overridden in each subclass of base_ui');
}
+
+ /**
+ * Cancels the current backup/restore and redirects the user back to the relevant place
+ */
+ public function cancel_process() {
+ global $PAGE;
+ // Determine the appropriate URL to redirect the user to
+ if ($PAGE->context->contextlevel == CONTEXT_MODULE && $PAGE->cm !== null) {
+ $relevanturl = new moodle_url('/mod/'.$PAGE->cm->modname.'/view.php', array('id'=>$PAGE->cm->id));
+ } else {
+ $relevanturl = new moodle_url('/course/view.php', array('id'=>$PAGE->course->id));
+ }
+ redirect($relevanturl);
+ }
+
/**
* Gets an array of progress bar items that can be displayed through the backup renderer.
* @return array Array of items for the progress bar
@@ -392,7 +392,7 @@ public function process(base_moodleform $form = null) {
$form = $this->initialise_stage_form();
// Check it wasn't cancelled
if ($form->is_cancelled()) {
- $this->ui->cancel_backup();
+ $this->ui->cancel_process();
}
// Check it has been submit
@@ -500,7 +500,7 @@ public function process(base_moodleform $form = null) {
$form = $this->initialise_stage_form();
// Check it hasn't been cancelled
if ($form->is_cancelled()) {
- $this->ui->cancel_backup();
+ $this->ui->cancel_process();
}
$data = $form->get_data();
@@ -47,6 +47,9 @@ function get_content() {
$args->env = 'block_comments';
$args->component = 'block_comments';
$args->linktext = get_string('showcomments');
+ $args->notoggle = true;
+ $args->autostart = true;
+ $args->displaycancel = true;
$comment = new comment($args);
$comment->set_view_permission(true);
View
@@ -41,8 +41,9 @@ M.core_comment = {
this.courseid = args.courseid;
this.contextid = args.contextid;
this.env = args.env;
+ this.autostart = (args.autostart);
// expand comments?
- if (args.autostart) {
+ if (this.autostart) {
this.view(args.page);
}
// load comments
@@ -347,7 +348,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
var d = container.getStyle('display');
if (d=='none'||d=='') {
// show
- if (this.env != 'block_comments') {
+ if (this.autostart) {
this.load(page);
} else {
this.register_delete_buttons();
Oops, something went wrong.

0 comments on commit dbb6157

Please sign in to comment.