Permalink
Browse files

Merge remote branch 'moodle/master' into master_MDL-18392_slash_cleanup

  • Loading branch information...
danmarsden committed Apr 13, 2011
2 parents 3825bed + 91787c3 commit 4f6e39db5e8178ea1d5219e8652455b174c98b0b
Showing with 1,776 additions and 693 deletions.
  1. +1 −1 admin/cli/upgrade.php
  2. +13 −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. +8 −0 backup/util/helper/restore_inforef_parser_processor.class.php
  7. +8 −0 backup/util/helper/restore_moodlexml_parser_processor.class.php
  8. +8 −0 backup/util/helper/restore_questions_parser_processor.class.php
  9. +8 −0 backup/util/helper/restore_roles_parser_processor.class.php
  10. +8 −0 backup/util/helper/restore_structure_parser_processor.class.php
  11. +8 −0 backup/util/helper/restore_users_parser_processor.class.php
  12. +1 −13 backup/util/ui/backup_ui.class.php
  13. +3 −3 backup/util/ui/backup_ui_stage.class.php
  14. +15 −0 backup/util/ui/base_ui.class.php
  15. +2 −2 backup/util/ui/restore_ui_stage.class.php
  16. +17 −18 backup/util/xml/parser/processors/grouped_parser_processor.class.php
  17. +42 −0 backup/util/xml/parser/processors/simplified_parser_processor.class.php
  18. +80 −0 backup/util/xml/parser/simpletest/testparser.php
  19. +3 −0 blocks/comments/block_comments.php
  20. +3 −2 comment/comment.js
  21. +163 −77 comment/lib.php
  22. +6 −0 enrol/ajax.php
  23. +2 −0 enrol/locallib.php
  24. +5 −2 enrol/renderer.php
  25. +4 −1 enrol/users.php
  26. +15 −1 enrol/yui/enrolmentmanager/enrolmentmanager.js
  27. +0 −3 index.php
  28. +7 −7 lang/en/admin.php
  29. +1 −0 lang/en/enrol.php
  30. +1 −0 lang/en/repository.php
  31. +4 −4 lib/accesslib.php
  32. +10 −0 lib/completionlib.php
  33. +2 −2 lib/form/filemanager.js
  34. +6 −5 lib/form/filemanager.php
  35. +84 −8 lib/gradelib.php
  36. +116 −163 lib/grouplib.php
  37. +3 −3 lib/htmlpurifier/HTMLPurifier.php
  38. +2 −0 lib/htmlpurifier/HTMLPurifier.safe-includes.php
  39. +138 −13 lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php
  40. +9 −0 lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/URI.php
  41. +6 −0 lib/htmlpurifier/HTMLPurifier/AttrDef/URI/Host.php
  42. +41 −0 lib/htmlpurifier/HTMLPurifier/AttrTransform/Nofollow.php
  43. +2 −1 lib/htmlpurifier/HTMLPurifier/AttrTransform/SafeParam.php
  44. +8 −2 lib/htmlpurifier/HTMLPurifier/Bootstrap.php
  45. +21 −0 lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
  46. +181 −52 lib/htmlpurifier/HTMLPurifier/Config.php
  47. +7 −1 lib/htmlpurifier/HTMLPurifier/ConfigSchema.php
  48. BIN lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser
  49. +12 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt
  50. +9 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt
  51. +11 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt
  52. +7 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt
  53. +1 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt
  54. +15 −0 lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt
  55. +11 −0 lib/htmlpurifier/HTMLPurifier/Definition.php
  56. +24 −11 lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php
  57. 0 lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/README
  58. +1 −1 lib/htmlpurifier/HTMLPurifier/EntityLookup/entities.ser
  59. +38 −13 lib/htmlpurifier/HTMLPurifier/Generator.php
  60. +19 −0 lib/htmlpurifier/HTMLPurifier/HTMLModule/Nofollow.php
  61. +1 −1 lib/htmlpurifier/HTMLPurifier/HTMLModule/SafeEmbed.php
  62. +0 −1 lib/htmlpurifier/HTMLPurifier/HTMLModule/SafeObject.php
  63. +4 −4 lib/htmlpurifier/HTMLPurifier/HTMLModuleManager.php
  64. +3 −3 lib/htmlpurifier/HTMLPurifier/Lexer.php
  65. +52 −22 lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php
  66. +79 −22 lib/htmlpurifier/HTMLPurifier/Strategy/MakeWellFormed.php
  67. +9 −7 lib/htmlpurifier/HTMLPurifier/TagTransform/Font.php
  68. +2 −1 lib/htmlpurifier/HTMLPurifier/Token/Tag.php
  69. +62 −31 lib/htmlpurifier/HTMLPurifier/URI.php
  70. +54 −7 lib/htmlpurifier/HTMLPurifier/URIScheme.php
  71. +4 −1 lib/htmlpurifier/HTMLPurifier/URIScheme/data.php
  72. +8 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/file.php
  73. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/ftp.php
  74. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/http.php
  75. +2 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/mailto.php
  76. +2 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/news.php
  77. +1 −2 lib/htmlpurifier/HTMLPurifier/URIScheme/nntp.php
  78. +2 −3 lib/htmlpurifier/readme_moodle.txt
  79. +1 −1 lib/installlib.php
  80. +4 −0 lib/setuplib.php
  81. +133 −0 lib/simpletest/testpurifier.php
  82. +0 −25 lib/simpletest/testweblib.php
  83. +1 −1 lib/thirdpartylibs.xml
  84. +14 −12 lib/weblib.php
  85. +3 −11 lib/xhprof/xhprof_moodle.php
  86. +11 −13 message/output/email/message_output_email.php
  87. +1 −1 mod/assignment/mod_form.php
  88. +4 −3 mod/chat/view.php
  89. +4 −5 mod/choice/view.php
  90. +1 −0 mod/data/templates.php
  91. +4 −5 mod/data/view.php
  92. +4 −4 mod/feedback/complete.php
  93. +4 −4 mod/feedback/lib.php
  94. +5 −2 mod/forum/view.php
  95. +4 −5 mod/glossary/view.php
  96. +1 −1 mod/lesson/locallib.php
  97. +4 −4 mod/lesson/view.php
  98. +4 −6 mod/quiz/view.php
  99. +4 −4 mod/scorm/player.php
  100. +4 −3 mod/workshop/view.php
  101. +11 −10 tag/lib.php
  102. +0 −6 theme/canvas/style/editor.css
  103. +0 −6 theme/canvas/style/text.css
  104. +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
