Compare commits

..

1360 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 11e24ca055 Moodle release 2.0.7 2012-01-07 17:07:13 +01:00
Eloy Lafuente (stronk7) b5c2f4d339 weekly release 2.0.6+ 2012-01-05 15:09:03 +01:00
Sam Hemelryk 032d7039fd Merge branch 'w52_MDL-29917_m20_autocomplete' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2012-01-04 10:58:01 +13:00
Petr Skoda 4c519f313f MDL-30950 remove references to removed admin block
Credit goes to Ralf Hilgenstock.
2012-01-03 22:35:39 +01:00
Petr Skoda a4478cd677 MDL-29917 prevent form autocompletion in most Moodle forms
The password autocompletion in case of Moodle makes sense only on the login page, the form autocompletion in general is most probably useful only on the user signup page.

This patch is compatible with html 5, unfortunately we have to ignore strict warnings in legacy xhtml 1.0 standard.
2012-01-03 11:08:28 +01:00
Aparup Banerjee 9238b568c5 Merge branch 'wip-mdl-29844-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2012-01-03 12:33:02 +08:00
Eloy Lafuente 4b1634259a MDL-29844 Administration: Added new config for users to login for viewing profile image 2012-01-03 12:12:12 +08:00
Petr Skoda e9d36fd552 MDL-30673 fix login autocompletion protection 2012-01-03 14:11:52 +13:00
Petr Skoda 256f77ef94 MDL-13572 fix incorrect value printing 2012-01-03 11:02:13 +13:00
Petr Skoda fdb2313376 MDL-13572 fix incorrect value printing 2012-01-03 11:02:13 +13:00
Petr Skoda 5a72f96843 MDL-13572 do not send emails to invalid addresses 2012-01-03 11:02:13 +13:00
Andrew Davis 63601aa655 MDL-13572 message: added validation of the email address in the messaging preferences 2012-01-03 11:02:12 +13:00
Eloy Lafuente (stronk7) 464ad0a47e weekly release 2.0.6+ 2011-12-23 03:05:53 +01:00
Eloy Lafuente (stronk7) 8a99b2a116 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-12-23 02:53:35 +01:00
Gerard (Gerry) Caulfield 5697227dd9 MDL-29400 Fixing unset object bug encountered by Rajesh during testing 2011-12-22 09:56:17 +01:00
Aparup Banerjee b23d738cde Merge branch 'wip-MDL-30541-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-12-21 14:19:22 +08:00
Aparup Banerjee b562573aa2 Merge branch 'wip-MDL-30539-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-12-21 13:36:14 +08:00
Sam Hemelryk 3cd88ea638 Merge branch 'MDL-28126_m20' of https://github.com/nebgor/moodle into MOODLE_20_STABLE 2011-12-21 17:19:46 +13:00
Jason Fowler 0b537fd64f MDL-30541 - Blog - Fixing the context for RSS Feed headers on the single blog entry pages 2011-12-21 11:03:39 +08:00
Sam Hemelryk 91af0d8431 Merge branch 'MDL-29239_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-12-21 15:01:14 +13:00
David Mudrak 06f9aecbcf MDL-30170 MNet peers administration - various usability improvements
While fixing MDL-30170, the following tiny usability details were
improved along the way:

* the maximum length of the peer site title and the hostname is now
  validated (this was actually a real bug as the default value is pre-loaded
  from the peer) so the admin gets a nice validation error instead of
  the database write exception when trying to register a host with a
  longer site title.
* hard-coded English string 'All Hosts' is now localized
* the hostname link in the list of MNet peers leads to the peer itself
2011-12-20 23:36:52 +01:00
David Mudrak cac3efc3e2 MDL-30170 MNet peers administration - highlight the undelete widget
The patch highlights the undelete radio selector at the host edit form.
It moves it to the end of the form (near the submit button) and displays
an explanation above the radio selector.

Also, the list of deleted hosts is now displayed below the table of
active peers at the Manage peers page.

The data returned by mnet_get_hosts() function now contain the deleted
status, too. It is possible to obtain deleted hosts from that function
now.
2011-12-20 23:36:13 +01:00
Gerard (Gerry) Caulfield 183550216e MDL-29400 Update the upload and uploadsingle assignment classes to so
that they only display the assignment submitted status when it has
actually been submitted.
2011-12-20 22:55:49 +01:00
Aparup Banerjee dcaea2b744 MDL-30603 synced and renamed incorrect ZF 1.10.6 file and name 2011-12-20 19:50:29 +01:00
Mark Nielsen 834bcfa664 MDL-29048 Glossary Force glossary type to secondary while trying to duplicate a mail glossary 2011-12-20 18:57:00 +01:00
Eloy Lafuente (stronk7) 139ce28030 Merge branch 'MDL-30738_20_STABLE' of git://github.com/kiklop74/moodle into MOODLE_20_STABLE 2011-12-20 02:02:14 +01:00
AMOS bot e97f24ea91 Automatically generated installer lang files 2011-12-20 00:31:32 +00:00
Sam Hemelryk 834082292a Merge branch 'MDL-30646_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-20 13:20:38 +13:00
Eloy Lafuente (stronk7) 9f78a33c7b Merge branch 'MDL-30741_m20' of git://github.com/jfilip/moodle into MOODLE_20_STABLE 2011-12-20 00:05:59 +01:00
Sam Hemelryk ffcc16f52a Merge branch 'wip-MDL-28948-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-12-20 10:42:15 +13:00
Mary Evans b337e7be55 MDL-30500 Fix for Sky High report & print layout 2011-12-19 15:23:07 +13:00
AMOS bot 359f84eeac Automatically generated installer lang files 2011-12-18 00:31:29 +00:00
Andrew Davis (andyjdavis) 0958a64834 MDL-28072 coursereport: added a missing require_once() 2011-12-16 12:18:29 +01:00
adrian@moodle.com 43269b8442 MDL-28948 - lib - removed the hard coded key for the rc4encryt function. 2011-12-16 09:19:54 +08:00
AMOS bot 41a535e3e7 Automatically generated installer lang files 2011-12-16 00:31:31 +00:00
Tim Hunt 71b908e52f MDL-30646 default qbank sort should only use visible columns. 2011-12-15 18:41:33 +00:00
Justin Filip c40e59f1c6 MDL-30741 Adding a new test to check for incorrect parsing of complicate HTML with a PRE tag. 2011-12-15 11:12:55 -05:00
Justin Filip 7f3b9f0e31 MDL-30741 Fix the handling of PRE tags with the latest code from upstream: http://trac.roundcube.net/browser/trunk/roundcubemail/program/lib/html2text.php?rev=5497 2011-12-15 11:12:52 -05:00
Aparup Banerjee 90f345d02f MDL-28126 webservice : string fixed. 2011-12-15 16:23:18 +08:00
Tim Lock e460b8846d MDL-30419: IMS package content missing when using Blackboard packages 2011-12-14 21:34:47 +01:00
Darko Miletic a4ffe6c993 MDL-30738: added version for 2.0 stable 2011-12-14 14:49:36 -03:00
Jerome Mouneyrac e922d9a90b MDL-28126 webservices : should not able to create token if user is deleted,unconfirmed,suspended or guest. 2011-12-15 00:57:32 +08:00
Eloy Lafuente (stronk7) 2ef91b5b55 Merge branch 'wip-MDL-27767-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-12-14 03:18:20 +01:00
Petr Skoda 7e01298b8f MDL-30610 new environment requirements for 2.3 2011-12-14 02:43:09 +01:00
Sam Hemelryk a3c0ea64af Merge branch 'MDL-30463_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-12-14 14:24:46 +13:00
Tim Hunt ac9ee6a834 MDL-30559 conditional availability: missing validation of grade rules. 2011-12-13 17:30:40 +08:00
Petr Skoda 694bf2fa3b MDL-30575 more mail header cleanup 2011-12-13 10:24:56 +08:00
Jason Fowler 51ea2ffa7e MDL-305439 - BLOG - Adding RSS link to user blogs 2011-12-13 09:46:31 +08:00
Andrew Robert Nicols 6ec9004b69 MDL-30653 Remove duplicate Participants link from navbar 2011-12-13 12:09:21 +13:00
Sam Hemelryk 2a6811bb9d Merge branch 'MDL-30689' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-13 11:26:34 +13:00
Sam Hemelryk b11d9dc595 Merge branch 'MDL-30677_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-13 11:19:36 +13:00
Sam Hemelryk 3a4e0dd4d3 Merge branch 'MDL-30498a_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-13 11:10:52 +13:00
Sam Hemelryk 4a0b3e2a62 Merge branch 'MDL-27143_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-13 10:25:58 +13:00
Rossiani Wijaya 0293b62ebb MDL-30463 lesson module: add space between yes and no options on start last attempt page 2011-12-12 17:12:36 +08:00
Rossiani Wijaya 1b8755325a MDL-29239 fixed edit course setting for moodle/course:changesummary permission is set to prevent. 2011-12-12 15:47:01 +08:00
Sam Hemelryk 1114c49f51 Merge branch 'MDL-28180_20' of git://github.com/stronk7/moodle into MOODLE_20_STABLE 2011-12-12 14:57:09 +13:00
Andrew Robert Nicols 9a45c1e1f0 MDL-29195 Remove duplicate Participants -> Notes from navbar 2011-12-12 13:51:26 +13:00
Eloy Lafuente (stronk7) 54c5b28e69 MDL-28180 backup - on restore always prevent completion_aggr_methd dupes
This covers the last case where dupes could be happening in the
completion_aggr_methd table: Restoring one complete course into
an existing one, adding information. Now we always check if the
aggr_method exists before inserting it.
2011-12-12 00:44:25 +01:00
Eloy Lafuente (stronk7) cc2a5ff65e MDL-28180 backup - take rid of dupes in course_completion_aggr_methd 2011-12-12 00:43:52 +01:00
Eloy Lafuente (stronk7) 8f86e3a2ad MDL-28180 backup - set excluded activities for any non-course operation 2011-12-12 00:40:31 +01:00
Tim Hunt da1bee2cb9 MDL-30689 qtype base: fix typo in extra_answer_fields code. 2011-12-11 22:15:48 +00:00
AMOS bot 2be846fd31 Automatically generated installer lang files 2011-12-10 00:31:36 +00:00
Tim Hunt 442f0b10ae MDL-30677 quiz: fix attempt counts when a student is in several groups. 2011-12-09 17:30:53 +00:00
Tim Hunt 7ef2840ffa MDL-30498 user name can overlap user report icon. 2011-12-09 17:29:57 +00:00
Tim Hunt 38e32f6ddb MDL-27143 question bank: questions not saved when deleting a category.
Based on a fix by Nikhil Gupta.

Conflicts:

	lib/questionlib.php
