Compare commits

..

1208 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 779085b75d Moodle release 2.0.6 2011-11-27 23:49:08 +01:00
Eloy Lafuente (stronk7) 4ad8c6e350 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-11-27 23:39:44 +01:00
Eloy Lafuente (stronk7) e16d680905 Merge branch 'dropbox-api-bump-for-20_STABLE' of git://git.luns.net.uk/moodle into MOODLE_20_STABLE 2011-11-27 23:18:39 +01:00
AMOS bot 34292e766b Automatically generated installer lang files 2011-11-26 00:31:12 +00:00
Eloy Lafuente (stronk7) 433248cc8d weekly release 2.0.5+ 2011-11-25 11:09:20 +01:00
Eloy Lafuente (stronk7) 0c8697540c Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-11-25 11:04:58 +01:00
Dan Poltawski 3342f9278b MDL-29960 repository/dropbox - update to use 1.0 API version 2011-11-25 10:03:58 +00:00
AMOS bot 8bf9c37f0e Automatically generated installer lang files 2011-11-25 00:30:52 +00:00
Sam Hemelryk b40a326061 Merge branch 'MDL-26431-20' of git://github.com/totara/moodle into MOODLE_20_STABLE 2011-11-25 12:45:07 +13:00
Sam Hemelryk e1a236015c Merge branch 'MDL-29115_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-11-25 11:59:42 +13:00
Mary Evans 11e45d05f8 MDL-28625 - removed ul/ol styles from canvas/text.css 2011-11-25 11:18:30 +13:00
Aaron Barnes c99142aa86 MDL-26431 course completion report columns not lining up 2011-11-25 09:57:53 +13:00
Aparup Banerjee 4e3676afef Merge branch 'MDL-30288_override_checkbox_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-11-24 16:15:04 +08:00
Andrew Davis 8815d83999 MDL-30288 gradebook: prevented grade grade feedback being wrapped in a text to html div tag which was causing it to look like feedback had been edited when it hadn't 2011-11-24 15:32:47 +08:00
AMOS bot 032ca9883e Automatically generated installer lang files 2011-11-24 00:31:13 +00:00
Eloy Lafuente (stronk7) 2a71a2648e Merge branch 'wip-mdl-30375-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-11-23 13:29:03 +01:00
Ankit Kumar Agarwal 0c6182c125 MDL-30398 Validations added for password field 2011-11-23 13:20:37 +01:00
Eloy Lafuente (stronk7) 25641ce2da Merge branch 'MDL-29060_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-11-23 11:49:17 +01:00
Eloy Lafuente (stronk7) 8a2ac4cb74 Merge branch 'wip-mdl-28947-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-11-23 11:38:32 +01:00
Andrew Robert Nicols 8c10f16d34 MDL-30165: Make repository file extension check case insensitive 2011-11-23 11:23:55 +01:00
Dan Marsden ad4ac9daa5 SCORM MDL-25757 fix for saving of duplicate CMI values - thanks to Evan Irving-Pease for the patch 2011-11-23 11:09:31 +01:00
Jamie Pratt 6b7080c841 MDL-28562 "automatic naming of file in convert_image not working"
there is an obvious typo in the code causing the problem. The use of
an equality check instead of the intended assignment.
2011-11-23 12:40:31 +08:00
Aparup Banerjee 1fee8759bc Merge branch 'wip-MDL-20627-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-11-23 11:14:47 +08:00
Mary Evans c172ee6210 MDL-29778 Fix to make user selector arrow visible 2011-11-23 15:55:30 +13:00
Kordan 54d7e72ddd MDL-29830 theme_base: Fix overflow problems with navigation items 2011-11-23 15:47:44 +13:00
Rajesh Taneja 3ee4fb3f95 MDL-30375 Blocks: Comments block will show blank textbox rather then hiding and 'add a comment' will be visible if it's empty 2011-11-23 10:47:09 +08:00
Rossiani Wijaya e6155dfa67 MDL-29115 lesson mod: fixed the display of 'try again' button so it relates to lesson setting 2011-11-23 10:33:33 +08:00
Eloy Lafuente (stronk7) ec4b3cbcae Merge branch 'MDL-30042-MOODLE_20_STABLE-1' of git://git.luns.net.uk/moodle into MOODLE_20_STABLE 2011-11-23 03:07:45 +01:00
Eloy Lafuente (stronk7) d112ae914f Merge branch 'MDL-27045_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-11-23 03:02:40 +01:00
Sam Hemelryk 1ee341b3d1 Merge branch 'MDL-30192_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-11-23 14:20:34 +13:00
Sam Hemelryk d019d13ea1 Merge branch 'MDL-29904-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-23 13:58:15 +13:00
AMOS bot 866e90c3d4 Automatically generated installer lang files 2011-11-23 00:31:08 +00:00
Eloy Lafuente (stronk7) 731e021f9c Merge branch 'MDL-30402-install-string_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-11-23 01:08:17 +01:00
Mary Evans e88330b84c MDL-30164 FIX for missing gap between icon and text in reports 2011-11-23 12:59:11 +13:00
Mary Evans 39009f1633 MDL-30196 changed reference from Serenity to Sky High in theme_sky_high.php 2011-11-23 12:50:30 +13:00
Petr Skoda ce5ee449e3 MDL-30303 fix media playback from URLs with ? query parts
Credit for the rawurlencode() fix goes to Eloy.
2011-11-23 12:18:02 +13:00
David Mudrak d53fd52df8 MDL-30402 Removing hard-coded English string from the CLI installer 2011-11-22 10:05:51 +01:00
Aparup Banerjee d31ebf3462 Merge branch 'MDL-30194-m20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-22 16:19:48 +08:00
Aparup Banerjee 31550708b4 Merge branch 'wip-mdl-29396-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-11-22 16:11:06 +08:00
Rajesh Taneja b25603680e MDL-29396 core: ip blocking will be bypassed for cli scripts - Thanks Petr 2011-11-22 16:10:19 +08:00
Aparup Banerjee f50e703e21 Merge branch 'MDL-27703_user_report_sql_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-11-22 14:25:28 +08:00
Sam Hemelryk f68144c177 Merge branch 'MDL-28629_MOODLE_20_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-11-22 18:28:11 +13:00
Rajesh Taneja f129c975b9 MDL-28947 lib: print_object cleans html special chars before printing 2011-11-22 09:30:07 +08:00
AMOS bot b7867ebe98 Automatically generated installer lang files 2011-11-22 00:30:58 +00:00
Sam Hemelryk 63526f3e9b Merge branch 'MDL-30392_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-11-22 12:59:52 +13:00
Eloy Lafuente (stronk7) 2f4fe2f195 MDL-30392 DML - Fix old-style delete_records() call 2011-11-22 00:44:44 +01:00
Andrew Robert Nicols cf4b3493e2 MDL-30174 Assignment : Only increment submission offset if the current assignment was not saved 2011-11-22 02:21:44 +08:00
Andrew Robert Nicols 71dda1f97d MDL-30173 Assignment : Convert to use moodle_url and add missing filter param 2011-11-22 02:05:01 +08:00
Aparup Banerjee e239fd37b8 Merge branch 'MDL-29814_blank_emails2_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-11-22 01:22:20 +08:00
Aparup Banerjee 6c5fe9f7e9 Merge branch 'wip-MDL-30289-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-11-21 14:10:07 +08:00
Aparup Banerjee 36d22219bc Merge branch 'MDL-30279-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-21 11:53:21 +08:00
Andrew Robert Nicols f7aef5c648 MDL-29591 Check for permission before overwriting course idnumber when restoring 2011-11-21 02:34:32 +01:00
Charles Fulton 26303bd017 MDL-30289 forum - set page context when pruning a discussion 2011-11-21 09:14:49 +08:00
Mary Evans 50f0c58e69 MDL-30236 removed outlawed javasript from theme_anomaly 2011-11-21 13:28:52 +13:00
Mary Evans 689a6891bf MDL-29904-M21 FIX to add pagelayout=>report 2011-11-20 20:31:07 +00:00
Tim Hunt fef14d0fc8 MDL-29060 q export: writefiles should be public write_files & belongs to XML format. 2011-11-20 12:05:18 +00:00
Andrew Davis 878ff40575 MDL-29814 message: made html personal messages also store a plain text version as a fallback 2011-11-19 15:39:24 +08:00
AMOS bot 0d52d3366c Merge branch 'MOODLE_20_STABLE' into install_20_STABLE 2011-11-19 00:31:10 +00:00
Eloy Lafuente (stronk7) fcf11d558a MDL-30192 restore - prevent any extra info to be created for deleted users 2011-11-18 13:04:17 +01:00
adrian@moodle.com 905617c12f MDL-20627 user - Fixed viewing permission of email when sending group messages. 2011-11-18 14:53:56 +08:00
Eloy Lafuente (stronk7) f28832d5c0 weekly release 2.0.5+ 2011-11-18 01:32:16 +01:00
AMOS bot 05b49c8b6d Automatically generated installer lang files 2011-11-18 00:31:02 +00:00
Eloy Lafuente (stronk7) 5acc2fba63 MDL-29350 Prevent memory/time problems if there are zillions of combinations 2011-11-17 20:23:49 +01:00
Eloy Lafuente (stronk7) da7ab34762 Merge branch 'MDL-29350-MOODLE_20_STABLE-2' of git://git.luns.net.uk/moodle into MOODLE_20_STABLE 2011-11-17 20:18:38 +01:00
Tim Hunt 4dd114b834 MDL-27045 formslib: fix disabledif for advcheckbox
This is based on earlier work by Henning Bostelmann and Tom Potts.
2011-11-17 18:01:51 +00:00
Charles Fulton 797e49da80 MDL-30279 show full date and time for all wiki revisions 2011-11-17 09:11:54 +05:30
Tony Levi 165e476948 MDL-24577: Fix mark all posts in this discussion read doesn't work completely correct 2011-11-17 14:59:41 +13:00
Eloy Lafuente (stronk7) 991ee3344a Merge branch 'MDL-29743_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-11-17 01:23:08 +01:00
Sam Hemelryk 5174eeebe3 Merge branch 'MDL-29893-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-17 13:10:53 +13:00
Mary Evans 96b7f2d7db MDL-30283-M20 FIX coding errors 2011-11-16 14:18:15 +00:00
Ankit Kumar Agarwal 6eaf677b26 MDL-29893 Fixing issues with password generation function 2011-11-16 11:44:01 +05:30
Henning Bostelmann fc73d9e7b4 MDL-29350 Prevent duplication of groupings when copying activities
This patch also includes a database upgrade to correct data produced as a
result of this bug.
2011-11-15 11:06:00 +00:00
Tim Hunt ed39308f60 MDL-29743 quiz: Finish attempt link didn't save responses in some brosers.
Thanks to Brandon Browning for identifying the problem. It is quite subtle why this typo would have this effect. You need to look at the implementation of the preventDefault method in lib/yui/3.4.1/build/event-base/event-base.js.

Conflicts:

	mod/quiz/module.js
2011-11-15 10:54:48 +00:00
Eloy Lafuente (stronk7) 2450fc50ed weekly release 2.0.5+ 2011-11-15 11:08:51 +01:00
Eloy Lafuente (stronk7) 9fdd6c8bc8 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-11-15 10:55:39 +01:00
AMOS bot d7a7519fd4 Automatically generated installer lang files 2011-11-15 00:55:26 +00:00
Sam Hemelryk c0e1de9b00 Merge branch 'MDL-28670_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-11-14 17:51:06 +13:00
Aparup Banerjee 94846c2e39 MDL-28670 webservice : (review) changes improving performance 2011-11-14 11:26:24 +08:00
Sam Hemelryk 06b4c6e13a Merge branch 'wip-MDL-30010-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-14 12:14:47 +13:00
AMOS bot 036b35f682 Automatically generated installer lang files 2011-11-13 15:14:42 +01:00
AMOS bot 98ea2e451a Automatically generated installer lang files 2011-11-13 00:55:28 +00:00
Jerome Mouneyrac 794e40ec36 MDL-28629 more checks during web service authentication 2011-11-11 17:21:38 +08:00
Aparup Banerjee eff6d318ff Merge branch 'wip-mdl-29638-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-11-11 17:02:51 +08:00
andrew 327120be6a MDL-27703 gradebook: altered an sql query in the user report. join with no on clause causes an error in some DBs 2011-11-11 14:26:07 +08:00
Aparup Banerjee 483f992801 MDL-27037 wiki : fixed whitespace. 2011-11-11 13:27:27 +08:00
Aparup Banerjee 7ba8da8a13 Merge branch 'm20_MDL-27037_wiki_visiblegroups_functionality' of https://github.com/mayankgupta/moodle into MOODLE_20_STABLE 2011-11-11 13:14:52 +08:00
Aparup Banerjee 4342686ce6 Merge branch 'wip-MDL-26712-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-11 11:27:01 +08:00
Eloy Lafuente (stronk7) c8a5dfe0bd Merge branch 'MDL-29035-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-11 02:44:00 +01:00
Eloy Lafuente (stronk7) 1739fe7331 Merge branch 'MDL-22351-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-11 02:34:32 +01:00
Stephen Bourget d83c73053d MDL-29529 Assignment: Fix regression caused by MDL-27638 2011-11-11 01:23:20 +01:00
Andrew Robert Nicols f6d6e5446d MDL-30042: Sanitize httpwwwroot in mnet jump 2011-11-10 10:18:03 +00:00
Eloy Lafuente (stronk7) 3d99c7ef99 Merge branch 'MDL-28426_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-11-10 01:34:05 +01:00
Eloy Lafuente (stronk7) 81a95b0185 Merge branch 'MDL-30158-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-10 00:23:02 +01:00
Eloy Lafuente (stronk7) cc13ca3111 NOBUG: Whitespace cleanup 2011-11-09 16:29:33 +01:00
Eloy Lafuente (stronk7) 14db36e6d1 MDL-27542 calendar export: deleting remaining debugging 2011-11-09 16:00:41 +01:00
Eloy Lafuente (stronk7) 6733ba320d Merge branch 'MDL-27542b_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-11-09 15:57:09 +01:00
Aparup Banerjee 41752c58bc Merge branch 'MDL-29620-workshop-sequence_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-11-09 17:55:28 +08:00
Sun Zhigang e293df9442 MDL-29656 Fix bad string reference 2011-11-09 16:45:27 +08:00
Dan Poltawski 1803769098 MDL-29696 mod/data - fixed page continuing after footer. 2011-11-09 15:43:48 +08:00
Sun Zhigang 94eaa78a25 MDL-29722 - No default guest enrol instance for requested courses 2011-11-09 15:24:59 +08:00
Jason Fowler 3cbecebfa4 MDL-30194 - Lib - Fixing phpdoc for clean_param 2011-11-09 14:56:57 +08:00
Aparup Banerjee bca9d87c4e Merge branch 'MDL-29977-mnet-masquerade_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-11-09 13:38:07 +08:00
Dan Poltawski 52a29f890e MDL-29812 partcipiant report - breaks when filtering by user 2011-11-09 11:17:40 +08:00
Aparup Banerjee 8935486dc4 Merge branch 'wip-MDL-24200-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-09 11:05:15 +08:00
Dan Poltawski 2eb04f8ad3 MDL-29803 report/logs - don't retrieve all users uncessarily
Also remove uncessary retrieval of idnumber

Helps display the main logs page on large sites without running out of
memory

Conflicts:

	course/report/log/lib.php
2011-11-09 00:48:47 +01:00
Aparup Banerjee ce8e567302 Merge branch 'wip-mdl-27521-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-08 15:18:54 +08:00
Aparup Banerjee 3fa32485c9 MDL-30154 Repositories : fixed whitespace. 2011-11-08 11:31:24 +08:00
Aparup Banerjee 3555da1d3c Merge branch 'MDL-30154_20_wip' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-11-08 11:31:15 +08:00
Ankit Kumar Agarwal d90316ff6c MDL-30158 Questions Cleaning up blackboard/format.php 2011-11-08 07:45:48 +05:30
Sam Hemelryk 7352bbbc6a Merge branch 'MDL-25823_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-11-08 13:09:29 +13:00
Mark Nielsen d9f049c913 MDL-30059: Assignment Submission Notification Should Use Teacher's Timezone Rather Than Server Time 2011-11-08 12:53:08 +13:00
Sam Hemelryk 7f5380be08 Merge branch 'MDL-29420-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-08 12:00:42 +13:00
Rossiani Wijaya d3826329f6 MDL-27542 calendar export: fixed the following:
1. changing auth token to use user id instead of username
2. add fall back checking for old url
3. remove yui functionality to generate calendar url
4. fixed usercontext instance
2011-11-07 17:08:19 +08:00
Jason Fowler 35271f566f MDL24200 - Admin Users - Changing the submit button to just a button to prevent it from taking focus when entering text. (Patch provided by Hubert Chathi) 2011-11-07 15:41:37 +08:00
Aparup Banerjee b062b305f1 MDL-28670 webservice : added dimming of service name in security keys page if webservice is disabled or not on authorised list to access webservice. 2011-11-07 14:23:31 +08:00
Sam Hemelryk 0737e258b6 MDL-28292 block_html: white space fix 2011-11-07 12:33:42 +13:00
Sam Hemelryk fb3bf9a0d2 Merge branch 'wip-MDL-28292-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-07 12:24:15 +13:00
Mary Evans 7b1009233f MDL-30010 FIX for pagelayout problems when moving blocks 2011-11-06 22:46:18 +00:00
Sam Hemelryk 57b290b458 Merge branch 'MDL-29955_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-11-07 11:41:18 +13:00
Andreas Grabs 15f5066c93 MDL-30154 - WebDAV-Repository fails on some WebDAV-Server 2011-11-06 22:13:09 +01:00
David Mudrak 562c3f715f MDL-29620 workshop table id sequence reset after the upgrade 2011-11-04 13:57:40 +01:00
David Mudrak 0d7887f554 MDL-29977 MNet does not allow to start a remote session when masquerading as another user 2011-11-04 09:33:58 +01:00
Ankit Kumar Agarwal 93661834d8 MDL-29420 Global Search Fixing string issue 2011-11-04 12:37:32 +05:30
Mary Evans 7946da5f3c wip-MDL-22351 convert Anomaly CSS to readable format 2011-11-04 02:49:12 +00:00
Roger Moore 537114c6cc MDL-28426 question export should write answer and feedback format to the file. 2011-11-03 10:31:22 +00:00
Jason Fowler d153f01a53 MDL-28292 - Blocks - Patch supplied by Chris Follin to fix blocks with empty titles that disappear when docked 2011-11-03 16:35:05 +08:00
Rajesh Taneja 2b2fd42abc MDL-25937 Forms Library: Filepicker will respect disable if 2011-11-03 13:38:47 +08:00
Rajesh Taneja 3709584065 MDL-25937 Froms Library: Added server side validation for filepicker and filemanager 2011-11-03 13:38:47 +08:00
Jason Fowler 602c77f68c MDL-26712 Themes - Correcting text dimming for hidden labels 2011-11-03 13:22:55 +08:00
Ankit Kumar Agarwal ce77d3ea8c MDL-29035 Backups making email match case-insensitive when restoring backups 2011-11-03 10:37:45 +05:30
Rossiani Wijaya 9e232387f5 MDL-25823 lesson mod: fixed true and false question feedback. 2011-11-03 12:15:55 +08:00
AMOS bot a3bee9b1d3 Automatically generated installer lang files 2011-11-03 00:55:40 +00:00
Eloy Lafuente (stronk7) 919e659ba6 weekly release 2.0.5+ 2011-11-02 19:54:36 +01:00
Eloy Lafuente (stronk7) 8a79a37526 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-11-02 19:48:57 +01:00
Eloy Lafuente (stronk7) 3db86da7bb Merge branch 'm20_MDL-29213' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-11-01 19:55:52 +01:00
Aparup Banerjee a4276fe096 Merge branch 'w43_MDL-30005_m20_uri' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-11-01 15:28:25 +08:00
Petr Skoda 494268cd48 MDL-30005 regression fix for non http/ftp urls 2011-11-01 07:58:05 +01:00
Aparup Banerjee d14031e9ae Merge branch 'w43_MDL-29990_m20_navcontinue' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-11-01 12:16:42 +08:00
Aparup Banerjee ace896cda7 Merge branch 'MDL-29787_M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-01 12:07:57 +08:00
Sam Hemelryk 16d1e22c10 Merge branch 'w43_MDL-29980_m20_flowcss' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-11-01 16:54:03 +13:00
Gerwood Stewart 9fee0258a4 MDL-27521 Updates the can_finalize and can_unfinalize methods to deal with passing a submission object that isn't one (in this case is a Boolean value). This will result in both methods now returning false. Kick on effect is that it corrects the bug described in MDL-27521 by removing the button if it isn't possible to finalize the submission. 2011-11-01 11:45:10 +08:00
Sam Hemelryk 3a7d4b4b3d Merge branch 'MDL-29197-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-01 16:11:04 +13:00
Sam Hemelryk 2b7b20dea9 Merge branch 'MDL-25760_M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-11-01 15:58:28 +13:00
AMOS bot d555b33e55 Automatically generated installer lang files 2011-11-01 00:55:25 +00:00
Sam Hemelryk 0bc3cbc276 Merge branch 'w43_MDL-29925_m20_calendar' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-11-01 09:37:55 +13:00
Aparup Banerjee 4b25984a20 Merge branch 'w43_MDL-29966_m20_grouploading' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-10-31 16:06:03 +08:00
Rossiani Wijaya 25713708d6 MDL-29955: filestorage/file_types: add support for .aac, .f4v, .m4v and .webm 2011-10-31 15:33:50 +08:00
Aparup Banerjee 230c61f562 MDL-30005 URL : fixed typos 2011-10-31 15:20:08 +08:00
Aparup Banerjee 44aba13a35 Merge branch 'MOODLE_20_STABLE' of git://git.moodle.org/integration into MOODLE_20_STABLE 2011-10-31 15:19:43 +08:00
Sam Hemelryk f909700aff Merge branch 'MDL-29810-20' of git://github.com/bostelm/moodle into MOODLE_20_STABLE 2011-10-31 17:09:41 +13:00
Dan Marsden 11fd3b45bb MDL-29213 SCORM - fix for bug with flash player and IE 9 2011-10-31 15:00:37 +13:00
Mary Evans 306beb581d MDL-29197 FIX for content displacment when clicking anchor elements in course page 2011-10-31 01:51:24 +00:00
Sam Hemelryk 6cedec7615 Merge branch 'MDL-30006-workshop-grades_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-10-31 13:05:35 +13:00
Sam Hemelryk f672031f54 Merge branch 'm20_MDL-28559' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-10-31 13:00:25 +13:00
Petr Skoda 27a8ee7404 MDL-30005 bump up version after lang string change 2011-10-30 23:55:37 +01:00
Petr Skoda eb4e049654 MDL-30005 fix general URI support in URL module
The recent change completely removed support for general URIs and enforced strict URL validation which was breaking backwards compatibility and was not user friendly at all.

This patch finally adds full URI support with basic validation and fixes some older xhtml strict issues.

Please note we do not try to explain the difference between URL and URI to our users. Also keep in mind that mod/url has XSS risk and does not do any security validation of the data.
2011-10-30 23:55:30 +01:00
David Mudrak e4829fa696 MDL-30006 Workshop / Number of errors grading: force graders to actually answer the form
QuickForms do not distinguish non-checked radio from the checked radio
with the value "0". So we map the database grade value "0" to a value
"-1" when displaying the form and vice versa when saving the form. This
allowed us to have none radios checked by default and force the grader
to actually answer the form themselves, using the 'required' rule.
2011-10-30 20:05:27 +01:00
David Mudrak 1fd94ee7d7 MDL-30006 Workshop / Accumulative grading: force graders to actually pick a grade
This patch introduces a new hidden field with the value "-1". The grade
selectors are compared with this values and must be greater than it.
This should fit well for numerical grades with the range 0..x and scale
items with the range 1..x.
2011-10-30 18:57:57 +01:00
Petr Skoda 7704977132 MDL-29990 fix syntax error 2011-10-29 10:01:14 +02:00
Petr Skoda ae7cc577b7 MDL-29925 improve redirect url cleanup 2011-10-28 19:33:38 +02:00
Petr Skoda e3b2cd8543 MDL-29966 fix invalid group loading image
Credit goes to Alexander Bias.
2011-10-28 15:50:28 +02:00
Petr Skoda a944c3dc97 MDL-29980 fix rules typo
Credit goes to Paul Nicholls.
2011-10-28 15:36:32 +02:00
Mary Evans 9a5d24911b MDL-25760 FIX for highlighted current topic section 2011-10-28 01:34:12 +01:00
Mary Evans a6887331c2 MDL-29787 FIX to remove sprite hover image from single menu item 2011-10-28 00:35:17 +01:00
Henning Bostelmann 3be42c9e85 MDL-29810 Assignment grading: don't include teachers in list of students 2011-10-27 22:20:04 +01:00
Eloy Lafuente (stronk7) e1fe0c5189 weekly release 2.0.5+ 2011-10-27 18:54:42 +02:00
Eloy Lafuente (stronk7) 46fe9a9701 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-10-27 18:49:26 +02:00
AMOS bot 8167bfc973 Automatically generated installer lang files 2011-10-27 00:55:39 +00:00
Eloy Lafuente (stronk7) 512d5310db MDL-29912 course search - oracle inabilities with concats, empties, nulls and type-restrictions 2011-10-27 13:00:10 +13:00
Dan Marsden 5c5dbec7de MDL-28559 - hide send for marking button from people that are enrolled but don't have capability to submit files - displays the same way as teachers/admins - keeps ability to display previously submitted files if they exist 2011-10-26 10:59:53 +13:00
Sam Hemelryk d6261cf8c6 Merge branch 'MDL-29569_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-10-26 10:43:59 +13:00
Dan Poltawski 9485c9e4df MDL-26568 block_online_users - reporting incorrect number of users
When over 50 users were online the count used in the listing was incorrect
2011-10-25 23:35:40 +02:00
Stephen Bourget a558511b85 MDL-29368 Assignment: Fixed a fatal error caused by a missing include 2011-10-25 19:19:54 +02:00
Rossiani Wijaya 4d5dc3104b MDL-29569: lesson_mod: in matching type questions, fixed and set default value for scoring and fixed jump page setting when response text is set to empty 2011-10-25 12:12:54 +08:00
Sam Hemelryk abd481c63e Merge branch 'MDL-28324_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-10-25 15:44:40 +13:00
Sam Hemelryk 88507c0063 Merge branch 'wip-MDL-29231-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-10-25 15:19:33 +13:00
Petr Skoda 7a03cfd525 MDL-29444 use iframe embedding in IE
iframe is back in HTML 5, we can safely use it in IE for all text documents because object embedding has multiple problems
2011-10-25 14:32:22 +13:00
Tim Hunt 9ccf5668e7 MDL-28324 Two minor ouput glitches in the statistics report.
Fixes thanks to Jean-Michel Vedrine.
2011-10-24 22:16:46 +01:00
Eloy Lafuente (stronk7) 9bec13184c Merge branch 'w42_MDL-29867_m20_author' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-10-24 23:15:04 +02:00
Aparup Banerjee 2db9576147 Merge branch 'MDL-29542_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-10-24 17:05:49 +08:00
Aparup Banerjee 1e898eefe3 Merge branch 'MDL-29619-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-10-24 14:49:54 +08:00
Jason Fowler 647153cd4f MDL-29231 - Course, Resource - Fix so that the correct icon is displayed for courses that have had two or more files uploaded to them - Thanks Michael D for the patch 2011-10-24 14:26:25 +08:00
Petr Skoda 3765f9a4bc MDL-29867 fix invalid file author 2011-10-22 20:22:58 +02:00
Andreas Grabs fe6d0cf80d MDL-29806 - When a Feedback activity is restore the "Site after submit" URL is not updated and shows "$@PAGEVIEWBYID*15463@$" 2011-10-21 23:08:18 +02:00
Ankit Kumar Agarwal b216ddbe68 MDL-29619 Validate urls before generating output 2011-10-21 14:23:52 +05:30
Rossiani Wijaya e6aebbff8d MDL-29542 lesson module: changing qtype param type to INT 2011-10-21 12:42:50 +08:00
Eloy Lafuente (stronk7) 22df4905ca emergency release 2.0.5+ 2011-10-20 00:55:20 +02:00
Eloy Lafuente (stronk7) 150c09677c MDL-29496 course search - emergency regression fix 2011-10-20 00:49:43 +02:00
Eloy Lafuente (stronk7) 885ce5ff89 weekly release 2.1.2+ 2011-10-19 18:46:20 +02:00
Eloy Lafuente (stronk7) 87187e0ef9 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-10-19 18:41:53 +02:00
Sam Hemelryk 537cfab964 MDL-26953 theme_nonzero: Quick fix to incorrect left position 2011-10-19 16:27:18 +13:00
Eloy Lafuente (stronk7) 2092307aba Merge branch 'wip-MDL-29496-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-10-18 11:02:30 +02:00
Eloy Lafuente (stronk7) 64696ae4cc MDL-29496 unittests - verify COALESCE() cross-db compatibility 2011-10-18 16:01:47 +08:00
Sam Hemelryk 13df91ba6d Merge branch 'MDL-28170_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-17 18:51:40 +13:00
Sam Hemelryk d951bc52ac Merge branch 'MDL-26953-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-10-17 17:36:52 +13:00
Sam Hemelryk 9bb0bf92ab Merge branch 'MDL-29781-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-10-17 15:17:14 +13:00
Sam Hemelryk 14c31e1829 Merge branch 'MDL-26893-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-10-17 13:55:41 +13:00
Eloy Lafuente (stronk7) fcc0927953 MDL-28170 environment - add new 2.2 section
nothing changes from 2.1 as far as it was agreed that this will be
the last version supporting 1.9 upgrade. See issue for details.
2011-10-17 02:13:09 +02:00
Aparup Banerjee 8558498fb4 MDL-27351 Quiz : updated string to reflect validation looking for embedded questions. 2011-10-16 19:22:53 +02:00
Aparup Banerjee beb0f4a229 MDL-28436 webservice : fixed missing field in query 2011-10-16 19:13:42 +02:00
Eloy Lafuente (stronk7) bfe60efbb7 MDL-29191 wiki - avoid one more username leak 2011-10-16 19:02:56 +02:00
Sun Zhigang ff6c9d2f86 MDL-29191 - Show creator's fullname instead of username 2011-10-16 18:52:16 +02:00
Stephen Bourget b629bbec9f MDL-29698 Assignment: Fix broken logentry 2011-10-16 18:25:45 +02:00
Eloy Lafuente (stronk7) 3065bfa1e1 Merge branch 'MDL-28483-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-10-16 17:38:37 +02:00
Petr Skoda a1195a463d MDL-29773 prevent negative unix timestamps in the files table 2011-10-16 16:52:12 +02:00
Petr Skoda 4a50c000ab MDL-29773 use db debuginfo when file record insertion fails 2011-10-16 16:52:12 +02:00
Mary Evans b9edb6a853 MDL-29781 FIX for side-post-only layout 2011-10-14 20:44:51 +01:00
Mary Evans 456a4de803 MDL-26953 FIX for side-post-only layout 2011-10-14 02:33:57 +01:00
AMOS bot 694e29989f Automatically generated installer lang files 2011-10-14 00:55:32 +00:00
Ankit Kumar Agarwal 503581b5d0 MDL-28483 URL adding validation checks and changing field externalurl to not-null 2011-10-13 09:10:07 +05:30
Mary Evans 93149694d8 MDL-26983 FIX for side-post-only layout 2011-10-13 02:51:24 +01:00
Eloy Lafuente (stronk7) 9cdadbcad4 weekly release 2.0.5+ 2011-10-12 23:49:46 +02:00
Sam Hemelryk 79175f2019 MDL-29224 navigation Fixed bug caused because in 20 and 21 onclick events get added to extra rather than onclick 2011-10-12 19:46:53 +13:00
Aparup Banerjee f36e320c7e Merge branch 'wip-MDL-27278-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-11 11:26:07 +08:00
Aparup Banerjee 5775674f8c Merge branch 'wip-MDL-28582-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-11 09:28:02 +08:00
Sam Hemelryk 2f92290515 Merge branch 'MDL-29454_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-10-11 10:44:53 +13:00
Aparup Banerjee 422d1ed274 Merge branch 'wip-MDL-29224-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-10 23:15:16 +08:00
Aparup Banerjee c868308b89 Merge branch 'wip-MDL-29672-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-10 22:47:27 +08:00
Eloy Lafuente (stronk7) a2f5969b3d MDL-29564 Assignment: whitespace fix 2011-10-10 13:10:31 +02:00
Sam Hemelryk 787fc502ad Merge branch 'MDL-16553-20' of git://github.com/bostelm/moodle into MOODLE_20_STABLE 2011-10-10 17:57:18 +13:00
Sam Hemelryk 3974508f3f MDL-29690 mod_choice: Fixed regression from merge conflict 2011-10-10 16:48:57 +13:00
Jason Fowler 27d0976f6c MDL-29496 Search, Course - Code applied from patch to allow courses with a blank summary to be found in searchs - Thanks to Andrew Nicols for the patch 2011-10-10 11:37:46 +08:00
Dan Poltawski 1a7541517c MDL-29661 - lib/googleapi.php - Switch to SSL urls
I am not sure why I did not use these in the first instance, I don't
think Google supported SSL in the first versions of their API.

They do now, and it seems that this week they stopped supporting non-ssl
requests.
2011-10-10 16:28:58 +13:00
Sam Hemelryk 9f46908ac4 Merge branch 'MDL-29668_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-10 12:09:06 +13:00
Sam Hemelryk dbd95c2aca Merge branch 'MDL-29677_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-10 12:02:26 +13:00
Stephen Bourget d783eff54b MDL-29564 Assignment: Fixed a fatal error caused by a missing include 2011-10-10 11:54:39 +13:00
Dan Marsden 470e0cea2b MDL-29690 fix usage of select all/deselect all in choice reports 2011-10-10 11:40:59 +13:00
Sam Hemelryk bcc892d151 MDL-28582 course-report: Added a nothing to display notification to the outline and complete activity reports 2011-10-10 10:35:33 +13:00
Sam Hemelryk d86419ad87 MDL-29672 user: Fixed user edit page for non-admin users 2011-10-10 10:28:33 +13:00
Sam Hemelryk 00cc7f5cc9 MDL-27278 navigation: Admin users can now set the home page preference like normal users 2011-10-10 10:17:50 +13:00
Eloy Lafuente (stronk7) 3d765bc299 Moodle release 2.0.5 2011-10-09 00:52:59 +02:00
Eloy Lafuente (stronk7) 8f24208eb9 MDL-29668 xmldb editor - fix PHP generation for foreign-unique keys 2011-10-08 21:52:23 +02:00
Henning Bostelmann 5458ff4d23 MDL-16553 Assignment, student view: show response files when no grade available 2011-10-07 23:23:27 +01:00
Tim Hunt becf8f8a23 MDL-29454 qtype admin page does not work in some browsers.
The problem is that they were using input type=image, but they trying to
process that using optional_param. With input type=image, Firefox sends
inputname.x and inputname.y POST data, not inputname.

This fix is done by back-porting the working code from Moodle 2.1, so
the changes are bigger than the minimal changes required to fix this,
but that will make back-porting any future bug-fixes will be easier.
2011-10-07 19:26:50 +01:00
Tim Hunt 0b45720b6e MDL-29454 Fix coding style before trying to do the real fix.
All the changes here should be whitespace, /// -> // or adding boilerplate comment.
2011-10-07 19:26:48 +01:00
Eloy Lafuente (stronk7) 2c600c42fa MDL-29677 unit tests - missing global was causing tons of incorrect debugging info 2011-10-07 01:24:54 +02:00
Eloy Lafuente (stronk7) 9e4b400c67 weekly release 2.0.4+ 2011-10-07 00:11:54 +02:00
Eloy Lafuente (stronk7) 9a31f96622 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-10-07 00:05:23 +02:00
Sam Hemelryk 739328d149 MDL-29224 navigation: Navigation now respects a modules onclick event when preparing navigation nodes 2011-10-06 19:33:01 +13:00
Aparup Banerjee 8e6e5adb5b Merge branch 'wip-MDL-28615-m20-squashed' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-05 14:54:31 +08:00
Eloy Lafuente (stronk7) 51acffb94a Merge branch 'MDL-28469_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-10-05 01:15:06 +02:00
Eloy Lafuente (stronk7) 74126d6d3e Merge branch 'wip-MDL-25697-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-05 01:10:40 +02:00
Sam Hemelryk c9cfe78950 MDL-28615 forum: Fixed up a couple of minor regressions 2011-10-05 11:09:38 +13:00
Eloy Lafuente (stronk7) d5ca7b11b7 Merge branch 'MDL-27857-assignment-portfolio_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-10-04 12:48:30 +02:00
Eloy Lafuente (stronk7) 33091e7e58 Merge branch 'MDL-19575-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-10-04 12:13:09 +02:00
Sam Hemelryk 019e897604 Merge branch 'MDL-29621_20_wip' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-10-04 17:58:07 +13:00
Sam Hemelryk bdf95827b5 MDL-28615 forum: Fixed missing context regression 2011-10-04 16:36:52 +13:00
Sam Hemelryk c03a8543f0 Merge branch 'MDL-28725_wiki_section2_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-10-04 16:21:48 +13:00
Andreas Grabs fdd6b2fa57 MDL-29621 - XHTML not welformed when creating Feedback questions 2011-10-03 18:46:22 +02:00
Tim Hunt 2602c1ce44 MDL-28469 quiz settings pages should be pagelayout admin. 2011-10-03 16:39:34 +01:00
David Mudrak f5edf4eba4 MDL-27857 Export to portfolio support in the assignment module improved
Portfolio API code in the assignment module expected that the current
user is the author of the submission. Therefore the "Export to
portfolio" button did not work when the submission was viewed by a
teacher (eg at the page with the list of all submissions in the Advanced
upload assignment).

This patch introduces a new callback argument 'submissionid' that holds
explicit ID of the submission the export deals with. With it available,
we do not need to expect the current user is the author of the
submission.

The patch also cleans some strings used for portfolio callback
exceptions.

Backported from MOODLE_21_STABLE, resolved conflicts in:

	mod/assignment/lib.php
	mod/assignment/renderer.php
2011-10-03 11:15:17 +02:00
David Mudrak ee281f15a7 MDL-27857 Typo in the phpDocs fixed 2011-10-03 10:27:05 +02:00
David Mudrak 490057db33 MDL-27857 Assignment does not use form tag to render portfolio export control widget
When this code was used as a part of the grading screen, the default
PORTFOLIO_ADD_FULL_FORM widget led to nested form elements. This patch replaces
the form widget with a plain text link that can be embedded safely.

Backported from MOODLE_21_STABLE with a conflict resolved in mod/assignment/renderer.php
2011-10-03 10:26:01 +02:00
Aparup Banerjee 6dd8588504 MDL-26486 Lesson : fixed whitespace 2011-10-03 16:03:15 +08:00
Aparup Banerjee e2c3a02bb8 Merge branch 'MDL-26486_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-10-03 16:03:03 +08:00
Andrew Davis (andyjdavis) 5dd5818c9a MDL-27640 rating: altered the return url provided by mod_data to ratings 2011-10-03 15:27:58 +08:00
Aparup Banerjee 1f6a502674 Merge branch 'wip-MDL-27867-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-10-03 14:31:44 +08:00
Aparup Banerjee 067a949f46 MDL-29541 Administration : fixed whitespace 2011-10-03 14:05:05 +08:00
Aparup Banerjee 4824e2deff Merge branch 'wip-mdl-29244-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-10-03 13:52:52 +08:00
Rajesh Taneja 95a14f5d55 MDL-29244 Users: Fixed filter for selecting users who never logged in and course roles dropdown show all revelent roles 2011-10-03 13:47:58 +08:00
Sam Hemelryk 77738c4562 Merge branch 'MDL-29296_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-10-03 17:09:35 +13:00
Sam Hemelryk e93dd0d650 Merge branch 'wip-mdl-29539-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-10-03 15:10:05 +13:00
Sam Hemelryk 98b723b1ce MDL-28566 theme_base: removed MDL comment 2011-10-03 15:00:43 +13:00
Sam Hemelryk d6a7cac991 Merge branch 'MDL-28566-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-10-03 14:38:14 +13:00
Sam Hemelryk ec9b8fb68d Merge branch 'MDL-29323-M20' of git://github.com/lazydaisy/moodle into MOODLE_20_STABLE 2011-10-03 14:30:26 +13:00
Sam Hemelryk 8bd76f9e65 Merge branch 'wip-MDL-25454-MOODLE_20_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_20_STABLE 2011-10-03 14:23:59 +13:00
AMOS bot 4dbfb1becc Automatically generated installer lang files 2011-10-03 00:55:34 +00:00
Sam Hemelryk c06645a539 Merge branch 'MDL-29567_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-03 13:23:37 +13:00
Sam Hemelryk 85906b4ae5 Merge branch 'MDL-29566_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-03 12:50:10 +13:00
Sam Hemelryk 424cb3b0ef Merge branch 'MDL-29618_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-10-03 12:28:27 +13:00
Eloy Lafuente (stronk7) ab37ff5952 MDL-29618 backup - back to handling enrolments properly. Regession of MDL-26841, my fault, grrr 2011-10-03 00:47:51 +02:00
Sam Hemelryk b38867187f MDL-28615 forum: Revised enrol_sharing_course to use the new enrol_get_shared_courses and fixed permission checking in forum_user_can_see_post 2011-10-03 11:31:17 +13:00
Kordan 1cef86131d MDL-29403 fix for M20 2011-09-30 11:14:00 +02:00
Mary Evans 14b0fea807 MDL-29323-FIX invalid border style 2011-09-30 03:08:51 +01:00
AMOS bot 9fb272baaa Automatically generated installer lang files 2011-09-30 00:55:25 +00:00
Marina Glancy 44e9ca744e MDL-25454: using the faster way to check if record exists in db 2011-09-29 17:07:39 +08:00
Andrew Davis (andyjdavis) a80c9b9816 MDL-28725 wiki: added urlencode around the section variable when it is being used to construct URLs 2011-09-29 16:53:16 +08:00
Andrew Davis (andyjdavis) 3f1ef9ec5a MDL-28725 wiki: added missing string
AMOS BEGIN
 CPY [invalidsection,core_admin],[invalidsection,mod_wiki]
AMOS END
2011-09-29 16:53:07 +08:00
Rossiani Wijaya d754f1b012 MDL-26486 lesson mod: fixed grade report error on matching and shortanswers questions. 2011-09-29 13:10:35 +08:00
Ankit Kumar Agarwal 4ca24885a5 MDL-19575 Global Search Adding capability checks to the search and stat pages 2011-09-29 09:18:23 +05:30
Marina Glancy d69c84b185 MDL-25454 before skipping course backup make sure that there are no change entries in it's log during the last month. Store the nextstarttime even for courses that were not backed up 2011-09-29 10:01:50 +08:00
Rajesh Taneja 87fccbc271 MDL-29539 HTML Editor: Fixed XHTML formatting for editor 2011-09-29 09:35:52 +08:00
Sam Hemelryk dbde930a58 MDL-28615 mod_forum: Fixed the users page that shows all of the users posts 2011-09-29 14:21:26 +13:00
Sam Hemelryk 63cca18b3a MDL-25697 theme_base: Improved the alignment of the activity editing icons on the course frontpage 2011-09-29 14:15:13 +13:00
AMOS bot 18c99c67fa Automatically generated installer lang files 2011-09-29 00:55:45 +00:00
Eloy Lafuente (stronk7) 00b4aadafe MDL-29567 postgresql - handle negative defaults in numerical cols properly 2011-09-29 01:22:54 +02:00
Eloy Lafuente (stronk7) 13e183dd84 MDL-29567 unit tests - add some tests to cover negative defaults in numerical cols 2011-09-29 01:22:51 +02:00
Eloy Lafuente (stronk7) b558672db4 MDL-29566 mysql - length / decimal specs in float columns are optional 2011-09-29 00:31:30 +02:00
Eloy Lafuente (stronk7) 627282714b MDL-29566 unit tests - add some tests to cover get_columns() with number/float columns 2011-09-29 00:31:21 +02:00
Sam Hemelryk 199e7e9f85 MDL-27867 course: Course and category theme selectors no longer show theme's that should be hidden from the selector 2011-09-29 10:48:16 +13:00
Mary Evans 20b76253fb MDL-28566 - Fix for participants user details 2011-09-28 15:36:12 +01:00
Eloy Lafuente (stronk7) 690ef509de weekly release 2.0.4+ 2011-09-28 11:08:56 +02:00
Eloy Lafuente (stronk7) 0442a23878 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-09-28 11:04:44 +02:00
AMOS bot df50b954c6 Automatically generated installer lang files 2011-09-28 00:55:26 +00:00
Aparup Banerjee 38be5071c8 Merge branch 'MDL-29230_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-09-27 15:01:45 +08:00
Aparup Banerjee 041d4b3fab Merge branch 'MDL-25241_forum_search_ratings_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-09-27 11:27:26 +08:00
Sam Hemelryk a53366f7ab Merge branch 'm20_MDL-29519' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-09-27 14:17:36 +13:00
Sam Hemelryk bacfad505d Merge branch 'MDL-29411_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-27 11:17:59 +13:00
Eloy Lafuente (stronk7) fff222f460 Merge branch 'w38_MDL-29535_m20_filters' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-09-26 23:57:51 +02:00
Petr Skoda 60df5b0c05 MDL-29535 fix support for custom filter settings in contrib filters 2011-09-26 23:51:08 +02:00
Eloy Lafuente (stronk7) d2175fceaa Merge branch 'MDL-29462_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-26 22:42:43 +02:00
Eloy Lafuente (stronk7) aa114967bb Merge branch 'MDL-28202_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-26 22:37:51 +02:00
Eloy Lafuente (stronk7) e60ca6985b Merge branch 'MDL-29201_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-26 22:22:04 +02:00
Eloy Lafuente (stronk7) b506a6f08e Merge branch 'MDL-29528_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-26 21:45:15 +02:00
Tim Hunt 5751edbcb1 MDL-29411 questiontext images not displayed in randomsamatch generated questions. 2011-09-26 13:52:02 +01:00
Tim Hunt 7c144c47e5 MDL-29528 qtype multichoice and caclulated combined feedback format overwritten during upgrade.
Conflicts:

	question/type/multichoice/backup/moodle1/lib.php
2011-09-26 13:40:56 +01:00
Rossiani Wijaya 5f32139fde MDL-29296 lesson mod: fixed regression for continue button on last lesson page. 2011-09-26 16:30:43 +08:00
Aparup Banerjee 30a7869e49 Merge branch 'wip-MDL-29487-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-09-26 16:01:47 +08:00
Aparup Banerjee f2b7714f6b Merge branch 'MDL-29464_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-26 14:50:09 +08:00
Aparup Banerjee d0830107cb Merge branch 'MDL-29333_rating_ajax_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-09-26 14:08:30 +08:00
AMOS bot 953560c9c4 Merge branch 'MOODLE_20_STABLE' into install_20_STABLE 2011-09-26 00:55:37 +00:00
Dan Marsden b2f46deb0b MDL-29519 move plagiarism cron to after event queue 2011-09-26 13:17:11 +13:00
Sam Hemelryk 5ea58ff4e1 Merge branch 'MDL-29336-numerrors-mapping-20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-09-26 12:36:18 +13:00
Sam Hemelryk 3603e0856a Merge branch 'MDL-29139_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-09-26 10:45:57 +13:00
Sam Hemelryk 91c578c06d Merge branch 'MDL-29190_20_wip' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-09-26 10:39:41 +13:00
Eloy Lafuente (stronk7) 7608f458e3 weekly release 2.0.4+ (emergency) 2011-09-25 17:27:31 +02:00
Eloy Lafuente (stronk7) 78d1df7fd5 MDL-29512 Revert "MDL-25937 Froms Library: Added server side validation for filepicker and filemanager"
This reverts commit 59bc05c4a2.
2011-09-25 17:16:01 +02:00
Eloy Lafuente (stronk7) bdf1df7058 MDL-29512 Revert "MDL-25937 Forms Library: Added Javascript validation for filepicker and filemanager. Also fixed disbledif rule check for both"
This reverts commit 312a8e0436.
2011-09-25 17:15:47 +02:00
AMOS bot 6c6a05e561 Automatically generated installer lang files 2011-09-25 00:55:26 +00:00
Andreas Grabs 0972d40ad9 MDL-29190 - XHTML not well formed in show_nonrespondents.php 2011-09-23 18:51:50 +02:00
Sam Hemelryk 58d7e8cf60 MDL-29487 enrol: Fixed typo in enrol_sharing_course 2011-09-23 18:18:20 +12:00
Rossiani Wijaya ebc788d13e MDL-29230 lesson_module: fixed question's answer to have 0 value. 2011-09-23 14:17:51 +08:00
Kyle Temkin 9d19a2bcd8 MDL-28202 qtype_calculated fix edge case in the rounding code. 2011-09-22 12:14:59 +01:00
Tony Levi c538ea951f MDL-29201: questions: Fix regraded essay questions not being placed into correct state 2011-09-22 11:48:09 +01:00
Andrew Davis (andyjdavis) 1239f5a5c4 MDL-25241 forum: reimplemented the display of ratings on the forum search page 2011-09-22 15:27:54 +08:00
Aparup Banerjee 47147e2ff5 MDL-29139 Forms Library : fixed missing require_once 2011-09-22 14:55:46 +08:00
David Mudrak c418df9c94 MDL-29336 Saving grade mapping table in the Workshop
The Workshop module using the "Number of errors" grading strategy did
not save all items in the grade mapping table. If some assessment form
fields have weight > 1, the number of possible errors is greater that
the number of the assessment form fields. The previous code deleted all
mappings where the number of errors was greater than the number of
fields.

In this patch, the maximum number of possible errors is calculated as a
sum of weights of all fields. Only mappings over this maximum are
deleted now.
2011-09-22 05:31:03 +02:00
Andrew Davis (andyjdavis) 6ec18f437b MDL-29333 rating: refactored the ratings ajax 2011-09-22 11:03:05 +08:00
Tim Hunt 2d56b929c0 MDL-29464 quiz add random question popup does not update sumgrades. 2011-09-21 16:40:47 +01:00
Tim Hunt 8dce32bb7b MDL-29462 html_to_text('0') gives '', not '0'.
Conflicts:

	lib/simpletest/testweblib.php
2011-09-21 16:40:18 +01:00
Eloy Lafuente (stronk7) 51e1e3d536 weekly release 2.0.4+ 2011-09-21 17:12:24 +02:00
Eloy Lafuente (stronk7) 0ca9b41b50 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-09-21 17:04:56 +02:00
AMOS bot 5e2f228709 Automatically generated installer lang files 2011-09-21 00:55:25 +00:00
Eloy Lafuente (stronk7) 387bde00c2 Merge branch 'MDL-26567_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-21 00:11:35 +02:00
Tim Hunt b9bed21722 MDL-26567 no grade category option on the quiz settings form.
Also, refine the standard_grading_coursemodule_elements method to add a
help string.

AMOS BEGIN
 CPY [gradecategory,grades],[gradecategoryonmodform,grades]
AMOS END
2011-09-20 12:21:36 +01:00
Eloy Lafuente (stronk7) eebe41c9d3 Merge branch 'wip-mdl-29079-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-20 09:51:44 +02:00
Aparup Banerjee 5e90b425fb Merge branch 'MDL-26890-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-09-20 13:18:24 +08:00
Ankit Kumar Agarwal 1a17422d24 MDL-26890 Forums Check on filesize if the file is added to the forum from private area 2011-09-20 10:20:58 +05:30
Rajesh Taneja 722bbfc81f MDL-29079 Administration: Added space on both sides of locked checkbox and for rtl language space will be applied accordingly 2011-09-20 11:51:25 +08:00
Aparup Banerjee 3ee798f85f Merge branch 'wip-mdl-28726-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-20 10:21:45 +08:00
Sam Hemelryk 5e51b68a18 Merge branch 'MDL-26841_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-09-20 12:13:29 +12:00
Sam Hemelryk 0243159817 Merge branch 'MDL-29392_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-09-20 11:59:03 +12:00
Eloy Lafuente (stronk7) 2bc77f9cc9 Merge branch 'wip-mdl-29079-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-20 00:18:03 +02:00
Eloy Lafuente (stronk7) 439de8cf42 Merge branch 'MDL-29126_export_separator_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-09-19 23:36:35 +02:00
Eloy Lafuente (stronk7) c1beb0fa2d Merge branch 'MDL-27298_forum_rating_participants' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-09-19 23:33:55 +02:00
M Kassaei 30721d4913 MDL-29392 grade/report/index.php should use $CFG->grade_profilereport 2011-09-19 11:33:18 +01:00
Eloy Lafuente (stronk7) aed1ff8d29 MDL-26841 backup - prevent any enrolments info to be handled in IMPORT/HUB operations 2011-09-19 11:25:02 +02:00
Rajesh Taneja facb211577 MDL-29079 Administration: Added space between checkboxes on general backup setting page 2011-09-19 13:37:48 +08:00
Sam Hemelryk f6b9535c4b Merge branch 'wip-mdl-25937-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-19 17:00:23 +12:00
Aparup Banerjee 3a5dd161c2 Merge branch 's13_MDL-28509_youtube_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-09-19 12:18:14 +08:00
Dongsheng Cai 54b3f85625 MDL-28509 repository : fixed youtube repository search keyword 2011-09-19 11:53:42 +08:00
Mark Johnson c865e54938 MDL-28509 repository_youtube Enable selection of sort order 2011-09-19 11:53:24 +08:00
Petr Skoda e157c695c9 MDL-29406 fix greedy config settings cleanup 2011-09-19 13:33:16 +12:00
Tim Hunt 1d469cae30 MDL-29360 quiz comment.php has broken JS for the Cancel button.
This swtichest it to more modern YUI3 approach.
2011-09-16 12:08:16 +01:00
Rajesh Taneja 7039fa8d96 MDL-28726 wiki-2.0: Fixed XSS in wiki comments 2011-09-16 11:11:32 +08:00
Rajesh Taneja 312a8e0436 MDL-25937 Forms Library: Added Javascript validation for filepicker and filemanager. Also fixed disbledif rule check for both 2011-09-16 09:18:57 +08:00
Rajesh Taneja 59bc05c4a2 MDL-25937 Froms Library: Added server side validation for filepicker and filemanager 2011-09-16 09:18:57 +08:00
Eloy Lafuente (stronk7) 3df2ab8d98 weekly release 2.0.4+ 2011-09-16 01:39:32 +02:00
Eloy Lafuente (stronk7) 77962f179e Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-09-16 01:34:52 +02:00
AMOS bot ce7582df1f Automatically generated installer lang files 2011-09-15 00:55:25 +00:00
Aparup Banerjee 29134ecc9e MDL-26257 Authentication : fixed typo 2011-09-14 16:12:03 +08:00
Petr Skoda 2d1e165183 MDL-29295 do not use strtok in dml and ddl layers
This prevents clobbering of internal pointer when code calling DML
uses strtok too. Unit test added to prevent future uses.
2011-09-14 00:21:50 +02:00
Aparup Banerjee f3f329d1be MDL-26257 Authentication : whitespace/style fixes 2011-09-13 19:19:28 +08:00
Aparup Banerjee e2ea315c5b Merge branch 'MDL-26257-20' of git://github.com/bostelm/moodle into MOODLE_20_STABLE 2011-09-13 19:17:03 +08:00
Aparup Banerjee 25c976527b Revert "MDL-29188 multilang Reviewed the uses of section name and ensured things were being formatted consistently"
This reverts commit 64e085e1d1.
2011-09-13 16:29:59 +08:00
Aparup Banerjee 06a8b8482d Merge branch 'wip-MDL-29188-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-09-13 13:35:15 +08:00
Sam Hemelryk 62920e80ba Merged branch 'MDL-22232_easier_turn_off_notifications_20' from git://github.com/andyjdavis/moodle.git with conflict resolution 2011-09-12 20:27:41 +12:00
Sam Hemelryk 5fbc1470b1 Merge branch 'MDL-29211_M20' of git://github.com/kordan/moodle into MOODLE_20_STABLE 2011-09-12 19:49:46 +12:00
kordan f196ac57ca MDL-29211 fox for MOODLE_20_STABLE 2011-09-12 09:36:40 +02:00
Sun Zhigang 479af9ed9f MDL-29112 trigger event mod_deleted after deleting mod through AJAX 2011-09-12 17:36:20 +12:00
Sam Hemelryk 52c00a59c6 Merge branch 'MDL-28724_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-09-12 17:26:44 +12:00
Petr Skoda 42a349855f MDL-29131 fix multiple groups issues on the recent activity report 2011-09-12 17:09:06 +12:00
Aparup Banerjee 1fc6a6046a MDL-28724 wiki : Fixed bugs in wiki forms 2011-09-12 12:31:56 +08:00
Sam Hemelryk 13b7a5d4e5 Merge branch 'MDL-27635_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-09-12 14:39:42 +12:00
Sam Hemelryk f4aea09ea4 Merge branch 'w36_MDL-29312_m20_cookieless' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-09-12 14:31:03 +12:00
Rossiani Wijaya b086b19faa MDL-27635 hub component: fixed default value for 'secret' field in 'registration_hubs' table 2011-09-12 10:17:39 +08:00
Sam Hemelryk ef9d05cd99 Merge branch 'MDL-28488_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-09-12 13:21:01 +12:00
kordan e60fc41fdb MDL-29056 theme-formal_white fix for the report pagelayout that was preventing horizontal scroll 2011-09-12 13:03:21 +12:00
Eloy Lafuente (stronk7) d561fa9527 MDL-28488 backup - conditionaly apply defaults based on mode
Some modes of backup cannot be preloaded with general backup
settings because they may conflict with the definitions required/set
by the mode (for example, import backups are, by definition, without
users always, so we cannot apply one default in the opposite direction).

So, after the patch, current general_backup setting will be only applied
to general backups, import/hub modes won't be using any default and
automated backup defaults should be loaded here (TODO)
2011-09-11 22:00:08 +02:00
Eloy Lafuente (stronk7) 53c074a81c MDL-28488 backup - '[backup|restore]:configure cap does not control import mode anymore 2011-09-11 21:59:58 +02:00
Eloy Lafuente (stronk7) a31173a6a6 MDL-28488 backup - fixup some strings and delete legacy ones 2011-09-11 21:59:48 +02:00
Eloy Lafuente (stronk7) f850a316f7 MDL-28488 backup - make backup and import capabilities independent
Before this change, in order to perform one course import it was
necessary to have both the backupcourse and the backuptargetimport
capabilities. After agreement now each one will control its own
backup mode. Same applies for restore.
2011-09-11 21:59:29 +02:00
Petr Skoda f0a75425cb MDL-29312 prevent cookieless mode for security reasons 2011-09-11 10:09:14 +02:00
AMOS bot 43426f3bf8 Automatically generated installer lang files 2011-09-11 00:55:45 +00:00
Henning Bostelmann 42d4cf091e MDL-26257 Shibboleth auth: run logout handler only if logged in via Shibboleth 2011-09-08 11:56:20 +01:00
Andrew Davis (andyjdavis) c841c104f0 MDL-27298 forum: corrected a query in forum_get_participants() 2011-09-08 12:05:35 +08:00
AMOS bot 57ee29839a Automatically generated installer lang files 2011-09-08 00:55:35 +00:00
Sam Hemelryk 64e085e1d1 MDL-29188 multilang Reviewed the uses of section name and ensured things were being formatted consistently 2011-09-08 09:28:05 +12:00
Eloy Lafuente (stronk7) 4f65f98942 weekly release 2.0.4+ 2011-09-07 17:53:24 +02:00
Eloy Lafuente (stronk7) f3266ff658 Merge branch 'wip-MDL-28043-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-09-06 13:56:25 +02:00
Eloy Lafuente (stronk7) bede2a2a34 Merge branch 'wip-mdl-28987-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-06 02:00:12 +02:00
Sam Hemelryk c2731a79e2 MDL-28043 user Fixed context hack in pluginfile for user pics leading to init of page, theme and output for redirect 2011-09-06 11:29:56 +12:00
Eloy Lafuente (stronk7) 85ae284e59 Merge branch 'wip-mdl-23520-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-09-06 01:28:28 +02:00
Eloy Lafuente (stronk7) 029a753b91 Merge branch 'wip-MDL-29006-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-09-06 00:38:55 +02:00
Eloy Lafuente (stronk7) cba00bdb69 MDL-29072 Import course - whitespace fixes 2011-09-05 10:43:32 +02:00
Rajesh Taneja 39f5ddeeb7 MDL-28987 Forms Library: Removed onBlur validation. Now the validation will occur on form submit only 2011-09-05 14:34:07 +08:00
Iñaki Arenaza 556c446f32 MDL-27689 Vague README-LDAP file in auth/ldap
README-LDAP referes to a file that was renamed (to auth.php) in Moodle
1.8 and no longer exists. Make clear what file we are referring to.
2011-09-05 13:32:16 +08:00
Aparup Banerjee 70e16becad Merge branch 'wip-MDL-26811-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-09-05 13:22:25 +08:00
Aparup Banerjee 146ada0aa6 Merge branch 'MDL-29198_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-09-05 12:53:56 +08:00
Rajesh Taneja 11dd2fdb74 MDL-28987 Forms Library: Added tinyMCE onblur event callback for required tinymce fields 2011-09-05 12:23:29 +08:00
Rajesh Taneja 98b8818735 MDL-28987 Forms Library: Added tinyMCE save for tinymce editor validation 2011-09-05 12:23:23 +08:00
Adam Olley 52ed7bb7e3 MDL-28987: Affix [text] to editor element in JS validation and add blur event 2011-09-05 12:23:17 +08:00
Sam Hemelryk f364f5628f Merge branch 'MDL-29018_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-09-05 16:08:13 +12:00
Sam Hemelryk 2c90eef264 Merge branch 'MDL-28689_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-09-05 16:03:12 +12:00
Rossiani Wijaya 55b0567707 MDL-29018 lesson module statistics: fixed statistics diplay for whole the class 2011-09-05 11:14:21 +08:00
Rossiani Wijaya 08aaea9856 MDL-28689 chat module: add input.png file. This is a simple fix by copying the file from bubbles themes. Proper fix should be done in the future 2011-09-05 11:06:27 +08:00
Henning Bostelmann 1749c7aa31 MDL-29072 Import course: Use correct capability for course selection 2011-09-05 13:41:42 +12:00
Sam Hemelryk b1e71dac7d Merge branch 'MDL-27975_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-09-05 13:37:13 +12:00
Eloy Lafuente (stronk7) a2c3c37cb6 MDL-28080 DML unit tests - cover tweak_param_names() and the new 30 chars limit exception 2011-09-01 20:00:17 +02:00
Eloy Lafuente (stronk7) a4c5837ad7 MDL-28080 oracle - avoid tweak_param_names() tweaking too much :-P
Sometimes the (oracle only) tweak_param_names() method was causing
placeholders having > 28 chars length to exceed the 30 chars limit
imposed by Oracle. With this commit the tweak is performed by
replacement for such long placeholders and, at the same time, the
tweak has been commented out from insert/update because it is not
necessary there (placeholders are safe column name always)
2011-09-01 20:00:17 +02:00
Tim Hunt a167057d58 MDL-28080 coding_exception for over-long placeholder names. 2011-09-01 20:00:16 +02:00
Rossiani Wijaya 14d8d6b7bb MDL-27975 community block: fixed string typo 2011-09-01 17:11:39 +08:00
Eloy Lafuente (stronk7) 687e61cdea MDL-29198 DB - make delete_records transactional safe when needed 2011-09-01 11:08:58 +02:00
Andrew Davis (andyjdavis) e186fee5e3 MDL-22232 messaging: updated upgrade code to reduce server load during upgrade 2011-09-01 16:47:39 +08:00
Andrew Davis (andyjdavis) 1e7cd615c1 MDL-29126 gradebook: made text export with tabs as separator work 2011-09-01 15:42:53 +08:00
Rajesh Taneja 92a3823994 MDL-23520 mod-wiki-2.0: Added delete page and version feature as it was in 1.9 2011-08-31 13:54:24 +08:00
Sam Hemelryk 8068301cd7 MDL-29006 block_html Added formatted to title printed on editing form when a hard freeze is in effect 2011-08-31 11:47:03 +12:00
Eloy Lafuente (stronk7) 15141ad25f weekly release 2.0.4+ 2011-08-31 01:34:16 +02:00
Eloy Lafuente (stronk7) 724641e59a Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-08-31 01:29:52 +02:00
Aparup Banerjee 832ea65890 MDL-29005 blocks : clarified comment 2011-08-30 11:24:05 +08:00
Aparup Banerjee 311c3e9365 Merge branch 'MDL-29005_MOODLE_20_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-08-30 11:23:57 +08:00
Eloy Lafuente (stronk7) 65ab1ffa5b MDL-28489 site news forum - support multilang filter 2011-08-30 11:07:08 +12:00
Eloy Lafuente (stronk7) b7424c7693 Merge branch 'MDL-29141_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-29 13:02:27 +02:00
Eloy Lafuente (stronk7) 081d16475b Merge branch 'wip-MDL-24202-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-08-29 10:31:34 +02:00
Andrew Davis (andyjdavis) b15713760e MDL-22232 messaging: added some Javascript to the messaging preferences screen to make it awesomer 2011-08-29 15:58:26 +08:00
Sam Hemelryk f24f704630 MDL-24202 navigation Fixed bug caused by navigation overriding a CFG setting 2011-08-29 13:45:56 +12:00
Eloy Lafuente (stronk7) 22a35ffaaf Merge branch 'MDL-26302_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-29 03:23:45 +02:00
Sam Hemelryk 96083d8068 Merge branch 'MDL-26819_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-08-29 13:05:38 +12:00
Sam Hemelryk 31bb03f6e1 Merge branch 'dev_MDL-27289_boxnet_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-08-29 12:55:00 +12:00
Eloy Lafuente (stronk7) 00f706d1f5 Merge branch 'MDL-29064_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-29 02:53:08 +02:00
Sam Hemelryk d3e5802d97 Merge branch 'MDL-29135-mnet-login_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-08-29 12:25:16 +12:00
David Mudrak 6b27edcc47 MDL-29148 MNet - improved handling of a verification function return code 2011-08-29 01:48:16 +02:00
Eloy Lafuente (stronk7) 28883e9b45 Merge branch 'MDL-25872-20' of git://github.com/bostelm/moodle into MOODLE_20_STABLE 2011-08-29 01:22:58 +02:00
Iñaki Arenaza e79edb11ee MDL-28402 LDAP configuration values being stored in lower case, causing misconfiguration
It looks like array_change_key_case() does not work recursively, so we
were not actually lowercasing the expiration attribute key. As the
configuration setting is always lowercase they didn't match.
2011-08-29 01:09:18 +02:00
Eloy Lafuente (stronk7) d5d16e1f9c MDL-26819 quiz statistics - use cross-db GROUP BY expression 2011-08-28 22:23:32 +02:00
David Mudrak a1e52c70e5 MDL-27107 auth_mnet - consider all incoming roaming users as confirmed
The 'confirmed' field can't be optional. If the identity provider did
not export it, the new remote user would be created with 'confirmed' set
to default zero and as such could be a subject of scheduled deletion.
2011-08-28 02:28:12 +02:00
David Mudrak b9720b8869 MDL-29135 Reworded login prompt with SSO over MNet enabled 2011-08-27 18:25:09 +02:00
AMOS bot 3f4a67b330 Automatically generated installer lang files 2011-08-27 00:55:45 +00:00
Henning Bostelmann 62da28c64d MDL-25872 View assignment submissions: show only students, not teachers
Fixing incorrect capability reference mod/assignment:view to ...:submit
2011-08-26 17:34:42 +01:00
Tim Hunt 1179c92d0b MDL-29141 question bank show question text checkbox does not match state. 2011-08-26 17:31:23 +01:00
M Kassaei 3388d2f9f9 MDL-27631 question bank Show question text in the question list when top level category is used 2011-08-26 17:30:20 +01:00
Eloy Lafuente (stronk7) 58609afebb weekly release 2.0.4+ 2011-08-26 15:07:04 +02:00
Eloy Lafuente (stronk7) 6a10905864 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-08-26 14:57:03 +02:00
Andrew Davis (andyjdavis) 87a4bba39c MDL-22232 messaging: miscelaneous fixes after integration review 2011-08-26 15:59:31 +08:00
Sam Hemelryk 179b60aea6 MDL-26811 upgrade Fixed up default handling causing exception on upgrade of used site in MSSQL 2011-08-26 14:58:55 +12:00
Eloy Lafuente (stronk7) d52f9563d1 Merge branch 'MDL-27823_bulk_messaging_2_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-08-25 10:47:31 +02:00
Eloy Lafuente (stronk7) de8c58715a Merge branch 'MDL-28650-MOODLE_20_STABLE' of https://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-08-25 01:16:38 +02:00
Jerome Mouneyrac 2771063982 MDL-29005 display enrollable courses total and downloadable courses total instead of courses/sites total 2011-08-24 14:53:51 +08:00
Aparup Banerjee acb05b5d4d Revert "MDL-28509 repository_youtube Enable selection of sort order"
This reverts commit 919304d4bf.
2011-08-24 14:43:36 +08:00
Eloy Lafuente (stronk7) d45e517538 Merge branch 'w33_MDL-29022_m20_idnumber' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-24 03:52:26 +02:00
Aaron Barnes df40fa5f66 MDL-28248 completion: Incorrect SQL for finding enrol start date 2011-08-24 12:06:12 +12:00
Sun Zhigang 02e5cdbeb8 MDL-29019 enrol - fix a typo 2011-08-24 01:31:47 +02:00
Petr Skoda 029e7f5eae MDL-29000 multiple password reset issues
* stop abusing get_complete_user_data()
* fix case-sensitiveness in password reset for PG
* do not allow reset of disabled accounts
* propose a solution for non-unique emails
2011-08-24 01:09:23 +02:00
Petr Skoda 9a529b0753 MDL-28981 fix forum_user_can_post() call params 2011-08-24 00:53:45 +02:00
Tony Levi 3c0b7e9468 MDL-27228: Fix label 'eye' does not match show/hide setting 2011-08-23 23:36:43 +02:00
Aparup Banerjee ce7519c27e Merge branch 'MDL-28723-plugin-tables_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-08-24 01:30:09 +08:00
Eloy Lafuente (stronk7) 0a2be338a8 MDL-28962 enrol imsenterprise - whitespace fix 2011-08-23 18:44:10 +02:00
Eloy Lafuente (stronk7) d3ff99e745 Merge branch 'm20_MDL-28962' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-23 18:43:56 +02:00
Eloy Lafuente (stronk7) 91d77b17bd Merge branch 'MDL-28397-20' of https://github.com/totara/moodle into MOODLE_20_STABLE 2011-08-23 17:31:45 +02:00
Sam Hemelryk 142af01f32 MDL-25636 block_html Fixed up missing format config if block restored from early 2.0 backup 2011-08-23 18:43:54 +08:00
Petr Skoda 6551049f07 MDL-28935 use weekdays as calendar table headings 2011-08-23 10:05:28 +02:00
Jason Ilicic ed246c21db MDL-28935 Add days of week to monthly calendar view 2011-08-23 10:05:22 +02:00
Tim Hunt e5073fe305 MDL-29064 qtype multianswer, question text should be a required field. 2011-08-23 08:41:18 +01:00
Aparup Banerjee 9ef338d744 Merge branch 'MDL-28509_20_STABLE' of git://github.com/marxjohnson/moodle into MOODLE_20_STABLE 2011-08-23 14:58:00 +08:00
Eloy Lafuente (stronk7) 68e22328b5 Merge branch 'm20_MDL-28999' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-23 02:50:21 +02:00
Petr Skoda 9986fe8d0d MDL-29016 allow distributions to set dataroot permissions 2011-08-23 02:43:17 +02:00
Eloy Lafuente (stronk7) 13c04d1701 Merge branch 'w33_MDL-29031_m20_oldblock' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-23 02:05:33 +02:00
Eloy Lafuente (stronk7) bf3e4e030f Merge branch 'MDL-28226_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-23 01:42:48 +02:00
Adam Olley f22a7de23f MDL-28481: Send headers before any possible output 2011-08-23 01:37:32 +02:00
Eloy Lafuente (stronk7) f9356f85ce Merge branch 'w33_MDL-28936_m20_msgstrlen' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-23 01:20:37 +02:00
Tom Cubanski 3c94cc716e MDL-26302 quiz editing: top move button on the order and paging tab does not work.
It is strange that processes the submission already handles the submitted data from this change to the HTML.
2011-08-22 23:58:12 +01:00
Aparup Banerjee 5a80cab06d Merge branch 'wip-mdl-28580-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-23 01:54:22 +08:00
Andrew Davis (andyjdavis) b1f400ae6f MDL-27823 messaging: preventing html tags from being output to the UI 2011-08-22 15:33:30 +08:00
Aaron Barnes 551fa5f4dd MDL-28397 completion: Activity completion criteria not showing grading
requirement

Credit goes to Evan Irving-Pease for the patch
2011-08-22 14:56:35 +12:00
Andrew Davis (andyjdavis) bec1c29d84 MDL-22232 messaging: reimplementing support for "emailstop" in 2.0 stable 2011-08-22 09:51:17 +08:00
Petr Skoda 89f5428879 MDL-29031 remove blocks cleanup todo 2011-08-21 17:46:54 +02:00
Petr Skoda 84c656a557 MDL-27248 remove forgotten unique sortorder index from the course table 2011-08-21 17:34:26 +02:00
Petr Skoda 367f1a7300 MDL-29022 do not require idnumber in ext courses - backport from MDL-29020 2011-08-20 11:36:21 +02:00
Petr Skoda 725ef19f1f MDL-28936 fix invalid >200 comparison and utf-8 incompatibility
Credit for discovery goes to Jason Ilicic.
2011-08-19 18:46:38 +02:00
Rajesh Taneja 12acab953b MDL-28580 Administration: Added sanity check to grab wrong usage of upgrade_main_savepoint 2011-08-19 07:48:24 +00:00
Dan Marsden 1425c0b449 MDL-28999 SCORM add missing yui2 require 2011-08-19 10:22:41 +12:00
Tim Hunt 4f24a95cdd MDL-28226 wrong final quiz grade when regrading with first/last attempt graded.
This is an intermitted problem that depends on the order the DB returns
rows in the absence of an order-by. At any rate, adding an explicit
order-by fixes it.

Also inprove a PHP doc comment and some code to make the API clearer.
2011-08-18 13:47:46 +01:00
Jerome Mouneyrac f4a57f80ef MDL-28650 add a page in the administration to the full web service API (API documentation). 2011-08-18 13:31:50 +08:00
Dan Marsden feb6542872 MDL-28962 enrol imsenterprise - incorrect conversion of new dml syntax - thanks to Patrick Gagnon for report and fix. 2011-08-18 13:40:42 +12:00
AMOS bot 1c59b0ad97 Automatically generated installer lang files 2011-08-18 00:55:29 +00:00
Eloy Lafuente (stronk7) 9e47a85a24 weekly release 2.0.4+ 2011-08-18 02:43:23 +02:00
Eloy Lafuente (stronk7) a25ae4ff1b Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-08-18 02:38:59 +02:00
Eloy Lafuente (stronk7) 14f9c0cbcd Merge branch 'm20_MDL-28971' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-18 01:43:05 +02:00
Dan Marsden c9a0802794 MDL-28971 - SCORM_TOC_DISABLED is not available in 2.0 - only available in 2.1 and higher 2011-08-17 20:45:19 +12:00
Dongsheng Cai 078bd6815c MDL-27289, upgrade box.net repository plugin to use new box.net authentication process 2011-08-17 11:44:49 +08:00
Eloy Lafuente (stronk7) c7cce21d67 Merge branch 'wip-mdl-27219-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-17 03:00:59 +02:00
Eloy Lafuente (stronk7) be3aba207e Merge branch 'MDL-28737_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-17 02:52:25 +02:00
Eloy Lafuente (stronk7) c2a64d94ff Revert "MDL-25757 SCORM fix issue with duplicate cmi values being saved"
This reverts commit 230a4ab6a2.
2011-08-17 02:29:28 +02:00
Eloy Lafuente (stronk7) 780cdcea5f Merge branch 'MDL-27752_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-08-17 01:02:39 +02:00
sam marshall 4cc5500d0e MDL-28643 Fix debugging message when deleting activity with grade completion 2011-08-17 00:46:06 +02:00
Eloy Lafuente (stronk7) c2fe54c236 Merge branch 'm20_MDL-28649' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-17 00:35:07 +02:00
Tim Hunt 104524f504 MDL-28654 fix path for TinyMCE in lib/thirdpartylibs.xml. 2011-08-17 00:10:51 +02:00
Eloy Lafuente (stronk7) 664a07f74e Merge branch 'm20_MDL-28721' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-16 23:44:32 +02:00
David Mudrak a0e1c31535 MDL-28723 Make sure that the arrays used by print_plugin_tables() are correctly initialized
This covers a very rare and unexpected case when no mods or no blocks
are installed. Credit goes to Aparup Banerjee for spotting this.
2011-08-16 13:59:56 +02:00
Eloy Lafuente (stronk7) bf479611db Merge branch 'wip-MDL-26754-MOODLE_20_STABLE' of github.com:marinaglancy/moodle into MOODLE_20_STABLE 2011-08-16 13:17:12 +02:00
Eloy Lafuente (stronk7) 1f52e72526 Merge branch 'MDL-23872_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-08-16 11:52:12 +02:00
Rajesh Taneja 03af3e075d MDL-27219 chat: Beep will not display user fullname if user is not in chat 2011-08-16 16:36:34 +08:00
Eloy Lafuente (stronk7) 9a287f8a49 Merge branch 'MDL-28931_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-08-16 03:06:31 +02:00
Eloy Lafuente (stronk7) 76a07a1da5 Merge branch 'wip-mdl-27728-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-16 02:15:18 +02:00
Eloy Lafuente (stronk7) 46894c5058 Merge branch 'MDL-27030_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-16 02:08:04 +02:00
Eloy Lafuente (stronk7) 52dd1d84a3 MDL-27896 filters/editor - fix whitespace 2011-08-16 02:02:12 +02:00
Eloy Lafuente (stronk7) 75e815fe72 Merge branch 'wip-mdl-27896-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-16 02:01:48 +02:00
Eloy Lafuente (stronk7) 8634bb229e Merge branch 'm20_MDL-25757' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-16 00:39:41 +02:00
Petr Skoda 7431abde3c Merge branch 'MDL-28465_rating_aggregation_split' into MOODLE_20_STABLE 2011-08-15 20:26:19 +02:00
Eloy Lafuente (stronk7) eac56e02bc Merge branch 'm20_MDL-28603' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-15 20:02:56 +02:00
Dan Poltawski 5a52740940 MDL-28605 repsitory/local - Prevent server running out of memory
Removing useless code..
2011-08-15 19:58:34 +02:00
Eloy Lafuente (stronk7) 6e4ece5640 Merge branch 'MDL-28939_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-15 19:35:22 +02:00
Tim Hunt e84cef850a MDL-28939 Bad lang string reference in grade/import/csv. 2011-08-15 15:12:29 +01:00
Tim Hunt cf93bcd37d MDL-28639 question import should set timemodified and modified by.
Thanks to Jean-Michel Vedrine for the fix.
2011-08-15 14:57:57 +01:00
Eloy Lafuente (stronk7) b5e0ee6f4a MDL-28931 timezone - update to 2011h (2200 rules) 2011-08-14 18:06:34 +02:00
Dan Marsden 230a4ab6a2 MDL-25757 SCORM fix issue with duplicate cmi values being saved 2011-08-13 13:25:05 +12:00
Tim Hunt 41977bb4cc MDL-28737 advcheckboxes toggle state every submit if checkbox_controller present. 2011-08-12 19:15:18 +01:00
Rajesh Taneja 1d34dc5aa3 MDL-27896 course - Rectified wrong use of itemid for preparing draft file area 2011-08-12 16:52:25 +08:00
Rajesh Taneja 2c01ba7bb7 MDL-27896 editor - parent context will be respected by editor in case context is not created. 2011-08-12 16:52:12 +08:00
Rajesh Taneja 5b5bef12f0 MDL-27896 editor - added sanity check to pick wrong context passed to editor creation 2011-08-12 16:51:59 +08:00
Rajesh Taneja 88a7dcab1e MDL-27896 context - Fixed editor context to observe filter status 2011-08-12 16:51:21 +08:00
Dan Marsden aa1e13ed2e MDL-28603 SCORM fix regression with ADL scorm 1.2 tests 2011-08-12 17:25:59 +12:00
Rajesh Taneja 6a008b485e MDL-27728 Moodleforms: Added validation for element before checking element values 2011-08-12 10:56:14 +08:00
AMOS bot 659b8d8dc6 Automatically generated installer lang files 2011-08-12 00:55:35 +00:00
Dan Marsden 0dd1a7cb66 MDL-28649 SCORM start new attempt if set when skipview used. 2011-08-12 12:55:14 +12:00
Dan Marsden 07d9ba8e9b MDL-28721 SCORM - disable hidenav setting if hidetoc not set to display toc to the left 2011-08-12 11:07:49 +12:00
Eloy Lafuente (stronk7) 9d228de05a weekly release 2.0.4+ 2011-08-12 00:20:15 +02:00
Eloy Lafuente (stronk7) c8028c9371 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-08-12 00:13:30 +02:00
Marina Glancy a2cfc3e460 MDL-26754: Removed unnecessary include 2011-08-11 13:41:30 +08:00
sam marshall 8b805ced71 MDL-27491 Add 'complete on view' support to wiki, survey 2011-08-10 23:07:16 +02:00
Eloy Lafuente (stronk7) 55ffbabe6d Merge branch 'm20_MDL-28295' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-10 22:59:47 +02:00
Daren Chandisingh e39ee61705 MDL-23872 Forms Library : Updated MoodleQuickForm to honour setConstant(), prevents injection. 2011-08-10 15:23:48 +08:00
Sam Hemelryk 3e7ff59eb4 Merge branch 'MDL-20501_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-08-10 14:10:41 +08:00
Dan Marsden cca2289111 MDL-28295 SCORM change mangement of pop-up windows, load full SCORM API in existing window - this fixes an issue with IE 7 and httpreq communication 2011-08-10 14:35:00 +12:00
Eloy Lafuente (stronk7) e8a165d2a3 Merge branch 'MDL-27550-workshop-feedback_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-08-10 02:49:28 +02:00
Eloy Lafuente (stronk7) fcda253026 Merge branch 'w31_MDL-27597_m20_catlike' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-10 02:37:32 +02:00
Dan Poltawski 3728b69f31 MDL-23967 admin/cron.php - warn about use on CLI
Admins now need to use the explicit CLI script
2011-08-10 02:06:31 +02:00
Dan Poltawski c8e7fdd9af MDL-28059 weblib - don't strip mailto: anchors 2011-08-10 01:59:35 +02:00
Eloy Lafuente (stronk7) 2bdfe77686 Merge branch 'wip-MDL-28407-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-08-10 01:12:11 +02:00
Eloy Lafuente (stronk7) 1b8b39cbde Merge branch 'MDL-28565_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-08-09 10:16:14 +02:00
Eloy Lafuente (stronk7) c874785067 Merge branch 'MDL-28604_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-09 09:43:23 +02:00
AMOS bot cbf4d62ccd Automatically generated installer lang files 2011-08-09 00:55:27 +00:00
Tony Levi 6ad6368adc MDL-27030: Fix quiz overview report showing incorrect grades on regraded attempts 2011-08-08 23:47:42 +01:00
Aparup Banerjee 58cbfde495 MDL-28565 General - updated lang files License link to docs.moodle.org/dev/License 2011-08-08 17:10:32 +08:00
Aparup Banerjee a743d4a77c MDL-28565 General - updated License and Credits links
to docs.moodle.org/dev/License and docs.moodle.org/dev/Credits
2011-08-08 17:02:31 +08:00
Sagie Maoz f3a2907f15 MDL-26721 automated backups - Fix typo
Causing the 'role assignment' backup inclusion to be tied to the users

Signed-off-by: Dan Poltawski <dan.poltawski@luns.net.uk>
2011-08-08 15:38:36 +08:00
Dan Poltawski a873af4dfe MDL-28569 blocks/rss_client - RSS feed autodiscovery fails with ampersands
Simpliepie is quoting urls and we need the url to be unescaped
2011-08-08 14:10:44 +08:00
Sam Hemelryk 47a6e69179 Merged branch 'MDL-28575_MOODLE_20_STABLE' of git://github.com/kordan/moodle.git with conflict resolution 2011-08-08 14:00:08 +08:00
Sam Hemelryk 4ecd7134e5 Merge branch 'MDL-28587_MOODLE_20_STABLE' of git://github.com/kordan/moodle into MOODLE_20_STABLE 2011-08-08 13:45:05 +08:00
Rossiani Wijaya 269255473f MDL-27752_m20 Calendar export: fixed typo in url parameter 2011-08-08 12:06:46 +08:00
Sam Hemelryk 3bbbd26ee6 Merge branch 'MDL-28406_block_duplicate_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-08-08 11:19:18 +08:00
Sam Hemelryk 81c77993e3 Merge branch 'w31_MDL-27586_m20_browser' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-08 10:47:21 +08:00
Sam Hemelryk 6aec498812 Merge branch 'w31_MDL-27685_m20_pglike' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-08 10:25:55 +08:00
Sam Hemelryk 11909e87a0 Merge branch 'w31_MDL-28382_m20_iis' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-08 10:21:05 +08:00
Sam Hemelryk 48db633522 Merge branch 'w31_MDL-28450_m20_defgroup' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-08-08 10:09:56 +08:00
Petr Skoda 1a6bfd3c1e MDL-28382 work around or detect REQUEST_URI IIS bug 2011-08-07 14:48:44 +02:00
Petr Skoda e4ff5b5d74 MDL-27685 fix pg LIKE escape trouble 2011-08-07 13:23:36 +02:00
Petr Skoda 4e86cbabb0 MDL-28450 prefer member group for default 2011-08-07 13:09:00 +02:00
Petr Skoda 5bdd8b8e7a MDL-27586 fix file_browser access control 2011-08-06 16:41:18 +02:00
Petr Skoda fd526f38ce MDL-28473 fix $instanceids troubles in blocks upgrade
Credit goes to Mateusz Wójcik.
2011-08-05 22:10:44 +02:00
Petr Skoda 56eff94252 MDL-27597 fix invalid results of get_categories when shallow is false 2011-08-05 20:16:22 +02:00
Andrew Davis (andyjdavis) b6cbbb862c MDL-28465 rating: altered one of the get_ratings() queries to avoid possible future duplicate first column problems 2011-08-05 13:48:38 +08:00
Andrew Davis (andyjdavis) 0683e9c5be MDL-28406 blocks: added JS to prevent the addition of duplicate blocks 2011-08-05 11:36:58 +08:00
Sam Hemelryk 3b7127a9b7 MDL-28407 Fixed up calendar preferences form handling 2011-08-05 09:35:09 +08:00
Tim Hunt 6740639cef MDL-28604 Question bank display forgets sort order 2011-08-04 14:04:23 +01:00
Marina Glancy dcaa0b4e21 MDL-26754 Display blocks in 'manage blocks' alphabetically sorted 2011-08-04 14:14:39 +08:00
AMOS bot 190cae0e09 Automatically generated installer lang files 2011-08-04 00:55:44 +00:00
Petr Skoda 4b85dc13ac weekly release 2.0.4+ 2011-08-03 18:01:36 +02:00
kordan 761a9abd02 MDL-28587 fix for MOODLE_20_STABLE 2011-08-03 15:22:54 +02:00
Sam Hemelryk 763fc56f9a Revert "MDL-28284 don't load filepicker module for every page"
This reverts commit e336ad1b80.
2011-08-03 18:20:45 +08:00
kordan 43424771b6 MDL-28575 fix for MOODLE_20_STABLE 2011-08-02 23:44:13 +02:00
David Mudrak 4ac89c85d4 MDL-27550 workshop: fixed XHTML strictness of H3 and A combo
H3 is block level element while A is in-line element in XHTML.
Credit goes to Sam Hemelryk for spotting this during the peer-review.
2011-08-02 23:28:52 +02:00
David Mudrak d98c8aedb2 MDL-27550 workshop: rendering links to the submission and the assessment page
This usability improvement helps to provide feedback quickly during the
grading evaluation phase.
2011-08-02 23:14:45 +02:00
David Mudrak a6a58c3485 MDL-27550 workshop: students do not see peer-assessment that are not graded yet 2011-08-02 23:14:45 +02:00
David Mudrak 6e6b96d57b MDL-27550 workshop: display the feedback for the submission reviewer when the workshop is closed 2011-08-02 23:14:45 +02:00
David Mudrak c9f31ba3a3 MDL-27550 workshop: assessments are now displayed via proper rendering subsystem
AMOS BEGIN
 MOV [assessmentbyknown,mod_workshop],[assessmentbyfullname,mod_workshop]
AMOS END
2011-08-02 23:14:45 +02:00
David Mudrak 3675dbc32b MDL-27550 workshop: display the feedback for the submission author when the workshop is closed
The method user_picture::fields() was not available when these SQL
statements were originally written. Now instead of hard-coding the list
of returned fields, the user_picture is asked for the list.

Together with this change, methods workshop::get_submission_by_id()
and workshop::get_submission_by_author() now return the information
about the user who provided the feedback and overwrote the grade.
2011-08-02 23:14:44 +02:00
Petr Skoda b8a5c64e95 Merge branch 'wip-mdl-27658-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-02 15:14:00 +02:00
Dan Marsden 984c6bd358 MDL-28410 Choice - allow single answer choice to be created 2011-08-02 15:06:15 +02:00
Dan Marsden 1389810600 MDL-28535 SCORM remove old IE 6 related warning about zlib 2011-08-02 14:42:24 +02:00
Sam Hemelryk 0f68bcbc52 Merge branch 'MDL-28508_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-08-02 17:47:13 +08:00
Andrew Robert Nicols 033be70faa MDL-28515 Add cli install options for fullname and shortname 2011-08-02 17:08:04 +08:00
Sam Hemelryk c440ddfb58 Merge branch 'MDL-28340_advanced_search_other_users_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-08-02 16:59:08 +08:00
Sam Hemelryk 6a60e3f282 Merge branch 'wip-mdl-28504-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-08-02 16:52:22 +08:00
Sam Hemelryk f15c1b78ab Merge branch 'wip-MDL-19907-M00DLE_20_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_20_STABLE 2011-08-02 16:44:33 +08:00
Sam Hemelryk 0b1bc0a771 MDL-27122 admin Improved block protection help string 2011-08-02 16:37:04 +08:00
Sam Hemelryk 43b2bb6cd9 Merge branch 'wip-MDL-27122-MOODLE_20_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_20_STABLE 2011-08-02 16:36:16 +08:00
Sam Hemelryk 7d5f92870e Merge branch 'wip-MDL-27754-MOODLE_20_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_20_STABLE 2011-08-02 14:09:57 +08:00
Sam Hemelryk e99d784ffe Merge branch 's11_MDL-28284_filepicker_module_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-08-02 13:41:36 +08:00
Sam Hemelryk 25f8084ba0 Merge branch 'MDL-28510_20_STABLE' of git://github.com/marxjohnson/moodle into MOODLE_20_STABLE 2011-08-02 13:38:00 +08:00
unknown 187c395673 Merge branch 'm20_MDL-27876' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-08-02 13:27:00 +08:00
Piers Harding 902b6d7df4 MDL-27876 SCORM auto-adjust the stage height 2011-08-02 17:14:06 +12:00
Sam Hemelryk d5addee28f Merge branch 'MDL-28487-typo_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-08-02 12:22:57 +08:00
Sam Hemelryk a8562f6c01 Merged branch 'm20_MDL-28548' of git://github.com/danmarsden/moodle.git with comment changes 2011-08-02 11:49:21 +08:00
Marina Glancy e29521960d MDL-27754 fixed typo in language string 2011-08-02 08:51:24 +08:00
Marina Glancy 914cbfa714 MDL-27122 Allow admin to change CFG->undeletableblocktypes on 'Manage blocks' settings page. Instances of protected block types will be undeletable only from site context 2011-08-02 08:51:17 +08:00
Marina Glancy 54641661e1 MDL-19907 rewrote validation for required fields in forms, including support for editor field. Added parameter to use strict (no spaces) required fields validation 2011-08-02 08:50:51 +08:00
Rossiani Wijaya b7342c4c7b MDL-20501 survey module: fix text alignment for right to left language. Change undefined string to 2011-08-01 17:30:12 +08:00
Sam Hemelryk e8e1ad9100 Moodle 2.0.4 release 2011-08-01 16:55:04 +08:00
Andrew Davis (andyjdavis) 8c598be92d MDL-28465 rating: split the get_ratings() query into two 2011-08-01 15:35:40 +08:00
Rajesh Taneja dcb368720a MDL-27658 javascript: Typo fixed for toUpperCase 2011-08-01 12:55:01 +08:00
Rajesh Taneja 9d9e5bc707 MDL-28504 filter: Typo in css fixed 2011-08-01 10:24:15 +08:00
Dan Marsden e8ce08c331 MDL-28548 allow backup to contain info from multiple plagiarism plugins. 2011-08-01 10:29:23 +12:00
Sam Hemelryk f84058a263 weekly release 2.0.3+ (emergency) 2011-07-29 12:22:29 +08:00
Andrew Davis (andyjdavis) 3b81d3b0e2 MDL-28340 messaging: fixed a display issue when you search for and tried to view a conversation between two other users 2011-07-29 11:56:28 +08:00
Sam Hemelryk 03e29fff56 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-07-29 10:13:30 +08:00
Sam Hemelryk 3765c3f098 MDL-28503 comment-caps Slight improvement to allow frontpage and guest users to view comments by default 2011-07-29 09:44:18 +08:00
Mark Johnson b3ebbd4fc8 MDL-28510 repository_youtube Use smaller thumbnails in search results 2011-07-28 13:44:53 +01:00
Mark Johnson 919304d4bf MDL-28509 repository_youtube Enable selection of sort order 2011-07-28 13:12:02 +01:00
Tim Hunt 01ae3d20da MDL-28508 bad string trunction in Aiken format. 2011-07-28 12:19:34 +01:00
Sam Hemelryk 15125314eb MDL-28503 Removed the ability for plugins to override comment capabilities and the defaults associated with it 2011-07-28 13:41:20 +08:00
AMOS bot 44e6b8ff57 Automatically generated installer lang files 2011-07-28 00:55:21 +00:00
David Mudrak 8684284e49 MDL-28487 Fixed typo in media filter help string 2011-07-27 14:42:05 +02:00
Petr Skoda c46c673568 weekly release 2.0.3+ 2011-07-26 11:08:28 +02:00
Petr Skoda aa79f99d53 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-07-26 11:07:40 +02:00
AMOS bot ef65eefff8 Automatically generated installer lang files 2011-07-26 00:55:29 +00:00
Tim Hunt df390ba9f0 MDL-28218 allow testclient.php to find the necessary form for services defined in plugins. 2011-07-25 20:05:31 +02:00
Petr Skoda 2a41529f68 Merge branch 'MDL-28437_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-25 19:55:46 +02:00
Petr Skoda e9adc8f6eb Merge branch 'MDL-28453_MOODLE_20_STABLE' into MOODLE_20_STABLE 2011-07-25 16:30:52 +02:00
Aparup Banerjee 22edb9944a MDL-28453 backup - made temporary restoration courses hidden by default. 2011-07-25 16:46:22 +08:00
Tim Hunt ceedbe876d MDL-28437 Question bank pages should all use General type: admin. 2011-07-25 08:59:25 +01:00
Sam Hemelryk 213eaa94f6 Merge branch 'MDL-28107_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-25 15:14:39 +08:00
Dan Poltawski 2acfb396ec MDL-28232 - Course log text export is missing a new line 2011-07-25 12:57:39 +08:00
Michael Aherne 936f6706c2 MDL-27538 Added deprecation details to functions now in $DB 2011-07-25 11:31:40 +08:00
Sam Hemelryk 2e3a96e192 Merge branch 'w29_MDL-22584_m20_monsterpaths' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 11:18:45 +08:00
Sam Hemelryk 417fdfab6b Merge branch 'w29_MDL-27464_m20_continue' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 11:04:02 +08:00
Sam Hemelryk 77c9ae457d Merge branch 'w29_MDL-27653_m20_usercasting' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:59:30 +08:00
Sam Hemelryk a8fd6146e7 Merge branch 'w29_MDL-27796_m20_httphost' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:55:12 +08:00
Sam Hemelryk 538e680d39 Merge branch 'w29_MDL-27994_m20_creatorcaps' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:45:51 +08:00
Sam Hemelryk ec5f521a59 Merge branch 'w29_MDL-28145_m20_renderer' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:40:00 +08:00
Sam Hemelryk 100308ce24 Merge branch 'w29_MDL-28182_m20_userdel' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:37:05 +08:00
Sam Hemelryk f6fc3616de Merge branch 'w29_MDL-28384_m20_nullurl' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 10:15:05 +08:00
Sam Hemelryk 9a8343cdde Merge branch 'w29_MDL-28432_m20_cohortconfig' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 09:53:02 +08:00
Sam Hemelryk a4e3607a21 Merge branch 'w29_MDL-28440_m20_jssemicol' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-25 09:45:53 +08:00
Mary Evans 27a2c6bffd fix for MDL-27768 removed reference to gradient-sb image 2011-07-25 09:40:17 +08:00
Petr Skoda b6481ac993 MDL-27653 fix incorrect int | object detection 2011-07-24 15:06:07 +02:00
Petr Skoda 2abbe6e2a3 MDL-27994 course creator role is for creating courses only!
The course creator role is designed to be used to create courses, nothing else - that is create new course, create new course from backup + view hidden courses and categories.
2011-07-24 14:25:50 +02:00
Petr Skoda 3687ab70bc MDL-28384 convert empty log urls to ''
The problem is that the log table does not allow nulls, credit goes to Troy Williams.
2011-07-24 14:09:11 +02:00
Petr Skoda 201159335f MDL-27464 continuation link sometimes links off-site
This code was manually merged from MOODLE_19_STABLE, credit goes to Matt Meisberger.
2011-07-23 13:31:20 +02:00
Petr Skoda c3ceb8d218 MDL-28440 add missing semicolon causing JS issues
Credit goes to Mark Nielsen.
2011-07-23 11:50:22 +02:00
Petr Skoda 9df28ce5a3 MDL-22584 deal with oversized dir and file names during upgrade 2011-07-23 11:41:28 +02:00
Petr Skoda 784c24fde1 MDL-28145 fix renderer typo in comments 2011-07-22 23:44:49 +02:00
Petr Skoda cf264063c1 MDL-27796 ignore missing HTTP_HOST header 2011-07-22 23:34:34 +02:00
Petr Skoda 3f51ad2a70 MDL-28182 always use full user object when deleting users 2011-07-22 22:50:17 +02:00
Petr Skoda 6b0b96c581 MDL-28432 use enrol/cohort and enrol/manual capabilities correctly in cohort enrol UI and fix input validation in ajax 2011-07-22 10:11:08 +02:00
Rossiani Wijaya 8190a2911f MDL-28107 course enrolment icon: Fixed logged in user enrolment icons 2011-07-22 13:17:49 +08:00
Dongsheng Cai e336ad1b80 MDL-28284 don't load filepicker module for every page 2011-07-21 17:28:24 +08:00
Petr Skoda ac30618786 weekly release 2.0.3+ 2011-07-19 15:22:21 +02:00
Petr Skoda e9889abe38 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-07-19 15:18:09 +02:00
Petr Skoda c0e1e425be MDL-27696 initialise arrays
Credit goes to David Mudrak.
2011-07-19 15:05:22 +02:00
Petr Skoda 517d606401 MDL-27696 do not use placeholders in GROUP BY because pg does no like that 2011-07-19 10:55:02 +02:00
Petr Skoda f3cbcc623d MDL-27889 use new recaptcha google urls in lang packs 2011-07-19 10:24:57 +02:00
Petr Skoda be36e2ad1d MDL-27889 use new recaptcha google urls in lang packs 2011-07-19 10:18:31 +02:00
AMOS bot aff1c65c3d Automatically generated installer lang files 2011-07-19 00:55:41 +00:00
Petr Skoda d96d964425 Merge branch 'wip-MDL-28040-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:34:42 +02:00
Petr Skoda 4f76e7ddf7 Merge branch 'wip-MDL-28184-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:29:19 +02:00
Petr Skoda 393d636e25 Merge branch 'wip-MDL-28205-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:25:56 +02:00
Petr Skoda 2b98c3d5e0 Merge branch 'wip-MDL-28137-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:23:21 +02:00
Petr Skoda 2bd3fc4d03 Merge branch 'wip-MDL-27771-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:20:26 +02:00
Petr Skoda 6b43f50c41 Merge branch 'wip-MDL-27696-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:18:24 +02:00
Petr Skoda 533a766447 Merge branch 'wip-MDL-27305-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 15:15:18 +02:00
Petr Skoda 59f3144e0a Merge branch 'wip-MDL-25870-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-07-18 14:58:38 +02:00
Sam Hemelryk ef5a198d1c Merge branch 'wip-MDL-27756-MOODLE_20_STABLE' of github.com:marinaglancy/moodle into MOODLE_20_STABLE 2011-07-18 22:20:13 +10:00
Sam Hemelryk 60e7f2b113 Merge branch 'MDL-27555_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-18 21:51:39 +10:00
Sam Hemelryk 68bc5b7b68 Merge branch 'w28_MDL-27804_m20_csvauth' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-18 20:19:51 +10:00
Sam Hemelryk 45222fc50f Merge branch 'w28_MDL-28253_m20_managerupgrade' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-18 20:10:30 +10:00
Sam Hemelryk 78092d6742 Merge branch 'w28_MDL-28313_m20_enroldb' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-18 20:04:32 +10:00
Sam Hemelryk a3fe5348ab Merge branch 'w28_MDL-28348_m20_meta' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-18 19:39:56 +10:00
Sam Hemelryk e3f6f30896 Merge branch 'w28_MDL-28350_m20_wsra' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-18 19:29:01 +10:00
Petr Skoda 50296e134b Merge branch 'wip-MDL-25125-MOODLE_20_STABLE' of github.com:marinaglancy/moodle into MOODLE_20_STABLE 2011-07-18 09:36:20 +02:00
Sam Hemelryk a6c44179e5 Merge branch 'w28_MDL-28363_m20_dimmed' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-07-19 00:48:11 +10:00
Sam Hemelryk ab93b02919 Merge branch 'MDL-28298-workshop-constant_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-07-19 00:40:22 +10:00
Sam Hemelryk 07ea543a1c Merge branch 'MDL-28325-enrol-help_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-07-19 00:35:16 +10:00
Petr Skoda 768dd79e1f MDL-28348 fix spelling and some whitespace issues 2011-07-17 20:42:44 +02:00
Petr Skoda c7f51d2dfe MDL-28348 fix fatal error caused by unenrolling of incorrect enrol instance 2011-07-17 20:42:43 +02:00
Petr Skoda ebbc9e717f MDL-28348 prevent circular references in meta handler for enrolments 2011-07-17 20:42:43 +02:00
Petr Skoda 617027cf84 MDL-28348 fix meta sync when unassigning roles 2011-07-17 20:42:42 +02:00
Petr Skoda 21dc44b4df MDL-28363 make dimmed selectors more specific to prevent overriding from other themes 2011-07-16 21:05:48 +02:00
AMOS bot 922817560c Automatically generated installer lang files 2011-07-16 00:55:24 +00:00
Petr Skoda 4b9cb37191 MDL-28350 prevent bogus role assignment via externallib 2011-07-15 12:30:20 +02:00
Petr Skoda a4673317a7 MDL-27804 allow changing of only auth in csv user uploads 2011-07-15 11:10:38 +02:00
Petr Skoda deba736fbc MDL-28313 fix incorrect enrol database settings upgrade 2011-07-14 22:36:05 +02:00
Petr Skoda badddcab36 MDL-28253 use unique name for new manager role 2011-07-14 13:36:27 +02:00
Marina Glancy be1f4ab759 MDL-27756 Improving move_course() performance 2011-07-14 11:04:37 +08:00
Marina Glancy 01bb865997 MDL-25125 fix YUI bug with overriding styles 2011-07-14 10:02:43 +08:00
AMOS bot 79f544a45f Automatically generated installer lang files 2011-07-14 00:55:24 +00:00
Dan Marsden eadbd73918 MDL-28300 SCORM Fix check for SCORM 2004 thanks to Silvia Bastos for report/patch 2011-07-14 11:02:32 +12:00
David Mudrak bf9f318ead MDL-28325 Enrolment: added help to the duration, start date and end date setting
The patch also fixes one typo in enrol_manual detected while working on
this.
2011-07-13 22:36:00 +02:00
AMOS bot c015236f00 Removing oc_ES that was generated by an accident instead of proper oc_es 2011-07-13 15:36:08 +02:00
Sam Hemelryk 7a3156d001 weekly release 2.0.3+ 2011-07-13 20:24:18 +08:00
Sam Hemelryk b22eb6a987 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-07-13 20:09:42 +08:00
David Mudrak c7c83663e1 MDL-28298 workshop: do not use a constant without explicit inclusion of the library
Instead of including whole formslib just to get the constant defined, I
decided to hard-code the value and put the reference to the comment so
that eventual grep would spot it. Of course that is is not nice at all
but it's lesser of two evils imho.
2011-07-13 10:23:10 +02:00
Sam Hemelryk 49d85b7cfa MDL-28184 navigation: Tidied up handling of coursenode when adding course essentials 2011-07-13 14:59:59 +08:00
Sam Hemelryk bc5d53c15c MDL-27771 filter-text: Fixed typo contninue 2011-07-13 14:53:18 +08:00
Chris Follin 95f780c200 MDL-27305 forum: Added missing item to forum_get_view_actions 2011-07-13 14:23:18 +08:00
Sam Hemelryk 3656becc4a MDL-25870 enrol-manual: Fixed pagination of AJAX search results for users when changing search 2011-07-13 14:03:08 +08:00
Sam Hemelryk 89ba1d6c2b MDL-28137 unit tests: Fixed up problem with block manager tests when running unit tests after turning editing on 2011-07-13 13:45:23 +08:00
Sam Hemelryk cca30c4795 MDL-28205 RSS: Fixed up notice and set better pagelayout type on manage feeds page 2011-07-13 10:31:50 +08:00
Sam Hemelryk c78b71efb6 MDL-27696 datalib Fixed up misused params in get_logs_usercourse 2011-07-13 10:29:36 +08:00
Sam Hemelryk 35a5d3b2fc MDL-28040 navigation: Fixed up error with navigation when dealing with categories that have a lower sort order than the parent. 2011-07-13 10:01:08 +08:00
AMOS bot 40638405ea Automatically generated installer lang files 2011-07-13 00:55:34 +00:00
Eloy Lafuente (stronk7) a53760ef5a Merge branch 'm20_MDL-28017' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-07-12 16:31:40 +02:00
Eloy Lafuente (stronk7) 1193e6b023 MDL-28210 messaging: all includes but config.php must use $CFG-based abosolute paths 2011-07-12 12:23:51 +02:00
Eloy Lafuente (stronk7) 8c5b86e044 Merge branch 'MDL-28210_messaging_constants_20_2' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-07-12 12:23:19 +02:00
Sam Hemelryk 6bc177e912 MDL-27809 navigation: Fixed up a couple of minor issues after peer-review 2011-07-12 16:04:12 +08:00
Sam Hemelryk 1f7907dac3 MDL-27809 navigation: Reworked the caching within navigation and improved the ordering of events in order to reduce the use of session without serious impact on serverload 2011-07-12 16:04:03 +08:00
Andrew Davis (andyjdavis) 25c53e2b9f MDL-28210 messaging: Fixed requires problems in /message/discussion.php 2011-07-12 10:56:33 +08:00
AMOS bot 83fcca9346 Automatically generated installer lang files 2011-07-12 00:55:27 +00:00
Dan Marsden ab837e6113 MDL-28017 SCORM add unset_config for old config var 2011-07-12 09:51:32 +12:00
Eloy Lafuente (stronk7) 96651cf9ed Merge branch 'MDL-28251_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-11 20:29:01 +02:00
Eloy Lafuente (stronk7) 583c465a3a Merge branch 'm20_MDL-26942' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-07-11 19:48:54 +02:00
Eloy Lafuente (stronk7) 24f90eedb9 Merge branch 'MDL-27755_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-11 19:44:41 +02:00
Eloy Lafuente (stronk7) 0d81404f9a Merge branch 'MDL-27741_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-11 19:36:16 +02:00
Dan Poltawski 7ba9375e84 MDL-23580 course overview - remove debugging junk 2011-07-11 16:47:43 +02:00
Eloy Lafuente (stronk7) 15ffa46a1a Merge branch 'MDL-27483_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-11 16:27:04 +02:00
Eloy Lafuente (stronk7) 38bc3c281a Merge branch 'MDL-27931_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-07-11 15:58:33 +02:00
Rossiani Wijaya 9bb6e09468 MDL-27741 forum subscribe link: Removed 'no' string in social course format to display a subscribe link if user is not enrolled 2011-07-11 17:00:33 +08:00
Sam Hemelryk 77de688b82 Merge branch 'wip-mdl-27954-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-07-11 16:02:00 +08:00
Sam Hemelryk dd8e618917 Merge branch 'MDL-28227_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-11 14:54:48 +08:00
Dan Marsden ea819f2205 MDL-28017 SCORM - remove admin setting incorrectly added as it was never used. 2011-07-11 15:44:19 +12:00
Sam Hemelryk 05deeaacdb Merge branch 'm20_MDL-27947' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-07-11 11:32:04 +08:00
Sam Hemelryk 19dd687377 Merge branch 'mod_url_decode_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-07-11 11:04:35 +08:00
Sam Hemelryk f2c12522c3 Merge branch 'backup_groups_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-07-11 10:57:33 +08:00
Rajesh Taneja 79a80529f8 MDL-27954 mod_database - fixed search navigation link 2011-07-11 10:31:47 +08:00
AMOS bot 70a649e40c Automatically generated installer lang files 2011-07-11 00:55:22 +00:00
Eloy Lafuente (stronk7) 38a94e0d39 MDL-28156 restore - fix some notices restoring empty courses 2011-07-10 13:12:05 +02:00
Eloy Lafuente (stronk7) 327c88b76b MDL-28156 restore - support restoring files without grade items 2011-07-10 00:53:43 +02:00
Eloy Lafuente (stronk7) b229f563e5 MDL-27438 backup - on course backups add course gropus and groupings 2011-07-09 19:29:21 +02:00
Eloy Lafuente (stronk7) 7769615e76 MDL-27018 restore - decode links missing url->externalurl support 2011-07-09 13:36:14 +02:00
Dan Marsden 056d2682a1 MDL-27947 - fix TOC display on skipview - use correct org in TOC title 2011-07-09 11:50:15 +12:00
Dan Marsden a103d27e06 SCORM MDL-26942 - merge scorm_get_toc into a single global function 2011-07-09 11:15:13 +12:00
AMOS bot d9c90952bb Automatically generated installer lang files 2011-07-08 12:34:55 +02:00
Eloy Lafuente (stronk7) 89b2800f75 weekly release 2.0.3+ 2011-07-08 11:23:10 +02:00
Rossiani Wijaya e12559481f MDL-28251 DB activity module: fixed the argument type error for html_table_row from string to array 2011-07-08 16:54:38 +08:00
Eloy Lafuente (stronk7) 6761018805 Merge branch 'MDL-28015-workshop-sql_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-07-08 01:19:22 +02:00
Eloy Lafuente (stronk7) 9948122905 Merge branch 'MDL-28168-custommenu_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-07-08 00:58:24 +02:00
David Mudrak 308e53f572 MDL-28015 workshop - fixed unique list of columns in ORDER BY clause
MSSQL requires that the columns in the ORDER BY clause list must be
unique. The patch populates the list of fields by combining an array of
explicit sort definition with an array of implicit (default) sort
definition.
2011-07-07 15:02:34 +02:00
David Mudrak 3367e3ee1e MDL-28168 Revert "MDL-27073 Support multi-language content in custom menu"
This reverts commit 87e0230d0a.
2011-07-07 11:26:01 +02:00
Eloy Lafuente (stronk7) c1979ef02d Merge branch 'fix_import_search_course' of git://github.com/hit-moodle/moodle into MOODLE_20_STABLE 2011-07-07 10:38:44 +02:00
Tony Levi 25a5bd96f9 MDL-27483: Fix quiz repaginate enter in a endless loop 2011-07-07 16:19:56 +09:30
Rossiani Wijaya 536c7aa882 MDL-27755 course search: Add course id and shortname to search fields 2011-07-07 11:05:06 +08:00
Sun Zhigang 534eebdd35 MDL-27833 Backup - Fix can't search courses with non-latin characters during importing
PARAM_ALPHANUMEXT filter out all non-latin characters, including
Chinese, Japanese and etc. Use PARAM_NOTAGS instead.
2011-07-07 09:27:48 +08:00
Eloy Lafuente (stronk7) e317113746 Merge branch 'm20_MDL-28110' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-07-07 03:02:26 +02:00
Tony Levi ac473cb811 MDL-28227: Regrade sometimes grades user attempts for any quiz not selected quiz 2011-07-07 10:01:46 +09:30
Eloy Lafuente (stronk7) fea115dab3 Merge branch 'MDL-27989_MOODLE_20_STABLE' of git://github.com/kordan/moodle into MOODLE_20_STABLE 2011-07-07 02:23:33 +02:00
Dan Poltawski 46306d8a25 MDL-26285 block_rss_client - do not disable with enablerssfeeds
This setting was used in 1.9 and below to control feed generation only, not
for RSS consumption.
2011-07-07 02:12:09 +02:00
Petr Skoda 2c9b8852f0 MDL-27375 add missing lowercasing of external column names
Credit goes to Gail Preuninger.
2011-07-07 01:41:04 +02:00
Petr Skoda 413b73ffe3 MDL-28117 include repo lib when hacking file_picker renderer 2011-07-07 01:34:35 +02:00
Dan Poltawski 5bda351ef7 MDL-27329 course report - correct use of wrong fullname
We are refering to users in this column of the course report not
course full name.

Conflicts:

	course/lib.php
2011-07-07 00:26:26 +02:00
Dan Poltawski e5180a491c MDL-28100 - page resource was not using context for text filtering 2011-07-07 00:12:54 +02:00
Dan Poltawski 5d7b69cd80 MDL-27279 lang/en/xmldb - Fix Typo in confirmcheckforeignkeys 2011-07-07 00:02:04 +02:00
Eloy Lafuente (stronk7) 4bd293ee63 Merge branch 'MDL-27040_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-06 19:26:56 +02:00
Rossiani Wijaya 8252cd2848 MDL-27931 admin bulk user upload: convert city as required field. Credit goes to Charles Fulton for supplying the patch. 2011-07-06 16:17:01 +08:00
Dan Poltawski a35be2f5ef MDL-27855 navigation - only display participants link with permissions 2011-07-06 13:19:59 +08:00
Sam Hemelryk 668a9eb90b Merge branch 'MDL-27716_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-06 12:11:14 +08:00
Dan Poltawski 606e175133 MDL-27168 completionstatus block - Use localized strings 2011-07-06 12:03:59 +08:00
Dan Poltawski 2e214b26f3 MDL-26626 course competion block - fix hardcoded string 2011-07-06 11:30:33 +08:00
Dan Poltawski c24ad72ba0 MDL-26611 Roles Language - remove reference to 'legacy role type' 2011-07-06 11:10:47 +08:00
Sam Hemelryk ed26ad33ca Merge branch 'MDL-28135_MOODLE_20_STABLE' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-07-06 11:05:11 +08:00
Petr Skoda 9a380fbb53 MDL-28147 do not double cache theme css/js 2011-07-06 03:15:44 +02:00
Petr Skoda 6893e10840 MDL-28161 precreate htmlpurifier dir when resetting caches
Conflicts:

	lib/moodlelib.php
2011-07-06 02:59:16 +02:00
Eloy Lafuente (stronk7) c18a7f9d94 Merge branch 'MDL-28185_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-07-05 17:58:25 +02:00
Eloy Lafuente (stronk7) 07ca3c6816 Merge branch 'MDL-26618_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-05 17:48:30 +02:00
Eloy Lafuente (stronk7) 9315fd7200 MDL-28185 upgrade - fix oracle problem upgrading blocks 2011-07-05 15:38:37 +02:00
Kordan 10bc60a163 addition to previous fix for MDL-27989 in MOODLE_20_STABLE 2011-07-05 11:24:09 +02:00
Kordan 0f9a1467e2 MDL-27989 fix for MOODLE_20_STABLE 2011-07-05 10:13:35 +02:00
Aparup Banerjee 8b3405e8f2 MDL-28135 general Updated broken and typo docs links 2011-07-05 15:43:34 +08:00
Aparup Banerjee c5b7c1f627 MDL-28135 general Updated the Copyright notice to point to docs.moodle.org/dev/Releases instead of en/Release 2011-07-05 15:43:23 +08:00
Aparup Banerjee cc56539e51 MDL-28135 general Updated doc links related to Release notes to docs.moodle.org/dev/Releases now 2011-07-05 15:43:13 +08:00
Aparup Banerjee ae8da34929 MDL-28135 general Updating all hardcoded "docs.moodle.org/en/Development:" type doc links to "docs.moodle.org/dev/"
- cherry-picked and resolved conflicts
2011-07-05 15:39:56 +08:00
Rossiani Wijaya 0a6604e525 MDL-27555 assignment module: remove 'submitted' option from optional setting for offline assignment type. 2011-07-05 14:39:59 +08:00
Iñaki Arenaza 385e9d72ec MDL-24666 sync_users.php can throw db exception on sites upgraded from 1.x
From 2.0 on we lowercase all the settings related to LDAP attributes
to cope with differences in LDAP servers when returning attribute
names as array indices (some lowercase them, some leave them as
specified in the query, some normalize them, etc.).

But we only lowercase them when saving the settings page. So on sites
that have been migrated from 1.x, it may happen that we still have
mixed-case attribute names. And this is fatal for the user_attribute
setting, as we might not detect it in the returned array from LDAP and
it will be empty (and the db layer throws and exception).

So we just make sure the attribute name is lowercased (and trimmed,
in case it's got some white space around it).
2011-07-04 21:38:53 +02:00
Tim Hunt ae912070ea MDL-27040 get_users_by_capability generates u.id IN () when no uesrs have accessallgroups 2011-07-04 19:01:06 +01:00
Joseph Rezeau 988f1a05e7 MDL-27716 qtype_multianswer make the work 'Close' in the overlib popup translatable. 2011-07-04 15:53:09 +01:00
Tim Hunt b8369f5e9f MDL-26618 Moving sticky blocks on other pages does not work in Oracle.
This was due to some missing $DB->sql_empty() in a query affecting the
block_positions table.
2011-07-04 14:24:36 +01:00
Eloy Lafuente (stronk7) 020f0ffc5b weekly release 2.0.3+ 2011-07-02 00:01:29 +02:00
Eloy Lafuente (stronk7) 087a329eef Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-07-01 23:37:36 +02:00
Sam Hemelryk 39025fe177 Merge branch 's11_MDL-28121_split_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-07-01 15:08:59 +08:00
Dan Marsden 473afcbfec SCORM MDL-28110 fix string name 2011-07-01 14:24:52 +12:00
Eloy Lafuente (stronk7) 1dcb107bd4 Merge branch 'MDL-28132_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-07-01 01:38:44 +02:00
Tim Hunt 7cf9937724 MDL-28132 truncate very long category names before using them in random question names. 2011-06-30 19:34:44 +01:00
Eloy Lafuente (stronk7) f6c6bb4d39 Merge branch 'MDL-28115_20stable' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-06-30 17:12:31 +02:00
Rossiani Wijaya 814bce6575 MDL-28115 lesson module: fixed undefined variable for multiple answer, disabled numberical input text during review and fixed bug for essay answer during review process. 2011-06-30 19:11:15 +08:00
Dongsheng Cai f12c714e6f MDL-28121, fixed deprecated split() function 2011-06-30 17:35:33 +08:00
Dan Marsden 74e78f3ad8 SCORM MDL-28110 set default for forcejavascript to yes - add string explaining what it does. 2011-06-30 19:40:01 +12:00
Sam Hemelryk 4a7e2298a3 Merge branch 'MDL-24684_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-30 10:50:10 +08:00
Eloy Lafuente (stronk7) 910c941fa8 MDL-24684 backup - basic protection against time/memory limits 2011-06-30 03:43:50 +02:00
AMOS bot bfb0183f6d Automatically generated installer lang files 2011-06-30 00:55:15 +00:00
Eloy Lafuente (stronk7) add39c57dd Merge branch 'MDL-28044_MOODLE_20_STABLE' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-06-30 02:01:44 +02:00
Eloy Lafuente (stronk7) 1b024a0b51 Merge branch 'MDL-15587-stable' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-06-30 01:54:44 +02:00
Eloy Lafuente (stronk7) 9d12edfcae Merge branch 'm20_MDL-28016' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-06-30 01:11:28 +02:00
Sam Hemelryk 746f1ac85c MDL-27988 backup grade: Calculated grade items calculation references now corrected and idnumber restore improved 2011-06-29 18:42:34 +02:00
Eloy Lafuente (stronk7) 8277c39c76 Merge branch 'MDL-27955_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-06-29 15:59:57 +02:00
Eloy Lafuente (stronk7) fb654f651f Merge branch 'wip-mdl-27964-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-06-29 15:12:50 +02:00
Rossiani Wijaya 494f645bf4 MDL-27955 lesson module (m20): fixed error for reviewing lesson and update string to continue or finish reviewing 2011-06-29 18:34:54 +08:00
Dan Marsden a26a8c6a6f SCORM MDL-28016 - fix redirect call to use proper moodle_url 2011-06-29 20:32:36 +12:00
Rajesh Taneja 27beb68c4b MDL-27964 lesson - Quick fix added for importing question files in lesson module 2011-06-29 14:09:20 +08:00
Rajesh Taneja 8254083dc9 MDL-27964 lesson - Old file picker is replaced with new filepicker, currently all imported questions will be saved in /temp/questionimport/ where questionbank files are saved. 2011-06-29 14:08:30 +08:00
Aparup Banerjee 9b7ac1ea57 MDL-28044 general - updated print_error() link to point to new versioned docs link. 2011-06-29 10:57:14 +08:00
AMOS bot b214520d8b Automatically generated installer lang files 2011-06-29 00:55:20 +00:00
Sam Hemelryk abfe9dbe6e Merge branch 'MDL-28023_assignment_jabber_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-06-28 17:05:41 +08:00
Sam Hemelryk 8c75bb5976 Merge branch 's11_MDL-27866_pix_url_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-06-28 10:17:48 +08:00
Sam Hemelryk e78632643c Merge branch 'MDL-28014_stable' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-06-28 10:13:15 +08:00
sam marshall f114cff65f MDL-28021 Completion system can create inconsistent database rows
This change includes:

(1) update deletes older versions of inconsistent rows
(2) update drops one index and replaces it with a new unique index
(3) fixed to ensure that when it decides whether to insert or update
    it uses current database state and not cached info
(4) unit tests updated to test #3
2011-06-27 15:26:54 +02:00
Andrew Davis (andyjdavis) 3c18677ad1 MDL-28023_assignment_jabber assignment: added context url to improve the jabber notifications 2011-06-27 11:11:34 +08:00
Andrew Davis (andyjdavis) 1a199937f0 MDL-28023 assignment: assignment wasnt supplying all the data necessary to produce a meaningful jabber notification 2011-06-27 11:11:19 +08:00
AMOS bot b39029f718 Automatically generated installer lang files 2011-06-27 00:55:14 +00:00
Eloy Lafuente (stronk7) 7cb1a84978 Merge branch 'MDL-27922_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-06-27 00:55:29 +02:00
AMOS bot 8f7c097a09 Automatically generated installer lang files 2011-06-26 00:55:14 +00:00
Andreas Grabs 5dc47fbbc6 MDL-15587 - Course Participation report for a feedback activity 2011-06-24 23:11:10 +02:00
Rossiani Wijaya bac9a5e95e MDL-27922 lesson mod: fixed string for activity link 2011-06-24 16:48:46 +08:00
Eloy Lafuente (stronk7) 4a8d589d41 Merge branch 'MDL-27827_stable' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-06-24 00:23:03 +02:00
Eloy Lafuente (stronk7) ffd06a7394 Merge branch 's11_MDL-27999_wiki_preview_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-06-24 00:14:41 +02:00
Eloy Lafuente (stronk7) ba55e33828 Merge branch 'wip-MDL-27958-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-06-23 23:58:21 +02:00
Andreas Grabs 3fcd1d05b9 MDL-28014 - unpropitious use of bcmod() 2011-06-23 21:20:49 +02:00
Andreas Grabs 29f02f10f0 MDL-27827 - Missing messageprovider:message language string 2011-06-23 20:31:17 +02:00
Eloy Lafuente (stronk7) ff555b58be emergency release 2.0.3+ 2011-06-23 18:23:51 +02:00
stabijoh 42d1a03acc MDL-27998 canvas theme - fix font sizes 2011-06-23 17:29:45 +02:00
Eloy Lafuente (stronk7) 80a90f8d71 weekly release 2.0.3+ 2011-06-23 11:27:12 +02:00
Eloy Lafuente (stronk7) 4a225b69bb Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-06-23 11:24:19 +02:00
Eloy Lafuente (stronk7) 727242750d Merge branch 's10_MDL-27341_flickr_plugin_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-06-23 11:16:34 +02:00
Dongsheng Cai 454efc509f MDL-26677 flickr repo - fix undefined index usewatermarks 2011-06-23 17:14:30 +08:00
Eloy Lafuente (stronk7) 1bef145b49 Merge branch 'MDL-27920_grade_export_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-06-23 10:19:13 +02:00
Andrew Davis (andyjdavis) 1a20976561 MDL-27920 gradebook: fixes following integration review 2011-06-23 16:02:04 +08:00
Andrew Davis (andyjdavis) 2558ce3593 MDL-27920 gradebook: export was always excluding course totals and xml export was failing 2011-06-23 16:01:52 +08:00
Dongsheng Cai ab14ec06d2 MDL-27999 mod wiki, fixed broken image in preview 2011-06-23 13:53:12 +08:00
Sam Hemelryk d072124ba4 MDL-27958 Added missing set_context call which would cause errors for all contexts below course 2011-06-23 12:17:55 +08:00
Sam Hemelryk d9c19266c8 Merge branch 'MDL-27169_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-23 10:44:32 +08:00
Eloy Lafuente (stronk7) cf93662ffe MDL-26677 repositories - clean one debugging var_dump() 2011-06-23 02:06:16 +02:00
Eloy Lafuente (stronk7) 177f14d6f6 Merge branch 's10_MDL-27341_flickr_plugin_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-06-23 02:05:45 +02:00
Eloy Lafuente (stronk7) bdcea1a221 Merge branch 'MDL-27196-hardcodedstrings_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-23 00:26:09 +02:00
Eloy Lafuente (stronk7) 25ebb1df63 MDL-27169 filepicker - add explicit enctype to the js upload form. Credit goes to J Ross Nicoll, thanks! 2011-06-22 19:32:01 +02:00
David Mudrak 39af096daf MDL-27196 workshop - hardcoded strings in the random allocator 2011-06-22 18:02:48 +02:00
David Mudrak 0ff186d7d7 MDL-27196 workshop - hardcoded string in the number of errors strategy form 2011-06-22 18:02:44 +02:00
Eloy Lafuente (stronk7) 26a92149cc Merge branch 'wip-mdl-26281-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-06-22 14:28:36 +02:00
Eloy Lafuente (stronk7) 38961259de Merge branch 'MDL-27969-randomallocator-20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-22 14:16:41 +02:00
Eloy Lafuente (stronk7) 528cde2db2 Merge branch 'MDL-27073_multilang-custommenu_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-22 14:12:11 +02:00
David Mudrak 0ca33a3835 MDL-27969 workshop - prevent PHP notices in the random allocator
When generating the output of the allocation results, the names of
reviewers and authors are obtained based on the current state of assigned
roles and the 'musthavesubmission' setting. Therefore, when we want to
display information about a re-used allocation, the name of the author
or the name of the author may not be available.

In case of reviewers, we first try to reload the list including the
users without own submission. If it does not help, we just display the
id of the user instead of the name. In case of authors, we just display
the id the user. I can't see much point of eventual fetching the user
record from the database just to populate the list that almost no-one
reads anyway.
2011-06-22 12:15:47 +02:00
Rajesh Taneja 2a02a3f0de MDL-26281 Lesson - Fixed short answer with apostrophe and other html formats 2011-06-22 17:20:25 +08:00
Sam Hemelryk 8445c4724c Merge branch 'MDL-27966_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-22 17:16:00 +08:00
Sam Hemelryk 3e6c1d4d55 Merge branch 'MDL-25811_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-22 17:10:53 +08:00
Eloy Lafuente (stronk7) 2c85a824fc Merge branch 's10_MDL-27341_flickr_json_error_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-06-22 03:07:26 +02:00
Eloy Lafuente (stronk7) 6ce26b03e7 Merge branch 'MDL-27860_2.0' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-06-22 03:00:41 +02:00
AMOS bot ae18165edd Automatically generated installer lang files 2011-06-22 00:55:18 +00:00
Eloy Lafuente (stronk7) 5def8d573d Merge branch 'MDL-26948_2.0' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-06-22 02:36:05 +02:00
Eloy Lafuente (stronk7) 41c5f54940 MDL-27966 timezones - updated to 2011g version + fix minor notice 2011-06-21 16:25:18 +02:00
AMOS bot 39b5360e69 Automatically generated installer lang files 2011-06-21 00:55:16 +00:00
Rossiani Wijaya 6409d38377 MDL-27906 calendar event: fixed retrieving coursemodule by replacing get_coursemodule_from_id() to get_coursemodule_from_instance() 2011-06-20 15:13:59 +08:00
Dongsheng Cai 945df69ff3 MDL-27866, set page context for $OUTPUT->pix_url 2011-06-20 13:53:06 +08:00
AMOS bot 16aae71dcd Automatically generated installer lang files 2011-06-20 00:55:14 +00:00
Eloy Lafuente (stronk7) 371e83db2d MDL-25811 automated backups - clean running status after 90 mins of inactivity 2011-06-18 22:12:57 +02:00
Tim Hunt f4bc50d2bb MDL-27860 count quiz attempts properly when checking if a new attempt is allowed. 2011-06-18 18:33:55 +01:00
AMOS bot b32484d582 Automatically generated installer lang files 2011-06-18 00:55:20 +00:00
Tim Hunt 6750bec6c9 MDL-26948 quiz navigation fake block should have an id to allow styling. 2011-06-17 17:26:34 +01:00
David Mudrak 6a8787828e MDL-27073 Support multi-language content in custom menu 2011-06-17 17:05:10 +02:00
Dongsheng Cai 466b23caf7 MDL-27341, fixed flickr public plugin should check
search text, tag and nsid before searching photos
2011-06-17 12:13:42 +08:00
Dongsheng Cai a4d6717aec MDL-26677 fixed undefined index usewatermarks in flickr plugin 2011-06-17 12:11:22 +08:00
Eloy Lafuente (stronk7) cc50a2fbc4 weekly release 2.0.3+ 2011-06-16 19:09:49 +02:00
Eloy Lafuente (stronk7) 3345c20e29 fix permissions 2011-06-16 19:06:33 +02:00
Eloy Lafuente (stronk7) c06e87a410 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-06-16 19:04:49 +02:00
Eloy Lafuente (stronk7) db005da178 Merge branch 'MDL-24355-MOODLE_20_STABLE2' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-06-16 10:39:48 +02:00
Andrew Davis (andyjdavis) cfc9f55ca6 MDL-24355 tag: minor clean up of tags changes 2011-06-16 10:35:29 +08:00
Sam Hemelryk 15f0d2ed37 MDL-24355 Fixed up deletion of tag correlations when deleting tags 2011-06-16 10:07:58 +08:00
Sam Hemelryk a370e4e4fa MDL-24355 Added code to delete any tag correlations that wern't just identified 2011-06-16 10:07:41 +08:00
Eloy Lafuente (stronk7) a9e0bc82fb Merge branch 'wip-mdl-27863-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-06-15 11:30:15 +02:00
Rajesh Taneja ec05915767 MDL-27863 moodlelib: - fixed testcase faliure in MDL-27577 2011-06-15 16:38:29 +08:00
Eloy Lafuente (stronk7) b5e8919b7c Merge branch 'm20_MDL-27858' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-06-15 01:18:33 +02:00
Eloy Lafuente (stronk7) 397262e292 Merge branch 'MDL-27848_for_MOODLE_20_STABLE' of git://github.com/kordan/moodle into MOODLE_20_STABLE 2011-06-15 00:55:08 +02:00
Dan Marsden ea1e93b265 SCORM MDL-27858 - fix typo 2011-06-15 10:33:15 +12:00
AMOS bot 29e42725a4 Automatically generated installer lang files 2011-06-14 18:25:59 +02:00
Eloy Lafuente (stronk7) 91c59dbd8e MDL-27759 backport some improvs from master + whitespace fix 2011-06-14 17:07:03 +02:00
Eloy Lafuente (stronk7) 87c8b752ca Merge branch 'wip-MDL-27759-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-06-14 17:01:56 +02:00
Eloy Lafuente (stronk7) 4fcc689dfc Merge branch 'wip-MDL-27825-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-06-14 12:30:55 +02:00
Eloy Lafuente (stronk7) 27f31cc626 Merge branch 'MDL-27525_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-06-14 12:12:57 +02:00
Kordan 9660303cc2 MDL-27835_for_MOODLE_20_STABLE fix 2011-06-14 11:45:31 +02:00
Sam Hemelryk 9abec7278b MDL-27825 Improved check of themedesignermode to prevent errors if it isn't set 2011-06-14 15:49:33 +08:00
Kordan ba7c14c1a7 MDL-27834 for MOODLE_20_STABLE fix 2011-06-14 09:54:53 +08:00
Sam Hemelryk 97161e5008 Merge branch 'MDL-27286_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-14 09:48:57 +08:00
AMOS bot 25041083d5 Automatically generated installer lang files 2011-06-14 00:55:09 +00:00
Eloy Lafuente (stronk7) a1c5868475 MDL-27822 rename new methods 2011-06-14 00:35:07 +02:00
Tim Hunt d4e94648cf MDL-27822 old module version should be available in restore_activity_structure_step::define_structure() 2011-06-14 00:34:50 +02:00
Eloy Lafuente (stronk7) b651e7bb74 MDL-27286 recent files repo - fix for oracle and cleanup 2011-06-13 18:55:19 +02:00
Eloy Lafuente (stronk7) d527599fcd whitespace fixes 2011-06-13 10:29:18 +02:00
Sam Hemelryk c1d93d47e9 Merged branch 'MDL-26960-for-20_STABLE' of git://git.luns.net.uk/moodle with changes 2011-06-13 15:09:16 +08:00
Sam Hemelryk 6160c1721c Merge branch 'm20_MDL-27404' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-06-13 14:54:06 +08:00
Sam Hemelryk 71472b0a82 Merge branch 'MDL-16168-CAS-crash-if-no-LDAP-20' of https://github.com/iarenaza/moodle into MOODLE_20_STABLE 2011-06-13 11:32:55 +08:00
Sam Hemelryk ba3721d463 Merge branch 'MDL-27757-20' of git://github.com/srynot4sale/moodle into MOODLE_20_STABLE 2011-06-13 11:18:48 +08:00
Sam Hemelryk 1a1f7b0eec Merge branch 'MDL-27783-20STABLE' of git://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-06-13 11:14:02 +08:00
Rossiani Wijaya 0c60b1113e MDL-27525 mod_wiki: Fixed typing error for the variable and assign the value contextid to use mod context id 2011-06-13 11:08:32 +08:00
Sam Hemelryk 79121602c4 Merged branch 'MDL-27801_MOODLE_20_STABLE' of git://github.com/kordan/moodle.git with changes 2011-06-13 10:35:55 +08:00
Rajesh Taneja ba16180449 MDL-27759 user webservice - added new PARAM for timezone PARAM_TIMEZONE, to validate timezone input in webservice while deling with user information 2011-06-13 10:23:46 +08:00
Dan Marsden 01765239b0 MDL-27404 SCORM fix for IE 6 - thanks to Howard Miller 2011-06-13 11:31:48 +12:00
Marina Glancy d65a2b2262 MDL-26430 fixed appearance of one html form within another 2011-06-10 13:15:13 +08:00
Aaron Barnes 4754c0edd1 MDL-27757 lib/completionlib.php: Load "enablecompletion" property if required 2011-06-10 13:54:45 +12:00
kordan ec441b6dd0 MDL-27801 fix for MOODLE_20_STABLE 2011-06-09 22:05:32 +02:00
Dan Poltawski df01a82082 messaging: MDL-26960 Check correct users permissions
When on message profile page, the incorrect capability was checked
2011-06-09 16:01:15 +01:00
Jerome Mouneyrac 00338d8b94 MDL-27783 enabled status of a built-in service should never been updated on upgrade. It is only used during the installation. If a dev really needs to change the status, he can do it in lib/db/upgrade.php 2011-06-09 16:59:35 +08:00
Eloy Lafuente (stronk7) 57e034c094 weekly release 2.0.3+ 2011-06-09 03:42:48 +02:00
Eloy Lafuente (stronk7) c5b9fe0dda Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-06-09 03:38:54 +02:00
Eloy Lafuente (stronk7) 07511dbe6d Merge branch 'wip-MDL-27638-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-06-09 01:23:30 +02:00
Eloy Lafuente (stronk7) df70dfe4ee Merge branch 'wip-mdl-27577-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-06-09 01:10:27 +02:00
Eloy Lafuente (stronk7) f872b32778 Merge branch 'wip-MDL-27676-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-06-09 00:36:33 +02:00
Iñaki Arenaza beb807e033 MDL-16168 auth/cas CAS crashes if no LDAP is set up
Pending fix for Moodle 2.x. Credit goes to Ivan Dackiewicz.
2011-06-08 19:45:14 +02:00
Sam Hemelryk 98d17b5bad MDL-27676 Requests for a users profile pic that doesnt exist now redirect to the requested f1/f2 rather than just f1 2011-06-08 18:06:22 +08:00
Sam Hemelryk bca840b4bc Merged branch 'MDL-27695_MOODLE_20_STABLE' of git://github.com/nebgor/moodle.git with changes 2011-06-08 16:32:18 +08:00
Sam Hemelryk 80406e9dd8 Merge branch 'MDL-27737_2.0' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-06-08 13:52:39 +08:00
Sam Hemelryk f4c5e50440 Merged branch 'MDL-25775_stable' of git://github.com/grabs/moodle.git 2011-06-08 13:51:10 +08:00
Sam Hemelryk 1382f8a549 Merged branch 'MDL-27118-MOODLE_20_STABLE' of git://github.com/epsd/moodle.git 2011-06-08 13:43:51 +08:00
Aparup Banerjee c372808e97 MDL-27695 Documentation : updated the moodle docs link at the footer of pages to point to new docs url 2011-06-08 13:43:44 +08:00
Sam Hemelryk f279137a86 Merge branch 'MDL-27294-MOODLE_20_STABLE' of git://github.com/epsd/moodle into MOODLE_20_STABLE 2011-06-08 13:39:29 +08:00
Sam Hemelryk 0ad12999d7 MDL-27704 Fixed typo in theme/fusion/style/core.css 2011-06-08 13:36:27 +08:00
Mary Evans a390156411 MDL-27704_master Fix for Overlapping problems in Fusion theme 2011-06-08 13:35:30 +08:00
kordan b84a272faf MDL-27588 Fixed up several bugs with the formal_white theme
-> MDL-26934 has been fixed
-> MDL-27474 has been fixed
-> one more option to have blocks column with different background colours
-> one more option to use custom font size
-> version.php, and b/install.php to handle upgrades
-> increased the font size in the table with plugin list shown at upgrade time
-> minor fixes in IE7 when images from remote web sites are shown in the header
-> conformed the dock background colour to the block background colour to avoid unpleasant color combinations
-> conformed a.link, a.visited and a.active colours in tabs
-> conformed a.link, a.visited and a.active colours in the navigation block
-> deleted an awful box border from enrolment page
-> right aligned commands for resources and activities in the course page
-> increased the width of field item title column in mform
-> increased the padding-top to the help popup box messages
-> user menu restyled to fix some minor tweaks in IE7
-> minor repair to tabs to improve its look
-> restyling of the docked item panel header to look like all the other blocks
-> reduced the distance between elements in headermenu to look better even when only headings are shown in the header
-> links wherever and always black
-> the "search courses" field in the navigation bar does not force extra height
-> some unpleasant generalbox border duplicating some other border have been removed
-> some unpleasant margin/padding in notices and mtables has been removed
2011-06-08 13:14:36 +08:00
Sam Hemelryk f2ba68efc1 Merged branch 'MDL-27692' of git://github.com/MaryE/moodle.git 2011-06-08 13:04:57 +08:00
Sam Hemelryk 629ea4957b Merge branch 'MDL-25477-MOODLE_20_STABLE' of git://github.com/epsd/moodle into MOODLE_20_STABLE 2011-06-08 11:31:14 +08:00
Sam Hemelryk 4c1db5b4ea Merged branch 's9_MDL-26392_wiki_files_20' from git://github.com/dongsheng/moodle.git with fixes 2011-06-07 16:31:38 +08:00
Sam Hemelryk 7ea0f8e519 Merge branch 'MDL-27734-workshop-example-weight_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-07 16:25:14 +08:00
Sam Hemelryk ece057943d Merge branch 'MDL-27733-workshop-deadlines_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-07 16:22:49 +08:00
Sam Hemelryk edb8d49d35 Merge branch 'MDL-27732-glossary-introformat_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-06-07 16:14:52 +08:00
Sam Hemelryk 8c23e3f5ff Merge branch 'admin_whitespace_cleanup_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-06-07 16:11:33 +08:00
AMOS bot 30a39ee2b7 Automatically generated installer lang files 2011-06-07 00:55:09 +00:00
Tim Hunt c3a68f4496 MDL-27737 numerical qtype upgrade bug 2.0dev -> 2.0. 2011-06-06 18:13:31 +01:00
Andreas Grabs d230fb7bcd MDL-25775 - Site policy page blank 2011-06-06 18:12:14 +02:00
David Mudrak 0f37e97dc6 MDL-27734 Fixed weights of the example submission assessments 2011-06-06 17:27:32 +02:00
David Mudrak c33e534dce MDL-27733 workshop: keep the phase deadlines during the 1.9 => 2.0 upgrade 2011-06-06 15:40:56 +02:00
David Mudrak 65814f90c1 MDL-27732 Include the introformat field in the glossary module backups 2011-06-06 15:16:46 +02:00
Eloy Lafuente (stronk7) 3a1380d81a MDL-27724 wiki - update commented upgrade step to avoid future problems 2011-06-05 19:46:46 +02:00
Eloy Lafuente (stronk7) 743010f779 MDL-27723 whitespace cleanup of admin directory 2011-06-05 19:34:12 +02:00
AMOS bot 5a1a6fc1f0 Automatically generated installer lang files 2011-06-05 00:55:09 +00:00
Dongsheng Cai b0022f8d91 MDL-26392 WIKI added file managment support to wiki editor 2011-06-03 11:24:50 +08:00
Mary Evans 838f1bcdf4 MDL-27692-fixes_bullets_not_numbers_in_ordered_list_in_topic_sectio_in_course_page_view 2011-06-03 03:03:38 +01:00
Rajesh Taneja 014fba4928 MDL-27577 moodlelib - fixed dst offset in userdate, usergetdate and make_timestamp functions 2011-06-03 09:59:52 +08:00
AMOS bot 32eadaf080 Automatically generated installer lang files 2011-06-03 00:55:27 +00:00
Eloy Lafuente (stronk7) dba24103ea weekly release 2.0.3+ 2011-06-02 23:37:12 +02:00
Eloy Lafuente (stronk7) 0a770d5c6c Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-06-02 23:28:02 +02:00
AMOS bot 29775a8e89 Automatically generated installer lang files 2011-06-02 00:55:11 +00:00
Sam Hemelryk f2855813c7 MDL-27638 Removed buggy status line from query as it is being calculated in php anyway 2011-05-31 17:03:17 +08:00
Eloy Lafuente (stronk7) b5e1c2e748 Merge branch 'MDL-25191-m20' of git://github.com/sammarshallou/moodle into MOODLE_20_STABLE 2011-05-31 01:01:24 +02:00
Sam Hemelryk 98c1207c46 Merge branch 'wip-mdl-27603-MOODLE_20_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-05-30 17:22:41 +08:00
Sam Hemelryk 3466a42f31 Merge branch 'MDL-25512' of git://github.com/MaryE/moodle.git 2011-05-30 13:07:24 +08:00
Rajesh Taneja 3fc24f1238 MDL-27603 enrol_user - changed modifier to modifierid which is used in database 2011-05-30 10:20:24 +08:00
Sam Hemelryk 2e8ab7269c Merge branch 'MDL-27636_20stable' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-05-30 09:33:19 +08:00
Sam Hemelryk 72ca02b0b2 Merge branch 'MDL-27009' of git://github.com/aolley/moodle into MOODLE_20_STABLE 2011-05-30 09:04:34 +08:00
Mary Evans 22a7afd577 wip-MDL-25512 Correct CSS rules in Canvas theme to align with YUI3 CSS Fonts 2011-05-30 00:12:27 +01:00
Adam Olley c281550ce5 MDL-25191: Properly destroy all elements of the modinfo cache 2011-05-27 13:31:36 +01:00
AMOS bot 4a94bae470 Automatically generated installer lang files 2011-05-26 00:55:15 +00:00
Eloy Lafuente (stronk7) 92480bc82b MDL-27636 restore - add support for after_restore() to plugins. Credit goes to Mark Nielsen. Thanks! 2011-05-26 02:39:43 +02:00
Eloy Lafuente (stronk7) 2ff8943027 MDL-27541 course reports - allow teachers to view individual reports 2011-05-26 01:31:43 +02:00
Eloy Lafuente (stronk7) da63c93657 weekly release 2.0.3+ 2011-05-26 00:25:27 +02:00
Eloy Lafuente (stronk7) 4e184a9ce6 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-05-26 00:14:02 +02:00
Eloy Lafuente (stronk7) 36420f78c1 Merge branch 'MDL-27625_20stable' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-05-25 16:38:48 +02:00
Eloy Lafuente (stronk7) 93e980d52b MDL-27625 rating - consider RATING_UNSET_RATING a valid rating value 2011-05-25 16:14:07 +02:00
sam marshall 9e5855cb1a MDL-27532 Add backup support for course report per-course data 2011-05-23 12:16:13 +02:00
Sam Hemelryk f9ba5c5222 Merge branch 'm20_MDL-25177_choice_windowfix' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-05-23 11:34:29 +08:00
Sam Hemelryk f79dd3b57d Merge branch 'MDL-27530_stable' of git://github.com/grabs/moodle into MOODLE_20_STABLE 2011-05-23 11:25:25 +08:00
AMOS bot f5eec88fb6 Automatically generated installer lang files 2011-05-22 21:22:44 +02:00
AMOS bot f5a4f25375 Automatically generated installer lang files 2011-05-19 11:45:22 +02:00
Dan Marsden d714350a11 MDL-25177 Choice - fix typo for form creation causing pop-up window - thanks to Jason Hardin for fix 2011-05-19 13:03:04 +12:00
Sam Hemelryk a021f72a34 weekly release 2.0.3+ 2011-05-18 18:12:56 +08:00
Sam Hemelryk 32af9814f1 MDL-27161 Improved the 2 new strings in assignment 2011-05-18 17:30:06 +08:00
Sam Hemelryk bcb785fa9e MDL-26704 Fixed up variable typo 2011-05-18 15:33:41 +08:00
Eloy Lafuente (stronk7) 733bd07b8b MDL-27192 Global scope does not need global usage 2011-05-17 18:50:16 +02:00
Eloy Lafuente (stronk7) 19ab387d06 Merge branch 'wip-MDL-27192_MOODLE_20_STABLE' of git://github.com/jason-platts/moodle into MOODLE_20_STABLE 2011-05-17 18:49:49 +02:00
Jason Platts 02a03f4fe2 MDL-27192 Page context error on calendar export with custom user
profile fields
2011-05-17 15:24:39 +01:00
Eloy Lafuente (stronk7) 75c92b6306 MDL-27161: whitespace fix 2011-05-17 14:57:32 +02:00
Eloy Lafuente (stronk7) e56ac08a5c Merge branch 'MDL-27386_m20_b' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-05-17 14:28:55 +02:00
stabijoh 0cf31e061b MDL-27294 fix for fusion and overlay zoom text issue 2011-05-17 07:32:01 -04:00
Eloy Lafuente (stronk7) 65150b26cd MDL-26704 gradebook: adding TODO comment to avoid forgetting 2011-05-17 12:00:50 +02:00
Eloy Lafuente (stronk7) e1ad9ae4f5 Merge branch 'MDL-26704_user_outline_report' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-05-17 12:00:10 +02:00
Andreas Grabs ffa12b8397 MDL-27530 The webdav-repository loads empty files 2011-05-16 15:32:17 +02:00
Eloy Lafuente (stronk7) 890c7fae4e Merge branch 'MDL-26436_close_recordsets3' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-05-16 09:26:29 +02:00
Andrew Davis (andyjdavis) 9f2e9b535d MDL-26436 message: reviewed use of recordsets in messaging 2011-05-16 14:00:09 +08:00
Sam Hemelryk c7d4a92ccf Merge branch 'MDL-27161_m20' of git://github.com/rwijaya/moodle.git 2011-05-16 12:32:12 +08:00
Sam Hemelryk 5bd0e7af9f Merge branch 'MDL-27387_rating_scale_validation' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-05-16 12:16:26 +08:00
Sam Hemelryk 794fb0e565 Merge branch 'MDL-26075_stable' of git://github.com/grabs/moodle 2011-05-16 12:10:58 +08:00
Glenn Ansley 998b74a160 MDL-27494 choice - fixing incorrectly named column in backup 2011-05-16 03:25:46 +02:00
Eloy Lafuente (stronk7) 9ae0b69f59 Merge branch 'MDL-26436_close_recordsets2' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-05-16 02:46:52 +02:00
Rossiani Wijaya f4dc83e6e6 MDL-27161: fixed optional setting for 'require grading' to prevent page lock out 2011-05-13 14:10:45 +08:00
Sam Hemelryk ca2b2eb8af MDL-27456 Fixed typo in comment/lib.php after last refatoring 2011-05-13 11:18:48 +08:00
Andreas Grabs 5399e053d1 MDL-26075 Sending Message through Feedback Component throws an error 2011-05-12 17:10:06 +02:00
Rossiani Wijaya 6ef4ef1ee5 MDL-27161: fixed optional setting for 'require grading' to prevent page lock out 2011-05-12 16:53:55 +08:00
Andrew Davis (andyjdavis) f5a1b068cc MDL-27387 rating: prevent the submission of ratings outside of the range allowed by the current scale 2011-05-12 10:44:46 +08:00
Andrew Davis (andyjdavis) b9d64ab18f MDL-27460 roles: now closing a record set that wasnt being closed 2011-05-12 10:37:33 +08:00
Eloy Lafuente (stronk7) 39d106ee76 weekly release 2.0.3+ 2011-05-11 15:22:32 +02:00
Andrew Davis (andyjdavis) 07373d91a8 MDL-26704 gradebook: added some intelligence to the dates displayed on the user outline activity report 2011-05-10 11:02:22 +08:00
Sam Hemelryk 633fcef536 Merge branch 'MDL-27140_m20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-05-10 09:54:15 +08:00
Eloy Lafuente (stronk7) dde17843e0 MDL-27140 weeks course format - incorrect roll of dates on hidden sections
Credit goes to Nikhil Gupta, big thanks!
2011-05-09 18:17:35 +02:00
Eloy Lafuente (stronk7) 2430319b52 Merge branch 'MDL-27401-m20' of git://github.com/sammarshallou/moodle into MOODLE_20_STABLE 2011-05-09 17:47:47 +02:00
sam marshall adabef8bf6 MDL-27401 Unit test errors in lib/simpletest/testpagelib_moodlepage.php 2011-05-09 11:17:03 +01:00
Andreas Grabs 22ea14df25 MDL-27422 The excel export fails in some conditions. 2011-05-09 17:47:21 +08:00
Sam Hemelryk 6867fc94b7 Merge branch 'MDL-27325_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-05-09 10:52:22 +08:00
Sam Hemelryk 8385249f5b Merge branch 'MDL-27367-20' of git://github.com/srynot4sale/moodle into MOODLE_20_STABLE 2011-05-09 10:22:20 +08:00
Eloy Lafuente (stronk7) 30dc7311ad Merge branch 'wip-MDL-27400-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-05-09 02:13:26 +02:00
Eloy Lafuente (stronk7) 9784520acb Merge branch 'MDL-27372_MOODLE_20_STABLE' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-05-09 01:55:39 +02:00
Eloy Lafuente (stronk7) d015c2352f Merge branch 'MDL-27391-m20' of git://github.com/sammarshallou/moodle into MOODLE_20_STABLE 2011-05-09 01:01:44 +02:00
Eloy Lafuente (stronk7) 35fa620a2e MDL-27325 Adding some extreme, but 32bits safe, float tests 2011-05-06 16:07:02 +02:00
Eloy Lafuente (stronk7) 15516e6445 MDL-27325 Now also testing update_record and set_field 2011-05-06 16:07:02 +02:00
Eloy Lafuente (stronk7) 280a641232 MDL-27325 mysql: Avoid some implicit casting from float to varchar/text 2011-05-06 16:07:02 +02:00
Tim Hunt 14dac82376 MDL-27325 New DB unit tests to demonstrate the problem. 2011-05-06 16:07:01 +02:00
Eloy Lafuente (stronk7) 06ede85e1f Moodle 2.0.3 release 2011-05-06 15:09:21 +02:00
Sam Hemelryk 31a43cca97 MDL-27400 Fixed up typo in blocklib.php 2011-05-06 16:29:01 +08:00
Tim Hunt 8ad8b7dba8 MDL-27394 Moodle 2.0 backup and restore may randomise the order of multichoice/numerical/shortanswer answers 2011-05-06 00:18:50 +02:00
sam marshall a09897b4b1 MDL-26778 Completion unit tests broken by earlier change 2011-05-05 12:21:10 +01:00
Aparup Banerjee 5e00f29019 MDL-27372 moved blog comments to end of body of blog entry. we now see the entire blog entry without comments in the way. 2011-05-05 15:29:42 +08:00
Sam Hemelryk 36f0835e72 Merge branch 's9_MDL-27382_dropbox_get_file_fix_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-05-05 13:26:46 +08:00
Sam Hemelryk 259b9d05f3 Merge branch 's9_MDL-27381_overwrite_dialog_safari_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-05-05 13:23:22 +08:00
Sam Hemelryk da20cd7b43 Merge branch 's9_MDL-26854_spam_comments_20_2' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-05-05 11:46:05 +08:00
Dongsheng Cai acb4688d29 MDL-26854 Added comments block lib.php, it contains comments callbacks 2011-05-05 11:25:19 +08:00
Jerome Mouneyrac 471952fe82 MDL-26250 Create a web service function that enrols users to a certain course 2011-05-05 11:00:00 +08:00
Dongsheng Cai 0d738689bd MDL-27381 fixed 'overwrite files' dialog zindex in safari 2011-05-05 10:43:17 +08:00
Sam Hemelryk 7390fdde63 Merge branch 's9_MDL-26854_spam_comments_20_2' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-05-05 10:42:58 +08:00
Sam Hemelryk 1374c61bb4 Merge branch 'MDL-26838_ratings_bad_data3' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-05-05 10:19:54 +08:00
Dongsheng Cai 98d9209a34 MDL-27382 repository dropbox plugin, fixed bug of
file downloading path
2011-05-05 09:57:34 +08:00
Eloy Lafuente (stronk7) 8351ce1bd0 weekly release 2.0.2+ 2011-05-05 00:37:10 +02:00
Eloy Lafuente (stronk7) b911ab236c Merge branch 'MDL-25594-20' of git://github.com/srynot4sale/moodle into MOODLE_20_STABLE 2011-05-04 16:09:44 +02:00
Dongsheng Cai b4730465e6 MDL-26854 COMMENT
1. added pluginname_comment_validate callback to comments api
2. change permission callback defaults to false
3. Tidied up serveal areas of comments and implemented callback to
ignore system permissions for view (credits to Sam Hemelryk)

AMOS BEGIN
    MOV [modulerejectcomment,error],[callbackrejectcomment,error]
AMOS END
2011-05-04 17:59:19 +08:00
Eloy Lafuente (stronk7) 78cc7bee62 Merge branch 'MDL-26788_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-05-04 11:21:02 +02:00
Dongsheng Cai 5d6eafcf10 MDL-26388 Recent repository plugin should return draft url 2011-05-04 17:03:36 +08:00
Dongsheng Cai 090e19328e MDL-26388 Recent repository plugin should return draft url 2011-05-04 15:48:11 +08:00
Andrew Davis (andyjdavis) 34b5e856b0 MDL-26838 rating: multiple fixes after a review of rating validation code 2011-05-04 15:33:35 +08:00
Sam Hemelryk c44a5d5946 Merge branch 's10_MDL-27330_dropbox_authorization_url_20' of github.com:dongsheng/moodle into MOODLE_20_STABLE 2011-05-04 13:56:59 +08:00
Aaron Barnes b7d7679112 MDL-25594 completion: Remove unused column from query
Which is also a reserved word.
2011-05-04 13:01:27 +12:00
Aaron Barnes 90061a6d95 MDL-26190 completion blocks: Completion blocks shouldn't ever be blank 2011-05-04 12:53:02 +12:00
stabijoh c9c031fc90 MDL-25477 fix for Anomoly theme doesn't display bullets for unordered lists in descriptions or labels 2011-05-03 07:06:55 -04:00
Dongsheng Cai 64a17788aa MDL-27330 repository dropbox plugin
Dropbox changed authorization URL, and added a few error check code
2011-05-03 17:42:57 +08:00
Sam Hemelryk 0baa1eee59 Merged MDL-26388 Fixed whitespace 2011-05-03 16:28:38 +08:00
Sam Hemelryk 9f6eeb4abf Merged MDL-25805 Renamed property and function to be a little more descriptive 2011-05-03 15:43:20 +08:00
Sam Hemelryk 6a48b42ae8 Merge branch 'MDL-25805_MOODLE_20_STABLE' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-05-03 15:42:26 +08:00
Sam Hemelryk 2dd90f136c Merge branch 'MDL-26628' of git://github.com/srynot4sale/moodle into MOODLE_20_STABLE 2011-05-03 11:00:15 +08:00
Sam Hemelryk e6647397b9 Merged MDL-27251 Fixed up whitespace, Fixed broken string, reworded new strings 2011-05-03 10:54:44 +08:00
Aparup Banerjee 07fa10d725 MDL-25840 blog - fixed broken image file image attachment display 2011-05-03 01:14:16 +02:00
Eloy Lafuente (stronk7) 98032d512d Merge branch 'MDL-27293-customlang-timeout_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-05-02 16:19:40 +02:00
Aparup Banerjee 389235fb00 MDL-25805 Roles propagated ugly hack for parent seeing child activities into navigation lib to display nav node. 2011-05-02 20:21:51 +08:00
Eloy Lafuente (stronk7) 656237dd55 Merge branch 'MDL-26714_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-05-02 12:26:22 +02:00
Sam Hemelryk e3cc5b1a7f Merged changes and fixed whitespace issues for MDL-23188 2011-05-02 15:00:54 +08:00
Sam Hemelryk 0742ea86b2 Merge branch 'MDL-26955-themedir-plugindirectory_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-05-02 14:23:06 +08:00
Sam Hemelryk 41f79b5c07 Merge branch 'MDL-27116-themedir-config_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-05-02 14:12:45 +08:00
Sam Hemelryk ed85c0acd2 Merge branch 'MDL-27155_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-05-02 14:09:26 +08:00
Sam Hemelryk 9c39028179 Merge branch 'MDL-27246-cutomlang-version_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-05-02 12:14:05 +08:00
Dongsheng Cai 9fb4a6300b MDL-26388, pop up a dialog when attaching a file already being used in draft area. 2011-05-02 10:27:50 +08:00
Tim Hunt 44c9dc6e7b MDL-27340 tablelib.php fix a notice when is false. 2011-05-01 17:37:54 +01:00
Andrew Davis (andyjdavis) 4af7c9d188 MDL-26838 rating: remove logged in users ability to sidestep rating validity checks 2011-05-01 18:44:12 +08:00
Tim Hunt 847dee60ce MDL-27155 qtype_numerical problem with GIFT import. 2011-04-29 14:16:10 +01:00
stabijoh b7551bdf23 MDL-27118 Text in a highlighted topic box is white on white in the Leatherbound theme. 2011-04-29 07:44:56 -04:00
Rossiani Wijaya e0be8fd6a3 MDL-26788 - grading in lesson containing essays 2011-04-29 18:17:36 +08:00
Tim Hunt 55e03d1233 MDL-26714 qtype_multianswer regression from the previous commit for numerical subquestions. 2011-04-28 23:32:14 +01:00
stabijoh e391f907af MDL-23188 implement custom menu where possible in core themes, 20 stable version 2011-04-27 08:44:53 -04:00
David Mudrak bef867a96c MDL-26955 get_plugin_directory() respects $CFG->themedir
If $CFG->themedir is set (it is not usually) and the given theme is not
found in the standard location, then it is expected to be in the custom
$CFG->themedir directory.

Credit goes to Urs Hunkler for the idea of the patch.
2011-04-27 14:03:53 +02:00
David Mudrak 4207d47742 MDL-27116 theme_config::find_theme_location() respects $CFG->themedir
Credit goes to Jai Gupta for the idea of the patch.
2011-04-27 14:03:10 +02:00
David Mudrak bd7193c7ac MDL-27293 report customlang has extra execution time and displays a progress bar during the checkout
Initial checkout of strings into the translator table may take a long time. The
maximum execution time is increased to one hour and a progress bar is
displayed so the user is informed on what is going on.
2011-04-27 14:01:59 +02:00
David Mudrak 77e4a16c4f MDL-27246 customlang report stores the versions in a char field rather than integer 2011-04-27 14:01:38 +02:00
Petr Skoda 7daba2713e weekly release 2.0.2+ 2011-04-27 12:08:04 +02:00
Aaron Barnes 03b1be3005 MDL-26628 completion report: Fix hard coded strings in Completion report 2011-04-27 15:33:45 +12:00
Aparup Banerjee 5c8511ecf7 MDL-27251 Files API - added timeout re-calculation as an optional argument. added setting for minimum Kbps for large files fetched from internet where the passed in timeout maybe too low.
allowed turning off the http HEAD request timeout calculation with zero (or negative) bitrate

	This was added in to allow servers that have a problem with
	HEAD requests to carry on with the given timeout without re-calculations.
	See PULL-651 for the discussion.

	the optional argument to force recalculation of timeout has been forced within scorm/locallib.php

	timeout re-calculation only increments timeout.
2011-04-27 11:02:21 +08:00
Eloy Lafuente (stronk7) 52435228c5 Merge branch 'w17_MDL-27253_m20_swfsize' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-26 11:15:01 +02:00
Eloy Lafuente (stronk7) c9dc3e5564 Merge branch 'w17_MDL-27263_m20_loggedintypo' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-26 11:06:31 +02:00
Petr Skoda ffaf18a8c1 MDL-27253 add default swf size and allow #d=100x50 URL resizing in mod/url 2011-04-21 20:36:06 +02:00
Petr Skoda f5fddc6081 MDL-27263 fix already logged in error message typo 2011-04-21 20:35:33 +02:00
stabijoh 9d5a4e2b7c MDL-27252 themes, fix for nonzero current highlight 2011-04-20 13:19:12 -04:00
Eloy Lafuente (stronk7) ba9103b2c6 weekly release 2.0.2+ 2011-04-20 13:36:41 +02:00
Eloy Lafuente (stronk7) 79196c9ed5 Fix permissions 2011-04-20 11:09:11 +02:00
Aparup Banerjee a572cfe5bd MDL-26580 adding precautionary upgrade_set_timeout() calls to some loops which may timeout in very edge cases 2011-04-19 17:58:03 +08:00
Aparup Banerjee 92d7776478 MDL-26580 adding some upgrade_set_timeout() calls to 2010080901 upgrade block, upgrades on questions were timing out 2011-04-19 17:57:56 +08:00
Sam Hemelryk 2715f96932 Merged with small fix branch MDL-26516_m20_calevent_wip4 from git://github.com/rwijaya/moodle.git 2011-04-19 16:29:49 +08:00
John Stabinger 6919d9f790 Fixes for MDL-27138, add correct page headers and footer 2011-04-19 11:03:33 +08:00
Sam Hemelryk 8be0517692 MDL-26835 Fixed up styles being used for suspended users in the grader report. 2011-04-19 10:47:14 +08:00
Sam Hemelryk a4b65c11b9 Merged with conflict resolution branch MDL-26835_MASTER_grader_highlight_suspended_users from git://github.com/andyjdavis/moodle.git 2011-04-19 10:46:54 +08:00
Sam Hemelryk 64e711f04b MDL-25999 Fixed URL bug with admin bookmark changes 2011-04-19 10:26:46 +08:00
Sam Hemelryk e6cf40de78 Merge branch 'MDL-25999_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-04-19 10:26:30 +08:00
Rossiani Wijaya 174f5a0189 MDL-26516: fix calendar event type (user overides) 2011-04-18 18:12:25 +08:00
Eloy Lafuente (stronk7) dd56fd7c64 MDL-26167 lib/form: minor coding tweaks 2011-04-18 11:45:02 +02:00
Eloy Lafuente (stronk7) 436f83f8ff Merge branch 'MDL-26167-stable' of git://github.com/agwells/moodle into MOODLE_20_STABLE 2011-04-18 11:44:02 +02:00
Rossiani Wijaya d03f904759 MDL-25999: update Admin Bookmarks block to work properly in 2.0 2011-04-18 17:23:36 +08:00
Eloy Lafuente (stronk7) 15a6af91f5 Merge branch 'w16_MDL-17344_m20_uploadprof' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-18 11:07:42 +02:00
Andrew Davis (andyjdavis) 0a23dec07a MDL-26835 gradebook: grader report now marks suspended students 2011-04-18 14:25:16 +08:00
Sam Hemelryk 6f8081bef4 MDL-26958 PULL-675 Merged changes and removed border colour style 2011-04-18 10:57:27 +08:00
Andrew Davis (andyjdavis) c643d3ae06 MDL-27153 gradebook - fixed an SQL error in grade export 2011-04-18 02:17:09 +02:00
Eloy Lafuente (stronk7) 507ccf1c4b MDL-27148 whitespace fix 2011-04-18 01:47:11 +02:00
Eloy Lafuente (stronk7) 60bc533ee8 Merge branch 'w16_MDL-27148_m20_stringinc' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-18 01:44:10 +02:00
Eloy Lafuente (stronk7) 42f2b8d0dd Merge branch 'w16_MDL-27217_m20_tinyset' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-18 01:13:49 +02:00
Eloy Lafuente (stronk7) 84047d1fc9 Merge branch 'w16_MDL-27220_m20_tagprofile' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-18 01:08:10 +02:00
Petr Skoda b79ac7e0d6 Merge branch 'm20_MDL-26880_SCORM2004_tracking_fix' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-04-17 17:16:48 +02:00
Petr Skoda 241ceba38c Merge branch 'm20_MDL-24734_gradefix' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-04-17 17:09:59 +02:00
Petr Skoda 8e49e0833c Merge branch 'm20_MDL-18392_slash_cleanup' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-04-17 17:04:09 +02:00
Petr Skoda f6bf9c932d Merge branch 'MDL-27198-m20' of git://github.com/sammarshallou/moodle into MOODLE_20_STABLE 2011-04-17 16:40:10 +02:00
Petr Skoda 1fb2369b09 Merge branch 'wip-MDL-26013-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-17 16:22:34 +02:00
Petr Skoda 4de0925820 Merge branch 'wip-MDL-27145-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-17 16:13:08 +02:00
Petr Skoda 81f2a1686a MDL-27217 use correct editor name in editor settings page
Credit goes to Franck Bellemain.
2011-04-17 11:18:00 +02:00
Petr Skoda 5f509554a5 MDL-27220 add missing tag lib include 2011-04-17 11:07:57 +02:00
Dan Marsden edd5d0693d SCORM MDL-24734 - fix display of grade information on view.php page - also fixes some XHTML in the same function. 2011-04-16 19:32:11 +12:00
Mary Evans d59a75a841 MDL-26958 Core Themes:adding css patch to base theme so hidden elements are dimmed
This patch also fixes MDL-27160 - the same bug which affects many CORE themes like Binarus and Nonzeo. This patch also a small element of a patch supplied by Thomas Lake in Tracker MDL-26958 (most of which already exists in Base theme).
2011-04-15 00:49:22 +01:00
Aaron Wells 9b482d1cbe MDL-26167 lib/form: Altering Javascript so that "disabledIf" will disable the "Choose" button for a filepicker 2011-04-15 10:02:34 +12:00
sam marshall ca090f3262 MDL-27198 Accessibility: For labels, completion/editing icons must appear after content 2011-04-14 17:28:53 +01:00
Petr Skoda 12db898084 MDL-27148 use new get_in_or_equal() param prefix instead of start 2011-04-14 15:13:28 +02:00
Petr Skoda c79345c0f0 MDL-27148 fix unit tests to accept arbitrary named params format from get_in_or_equal 2011-04-14 15:12:21 +02:00
Petr Skoda d691571218 MDL-27148 use static counter instead of incrementing parameter name 2011-04-14 14:44:50 +02:00
Petr Skoda 4e1bb6e10c MDL-17344 fix case and unicode related profile field issues in user upload
This fixes issue with uppercase and non-ascii profile fields and closes the iterator properly when field not found. Please note that profile fields with upper case letters must be specified exactly in CSV file headers. includes improved docs and parameter typo fix (credit for the parameter typo discovery goes to Aparup Banerjee)
2011-04-14 13:18:42 +02:00
Nadav Kavalerchik a7e920fbfb CSS MDL-26013 Fixed several display bugs when using right to left languages 2011-04-14 15:59:03 +08:00
Matteo Scaramuccia 7a725d6b59 PULL-498 - Fixed potential issues about UTF-8 and multilang filter by adopting pure ASCII chars, the SCO primary key 2011-04-14 10:26:41 +12:00
Matteo Scaramuccia 489c6ef357 MDL-26880 - Fixed missing of activity id
Moved errorCode as global, to allow GetLastError() to work
Applied MDL-17891 mechanism against AJAX failures, "true if true, false otherwise"
Limited what added to log when in debug, to be compliant with mdl_log.action as VARCHAR(40)
2011-04-14 10:26:18 +12:00
Dan Marsden dbb6157aa1 Merge remote branch 'moodle/MOODLE_20_STABLE' into m20_MDL-18392_slash_cleanup 2011-04-14 09:15:17 +12:00
Petr Skoda 50467e50c9 weekly release 2.0.2+ 2011-04-13 22:08:30 +02:00
Petr Skoda 85a91fb98e Merge branch 'MDL-24355_emergency_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-04-13 16:49:29 +02:00
Eloy Lafuente (stronk7) 75454e2567 MDL-24355 tags - fix correlation sql to be cross-db 2011-04-13 16:37:37 +02:00
Petr Skoda 06c09f30e3 Revert "MDL-25840 fixed image files link not rendered correctly when attached as file (instead of inline)."
The reason is failed testing. This reverts commit 3d0e3ade75.
2011-04-13 15:07:22 +02:00
Dan Marsden 26daa23d9d SCORM MDL-18392 - remove old call to stripslashes 2011-04-13 20:00:59 +12:00
Matteo Scaramuccia 74a2ee73ed SCORM MDL-18392 MDL-26282 - Fixed calls to add/strip slashes 2011-04-13 19:58:44 +12:00
Petr Skoda fca41d2589 MDL-25718 fix incorrect 'no grade' test and improve coding style 2011-04-12 10:07:05 +02:00
Petr Skoda 6de6a45a10 Merge branch 'MDL-25718_enrol_grades_alternative2' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-04-12 09:55:28 +02:00
Sam Hemelryk 0f1fac1f1f form-dateselector MDL-27145 Fixed up error resulting from incorrectly required 'optional' argument on create event 2011-04-12 14:15:51 +08:00
andyjdavis 692134ecd4 enrol MDL-25718 added ability to recover grades when enrolling users 2011-04-12 11:05:02 +08:00
Eloy Lafuente (stronk7) d7706bac2c Merge branch 'MDL-26778-m20' of git://github.com/sammarshallou/moodle into MOODLE_20_STABLE 2011-04-11 17:54:21 +02:00
Eloy Lafuente (stronk7) 391e054c03 Merge branch 'w15_MDL-26577_m20_groupscleanup' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 16:02:10 +02:00
Eloy Lafuente (stronk7) 71f2316fe6 Merge branch 'w15_MDL-26805_m20_userpol' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 15:18:31 +02:00
Petr Skoda 16d610019a Merge branch 'wip-MDL-27024-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-11 14:13:34 +02:00
Petr Skoda 4f5791da64 Merge branch 'wip-MDL-26599-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-11 14:10:38 +02:00
sam marshall c5e3a242b1 MDL-26778 Change to completion should immediately affect nav block
Includes change so that updating completion resets the cache, and a debugging
warning if any module calls the completion viewed thing after it's already
printed navigation (which will mean navigation obviously doesn't update right
away). All existing modules that currently update after printing navigation
were updated.
2011-04-11 12:40:50 +01:00
Petr Skoda 13ad1eaf37 Merge branch 'MDL-25840_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-04-11 13:30:44 +02:00
Petr Skoda 7ca448fa83 MDL-26805 cleanup default role selections
Frontpage role selection now allows only guest and frontpage roles. Default forntpage role is selected duuring install. Unused nodefaultuserrolelists option was removed completely. Coding style improvements.
2011-04-11 13:08:35 +02:00
Eloy Lafuente (stronk7) 37efb4f1ee Merge branch 's9_MDL-27098_filemanager_strings_20' of git://github.com/dongsheng/moodle into MOODLE_20_STABLE 2011-04-11 11:20:31 +02:00
Dongsheng Cai 81bd2292bc MDL-27098
1. Fixed add file language string
2. Fixed hard-coded 'moving' string
3. Fixed hard-coded 'Files' string
2011-04-11 17:10:30 +08:00
Eloy Lafuente (stronk7) 8fa13d155d Merge branch 'w15_MDL-25826_m20_htmlpurifier' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 11:08:23 +02:00
Sam Hemelryk 465846f082 Merge branch 'MDL-25746_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-04-11 15:38:48 +08:00
Aparup Banerjee f68815ffcf MDL-25746 fixed db tempate page layout to prevent hidden content layers 2011-04-11 15:16:54 +08:00
Sam Hemelryk 67b5d74b2c Merge branch 'MDL-27034_xhprof_table_sql_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-04-11 14:34:57 +08:00
Aparup Banerjee 3d0e3ade75 MDL-25840 fixed image files link not rendered correctly when attached as file (instead of inline). 2011-04-11 14:24:22 +08:00
Sam Hemelryk 7d1fb2f6ec Merged branch 'MDL-26185_m20' of git://github.com/andyjdavis/moodle.git and fixed conflicts 2011-04-11 11:54:50 +08:00
Sam Hemelryk 227e54d65a Merge branch 'MDL-27063' of git://github.com/MaryE/moodle into MOODLE_20_STABLE 2011-04-11 11:38:21 +08:00
Sam Hemelryk ee6181b1e7 comment MDL-27024 Removed last check within comment.js for block_comment env 2011-04-11 10:43:25 +08:00
Sam Hemelryk 3962c89bbf comment MDL-27024 Fixed bug that arose when a comment section didnt require pagination but the JS still looked for pageination HTML in the page 2011-04-11 10:43:21 +08:00
Sam Hemelryk 59137c2c5b comment MDL-27024 Removed last reference to the comment block within the comment API and used the options properly 2011-04-11 10:43:17 +08:00
Sam Hemelryk b83e494d6f comment MDL-27024 Fixed up whitespace issues 2011-04-11 10:43:12 +08:00
Sam Hemelryk 3b2164bdca comment MDL-27024 made notoggle and autoload into proper options to remove comment block conditions from comment API 2011-04-11 10:43:06 +08:00
Sam Hemelryk aa54d70440 comment MDL-27024 Cleaned up HTML output in comment class 2011-04-11 10:43:01 +08:00
Sam Hemelryk d2d4bccec1 comment MDL-27024 Cleaned up use of undefined property $this->link 2011-04-11 10:42:56 +08:00
Sam Hemelryk f3a3c59f48 mod-lesson MDL-26599 Fixed echo causing incorrect nesting. 2011-04-11 10:27:58 +08:00
Eloy Lafuente (stronk7) 3d62a46b26 Merge branch 'w15_MDL-27094_m20_assval' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 01:32:15 +02:00
Eloy Lafuente (stronk7) 9aacfedb22 Merge branch 'w15_MDL-27007_m20_userupload' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 01:23:04 +02:00
Eloy Lafuente (stronk7) 12b734434b Merge branch 'w15_MDL-26910_m20_httpd' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-11 00:17:23 +02:00
Eloy Lafuente (stronk7) f9068e531c Merge branch 'w15_MDL-27121_m20_phpreq' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-04-10 23:55:11 +02:00
Eloy Lafuente (stronk7) 96506c474a Merge branch 'MDL-26319_MOODLE_20_STABLE' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-04-10 23:49:59 +02:00
Tony Levi 0d66e33da5 MDL-27084: mod/feedback fix bad syntax in database query 2011-04-10 23:43:56 +02:00
Petr Skoda 934fa3ed6c MDL-27094 fix incorrect assignment form validation method name
Credit goes to H. Hanna
2011-04-10 21:01:53 +02:00
Petr Skoda 6743d6c520 MDL-26910 add HTTPD server name whitelisting 2011-04-10 13:59:17 +02:00
Petr Skoda cf76e10e4a MDL-26577 fix several groups and groupings issues
The current group in verified on each page which prevents problems when group settings are changed. The default group for course level is now using correct grouping id which solves problems when activity and course are using different grouping. The grouping is now displayed in group selector if user has access to all groups.
2011-04-10 13:28:02 +02:00
Mary Evans c800e31213 MDL-27063 tt styled incorrectly in canvas theme 2011-04-10 00:48:35 +01:00
Petr Skoda 23580ddacb MDL-27121 fix incorrect check_moodle_environment() version parameter
This prevents Moodle 2.0 from using environment info for 2.1 in the installer and CLI upgrade.
2011-04-09 17:42:53 +02:00
Petr Skoda 827fcdb347 MDL-27007 fix incorrectly suspended user enrolment when uploading users
This bug surfaced after the recent change in enrol API, credit goes to Chaim Schendowich and Micky Fokken.
2011-04-09 12:09:53 +02:00
Petr Skoda 60aaf1dc77 MDL-25826 add more HTMLPurifier integration tests 2011-04-09 11:51:55 +02:00
Petr Skoda fd8fa6f9d0 MDL-25826 integrate HTMLPurifier 4.3.0 and improve performance
The new HTMLPurifier finally caches the schema properly eliminating both extra CPU cycles and disk writes. The repeated dir exists tests might cause problems on NFS shares.
2011-04-09 11:51:49 +02:00
Petr Skoda 8adf19eda8 MDL-25826 import HTMLPurifier 4.3.0 2011-04-09 11:51:35 +02:00
Mayank Gupta 95fa6fddca MDL-27037, wiki does not support visiblegroups functionality 2011-04-08 23:40:36 +05:30
Andrew Davis (andyjdavis) a6e29ac6a3 message MDL-26185 fixed the logic around email addy in user profile Vs in messaging preferences 2011-04-07 15:39:03 +08:00
Aparup Banerjee 52e184904f MDL-26319 moved cancel_backup() from backup_ui to cancel_process() in base_ui and renamed callers. fix for method inheritance in restore_ui. 2011-04-07 10:40:45 +08:00
Eloy Lafuente (stronk7) b8d80c062e MDL-27034 profiling - xhprof_table_sql improvement 2011-04-07 00:46:33 +02:00
Petr Skoda eb9d692f8b weekly release 2.0.2+ 2011-04-06 14:55:57 +02:00
Petr Skoda a805d653d1 MDL-26804 fix undefined CFG langcache property during install
Sorry, I have committed fix for this in master incorrectly with MDL-26914.
2011-04-06 10:56:30 +02:00
Sam Hemelryk fe4a0cfe63 PULL-574 MDL-26185 Reverted changes due failed testing + review 2011-04-06 16:35:24 +08:00
Petr Skoda d0e3447e43 revert MDL-26577 added session cleaning to groups_get_activity_group() that fixes an issue with dirty session data. refactored session cleaning into one function, added caching to reduce queries.
(reverse-merged from commit 77335e76e9) This change was causing fatal errors on the course level, I am going to fix it myself.
2011-04-05 18:35:01 +02:00
Sam Hemelryk f046221272 messaging MDL-26185 Last minute fix of bug during integration, empty user preference causing error 2011-04-05 16:53:03 +08:00
Petr Skoda 42a50a0a45 Merge branch 'MDL-26577_groups_api_refactor_take2_m20' of git://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-04-05 10:21:21 +02:00
Aparup Banerjee 77335e76e9 MDL-26577 added session cleaning to groups_get_activity_group() that fixes an issue with dirty session data. refactored session cleaning into one function, added caching to reduce queries. 2011-04-05 12:23:56 +08:00
Eloy Lafuente (stronk7) ddf3e875f3 Merge branch 'wip-MDL-26560-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-04 23:16:53 +02:00
Eloy Lafuente (stronk7) 91fa7abf3d Merge branch 'wip-MDL-26858-MOODLE_20_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-04-04 21:50:22 +02:00
Eloy Lafuente (stronk7) b060e5b0b8 Merge branch 'MDL-26931-blog-post-order_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-04-04 12:02:17 +02:00
Andrew Davis (andyjdavis) f9c8746704 gradebook MDL-20946 fixed average calculation where users have multiple gradeable roles 2011-04-04 11:27:09 +02:00
Petr Skoda c629aeabe3 MDL-25651 fix incorrect indentation 2011-04-04 10:01:30 +02:00
Petr Skoda 27614a5e5d Merge branch 'wip-MDL-25651_MOODLE_20_STABLE' of git://github.com/jennymgray/moodle into MOODLE_20_STABLE 2011-04-04 09:59:04 +02:00
Sam Hemelryk ba32fc0042 enrolments MDL-26560 Fixed panel.user bug with role assignments dialogue 2011-04-04 14:50:15 +08:00
Sam Hemelryk 87b05ba3e0 enrolments MDL-26858 Added finish user enrolments button to JS dialogue 2011-04-04 14:38:23 +08:00
Sam Hemelryk 728f3c9d08 Merge branch 'MDL-26185_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-04-04 13:21:24 +08:00
Mary Evans d7dd177eb4 Fix for MDL-27016 added min-width 2011-04-04 13:10:06 +08:00
Rossiani Wijaya 507de745e3 MDL-26185: simplify the logic of email message output and removing email cache 2011-04-01 11:12:54 +08:00
Jenny Gray bf8ff4889b MDL-25651 add capability check to my private files navigation link 2011-03-31 14:54:36 +01:00
Ankit Agarwal f9112bda35 MDL-26931 Order blog entries by the creation date 2011-03-31 11:56:53 +02:00
Tim Hunt ba63612bfa MDL-27035 table_sql forgets to set countparams. 2011-03-30 20:26:34 +01:00
Petr Skoda 408612d111 updating digits to match the .2 release 2011-03-30 18:01:09 +02:00
Petr Skoda 60e837038a weekly release 2011-03-30 14:29:56 +02:00
Petr Skoda 4cb05cea9d Merge branch 'MDL-26964-moodle_url-anchor_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-03-29 10:00:04 +02:00
Adam Olley 0960f2f417 MDL-27009: Fix role group by statement for statistics 2011-03-29 11:46:17 +10:30
Eloy Lafuente (stronk7) 09c1e72a56 Merge branch 'MDL-26744-metasyncstring_20_STABLE' of git://github.com/wildgirl/moodle into MOODLE_20_STABLE 2011-03-28 23:56:08 +02:00
Eloy Lafuente (stronk7) d2455301b7 Merge branch 'w13_MDL-22733_20_youtubeiframe' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 23:53:40 +02:00
Eloy Lafuente (stronk7) 1be2b904ab Merge branch 'w13_MDL-26909_20_mediatests' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 23:30:35 +02:00
Eloy Lafuente (stronk7) 337817e669 Merge branch 'w13_MDL-26987_20_sclean' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 21:59:21 +02:00
Eloy Lafuente (stronk7) b17a3a5591 Merge branch 'w13_MDL-26913_20_sitecreated' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 20:10:57 +02:00
Eloy Lafuente (stronk7) c44c552efa Merge branch 'w13_MDL-26951_20_archetypes' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 19:40:35 +02:00
Eloy Lafuente (stronk7) faa297ce6f Merge branch 'w13_MDL-26991_20_legacy' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 19:26:28 +02:00
Eloy Lafuente (stronk7) b6225c0f2f Merge branch 'w13_MDL-26966_20_urlparsing' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 19:07:00 +02:00
Eloy Lafuente (stronk7) 50496af78b Merge branch 'w13_MDL-26985_20_branching' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 18:41:22 +02:00
Tim Hunt 8fc52ccf46 MDL-26425 tablelib ability for table_sql to add a class to the row based on the data. 2011-03-28 17:12:26 +02:00
Tim Hunt 9f9324f408 MDL-26425 tablelib better validation of the sort code, also some cleanup.
You may think that the extra validation is unnecessary, since the sort fields are already validated when the URL parameters are parsed, however that overlooks an important point. There may be other options that affect which columns are in the SQL, for example the quiz show individual question grades setting. These other options can cause a column that was in the table, and being sorted on, to disappear. Therefore, it is necessary to re-validate the sort columns when they are used, to make sure they are still present, otherwise you can get ORDER BY sql that refers to non-existant columns, which then causes DB errors.
2011-03-28 17:10:53 +02:00
Helen Foster d4dc367a5b MDL-26744 enrol meta lang string improvement thanks to Ray Lawrence 2011-03-28 17:07:55 +02:00
Eloy Lafuente (stronk7) 3ede344b5c Merge branch 'w13_MDL-26990_20_missingrebuild' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 16:35:18 +02:00
Petr Skoda 5c686792c6 Merge branch 'MDL-26335' of github.com:mouneyrac/moodle into MOODLE_20_STABLE 2011-03-28 15:13:47 +02:00
David Mudrak 91a4b3bd3e MDL-26804 core_string_manager::get_list_of_translations() can use a cache again
This patch reimplements the internal cache that was used to store the
list of available translations in Moodle 1.x. By default, the method
get_list_of_translations() still uses the file
moodledata/cache/languages to store the list of available translations.
The location of that file can be redefined in config.php. The internal
format of the cache file is JSON now (used to be a plain text list).

The patch also fixes a usage of the global $CFG in translation_exists()
methods where the internal property should be used instead.
2011-03-28 14:49:17 +02:00
Dongsheng Cai 1a6a1487f4 MOD-WIKI MDL-26213
1. Rewrite the image urls in diff.php and viewdiff.php
2. Fxied image urls in search.php
3. Add modcontext variable to avoid using duplicated
get_context_instance calls
2011-03-28 11:50:37 +02:00
Jenny Gray a5286ae4cc MDL-26932 full url path for toggle completion form POST 2011-03-28 11:04:39 +02:00
Dan Marsden 5b97bff526 Plagiarism MDL-26939 - missing return 2011-03-28 10:53:13 +02:00
Dongsheng Cai 1c4873ba1b MDL-26916, MDL-26917
1. Fix filepicker paging issue MDL-26916
2. Highlight view as icon button by default MDL-26917
2011-03-28 16:13:27 +08:00
Dan Marsden 9a8f8cea49 Forum Overview MDL-26957 add classes to allow better control by theme 2011-03-28 16:11:30 +08:00
stabijoh c37f03543b Revised fix for MDL-26906, magazine and formal white secure browser quiz window 2011-03-28 16:04:21 +08:00
Andrew Davis (andyjdavis) cd4ca97611 message MDL-26077 fixed up a problem with html tags being stripped out 2011-03-28 16:00:36 +08:00
Myles Carrick 77bfc4ce0f MDL-26798 encode file path in dropbox repository plugin, credits to Myles Carrick 2011-03-28 15:57:38 +08:00
Sam Hemelryk 13c53a4a2e Merge branch 'w13_MDL-26992_20_uploadtemplates' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 14:33:27 +08:00
Sam Hemelryk d3796a2c61 Merge branch 'w13_MDL-26989_20_enrolroles' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-03-28 14:17:08 +08:00
Petr Skoda 7bb8ae5911 MDL-26985 new Moodle 2.1 requirements
For now only extra PHP 5.3.2 requirement compared to 2.0.
2011-03-26 22:03:00 +01:00
David Mudrak dbe6d9f821 MDL-26964 URL anchor support for single_button and single_select
If the single_button or single_select use HTTP method 'get' then the
eventual anchor part of the URL is used.
2011-03-24 22:15:47 +01:00
David Mudrak 4927443761 MDL-26964 URL returned by moodle_url::out_omit_querystring() may contain the anchor part 2011-03-24 22:15:47 +01:00
33343 changed files with 1465410 additions and 4800560 deletions
-249
View File
@@ -1,249 +0,0 @@
{
'plugins': [
'@babel',
'promise',
'jsdoc'
],
'extends': [
'eslint:recommended',
'plugin:promise/recommended'
],
'env': {
'browser': true,
// Enable ES6+ features by default.
// See http://eslint.org/docs/user-guide/configuring#specifying-environments
// Note: The YUI override must exactly match this when disabling the ES6+ version because those features are not supported by Shifter.
'es2020': true,
'amd': true
},
'globals': {
'M': true,
'Y': true
},
// Warn about unused eslint-disable statements.
'reportUnusedDisableDirectives': true,
'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules.
// === Possible Errors ===
'comma-dangle': 'off',
'no-console': 'error',
'no-empty': 'warn',
'no-extra-parens': 'off',
'no-prototype-builtins': 'off',
'no-unreachable': 'warn',
// === Best Practices ===
// (these mostly match our jshint config)
'array-callback-return': 'warn',
'block-scoped-var': 'warn',
'complexity': 'warn',
'consistent-return': 'warn',
'curly': 'error',
'dot-notation': 'warn',
'no-alert': 'warn',
'no-caller': 'error',
'no-div-regex': 'error',
'no-empty-function': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'warn',
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-redeclare': 'warn',
'no-restricted-globals': ['error', { 'name': 'Notification' }],
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'warn',
'no-useless-escape': 'warn',
'wrap-iife': ['error', 'any'],
// === Variables ===
'no-undef-init': 'error',
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
// === Stylistic Issues ===
'array-bracket-spacing': 'warn',
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'func-call-spacing': ['warn', 'never'],
'func-names': 'off',
'func-style': 'off',
// indent currently not doing well with our wrapping style, so disabled.
'indent': ['off', 4, { 'SwitchCase': 1 }],
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
'keyword-spacing': 'warn',
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'off',
'max-len': ['error', 132],
'max-lines': 'off',
'max-depth': 'warn',
'max-nested-callbacks': ['warn', 5],
'max-params': 'off',
'max-statements': 'off',
'max-statements-per-line': ['warn', { max: 2 }],
'new-cap': ['warn', { 'properties': false }],
'new-parens': 'warn',
'newline-per-chained-call': 'off',
'no-array-constructor': 'off',
'no-bitwise': 'error',
'no-continue': 'off',
'no-inline-comments': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-multiple-empty-lines': 'warn',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-tabs': 'error',
'no-ternary': 'off',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-whitespace-before-property': 'warn',
'object-curly-newline': 'off',
'object-curly-spacing': 'warn',
'object-property-newline': 'off',
'one-var': 'off',
'one-var-declaration-per-line': ['warn', 'initializations'],
'operator-assignment': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
'quotes': 'off',
'semi': 'error',
'semi-spacing': ['warn', {'before': false, 'after': true}],
'sort-vars': 'off',
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', 'never'],
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises (override plugin:promise/recommended) ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail', 'always'], allowFinally: true}],
'promise/no-native': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use "core/str" module or M.util.get_string()'
}],
},
overrides: [
{
files: ["**/yui/src/**/*.js"],
'env': {
// Disable ES6+ for YUI files.
'es2020': false,
},
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We're using babel transpiling so use their parser
// for linting.
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-implicit-globals': 'error',
// Disable all of the rules that have babel versions.
'new-cap': 'off',
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'no-invalid-this': 'off',
'object-curly-spacing': 'off',
'quotes': 'off',
'semi': 'off',
'no-unused-expressions': 'off',
// Enable all of the babel version of these rules.
'@babel/new-cap': ['warn', { 'properties': false }],
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'@babel/no-invalid-this': 'off',
'@babel/object-curly-spacing': 'warn',
'@babel/semi': 'error',
'@babel/no-unused-expressions': 'error',
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
// === JSDocs ===
'jsdoc/check-access': 'error',
'jsdoc/check-alignment': 1, // Recommended.
'jsdoc/check-param-names': 'error',
'jsdoc/check-property-names': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/multiline-blocks': 'error',
'jsdoc/require-jsdoc': 'error',
'jsdoc/require-param': 'error',
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-type': 'error',
'jsdoc/require-property': 'error',
'jsdoc/require-property-name': 'error',
'jsdoc/require-property-type': 'error'
},
parserOptions: {
'sourceType': 'module',
'requireConfigFile': false
}
}
]
}
-24
View File
@@ -1,24 +0,0 @@
{
"indentation": ["on",{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Examples": 4,
"example": 6,
"Step": 4,
"given": 4,
"and": 4
}],
"no-dupe-feature-names": "on",
"no-dupe-scenario-names": "off",
"no-empty-file": "on",
"no-files-without-scenarios": "on",
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on",
"no-examples-in-scenarios": "on",
"new-line-at-eof": ["on", "yes"]
}
-5
View File
@@ -1,5 +0,0 @@
**/yui/build/** -diff
**/amd/build/** -diff
**.js.map -diff
**-min.js -diff
**.min.js -diff
-2
View File
@@ -1,2 +0,0 @@
# Primary donations pages.
custom: ["https://moodle.com/donations/", "https://fund.moodle.org"]
-7
View File
@@ -1,7 +0,0 @@
*** PLEASE DO NOT OPEN PULL REQUESTS VIA GITHUB ***
The moodle.git repository at Github is just a mirror of the official repository. We do not accept pull requests at Github.
See CONTRIBUTING.md guidelines for how to contribute patches for Moodle. Thank you.
--
-6
View File
@@ -1,6 +0,0 @@
> [!IMPORTANT]
> PLEASE DO NOT PUBLISH SECURITY FINDINGS PUBLICLY.
If you discover a potential security issue, please report it via our [Security Submission Form](https://moodle.org/security/report).
For more information about our security processes and responsible disclosure policy, see the [Security Procedures documentation](https://moodledev.io/general/development/process/security).
-1
View File
@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1231.24 314.44" preserveAspectRatio="xMinYMid meet"><defs><style>.cls-1{fill:#f48020;}.cls-2,.cls-3{fill:#383738;stroke:#4a4a4c;}.cls-2{stroke-width:2.37px;}.cls-3{stroke-width:2.38px;}.cls-4{fill:#585858;}</style></defs><title>Moodle_Logo_UseonBlack_RGB</title><path class="cls-1" d="M1086.3,235.34a53.42,53.42,0,0,0,16.71,29q13.26,12.27,29.48,12.27,11.29,0,24.56-5.89,16.23-6.88,16.22-16.22l58-.49q-12.29,29-41.76,45.2-27.52,15.23-60.43,15.24-42.25,0-70-26.29t-27.75-68.54q0-43.73,27.75-69.51t72-25.8q48.15,0,75.17,31.94,25.07,29.47,25.06,79.1Zm89.91-33.91q-3.43-17.69-14.73-29-12.8-12.28-29.49-12.29-17.21,0-28.74,11.79t-15.47,29.48Z"/><path class="cls-1" d="M965.45,308.54V0h55V308.54Z"/><path class="cls-1" d="M892.69,308.54V290.36q-7.38,9.83-25.06,15.72a92.31,92.31,0,0,1-30,5.41q-39.31,0-63.13-27T750.7,217.65q0-39.3,23.34-65.84t62.15-26.53q43.71,0,56.5,23.58V0h53.55V308.54Zm0-102.68q0-14.75-14-28.26t-28.74-13.51q-21.12,0-33.41,17.2-10.8,15.24-10.8,37.33,0,21.63,10.8,36.85,12.29,17.71,33.41,17.69,12.78,0,27.76-12t15-24.81Z"/><path class="cls-1" d="M647,313.45q-41.77,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.75,0,69.27,26.53t27.52,68.28q0,41.79-27.52,68.3T647,313.45ZM647,168q-19.89,0-30.58,15.07t-10.68,35.79q0,20.73,9.94,35.05,11.43,16.31,31.32,16.28t31.32-16.28q10.44-14.31,10.44-35.05t-9.94-35Q667.42,168,647,168Z"/><path class="cls-1" d="M448.07,313.45q-41.76,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.74,0,69.28,26.53t27.5,68.28q0,41.79-27.5,68.3T448.07,313.45Zm0-145.43q-19.89,0-30.59,15.07t-10.69,35.79q0,20.73,9.94,35.05,11.43,16.31,31.34,16.28t31.32-16.28q10.42-14.31,10.44-35.05t-9.94-35Q468.45,168,448.07,168Z"/><path class="cls-1" d="M288.89,309.11V201q0-33.9-28-33.9t-28,33.9V309.11h-55V201q0-33.9-27.52-33.9-28,0-28,33.9V309.11h-55V194.65q0-35.37,24.56-53.54,21.61-16.22,58.46-16.22,37.35,0,55,19.16,15.23-19.16,55.51-19.16,36.86,0,58.45,16.22,24.57,18.16,24.57,53.54V309.11Z"/><path class="cls-2" d="M.76,145.76"/><path class="cls-3" d="M1.73,145.32"/><path class="cls-4" d="M173.86,116.85l55.08-40.1-.7-2.44C135,83.92,80.42,96.44,0,144.13l.73,2.38,21-.67c15.17.52,30.85,1.26,46,1.32-1,24.09.83,32.65.83,32.65,51.92,17.58,101.22,1.53,127.14-43.9A248.72,248.72,0,0,0,173.86,116.85Z"/><path class="cls-4" d="M113.78,110c-.3-1.08-2.23-1.48-4.28-.9a4.73,4.73,0,0,0-3.14,2.19c-18.53,5-49.16,13.72-70.73,21l-1.33.45c-16.68,5.61-24.73,8.49-25.22,12.55-2.29,18.44-.87,42.18-.86,42.48l.19,6.4c-9.74,27.56.06,49.6,8.38,69.77.06-24.92,1.07-45.22-6-71-.2-3.82-1.49-30.36.61-47.34.34-2.75,11.65-6.56,23.63-10.59l1.33-.44c22-7.42,53.57-16.39,71.9-21.29a6.75,6.75,0,0,0,2.29-.25C112.64,112.43,114.08,111.09,113.78,110Z"/></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

-31
View File
@@ -1,31 +0,0 @@
name: 'Close Pull Requests'
on:
pull_request_target:
types: opened
workflow_dispatch:
jobs:
close:
# Avoid forks to run this job
if: github.repository_owner == 'moodle'
name: Close Pull Requests
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v4
with:
process-only: prs
close-pr: true
skip-closed-pr-comment: true
pr-comment: >
**Please, don't open pull requests via GitHub.**
This repository (moodle.git) at GitHub is just a mirror of the official Moodle repository.
For how to contribute patches for Moodle see
[CONTRIBUTING.md](https://github.com/moodle/moodle/blob/main/CONTRIBUTING.md).
Closing this pull request.
-71
View File
@@ -1,71 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
-143
View File
@@ -1,143 +0,0 @@
name: One by One Testing
# Run all the individual unit tests one by one, with
# fully independent PHPUnit executions. Useful to
# detect issues with some tests that are using stuff
# that has been made available by others, but is not
# available when running individually.
#
# Note that we aren't using PHPUnit's own isolation
# here but completely separated runs, one for each
# test.
#
# The workflow will fail reporting all the tests
# that have failed (and will pass if no failure is
# detected, of course).
#
# It's only executed via workflow dispatch (automated
# or manual), not by push/tag. And acceptd configuration
# of phpunit, specially useful to run it with PHPUnit's
# own isolation or any other option.
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
chunks: 7
jobs:
collect:
name: Collect individual unit tests
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.individual-tests.outputs.matrix }}
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Looking for all individual tests
id: individual-tests
run: |
count=0 # Number of individual tests found.
while read -r testfile; do # For each test file.
while read -r testname; do # For each unit test in a file.
count=$((count + 1))
# Sent it to the correct chunk file.
chunk=$(((($count % $chunks)) + 1))
echo "$testname $testfile" >> ./chunk_$chunk.txt
done < <(grep "function test_" "${testfile}" | sed -r "s/^.*function (test_[a-zA-Z0-9_]+).*/\1/")
done < <(find . -name "*_test.php" -not -path "*/fixtures/*")
# Generate the matrix to run tests.
echo "matrix=$(ls -1 chunk_*.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "$count individual tests collected in $chunks files"
- name: Upload individual tests files
uses: actions/upload-artifact@v4
with:
name: individual_tests
path: chunk_*.txt
retention-days: 1
test:
name: Run tests
needs: collect
runs-on: ubuntu-latest
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.collect.outputs.matrix) }}
steps:
- name: Setting up DB pgsql
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 14
postgresql db: test
postgresql user: test
postgresql password: test
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code
uses: actions/checkout@v4
- name: Download individual test files
uses: actions/download-artifact@v4
with:
name: individual_tests # Make all the chunk files available for the next steps.
- name: Setting up PHPUnit
env:
dbtype: pgsql
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Run PHPUnit test (one by one)
env:
dbtype: pgsql
run: |
status=0
count=0
while read -r line; do # For each line in the chunk file
count=$((count + 1))
filter="${line% *}"
file="${line#* }"
# Run the individual unit test and report problems if needed to.
if ! php vendor/bin/phpunit \
--fail-on-empty-test-suite \
--fail-on-warning \
--fail-on-risky \
--filter "$filter" ${{ inputs.phpunit_extra_options }} \
"$file" >/dev/null 2>&1; then
if [ $status -eq 0 ]; then
echo "Problems found, list of PHPUnit commands failing:"
fi
echo "vendor/bin/phpunit --filter '${filter}' ${{ inputs.phpunit_extra_options }} $file"
status=$((status + 1))
fi
done < ${{ matrix.file }}
echo "Finished: $count individual tests executed, $status tests failed"
exit $status
-127
View File
@@ -1,127 +0,0 @@
name: Core
on:
push:
branches-ignore:
- main
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: ubuntu-24.04
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-24.04
php: 8.2
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-24.04
php: 8.4
db: pgsql
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: moodlehq/mysql-action@v1
with:
collation server: utf8mb4_bin
mysql version: 8.4
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
tmpfs size: '1024M'
extra conf: --skip-log-bin
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 14
postgresql db: test
postgresql user: test
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
- name: Git status
run: git status
-23
View File
@@ -1,23 +0,0 @@
name: Web Installer Testing
on:
workflow_dispatch:
jobs:
InstallationTest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.4]
steps:
- name: Construct repository URL
run: echo "REPOSITORY_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
shell: bash
- uses: moodlehq/moodle-webinstaller-test@main
with:
repository: ${{ env.REPOSITORY_URL }}
branch: ${{ github.ref_name }}
php: ${{ matrix.php }}
-149
View File
@@ -1,149 +0,0 @@
name: Windows Testing
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm ci
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
php: 8.4
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
- os: windows-latest
php: 8.2
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: 8.4
user: test
password: test
- name: Creating DB mysql
if: ${{ matrix.db == 'mysqli' }}
run: mysql --host 127.0.0.1 -utest -ptest -e 'CREATE DATABASE IF NOT EXISTS test COLLATE = utf8mb4_bin;';
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
# TODO: Remove these conf. modifications when php74 or php80 are lowest.
# Change to old md5 auth, because php73 does not support it.
# #password_encryption = scram-sha-256
(Get-Content "$env:PGDATA\postgresql.conf"). `
replace('#password_encryption = scram-sha-256', 'password_encryption = md5') | `
Set-Content "$env:PGDATA\postgresql.conf"
(Get-Content "$env:PGDATA\pg_hba.conf"). `
replace('scram-sha-256', 'md5') | `
Set-Content "$env:PGDATA\pg_hba.conf"
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\psql --command="CREATE USER test PASSWORD 'test'" --command="\du"
- name: Creating DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
& $env:PGBIN\createdb --owner=test test
$env:PGPASSWORD = 'test'
& $env:PGBIN\psql --username=test --host=localhost --list test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
# Needs to be done after php is available, git configured and Moodle checkout has happened.
- name: Setting up moodle-exttests service
run: |
git clone https://github.com/moodlehq/moodle-exttests.git
nssm install php-built-in C:\tools\php\php.exe -S localhost:8080 -t D:\a\moodle\moodle\moodle-exttests
nssm start php-built-in
- name: Setting up redis service
run: |
choco install redis --version 5.0.7 --no-progress
nssm install redis redis-server
nssm start redis
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
shell: bash
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
+3 -38
View File
@@ -9,26 +9,15 @@
#
# See gitignore(5) man page for more details
#
# Swap files (vim)
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Temporary files including undo
*~
#
/config.php
/lib/editor/tinymce/extra/tools/temp/
*~
*.swp
/tags
/TAGS
/cscope.*
/.patches/
/.idea/
.phpstorm.*
!/.phpstorm.meta.php/
/.phpstorm.meta.php/*
!/.phpstorm.meta.php/di.php
/nbproject/
CVS
.DS_Store
@@ -36,27 +25,3 @@ CVS
/.project
/.buildpath
/.cache
.phpunit.result.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
composer.phar
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/lib/yuilib/*/build/*/*-coverage.js
# lib/yuilib/version/module/module-coverage.js
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
/admin/tool/componentlibrary/docs
/admin/tool/componentlibrary/hugo/site/data/my-index.json
.hugo_build.lock
phpcs.xml
jsconfig.json
UPGRADING-CURRENT.md
.phpunit.cache
-169
View File
@@ -1,169 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This is a babel plugin to add the Moodle module names to the AMD modules
* as part of the transpiling process.
*
* In addition it will also add a return statement for the default export if the
* module is using default exports. This is a highly specific Moodle thing because
* we're transpiling to AMD and none of the existing Babel 7 plugins work correctly.
*
* This will fix the issue where an ES6 module using "export default Foo" will be
* transpiled into an AMD module that returns {default: Foo}; Instead it will now
* just simply return Foo.
*
* Note: This means all other named exports in that module are ignored and won't be
* exported.
*
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
module.exports = ({template, types}) => {
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
/**
* Search the list of components that match the given file name
* and return the Moodle component for that file, if found.
*
* Throw an exception if no matching component is found.
*
* @throws {Error}
* @param {string} searchFileName The file name to look for.
* @return {string} Moodle component
*/
function getModuleNameFromFileName(searchFileName) {
searchFileName = fs.realpathSync(searchFileName);
const relativeFileName = searchFileName.replace(`${cwd}${path.sep}`, '').replace(/\\/g, '/');
const [componentPath, file] = relativeFileName.split('/amd/src/');
const fileName = file.replace('.js', '');
// Check subsystems first which require an exact match.
const componentName = ComponentList.getComponentFromPath(componentPath);
if (componentName) {
return `${componentName}/${fileName}`;
}
// This matches the previous PHP behaviour that would throw an exception
// if it couldn't parse an AMD file.
throw new Error(`Unable to find module name for ${searchFileName} (${componentPath}::${file}}`);
}
/**
* This is heavily inspired by the babel-plugin-add-module-exports plugin.
* See: https://github.com/59naga/babel-plugin-add-module-exports
*
* This is used when we detect a module using "export default Foo;" to make
* sure the transpiled code just returns Foo directly rather than an object
* with the default property (i.e. {default: Foo}).
*
* Note: This means that we can't support modules that combine named exports
* with a default export.
*
* @param {String} path
* @param {String} exportObjectName
*/
function addModuleExportsDefaults(path, exportObjectName) {
const rootPath = path.findParent(path => {
return path.key === 'body' || !path.parentPath;
});
// HACK: `path.node.body.push` instead of path.pushContainer(due doesn't work in Plugin.post).
// This is hardcoded to work specifically with AMD.
rootPath.node.body.push(template(`return ${exportObjectName}.default`)());
}
return {
pre() {
this.seenDefine = false;
this.addedReturnForDefaultExport = false;
},
visitor: {
// Plugin ordering is only respected if we visit the "Program" node.
// See: https://babeljs.io/docs/en/plugins.html#plugin-preset-ordering
//
// We require this to run after the other AMD module transformation so
// let's visit the "Program" node.
Program: {
exit(path) {
path.traverse({
CallExpression(path) {
// If we find a "define" function call.
if (!this.seenDefine && path.get('callee').isIdentifier({name: 'define'})) {
// We only want to modify the first instance of define that we find.
this.seenDefine = true;
// Get the Moodle component for the file being processed.
var moduleName = getModuleNameFromFileName(this.file.opts.filename);
// The function signature of `define()` is:
// define = function (name, deps, callback) {...}
// Ensure that if the moduel supplied its own name that it is replaced.
if (path.node.arguments.length > 0) {
// Ensure that there is only one name.
if (path.node.arguments[0].type === 'StringLiteral') {
// eslint-disable-next-line
console.log(`Replacing module name '${path.node.arguments[0].extra.rawValue}' with ${moduleName}`);
path.node.arguments.shift();
}
}
// Add the module name as the first argument to the define function.
path.node.arguments.unshift(types.stringLiteral(moduleName));
// Add a space after the define function in the built file so that previous versions
// of Moodle will not try to add the module name to the file when it's being served
// by PHP. This forces the regex in PHP to not match for this file.
path.node.callee.name = 'define ';
}
// Check for any Object.defineProperty('exports', 'default') calls.
if (!this.addedReturnForDefaultExport && path.get('callee').matchesPattern('Object.defineProperty')) {
const [identifier, prop] = path.get('arguments');
const objectName = identifier.get('name').node;
const propertyName = prop.get('value').node;
if ((objectName === 'exports' || objectName === '_exports') && propertyName === 'default') {
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
},
AssignmentExpression(path) {
// Check for an exports.default assignments.
if (
!this.addedReturnForDefaultExport &&
(
path.get('left').matchesPattern('exports.default') ||
path.get('left').matchesPattern('_exports.default')
)
) {
const objectName = path.get('left.object.name').node;
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
}, this);
}
}
}
};
};
-432
View File
@@ -1,432 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
/** @var {Object} A list of subsystems in Moodle */
const componentData = {};
/**
* Load details of all moodle modules.
*
* @returns {object}
*/
const fetchComponentData = () => {
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const gruntFilePath = process.cwd();
if (!Object.entries(componentData).length) {
componentData.subsystems = {};
componentData.pathList = [];
componentData.components = {};
componentData.standardComponents = {};
// Fetch the component definiitions from the distributed JSON file.
const components = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/components.json`));
const pluginData = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/plugins.json`));
componentData.pluginTypes = components.plugintypes;
const standardPlugins = Object.entries(pluginData.standard).map(
([pluginType, pluginNames]) => {
return pluginNames.map(pluginName => `${pluginType}_${pluginName}`);
}
).reduce((acc, val) => acc.concat(val), []);
// Build the list of moodle subsystems.
componentData.subsystems.lib = 'core';
componentData.pathList.push(process.cwd() + path.sep + 'lib');
for (const [component, thisPath] of Object.entries(components.subsystems)) {
if (thisPath) {
// Prefix "core_" to the front of the subsystems.
componentData.subsystems[thisPath] = `core_${component}`;
componentData.pathList.push(process.cwd() + path.sep + thisPath);
}
}
// The list of components includes the list of subsystems.
componentData.components = {...componentData.subsystems};
const subpluginAdder = (subpluginType, subpluginTypePath) => {
glob.sync(`${subpluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${subpluginType}_${componentName}`;
componentData.components[`${subpluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
});
};
// Go through each of the plugintypes.
Object.entries(components.plugintypes).forEach(([pluginType, pluginTypePath]) => {
// We don't allow any code in this place..?
glob.sync(`${pluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${pluginType}_${componentName}`;
componentData.components[`${pluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
// Look for any subplugins.
const subPluginConfigurationFile = `${componentPath}/db/subplugins.json`;
if (fs.existsSync(subPluginConfigurationFile)) {
const subpluginList = JSON.parse(fs.readFileSync(fs.realpathSync(subPluginConfigurationFile)));
if (subpluginList.subplugintypes) {
Object.entries(subpluginList.subplugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(
subpluginType,
`${pluginTypePath}/${componentName}/${subpluginTypePath}`
);
});
} else if (subpluginList.plugintypes) {
Object.entries(subpluginList.plugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(subpluginType, subpluginTypePath);
});
}
}
});
});
// Create a list of the standard subsystem and plugins.
componentData.standardComponents = Object.fromEntries(
Object.entries(componentData.components).filter(([, name]) => {
if (name === 'core' || name.startsWith('core_')) {
return true;
}
return standardPlugins.indexOf(name) !== -1;
})
);
componentData.componentMapping = Object.fromEntries(
Object.entries(componentData.components).map(([path, name]) => [name, path])
);
}
return componentData;
};
/**
* Get the list of component paths.
*
* @param {string} relativeTo
* @returns {array}
*/
const getComponentPaths = (relativeTo = '') => fetchComponentData().pathList.map(componentPath => {
return componentPath.replace(relativeTo, '');
});
/**
* Get the list of paths to build AMD sources.
*
* @returns {Array}
*/
const getAmdSrcGlobList = () => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
globList.push(`${componentPath}/amd/src/*.js`);
globList.push(`${componentPath}/amd/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to build YUI sources.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getYuiSrcGlobList = relativeTo => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/yui/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to thirdpartylibs.xml.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getThirdPartyLibsList = relativeTo => {
const fs = require('fs');
const path = require('path');
return fetchComponentData().pathList
.map(componentPath => path.relative(relativeTo, componentPath) + '/thirdpartylibs.xml')
.map(componentPath => componentPath.replace(/\\/g, '/'))
.filter(path => fs.existsSync(path))
.sort();
};
/**
* Get the list of thirdparty library paths.
*
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
const libs = ['node_modules/', 'vendor/'];
const addLibToList = lib => {
if (!lib.match('\\*') && fs.statSync(lib).isDirectory()) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
};
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
const xmlContent = fs.readFileSync(file, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const nodes = xpath.select("/libraries/library/location/text()", doc);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
addLibToList(lib);
});
});
return libs;
};
/**
* Find the name of the component matching the specified path.
*
* @param {String} path
* @returns {String|null} Name of matching component.
*/
const getComponentFromPath = path => {
const componentList = fetchComponentData().components;
if (componentList.hasOwnProperty(path)) {
return componentList[path];
}
return null;
};
/**
* Check whether the supplied path, relative to the Gruntfile.js, is in a known component.
*
* @param {String} checkPath The path to check. This can be with either Windows, or Linux directory separators.
* @returns {String|null}
*/
const getOwningComponentDirectory = checkPath => {
const path = require('path');
// Fetch all components into a reverse sorted array.
// This ensures that components which are within the directory of another component match first.
const pathList = Object.keys(fetchComponentData().components).sort().reverse();
for (const componentPath of pathList) {
// If the componentPath is the directory being checked, it will be empty.
// If the componentPath is a parent of the directory being checked, the relative directory will not start with ..
if (!path.relative(componentPath, checkPath).startsWith('..')) {
return componentPath;
}
}
return null;
};
/**
* Get the latest tag in a remote GitHub repository.
*
* @param {string} url The remote repository.
* @returns {Array}
*/
const getRepositoryTags = async(url) => {
const gtr = require('git-tags-remote');
try {
const tags = await gtr.get(url);
if (tags !== undefined) {
return tags;
}
} catch (error) {
return [];
}
return [];
};
/**
* Get the list of thirdparty libraries that could be upgraded.
*
* @returns {Array}
*/
const getThirdPartyLibsUpgradable = async() => {
const libraries = getThirdPartyLibsData().filter((library) => !!library.repository);
const upgradableLibraries = [];
const versionCompare = (a, b) => {
if (a === b) {
return 0;
}
const aParts = a.split('.');
const bParts = b.split('.');
for (let i = 0; i < Math.min(aParts.length, bParts.length); i++) {
const aPart = parseInt(aParts[i], 10);
const bPart = parseInt(bParts[i], 10);
if (aPart > bPart) {
// 1.1.0 > 1.0.9
return 1;
} else if (aPart < bPart) {
// 1.0.9 < 1.1.0
return -1;
} else {
// Same version.
continue;
}
}
if (aParts.length > bParts.length) {
// 1.0.1 > 1.0
return 1;
}
// 1.0 < 1.0.1
return -1;
};
for (let library of libraries) {
upgradableLibraries.push(
getRepositoryTags(library.repository).then((tagMap) => {
library.version = library.version.replace(/^v/, '');
const currentVersion = library.version.replace(/moodle-/, '');
const currentMajorVersion = library.version.split('.')[0];
const tags = [...tagMap]
.map((tagData) => tagData[0])
.filter((tag) => !tag.match(/(alpha|beta|rc)/))
.map((tag) => tag.replace(/^v/, ''))
.sort((a, b) => versionCompare(b, a));
if (!tags.length) {
library.warning = "Unable to find any comparable tags.";
return library;
}
library.latestVersion = tags[0];
tags.some((tag) => {
if (!tag) {
return false;
}
// See if the version part matches.
const majorVersion = tag.split('.')[0];
if (majorVersion === currentMajorVersion) {
library.latestSameMajorVersion = tag;
return true;
}
return false;
});
if (versionCompare(currentVersion, library.latestVersion) > 0) {
// Moodle somehow has a newer version than the latest version.
library.warning = `Newer version found: ${currentVersion} > ${library.latestVersion} for ${library.name}`;
return library;
}
if (library.version !== library.latestVersion) {
// Delete version and add it again at the end of the array. That way, current and new will stay closer.
delete library.version;
library.version = currentVersion;
return library;
}
return null;
})
);
}
return (await Promise.all(upgradableLibraries)).filter((library) => !!library);
};
/**
* Get the list of thirdparty libraries.
*
* @returns {Array}
*/
const getThirdPartyLibsData = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const xpath = require('xpath');
const path = require('path');
const libraryList = [];
const libraryFields = [
'location',
'name',
'version',
'repository',
];
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
thirdpartyfiles.forEach(function(libraryPath) {
const xmlContent = fs.readFileSync(libraryPath, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const libraries = xpath.select("/libraries/library", doc);
for (const library of libraries) {
const libraryData = [];
for (const field of libraryFields) {
libraryData[field] = xpath.select(`${field}/text()`, library)?.toString();
}
libraryData.location = path.join(path.dirname(libraryPath), libraryData.location);
libraryList.push(libraryData);
}
});
return libraryList.sort((a, b) => a.location.localeCompare(b.location));
};
module.exports = {
fetchComponentData,
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
getOwningComponentDirectory,
getYuiSrcGlobList,
getThirdPartyLibsList,
getThirdPartyPaths,
getThirdPartyLibsUpgradable,
};
-19
View File
@@ -1,19 +0,0 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
-131
View File
@@ -1,131 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://moodledev.io",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
-138
View File
@@ -1,138 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import * as Components from '../../components.js';
const componentData = Components.fetchComponentData();
/**
* The standard components shipped with core Moodle.
*
* @type {Object}
*/
export const standardComponents = componentData.standardComponents;
/**
* All components of the current Moodle instance.
*
* @type {Object}
*/
export const allComponents = componentData.components;
/**
* Get all components of the current Moodle instance.
*
* @returns {Array}
*/
export const getAllComponents = () => {
let components = new Map(Object.entries(componentData.pluginTypes).map(([value, path]) => ([path,{
path,
value,
name: `${value} (plugin type)`,
}])));
Object
.entries(componentData.components)
.filter(([path, value]) => Object.values(componentData.standardComponents).includes(value))
.forEach(([path, value]) => {
const entry = {
path,
value,
name: value,
};
if (Object.values(componentData.subsystems).includes(value)) {
if (components.has(path)) {
entry.name = `${value} (subsystem / plugintype)`;
} else {
entry.name = `${value} (subsystem)`;
}
}
components.set(path, entry);
});
return Array.from(components.values());
};
/**
* Whether the specified component is a standard component shipped with core Moodle.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isStandardComponent = (componentName) => {
if (Object.values(componentData.standardComponents).includes(componentName)) {
return true;
}
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
return true;
}
return false;
};
export const rewritePlugintypeAsSubsystem = (componentName) => {
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
const pluginTypePath = componentData.pluginTypes[componentName];
if (Object.keys(componentData.subsystems).includes(pluginTypePath)) {
return true;
}
}
return false;
};
/**
* Whether the specified component is a community component.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isCommunityComponent = (componentName) => {
if (isStandardComponent(componentName)) {
return false;
}
return Object.values(componentData.components).indexOf(componentName) !== -1;
};
/**
* Sort method for components.
*
* This method sorts components putting `core` first, followed by core subsystems, then everything else.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortComponents = (a, b) => {
// Always put 'core' first.
if (a === 'core') {
return -1;
} else if (b === 'core') {
return 1;
}
// Put core subsystems next.
if (a.startsWith('core_') && !b.startsWith('core_')) {
return -1;
} else if (b.startsWith('core_') && !a.startsWith('core_')) {
return 1;
}
// Sort alphabetically for everything else.
return a.localeCompare(b);
};
-85
View File
@@ -1,85 +0,0 @@
#!/usr/bin/env node
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import inquirer from 'inquirer';
import chalk from 'chalk';
import { createNote } from './note.mjs';
import { getInitialValues } from './helpers.mjs';
import * as Prompts from './prompts.mjs';
import logger from './logger.mjs';
export default async (options) => {
// Processs the initial values.
const initialValues = getInitialValues(options);
// Fetch information.
const messages = [];
const { issueNumber } = await inquirer.prompt([
Prompts.getIssuePrompt(),
], initialValues);
let selection = {};
let notePath;
do {
selection = {};
selection = await inquirer.prompt([
Prompts.getComponentsPrompt(),
Prompts.getTypePrompt(),
Prompts.getMessagePromptInput(),
], initialValues);
if (selection.message === '') {
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getMessagePromptEditor(),
]),
);
}
logger.info(`
Creating upgrade note with the following options:
- Issue: ${chalk.bold(issueNumber)}
- Component: ${chalk.bold(selection.components)}
- Type: ${chalk.bold(selection.type)}
- Message:
${chalk.bold(selection.message)}
`);
messages.push({
components: [selection.components],
type: selection.type,
message: selection.message,
});
// Save the note so far.
if (notePath) {
await createNote(issueNumber, messages, notePath);
logger.info(`Updated note at: ${chalk.underline(chalk.bold(notePath))}`);
} else {
notePath = await createNote(issueNumber, messages);
logger.info(`Note created at: ${chalk.underline(chalk.bold(notePath))}`);
}
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getAddAnotherPrompt(),
], initialValues),
);
} while (selection.addAnother);
};
-357
View File
@@ -1,357 +0,0 @@
#!/usr/bin/env node
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import chalk from 'chalk';
import { getAllComponents } from './components.mjs';
import { getCombinedNotesByComponent, deleteAllNotes } from './note.mjs';
import { getNoteName } from './noteTypes.mjs';
import { writeFile, readFile, unlink } from 'fs/promises';
import { join as joinPath } from 'path';
import logger from './logger.mjs';
import { getCurrentVersion } from './helpers.mjs';
/**
* Helper to fetch the current notes from a file.
*
* @param {string} file
* @returns {Promise<string>}
*/
const getCurrentNotes = async (file) => {
try {
return await readFile(file, 'utf8');
} catch (error) {
return null;
}
}
/**
* Update the UPGRADING.md file.
*
* @param {string} upgradeNotes
* @param {Object} options
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
const updateUpgradeNotes = async (upgradeNotes, options) => {
const fileName = 'UPGRADING.md';
// Write the notes to a file.
logger.info(`Writing notes to ${chalk.underline(chalk.bold(fileName))}`);
// Prepend to the existing file.
const existingContent = await getCurrentNotes(fileName);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
// This should not normally happen.
await writeFile(fileName, upgradeNotes);
}
if (options.deleteNotes) {
logger.warn(`>>> Deleting all notes <<<`)
// Delete the notes.
deleteAllNotes();
}
};
/**
* Create the current summary notes.
*
* @param {string} upgradeNotes
* @returns {Promise<void>}
*/
const createCurrentSummary = async (upgradeNotes) => {
const fileName = 'UPGRADING-CURRENT.md';
const notes = `# Moodle upgrade notes\n\n${upgradeNotes}`;
await writeFile(fileName, notes);
logger.info(`Running upgrade notes written to ${chalk.underline(chalk.bold(fileName))}`);
};
/**
* Get the indexes of the lines that contain the version headings.
*
* @param {array<string>} lines
* @returns {array<object>}
*/
const getVersionLineIndexes = (lines) => {
const h2Indexes = [];
lines.forEach((line, index) => {
const matches = line.match(/^##\s(?<version>.*)$/);
if (matches) {
h2Indexes.push({
index,
line,
version: matches.groups.version,
});
}
});
return h2Indexes;
};
/**
* Find the index of the Unreleased heading.
*
* @param {array<object>} versionHeadings
* @returns {number}
*/
const findUnreleasedHeadingIndex = (versionHeadings) => versionHeadings.findIndex((heading) => {
if (heading.version === 'Unreleased') {
// Used if version cannot be guessed.
return true;
}
if (heading.version.endsWith('+')) {
// Weekly release for a stable branch.
return true;
}
if (heading.version.match(/beta|rc\d/)) {
// Beta and RC rolls are treated as weeklies.
return true;
}
if (heading.version.endsWith('dev')) {
// Development version.
return true;
}
return false;
});
/**
* Get the before and after content, to facilitate replacing any existing Unreleased notes.
*
* @param {array<string>} lines
* @returns {Object} {beforeContent: string, afterContent: string}
*/
const getBeforeAndAfterContent = (lines) => {
const existingLines = lines.split('\n');
const versionHeadings = getVersionLineIndexes(existingLines);
if (versionHeadings.length > 0) {
const unreleasedHeadingIndex = findUnreleasedHeadingIndex(versionHeadings);
if (unreleasedHeadingIndex !== -1) {
const beforeContent = existingLines.slice(0, versionHeadings[unreleasedHeadingIndex].index).join('\n');
if (versionHeadings.length > unreleasedHeadingIndex + 1) {
const afterContent = existingLines.slice(versionHeadings[unreleasedHeadingIndex + 1].index).join('\n');
return {
beforeContent,
afterContent,
};
}
return {
beforeContent,
afterContent: '',
};
}
return {
beforeContent: existingLines.slice(0, versionHeadings[0].index).join('\n'),
afterContent: existingLines.slice(versionHeadings[0].index).join('\n'),
};
}
return {
beforeContent: existingLines.join('\n'),
afterContent: '',
}
};
/**
* Get the notes for the component.
*
* @param {string} types
* @param {Number} headingLevel
* @returns {string}
*/
const getNotesForComponent = (types, headingLevel) => {
let upgradeNotes = '';
Object.entries(types).forEach(([type, notes]) => {
upgradeNotes += '#'.repeat(headingLevel);
upgradeNotes += ` ${getNoteName(type)}\n\n`;
notes.forEach(({ message, issueNumber }) => {
// Split the message into lines, removing empty lines.
const messageLines = message
.split('\n')
// Remove empty lines between tables, and list entries, but not after lists.
.filter((line, index, lines) => {
if (line.trim().length === 0) {
// This line is empty.
// If it's the first line in the file, remove it.
if (index === 0) {
return false;
}
// This is the last line in the file, remove it.
if (index === lines.length - 1) {
return false;
}
// If the previous line relates to a table, remove this line.
if (lines[index - 1].match(/^\s*\|/)) {
return false;
}
// If the next line is also empty, do not remove this line.
if (lines[index + 1].trim().length === 0) {
return true;
}
// Do not remove the line if the previous line was a list item.
if (lines[index - 1].match(/^\s*[-*]\s/)) {
return true;
}
if (lines[index - 1].match(/^\s*\d+\.\s/)) {
return true;
}
// Preserve all other empty lines by default.
return true;
}
// Keep any line which has content.
return true;
});
const firstLine = messageLines.shift().trim();
upgradeNotes += `- ${firstLine}\n`;
messageLines
.forEach((line) => {
upgradeNotes += ` ${line}`.trimEnd() + `\n`;
});
upgradeNotes += `\n For more information see [${issueNumber}](https://tracker.moodle.org/browse/${issueNumber})\n`;
});
upgradeNotes += '\n';
});
return upgradeNotes;
};
/**
* Get the updated notes mixed with existing content.
*
* @param {string} existingContent
* @param {string} upgradeNotes
*/
const getUpdatedNotes = (existingContent, upgradeNotes) => {
const { beforeContent, afterContent } = getBeforeAndAfterContent(existingContent);
const newContent = `${beforeContent}\n${upgradeNotes}\n${afterContent}`
.split('\n')
.filter((line, index, lines) => {
if (line === '' && lines[index - 1] === '') {
// Remove multiple consecutive empty lines.
return false;
}
return true;
})
.join('\n');
return newContent;
};
/**
* Update the notes for each component.
*/
const updateComponentNotes = (
notes,
version,
notesFileName = 'UPGRADING.md',
removeEmpty = false,
) => {
return getAllComponents().map(async (component) => {
logger.verbose(`Updating notes for ${component.name} into ${component.path}`);
const fileName = joinPath(component.path, notesFileName);
const existingContent = await getCurrentNotes(fileName);
if (!existingContent) {
if (!notes[component.value]) {
// No existing notes, and no new notes to add.
return;
}
} else {
if (!notes[component.value]) {
// There is existing content, but nothing to add.
if (removeEmpty) {
logger.verbose(`Removing empty notes file ${fileName}`);
await unlink(fileName);
}
return;
}
}
const componentNotes = notes[component.value];
let upgradeNotes = `## ${version}\n\n`;
upgradeNotes += getNotesForComponent(componentNotes, 3);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
await writeFile(
fileName,
`# ${component.name} Upgrade notes\n\n${upgradeNotes}`,
);
}
});
}
/**
* Generate the upgrade notes for a new release.
*
* @param {string|undefined} version
* @param {Object} options
* @param {boolean} options.generateUpgradeNotes
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
export default async (version, options = {}) => {
const notes = await getCombinedNotesByComponent();
if (Object.keys(notes).length === 0) {
logger.warn('No notes to generate');
return;
}
if (!version) {
version = await getCurrentVersion();
}
// Generate the upgrade notes for this release.
// We have
// - a title with the release name
// - the change types
// - which contain the components
// - which document each change
let upgradeNotes = `## ${version}\n\n`;
Object.entries(notes).forEach(([component, types]) => {
upgradeNotes += `### ${component}\n\n`;
upgradeNotes += getNotesForComponent(types, 4);
});
await Promise.all([
createCurrentSummary(upgradeNotes),
...updateComponentNotes(notes, version, 'UPGRADING-CURRENT.md', true),
]);
if (options.generateUpgradeNotes) {
await Promise.all(updateComponentNotes(notes, version));
await updateUpgradeNotes(upgradeNotes, options);
}
};
-230
View File
@@ -1,230 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import chalk from 'chalk';
import { isStandardComponent, isCommunityComponent, rewritePlugintypeAsSubsystem } from './components.mjs';
import { isValidNoteName } from './noteTypes.mjs';
import logger from './logger.mjs';
import { readFile } from 'fs/promises';
/**
* Validate an issue number input
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateIssueNumber = (input) => {
if (!input) {
return 'You must provide a tracker issue number';
}
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return true;
}
if (input.match(/^\d+$/)) {
return true;
}
return 'The issue number was not recognised as a valid issue number';
};
/**
* Format an issue number input.
*
* @param {string} input
* @returns {string}
*/
export const formatIssueNumber = (input) => {
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return input;
}
if (input.match(/^\d+$/)) {
return `MDL-${input}`;
}
return input;
};
/**
* Validate a component.
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateComponent = (input) => {
if (isStandardComponent(input)) {
return true;
}
if (isCommunityComponent(input)) {
return 'Currently only core plugins are supported.';
}
return 'The component was not recognised as a standard component';
};
export const formatComponent = (input) => {
if (rewritePlugintypeAsSubsystem(input)) {
return `core_${input}`;
}
return input;
}
/**
* Get the initial values from the options.
*
* @param {object} options
* @returns {object}
*/
export const getInitialValues = (options) => {
const initialValues = {};
const type = getInitialTypeValue(options);
if (type) {
initialValues.type = type;
}
const issueNumber = getInitialIssueValue(options);
if (issueNumber) {
initialValues.issueNumber = issueNumber;
}
const component = getInitialComponentValue(options);
if (component) {
initialValues.components = component;
}
const message = getInitialMessageValue(options);
if (message) {
initialValues.message = message
initialValues.addAnother = false;
}
return initialValues;
};
/**
* Get the initial type value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialTypeValue = (options) => {
if (!options.type) {
return;
}
options.type = options.type.trim().toLowerCase();
if (isValidNoteName(options.type)) {
return options.type;
}
logger.warn(`Note type "${chalk.underline(chalk.red(options.type))}" is not valid.`);
};
/**
* Get the initial issue number value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialIssueValue = (options) => {
if (!options.issue) {
return;
}
options.issue = options.issue.trim().toUpperCase();
const issueNumberValidated = validateIssueNumber(options.issue);
if (issueNumberValidated === true) {
const issueNumber = formatIssueNumber(options.issue);
if (issueNumber !== options.issue) {
logger.warn(
`Issue number "${chalk.underline(chalk.red(options.issue))}" was updated to ` +
`"${chalk.underline(chalk.green(issueNumber))}"`
);
}
return issueNumber;
} else {
logger.warn(`Issue number "${chalk.underline(chalk.red(options.issue))}" is not valid: ${issueNumberValidated}`);
}
};
/**
* Get the initial component value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialComponentValue = (options) => {
if (!options.component) {
return;
}
options.component = options.component.trim().toLowerCase();
const componentValidated = validateComponent(options.component);
if (componentValidated === true) {
const component = formatComponent(options.component);
if (component !== options.component) {
logger.warn(
`Component "${chalk.underline(chalk.red(options.component))}" was updated to ` +
`"${chalk.underline(chalk.green(component))}"`
);
}
return component;
} else {
logger.warn(`Component "${chalk.underline(chalk.red(options.component))}" is not valid: ${componentValidated}`);
}
};
/**
* Get the initial message value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialMessageValue = (options) => {
if (!options.message) {
return;
}
return options.message.trim();
};
/**
* Get the current version from the project /version.php file.
*
* @returns {Promise<string>}
*/
export const getCurrentVersion = async () => {
const versionRegex = new RegExp(/^ *\$release *= *['\"](?<release>[^ \+]+\+?) *\(Build:.*/m);
try {
const versionFile = await readFile('version.php', 'utf8');
const match = versionFile.match(versionRegex);
if (match) {
return match.groups.release;
}
} catch(error) {
logger.error('Unable to read the version file');
}
return "Unreleased";
}
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env node
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
),
transports: [
new winston.transports.Console(),
],
});
export default logger;
-194
View File
@@ -1,194 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import yaml from 'js-yaml';
import path from 'path';
import { writeFile, mkdir, readdir, readFile, unlink } from 'fs/promises';
import { isValidNoteName, sortNoteTypes } from './noteTypes.mjs';
import { sortComponents } from './components.mjs';
const unreleasedPath = path.resolve('.upgradenotes');
/**
* Get the filename for the note.
*
* @param {string} issueNumnber The issue number
* @returns {string}
*/
const getFilename = (issueNumber) => {
const dateTimeFormat = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
fractionalSecondDigits: 2,
timeZone: 'UTC',
});
const date = Object.fromEntries(
dateTimeFormat.formatToParts(new Date())
.filter((p) => p.type !== 'literal')
.map((p) => ([p.type, p.value]))
);
const dateString = [
date.year,
date.month,
date.day,
date.hour,
date.minute,
date.second,
date.fractionalSecond,
].join('');
return `${issueNumber}-${dateString}.yml`;
};
/**
* Create a new note.
*
* @param {string} issueNumber
* @param {[type: string]: {message: string}} messages
* @returns {string} The path to the note on disk
*/
export const createNote = async (
issueNumber,
messages,
notePath,
) => {
const note = {
issueNumber,
notes: {},
};
messages.forEach(({components, type, message}) => {
note.notes[components] = note.notes[components] || [];
note.notes[components].push({message, type});
});
if (!notePath) {
notePath = path.resolve(unreleasedPath, getFilename(issueNumber));
}
const noteContent = yaml.dump(note);
await mkdir(unreleasedPath, {recursive: true});
await writeFile(notePath, noteContent);
return notePath;
};
/**
* Get all unreleased notes.
*
* @returns {Promise<{issueNumber: string, components: string[], types: {[type: string]: {message: string}[]}}[]>
*/
export const getAllNotes = async () => {
const files = await readdir(unreleasedPath);
const notes = files
.filter((file) => file.endsWith('.yml'))
.map(async (file) => {
const filePath = path.resolve(unreleasedPath, file);
const fileContent = await readFile(filePath, 'utf8');
return {
...yaml.load(fileContent),
filePath,
};
});
return Promise.all(notes);
};
/**
* Get the list of notes, grouped by note type, then component.
*
* @returns {Promise<{[type: string]: {[components: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotes = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([components, data]) => {
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[entry.type] = combinedNotes[entry.type] || {};
combinedNotes[entry.type][components] = combinedNotes[entry.type][components] || [];
combinedNotes[entry.type][components].push({message: entry.message, issueNumber: note.issueNumber});
});
});
});
return combinedNotes;
};
/**
* Get the list of notes, grouped by component, then by note type.
*
* @returns {Promise<{[component: string]: {[type: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotesByComponent = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([component, data]) => {
combinedNotes[component] = combinedNotes[component] || {};
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[component][entry.type] = combinedNotes[component][entry.type] || [];
combinedNotes[component][entry.type].push({
component,
message: entry.message,
issueNumber: note.issueNumber,
type: entry.type,
});
});
});
});
// Sort notes by note type.
Object.entries(combinedNotes).forEach(([component, types]) => {
combinedNotes[component] = Object.fromEntries(
Object.entries(types).sort(([a], [b]) => sortNoteTypes(a, b))
);
});
// Sort components.
return Object.fromEntries(
Object.entries(combinedNotes).sort(([a], [b]) => sortComponents(a, b))
);
};
/**
* Delete all unreleased notes.
*
* @returns {Promise<void>}
*/
export const deleteAllNotes = async () => {
const files = await readdir(unreleasedPath);
return Promise.all(
files
.filter((item, index) => files.indexOf(item) === index)
.filter((file) => file.endsWith('.yml'))
.map((file) => unlink(`${unreleasedPath}/${file}`))
);
};
-80
View File
@@ -1,80 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* The note types.
*
* Matches the suggested order in https://keepachangelog.com/en/1.1.0/.
* @type {Object<string, string>}
*/
const noteTypes = {
'improved': 'Added',
'changed': 'Changed',
'deprecated': 'Deprecated',
'removed': 'Removed',
'fixed': 'Fixed',
};
/**
* The preferred order of note types.
*
* @type {string[]}
*/
const preferredOrder = Object.keys(noteTypes);
/**
* Comparison method to sort note types.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortNoteTypes = (a, b) => {
const aIndex = preferredOrder.indexOf(a);
const bIndex = preferredOrder.indexOf(b);
if (aIndex === -1) {
return 1;
}
if (bIndex === -1) {
return -1;
}
return aIndex - bIndex;
};
/**
* Get the note names.
*
* @returns {string[]}
*/
export const getNoteNames = () => Object.keys(noteTypes);
/**
* Get the human-readable note name.
*
* @param {string} type
* @returns {string}
*/
export const getNoteName = (type) => noteTypes[type];
/**
* Whether the note name is valid.
*
* @param {string} type
* @returns {boolean}
*/
export const isValidNoteName = (type) => noteTypes[type] !== undefined;
-153
View File
@@ -1,153 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import inquirer from 'inquirer';
import SearchList from 'inquirer-search-list';
import { getNoteNames } from './noteTypes.mjs';
import { getAllComponents } from './components.mjs';
import {
formatComponent,
formatIssueNumber,
validateComponent,
validateIssueNumber,
} from './helpers.mjs';
/**
* A Search List which accepts an initial value.
*/
class SearchListWithInitialValue extends SearchList {
constructor(options, ...args) {
super(options, ...args);
if (options.default) {
const pointer = this.filterList.findIndex((item) => {
return item.value === options.default;
});
if (pointer > -1) {
this.pointer = pointer;
}
}
}
}
inquirer.registerPrompt('search-list', SearchListWithInitialValue);
/**
* Get the issue type prompt.
*
* @param {string} defaultData The initially selected value
* @returns {Object}
*/
export const getTypePrompt = (defaultData) => ({
default: defaultData,
type: 'search-list',
message: 'Type of change',
name: 'type',
choices: getNoteNames(),
validate: (selection) => {
if (selection.length < 1) {
return 'You must select at least one type of change';
}
return true;
},
});
/**
* Get the component prompt.
*
* @param {string} [defaultValue='core'] The initally selected value.
* @returns
*/
export const getComponentsPrompt = (defaultValue) => {
if (!defaultValue ) {
defaultValue = 'core';
}
return {
choices: getAllComponents(),
default: defaultValue,
type: 'search-list',
message: 'Component',
name: 'components',
validate: validateComponent,
filter: formatComponent,
};
};
/**
* Get the issue number prompt as an inline input.
*
* @param {string} defaultData
* @returns {object}
*/
export const getIssuePrompt = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Tracker issue number',
name: 'issueNumber',
validate: validateIssueNumber,
filter: formatIssueNumber,
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptEditor = (defaultData) => ({
default: defaultData,
type: process.stdin.isTTY ? 'editor' : 'input',
postfix: '.md',
message: 'Message',
name: 'message',
waitUserInput: false,
validate: (input) => {
if (!input) {
return 'You must provide a message';
}
return true;
},
// Remove any trailing whitespace.
filter: (input) => input.split('\n').map((line) => line.trimEnd()).join('\n'),
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptInput = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Message (leave empty to use editor)',
name: 'message',
filter: (input) => input.trim(),
});
/**
* Get a prompt to ask the user if they wish to add another entry.
*
* @returns {Object}
*/
export const getAddAnotherPrompt = () => ({
type: 'confirm',
message: 'Do you want to add another note?',
default: false,
name: 'addAnother',
});
-142
View File
@@ -1,142 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* Component Library build tasks.
*
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get a child path of the component library.
*
* @param {string} path
* @returns {string}
*/
const getCLPath = path => `admin/tool/componentlibrary/${path}`;
/**
* Get a spawn handler.
*
* This is a generic function to write the spawn output, and then to exit if required and mark the async task as
* complete.
*
* @param {Promise} done
* @returns {function}
*/
const getSpawnHandler = done => (error, result, code) => {
grunt.log.write(result);
if (error) {
grunt.log.error(result.stdout);
process.exit(code);
}
done();
};
/**
* Spawn a function against Node with the provided args.
*
* @param {array} args
* @returns {object}
*/
const spawnNodeCall = (args) => grunt.util.spawn({
cmd: 'node',
args,
}, getSpawnHandler(grunt.task.current.async()));
/**
* Build the docs using Hugo.
*
* @returns {Object} Reference to the spawned task
*/
const docsBuild = () => spawnNodeCall([
'node_modules/hugo-bin/cli.js',
'--config', getCLPath('config.yml'),
'--cleanDestinationDir',
]);
/**
* Build the docs index using the hugo-lunr-indexer.
*
* @returns {Object} Reference to the spawned task
*/
const indexBuild = () => spawnNodeCall([
'node_modules/hugo-lunr-indexer/bin/hli.js',
'-i', getCLPath('content/**'),
'-o', getCLPath('hugo/site/data/my-index.json'),
'-l', 'yaml',
'-d', '---',
]);
/**
* Build the hugo CSS.
*
* @returns {Object} Reference to the spawned task
*/
const cssBuild = () => spawnNodeCall([
'node_modules/sass/sass.js',
'--style', 'expanded',
'--source-map',
'--embed-sources',
'--precision', 6,
'--load-path', process.cwd(),
getCLPath('hugo/scss/docs.scss'),
getCLPath('hugo/dist/css/docs.css'),
]);
// Register the various component library tasks.
grunt.registerTask('componentlibrary:docsBuild', 'Build the component library', docsBuild);
grunt.registerTask('componentlibrary:cssBuild', 'Build the component library', cssBuild);
grunt.registerTask('componentlibrary:indexBuild', 'Build the component library', indexBuild);
grunt.registerTask('componentlibrary', 'Build the component library', [
'componentlibrary:docsBuild',
'componentlibrary:cssBuild',
'componentlibrary:indexBuild',
]);
grunt.config.merge({
watch: {
componentLibraryDocs: {
files: [
getCLPath('content/**/*.md'),
getCLPath('hugo'),
],
tasks: ['componentlibrary:docsBuild', 'componentlibrary:indexBuild'],
},
componentLibraryCSS: {
files: [
getCLPath('hugo/scss/**/*.scss'),
'hugo',
],
tasks: ['componentlibrary:cssBuild'],
},
},
});
// Add the 'componentlibrary' task as a startup task.
grunt.moodleEnv.startupTasks.push('componentlibrary');
return {
docsBuild,
cssBuild,
indexBuild,
};
};
-64
View File
@@ -1,64 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const files = grunt.moodleEnv.files;
// Project configuration.
grunt.config.merge({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
// Check AMD src files.
amd: {src: files ? files : grunt.moodleEnv.amdSrc},
// Check YUI module source files.
yui: {src: files ? files : grunt.moodleEnv.yuiSrc},
},
});
grunt.loadNpmTasks('grunt-eslint');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
};
-92
View File
@@ -1,92 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (grunt.moodleEnv.files) {
// Specific files were requested. Only check these.
return grunt.moodleEnv.files;
}
if (grunt.moodleEnv.inComponent) {
return [`${grunt.moodleEnv.runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
const handler = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', handler);
grunt.config.set('gherkinlint', {
options: {
files: getGherkinLintTargets(),
}
});
grunt.config.merge({
watch: {
gherkinlint: {
files: [grunt.moodleEnv.inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint'],
},
},
});
// Add the 'gherkinlint' task as a startup task.
grunt.moodleEnv.startupTasks.push('gherkinlint');
return handler;
};
-139
View File
@@ -1,139 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Extracts ignore entries from a local ignore file.
*
* @param {string} componentPath the file path to the component, relative to the code base directory
* @param {string} ignoreFilePath the path to the ignore file
* @return {array} array of ignore paths to be included in the global ignore files
*/
const getEntriesFromLocalIgnoreFile = (componentPath, ignoreFilePath) => {
const ignorePaths = [];
if (grunt.file.exists(ignoreFilePath)) {
const ignoreFile = grunt.file.read(ignoreFilePath);
const entries = ignoreFile.split('\n');
entries.forEach(entry => {
entry = entry.trim();
if (entry.length > 0 && !entry.startsWith('#') && !entry.startsWith('!')) {
while (entry.startsWith('/')) {
entry = entry.substring(1);
}
ignorePaths.push(componentPath + '/' + entry);
}
});
}
return ignorePaths;
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of paths to third party directories.
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const localStylelintIgnorePaths = [];
const localEslintIgnorePaths = [];
ComponentList.getComponentPaths(process.cwd() + '/').forEach(componentPath => {
const localEslintIgnorePath = process.cwd() + '/' + componentPath + '/.eslintignore';
const localEslintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localEslintIgnorePath);
if (localEslintIgnoreEntries.length > 0) {
localEslintIgnorePaths.push(...localEslintIgnoreEntries);
}
const localStylelintIgnorePath = process.cwd() + '/' + componentPath + '/.stylelintignore';
const localStylelintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localStylelintIgnorePath);
if (localStylelintIgnoreEntries.length > 0) {
localStylelintIgnorePaths.push(...localStylelintIgnoreEntries);
}
});
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
// Do not ignore the .grunt directory.
'!/.grunt',
// Ignore all yui/src meta directories and build directories.
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths).concat(localEslintIgnorePaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
'admin/tool/componentlibrary/hugo/dist/css/docs.css',
].concat(thirdPartyPaths).concat(localStylelintIgnorePaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
return handler;
};
-215
View File
@@ -1,215 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Function to generate the destination for the minification task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace(`amd/src`, `amd/build`);
destPath = destPath.replace(/\.js$/, '.min.js');
return destPath;
};
module.exports = grunt => {
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load jsconfig.
require('./jsconfig')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
grunt.log.debug(`Item resolved. Kicking off next one.`);
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async(options) => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
return options;
});
},
// When an item in the queue completes, start the next item in the queue.
generateBundle: (options, bundle) => {
grunt.log.debug(`Finished output phase for ${Object.keys(bundle).join(', ')}`);
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
grunt.config.merge({
rollup: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit(),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js')
],
presets: [
['@babel/preset-env', {
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}],
},
},
});
grunt.config.merge({
watch: {
amd: {
files: grunt.moodleEnv.inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
},
});
// Add the 'js' task as a startup task.
grunt.moodleEnv.startupTasks.push('js');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('rollup.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
return {
babelRename,
};
};
-53
View File
@@ -1,53 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2022 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const configuration = {
compilerOptions: {
baseUrl: ".",
paths: {
},
target: "es2015",
allowSyntheticDefaultImports: false,
},
exclude: [
"node_modules",
],
include: [],
};
module.exports = (grunt) => {
const handler = () => {
const jsconfigData = Object.assign({}, configuration);
const path = require('path');
const {fetchComponentData} = require(path.join(process.cwd(), '.grunt', 'components.js'));
const componentData = fetchComponentData().components;
for (const [thisPath, component] of Object.entries(componentData)) {
jsconfigData.compilerOptions.paths[`${component}/*`] = [`${thisPath}/amd/src/*`];
jsconfigData.include.push(`${thisPath}/amd/src/**/*`);
}
grunt.file.write('jsconfig.json', JSON.stringify(jsconfigData, null, " ") + "\n");
};
grunt.registerTask('jsconfig', 'Generate a jsconfig configuration compatible with the LSP', handler);
};
-52
View File
@@ -1,52 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = (grunt) => {
const path = require('path');
grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}
if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
});
};
-40
View File
@@ -1,40 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
grunt.loadNpmTasks('grunt-sass');
grunt.config.merge({
sass: {
dist: {
files: {
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss",
"theme/classic/style/moodle.css": "theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: require('sass'),
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
}
},
});
};
-155
View File
@@ -1,155 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
module.exports = grunt => {
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
const handler = function() {
const done = this.async();
const options = grunt.config('shifter.options');
const async = require('async');
const path = require('path');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(process.cwd() + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
// Register the shifter task.
grunt.registerTask('shifter', 'Run Shifter against the current directory', handler);
// Configure it.
grunt.config.set('shifter', {
options: {
recursive: true,
// Shifter takes a relative path.
paths: grunt.moodleEnv.files ? grunt.moodleEnv.files : [grunt.moodleEnv.runDir]
}
});
grunt.config.merge({
watch: {
yui: {
files: grunt.moodleEnv.inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
return handler;
};
-46
View File
@@ -1,46 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
// Are we in a YUI directory?
if (path.basename(path.resolve(grunt.moodleEnv.cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (grunt.moodleEnv.inAMD) {
grunt.task.run('amd');
} else {
// Run all of the requested startup tasks.
grunt.moodleEnv.startupTasks.forEach(taskName => grunt.task.run(taskName));
}
};
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', handler);
return handler;
};
-35
View File
@@ -1,35 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
// Load the SASS tasks.
require('./sass')(grunt);
// Add the 'css' task as a startup task.
grunt.moodleEnv.startupTasks.push('css');
};
-187
View File
@@ -1,187 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
quietDeprecationWarnings: true,
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
};
};
const getScssConfigForFiles = files => {
return {
stylelint: {
scss: {
options: {
quietDeprecationWarnings: true,
customSyntax: 'postcss-scss',
},
src: files,
},
},
};
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = () => {
const glob = require('glob');
// The stylelinters do not handle the case where a configuration was provided but no files were included.
// Keep track of whether any files were found.
let hasCss = false;
let hasScss = false;
// The stylelint processors do not take a path argument. They always check all provided values.
// As a result we must check through each glob and determine if any files match the current directory.
const scssFiles = [];
const cssFiles = [];
const requestedFiles = grunt.moodleEnv.files;
if (requestedFiles) {
// Grunt was called with a files argument.
// Check whether each of the requested files matches either the CSS or SCSS source file list.
requestedFiles.forEach(changedFilePath => {
let matchesGlob;
// Check whether this watched path matches any watched SCSS file.
matchesGlob = grunt.moodleEnv.scssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
scssFiles.push(changedFilePath);
hasScss = true;
}
// Check whether this watched path matches any watched CSS file.
matchesGlob = grunt.moodleEnv.cssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
cssFiles.push(changedFilePath);
hasCss = true;
}
});
} else {
// Grunt was called without a list of files.
// The start directory (runDir) may be a child dir of the project.
// Check each scssSrc file to see if it's in the start directory.
// This means that we can lint just mod/*/styles.css if started in the mod directory.
grunt.moodleEnv.scssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
scssFiles.push(path);
hasScss = true;
}
});
grunt.moodleEnv.cssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
cssFiles.push(path);
hasCss = true;
}
});
}
// Register the tasks.
const scssTasks = ['sass'];
if (hasScss) {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
}
// The tasks must be registered, even if empty to ensure a consistent command list.
// They jsut won't run anything.
grunt.registerTask('scss', scssTasks);
grunt.registerTask('rawcss', cssTasks);
};
// Register CSS tasks.
grunt.loadNpmTasks('grunt-stylelint');
// Register the style lint tasks.
registerStyleLintTasks();
grunt.registerTask('css', ['scss', 'rawcss']);
const getCoreThemeMatches = () => {
const scssMatch = 'scss/**/*.scss';
if (grunt.moodleEnv.inTheme) {
return [scssMatch];
}
if (grunt.moodleEnv.runDir.startsWith('theme')) {
return [`*/${scssMatch}`];
}
return [`theme/*/${scssMatch}`];
};
// Add the watch configuration for rawcss, and scss.
grunt.config.merge({
watch: {
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
scss: {
files: getCoreThemeMatches(),
tasks: ['scss']
},
},
});
};
-42
View File
@@ -1,42 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2023 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate upgradable third-party libraries (utilising thirdpartylibs.xml data)
*/
grunt.registerTask('upgradablelibs', 'Generate upgradable third-party libraries', async function() {
const done = this.async();
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of third party libraries that have a newer version in their repositories.
const thirdPartyLibs = await ComponentList.getThirdPartyLibsUpgradable({progress: true});
for (let library of thirdPartyLibs) {
grunt.log.ok(JSON.stringify(Object.assign({}, library), null, 4));
}
done();
});
};
-272
View File
@@ -1,272 +0,0 @@
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
/* eslint-env node */
module.exports = grunt => {
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
const watchHandler = function() {
const async = require('async');
const watchTaskDone = this.async();
let watchInitialised = false;
let watchTaskQueue = {};
let processingQueue = false;
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: grunt.moodleEnv.fullRunDir,
stdio: 'inherit'
},
args: [task, filesOption]
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = grunt.moodleEnv.fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(grunt.moodleEnv.gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', grunt.moodleEnv.fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + grunt.moodleEnv.fullRunDir);
});
});
});
};
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register the new watch handler.
grunt.registerTask('watch', 'Run tasks on file changes', watchHandler);
grunt.config.merge({
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
},
});
return watchHandler;
};
-103
View File
@@ -1,103 +0,0 @@
#!/usr/bin/env node
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import { Argument, Option, program } from 'commander';
import chalk from 'chalk';
import { getNoteNames } from './notes/src/noteTypes.mjs';
import createAction from './notes/src/create.mjs';
import generateAction from './notes/src/generate.mjs';
import logger from './notes/src/logger.mjs';
console.log(`
${chalk.bold(chalk.underline(chalk.green('Moodle Upgrade Notes Generator')))}
This tool is used to generate the upgrade notes for changes you make in Moodle.
Please remember that the intended audience of these changes is
${chalk.italic('plugin developers')} who need to know how to update their plugins
for a new Moodle version.
Upgrade notes should not be used to document changes for site administrators, or
for internal API changes which are not expected to be used outside of the
relevant component.
`)
program.configureHelp({
helpWidth: 100,
});
program.on('option:verbose', () => {
logger.level = 'verbose';
});
program.addOption(
new Option(
'-v, --verbose',
'Output more information during the generation process',
)
.default(false)
);
// Define the command line options.
program
.command('create')
.summary('Generate a new upgrade note')
.addOption(
new Option('-t, --type <type>', `The type of change to document. Valid types are: ${getNoteNames().join(', ')}`)
)
.addOption(new Option('-i, --issue <issue>', 'The tracker issue number'))
.addOption(new Option('-c, --component <component>', 'The component to write a note for'))
.addOption(new Option(
'-m, --message <message>',
'The message to use for the upgrade note',
))
.action((options) => createAction(options));
program
.command('summary')
.summary('Generate a local copy of the upgrade notes summary')
.addArgument(
new Argument('[version]', 'The Moodle version to create the summary notes for')
)
.action((version) => generateAction(version));
program
.command('release')
.summary('Generate the markdown copies of the upgrade notes for a Moodle release')
.addArgument(
new Argument('[version]', 'The Moodle version to create the release notes for')
)
.addOption(
new Option(
'--generate-upgrade-notes',
'Generate the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.',
)
.default(true)
)
.addOption(
new Option(
'-d, --delete-notes',
'Delete the notes after generating the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.' +
'This option has no effect unless --generate-upgrade-notes is also set.'
)
.default(false)
)
.action((version, options) => generateAction(version, options));
program.parse();
-2
View File
@@ -1,2 +0,0 @@
**/amd/**
/*.js
-58
View File
@@ -1,58 +0,0 @@
// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
// here because shifter uses jshint after modules have been concating. Eslint can't
// currently do this.
{
"asi": false,
"bitwise": true,
"boss": false,
"browser": true,
"curly": true,
"debug": false,
"eqeqeq": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"forin": false,
"funcscope": false,
"globalstrict": false,
"immed": true,
"indent": 4,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"maxerr": 500,
"maxlen": 132,
"multistr": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onecase": false,
"onevar": false,
"passfail": false,
"plusplus": false,
"predef": [
"M",
"define",
"require"
],
"proto": false,
"regexdash": false,
"regexp": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false,
"yui": true
}
-1
View File
@@ -1 +0,0 @@
lts/jod
-40
View File
@@ -1,40 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper file for PhpStorm, and other IDEs, to provide better code completion.
*
* @package core
* @copyright 2024 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace PHPSTORM_META;
// Assume that anything returned by \core\di::get('...') is an instance of the first argument.
override(\core\di::get(0), map([
'' => '@',
]));
// Assume that anything returned by \Psr\Container\ContainerInterface::get('...') is an instance of the first argument.
override(\Psr\Container\ContainerInterface::get(0), map([
'' => '@',
]));
// Assume that anything returned by \DI\Container::get('...') is an instance of the first argument.
override(\DI\Container::get(0), map([
'' => '@',
]));
-5
View File
@@ -1,5 +0,0 @@
{
"coverage": false,
"lint": "config",
"clean": true
}
-107
View File
@@ -1,107 +0,0 @@
{
"customSyntax": "postcss-scss",
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": {
"syntaxExtensions": [
"sass"
]
},
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": ["lower", { "severity": "warning" }],
"color-hex-length": ["short", { "severity": "warning" }],
"color-no-invalid-hex": true,
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-no-important": true,
"font-family-no-duplicate-names": true,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-disallowed-list": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": [true, { "severity": "warning" }],
"max-empty-lines": 2,
"max-line-length": [132, { "severity": "warning" }],
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": [true, { "severity": "warning" }],
"no-invalid-double-slash-comments": true,
"no-unknown-animations": true,
"property-case": "lower",
"property-no-unknown": true,
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-disallowed-list": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
},
"overrides": [
{
"files": ["**/yui/**/*.css"],
"rules": {
}
}
]
}
-52
View File
@@ -1,52 +0,0 @@
# Contributing to Moodle
[Moodle][1] is made by people like you. We are members of a big worldwide community of developers, designers, teachers, testers, translators and many more. We work in universities, schools, companies and other places. You are very welcome to join us and contribute to the project.
There are many ways that you can contribute to Moodle, not just through development. See our [community contribution guide][2] for some of the many ways that you can help.
## Github
> [!NOTE]
> Please do not open pull requests via Github.
All issues should be reported via, and patched provided to the [Moodle Tracker][3].
The Moodle [Github][4] repository is a clone of the official Moodle repository, whcih can be found at https://git.moodle.org.
## Moodle core bug fixes and new features
Over the years, Moodle has developed a mature process for reporting, reviewing, and accepting patches. This is fully documented in our [documentation on development processes][6], but in summary:
- Every bug fix or new feature must have a tracker issue.
- You publish the branch implementing the fix or new feature in your public clone of the moodle.git repository (typically on Github).
- Your patch is peer-reviewed, discussed, integrated, tested and then released as a part of one of our weekly releases.
- New features are developed on the `main` branch. Bug fixes are also backported to currently supported maintenance (stable) branches.
> [!IMPORTANT]
> Please do not publish security issues, or patches releating to them publicly.
> See our [Responsible Disclosure Policy][5] for more information.
## Moodle plugins
Moodle has a framework for additional plugins to extend its functionality. We
have a Moodle plugins directory <https://moodle.org/plugins/> where you can
register and maintain your plugin. Plugins hosted in the plugins directory can
be easily installed and updated via the Moodle administration interface.
* You are expected to have a public source code repository with your plugin
code.
* After registering your plugin in the plugins directory it is reviewed before
being published.
* You are expected to continuously release updated versions of the plugin via
the plugins directory. We do not pull from your code repository; you must do
it explicitly.
For further details, see <https://moodledev.io/general/community/plugincontribution>.
[1]: https://moodle.org
[2]: https://moodledev.io/general/community/contribute
[3]: https://tracker.moodle.org
[4]: https://github.com/moodle/moodle
[5]: https://moodledev.io/general/development/process/security
[6]: https://moodledev.io/general/development/process
-267
View File
@@ -1,267 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* Grunt configuration for Moodle.
*
* @copyright 2014 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Setup the Grunt Moodle environment.
*
* @param {Grunt} grunt
* @returns {Object}
*/
const setupMoodleEnvironment = grunt => {
const fs = require('fs');
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
const getAmdConfiguration = () => {
// If the cwd is the amd directory in the current component then it will be empty.
// If the cwd is a child of the component's AMD directory, the relative directory will not start with ..
let inAMD = !path.relative(`${componentDirectory}/amd`, cwd).startsWith('..');
// Globbing pattern for matching all AMD JS source files.
let amdSrc = [];
if (inComponent) {
amdSrc.push(
componentDirectory + "/amd/src/*.js",
componentDirectory + "/amd/src/**/*.js"
);
} else {
amdSrc = ComponentList.getAmdSrcGlobList();
}
return {
inAMD,
amdSrc,
};
};
const getYuiConfiguration = () => {
let yuiSrc = [];
if (inComponent) {
yuiSrc.push(componentDirectory + "/yui/src/**/*.js");
} else {
yuiSrc = ComponentList.getYuiSrcGlobList(gruntFilePath + '/');
}
return {
yuiSrc,
};
};
const getStyleConfiguration = () => {
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// Build the cssSrc and scssSrc.
// Valid paths are:
// [component]/styles.css; and either
// [theme/[themename]]/scss/**/*.scss; or
// [theme/[themename]]/style/*.css.
//
// If a theme has scss, then it is assumed that the style directory contains generated content.
let cssSrc = [];
let scssSrc = [];
const checkComponentDirectory = componentDirectory => {
const isTheme = componentDirectory.startsWith('theme/');
if (isTheme) {
const scssDirectory = `${componentDirectory}/scss`;
if (fs.existsSync(scssDirectory)) {
// This theme has an SCSS directory.
// Include all scss files within it recursively, but do not check for css files.
scssSrc.push(`${scssDirectory}/*.scss`);
scssSrc.push(`${scssDirectory}/**/*.scss`);
} else {
// This theme has no SCSS directory.
// Only hte CSS files in the top-level directory are checked.
cssSrc.push(`${componentDirectory}/style/*.css`);
}
} else {
// This is not a theme.
// All other plugin types are restricted to a single styles.css in their top level.
cssSrc.push(`${componentDirectory}/styles.css`);
}
};
if (inComponent) {
checkComponentDirectory(componentDirectory);
} else {
ComponentList.getComponentPaths(`${gruntFilePath}/`).forEach(componentPath => {
checkComponentDirectory(componentPath);
});
}
return {
cssSrc,
scssSrc,
};
};
/**
* Calculate the cwd, taking into consideration the `root` option (for Windows).
*
* @param {Object} grunt
* @returns {String} The current directory as best we can determine
*/
const getCwd = grunt => {
let cwd = fs.realpathSync(process.env.PWD || process.cwd());
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
if (grunt.option('root')) {
const root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = fs.realpathSync(path.join(__dirname, root));
grunt.log.ok('Setting root to ' + cwd);
} else {
grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
}
}
return cwd;
};
// Detect directories:
// * gruntFilePath The real path on disk to this Gruntfile.js
// * cwd The current working directory, which can be overridden by the `root` option
// * relativeCwd The cwd, relative to the Gruntfile.js
// * componentDirectory The root directory of the component if the cwd is in a valid component
// * inComponent Whether the cwd is in a valid component
// * runDir The componentDirectory or cwd if not in a component, relative to Gruntfile.js
// * fullRunDir The full path to the runDir
const gruntFilePath = fs.realpathSync(process.cwd());
const cwd = getCwd(grunt);
const relativeCwd = path.relative(gruntFilePath, cwd);
const componentDirectory = ComponentList.getOwningComponentDirectory(relativeCwd);
const inComponent = !!componentDirectory;
const inTheme = !!componentDirectory && componentDirectory.startsWith('theme/');
const runDir = inComponent ? componentDirectory : relativeCwd;
const fullRunDir = fs.realpathSync(gruntFilePath + path.sep + runDir);
const {inAMD, amdSrc} = getAmdConfiguration();
const {yuiSrc} = getYuiConfiguration();
const {cssSrc, scssSrc} = getStyleConfiguration();
let files = null;
if (grunt.option('files')) {
// Accept a comma separated list of files to process.
files = grunt.option('files').split(',');
}
grunt.log.debug('============================================================================');
grunt.log.debug(`= Node version: ${process.versions.node}`);
grunt.log.debug(`= grunt version: ${grunt.package.version}`);
grunt.log.debug(`= process.cwd: '` + process.cwd() + `'`);
grunt.log.debug(`= process.env.PWD: '${process.env.PWD}'`);
grunt.log.debug(`= path.sep '${path.sep}'`);
grunt.log.debug('============================================================================');
grunt.log.debug(`= gruntFilePath: '${gruntFilePath}'`);
grunt.log.debug(`= relativeCwd: '${relativeCwd}'`);
grunt.log.debug(`= componentDirectory: '${componentDirectory}'`);
grunt.log.debug(`= inComponent: '${inComponent}'`);
grunt.log.debug(`= runDir: '${runDir}'`);
grunt.log.debug(`= fullRunDir: '${fullRunDir}'`);
grunt.log.debug('============================================================================');
if (inComponent) {
grunt.log.ok(`Running tasks for component directory ${componentDirectory}`);
}
return {
amdSrc,
componentDirectory,
cwd,
cssSrc,
files,
fullRunDir,
gruntFilePath,
inAMD,
inComponent,
inTheme,
relativeCwd,
runDir,
scssSrc,
yuiSrc,
};
};
/**
* Verify tha tthe current NodeJS version matches the required version in package.json.
*
* @param {Grunt} grunt
*/
const verifyNodeVersion = grunt => {
const semver = require('semver');
// Verify the node version is new enough.
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
var actual = semver.valid(process.version);
if (!semver.satisfies(actual, expected)) {
grunt.fail.fatal('Node version not satisfied. Require ' + expected + ', version installed: ' + actual);
}
};
/**
* Grunt configuration.
*
* @param {Grunt} grunt
*/
module.exports = function(grunt) {
// Verify that the Node version meets our requirements.
verifyNodeVersion(grunt);
// Setup the Moodle environemnt within the Grunt object.
grunt.moodleEnv = setupMoodleEnvironment(grunt);
/**
* Add the named task.
*
* @param {string} name
* @param {Grunt} grunt
*/
const addTask = (name, grunt) => {
const path = require('path');
const taskPath = path.resolve(`./.grunt/tasks/${name}.js`);
grunt.log.debug(`Including tasks for ${name} from ${taskPath}`);
require(path.resolve(`./.grunt/tasks/${name}.js`))(grunt);
};
// Startup tasks.
grunt.moodleEnv.startupTasks = [];
// Add Moodle task configuration.
addTask('gherkinlint', grunt);
addTask('ignorefiles', grunt);
addTask('javascript', grunt);
addTask('style', grunt);
addTask('componentlibrary', grunt);
addTask('watch', grunt);
addTask('startup', grunt);
addTask('upgradablelibs', grunt);
// Register the default task.
grunt.registerTask('default', ['startup']);
};
-20
View File
@@ -1,20 +0,0 @@
MOODLE INSTALLATION
===================
Here is a short summary of the installation process (which can take just a few
minutes):
1. Move the Moodle files into your web directory.
2. Create a single database for Moodle to store all its tables in (or choose an
existing database).
3. Visit your Moodle site with a browser. You should be taken to the
install.php script, which will lead you through creating a config.php file
and then setting up Moodle, creating an admin account etc.
4. Set up a cron task to call the file admin/cron.php every minute.
For more information, see <https://docs.moodle.org/en/Installing_Moodle>.
Good luck and have fun!
-7
View File
@@ -1,7 +0,0 @@
issueNumber: MDL-87443
notes:
core:
- message: >-
There is a new Behat `toast_message` named selector to more easily
assert the presence of Toast messages on the page
type: improved
-48
View File
@@ -1,48 +0,0 @@
# Moodle
<p align="center"><a href="https://moodle.org" target="_blank" title="Moodle Website">
<img src="https://raw.githubusercontent.com/moodle/moodle/main/.github/moodlelogo.svg" alt="The Moodle Logo">
</a></p>
[Moodle][1] is the World's Open Source Learning Platform, widely used around the world by countless universities, schools, companies, and all manner of organisations and individuals.
Moodle is designed to allow educators, administrators and learners to create personalised learning environments with a single robust, secure and integrated system.
## Documentation
- Read our [User documentation][3]
- Discover our [developer documentation][5]
- Take a look at our [demo site][4]
## Community
[moodle.org][1] is the central hub for the Moodle Community, with spaces for educators, administrators and developers to meet and work together.
You may also be interested in:
- attending a [Moodle Moot][6]
- our regular series of [developer meetings][7]
- the [Moodle User Association][8]
## Installation and hosting
Moodle is Free, and Open Source software. You can easily [download Moodle][9] and run it on your own web server, however you may prefer to work with one of our experienced [Moodle Partners][10].
Moodle also offers hosting through both [MoodleCloud][11], and our [partner network][10].
## License
Moodle is provided freely as open source software, under version 3 of the GNU General Public License. For more information on our license see
[1]: https://moodle.org
[2]: https://moodle.com
[3]: https://docs.moodle.org/
[4]: https://sandbox.moodledemo.net/
[5]: https://moodledev.io
[6]: https://moodle.com/events/mootglobal/
[7]: https://moodledev.io/general/community/meetings
[8]: https://moodleassociation.org/
[9]: https://download.moodle.org
[10]: https://moodle.com/partners
[11]: https://moodle.com/cloud
[12]: https://moodledev.io/general/license
+29
View File
@@ -0,0 +1,29 @@
QUICK INSTALL
=============
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more information, see the INSTALL DOCUMENTATION:
http://docs.moodle.org/en/Installing_Moodle
Good luck and have fun!
Martin Dougiamas, Lead Developer
+28 -60
View File
@@ -1,66 +1,34 @@
MOODLE TRADEMARKS POLICY
========================
The Moodle Trademark
--------------------
The brand and word "Moodle" has trade mark protection in many countries around
the world. Various Moodle™ trade marks are owned by either Moodle Pty Ltd or
one of its associated entities. The law obligates trade mark owners to police
their trade marks and prevent the use of confusingly similar names by
third parties.
We have created a more concise and thorough set of Trademark Guidelines
(https://moodle.com/wp-content/uploads/2023/02/Moodle-Trademark-Guidelines-2023-4.pdf)
to help you understand how to comply with Moodle's trade mark requirements.
The Trademark Guidelines will also assist our Moodle Certified Partners and the
community to understand some of the principles that inform Moodle's stance
whenever potential infringement has been detected by us or our community.
We need to be clear about use of the word "Moodle" and how we restrict its use
when promoting commercial Moodle™ branded services. The proper use of
trade marks reliably assures consumers about the quality of the associated
products or services and where they have been derived from. Because the
Moodle LMS is made available under the open source GNU General Public License'
that permits you to modify the copyrighted software, the distribution of such
modified software in combination with Moodle trade marks can potentially
mislead others in the community. To be clear, the GNU GPL does not include an
implied right or licence to use Moodle's trade marks.
We do all this to protect the very business model that allows us to continue
developing various Moodle software solutions for you.
Allowed uses of "Moodle"
------------------------
Moodle Trademark License
------------------------
The following uses don't require any permission at all:
The name Moodle™ is a registered trademark of the Moodle Trust.
* Referring to the software or the Moodle project as the "Moodle™ software"
or the "Moodle™ project"
* Describing your own implementation of the Moodle™ software platform
(including within corporate settings).
* Describing a Moodle-based community hub.
* Describing certain software you've made that integrates with Moodle™
branded software (e.g. a Moodle™ integration feature on another system).
A key part of the business model that allows us to produce and
distribute Moodle as completely Free open source software is that
we restrict the commercial use of the Moodle trademark to those
who have contracted to support Moodle development (Moodle Partners).
Restricted uses of "Moodle"
---------------------------
If you are intending to use the name (and/or logo) to advertise
generic Moodle™ services (eg Moodle Hosting, Moodle Support,
Moodle Certification, Moodle Training, Moodle Consulting,
Moodle Customisation, Moodle Courseware Development, Moodle
Theme design, Moodle Integrations, Moodle Installations, etc)
or as the name of a software package, then you must seek
direct permission in writing from the Moodle Trust via the
moodle.com helpdesk, in accordance with normal trademark
restrictions.
The following uses are generally prohibited without explicit and direct
permission being granted to you by Moodle Pty Ltd. We do this to protect the
Moodle™ project from software and sites which could confuse people. If in
doubt, reach out for clarification at <trademarks@moodle.com>
There are no restrictions on how you use the name in other
contexts (for example, if you use Moodle just to provide
courses then you can use the name freely to refer to it.)
* You can't use the word "Moodle" or any Moodle logos for commercial purposes
without prior written permission from Moodle HQ.
* You can't use "Moodle" in the name of your software (including Mobile apps).
* You can't use "Moodle" in your company name.
* You can't use "Moodle" in your domain name.
* You can't use "Moodle" in advertising-related keywords (such as Adsense).
* You can't use "Moodle" to describe services around Moodle
(such as hosting, training, support, consulting, course creation services,
theme development, customisation, installation, integration, analytics
and certification) that cause consumers to be confused that you are
associated with Moodle HQ if you are not.
This applies even if you do not charge for the services.
Note that usually only Moodle Partners have this permission.
If you aren't sure of a particular case, please ask us via
http://moodle.com/helpdesk: we'll be happy to either provide
you with official permission in writing or help you fix
your wording.
Martin Dougiamas
Executive Director
Moodle Trust
http://moodle.com
-2766
View File
File diff suppressed because it is too large Load Diff
-9
View File
@@ -1,9 +0,0 @@
# core_admin (subsystem) Upgrade notes
## 4.5rc1
### Removed
- The HTTP Server setting "Use slash arguments" (slasharguments) configuration setting and related to it has been removed. Calling the option with $CFG->slasharguments or get_config('slasharguments') is no longer available.
For more information see [MDL-62640](https://tracker.moodle.org/browse/MDL-62640)
-65
View File
@@ -1,65 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Manage AI subsystem plugins settings.
*
* @package core_admin
* @copyright 2024 Matt Porritt <matt.porritt@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir . '/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$type = required_param('type', PARAM_PLUGIN); // Must be provider or placement.
$name = required_param('name', PARAM_PLUGIN); // Plugin name, e.g openai.
$syscontext = context_system::instance();
$PAGE->set_url('/admin/ai.php');
$PAGE->set_context($syscontext);
require_admin();
require_sesskey();
$return = new moodle_url('/admin/settings.php', ['section' => "aisettings$type"]);
$plugins = core_plugin_manager::instance()->get_plugins_of_type("ai$type");
$sortorder = array_flip(array_keys($plugins));
if (!isset($plugins[$name])) {
throw new moodle_exception('aipluginnotfound', 'core_ai', $return, $name);
}
$plugintypename = $plugins[$name]->type . '_' . $plugins[$name]->name;
switch ($action) {
case 'disable':
if ($plugins[$name]->is_enabled()) {
$class = core_plugin_manager::resolve_plugininfo_class("aisettings$type");
$class::enable_plugin($name, false);
}
break;
case 'enable':
if (!$plugins[$name]->is_enabled()) {
$class = core_plugin_manager::resolve_plugininfo_class("aisettings$type");
$class::enable_plugin($name, true);
}
break;
}
redirect($return);
-3
View File
@@ -1,3 +0,0 @@
define("core_admin/block_management_table",["exports","./plugin_management_table","core_table/dynamic","core/ajax","core/pending","core/notification"],(function(_exports,_plugin_management_table,_dynamic,_ajax,_pending,_notification){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_plugin_management_table=_interopRequireDefault(_plugin_management_table),_pending=_interopRequireDefault(_pending);class _default extends _plugin_management_table.default{constructor(){super(),this.addClickHandler(this.handleBlockProtectToggle)}setBlockProtectState(plugin,state){return(0,_ajax.call)([{methodname:"core_admin_set_block_protection",args:{plugin:plugin,state:state}}])[0]}async handleBlockProtectToggle(tableRoot,e){const stateToggle=e.target.closest('[data-action="toggleprotectstate"]');if(stateToggle){e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:processAction");await this.setBlockProtectState(stateToggle.dataset.plugin,"1"===stateToggle.dataset.targetState?1:0);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]);updatedRoot.querySelector('[data-action="toggleprotectstate"][data-plugin="'.concat(stateToggle.dataset.plugin,'"]')).focus(),pendingPromise.resolve()}}}return _exports.default=_default,_exports.default}));
//# sourceMappingURL=block_management_table.min.js.map
@@ -1 +0,0 @@
{"version":3,"file":"block_management_table.min.js","sources":["../src/block_management_table.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\nimport PluginManagementTable from './plugin_management_table';\nimport {refreshTableContent} from 'core_table/dynamic';\nimport {call as fetchMany} from 'core/ajax';\nimport Pending from 'core/pending';\nimport {fetchNotifications} from 'core/notification';\n\nexport default class extends PluginManagementTable {\n constructor() {\n super();\n this.addClickHandler(this.handleBlockProtectToggle);\n }\n\n /**\n * Set the block protection state.\n *\n * @param {string} plugin\n * @param {number} state\n * @returns {Promise}\n */\n setBlockProtectState(plugin, state) {\n return fetchMany([{\n methodname: 'core_admin_set_block_protection',\n args: {\n plugin,\n state,\n },\n }])[0];\n }\n\n /**\n * Handle toggling of block protection.\n *\n * @param {HTMLElement} tableRoot\n * @param {Event} e\n */\n async handleBlockProtectToggle(tableRoot, e) {\n const stateToggle = e.target.closest('[data-action=\"toggleprotectstate\"]');\n if (stateToggle) {\n e.preventDefault();\n const pendingPromise = new Pending('core_table/dynamic:processAction');\n\n await this.setBlockProtectState(\n stateToggle.dataset.plugin,\n stateToggle.dataset.targetState === '1' ? 1 : 0\n );\n\n const [updatedRoot] = await Promise.all([\n refreshTableContent(tableRoot),\n fetchNotifications(),\n ]);\n\n // Refocus on the link that as pressed in the first place.\n updatedRoot.querySelector(`[data-action=\"toggleprotectstate\"][data-plugin=\"${stateToggle.dataset.plugin}\"]`).focus();\n pendingPromise.resolve();\n }\n }\n}\n"],"names":["PluginManagementTable","constructor","addClickHandler","this","handleBlockProtectToggle","setBlockProtectState","plugin","state","methodname","args","tableRoot","e","stateToggle","target","closest","preventDefault","pendingPromise","Pending","dataset","targetState","updatedRoot","Promise","all","querySelector","focus","resolve"],"mappings":"uhBAqB6BA,iCACzBC,2BAESC,gBAAgBC,KAAKC,0BAU9BC,qBAAqBC,OAAQC,cAClB,cAAU,CAAC,CACdC,WAAY,kCACZC,KAAM,CACFH,OAAAA,OACAC,MAAAA,UAEJ,kCASuBG,UAAWC,SAChCC,YAAcD,EAAEE,OAAOC,QAAQ,yCACjCF,YAAa,CACbD,EAAEI,uBACIC,eAAiB,IAAIC,iBAAQ,0CAE7Bd,KAAKE,qBACPO,YAAYM,QAAQZ,OACgB,MAApCM,YAAYM,QAAQC,YAAsB,EAAI,SAG3CC,mBAAqBC,QAAQC,IAAI,EACpC,gCAAoBZ,YACpB,wCAIJU,YAAYG,wEAAiEX,YAAYM,QAAQZ,cAAYkB,QAC7GR,eAAeS"}
-10
View File
@@ -1,10 +0,0 @@
define("core_admin/bulk_user_actions",["exports","core_reportbuilder/local/selectors","core_table/local/dynamic/events","core_form/changechecker","core/custom_interaction_events","jquery"],(function(_exports,reportSelectors,tableEvents,FormChangeChecker,CustomEvents,_jquery){var obj;function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}
/**
* Add bulk actions to the users list report
*
* @module core_admin/bulk_user_actions
* @copyright 2024 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,reportSelectors=_interopRequireWildcard(reportSelectors),tableEvents=_interopRequireWildcard(tableEvents),FormChangeChecker=_interopRequireWildcard(FormChangeChecker),CustomEvents=_interopRequireWildcard(CustomEvents),_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};const Selectors_bulkActionsForm="form#user-bulk-action-form",Selectors_userReportWrapper='[data-region="report-user-list-wrapper"]',Selectors_checkbox='input[type="checkbox"][data-togglegroup="report-select-all"][data-toggle="slave"]',Selectors_masterCheckbox='input[type="checkbox"][data-togglegroup="report-select-all"][data-toggle="master"]',Selectors_checkedRows='[data-togglegroup="report-select-all"][data-toggle="slave"]:checked';_exports.init=()=>{var _userBulkForm$closest;const userBulkForm=document.querySelector(Selectors_bulkActionsForm),userReport=null==userBulkForm||null===(_userBulkForm$closest=userBulkForm.closest(Selectors_userReportWrapper))||void 0===_userBulkForm$closest?void 0:_userBulkForm$closest.querySelector(reportSelectors.regions.report);if(!userBulkForm||!userReport)return;const actionSelect=userBulkForm.querySelector("select");CustomEvents.define(actionSelect,[CustomEvents.events.accessibleChange]),(0,_jquery.default)(actionSelect).on(CustomEvents.events.accessibleChange,(event=>{if(event.target.value&&"0"!=="".concat(event.target.value)){const e=new Event("submit",{cancelable:!0});userBulkForm.dispatchEvent(e),e.defaultPrevented||(FormChangeChecker.markFormSubmitted(userBulkForm),userBulkForm.submit())}}));const updateUserIds=()=>{const selectedUsers=[...userReport.querySelectorAll(Selectors_checkedRows)],selectedUserIds=selectedUsers.map((check=>parseInt(check.value)));userBulkForm.querySelector('[name="userids"]').value=selectedUserIds.join(","),actionSelect.disabled=0===selectedUsers.length,actionSelect.disabled&&(actionSelect.value="0");const selectedUsersNames=selectedUsers.map((check=>document.querySelector('label[for="'.concat(check.id,'"]')).textContent));userBulkForm.data={userids:selectedUserIds,usernames:selectedUsersNames}};updateUserIds(),document.addEventListener("change",(event=>{(event.target.matches(Selectors_checkbox)||event.target.matches(Selectors_masterCheckbox))&&userReport.contains(event.target)&&updateUserIds()})),document.addEventListener(tableEvents.tableContentRefreshed,(event=>{userReport.contains(event.target)&&updateUserIds()}))}}));
//# sourceMappingURL=bulk_user_actions.min.js.map
File diff suppressed because one or more lines are too long
-12
View File
@@ -1,12 +0,0 @@
define("core_admin/expand_hash",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=_exports.expandSection=void 0;
/**
* Expand the collapse section element.
*
* @module core_admin/expand_hash
* @copyright Meirza <meirza.arson@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 4.5
*/
const SELECTORS_COLLAPSE_ELEMENTS='[data-bs-toggle="collapse"]',SELECTORS_FOCUSTHENEXPAND_ELEMENTS=".focus-expand";_exports.init=()=>{const focusexpand=document.querySelector(SELECTORS_FOCUSTHENEXPAND_ELEMENTS);null==focusexpand||focusexpand.addEventListener("click",(()=>{expandSection("".concat(focusexpand.getAttribute("href")))}))};const expandSection=hash=>{const container=document.querySelector(hash),targetContainer=null==container?void 0:container.querySelector(SELECTORS_COLLAPSE_ELEMENTS);if("false"===(null==targetContainer?void 0:targetContainer.getAttribute("aria-expanded"))){const collapseId=targetContainer.getAttribute("aria-controls"),collapseContainer=document.getElementById(collapseId);collapseContainer.classList.remove("collapse"),collapseContainer.classList.add("show"),targetContainer.setAttribute("aria-expanded","true"),targetContainer.classList.remove("collapsed");const collapseElement=document.querySelector(".collapseexpand.collapsemenu");collapseElement.setAttribute("aria-expanded","true"),collapseElement.classList.remove("collapsed")}};_exports.expandSection=expandSection}));
//# sourceMappingURL=expand_hash.min.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"expand_hash.min.js","sources":["../src/expand_hash.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Expand the collapse section element.\n *\n * @module core_admin/expand_hash\n * @copyright Meirza <meirza.arson@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.5\n */\n\nconst SELECTORS = {\n COLLAPSE_ELEMENTS: '[data-bs-toggle=\"collapse\"]',\n FOCUSTHENEXPAND_ELEMENTS: '.focus-expand',\n};\n\n/**\n * Initializes the focus and expand functionality.\n */\nexport const init = () => {\n // Select all collapsible elements only.\n const focusexpand = document.querySelector(SELECTORS.FOCUSTHENEXPAND_ELEMENTS);\n\n // Add click event listener to the anchor element\n focusexpand?.addEventListener('click', () => {\n expandSection(`${focusexpand.getAttribute('href')}`);\n });\n};\n\n/**\n * Expands a section based on the provided URL hash.\n *\n * This function takes a hash string, finds the corresponding element in the DOM,\n * and expands it if it is currently collapsed. It updates the necessary ARIA\n * attributes and classes to reflect the expanded state.\n *\n * @param {string} hash - The hash (e.g., '#elementId') of the element to expand.\n */\nexport const expandSection = (hash) => {\n const container = document.querySelector(hash);\n const targetContainer = container?.querySelector(SELECTORS.COLLAPSE_ELEMENTS);\n\n if (targetContainer?.getAttribute('aria-expanded') === 'false') {\n const collapseId = targetContainer.getAttribute('aria-controls');\n const collapseContainer = document.getElementById(collapseId);\n\n // Show the content.\n collapseContainer.classList.remove('collapse');\n collapseContainer.classList.add('show');\n\n // Update aria-expanded attribute to reflect the new state.\n targetContainer.setAttribute('aria-expanded', 'true');\n targetContainer.classList.remove('collapsed');\n\n // Get collapse expand menu element.\n const collapseElement = document.querySelector('.collapseexpand.collapsemenu');\n // Ensure it gets noticed to make it work.\n collapseElement.setAttribute('aria-expanded', 'true');\n collapseElement.classList.remove('collapsed');\n }\n};\n"],"names":["SELECTORS","focusexpand","document","querySelector","addEventListener","expandSection","getAttribute","hash","container","targetContainer","collapseId","collapseContainer","getElementById","classList","remove","add","setAttribute","collapseElement"],"mappings":";;;;;;;;;MAwBMA,4BACiB,8BADjBA,mCAEwB,8BAMV,WAEVC,YAAcC,SAASC,cAAcH,oCAG3CC,MAAAA,aAAAA,YAAaG,iBAAiB,SAAS,KACnCC,wBAAiBJ,YAAYK,aAAa,oBAarCD,cAAiBE,aACpBC,UAAYN,SAASC,cAAcI,MACnCE,gBAAkBD,MAAAA,iBAAAA,UAAWL,cAAcH,gCAEM,WAAnDS,MAAAA,uBAAAA,gBAAiBH,aAAa,kBAA8B,OACtDI,WAAaD,gBAAgBH,aAAa,iBAC1CK,kBAAoBT,SAASU,eAAeF,YAGlDC,kBAAkBE,UAAUC,OAAO,YACnCH,kBAAkBE,UAAUE,IAAI,QAGhCN,gBAAgBO,aAAa,gBAAiB,QAC9CP,gBAAgBI,UAAUC,OAAO,mBAG3BG,gBAAkBf,SAASC,cAAc,gCAE/Cc,gBAAgBD,aAAa,gBAAiB,QAC9CC,gBAAgBJ,UAAUC,OAAO"}
-3
View File
@@ -1,3 +0,0 @@
define("core_admin/plugin_management_table",["exports","core_table/dynamic","core_table/local/dynamic/selectors","core/ajax","core/pending","core/notification"],(function(_exports,_dynamic,Selectors,_ajax,_pending,_notification){var obj;function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Selectors=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(Selectors),_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};let watching=!1;return _exports.default=class{constructor(){!function(obj,key,value){key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}(this,"clickHandlers",[]),this.addClickHandler(this.handleStateToggle),this.addClickHandler(this.handleMoveUpDown),this.registerEventListeners()}static init(){watching||(watching=!0,new this)}addClickHandler(handler){this.clickHandlers.push(handler.bind(this))}registerEventListeners(){document.addEventListener("click",function(e){const tableRoot=this.getTableRoot(e);tableRoot&&this.clickHandlers.forEach((handler=>handler(tableRoot,e)))}.bind(this))}getTableRoot(e){const tableRoot=e.target.closest(Selectors.main.region);return tableRoot||!1}setPluginState(methodname,plugin,state){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,state:state}}])[0]}setPluginOrder(methodname,plugin,direction){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,direction:direction}}])[0]}async handleStateToggle(tableRoot,e){const stateToggle=e.target.closest('[data-action="togglestate"][data-toggle-method]');if(stateToggle){e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:togglestate");await this.setPluginState(stateToggle.dataset.toggleMethod,stateToggle.dataset.plugin,"1"===stateToggle.dataset.state?0:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]);updatedRoot.querySelector('[data-action="togglestate"][data-plugin="'.concat(stateToggle.dataset.plugin,'"]')).focus(),this.removeTooltips(),pendingPromise.resolve()}}async handleMoveUpDown(tableRoot,e){const actionLink=e.target.closest('[data-action="move"][data-method][data-direction]');if(!actionLink)return;e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:processAction");await this.setPluginOrder(actionLink.dataset.method,actionLink.dataset.plugin,"up"===actionLink.dataset.direction?-1:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]),exactMatch=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"][data-direction="').concat(actionLink.dataset.direction,'"]'));var _updatedRoot$querySel;exactMatch?exactMatch.focus():null===(_updatedRoot$querySel=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"]')))||void 0===_updatedRoot$querySel||_updatedRoot$querySel.focus();pendingPromise.resolve()}removeTooltips(){const tooltips=document.querySelectorAll('[id*="tooltip"]');tooltips.length>0&&tooltips.forEach((tooltip=>{tooltip.remove()}))}},_exports.default}));
//# sourceMappingURL=plugin_management_table.min.js.map
File diff suppressed because one or more lines are too long
-11
View File
@@ -1,11 +0,0 @@
define("core_admin/plugins_overview",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=function(){const filters=document.querySelectorAll(SELECTORS_PLUGIN_FILTERS),pluginRows=document.querySelectorAll(SELECTORS_PLUGIN_ROWS),pluginTypeRows=document.querySelectorAll(SELECTORS_PLUGIN_TYPE_ROWS),filterPlugins=target=>{const filterBy=target.getAttribute("data-filterby"),headerVisibility={};for(const row of pluginRows){const type=[...row.classList].find((s=>s.startsWith("type-"))),visible="all"===filterBy||row.classList.contains(filterBy);row.style.display=visible?null:"none",visible&&type&&(headerVisibility[type]=!0)}for(const row of pluginTypeRows){const type=[...row.classList].find((s=>s.startsWith("type-")));if(type){const visible="all"===filterBy||headerVisibility[type];row.style.display=visible?null:"none"}}filters.forEach((el=>el.classList.remove("active"))),target.classList.add("active")};if(filters.forEach((target=>target.addEventListener("click",(e=>{e.preventDefault(),window.history.replaceState({},null,e.target.href),filterPlugins(target)})))),window.location.hash.length>1){const anchor=window.location.hash.substring(1),target=[...filters].find((t=>t.getAttribute("data-filterby")===anchor));target&&filterPlugins(target)}};
/**
* Allows to filter the plugin list on plugins overview page
*
* @module core_admin/plugins_overview
* @copyright 2024 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const SELECTORS_PLUGIN_FILTERS="#plugins-overview-panel [data-filterby]",SELECTORS_PLUGIN_ROWS="table#plugins-control-panel tbody tr:not(.plugintypeheader)",SELECTORS_PLUGIN_TYPE_ROWS="table#plugins-control-panel tbody tr.plugintypeheader"}));
//# sourceMappingURL=plugins_overview.min.js.map
@@ -1 +0,0 @@
{"version":3,"file":"plugins_overview.min.js","sources":["../src/plugins_overview.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Allows to filter the plugin list on plugins overview page\n *\n * @module core_admin/plugins_overview\n * @copyright 2024 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nconst SELECTORS = {\n PLUGIN_FILTERS: '#plugins-overview-panel [data-filterby]',\n PLUGIN_ROWS: 'table#plugins-control-panel tbody tr:not(.plugintypeheader)',\n PLUGIN_TYPE_ROWS: 'table#plugins-control-panel tbody tr.plugintypeheader',\n};\n\n/**\n * Initialise filters for the \"Plugins overview\" page\n */\nexport function init() {\n const filters = document.querySelectorAll(SELECTORS.PLUGIN_FILTERS);\n const pluginRows = document.querySelectorAll(SELECTORS.PLUGIN_ROWS);\n const pluginTypeRows = document.querySelectorAll(SELECTORS.PLUGIN_TYPE_ROWS);\n\n const filterPlugins = (target) => {\n const filterBy = target.getAttribute('data-filterby');\n const headerVisibility = {};\n\n // Hide all plugin rows in the plugin table that do not match the filter and show all others.\n for (const row of pluginRows) {\n const type = [...row.classList].find(s => s.startsWith('type-'));\n const visible = filterBy === 'all' ? true : row.classList.contains(filterBy);\n row.style.display = visible ? null : 'none';\n if (visible && type) {\n headerVisibility[type] = true;\n }\n }\n\n // Hide all the plugin type headers that do not have any visible plugins and show all others.\n for (const row of pluginTypeRows) {\n const type = [...row.classList].find(s => s.startsWith('type-'));\n if (type) {\n const visible = filterBy === 'all' || headerVisibility[type];\n row.style.display = visible ? null : 'none';\n }\n }\n\n // Toggle 'active' class for the selected filter.\n filters.forEach(el => el.classList.remove('active'));\n target.classList.add('active');\n };\n\n // Add event listeners for the links changing plugins filters.\n filters\n .forEach(target => target.addEventListener('click', (e) => {\n e.preventDefault();\n window.history.replaceState({}, null, e.target.href);\n filterPlugins(target);\n }));\n\n // Pre-filter plugins based on the current url anchor.\n if (window.location.hash.length > 1) {\n const anchor = window.location.hash.substring(1);\n const target = [...filters].find(t => t.getAttribute('data-filterby') === anchor);\n if (target) {\n filterPlugins(target);\n }\n }\n}\n"],"names":["filters","document","querySelectorAll","SELECTORS","pluginRows","pluginTypeRows","filterPlugins","target","filterBy","getAttribute","headerVisibility","row","type","classList","find","s","startsWith","visible","contains","style","display","forEach","el","remove","add","addEventListener","e","preventDefault","window","history","replaceState","href","location","hash","length","anchor","substring","t"],"mappings":"4JAiCUA,QAAUC,SAASC,iBAAiBC,0BACpCC,WAAaH,SAASC,iBAAiBC,uBACvCE,eAAiBJ,SAASC,iBAAiBC,4BAE3CG,cAAiBC,eACbC,SAAWD,OAAOE,aAAa,iBAC/BC,iBAAmB,OAGpB,MAAMC,OAAOP,WAAY,OACpBQ,KAAO,IAAID,IAAIE,WAAWC,MAAKC,GAAKA,EAAEC,WAAW,WACjDC,QAAuB,QAAbT,UAA4BG,IAAIE,UAAUK,SAASV,UACnEG,IAAIQ,MAAMC,QAAUH,QAAU,KAAO,OACjCA,SAAWL,OACXF,iBAAiBE,OAAQ,OAK5B,MAAMD,OAAON,eAAgB,OACxBO,KAAO,IAAID,IAAIE,WAAWC,MAAKC,GAAKA,EAAEC,WAAW,cACnDJ,KAAM,OACAK,QAAuB,QAAbT,UAAsBE,iBAAiBE,MACvDD,IAAIQ,MAAMC,QAAUH,QAAU,KAAO,QAK7CjB,QAAQqB,SAAQC,IAAMA,GAAGT,UAAUU,OAAO,YAC1ChB,OAAOM,UAAUW,IAAI,cAIzBxB,QACCqB,SAAQd,QAAUA,OAAOkB,iBAAiB,SAAUC,IACjDA,EAAEC,iBACFC,OAAOC,QAAQC,aAAa,GAAI,KAAMJ,EAAEnB,OAAOwB,MAC/CzB,cAAcC,aAIdqB,OAAOI,SAASC,KAAKC,OAAS,EAAG,OAC3BC,OAASP,OAAOI,SAASC,KAAKG,UAAU,GACxC7B,OAAS,IAAIP,SAASc,MAAKuB,GAAKA,EAAE5B,aAAa,mBAAqB0B,SACtE5B,QACAD,cAAcC;;;;;;;;MAvDpBJ,yBACc,0CADdA,sBAEW,8DAFXA,2BAGgB"}
-10
View File
@@ -1,10 +0,0 @@
define("core_admin/themeselector/preview_modal",["exports","core/modal_events","core/modal_cancel","core/modal_save_cancel","core/notification","core/templates","core/str"],(function(_exports,_modal_events,_modal_cancel,_modal_save_cancel,_notification,_templates,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
/**
* Modal for theme previews.
*
* @module core_admin/themeselector/preview_modal
* @copyright 2023 David Woloszyn <david.woloszyn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_modal_events=_interopRequireDefault(_modal_events),_modal_cancel=_interopRequireDefault(_modal_cancel),_modal_save_cancel=_interopRequireDefault(_modal_save_cancel),_notification=_interopRequireDefault(_notification),_templates=_interopRequireDefault(_templates);const SELECTORS_THEMES_CONTAINER="themelist",SELECTORS_PREVIEW='[data-action="preview"]';_exports.init=()=>{registerListenerEvents()};const registerListenerEvents=()=>{document.addEventListener("click",(e=>{const preview=e.target.closest(SELECTORS_PREVIEW);preview&&buildModal(preview).catch(_notification.default.exception)}))},buildModal=async element=>{let description=await(0,_str.getString)("choosereadme","theme_"+element.getAttribute("data-choose"));const themesContainer=document.getElementById(SELECTORS_THEMES_CONTAINER),definedInConfig=parseInt(themesContainer.dataset.definedinconfig),data={name:element.getAttribute("data-name"),image:element.getAttribute("data-image"),description:description.replace(/<[^>]+>/g," "),current:element.getAttribute("data-current"),actionurl:element.getAttribute("data-actionurl"),choose:element.getAttribute("data-choose"),sesskey:element.getAttribute("data-sesskey"),definedinconfig:definedInConfig};let modalTemplate=_modal_save_cancel.default;(data.current||data.definedinconfig)&&(modalTemplate=_modal_cancel.default);const modal=await modalTemplate.create({title:data.name,body:_templates.default.render("core_admin/themeselector/theme_preview_modal",data),large:!0,buttons:{save:(0,_str.getString)("selecttheme","moodle"),cancel:(0,_str.getString)("closebuttontitle","moodle")},show:!0});modal.getRoot().on(_modal_events.default.save,(()=>{modal.getRoot().find("form").submit()}))}}));
//# sourceMappingURL=preview_modal.min.js.map
@@ -1 +0,0 @@
{"version":3,"file":"preview_modal.min.js","sources":["../../src/themeselector/preview_modal.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Modal for theme previews.\n *\n * @module core_admin/themeselector/preview_modal\n * @copyright 2023 David Woloszyn <david.woloszyn@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalEvents from 'core/modal_events';\nimport ModalCancel from 'core/modal_cancel';\nimport ModalSaveCancel from 'core/modal_save_cancel';\nimport Notification from 'core/notification';\nimport Templates from 'core/templates';\nimport {getString} from 'core/str';\n\nconst SELECTORS = {\n THEMES_CONTAINER: 'themelist',\n PREVIEW: '[data-action=\"preview\"]',\n};\n\n/**\n * Entrypoint of the js.\n *\n * @method init\n */\nexport const init = () => {\n registerListenerEvents();\n};\n\n/**\n * Register theme related event listeners.\n *\n * @method registerListenerEvents\n */\nconst registerListenerEvents = () => {\n document.addEventListener('click', (e) => {\n const preview = e.target.closest(SELECTORS.PREVIEW);\n if (preview) {\n buildModal(preview).catch(Notification.exception);\n }\n });\n};\n\n/**\n * Build the modal with the provided data.\n *\n * @method buildModal\n * @param {object} element\n */\nconst buildModal = async(element) => {\n\n // This string can be long. We will fetch it with JS as opposed to passing it as an attribute.\n let description = await getString('choosereadme', 'theme_' + element.getAttribute('data-choose'));\n\n const themesContainer = document.getElementById(SELECTORS.THEMES_CONTAINER);\n const definedInConfig = parseInt(themesContainer.dataset.definedinconfig);\n // Prepare data for modal.\n const data = {\n name: element.getAttribute('data-name'),\n image: element.getAttribute('data-image'),\n description: description.replace(/<[^>]+>/g, ' '), // Strip out HTML tags.\n current: element.getAttribute('data-current'),\n actionurl: element.getAttribute('data-actionurl'),\n choose: element.getAttribute('data-choose'),\n sesskey: element.getAttribute('data-sesskey'),\n definedinconfig: definedInConfig,\n };\n\n // Determine which modal template we should use.\n let modalTemplate = ModalSaveCancel;\n if (data.current || data.definedinconfig) {\n modalTemplate = ModalCancel;\n }\n\n const modal = await modalTemplate.create({\n title: data.name,\n body: Templates.render('core_admin/themeselector/theme_preview_modal', data),\n large: true,\n buttons: {\n 'save': getString('selecttheme', 'moodle'),\n 'cancel': getString('closebuttontitle', 'moodle'),\n },\n show: true,\n });\n\n modal.getRoot().on(ModalEvents.save, () => {\n modal.getRoot().find('form').submit();\n });\n};\n"],"names":["SELECTORS","registerListenerEvents","document","addEventListener","e","preview","target","closest","buildModal","catch","Notification","exception","async","description","element","getAttribute","themesContainer","getElementById","definedInConfig","parseInt","dataset","definedinconfig","data","name","image","replace","current","actionurl","choose","sesskey","modalTemplate","ModalSaveCancel","ModalCancel","modal","create","title","body","Templates","render","large","buttons","show","getRoot","on","ModalEvents","save","find","submit"],"mappings":";;;;;;;gWA8BMA,2BACgB,YADhBA,kBAEO,wCAQO,KAChBC,gCAQEA,uBAAyB,KAC3BC,SAASC,iBAAiB,SAAUC,UAC1BC,QAAUD,EAAEE,OAAOC,QAAQP,mBAC7BK,SACAG,WAAWH,SAASI,MAAMC,sBAAaC,eAW7CH,WAAaI,MAAAA,cAGXC,kBAAoB,kBAAU,eAAgB,SAAWC,QAAQC,aAAa,sBAE5EC,gBAAkBd,SAASe,eAAejB,4BAC1CkB,gBAAkBC,SAASH,gBAAgBI,QAAQC,iBAEnDC,KAAO,CACTC,KAAMT,QAAQC,aAAa,aAC3BS,MAAOV,QAAQC,aAAa,cAC5BF,YAAaA,YAAYY,QAAQ,WAAY,KAC7CC,QAASZ,QAAQC,aAAa,gBAC9BY,UAAWb,QAAQC,aAAa,kBAChCa,OAAQd,QAAQC,aAAa,eAC7Bc,QAASf,QAAQC,aAAa,gBAC9BM,gBAAiBH,qBAIjBY,cAAgBC,4BAChBT,KAAKI,SAAWJ,KAAKD,mBACrBS,cAAgBE,6BAGdC,YAAcH,cAAcI,OAAO,CACrCC,MAAOb,KAAKC,KACZa,KAAMC,mBAAUC,OAAO,+CAAgDhB,MACvEiB,OAAO,EACPC,QAAS,OACG,kBAAU,cAAe,kBACvB,kBAAU,mBAAoB,WAE5CC,MAAM,IAGVR,MAAMS,UAAUC,GAAGC,sBAAYC,MAAM,KACjCZ,MAAMS,UAAUI,KAAK,QAAQC"}
-72
View File
@@ -1,72 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import PluginManagementTable from './plugin_management_table';
import {refreshTableContent} from 'core_table/dynamic';
import {call as fetchMany} from 'core/ajax';
import Pending from 'core/pending';
import {fetchNotifications} from 'core/notification';
export default class extends PluginManagementTable {
constructor() {
super();
this.addClickHandler(this.handleBlockProtectToggle);
}
/**
* Set the block protection state.
*
* @param {string} plugin
* @param {number} state
* @returns {Promise}
*/
setBlockProtectState(plugin, state) {
return fetchMany([{
methodname: 'core_admin_set_block_protection',
args: {
plugin,
state,
},
}])[0];
}
/**
* Handle toggling of block protection.
*
* @param {HTMLElement} tableRoot
* @param {Event} e
*/
async handleBlockProtectToggle(tableRoot, e) {
const stateToggle = e.target.closest('[data-action="toggleprotectstate"]');
if (stateToggle) {
e.preventDefault();
const pendingPromise = new Pending('core_table/dynamic:processAction');
await this.setBlockProtectState(
stateToggle.dataset.plugin,
stateToggle.dataset.targetState === '1' ? 1 : 0
);
const [updatedRoot] = await Promise.all([
refreshTableContent(tableRoot),
fetchNotifications(),
]);
// Refocus on the link that as pressed in the first place.
updatedRoot.querySelector(`[data-action="toggleprotectstate"][data-plugin="${stateToggle.dataset.plugin}"]`).focus();
pendingPromise.resolve();
}
}
}
-97
View File
@@ -1,97 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Add bulk actions to the users list report
*
* @module core_admin/bulk_user_actions
* @copyright 2024 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import * as reportSelectors from 'core_reportbuilder/local/selectors';
import * as tableEvents from 'core_table/local/dynamic/events';
import * as FormChangeChecker from 'core_form/changechecker';
import * as CustomEvents from 'core/custom_interaction_events';
import jQuery from 'jquery';
const Selectors = {
bulkActionsForm: 'form#user-bulk-action-form',
userReportWrapper: '[data-region="report-user-list-wrapper"]',
checkbox: 'input[type="checkbox"][data-togglegroup="report-select-all"][data-toggle="slave"]',
masterCheckbox: 'input[type="checkbox"][data-togglegroup="report-select-all"][data-toggle="master"]',
checkedRows: '[data-togglegroup="report-select-all"][data-toggle="slave"]:checked',
};
/**
* Initialise module
*/
export const init = () => {
const userBulkForm = document.querySelector(Selectors.bulkActionsForm);
const userReport = userBulkForm?.closest(Selectors.userReportWrapper)?.querySelector(reportSelectors.regions.report);
if (!userBulkForm || !userReport) {
return;
}
const actionSelect = userBulkForm.querySelector('select');
CustomEvents.define(actionSelect, [CustomEvents.events.accessibleChange]);
jQuery(actionSelect).on(CustomEvents.events.accessibleChange, event => {
if (event.target.value && `${event.target.value}` !== "0") {
const e = new Event('submit', {cancelable: true});
userBulkForm.dispatchEvent(e);
if (!e.defaultPrevented) {
FormChangeChecker.markFormSubmitted(userBulkForm);
userBulkForm.submit();
}
}
});
// Every time the checkboxes in the report are changed, update the list of users in the form values
// and enable/disable the action select.
const updateUserIds = () => {
const selectedUsers = [...userReport.querySelectorAll(Selectors.checkedRows)];
const selectedUserIds = selectedUsers.map(check => parseInt(check.value));
userBulkForm.querySelector('[name="userids"]').value = selectedUserIds.join(',');
// Disable the action selector if nothing selected, and reset the current selection.
actionSelect.disabled = selectedUsers.length === 0;
if (actionSelect.disabled) {
actionSelect.value = "0";
}
const selectedUsersNames = selectedUsers.map(check => document.querySelector(`label[for="${check.id}"]`).textContent);
// Add the user ids and names to the form data attributes so they can be available from the
// other JS modules that listen to the form submit event.
userBulkForm.data = {userids: selectedUserIds, usernames: selectedUsersNames};
};
updateUserIds();
document.addEventListener('change', event => {
// When checkboxes are checked next to individual users or the master toggle (Select all/none).
if ((event.target.matches(Selectors.checkbox) || event.target.matches(Selectors.masterCheckbox))
&& userReport.contains(event.target)) {
updateUserIds();
}
});
document.addEventListener(tableEvents.tableContentRefreshed, event => {
// When the report contents is updated (i.e. page is changed, filters applied, etc).
if (userReport.contains(event.target)) {
updateUserIds();
}
});
};
-74
View File
@@ -1,74 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Expand the collapse section element.
*
* @module core_admin/expand_hash
* @copyright Meirza <meirza.arson@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 4.5
*/
const SELECTORS = {
COLLAPSE_ELEMENTS: '[data-bs-toggle="collapse"]',
FOCUSTHENEXPAND_ELEMENTS: '.focus-expand',
};
/**
* Initializes the focus and expand functionality.
*/
export const init = () => {
// Select all collapsible elements only.
const focusexpand = document.querySelector(SELECTORS.FOCUSTHENEXPAND_ELEMENTS);
// Add click event listener to the anchor element
focusexpand?.addEventListener('click', () => {
expandSection(`${focusexpand.getAttribute('href')}`);
});
};
/**
* Expands a section based on the provided URL hash.
*
* This function takes a hash string, finds the corresponding element in the DOM,
* and expands it if it is currently collapsed. It updates the necessary ARIA
* attributes and classes to reflect the expanded state.
*
* @param {string} hash - The hash (e.g., '#elementId') of the element to expand.
*/
export const expandSection = (hash) => {
const container = document.querySelector(hash);
const targetContainer = container?.querySelector(SELECTORS.COLLAPSE_ELEMENTS);
if (targetContainer?.getAttribute('aria-expanded') === 'false') {
const collapseId = targetContainer.getAttribute('aria-controls');
const collapseContainer = document.getElementById(collapseId);
// Show the content.
collapseContainer.classList.remove('collapse');
collapseContainer.classList.add('show');
// Update aria-expanded attribute to reflect the new state.
targetContainer.setAttribute('aria-expanded', 'true');
targetContainer.classList.remove('collapsed');
// Get collapse expand menu element.
const collapseElement = document.querySelector('.collapseexpand.collapsemenu');
// Ensure it gets noticed to make it work.
collapseElement.setAttribute('aria-expanded', 'true');
collapseElement.classList.remove('collapsed');
}
};
-195
View File
@@ -1,195 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import {refreshTableContent} from 'core_table/dynamic';
import * as Selectors from 'core_table/local/dynamic/selectors';
import {call as fetchMany} from 'core/ajax';
import Pending from 'core/pending';
import {fetchNotifications} from 'core/notification';
let watching = false;
export default class {
/**
* @property {function[]} clickHandlers a list of handlers to call on click.
*/
clickHandlers = [];
constructor() {
this.addClickHandler(this.handleStateToggle);
this.addClickHandler(this.handleMoveUpDown);
this.registerEventListeners();
}
/**
* Initialise an instance of the class.
*
* This is just a way of making it easier to initialise an instance of the class from PHP.
*/
static init() {
if (watching) {
return;
}
watching = true;
new this();
}
/**
* Add a click handler to the list of handlers.
*
* @param {Function} handler A handler to call on a click event
*/
addClickHandler(handler) {
this.clickHandlers.push(handler.bind(this));
}
/**
* Register the event listeners for this instance.
*/
registerEventListeners() {
document.addEventListener('click', function(e) {
const tableRoot = this.getTableRoot(e);
if (!tableRoot) {
return;
}
this.clickHandlers.forEach((handler) => handler(tableRoot, e));
}.bind(this));
}
/**
* Get the table root from an event.
*
* @param {Event} e
* @returns {HTMLElement|bool}
*/
getTableRoot(e) {
const tableRoot = e.target.closest(Selectors.main.region);
if (!tableRoot) {
return false;
}
return tableRoot;
}
/**
* Set the plugin state (enabled or disabled)
*
* @param {string} methodname The web service to call
* @param {string} plugin The name of the plugin to set the state for
* @param {number} state The state to set
* @returns {Promise}
*/
setPluginState(methodname, plugin, state) {
return fetchMany([{
methodname,
args: {
plugin,
state,
},
}])[0];
}
setPluginOrder(methodname, plugin, direction) {
return fetchMany([{
methodname,
args: {
plugin,
direction,
},
}])[0];
}
/**
* Handle state toggling.
*
* @param {HTMLElement} tableRoot
* @param {Event} e
*/
async handleStateToggle(tableRoot, e) {
const stateToggle = e.target.closest('[data-action="togglestate"][data-toggle-method]');
if (stateToggle) {
e.preventDefault();
const pendingPromise = new Pending('core_table/dynamic:togglestate');
await this.setPluginState(
stateToggle.dataset.toggleMethod,
stateToggle.dataset.plugin,
stateToggle.dataset.state === '1' ? 0 : 1
);
const [updatedRoot] = await Promise.all([
refreshTableContent(tableRoot),
fetchNotifications(),
]);
// Refocus on the link that as pressed in the first place.
updatedRoot.querySelector(`[data-action="togglestate"][data-plugin="${stateToggle.dataset.plugin}"]`).focus();
// When clicking the toggle and it remains focused, a new tooltip will be generated.
// Therefore, the old tooltip should be removed.
this.removeTooltips();
pendingPromise.resolve();
}
}
async handleMoveUpDown(tableRoot, e) {
const actionLink = e.target.closest('[data-action="move"][data-method][data-direction]');
if (!actionLink) {
return;
}
e.preventDefault();
const pendingPromise = new Pending('core_table/dynamic:processAction');
await this.setPluginOrder(
actionLink.dataset.method,
actionLink.dataset.plugin,
actionLink.dataset.direction === 'up' ? -1 : 1,
);
const [updatedRoot] = await Promise.all([
refreshTableContent(tableRoot),
fetchNotifications(),
]);
// Refocus on the link that as pressed in the first place.
const exactMatch = updatedRoot.querySelector(
`[data-action="move"][data-plugin="${actionLink.dataset.plugin}"][data-direction="${actionLink.dataset.direction}"]`
);
if (exactMatch) {
exactMatch.focus();
} else {
// The move link is not present anymore, so we need to focus on the other one.
updatedRoot.querySelector(`[data-action="move"][data-plugin="${actionLink.dataset.plugin}"]`)?.focus();
}
pendingPromise.resolve();
}
/**
* Remove tooltips.
*/
removeTooltips() {
const tooltips = document.querySelectorAll('[id*="tooltip"]');
if (tooltips.length > 0) {
tooltips.forEach(tooltip => {
tooltip.remove();
});
}
}
}
-82
View File
@@ -1,82 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows to filter the plugin list on plugins overview page
*
* @module core_admin/plugins_overview
* @copyright 2024 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const SELECTORS = {
PLUGIN_FILTERS: '#plugins-overview-panel [data-filterby]',
PLUGIN_ROWS: 'table#plugins-control-panel tbody tr:not(.plugintypeheader)',
PLUGIN_TYPE_ROWS: 'table#plugins-control-panel tbody tr.plugintypeheader',
};
/**
* Initialise filters for the "Plugins overview" page
*/
export function init() {
const filters = document.querySelectorAll(SELECTORS.PLUGIN_FILTERS);
const pluginRows = document.querySelectorAll(SELECTORS.PLUGIN_ROWS);
const pluginTypeRows = document.querySelectorAll(SELECTORS.PLUGIN_TYPE_ROWS);
const filterPlugins = (target) => {
const filterBy = target.getAttribute('data-filterby');
const headerVisibility = {};
// Hide all plugin rows in the plugin table that do not match the filter and show all others.
for (const row of pluginRows) {
const type = [...row.classList].find(s => s.startsWith('type-'));
const visible = filterBy === 'all' ? true : row.classList.contains(filterBy);
row.style.display = visible ? null : 'none';
if (visible && type) {
headerVisibility[type] = true;
}
}
// Hide all the plugin type headers that do not have any visible plugins and show all others.
for (const row of pluginTypeRows) {
const type = [...row.classList].find(s => s.startsWith('type-'));
if (type) {
const visible = filterBy === 'all' || headerVisibility[type];
row.style.display = visible ? null : 'none';
}
}
// Toggle 'active' class for the selected filter.
filters.forEach(el => el.classList.remove('active'));
target.classList.add('active');
};
// Add event listeners for the links changing plugins filters.
filters
.forEach(target => target.addEventListener('click', (e) => {
e.preventDefault();
window.history.replaceState({}, null, e.target.href);
filterPlugins(target);
}));
// Pre-filter plugins based on the current url anchor.
if (window.location.hash.length > 1) {
const anchor = window.location.hash.substring(1);
const target = [...filters].find(t => t.getAttribute('data-filterby') === anchor);
if (target) {
filterPlugins(target);
}
}
}
@@ -1,104 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Modal for theme previews.
*
* @module core_admin/themeselector/preview_modal
* @copyright 2023 David Woloszyn <david.woloszyn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import ModalEvents from 'core/modal_events';
import ModalCancel from 'core/modal_cancel';
import ModalSaveCancel from 'core/modal_save_cancel';
import Notification from 'core/notification';
import Templates from 'core/templates';
import {getString} from 'core/str';
const SELECTORS = {
THEMES_CONTAINER: 'themelist',
PREVIEW: '[data-action="preview"]',
};
/**
* Entrypoint of the js.
*
* @method init
*/
export const init = () => {
registerListenerEvents();
};
/**
* Register theme related event listeners.
*
* @method registerListenerEvents
*/
const registerListenerEvents = () => {
document.addEventListener('click', (e) => {
const preview = e.target.closest(SELECTORS.PREVIEW);
if (preview) {
buildModal(preview).catch(Notification.exception);
}
});
};
/**
* Build the modal with the provided data.
*
* @method buildModal
* @param {object} element
*/
const buildModal = async(element) => {
// This string can be long. We will fetch it with JS as opposed to passing it as an attribute.
let description = await getString('choosereadme', 'theme_' + element.getAttribute('data-choose'));
const themesContainer = document.getElementById(SELECTORS.THEMES_CONTAINER);
const definedInConfig = parseInt(themesContainer.dataset.definedinconfig);
// Prepare data for modal.
const data = {
name: element.getAttribute('data-name'),
image: element.getAttribute('data-image'),
description: description.replace(/<[^>]+>/g, ' '), // Strip out HTML tags.
current: element.getAttribute('data-current'),
actionurl: element.getAttribute('data-actionurl'),
choose: element.getAttribute('data-choose'),
sesskey: element.getAttribute('data-sesskey'),
definedinconfig: definedInConfig,
};
// Determine which modal template we should use.
let modalTemplate = ModalSaveCancel;
if (data.current || data.definedinconfig) {
modalTemplate = ModalCancel;
}
const modal = await modalTemplate.create({
title: data.name,
body: Templates.render('core_admin/themeselector/theme_preview_modal', data),
large: true,
buttons: {
'save': getString('selecttheme', 'moodle'),
'cancel': getString('closebuttontitle', 'moodle'),
},
show: true,
});
modal.getRoot().on(ModalEvents.save, () => {
modal.getRoot().find('form').submit();
});
};
-113
View File
@@ -1,113 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows admin to configure antiviruses.
*
* @package core_antivirus
* @copyright 2015 Ruslan Kabalin, Lancaster University.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$antivirus = required_param('antivirus', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/antiviruses.php', array('action' => $action, 'antivirus' => $antivirus));
$PAGE->set_context(context_system::instance());
require_admin();
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageantiviruses";
// Get currently installed and enabled antivirus plugins.
$availableantiviruses = \core\antivirus\manager::get_available();
if (!empty($antivirus) and empty($availableantiviruses[$antivirus])) {
redirect ($returnurl);
}
$activeantiviruses = explode(',', $CFG->antiviruses);
foreach ($activeantiviruses as $key => $active) {
if (empty($availableantiviruses[$active])) {
unset($activeantiviruses[$key]);
}
}
if (!confirm_sesskey()) {
redirect($returnurl);
}
$needsupdate = false;
switch ($action) {
case 'disable':
// Remove from enabled list.
$class = \core_plugin_manager::resolve_plugininfo_class('antivirus');
$class::enable_plugin($antivirus, false);
break;
case 'enable':
// Add to enabled list.
if (!in_array($antivirus, $activeantiviruses)) {
$class = \core_plugin_manager::resolve_plugininfo_class('antivirus');
$class::enable_plugin($antivirus, true);
}
break;
case 'down':
$key = array_search($antivirus, $activeantiviruses);
// Check auth plugin is valid.
if ($key !== false) {
// Move down the list.
if ($key < (count($activeantiviruses) - 1)) {
$fsave = $activeantiviruses[$key];
$activeantiviruses[$key] = $activeantiviruses[$key + 1];
$activeantiviruses[$key + 1] = $fsave;
$needsupdate = true;
}
}
break;
case 'up':
$key = array_search($antivirus, $activeantiviruses);
// Check auth is valid.
if ($key !== false) {
// Move up the list.
if ($key >= 1) {
$fsave = $activeantiviruses[$key];
$activeantiviruses[$key] = $activeantiviruses[$key - 1];
$activeantiviruses[$key - 1] = $fsave;
$needsupdate = true;
}
}
break;
default:
break;
}
if ($needsupdate) {
$new = implode(',', $activeantiviruses);
add_to_config_log('antiviruses', $CFG->antiviruses, $new, 'core');
set_config('antiviruses', $new);
core_plugin_manager::reset_caches();
}
redirect ($returnurl);
+29 -18
View File
@@ -11,14 +11,15 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_admin();
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths'));
$PAGE->set_url($returnurl);
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$auth = optional_param('auth', '', PARAM_PLUGIN);
$action = optional_param('action', '', PARAM_ACTION);
$auth = optional_param('auth', '', PARAM_SAFEDIR);
get_enabled_auth_plugins(true); // fix the list of enabled auths
if (empty($CFG->auth)) {
@@ -28,7 +29,7 @@ if (empty($CFG->auth)) {
}
if (!empty($auth) and !exists_auth_plugin($auth)) {
throw new \moodle_exception('pluginnotinstalled', 'auth', $returnurl, $auth);
print_error('pluginnotinstalled', 'auth', $returnurl, $auth);
}
////////////////////////////////////////////////////////////////////////////////
@@ -40,31 +41,41 @@ if (!confirm_sesskey()) {
switch ($action) {
case 'disable':
// Remove from enabled list.
$class = \core_plugin_manager::resolve_plugininfo_class('auth');
$class::enable_plugin($auth, false);
// remove from enabled list
$key = array_search($auth, $authsenabled);
if ($key !== false) {
unset($authsenabled[$key]);
set_config('auth', implode(',', $authsenabled));
}
if ($auth == $CFG->registerauth) {
set_config('registerauth', '');
}
session_gc(); // remove stale sessions
break;
case 'enable':
// Add to enabled list.
$class = \core_plugin_manager::resolve_plugininfo_class('auth');
$class::enable_plugin($auth, true);
// add to enabled list
if (!in_array($auth, $authsenabled)) {
$authsenabled[] = $auth;
$authsenabled = array_unique($authsenabled);
set_config('auth', implode(',', $authsenabled));
}
session_gc(); // remove stale sessions
break;
case 'down':
$key = array_search($auth, $authsenabled);
// check auth plugin is valid
if ($key === false) {
throw new \moodle_exception('pluginnotenabled', 'auth', $returnurl, $auth);
print_error('pluginnotenabled', 'auth', $returnurl, $auth);
}
// move down the list
if ($key < (count($authsenabled) - 1)) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key + 1];
$authsenabled[$key + 1] = $fsave;
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
break;
@@ -72,16 +83,14 @@ switch ($action) {
$key = array_search($auth, $authsenabled);
// check auth is valid
if ($key === false) {
throw new \moodle_exception('pluginnotenabled', 'auth', $returnurl, $auth);
print_error('pluginnotenabled', 'auth', $returnurl, $auth);
}
// move up the list
if ($key >= 1) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key - 1];
$authsenabled[$key - 1] = $fsave;
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
break;
@@ -90,3 +99,5 @@ switch ($action) {
}
redirect($returnurl);
+179
View File
@@ -0,0 +1,179 @@
<?php
/**
* Edit configuration for an individual auth plugin
*/
require_once '../config.php';
require_once $CFG->libdir.'/adminlib.php';
$auth = required_param('auth', PARAM_SAFEDIR);
$PAGE->set_pagetype('admin-auth-' . $auth);
admin_externalpage_setup('authsetting'.$auth);
$authplugin = get_auth_plugin($auth);
$err = array();
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
// save configuration changes
if ($frm = data_submitted() and confirm_sesskey()) {
$authplugin->validate_form($frm, $err);
if (count($err) == 0) {
// save plugin config
if ($authplugin->process_config($frm)) {
// save field lock configuration
foreach ($frm as $name => $value) {
if (preg_match('/^lockconfig_(.+?)$/', $name, $matches)) {
$plugin = "auth/$auth";
$name = $matches[1];
set_config($name, $value, $plugin);
}
}
redirect($returnurl);
exit;
}
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
} else {
$frmlegacystyle = get_config('auth/'.$auth);
$frmnewstyle = get_config('auth_'.$auth);
$frm = (object)array_merge((array)$frmlegacystyle, (array)$frmnewstyle);
}
$user_fields = $authplugin->userfields;
//$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "institution", "department", "address", "city", "country", "description", "idnumber", "lang");
/// Get the auth title (from core or own auth lang files)
$authtitle = $authplugin->get_title();
/// Get the auth descriptions (from core or own auth lang files)
$authdescription = $authplugin->get_description();
// output configuration form
echo $OUTPUT->header();
// choose an authentication method
echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// auth plugin description
echo $OUTPUT->box_start();
echo $OUTPUT->heading($authtitle);
echo $OUTPUT->box_start('informationbox');
echo $authdescription;
echo $OUTPUT->box_end();
echo "<hr />\n";
$authplugin->config_form($frm, $err, $user_fields);
echo $OUTPUT->box_end();
echo '<p style="text-align: center"><input type="submit" value="' . get_string("savechanges") . "\" /></p>\n";
echo "</div>\n";
echo "</form>\n";
echo $OUTPUT->footer();
exit;
/// Functions /////////////////////////////////////////////////////////////////
// Good enough for most auth plugins
// but some may want a custom one if they are offering
// other options
// Note: lockconfig_ fields have special handling.
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
global $OUTPUT;
echo '<tr><td colspan="3">';
if ($retrieveopts) {
echo $OUTPUT->heading(get_string('auth_data_mapping', 'auth'));
} else {
echo $OUTPUT->heading(get_string('auth_fieldlocks', 'auth'));
}
echo '</td></tr>';
$lockoptions = array ('unlocked' => get_string('unlocked', 'auth'),
'unlockedifempty' => get_string('unlockedifempty', 'auth'),
'locked' => get_string('locked', 'auth'));
$updatelocaloptions = array('oncreate' => get_string('update_oncreate', 'auth'),
'onlogin' => get_string('update_onlogin', 'auth'));
$updateextoptions = array('0' => get_string('update_never', 'auth'),
'1' => get_string('update_onupdate', 'auth'));
$pluginconfig = get_config("auth/$auth");
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
}
foreach ($user_fields as $field) {
// Define some vars we'll work with
if (!isset($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
if (!isset($pluginconfig->{"field_updatelocal_$field"})) {
$pluginconfig->{"field_updatelocal_$field"} = '';
}
if (!isset($pluginconfig->{"field_updateremote_$field"})) {
$pluginconfig->{"field_updateremote_$field"} = '';
}
if (!isset($pluginconfig->{"field_lock_$field"})) {
$pluginconfig->{"field_lock_$field"} = '';
}
// define the fieldname we display to the user
$fieldname = $field;
if ($fieldname === 'lang') {
$fieldname = get_string('language');
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
$fieldname = get_string($fieldname);
}
if ($retrieveopts) {
$varname = 'field_map_' . $field;
echo '<tr valign="top"><td align="right">';
echo '<label for="lockconfig_'.$varname.'">'.$fieldname.'</label>';
echo '</td><td>';
echo "<input id=\"lockconfig_{$varname}\" name=\"lockconfig_{$varname}\" type=\"text\" size=\"30\" value=\"{$pluginconfig->$varname}\" />";
echo '<div style="text-align: right">';
echo '<label for="menulockconfig_field_updatelocal_'.$field.'">'.get_string('auth_updatelocal', 'auth') . '</label>&nbsp;';
echo html_writer::select($updatelocaloptions, "lockconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, false);
echo '<br />';
if ($updateopts) {
echo '<label for="menulockconfig_field_updateremote_'.$field.'">'.get_string('auth_updateremote', 'auth') . '</label>&nbsp;';
echo html_writer::select($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, false);
echo '<br />';
}
echo '<label for="menulockconfig_field_lock_'.$field.'">'.get_string('auth_fieldlock', 'auth') . '</label>&nbsp;';
echo html_writer::select($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false);
echo '</div>';
} else {
echo '<tr valign="top"><td align="right">';
echo '<label for="menulockconfig_field_lock_'.$field.'">'.$fieldname.'</label>';
echo '</td><td>';
echo html_writer::select($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false);
}
echo '</td>';
if (!empty($helptext)) {
echo '<td rowspan="' . count($user_fields) . '">' . $helptext . '</td>';
$helptext = '';
}
echo '</tr>';
}
}
+76
View File
@@ -0,0 +1,76 @@
<?php
// block.php - allows admin to edit all local configuration variables for a block
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$blockid = required_param('block', PARAM_INT);
if(!$blockrecord = blocks_get_record($blockid)) {
print_error('blockdoesnotexist', 'error');
}
admin_externalpage_setup('blocksetting'.$blockrecord->name);
$block = block_instance($blockrecord->name);
if($block === false) {
print_error('blockcannotinistantiate', 'error');
}
// Define the data we're going to silently include in the instance config form here,
// so we can strip them from the submitted data BEFORE handling it.
$hiddendata = array(
'block' => $blockid,
'sesskey' => sesskey()
);
/// If data submitted, then process and store.
if ($config = data_submitted()) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
if(!$block->has_config()) {
print_error('blockcannotconfig', 'error');
}
$remove = array_keys($hiddendata);
foreach($remove as $item) {
unset($config->$item);
}
$block->config_save($config);
redirect("$CFG->wwwroot/$CFG->admin/blocks.php", get_string("changessaved"), 1);
exit;
}
/// Otherwise print the form.
$strmanageblocks = get_string('manageblocks');
$strblockname = $block->get_title();
echo $OUTPUT->header();
echo $OUTPUT->heading($strblockname);
echo $OUTPUT->notification('This block still uses an old-style config_global.html file. ' .
'It must be updated by a developer to use a settings.php file.');
echo $OUTPUT->box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter');
echo '<br />';
echo '<form method="post" action="block.php">';
echo '<p>';
foreach($hiddendata as $name => $val) {
echo '<input type="hidden" name="'. $name .'" value="'. $val .'" />';
}
echo '</p>';
echo $OUTPUT->box_start();
include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html');
echo $OUTPUT->box_end();
echo '</form>';
echo $OUTPUT->footer();
+269 -79
View File
@@ -1,94 +1,284 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows the admin to configure blocks (hide/show, uninstall and configure)
*
* @package core_admin
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Allows the admin to configure blocks (hide/show, delete and configure)
require_once('../config.php');
require_once("{$CFG->libdir}/adminlib.php");
require_once("{$CFG->libdir}/blocklib.php");
require_once("{$CFG->libdir}/tablelib.php");
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('manageblocks');
admin_externalpage_setup('manageblocks');
$plugin = optional_param('plugin', '', PARAM_PLUGIN);
$action = optional_param('action', '', PARAM_ALPHA);
$unprotect = optional_param('unprotect', 0, PARAM_PLUGIN);
$protect = optional_param('protect', 0, PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$unprotect = optional_param('unprotect', 0, PARAM_INT);
$protect = optional_param('protect', 0, PARAM_INT);
$strmanageblocks = get_string('manageblocks');
/// Print headings
// If data submitted, then process and store.
if (!empty($plugin) && !empty($action) && confirm_sesskey()) {
$manager = \core_plugin_manager::resolve_plugininfo_class('block');
$pluginname = get_string('pluginname', "block_{$plugin}");
$strmanageblocks = get_string('manageblocks');
$strdelete = get_string('delete');
$strversion = get_string('version');
$strhide = get_string('hide');
$strshow = get_string('show');
$strsettings = get_string('settings');
$strcourses = get_string('blockinstances', 'admin');
$strname = get_string('name');
$strshowblockcourse = get_string('showblockcourse');
$strprotecthdr = get_string('blockprotect', 'admin'). $OUTPUT->help_icon('blockprotect','admin');
$strprotect = get_string('blockprotect', 'admin');
$strunprotect = get_string('blockunprotect', 'admin');
if ($action === 'disable' && $manager::enable_plugin($plugin, 0)) {
\core\notification::add(
get_string('plugin_disabled', 'core_admin', $pluginname),
\core\notification::SUCCESS
);
// Settings not required - only pages.
admin_get_root(true, false);
} else if ($action === 'enable' && $manager::enable_plugin($plugin, 1)) {
\core\notification::add(
get_string('plugin_enabled', 'core_admin', $pluginname),
\core\notification::SUCCESS
);
/// If data submitted, then process and store.
// Settings not required - only pages.
admin_get_root(true, false);
if (!empty($hide) && confirm_sesskey()) {
if (!$block = $DB->get_record('block', array('id'=>$hide))) {
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
admin_get_root(true, false); // settings not required - only pages
}
// Redirect back to the page with out any params.
redirect(new moodle_url('/admin/blocks.php'));
}
if (!empty($show) && confirm_sesskey() ) {
if (!$block = $DB->get_record('block', array('id'=>$show))) {
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($protect) && confirm_sesskey()) {
block_manager::protect_block($protect);
$pluginname = get_string('pluginname', "block_{$protect}");
\core\notification::add(
get_string('blockprotected', 'core_admin', $pluginname),
\core\notification::SUCCESS
);
// Settings not required - only pages.
admin_get_root(true, false);
}
if (!isset($CFG->undeletableblocktypes) || (!is_array($CFG->undeletableblocktypes) && !is_string($CFG->undeletableblocktypes))) {
$undeletableblocktypes = array('navigation', 'settings');
} else if (is_string($CFG->undeletableblocktypes)) {
$undeletableblocktypes = explode(',', $CFG->undeletableblocktypes);
} else {
$undeletableblocktypes = $CFG->undeletableblocktypes;
}
if (!empty($unprotect) && confirm_sesskey()) {
block_manager::unprotect_block($unprotect);
$pluginname = get_string('pluginname', "block_{$unprotect}");
\core\notification::add(
get_string('blockunprotected', 'core_admin', $pluginname),
\core\notification::SUCCESS
);
// Settings not required - only pages.
admin_get_root(true, false);
}
if (!empty($protect) && confirm_sesskey()) {
if (!$block = $DB->get_record('block', array('id'=>$protect))) {
print_error('blockdoesnotexist', 'error');
}
if (!in_array($block->name, $undeletableblocktypes)) {
$undeletableblocktypes[] = $block->name;
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
}
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($unprotect) && confirm_sesskey()) {
if (!$block = $DB->get_record('block', array('id'=>$unprotect))) {
print_error('blockdoesnotexist', 'error');
}
if (in_array($block->name, $undeletableblocktypes)) {
$undeletableblocktypes = array_diff($undeletableblocktypes, array($block->name));
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
}
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($delete) && confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
if (!$block = blocks_get_record($delete)) {
print_error('blockdoesnotexist', 'error');
}
if (get_string_manager()->string_exists('pluginname', "block_$block->name")) {
$strblockname = get_string('pluginname', "block_$block->name");
} else {
$strblockname = $block->name;
}
if (!$confirm) {
echo $OUTPUT->confirm(get_string('blockdeleteconfirm', '', $strblockname), 'blocks.php?delete='.$block->id.'&confirm=1', 'blocks.php');
echo $OUTPUT->footer();
exit;
} else {
// Inform block it's about to be deleted
if (file_exists("$CFG->dirroot/blocks/$block->name/block_$block->name.php")) {
$blockobject = block_instance($block->name);
if ($blockobject) {
$blockobject->before_delete(); //only if we can create instance, block might have been already removed
}
}
// First delete instances and then block
$instances = $DB->get_records('block_instances', array('blockname' => $block->name));
if(!empty($instances)) {
foreach($instances as $instance) {
blocks_delete_instance($instance);
}
}
// Delete block
$DB->delete_records('block', array('id'=>$block->id));
drop_plugin_tables($block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false); // old obsoleted table names
drop_plugin_tables('block_'.$block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false);
// Delete the capabilities that were defined by this block
capabilities_cleanup('block/'.$block->name);
// Remove event handlers and dequeue pending events
events_uninstall('block/'.$block->name);
$a->block = $strblockname;
$a->directory = $CFG->dirroot.'/blocks/'.$block->name;
notice(get_string('blockdeletefiles', '', $a), 'blocks.php');
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
/// Main display starts here
/// Get and sort the existing blocks
if (!$blocks = $DB->get_records('block', array(), 'name ASC')) {
print_error('noblocks', 'error'); // Should never happen
}
$incompatible = array();
/// Print the table of all blocks
$table = new flexible_table('admin-blocks-compatible');
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
$table->setup();
$tablerows = array();
foreach ($blocks as $blockid=>$block) {
$blockname = $block->name;
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false;
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new stdClass();
$plugin->version = $block->version;
} else {
$plugin = new stdClass();
$plugin->version = '???';
if (file_exists("$CFG->dirroot/blocks/$blockname/version.php")) {
include("$CFG->dirroot/blocks/$blockname/version.php");
}
if (!$blockobject = block_instance($block->name)) {
$incompatible[] = $block;
continue;
}
$strblockname = get_string('pluginname', 'block_'.$blockname);
}
$delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>';
$settings = ''; // By default, no configuration
if ($blockobject and $blockobject->has_config()) {
$blocksettings = admin_get_root()->locate('blocksetting' . $block->name);
if ($blocksettings instanceof admin_externalpage) {
$settings = '<a href="' . $blocksettings->url . '">' . get_string('settings') . '</a>';
} else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
}
}
// MDL-11167, blocks can be placed on mymoodle, or the blogs page
// and it should not show up on course search page
$totalcount = $DB->count_records('block_instances', array('blockname'=>$blockname));
$count = $DB->count_records('block_instances', array('blockname'=>$blockname, 'pagetypepattern'=>'course-view-*'));
if ($count>0) {
$blocklist = "<a href=\"{$CFG->wwwroot}/course/search.php?blocklist=$blockid&amp;sesskey=".sesskey()."\" ";
$blocklist .= "title=\"$strshowblockcourse\" >$totalcount</a>";
}
else {
$blocklist = "$totalcount";
}
$class = ''; // Nothing fancy, by default
if (!$blockobject) {
// ignore
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}
if ($block->version == $plugin->version) {
$version = $block->version;
} else {
$version = "$block->version ($plugin->version)";
}
if (!$blockobject) {
// ignore
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
}
$row = array(
'<span'.$class.'>'.$strblockname.'</span>',
$blocklist,
'<span'.$class.'>'.$version.'</span>',
$visible,
$undeletable,
$delete,
$settings
);
$tablerows[] = array(strip_tags($strblockname), $row); // first element will be used for sorting
}
textlib_get_instance()->asort($tablerows);
foreach ($tablerows as $row) {
$table->add_data($row[1]);
}
$table->print_html();
if (!empty($incompatible)) {
echo $OUTPUT->heading(get_string('incompatibleblocks', 'blockstable', 'admin'));
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'incompatibleblockstable generaltable');
$table->setup();
foreach ($incompatible as $block) {
$table->add_data(array(
$block->name,
'<a href="blocks.php?delete='.$block->id.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>',
));
}
$table->print_html();
}
echo $OUTPUT->footer();
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
echo $OUTPUT->notification(get_string('noteunneededblocks', 'admin'), 'info', false);
// Print the table of all blocks.
$table = new \core_admin\table\block_management_table();
$table->out();
echo $OUTPUT->footer();
+152
View File
@@ -0,0 +1,152 @@
<?php
/// Create "blog" forums in each course and copy blog entries from these courses' participants in these forums
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/blog/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('bloglevelupgrade');
$PAGE->set_pagelayout('maintenance');
$go = optional_param('go', 0, PARAM_BOOL);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('bloglevelupgrade', 'admin'));
$strbloglevelupgrade = get_string('bloglevelupgradeinfo', 'admin');
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
echo $OUTPUT->confirm($strbloglevelupgrade, new moodle_url('bloglevelupgrade.php', $optionsyes), 'index.php');
echo $OUTPUT->footer();
die;
}
echo $OUTPUT->box_start();
/// Turn off time limits, sometimes upgrades can be slow.
set_time_limit(0);
$i = 0;
// If $CFG->bloglevel is set to BLOG_GROUP_LEVEL or BLOG_COURSE_LEVEL, create a new "blog" forum in each course
// whose enrolled students have written blog entries, copy these entries in that forum and switch off blogs at site level
if ($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL) {
$pbar = new progress_bar('bloglevelupgrade', 500, true);
$bloggers = $DB->get_records_sql("SELECT userid FROM {post} WHERE module = 'blog' GROUP BY userid");
require_once($CFG->dirroot.'/mod/forum/lib.php');
$a = new stdClass();
$a->userscount = 0;
$a->blogcount = 0;
foreach ($bloggers as $blogger) {
$courses = enrol_get_users_courses($blogger->userid, true, 'groupmode,groupmodeforce');
$blogentries = $DB->get_records('post', array('module' => 'blog', 'userid' => $blogger->userid));
foreach ($courses as $course) {
$forum = forum_get_course_forum($course->id, 'blog');
$cm = get_coursemodule_from_instance('forum', $forum->id);
if ($CFG->bloglevel == BLOG_GROUP_LEVEL && $course->groupmode != NOGROUPS) {
// Unless the course is set to separate groups forced, force the forum to Separate groups
if (!($course->groupmode == SEPARATEGROUPS && $course->groupmodeforce)) {
$cm->groupmode = SEPARATEGROUPS;
$DB->update_record('course_modules', $cm);
}
$groups = groups_get_user_groups($course->id, $blogger->userid);
foreach ($groups[0] as $groupid) { // [0] is for all groupings combined
$a->blogcount += bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid);
}
} else {
$a->blogcount += bloglevelupgrade_entries($blogentries, $forum, $cm);
}
}
$a->userscount = $i . '/' . count($bloggers);
$pbar->update($i, count($bloggers), get_string('bloglevelupgradeprogress', 'admin', $a));
$i++;
}
}
function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
$count = 0;
$forumcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
foreach ($blogentries as $blogentry) {
$discussion = new stdClass();
$discussion->course = $forum->course;
$discussion->forum = $forum->id;
$discussion->name = $blogentry->subject;
$discussion->assessed = $forum->assessed;
$discussion->message = $blogentry->summary;
$discussion->messageformat = $blogentry->summaryformat;
$discussion->messagetrust = 0;
$discussion->attachments = 0;
$discussion->mailnow = false;
$discussion->timemodified = $blogentry->created;
$discussion->itemid = null;
$discussion->groupid = $groupid;
$message = '';
$discussionid = forum_add_discussion($discussion, null, $message);
// Copy file attachment records
$fs = get_file_storage();
$files = $fs->get_area_files($sitecontext->id, 'blog', 'attachment', $blogentry->id);
if (!empty($files)) {
foreach ($files as $storedfile) {
$newfile = new stdClass();
$newfile->component = 'mod_forum';
$newfile->filearea = 'attachment';
$newfile->itemid = $discussion->firstpost;
$newfile->contextid = $forumcontext->id;
$fs->create_file_from_storedfile($newfile, $storedfile->get_id());
}
}
$files = $fs->get_area_files($sitecontext->id, 'blog', 'post', $blogentry->id);
if (!empty($files)) {
foreach ($files as $storedfile) {
$newfile = new stdClass();
$newfile->component = 'mod_forum';
$newfile->filearea = 'post';
$newfile->itemid = $discussion->firstpost;
$newfile->contextid = $forumcontext->id;
$fs->create_file_from_storedfile($newfile, $storedfile->get_id());
}
}
$count++;
}
return $count;
}
// END OF LOOP
// set conversion flag - switches to new plugin automatically
set_config('bloglevel_upgrade_complete', 1);
// Finally switch bloglevel to 0 (disabled)
set_config('bloglevel', 0);
echo $OUTPUT->box_end();
/// Rebuild course cache which might be incorrect now
echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
rebuild_course_cache();
echo $OUTPUT->notification('...finished', 'notifysuccess');
echo $OUTPUT->continue_button('index.php');
echo $OUTPUT->footer();
die;
-167
View File
@@ -1,167 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is used to display a categories sub categories, external pages, and settings.
*
* @since Moodle 2.3
* @package admin
* @copyright 2011 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$category = required_param('category', PARAM_SAFEDIR);
$return = optional_param('return','', PARAM_ALPHA);
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
require_login(0, false);
$PAGE->set_context(context_system::instance());
$PAGE->set_url('/admin/category.php', array('category' => $category));
$PAGE->set_pagetype('admin-setting-' . $category);
$PAGE->set_pagelayout('admin');
$PAGE->navigation->clear_cache();
$adminroot = admin_get_root(); // need all settings
$settingspage = $adminroot->locate($category, true);
if (empty($settingspage) or !($settingspage instanceof admin_category)) {
throw new \moodle_exception('categoryerror', 'error', "$CFG->wwwroot/$CFG->admin/");
}
if (!($settingspage->check_access())) {
throw new \moodle_exception('accessdenied', 'admin');
}
$hassiteconfig = has_capability('moodle/site:config', $PAGE->context);
if ($hassiteconfig) {
$PAGE->add_header_action($OUTPUT->render_from_template('core_admin/header_search_input', [
'action' => new moodle_url('/admin/search.php'),
]));
}
$statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
$count = admin_write_settings($data);
if (empty($adminroot->errors)) {
// No errors. Did we change any setting? If so, then indicate success.
if ($count) {
$statusmsg = get_string('changessaved');
} else {
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
}
}
} else {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
}
$settingspage = $adminroot->locate($category, true);
}
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
$USER->editing = $adminediting;
}
$buttons = null;
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
$url = clone($PAGE->url);
if ($PAGE->user_is_editing()) {
$caption = get_string('blockseditoff');
$url->param('adminedit', 'off');
} else {
$caption = get_string('blocksediton');
$url->param('adminedit', 'on');
}
$buttons = $OUTPUT->single_button($url, $caption, 'get');
}
$savebutton = false;
$outputhtml = '';
foreach ($settingspage->children as $childpage) {
if ($childpage->is_hidden() || !$childpage->check_access()) {
continue;
}
if ($childpage instanceof admin_externalpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
} else if ($childpage instanceof admin_settingpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
// If its a settings page and has settings lets display them.
if (!empty($childpage->settings)) {
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
foreach ($childpage->settings as $setting) {
if (empty($setting->nosave)) {
$savebutton = true;
}
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
$data = $adminroot->errors[$fullname]->data;
} else {
$data = $setting->get_setting();
}
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
$outputhtml .= $setting->output_html($data);
if ($childpage->has_dependencies()) {
$context = ['dependencies' => json_encode($childpage->get_dependencies_for_javascript())];
echo $OUTPUT->render_from_template('core_admin/settings_showhide', $context);
}
}
$outputhtml .= html_writer::end_tag('fieldset');
}
} else if ($childpage instanceof admin_category) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
}
}
if ($savebutton) {
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'btn btn-primary form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::end_tag('div');
}
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$PAGE->set_heading($SITE->fullname);
if ($buttons) {
$PAGE->set_button($buttons);
}
echo $OUTPUT->header();
if ($errormsg !== '') {
echo $OUTPUT->notification($errormsg);
} else if ($statusmsg !== '') {
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}
echo $OUTPUT->heading(get_string('admincategory', 'admin', $settingspage->visiblename), 2);
echo html_writer::start_tag('form', array('action' => '', 'method' => 'post', 'id' => 'adminsettings'));
echo html_writer::start_tag('div');
echo html_writer::input_hidden_params(new moodle_url($PAGE->url, array('sesskey' => sesskey(), 'return' => $return)));
echo html_writer::end_tag('div');
echo html_writer::start_tag('fieldset');
echo html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
// Add the form change checker.
$PAGE->requires->js_call_amd('core_form/changechecker', 'watchFormById', ['adminsettings']);
echo $OUTPUT->footer();
@@ -1,74 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\admin;
use admin_setting;
/**
* Render a notification as part of other admin settings.
*
* @package core_admin
* @subpackage admin
* @copyright 2025 Matt Porritt <matt.porritt@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_notification extends admin_setting {
/**
* Constructor.
*
* @param string $name The name of the setting.
* @param string $notification The notification to display.
* @param string $type The type of notification.
* @param bool $cancelable Whether the notification can be canceled.
*/
public function __construct(
string $name,
/** @var string The notification to display. */
protected string $notification,
/** @var string The type of notification. */
protected string $type = 'info',
/** @var bool Whether the notification can be canceled. */
protected bool $cancelable = false
) {
$this->nosave = true;
parent::__construct($name, '', '', '');
}
#[\Override]
public function get_setting(): bool {
return true;
}
#[\Override]
public function get_defaultsetting(): bool {
return true;
}
#[\Override]
public function write_setting($data): string {
// Do not write any setting.
return '';
}
#[\Override]
public function output_html($data, $query = ''): string {
global $OUTPUT;
return $OUTPUT->notification($this->notification, $this->type, $this->cancelable);
}
}
@@ -1,127 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\admin;
use admin_setting;
use core_plugin_manager;
use core_text;
/**
* Admin setting plugin manager.
*
* @package core_admin
* @subpackage admin
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_plugin_manager extends admin_setting {
/** @var core_plugin_manager The plugin manager instance */
protected core_plugin_manager $pluginmanager;
/** @var string The plugintype that this manager covers */
protected string $plugintype;
/** @var string The class of the management table to use */
protected string $tableclass;
public function __construct(
string $plugintype,
string $tableclass,
string $name,
string $visiblename,
string $description = '',
string $defaultsetting = '',
) {
$this->nosave = true;
$this->pluginmanager = core_plugin_manager::instance();
$this->plugintype = $plugintype;
$this->tableclass = $tableclass;
parent::__construct($name, $visiblename, $description, $defaultsetting);
}
/**
* Always returns true, does nothing
*
* @return true
*/
public function get_setting(): bool {
return true;
}
/**
* Always returns true, does nothing
*
* @return true
*/
public function get_defaultsetting(): bool {
return true;
}
/**
* Always returns '', does not write anything
*
* @return string Always returns ''
*/
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
public function write_setting($data): string {
// Do not write any setting.
return '';
}
/**
* Checks if $query is one of the available editors
*
* @param string $query The string to search for
* @return bool Returns true if found, false if not
*/
public function is_related($query) {
if (parent::is_related($query)) {
return true;
}
$plugins = $this->pluginmanager->get_installed_plugins($this->plugintype);
foreach (array_keys($plugins) as $plugin) {
$plugin = "{$this->plugintype}_{$plugin}";
if (str_contains($plugin, $query)) {
return true;
}
$pluginname = get_string('pluginname', $plugin);
if (strpos(core_text::strtolower($pluginname), $query) !== false) {
return true;
}
}
return false;
}
/**
* Builds the XHTML to display the control
*
* @param string $data Unused
* @param string $query
* @return string
*/
public function output_html($data, $query = ''): string {
$table = new $this->tableclass();
if (!($table instanceof \core_admin\table\plugin_management_table)) {
throw new \coding_exception("{$this->tableclass} must be an instance of \\core_admin\\table\\plugin_management_table");
}
return highlight($query, $table->get_content());
}
}
@@ -1,73 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\admin;
use admin_setting;
/**
* Render a template as part of other admin settings.
* Use for rendering additional html in settings.
*
* @package core_admin
* @subpackage admin
* @copyright 2024 Matt Porritt <matt.porritt@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_template_render extends admin_setting {
/**
* Constructor.
*
* @param string $name The name of the setting.
* @param string $templatename The name of the template to render.
* @param array|\stdClass $context The context to pass to the template.
*/
public function __construct(
string $name,
/** @var string The name of the template to render. */
protected string $templatename,
/** @var array|\stdClass The context to pass to the template. */
protected array|\stdClass $context
) {
$this->nosave = true;
parent::__construct($name, $templatename, '', '');
}
#[\Override]
public function get_setting(): bool {
return true;
}
#[\Override]
public function get_defaultsetting(): bool {
return true;
}
#[\Override]
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
public function write_setting($data): string {
// Do not write any setting.
return '';
}
#[\Override]
public function output_html($data, $query = ''): string {
global $OUTPUT;
return $OUTPUT->render_from_template($this->templatename, $this->context);
}
}
-97
View File
@@ -1,97 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\external;
use block_manager;
use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;
use core_external\external_value;
/**
* Web Service to control the state of a plugin.
*
* @package core_admin
* @category external
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class set_block_protection extends external_api {
/**
* Returns description of method parameters
*
* @return external_function_parameters
*/
public static function execute_parameters(): external_function_parameters {
return new external_function_parameters([
'plugin' => new external_value(PARAM_PLUGIN, 'The name of the plugin', VALUE_REQUIRED),
'state' => new external_value(PARAM_INT, 'The target state', VALUE_REQUIRED),
]);
}
/**
* Set the block protection state.
*
* @param string $plugin The name of the plugin
* @param int $state The target state
* @return null
*/
public static function execute(
string $plugin,
int $state,
): array {
[
'plugin' => $plugin,
'state' => $state,
] = self::validate_parameters(self::execute_parameters(), [
'plugin' => $plugin,
'state' => $state,
]);
$context = \context_system::instance();
self::validate_context($context);
require_capability('moodle/site:config', $context);
[, $pluginname] = explode('_', \core_component::normalize_componentname($plugin), 2);
$displayname = get_string('pluginname', $plugin);
if ($state) {
block_manager::protect_block($pluginname);
\core\notification::add(
get_string('blockprotected', 'core_admin', $displayname),
\core\notification::SUCCESS
);
} else {
block_manager::unprotect_block($pluginname);
\core\notification::add(
get_string('blockunprotected', 'core_admin', $displayname),
\core\notification::SUCCESS
);
}
return [];
}
/**
* Describe the return structure of the external service.
*
* @return external_single_structure
*/
public static function execute_returns(): external_single_structure {
return new external_single_structure([]);
}
}
-84
View File
@@ -1,84 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\external;
use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;
use core_external\external_value;
/**
* Web Service to control the order of a plugin.
*
* @package core_admin
* @category external
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class set_plugin_order extends external_api {
/**
* Returns description of method parameters
*
* @return external_function_parameters
*/
public static function execute_parameters(): external_function_parameters {
return new external_function_parameters([
'plugin' => new external_value(PARAM_PLUGIN, 'The name of the plugin', VALUE_REQUIRED),
'direction' => new external_value(PARAM_INT, 'The direction to move', VALUE_REQUIRED),
]);
}
/**
* Set the plugin state.
*
* @param string $plugin The name of the plugin
* @param int $direction The direction to move the plugin
* @return array
*/
public static function execute(
string $plugin,
int $direction,
): array {
[
'plugin' => $plugin,
'direction' => $direction,
] = self::validate_parameters(self::execute_parameters(), [
'plugin' => $plugin,
'direction' => $direction,
]);
$context = \context_system::instance();
self::validate_context($context);
require_capability('moodle/site:config', $context);
[$plugintype, $pluginname] = explode('_', \core_component::normalize_componentname($plugin), 2);
$manager = \core_plugin_manager::resolve_plugininfo_class($plugintype);
$manager::change_plugin_order($pluginname, $direction);
return [];
}
/**
* Describe the return structure of the external service.
*
* @return external_single_structure
*/
public static function execute_returns(): external_single_structure {
return new external_single_structure([]);
}
}
-98
View File
@@ -1,98 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\external;
use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;
use core_external\external_value;
/**
* Web Service to control the state of a plugin.
*
* @package core_admin
* @category external
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class set_plugin_state extends external_api {
/**
* Returns description of method parameters
*
* @return external_function_parameters
*/
public static function execute_parameters(): external_function_parameters {
return new external_function_parameters([
'plugin' => new external_value(PARAM_PLUGIN, 'The name of the plugin', VALUE_REQUIRED),
'state' => new external_value(PARAM_INT, 'The target state', VALUE_REQUIRED),
]);
}
/**
* Set the plugin state.
*
* @param string $plugin The name of the plugin
* @param int $state The target state
* @return null
*/
public static function execute(
string $plugin,
int $state,
): array {
[
'plugin' => $plugin,
'state' => $state,
] = self::validate_parameters(self::execute_parameters(), [
'plugin' => $plugin,
'state' => $state,
]);
$context = \context_system::instance();
self::validate_context($context);
require_capability('moodle/site:config', $context);
[$plugintype, $pluginname] = explode('_', \core_component::normalize_componentname($plugin), 2);
$manager = \core_plugin_manager::resolve_plugininfo_class($plugintype);
$displayname = get_string('pluginname', $plugin);
if ($manager::enable_plugin($pluginname, $state)) {
if (!empty($state)) {
\core\notification::add(
get_string('plugin_enabled', 'core_admin', $displayname),
\core\notification::SUCCESS
);
} else {
\core\notification::add(
get_string('plugin_disabled', 'core_admin', $displayname),
\core\notification::SUCCESS
);
}
}
return [];
}
/**
* Describe the return structure of the external service.
*
* @return external_single_structure
*/
public static function execute_returns(): external_single_structure {
return new external_single_structure([]);
}
}
-77
View File
@@ -1,77 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Form for selective purging of caches.
*
* @package core
* @copyright 2018 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\form;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php');
/**
* Form for selecting which caches to purge on admin/purgecaches.php
*
* @package core
* @copyright 2018 The Open University
* @author Mark Johnson <mark.johnson@open.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class purge_caches extends \moodleform {
/**
* Define a "Purge all caches" button, and a fieldset with checkboxes for selectively purging separate caches.
*/
public function definition() {
$mform = $this->_form;
$mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
$mform->setType('returnurl', PARAM_LOCALURL);
$mform->addElement('submit', 'all', get_string('purgecaches', 'admin'));
$mform->addElement('header', 'purgecacheheader', get_string('purgeselectedcaches', 'admin'));
$checkboxes = [
$mform->createElement('advcheckbox', 'theme', '', get_string('purgethemecache', 'admin')),
$mform->createElement('advcheckbox', 'courses', '', get_string('purgecoursecache', 'admin')),
$mform->createElement('advcheckbox', 'lang', '', get_string('purgelangcache', 'admin')),
$mform->createElement('advcheckbox', 'js', '', get_string('purgejscache', 'admin')),
$mform->createElement('advcheckbox', 'template', '', get_string('purgetemplates', 'admin')),
$mform->createElement('advcheckbox', 'filter', '', get_string('purgefiltercache', 'admin')),
$mform->createElement('advcheckbox', 'muc', '', get_string('purgemuc', 'admin')),
$mform->createElement('advcheckbox', 'other', '', get_string('purgeothercaches', 'admin'))
];
$mform->addGroup($checkboxes, 'purgeselectedoptions');
$mform->addElement('submit', 'purgeselectedcaches', get_string('purgeselectedcaches', 'admin'));
}
/**
* If the "Purge selected caches" button was pressed, ensure at least one cache was selected.
*
* @param array $data
* @param array $files
* @return array Error messages
*/
public function validation($data, $files) {
$errors = [];
if (isset($data['purgeselectedcaches']) && empty(array_filter($data['purgeselectedoptions']))) {
$errors['purgeselectedoptions'] = get_string('purgecachesnoneselected', 'admin');
}
return $errors;
}
}
@@ -1,92 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Testing outgoing mail configuration form
*
* @package core
* @copyright 2019 Victor Deniz <victor@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\form;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php');
/**
* Test mail form
*
* @package core
* @copyright 2019 Victor Deniz <victor@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testoutgoingmailconf_form extends \moodleform {
/**
* Add elements to form
*/
public function definition() {
$mform = $this->_form;
// Recipient.
$options = ['maxlength' => '100', 'size' => '25', 'autocomplete' => 'email'];
$mform->addElement('text', 'recipient', get_string('testoutgoingmailconf_toemail', 'admin'), $options);
$mform->setType('recipient', PARAM_EMAIL);
$mform->addRule('recipient', get_string('required'), 'required');
// From user.
$options = ['maxlength' => '100', 'size' => '25'];
$mform->addElement('text', 'from', get_string('testoutgoingmailconf_fromemail', 'admin'), $options);
$mform->setType('from', PARAM_TEXT);
$mform->addHelpButton('from', 'testoutgoingmailconf_fromemail', 'admin');
// Additional subject text.
$options = ['size' => '25'];
$mform->addElement('text', 'additionalsubject', get_string('testoutgoingmailconf_subjectadditional', 'admin'), $options);
$mform->setType('additionalsubject', PARAM_TEXT);
$buttonarray = array();
$buttonarray[] = $mform->createElement('submit', 'send', get_string('testoutgoingmailconf_sendtest', 'admin'));
$buttonarray[] = $mform->createElement('cancel');
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->closeHeaderBefore('buttonar');
}
/**
* Validate Form field, should be a valid email format or a username that matches with a Moodle user.
*
* @param array $data
* @param array $files
* @return array
* @throws \dml_exception|\coding_exception
*/
public function validation($data, $files): array {
$errors = parent::validation($data, $files);
if (isset($data['from']) && $data['from']) {
$userfrom = \core_user::get_user_by_username($data['from']);
if (!$userfrom && !validate_email($data['from'])) {
$errors['from'] = get_string('testoutgoingmailconf_fromemail_invalid', 'admin');
}
}
return $errors;
}
}
@@ -1,71 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* External admin page class that allows a callback to be provided to determine whether page can be accessed
*
* @package core_admin
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\externalpage;
use admin_externalpage;
defined('MOODLE_INTERNAL') || die();
require_once("{$CFG->libdir}/adminlib.php");
/**
* Admin externalpage class
*
* @package core_admin
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class accesscallback extends admin_externalpage {
/** @var callable $accesscheckcallback */
protected $accesscheckcallback;
/**
* Class constructor
*
* @param string $name
* @param string $visiblename
* @param string $url
* @param callable $accesscheckcallback The callback method that will be executed to check whether user has access to
* this page. The setting instance ($this) is passed as an argument to the callback. Should return boolean value
* @param bool $hidden
*/
public function __construct(string $name, string $visiblename, string $url, callable $accesscheckcallback,
bool $hidden = false) {
$this->accesscheckcallback = $accesscheckcallback;
parent::__construct($name, $visiblename, $url, [], $hidden);
}
/**
* Determines if the current user has access to this external page based on access callback
*
* @return bool
*/
public function check_access() {
return ($this->accesscheckcallback)($this);
}
}
@@ -1,206 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Auto complete admin setting.
*
* @package core_admin
* @copyright 2020 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/adminlib.php');
/**
* Auto complete setting class.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2020 The Open University
*/
class autocomplete extends \admin_setting_configmultiselect {
/** @var boolean Should we allow typing new entries to the field? */
protected $tags = false;
/** @var string Name of an AMD module to send/process ajax requests. */
protected $ajax = '';
/** @var string Placeholder text for an empty list. */
protected $placeholder = '';
/** @var bool Whether the search has to be case-sensitive. */
protected $casesensitive = false;
/** @var bool Show suggestions by default - but this can be turned off. */
protected $showsuggestions = true;
/** @var string String that is shown when there are no selections. */
protected $noselectionstring = '';
/** @var string Delimiter to store values in database. */
protected $delimiter = ',';
/** @var string Should be multiple choices? */
protected $multiple = true;
/** @var string The link to manage choices. */
protected $manageurl = true;
/** @var string The text to display in manage link. */
protected $managetext = true;
/**
* Constructor
*
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting'
* for ones in config_plugins.
* @param string $visiblename localised
* @param string $description long localised info
* @param array $defaultsetting array of selected items
* @param array $choices options for autocomplete field
* @param array $attributes settings for autocomplete field
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $choices, $attributes = null) {
if ($attributes === null) {
$attributes = [];
}
$this->placeholder = get_string('search');
$this->noselectionstring = get_string('noselection', 'form');
$defaultattributes = [
'tags',
'showsuggestions',
'placeholder',
'noselectionstring',
'ajax',
'casesensitive',
'delimiter',
'multiple',
'manageurl',
'managetext'
];
foreach ($defaultattributes as $attributename) {
if (isset($attributes[$attributename])) {
$this->$attributename = $attributes[$attributename];
}
}
parent::__construct($name, $visiblename, $description, $defaultsetting, $choices);
}
/**
* Returns the select setting(s)
*
* @return mixed null or array. Null if no settings else array of setting(s)
*/
public function get_setting() {
$result = $this->config_read($this->name);
if (is_null($result)) {
return null;
}
if ($result === '') {
return [];
}
return explode($this->delimiter, $result);
}
/**
* Saves setting(s) provided through $data
*
* @param array $data
*/
public function write_setting($data) {
if (!is_array($data)) {
return ''; // Ignore it.
}
if (!$this->load_choices() || empty($this->choices)) {
return '';
}
unset($data['xxxxx']);
$save = [];
foreach ($data as $value) {
if (!array_key_exists($value, $this->choices)) {
continue; // Ignore it.
}
$save[] = $value;
}
return ($this->config_write($this->name, implode($this->delimiter, $save)) ? '' : get_string('errorsetting', 'admin'));
}
/**
* Returns XHTML autocomplete field
*
* @param array $data Array of values to select by default
* @param string $query
* @return string XHTML autocomplete field
*/
public function output_html($data, $query = '') {
global $OUTPUT;
if (!$this->load_choices() or empty($this->choices)) {
return '';
}
$default = $this->get_defaultsetting();
if (empty($default)) {
$default = [];
}
if (is_null($data)) {
$data = [];
}
$context = [
'id' => $this->get_id(),
'name' => $this->get_full_name()
];
$defaults = [];
$options = [];
$template = 'core_admin/local/settings/autocomplete';
foreach ($this->choices as $value => $name) {
if (in_array($value, $default)) {
$defaults[] = $name;
}
$options[] = [
'value' => $value,
'text' => $name,
'selected' => in_array($value, $data),
'disabled' => false
];
}
$context['options'] = $options;
$context['tags'] = $this->tags;
$context['placeholder'] = $this->placeholder;
$context['casesensitive'] = $this->casesensitive;
$context['multiple'] = $this->multiple;
$context['showsuggestions'] = $this->showsuggestions;
$context['manageurl'] = $this->manageurl;
$context['managetext'] = $this->managetext;
if (is_null($default)) {
$defaultinfo = null;
} if (!empty($defaults)) {
$defaultinfo = implode(', ', $defaults);
} else {
$defaultinfo = get_string('none');
}
$element = $OUTPUT->render_from_template($template, $context);
return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $defaultinfo, $query);
}
}
-197
View File
@@ -1,197 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* File size admin setting.
*
* @package core_admin
* @copyright 2019 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/adminlib.php');
/**
* An admin setting to support entering and displaying of file sizes in Bytes, KB, MB or GB.
*
* @copyright 2019 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filesize extends \admin_setting {
/** @var int The byte unit. Number of bytes in a byte */
const UNIT_B = 1;
/** @var int The kilobyte unit (number of bytes in a kilobyte) */
const UNIT_KB = 1024;
/** @var int The megabyte unit (number of bytes in a megabyte) */
const UNIT_MB = 1048576;
/** @var int The gigabyte unit (number of bytes in a gigabyte) */
const UNIT_GB = 1073741824;
/** @var int default size unit */
protected $defaultunit;
/**
* Constructor
*
* @param string $name unique ascii name, either 'mysetting' for settings that in config,
* or 'myplugin/mysetting' for ones in config_plugins.
* @param string $visiblename localised name
* @param string $description localised long description
* @param int|null $defaultvalue Value of the settings in bytes
* @param int|null $defaultunit GB, MB, etc. (in bytes)
*/
public function __construct(string $name, string $visiblename, string $description,
?int $defaultvalue = null, ?int $defaultunit = null) {
$defaultsetting = self::parse_bytes($defaultvalue);
if ($defaultunit && array_key_exists($defaultunit, self::get_units())) {
$this->defaultunit = $defaultunit;
} else {
$this->defaultunit = self::UNIT_MB;
}
parent::__construct($name, $visiblename, $description, $defaultsetting);
}
/**
* Returns selectable units.
*
* @return array
*/
protected static function get_units(): array {
return [
self::UNIT_GB => get_string('sizegb'),
self::UNIT_MB => get_string('sizemb'),
self::UNIT_KB => get_string('sizekb'),
self::UNIT_B => get_string('sizeb'),
];
}
/**
* Converts bytes to some more user friendly string.
*
* @param int $bytes The number of bytes we want to convert from
* @return string
*/
protected static function get_size_text(int $bytes): string {
if (empty($bytes)) {
return get_string('none');
}
return display_size($bytes, 0);
}
/**
* Finds suitable units for given file size.
*
* @param int $bytes The number of bytes
* @return array Parsed file size in the format of ['v' => value, 'u' => unit]
*/
protected static function parse_bytes(int $bytes): array {
foreach (self::get_units() as $unit => $unused) {
if ($bytes % $unit === 0) {
return ['v' => (int)($bytes / $unit), 'u' => $unit];
}
}
return ['v' => (int)$bytes, 'u' => self::UNIT_B];
}
/**
* Get the selected file size as array.
*
* @return array|null An array containing 'v' => xx, 'u' => xx, or null if not set
*/
public function get_setting(): ?array {
$bytes = $this->config_read($this->name);
if (is_null($bytes)) {
return null;
}
$bytes = intval($bytes);
return self::parse_bytes($bytes);
}
/**
* Store the file size as bytes.
*
* @param array $data Must be form 'h' => xx, 'm' => xx
* @return string The error string if any
*/
public function write_setting($data): string {
if (!is_array($data)) {
return '';
}
if (!is_numeric($data['v']) || $data['v'] < 0) {
return get_string('errorsetting', 'admin');
}
// Calculate size in bytes, ensuring we don't overflow PHP_INT_MAX.
$bytes = $data['v'] * $data['u'];
$result = (is_int($bytes) && $this->config_write($this->name, $bytes));
return ($result ? '' : get_string('errorsetting', 'admin'));
}
/**
* Returns file size text+select fields.
*
* @param array $data The current setting value. Must be form 'v' => xx, 'u' => xx.
* @param string $query Admin search query to be highlighted.
* @return string File size text+select fields and wrapping div(s).
*/
public function output_html($data, $query = ''): string {
global $OUTPUT;
$default = $this->get_defaultsetting();
if (is_number($default)) {
$defaultinfo = self::get_size_text($default);
} else if (is_array($default)) {
$defaultinfo = self::get_size_text($default['v'] * $default['u']);
} else {
$defaultinfo = null;
}
$inputid = $this->get_id() . 'v';
$units = self::get_units();
$defaultunit = $this->defaultunit;
$context = (object) [
'id' => $this->get_id(),
'name' => $this->get_full_name(),
'value' => $data['v'],
'readonly' => $this->is_readonly(),
'options' => array_map(function($unit, $title) use ($data, $defaultunit) {
return [
'value' => $unit,
'name' => $title,
'selected' => ($data['v'] == 0 && $unit == $defaultunit) || $unit == $data['u']
];
}, array_keys($units), $units)
];
$element = $OUTPUT->render_from_template('core_admin/setting_configfilesize', $context);
return format_admin_setting($this, $this->visiblename, $element, $this->description, $inputid, '', $defaultinfo, $query);
}
}
@@ -1,37 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* A settings page which can be viewed with a link directly.
*
* @package core_admin
* @copyright 2021 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
use moodle_url;
interface linkable_settings_page {
/**
* Get the URL to view this settings page.
*
* @return moodle_url
*/
public function get_settings_page_url(): moodle_url;
}
@@ -1,74 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Payment gateway admin setting.
*
* @package core_admin
* @copyright 2020 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
/**
* Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin.
*/
class manage_payment_gateway_plugins extends \admin_setting_manage_plugins {
/**
* Get the admin settings section title (use get_string).
*
* @return string
*/
public function get_section_title() {
return get_string('type_paygw_plural', 'plugin');
}
/**
* Get the type of plugin to manage.
*
* @return string
*/
public function get_plugin_type() {
return 'paygw';
}
/**
* Get the name of the second column.
*
* @return string
*/
public function get_info_column_name() {
return get_string('supportedcurrencies', 'core_payment');
}
/**
* Get the type of plugin to manage.
*
* @param plugininfo The plugin info class.
* @return string
*/
public function get_info_column($plugininfo) {
$codes = $plugininfo->get_supported_currencies();
$currencies = [];
foreach ($codes as $c) {
$currencies[$c] = new \lang_string($c, 'core_currencies');
}
return implode(get_string('listsep', 'langconfig') . ' ', $currencies);
}
}
@@ -1,121 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Admin setting to show current scheduled task's status.
*
* @package core
* @copyright 2021 Universitat Rovira i Virgili
* @author Jordi Pujol-Ahulló <jpahullo@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/moodlelib.php');
use admin_setting_description;
use core\task\manager;
use core\task\scheduled_task;
use html_writer;
use lang_string;
use moodle_url;
use stdClass;
/**
* This admin setting tells whether a given scheduled task is enabled, providing a link to its configuration page.
*
* The goal of this setting is to help contextualizing the configuration settings with related scheduled task status,
* providing the big picture of that part of the system.
*
* @package core
* @copyright 2021 Universitat Rovira i Virgili
* @author Jordi Pujol-Ahulló <jpahullo@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class setting_scheduled_task_status extends admin_setting_description {
/**
* @var string fully qualified class name of a scheduled task.
*/
private $classname;
/**
* @var string additional text to append to the description.
*/
private $extradescription;
/**
* setting_scheduled_task_status constructor.
* @param string $name unique setting name.
* @param string $scheduledtaskclassname full classpath class name of the scheduled task.
* @param string $extradescription extra detail to append to the scheduled task status to add context in the setting
* page.
*/
public function __construct(string $name, string $scheduledtaskclassname, string $extradescription = '') {
$visiblename = new lang_string('task_status', 'admin');
$this->classname = $scheduledtaskclassname;
$this->extradescription = $extradescription;
parent::__construct($name, $visiblename, '');
}
/**
* Calculates lazily the content of the description.
* @param mixed $data nothing expected in this case.
* @param string $query nothing expected in this case.
* @return string the HTML content to print for this setting.
*/
public function output_html($data, $query = ''): string {
if (empty($this->description)) {
$this->description = $this->get_task_description();
}
return parent::output_html($data, $query);
}
/**
* Returns the HTML to print as the description.
* @return string description to be printed.
*/
private function get_task_description(): string {
$task = manager::get_scheduled_task($this->classname);
if ($task->is_enabled()) {
$taskenabled = get_string('enabled', 'admin');
} else {
$taskenabled = get_string('disabled', 'admin');
}
$taskenabled = strtolower($taskenabled);
$gotourl = new moodle_url(
'/admin/tool/task/scheduledtasks.php',
[],
scheduled_task::get_html_id($this->classname)
);
if (!empty($this->extradescription)) {
$this->extradescription = '<br />' . $this->extradescription;
}
$taskdetail = new stdClass();
$taskdetail->class = $this->classname;
$taskdetail->name = $task->get_name();
$taskdetail->status = $taskenabled;
$taskdetail->gotourl = $gotourl->out(false);
$taskdetail->extradescription = $this->extradescription;
return html_writer::tag('p', get_string('task_status_desc', 'admin', $taskdetail));
}
}
-71
View File
@@ -1,71 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\output;
use moodle_url;
use renderable;
use renderer_base;
use stdClass;
use templatable;
/**
* Theme selector renderable.
*
* @package core_admin
* @copyright 2023 David Woloszyn <david.woloszyn@moodle.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class theme_selector implements renderable, templatable {
/** @var array $themedata Theme data to pass to the template. */
private $themedata = null;
/** @var bool Whether $CFG->theme is defined in config.php. */
private $definedinconfig;
/**
* Constructor.
*
* @param array $themedata Theme data used for template.
* @param bool $definedinconfig Whether $CFG->theme is defined in config.php.
*/
public function __construct(array $themedata, bool $definedinconfig = false) {
$this->themedata = $themedata;
$this->definedinconfig = $definedinconfig;
}
/**
* Export this data so it can be used as the context for a mustache template.
*
* @param renderer_base $output Renderer base.
* @return stdClass
*/
public function export_for_template(renderer_base $output): stdClass {
$data = new stdClass();
// Theme data used to populate cards and modal.
$data->themes = $this->themedata;
// Reset theme caches button.
$reseturl = new moodle_url('/admin/themeselector.php', ['sesskey' => sesskey(), 'reset' => 1]);
$resetbutton = new \single_button($reseturl, get_string('themeresetcaches', 'admin'), 'post',
\single_button::BUTTON_SECONDARY);
$data->resetbutton = $resetbutton->export_for_template($output);
$data->definedinconfig = $this->definedinconfig;
return $data;
}
}
-41
View File
@@ -1,41 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for core_admin.
*
* @package core_admin
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for core_admin implementing null_provider.
*
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason(): string {
return 'privacy:metadata';
}
}
@@ -1,128 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
declare(strict_types=1);
namespace core_admin\reportbuilder\datasource;
use core_admin\reportbuilder\local\entities\task_log;
use core_reportbuilder\datasource;
use core_reportbuilder\local\entities\user;
use core_reportbuilder\local\filters\select;
/**
* Task logs datasource
*
* @package core_admin
* @copyright 2022 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_logs extends datasource {
/**
* Return user friendly name of the report source
*
* @return string
*/
public static function get_name(): string {
return get_string('tasklogs', 'core_admin');
}
/**
* Initialise report
*/
protected function initialise(): void {
$tasklogentity = new task_log();
$tasklogalias = $tasklogentity->get_table_alias('task_log');
$this->set_main_table('task_log', $tasklogalias);
$this->add_entity($tasklogentity);
// Join the user entity to represent the associated user.
$userentity = new user();
$useralias = $userentity->get_table_alias('user');
$this->add_entity($userentity->add_join("
LEFT JOIN {user} {$useralias}
ON {$useralias}.id = {$tasklogalias}.userid")
);
// Add report elements from each of the entities we added to the report.
$this->add_all_from_entities();
}
/**
* Return the columns that will be added to the report upon creation
*
* @return string[]
*/
public function get_default_columns(): array {
return [
'task_log:name',
'task_log:starttime',
'task_log:duration',
'task_log:result',
];
}
/**
* Return the column sorting that will be added to the report upon creation
*
* @return int[]
*/
public function get_default_column_sorting(): array {
return [
'task_log:starttime' => SORT_DESC,
];
}
/**
* Return the filters that will be added to the report upon creation
*
* @return string[]
*/
public function get_default_filters(): array {
return [
'task_log:timestart',
'task_log:result',
];
}
/**
* Return the conditions that will be added to the report upon creation
*
* @return string[]
*/
public function get_default_conditions(): array {
return [
'task_log:type',
'task_log:timestart',
'task_log:result',
];
}
/**
* Return the condition values that will be set for the report upon creation
*
* @return array
*/
public function get_default_condition_values(): array {
return [
'task_log:type_operator' => select::EQUAL_TO,
'task_log:type_value' => \core\task\database_logger::TYPE_SCHEDULED,
];
}
}
@@ -1,413 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\reportbuilder\local\entities;
use core_reportbuilder\local\filters\date;
use core_reportbuilder\local\filters\duration;
use core_reportbuilder\local\filters\number;
use core_reportbuilder\local\filters\select;
use core_reportbuilder\local\filters\text;
use core_reportbuilder\local\filters\autocomplete;
use core_reportbuilder\local\helpers\format;
use lang_string;
use core_reportbuilder\local\entities\base;
use core_reportbuilder\local\report\column;
use core_reportbuilder\local\report\filter;
use stdClass;
use core_collator;
/**
* Task log entity class implementation
*
* @package core_admin
* @copyright 2021 David Matamoros <davidmc@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_log extends base {
/** @var int Result success */
protected const SUCCESS = 0;
/** @var int Result failed */
protected const FAILED = 1;
/**
* Database tables that this entity uses
*
* @return string[]
*/
protected function get_default_tables(): array {
return [
'task_log',
];
}
/**
* The default title for this entity in the list of columns/conditions/filters in the report builder
*
* @return lang_string
*/
protected function get_default_entity_title(): lang_string {
return new lang_string('entitytasklog', 'admin');
}
/**
* Initialise the entity
*
* @return base
*/
public function initialise(): base {
$columns = $this->get_all_columns();
foreach ($columns as $column) {
$this->add_column($column);
}
// All the filters defined by the entity can also be used as conditions.
$filters = $this->get_all_filters();
foreach ($filters as $filter) {
$this
->add_filter($filter)
->add_condition($filter);
}
return $this;
}
/**
* Returns list of all available columns
*
* @return column[]
*/
protected function get_all_columns(): array {
global $DB;
$tablealias = $this->get_table_alias('task_log');
// Name column.
$columns[] = (new column(
'name',
new lang_string('name'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_field("{$tablealias}.classname")
->set_is_sortable(true)
->add_callback(static function(string $classname): string {
$output = '';
if (class_exists($classname)) {
$task = new $classname;
if ($task instanceof \core\task\task_base) {
$output = $task->get_name();
}
}
$output .= \html_writer::tag('div', "\\{$classname}", [
'class' => 'small text-muted',
]);
return $output;
});
// Component column.
$columns[] = (new column(
'component',
new lang_string('plugin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_field("{$tablealias}.component")
->set_is_sortable(true);
// Type column.
$columns[] = (new column(
'type',
new lang_string('tasktype', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_field("{$tablealias}.type")
->set_is_sortable(true)
->add_callback(static function($value): string {
if (\core\task\database_logger::TYPE_SCHEDULED === (int) $value) {
return get_string('task_type:scheduled', 'admin');
}
return get_string('task_type:adhoc', 'admin');
});
// Start time column.
$columns[] = (new column(
'starttime',
new lang_string('task_starttime', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TIMESTAMP)
->add_field("{$tablealias}.timestart")
->set_is_sortable(true)
->add_callback([format::class, 'userdate'], get_string('strftimedatetimeshortaccurate', 'core_langconfig'));
// End time column.
$columns[] = (new column(
'endtime',
new lang_string('task_endtime', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TIMESTAMP)
->add_field("{$tablealias}.timeend")
->set_is_sortable(true)
->add_callback([format::class, 'userdate'], get_string('strftimedatetimeshortaccurate', 'core_langconfig'));
// Duration column.
$columns[] = (new column(
'duration',
new lang_string('task_duration', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_FLOAT)
->add_field("{$tablealias}.timeend - {$tablealias}.timestart", 'duration')
->set_is_sortable(true)
->add_callback([format::class, 'format_time'], 2);
// Hostname column.
$columns[] = (new column(
'hostname',
new lang_string('hostname', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_field("$tablealias.hostname")
->set_is_sortable(true);
// PID column.
$columns[] = (new column(
'pid',
new lang_string('pid', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->add_field("{$tablealias}.pid")
->set_is_sortable(true);
// Database column.
$columns[] = (new column(
'database',
new lang_string('task_dbstats', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->add_fields("{$tablealias}.dbreads, {$tablealias}.dbwrites")
->set_is_sortable(true, ["{$tablealias}.dbreads", "{$tablealias}.dbwrites"])
->add_callback(static function($value, stdClass $row): string {
$output = '';
$output .= \html_writer::div(get_string('task_stats:dbreads', 'admin', $row->dbreads));
$output .= \html_writer::div(get_string('task_stats:dbwrites', 'admin', $row->dbwrites));
return $output;
});
// Database reads column.
$columns[] = (new column(
'dbreads',
new lang_string('task_dbreads', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_INTEGER)
->add_fields("{$tablealias}.dbreads")
->set_is_sortable(true);
// Database writes column.
$columns[] = (new column(
'dbwrites',
new lang_string('task_dbwrites', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_INTEGER)
->add_fields("{$tablealias}.dbwrites")
->set_is_sortable(true);
// Result column.
$columns[] = (new column(
'result',
new lang_string('task_result', 'admin'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_BOOLEAN)
// For accurate aggregation, we need to return boolean success = true by xor'ing the field value.
->add_field($DB->sql_bitxor("{$tablealias}.result", 1), 'success')
->set_is_sortable(true)
->add_callback(static function(bool $success): string {
if (!$success) {
return get_string('task_result:failed', 'admin');
}
return get_string('success');
});
return $columns;
}
/**
* Return list of all available filters
*
* @return filter[]
*/
protected function get_all_filters(): array {
$tablealias = $this->get_table_alias('task_log');
// Name filter (Filter by classname).
$filters[] = (new filter(
autocomplete::class,
'name',
new lang_string('classname', 'tool_task'),
$this->get_entity_name(),
"{$tablealias}.classname"
))
->add_joins($this->get_joins())
->set_options_callback(static function(): array {
global $DB;
$classnames = $DB->get_fieldset_sql('SELECT DISTINCT classname FROM {task_log} ORDER BY classname ASC');
$options = [];
foreach ($classnames as $classname) {
if (class_exists($classname)) {
$task = new $classname;
$options[$classname] = $task->get_name();
}
}
core_collator::asort($options);
return $options;
});
// Component filter.
$filters[] = (new filter(
text::class,
'component',
new lang_string('plugin'),
$this->get_entity_name(),
"{$tablealias}.component"
))
->add_joins($this->get_joins());
// Type filter.
$filters[] = (new filter(
select::class,
'type',
new lang_string('tasktype', 'admin'),
$this->get_entity_name(),
"{$tablealias}.type"
))
->add_joins($this->get_joins())
->set_options([
\core\task\database_logger::TYPE_ADHOC => new lang_string('task_type:adhoc', 'admin'),
\core\task\database_logger::TYPE_SCHEDULED => new lang_string('task_type:scheduled', 'admin'),
]);
// Output filter (Filter by task output).
$filters[] = (new filter(
text::class,
'output',
new lang_string('task_logoutput', 'admin'),
$this->get_entity_name(),
"{$tablealias}.output"
))
->add_joins($this->get_joins());
// Start time filter.
$filters[] = (new filter(
date::class,
'timestart',
new lang_string('task_starttime', 'admin'),
$this->get_entity_name(),
"{$tablealias}.timestart"
))
->add_joins($this->get_joins())
->set_limited_operators([
date::DATE_ANY,
date::DATE_RANGE,
date::DATE_PREVIOUS,
date::DATE_CURRENT,
]);
// End time.
$filters[] = (new filter(
date::class,
'timeend',
new lang_string('task_endtime', 'admin'),
$this->get_entity_name(),
"{$tablealias}.timeend"
))
->add_joins($this->get_joins())
->set_limited_operators([
date::DATE_ANY,
date::DATE_RANGE,
date::DATE_PREVIOUS,
date::DATE_CURRENT,
]);
// Duration filter.
$filters[] = (new filter(
duration::class,
'duration',
new lang_string('task_duration', 'admin'),
$this->get_entity_name(),
"{$tablealias}.timeend - {$tablealias}.timestart"
))
->add_joins($this->get_joins());
// Database reads.
$filters[] = (new filter(
number::class,
'dbreads',
new lang_string('task_dbreads', 'admin'),
$this->get_entity_name(),
"{$tablealias}.dbreads"
))
->add_joins($this->get_joins());
// Database writes.
$filters[] = (new filter(
number::class,
'dbwrites',
new lang_string('task_dbwrites', 'admin'),
$this->get_entity_name(),
"{$tablealias}.dbwrites"
))
->add_joins($this->get_joins());
// Result filter.
$filters[] = (new filter(
select::class,
'result',
new lang_string('task_result', 'admin'),
$this->get_entity_name(),
"{$tablealias}.result"
))
->add_joins($this->get_joins())
->set_options([
self::SUCCESS => get_string('success'),
self::FAILED => get_string('task_result:failed', 'admin'),
]);
return $filters;
}
}

Some files were not shown because too many files have changed in this diff Show More