@@ -153,7 +153,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');
@@ -194,6 +194,7 @@
}
if ($version > $CFG->version) { // upgrade
purge_all_caches();
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
@@ -407,6 +408,17 @@
admin_externalpage_setup('adminnotifications');
echo $OUTPUT->header();
// Unstable code warning
if (isset($maturity)) {
if ($maturity < MATURITY_STABLE) {
$maturitylevel = get_string('maturity'.$maturity, 'admin');
echo $OUTPUT->box(
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
$OUTPUT->doc_link('admin/versions', get_string('morehelp')),
'generalbox adminwarning maturityinfo');
}
}
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
echo $OUTPUT->box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
@@ -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;
@@ -53,4 +53,12 @@ protected function dispatch_chunk($data) {
$itemid = $data['tags']['id'];
restore_dbops::set_backup_ids_record($this->restoreid, $itemname, $itemid);
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
}
@@ -51,6 +51,14 @@ protected function dispatch_chunk($data) {
$this->accumchunks[] = $data;
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
public function get_all_chunks() {
return $this->accumchunks;
}
@@ -75,6 +75,14 @@ protected function dispatch_chunk($data) {
}
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
/**
* Provide NULL decoding
*/
@@ -55,6 +55,14 @@ protected function dispatch_chunk($data) {
}
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
/**
* Provide NULL decoding
*/
@@ -102,4 +102,12 @@ protected function postprocess_chunk($data) {
protected function dispatch_chunk($data) {
$this->step->process($data);
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
}
@@ -66,6 +66,14 @@ protected function dispatch_chunk($data) {
}
}
protected function notify_path_start($path) {
// nothing to do
}
protected function notify_path_end($path) {
// nothing to do
}
/**
* Provide NULL decoding
*/
@@ -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();
Oops, something went wrong.

0 comments on commit 4f6e39d

Please sign in to comment.