2011-12-09 17:29:22 +00:00
Eloy Lafuente (stronk7) bdfd90b105 weekly release 2.0.6+ 2011-12-09 16:29:15 +01:00
Eloy Lafuente (stronk7) 87690ba756 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-12-09 16:20:49 +01:00
Tim Hunt cbda44bca4 MDL-27314 quiz responses report: delete confirmation did not cancel. 2011-12-09 14:24:47 +01:00
Tim Hunt 96cd18c261 MDL-30660 javascript-static: another yui3/ticket/2531561 work-around. 2011-12-09 12:41:57 +01:00
Petr Skoda 2876f41409 MDL-27364 use https for recaptcha when site runs via https
Based on solution by Rajesh Taneja.
2011-12-09 11:11:14 +08:00
Sam Hemelryk c4a91d0670 Merge branch 'MDL-30660' of git://github.com/timhunt/moodle 2011-12-09 11:49:48 +13:00
Eloy Lafuente (stronk7) b07c46d077 Merge branch 'MDL-30658_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-08 19:23:57 +01:00
Tim Hunt 784a6f3132 MDL-30660 javascript-static: M.util.show_confirm_dialog fixes 2011-12-08 17:52:40 +00:00
Tim Hunt 8c70ac0eb6 MDL-30658 formslib: fix JavaScript regression from MDL-27045. 2011-12-08 14:39:00 +00:00
Aparup Banerjee ff6a1ffdbe Merge branch 'wip-MDL-30336-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-12-08 16:22:22 +08:00
Petr Skoda 9217c1aa87 MDL-30528 stop recreating role_assignments on every login attempt for each user
Credit goes to Luis Gustavo Mueller de Alcantara.
2011-12-08 15:51:40 +13:00
adrian@moodle.com 6c91ae7d99 MDL-30336 - login - Added a setting in security that allows auto complete to be set to off in password fields. 2011-12-08 09:02:03 +08:00
Eloy Lafuente (stronk7) a79d228de6 Merge branch 'wip-MDL-30582-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-12-08 01:37:37 +01:00
Eloy Lafuente (stronk7) 30b29a5cfa Merge branch 'MDL-26522_user_report_menu_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-12-08 01:02:41 +01:00
Eloy Lafuente (stronk7) 2baa09dd5f Merge branch 'MDL-27314_20' of git://github.com/timhunt/moodle into MOODLE_20_STABLE 2011-12-08 00:45:54 +01:00
Sam Hemelryk 3b1a4a0d55 Merge branch 'MDL-29712-MOODLE_20_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-12-08 12:42:20 +13:00
Eloy Lafuente (stronk7) 8f51baa885 Merge branch 'wip-MDL-30222-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-12-08 00:40:33 +01:00
Eloy Lafuente (stronk7) 88ade60cf4 Merge branch 'w50_MDL-30595_m20_regex' of git://github.com/skodak/moodle into MOODLE_20_STABLE 2011-12-08 00:25:18 +01:00
Sam Hemelryk 2316dcf0a8 Merge branch 'm20_MDL-30211' of git://github.com/danmarsden/moodle into MOODLE_20_STABLE 2011-12-08 10:47:59 +13:00
Dan Marsden ea3c021a86 MDL-30536 Choice - remove setType so that validation works when JS is disabled 2011-12-08 10:37:11 +13:00
Andrew Davis ad679f47ac MDL-26522 grade: made the user selection drop down on the user report behave more sensibly 2011-12-07 09:40:26 +08:00
Sam Hemelryk 8eaf6d689b Merge branch 'wip-MDL-19147-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-12-07 14:20:03 +13:00
AMOS bot 7217ca7d93 Automatically generated installer lang files 2011-12-07 00:31:29 +00:00
Petr Skoda 88ec670c50 MDL-30595 workaround for PHP5.2 preg_quote trouble 2011-12-06 14:11:16 +01:00
Sam Hemelryk d183cb5d85 MDL-30582 navigation: Fixed regression in generation of front page modules 2011-12-06 13:34:53 +13:00
Sam Hemelryk 6def225efa MDL-27767 install: Shows notifications rather than throwing exceptions when installation encounters unexpected id for guest or admin 2011-12-06 12:20:56 +13:00
Sam Hemelryk c21932e739 MDL-30222 Fixed home page redirection madness. Thank you Julien Boulen for providing the solution 2011-12-06 12:07:39 +13:00
AMOS bot 6b7fca5e7f Automatically generated installer lang files 2011-12-05 18:36:52 +01:00
Eloy Lafuente (stronk7) 4828564296 weekly release 2.0.6+ 2011-12-05 12:34:29 +01:00
Jerome Mouneyrac dd154420ee MDL-29712server was translating too many HTML characters. use htmlspecialchars instead of htmlentities. Translated characters by htmlspecialchars are compatible with XML validation, and so XML parsers for javascript, java... 2011-12-05 14:17:26 +08:00
AMOS bot 85197c3d6c Automatically generated installer lang files 2011-12-05 00:31:08 +00:00
Dan Marsden eba115041c MDL-30211 imsenterprise enrolment - set up default enrolment methods in new courses 2011-12-02 22:47:22 +13:00
Charles Fulton a6da7bde9b MDL-19147 - forum - Removed single discussions from the pull down menu for moving posts to different forums. 2011-12-02 07:45:53 +08:00
Tim Hunt 17d339ea8e MDL-27314 quiz attempts cannot be deleted in separate groups mode. 2011-12-01 16:29:10 +00:00
Eloy Lafuente (stronk7) 28ab88e130 weekly release 2.0.6+ 2011-12-01 12:18:43 +01:00
Eloy Lafuente (stronk7) 4137a8c195 Merge branch 'install_20_STABLE' of git://github.com/amosbot/moodle into MOODLE_20_STABLE 2011-12-01 12:04:35 +01:00
Eloy Lafuente (stronk7) 6b04aaad26 Merge branch 'MDL-30544_disable_notifications_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-12-01 10:46:18 +01:00
Andrew Davis 133a23e130 MDL-30544 message: prevented the temporarily disable notifications checkbox from accidently clearing your messaging preferences 2011-12-01 17:10:49 +08:00
Aparup Banerjee 5738c51982 Merge branch 'MDL-30260_backport_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-12-01 11:28:30 +08:00
Sam Hemelryk ebaa82b5da Merge branch 'wip-mdl-30421-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-12-01 15:49:10 +13:00
Sam Hemelryk 0e1cdd9e43 Merge branch 'wip-MDL-30469-MOODLE_20_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_20_STABLE 2011-12-01 15:19:56 +13:00
Rajesh Taneja cfd9db2b8f MDL-30421 forum: resolved error in single discussion forum, if more then one record is present 2011-12-01 09:46:16 +08:00
Sam Hemelryk bca26d231d MDL-30376 mod_glossary: Integration tidy up 2011-12-01 14:30:29 +13:00
Jason Fowler 10c8f7e601 MDL-30376 - Glossary - Fixing ability to see the RSS feed for a glossary 2011-12-01 14:18:23 +13:00
Ruslan Kabalin 24354adc3a MDL-30526 Choice: add form validation rule for numeric field 2011-12-01 12:45:06 +13:00
Sam Hemelryk 088b648ccc Merge branch 'MDL-29730_m20' of git://github.com/rwijaya/moodle into MOODLE_20_STABLE 2011-12-01 12:29:57 +13:00
Sam Hemelryk bd87b71c4d Merge branch 'MDL-30453-exassessment-link_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-12-01 12:16:23 +13:00
Sam Hemelryk 6c5ba86e35 Merge branch 'MDL-30271-switch-role-workshop_20_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_20_STABLE 2011-12-01 11:50:24 +13:00
Marina Glancy 57e47cc33a MDL-30214: Added function forum_get_file_info() to fix the bug with choosing recent forum files in filepicker 2011-11-30 15:55:17 +08:00
Aparup Banerjee 10c502480b MDL-27334 : summarised comment about problem.
we have git for history.
2011-11-30 15:19:10 +08:00
Aparup Banerjee fd5cee8ce9 Merge branch 'wip-MDL-27334-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-11-30 15:19:06 +08:00
Aparup Banerjee 4d49d71f19 MDL-29469 Enrolments : fixed whitespaces 2011-11-30 14:43:46 +08:00
Aparup Banerjee a0380d65e9 Merge branch 'wip-MDL-29469-stable20' of git://github.com/phalacee/moodle into MOODLE_20_STABLE 2011-11-30 14:43:37 +08:00
Aparup Banerjee cf1fa9497d Merge branch 'MDL-30395-MOODLE_20_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_20_STABLE 2011-11-30 14:13:27 +08:00
Rossiani Wijaya f3052cca98 MDL-29730 Lesson mod: fixed check_answer() for shortanswser with regular expression option enable 2011-11-30 11:17:31 +08:00
Jerome Mouneyrac 471af8c6c7 MDL-30395 display the folder name if the block/module of a backup file is not installed in the site 2011-11-30 10:36:14 +08:00
AMOS bot 8de624b8e1 Automatically generated installer lang files 2011-11-30 00:31:11 +00:00
Sam Hemelryk cebd1bce58 MDL-30485 whitespace fix 2011-11-30 11:56:24 +13:00
Sam Hemelryk de8b419b60 Merge commit 'FETCH_HEAd' into MOODLE_20_STABLE 2011-11-30 11:43:18 +13:00
Sam Hemelryk dc558d2882 Merge branch 'MDL-30287_grader_ajax_20' of git://github.com/andyjdavis/moodle into MOODLE_20_STABLE 2011-11-30 11:37:49 +13:00
Mary Evans c65ce8ed3c MDL-30505 Fix for nested mixed ordered/unordered lists 2011-11-30 11:17:55 +13:00
Eloy Lafuente (stronk7) 027961fcf4 Merge branch 'wip-mdl-30466-m20' of git://github.com/rajeshtaneja/moodle into MOODLE_20_STABLE 2011-11-29 19:50:09 +01:00
Andrew Davis a9767e2d01 MDL-30260 message: added an upgrade.txt to describe changes to the messaging API 2011-11-29 22:08:59 +08:00
Andrew Davis e5a3ba18f4 MDL-30260 messaging: backporting changes to prevent errors if $userto->emailto isn't supplied when sending messages 2011-11-29 22:05:09 +08:00
Jerome Mouneyrac 1785306187 Merge branches 'MOODLE_20_STABLE' and 'MOODLE_20_STABLE' of git://git.moodle.org/moodle into MOODLE_20_STABLE 2011-11-29 16:31:58 +08:00
Andrew Robert Nicols 04b1bdffdb MDL-30302 Adjust options for calendar day settings 2011-11-29 16:59:16 +13:00
Sam Hemelryk aafb430115 MDL-30273 whitespace cleanup 2011-11-29 16:47:57 +13:00
Sam Hemelryk 7231e48c27 Merge branch 'wip-MDL-30273-MOODLE_20_STABLE' of git://github.com/abgreeve/moodle into MOODLE_20_STABLE 2011-11-29 16:41:07 +13:00
Mary Evans d8c7d0999c MDL-30471 Fix for nesting unordered list inside ordered list 2011-11-29 16:29:12 +13:00
Eloy Lafuente (stronk7) c42caf06ac Merge branch 'wip-MDL-30378-m20' of git://github.com/samhemelryk/moodle into MOODLE_20_STABLE 2011-11-29 03:18:28 +01:00
Rajesh Taneja d98fbf5108 MDL-30466 Backup: Fixed duplicate completion record check error 2011-11-29 10:07:31 +08:00
AMOS bot 0fef954f39 Automatically generated installer lang files 2011-11-29 00:30:50 +00:00
Sam Hemelryk 7bfc00a71a MDL-30378 navigation: Front page activities are now added to the navigation on every page 2011-11-29 11:22:56 +13:00
Petr Skoda f9a0759eec MDL-30487 remove obsolete test
Since MDL-30303 media filter accepts any ? parameters.
2011-11-28 20:19:35 +01:00
Tim Hunt 0ce2d140b7 MDL-30485 XML import from 1.9 does not handle files in subfolders. 2011-11-28 17:27:55 +00:00
Petr Skoda 02ba9aba00 MDL-30448 fix url param problems 2011-11-28 18:55:51 +13:00
Andrew Robert Nicols 879b36fe31 MDL-30465 Add br tag when showing the 'Export to Portfolio' text 2011-11-28 18:30:45 +13:00
Aparup Banerjee 487b07bcc1 Merge branch 'MDL-30460-m20' of git://github.com/ankitagarwal/moodle into MOODLE_20_STABLE 2011-11-28 11:49:59 +08:00
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
David Mudrak 2bf6056b4a MDL-30453 Use correct renderable classes to represent assessments of example submission 2011-11-25 18:39:31 +01:00
David Mudrak 06cb4cbaee MDL-30453 New renderable classes for assessments of example submissions
The patch introduces two new classes for rendering assessments of
example submission - both the training one and the reference one.
Together with the cooking functions for obtaining instances of these
classes.
2011-11-25 18:39:31 +01:00
David Mudrak 103fc0ec44 MDL-30271 Inform the user about the example assessment conflict, instead of throwing the exception 2011-11-25 16:01:07 +01:00
David Mudrak e0475260c6 MDL-30271 Move the page initialization so that we can produce output in param processing sections eventually 2011-11-25 16:01:07 +01: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
Ankit Kumar Agarwal d616497a0e MDL-30460 Wiki making file extension case-insensitive 2011-11-25 15:06:10 +05:30
Andrew Davis b7bb9c0f6c MDL-30287 gradebook: fixed the ajax JS for grade and feedback changes on the grader report 2011-11-25 15:14:47 +08: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
adrian@moodle.com c60b224fbc MDL-27334 - forum - Fixed the issue of error session keys being displayed when trying to browse to a site without logging in. 2011-11-23 13:08:48 +08: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
Jason Fowler 2232cbb2b5 MDL-29469 Enrolments - fixing the role assignment access elevation issue 2011-11-23 11:33:45 +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
Charles Fulton 23e7302a9e MDL-30273 forum - prevent the creation of discussions in simple single forums 2011-11-18 15:40:34 +08: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
13515 changed files with 1037408 additions and 1774622 deletions
-8
View File
@@ -25,11 +25,3 @@ CVS
/.project
/.buildpath
/.cache
phpunit.xml
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
composer.phar
composer.lock
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/lib/yuilib/*/build/*/*-coverage.js
-48
View File
@@ -1,48 +0,0 @@
{
"browser": true,
"yui": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"strict": false,
"trailing": true,
"unused": true,
"white": false,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"onecase": false,
"proto": false,
"regexdash": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"sub": false,
"supernew": false,
"maxerr": 500,
"maxlen": 180,
"passfail": false,
"latedef": true
}
-5
View File
@@ -1,5 +0,0 @@
{
"coverage": false,
"lint": "config",
"clean": true
}
+1 -1
View File
@@ -8,7 +8,7 @@ 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).
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
+5 -7
View File
@@ -12,14 +12,14 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
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)) {
@@ -51,8 +51,7 @@ switch ($action) {
if ($auth == $CFG->registerauth) {
set_config('registerauth', '');
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
session_gc(); // remove stale sessions
break;
case 'enable':
@@ -62,8 +61,7 @@ switch ($action) {
$authsenabled = array_unique($authsenabled);
set_config('auth', implode(',', $authsenabled));
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
session_gc(); // remove stale sessions
break;
case 'down':
+12 -22
View File
@@ -6,7 +6,7 @@
require_once '../config.php';
require_once $CFG->libdir.'/adminlib.php';
$auth = required_param('auth', PARAM_PLUGIN);
$auth = required_param('auth', PARAM_SAFEDIR);
$PAGE->set_pagetype('admin-auth-' . $auth);
admin_externalpage_setup('authsetting'.$auth);
@@ -78,9 +78,6 @@ echo '<p style="text-align: center"><input type="submit" value="' . get_string("
echo "</div>\n";
echo "</form>\n";
$PAGE->requires->string_for_js('unmaskpassword', 'core_form');
$PAGE->requires->yui_module('moodle-auth-passwordunmask', 'M.auth.passwordunmask');
echo $OUTPUT->footer();
exit;
@@ -90,8 +87,8 @@ exit;
// 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, $customfields = array()) {
global $DB, $OUTPUT;
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'));
@@ -110,21 +107,14 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
$pluginconfig = get_config("auth/$auth");
// Helptext is on a field with rowspan.
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
$helptext = '&nbsp;';
}
// If we have custom fields then merge them with user fields.
if (!empty($customfields)) {
$user_fields = array_merge($user_fields, $customfields);
}
if (!empty($customfields)) {
$customfieldname = $DB->get_records('user_info_field', null, '', 'shortname, name');
}
foreach ($user_fields as $field) {
// Define some vars we'll work with.
// Define some vars we'll work with
if (!isset($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
@@ -138,7 +128,7 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
$pluginconfig->{"field_lock_$field"} = '';
}
// Define the fieldname we display to the user.
// define the fieldname we display to the user
$fieldname = $field;
if ($fieldname === 'lang') {
$fieldname = get_string('language');
@@ -146,10 +136,6 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} elseif (!empty($customfields) && in_array($field, $customfields)) {
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
} else {
$fieldname = get_string($fieldname);
}
@@ -169,6 +155,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
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);
@@ -187,3 +175,5 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
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();
+85 -50
View File
@@ -1,6 +1,6 @@
<?php
// Allows the admin to configure blocks (hide/show, uninstall and configure)
// Allows the admin to configure blocks (hide/show, delete and configure)
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
@@ -11,13 +11,14 @@
$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);
/// Print headings
$strmanageblocks = get_string('manageblocks');
$struninstall = get_string('uninstallplugin', 'core_admin');
$strdelete = get_string('delete');
$strversion = get_string('version');
$strhide = get_string('hide');
$strshow = get_string('show');
@@ -36,7 +37,6 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -45,7 +45,6 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -79,6 +78,60 @@
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);
@@ -96,36 +149,21 @@
$table = new flexible_table('admin-blocks-compatible');
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'settings', 'uninstall'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strsettings, $struninstall));
$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', 'admintable blockstable generaltable');
$table->set_attribute('id', 'compatibleblockstable');
$table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
$table->setup();
$tablerows = array();
// Sort blocks using current locale.
$blocknames = array();
foreach ($blocks as $blockid=>$block) {
$blockname = $block->name;
if (file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blocknames[$blockid] = get_string('pluginname', 'block_'.$blockname);
} else {
$blocknames[$blockid] = $blockname;
}
}
core_collator::asort($blocknames);
foreach ($blocknames as $blockid=>$strblockname) {
$block = $blocks[$blockid];
$blockname = $block->name;
$dbversion = get_config('block_'.$block->name, 'version');
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false;
$strblockname = '<span class="notifyproblem">'.$strblockname.' ('.get_string('missingfromdisk').')</span>';
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new stdClass();
$plugin->version = $dbversion;
$plugin->version = $block->version;
} else {
$plugin = new stdClass();
@@ -138,13 +176,10 @@
$incompatible[] = $block;
continue;
}
$strblockname = get_string('pluginname', 'block_'.$blockname);
}
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$blockname, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
}
$delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>';
$settings = ''; // By default, no configuration
if ($blockobject and $blockobject->has_config()) {
@@ -179,17 +214,17 @@
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
'<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('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = 'dimmed_text';
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}
if ($dbversion == $plugin->version) {
$version = $dbversion;
if ($block->version == $plugin->version) {
$version = $block->version;
} else {
$version = "$dbversion ($plugin->version)";
$version = "$block->version ($plugin->version)";
}
if (!$blockobject) {
@@ -197,22 +232,27 @@
$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="iconsmall" alt="'.$strunprotect.'" /></a>';
'<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/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
}
$row = array(
$strblockname,
'<span'.$class.'>'.$strblockname.'</span>',
$blocklist,
$version,
'<span'.$class.'>'.$version.'</span>',
$visible,
$undeletable,
$settings,
$uninstall,
$delete,
$settings
);
$table->add_data($row, $class);
$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();
@@ -222,8 +262,8 @@
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'uninstall'));
$table->define_headers(array($strname, $struninstall));
$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');
@@ -231,14 +271,9 @@
$table->setup();
foreach ($incompatible as $block) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$block->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
}
$table->add_data(array(
$block->name,
$uninstall,
'<a href="blocks.php?delete='.$block->id.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>',
));
}
$table->print_html();
+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;
-160
View File
@@ -1,160 +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 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);
/// no guest autologin
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)) {
print_error('categoryerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
}
if (!($settingspage->check_access())) {
print_error('accessdenied', 'admin');
}
$statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
if (admin_write_settings($data)) {
$statusmsg = get_string('changessaved');
}
if (empty($adminroot->errors)) {
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
}
} else {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
}
$adminroot = admin_get_root(true); //reload tree
$settingspage = $adminroot->locate($category, true);
}
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
$USER->editing = $adminediting;
}
if ($PAGE->user_allowed_editing()) {
$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()) {
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);
} 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);
} else {
continue;
}
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);
}
$outputhtml .= html_writer::end_tag('fieldset');
}
}
if ($savebutton) {
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::end_tag('div');
}
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_heading($SITE->fullname);
$PAGE->set_button($buttons);
echo $OUTPUT->header();
if ($errormsg !== '') {
echo $OUTPUT->notification($errormsg);
} else if ($statusmsg !== '') {
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}
$path = array_reverse($settingspage->visiblepath);
if (is_array($path)) {
$visiblename = join(' / ', $path);
} else {
$visiblename = $path;
}
echo $OUTPUT->heading(get_string('admincategory', 'admin', $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');
echo $OUTPUT->footer();
-111
View File
@@ -1,111 +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 hack is intended for clustered sites that do not want
* to use shared cachedir for component cache.
*
* This file needs to be called after any change in PHP files in dataroot,
* that is before upgrade and install.
*
* @package core
* @copyright 2013 Petr Skoda (skodak) {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
define('ABORT_AFTER_CONFIG', true); // We need just the values from config.php.
define('CACHE_DISABLE_ALL', true); // This prevents reading of existing caches.
define('IGNORE_COMPONENT_CACHE', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(
array(
'file' => false,
'rebuild' => false,
'print' => false,
'help' => false
),
array(
'h' => 'help'
)
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if (!$options['rebuild'] and !$options['file'] and !$options['print']) {
$help =
"Create alternative component cache file
Options:
-h, --help Print out this help
--rebuild Rebuild \$CFG->alternative_component_cache file
--file=filepath Save component cache to file
--print Print component cache file content
Example:
\$ php admin/cli/rebuild_alternative_component_cache.php --rebuild
";
echo $help;
exit(0);
}
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
$content = core_component::get_cache_content();
if ($options['print']) {
echo $content;
exit(0);
}
if ($options['rebuild']) {
if (empty($CFG->alternative_component_cache)) {
fwrite(STDERR, 'config.php does not contain $CFG->alternative_component_cache setting');
fwrite(STDERR, "\n");
exit(2);
}
$target = $CFG->alternative_component_cache;
} else {
$target = $options['file'];
}
if (!$target) {
fwrite(STDERR, "Invalid target file $target");
fwrite(STDERR, "\n");
exit(1);
}
$bytes = file_put_contents($target, $content);
if (!$bytes) {
fwrite(STDERR, "Error writing to $target");
fwrite(STDERR, "\n");
exit(1);
}
// Success.
echo "File $target was updated\n";
exit(0);
+2 -1
View File
@@ -75,7 +75,8 @@ if (!empty($CFG->showcronsql)) {
$DB->set_debug(true);
}
if (!empty($CFG->showcrondebugging)) {
set_debugging(DEBUG_DEVELOPER, true);
$CFG->debug = DEBUG_DEVELOPER;
$CFG->debugdisplay = true;
}
$starttime = microtime();
-125
View File
@@ -1,125 +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 script fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Get cli options.
list($options, $unrecognized) = cli_get_params(
array(
'courses' => false,
'fix' => false,
'help' => false
),
array(
'h' => 'help',
'c' => 'courses',
'f' => 'fix'
)
);
if ($options['help'] || empty($options['courses'])) {
$help =
"Checks and fixes that course modules and sections reference each other correctly.
Compares DB fields course_sections.sequence and course_modules.section
checking that:
- course_sections.sequence contains each module id not more than once in the course
- for each moduleid from course_sections.sequence the field course_modules.section
refers to the same section id (this means course_sections.sequence is more
important if they are different)
- each module in the course is present in one of course_sections.sequence
- section sequences do not contain non-existing course modules
If there are any mismatches, the message is displayed. If --fix is specified,
the records in DB are corrected.
This script may run for a long time on big systems if called for all courses.
Avoid executing the script when another user may simultaneously edit any of the
courses being checked (recommended to run in mainenance mode).
Options:
-c, --courses List courses that need to be checked (comma-separated
values or * for all). Required
-f, --fix Fix the mismatches in DB. If not specified check only and
report problems to STDERR
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=*
\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=2,3,4 --fix
";
echo $help;
die;
}
$courseslist = preg_split('/\s*,\s*/', $options['courses'], -1, PREG_SPLIT_NO_EMPTY);
if (in_array('*', $courseslist)) {
$where = '';
$params = array();
} else {
list($sql, $params) = $DB->get_in_or_equal($courseslist, SQL_PARAMS_NAMED, 'id');
$where = 'WHERE id '. $sql;
}
$coursescount = $DB->get_field_sql('SELECT count(id) FROM {course} '. $where, $params);
if (!$coursescount) {
cli_error('No courses found');
}
echo "Checking $coursescount courses...\n\n";
require_once($CFG->dirroot. '/course/lib.php');
$problems = array();
$courses = $DB->get_fieldset_sql('SELECT id FROM {course} '. $where, $params);
foreach ($courses as $courseid) {
$errors = course_integrity_check($courseid, null, null, true, empty($options['fix']));
if ($errors) {
if (!empty($options['fix'])) {
// Reset the course cache to make sure cache is recalculated next time the course is viewed.
rebuild_course_cache($courseid, true);
}
foreach ($errors as $error) {
cli_problem($error);
}
$problems[] = $courseid;
} else {
echo "Course [$courseid] is OK\n";
}
}
if (!count($problems)) {
echo "\n...All courses are OK\n";
} else {
if (!empty($options['fix'])) {
echo "\n...Found and fixed ".count($problems)." courses with problems". "\n";
} else {
echo "\n...Found ".count($problems)." courses with problems. To fix run:\n";
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=".join(',', $problems)." --fix". "\n";
}
}
-91
View File
@@ -1,91 +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 script fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix incorrectly deleted users.
This scripts detects users that are marked as deleted instead
of calling delete_user().
Deleted users do not have original username, idnumber or email,
we must also delete all roles, enrolments, group memberships, etc.
Please note this script does not delete any public information
such as forum posts.
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
";
echo $help;
die;
}
cli_heading('Looking for sloppy user deletes');
// Look for sloppy deleted users where somebody only flipped the deleted flag.
$sql = "SELECT *
FROM {user}
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
cli_heading('Deleting all leftovers');
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
exit(0);
+53 -158
View File
@@ -20,6 +20,7 @@
*
* This script is not intended for beginners!
* Potential problems:
* - environment check is not present yet
* - su to apache account or sudo before execution
* - not compatible with Windows platform
*
@@ -36,12 +37,6 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
exit(1);
}
// Force OPcache reset if used, we do not want any stale caches
// when preparing test environment.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$help =
"Command line Moodle installer, creates config.php and initializes database.
Please note you must execute this script with the same uid as apache
@@ -64,8 +59,7 @@ Options:
--dbname=NAME Database name. Default is moodle
--dbuser=USERNAME Database user. Default is root
--dbpass=PASSWORD Database password. Default is blank
--dbport=NUMBER Use database port.
--dbsocket=PATH Use database socket, 1 means default. Available for some databases only.
--dbsocket Use database sockets. Available for some databases only.
--prefix=STRING Table prefix for above database tables. Default is mdl_
--fullname=STRING The fullname of the site
--shortname=STRING The shortname of the site
@@ -85,16 +79,6 @@ Example:
"; //TODO: localize, mark as needed in install - to be translated later when everything is finished
// distro specific customisation
$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
$distro = null;
if (file_exists($distrolibfile)) {
require_once($distrolibfile);
if (function_exists('distro_get_config')) {
$distro = distro_get_config();
}
}
// Nothing to do if config.php exists
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
if (file_exists($configfile)) {
@@ -107,16 +91,12 @@ if (file_exists($configfile)) {
echo "\n\n";
}
if ($DB->get_manager()->table_exists('config')) {
cli_error(get_string('clialreadyinstalled', 'install'));
} else {
cli_error(get_string('clialreadyconfigured', 'install'));
}
cli_error(get_string('clialreadyinstalled', 'install'));
}
$olddir = getcwd();
// change directory so that includes below work properly
// change directory so that includes bellow work properly
chdir(dirname($_SERVER['argv'][0]));
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
@@ -134,38 +114,26 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau
/** Used by library scripts to check they are being called by Moodle */
define('MOODLE_INTERNAL', true);
// Disables all caching.
define('CACHE_DISABLE_ALL', true);
define('PHPUNIT_TEST', false);
define('IGNORE_COMPONENT_CACHE', true);
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.3.3") < 0) {
if (version_compare(phpversion(), "5.2.8") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion).\n";
echo "Please upgrade your server software or install latest Moodle 1.9.x instead.";
die;
}
// set up configuration
global $CFG;
$CFG = new stdClass();
$CFG->lang = 'en';
$CFG->dirroot = dirname(dirname(dirname(__FILE__)));
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->dataroot = str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata');
$CFG->docroot = 'http://docs.moodle.org';
$CFG->running_installer = true;
$CFG->early_install_lang = true;
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
$CFG->dboptions = array();
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = true;
$CFG->debugdeveloper = true;
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
$CFG->admin = array_pop($parts);
@@ -174,56 +142,22 @@ $CFG->admin = array_pop($parts);
//the problem is that we need specific version of quickforms and hacked excel files :-(
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
require_once($CFG->libdir.'/classes/component.php');
require_once($CFG->libdir.'/classes/text.php');
require_once($CFG->libdir.'/classes/string_manager.php');
require_once($CFG->libdir.'/classes/string_manager_install.php');
require_once($CFG->libdir.'/classes/string_manager_standard.php');
require_once($CFG->libdir.'/installlib.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/setuplib.php');
require_once($CFG->libdir.'/textlib.class.php');
require_once($CFG->libdir.'/weblib.php');
require_once($CFG->libdir.'/dmllib.php');
require_once($CFG->libdir.'/moodlelib.php');
require_once($CFG->libdir.'/deprecatedlib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
require_once($CFG->dirroot.'/cache/lib.php');
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}
require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;
$_SESSION = array();
$_SESSION['SESSION'] = new stdClass();
$_SESSION['SESSION']->lang = $CFG->lang;
$_SESSION['USER'] = new stdClass();
$_SESSION['USER']->id = 0;
$_SESSION['USER']->mnethostid = 1;
global $SESSION;
global $USER;
$SESSION = &$_SESSION['SESSION'];
$USER = &$_SESSION['USER'];
global $COURSE;
$COURSE = new stdClass();
$COURSE->id = 1;
global $SITE;
$SITE = $COURSE;
define('SITEID', 1);
//Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
'mariadb'=> moodle_database::get_driver_instance('mariadb', 'native'),
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
'oci' => moodle_database::get_driver_instance('oci', 'native'),
'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // MS SQL*Server PHP driver
@@ -244,17 +178,16 @@ if (empty($databases)) {
// now get cli options
list($options, $unrecognized) = cli_get_params(
array(
'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
'chmod' => '2777',
'lang' => $CFG->lang,
'wwwroot' => '',
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
'dataroot' => $CFG->dataroot,
'dbtype' => $defaultdb,
'dbhost' => 'localhost',
'dbname' => 'moodle',
'dbuser' => empty($distro->dbuser) ? 'root' : $distro->dbuser, // let distros set dbuser
'dbuser' => 'root',
'dbpass' => '',
'dbport' => '',
'dbsocket' => '',
'dbsocket' => false,
'prefix' => 'mdl_',
'fullname' => '',
'shortname' => '',
@@ -295,8 +228,18 @@ echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
if ($interactive) {
cli_separator();
$languages = get_string_manager()->get_list_of_translations();
// Do not put the langs into columns because it is not compatible with RTL.
$langlist = implode("\n", $languages);
// format the langs nicely - 3 per line
$c = 0;
$langlist = '';
foreach ($languages as $key=>$lang) {
$c++;
$length = iconv_strlen($lang, 'UTF-8');
$padded = $lang.str_repeat(' ', 38-$length);
$langlist .= $padded;
if ($c % 3 == 0) {
$langlist .= "\n";
}
}
$default = $CFG->lang;
cli_heading(get_string('availablelangs', 'install'));
echo $langlist."\n";
@@ -344,8 +287,6 @@ if ($interactive) {
}
}
$CFG->directorypermissions = $chmod;
$CFG->filepermissions = ($CFG->directorypermissions & 0666);
$CFG->umaskpermissions = (($CFG->directorypermissions & 0777) ^ 0777);
//We need wwwroot before we test dataroot
$wwwroot = clean_param($options['wwwroot'], PARAM_URL);
@@ -384,7 +325,9 @@ $CFG->httpswwwroot = $CFG->wwwroot;
//We need dataroot before lang download
$CFG->dataroot = $options['dataroot'];
if (!empty($options['dataroot'])) {
$CFG->dataroot = $options['dataroot'];
}
if ($interactive) {
cli_separator();
$i=0;
@@ -432,20 +375,26 @@ if ($interactive) {
cli_error(get_string('pathserrcreatedataroot', 'install', $a));
}
}
$CFG->tempdir = $CFG->dataroot.'/temp';
$CFG->cachedir = $CFG->dataroot.'/cache';
$CFG->localcachedir = $CFG->dataroot.'/localcache';
// download required lang packs
if ($CFG->lang !== 'en') {
$installer = new lang_installer($CFG->lang);
$results = $installer->run();
foreach ($results as $langcode => $langstatus) {
if ($langstatus === lang_installer::RESULT_DOWNLOADERROR) {
$a = new stdClass();
$a->url = $installer->lang_pack_url($langcode);
$a->dest = $CFG->dataroot.'/lang';
cli_problem(get_string('remotedownloaderror', 'error', $a));
//download lang pack with optional notification
if ($CFG->lang != 'en') {
if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0', $CFG->lang.'.zip', 'languages.md5', 'lang')) {
if ($cd->install() == COMPONENT_ERROR) {
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/langpack/2.0/'.$CFG->lang.'.zip';
$a->dest = $CFG->dataroot.'/lang';
cli_problem(get_string($cd->get_error(), 'error', $a));
} else {
cli_problem(get_string($cd->get_error(), 'error'));
}
} else {
// install parent lang if defined
if ($parentlang = get_parent_language()) {
if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0', $parentlang.'.zip', 'languages.md5', 'lang')) {
$cd->install();
}
}
}
}
}
@@ -473,8 +422,7 @@ if (isset($maturity)) {
exit(1);
}
} else {
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
cli_error(get_string('maturityallowunstable', 'admin'));
cli_error(get_string('maturitycorewarning', 'admin'));
}
}
}
@@ -550,34 +498,6 @@ if ($interactive) {
$CFG->prefix = $options['prefix'];
}
// ask for db port
if ($interactive) {
cli_separator();
cli_heading(get_string('databaseport', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbport']);
$CFG->dboptions['dbport'] = (int)cli_input($prompt, $options['dbport']);
} else {
$CFG->dboptions['dbport'] = (int)$options['dbport'];
}
if ($CFG->dboptions['dbport'] <= 0) {
$CFG->dboptions['dbport'] = '';
}
// ask for db socket
if ($CFG->ostype === 'WINDOWS') {
$CFG->dboptions['dbsocket'] = '';
} else if ($interactive and empty($CFG->dboptions['dbport'])) {
cli_separator();
cli_heading(get_string('databasesocket', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbsocket']);
$CFG->dboptions['dbsocket'] = cli_input($prompt, $options['dbsocket']);
} else {
$CFG->dboptions['dbsocket'] = $options['dbsocket'];
}
// ask for db user
if ($interactive) {
cli_separator();
@@ -605,15 +525,12 @@ if ($interactive) {
}
$CFG->dbpass = cli_input($prompt, $options['dbpass']);
if (function_exists('distro_pre_create_db')) { // Hook for distros needing to do something before DB creation
$distro = distro_pre_create_db($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']), $distro);
}
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']));
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']));
} while ($hint_database !== '');
} else {
$CFG->dbpass = $options['dbpass'];
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']));
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']));
if ($hint_database !== '') {
cli_error(get_string('dbconnectionerror', 'install'));
}
@@ -737,28 +654,6 @@ require($configfile);
$CFG->lang = $installlang;
$SESSION->lang = $CFG->lang;
require("$CFG->dirroot/version.php");
// Test environment first.
require_once($CFG->libdir . '/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
$errors = environment_get_errors($environment_results);
cli_heading(get_string('environment', 'admin'));
foreach ($errors as $error) {
list($info, $report) = $error;
echo "!! $info !!\n$report\n\n";
}
exit(1);
}
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
install_cli_database($options, $interactive);
echo get_string('cliinstallfinished', 'install')."\n";
+26 -45
View File
@@ -29,19 +29,12 @@
*/
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
// extra execution prevention - we can not just require config.php here
if (isset($_SERVER['REMOTE_ADDR'])) {
exit(1);
}
// Force OPcache reset if used, we do not want any stale caches
// when preparing test environment.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$help =
"Advanced command line Moodle database installer.
Please note you must execute this script with the same uid as apache.
@@ -53,8 +46,8 @@ Options:
--adminuser=USERNAME Username for the moodle admin account. Default is admin.
--adminpass=PASSWORD Password for the moodle admin account.
--agree-license Indicates agreement with software license.
--fullname=STRING Name of the site
--shortname=STRING Name of the site
--fullname Name of the site
--shortname Name of the site
-h, --help Print out this help
Example:
@@ -62,12 +55,12 @@ Example:
";
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.3.3") < 0) {
if (version_compare(phpversion(), "5.2.8") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
fwrite(STDERR, "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install latest Moodle 1.9.x instead.\n");
die(1);
}
// Nothing to do if config.php does not exist
@@ -75,7 +68,7 @@ $configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
if (!file_exists($configfile)) {
fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize
fwrite(STDERR, "\n");
exit(1);
die(1);
}
// Include necessary libs
@@ -132,17 +125,26 @@ if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
}
$CFG->lang = $options['lang'];
// download required lang packs
if ($CFG->lang !== 'en') {
//download lang pack with optional notification
if ($CFG->lang != 'en') {
make_upload_directory('lang');
$installer = new lang_installer($CFG->lang);
$results = $installer->run();
foreach ($results as $langcode => $langstatus) {
if ($langstatus === lang_installer::RESULT_DOWNLOADERROR) {
$a = new stdClass();
$a->url = $installer->lang_pack_url($langcode);
$a->dest = $CFG->dataroot.'/lang';
cli_problem(get_string('remotedownloaderror', 'error', $a));
if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0', $CFG->lang.'.zip', 'languages.md5', 'lang')) {
if ($cd->install() == COMPONENT_ERROR) {
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/langpack/2.0/'.$CFG->lang.'.zip';
$a->dest = $CFG->dataroot.'/lang';
cli_problem(get_string($cd->get_error(), 'error', $a));
} else {
cli_problem(get_string($cd->get_error(), 'error'));
}
} else {
// install parent lang if defined
if ($parentlang = get_parent_language()) {
if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0', $parentlang.'.zip', 'languages.md5', 'lang')) {
$cd->install();
}
}
}
}
}
@@ -151,27 +153,6 @@ if ($CFG->lang !== 'en') {
$CFG->early_install_lang = false;
get_string_manager(true);
require("$CFG->dirroot/version.php");
// Test environment first.
require_once($CFG->libdir . '/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
$errors = environment_get_errors($environment_results);
cli_heading(get_string('environment', 'admin'));
foreach ($errors as $error) {
list($info, $report) = $error;
echo "!! $info !!\n$report\n\n";
}
exit(1);
}
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
install_cli_database($options, true);
+10 -46
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Enable or disable maintenance mode.
* Enable or disable maintenance mode
*
* @package core
* @subpackage cli
@@ -25,13 +26,12 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once("$CFG->libdir/clilib.php");
require_once("$CFG->libdir/adminlib.php");
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'enablelater'=>0, 'enableold'=>false, 'disable'=>false, 'help'=>false),
// now get cli options
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'disable'=>false, 'help'=>false),
array('h'=>'help'));
if ($unrecognized) {
@@ -45,14 +45,12 @@ if ($options['help']) {
Current status displayed if not option specified.
Options:
--enable Enable CLI maintenance mode
--enablelater=MINUTES Number of minutes before entering CLI maintenance mode
--enableold Enable legacy half-maintenance mode
--enable Enable maintenance mode
--disable Disable maintenance mode
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/maintenance.php
\$sudo -u www-data /usr/bin/php admin/cli/maintenance.php
"; //TODO: localize - to be translated later when everything is finished
echo $help;
@@ -61,52 +59,18 @@ Example:
cli_heading(get_string('sitemaintenancemode', 'admin')." ($CFG->wwwroot)");
if ($options['enablelater']) {
if (file_exists("$CFG->dataroot/climaintenance.html")) {
// Already enabled, sorry.
echo get_string('clistatusenabled', 'admin')."\n";
return 1;
}
$time = time() + ($options['enablelater']*60);
set_config('maintenance_later', $time);
echo get_string('clistatusenabledlater', 'admin', userdate($time))."\n";
return 0;
} else if ($options['enable']) {
if (file_exists("$CFG->dataroot/climaintenance.html")) {
// The maintenance is already enabled, nothing to do.
} else {
enable_cli_maintenance_mode();
}
set_config('maintenance_enabled', 0);
unset_config('maintenance_later');
echo get_string('sitemaintenanceoncli', 'admin')."\n";
exit(0);
} else if ($options['enableold']) {
if ($options['enable']) {
set_config('maintenance_enabled', 1);
unset_config('maintenance_later');
echo get_string('sitemaintenanceon', 'admin')."\n";
exit(0);
} else if ($options['disable']) {
set_config('maintenance_enabled', 0);
unset_config('maintenance_later');
if (file_exists("$CFG->dataroot/climaintenance.html")) {
unlink("$CFG->dataroot/climaintenance.html");
}
echo get_string('sitemaintenanceoff', 'admin')."\n";
exit(0);
}
if (!empty($CFG->maintenance_enabled) or file_exists("$CFG->dataroot/climaintenance.html")) {
if (!empty($CFG->maintenance_enabled)) {
echo get_string('clistatusenabled', 'admin')."\n";
} else if (isset($CFG->maintenance_later)) {
echo get_string('clistatusenabledlater', 'admin', userdate($CFG->maintenance_later))."\n";
} else {
echo get_string('clistatusdisabled', 'admin')."\n";
}
-211
View File
@@ -1,211 +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/>.
/**
* MySQL collation conversion tool.
*
* @package core
* @copyright 2012 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
if ($DB->get_dbfamily() !== 'mysql') {
cli_error('This function is designed for MySQL databases only!');
}
// now get cli options
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'collation'=>false, 'available'=>false),
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$help =
"MySQL collation conversions script.
It is strongly recommended to stop the web server before the conversion.
This script may be executed before the main upgrade - 1.9.x data for example.
Options:
--collation=COLLATION Convert MySQL tables to different collation
-l, --list Show table and column information
-a, --available Show list of available collations
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8_general_ci
";
if (!empty($options['collation'])) {
$collations = mysql_get_collations();
$collation = clean_param($options['collation'], PARAM_ALPHANUMEXT);
$collation = strtolower($collation);
if (!isset($collations[$collation])) {
cli_error("Error: collation '$collation' is not available on this server!");
}
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
$prefix = $DB->get_prefix();
$prefix = str_replace('_', '\\_', $prefix);
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
$rs = $DB->get_recordset_sql($sql);
$converted = 0;
$skipped = 0;
$errors = 0;
foreach ($rs as $table) {
echo str_pad($table->name, 40). " - ";
if ($table->collation === $collation) {
echo "NO CHANGE\n";
$skipped++;
} else {
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
echo "CONVERTED\n";
$converted++;
}
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
$rs2 = $DB->get_recordset_sql($sql);
foreach ($rs2 as $column) {
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
echo ' '.str_pad($column->field, 36). " - ";
if ($column->collation === $collation) {
echo "NO CHANGE\n";
$skipped++;
continue;
}
if ($column->type === 'tinytext' or $column->type === 'mediumtext' or $column->type === 'text' or $column->type === 'longtext') {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
$DB->change_database_structure($sql);
} else if (strpos($column->type, 'varchar') === 0) {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
$DB->change_database_structure($sql);
} else {
echo "ERROR (unknown column type: $column->type)\n";
$error++;
continue;
}
echo "CONVERTED\n";
$converted++;
}
$rs2->close();
}
$rs->close();
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
exit(0); // success
} else if (!empty($options['list'])) {
echo "List of tables for $CFG->wwwroot:\n";
$prefix = $DB->get_prefix();
$prefix = str_replace('_', '\\_', $prefix);
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
$rs = $DB->get_recordset_sql($sql);
$counts = array();
foreach ($rs as $table) {
if (isset($counts[$table->collation])) {
$counts[$table->collation]++;
} else {
$counts[$table->collation] = 1;
}
echo str_pad($table->name, 40);
echo $table->collation. "\n";
$collations = mysql_get_column_collations($table->name);
foreach ($collations as $columname=>$collation) {
if (isset($counts[$collation])) {
$counts[$collation]++;
} else {
$counts[$collation] = 1;
}
echo ' ';
echo str_pad($columname, 36);
echo $collation. "\n";
}
}
$rs->close();
echo "\n";
echo "Table collations summary for $CFG->wwwroot:\n";
foreach ($counts as $collation => $count) {
echo "$collation: $count\n";
}
exit(0); // success
} else if (!empty($options['available'])) {
echo "List of available MySQL collations for $CFG->wwwroot:\n";
$collations = mysql_get_collations();
foreach ($collations as $collation) {
echo " $collation\n";
}
die;
} else {
echo $help;
die;
}
// ========== Some functions ==============
function mysql_get_collations() {
global $DB;
$collations = array();
$sql = "SHOW COLLATION WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $collation) {
$collations[$collation->collation] = $collation->collation;
}
$rs->close();
$collation = $DB->get_dbcollation();
if (isset($collations[$collation])) {
$collations[$collation] .= ' (default)';
}
return $collations;
}
function mysql_get_column_collations($tablename) {
global $DB;
$collations = array();
$sql = "SELECT column_name, collation_name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = DATABASE() AND table_name = ? AND collation_name IS NOT NULL";
$rs = $DB->get_recordset_sql($sql, array($tablename));
foreach($rs as $record) {
$collations[$record->column_name] = $record->collation_name;
}
$rs->close();
return $collations;
}
+8 -73
View File
@@ -34,8 +34,8 @@ if ($DB->get_dbfamily() !== 'mysql') {
}
// now get cli options
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false),
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false),
array('h'=>'help', 'l'=>'list'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
@@ -52,7 +52,6 @@ and does not support transactions.
Options:
--engine=ENGINE Convert MySQL tables to different engine
-l, --list Show table information
-a, --available Show list of available engines
-h, --help Print out this help
Example:
@@ -60,11 +59,7 @@ Example:
";
if (!empty($options['engine'])) {
$engines = mysql_get_engines();
$engine = clean_param($options['engine'], PARAM_ALPHA);
if (!isset($engines[strtoupper($engine)])) {
cli_error("Error: engine '$engine' is not available on this server!");
}
echo "Converting tables to '$engine' for $CFG->wwwroot:\n";
$prefix = $DB->get_prefix();
@@ -73,34 +68,20 @@ if (!empty($options['engine'])) {
$rs = $DB->get_recordset_sql($sql);
$converted = 0;
$skipped = 0;
$errors = 0;
foreach ($rs as $table) {
if (strtoupper($table->engine) === strtoupper($engine)) {
$newengine = mysql_get_table_engine($table->name);
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n";
if ($table->engine === $engine) {
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n";
$skipped++;
continue;
}
echo str_pad($table->name, 40). " - ";
try {
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
$newengine = mysql_get_table_engine($table->name);
if (strtoupper($newengine) !== strtoupper($engine)) {
echo "ERROR ($newengine)\n";
$errors++;
continue;
}
echo "DONE ($newengine)\n";
$converted++;
} catch (moodle_exception $e) {
echo $e->getMessage()."\n";
$errors++;
continue;
}
$DB->change_database_structure("ALTER TABLE {$table->name} TYPE = $engine");
echo "DONE\n";
$converted++;
}
$rs->close();
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
echo "Converted: $converted, skipped: $skipped\n";
exit(0); // success
} else if (!empty($options['list'])) {
@@ -128,53 +109,7 @@ if (!empty($options['engine'])) {
}
exit(0); // success
} else if (!empty($options['available'])) {
echo "List of available MySQL engines for $CFG->wwwroot:\n";
$engines = mysql_get_engines();
foreach ($engines as $engine) {
echo " $engine\n";
}
die;
} else {
echo $help;
die;
}
// ========== Some functions ==============
function mysql_get_engines() {
global $DB;
$sql = "SHOW Engines";
$rs = $DB->get_recordset_sql($sql);
$engines = array();
foreach ($rs as $engine) {
if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') {
continue;
}
$engines[strtoupper($engine->engine)] = $engine->engine;
if (strtoupper($engine->support) === 'DEFAULT') {
$engines[strtoupper($engine->engine)] .= ' (default)';
}
}
$rs->close();
return $engines;
}
function mysql_get_table_engine($tablename) {
global $DB;
$engine = null;
$sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here
$rs = $DB->get_recordset_sql($sql);
if ($rs->valid()) {
$record = $rs->current();
$engine = $record->engine;
}
$rs->close();
return $engine;
}
-53
View File
@@ -1,53 +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/>.
/**
* @package core
* @subpackage cli
* @copyright 2011 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php');
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if ($options['help']) {
$help =
"Invalidates all Moodle internal caches
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/purge_caches.php
";
echo $help;
exit(0);
}
purge_all_caches();
exit(0);
+9 -32
View File
@@ -20,6 +20,7 @@
*
* This script is not intended for beginners!
* Potential problems:
* - environment check is not present yet
* - su to apache account or sudo before execution
* - not compatible with Windows platform
*
@@ -29,14 +30,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Force OPcache reset if used, we do not want any stale caches
// when detecting if upgrade necessary or when running upgrade.
if (function_exists('opcache_reset') and !isset($_SERVER['REMOTE_ADDR'])) {
opcache_reset();
}
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
@@ -44,6 +38,7 @@ require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install rel
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/environmentlib.php');
// now get cli options
list($options, $unrecognized) = cli_get_params(
array(
@@ -88,7 +83,7 @@ if (empty($CFG->version)) {
cli_error(get_string('missingconfigversion', 'debug'));
}
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
$CFG->target_release = $release; // used during installation and upgrades
if ($version < $CFG->version) {
@@ -98,13 +93,8 @@ if ($version < $CFG->version) {
$oldversion = "$CFG->release ($CFG->version)";
$newversion = "$release ($version)";
if (!moodle_needs_upgrading()) {
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 0);
}
// Test environment first.
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
// test environment first
if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) {
$errors = environment_get_errors($environment_results);
cli_heading(get_string('environment', 'admin'));
foreach ($errors as $error) {
@@ -114,13 +104,6 @@ if (!$envstatus) {
exit(1);
}
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
if ($interactive) {
$a = new stdClass();
$a->oldversion = $oldversion;
@@ -140,8 +123,7 @@ if (isset($maturity)) {
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
cli_separator();
} else {
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
cli_error(get_string('maturityallowunstable', 'admin'));
cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
}
}
}
@@ -156,22 +138,17 @@ if ($interactive) {
}
if ($version > $CFG->version) {
// We purge all of MUC's caches here.
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
// This ensures a real config object is loaded and the stores will be purged.
// This is the only way we can purge custom caches such as memcache or APC.
// Note: all other calls to caches will still used the disabled API.
cache_helper::purge_all(true);
upgrade_core($version, true);
}
set_config('release', $release);
set_config('branch', $branch);
// unconditionally upgrade
upgrade_noncore(true);
// log in as admin - we need doanything permission when applying defaults
\core\session\manager::set_user(get_admin());
$admins = get_admins();
$admin = reset($admins);
session_set_user($admin);
// apply all default settings, just in case do it twice to fill all defaults
admin_apply_default_settings(NULL, false);
-83
View File
@@ -1,83 +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 the admin to enable, disable and uninstall course formats
*
* @package core_admin
* @copyright 2012 Marina Glancy
* @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);
$formatname = required_param('format', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/courseformats.php');
$PAGE->set_context($syscontext);
require_login();
require_capability('moodle/site:config', $syscontext);
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
$formatplugins = core_plugin_manager::instance()->get_plugins_of_type('format');
$sortorder = array_flip(array_keys($formatplugins));
if (!isset($formatplugins[$formatname])) {
print_error('courseformatnotfound', 'error', $return, $formatname);
}
switch ($action) {
case 'disable':
if ($formatplugins[$formatname]->is_enabled()) {
if (get_config('moodlecourse', 'format') === $formatname) {
print_error('cannotdisableformat', 'error', $return);
}
set_config('disabled', 1, 'format_'. $formatname);
core_plugin_manager::reset_caches();
}
break;
case 'enable':
if (!$formatplugins[$formatname]->is_enabled()) {
unset_config('disabled', 'format_'. $formatname);
core_plugin_manager::reset_caches();
}
break;
case 'up':
if ($sortorder[$formatname]) {
$currentindex = $sortorder[$formatname];
$seq = array_keys($formatplugins);
$seq[$currentindex] = $seq[$currentindex-1];
$seq[$currentindex-1] = $formatname;
set_config('format_plugins_sortorder', implode(',', $seq));
}
break;
case 'down':
if ($sortorder[$formatname] < count($sortorder)-1) {
$currentindex = $sortorder[$formatname];
$seq = array_keys($formatplugins);
$seq[$currentindex] = $seq[$currentindex+1];
$seq[$currentindex+1] = $formatname;
set_config('format_plugins_sortorder', implode(',', $seq));
}
break;
}
redirect($return);
+16 -5
View File
@@ -53,7 +53,7 @@ require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/cronlib.php');
// extra safety
\core\session\manager::write_close();
session_get_instance()->write_close();
// check if execution allowed
if (!empty($CFG->cronclionly)) {
@@ -72,10 +72,21 @@ if (!empty($CFG->cronremotepassword)) {
}
// send mime type and encoding
@header('Content-Type: text/plain; charset=utf-8');
// we do not want html markup in emulated CLI
@ini_set('html_errors', 'off');
if (check_browser_version('MSIE')) {
//ugly IE hack to work around downloading instead of viewing
@header('Content-Type: text/html; charset=utf-8');
echo "<xmp>"; //<pre> is not good enough for us here
} else {
//send proper plaintext header
@header('Content-Type: text/plain; charset=utf-8');
}
// execute the cron
cron_run();
// finish the IE hack
if (check_browser_version('MSIE')) {
echo "</xmp>";
}
+32
View File
@@ -0,0 +1,32 @@
<?PHP
// dbperformance.php - shows latest ADOdb stats for the current server
// disable moodle specific debug messages and any errors in output
define('NO_DEBUG_DISPLAY', true);
require_once('../config.php');
error('TODO: rewrite db perf code'); // TODO: rewrite
$topframe = optional_param('topframe', 0, PARAM_BOOL);
$bottomframe = optional_param('bottomframe', 0, PARAM_BOOL);
$do = optional_param('do', '', PARAM_ALPHA);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$strdatabaseperformance = get_string("databaseperformance");
$stradministration = get_string("administration");
$site = get_site();
if (!empty($topframe)) {
$PAGE->set_url('/admin/dbperformance.php');
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php'));
$PAGE->navbar->add($strdatabaseperformance);
$PAGE->set_title("$site->shortname: $strdatabaseperformance");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
exit;
}
+19
View File
@@ -0,0 +1,19 @@
<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once $CFG->libdir.'/formslib.php';
class database_export_form extends moodleform {
function definition() {
$mform = $this->_form;
$mform->addElement('header', 'database', get_string('dbexport', 'dbtransfer'));
$mform->addElement('textarea', 'description', get_string('description'), array('rows'=>5, 'cols'=>60));
$this->add_action_buttons(false, get_string('exportdata', 'dbtransfer'));
}
}
@@ -0,0 +1,48 @@
<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once $CFG->libdir.'/formslib.php';
class database_transfer_form extends moodleform {
function definition() {
$mform = $this->_form;
$mform->addElement('header', 'database', get_string('dbtransfer', 'dbtransfer'));
$supported = array (
'mysqli/native',
'pgsql/native',
'mssql/native',
'oci/native',
'sqlite3/pdo',
);
$drivers = array();
foreach($supported as $driver) {
list($dbtype, $dblibrary) = explode('/', $driver);
$targetdb = moodle_database::get_driver_instance($dbtype, $dblibrary);
if ($targetdb->driver_installed() !== true) {
continue;
}
$drivers[$driver] = $driver;
}
$mform->addElement('select', 'driver', get_string('dbtype', 'install'), $drivers);
$mform->addElement('text', 'dbhost', get_string('dbhost', 'install'));
$mform->addElement('text', 'dbname', get_string('database', 'install'));
$mform->addElement('text', 'dbuser', get_string('user'));
$mform->addElement('text', 'dbpass', get_string('password'));
$mform->addElement('text', 'prefix', get_string('dbprefix', 'install'));
$mform->addRule('dbhost', get_string('required'), 'required', null);
$mform->addRule('dbname', get_string('required'), 'required', null);
$mform->addRule('dbuser', get_string('required'), 'required', null);
$mform->addRule('dbpass', get_string('required'), 'required', null);
$mform->addRule('prefix', get_string('required'), 'required', null);
$this->add_action_buttons(false, get_string('transferdata', 'dbtransfer'));
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
require('../../config.php');
require_once('lib.php');
require_once('database_export_form.php');
require_login();
admin_externalpage_setup('dbexport');
//create form
$form = new database_export_form();
if ($data = $form->get_data()) {
dbtransfer_export_xml_database($data->description, $DB);
die;
}
echo $OUTPUT->header();
// TODO: add some more info here
$form->display();
echo $OUTPUT->footer();
+47
View File
@@ -0,0 +1,47 @@
<?php
require('../../config.php');
require_once('lib.php');
require_once('database_transfer_form.php');
require_login();
admin_externalpage_setup('dbtransfer');
// Create the form
$form = new database_transfer_form();
// If we have valid input.
if ($data = $form->get_data()) {
// Connect to the other database.
list($dbtype, $dblibrary) = explode('/', $data->driver);
$targetdb = moodle_database::get_driver_instance($dbtype, $dblibrary);
if (!$targetdb->connect($data->dbhost, $data->dbuser, $data->dbpass, $data->dbname, $data->prefix, null)) {
throw new dbtransfer_exception('notargetconectexception', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
}
if ($targetdb->get_tables()) {
throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
}
// Start output.
echo $OUTPUT->header();
$data->dbtype = $dbtype;
echo $OUTPUT->heading(get_string('transferringdbto', 'dbtransfer', $data));
// Do the transfer.
$feedback = new html_list_progress_trace();
dbtransfer_transfer_database($DB, $targetdb, $feedback);
$feedback->finished();
// Finish up.
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
echo $OUTPUT->continue_button("$CFG->wwwroot/$CFG->admin/");
echo $OUTPUT->footer();
die;
}
// Otherwise display the settings form.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('transferdbtoserver', 'dbtransfer'));
echo '<p>', get_string('transferdbintro', 'dbtransfer'), "</p>\n\n";
$form->display();
echo $OUTPUT->footer();
+52
View File
@@ -0,0 +1,52 @@
<?php
/*
TODO:
- exporting to server file >2GB fails in 32bit operating systems - needs warning
- we may run out of disk space exporting to srever file - we must verify the file is not truncated; read from the end of file?
- when sending file >4GB - FAT32 limit, Apache limit, browser limit - needs warning
- there must be some form of progress bar during export, transfer - new tracking class could be passed around
- command line operation - could work around some 2G/4G limits in PHP; useful for cron full backups
- by default allow exporting into empty database only (no tables with the same prefix yet)
- all dangerous operation (like deleting of all data) should be confirmed by key found in special file in dataroot
(user would need file access to dataroot which might prevent various "accidents")
- implement "Export/import running" notification in lib/setup.php (similar to new upgrade flag in config table)
- gzip compression when storing xml file - the xml is very verbose and full of repeated tags (zip is not suitable here at all)
this could help us keep the files bellow 2G (expected ratio is > 10:1)
*/
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/dtllib.php');
function dbtransfer_export_xml_database($description, $mdb) {
@set_time_limit(0);
session_get_instance()->write_close(); // release session
header('Content-Type: application/xhtml+xml; charset=utf-8');
header('Content-Disposition: attachment; filename=database.xml');
header('Expires: 0');
header('Cache-Control: must-revalidate,post-check=0,pre-check=0');
header('Pragma: public');
while(@ob_flush());
$var = new file_xml_database_exporter('php://output', $mdb);
$var->export_database($description);
// no more output
die;
}
function dbtransfer_transfer_database($sourcedb, $targetdb, $feedback = null) {
@set_time_limit(0);
session_get_instance()->write_close(); // release session
$var = new database_mover($sourcedb, $targetdb, true, $feedback);
$var->export_database(null);
}
+86
View File
@@ -0,0 +1,86 @@
<?php
// Deletes the moodledata directory, COMPLETELY!!
// BE VERY CAREFUL USING THIS!
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('purgemoodledata');
require_login();
$sure = optional_param('sure', 0, PARAM_BOOL);
$reallysure = optional_param('reallysure', 0, PARAM_BOOL);
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$deletedir = $CFG->dataroot; // The directory to delete!
echo $OUTPUT->header();
echo $OUTPUT->heading('Purge moodledata');
if (empty($sure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
$formcancel = new single_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
}
if (!data_submitted() or empty($reallysure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
$formcancel = new single_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '.
$deletedir .' (this includes all user images, and any other course files that have been created) ?',
$formcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
}
if (!confirm_sesskey()) {
print_error('wrongcall', 'error');
}
/// OK, here goes ...
delete_subdirectories($deletedir);
echo '<h1 align="center">Done!</h1>';
echo $OUTPUT->continue_button($CFG->wwwroot);
echo $OUTPUT->footer();
exit;
function delete_subdirectories($rootdir) {
$dir = opendir($rootdir);
while (false !== ($file = readdir($dir))) {
if ($file != '.' and $file != '..') {
$fullfile = $rootdir .'/'. $file;
if (filetype($fullfile) == 'dir') {
delete_subdirectories($fullfile);
echo 'Deleting '. $fullfile .' ... ';
if (rmdir($fullfile)) {
echo 'Done.<br />';
} else {
echo 'FAILED.<br />';
}
} else {
echo 'Deleting '. $fullfile .' ... ';
if (unlink($fullfile)) {
echo 'Done.<br />';
} else {
echo 'FAILED.<br />';
}
}
}
}
closedir($dir);
}
+4 -10
View File
@@ -8,18 +8,14 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$editor = required_param('editor', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/editors.php', array('action'=>$action, 'editor'=>$editor));
$PAGE->set_context(context_system::instance());
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
$action = optional_param('action', '', PARAM_ACTION);
$editor = optional_param('editor', '', PARAM_SAFEDIR);
// get currently installed and enabled auth plugins
$available_editors = editors_get_available();
if (!empty($editor) and empty($available_editors[$editor])) {
@@ -82,7 +78,6 @@ switch ($action) {
}
}
break;
default:
break;
}
@@ -93,7 +88,6 @@ if (empty($active_editors)) {
}
set_config('texteditors', implode(',', $active_editors));
core_plugin_manager::reset_caches();
if ($return) {
redirect ($returnurl);
+20 -33
View File
@@ -23,20 +23,17 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$enrol = required_param('enrol', PARAM_PLUGIN);
$action = required_param('action', PARAM_ACTION);
$enrol = required_param('enrol', PARAM_SAFEDIR);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/enrol.php');
$PAGE->set_context(context_system::instance());
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
require_sesskey();
$enabled = enrol_get_plugins(true);
@@ -44,14 +41,10 @@ $all = enrol_get_plugins(false);
$return = new moodle_url('/admin/settings.php', array('section'=>'manageenrols'));
$syscontext = context_system::instance();
switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
case 'enable':
@@ -61,8 +54,6 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enrol_plugins_enabled', implode(',', $enabled));
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
case 'up':
@@ -97,36 +88,32 @@ switch ($action) {
set_config('enrol_plugins_enabled', implode(',', $enabled));
break;
case 'migrate':
case 'uninstall':
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
if (get_string_manager()->string_exists('pluginname', 'enrol_'.$enrol)) {
$strplugin = get_string('pluginname', 'enrol_'.$enrol);
} else {
$strplugin = $enrol;
}
$PAGE->set_title($strplugin);
echo $OUTPUT->header();
if (!$confirm) {
$uurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1));
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'enrol', $strplugin), $uurl, $return);
echo $OUTPUT->footer();
exit;
// This may take a long time.
set_time_limit(0);
} else { // Delete everything!!
uninstall_plugin('enrol', $enrol);
// Disable plugin to prevent concurrent cron execution.
unset($enabled[$enrol]);
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
echo $OUTPUT->heading(get_string('uninstallmigrating', 'enrol', 'enrol_'.$enrol));
require_once("$CFG->dirroot/enrol/manual/locallib.php");
enrol_manual_migrate_plugin_enrolments($enrol);
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
if (!$return = core_plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol, 'manage')) {
$return = new moodle_url('/admin/plugins.php');
$a->plugin = $strplugin;
$a->directory = "$CFG->dirroot/enrol/$enrol";
echo $OUTPUT->notification(get_string('uninstalldeletefiles', 'enrol', $a), 'notifysuccess');
echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
exit;
}
echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
exit;
}
+124 -96
View File
@@ -1,109 +1,137 @@
<?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 the admin frontend to execute all the checks available
* in the environment.xml file. It includes database, php and
* php_extensions. Also, it's possible to update the xml file
* from moodle.org be able to check more and more versions.
*
* @package core
* @subpackage admin
* @copyright 2006 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
// This file is the admin frontend to execute all the checks available
// in the environment.xml file. It includes database, php and
// php_extensions. Also, it's possible to update the xml file
// from moodle.org be able to check more and more versions.
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
admin_externalpage_setup('environment');
/// Parameters
$action = optional_param('action', '', PARAM_ACTION);
$version = optional_param('version', '', PARAM_FILE); //
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
/// Get some strings
$stradmin = get_string('administration');
$stradminhelpenvironment = get_string("adminhelpenvironment");
$strenvironment = get_string('environment', 'admin');
$strerror = get_string('error');
$strmoodleversion = get_string('moodleversion');
$strupdate = get_string('updatecomponent', 'admin');
$strupwards = get_string('upwards', 'admin');
$strmisc = get_string('miscellaneous');
// Parameters
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$version = optional_param('version', '', PARAM_FILE); //
/// Print the header stuff
echo $OUTPUT->header();
$extraurlparams = array();
if ($version) {
$extraurlparams['version'] = $version;
}
admin_externalpage_setup('environment', '', $extraurlparams);
/// Print the component download link
echo '<div class="reportlink"><a href="environment.php?action=updatecomponent&amp;sesskey='.sesskey().'">'.$strupdate.'</a></div>';
// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest = $CFG->dataroot . '/';
print_error($cd->get_error(), 'error', $PAGE->url, $a);
die();
echo $OUTPUT->heading($strenvironment);
} else {
print_error($cd->get_error(), 'error', $PAGE->url);
die();
}
case COMPONENT_UPTODATE:
redirect($PAGE->url, get_string($cd->get_error(), 'error'));
die;
case COMPONENT_INSTALLED:
redirect($PAGE->url, get_string('componentinstalled', 'admin'));
die;
}
}
}
// Get current Moodle version
$current_version = $CFG->release;
// Calculate list of versions
$versions = array();
if ($contents = load_environment_xml()) {
if ($env_versions = get_list_of_environment_versions($contents)) {
// Set the current version at the beginning
$env_version = normalize_version($current_version); //We need this later (for the upwards)
$versions[$env_version] = $current_version;
// If no version has been previously selected, default to $current_version
if (empty($version)) {
$version = $env_version;
}
//Iterate over each version, adding bigger than current
foreach ($env_versions as $env_version) {
if (version_compare(normalize_version($current_version), $env_version, '<')) {
$versions[$env_version] = $env_version;
/// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
/// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest= $CFG->dataroot.'/';
echo $OUTPUT->box(get_string($cd->get_error(), 'error', $a), 'errorbox');
} else {
echo $OUTPUT->box(get_string($cd->get_error(), 'error'), 'errorbox');
}
break;
case COMPONENT_UPTODATE:
echo $OUTPUT->box(get_string($cd->get_error(), 'error'));
break;
case COMPONENT_INSTALLED:
echo $OUTPUT->box(get_string('componentinstalled', 'admin'));
break;
}
}
// Add 'upwards' to the last element
$versions[$env_version] = $env_version.' '.get_string('upwards', 'admin');
} else {
$versions = array('error' => get_string('error'));
}
}
// Get the results of the environment check.
list($envstatus, $environment_results) = check_moodle_environment($version);
/// Start of main box
echo $OUTPUT->box_start();
echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
/// Get current Moodle version
$current_version = $CFG->release;
/// Calculate list of versions
$versions = array();
if ($contents = load_environment_xml()) {
if ($env_versions = get_list_of_environment_versions($contents)) {
/// Set the current version at the beginning
$env_version = normalize_version($current_version); //We need this later (for the upwards)
$versions[$env_version] = $current_version;
/// If no version has been previously selected, default to $current_version
if (empty($version)) {
$version = $env_version;
}
///Iterate over each version, adding bigger than current
foreach ($env_versions as $env_version) {
if (version_compare(normalize_version($current_version), $env_version, '<')) {
$versions[$env_version] = $env_version;
}
}
/// Add 'upwards' to the last element
$versions[$env_version] = $env_version.' '.$strupwards;
} else {
$versions = array('error' => $strerror);
}
}
/// Print form and popup menu
echo '<div style="text-align:center"> ';
$select = new single_select(new moodle_url('/admin/environment.php'), 'version', $versions, $version, null);
$select->label = $strmoodleversion;
echo $OUTPUT->render($select);
echo '</div>';
/// End of main box
echo $OUTPUT->box_end();
/// Gather and show results
$status = check_moodle_environment($version, $environment_results);
/// Print footer
echo $OUTPUT->footer();
// Display the page.
$output = $PAGE->get_renderer('core', 'admin');
echo $output->environment_check_page($versions, $version, $envstatus, $environment_results);
+36 -502
View File
@@ -214,7 +214,11 @@
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25" />
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
@@ -227,7 +231,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -237,7 +241,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -277,12 +281,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -331,7 +335,11 @@
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25" />
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
@@ -344,7 +352,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -354,7 +362,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -394,12 +402,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -441,7 +449,11 @@
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25" />
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
@@ -454,7 +466,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -464,7 +476,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -504,12 +516,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -551,7 +563,11 @@
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
@@ -561,15 +577,10 @@
</DATABASE>
<PHP version="5.3.2" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -579,7 +590,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -619,12 +630,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -640,7 +651,6 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
@@ -660,480 +670,4 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.4" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.2" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="optional">
<FEEDBACK>
<ON_CHECK message="gdrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.5" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.6" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.3.5" />
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="optional">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="64M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.7" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+204 -172
View File
@@ -1,232 +1,260 @@
<?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/>.
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
/**
* Filter management page.
* Processes actions from the admin_setting_managefilters object (defined in
* adminlib.php).
*
* @package core
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package administration
*//** */
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
$action = optional_param('action', '', PARAM_ALPHA);
$filterpath = optional_param('filterpath', '', PARAM_PLUGIN);
$action = optional_param('action', '', PARAM_ACTION);
$filterpath = optional_param('filterpath', '', PARAM_PATH);
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/site:config', $systemcontext);
require_login();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $systemcontext);
admin_externalpage_setup('managefilters');
$returnurl = "$CFG->wwwroot/$CFG->admin/filters.php";
admin_externalpage_setup('managefilters');
// Clean up bogus filter states first.
$plugininfos = core_plugin_manager::instance()->get_plugins_of_type('filter');
$filters = array();
$states = filter_get_global_states();
foreach ($states as $state) {
if (!isset($plugininfos[$state->filter]) and !get_config('filter_'.$state->filter, 'version')) {
// Purge messy leftovers after incorrectly uninstalled plugins and unfinished installs.
$DB->delete_records('filter_active', array('filter' => $state->filter));
$DB->delete_records('filter_config', array('filter' => $state->filter));
error_log('Deleted bogus "filter_'.$state->filter.'" states and config data.');
} else {
$filters[$state->filter] = $state;
$filters = filter_get_global_states();
// In case any new filters have been installed, but not put in the table yet.
$fitlernames = filter_get_all_installed();
$newfilters = $fitlernames;
foreach ($filters as $filter => $notused) {
unset($newfilters[$filter]);
}
}
// Add properly installed and upgraded filters to the global states table.
foreach ($plugininfos as $filter => $info) {
if (isset($filters[$filter])) {
continue;
}
/** @var \core\plugininfo\base $info */
if ($info->is_installed_and_upgraded()) {
filter_set_global_state($filter, TEXTFILTER_DISABLED);
$states = filter_get_global_states();
foreach ($states as $state) {
if ($state->filter === $filter) {
$filters[$filter] = $state;
break;
}
/// Process actions ============================================================
if ($action) {
if (!isset($filters[$filterpath]) && !isset($newfilters[$filterpath])) {
throw new moodle_exception('filternotinstalled', 'error', $returnurl, $filterpath);
}
if (!confirm_sesskey()) {
redirect($returnurl);
}
}
}
if ($action) {
require_sesskey();
}
// Process actions.
switch ($action) {
switch ($action) {
case 'setstate':
if (isset($filters[$filterpath]) and $newstate = optional_param('newstate', '', PARAM_INT)) {
if ($newstate = optional_param('newstate', '', PARAM_INTEGER)) {
filter_set_global_state($filterpath, $newstate);
if ($newstate == TEXTFILTER_DISABLED) {
filter_set_applies_to_strings($filterpath, false);
}
unset($newfilters[$filterpath]);
}
break;
case 'setapplyto':
if (isset($filters[$filterpath])) {
$applytostrings = optional_param('stringstoo', false, PARAM_BOOL);
filter_set_applies_to_strings($filterpath, $applytostrings);
}
$applytostrings = optional_param('stringstoo', false, PARAM_BOOL);
filter_set_applies_to_strings($filterpath, $applytostrings);
break;
case 'down':
if (isset($filters[$filterpath])) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, 1);
$oldpos = $filters[$filterpath]->sortorder;
if ($oldpos <= count($filters)) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos + 1);
}
}
break;
case 'up':
if (isset($filters[$filterpath])) {
$oldpos = $filters[$filterpath]->sortorder;
filter_set_global_state($filterpath, $filters[$filterpath]->active, -1);
if ($oldpos >= 1) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos - 1);
}
}
break;
}
// Reset caches and return.
if ($action) {
reset_text_filters_cache();
core_plugin_manager::reset_caches();
redirect(new moodle_url('/admin/filters.php'));
}
case 'delete':
if (!empty($filternames[$filterpath])) {
$filtername = $filternames[$filterpath];
} else {
$filtername = $filterpath;
}
// Print the page heading.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('filtersettings', 'admin'));
if (substr($filterpath, 0, 4) == 'mod/') {
$mod = basename($filterpath);
$a = new stdClass;
$a->filter = $filtername;
$a->module = get_string('modulename', $mod);
print_error('cannotdeletemodfilter', 'admin', $returnurl, $a);
}
$states = filter_get_global_states();
$stringfilters = filter_get_string_filters();
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
$title = get_string('deletefilterareyousure', 'admin', $filtername);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('uninstallplugin', 'core_admin'));
$table->colclasses = array ('leftalign', 'leftalign', 'centeralign', 'leftalign', 'leftalign', 'leftalign');
$table->attributes['class'] = 'admintable generaltable';
$table->id = 'filterssetting';
$table->data = array();
$linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
$formcancel = new single_button(new moodle_url($returnurl), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
}
$lastactive = null;
foreach ($states as $state) {
if ($state->active != TEXTFILTER_DISABLED) {
$lastactive = $state->filter;
// Do the deletion.
$title = get_string('deletingfilter', 'admin', $filtername);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
// Delete all data for this plugin.
filter_delete_all_for_filter($filterpath);
$a = new stdClass;
$a->filter = $filtername;
$a->directory = $filterpath;
echo $OUTPUT->box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice');
echo $OUTPUT->continue_button($returnurl);
echo $OUTPUT->footer();
exit;
}
}
// Iterate through filters adding to display table.
$firstrow = true;
foreach ($states as $state) {
$filter = $state->filter;
if (!isset($plugininfos[$filter])) {
continue;
// Add any missing filters to the DB table.
foreach ($newfilters as $filter => $notused) {
filter_set_global_state($filter, TEXTFILTER_DISABLED);
}
$plugininfo = $plugininfos[$filter];
$applytostrings = isset($stringfilters[$filter]) && $state->active != TEXTFILTER_DISABLED;
$row = get_table_row($plugininfo, $state, $firstrow, $filter == $lastactive, $applytostrings);
$table->data[] = $row;
if ($state->active == TEXTFILTER_DISABLED) {
// Reset caches and return
if ($action) {
reset_text_filters_cache();
redirect($returnurl);
}
/// End of process actions =====================================================
/// Print the page heading.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('filtersettings', 'admin'));
$activechoices = array(
TEXTFILTER_DISABLED => get_string('disabled', 'filters'),
TEXTFILTER_OFF => get_string('offbutavailable', 'filters'),
TEXTFILTER_ON => get_string('on', 'filters'),
);
$applytochoices = array(
0 => get_string('content', 'filters'),
1 => get_string('contentandheadings', 'filters'),
);
$filters = filter_get_global_states();
// In case any new filters have been installed, but not put in the table yet.
$filternames = filter_get_all_installed();
$newfilters = $filternames;
foreach ($filters as $filter => $notused) {
unset($newfilters[$filter]);
}
$stringfilters = filter_get_string_filters();
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
$table->align = array('left', 'left', 'center', 'left', 'left');
$table->width = '100%';
$table->data = array();
$lastactive = null;
foreach ($filters as $filter => $filterinfo) {
if ($filterinfo->active != TEXTFILTER_DISABLED) {
$lastactive = $filter;
}
}
// iterate through filters adding to display table
$firstrow = true;
foreach ($filters as $filter => $filterinfo) {
$applytostrings = isset($stringfilters[$filter]) && $filterinfo->active != TEXTFILTER_DISABLED;
$row = get_table_row($filterinfo, $firstrow, $filter == $lastactive, $applytostrings);
$table->data[] = $row;
if ($filterinfo->active == TEXTFILTER_DISABLED) {
$table->rowclasses[] = 'dimmed_text';
} else {
$table->rowclasses[] = '';
}
$firstrow = false;
}
foreach ($newfilters as $filter => $filtername) {
$filterinfo = new stdClass;
$filterinfo->filter = $filter;
$filterinfo->active = TEXTFILTER_DISABLED;
$row = get_table_row($filterinfo, false, false, false);
$table->data[] = $row;
$table->rowclasses[] = 'dimmed_text';
} else {
$table->rowclasses[] = '';
}
$firstrow = false;
}
echo html_writer::table($table);
echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
echo $OUTPUT->footer();
die;
echo html_writer::table($table);
echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
echo $OUTPUT->footer();
/// Display helper functions ===================================================
/**
* Return action URL.
*
* @param string $filterpath
* @param string $action
* @return moodle_url
*/
function filters_action_url($filterpath, $action) {
if ($action === 'delete') {
return core_plugin_manager::instance()->get_uninstall_url('filter_'.$filterpath, 'manage');
}
return new moodle_url('/admin/filters.php', array('sesskey'=>sesskey(), 'filterpath'=>$filterpath, 'action'=>$action));
}
/**
* Construct table record.
*
* @param \core\plugininfo\filter $plugininfo
* @param stdClass $state
* @param bool $isfirstrow
* @param bool $islastactive
* @param bool $applytostrings
* @return array data
*/
function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow, $islastactive, $applytostrings) {
global $OUTPUT;
function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) {
global $CFG, $OUTPUT, $activechoices, $applytochoices, $filternames; //TODO: this is sloppy coding style!!
$row = array();
$filter = $state->filter;
$active = $plugininfo->is_installed_and_upgraded();
$filter = $filterinfo->filter;
static $activechoices;
static $applytochoices;
if (!isset($activechoices)) {
$activechoices = array(
TEXTFILTER_DISABLED => get_string('disabled', 'core_filters'),
TEXTFILTER_OFF => get_string('offbutavailable', 'core_filters'),
TEXTFILTER_ON => get_string('on', 'core_filters'),
);
$applytochoices = array(
0 => get_string('content', 'core_filters'),
1 => get_string('contentandheadings', 'core_filters'),
);
// Filter name
if (!empty($filternames[$filter])) {
$row[] = $filternames[$filter];
} else {
$row[] = '<span class="error">' . get_string('filemissing', '', $filter) . '</span>';
}
// Filter name.
$displayname = $plugininfo->displayname;
if (!$plugininfo->rootdir) {
$displayname = '<span class="error">' . $displayname . ' - ' . get_string('status_missing', 'core_plugin') . '</span>';
} else if (!$active) {
$displayname = '<span class="error">' . $displayname . ' - ' . get_string('error') . '</span>';
}
$row[] = $displayname;
// Disable/off/on.
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $state->active, null, 'active' . $filter);
$select->set_label(get_string('isactive', 'filters'), array('class' => 'accesshide'));
// Disable/off/on
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
$row[] = $OUTPUT->render($select);
// Re-order.
// Re-order
$updown = '';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
if ($state->active != TEXTFILTER_DISABLED) {
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
if ($filterinfo->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
} else {
$updown .= $spacer;
}
@@ -234,20 +262,24 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
$row[] = $updown;
// Apply to strings.
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . $filter);
$select->set_label(get_string('applyto', 'filters'), array('class' => 'accesshide'));
$select->disabled = ($state->active == TEXTFILTER_DISABLED);
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
$row[] = $OUTPUT->render($select);
// Settings link, if required.
if ($active and filter_has_global_settings($filter)) {
$row[] = html_writer::link(new moodle_url('/admin/settings.php', array('section'=>'filtersetting'.$filter)), get_string('settings'));
// Settings link, if required
if (filter_has_global_settings($filter)) {
$row[] = '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=filtersetting' .
str_replace('/', '',$filter) . '">' . get_string('settings') . '</a>';
} else {
$row[] = '';
}
// Uninstall.
$row[] = html_writer::link(filters_action_url($filter, 'delete'), get_string('uninstallplugin', 'core_admin'));
// Delete
if (substr($filter, 0, 4) != 'mod/') {
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
} else {
$row[] = '';
}
return $row;
}
+1336
View File
File diff suppressed because it is too large Load Diff
+4 -9
View File
@@ -39,18 +39,13 @@ while(!feof($fd)) {
$action = clam_handle_infected_file($file,$log->userid,true);
clam_replace_infected_file($file);
$ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
$ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)";
$sql = "SELECT c.id, c.fullname $ctxselect FROM {course} c $ctxjoin WHERE c.id = :courseid";
$course = $DB->get_record_sql($sql, array('courseid' => $log->course, 'contextlevel' => CONTEXT_COURSE));
context_helper::preload_from_record($course);
$user = $DB->get_record("user", array("id"=>$log->userid));
$course = $DB->get_record("course", array("id"=>$log->course));
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$a->date = userdate($log->time);
$a->action = $action;
$a->course = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
$a->course = $course->fullname;
$a->user = fullname($user);
notify_user($user,$subject,$a);
@@ -87,7 +82,7 @@ function notify_admins($user,$subject,$a) {
foreach ($admins as $admin) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = get_admin();
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
@@ -108,7 +103,7 @@ function notify_admins_unknown($file,$a) {
foreach ($admins as $admin) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = get_admin();
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
+790
View File
@@ -0,0 +1,790 @@
<?php
ob_start(); //for whitespace test
require_once('../config.php');
// extra whitespace test - intentionally breaks cookieless mode
$extraws = '';
while (ob_get_level()) {
$extraws .= ob_get_contents();
ob_end_clean();
}
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('healthcenter');
define('SEVERITY_NOTICE', 'notice');
define('SEVERITY_ANNOYANCE', 'annoyance');
define('SEVERITY_SIGNIFICANT', 'significant');
define('SEVERITY_CRITICAL', 'critical');
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$site = get_site();
echo $OUTPUT->header();
echo <<<STYLES
<style type="text/css">
div#healthnoproblemsfound {
width: 60%;
margin: auto;
padding: 1em;
border: 1px black solid;
-moz-border-radius: 6px;
}
dl.healthissues {
width: 60%;
margin: auto;
}
dl.critical dt, dl.critical dd {
background-color: #a71501;
}
dl.significant dt, dl.significant dd {
background-color: #d36707;
}
dl.annoyance dt, dl.annoyance dd {
background-color: #dba707;
}
dl.notice dt, dl.notice dd {
background-color: #e5db36;
}
dt.solution, dd.solution, div#healthnoproblemsfound {
background-color: #5BB83E !important;
}
dl.healthissues dt, dl.healthissues dd {
margin: 0px;
padding: 1em;
border: 1px black solid;
}
dl.healthissues dt {
font-weight: bold;
border-bottom: none;
padding-bottom: 0.5em;
}
dl.healthissues dd {
border-top: none;
padding-top: 0.5em;
margin-bottom: 10px;
}
dl.healthissues dd form {
margin-top: 0.5em;
text-align: right;
}
form#healthformreturn {
text-align: center;
margin: 2em;
}
dd.solution p {
padding: 0px;
margin: 1em 0px;
}
dd.solution li {
margin-top: 1em;
}
</style>
STYLES;
if(strpos($solution, 'problem_') === 0 && class_exists($solution)) {
health_print_solution($solution);
}
else {
health_find_problems();
}
echo $OUTPUT->footer();
function health_find_problems() {
global $OUTPUT;
echo $OUTPUT->heading(get_string('healthcenter'));
$issues = array(
SEVERITY_CRITICAL => array(),
SEVERITY_SIGNIFICANT => array(),
SEVERITY_ANNOYANCE => array(),
SEVERITY_NOTICE => array(),
);
$problems = 0;
for($i = 1; $i < 1000000; ++$i) {
$classname = sprintf('problem_%06d', $i);
if(!class_exists($classname)) {
break;
}
$problem = new $classname;
if($problem->exists()) {
$severity = $problem->severity();
$issues[$severity][$classname] = array(
'severity' => $severity,
'description' => $problem->description(),
'title' => $problem->title()
);
++$problems;
}
unset($problem);
}
if($problems == 0) {
echo '<div id="healthnoproblemsfound">';
echo get_string('healthnoproblemsfound');
echo '</div>';
}
else {
echo $OUTPUT->heading(get_string('healthproblemsdetected'));
$severities = array(SEVERITY_CRITICAL, SEVERITY_SIGNIFICANT, SEVERITY_ANNOYANCE, SEVERITY_NOTICE);
foreach($severities as $severity) {
if(!empty($issues[$severity])) {
echo '<dl class="healthissues '.$severity.'">';
foreach($issues[$severity] as $classname => $data) {
echo '<dt id="'.$classname.'">'.$data['title'].'</dt>';
echo '<dd>'.$data['description'];
echo '<form action="health.php#solution" method="get">';
echo '<input type="hidden" name="solution" value="'.$classname.'" /><input type="submit" value="'.get_string('viewsolution').'" />';
echo '</form></dd>';
}
echo '</dl>';
}
}
}
}
function health_print_solution($classname) {
global $OUTPUT;
$problem = new $classname;
$data = array(
'title' => $problem->title(),
'severity' => $problem->severity(),
'description' => $problem->description(),
'solution' => $problem->solution()
);
echo $OUTPUT->heading(get_string('healthcenter'));
echo $OUTPUT->heading(get_string('healthproblemsolution'));
echo '<dl class="healthissues '.$data['severity'].'">';
echo '<dt>'.$data['title'].'</dt>';
echo '<dd>'.$data['description'].'</dd>';
echo '<dt id="solution" class="solution">'.get_string('healthsolution').'</dt>';
echo '<dd class="solution">'.$data['solution'].'</dd></dl>';
echo '<form id="healthformreturn" action="health.php#'.$classname.'" method="get">';
echo '<input type="submit" value="'.get_string('healthreturntomain').'" />';
echo '</form>';
}
class problem_base {
function exists() {
return false;
}
function title() {
return '???';
}
function severity() {
return SEVERITY_NOTICE;
}
function description() {
return '';
}
function solution() {
return '';
}
}
class problem_000002 extends problem_base {
function title() {
return 'Extra characters at the end of config.php or other library function';
}
function exists() {
global $extraws;
if($extraws === '') {
return false;
}
return true;
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'Your Moodle configuration file config.php or another library file, contains some characters after the closing PHP tag (?>). This causes Moodle to exhibit several kinds of problems (such as broken downloaded files) and must be fixed.';
}
function solution() {
global $CFG;
return 'You need to edit <strong>'.$CFG->dirroot.'/config.php</strong> and remove all characters (including spaces and returns) after the ending ?> tag. These two characters should be the very last in that file. The extra trailing whitespace may be also present in other PHP files that are included from lib/setup.php.';
}
}
class problem_000003 extends problem_base {
function title() {
return '$CFG->dataroot does not exist or does not have write permissions';
}
function exists() {
global $CFG;
if(!is_dir($CFG->dataroot) || !is_writable($CFG->dataroot)) {
return true;
}
return false;
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
global $CFG;
return 'Your <strong>config.php</strong> says that your "data root" directory is <strong>'.$CFG->dataroot.'</strong>. However, this directory either does not exist or cannot be written to by Moodle. This means that a variety of problems will be present, such as users not being able to log in and not being able to upload any files. It is imperative that you address this problem for Moodle to work correctly.';
}
function solution() {
global $CFG;
return 'First of all, make sure that the directory <strong>'.$CFG->dataroot.'</strong> exists. If the directory does exist, then you must make sure that Moodle is able to write to it. Contact your web server administrator and request that he gives write permissions for that directory to the user that the web server process is running as.';
}
}
class problem_000004 extends problem_base {
function title() {
return 'cron.php is not set up to run automatically';
}
function exists() {
global $DB;
$lastcron = $DB->get_field_sql('SELECT max(lastcron) FROM {modules}');
return (time() - $lastcron > 3600 * 24);
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'The cron.php mainenance script has not been run in the past 24 hours. This probably means that your server is not configured to automatically run this script in regular time intervals. If this is the case, then Moodle will mostly work as it should but some operations (notably sending email to users) will not be carried out at all.';
}
function solution() {
global $CFG;
return 'For detailed instructions on how to enable cron, see <a href="'.$CFG->wwwroot.'/doc/?file=install.html#cron">this section</a> of the installation manual.';
}
}
class problem_000005 extends problem_base {
function title() {
return 'PHP: session.auto_start is enabled';
}
function exists() {
return ini_get_bool('session.auto_start');
}
function severity() {
return SEVERITY_CRITICAL;
}
function description() {
return 'Your PHP configuration includes an enabled setting, session.auto_start, that <strong>must be disabled</strong> in order for Moodle to work correctly. Notable symptoms arising from this misconfiguration include fatal errors and/or blank pages when trying to log in.';
}
function solution() {
global $CFG;
return '<p>There are two ways you can solve this problem:</p><ol><li>If you have access to your main <strong>php.ini</strong> file, then find the line that looks like this: <pre>session.auto_start = 1</pre> and change it to <pre>session.auto_start = 0</pre> and then restart your web server. Be warned that this, as any other PHP setting change, might affect other web applications running on the server.</li><li>Finally, you may be able to change this setting just for your site by creating or editing the file <strong>'.$CFG->dirroot.'/.htaccess</strong> to contain this line: <pre>php_value session.auto_start "0"</pre></li></ol>';
}
}
class problem_000006 extends problem_base {
function title() {
return 'PHP: magic_quotes_runtime is enabled';
}
function exists() {
return (ini_get_bool('magic_quotes_runtime'));
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'Your PHP configuration includes an enabled setting, magic_quotes_runtime, that <strong>must be disabled</strong> in order for Moodle to work correctly. Notable symptoms arising from this misconfiguration include strange display errors whenever a text field that includes single or double quotes is processed.';
}
function solution() {
global $CFG;
return '<p>There are two ways you can solve this problem:</p><ol><li>If you have access to your main <strong>php.ini</strong> file, then find the line that looks like this: <pre>magic_quotes_runtime = On</pre> and change it to <pre>magic_quotes_runtime = Off</pre> and then restart your web server. Be warned that this, as any other PHP setting change, might affect other web applications running on the server.</li><li>Finally, you may be able to change this setting just for your site by creating or editing the file <strong>'.$CFG->dirroot.'/.htaccess</strong> to contain this line: <pre>php_value magic_quotes_runtime "Off"</pre></li></ol>';
}
}
class problem_000007 extends problem_base {
function title() {
return 'PHP: file_uploads is disabled';
}
function exists() {
return !ini_get_bool('file_uploads');
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'Your PHP configuration includes a disabled setting, file_uploads, that <strong>must be enabled</strong> to let Moodle offer its full functionality. Until this setting is enabled, it will not be possible to upload any files into Moodle. This includes, for example, course content and user pictures.';
}
function solution() {
global $CFG;
return '<p>There are two ways you can solve this problem:</p><ol><li>If you have access to your main <strong>php.ini</strong> file, then find the line that looks like this: <pre>file_uploads = Off</pre> and change it to <pre>file_uploads = On</pre> and then restart your web server. Be warned that this, as any other PHP setting change, might affect other web applications running on the server.</li><li>Finally, you may be able to change this setting just for your site by creating or editing the file <strong>'.$CFG->dirroot.'/.htaccess</strong> to contain this line: <pre>php_value file_uploads "On"</pre></li></ol>';
}
}
class problem_000008 extends problem_base {
function title() {
return 'PHP: memory_limit cannot be controlled by Moodle';
}
function exists() {
global $CFG;
$oldmemlimit = @ini_get('memory_limit');
if (empty($oldmemlimit)) {
// PHP not compiled with memory limits, this means that it's
// probably limited to 8M or in case of Windows not at all.
// We can ignore it for now - there is not much to test anyway
// TODO: add manual test that fills memory??
return false;
}
$oldmemlimit = get_real_size($oldmemlimit);
//now lets change the memory limit to something higher
$newmemlimit = ($oldmemlimit + 1024*1024*5);
raise_memory_limit($newmemlimit);
$testmemlimit = get_real_size(@ini_get('memory_limit'));
//verify the change had any effect at all
if ($oldmemlimit == $testmemlimit) {
//memory limit can not be changed - is it big enough then?
if ($oldmemlimit < get_real_size('128M')) {
return true;
} else {
return false;
}
}
reduce_memory_limit($oldmemlimit);
return false;
}
function severity() {
return SEVERITY_NOTICE;
}
function description() {
return 'The settings for PHP on your server do not allow a script to request more memory during its execution. '.
'This means that there is a hard limit of '.@ini_get('memory_limit').' for each script. '.
'It is possible that certain operations within Moodle will require more than this amount in order '.
'to complete successfully, especially if there are lots of data to be processed.';
}
function solution() {
return 'It is recommended that you contact your web server administrator to address this issue.';
}
}
class problem_000009 extends problem_base {
function title() {
return 'SQL: using account without password';
}
function exists() {
global $CFG;
return empty($CFG->dbpass);
}
function severity() {
return SEVERITY_CRITICAL;
}
function description() {
global $CFG;
return 'The user account your are connecting to the database server with is set up without a password. This is a very big security risk and is only somewhat lessened if your database is configured to not accept connections from any hosts other than the server Moodle is running on. Unless you use a strong password to connect to the database, you risk unauthorized access to and manipulation of your data.'.($CFG->dbuser != 'root'?'':' <strong>This is especially alarming because such access to the database would be as the superuser (root)!</strong>');
}
function solution() {
global $CFG;
return 'You should change the password of the user <strong>'.$CFG->dbuser.'</strong> both in your database and in your Moodle <strong>config.php</strong> immediately!'.($CFG->dbuser != 'root'?'':' It would also be a good idea to change the user account from root to something else, because this would lessen the impact in the event that your database is compromised anyway.');
}
}
/* // not implemented in 2.0 yet
class problem_000010 extends problem_base {
function title() {
return 'Uploaded files: slasharguments disabled or not working';
}
function exists() {
if (!$this->is_enabled()) {
return true;
}
if ($this->status() < 1) {
return true;
}
return false;
}
function severity() {
if ($this->is_enabled() and $this->status() == 0) {
return SEVERITY_SIGNIFICANT;
} else {
return SEVERITY_ANNOYANCE;
}
}
function description() {
global $CFG;
$desc = 'Slasharguments are needed for relative linking in uploaded resources:<ul>';
if (!$this->is_enabled()) {
$desc .= '<li>slasharguments are <strong>disabled</strong> in Moodle configuration</li>';
} else {
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
}
if ($this->status() == -1) {
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a> manually</li>';
} else if ($this->status() == 0) {
$desc .= '<li>slashargument test <strong>failed</strong>, please check server configuration</li>';
} else {
$desc .= '<li>slashargument test passed</li>';
}
$desc .= '</ul>';
return $desc;
}
function solution() {
global $CFG;
$enabled = $this->is_enabled();
$status = $this->status();
$solution = '';
if ($enabled and ($status == 0)) {
$solution .= 'Slasharguments are enabled, but the test failed. Please disable slasharguments in Moodle configuration or fix the server configuration.<hr />';
} else if ((!$enabled) and ($status == 0)) {
$solution .= 'Slasharguments are disabled and the test failed. You may try to fix the server configuration.<hr />';
} else if ($enabled and ($status == -1)) {
$solution .= 'Slasharguments are enabled, <a href="'.$CFG->wwwroot.'/file.php/testslasharguments">automatic testing</a> not possible.<hr />';
} else if ((!$enabled) and ($status == -1)) {
$solution .= 'Slasharguments are disabled, <a href="'.$CFG->wwwroot.'/file.php/testslasharguments">automatic testing</a> not possible.<hr />';
} else if ((!$enabled) and ($status > 0)) {
$solution .= 'Slasharguments are disabled though the iternal test is OK. You should enable slasharguments in Moodle configuration.';
} else if ($enabled and ($status > 0)) {
$solution .= 'Congratulations - everything seems OK now :-D';
}
if ($status < 1) {
$solution .= '<p>IIS:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li><li>do NOT enable AllowPathInfoForScriptMappings !!!</li><li>slasharguments may not work when using ISAPI and PHP 4.3.10 and older</li></ul></p>';
$solution .= '<p>Apache 1:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>Apache 2:<ul><li>you must add <code>AcceptPathInfo on</code> to php.ini or .htaccess</li><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
}
return $solution;
}
function is_enabled() {
global $CFG;
return !empty($CFG->slasharguments);
}
function status() {
global $CFG;
$handle = @fopen($CFG->wwwroot.'/file.php?file=/testslasharguments', "r");
$contents = @trim(fread($handle, 10));
@fclose($handle);
if ($contents != 'test -1') {
return -1;
}
$handle = @fopen($CFG->wwwroot.'/file.php/testslasharguments', "r");
$contents = trim(@fread($handle, 10));
@fclose($handle);
switch ($contents) {
case 'test 1': return 1;
case 'test 2': return 2;
default: return 0;
}
}
}*/
class problem_000012 extends problem_base {
function title() {
return 'Random questions data consistency';
}
function exists() {
global $DB;
return $DB->record_exists_select('question', "qtype = 'random' AND parent <> id", array());
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>For random questions, question.parent should equal question.id. ' .
'There are some questions in your database for which this is not true. ' .
'One way that this could have happened is for random questions restored from backup before ' .
'<a href="http://tracker.moodle.org/browse/MDL-5482">MDL-5482</a> was fixed.</p>';
}
function solution() {
global $CFG;
return '<p>Upgrade to Moodle 1.9.1 or later, or manually execute the SQL</p>' .
'<pre>UPDATE ' . $CFG->prefix . 'question SET parent = id WHERE qtype = \'random\' and parent &lt;> id;</pre>';
}
}
class problem_000013 extends problem_base {
function title() {
return 'Multi-answer questions data consistency';
}
function exists() {
global $DB;
$positionexpr = $DB->sql_position($DB->sql_concat("','", "q.id", "','"),
$DB->sql_concat("','", "qma.sequence", "','"));
return $DB->record_exists_sql("
SELECT * FROM {question} q
JOIN {question_multianswer} qma ON $positionexpr > 0
WHERE qma.question <> q.parent") ||
$DB->record_exists_sql("
SELECT * FROM {question} q
JOIN {question} parent_q ON parent_q.id = q.parent
WHERE q.category <> parent_q.category");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>For each sub-question whose id is listed in ' .
'question_multianswer.sequence, its question.parent field should equal ' .
'question_multianswer.question; and each sub-question should be in the same ' .
'category as its parent. There are questions in your database for ' .
'which this is not the case. One way that this could have happened is ' .
'for multi-answer questions restored from backup before ' .
'<a href="http://tracker.moodle.org/browse/MDL-14750">MDL-14750</a> was fixed.</p>';
}
function solution() {
return '<p>Upgrade to Moodle 1.9.1 or later, or manually execute the ' .
'code in question_multianswer_fix_subquestion_parents_and_categories in ' .
'<a href="http://cvs.moodle.org/moodle/question/type/multianswer/db/upgrade.php?revision=1.1.10.2&amp;view=markup">/question/type/multianswer/db/upgrade.php' .
'from the 1.9 stable branch</a>.</p>';
}
}
class problem_000014 extends problem_base {
function title() {
return 'Only multianswer and random questions should be the parent of another question';
}
function exists() {
global $DB;
return $DB->record_exists_sql("
SELECT * FROM {question} q
JOIN {question} parent_q ON parent_q.id = q.parent
WHERE parent_q.qtype NOT IN ('random', 'multianswer')");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>You have questions that violate this in your databse. ' .
'You will need to investigate to determine how this happened.</p>';
}
function solution() {
return '<p>It is impossible to give a solution without knowing more about ' .
' how the problem was caused. You may be able to get help from the ' .
'<a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a>.</p>';
}
}
class problem_000015 extends problem_base {
function title() {
return 'Question categories should belong to a valid context';
}
function exists() {
global $DB;
return $DB->record_exists_sql("
SELECT qc.*, (SELECT COUNT(1) FROM {question} q WHERE q.category = qc.id) AS numquestions
FROM {question_categories} qc
LEFT JOIN {context} con ON qc.contextid = con.id
WHERE con.id IS NULL");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
global $DB;
$problemcategories = $DB->get_records_sql("
SELECT qc.id, qc.name, qc.contextid, (SELECT COUNT(1) FROM {question} q WHERE q.category = qc.id) AS numquestions
FROM {question_categories} qc
LEFT JOIN {context} con ON qc.contextid = con.id
WHERE con.id IS NULL
ORDER BY numquestions DESC, qc.name");
$table = '<table><thead><tr><th>Cat id</th><th>Category name</th>' .
"<th>Context id</th><th>Num Questions</th></tr></thead><tbody>\n";
foreach ($problemcategories as $cat) {
$table .= "<tr><td>$cat->id</td><td>" . s($cat->name) . "</td><td>" .
$cat->contextid ."</td><td>$cat->numquestions</td></tr>\n";
}
$table .= '</tbody></table>';
return '<p>All question categories are linked to a context id, and, ' .
'the context they are linked to must exist. The following categories ' .
'belong to a non-existant category:</p>' . $table . '<p>Any of these ' .
'categories that contain no questions can just be deleted form the database. ' .
'Other categories will require more thought.</p>';
}
function solution() {
global $CFG;
return '<p>You can delete the empty categories by executing the following SQL:</p><pre>
DELETE FROM ' . $CFG->prefix . 'question_categories
WHERE
NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'question q WHERE q.category = ' . $CFG->prefix . 'question_categories.id)
AND NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'context con WHERE contextid = con.id)
</pre><p>Any remaining categories that contain questions will require more thought. ' .
'People in the <a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a> may be able to help.</p>';
}
}
class problem_000016 extends problem_base {
function title() {
return 'Question categories should belong to the same context as their parent';
}
function exists() {
global $DB;
return $DB->record_exists_sql("
SELECT parent_qc.id AS parent, child_qc.id AS child, child_qc.contextid
FROM {question_categories} child_qc
JOIN {question_categories} parent_qc ON child_qc.parent = parent_qc.id
WHERE child_qc.contextid <> parent_qc.contextid");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
global $DB;
$problemcategories = $DB->get_records_sql("
SELECT
parent_qc.id AS parentid, parent_qc.name AS parentname, parent_qc.contextid AS parentcon,
child_qc.id AS childid, child_qc.name AS childname, child_qc.contextid AS childcon
FROM {question_categories} child_qc
JOIN {question_categories} parent_qc ON child_qc.parent = parent_qc.id
WHERE child_qc.contextid <> parent_qc.contextid");
$table = '<table><thead><tr><th colspan="3">Child category</th><th colspan="3">Parent category</th></tr><tr>' .
'<th>Id</th><th>Name</th><th>Context id</th>' .
'<th>Id</th><th>Name</th><th>Context id</th>' .
"</tr></thead><tbody>\n";
foreach ($problemcategories as $cat) {
$table .= "<tr><td>$cat->childid</td><td>" . s($cat->childname) .
"</td><td>$cat->childcon</td><td>$cat->parentid</td><td>" . s($cat->parentname) .
"</td><td>$cat->parentcon</td></tr>\n";
}
$table .= '</tbody></table>';
return '<p>When one question category is the parent of another, then they ' .
'should both belong to the same context. This is not true for the following categories:</p>' .
$table;
}
function solution() {
return '<p>An automated solution is difficult. It depends whether the ' .
'parent or child category is in the wrong pace.' .
'People in the <a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a> may be able to help.</p>';
}
}
class problem_000017 extends problem_base {
function title() {
return 'Question categories tree structure';
}
function find_problems() {
global $DB;
static $answer = null;
if (is_null($answer)) {
$categories = $DB->get_records('question_categories', array(), 'id');
// Look for missing parents.
$missingparent = array();
foreach ($categories as $category) {
if ($category->parent != 0 && !array_key_exists($category->parent, $categories)) {
$missingparent[$category->id] = $category;
}
}
// Look for loops.
$loops = array();
while (!empty($categories)) {
$current = array_pop($categories);
$thisloop = array($current->id => $current);
while (true) {
if (isset($thisloop[$current->parent])) {
// Loop detected
$loops[$current->id] = $thisloop;
break;
} else if (!isset($categories[$current->parent])) {
// Got to the top level, or a category we already know is OK.
break;
} else {
// Continue following the path.
$current = $categories[$current->parent];
$thisloop[$current->id] = $current;
unset($categories[$current->id]);
}
}
}
$answer = array($missingparent, $loops);
}
return $answer;
}
function exists() {
list($missingparent, $loops) = $this->find_problems();
return !empty($missingparent) || !empty($loops);
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
list($missingparent, $loops) = $this->find_problems();
$description = '<p>The question categories should be arranged into tree ' .
' structures by the question_categories.parent field. Sometimes ' .
' this tree structure gets messed up.</p>';
if (!empty($missingparent)) {
$description .= '<p>The following categories are missing their parents:</p><ul>';
foreach ($missingparent as $cat) {
$description .= "<li>Category $cat->id: " . s($cat->name) . "</li>\n";
}
$description .= "</ul>\n";
}
if (!empty($loops)) {
$description .= '<p>The following categories form a loop of parents:</p><ul>';
foreach ($loops as $loop) {
$description .= "<li><ul>\n";
foreach ($loop as $cat) {
$description .= "<li>Category $cat->id: " . s($cat->name) . " has parent $cat->parent</li>\n";
}
$description .= "</ul></li>\n";
}
$description .= "</ul>\n";
}
return $description;
}
function solution() {
global $CFG;
list($missingparent, $loops) = $this->find_problems();
$solution = '<p>Consider executing the following SQL queries. These fix ' .
'the problem by moving some categories to the top level.</p>';
if (!empty($missingparent)) {
$solution .= "<pre>UPDATE " . $CFG->prefix . "question_categories\n" .
" SET parent = 0\n" .
" WHERE id IN (" . implode(',', array_keys($missingparent)) . ");</pre>\n";
}
if (!empty($loops)) {
$solution .= "<pre>UPDATE " . $CFG->prefix . "question_categories\n" .
" SET parent = 0\n" .
" WHERE id IN (" . implode(',', array_keys($loops)) . ");</pre>\n";
}
return $solution;
}
}
class problem_00000x extends problem_base {
function title() {
return '';
}
function exists() {
return false;
}
function severity() {
return SEVERITY_SIGNIFICANT;
}
function description() {
return '';
}
function solution() {
global $CFG;
return '';
}
}
/*
TODO:
session.save_path -- it doesn't really matter because we are already IN a session, right?
detect unsupported characters in $CFG->wwwroot - see bug Bug #6091 - relative vs absolute path during backup/restore process
*/
+174 -318
View File
@@ -26,58 +26,21 @@
// Check that config.php exists, if not then call the install script
if (!file_exists('../config.php')) {
header('Location: ../install.php');
die();
die;
}
// Check that PHP is of a sufficient version as soon as possible
if (version_compare(phpversion(), '5.3.3') < 0) {
if (version_compare(phpversion(), '5.2.0') < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
echo "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).<br />";
echo "Please upgrade your server software or install older Moodle version.";
die();
}
// make sure iconv is available and actually works
if (!function_exists('iconv')) {
// this should not happen, this must be very borked install
echo 'Moodle requires the iconv PHP extension. Please install or enable the iconv extension.';
die();
echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion). ";
echo "Please upgrade your server software or use latest Moodle 1.9.x instead.";
die;
}
define('NO_OUTPUT_BUFFERING', true);
if ((isset($_GET['cache']) and $_GET['cache'] === '0')
or (isset($_POST['cache']) and $_POST['cache'] === '0')
or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
// Prevent caching at all cost when visiting this page directly,
// we redirect to self once we known no upgrades are necessary.
// Note: $_GET and $_POST are used here intentionally because our param cleaning is not loaded yet.
// Note2: the sesskey is present in all block editing hacks, we can not redirect there, so enable caching.
define('CACHE_DISABLE_ALL', true);
// Force OPcache reset if used, we do not want any stale caches
// when detecting if upgrade necessary or when running upgrade.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$cache = 0;
} else {
$cache = 1;
}
require('../config.php');
// Invalidate the cache of version.php in any circumstances to help core_component
// detecting if the version has changed and component cache should be reset.
if (function_exists('opcache_invalidate')) {
opcache_invalidate($CFG->dirroot . '/version.php', true);
}
// Make sure the component cache gets rebuilt if necessary, any method that
// indirectly calls the protected init() method is good here.
core_component::get_core_subsystems();
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
@@ -85,36 +48,15 @@ $id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW);
// Set up PAGE.
$url = new moodle_url('/admin/index.php');
$url->param('cache', $cache);
$PAGE->set_url($url);
unset($url);
// Are we returning from an add-on installation request at moodle.org/plugins?
if ($newaddonreq and !$cache and empty($CFG->disableonclickaddoninstall)) {
$target = new moodle_url('/admin/tool/installaddon/index.php', array(
'installaddonrequest' => $newaddonreq,
'confirm' => 0));
if (!isloggedin() or isguestuser()) {
// Login and go the the add-on tool page.
$SESSION->wantsurl = $target->out();
redirect(get_login_url());
}
redirect($target);
}
// Check some PHP server settings
$PAGE->set_url('/admin/index.php');
$PAGE->set_pagelayout('admin'); // Set a default pagelayout
$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
// Check some PHP server settings
if (ini_get_bool('session.auto_start')) {
print_error('phpvaroff', 'debug', '', (object)array('name'=>'session.auto_start', 'link'=>$documentationlink));
}
@@ -132,26 +74,29 @@ if (is_float_problem()) {
}
// Set some necessary variables during set-up to avoid PHP warnings later on this page
if (!isset($CFG->framename)) {
$CFG->framename = '_top';
}
if (!isset($CFG->release)) {
$CFG->release = '';
}
if (!isset($CFG->version)) {
$CFG->version = '';
}
if (!isset($CFG->branch)) {
$CFG->branch = '';
}
$version = null;
$release = null;
$branch = null;
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
$CFG->target_release = $release; // used during installation and upgrades
if (!$version or !$release) {
print_error('withoutversion', 'debug'); // without version, stop
}
// Turn off xmlstrictheaders during upgrade.
$origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
$CFG->xmlstrictheaders = false;
if (!core_tables_exist()) {
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
@@ -162,63 +107,69 @@ if (!core_tables_exist()) {
$strinstallation = get_string('installation', 'install');
// remove current session content completely
\core\session\manager::terminate_current();
session_get_instance()->terminate_current();
if (empty($agreelicense)) {
$strlicense = get_string('license');
$PAGE->navbar->add($strlicense);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
echo $output->install_licence_page();
die();
echo $OUTPUT->header();
echo $OUTPUT->heading('<a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment');
echo $OUTPUT->heading(get_string('copyrightnotice'));
$copyrightnotice = text_to_html(get_string('gpl3'));
$copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
echo $OUTPUT->box($copyrightnotice, 'copyrightnotice');
echo '<br />';
$continue = new single_button(new moodle_url('/admin/index.php', array('lang'=>$CFG->lang, 'agreelicense'=>1)), get_string('continue'), 'get');
echo $OUTPUT->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
echo $OUTPUT->footer();
die;
}
if (empty($confirmrelease)) {
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
$PAGE->set_title($strinstallation);
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();
echo $OUTPUT->heading("Moodle $release");
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
echo $output->install_environment_page($maturity, $envstatus, $environment_results, $release);
die();
if (isset($maturity)) {
// main version.php declares moodle code maturity
if ($maturity < MATURITY_STABLE) {
$maturitylevel = get_string('maturity'.$maturity, 'admin');
echo $OUTPUT->box(
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
'generalbox maturitywarning');
}
}
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
echo $OUTPUT->box($releasenoteslink, 'generalbox releasenoteslink');
require_once($CFG->libdir.'/environmentlib.php');
if (!check_moodle_environment(normalize_version($release), $environment_results, true, ENV_SELECT_RELEASE)) {
print_upgrade_reload("index.php?agreelicense=1&amp;lang=$CFG->lang");
} else {
echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
echo $OUTPUT->continue_button(new moodle_url('/admin/index.php', array('agreelicense'=>1, 'confirmrelease'=>1, 'lang'=>$CFG->lang)));
}
echo $OUTPUT->footer();
die;
}
// check plugin dependencies
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
$PAGE->set_title($strinstallation);
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
$output = $PAGE->get_renderer('core', 'admin');
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
die();
}
unset($failed);
//TODO: add a page with list of non-standard plugins here
$strdatabasesetup = get_string('databasesetup');
upgrade_init_javascript();
$PAGE->navbar->add($strdatabasesetup);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->header();
echo $OUTPUT->header();
if (!$DB->setup_is_unicodedb()) {
if (!$DB->change_db_encoding()) {
@@ -235,124 +186,90 @@ if (!core_tables_exist()) {
// and upgrade if possible.
$stradministration = get_string('administration');
$PAGE->set_context(context_system::instance());
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
if (empty($CFG->version)) {
print_error('missingconfigversion', 'debug');
}
// Detect config cache inconsistency, this happens when you switch branches on dev servers.
if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))) {
purge_all_caches();
redirect(new moodle_url('/admin/index.php'), 'Config cache inconsistency detected, resetting caches...');
}
if (!$cache and $version > $CFG->version) { // upgrade
// Warning about upgrading a test site.
$testsite = false;
if (defined('BEHAT_SITE_RUNNING')) {
$testsite = 'behat';
}
// We purge all of MUC's caches here.
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
// This ensures a real config object is loaded and the stores will be purged.
// This is the only way we can purge custom caches such as memcache or APC.
// Note: all other calls to caches will still used the disabled API.
cache_helper::purge_all(true);
// We then purge the regular caches.
purge_all_caches();
if ($version > $CFG->version) { // upgrade
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
if (upgrade_stale_php_files_present()) {
$PAGE->set_title($stradministration);
$PAGE->set_cacheable(false);
echo $output->upgrade_stale_php_files_page();
die();
}
$a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)";
$strdatabasechecking = get_string('databasechecking', '', $a);
if (empty($confirmupgrade)) {
$a = new stdClass();
$a->oldversion = "$CFG->release (".sprintf('%.2f', $CFG->version).")";
$a->newversion = "$release (".sprintf('%.2f', $version).")";
$strdatabasechecking = get_string('databasechecking', '', $a);
$PAGE->set_title($stradministration);
$PAGE->set_heading($strdatabasechecking);
$PAGE->set_cacheable(false);
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
die();
echo $OUTPUT->header();
if (isset($maturity)) {
// main version.php declares moodle code maturity
if ($maturity < MATURITY_STABLE) {
$maturitylevel = get_string('maturity'.$maturity, 'admin');
echo $OUTPUT->box(
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
'generalbox maturitywarning');
}
}
$continueurl = new moodle_url('index.php', array('confirmupgrade' => 1));
$cancelurl = new moodle_url('index.php');
echo $OUTPUT->confirm(get_string('upgradesure', 'admin', $a->newversion), $continueurl, $cancelurl);
echo $OUTPUT->footer();
exit;
} else if (empty($confirmrelease)){
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment($release, ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
$PAGE->set_title($strcurrentrelease);
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();
echo $OUTPUT->heading("Moodle $release");
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
echo $OUTPUT->box($releasenoteslink);
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
die();
require_once($CFG->libdir.'/environmentlib.php');
if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
print_upgrade_reload('index.php?confirmupgrade=1');
} else {
echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
if (empty($CFG->skiplangupgrade)) {
echo $OUTPUT->box_start('generalbox', 'notice');
print_string('langpackwillbeupdated', 'admin');
echo $OUTPUT->box_end();
}
echo $OUTPUT->continue_button('index.php?confirmupgrade=1&confirmrelease=1');
}
} else if (empty($confirmplugins)) {
echo $OUTPUT->footer();
die;
} elseif (empty($confirmplugins)) {
$strplugincheck = get_string('plugincheck');
$PAGE->navbar->add($strplugincheck);
$PAGE->set_title($strplugincheck);
$PAGE->set_heading($strplugincheck);
$PAGE->set_cacheable(false);
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
if ($fetchupdates) {
// No sesskey support guaranteed here, because sessions might not work yet.
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
redirect($reloadurl);
}
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$deployer->initialize($reloadurl, $reloadurl);
$deploydata = $deployer->submitted_data();
if (!empty($deploydata)) {
// No sesskey support guaranteed here, because sessions might not work yet.
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
die();
}
}
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
$version, $showallplugins, $reloadurl,
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1, 'cache'=>0)));
echo $OUTPUT->header();
echo $OUTPUT->heading($strplugincheck);
echo $OUTPUT->box_start('generalbox', 'notice');
print_string('pluginchecknotice');
echo $OUTPUT->box_end();
print_plugin_tables();
print_upgrade_reload('index.php?confirmupgrade=1&amp;confirmrelease=1');
$button = new single_button(new moodle_url('index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
$button->class = 'continuebutton';
echo $OUTPUT->render($button);
echo $OUTPUT->footer();
die();
} else {
// Always verify plugin dependencies!
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
die();
}
unset($failed);
// Launch main upgrade.
// Launch main upgrade
upgrade_core($version, true);
}
} else if ($version < $CFG->version) {
@@ -361,72 +278,35 @@ if (!$cache and $version > $CFG->version) { // upgrade
}
// Updated human-readable release version if necessary
if (!$cache and $release <> $CFG->release) { // Update the release version
if ($release <> $CFG->release) { // Update the release version
set_config('release', $release);
}
if (!$cache and $branch <> $CFG->branch) { // Update the branch
set_config('branch', $branch);
}
if (!$cache and moodle_needs_upgrading()) {
if (moodle_needs_upgrading()) {
if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
$strplugincheck = get_string('plugincheck');
$PAGE->navbar->add($strplugincheck);
$PAGE->set_title($strplugincheck);
$PAGE->set_heading($strplugincheck);
$PAGE->set_cacheable(false);
if ($fetchupdates) {
require_sesskey();
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
redirect($PAGE->url);
}
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$deployer->initialize($PAGE->url, $PAGE->url);
$deploydata = $deployer->submitted_data();
if (!empty($deploydata)) {
require_sesskey();
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
die();
}
}
// Show plugins info.
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
$version, $showallplugins,
new moodle_url($PAGE->url),
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1, 'cache'=>0)));
echo $OUTPUT->header();
echo $OUTPUT->heading($strplugincheck);
echo $OUTPUT->box_start('generalbox', 'notice');
print_string('pluginchecknotice');
echo $OUTPUT->box_end();
print_plugin_tables();
print_upgrade_reload('index.php');
$button = new single_button(new moodle_url('index.php', array('confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
$button->class = 'continuebutton';
echo $OUTPUT->render($button);
echo $OUTPUT->footer();
die();
}
// Make sure plugin dependencies are always checked.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
$reloadurl = new moodle_url('/admin/index.php', array('cache' => 0));
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
die();
}
unset($failed);
}
// install/upgrade all plugins and other parts
upgrade_noncore(true);
}
@@ -459,13 +339,8 @@ if (during_initial_install()) {
}
}
// Cleanup SESSION to make sure other code does not complain in the future.
unset($SESSION->has_timed_out);
unset($SESSION->wantsurl);
// at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
$adminids = explode(',', $CFG->siteadmins);
$adminuser = get_complete_user_data('id', reset($adminids));
// at this stage there can be only one admin - users may change username, so do not rely on that
$adminuser = get_complete_user_data('id', $CFG->siteadmins);
if ($adminuser->password === 'adminsetuppending') {
// prevent installation hijacking
@@ -474,7 +349,8 @@ if (during_initial_install()) {
}
// login user and let him set password and admin details
$adminuser->newadminuser = 1;
complete_user_login($adminuser);
message_set_default_message_preferences($adminuser);
complete_user_login($adminuser, false);
redirect("$CFG->wwwroot/user/editadvanced.php?id=$adminuser->id"); // Edit thyself
} else {
@@ -486,31 +362,13 @@ if (during_initial_install()) {
upgrade_finished('upgradesettings.php');
}
if (has_capability('moodle/site:config', context_system::instance())) {
if ($fetchupdates) {
require_sesskey();
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
redirect(new moodle_url('/admin/index.php', array('cache' => 0)));
}
}
// Now we can be sure everything was upgraded and caches work fine,
// redirect if necessary to make sure caching is enabled.
if (!$cache) {
redirect(new moodle_url('/admin/index.php', array('cache' => 1)));
}
// Turn xmlstrictheaders back on now.
$CFG->xmlstrictheaders = $origxmlstrictheaders;
unset($origxmlstrictheaders);
// Check for valid admin user - no guest autologin
require_login(0, false);
if (isguestuser()) {
// Login as real user!
$SESSION->wantsurl = (string)new moodle_url('/admin/index.php');
redirect(get_login_url());
}
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
// check that site is properly customized
@@ -538,58 +396,56 @@ if (any_new_admin_settings($adminroot)){
redirect('upgradesettings.php');
}
// Return to original page that started the plugin uninstallation if necessary.
if (isset($SESSION->pluginuninstallreturn)) {
$return = $SESSION->pluginuninstallreturn;
unset($SESSION->pluginuninstallreturn);
if ($return) {
redirect($return);
}
}
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
admin_externalpage_setup('adminnotifications');
echo $OUTPUT->header();
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
$cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
echo $OUTPUT->box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
echo $OUTPUT->box(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'generalbox adminerror');
// Available updates for Moodle core
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
}
}
}
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
echo $OUTPUT->box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning');
}
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
//check if the site is registered on Moodle.org
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
// If no recently cron run
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
if (time() - $lastcron > 3600 * 24) {
$helpbutton = $OUTPUT->help_icon('cron', 'admin');
echo $OUTPUT->box(get_string('cronwarning', 'admin').'&nbsp;'.$helpbutton, 'generalbox adminwarning');
}
admin_externalpage_setup('adminnotifications');
// Hidden bloglevel upgrade
$showbloglevelupgrade = ($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL) && empty($CFG->bloglevel_upgrade_complete);
if ($showbloglevelupgrade) {
echo $OUTPUT->box(get_string('bloglevelupgradenotice', 'admin'), 'generalbox adminwarning');
}
// diagnose DB, especially the sloppy MyISAM tables
$diagnose = $DB->diagnose();
if ($diagnose !== NULL) {
echo $OUTPUT->box($diagnose, 'generalbox adminwarning');
}
// Alert if we are currently in maintenance mode
if (!empty($CFG->maintenance_enabled)) {
echo $OUTPUT->box(get_string('sitemaintenancewarning2', 'admin', "$CFG->wwwroot/$CFG->admin/settings.php?section=maintenancemode"), 'generalbox adminwarning');
}
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
echo $OUTPUT->box($copyrighttext, 'copyright');
//////////////////////////////////////////////////////////////////////////////////////////////////
echo $OUTPUT->footer();
$output = $PAGE->get_renderer('core', 'admin');
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered);
+45
View File
@@ -0,0 +1,45 @@
<?php
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toinodb');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
echo $OUTPUT->header();
echo $OUTPUT->heading('Convert all MySQL tables from MYISAM to InnoDB');
if ($DB->get_dbfamily() != 'mysql') {
notice('This function is for MySQL databases only!', 'index.php');
}
if (data_submitted() and $confirm and confirm_sesskey()) {
echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
if ($tables = $DB->get_tables()) {
$DB->set_debug(true);
foreach ($tables as $table) {
$fulltable = $DB->get_prefix().$table;
$DB->change_database_structure("ALTER TABLE $fulltable TYPE=INNODB");
}
$DB->set_debug(false);
}
echo $OUTPUT->notification('... done.', 'notifysuccess');
echo $OUTPUT->continue_button('index.php');
echo $OUTPUT->footer();
} else {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
$formcontinue = new single_button(new moodle_url('/admin/innodb.php', $optionsyes), get_string('yes'));
$formcancel = new single_button(new moodle_url('/admin/index.php'), get_string('no'), 'get');
echo $OUTPUT->confirm('Are you sure you want convert all your tables to the InnoDB format?', $formcontinue, $formcancel);
echo $OUTPUT->footer();
}
+382
View File
@@ -0,0 +1,382 @@
<?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/>.
/**
* Fetches language packages from download.moodle.org server
*
* Language packages are available at http://download.moodle.org/langpack/2.0/
* in ZIP format together with a file languages.md5 containing their hashes
* and meta info.
* Locally, language packs are saved into $CFG->dataroot/lang/
*
* @package core
* @copyright 2005 Yu Zhang
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(dirname(__FILE__)).'/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/componentlib.class.php');
$thisversion = '2.0'; // TODO this information should be taken from version.php or similar source
admin_externalpage_setup('langimport');
if (!empty($CFG->skiplangupgrade)) {
echo $OUTPUT->header();
echo $OUTPUT->box(get_string('langimportdisabled', 'admin'));
echo $OUTPUT->footer();
die;
}
$mode = optional_param('mode', 0, PARAM_INT); // action
$pack = optional_param('pack', array(), PARAM_SAFEDIR); // pack to install
$uninstalllang = optional_param('uninstalllang', '', PARAM_LANG); // installed pack to uninstall
$confirm = optional_param('confirm', 0, PARAM_BOOL); // uninstallation confirmation
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
get_string_manager()->reset_caches();
$notice_ok = array();
$notice_error = array();
if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($pack)) {
set_time_limit(0);
make_upload_directory('temp');
make_upload_directory('lang');
if (is_array($pack)) {
$packs = $pack;
} else {
$packs = array($pack);
}
foreach ($packs as $pack) {
if ($cd = new component_installer('http://download.moodle.org', 'langpack/'.$thisversion, $pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install();
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/langpack/'.$thisversion.'/'.$pack.'.zip';
$a->dest = $CFG->dataroot.'/lang';
print_error($cd->get_error(), 'error', 'langimport.php', $a);
} else {
print_error($cd->get_error(), 'error', 'langimport.php');
}
break;
case COMPONENT_INSTALLED:
$notice_ok[] = get_string('langpackinstalled','admin',$pack);
if ($parentlang = get_parent_language($pack)) {
// install also parent pack if specified
if ($cd = new component_installer('http://download.moodle.org', 'langpack/'.$thisversion,
$parentlang.'.zip', 'languages.md5', 'lang')) {
$cd->install();
}
}
break;
case COMPONENT_UPTODATE:
break;
}
} else {
echo $OUTPUT->notification('Had an unspecified error with the component installer, sorry.');
}
}
}
if ($mode == DELETION_OF_SELECTED_LANG and !empty($uninstalllang)) {
if ($uninstalllang == 'en') {
$notice_error[] = 'English language pack can not be uninstalled';
} else if (!$confirm and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'admin', $uninstalllang),
'langimport.php?mode='.DELETION_OF_SELECTED_LANG.'&uninstalllang='.$uninstalllang.'&confirm=1',
'langimport.php');
echo $OUTPUT->footer();
die;
} else if (confirm_sesskey()) {
$dest1 = $CFG->dataroot.'/lang/'.$uninstalllang;
$dest2 = $CFG->dirroot.'/lang/'.$uninstalllang;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)){
$rm1 = remove_dir($dest1);
}
if (file_exists($dest2)){
$rm2 = remove_dir($dest2);
}
if ($rm1 or $rm2) {
$notice_ok[] = get_string('langpackremoved','admin');
} else { //nothing deleted, possibly due to permission error
$notice_error[] = 'An error has occurred, language pack is not completely uninstalled, please check file permissions';
}
}
}
if ($mode == UPDATE_ALL_LANG) {
set_time_limit(0);
if (!$availablelangs = get_remote_list_of_languages()) {
print_error('cannotdownloadlanguageupdatelist', 'error');
}
$md5array = array(); // (string)langcode => (string)md5
foreach ($availablelangs as $alang) {
$md5array[$alang[0]] = $alang[1];
}
// filter out unofficial packs
$currentlangs = array_keys(get_string_manager()->get_list_of_translations(true));
$updateablelangs = array();
foreach ($currentlangs as $clang) {
if (!array_key_exists($clang, $md5array)) {
$notice_ok[] = get_string('langpackupdateskipped', 'admin', $clang);
continue;
}
$dest1 = $CFG->dataroot.'/lang/'.$clang;
$dest2 = $CFG->dirroot.'/lang/'.$clang;
if (file_exists($dest1.'/langconfig.php') || file_exists($dest2.'/langconfig.php')){
$updateablelangs[] = $clang;
}
}
// then filter out packs that have the same md5 key
$neededlangs = array(); // all the packs that needs updating
foreach ($updateablelangs as $ulang) {
if (!is_installed_lang($ulang, $md5array[$ulang])) {
$neededlangs[] = $ulang;
}
}
make_upload_directory('temp');
make_upload_directory('lang');
$updated = false; // any packs updated?
foreach ($neededlangs as $pack) {
if ($pack == 'en') {
continue;
}
// delete old directories
$dest1 = $CFG->dataroot.'/lang/'.$pack;
$dest2 = $CFG->dirroot.'/lang/'.$pack;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)) {
if (!remove_dir($dest1)) {
$notice_error[] = 'Could not delete old directory '.$dest1.', update of '.$pack.' failed, please check permissions.';
continue;
}
}
if (file_exists($dest2)) {
if (!remove_dir($dest2)) {
$notice_error[] = 'Could not delete old directory '.$dest2.', update of '.$pack.' failed, please check permissions.';
continue;
}
}
// copy and unzip new version
if ($cd = new component_installer('http://download.moodle.org', 'langpack/'.$thisversion, $pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install();
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/langpack/'.$thisversion.'/'.$pack.'.zip';
$a->dest = $CFG->dataroot.'/lang';
print_error($cd->get_error(), 'error', 'langimport.php', $a);
} else {
print_error($cd->get_error(), 'error', 'langimport.php');
}
break;
case COMPONENT_UPTODATE:
// should not get here
break;
case COMPONENT_INSTALLED:
$notice_ok[] = get_string('langpackupdated', 'admin', $pack);
$updated = true;
break;
}
}
}
if ($updated) {
$notice_ok[] = get_string('langupdatecomplete','admin');
} else {
$notice_ok[] = get_string('nolangupdateneeded','admin');
}
}
get_string_manager()->reset_caches();
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('langimport', 'admin'));
$installedlangs = get_string_manager()->get_list_of_translations(true);
$missingparents = array();
foreach ($installedlangs as $installedlang => $unused) {
$parent = get_parent_language($installedlang);
if (empty($parent) or ($parent === 'en')) {
continue;
}
if (!isset($installedlangs[$parent])) {
$missingparents[$installedlang] = $parent;
}
}
if ($availablelangs = get_remote_list_of_languages()) {
$remote = true;
} else {
$remote = false;
$availablelangs = array();
echo $OUTPUT->box_start();
print_string('remotelangnotavailable', 'admin', $CFG->dataroot.'/lang/');
echo $OUTPUT->box_end();
}
if ($notice_ok) {
$info = implode('<br />', $notice_ok);
echo $OUTPUT->notification($info, 'notifysuccess');
}
if ($notice_error) {
$info = implode('<br />', $notice_error);
echo $OUTPUT->notification($info, 'notifyproblem');
}
if ($missingparents) {
foreach ($missingparents as $l=>$parent) {
$a = new stdClass();
$a->lang = $installedlangs[$l];
$a->parent = $parent;
foreach ($availablelangs as $alang) {
if ($alang[0] == $parent) {
$shortlang = $alang[0];
$a->parent = $alang[2].' ('.$shortlang.')';
}
}
$info = get_string('missinglangparent', 'admin', $a);
echo $OUTPUT->notification($info, 'notifyproblem');
}
}
echo $OUTPUT->box_start();
echo html_writer::start_tag('table');
echo html_writer::start_tag('tr');
// list of installed languages
$url = new moodle_url('/admin/langimport.php', array('mode' => DELETION_OF_SELECTED_LANG));
echo html_writer::start_tag('td', array('valign' => 'top'));
echo html_writer::start_tag('form', array('id' => 'uninstallform', 'action' => $url->out(), 'method' => 'post'));
echo html_writer::start_tag('fieldset');
echo html_writer::label(get_string('installedlangs','admin'), 'uninstalllang');
echo html_writer::empty_tag('br');
echo html_writer::select($installedlangs, 'uninstalllang', '', false, array('size' => 15));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::empty_tag('br');
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('uninstall','admin')));
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
if ($remote) {
$url = new moodle_url('/admin/langimport.php', array('mode' => UPDATE_ALL_LANG));
echo html_writer::start_tag('form', array('id' => 'updateform', 'action' => $url->out(), 'method' => 'post'));
echo html_writer::tag('fieldset', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('updatelangs','admin'))));
echo html_writer::end_tag('form');
}
echo html_writer::end_tag('td');
// list of available languages
$options = array();
foreach ($availablelangs as $alang) {
if (!empty($alang[0]) and trim($alang[0]) !== 'en' and !is_installed_lang($alang[0], $alang[1])) {
$options[$alang[0]] = $alang[2].' ('.$alang[0].')';
}
}
if (!empty($options)) {
echo html_writer::start_tag('td', array('valign' => 'top'));
$url = new moodle_url('/admin/langimport.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
echo html_writer::start_tag('form', array('id' => 'installform', 'action' => $url->out(), 'method' => 'post'));
echo html_writer::start_tag('fieldset');
echo html_writer::label(get_string('availablelangs','install'), 'pack');
echo html_writer::empty_tag('br');
echo html_writer::select($options, 'pack[]', '', false, array('size' => 15, 'multiple' => 'multiple'));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::empty_tag('br');
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('install','admin')));
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
echo html_writer::end_tag('td');
}
echo html_writer::end_tag('tr');
echo html_writer::end_tag('table');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die();
////////////////////////////////////////////////////////////////////////////////
// Local functions /////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/**
* checks the md5 of the zip file, grabbed from download.moodle.org,
* against the md5 of the local language file from last update
* @param string $lang
* @param string $md5check
* @return bool
*/
function is_installed_lang($lang, $md5check) {
global $CFG;
$md5file = $CFG->dataroot.'/lang/'.$lang.'/'.$lang.'.md5';
if (file_exists($md5file)){
return (file_get_contents($md5file) == $md5check);
}
return false;
}
/**
* Returns the list of available language packs from download.moodle.org
*
* @return array|bool false if can not download
*/
function get_remote_list_of_languages() {
$source = 'http://download.moodle.org/langpack/2.0/languages.md5';
$availablelangs = array();
if ($content = download_file_content($source)) {
$alllines = explode("\n", $content);
foreach($alllines as $line) {
if (!empty($line)){
$availablelangs[] = explode(',', $line);
}
}
return $availablelangs;
} else {
return false;
}
}
-39
View File
@@ -1,39 +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 contains functions used by the admin pages
*
* @since 2.1
* @package admin
* @copyright 2011 Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Return a list of page types
* @param string $pagetype current page type
* @param stdClass $parentcontext Block's parent context
* @param stdClass $currentcontext Current context of block
*/
function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
$array = array(
'admin-*' => get_string('page-admin-x', 'pagetype'),
$pagetype => get_string('page-admin-current', 'pagetype')
);
return $array;
}
+2 -2
View File
@@ -24,11 +24,11 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/licenselib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ACTION);
$license = optional_param('license', '', PARAM_SAFEDIR);
////////////////////////////////////////////////////////////////////////////////
+42 -10
View File
@@ -33,21 +33,55 @@ require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('managelocalplugins');
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// If data submitted, then process and store.
if (!empty($delete) and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('localplugins'));
if (!$confirm) {
if (get_string_manager()->string_exists('pluginname', 'local_' . $delete)) {
$strpluginname = get_string('pluginname', 'local_' . $delete);
} else {
$strpluginname = $delete;
}
echo $OUTPUT->confirm(get_string('localplugindeleteconfirm', '', $strpluginname),
new moodle_url($PAGE->url, array('delete' => $delete, 'confirm' => 1)),
$PAGE->url);
echo $OUTPUT->footer();
die();
} else {
uninstall_plugin('local', $delete);
$a = new stdclass();
$a->name = $delete;
$pluginlocation = get_plugin_types();
$a->directory = $pluginlocation['local'] . '/' . $delete;
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
echo $OUTPUT->continue_button($PAGE->url);
echo $OUTPUT->footer();
die();
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('localplugins'));
/// Print the table of all installed local plugins
$table = new flexible_table('localplugins_administration_table');
$table->define_columns(array('name', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('uninstallplugin', 'core_admin')));
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'localplugins');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
$plugins = array();
foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
foreach (get_plugin_list('local') as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'local_' . $plugin)) {
$strpluginname = get_string('pluginname', 'local_' . $plugin);
} else {
@@ -55,13 +89,11 @@ foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
core_collator::asort($plugins);
textlib_get_instance()->asort($plugins);
foreach ($plugins as $plugin => $name) {
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('local_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'));
}
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
$delete = html_writer::link($delete, get_string('delete'));
$version = get_config('local_' . $plugin);
if (!empty($version->version)) {
@@ -70,7 +102,7 @@ foreach ($plugins as $plugin => $name) {
$version = '?';
}
$table->add_data(array($name, $version, $uninstall));
$table->add_data(array($name, $version, $delete));
}
$table->print_html();
-74
View File
@@ -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/>.
/**
* Message outputs configuration page
*
* @package message
* @copyright 2011 Lancaster University Network Services Limited
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
// This is an admin page
admin_externalpage_setup('managemessageoutputs');
// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());
// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
$headingtitle = get_string('managemessageoutputs', 'message');
if (!empty($disable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
core_plugin_manager::reset_caches();
}
if (!empty($enable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
core_plugin_manager::reset_caches();
}
if ($disable || $enable) {
$url = new moodle_url('message.php');
redirect($url);
}
// Page settings
$PAGE->set_context(context_system::instance());
// Grab the renderer
$renderer = $PAGE->get_renderer('core', 'message');
// Display the manage message outputs interface
$processors = get_message_processors();
$messageoutputs = $renderer->manage_messageoutputs($processors);
// Display the page
echo $OUTPUT->header();
echo $OUTPUT->heading($headingtitle);
echo $messageoutputs;
echo $OUTPUT->footer();
+10 -13
View File
@@ -16,11 +16,13 @@ require_login();
admin_externalpage_setup('ssoaccesscontrol');
echo $OUTPUT->header();
if (!extension_loaded('openssl')) {
print_error('requiresopenssl', 'mnet');
}
$sitecontext = context_system::instance();
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$sesskey = sesskey();
$formerror = array();
@@ -63,11 +65,9 @@ if (!empty($action) and confirm_sesskey()) {
if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) {
if ($accessctrl == 'allow') {
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('user' => $idrec->username,
'host' => $mnethosts[$idrec->mnet_host_id])));
} else if ($accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user' => $idrec->username,
'host' => $mnethosts[$idrec->mnet_host_id])));
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('uset'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
} elseif ($accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
}
}
break;
@@ -103,7 +103,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
$usernames = explode(',', $form->username);
foreach ($usernames as $username) {
$username = trim(core_text::strtolower($username));
$username = trim(moodle_strtolower($username));
if (!empty($username)) {
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
if ($form->accessctrl == 'allow') {
@@ -118,8 +118,6 @@ if ($form = data_submitted() and confirm_sesskey()) {
exit;
}
echo $OUTPUT->header();
// Explain
echo $OUTPUT->box(get_string('ssoacldescr','mnet'));
// Are the needed bits enabled?
@@ -205,18 +203,17 @@ echo get_string('username') . ":\n";
if (!empty($formerror['username'])) {
echo '<span class="error"> * </span>';
}
echo html_writer::label(get_string('username'), 'menuusername', false, array('class' => 'accesshide'));
echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
echo '<input type="text" name="username" size="20" maxlength="100" />';
// choose a remote host
echo " " . html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id') . ":\n";
echo " " . get_string('remotehost', 'mnet') . ":\n";
if (!empty($formerror['mnet_host_id'])) {
echo '<span class="error"> * </span>';
}
echo html_writer::select($mnethosts, 'mnet_host_id');
// choose an access level
echo " " . html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl') . ":\n";
echo " " . get_string('accesslevel', 'mnet') . ":\n";
if (!empty($formerror['accessctrl'])) {
echo '<span class="error"> * </span>';
}
+1 -1
View File
@@ -36,7 +36,7 @@ $hostid = required_param('hostid', PARAM_INT);
require_login();
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$mnet = get_mnet_environment();
+3 -3
View File
@@ -9,7 +9,7 @@
require_login();
admin_externalpage_setup('net');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
@@ -85,7 +85,7 @@
echo $OUTPUT->header();
?>
<form method="post" action="index.php">
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
@@ -106,7 +106,7 @@
</table>
</form>
<form method="post" action="index.php">
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
+7 -15
View File
@@ -50,7 +50,7 @@ class mnet_simple_host_form extends moodleform {
$this->add_action_buttons(false, get_string('addhost', 'mnet'));
}
function validation($data, $files) {
function validation($data) {
global $DB;
$wwwroot = $data['wwwroot'];
@@ -78,13 +78,9 @@ class mnet_review_host_form extends moodleform {
$mnet_peer = $this->_customdata['peer'];
$mform->addElement('hidden', 'last_connect_time');
$mform->setType('last_connect_time', PARAM_INT);
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'applicationid');
$mform->setType('applicationid', PARAM_INT);
$mform->addElement('hidden', 'oldpublickey');
$mform->setType('oldpublickey', PARAM_PEM);
$mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50));
$mform->setType('name', PARAM_NOTAGS);
@@ -95,14 +91,13 @@ class mnet_review_host_form extends moodleform {
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$themes = array('' => get_string('forceno'));
foreach (array_keys(core_component::get_plugin_list('theme')) as $themename) {
foreach (array_keys(get_plugin_list('theme')) as $themename) {
$themes[$themename] = get_string('pluginname', 'theme_'.$themename);
}
$mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
$mform->addElement('textarea', 'public_key', get_string('publickey', 'mnet'), array('rows' => 17, 'cols' => 100, 'class' => 'smalltext'));
$mform->setType('public_key', PARAM_PEM);
$mform->addRule('public_key', get_string('required'), 'required');
// finished with form controls, now the static informational stuff
if ($mnet_peer && !empty($mnet_peer->bootstrapped)) {
@@ -145,30 +140,27 @@ class mnet_review_host_form extends moodleform {
if ($mnet_peer && !empty($mnet_peer->deleted)) {
$radioarray = array();
$radioarray[] = $mform->createElement('static', 'deletedinfo', '',
$radioarray[] = MoodleQuickForm::createElement('static', 'deletedinfo', '',
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1);
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0);
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('yes'), 1);
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('no'), 0);
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
} else {
$mform->addElement('hidden', 'deleted');
$mform->setType('deleted', PARAM_BOOL);
}
// finished with static stuff, print save button
$this->add_action_buttons(false);
}
function validation($data, $files) {
function validation($data) {
$errors = array();
if ($data['oldpublickey'] == $data['public_key']) {
return;
}
$mnet_peer = new mnet_peer(); // idiotic api
$mnet_peer->wwwroot = $data['wwwroot']; // just hard-set this rather than bootstrap the object
if (empty($data['public_key'])) {
$errors['public_key'] = get_string('publickeyrequired', 'mnet');
} else if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
$errmsg = '';
foreach ($mnet_peer->error as $err) {
$errmsg .= $err['code'] . ': ' . $err['text'].'<br />';
+2 -2
View File
@@ -30,11 +30,11 @@
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/mnet/lib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
require_once($CFG->dirroot.'/admin/mnet/peer_forms.php');
require_login();
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
/// Initialize variables.
+1 -1
View File
@@ -34,7 +34,7 @@ $hostid = required_param('hostid', PARAM_INT);
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
admin_externalpage_setup('mnetpeers');
+2 -13
View File
@@ -39,19 +39,8 @@ class mnet_profile_form extends moodleform {
global $CFG;
$mform =& $this->_form;
$mnetprofileimportfields = '';
if (isset($CFG->mnetprofileimportfields)) {
$mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
}
$mnetprofileexportfields = '';
if (isset($CFG->mnetprofileexportfields)) {
$mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
}
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$mform->setType('hostid', PARAM_INT);
$fields = mnet_profile_field_options();
// Fields to import ----------------------------------------------------
@@ -60,7 +49,7 @@ class mnet_profile_form extends moodleform {
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
$mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
$mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileimportfields));
// Fields to export ----------------------------------------------------
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
@@ -68,7 +57,7 @@ class mnet_profile_form extends moodleform {
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
$mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
$mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileexportfields));
$this->add_action_buttons();
}
+1 -1
View File
@@ -33,7 +33,7 @@ $mnet = get_mnet_environment();
require_login();
admin_externalpage_setup('mnetpeers');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$hostid = required_param('hostid', PARAM_INT);
+1 -4
View File
@@ -36,10 +36,9 @@ class mnet_services_form extends moodleform {
function definition() {
$mform =& $this->_form;
$mnet_peer =& $this->_customdata['peer'];
$myservices = mnet_get_service_info($mnet_peer);
$myservices =& mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
$mform->setType('hostid', PARAM_INT);
$count = 0;
foreach ($myservices as $name => $versions) {
@@ -56,8 +55,6 @@ class mnet_services_form extends moodleform {
$mform->addElement('html', '<h3>' . get_string($name.'_name', $langmodule , $mnet_peer->name) . '</h3>' . get_string($name.'_description', $langmodule, $mnet_peer->name));
$mform->addElement('hidden', 'exists[' . $version['serviceid'] . ']', 1);
// Temporary fix until MDL-38885 gets integrated.
$mform->setType('exists', PARAM_BOOL);
$pubstr = get_string('publish','mnet');
if (!empty($version['hostsubscribes'])) {
+1 -1
View File
@@ -38,7 +38,7 @@ $strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$logurl = $CFG->wwwroot.
'/report/log/index.php?chooselog=1&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
'/course/report/log/index.php?chooselog=1&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
'%2F1&amp;user='.'0'.
'&amp;date=0'.
'&amp;modid=&amp;modaction=0&amp;logformat=showashtml';
+1 -1
View File
@@ -24,7 +24,7 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
require_login();
admin_externalpage_setup('mnettestclient');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
error_reporting(DEBUG_ALL);
+1 -1
View File
@@ -8,7 +8,7 @@
require_login();
admin_externalpage_setup('trustedhosts');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
+64 -34
View File
@@ -11,14 +11,16 @@
admin_externalpage_setup('managemodules');
$show = optional_param('show', '', PARAM_PLUGIN);
$hide = optional_param('hide', '', PARAM_PLUGIN);
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// Print headings
$stractivities = get_string("activities");
$struninstall = get_string('uninstallplugin', 'core_admin');
$strdelete = get_string("delete");
$strversion = get_string("version");
$strhide = get_string("hide");
$strshow = get_string("show");
@@ -40,14 +42,14 @@
SET visibleold=visible, visible=0
WHERE module=?";
$DB->execute($sql, array($module->id));
// Increment course.cacherev for courses where we just made something invisible.
// This will force cache rebuilding on the next request.
increment_revision_number('course', 'cacherev',
"id IN (SELECT DISTINCT course
// clear the course modinfo cache for courses
// where we just deleted something
$sql = "UPDATE {course}
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
FROM {course_modules}
WHERE visibleold=1 AND module=?)",
array($module->id));
core_plugin_manager::reset_caches();
WHERE visibleold=1 AND module=?)";
$DB->execute($sql, array($module->id));
admin_get_root(true, false); // settings not required - only pages
}
@@ -57,17 +59,48 @@
}
$DB->set_field("modules", "visible", "1", array("id"=>$module->id)); // Show main module
$DB->set_field('course_modules', 'visible', '1', array('visibleold'=>1, 'module'=>$module->id)); // Get the previous saved visible state for the course module.
// Increment course.cacherev for courses where we just made something visible.
// This will force cache rebuilding on the next request.
increment_revision_number('course', 'cacherev',
"id IN (SELECT DISTINCT course
// clear the course modinfo cache for courses
// where we just made something visible
$sql = "UPDATE {course}
SET modinfo = ''
WHERE id IN (SELECT DISTINCT course
FROM {course_modules}
WHERE visible=1 AND module=?)",
array($module->id));
core_plugin_manager::reset_caches();
WHERE visible=1 AND module=?)";
$DB->execute($sql, array($module->id));
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($delete) and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($stractivities);
if (get_string_manager()->string_exists('modulename', $delete)) {
$strmodulename = get_string('modulename', $delete);
} else {
$strmodulename = $delete;
}
if (!$confirm) {
echo $OUTPUT->confirm(get_string("moduledeleteconfirm", "", $strmodulename), "modules.php?delete=$delete&confirm=1", "modules.php");
echo $OUTPUT->footer();
exit;
} else { // Delete everything!!
if ($delete == "forum") {
print_error("cannotdeleteforummodule", 'forum');
}
uninstall_plugin('mod', $delete);
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
echo $OUTPUT->notification(get_string("moduledeletefiles", "", $a), 'notifysuccess');
echo $OUTPUT->continue_button("modules.php");
echo $OUTPUT->footer();
exit;
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($stractivities);
@@ -80,11 +113,11 @@
/// Print the table of all modules
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'uninstall', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strsettings, $struninstall));
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable');
$table->setup();
foreach ($modules as $module) {
@@ -99,10 +132,7 @@
$missing = false;
}
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('mod_'.$module->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$delete = "<a href=\"modules.php?delete=$module->name&amp;sesskey=".sesskey()."\">$strdelete</a>";
if (file_exists("$CFG->dirroot/mod/$module->name/settings.php") ||
file_exists("$CFG->dirroot/mod/$module->name/settingstree.php")) {
@@ -130,28 +160,28 @@
$class = '';
} else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">".
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
"<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
$class = '';
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = 'dimmed_text';
"<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
$class = ' class="dimmed_text"';
}
if ($module->name == "forum") {
$uninstall = "";
$delete = "";
$visible = "";
$class = "";
}
$version = get_config('mod_'.$module->name, 'version');
$table->add_data(array(
$strmodulename,
'<span'.$class.'>'.$strmodulename.'</span>',
$countlink,
$version,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
$settings,
$uninstall,
), $class);
$delete,
$settings
));
}
$table->print_html();
+117
View File
@@ -0,0 +1,117 @@
<?php
/// Search and replace strings throughout all texts in the whole database
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('multilangupgrade');
$go = optional_param('go', 0, PARAM_BOOL);
###################################################################
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('multilangupgrade', 'admin'));
$strmultilangupgrade = get_String('multilangupgradeinfo', 'admin');
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
echo $OUTPUT->confirm($strmultilangupgrade, new moodle_url('multilangupgrade.php', $optionsyes), 'index.php');
echo $OUTPUT->footer();
die;
}
if (!$tables = $DB->get_tables() ) { // No tables yet at all.
print_error('notables', 'debug');
}
echo $OUTPUT->box_start();
/// Turn off time limits, sometimes upgrades can be slow.
@set_time_limit(0);
echo '<strong>Progress:</strong>';
$i = 0;
$skiptables = array('config', 'user_students', 'user_teachers');
foreach ($tables as $table) {
if (strpos($table,'pma') === 0) { // Not our tables
continue;
}
if (in_array($table, $skiptables)) { // Don't process these
continue;
}
$fulltable = $DB->get_prefix().$table;
if ($columns = $DB->get_columns($table)) {
if (!array_key_exists('id', $columns)) {
continue; // moodle tables have id
}
foreach ($columns as $column => $data) {
if (in_array($data->type, array('text','mediumtext','longtext','varchar'))) { // Text stuff only
// first find candidate records
$sql = "SELECT id, $column FROM $fulltable WHERE $column LIKE '%</lang>%' OR $column LIKE '%<span lang=%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $data) {
$text = $data->$column;
$id = $data->id;
if ($i % 600 == 0) {
echo '<br />';
}
if ($i % 10 == 0) {
echo '.';
}
$i++;
if (empty($text) or is_numeric($text)) {
continue; // nothing to do
}
$search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)+/is';
$newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
if (is_null($newtext)) {
continue; // regex error
}
if ($newtext != $text) {
$DB->execute("UPDATE $fulltable SET $column=? WHERE id=?", array($newtext, $id));
}
}
$rs->close();
}
}
}
}
// set conversion flag - switches to new plugin automatically
set_config('filter_multilang_converted', 1);
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;
function multilangupgrade_impl($langblock) {
$searchtosplit = '/<(?:lang|span) lang="([a-zA-Z0-9_-]*)".*?>(.+?)<\/(?:lang|span)>/is';
preg_match_all($searchtosplit, $langblock[0], $rawlanglist);
$return = '';
foreach ($rawlanglist[1] as $index=>$lang) {
$return .= '<span lang="'.$lang.'" class="multilang">'.$rawlanglist[2][$index].'</span>';
}
return $return;
}
+156
View File
@@ -0,0 +1,156 @@
<?php
if (!isset($CFG)) {
require('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('oacleanup');
echo $OUTPUT->header();
online_assignment_cleanup(true);
echo $OUTPUT->footer();
}
function online_assignment_cleanup($output=false) {
global $CFG, $DB, $OUTPUT;
if ($output) {
echo $OUTPUT->heading('Online Assignment Cleanup');
echo '<center>';
}
/// We don't want to run this code if we are doing an upgrade from an assignment
/// version earlier than 2005041400
/// because the assignment type field will not exist
$amv = $DB->get_field('modules', 'version', array('name'=>'assignment'));
if ((int)$amv < 2005041400) {
if ($output) {
echo '</center>';
}
return;
}
/// get the module id for assignments from db
$arecord = $DB->get_record('modules', array('name', 'assignment'));
$aid = $arecord->id;
/// get a list of all courses on this site
$courses = $DB->get_records('course');
/// cycle through each course
foreach ($courses as $course) {
$fullname = empty($course->fullname) ? 'Course: '.$course->id : $course->fullname;
if ($output) echo $OUTPUT->heading($fullname);
/// retrieve a list of sections beyond what is currently being shown
$sql = "SELECT *
FROM {course_sections}
WHERE course=? AND section>?
ORDER BY section ASC";
$params = array($course->id, $course->numsections);
if (!($xsections = $DB->get_records_sql($sql, $params))) {
if ($output) echo 'No extra sections<br />';
continue;
}
/// cycle through each of the xtra sections
foreach ($xsections as $xsection) {
if ($output) echo 'Checking Section: '.$xsection->section.'<br />';
/// grab any module instances from the sequence field
if (!empty($xsection->sequence)) {
$instances = explode(',', $xsection->sequence);
/// cycle through the instances
foreach ($instances as $instance) {
/// is this an instance of an online assignment
$sql = "SELECT a.id
FROM {course_modules} cm, {assignment} a
WHERE cm.id = ? AND cm.module = ? AND
cm.instance = a.id AND a.assignmenttype = 'online'";
$params = array($instance, $aid);
/// if record exists then we need to move instance to it's correct section
if ($DB->record_exists_sql($sql, $params)) {
/// check the new section id
/// the journal update erroneously stored it in course_sections->section
$newsection = $xsection->section;
/// double check the new section
if ($newsection > $course->numsections) {
/// get the record for section 0 for this course
if (!($zerosection = $DB->get_record('course_sections', array('course'=>$course->id, 'section'=>'0')))) {
continue;
}
$newsection = $zerosection->id;
}
/// grab the section record
if (!($section = $DB->get_record('course_sections', array('id'=>$newsection)))) {
if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. format_string($course->fullname) .'<br />';
continue;
}
/// explode the sequence
if (($sequence = explode(',', $section->sequence)) === false) {
$sequence = array();
}
/// add instance to correct section
array_push($sequence, $instance);
/// implode the sequence
$section->sequence = implode(',', $sequence);
$DB->set_field('course_sections', 'sequence', $section->sequence, array('id'=>$section->id));
/// now we need to remove the instance from the old sequence
/// grab the old section record
if (!($section = $DB->get_record('course_sections', array('id'=>$xsection->id)))) {
if ($output) echo 'Serious error: Cannot retrieve old section: '.$xsection->id.' for course: '.$course->fullname.'<br />';
continue;
}
/// explode the sequence
if (($sequence = explode(',', $section->sequence)) === false) {
$sequence = array();
}
/// remove the old value from the array
$key = array_search($instance, $sequence);
unset($sequence[$key]);
/// implode the sequence
$section->sequence = implode(',', $sequence);
$DB->set_field('course_sections', 'sequence', $section->sequence, array('id'=>$section->id));
if ($output) echo 'Online Assignment (instance '.$instance.') moved from section '.$section->id.': to section '.$newsection.'<br />';
}
}
}
/// if the summary and sequence are empty then remove this section
if (empty($xsection->summary) and empty($xsection->sequence)) {
$DB->delete_records('course_sections', array('id'=>$xsection->id));
if ($output) echo 'Deleting empty section '.$xsection->section.'<br />';
}
}
}
echo '</center>';
}
-46
View File
@@ -1,46 +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/>.
/**
* An oauth2 redirection endpoint which can be used for an application:
* http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
*
* This is used because some oauth servers will not allow a redirect urls
* with get params (like repository callback) and that needs to be called
* using the state param.
*
* @package core
* @copyright 2012 Dan Poltawski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(dirname(__FILE__)).'/config.php');
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
// The state parameter we've given (used in moodle as a redirect url).
$state = required_param('state', PARAM_LOCALURL);
$redirecturl = new moodle_url($state);
$params = $redirecturl->params();
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
redirect($redirecturl);
} else {
print_error('invalidsesskey');
}
-86
View File
@@ -1,86 +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/>.
/**
* Provides an overview of installed plagiarism plugins
*
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to uninstall the plagiarism plugin.
*
* @see http://docs.moodle.org/dev/Plagiarism_API
* @package admin
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('manageplagiarismplugins');
echo $OUTPUT->header();
// Print the table of all installed plagiarism plugins.
$txt = get_strings(array('settings', 'name', 'version'));
$txt->uninstall = get_string('uninstallplugin', 'core_admin');
$plagiarismplugins = core_component::get_plugin_list('plagiarism');
if (empty($plagiarismplugins)) {
echo $OUTPUT->notification(get_string('nopluginsinstalled', 'plagiarism'));
echo $OUTPUT->footer();
exit;
}
echo $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
echo $OUTPUT->box_start('generalbox authsui');
$table = new html_table();
$table->head = array($txt->name, $txt->version, $txt->uninstall, $txt->settings);
$table->colclasses = array('mdl-left', 'mdl-align', 'mdl-align', 'mdl-align');
$table->data = array();
$table->attributes['class'] = 'manageplagiarismtable generaltable';
// Iterate through auth plugins and add to the display table.
$authcount = count($plagiarismplugins);
foreach ($plagiarismplugins as $plugin => $dir) {
if (file_exists($dir.'/settings.php')) {
$displayname = "<span>".get_string($plugin, 'plagiarism_'.$plugin)."</span>";
// Settings link.
$url = new moodle_url("/plagiarism/$plugin/settings.php");
$settings = html_writer::link($url, $txt->settings);
// Get version.
$version = get_config('plagiarism_' . $plugin);
if (!empty($version->version)) {
$version = $version->version;
} else {
$version = '?';
}
// uninstall link.
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $txt->uninstall);
}
$table->data[] = array($displayname, $version, $uninstall, $settings);
}
}
echo html_writer::table($table);
echo get_string('configplagiarismplugins', 'plagiarism');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
-207
View File
@@ -1,207 +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/>.
/**
* UI for general plugins management
*
* Supported HTTP parameters:
*
* ?fetchremote=1 - check for available updates
* ?updatesonly=1 - display plugins with available update only
* ?contribonly=1 - display non-standard add-ons only
* ?uninstall=foo_bar - uninstall the given plugin
* ?delete=foo_bar - delete the plugin folder (it must not be installed)
* &confirm=1 - confirm the uninstall or delete action
*
* @package core
* @subpackage admin
* @copyright 2011 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/filelib.php');
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL);
$contribonly = optional_param('contribonly', false, PARAM_BOOL);
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT);
$delete = optional_param('delete', '', PARAM_COMPONENT);
$confirmed = optional_param('confirm', false, PARAM_BOOL);
$return = optional_param('return', 'overview', PARAM_ALPHA);
// NOTE: do not use admin_externalpage_setup() here because it loads
// full admin tree which is not possible during uninstallation.
require_login();
$syscontext = context_system::instance();
require_capability('moodle/site:config', $syscontext);
$pluginman = core_plugin_manager::instance();
if ($uninstall) {
require_sesskey();
if (!$confirmed) {
admin_externalpage_setup('pluginsoverview');
} else {
$PAGE->set_url('/admin/plugins.php');
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
}
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$pluginfo = $pluginman->get_plugin_info($uninstall);
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_uninstalling_unknown_plugin', 'core_plugin', '', array('plugin' => $uninstall),
'core_plugin_manager::get_plugin_info() returned null for the plugin to be uninstalled');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
$PAGE->set_title($pluginname);
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
if (!$pluginman->can_uninstall_plugin($pluginfo->component)) {
throw new moodle_exception('err_cannot_uninstall_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component),
'core_plugin_manager::can_uninstall_plugin() returned false');
}
if (!$confirmed) {
$continueurl = new moodle_url($PAGE->url, array('uninstall' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1, 'return'=>$return));
$cancelurl = $pluginfo->get_return_url_after_uninstall($return);
echo $output->plugin_uninstall_confirm_page($pluginman, $pluginfo, $continueurl, $cancelurl);
exit();
} else {
$SESSION->pluginuninstallreturn = $pluginfo->get_return_url_after_uninstall($return);
$progress = new progress_trace_buffer(new text_progress_trace(), false);
$pluginman->uninstall_plugin($pluginfo->component, $progress);
$progress->finished();
if ($pluginman->is_plugin_folder_removable($pluginfo->component)) {
$continueurl = new moodle_url($PAGE->url, array('delete' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1));
echo $output->plugin_uninstall_results_removable_page($pluginman, $pluginfo, $progress, $continueurl);
// Reset op code caches.
if (function_exists('opcache_reset')) {
opcache_reset();
}
exit();
} else {
echo $output->plugin_uninstall_results_page($pluginman, $pluginfo, $progress);
// Reset op code caches.
if (function_exists('opcache_reset')) {
opcache_reset();
}
exit();
}
}
}
if ($delete and $confirmed) {
require_sesskey();
$PAGE->set_url('/admin/plugins.php');
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$pluginfo = $pluginman->get_plugin_info($delete);
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_removing_unknown_plugin', 'core_plugin', '', array('plugin' => $delete),
'core_plugin_manager::get_plugin_info() returned null for the plugin to be deleted');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
$PAGE->set_title($pluginname);
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
// Make sure it is not installed.
if (!is_null($pluginfo->versiondb)) {
throw new moodle_exception('err_removing_installed_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'versiondb' => $pluginfo->versiondb),
'core_plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
}
// Make sure the folder is removable.
if (!$pluginman->is_plugin_folder_removable($pluginfo->component)) {
throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir),
'plugin root folder is not removable as expected');
}
// Make sure the folder is within Moodle installation tree.
if (strpos($pluginfo->rootdir, $CFG->dirroot) !== 0) {
throw new moodle_exception('err_unexpected_plugin_rootdir', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir, 'dirroot' => $CFG->dirroot),
'plugin root folder not in the moodle dirroot');
}
// So long, and thanks for all the bugs.
fulldelete($pluginfo->rootdir);
// Reset op code caches.
if (function_exists('opcache_reset')) {
opcache_reset();
}
// We need to execute upgrade to make sure everything including caches is up to date.
redirect(new moodle_url('/admin/index.php'));
}
admin_externalpage_setup('pluginsoverview');
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$checker = \core\update\checker::instance();
// Filtering options.
$options = array(
'updatesonly' => $updatesonly,
'contribonly' => $contribonly,
);
if ($fetchremote) {
require_sesskey();
$checker->fetch();
redirect(new moodle_url($PAGE->url, $options));
}
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
$deployer->initialize($myurl, new moodle_url('/admin'));
$deploydata = $deployer->submitted_data();
if (!empty($deploydata)) {
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
die();
}
}
echo $output->plugin_management_page($pluginman, $checker, $options);
+3 -7
View File
@@ -5,7 +5,7 @@ require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->libdir . '/portfolio/forms.php');
require_once($CFG->libdir . '/adminlib.php');
$portfolio = optional_param('pf', '', PARAM_ALPHANUMEXT);
$portfolio = optional_param('pf', '', PARAM_FORMAT);
$action = optional_param('action', '', PARAM_ALPHA);
$sure = optional_param('sure', '', PARAM_ALPHA);
@@ -35,7 +35,7 @@ if ($action == 'newon') {
admin_externalpage_setup($pagename);
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$baseurl = "$CFG->wwwroot/$CFG->admin/portfolio.php";
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/portfolio.php?sesskey=" . sesskey();
@@ -88,7 +88,6 @@ if (($action == 'edit') || ($action == 'new')) {
} else {
portfolio_static_function($plugin, 'create_instance', $plugin, $fromform->name, $fromform);
}
core_plugin_manager::reset_caches();
$savedstr = get_string('instancesaved', 'portfolio');
redirect($baseurl, $savedstr, 1);
exit;
@@ -117,7 +116,6 @@ if (($action == 'edit') || ($action == 'new')) {
$instance->set('visible', $visible);
$instance->save();
core_plugin_manager::reset_caches();
$return = true;
} else if ($action == 'delete') {
$instance = portfolio_instance($portfolio);
@@ -162,7 +160,7 @@ if (($action == 'edit') || ($action == 'new')) {
$output = $OUTPUT->box_start('generalbox');
$plugins = core_component::get_plugin_list('portfolio');
$plugins = get_plugin_list('portfolio');
$plugins = array_keys($plugins);
$instances = portfolio_instances(false, false);
$usedplugins = array();
@@ -199,7 +197,6 @@ if (($action == 'edit') || ($action == 'new')) {
$currentaction = 'hide';
}
$select = new single_select(portfolio_action_url($pluginid, 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $pluginid);
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$table->data[] = array($pluginname, $OUTPUT->render($select), $settings);
}
if (!in_array($plugin, $usedplugins)) {
@@ -221,7 +218,6 @@ if (($action == 'edit') || ($action == 'new')) {
$insaneplugins[] = $p;
} else {
$select = new single_select(portfolio_action_url($p, 'pf'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . $p);
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$table->data[] = array(portfolio_static_function($p, 'get_name'), $OUTPUT->render($select), '');
}
}
+30 -30
View File
@@ -27,37 +27,37 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
// If we have got here as a confirmed aciton, do it.
if ($confirm && isloggedin() && confirm_sesskey()) {
require_capability('moodle/site:config', context_system::instance());
// Valid request. Purge, and redirect the user back to where they came from.
purge_all_caches();
if ($returnurl) {
$returnurl = $CFG->wwwroot . $returnurl;
} else {
$returnurl = new moodle_url('/admin/purgecaches.php');
}
redirect($returnurl, get_string('purgecachesfinished', 'admin'));
}
// Otherwise, show a button to actually purge the caches.
admin_externalpage_setup('purgecaches');
$actionurl = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
if ($returnurl) {
$actionurl->param('returnurl', $returnurl);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if ($confirm) {
require_sesskey();
// Valid request. Purge, and redisplay the form so it is easy to purge again
// in the near future.
purge_all_caches();
redirect(new moodle_url('/admin/purgecaches.php'), get_string('purgecachesfinished', 'admin'));
} else {
// Show a confirm form.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
$url = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
$button = new single_button($url, get_string('purgecaches','admin'), 'post');
// Cancel button takes them back to the page the were on, if possible,
// otherwise to the site home page.
$return = new moodle_url('/');
if (isset($_SERVER['HTTP_REFERER']) and !empty($_SERVER['HTTP_REFERER'])) {
if ($_SERVER['HTTP_REFERER'] !== "$CFG->wwwroot/$CFG->admin/purgecaches.php") {
$return = $_SERVER['HTTP_REFERER'];
}
}
echo $OUTPUT->confirm(get_string('purgecachesconfirm', 'admin'), $button, $return);
echo $OUTPUT->footer();
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
echo $OUTPUT->box_start('generalbox', 'notice');
echo html_writer::tag('p', get_string('purgecachesconfirm', 'admin'));
echo $OUTPUT->single_button($actionurl, get_string('purgecaches', 'admin'), 'post');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
-241
View File
@@ -1,241 +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 the admin to manage question behaviours.
*
* @package moodlecore
* @subpackage questionengine
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/tablelib.php');
// Check permissions.
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/question:config', $systemcontext);
admin_externalpage_setup('manageqbehaviours');
$thispageurl = new moodle_url('/admin/qbehaviours.php');
$behaviours = core_component::get_plugin_list('qbehaviour');
$pluginmanager = core_plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$counts = $DB->get_records_sql_menu("
SELECT behaviour, COUNT(1)
FROM {question_attempts} GROUP BY behaviour");
$needed = array();
$archetypal = array();
foreach ($behaviours as $behaviour => $notused) {
if (!array_key_exists($behaviour, $counts)) {
$counts[$behaviour] = 0;
}
$needed[$behaviour] = ($counts[$behaviour] > 0) ||
$pluginmanager->other_plugins_that_require('qbehaviour_' . $behaviour);
$archetypal[$behaviour] = question_engine::is_behaviour_archetypal($behaviour);
}
foreach ($counts as $behaviour => $count) {
if (!array_key_exists($behaviour, $behaviours)) {
$counts['missing'] += $count;
}
}
$needed['missing'] = true;
// Work of the correct sort order.
$config = get_config('question');
$sortedbehaviours = array();
foreach ($behaviours as $behaviour => $notused) {
$sortedbehaviours[$behaviour] = question_engine::get_behaviour_name($behaviour);
}
if (!empty($config->behavioursortorder)) {
$sortedbehaviours = question_engine::sort_behaviours($sortedbehaviours,
$config->behavioursortorder, '');
}
if (!empty($config->disabledbehaviours)) {
$disabledbehaviours = explode(',', $config->disabledbehaviours);
} else {
$disabledbehaviours = array();
}
// Process actions ============================================================
// Disable.
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$disable])) {
print_error('unknownbehaviour', 'question', $thispageurl, $disable);
}
if (array_search($disable, $disabledbehaviours) === false) {
$disabledbehaviours[] = $disable;
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
core_plugin_manager::reset_caches();
redirect($thispageurl);
}
// Enable.
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$enable])) {
print_error('unknownbehaviour', 'question', $thispageurl, $enable);
}
if (!$archetypal[$enable]) {
print_error('cannotenablebehaviour', 'question', $thispageurl, $enable);
}
if (($key = array_search($enable, $disabledbehaviours)) !== false) {
unset($disabledbehaviours[$key]);
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
core_plugin_manager::reset_caches();
redirect($thispageurl);
}
// Move up in order.
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$up])) {
print_error('unknownbehaviour', 'question', $thispageurl, $up);
}
// This function works fine for behaviours, as well as qtypes.
$neworder = question_reorder_qtypes($sortedbehaviours, $up, -1);
set_config('behavioursortorder', implode(',', $neworder), 'question');
redirect($thispageurl);
}
// Move down in order.
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$down])) {
print_error('unknownbehaviour', 'question', $thispageurl, $down);
}
// This function works fine for behaviours, as well as qtypes.
$neworder = question_reorder_qtypes($sortedbehaviours, $down, +1);
set_config('behavioursortorder', implode(',', $neworder), 'question');
redirect($thispageurl);
}
// End of process actions ==================================================
// Print the page heading.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('manageqbehaviours', 'admin'));
// Set up the table.
$table = new flexible_table('qbehaviouradmintable');
$table->define_baseurl($thispageurl);
$table->define_columns(array('behaviour', 'numqas', 'version', 'requires',
'available', 'uninstall'));
$table->define_headers(array(get_string('behaviour', 'question'), get_string('numqas', 'question'),
get_string('version'), get_string('requires', 'admin'),
get_string('availableq', 'question'), get_string('uninstallplugin', 'core_admin')));
$table->set_attribute('id', 'qbehaviours');
$table->set_attribute('class', 'generaltable admintable');
$table->setup();
// Add a row for each question type.
foreach ($sortedbehaviours as $behaviour => $behaviourname) {
$row = array();
// Question icon and name.
$row[] = $behaviourname;
// Count
$row[] = $counts[$behaviour];
// Question version number.
$version = get_config('qbehaviour_' . $behaviour, 'version');
if ($version) {
$row[] = $version;
} else {
$row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'disabled'));
}
// Other question types required by this one.
$plugin = $pluginmanager->get_plugin_info('qbehaviour_' . $behaviour);
$required = $plugin->get_other_required_plugins();
if (!empty($required)) {
$strrequired = array();
foreach ($required as $component => $notused) {
$strrequired[] = $pluginmanager->plugin_name($component);
}
$row[] = implode(', ', $strrequired);
} else {
$row[] = '';
}
// Are people allowed to select this behaviour?
$rowclass = '';
if ($archetypal[$behaviour]) {
$enabled = array_search($behaviour, $disabledbehaviours) === false;
$icons = question_behaviour_enable_disable_icons($behaviour, $enabled);
if (!$enabled) {
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
}
// Move icons.
$icons .= question_behaviour_icon_html('up', $behaviour, 't/up', get_string('up'), null);
$icons .= question_behaviour_icon_html('down', $behaviour, 't/down', get_string('down'), null);
$row[] = $icons;
// Delete link, if available.
if ($needed[$behaviour]) {
$row[] = '';
} else {
$uninstallurl = core_plugin_manager::instance()->get_uninstall_url('qbehaviour_'.$behaviour, 'manage');
if ($uninstallurl) {
$row[] = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'),
array('title' => get_string('uninstallbehaviour', 'question')));
}
}
$table->add_data($row, $rowclass);
}
$table->finish_output();
echo $OUTPUT->footer();
function question_behaviour_enable_disable_icons($behaviour, $enabled) {
if ($enabled) {
return question_behaviour_icon_html('disable', $behaviour, 't/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_behaviour_icon_html('enable', $behaviour, 't/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
function question_behaviour_icon_html($action, $behaviour, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
array($action => $behaviour, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
}
+102 -49
View File
@@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -32,34 +31,35 @@ require_once($CFG->libdir . '/tablelib.php');
// Check permissions.
require_login();
$systemcontext = context_system::instance();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/question:config', $systemcontext);
$canviewreports = has_capability('report/questioninstances:view', $systemcontext);
admin_externalpage_setup('manageqtypes');
$thispageurl = new moodle_url('/admin/qtypes.php');
$qtypes = question_bank::get_all_qtypes();
$pluginmanager = core_plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$counts = $DB->get_records_sql("
SELECT qtype, COUNT(1) as numquestions, SUM(hidden) as numhidden
FROM {question} GROUP BY qtype", array());
$needed = array();
foreach ($qtypes as $qtypename => $qtype) {
foreach ($QTYPES as $qtypename => $qtype) {
if (!isset($counts[$qtypename])) {
$counts[$qtypename] = new stdClass;
$counts[$qtypename]->numquestions = 0;
$counts[$qtypename]->numhidden = 0;
}
$needed[$qtypename] = $counts[$qtypename]->numquestions > 0 ||
$pluginmanager->other_plugins_that_require($qtype->plugin_name());
$needed[$qtypename] = $counts[$qtypename]->numquestions > 0;
$counts[$qtypename]->numquestions -= $counts[$qtypename]->numhidden;
}
$needed['missingtype'] = true; // The system needs the missing question type.
foreach ($QTYPES as $qtypename => $qtype) {
foreach ($qtype->requires_qtypes() as $reqtype) {
$needed[$reqtype] = true;
}
}
foreach ($counts as $qtypename => $count) {
if (!isset($qtypes[$qtypename])) {
if (!isset($QTYPES[$qtypename])) {
$counts['missingtype']->numquestions += $count->numquestions - $count->numhidden;
$counts['missingtype']->numhidden += $count->numhidden;
}
@@ -68,16 +68,16 @@ foreach ($counts as $qtypename => $count) {
// Work of the correct sort order.
$config = get_config('question');
$sortedqtypes = array();
foreach ($qtypes as $qtypename => $qtype) {
foreach ($QTYPES as $qtypename => $qtype) {
$sortedqtypes[$qtypename] = $qtype->local_name();
}
$sortedqtypes = question_bank::sort_qtype_array($sortedqtypes, $config);
$sortedqtypes = question_sort_qtype_array($sortedqtypes, $config);
// Process actions ============================================================
// Disable.
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$disable])) {
if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (!isset($QTYPES[$disable])) {
print_error('unknownquestiontype', 'question', $thispageurl, $disable);
}
@@ -86,12 +86,12 @@ if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey(
}
// Enable.
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$enable])) {
if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (!isset($QTYPES[$enable])) {
print_error('unknownquestiontype', 'question', $thispageurl, $enable);
}
if (!$qtypes[$enable]->menu_name()) {
if (!$QTYPES[$enable]->menu_name()) {
print_error('cannotenable', 'question', $thispageurl, $enable);
}
@@ -100,8 +100,8 @@ if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey())
}
// Move up in order.
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$up])) {
if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (!isset($QTYPES[$up])) {
print_error('unknownquestiontype', 'question', $thispageurl, $up);
}
@@ -111,8 +111,8 @@ if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
}
// Move down in order.
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$down])) {
if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (!isset($QTYPES[$down])) {
print_error('unknownquestiontype', 'question', $thispageurl, $down);
}
@@ -121,6 +121,63 @@ if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
redirect($thispageurl);
}
// Delete.
if (($delete = optional_param('delete', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
// Check it is OK to delete this question type.
if ($delete == 'missingtype') {
print_error('cannotdeletemissingqtype', 'admin', $thispageurl);
}
if (!isset($QTYPES[$delete])) {
print_error('unknownquestiontype', 'question', $thispageurl, $delete);
}
$qtypename = $QTYPES[$delete]->local_name();
if ($counts[$delete]->numquestions + $counts[$delete]->numhidden > 0) {
print_error('cannotdeleteqtypeinuse', 'admin', $thispageurl, $qtypename);
}
if ($needed[$delete] > 0) {
print_error('cannotdeleteqtypeneeded', 'admin', $thispageurl, $qtypename);
}
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
$qtypename = $QTYPES[$delete]->local_name();
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deleteqtypeareyousure', 'admin', $qtypename));
echo $OUTPUT->confirm(get_string('deleteqtypeareyousuremessage', 'admin', $qtypename),
new moodle_url($thispageurl, array('delete' => $delete, 'confirm' => 1)),
$thispageurl);
echo $OUTPUT->footer();
exit;
}
// Do the deletion.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deletingqtype', 'admin', $qtypename));
// Delete any configuration records.
if (!unset_all_config_for_plugin('qtype_' . $delete)) {
echo $OUTPUT->notification(get_string('errordeletingconfig', 'admin', 'qtype_' . $delete));
}
unset_config($delete . '_disabled', 'question');
unset_config($delete . '_sortorder', 'question');
// Then the tables themselves
drop_plugin_tables($delete, $QTYPES[$delete]->plugin_dir() . '/db/install.xml', false);
// Remove event handlers and dequeue pending events
events_uninstall('qtype/' . $delete);
$a->qtype = $qtypename;
$a->directory = $QTYPES[$delete]->plugin_dir();
echo $OUTPUT->box(get_string('qtypedeletefiles', 'admin', $a), 'generalbox', 'notice');
echo $OUTPUT->continue_button($thispageurl);
echo $OUTPUT->footer();
exit;
}
// End of process actions ==================================================
// Print the page heading.
@@ -131,18 +188,18 @@ echo $OUTPUT->heading(get_string('manageqtypes', 'admin'));
$table = new flexible_table('qtypeadmintable');
$table->define_baseurl($thispageurl);
$table->define_columns(array('questiontype', 'numquestions', 'version', 'requires',
'availableto', 'uninstall', 'settings'));
$table->define_headers(array(get_string('questiontype', 'question'), get_string('numquestions', 'question'),
'availableto', 'delete', 'settings'));
$table->define_headers(array(get_string('questiontype', 'admin'), get_string('numquestions', 'admin'),
get_string('version'), get_string('requires', 'admin'), get_string('availableq', 'question'),
get_string('settings'), get_string('uninstallplugin', 'core_admin')));
get_string('delete'), get_string('settings')));
$table->set_attribute('id', 'qtypes');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
// Add a row for each question type.
$createabletypes = question_bank::get_creatable_qtypes();
$createabletypes = question_type_menu();
foreach ($sortedqtypes as $qtypename => $localname) {
$qtype = $qtypes[$qtypename];
$qtype = $QTYPES[$qtypename];
$row = array();
// Question icon and name.
@@ -154,12 +211,12 @@ foreach ($sortedqtypes as $qtypename => $localname) {
// Number of questions of this type.
if ($counts[$qtypename]->numquestions + $counts[$qtypename]->numhidden > 0) {
if ($counts[$qtypename]->numhidden > 0) {
$strcount = get_string('numquestionsandhidden', 'question', $counts[$qtypename]);
$strcount = get_string('numquestionsandhidden', 'admin', $counts[$qtypename]);
} else {
$strcount = $counts[$qtypename]->numquestions;
}
if ($canviewreports) {
$row[] = html_writer::link(new moodle_url('/report/questioninstances/index.php',
$row[] = html_writer::link(new moodle_url('/admin/report/questioninstances/index.php',
array('qtype' => $qtypename)), $strcount, array('title' => get_string('showdetails', 'admin')));
} else {
$strcount;
@@ -177,12 +234,11 @@ foreach ($sortedqtypes as $qtypename => $localname) {
}
// Other question types required by this one.
$plugin = $pluginmanager->get_plugin_info($qtype->plugin_name());
$requiredtypes = $plugin->get_other_required_plugins();
$requiredtypes = $qtype->requires_qtypes();
$strtypes = array();
if (!empty($requiredtypes)) {
foreach ($requiredtypes as $required => $notused) {
$strtypes[] = $pluginmanager->plugin_name($required);
foreach ($requiredtypes as $required) {
$strtypes[] = $QTYPES[$required]->local_name();
}
$row[] = implode(', ', $strtypes);
} else {
@@ -198,7 +254,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer();
$icons = $OUTPUT->spacer() . ' ';
}
// Move icons.
@@ -206,6 +262,15 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$icons .= question_type_icon_html('down', $qtypename, 't/down', get_string('down'), '');
$row[] = $icons;
// Delete link, if available.
if ($needed[$qtypename]) {
$row[] = '';
} else {
$row[] = html_writer::link(new moodle_url($thispageurl,
array('delete' => $qtypename, 'sesskey' => sesskey())), get_string('delete'),
array('title' => get_string('uninstallqtype', 'admin')));
}
// Settings link, if available.
$settings = admin_get_root()->locate('qtypesetting' . $qtypename);
if ($settings instanceof admin_externalpage) {
@@ -217,17 +282,6 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$row[] = '';
}
// Uninstall link, if available.
if ($needed[$qtypename]) {
$row[] = '';
} else {
$uninstallurl = core_plugin_manager::instance()->get_uninstall_url('qtype_'.$qtypename, 'manage');
if ($uninstallurl) {
$row[] = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'),
array('title' => get_string('uninstallqtype', 'question')));
}
}
$table->add_data($row, $rowclass);
}
@@ -237,10 +291,10 @@ echo $OUTPUT->footer();
function question_types_enable_disable_icons($qtypename, $createable) {
if ($createable) {
return question_type_icon_html('disable', $qtypename, 't/hide',
return question_type_icon_html('disable', $qtypename, 'i/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_type_icon_html('enable', $qtypename, 't/show',
return question_type_icon_html('enable', $qtypename, 'i/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
@@ -249,7 +303,6 @@ function question_type_icon_html($action, $qtypename, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
array($action => $qtypename, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
null, array('title' => $tip)) . ' ';
}
+1 -1
View File
@@ -44,7 +44,7 @@ $hubname = optional_param('hubname', '', PARAM_TEXT);
$token = optional_param('token', '', PARAM_TEXT);
$error = optional_param('error', '', PARAM_ALPHANUM);
admin_externalpage_setup('registrationhubs');
admin_externalpage_setup('registrationindex');
if (!empty($error) and $error == 'urlalreadyexist') {
throw new moodle_exception('urlalreadyregistered', 'hub',
+46 -89
View File
@@ -49,10 +49,8 @@ class site_unregistration_form extends moodleform {
$unregisterlabel = get_string('unregister', 'hub');
$mform->addElement('checkbox', 'unpublishalladvertisedcourses', '',
' ' . get_string('unpublishalladvertisedcourses', 'hub'));
$mform->setType('unpublishalladvertisedcourses', PARAM_INT);
$mform->addElement('checkbox', 'unpublishalluploadedcourses', '',
' ' . get_string('unpublishalluploadedcourses', 'hub'));
$mform->setType('unpublishalluploadedcourses', PARAM_INT);
$mform->addElement('hidden', 'confirm', 1);
$mform->setType('confirm', PARAM_INT);
@@ -84,6 +82,7 @@ class site_clean_registration_data_form extends moodleform {
$unregisterlabel = get_string('forceunregister', 'hub');
$mform->addElement('static', '', get_string('warning', 'hub'), get_string('forceunregisterconfirmation', 'hub', $hubname));
$mform->addElement('hidden', 'confirm', 1);
$mform->setType('confirm', PARAM_INT);
$mform->addElement('hidden', 'unregistration', 1);
@@ -137,8 +136,8 @@ class hub_selector_form extends moodleform {
$options = array();
foreach ($hubs as $hub) {
//to not display a name longer than 100 character (too big)
if (core_text::strlen($hub['name']) > 100) {
$hubname = core_text::substr($hub['name'], 0, 100);
if (strlen($hub['name']) > 100) {
$hubname = substr($hub['name'], 0, 100);
$hubname = $hubname . "...";
} else {
$hubname = $hub['name'];
@@ -150,7 +149,6 @@ class hub_selector_form extends moodleform {
if (!empty($hubs)) {
$mform->addElement('select', 'publichub', get_string('publichub', 'hub'),
$options, array("size" => 15));
$mform->setType('publichub', PARAM_URL);
}
$mform->addElement('static', 'or', '', get_string('orenterprivatehub', 'hub'));
@@ -158,10 +156,8 @@ class hub_selector_form extends moodleform {
//Private hub
$mform->addElement('text', 'unlistedurl', get_string('privatehuburl', 'hub'),
array('class' => 'registration_textfield'));
$mform->setType('unlistedurl', PARAM_URL);
$mform->addElement('text', 'password', get_string('password'),
array('class' => 'registration_textfield'));
$mform->setType('password', PARAM_RAW);
$this->add_action_buttons(false, get_string('selecthub', 'hub'));
}
@@ -175,8 +171,11 @@ class hub_selector_form extends moodleform {
$unlistedurl = $this->_form->_submitValues['unlistedurl'];
if (empty($unlistedurl)) {
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
if (!empty($unlistedurl)) {
$unlistedurltotest = clean_param($unlistedurl, PARAM_URL);
if (empty($unlistedurltotest)) {
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
}
}
return $errors;
@@ -204,7 +203,7 @@ class site_registration_form extends moodleform {
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
$sitename = get_config('hub', 'site_name_' . $cleanhuburl);
if ($sitename === false) {
$sitename = format_string($site->fullname, true, array('context' => context_course::instance(SITEID)));
$sitename = $site->fullname;
}
$sitedescription = get_config('hub', 'site_description_' . $cleanhuburl);
if ($sitedescription === false) {
@@ -237,18 +236,13 @@ class site_registration_form extends moodleform {
$geolocation = get_config('hub', 'site_geolocation_' . $cleanhuburl);
$contactable = get_config('hub', 'site_contactable_' . $cleanhuburl);
$emailalert = get_config('hub', 'site_emailalert_' . $cleanhuburl);
$emailalert = ($emailalert === 0) ? 0 : 1;
$coursesnumber = get_config('hub', 'site_coursesnumber_' . $cleanhuburl);
$usersnumber = get_config('hub', 'site_usersnumber_' . $cleanhuburl);
$roleassignmentsnumber = get_config('hub', 'site_roleassignmentsnumber_' . $cleanhuburl);
$postsnumber = get_config('hub', 'site_postsnumber_' . $cleanhuburl);
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
$badgesnumber = get_config('hub', 'site_badges_' . $cleanhuburl);
$issuedbadgesnumber = get_config('hub', 'site_issuedbadges_' . $cleanhuburl);
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
//hidden parameters
$mform->addElement('hidden', 'huburl', $huburl);
@@ -275,7 +269,6 @@ class site_registration_form extends moodleform {
$options[HUB_SITELINKPUBLISHED] = $registrationmanager->get_site_privacy_string(HUB_SITELINKPUBLISHED);
$mform->addElement('select', 'privacy', get_string('siteprivacy', 'hub'), $options);
$mform->setDefault('privacy', $privacy);
$mform->setType('privacy', PARAM_ALPHA);
$mform->addHelpButton('privacy', 'privacy', 'hub');
unset($options);
@@ -286,14 +279,27 @@ class site_registration_form extends moodleform {
$mform->setType('description', PARAM_TEXT);
$mform->addHelpButton('description', 'sitedesc', 'hub');
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
$languages = get_string_manager()->get_list_of_languages();
core_collator::asort($languages);
textlib_get_instance()->asort($languages);
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
$languages);
$mform->setType('language', PARAM_ALPHANUMEXT);
$mform->addHelpButton('language', 'sitelang', 'hub');
$mform->setDefault('language', $language);
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
$mform->addElement('hidden', 'moodleversion', $CFG->version);
$mform->setType('moodleversion', PARAM_INT);
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
$mform->setType('moodlerelease', PARAM_TEXT);
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
$mform->addElement('textarea', 'address', get_string('postaladdress', 'hub'),
array('rows' => 4, 'cols' => 41));
$mform->setType('address', PARAM_TEXT);
@@ -309,13 +315,11 @@ class site_registration_form extends moodleform {
$countries = get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'countrycode', get_string('sitecountry', 'hub'), $countries);
$mform->setDefault('countrycode', $country);
$mform->setType('countrycode', PARAM_ALPHANUMEXT);
$mform->addHelpButton('countrycode', 'sitecountry', 'hub');
$mform->addElement('text', 'geolocation', get_string('sitegeolocation', 'hub'),
array('class' => 'registration_textfield'));
$mform->setDefault('geolocation', $geolocation);
$mform->setType('geolocation', PARAM_RAW);
$mform->addHelpButton('geolocation', 'sitegeolocation', 'hub');
$mform->addElement('text', 'contactname', get_string('siteadmin', 'hub'),
@@ -333,7 +337,7 @@ class site_registration_form extends moodleform {
$mform->addElement('text', 'contactemail', get_string('siteemail', 'hub'),
array('class' => 'registration_textfield'));
$mform->addRule('contactemail', $strrequired, 'required', null, 'client');
$mform->setType('contactemail', PARAM_EMAIL);
$mform->setType('contactemail', PARAM_TEXT);
$mform->setDefault('contactemail', $contactemail);
$mform->addHelpButton('contactemail', 'siteemail', 'hub');
@@ -342,7 +346,6 @@ class site_registration_form extends moodleform {
$options[1] = get_string("registrationcontactyes");
$mform->addElement('select', 'contactable', get_string('siteregistrationcontact', 'hub'), $options);
$mform->setDefault('contactable', $contactable);
$mform->setType('contactable', PARAM_INT);
$mform->addHelpButton('contactable', 'siteregistrationcontact', 'hub');
unset($options);
@@ -351,27 +354,12 @@ class site_registration_form extends moodleform {
$options[1] = get_string("registrationyes");
$mform->addElement('select', 'emailalert', get_string('siteregistrationemail', 'hub'), $options);
$mform->setDefault('emailalert', $emailalert);
$mform->setType('emailalert', PARAM_INT);
$mform->addHelpButton('emailalert', 'siteregistrationemail', 'hub');
unset($options);
//TODO site logo
$mform->addElement('hidden', 'imageurl', ''); //TODO: temporary
$mform->setType('imageurl', PARAM_URL);
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
$mform->addElement('hidden', 'moodleversion', $CFG->version);
$mform->setType('moodleversion', PARAM_INT);
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
$mform->setType('moodlerelease', PARAM_TEXT);
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
/// Display statistic that are going to be retrieve by the hub
$coursecount = $DB->count_records('course') - 1;
$usercount = $DB->count_records('user', array('deleted' => 0));
@@ -382,111 +370,80 @@ class site_registration_form extends moodleform {
require_once($CFG->dirroot . "/course/lib.php");
$participantnumberaverage = number_format(average_number_of_participants(), 2);
$modulenumberaverage = number_format(average_number_of_courses_modules(), 2);
require_once($CFG->libdir . '/badgeslib.php');
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
$issuedbadges = $DB->count_records('badge_issued');
if (HUB_MOODLEORGHUBURL != $huburl) {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->setDefault('courses', $coursesnumber != -1);
$mform->setType('courses', PARAM_INT);
$mform->setDefault('courses', true);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->setDefault('users', $usersnumber != -1);
$mform->setType('users', PARAM_INT);
$mform->setDefault('users', true);
$mform->addElement('checkbox', 'roleassignments', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
$mform->setType('roleassignments', PARAM_INT);
$mform->setDefault('roleassignments', true);
$mform->addElement('checkbox', 'posts', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->setDefault('posts', $postsnumber != -1);
$mform->setType('posts', PARAM_INT);
$mform->setDefault('posts', true);
$mform->addElement('checkbox', 'questions', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->setDefault('questions', $questionsnumber != -1);
$mform->setType('questions', PARAM_INT);
$mform->setDefault('questions', true);
$mform->addElement('checkbox', 'resources', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->setDefault('resources', $resourcesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('checkbox', 'badges', '',
" " . get_string('badgesnumber', 'hub', $badges));
$mform->setDefault('badges', $badgesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('checkbox', 'issuedbadges', '',
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
$mform->setDefault('issuedbadges', $issuedbadgesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->setDefault('resources', true);
$mform->addElement('checkbox', 'participantnumberaverage', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
$mform->setType('participantnumberaverage', PARAM_FLOAT);
$mform->setDefault('participantnumberaverage', true);
$mform->addElement('checkbox', 'modulenumberaverage', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
$mform->setType('modulenumberaverage', PARAM_FLOAT);
$mform->setDefault('modulenumberaverage', true);
} else {
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->addElement('hidden', 'courses', 1);
$mform->setType('courses', PARAM_INT);
$mform->addElement('hidden', 'courses', true);
$mform->setType('courses', PARAM_FLOAT);
$mform->addHelpButton('courseslabel', 'sendfollowinginfo', 'hub');
$mform->addElement('static', 'userslabel', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->addElement('hidden', 'users', 1);
$mform->setType('users', PARAM_INT);
$mform->addElement('hidden', 'users', true);
$mform->setType('users', PARAM_FLOAT);
$mform->addElement('static', 'roleassignmentslabel', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->addElement('hidden', 'roleassignments', 1);
$mform->setType('roleassignments', PARAM_INT);
$mform->addElement('hidden', 'roleassignments', true);
$mform->setType('roleassignments', PARAM_FLOAT);
$mform->addElement('static', 'postslabel', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->addElement('hidden', 'posts', 1);
$mform->setType('posts', PARAM_INT);
$mform->addElement('hidden', 'posts', true);
$mform->setType('posts', PARAM_FLOAT);
$mform->addElement('static', 'questionslabel', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->addElement('hidden', 'questions', 1);
$mform->setType('questions', PARAM_INT);
$mform->addElement('hidden', 'questions', true);
$mform->setType('questions', PARAM_FLOAT);
$mform->addElement('static', 'resourceslabel', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->addElement('hidden', 'resources', 1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('static', 'badgeslabel', '',
" " . get_string('badgesnumber', 'hub', $badges));
$mform->addElement('hidden', 'badges', 1);
$mform->setType('badges', PARAM_INT);
$mform->addElement('static', 'issuedbadgeslabel', '',
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
$mform->addElement('hidden', 'issuedbadges', true);
$mform->setType('issuedbadges', PARAM_INT);
$mform->addElement('hidden', 'resources', true);
$mform->setType('resources', PARAM_FLOAT);
$mform->addElement('static', 'participantnumberaveragelabel', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->addElement('hidden', 'participantnumberaverage', 1);
$mform->addElement('hidden', 'participantnumberaverage', true);
$mform->setType('participantnumberaverage', PARAM_FLOAT);
$mform->addElement('static', 'modulenumberaveragelabel', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->addElement('hidden', 'modulenumberaverage', 1);
$mform->addElement('hidden', 'modulenumberaverage', true);
$mform->setType('modulenumberaverage', PARAM_FLOAT);
}
+68
View File
@@ -0,0 +1,68 @@
<?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/>.
/*
* @package moodle
* @subpackage registration
* @author Jerome Mouneyrac <jerome@mouneyrac.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* Thsi page displays a hub selector or a hub URL + password. Then it will redirect to
* the site registration form (with the selected hub as parameter)
*/
require('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/forms.php');
admin_externalpage_setup('registrationselector');
$hubselectorform = new hub_selector_form();
$fromform = $hubselectorform->get_data();
//// Redirect to the registration form if an URL has been choosen ////
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
$password = optional_param('password', '', PARAM_RAW);
if (!empty($unlistedhuburl)) {
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
$huburl = $unlistedhuburl;
}
} else if (!empty($selectedhuburl)) {
$huburl = $selectedhuburl;
}
//redirect
if (!empty($huburl) and confirm_sesskey()) {
$hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
$params = array('sesskey' => sesskey(), 'huburl' => $huburl,
'password' => $password, 'hubname' => $hubname);
redirect(new moodle_url($CFG->wwwroot."/" . $CFG->admin . "/registration/register.php",
$params));
}
//// OUTPUT ////
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
$hubselectorform->display();
echo $OUTPUT->footer();
+11 -56
View File
@@ -22,9 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* On this page the administrator selects which hub he wants to register,
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs, including MOOCH.
* On this page the administrator select if he wants to register on Moodle.org or
* a specific hub
*/
require('../../config.php');
@@ -35,7 +34,7 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/course/publish/lib.php');
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
admin_externalpage_setup('registrationhubs');
admin_externalpage_setup('registrationindex');
$renderer = $PAGE->get_renderer('core', 'register');
@@ -127,15 +126,13 @@ if (empty($cancel) and $unregistration and $confirm and confirm_sesskey()) {
}
}
echo $OUTPUT->header();
//do not check sesskey if confirm = false because this script is linked into email message
if (!empty($errormessage)) {
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
}
if (empty($cancel) and $unregistration and !$confirm) {
echo $OUTPUT->header();
//do not check sesskey if confirm = false because this script is linked into email message
if (!empty($errormessage)) {
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
}
$hub = $registrationmanager->get_registeredhub($huburl);
echo $OUTPUT->heading(get_string('unregisterfrom', 'hub', $hub->hubname), 3, 'main');
if ($cleanregdata) {
@@ -145,7 +142,6 @@ if (empty($cancel) and $unregistration and !$confirm) {
$siteunregistrationform = new site_unregistration_form('',
array('huburl' => $huburl, 'hubname' => $hub->hubname));
}
$siteunregistrationform->display();
} else {
$registeredonmoodleorg = false;
@@ -154,49 +150,8 @@ if (empty($cancel) and $unregistration and !$confirm) {
$registeredonmoodleorg = true;
}
// load the hub selector form
$hubselectorform = new hub_selector_form();
$fromform = $hubselectorform->get_data();
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
$password = optional_param('password', '', PARAM_RAW);
$registeringhuburl = null;
if (!empty($unlistedhuburl)) {
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
$registeringhuburl = $unlistedhuburl;
}
} else if (!empty($selectedhuburl)) {
$registeringhuburl = $selectedhuburl;
}
// a hub has been selected, redirect to the hub registration page
if (empty($cancel) and !empty($registeringhuburl) and confirm_sesskey()) {
$hubname = optional_param(clean_param($registeringhuburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
$params = array('sesskey' => sesskey(), 'huburl' => $registeringhuburl,
'password' => $password, 'hubname' => $hubname);
redirect(new moodle_url($CFG->wwwroot . "/" . $CFG->admin . "/registration/register.php",
$params));
}
echo $OUTPUT->header();
//check if the site is registered on Moodle.org and display a message about registering on MOOCH
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
if (empty($registered)) {
$warningmsg = get_string('registermoochtips', 'hub');
$warningmsg .= $renderer->single_button(new moodle_url('register.php', array('huburl' => HUB_MOODLEORGHUBURL
, 'hubname' => 'Moodle.org')), get_string('register', 'admin'));
echo $renderer->box($warningmsg, 'buttons mdl-align generalbox adminwarning');
}
//do not check sesskey if confirm = false because this script is linked into email message
if (!empty($errormessage)) {
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
}
echo $OUTPUT->heading(get_string('registerwith', 'hub'));
$hubselectorform->display();
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
echo $renderer->registrationselector($registeredonmoodleorg);
if (extension_loaded('xmlrpc')) {
$hubs = $registrationmanager->get_registered_on_hubs();
-14
View File
@@ -247,20 +247,6 @@ class registration_manager {
$resourcecount = $DB->count_records('resource');
}
$siteinfo['resources'] = $resourcecount;
// Badge statistics.
require_once($CFG->libdir . '/badgeslib.php');
if (get_config('hub', 'site_badges_' . $cleanhuburl) == -1) {
$badges = -1;
} else {
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
}
$siteinfo['badges'] = $badges;
if (get_config('hub', 'site_issuedbadges_' . $cleanhuburl) == -1) {
$issuedbadges = -1;
} else {
$issuedbadges = $DB->count_records('badge_issued');
}
$siteinfo['issuedbadges'] = $issuedbadges;
//TODO
require_once($CFG->dirroot . "/course/lib.php");
if (get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl) == -1) {
+7 -44
View File
@@ -27,7 +27,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* This page displays the site registration form for Moodle.org/MOOCH or for a different hub.
* This page displays the site registration form.
* It handles redirection to the hub to continue the registration workflow process.
* It also handles update operation by web service.
*/
@@ -39,17 +39,15 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
admin_externalpage_setup('registrationindex');
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
if ($huburl == HUB_MOODLEORGHUBURL) { // register to Moodle.org
admin_externalpage_setup('registrationmoodleorg');
} else { //register to a hub
admin_externalpage_setup('registrationhub');
}
$password = optional_param('password', '', PARAM_TEXT);
$hubname = optional_param('hubname', '', PARAM_TEXT);
if (!confirm_sesskey()) {
throw new moodle_exception('missingparameter');
}
$registrationmanager = new registration_manager();
@@ -62,18 +60,7 @@ $siteregistrationform = new site_registration_form('',
$fromform = $siteregistrationform->get_data();
if (!empty($fromform) and confirm_sesskey()) {
// Set to -1 all optional data marked as "don't send" by the admin.
// The function get_site_info() will not calculate the optional data if config is set to -1.
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
'badges', 'issuedbadges', 'modulenumberaverage', 'participantnumberaverage');
foreach ($inputnames as $inputname) {
if (empty($fromform->{$inputname})) {
$fromform->{$inputname} = -1;
}
}
// Save the settings.
//save the settings
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
@@ -95,8 +82,6 @@ if (!empty($fromform) and confirm_sesskey()) {
set_config('site_postsnumber_' . $cleanhuburl, $fromform->posts, 'hub');
set_config('site_questionsnumber_' . $cleanhuburl, $fromform->questions, 'hub');
set_config('site_resourcesnumber_' . $cleanhuburl, $fromform->resources, 'hub');
set_config('site_badges_' . $cleanhuburl, $fromform->badges, 'hub');
set_config('site_issuedbadges_' . $cleanhuburl, $fromform->issuedbadges, 'hub');
set_config('site_modulenumberaverage_' . $cleanhuburl, $fromform->modulenumberaverage, 'hub');
set_config('site_participantnumberaverage_' . $cleanhuburl, $fromform->participantnumberaverage, 'hub');
}
@@ -126,21 +111,6 @@ if ($update and confirm_sesskey()) {
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
// Retrieve the optional info (specially course number, user number, module number average...).
$siteinfo = $registrationmanager->get_site_info($huburl);
$fromform->courses = $siteinfo['courses'];
$fromform->users = $siteinfo['users'];
$fromform->enrolments = $siteinfo['enrolments'];
$fromform->posts = $siteinfo['posts'];
$fromform->questions = $siteinfo['questions'];
$fromform->resources = $siteinfo['resources'];
$fromform->badges = $siteinfo['badges'];
$fromform->issuedbadges = $siteinfo['issuedbadges'];
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
$fromform->street = $siteinfo['street'];
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
@@ -175,12 +145,5 @@ if (!empty($error)) {
echo $error;
}
//some Moodle.org resitration explanation
if ($huburl == HUB_MOODLEORGHUBURL) {
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
echo $renderer->moodleorg_registration_message();
}
$siteregistrationform->display();
echo $OUTPUT->footer();
+52 -18
View File
@@ -30,23 +30,6 @@
*/
class core_register_renderer extends plugin_renderer_base {
/**
* Display Moodle.org registration message about benefit to register on Moodle.org
*
* @return string
*/
public function moodleorg_registration_message() {
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, get_string('moodleorghubname', 'admin'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
get_string('registermoodleorgli3', 'admin', $moochurl));
$moodleorgregmsg .= html_writer::alist($items);
return $moodleorgregmsg;
}
/**
* Display a box message confirming a site registration (add or update)
* @param string $confirmationmessage
@@ -59,6 +42,57 @@ class core_register_renderer extends plugin_renderer_base {
return $this->output->box($message);
}
/**
* Display the page to register on Moodle.org or on a specific hub
*/
public function registrationselector($updatemoodleorg = false) {
global $CFG;
$table = new html_table();
$table->head = array(get_string('moodleorg', 'hub'), get_string('specifichub', 'hub'));
$table->size = array('50%', '50%');
//$table->attributes['class'] = 'registerindextable';
//Moodle.org information cell
$moodleorgcell = get_string('moodleorgregistrationdetail', 'hub');
$moodleorgcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
$moodleorgcell = html_writer::tag('div', $moodleorgcell, array('class' => 'justifytext'));
//Specific hub information cell
$specifichubcell = get_string('specifichubregistrationdetail', 'hub');
$specifichubcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
$specifichubcell = html_writer::tag('div', $specifichubcell, array('class' => 'justifytext'));
//add information cells
$cells = array($moodleorgcell, $specifichubcell);
$row = new html_table_row($cells);
$table->data[] = $row;
//Moodle.org button cell
$registeronmoodleorgurl = new moodle_url("/" . $CFG->admin . "/registration/register.php",
array('sesskey' => sesskey(), 'huburl' => HUB_MOODLEORGHUBURL
, 'hubname' => 'Moodle.org'));
$registeronmoodleorgbutton = new single_button($registeronmoodleorgurl,
$updatemoodleorg ? get_string('updatesite', 'hub', 'Moodle.org') : get_string('registeronmoodleorg', 'hub'));
$registeronmoodleorgbutton->class = 'centeredbutton';
$registeronmoodleorgbuttonhtml = $this->output->render($registeronmoodleorgbutton);
$moodleorgcell = $registeronmoodleorgbuttonhtml;
//Specific hub button cell
$registeronspecifichuburl = new moodle_url("/" . $CFG->admin . "/registration/hubselector.php",
array('sesskey' => sesskey()));
$registeronspecifichubbutton = new single_button($registeronspecifichuburl,
get_string('registeronspecifichub', 'hub'));
$registeronspecifichubbutton->class = 'centeredbutton';
$registeronspecifichubbuttonhtml = $this->output->render($registeronspecifichubbutton);
$specifichubcell = $registeronspecifichubbuttonhtml;
//add button cells
$cells = array($moodleorgcell, $specifichubcell);
$row = new html_table_row($cells);
$table->data[] = $row;
return html_writer::table($table);
}
/**
* Display the listing of registered on hub
*/
@@ -92,4 +126,4 @@ class core_register_renderer extends plugin_renderer_base {
return html_writer::table($table);
}
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ $url = optional_param('url', '', PARAM_URL);
$hubname = optional_param('hubname', '', PARAM_TEXT);
$token = optional_param('token', '', PARAM_TEXT);
admin_externalpage_setup('registrationhubs');
admin_externalpage_setup('registrationindex');
//check that we are waiting a confirmation from this hub, and check that the token is correct
$registrationmanager = new registration_manager();
-1529
View File
File diff suppressed because it is too large Load Diff
+59
View File
@@ -0,0 +1,59 @@
<?php
/// Search and replace strings throughout all texts in the whole database
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('replace');
$search = optional_param('search', '', PARAM_RAW);
$replace = optional_param('replace', '', PARAM_RAW);
$sure = optional_param('sure', 0, PARAM_BOOL);
###################################################################
echo $OUTPUT->header();
echo $OUTPUT->heading('Search and replace text throughout the whole database');
if ($DB->get_dbfamily() !== 'mysql' and $DB->get_dbfamily() !== 'postgres') {
//TODO: add $DB->text_replace() to DML drivers
echo $OUTPUT->notification('Sorry, this feature is implemented only for MySQL and PostgreSQL databases.');
echo $OUTPUT->footer();
die;
}
if (!data_submitted() or !$search or !$replace or !confirm_sesskey() or !$sure) { /// Print a form
echo $OUTPUT->notification('This script is not supported, always make complete backup before proceeding!<br />This operation can not be reverted!');
echo $OUTPUT->box_start();
echo '<div class="mdl-align">';
echo '<form action="replace.php" method="post"><div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<div><label for="search">Search whole database for: </label><input id="search" type="text" name="search" size="40" /> (usually previous server URL)</div>';
echo '<div><label for="replace">Replace with this string: </label><input type="text" id="replace" name="replace" size="40" /> (usually new server URL)</div>';
echo '<div><label for="sure">I understand the risks of this operation: </label><input type="checkbox" id="sure" name="sure" value="1" /></div>';
echo '<div class="buttons"><input type="submit" class="singlebutton" value="Yes, do it now" /></div>';
echo '</div></form>';
echo '</div>';
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die;
}
echo $OUTPUT->box_start();
db_replace($search, $replace);
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();
+128
View File
@@ -0,0 +1,128 @@
<?php
// index.php - scheduled backup logs
require_once('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/backup/lib.php');
$courseid = optional_param('courseid', 0, PARAM_INT);
admin_externalpage_setup('reportbackups', '', null, '', array('pagelayout'=>'report'));
echo $OUTPUT->header();
/// Automated backups aren't active by the site admin
$backup_config = backup_get_config();
if (empty($backup_config->backup_auto_active)) {
echo $OUTPUT->notification(get_string('automatedbackupsinactive', 'backup'));
}
/// Get needed strings
$backuploglaststatus = get_string("backuploglaststatus");
$backuplogdetailed = get_string("backuplogdetailed");
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strbackup = get_string("backup");
$strbackupdetails = get_string("backupdetails");
$strlogs = get_string("logs");
$strftimedatetime = get_string("strftimerecent");
$strftimetime = get_string("strftimetime").":%S";
$strerror = get_string("error");
$strok = get_string("ok");
$strunfinished = get_string("unfinished");
$strskipped = get_string("skipped");
$strcourse = get_string("course");
$strtimetaken = get_string("timetaken","quiz");
$strstatus = get_string("status");
$strnext = get_string("backupnext");
/// Decide when to show last execution logs or detailed logs
/// Lastlog view
if (!$courseid) {
echo $OUTPUT->heading($backuploglaststatus);
echo $OUTPUT->box_start();
/// Now, get every record from backup_courses
$courses = $DB->get_records("backup_courses");
if (!$courses) {
echo $OUTPUT->notification(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
//Print table header
echo "<tr>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strcourse</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\"><font size=\"3\">$strtimetaken</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strstatus</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strnext</font></td></tr>";
foreach ($courses as $course) {
/// Get the course shortname
$coursename = $DB->get_field ("course", "fullname", array("id"=>$course->courseid));
if ($coursename) {
echo "<tr>";
echo "<td nowrap=\"nowrap\"><font size=\"2\"><a href=\"index.php?courseid=$course->courseid\">".$coursename."</a></font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->laststarttime,$strftimedatetime)."</font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\"> - </font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->lastendtime,$strftimedatetime)."</font></td>";
if ($course->laststatus == 1) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strok."</font></td>";
} else if ($course->laststatus == 2) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strunfinished."</font></td>";
} else if ($course->laststatus == 3) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strskipped."</font></td>";
} else {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strerror."</font></td>";
}
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->nextstarttime,$strftimedatetime)."</font></td>";
echo "</tr>";
}
}
echo "</table>";
}
echo $OUTPUT->box_end();
/// Detailed View !!
} else {
echo $OUTPUT->heading($backuplogdetailed);
$coursename = $DB->get_field("course", "fullname", array("id"=>"$courseid"));
echo $OUTPUT->heading("$strcourse: $coursename");
echo $OUTPUT->box_start();
/// First, me get all the distinct backups for that course in backup_log
$executions = $DB->get_records_sql("SELECT DISTINCT laststarttime
FROM {backup_log}
WHERE courseid = ? AND backuptype = ?
ORDER BY laststarttime DESC", array($courseid,'scheduledbackup'));
/// Iterate over backup executions
if (!$executions) {
echo $OUTPUT->notification(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
foreach($executions as $execution) {
echo "<tr>";
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\">";
echo $OUTPUT->box(userdate($execution->laststarttime));
echo "</td>";
echo "</tr>";
$logs = $DB->get_records_sql("SELECT *
FROM {backup_log}
WHERE courseid = ? AND laststarttime = ? AND backuptype = ?
ORDER BY id", array($courseid, $execution->laststarttime,'scheduledbackup'));
if ($logs) {
foreach ($logs as $log) {
echo "<tr>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($log->time,$strftimetime)."</font></td>";
$log->info = str_replace("- ERROR!!","- <font color=\"red\">ERROR!!</font>",$log->info);
$log->info = str_replace("- OK","- <font color=\"green\">OK</font>",$log->info);
echo "<td nowrap=\"nowrap\"><font size=\"2\">".str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$log->info)."</font></td>";
echo "</tr>";
}
}
}
echo "</table>";
}
echo $OUTPUT->box_end();
}
echo $OUTPUT->footer();
+5
View File
@@ -0,0 +1,5 @@
<?php
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('reports', new admin_externalpage('reportbackups', get_string('backups', 'admin'), "$CFG->wwwroot/$CFG->admin/report/backups/index.php",'moodle/backup:backupcourse'));
+214
View File
@@ -0,0 +1,214 @@
<?php
/**
* For a given capability, show what permission it has for every role, and
* everywhere that it is overridden.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package roles
*/
/** */
require_once(dirname(__FILE__).'/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
// Check permissions.
require_login();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $systemcontext);
// Get URL parameters.
$capability = optional_param('capability', '', PARAM_CAPABILITY);
$roleids = optional_param('roles', array('0'), PARAM_INTEGER);
// Clean the passed in list of role ids. If 'All' selected as an option, or
// if none were selected, do all roles.
$allroles = get_all_roles();
$cleanedroleids = array();
foreach ($roleids as $roleid) {
if ($roleid == 0) {
$cleanedroleids = array_keys($allroles);
break;
}
if (array_key_exists($roleid, $allroles)) {
$cleanedroleids[] = $roleid;
}
}
if (empty($cleanedroleids)) {
$cleanedroleids = array_keys($allroles);
}
// Include the required JavaScript.
$PAGE->requires->js_init_call('M.report_capability.init', array(get_string('search')));
// Log.
add_to_log(SITEID, "admin", "report capability", "report/capability/index.php?capability=$capability", $capability);
// Print the header.
admin_externalpage_setup('reportcapability');
echo $OUTPUT->header();
// Prepare the list of capabilities to choose from
$allcapabilities = fetch_context_capabilities($systemcontext);
$capabilitychoices = array();
foreach ($allcapabilities as $cap) {
$capabilitychoices[$cap->name] = $cap->name . ': ' . get_capability_string($cap->name);
}
// Prepare the list of roles to choose from
$rolechoices = array('0' => get_string('all'));
foreach ($allroles as $role) {
$rolechoices[$role->id] = $role->name;
}
if (count($cleanedroleids) == count($allroles)) {
// Select 'All', rather than each role individually.
$selectedroleids = array('0');
} else {
$selectedroleids = $cleanedroleids;
}
// Print the settings form.
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
echo '<form method="get" action="." id="settingsform"><div>';
echo $OUTPUT->heading(get_string('reportsettings', 'report_capability'));
echo '<p id="intro">', get_string('intro', 'report_capability') , '</p>';
echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'report_capability') . '</label></p>';
echo html_writer::select($capabilitychoices, 'capability', $capability, array(''=>'choose'), array('size'=>10));
echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'report_capability') . '</label></p>';
echo html_writer::select($rolechoices, 'roles[]', $selectedroleids, false, array('size'=>10, 'multiple'=>'multiple'));
echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'report_capability') . '" /></p>';
echo '</div></form>';
echo $OUTPUT->box_end();
// If we have a capability, generate the report.
if ($capability) {
// Work out the bits needed for the SQL WHERE clauses.
$params = array($capability);
$sqlroletest = '';
if (count($cleanedroleids) != count($allroles)) {
list($sqlroletest, $roleparams) = $DB->get_in_or_equal($cleanedroleids);
$params = array_merge($params, $roleparams);
$sqlroletest = 'AND roleid ' . $sqlroletest;
}
// Get all the role_capabilities rows for this capability - that is, all
// role definitions, and all role overrides.
$rolecaps = $DB->get_records_sql("
SELECT id, roleid, contextid, permission
FROM {role_capabilities}
WHERE capability = ? $sqlroletest", $params);
// In order to display a nice tree of contexts, we need to get all the
// ancestors of all the contexts in the query we just did.
$relevantpaths = $DB->get_records_sql_menu("
SELECT DISTINCT con.path, 1
FROM {context} con JOIN {role_capabilities} rc ON rc.contextid = con.id
WHERE capability = ? $sqlroletest", $params);
$requiredcontexts = array($systemcontext->id);
foreach ($relevantpaths as $path => $notused) {
$requiredcontexts = array_merge($requiredcontexts, explode('/', trim($path, '/')));
}
$requiredcontexts = array_unique($requiredcontexts);
// Now load those contexts.
list($sqlcontexttest, $contextparams) = $DB->get_in_or_equal($requiredcontexts);
$contexts = get_sorted_contexts('ctx.id ' . $sqlcontexttest, $contextparams);
// Prepare some empty arrays to hold the data we are about to compute.
foreach ($contexts as $conid => $con) {
$contexts[$conid]->children = array();
$contexts[$conid]->rolecapabilities = array();
}
// Put the contexts into a tree structure.
foreach ($contexts as $conid => $con) {
$parentcontextid = get_parent_contextid($con);
if ($parentcontextid) {
$contexts[$parentcontextid]->children[] = $conid;
}
}
// Put the role capabilities into the context tree.
foreach ($rolecaps as $rolecap) {
$contexts[$rolecap->contextid]->rolecapabilities[$rolecap->roleid] = $rolecap->permission;
}
// Fill in any missing rolecaps for the system context.
foreach ($cleanedroleids as $roleid) {
if (!isset($contexts[$systemcontext->id]->rolecapabilities[$roleid])) {
$contexts[$systemcontext->id]->rolecapabilities[$roleid] = CAP_INHERIT;
}
}
// Print the report heading.
echo $OUTPUT->heading(get_string('reportforcapability', 'report_capability', get_capability_string($capability)), 2, 'main', 'report');
if (count($cleanedroleids) != count($allroles)) {
$rolenames = array();
foreach ($cleanedroleids as $roleid) {
$rolenames[] = $allroles[$roleid]->name;
}
echo '<p>', get_string('forroles', 'report_capability', implode(', ', $rolenames)), '</p>';
}
// Now, recursively print the contexts, and the role information.
print_report_tree($systemcontext->id, $contexts, $allroles);
}
// Footer.
echo $OUTPUT->footer();
function print_report_tree($contextid, $contexts, $allroles) {
global $CFG;
// Array for holding lang strings.
static $strpermissions = null;
if (is_null($strpermissions)) {
$strpermissions = array(
CAP_INHERIT => get_string('notset','role'),
CAP_ALLOW => get_string('allow','role'),
CAP_PREVENT => get_string('prevent','role'),
CAP_PROHIBIT => get_string('prohibit','role')
);
}
// Start the list item, and print the context name as a link to the place to
// make changes.
if ($contextid == get_system_context()->id) {
$url = "$CFG->wwwroot/$CFG->admin/roles/manage.php";
$title = get_string('changeroles', 'report_capability');
} else {
$url = "$CFG->wwwroot/$CFG->admin/roles/override.php?contextid=$contextid";
$title = get_string('changeoverrides', 'report_capability');
}
echo '<h3><a href="' . $url . '" title="' . $title . '">', print_context_name($contexts[$contextid]), '</a></h3>';
// If there are any role overrides here, print them.
if (!empty($contexts[$contextid]->rolecapabilities)) {
$rowcounter = 0;
echo '<table class="generaltable rolecaps"><tbody>';
foreach ($allroles as $role) {
if (isset($contexts[$contextid]->rolecapabilities[$role->id])) {
$permission = $contexts[$contextid]->rolecapabilities[$role->id];
echo '<tr class="r' . ($rowcounter % 2) . '"><th class="cell">', $role->name,
'</th><td class="cell">' . $strpermissions[$permission] . '</td></tr>';
$rowcounter++;
}
}
echo '</tbody></table>';
}
// After we have done the site context, change the string for CAP_INHERIT
// from 'notset' to 'inherit'.
$strpermissions[CAP_INHERIT] = get_string('inherit','role');
// If there are any child contexts, print them recursively.
if (!empty($contexts[$contextid]->children)) {
echo '<ul>';
foreach ($contexts[$contextid]->children as $childcontextid) {
echo '<li>';
print_report_tree($childcontextid, $contexts, $allroles);
echo '</li>';
}
echo '</ul>';
}
}
@@ -0,0 +1,36 @@
<?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/>.
/**
* Strings for component 'report_capability', language 'en', branch 'MOODLE_20_STABLE'
*
* @package report_capability
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['capabilitylabel'] = 'Capability:';
$string['capabilityreport'] = 'Capability report';
$string['forroles'] = 'For roles {$a}';
$string['getreport'] = 'Get the report';
$string['changeoverrides'] = 'Change overrides in this context';
$string['changeroles'] = 'Change role definitions';
$string['intro'] = 'This report shows, for a particular capability, what permission that capability has in the definition of every role (or a selection of roles), and everywhere in the site where that capability is overridden.';
$string['pluginname'] = 'Capability report';
$string['reportforcapability'] = 'Report for capability \'{$a}\'';
$string['reportsettings'] = 'Report settings';
$string['roleslabel'] = 'Roles:';
+75
View File
@@ -0,0 +1,75 @@
M.report_capability = {
select: null,
input: null,
button: null,
init: function(Y, strsearch) {
var context = M.report_capability;
// Find the form controls.
context.select = document.getElementById('menucapability');
context.button = document.getElementById('settingssubmit');
// Create a div to hold the search UI.
var div = document.createElement('div');
div.id = 'capabilitysearchui';
// Find the capability search input.
var input = document.createElement('input');
input.type = 'text';
input.id = 'capabilitysearch';
context.input = input;
// Create a label for the search input.
var label = document.createElement('label');
label.htmlFor = input.id;
label.appendChild(document.createTextNode(strsearch + ' '));
// Tie it all together
div.appendChild(label);
div.appendChild(input);
context.select.parentNode.insertBefore(div, context.select);
Y.on('keyup', context.typed, input);
Y.on('change', context.validate, context.select);
context.select.options[0].style.display = 'none';
context.validate();
},
typed: function() {
var context = M.report_capability;
var filtertext = context.input.value;
var options = context.select.options;
var onlycapability = -1;
for (var i = 1; i < options.length; i++) {
if (options[i].text.indexOf(filtertext) >= 0) {
options[i].disabled = false;
options[i].style.display = 'block';
if (onlycapability == -1) {
onlycapability = i;
} else {
onlycapability = -2;
}
} else {
options[i].disabled = true;
options[i].selected = false;
options[i].style.display = 'none';
}
}
if (onlycapability >= 0) {
options[onlycapability].selected = true;
}
if (onlycapability == -1) {
context.input.className = "error";
} else {
context.input.className = "";
}
context.validate();
},
validate: function() {
var context = M.report_capability;
context.button.disabled = (context.select.value == '');
}
}
+5
View File
@@ -0,0 +1,5 @@
<?php
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('roles', new admin_externalpage('reportcapability', get_string('pluginname', 'report_capability'), "$CFG->wwwroot/$CFG->admin/report/capability/index.php",'moodle/role:manage'));
+110
View File
@@ -0,0 +1,110 @@
<?php
require_once(dirname(__FILE__).'/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
// page parameters
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT); // how many per page
$sort = optional_param('sort', 'timemodified', PARAM_ALPHA);
$dir = optional_param('dir', 'DESC', PARAM_ALPHA);
admin_externalpage_setup('reportconfiglog', '', null, '', array('pagelayout'=>'report'));
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('configlog', 'report_configlog'));
$changescount = $DB->count_records('config_log');
$columns = array('firstname' => get_string('firstname'),
'lastname' => get_string('lastname'),
'timemodified' => get_string('timemodified', 'report_configlog'),
'plugin' => get_string('plugin', 'report_configlog'),
'name' => get_string('setting', 'report_configlog'),
'value' => get_string('value', 'report_configlog'),
'oldvalue' => get_string('oldvalue', 'report_configlog'),
);
$hcolumns = array();
if (!isset($columns[$sort])) {
$sort = 'lastname';
}
foreach ($columns as $column=>$strcolumn) {
if ($sort != $column) {
$columnicon = '';
if ($column == 'lastaccess') {
$columndir = 'DESC';
} else {
$columndir = 'ASC';
}
} else {
$columndir = $dir == 'ASC' ? 'DESC':'ASC';
if ($column == 'lastaccess') {
$columnicon = $dir == 'ASC' ? 'up':'down';
} else {
$columnicon = $dir == 'ASC' ? 'down':'up';
}
$columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
}
$hcolumns[$column] = "<a href=\"index.php?sort=$column&amp;dir=$columndir&amp;page=$page&amp;perpage=$perpage\">".$strcolumn."</a>$columnicon";
}
$baseurl = new moodle_url('index.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
echo $OUTPUT->paging_bar($changescount, $page, $perpage, $baseurl);
$override = new stdClass();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
if (($CFG->fullnamedisplay == 'firstname lastname') or
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
$fullnamedisplay = $hcolumns['firstname'].' / '.$hcolumns['lastname'];
} else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
$fullnamedisplay = $hcolumns['lastname'].' / '.$hcolumns['firstname'];
}
$table = new html_table();
$table->head = array($hcolumns['timemodified'], $fullnamedisplay, $hcolumns['plugin'], $hcolumns['name'], $hcolumns['value'], $hcolumns['oldvalue']);
$table->align = array('left', 'left', 'left', 'left', 'left', 'left');
$table->size = array('30%', '10%', '10%', '10%', '20%', '20%');
$table->width = '95%';
$table->data = array();
if ($sort == 'firstname' or $sort == 'lastname') {
$orderby = "u.$sort $dir";
} else {
$orderby = "cl.$sort $dir";
}
$ufields = user_picture::fields('u');
$sql = "SELECT $ufields,
cl.timemodified, cl.plugin, cl.name, cl.value, cl.oldvalue
FROM {config_log} cl
JOIN {user} u ON u.id = cl.userid
ORDER BY $orderby";
$rs = $DB->get_recordset_sql($sql, array(), $page*$perpage, $perpage);
foreach ($rs as $log) {
$row = array();
$row[] = userdate($log->timemodified);
$row[] = fullname($log);
if (is_null($log->plugin)) {
$row[] = 'core';
} else {
$row[] = $log->plugin;
}
$row[] = $log->name;
$row[] = s($log->value);
$row[] = s($log->oldvalue);
$table->data[] = $row;
}
$rs->close();
echo html_writer::table($table);
echo $OUTPUT->footer();
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -17,16 +18,14 @@
/**
* Strings for component 'report_configlog', language 'en', branch 'MOODLE_20_STABLE'
*
* @package report
* @subplugin configlog
* @copyright 2009 petr Skoda
* @package report_configlog
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['configlog'] = 'Config changes';
$string['oldvalue'] = 'Original value';
$string['plugin'] = 'Plugin';
$string['pluginname'] = 'Config changes';
$string['setting'] = 'Setting';
$string['timemodified'] = 'Date';
$string['value'] = 'New value';
+5
View File
@@ -0,0 +1,5 @@
<?php
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('reports', new admin_externalpage('reportconfiglog', get_string('configlog', 'report_configlog'), "$CFG->wwwroot/$CFG->admin/report/configlog/index.php"));
+40
View File
@@ -0,0 +1,40 @@
<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$capabilities = array(
'report/courseoverview:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:viewreports',
)
);
+122
View File
@@ -0,0 +1,122 @@
<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->libdir.'/adminlib.php');
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
if (empty($CFG->enablestats)) {
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
} else {
print_error('statsdisable');
}
}
admin_externalpage_setup('reportcourseoverview', '', null, '', array('pagelayout'=>'report'));
echo $OUTPUT->header();
$course = get_site();
stats_check_uptodate($course->id);
$strreports = get_string('reports');
$strcourseoverview = get_string('courseoverview');
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
$earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_daily}');
$earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_weekly}');
$earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_monthly}');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
if (empty($earliestmonth)) $earliestmonth = time();
$now = stats_get_base_daily();
$lastweekend = stats_get_base_weekly();
$lastmonthend = stats_get_base_monthly();
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
if (empty($timeoptions)) {
print_error('nostatstodisplay', 'error', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
echo '<form action="index.php" method="post">'."\n";
echo '<div>';
$table = new html_table();
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
$reporttypemenu = html_writer::select($reportoptions,'report',$report, false);
$timeoptionsmenu = html_writer::select($timeoptions,'time',$time, false);
$table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
get_string('statstimeperiod'),$timeoptionsmenu,
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
echo html_writer::table($table);
echo '</div>';
echo '</form>';
echo $OUTPUT->heading($reportoptions[$report]);
if (!empty($report) && !empty($time)) {
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql;
} else {
$sql = "SELECT courseid,".$param->fields."
FROM {".'stats_'.$param->table."}
WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0
GROUP BY courseid
$param->extras
ORDER BY $param->orderby";
}
$courses = $DB->get_records_sql($sql, $param->params, 0, $numcourses);
if (empty($courses)) {
echo $OUTPUT->notification(get_string('statsnodata'));
echo '</td></tr></table>';
} else {
if (empty($CFG->gdversion)) {
echo '<div class="graph">(' . get_string("gdneed") .')</div>';
} else {
echo '<div class="graph"><img alt="'.get_string('courseoverviewgraph').'" src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
}
$table = new html_table();
$table->align = array('left','center','center','center');
$table->head = array(get_string('course'),$param->line1);
if (!empty($param->line2)) {
$table->head[] = $param->line2;
}
if (!empty($param->line3)) {
$table->head[] = $param->line3;
}
foreach ($courses as $c) {
$a = array();
$a[] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$c->courseid.'">'.$DB->get_field('course', 'shortname', array('id'=>$c->courseid)).'</a>';
$a[] = $c->line1;
if (isset($c->line2)) {
$a[] = $c->line2;
}
if (isset($c->line3)) {
$a[] = round($c->line3,2);
}
$table->data[] = $a;
}
echo html_writer::table($table);
}
}
echo $OUTPUT->footer();
@@ -0,0 +1,27 @@
<?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/>.
/**
* Strings for component 'report_courseoverview', language 'en', branch 'MOODLE_20_STABLE'
*
* @package report_courseoverview
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['courseoverview:view'] = 'View course overview report';
$string['pluginname'] = 'Course overview';
@@ -0,0 +1,57 @@
<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->dirroot.'/lib/graphlib.php');
$report = required_param('report', PARAM_INT);
$time = required_param('time', PARAM_INT);
$numcourses = required_param('numcourses', PARAM_INT);
require_login();
require_capability('report/courseoverview:view', get_context_instance(CONTEXT_SYSTEM));
stats_check_uptodate();
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql;
} else {
$sql = "SELECT courseid, $param->fields
FROM {".'stats_'.$param->table."}
WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0
GROUP BY courseid
$param->extras
ORDER BY $param->orderby";
}
$courses = $DB->get_records_sql($sql, $param->params, 0, $numcourses);
if (empty($courses)) {
$PAGE->set_url('/admin/report/courseoverview/index.php');
print_error('statsnodata', 'error', $PAGE->url->out());
}
$graph = new graph(750,400);
$graph->parameter['legend'] = 'outside-right';
$graph->parameter['legend_size'] = 10;
$graph->parameter['x_axis_angle'] = 90;
$graph->parameter['title'] = false; // moodle will do a nicer job.
$graph->y_tick_labels = null;
$graph->offset_relation = null;
if ($report != STATS_REPORT_ACTIVE_COURSES) {
$graph->parameter['y_decimal_left'] = 2;
}
foreach ($courses as $c) {
$graph->x_data[] = $DB->get_field('course', 'shortname', array('id'=>$c->courseid));
$graph->y_data['bar1'][] = $c->{$param->graphline};
}
$graph->y_order = array('bar1');
$graph->y_format['bar1'] = array('colour' => 'blue','bar' => 'fill','legend' => $param->{$param->graphline});
$graph->draw_stack();
+5
View File
@@ -0,0 +1,5 @@
<?php
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('reports', new admin_externalpage('reportcourseoverview', get_string('pluginname', 'report_courseoverview'), "$CFG->wwwroot/$CFG->admin/report/courseoverview/index.php",'report/courseoverview:view'));
+27
View File
@@ -0,0 +1,27 @@
<?PHP
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
+51
View File
@@ -0,0 +1,51 @@
<?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/>.
/**
* Defines the capabilities used by the Language customization admin report
*
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
/* allows the user to view the current language customization */
'report/customlang:view' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
/* allows the user to edit the current language customization */
'report/customlang:edit' => array(
'riskbitmask' => RISK_CONFIG | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
);
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="admin/report/customlang/db" VERSION="20110419" COMMENT="XMLDB file for Moodle admin/report/customlang"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="report_customlang" COMMENT="Contains the working checkout of all strings and their customization" NEXT="report_customlang_components">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="lang"/>
<FIELD NAME="lang" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" COMMENT="The code of the language this string belongs to. Like en, cs or es" PREVIOUS="id" NEXT="componentid"/>
<FIELD NAME="componentid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The id of the component" PREVIOUS="lang" NEXT="stringid"/>
<FIELD NAME="stringid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The identifier of the string" PREVIOUS="componentid" NEXT="original"/>
<FIELD NAME="original" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="English original of the string" PREVIOUS="stringid" NEXT="master"/>
<FIELD NAME="master" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Master translation of the string as is distributed in the official lang pack, null if not translated" PREVIOUS="original" NEXT="local"/>
<FIELD NAME="local" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Local customization of the string, null if not customized" PREVIOUS="master" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The timestamp of when the original or master was recently modified" PREVIOUS="local" NEXT="timecustomized"/>
<FIELD NAME="timecustomized" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The timestamp of when the value of the local translation was recently modified, null if not customized yet" PREVIOUS="timemodified" NEXT="outdated"/>
<FIELD NAME="outdated" TYPE="int" LENGTH="3" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Either the English original or the master translation changed and the customization may be outdated" PREVIOUS="timecustomized" NEXT="modified"/>
<FIELD NAME="modified" TYPE="int" LENGTH="3" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Has the string been modified via the translator?" PREVIOUS="outdated"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fk_component"/>
<KEY NAME="fk_component" TYPE="foreign" FIELDS="componentid" REFTABLE="report_customlang_components" REFFIELDS="id" PREVIOUS="primary"/>
</KEYS>
<INDEXES>
<INDEX NAME="uq_lang_component_string" UNIQUE="true" FIELDS="lang, componentid, stringid" COMMENT="For a given language and component, string identifiers must be unique"/>
</INDEXES>
</TABLE>
<TABLE NAME="report_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="report_customlang">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The normalized name of the plugin" PREVIOUS="id" NEXT="version"/>
<FIELD NAME="version" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The checked out version of the plugin, null if the version is unknown" PREVIOUS="name"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
+74
View File
@@ -0,0 +1,74 @@
<?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/>.
/**
* Language customization report upgrades
*
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function xmldb_report_customlang_upgrade($oldversion) {
global $CFG, $DB, $OUTPUT;
$dbman = $DB->get_manager();
$result = true;
/**
* Use proper plugin prefix for tables
*/
if ($oldversion < 2010111200) {
if ($dbman->table_exists('customlang')) {
$dbman->rename_table(new xmldb_table('customlang'), 'report_customlang');
}
if ($dbman->table_exists('customlang_components')) {
$dbman->rename_table(new xmldb_table('customlang_components'), 'report_customlang_components');
}
upgrade_plugin_savepoint(true, 2010111200, 'report', 'customlang');
}
/**
* Regenerate the foreign key after the tables rename
*/
if ($oldversion < 2010111500) {
$table = new xmldb_table('report_customlang');
$oldkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'customlang_components', array('id'));
$newkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'report_customlang_components', array('id'));
$dbman->drop_key($table, $oldkey);
$dbman->add_key($table, $newkey);
upgrade_plugin_savepoint(true, 2010111500, 'report', 'customlang');
}
/**
* Change the version field from integer to varchar
*/
if ($oldversion < 2011041900) {
$table = new xmldb_table('report_customlang_components');
$field = new xmldb_field('version', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'name');
$dbman->change_field_type($table, $field);
upgrade_plugin_savepoint(true, 2011041900, 'report', 'customlang');
}
return $result;
}
+126
View File
@@ -0,0 +1,126 @@
<?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/>.
/**
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/filter_form.php');
require_login(SITEID, false);
require_capability('report/customlang:edit', get_system_context());
$lng = required_param('lng', PARAM_LANG);
$currentpage = optional_param('p', 0, PARAM_INT);
$translatorsubmitted = optional_param('translatorsubmitted', 0, PARAM_BOOL);
$PAGE->set_pagelayout('standard');
$PAGE->set_url('/admin/report/customlang/edit.php', array('lng' => $lng));
navigation_node::override_active_url(new moodle_url('/admin/report/customlang/index.php'));
$PAGE->set_title(get_string('pluginname', 'report_customlang'));
$PAGE->set_heading(get_string('pluginname', 'report_customlang'));
$PAGE->requires->js_init_call('M.report_customlang.init_editor', array(), true);
if (empty($lng)) {
// PARAM_LANG validation failed
print_error('missingparameter');
}
// pre-output processing
$filter = new report_customlang_filter_form($PAGE->url, null, 'post', '', array('class'=>'filterform'));
$filterdata = report_customlang_utils::load_filter($USER);
$filter->set_data($filterdata);
if ($filter->is_cancelled()) {
redirect($PAGE->url);
} elseif ($submitted = $filter->get_data()) {
report_customlang_utils::save_filter($submitted, $USER);
redirect(new moodle_url($PAGE->url, array('p'=>0)));
}
if ($translatorsubmitted) {
$strings = optional_param('cust', array(), PARAM_RAW);
$updates = optional_param('updates', array(), PARAM_INT);
$checkin = optional_param('savecheckin', false, PARAM_RAW);
if ($checkin === false) {
$nexturl = $PAGE->url;
} else {
$nexturl = new moodle_url('/admin/report/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
}
if (!is_array($strings)) {
$strings = array();
}
$current = $DB->get_records_list('report_customlang', 'id', array_keys($strings));
$now = time();
foreach ($strings as $recordid => $customization) {
$customization = trim($customization);
if (empty($customization) and !is_null($current[$recordid]->local)) {
$current[$recordid]->local = null;
$current[$recordid]->modified = 1;
$current[$recordid]->outdated = 0;
$current[$recordid]->timecustomized = null;
$DB->update_record('report_customlang', $current[$recordid]);
continue;
}
if (empty($customization)) {
continue;
}
if ($customization !== $current[$recordid]->local) {
$current[$recordid]->local = $customization;
$current[$recordid]->modified = 1;
$current[$recordid]->outdated = 0;
$current[$recordid]->timecustomized = $now;
$DB->update_record('report_customlang', $current[$recordid]);
continue;
}
}
if (!is_array($updates)) {
$updates = array();
}
if (!empty($updates)) {
list($sql, $params) = $DB->get_in_or_equal($updates);
$DB->set_field_select('report_customlang', 'outdated', 0, "local IS NOT NULL AND id $sql", $params);
}
redirect($nexturl);
}
$translator = new report_customlang_translator($PAGE->url, $lng, $filterdata, $currentpage);
// output starts here
$output = $PAGE->get_renderer('report_customlang');
$paginator = $output->paging_bar($translator->numofrows, $currentpage, report_customlang_translator::PERPAGE, $PAGE->url, 'p');
echo $output->header();
$filter->display();
echo $paginator;
echo $output->render($translator);
echo $paginator;
echo $output->footer();
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package tool
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -28,51 +29,51 @@ require_once($CFG->dirroot . '/lib/formslib.php');
/**
* Form for filtering the strings to customize
*/
class tool_customlang_filter_form extends moodleform {
class report_customlang_filter_form extends moodleform {
function definition() {
$mform = $this->_form;
$current = $this->_customdata['current'];
$mform->addElement('header', 'filtersettings', get_string('filter', 'tool_customlang'));
$mform->addElement('header', 'filtersettings', get_string('filter', 'report_customlang'));
// Component
$options = array();
foreach (tool_customlang_utils::list_components() as $component => $normalized) {
list($type, $plugin) = core_component::normalize_component($normalized);
foreach (report_customlang_utils::list_components() as $component => $normalized) {
list($type, $plugin) = normalize_component($normalized);
if ($type == 'core' and is_null($plugin)) {
$plugin = 'moodle';
}
$options[$type][$normalized] = $component.'.php';
}
$mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'tool_customlang'), $options,
$mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'report_customlang'), $options,
array('multiple'=>'multiple', 'size'=>7));
// Customized only
$mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'tool_customlang'));
$mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'report_customlang'));
$mform->setType('customized', PARAM_BOOL);
$mform->setDefault('customized', 0);
// Only helps
$mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'tool_customlang'));
$mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'report_customlang'));
$mform->setType('helps', PARAM_BOOL);
$mform->setDefault('helps', 0);
// Modified only
$mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'tool_customlang'));
$mform->setType('modified', PARAM_BOOL);
$mform->setDefault('modified', 0);
$mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'report_customlang'));
$mform->setType('filtermodified', PARAM_BOOL);
$mform->setDefault('filtermodified', 0);
// Substring
$mform->addElement('text', 'substring', get_string('filtersubstring', 'tool_customlang'));
$mform->addElement('text', 'substring', get_string('filtersubstring', 'report_customlang'));
$mform->setType('substring', PARAM_RAW);
// String identifier
$mform->addElement('text', 'stringid', get_string('filterstringid', 'tool_customlang'));
$mform->addElement('text', 'stringid', get_string('filterstringid', 'report_customlang'));
$mform->setType('stringid', PARAM_STRINGID);
// Show strings - submit button
$mform->addElement('submit', 'submit', get_string('filtershowstrings', 'tool_customlang'));
$mform->addElement('submit', 'submit', get_string('filtershowstrings', 'report_customlang'));
}
}
+139
View File
@@ -0,0 +1,139 @@
<?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/>.
/**
* Performs checkout of the strings into the translation table
*
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true); // progress bar is used here
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
require_once($CFG->libdir.'/adminlib.php');
require_login(SITEID, false);
require_capability('report/customlang:view', get_system_context());
$action = optional_param('action', '', PARAM_ALPHA);
$confirm = optional_param('confirm', false, PARAM_BOOL);
$lng = optional_param('lng', '', PARAM_LANG);
admin_externalpage_setup('reportcustomlang');
$langs = get_string_manager()->get_list_of_translations();
// pre-output actions
if ($action === 'checkout') {
require_sesskey();
require_capability('report/customlang:edit', get_system_context());
if (empty($lng)) {
print_error('missingparameter');
}
$PAGE->set_cacheable(false); // progress bar is used here
$output = $PAGE->get_renderer('report_customlang');
echo $output->header();
echo $output->heading(get_string('pluginname', 'report_customlang'));
$progressbar = new progress_bar();
$progressbar->create(); // prints the HTML code of the progress bar
// we may need a bit of extra execution time and memory here
@set_time_limit(HOURSECS);
raise_memory_limit(MEMORY_EXTRA);
report_customlang_utils::checkout($lng, $progressbar);
echo $output->continue_button(new moodle_url('/admin/report/customlang/edit.php', array('lng' => $lng)), 'get');
echo $output->footer();
exit;
}
if ($action === 'checkin') {
require_sesskey();
require_capability('report/customlang:edit', get_system_context());
if (empty($lng)) {
print_error('missingparameter');
}
if (!$confirm) {
$output = $PAGE->get_renderer('report_customlang');
echo $output->header();
echo $output->heading(get_string('pluginname', 'report_customlang'));
echo $output->heading($langs[$lng], 3);
$numofmodified = report_customlang_utils::get_count_of_modified($lng);
if ($numofmodified != 0) {
echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
echo $output->confirm(get_string('confirmcheckin', 'report_customlang'),
new moodle_url($PAGE->url, array('action'=>'checkin', 'lng'=>$lng, 'confirm'=>1)),
new moodle_url($PAGE->url, array('lng'=>$lng)));
} else {
echo $output->heading(get_string('modifiedno', 'report_customlang', $numofmodified), 3);
echo $output->continue_button(new moodle_url($PAGE->url, array('lng' => $lng)));
}
echo $output->footer();
die();
} else {
report_customlang_utils::checkin($lng);
redirect($PAGE->url);
}
}
$output = $PAGE->get_renderer('report_customlang');
// output starts here
echo $output->header();
echo $output->heading(get_string('pluginname', 'report_customlang'));
if (empty($lng)) {
$s = new single_select($PAGE->url, 'lng', $langs);
$s->label = get_accesshide(get_string('language'));
$s->class = 'langselector';
echo $output->box($OUTPUT->render($s), 'langselectorbox');
echo $OUTPUT->footer();
exit;
}
echo $output->heading($langs[$lng], 3);
$numofmodified = report_customlang_utils::get_count_of_modified($lng);
if ($numofmodified != 0) {
echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
}
$menu = array();
if (has_capability('report/customlang:edit', get_system_context())) {
$menu['checkout'] = array(
'title' => get_string('checkout', 'report_customlang'),
'url' => new moodle_url($PAGE->url, array('action' => 'checkout', 'lng' => $lng)),
'method' => 'post',
);
if ($numofmodified != 0) {
$menu['checkin'] = array(
'title' => get_string('checkin', 'report_customlang'),
'url' => new moodle_url($PAGE->url, array('action' => 'checkin', 'lng' => $lng)),
'method' => 'post',
);
}
}
echo $output->render(new report_customlang_menu($menu));
echo $output->footer();
@@ -0,0 +1,61 @@
<?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/>.
/**
* Strings for Language customization admin report
*
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['checkin'] = 'Check in strings into disk';
$string['checkout'] = 'Check out strings into the translator';
$string['checkoutdone'] = 'Strings checked out successfully into the translator';
$string['checkoutinprogress'] = 'Checking out strings into the translator';
$string['confirmcheckin'] = 'You are about to check in modified strings into your local language pack. This will export the customized strings from the translator into the data directory and Moodle will start using the modified strings. Press \'Continue\' button to proceed check in.';
$string['customlang:edit'] = 'Edit local translation';
$string['customlang:view'] = 'View local translation';
$string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components';
$string['filtercustomized'] = 'Customized only';
$string['filtermodified'] = 'Modified only';
$string['filteronlyhelps'] = 'Help only';
$string['filtershowstrings'] = 'Show strings';
$string['filterstringid'] = 'String identifier';
$string['filtersubstring'] = 'Only strings containing';
$string['headingcomponent'] = 'Component';
$string['headinglocal'] = 'Local customization';
$string['headingstandard'] = 'Standard text';
$string['headingstringid'] = 'String';
$string['markinguptodate'] = 'Marking the customization as up-to-date';
$string['markinguptodate_help'] = 'The customized translation may get outdated if either the English original or the master translation has modified since the string was customized on your site. Review the customized translation. If you find it up-to-date, click the checkbox. Edit it otherwise.';
$string['markuptodate'] = 'mark as up-to-date';
$string['modifiedno'] = 'There are no modified strings to check in.';
$string['modifiednum'] = 'There are {$a} modified strings. You must check in them into disk to store them permanently.';
$string['nostringsfound'] = 'No strings found, please modify the filter settings';
$string['placeholder'] = 'Placeholders';
$string['placeholder_help'] = 'Placeholders are special statements like `{$a}` or `{$a->something}` within the string. They are replaced with a value when the string is actually printed.
It is important to copy them exactly as they are in the original string. Do not translate them nor change their left-to-right orientation.';
$string['placeholderwarning'] = 'string contains a placeholder';
$string['pluginname'] = 'Language customization';
$string['savecheckin'] = 'Save and check in strings into files';
$string['savecontinue'] = 'Save and continue editing';
+25
View File
@@ -0,0 +1,25 @@
<?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/>.
/**
* @package report
* @subpackage customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

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