Merge branch 'MDL-49905_postform_timeoption' of https://github.com/kylemn/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 2 Jun 2015 15:06:45 +0000 (16:06 +0100)
committerDan Poltawski <dan@moodle.com>
Tue, 2 Jun 2015 15:06:45 +0000 (16:06 +0100)
871 files changed:
.gitignore
Gruntfile.js
admin/index.php
admin/registration/confirmregistration.php
admin/registration/renderer.php
admin/settings/appearance.php
admin/settings/courses.php
admin/settings/plugins.php
admin/tool/assignmentupgrade/version.php
admin/tool/availabilityconditions/version.php
admin/tool/behat/cli/init.php
admin/tool/behat/cli/run.php
admin/tool/behat/cli/util.php
admin/tool/behat/cli/util_single_run.php
admin/tool/behat/tests/behat/data_generators.feature
admin/tool/behat/tests/behat/manipulate_forms.feature
admin/tool/behat/tests/behat/nasty_strings.feature
admin/tool/behat/version.php
admin/tool/capability/version.php
admin/tool/customlang/db/upgrade.php
admin/tool/customlang/version.php
admin/tool/dbtransfer/version.php
admin/tool/filetypes/version.php
admin/tool/generator/version.php
admin/tool/health/version.php
admin/tool/innodb/version.php
admin/tool/installaddon/version.php
admin/tool/langimport/version.php
admin/tool/log/db/upgrade.php
admin/tool/log/store/database/db/upgrade.php
admin/tool/log/store/database/version.php
admin/tool/log/store/legacy/version.php
admin/tool/log/store/standard/db/upgrade.php
admin/tool/log/store/standard/version.php
admin/tool/log/version.php
admin/tool/messageinbound/settings.php
admin/tool/messageinbound/version.php
admin/tool/monitor/classes/output/managesubs/rules.php
admin/tool/monitor/db/upgrade.php
admin/tool/monitor/index.php
admin/tool/monitor/lib.php
admin/tool/monitor/tests/behat/subscription.feature
admin/tool/monitor/version.php
admin/tool/multilangupgrade/version.php
admin/tool/phpunit/cli/init.php
admin/tool/phpunit/version.php
admin/tool/profiling/version.php
admin/tool/replace/version.php
admin/tool/spamcleaner/version.php
admin/tool/task/version.php
admin/tool/templatelibrary/amd/build/display.min.js
admin/tool/templatelibrary/amd/src/display.js
admin/tool/templatelibrary/classes/api.php
admin/tool/templatelibrary/classes/external.php
admin/tool/templatelibrary/classes/output/list_templates_page.php
admin/tool/templatelibrary/db/services.php
admin/tool/templatelibrary/lang/en/tool_templatelibrary.php
admin/tool/templatelibrary/tests/externallib_test.php
admin/tool/templatelibrary/version.php
admin/tool/unsuproles/version.php
admin/tool/uploadcourse/version.php
admin/tool/uploaduser/version.php
admin/tool/xmldb/version.php
admin/user.php
auth/cas/db/upgrade.php
auth/cas/version.php
auth/db/version.php
auth/email/auth.php
auth/email/lang/en/auth_email.php
auth/email/version.php
auth/fc/version.php
auth/imap/version.php
auth/ldap/auth.php
auth/ldap/db/upgrade.php
auth/ldap/version.php
auth/manual/db/upgrade.php
auth/manual/version.php
auth/mnet/db/upgrade.php
auth/mnet/version.php
auth/nntp/version.php
auth/nologin/version.php
auth/none/version.php
auth/pam/version.php
auth/pop3/version.php
auth/radius/version.php
auth/shibboleth/version.php
auth/webservice/version.php
availability/condition/completion/classes/condition.php
availability/condition/completion/version.php
availability/condition/date/version.php
availability/condition/grade/tests/behat/availability_grade.feature
availability/condition/grade/version.php
availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-debug.js
availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-min.js
availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form.js
availability/condition/grade/yui/src/form/js/form.js
availability/condition/group/version.php
availability/condition/grouping/version.php
availability/condition/profile/version.php
backup/backup.class.php
backup/moodle2/restore_stepslib.php
backup/restorefile_form.php
backup/util/helper/backup_anonymizer_helper.class.php
backup/util/helper/backup_general_helper.class.php
badges/award.php
badges/criteria/award_criteria_overall.php
badges/lib.php
badges/mybackpack.php
badges/mybadges.php
badges/newbadge.php
badges/renderer.php
badges/tests/behat/award_badge.feature
blocks/activity_modules/version.php
blocks/activity_results/lang/en/block_activity_results.php
blocks/activity_results/tests/behat/addblockinactivity.feature
blocks/activity_results/tests/behat/addunconfiguredblock.feature
blocks/activity_results/tests/behat/addunsupportedactivity.feature
blocks/activity_results/tests/behat/highscoreswithoutgroups.feature
blocks/activity_results/tests/behat/highscoreswithseperategroups.feature
blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature
blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature
blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature
blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature
blocks/activity_results/version.php
blocks/admin_bookmarks/version.php
blocks/badges/db/access.php
blocks/badges/db/upgrade.php
blocks/badges/lang/en/block_badges.php
blocks/badges/version.php
blocks/blog_menu/version.php
blocks/blog_recent/version.php
blocks/blog_tags/version.php
blocks/calendar_month/db/upgrade.php
blocks/calendar_month/version.php
blocks/calendar_upcoming/db/upgrade.php
blocks/calendar_upcoming/version.php
blocks/comments/version.php
blocks/community/db/upgrade.php
blocks/community/version.php
blocks/completionstatus/db/upgrade.php
blocks/completionstatus/details.php
blocks/completionstatus/version.php
blocks/course_list/version.php
blocks/course_overview/version.php
blocks/course_summary/db/upgrade.php
blocks/course_summary/version.php
blocks/feedback/version.php
blocks/glossary_random/version.php
blocks/html/db/upgrade.php
blocks/html/version.php
blocks/login/version.php
blocks/mentees/version.php
blocks/messages/version.php
blocks/mnet_hosts/version.php
blocks/myprofile/version.php
blocks/navigation/db/upgrade.php
blocks/navigation/version.php
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-min.js
blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js
blocks/navigation/yui/src/navigation/js/navigation.js
blocks/news_items/version.php
blocks/online_users/version.php
blocks/participants/version.php
blocks/private_files/block_private_files.php
blocks/private_files/lang/en/block_private_files.php
blocks/private_files/version.php
blocks/quiz_results/backup/moodle2/restore_quiz_results_block_task.class.php
blocks/quiz_results/block_quiz_results.php
blocks/quiz_results/db/upgrade.php
blocks/quiz_results/lang/en/block_quiz_results.php
blocks/quiz_results/version.php
blocks/recent_activity/db/upgrade.php
blocks/recent_activity/version.php
blocks/rss_client/version.php
blocks/search_forums/version.php
blocks/section_links/db/upgrade.php
blocks/section_links/version.php
blocks/selfcompletion/db/upgrade.php
blocks/selfcompletion/version.php
blocks/settings/db/upgrade.php
blocks/settings/renderer.php
blocks/settings/version.php
blocks/site_main_menu/version.php
blocks/social_activities/version.php
blocks/tag_flickr/version.php
blocks/tag_youtube/version.php
blocks/tags/version.php
blog/index.php
blog/lib.php
blog/tests/behat/blog_visibility.feature [new file with mode: 0644]
cache/classes/helper.php
cache/locks/file/version.php
cache/stores/file/version.php
cache/stores/memcache/lang/en/cachestore_memcache.php
cache/stores/memcache/version.php
cache/stores/memcached/lang/en/cachestore_memcached.php
cache/stores/memcached/version.php
cache/stores/mongodb/version.php
cache/stores/session/version.php
cache/stores/static/version.php
calendar/type/gregorian/version.php
cohort/index.php
completion/classes/external.php
completion/criteria/completion_criteria_activity.php
completion/tests/behat/teacher_manual_completion.feature
composer.json
composer.lock [new file with mode: 0644]
course/category.ajax.php
course/format/lib.php
course/format/singleactivity/version.php
course/format/social/version.php
course/format/topics/version.php
course/format/weeks/version.php
course/index.php
course/renderer.php
course/resources.php
course/tests/behat/behat_course.php
course/tests/behat/navigate_course_list.feature
course/tests/externallib_test.php
course/togglecompletion.php
course/user.php
course/view.php
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-debug.js
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-min.js
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander.js
course/yui/src/categoryexpander/js/categoryexpander.js
enrol/category/version.php
enrol/cohort/lang/en/enrol_cohort.php
enrol/cohort/lib.php
enrol/cohort/locallib.php
enrol/cohort/tests/cohortlib_test.php
enrol/cohort/version.php
enrol/database/db/upgrade.php
enrol/database/version.php
enrol/flatfile/db/upgrade.php
enrol/flatfile/version.php
enrol/guest/db/upgrade.php
enrol/guest/tests/behat/guest_access.feature
enrol/guest/version.php
enrol/imsenterprise/db/upgrade.php
enrol/imsenterprise/lib.php
enrol/imsenterprise/version.php
enrol/index.php
enrol/ldap/version.php
enrol/manual/db/upgrade.php
enrol/manual/version.php
enrol/meta/addinstance.php
enrol/meta/addinstance_form.php
enrol/meta/lang/en/enrol_meta.php
enrol/meta/lib.php
enrol/meta/locallib.php
enrol/meta/tests/behat/enrol_meta.feature [new file with mode: 0644]
enrol/meta/tests/plugin_test.php
enrol/meta/version.php
enrol/mnet/db/upgrade.php
enrol/mnet/version.php
enrol/paypal/db/upgrade.php
enrol/paypal/version.php
enrol/self/db/upgrade.php
enrol/self/lib.php
enrol/self/tests/behat/self_enrolment.feature
enrol/self/tests/self_test.php
enrol/self/version.php
enrol/tests/behat/behat_enrol.php
enrol/users.php
files/externallib.php
filter/activitynames/version.php
filter/algebra/version.php
filter/censor/version.php
filter/data/version.php
filter/emailprotect/version.php
filter/emoticon/version.php
filter/glossary/version.php
filter/mathjaxloader/db/upgrade.php
filter/mathjaxloader/version.php
filter/mediaplugin/db/upgrade.php
filter/mediaplugin/version.php
filter/multilang/version.php
filter/tex/db/upgrade.php
filter/tex/version.php
filter/tidy/version.php
filter/urltolink/version.php
grade/edit/tree/lib.php
grade/export/ods/version.php
grade/export/txt/tests/behat/export.feature
grade/export/txt/version.php
grade/export/xls/version.php
grade/export/xml/tests/behat/export.feature
grade/export/xml/version.php
grade/grading/form/guide/version.php
grade/grading/form/rubric/db/upgrade.php
grade/grading/form/rubric/version.php
grade/import/csv/index.php
grade/import/csv/version.php
grade/import/direct/classes/import_form.php
grade/import/direct/classes/mapping_form.php
grade/import/direct/version.php
grade/import/grade_import_form.php
grade/import/xml/version.php
grade/lib.php
grade/report/grader/lib.php
grade/report/grader/module.js
grade/report/grader/version.php
grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-debug.js
grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-min.js
grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable.js
grade/report/grader/yui/src/gradereporttable/js/floatingheaders.js
grade/report/history/classes/output/tablelog.php
grade/report/history/tests/behat/basic_functionality.feature
grade/report/history/version.php
grade/report/lib.php
grade/report/outcomes/version.php
grade/report/overview/index.php
grade/report/overview/lib.php
grade/report/overview/version.php
grade/report/singleview/tests/behat/singleview.feature
grade/report/singleview/version.php
grade/report/user/db/upgrade.php
grade/report/user/lib.php
grade/report/user/version.php
grade/tests/behat/grade_UI_settings.feature
grade/tests/behat/grade_aggregation.feature
grade/tests/behat/grade_average.feature [new file with mode: 0644]
grade/tests/behat/grade_calculated_weights.feature
grade/tests/behat/grade_contribution_with_extra_credit.feature
grade/tests/behat/grade_mingrade.feature
grade/tests/behat/grade_natural_normalisation.feature
grade/tests/behat/grade_override_letter.feature
grade/tests/behat/grade_scales.feature
grade/tests/behat/grade_scales_aggregation.feature
grade/tests/behat/grade_single_item_scales.feature
grade/tests/behat/grade_to_pass.feature
grade/tests/behat/grade_view.feature
group/lib.php
install/lang/ba/langconfig.php [new file with mode: 0644]
install/lang/mn/moodle.php
install/lang/zh_tw/install.php
lang/en/admin.php
lang/en/badges.php
lang/en/blog.php
lang/en/deprecated.txt
lang/en/grades.php
lang/en/moodle.php
lang/en/webservice.php
lib/accesslib.php
lib/adminlib.php
lib/ajax/getnavbranch.php
lib/badgeslib.php
lib/behat/classes/behat_config_manager.php
lib/classes/component.php
lib/classes/event/role_capabilities_updated.php
lib/classes/message/inbound/handler.php
lib/classes/output/external.php
lib/classes/output/mustache_filesystem_loader.php
lib/classes/output/mustache_template_finder.php [new file with mode: 0644]
lib/classes/string_manager_standard.php
lib/coursecatlib.php
lib/cronlib.php
lib/db/services.php
lib/db/upgrade.php
lib/editor/atto/db/upgrade.php
lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature
lib/editor/atto/plugins/accessibilitychecker/version.php
lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature
lib/editor/atto/plugins/accessibilityhelper/version.php
lib/editor/atto/plugins/align/tests/behat/align.feature
lib/editor/atto/plugins/align/version.php
lib/editor/atto/plugins/backcolor/version.php
lib/editor/atto/plugins/bold/tests/behat/bold.feature
lib/editor/atto/plugins/bold/version.php
lib/editor/atto/plugins/charmap/tests/behat/charmap.feature
lib/editor/atto/plugins/charmap/version.php
lib/editor/atto/plugins/clear/tests/behat/clear.feature
lib/editor/atto/plugins/clear/version.php
lib/editor/atto/plugins/collapse/tests/behat/collapse.feature
lib/editor/atto/plugins/collapse/version.php
lib/editor/atto/plugins/emoticon/version.php
lib/editor/atto/plugins/equation/tests/behat/equation.feature
lib/editor/atto/plugins/equation/version.php
lib/editor/atto/plugins/fontcolor/version.php
lib/editor/atto/plugins/html/tests/behat/html.feature
lib/editor/atto/plugins/html/version.php
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js
lib/editor/atto/plugins/html/yui/src/button/js/button.js
lib/editor/atto/plugins/image/tests/behat/image.feature
lib/editor/atto/plugins/image/version.php
lib/editor/atto/plugins/indent/tests/behat/indent.feature
lib/editor/atto/plugins/indent/version.php
lib/editor/atto/plugins/italic/tests/behat/italic.feature
lib/editor/atto/plugins/italic/version.php
lib/editor/atto/plugins/link/tests/behat/link.feature
lib/editor/atto/plugins/link/version.php
lib/editor/atto/plugins/managefiles/version.php
lib/editor/atto/plugins/media/tests/behat/media.feature
lib/editor/atto/plugins/media/version.php
lib/editor/atto/plugins/noautolink/version.php
lib/editor/atto/plugins/orderedlist/tests/behat/orderedlist.feature
lib/editor/atto/plugins/orderedlist/version.php
lib/editor/atto/plugins/rtl/version.php
lib/editor/atto/plugins/strike/tests/behat/strike.feature
lib/editor/atto/plugins/strike/version.php
lib/editor/atto/plugins/subscript/tests/behat/subscript.feature
lib/editor/atto/plugins/subscript/version.php
lib/editor/atto/plugins/superscript/tests/behat/superscript.feature
lib/editor/atto/plugins/superscript/version.php
lib/editor/atto/plugins/table/tests/behat/table.feature
lib/editor/atto/plugins/table/version.php
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js
lib/editor/atto/plugins/table/yui/src/button/js/button.js
lib/editor/atto/plugins/title/tests/behat/title.feature
lib/editor/atto/plugins/title/version.php
lib/editor/atto/plugins/underline/tests/behat/underline.feature
lib/editor/atto/plugins/underline/version.php
lib/editor/atto/plugins/undo/version.php
lib/editor/atto/plugins/unorderedlist/tests/behat/unorderedlist.feature
lib/editor/atto/plugins/unorderedlist/version.php
lib/editor/atto/version.php
lib/editor/textarea/version.php
lib/editor/tinymce/db/upgrade.php
lib/editor/tinymce/lang/en/editor_tinymce.php
lib/editor/tinymce/plugins/ctrlhelp/version.php
lib/editor/tinymce/plugins/managefiles/version.php
lib/editor/tinymce/plugins/moodleemoticon/version.php
lib/editor/tinymce/plugins/moodleimage/version.php
lib/editor/tinymce/plugins/moodlemedia/version.php
lib/editor/tinymce/plugins/moodlenolink/version.php
lib/editor/tinymce/plugins/pdw/version.php
lib/editor/tinymce/plugins/spellchecker/db/upgrade.php
lib/editor/tinymce/plugins/spellchecker/version.php
lib/editor/tinymce/plugins/wrap/version.php
lib/editor/tinymce/tests/behat/edit_available_icons.feature
lib/editor/tinymce/version.php
lib/enrollib.php
lib/externallib.php
lib/filebrowser/file_info_context_system.php
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms-debug.js
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms-min.js
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms.js
lib/form/yui/src/shortforms/js/shortforms.js
lib/form/yui/src/shortforms/meta/shortforms.json
lib/formslib.php
lib/gdlib.php
lib/moodlelib.php
lib/myprofilelib.php
lib/navigationlib.php
lib/outputcomponents.php
lib/outputfactories.php
lib/outputrenderers.php
lib/pagelib.php
lib/phpmailer/moodle_phpmailer.php
lib/setuplib.php
lib/testing/lib.php
lib/tests/accesslib_test.php
lib/tests/behat/behat_forms.php
lib/tests/behat/behat_general.php
lib/tests/fixtures/messageinbound/SAMPLE [new file with mode: 0644]
lib/tests/fixtures/messageinbound/evolution.test [new file with mode: 0644]
lib/tests/fixtures/messageinbound/ios.test [new file with mode: 0644]
lib/tests/fixtures/messageinbound/outlook.test [new file with mode: 0644]
lib/tests/messageinbound_test.php [new file with mode: 0644]
lib/tests/moodlelib_test.php
lib/tests/mustache_template_finder_test.php [new file with mode: 0644]
lib/tests/setuplib_test.php
lib/tests/string_manager_standard_test.php
lib/tests/user_menu_test.php
lib/upgrade.txt
lib/upgradelib.php
lib/yui/build/moodle-core-event/moodle-core-event-debug.js
lib/yui/build/moodle-core-event/moodle-core-event-min.js
lib/yui/build/moodle-core-event/moodle-core-event.js
lib/yui/src/event/js/event.js
login/confirm.php
login/index.php
message/ajax.php
message/edit.php
message/lib.php
message/output/airnotifier/version.php
message/output/email/db/upgrade.php
message/output/email/lang/en/message_email.php
message/output/email/settings.php
message/output/email/version.php
message/output/jabber/db/upgrade.php
message/output/jabber/version.php
message/output/popup/db/upgrade.php
message/output/popup/version.php
message/renderer.php
message/tests/behat/recent_conversations.feature [new file with mode: 0644]
message/upgrade.txt
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-min.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js
message/yui/src/messenger/js/sendmessage.js
mnet/service/enrol/version.php
mod/assign/db/upgrade.php
mod/assign/feedback/comments/db/upgrade.php
mod/assign/feedback/comments/version.php
mod/assign/feedback/editpdf/classes/document_services.php
mod/assign/feedback/editpdf/classes/pdf.php
mod/assign/feedback/editpdf/db/upgrade.php
mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
mod/assign/feedback/editpdf/tests/behat/group_annotations.feature
mod/assign/feedback/editpdf/tests/editpdf_test.php
mod/assign/feedback/editpdf/version.php
mod/assign/feedback/file/db/upgrade.php
mod/assign/feedback/file/version.php
mod/assign/feedback/offline/version.php
mod/assign/gradeform.php
mod/assign/gradingtable.php
mod/assign/locallib.php
mod/assign/submission/comments/db/upgrade.php
mod/assign/submission/comments/version.php
mod/assign/submission/file/db/upgrade.php
mod/assign/submission/file/version.php
mod/assign/submission/onlinetext/db/upgrade.php
mod/assign/submission/onlinetext/version.php
mod/assign/tests/behat/display_error_message_onbadformat.feature [new file with mode: 0644]
mod/assign/tests/behat/quickgrading.feature
mod/assign/tests/behat/steps_blind_marking.feature [new file with mode: 0644]
mod/assign/version.php
mod/assignment/db/upgrade.php
mod/assignment/type/offline/version.php
mod/assignment/type/online/version.php
mod/assignment/type/upload/version.php
mod/assignment/type/uploadsingle/version.php
mod/assignment/version.php
mod/book/db/upgrade.php
mod/book/delete.php
mod/book/tests/behat/edit_navigation_options.feature [new file with mode: 0644]
mod/book/tool/exportimscp/version.php
mod/book/tool/importhtml/version.php
mod/book/tool/print/version.php
mod/book/version.php
mod/chat/db/upgrade.php
mod/chat/version.php
mod/choice/db/upgrade.php
mod/choice/version.php
mod/choice/view.php
mod/data/classes/external.php
mod/data/db/upgrade.php
mod/data/field.php
mod/data/field/checkbox/version.php
mod/data/field/date/version.php
mod/data/field/file/version.php
mod/data/field/latlong/version.php
mod/data/field/menu/version.php
mod/data/field/multimenu/version.php
mod/data/field/number/version.php
mod/data/field/picture/version.php
mod/data/field/radiobutton/version.php
mod/data/field/text/version.php
mod/data/field/textarea/version.php
mod/data/field/url/version.php
mod/data/lib.php
mod/data/preset/imagegallery/version.php
mod/data/styles.css
mod/data/tests/externallib_test.php
mod/data/version.php
mod/feedback/db/upgrade.php
mod/feedback/styles.css
mod/feedback/version.php
mod/folder/db/upgrade.php
mod/folder/version.php
mod/forum/classes/message/inbound/reply_handler.php
mod/forum/classes/prune_form.php [new file with mode: 0644]
mod/forum/db/upgrade.php
mod/forum/externallib.php
mod/forum/lang/en/forum.php
mod/forum/lib.php
mod/forum/post.php
mod/forum/prune.html [deleted file]
mod/forum/tests/behat/my_forum_posts.feature
mod/forum/tests/behat/split_forum_discussion.feature [new file with mode: 0644]
mod/forum/tests/externallib_test.php
mod/forum/version.php
mod/glossary/db/install.xml
mod/glossary/db/upgrade.php
mod/glossary/formats.php
mod/glossary/lang/en/glossary.php
mod/glossary/lib.php
mod/glossary/tabs.php
mod/glossary/tests/behat/categories.feature
mod/glossary/tests/behat/search_entries.feature
mod/glossary/version.php
mod/glossary/view.php
mod/imscp/db/upgrade.php
mod/imscp/version.php
mod/label/db/upgrade.php
mod/label/version.php
mod/lesson/db/upgrade.php
mod/lesson/editpage.php
mod/lesson/format.php
mod/lesson/locallib.php
mod/lesson/pagetypes/matching.php
mod/lesson/pagetypes/multichoice.php
mod/lesson/pagetypes/numerical.php
mod/lesson/pagetypes/shortanswer.php
mod/lesson/pagetypes/truefalse.php
mod/lesson/tests/behat/lesson_practice.feature
mod/lesson/tests/behat/questions_images.feature
mod/lesson/tests/behat/teacher_grade_essays.feature
mod/lesson/version.php
mod/lti/db/upgrade.php
mod/lti/locallib.php
mod/lti/service/profile/version.php
mod/lti/service/toolproxy/version.php
mod/lti/service/toolsettings/version.php
mod/lti/version.php
mod/page/db/upgrade.php
mod/page/version.php
mod/quiz/accessrule/delaybetweenattempts/version.php
mod/quiz/accessrule/ipaddress/version.php
mod/quiz/accessrule/numattempts/version.php
mod/quiz/accessrule/openclosedate/version.php
mod/quiz/accessrule/password/version.php
mod/quiz/accessrule/safebrowser/version.php
mod/quiz/accessrule/securewindow/version.php
mod/quiz/accessrule/timelimit/version.php
mod/quiz/attemptlib.php
mod/quiz/classes/output/edit_renderer.php
mod/quiz/classes/structure.php
mod/quiz/db/access.php
mod/quiz/db/upgrade.php
mod/quiz/edit.php
mod/quiz/lang/en/quiz.php
mod/quiz/renderer.php
mod/quiz/report/grading/version.php
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/overview/version.php
mod/quiz/report/responses/version.php
mod/quiz/report/statistics/db/upgrade.php
mod/quiz/report/statistics/version.php
mod/quiz/styles.css
mod/quiz/tests/behat/attempt_require_previous.feature
mod/quiz/tests/behat/completion_condition_attempts_used.feature
mod/quiz/tests/behat/completion_condition_passing_grade.feature
mod/quiz/tests/behat/editing_require_previous.feature
mod/quiz/tests/behat/editing_section_headings.feature
mod/quiz/version.php
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-debug.js
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-min.js
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page.js
mod/quiz/yui/src/util/js/page.js
mod/resource/db/upgrade.php
mod/resource/version.php
mod/scorm/db/access.php
mod/scorm/db/upgrade.php
mod/scorm/lang/en/scorm.php
mod/scorm/report/basic/version.php
mod/scorm/report/graphs/version.php
mod/scorm/report/interactions/version.php
mod/scorm/report/objectives/version.php
mod/scorm/version.php
mod/survey/db/upgrade.php
mod/survey/save.php
mod/survey/version.php
mod/upgrade.txt
mod/url/classes/external.php [new file with mode: 0644]
mod/url/db/services.php [new file with mode: 0644]
mod/url/db/upgrade.php
mod/url/lib.php
mod/url/tests/externallib_test.php [new file with mode: 0644]
mod/url/tests/lib_test.php
mod/url/version.php
mod/url/view.php
mod/wiki/db/upgrade.php
mod/wiki/filesedit.php
mod/wiki/renderer.php
mod/wiki/version.php
mod/workshop/allocation/manual/version.php
mod/workshop/allocation/random/version.php
mod/workshop/allocation/scheduled/version.php
mod/workshop/db/upgrade.php
mod/workshop/eval/best/version.php
mod/workshop/form/accumulative/db/upgrade.php
mod/workshop/form/accumulative/version.php
mod/workshop/form/comments/db/upgrade.php
mod/workshop/form/comments/version.php
mod/workshop/form/numerrors/db/upgrade.php
mod/workshop/form/numerrors/version.php
mod/workshop/form/rubric/db/upgrade.php
mod/workshop/form/rubric/version.php
mod/workshop/version.php
my/index.php
my/tests/behat/add_blocks.feature
my/tests/behat/reset_page.feature
notes/index.php
notes/lib.php
package.json
portfolio/boxnet/db/upgrade.php
portfolio/boxnet/version.php
portfolio/download/version.php
portfolio/flickr/version.php
portfolio/googledocs/db/upgrade.php
portfolio/googledocs/version.php
portfolio/mahara/version.php
portfolio/picasa/db/upgrade.php
portfolio/picasa/version.php
question/behaviour/adaptive/version.php
question/behaviour/adaptivenopenalty/version.php
question/behaviour/behaviourbase.php
question/behaviour/deferredcbm/version.php
question/behaviour/deferredfeedback/version.php
question/behaviour/immediatecbm/version.php
question/behaviour/immediatefeedback/version.php
question/behaviour/informationitem/version.php
question/behaviour/interactive/behaviour.php
question/behaviour/interactive/lang/en/qbehaviour_interactive.php
question/behaviour/interactive/tests/walkthrough_test.php
question/behaviour/interactive/version.php
question/behaviour/interactivecountback/tests/walkthrough_test.php
question/behaviour/interactivecountback/version.php
question/behaviour/manualgraded/db/upgrade.php
question/behaviour/manualgraded/version.php
question/behaviour/missing/version.php
question/engine/bank.php
question/format/aiken/version.php
question/format/blackboard_six/version.php
question/format/examview/version.php
question/format/gift/version.php
question/format/missingword/version.php
question/format/multianswer/version.php
question/format/webct/format.php
question/format/webct/version.php
question/format/xhtml/version.php
question/format/xml/version.php
question/tests/random_question_loader_test.php
question/type/calculated/db/upgrade.php
question/type/calculated/version.php
question/type/calculatedmulti/version.php
question/type/calculatedsimple/version.php
question/type/description/version.php
question/type/essay/db/upgrade.php
question/type/essay/version.php
question/type/match/db/upgrade.php
question/type/match/renderer.php
question/type/match/styles.css
question/type/match/version.php
question/type/missingtype/version.php
question/type/multianswer/db/upgrade.php
question/type/multianswer/tests/walkthrough_test.php
question/type/multianswer/version.php
question/type/multichoice/db/upgrade.php
question/type/multichoice/question.php
question/type/multichoice/version.php
question/type/numerical/db/upgrade.php
question/type/numerical/version.php
question/type/questionbase.php
question/type/random/db/upgrade.php
question/type/random/version.php
question/type/randomsamatch/db/upgrade.php
question/type/randomsamatch/version.php
question/type/shortanswer/db/upgrade.php
question/type/shortanswer/version.php
question/type/tests/question_definition_test.php [new file with mode: 0644]
question/type/tests/question_first_matching_answer_grading_strategy_test.php [moved from question/type/tests/questionbase_test.php with 67% similarity]
question/type/tests/question_hint_test.php [new file with mode: 0644]
question/type/truefalse/version.php
report/backups/version.php
report/completion/index.php
report/completion/version.php
report/configlog/version.php
report/courseoverview/version.php
report/eventlist/version.php
report/log/user.php
report/log/version.php
report/loglive/version.php
report/outline/tests/behat/user.feature
report/outline/user.php
report/outline/version.php
report/participation/version.php
report/performance/version.php
report/progress/index.php
report/progress/version.php
report/questioninstances/version.php
report/security/lang/en/report_security.php
report/security/version.php
report/stats/lib.php
report/stats/user.php
report/stats/version.php
report/usersessions/tests/behat/usersessions_report.feature
report/usersessions/user.php
report/usersessions/version.php
repository/alfresco/db/upgrade.php
repository/alfresco/version.php
repository/areafiles/version.php
repository/boxnet/db/upgrade.php
repository/boxnet/version.php
repository/coursefiles/version.php
repository/dropbox/db/upgrade.php
repository/dropbox/version.php
repository/equella/version.php
repository/filesystem/version.php
repository/flickr/version.php
repository/flickr_public/version.php
repository/googledocs/db/upgrade.php
repository/googledocs/version.php
repository/local/version.php
repository/merlot/version.php
repository/picasa/db/upgrade.php
repository/picasa/version.php
repository/recent/tests/behat/add_recent.feature
repository/recent/version.php
repository/s3/version.php
repository/skydrive/version.php
repository/tests/behat/cancel_add_file.feature
repository/tests/behat/create_shortcut.feature
repository/tests/behat/delete_files.feature
repository/tests/behat/overwrite_file.feature
repository/upload/tests/behat/upload_file.feature
repository/upload/version.php
repository/url/version.php
repository/user/version.php
repository/webdav/version.php
repository/wikimedia/version.php
repository/youtube/version.php
tag/lib.php
theme/base/style/grade.css
theme/base/style/message.css
theme/base/templates/core/notification_message.mustache
theme/base/templates/core/notification_problem.mustache
theme/base/templates/core/notification_redirect.mustache
theme/base/templates/core/notification_success.mustache
theme/base/version.php
theme/bootstrapbase/amd/build/bootstrap.min.js
theme/bootstrapbase/less/moodle/grade.less
theme/bootstrapbase/less/moodle/message.less
theme/bootstrapbase/style/moodle.css
theme/bootstrapbase/version.php
theme/canvas/version.php
theme/clean/classes/core_renderer.php [new file with mode: 0644]
theme/clean/layout/columns1.php
theme/clean/layout/columns2.php
theme/clean/layout/columns3.php
theme/clean/version.php
theme/more/db/upgrade.php
theme/more/version.php
theme/upgrade.txt
user/edit.php
user/editadvanced.php
user/editor.php
user/editor_form.php
user/files.php
user/forum.php
user/forum_form.php
user/index.php
user/language.php
user/language_form.php
user/lib.php
user/portfolio.php
user/portfoliologs.php
user/preferences.php
user/profile/field/checkbox/version.php
user/profile/field/datetime/version.php
user/profile/field/menu/version.php
user/profile/field/text/version.php
user/profile/field/textarea/version.php
user/profile/index.php
user/tests/behat/delete_users.feature
user/tests/behat/user_grade_navigation.feature
user/view.php
version.php
webservice/amf/version.php
webservice/rest/version.php
webservice/soap/locallib.php
webservice/soap/version.php
webservice/xmlrpc/version.php

index 89ea0d6..1dab0f7 100644 (file)
@@ -26,9 +26,8 @@ CVS
 /.buildpath
 /.cache
 phpunit.xml
-# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
+# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
 composer.phar
-composer.lock
 /vendor/
 /behat.yml
 */yui/build/*/*-coverage.js
index 4c45234..6237dfa 100644 (file)
@@ -24,7 +24,8 @@
 
 module.exports = function(grunt) {
     var path = require('path'),
-        tasks = {};
+        tasks = {},
+        cwd = process.env.PWD || process.cwd();
 
     // Project configuration.
     grunt.initConfig({
@@ -38,11 +39,11 @@ module.exports = function(grunt) {
                     ['**/src/*.js', '!**/node_modules/**'],
                     '',
                     {
-                        cwd: process.env.PWD,
+                        cwd: cwd,
                         rename: function(destBase, destPath) {
                             destPath = destPath.replace('src', 'build');
                             destPath = destPath.replace('.js', '.min.js');
-                            destPath = path.resolve(process.env.PWD, destPath);
+                            destPath = path.resolve(cwd, destPath);
                             return destPath;
                         }
                     }
@@ -63,13 +64,15 @@ module.exports = function(grunt) {
             },
             shifter;
 
+            args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
+
             // Determine the most appropriate options to run with based upon the current location.
-            if (path.basename(process.env.PWD) === 'src') {
+            if (path.basename(cwd) === 'src') {
                 // Detect whether we're in a src directory.
                 grunt.log.debug('In a src directory');
                 args.push('--walk');
                 options.walk = true;
-            } else if (path.basename(path.dirname(process.env.PWD)) === 'src') {
+            } else if (path.basename(path.dirname(cwd)) === 'src') {
                 // Detect whether we're in a module directory.
                 grunt.log.debug('In a module directory');
                 options.module = true;
@@ -100,8 +103,8 @@ module.exports = function(grunt) {
             }
 
             // Actually run shifter.
-            shifter = exec(process.cwd() + '/node_modules/shifter/bin/shifter', args, {
-                cwd: process.env.PWD,
+            shifter = exec("node", args, {
+                cwd: cwd,
                 stdio: 'inherit',
                 env: process.env
             });
@@ -119,10 +122,10 @@ module.exports = function(grunt) {
 
     tasks.startup = function() {
         // Are we in a YUI directory?
-        if (path.basename(path.resolve(process.env.PWD, '../../')) == 'yui') {
+        if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
             grunt.task.run('shifter');
         // Are we in an AMD directory?
-        } else if (path.basename(process.env.PWD) == 'amd') {
+        } else if (path.basename(cwd) == 'amd') {
             grunt.task.run('jshint');
             grunt.task.run('uglify');
         } else {
index b263903..bad3ed9 100644 (file)
@@ -556,31 +556,36 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
 $dbproblems = $DB->diagnose();
 $maintenancemode = !empty($CFG->maintenance_enabled);
 
-// Available updates for Moodle core
+// Available updates for Moodle core.
 $updateschecker = \core\update\checker::instance();
 $availableupdates = array();
-$availableupdates['core'] = $updateschecker->get_update_info('core',
-    array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
-
-// Available updates for contributed plugins
-$pluginman = core_plugin_manager::instance();
-foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
-    foreach ($plugintypeinstances as $pluginname => $plugininfo) {
-        if (!empty($plugininfo->availableupdates)) {
-            foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
-                if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
-                    if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
-                        $availableupdates[$plugintype.'_'.$pluginname] = array();
+$availableupdatesfetch = null;
+
+if (empty($CFG->disableupdatenotifications)) {
+    // Only compute the update information when it is going to be displayed to the user.
+    $availableupdates['core'] = $updateschecker->get_update_info('core',
+        array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
+
+    // Available updates for contributed plugins
+    $pluginman = core_plugin_manager::instance();
+    foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
+        foreach ($plugintypeinstances as $pluginname => $plugininfo) {
+            if (!empty($plugininfo->availableupdates)) {
+                foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
+                    if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
+                        if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
+                            $availableupdates[$plugintype.'_'.$pluginname] = array();
+                        }
+                        $availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
                     }
-                    $availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
                 }
             }
         }
     }
-}
 
-// The timestamp of the most recent check for available updates
-$availableupdatesfetch = $updateschecker->get_last_timefetched();
+    // The timestamp of the most recent check for available updates
+    $availableupdatesfetch = $updateschecker->get_last_timefetched();
+}
 
 $buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
 //check if the site is registered on Moodle.org
index d1a4e8b..77b2fb2 100644 (file)
@@ -58,7 +58,6 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
 
     echo $OUTPUT->header();
     echo $OUTPUT->heading(get_string('registrationconfirmed', 'hub'), 3, 'main');
-    $hublink = html_writer::tag('a', $hubname, array('href' => $url));
 
     $registeredhub->token = $newtoken;
     $registeredhub->confirmed = 1;
@@ -66,9 +65,7 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
     $registrationmanager->update_registeredhub($registeredhub);
 
     // Display notification message.
-    $notificationmessage = $OUTPUT->notification(
-            get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
-    echo $notificationmessage;
+    echo $OUTPUT->notification(get_string('registrationconfirmedon', 'hub'), 'notifysuccess');
 
     //display continue button
     $registrationpage = new moodle_url('/admin/registration/index.php');
index f3aba40..09d2735 100644 (file)
 class core_register_renderer extends plugin_renderer_base {
 
     /**
-     * Display Moodle.org registration message about benefit to register on Moodle.org
+     * Display message about the benefits of registering on Moodle.org
      *
      * @return string
      */
     public function moodleorg_registration_message() {
-
         $moodleorgstatslink = html_writer::link('http://moodle.net/stats',
                                                get_string('statsmoodleorg', 'admin'),
                                                array('target' => '_blank'));
 
-        $hublink = html_writer::link('https://moodle.net/mod/page/view.php?id=1',
-                                      get_string('moodleorghubname', 'admin'),
-                                      array('target' => '_blank'));
-
-        $moodleorgregmsg = get_string('registermoodleorg', 'admin', $hublink);
+        $moodleorgregmsg = get_string('registermoodleorg', 'admin');
         $items = array(get_string('registermoodleorgli1', 'admin'),
                        get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
         $moodleorgregmsg .= html_writer::alist($items);
index ab8911a..5867711 100644 (file)
@@ -27,9 +27,9 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
         'customusermenuitems',
         new lang_string('customusermenuitems', 'admin'),
         new lang_string('configcustomusermenuitems', 'admin'),
-        'mygrades,grades|/grade/report/mygrades.php|grades
+        'grades,grades|/grade/report/mygrades.php|grades
 messages,message|/message/index.php|message
-mypreferences,moodle|/user/preferences.php|preferences',
+preferences,moodle|/user/preferences.php|preferences',
         PARAM_TEXT,
         '50',
         '10'
index 58b92b0..1442ab8 100644 (file)
@@ -46,7 +46,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
     $ADMIN->add('courses',
         new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
             new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
-            array('moodle/course:create')
+            array('moodle/restore:restorecourse')
         )
     );
 
index 248b0bc..f311696 100644 (file)
@@ -33,13 +33,13 @@ if ($hassiteconfig) {
     // activity modules
     $ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
 
-    $temp = new admin_settingpage('managemodulescommon', new lang_string('commonsettings', 'admin'));
+    $ADMIN->add('modsettings', new admin_page_managemods());
 
+    $temp = new admin_settingpage('managemodulescommon', new lang_string('commonactivitysettings', 'admin'));
     $temp->add(new admin_setting_configcheckbox('requiremodintro',
         get_string('requiremodintro', 'admin'), get_string('requiremodintro_desc', 'admin'), 0));
     $ADMIN->add('modsettings', $temp);
 
-    $ADMIN->add('modsettings', new admin_page_managemods());
     foreach (core_plugin_manager::instance()->get_plugins_of_type('mod') as $plugin) {
         /** @var \core\plugininfo\mod $plugin */
         $plugin->load_settings($ADMIN, 'modsettings', $hassiteconfig);
index 70a9fd6..e459706 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;
-$plugin->requires  = 2014110400;
+$plugin->version   = 2015051100;
+$plugin->requires  = 2015050500;
 $plugin->component = 'tool_assignmentupgrade';
-$plugin->dependencies = array('mod_assign' => 2014110400);
+$plugin->dependencies = array('mod_assign' => 2015050500);
index 2272aa3..52cdd4a 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000;
-$plugin->requires = 2014110400;
+$plugin->version = 2015051100;
+$plugin->requires = 2015050500;
 $plugin->component = 'tool_availabilityconditions';
index c80abb9..4517a7e 100644 (file)
@@ -99,25 +99,13 @@ if ($options['parallel'] && $options['parallel'] > 1) {
 $cwd = getcwd();
 $output = null;
 
-$installcomposer = true;
 // If behat dependencies not downloaded then do it first, else symfony/process can't be used.
-if ($options['parallel'] && !file_exists(__DIR__ . "/../../../../vendor/autoload.php")) {
-    $installcomposer = false;
-    testing_update_composer_dependencies();
-}
+testing_update_composer_dependencies();
 
+// Check whether the behat test environment needs to be updated.
 chdir(__DIR__);
 exec("php $utilfile --diag $paralleloption", $output, $code);
 
-// Check if composer needs to be updated.
-if ($installcomposer &&
-        ($code == BEHAT_EXITCODE_INSTALL || $code == BEHAT_EXITCODE_REINSTALL || $code == BEHAT_EXITCODE_COMPOSER)) {
-    testing_update_composer_dependencies();
-    // Check again for behat test site and see if it's install or re-install.
-    chdir(__DIR__);
-    exec("php $utilfile --diag $paralleloption", $output, $code);
-}
-
 if ($code == 0) {
     echo "Behat test environment already installed\n";
 
index 06630ea..6e19659 100644 (file)
@@ -108,7 +108,7 @@ if (extension_loaded('pcntl')) {
 
 $time = microtime(true);
 array_walk($unrecognised, function (&$v) {
-    if ($x = preg_filter("#^(-+\w+)=(.+)#", "\$1='\$2'", $v)) {
+    if ($x = preg_filter("#^(-+\w+)=(.+)#", "\$1=\"\$2\"", $v)) {
         $v = $x;
     } else if (!preg_match("#^-#", $v)) {
         $v = escapeshellarg($v);
@@ -124,7 +124,7 @@ if ($options['profile']) {
         echo "Invalid profile passed: " . $profile;
         exit(1);
     }
-    $extraopts[] = '--profile=\'' . $profile . "'";
+    $extraopts[] = '--profile="' . $profile . '"';
     // By default, profile tags will be used.
     if (!empty($CFG->behat_config[$profile]['filters']['tags'])) {
         $tags = $CFG->behat_config[$profile]['filters']['tags'];
index 23a47fd..a952efc 100644 (file)
@@ -97,7 +97,7 @@ if (!empty($options['help'])) {
 $cwd = getcwd();
 
 // For drop option check if parallel site.
-if ((empty($options['parallel'])) && $options['drop']) {
+if ((empty($options['parallel'])) && ($options['drop']) || $options['updatesteps']) {
     // Get parallel run info from first run.
     $options['parallel'] = behat_config_manager::get_parallel_test_runs($options['fromrun']);
 }
@@ -172,6 +172,26 @@ if ($options['diag'] || $options['enable'] || $options['disable']) {
         }
     }
 
+} else if ($options['updatesteps']) {
+    // Rewrite config file to ensure we have all the features covered.
+    if (empty($options['parallel'])) {
+        behat_config_manager::update_config_file();
+    } else {
+        // Update config file, ensuring we have up-to-date behat.yml.
+        for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
+            $CFG->behatrunprocess = $i;
+            behat_config_manager::update_config_file();
+        }
+        unset($CFG->behatrunprocess);
+    }
+
+    // Do it sequentially as it's fast and need to be displayed nicely.
+    foreach (array_chunk($cmds, 1, true) as $cmd) {
+        $processes = cli_execute_parallel($cmd, __DIR__);
+        print_sequential_output($processes);
+    }
+    exit(0);
+
 } else {
     // We should never reach here.
     echo $help;
index b089539..d523569 100644 (file)
@@ -199,9 +199,6 @@ if ($options['install']) {
         exit(1);
     }
 
-    // Rewrite config file to ensure we have all the features covered.
-    behat_config_manager::update_config_file();
-
     // Run behat command to get steps in feature files.
     $featurestepscmd = behat_command::get_behat_command(true);
     $featurestepscmd .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
@@ -263,6 +260,10 @@ function print_update_step_output($process, $featurestepfile) {
             $steps[$step[0]] = $step[1];
         }
     }
+
+    if ($existing = @json_decode(file_get_contents($featurestepfile), true)) {
+        $steps = array_merge($existing, $steps);
+    }
     arsort($steps);
 
     if (!@file_put_contents($featurestepfile, json_encode($steps, JSON_PRETTY_PRINT))) {
index 905e23b..6a15dd4 100644 (file)
@@ -349,7 +349,7 @@ Feature: Set up contextual data for tests
     When I log in as "admin"
     And I am on site homepage
     And I follow "Course 1"
-    And I follow "Grades"
+    And I navigate to "Grades" node in "Course administration"
     And I expand "Setup" node
     And I follow "Categories and items"
     Then I should see "Test Grade Item 1"
@@ -380,7 +380,7 @@ Feature: Set up contextual data for tests
     When I log in as "admin"
     And I am on site homepage
     And I follow "Course 1"
-    And I follow "Grades"
+    And I navigate to "Grades" node in "Course administration"
     And I follow "Scales"
     Then I should see "Test Scale 1"
     And I should see "Disappointing,  Good,  Very good,  Excellent"
@@ -432,7 +432,7 @@ Feature: Set up contextual data for tests
     When I log in as "admin"
     And I am on site homepage
     And I follow "Course 1"
-    And I follow "Grades"
+    And I navigate to "Grades" node in "Course administration"
     And I expand "Setup" node
     And I follow "Categories and items"
     Then I should see "Test Outcome Grade Item 1"
index 9aa451f..20c3c29 100644 (file)
@@ -7,7 +7,7 @@ Feature: Forms manipulation
   @javascript
   Scenario: Basic forms manipulation
     Given I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Edit profile"
     When I set the field "First name" to "Field value"
     And I set the field "Select a country" to "Japan"
index f6cdb33..41fac8d 100644 (file)
@@ -10,7 +10,7 @@ Feature: Transform steps arguments
       | fullname | shortname | category |
       | Course 1 | C1 | 0 |
     And I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Edit profile"
 
   @javascript
index 35adb63..e5cea8c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;   // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400;   // Requires this Moodle version
+$plugin->version   = 2015051100;   // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500;   // Requires this Moodle version
 $plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
index 863822c..e1128f6 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2014110400; // Requires this Moodle version.
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2015050500; // Requires this Moodle version.
 $plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
index 03f1855..489f887 100644 (file)
@@ -51,5 +51,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v2.9.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f0ffed6..cdba1b3 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;
-$plugin->requires  = 2014110400;
+$plugin->version   = 2015051100;
+$plugin->requires  = 2015050500;
 $plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
index b1d8ab0..95201c8 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2014110400; // Requires this Moodle version.
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2015050500; // Requires this Moodle version.
 $plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
index f4cefec..b615e7c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014112700;
-$plugin->requires = 2014112700;
+$plugin->version = 2015051100;
+$plugin->requires = 2015050500;
 $plugin->component = 'tool_filetypes';
index bbd2747..e80291c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000;
-$plugin->requires = 2014110400;
+$plugin->version = 2015051100;
+$plugin->requires = 2015050500;
 $plugin->component = 'tool_generator';
index 11c1b60..b284087 100644 (file)
@@ -25,8 +25,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_health'; // Full name of the plugin (used for diagnostics)
 
 $plugin->maturity  = MATURITY_ALPHA; // this version's maturity level
index c5ea4a7..ef52c4e 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
index da278d9..4c22571 100644 (file)
@@ -24,6 +24,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 $plugin->component  = 'tool_installaddon';
-$plugin->version    = 2014111000;
-$plugin->requires   = 2014110400;
+$plugin->version    = 2015051100;
+$plugin->requires   = 2015050500;
 $plugin->maturity   = MATURITY_STABLE;
index f29650c..ba6f1e5 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
index f35984b..da2a60c 100644 (file)
@@ -49,5 +49,8 @@ function xmldb_tool_log_upgrade($oldversion) {
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v2.9.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ed18470..f12d844 100644 (file)
@@ -39,5 +39,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v2.9.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8cc3fcf..6c635b4 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2014110400; // Requires this Moodle version.
+$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2015050500; // Requires this Moodle version.
 $plugin->component = 'logstore_database'; // Full name of the plugin (used for diagnostics).
index 060f925..0cf0cdd 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2014110400; // Requires this Moodle version.
+$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2015050500; // Requires this Moodle version.
 $plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
index 4714d3b..0fa6a8f 100644 (file)
@@ -117,5 +117,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v2.9.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c8a2225..b164b2a 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2014110400; // Requires this Moodle version.
+$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2015050500; // Requires this Moodle version.
 $plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
index 766ed73..bdc5cbd 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2014110400; // Requires this Moodle version.
+$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2015050500; // Requires this Moodle version.
 $plugin->component = 'tool_log'; // Full name of the plugin (used for diagnostics).
index 72d23ab..bb562e0 100644 (file)
@@ -41,9 +41,9 @@ if ($hassiteconfig) {
     $settings->add(new admin_setting_heading('messageinbound_mailboxconfiguration',
             new lang_string('mailboxconfiguration', 'tool_messageinbound'),
             new lang_string('messageinboundmailboxconfiguration_desc', 'tool_messageinbound'), ''));
-    $settings->add(new admin_setting_configtext('messageinbound_mailbox',
+    $settings->add(new admin_setting_configtext_with_maxlength('messageinbound_mailbox',
             new lang_string('mailbox', 'tool_messageinbound'),
-            null, '', PARAM_RAW));
+            null, '', PARAM_RAW, null, 15));
     $settings->add(new admin_setting_configtext('messageinbound_domain',
             new lang_string('domain', 'tool_messageinbound'),
             null, '', PARAM_RAW));
index 44c3bc7..43d8ba9 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;
-$plugin->requires  = 2014110400;
+$plugin->version   = 2015051100;
+$plugin->requires  = 2015050500;
 $plugin->component = 'tool_messageinbound';
index c0c031a..0e519ec 100644 (file)
@@ -203,31 +203,24 @@ class rules extends \table_sql implements \renderable {
     /**
      * Gets a list of courses where the current user can subscribe to rules as a dropdown.
      *
+     * @param bool $choose A flag for whether to show the 'choose...' option in the select box.
      * @return \single_select|bool returns the list of courses, or false if the select box
      *      should not be displayed.
      */
-    public function get_user_courses_select() {
-        global $DB;
-
-        // If the number of courses on the site exceed the maximum drop down limit do not display the select box.
-        $numcourses = $DB->count_records('course');
-        if ($numcourses > COURSE_MAX_COURSES_PER_DROPDOWN) {
+    public function get_user_courses_select($choose = false) {
+        $options = tool_monitor_get_user_courses();
+        // If we have no options then don't create a select element.
+        if (!$options) {
             return false;
         }
-        $orderby = 'visible DESC, sortorder ASC';
-        $options = array();
-        if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname', $orderby)) {
-            foreach ($courses as $course) {
-                $options[$course->id] = format_string($course->fullname, true,
-                    array('context' => \context_course::instance($course->id)));
-            }
-        }
-        // If there are no options to display, then don't display anything.
-        if (count($options) === 0) {
-            return false;
+        $selected = $this->courseid;
+        $nothing = array();
+        if ($choose) {
+            $selected = null;
+            $nothing = array('choosedots');
         }
         $url = new \moodle_url('/admin/tool/monitor/index.php');
-        $select = new \single_select($url, 'courseid', $options, $this->courseid);
+        $select = new \single_select($url, 'courseid', $options, $selected, $nothing);
         $select->set_label(get_string('selectacourse', 'tool_monitor'));
         return $select;
     }
index afde1c8..ffb1750 100644 (file)
@@ -53,5 +53,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v2.9.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 478cbe0..1065bd1 100644 (file)
 
 require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/monitor/lib.php');
 
-$courseid = optional_param('courseid', SITEID, PARAM_INT);
+$courseid = optional_param('courseid', 0, PARAM_INT);
 $action = optional_param('action', '', PARAM_ALPHA);
 $cmid = optional_param('cmid', 0, PARAM_INT);
 $ruleid = optional_param('ruleid', 0, PARAM_INT);
 $subscriptionid = optional_param('subscriptionid', 0, PARAM_INT);
 $confirm = optional_param('confirm', false, PARAM_BOOL);
 
-require_login();
-
-// We need to explicitly check that the course id is something legitimate.
+$choose = false;
+// Validate course id.
 if (empty($courseid)) {
-    $courseid = SITEID;
+    require_login();
+    $context = context_system::instance();
+    // check system level capability.
+    if (!has_capability('tool/monitor:subscribe', $context)) {
+        // If not system level then check to see if they have access to any course level rules.
+        if (tool_monitor_get_user_courses()){
+            // Make them choose a course.
+            $choose = true;
+        } else {
+            // return error.
+            print_error('rulenopermission', 'tool_monitor');
+        }
+    }
+} else {
+    // They might want to see rules for this course.
+    $course = get_course($courseid);
+    require_login($course);
+    $context = context_course::instance($course->id);
+    // Check for caps.
+    require_capability('tool/monitor:subscribe', $context);
 }
 
-$coursecontext = context_course::instance($courseid);
-
 if (!get_config('tool_monitor', 'enablemonitor')) {
     // This should never happen as the this page does not appear in navigation when the tool is disabled.
     throw new coding_exception('Event monitoring is disabled');
 }
 
-$sitename = format_string($SITE->fullname, true, array('context' => $coursecontext));
+// Use the user context here so that the header shows user information.
 $PAGE->set_context(context_user::instance($USER->id));
 
 // Set up the page.
 $indexurl = new moodle_url('/admin/tool/monitor/index.php', array('courseid' => $courseid));
 $PAGE->set_url($indexurl);
 $PAGE->set_pagelayout('report');
-$PAGE->set_title($sitename);
+$PAGE->set_title(get_string('managesubscriptions', 'tool_monitor'));
 $PAGE->set_heading(fullname($USER));
-$settingsnode = $PAGE->settingsnav->find('monitor', null)->make_active();
+$settingsnode = $PAGE->settingsnav->find('monitor', null);
+if ($settingsnode) {
+    $settingsnode->make_active();
+}
 
 // Create/delete subscription if needed.
 if (!empty($action)) {
@@ -86,7 +106,7 @@ if (!empty($action)) {
             } else {
                 $subscription = \tool_monitor\subscription_manager::get_subscription($subscriptionid);
                 echo $OUTPUT->header();
-                echo $OUTPUT->confirm(get_string('subareyousure', 'tool_monitor', $subscription->get_name($coursecontext)),
+                echo $OUTPUT->confirm(get_string('subareyousure', 'tool_monitor', $subscription->get_name($context)),
                     $confirmurl, $cancelurl);
                 echo $OUTPUT->footer();
                 exit();
@@ -104,17 +124,13 @@ $renderer = $PAGE->get_renderer('tool_monitor', 'managesubs');
 $totalrules = \tool_monitor\rule_manager::count_rules_by_courseid($courseid);
 $rules = new \tool_monitor\output\managesubs\rules('toolmonitorrules', $indexurl, $courseid);
 
-$usercourses = $rules->get_user_courses_select();
-if (!empty($usercourses)) {
-    echo $renderer->render($usercourses);
-} else {
-    // Nothing to show at all. Show a notification.
-    echo $OUTPUT->notification(get_string('rulenopermission', 'tool_monitor'), 'notifyproblem');
-}
+$usercourses = $rules->get_user_courses_select($choose);
+// There must be user courses otherwise we wouldn't make it this far.
+echo $renderer->render($usercourses);
 
 // Render the current subscriptions list.
 $totalsubs = \tool_monitor\subscription_manager::count_user_subscriptions();
-if (!empty($totalsubs)) {
+if (!empty($totalsubs) && !$choose) {
     // Show the subscriptions section only if there are subscriptions.
     $subs = new \tool_monitor\output\managesubs\subs('toolmonitorsubs', $indexurl, $courseid);
     echo $OUTPUT->heading(get_string('currentsubscriptions', 'tool_monitor'), 3);
@@ -122,14 +138,13 @@ if (!empty($totalsubs)) {
 }
 
 // Render the potential rules list.
-// Check the capability here before displaying any rules to subscribe to.
-if (has_capability('tool/monitor:subscribe', $coursecontext)) {
+if (!$choose) {
     echo $OUTPUT->heading(get_string('rulescansubscribe', 'tool_monitor'), 3);
     echo $renderer->render($rules);
 }
 
 // Check if the user can manage the course rules we are viewing.
-$canmanagerules = has_capability('tool/monitor:managerules', $coursecontext);
+$canmanagerules = has_capability('tool/monitor:managerules', $context);
 
 if (empty($totalrules)) {
     // No rules present. Show a link to manage rules page if permissions permit.
index 4091ef2..7e91f0b 100644 (file)
@@ -79,19 +79,40 @@ function tool_monitor_extend_navigation_user_settings($navigation, $user, $userc
 
     // Don't show the setting if the event monitor isn't turned on. No access to other peoples subscriptions.
     if (get_config('tool_monitor', 'enablemonitor') && $USER->id == $user->id) {
-        // The $course->id will always be the course that corresponds to the current context.
-        $courseid = $course->id;
-        // A $course->id of $SITE->id might either be the frontpage or the site. So if we get the site ID back, check the...
-        // ...courseid parameter passed to the page so we can know if we are looking at the frontpage rules or site level rules.
-        if ($course->id == $SITE->id && optional_param('courseid', $course->id, PARAM_INT) == 0) {
-            $courseid = 0;
+        // Now let's check to see if the user has any courses / site rules that they can subscribe to.
+        if ($courses = tool_monitor_get_user_courses()) {
+            $url = new moodle_url('/admin/tool/monitor/index.php');
+            $subsnode = navigation_node::create(get_string('managesubscriptions', 'tool_monitor'), $url,
+                    navigation_node::TYPE_SETTING, null, 'monitor', new pix_icon('i/settings', ''));
+
+            if (isset($subsnode) && !empty($navigation)) {
+                $navigation->add_node($subsnode);
+            }
         }
-        $url = new moodle_url('/admin/tool/monitor/index.php', array('courseid' => $courseid));
-        $subsnode = navigation_node::create(get_string('managesubscriptions', 'tool_monitor'), $url,
-                navigation_node::TYPE_SETTING, null, 'monitor', new pix_icon('i/settings', ''));
+    }
+}
 
-        if (isset($subsnode) && !empty($navigation)) {
-            $navigation->add_node($subsnode);
+/**
+ * Get a list of courses and also include 'Site' for site wide rules.
+ *
+ * @return array|bool Returns an array of courses or false if the user has no permission to subscribe to rules.
+ */
+function tool_monitor_get_user_courses() {
+    $orderby = 'visible DESC, sortorder ASC';
+    $options = array();
+    if (has_capability('tool/monitor:subscribe', context_system::instance())) {
+        $options[0] = get_string('site');
+    }
+    if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname', $orderby)) {
+        foreach ($courses as $course) {
+            $options[$course->id] = format_string($course->fullname, true,
+                array('context' => context_course::instance($course->id)));
         }
     }
+    // If there are no courses and there is no site permission then return false.
+    if (count($options) < 1) {
+        return false;
+    } else {
+        return $options;
+    }
 }
index 27029aa..496d709 100644 (file)
@@ -55,7 +55,7 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Subscribe to a rule on course level
     Given I log in as "teacher1"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     When I follow "Subscribe to rule \"New rule course level\""
@@ -64,7 +64,7 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Delete a subscription on course level
     Given I log in as "teacher1"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     And I follow "Subscribe to rule \"New rule course level\""
@@ -77,7 +77,7 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Subscribe to a rule on site level
     Given I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Acceptance test site"
     When I follow "Subscribe to rule \"New rule site level\""
@@ -86,7 +86,7 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Delete a subscription on site level
     Given I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Acceptance test site"
     And I follow "Subscribe to rule \"New rule site level\""
@@ -100,11 +100,11 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Receiving notification on site level
     Given I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Messaging"
     And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
     And I press "Save changes"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Acceptance test site"
     And I follow "Subscribe to rule \"New rule site level\""
@@ -119,11 +119,11 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Receiving notification on course level
     Given I log in as "teacher1"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Messaging"
     And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
     And I press "Save changes"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     And I follow "Subscribe to rule \"New rule course level\""
@@ -139,7 +139,7 @@ Feature: tool_monitor_subscriptions
 
   Scenario: Navigating via quick link to rules
     Given I log in as "admin"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     When I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     Then I should see "You can manage rules from the Event monitoring rules page."
@@ -147,7 +147,7 @@ Feature: tool_monitor_subscriptions
     And I should see "You can subscribe to rules from the Event monitoring page."
     And I log out
     And I log in as "teacher1"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     And I should see "You can manage rules from the Event monitoring rules page."
@@ -155,11 +155,12 @@ Feature: tool_monitor_subscriptions
     And I should see "You can subscribe to rules from the Event monitoring page."
     And I click on "//a[text()='Event monitoring']" "xpath_element"
     And the field "courseid" matches value "Course 1"
-    And I set the field "courseid" to "Choose..."
+    And I follow "Preferences" in the user menu
+    And I follow "Event monitoring"
     And I should not see "You can manage rules from the Event monitoring rules page."
     And I log out
     And I log in as "teacher2"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     And I should not see "You can manage rules the from the Event monitoring rules page."
@@ -170,7 +171,7 @@ Feature: tool_monitor_subscriptions
       | tool/monitor:managerules | Prohibit |
     And I log out
     And I log in as "teacher1"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     When I set the field "Select a course" to "Course 1"
     Then I should see "You can manage rules from the Event monitoring rules page."
@@ -178,7 +179,7 @@ Feature: tool_monitor_subscriptions
     And I should not see "You can manage rules from the Event monitoring rules page."
     And I log out
     And I log in as "teacher2"
-    And I follow "My preferences" in the user menu
+    And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
     And I should not see "You can manage rules from the Event monitoring rules page."
index 42c28c1..7647741 100644 (file)
@@ -26,6 +26,6 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version   = 2014111001;     // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2014110400;     // Requires this Moodle version.
+$plugin->version   = 2015051100;     // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2015050500;     // Requires this Moodle version.
 $plugin->component = 'tool_monitor'; // Full name of the plugin (used for diagnostics).
index 0758b92..41a66bc 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_multilangupgrade'; // Full name of the plugin (used for diagnostics)
 
index eb807ee..0785277 100644 (file)
@@ -39,6 +39,7 @@ require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
 require_once(__DIR__.'/../../../../lib/testing/lib.php');
 
 echo "Initialising Moodle PHPUnit test environment...\n";
+testing_update_composer_dependencies();
 
 $output = null;
 exec('php --version', $output, $code);
@@ -72,4 +73,6 @@ if ($code == 0) {
 
 passthru("php util.php --buildconfig", $code);
 
+echo "\n";
+echo "PHPUnit test environment setup complete.\n";
 exit(0);
index 847bd6e..2134945 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_phpunit'; // Full name of the plugin (used for diagnostics)
 
index 028eee4..15afdbb 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_profiling'; // Full name of the plugin (used for diagnostics)
index 7bbf3dc..3f8b27e 100644 (file)
@@ -25,8 +25,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_replace'; // Full name of the plugin (used for diagnostics)
 
 $plugin->maturity  = MATURITY_ALPHA; // this version's maturity level
index 379ac32..86bcdc2 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;
-$plugin->requires  = 2014110400;
+$plugin->version   = 2015051100;
+$plugin->requires  = 2015050500;
 $plugin->component = 'tool_spamcleaner'; // Full name of the plugin (used for diagnostics)
 
index 1dcf9d5..963c798 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_task'; // Full name of the plugin (used for diagnostics)
 
index 3bc7ab4..a5bf8ab 100644 (file)
Binary files a/admin/tool/templatelibrary/amd/build/display.min.js and b/admin/tool/templatelibrary/amd/build/display.min.js differ
index a6c4a70..1585a18 100644 (file)
@@ -25,21 +25,20 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
        function($, ajax, log, notification, templates, config, str) {
 
     /**
-     * Handle a template loaded response.
+     * Search through a template for a template docs comment.
      *
-     * @param {String} templateName The template name
-     * @param {String} source The template source
+     * @param {String} templateSource The raw template
+     * @param {String} templateName The name of the template used to search for docs tag
+     * @return {String|boolean} the correct comment or false
      */
-    var templateLoaded = function(templateName, source) {
-        str.get_string('templateselected', 'tool_templatelibrary', templateName).done(function(s) {
-            $('[data-region="displaytemplateheader"]').text(s);
-        }).fail(notification.exception);
+    var findDocsSection = function(templateSource, templateName) {
 
         // Find the comment section marked with @template component/template.
-        var marker = "@template " + templateName;
+        var marker = "@template " + templateName,
+            i = 0,
+            sections = [];
 
-        var sections = source.match(/{{!([\s\S]*?)}}/g);
-        var i = 0;
+        sections = templateSource.match(/{{!([\s\S]*?)}}/g);
 
         // If no sections match - show the entire file.
         if (sections !== null) {
@@ -50,11 +49,38 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
                     // Remove {{! and }} from start and end.
                     var offset = start + marker.length + 1;
                     section = section.substr(offset, section.length - 2 - offset);
-                    source = section;
-                    break;
+                    return section;
                 }
             }
         }
+        // No matching comment.
+        return false;
+    };
+
+    /**
+     * Handle a template loaded response.
+     *
+     * @param {String} templateName The template name
+     * @param {String} source The template source
+     * @param {String} originalSource The original template source (not theme overridden)
+     */
+    var templateLoaded = function(templateName, source, originalSource) {
+        str.get_string('templateselected', 'tool_templatelibrary', templateName).done(function(s) {
+            $('[data-region="displaytemplateheader"]').text(s);
+        }).fail(notification.exception);
+
+        // Find the comment section marked with @template component/template.
+        var docs = findDocsSection(source, templateName);
+
+        if (docs === false) {
+            // Docs was not in theme template, try original.
+            docs = findDocsSection(originalSource, templateName);
+        }
+
+        // If we found a docs section, limit the template library to showing this section.
+        if (docs) {
+            source = docs;
+        }
 
         $('[data-region="displaytemplatesource"]').text(source);
 
@@ -86,6 +112,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
 
     /**
      * Load the a template source from Moodle.
+     *
      * @param {String} templateName
      */
     var loadTemplate = function(templateName) {
@@ -93,16 +120,26 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
         var component = parts.shift();
         var name = parts.shift();
 
-        ajax.call([{
+        var promises = ajax.call([{
             methodname: 'core_output_load_template',
             args:{
                     component: component,
                     template: name,
                     themename: config.theme
-            },
-            done: function(source) { templateLoaded(templateName, source); },
-            fail: notification.exception
+            }
+        }, {
+            methodname: 'tool_templatelibrary_load_canonical_template',
+            args:{
+                    component: component,
+                    template: name
+            }
         }]);
+
+        // When returns a new promise that is resolved when all the passed in promises are resolved.
+        // The arguments to the done become the values of each resolved promise.
+        $.when.apply($, promises)
+            .done( function(source, originalSource) { templateLoaded(templateName, source, originalSource); })
+            .fail(notification.exception);
     };
 
     // Add the event listeners.
index c818c86..2ef5d4c 100644 (file)
  */
 namespace tool_templatelibrary;
 
-use stdClass;
 use core_component;
+use core\output\mustache_template_finder;
 use coding_exception;
+use moodle_exception;
 use required_capability_exception;
+use stdClass;
 
 /**
  * API exposed by tool_templatelibrary
@@ -41,52 +43,98 @@ class api {
      *
      * @param string $component Filter the list to a single component.
      * @param string $search Search string to optionally filter the list of templates.
+     * @param string $themename The name of the current theme.
      * @return array[string] Where each template is in the form "component/templatename".
      */
-    public static function list_templates($component = '', $search = '') {
+    public static function list_templates($component = '', $search = '', $themename = '') {
         global $CFG;
 
         $templatedirs = array();
         $results = array();
 
-        if ($component != '') {
+        if ($component !== '') {
             // Just look at one component for templates.
-            $dir = core_component::get_component_directory($component);
-            if (!$dir) {
-                return $templatedirs;
-            }
+            $dirs = mustache_template_finder::get_template_directories_for_component($component, $themename);
 
-            $templatedirs[$component] = $dir . '/templates';
+            $templatedirs[$component] = $dirs;
         } else {
 
-            // Look at all the templates dirs for all installed plugins.
-            $dir = $CFG->libdir . '/templates';
-            if (!empty($dir) && is_dir($dir)) {
-                $templatedirs['core'] = $dir;
+            // Look at all the templates dirs for core.
+            $templatedirs['core'] = mustache_template_finder::get_template_directories_for_component('core', $themename);
+
+            // Look at all the templates dirs for subsystems.
+            $subsystems = core_component::get_core_subsystems();
+            foreach ($subsystems as $subsystem => $dir) {
+                $dir .= '/templates';
+                if (is_dir($dir)) {
+                    $dirs = mustache_template_finder::get_template_directories_for_component('core_' . $subsystem, $themename);
+                    $templatedirs['core_' . $subsystem] = $dirs;
+                }
             }
+
+            // Look at all the templates dirs for plugins.
             $plugintypes = core_component::get_plugin_types();
             foreach ($plugintypes as $type => $dir) {
                 $plugins = core_component::get_plugin_list_with_file($type, 'templates', false);
                 foreach ($plugins as $plugin => $dir) {
                     if (!empty($dir) && is_dir($dir)) {
-                        $templatedirs[$type . '_' . $plugin] = $dir;
+                        $pluginname = $type . '_' . $plugin;
+                        $dirs = mustache_template_finder::get_template_directories_for_component($pluginname, $themename);
+                        $templatedirs[$pluginname] = $dirs;
                     }
                 }
             }
         }
 
-        foreach ($templatedirs as $templatecomponent => $dir) {
-            // List it.
-            $files = glob($dir . '/*.mustache');
+        foreach ($templatedirs as $templatecomponent => $dirs) {
+            foreach ($dirs as $dir) {
+                // List it.
+                $files = glob($dir . '/*.mustache');
 
-            foreach ($files as $file) {
-                $templatename = basename($file, '.mustache');
-                if ($search == '' || strpos($templatename, $search) !== false) {
-                    $results[] = $templatecomponent . '/' . $templatename;
+                foreach ($files as $file) {
+                    $templatename = basename($file, '.mustache');
+                    if ($search == '' || strpos($templatename, $search) !== false) {
+                        $results[$templatecomponent . '/' . $templatename] = 1;
+                    }
                 }
             }
         }
+        $results = array_keys($results);
+        sort($results);
         return $results;
     }
 
+    /**
+     * Return a mustache template.
+     * Note - this function differs from the function core_output_load_template
+     * because it will never return a theme overridden version of a template.
+     *
+     * @param string $component The component that holds the template.
+     * @param string $template The name of the template.
+     * @return string the template
+     */
+    public static function load_canonical_template($component, $template) {
+        // Get the list of possible template directories.
+        $dirs = mustache_template_finder::get_template_directories_for_component($component);
+        $filename = false;
+
+        foreach ($dirs as $dir) {
+            // Skip theme dirs - we only want the original plugin/core template.
+            if (strpos($dir, "/theme/") === false) {
+                $candidate = $dir . $template . '.mustache';
+                if (file_exists($candidate)) {
+                    $filename = $candidate;
+                    break;
+                }
+            }
+        }
+        if ($filename === false) {
+            throw new moodle_exception('filenotfound', 'error');
+        }
+
+        $templatestr = file_get_contents($filename);
+        return $templatestr;
+    }
+
+
 }
index 630f040..100172b 100644 (file)
@@ -95,4 +95,55 @@ class external extends external_api {
     public static function list_templates_returns() {
         return new external_multiple_structure(new external_value(PARAM_RAW, 'The template name (format is component/templatename)'));
     }
+
+    /**
+     * Returns description of load_canonical_template() parameters.
+     *
+     * @return external_function_parameters
+     */
+    public static function load_canonical_template_parameters() {
+        return new external_function_parameters(
+                array('component' => new external_value(PARAM_COMPONENT, 'component containing the template'),
+                      'template' => new external_value(PARAM_ALPHANUMEXT, 'name of the template'))
+            );
+    }
+
+    /**
+     * Can this function be called directly from ajax?
+     *
+     * @return boolean
+     * @since Moodle 2.9
+     */
+    public static function load_canonical_template_is_allowed_from_ajax() {
+        return true;
+    }
+
+    /**
+     * Return a mustache template.
+     * Note - this function differs from the function core_output_load_template
+     * because it will never return a theme overridden version of a template.
+     *
+     * @param string $component The component that holds the template.
+     * @param string $template The name of the template.
+     * @return string the template
+     */
+    public static function load_canonical_template($component, $template) {
+        $params = self::validate_parameters(self::load_canonical_template_parameters(),
+                                            array('component' => $component,
+                                                  'template' => $template));
+
+        $component = $params['component'];
+        $template = $params['template'];
+
+        return api::load_canonical_template($component, $template);
+    }
+
+    /**
+     * Returns description of load_canonical_template() result value.
+     *
+     * @return external_description
+     */
+    public static function load_canonical_template_returns() {
+        return new external_value(PARAM_RAW, 'template');
+    }
 }
index 8377e8b..cecf9cb 100644 (file)
@@ -59,8 +59,8 @@ class list_templates_page implements renderable, templatable {
         foreach ($components as $component) {
             $info = new stdClass();
             $info->component = $component;
-            if ($component == 'core') {
-                $info->name = get_string('core_component', 'tool_templatelibrary');
+            if (strpos($component, 'core') === 0) {
+                $info->name = get_string('coresubsystem', 'tool_templatelibrary', $component);
             } else {
                 $info->name = $pluginmanager->plugin_name($component);
             }
index fdecc01..c1a9479 100644 (file)
@@ -33,5 +33,12 @@ $functions = array(
         'type'        => 'read',
         'capabilities'=> '',
     ),
+    'tool_templatelibrary_load_canonical_template' => array(
+        'classname'   => 'tool_templatelibrary\external',
+        'methodname'  => 'load_canonical_template',
+        'description' => 'Load a canonical template by name (not the theme overidden one).',
+        'type'        => 'read'
+    ),
+
 );
 
index 87b8ea0..8cc6736 100644 (file)
@@ -24,7 +24,7 @@
 
 $string['all'] = 'All components';
 $string['component'] = 'Component';
-$string['core_component'] = 'Moodle core';
+$string['coresubsystem'] = 'Subsystem ({$a})';
 $string['documentation'] = 'Documentation';
 $string['example'] = 'Example';
 $string['noresults'] = 'No results';
index db9d4df..9b09541 100644 (file)
@@ -65,5 +65,19 @@ class tool_templatelibrary_external_testcase extends externallib_advanced_testca
         $this->assertEquals($result[0], "tool_templatelibrary/list_templates_page");
     }
 
+    public function test_load_canonical_template() {
+        global $CFG;
 
+        $originaltheme = $CFG->theme;
+        // Change the theme to 'base' because it overrides these templates.
+        $CFG->theme = 'base';
+
+        $template = external::load_canonical_template('core', 'notification_problem');
+
+        // Only the base template should contain the docs.
+        $this->assertContains('@template core/notification_problem', $template);
+
+        // Restore the original theme.
+        $CFG->theme = $originaltheme;
+    }
 }
index 085d347..e97195e 100644 (file)
@@ -21,6 +21,6 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 defined('MOODLE_INTERNAL') || die();
-$plugin->version   = 2015021623; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2014110400; // Requires this Moodle version.
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2015050500; // Requires this Moodle version.
 $plugin->component = 'tool_templatelibrary'; // Full name of the plugin (used for diagnostics).
index 97de3cf..19b39af 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2014110400; // Requires this Moodle version
+$plugin->version   = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2015050500; // Requires this Moodle version
 $plugin->component = 'tool_unsuproles'; // Full name of the plugin (used for diagnostics)
 
index 5d6d4c8..4e5c7c2 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2014111000;            // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2014110400;            // Requires this Moodle version.
+$plugin->version   = 2015051100;            // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2015050500;            // Requires this Moodle version.
 $plugin->component = 'tool_uploadcourse';   // Full name of the plugin (used for diagnostics).