Compare commits

..

381 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 560c1c8ea3 Moodle release 2.4.7 2013-11-10 01:58:40 +01:00
Damyon Wiese 7922f118db weekly release 2.4.6+ 2013-11-08 12:51:03 +08:00
Damyon Wiese f8872ff3e8 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-11-08 12:50:59 +08:00
AMOS bot d4edd6c99f Automatically generated installer lang files 2013-11-08 00:43:09 +00:00
Damyon Wiese 301e79acae Merge branch 'MDL-42668-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 16:11:30 +08:00
Frederic Massart baad460c91 MDL-42668 portfolio_boxnet: Disable the portfolio when non-HTTPS 2013-11-07 14:40:22 +08:00
Frederic Massart c3cf690cee MDL-42668 portfolio_boxnet: Disable the portfolio during upgrade 2013-11-07 14:40:22 +08:00
Frederic Massart 6cc4b72fb9 MDL-42668 portfolio_boxnet: Notify the admins about the upgrade process
Conflicts:

	portfolio/boxnet/version.php
2013-11-07 14:40:19 +08:00
Frederic Massart d311f9cc75 MDL-42668 portfolio_boxnet: Migration to APIv2
Conflicts:

	lib/boxlib.php
	portfolio/boxnet/lib.php
2013-11-07 14:39:44 +08:00
Marina Glancy bc6f61fe9f Merge branch 'MDL-42697-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-11-07 16:31:39 +11:00
Dan Poltawski b1455d0d74 Merge branch 'MDL-42666-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 11:44:53 +08:00
Frederic Massart 01a2722f32 MDL-42666 repository_boxnet: New lang strings rather than replace 2013-11-07 11:13:22 +08:00
Damyon Wiese 711f77e4ca Merge branch 'MDL-42605-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 11:05:32 +08:00
Frederic Massart 615e2caf67 MDL-42666 repository_boxnet: Improved output during migration 2013-11-07 11:01:01 +08:00
Dan Poltawski cad44b4778 Merge branch 'MDL-42728-en_fix_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-07 09:37:14 +08:00
Frederic Massart c3cefce21c MDL-42666 repository_boxnet: Avoid re-download of sync'd references 2013-11-06 15:03:07 +08:00
Frederic Massart 393133707a MDL-42666 repository_boxnet: Downloading a file follows locations 2013-11-06 14:05:00 +08:00
Frederic Massart 0fb12db343 MDL-42666 repository_boxnet: Fix undefined variable usage 2013-11-06 14:05:00 +08:00
Frederic Massart b1e4d7afc8 MDL-42666 repository_boxnet: Using the right reference 2013-11-06 14:04:59 +08:00
Frederic Massart eca84ae277 MDL-42666 repository_boxnet: Convert all the references asap
This has been done in case the script fails during the processing
and needs to be re-run. Now all the references are converted as soon
as we can, where as before they could have ended up being re-downloaded.
2013-11-06 14:04:59 +08:00
Frederic Massart c578a134fa MDL-42666 repository_boxnet: Warn on HTTPS requirement when non HTTPS 2013-11-06 14:04:59 +08:00
Frederic Massart 53661a6767 MDL-42666 repository_boxnet: Alert the admins of the migration process
Conflicts:

	repository/boxnet/version.php

Conflicts:

	repository/boxnet/version.php
2013-11-06 14:04:55 +08:00
Frederic Massart 3d115053d2 MDL-42666 repository_boxnet: Revoke access token when logging out 2013-11-06 14:03:43 +08:00
Frederic Massart 27db0b4376 MDL-42666 oauthlib: Getter methods for accesstoken, client id and secret 2013-11-06 14:03:43 +08:00
Frederic Massart 45c79022ac MDL-42666 repository_boxnet: Remove hardcoded date for APIv1 end of life 2013-11-06 14:03:42 +08:00
Frederic Massart e15c728434 MDL-42666 repository_boxnet: Disabling file references 2013-11-06 14:03:42 +08:00
Frederic Massart 2c1fc0e086 MDL-42666 repository_boxnet: Advise the user to run the migration tool 2013-11-06 14:03:41 +08:00
Frederic Massart 35662296e5 MDL-42666 repository_boxnet: Tool to launch the migration 2013-11-06 14:03:41 +08:00
Frederic Massart f5c99c5144 MDL-42666 repository_boxnet: Function to convert APIv1 references to true copies 2013-11-06 14:03:41 +08:00
Frederic Massart 82efa6c9f2 MDL-42666 repository_boxnet: Convert repository to APIv2
The support for downloading images when they are references
from Box.net have been dropped in this script as the new
API does not support references. Unfortunately the old
references thumbnails will not be updated any more.

Conflicts:

	lib/upgrade.txt
	repository/boxnet/lib.php

Conflicts:

	lib/upgrade.txt
	repository/boxnet/lib.php
2013-11-06 14:03:24 +08:00
Petr Škoda e02256507c MDL-38743 add private cache headers 2013-11-06 13:58:15 +08:00
Marina Glancy 794f42d81d Merge branch 'MDL-42640-24' of https://github.com/colin-umn/moodle into MOODLE_24_STABLE 2013-11-06 16:32:39 +11:00
Andrew Nicols add479a88e MDL-42697 Theme: Fix overflow on docked blocks 2013-11-06 12:02:41 +08:00
Damyon Wiese 429d0d711b MDL-39800 tags: Fix tags/upgrade.txt version number in backport 2013-11-06 10:45:22 +08:00
Jenny Gray 47b2416012 MDL-39800 tags: moved cloud sorting to print function 2013-11-06 10:43:27 +08:00
Jenny Gray a01bd41865 MDL-39800 tags: Applied weight and ordering fix on all more page options
Also:
Fixed weight and ordering on more page show=all
Fixed weight and ordering on more page show=my
rationalised tag_print_cloud lines now identical
2013-11-06 10:43:27 +08:00
Jenny Gray 555ad195a0 MDL-39800 tags: resolved weighting in block content 2013-11-06 10:43:27 +08:00
Mary Evans 1ba20f5594 MDL-40244 forms: added setType() for groupinfo in forum and wiki 2013-11-06 12:25:46 +11:00
Helen Foster d0890a7791 MDL-42728 Merge English strings from the en_fix language pack 2013-11-05 23:54:37 +01:00
Damyon Wiese b7a1f71911 Merge branch 'wip-MDL-38228-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-11-05 21:49:12 +08:00
Dan Poltawski 7fd34aa0e6 Merge branch 'MDL-42613_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-05 16:46:36 +08:00
Marina Glancy a78bb0cc83 Merge branch 'MDL-40267-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-11-05 17:45:38 +11:00
Aaron Barnes 2acdf0af6b MDL-42476 report_progress: don't browser sniff for SVG support
Use feature detection, its more robust and better practice.
2013-11-05 11:24:38 +08:00
Marina Glancy ba5ecbc72a MDL-38228 upgrade: Rewrite script that fixes corrupt course modules to sequence relation 2013-11-05 14:15:17 +11:00
Colin Campbell 4bb2eaa7d0 MDL-42640 quiz: Fix restore of backup without overduehandling setting
Use default quiz overduehandling setting when restoring a
backup from older Moodle version that does not have a quiz
overduehandling setting.
2013-11-04 20:56:32 -06:00
Ray Morris 55e3c2cd82 MDL-42265 make Browse Users list scrollable for smaller screens 2013-11-05 10:51:27 +08:00
Dan Poltawski d320d0b285 MDL-40267 forms: fix utf8 string length rules 2013-11-05 10:19:22 +08:00
Eloy Lafuente (stronk7) 9424bcb66e MDL-40267 forms: added some tests for the range rule 2013-11-05 10:10:51 +08:00
Dan Poltawski 08a8eb917e Merge branch 'wip-MDL-42270_M24_2' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-11-04 22:54:20 +08:00
Dan Poltawski df78a7902b Merge branch 'MDL-42548_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-11-04 22:35:09 +08:00
Dan Poltawski 43fa28331e Merge branch 'MDL-42453_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-11-04 22:17:22 +08:00
Dan Poltawski c512b7cc65 MDL-42533 conditionlib: Add clarifying comments 2013-11-04 22:04:30 +08:00
Dan Poltawski 8a7078b28b Merge branch 'MDL-42533-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-04 21:55:40 +08:00
Dan Poltawski dcb6e4169b Merge branch '42350-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-11-04 17:21:32 +08:00
Dan Poltawski 8cd148efe0 Merge branch 'MDL-42551_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-11-04 16:22:50 +08:00
Marina Glancy e2fb6ffa24 Merge branch 'MDL-42604-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-11-04 19:17:08 +11:00
Sam Hemelryk 71a5c487ce MDL-42350 mod_assign: fixed display of submission button 2013-11-04 15:59:24 +08:00
Dan Poltawski 23ea3287ea Merge branch 'MDL-42111_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 15:31:37 +08:00
Damyon Wiese a3e6f40dbe Merge branch 'MDL-34654-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-11-04 15:23:11 +08:00
Dan Poltawski 42cc95c245 Merge branch 'MDL-42494-workshop-exception_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-04 14:52:24 +08:00
Marina Glancy 9ea075bb32 Merge branch 'MDL-42429_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 17:28:34 +11:00
Marina Glancy 08839bbcb8 Merge branch 'MDL-42566_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 17:23:31 +11:00
Marina Glancy abfdce235b Merge branch 'MDL-42465_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 16:58:26 +11:00
Frederic Massart 70427c648e MDL-41807 repository_filesystem: Prevent access to parent directories 2013-11-04 13:30:58 +08:00
Damyon Wiese 5287178537 Merge branch 'MDL-42489-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-11-04 13:16:23 +08:00
Marina Glancy abaaa8cdae Merge branch 'MDL-42617_24' of git://github.com/jleyva/moodle into MOODLE_24_STABLE 2013-11-04 16:15:13 +11:00
Marina Glancy 9312fbe16e Merge branch 'MDL-38664_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 15:19:00 +11:00
Dan Poltawski d120a7baf2 Merge branch 'MDL-40515_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-11-04 12:10:58 +08:00
Damyon Wiese fb494ae9c8 Merge branch 'MDL-35146_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 12:05:22 +08:00
Petr Škoda 09f2963373 MDL-41941 clean message text 2013-11-04 11:38:14 +08:00
Tim Hunt 6917b452bf MDL-41820 XSS in the quiz responses report.
Thanks to Michael Hess for finding this bug and reporting it to us.
2013-11-04 11:10:30 +08:00
Damyon Wiese 919efdf632 Merge branch 'MDL-42663_24' of git://github.com/dmonllao/moodle into MOODLE_24_STABLE 2013-11-04 10:50:09 +08:00
Marina Glancy b3e58b7d0b Merge branch 'MDL-42664-performance_measuring_filter_manager_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-04 13:18:39 +11:00
Damyon Wiese 4844fc124c Merge branch 'MDL-38850_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 09:41:10 +08:00
Damyon Wiese d98f1751e8 Merge branch 'wip-MDL-28463-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-11-01 22:53:01 +08:00
David Monllao 9ab44b3f99 MDL-42663 mod_lesson: Move definitions to show_clock()
Seems that the required data is not always set
before timer.js is included.
2013-11-01 16:39:36 +08:00
Mark Nelson 6c32a2f003 MDL-42429 mod_lesson: removed unnecessary conditional check 2013-11-01 16:32:25 +08:00
David Mudrák f23a63b545 MDL-42664 Fix the filter_manager instantiation
For legacy reasons, the $CFG->perfdebug uses values 7 for disabled and 15 for
enabled. Because of this typo, Moodle has always created instance of the slower
performance_measuring_filter_manager instead of the standard filter_manager,
regardless the perfdebug setting.
2013-11-01 09:24:10 +01:00
Dan Poltawski 6758c0fa99 weekly release 2.4.6+ 2013-11-01 15:47:45 +08:00
Dan Poltawski eef875e0c1 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-11-01 15:47:42 +08:00
Sam Hemelryk 150735fbdb MDL-42619 block_community: delete course redirect bug fix 2013-11-01 10:16:02 +08:00
Marina Glancy accfa102fe Merge branch 'MDL-41624_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-10-31 22:20:20 +11:00
Juan Leyva e5663dfd70 MDL-42617 Add support for frozen fields in searchableselector form elements 2013-10-31 11:49:14 +01:00
Marina Glancy 91d309074f Merge branch 'MDL-40971_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-10-31 21:17:28 +11:00
Mark Nelson 9a3f511056 MDL-42566 mod_data: introduced check to ensure the picture supplied is valid 2013-10-31 17:10:46 +08:00
Michael Aherne de4d45ce8e MDL-42517 testing Changed events test to use assertDebuggingCalled() 2013-10-31 13:25:36 +08:00
Frederic Massart 2d22a9d474 MDL-42605 portfolio_flickr: Do not auto select a set to export to 2013-10-31 10:32:23 +08:00
Frederic Massart c64eea0a51 MDL-42605 portfolio_flickr: Photos can be added to a set on export 2013-10-31 10:32:22 +08:00
Jean-Michel Vedrine 0e099cc444 MDL-41624 DragMath crashes Firefox 2013-10-30 18:25:02 +01:00
Mark Nelson fda6ef7a1f MDL-42613 core_group: removed unnecessary table row when there is no group description or picture 2013-10-30 17:59:36 +08:00
Damyon Wiese 7b8dba0b52 Merge branch 'MDL-38734-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-30 17:21:30 +08:00
Sam Hemelryk c3673c5531 Merge branch 'MDL-42574-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-30 13:44:39 +08:00
Ankit Agarwal 1efa930202 MDL-42604 scorm: Fix division by zero warnings in error logs 2013-10-30 11:01:04 +08:00
Damyon Wiese 87c3a9fd9f Merge branch 'wip-MDL-41337-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-10-30 10:54:13 +08:00
Sam Hemelryk 1f26c7053a Merge branch 'MDL-42542-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-10-30 08:38:47 +08:00
Mary Evans fff86d45c1 MDL-40971 grade: Fixes missing setType() and $PAGE->layout for Outcomes/import which results in errors in 2.5 Clean theme 2013-10-30 00:15:59 +00:00
Marina Glancy 54a0a16b53 MDL-41337 files: Fixed bug with accidental delete of the root directory 2013-10-29 20:30:26 +11:00
John Beedell 8cb63784e5 MDL-41473 book: Book html zip import, incorrect url produced for internal linking to other chapters 2013-10-29 14:27:38 +08:00
Damyon Wiese 9ac938636f Merge branch 'MDL-40470-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-29 13:55:28 +08:00
Andrew Nicols 3bdbe1b08b MDL-40470 JavaScript: Correct issue when checking select change in Firefox 2013-10-29 10:43:06 +08:00
Marina Glancy eaccd0d486 MDL-28463 conditionlib: 10 minutes lifetime of cached grades 2013-10-29 13:21:12 +11:00
Dan Poltawski 0bc9604212 Merge branch 'MDL-22669-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-10-28 16:31:38 +08:00
Ankit Agarwal 17a0f7350f MDL-42574 blocks: Fix strict standards warning in community block 2013-10-28 15:43:09 +08:00
Mark Nielsen 0ed5fa3b88 MDL-38419: External tool - when force SSL checked, URLs get corrupted 2013-10-28 12:35:19 +08:00
Mark Nelson 34b3aa4d49 MDL-35146 mod_wiki: fixed variable typo and altered code to conform to Moodle guidelines 2013-10-28 12:34:37 +08:00
Anton Fletcher 5f22097114 MDL-35146 mod_wiki: fixed issue where pages for deleted groups caused an error on restore 2013-10-28 12:34:37 +08:00
Damyon Wiese 43fed596e5 Merge branch 'wip-mdl-30812-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-28 12:10:09 +08:00
Dan Poltawski acb1bf6fac Merge branch 'wip-mdl-42491-m24' of git://github.com/deraadt/moodle into MOODLE_24_STABLE 2013-10-28 11:33:36 +08:00
Prateek Sachan 6a748d5e8b MDL-38850: Fixed Horizontal bar issue in lesson 2013-10-28 11:09:42 +08:00
Damyon Wiese d0a9524463 Merge branch 'MDL-36818-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-28 10:59:16 +08:00
AMOS bot 42e7fb5e49 Automatically generated installer lang files 2013-10-28 00:46:46 +00:00
Eloy Lafuente (stronk7) 5c550aaafc MDL-42551 timezone info: updated to 2013h 2013-10-26 17:15:21 +02:00
Tim Hunt ea6e1851e9 MDL-42548 quiz review: don't show grade for non-finished attempts.
Now we show the attempt state separately, so there is no need to show
Grade: Attempt still in progress - especially since we were showing that
for abandoned and overdue attempts which is just wrong.
2013-10-25 20:11:26 +01:00
Gareth J Barnard bd0d739550 MDL-42270 course: Section name too big message. 2013-10-25 16:40:31 +01:00
Eloy Lafuente (stronk7) 75d8d06ffb weekly release 2.4.6+ 2013-10-25 13:03:31 +02:00
Eloy Lafuente (stronk7) 8c92e24434 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-25 13:03:27 +02:00
Frederic Massart cbd0157d66 MDL-42542 portfolio: Fix handlerfile in portfolio event handler 2013-10-25 16:02:21 +08:00
Frederic Massart c9bcb47d54 MDL-42533 conditionlib: Field name is translated for students 2013-10-25 09:52:02 +08:00
Michael de Raadt c58f3ed7ff MDL-42491 libraries: add exception for IE11 (and hopefully later versions) 2013-10-25 09:00:19 +08:00
Eloy Lafuente (stronk7) 3b34d79d36 Merge branch 'MDL-42377_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-25 01:13:08 +02:00
Dan Poltawski 8f19a957e2 Merge branch 'MDL-42338_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-10-24 16:29:19 +08:00
Marina Glancy 94cc2c769c Merge branch 'MDL-35402_editor_rules_24' of git://github.com/davosmith/moodle into MOODLE_24_STABLE 2013-10-24 15:31:12 +11:00
rwijaya 4f718dc60c MDL-42338 lti_mod: convert hardcoded string. 2013-10-24 10:34:20 +08:00
sam marshall d1b0786a51 MDL-34654 Glossary: ampersand breaks auto-linking 2013-10-23 16:22:25 +01:00
David Mudrák 1cdd43b12b MDL-42494 Fix workshop coding exception if all assessments have zero weight
If all assessments for the given submission have zero weight, the grading
evaluation plugin "Comparison with the best assessment" is unable to decide on
the average assessment as it ignores those with zero weight. In such rare case,
it makes sense to set the grading grade to null and prevent the coding
exception.
2013-10-23 11:51:37 +02:00
Damyon Wiese b807cc6334 Merge branch 'MDL-42210_24' of git://github.com/grabs/moodle into MOODLE_24_STABLE 2013-10-23 14:19:42 +08:00
Ankit Agarwal 8cbfc9614a MDL-42489 backup: use correct exception class in automated backups 2013-10-23 13:56:08 +08:00
Damyon Wiese 9de894db2d Merge branch 'w43_MDL-42208_m24_authunmask' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-23 13:42:26 +08:00
Dan Poltawski 7a2db63954 Merge branch 'MDL-40531_24' of https://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-10-23 12:36:38 +08:00
Ankit Agarwal 8a3894de89 MDL-42427 backup: Fix undefined errors during automated backups 2013-10-23 12:10:14 +08:00
Damyon Wiese 60ca7d5b07 MDL-41339 Tags - use uppercase for SQL keywords (AS) 2013-10-23 11:58:48 +08:00
Damyon Wiese 697ecc6db1 Merge branch '24STABLE-wip-mdl-41339' of https://github.com/jennymgray/moodle into MOODLE_24_STABLE 2013-10-23 11:55:33 +08:00
Marina Glancy e2536570a3 Merge branch 'w43_MDL-37813_m24_filterall' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-23 10:18:47 +11:00
Dan Poltawski af90211efd Merge branch 'MDL-42112-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-10-22 16:45:17 +08:00
Mark Nelson 78855a6c7b MDL-42465 mod_chat: instantiated message object before declaring properties 2013-10-22 16:12:20 +08:00
Dan Poltawski 1640389bcf Merge branch 'MDL-29441-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-22 13:21:27 +08:00
Marina Glancy a70c9434d7 Merge branch 'MDL-26170_rss_24' of https://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-10-22 15:04:25 +11:00
Andrew Davis 441b8d6e69 MDL-26170 RSS: fixed RSS cache clearing when items are deleted 2013-10-22 10:59:03 +07:00
Rajesh Taneja de61d99ad1 MDL-31405 Assignment: removed type in time shift reset status
Assignment reset shifts time for all assignments and not specific to
assignment type, hence removed type string from reset status
2013-10-22 11:54:23 +08:00
Marina Glancy f311ba2714 Merge branch 'MDL-24380-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-10-22 14:35:09 +11:00
Marina Glancy 06032cd928 Merge branch 'MDL-42239-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-22 14:09:05 +11:00
Ankit Agarwal d05a5b126c MDL-42239 calendar: Fix missing ids issue with mouseover panels 2013-10-22 10:46:02 +08:00
Jerome Mouneyrac 45e4351ade MDL-24380 Chat: autoscroll help popup incorrect and doesn't display fully (it only concerns the alternative chat methods) 2013-10-22 10:45:27 +08:00
Dan Poltawski 2811b3d262 Merge branch 'MDL-42201_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-22 10:30:43 +08:00
Rajesh Taneja 0cb2846998 MDL-34612 Restore: Gracefully handle empty file contenthash while restoring 2013-10-22 09:49:01 +08:00
Rajesh Taneja 4db1863687 MDL-34612 Restore: Gracefully handle empty section title while restoring 2013-10-22 09:49:01 +08:00
AMOS bot 4a256d6e8e Automatically generated installer lang files 2013-10-22 00:45:44 +00:00
Mary Evans 44666a2d31 MDL-42453 theme_base: Fixed Error in base/style/admin.css that breaks CSS validator. 2013-10-21 15:39:28 +01:00
Dan Poltawski a122d95343 Merge branch 'MDL-34209-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-21 13:58:40 +08:00
rwijaya af11bd26b6 MDL-38664 Lesson mod: code improvement for lesson re-attempt page 2013-10-21 13:54:28 +08:00
Joseph Rézeau b8aa36a063 MDL-38664 Lesson mod: fixed re-attempt unseen page 2013-10-21 13:54:16 +08:00
Jody Steele a10d621fc5 MDL-38628 mod_assign: Allow a user to specify "No Grade" when grading an assignment submission 2013-10-21 16:51:33 +11:00
Marina Glancy a322a0ab53 Merge branch 'w43_MDL-42386_m24_etag' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-21 16:00:53 +11:00
Mark Nelson 969d8f0e3f MDL-42377 backup: fixed incorrect debugging message 2013-10-21 11:55:30 +08:00
Mark Nelson 36cfbfe841 MDL-42201 backup: introduced new automatic backup state 2013-10-21 11:49:07 +08:00
Andrew Nicols 314cc22a28 MDL-34209 JavaScript: Simplify section drag/drop to fix reordering issues 2013-10-21 11:42:43 +08:00
Dan Poltawski bd1fae5fc0 Merge branch 'MDL-26244_url_24' of https://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-10-21 11:25:27 +08:00
rwijaya ac23be5d24 MDL-42111 TinyMCE media preview: fix video preview display for TinyMCE media.
Effected themes: boxxie, clean, brick, formal_white and splash.
2013-10-21 11:12:45 +08:00
Dan Poltawski 6e72e0a6aa MDL-31405 assign: avoid uncessary get_string call 2013-10-21 11:02:45 +08:00
Dan Poltawski 57bafe6ebc Merge branch 'wip-mdl-31405-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-21 10:59:00 +08:00
Andreas Grabs 4ae00d74bc MDL-42210 mod_feedback - convert tabs to space 2013-10-20 10:04:10 +02:00
Michael Milette 60293b276a MDL-42210-Feedback-Input-Labels
Adds labels to the input fields in the Feedback module including: multichoice, multichoicerated, numeric, textarea and textfield.
2013-10-20 10:04:08 +02:00
Charles Severance 4673a6a8fc MDL-40531 mod_lti: Various 1.1/1.1.1 fixes.
Conflicts:
	mod/lti/service.php
2013-10-19 03:04:59 +02:00
Sam Chaffee ce5a85c354 MDL-40531 mod_lti: Changed namespace in XML to IMS LTI compliant 2013-10-19 03:04:47 +02:00
AMOS bot ff952aa064 Automatically generated installer lang files 2013-10-19 00:47:36 +00:00
Petr Škoda 675fa4b813 MDL-37813 remove missing filters when configuring string filters and fix filter uninstall 2013-10-18 15:59:22 +02:00
Petr Škoda 73b0524202 MDL-42208 prevent autocompletion in auth configs 2013-10-18 15:09:17 +02:00
Petr Škoda 58c57f94d6 MDL-42386 fix invalid etag comparison
Credit goes to Eloy Lafuente, thanks!
2013-10-18 14:49:49 +02:00
Dan Poltawski b6ced2f7e4 weekly release 2.4.6+ 2013-10-18 16:16:43 +08:00
Dan Poltawski 6123c76bc7 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-18 16:16:34 +08:00
Tony Levi 8beb495df4 MDL-38734: Automated backup failure causing all course to fail 2013-10-18 15:05:00 +08:00
Damyon Wiese 90b46f39a4 Merge branch 'MDL-41554-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-18 13:27:19 +08:00
Dan Poltawski 1f3a85aa54 MDL-41554 rss: Move to more robust test url
tinyurl was sometimes failing (was bad to use them anyway)
2013-10-18 12:47:44 +08:00
Dan Poltawski 98e4f24ff6 Merge branch 'MDL-42421_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-18 12:15:43 +08:00
Damyon Wiese 48763c4d21 MDL-42112 tablelib: Generate the correct number of cols for empty rows
(And a test for it).
2013-10-18 11:56:06 +08:00
Damyon Wiese d91225aae4 MDL-42112 Tablelib: Add unit tests (some) 2013-10-18 11:56:03 +08:00
Mark Nelson a5436ae8ce MDL-42421 auth: removed incorrect statement in upgrade.txt 2013-10-18 11:38:56 +08:00
Jenny Gray 7a9000b1ff MDL-41339 Tags: Added unique tag instance id to tag_get_tags functions
Avoids php warnings on creating new tags
2013-10-17 14:03:30 +01:00
Damyon Wiese 85d47590cc Merge branch 'MDL-42065_24' of https://github.com/sam-moodle/moodle into MOODLE_24_STABLE 2013-10-16 15:48:19 +08:00
Damyon Wiese 8789750cc5 Merge branch 'MDL-37528-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-16 11:16:45 +08:00
Andrew Davis b15478526a MDL-26244 mod_date:added some logic show or hide the file picker button based on repository availability 2013-10-16 08:33:39 +07:00
Eloy Lafuente (stronk7) 8786deb033 MDL-37877 backup: fix incorrect backported code. 2013-10-16 00:32:00 +02:00
Davo Smith 59e8879130 MDL-35402 forms - prevent crash when multiple rules defined on an editor element 2013-10-15 14:34:40 +01:00
Damyon Wiese e81aa9e8e6 Merge branch 'MDL-37877-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-15 16:58:39 +08:00
Dan Poltawski 8a2e491ee7 Merge branch 'MDL-42209_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-15 14:43:21 +08:00
Ankit Agarwal 3a6857090e MDL-37877 backup: Fix issues with zipping of large files
Files bigger than 4GB is not supported at this point. Zip archiver doesn't know about it and always returns true. We need to verify if it is a valid file or not and delete if not
Also delete the backup file immediately if anything goes wrong anywhere in backup. We don't want to use up space
2013-10-15 13:18:46 +08:00
Marina Glancy d2ff78d173 Merge branch 'wip-MDL-42234-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-10-15 14:11:58 +11:00
Tim Hunt ef37c13e29 MDL-42309 typo: fix reponse -> response throughout Moodle. 2013-10-15 13:50:05 +11:00
Adrian Greeve a8d816982a MDL-42234 - Repositories: Fix undefined variable notice when no repositories are enabled. 2013-10-15 10:47:22 +08:00
Dan Poltawski ac7f6f4b96 Merge branch 'w42_MDL-42082_m24_authdbpass' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-14 14:36:29 +08:00
FilipBenco 6da08c0e2c MDL-42209 backup: fixed wrong icon being displayed when restoring course 2013-10-14 14:33:19 +08:00
Damyon Wiese f72e3fbbf2 MDL-34586 assignment - fix whitespace 2013-10-14 14:29:22 +08:00
Damyon Wiese 8afe4de645 Merge branch 'MDL-34586-24' of https://github.com/mackensen/moodle into MOODLE_24_STABLE 2013-10-14 14:29:14 +08:00
Dan Poltawski 1fc88334a6 Merge branch 'MDL-42232_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-10-14 14:24:17 +08:00
Damyon Wiese 7643bd4ca9 Merge branch 'MDL-34612-24' of https://github.com/mackensen/moodle into MOODLE_24_STABLE 2013-10-14 14:12:23 +08:00
Damyon Wiese 1b9f0beaf3 Merge branch 'MDL-41170-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-14 14:04:18 +08:00
Ankit Agarwal 993612b00e MDL-41170 events: Update upgrade.txt to reflect changes made in MDL-41170 2013-10-14 13:24:05 +08:00
Akinsaya Delamarre 4eb084f1a2 MDL-41170: Added user updated event triggers to password updating functions. 2013-10-14 13:22:15 +08:00
Dan Poltawski 34b3d144fe Merge branch 'MDL-41672-text-mail-links_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-10-14 12:12:17 +08:00
Thijs Kinkhorst c61decc816 MDL-36818 cas: improve SSL validation 2013-10-14 10:12:53 +08:00
Eloy Lafuente (stronk7) 5864eb6017 Merge branch 'wip-mdl-41843-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-14 00:15:29 +02:00
Eloy Lafuente (stronk7) d9131593c7 Merge branch 'MDL-37181_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-13 23:32:55 +02:00
Andrew Nicols 16e566b99f MDL-29441 Chat: Use a valid name for chat popup actions 2013-10-13 20:08:04 +08:00
Petr Škoda bd010f8854 MDL-42110 do not show auth_db password in plaintext 2013-10-12 13:49:54 +02:00
AMOS bot a364f61121 Automatically generated installer lang files 2013-10-12 00:43:51 +00:00
Tim Hunt cf2fb7579b MDL-42232 Multiple choice question choice alignment issue
The problem was with the alignment of:
* tables inside the choices.
* Lists inside the choices.
* The specific feedback, when it spanned mulitple lines.

The problem was introduced by MDL-39420.
2013-10-11 14:26:34 +01:00
Eloy Lafuente (stronk7) 945aa97617 weekly release 2.4.6+ 2013-10-11 13:20:55 +02:00
Rajesh Taneja ca4349c1ce MDL-31405 Assignment: Fixed date in reset to be called once
Conflicts:

	mod/assign/locallib.php
2013-10-11 08:59:02 +08:00
Jayesh Anandani 267b45e0a1 MDL-31405 Assignment reset issue solved 2013-10-11 08:58:29 +08:00
Andrew Nicols 4c53ec3355 MDL-37528 Libraries: Fix gesture + mouse issues with YUI
This addresses issues with devices which support both mouse and gesture
input devices whereby the presence of gesture support on the device causes
mouse interactions to be ignored.

This has the potential to cause issues with multiple events being triggered
for the same action, but we do not have this issue in core, and few
third-party plugins support drag and drop in such a way that this may be an
issue.

This is fixed in the latest version of YUI in a similar way, and the
addition of a new system to only trigger the event from the first action to
be triggered.
2013-10-10 17:14:02 +08:00
Marina Glancy 7bd19d562d Merge branch 'MDL-37153_24' of https://github.com/pauln/moodle into MOODLE_24_STABLE 2013-10-10 12:53:27 +11:00
Sam Hemelryk 49e3cda704 Merge branch 'wip-mdl-41744-m24' of https://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-10 14:39:24 +13:00
Sam Chaffee e8ec840f3c MDL-42065 core_grade: Modified some grade_item queries for improved performance
* Modified 2 queries in grade_item::depends_on to improve performance
* Added additional unit tests to cover those queries better
2013-10-09 12:34:29 -06:00
Alain Corbière 0c018318c6 MDL-41672 Fix html2text processing of multiple occurrences of the same URL 2013-10-09 15:49:21 +02:00
David Mudrák 3bd02768df MDL-41672 Add html2text unit test for multiple occurrences of the same URL 2013-10-09 15:49:12 +02:00
Dan Poltawski 39adfbde72 Merge branch 'w41_MDL-42054_m24_phpmailertesting_i' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-09 18:20:13 +08:00
Petr Škoda a42e313460 MDL-42054 fix incorrect email redirection in unit tests 2013-10-09 11:57:04 +02:00
Dan Poltawski d6b99cf123 Merge branch 'MDL-39776-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-10-09 16:54:30 +08:00
Dan Poltawski 77eb24f886 Merge branch 'm24_MDL-40226_Add_JNLP_MIME_Type_Support' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-10-09 16:48:44 +08:00
Damyon Wiese d4609de200 Merge branch 'w41_MDL-42047_m24_cohortdel' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-09 14:44:25 +08:00
Mark Nelson 6c2d9137b3 MDL-37181 backup: stopped setting the status of unscheduled backups to skipped 2013-10-09 14:16:03 +08:00
Damyon Wiese 5dc182dd6e Merge branch 'wip-MDL-41967-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-10-09 13:12:41 +08:00
Jason Fowler 88e2d12038 MDL-39776 Javascript - enable formautosubmit from a select box on android 2013-10-09 11:39:11 +08:00
Charles Fulton b6a84b6fdd MDL-34612 forum: convert default format value during restore 2013-10-08 20:05:35 -07:00
Paul Nicholls 3e2821e6f5 MDL-37153 - assign: Obey grade display settings in submission status
The assignment submission status screen was ignoring the grade item's
display setting, showing scores even if it's set to display letters only.
2013-10-09 16:03:50 +13:00
Tim Lock d93610d4b0 MDL-41908 QuickForm: Fix PEAR Non-static method error 2013-10-09 10:27:30 +08:00
James Henestofel 34d55059cb MDL-42068 Filepicker course listing use setting courselistshortname to show shortname and fullname 2013-10-09 01:27:33 +02:00
Eloy Lafuente (stronk7) 6257097a3f Merge branch 'MDL-42069_24' of https://github.com/appalachianstate/moodle into MOODLE_24_STABLE 2013-10-08 21:27:27 +02:00
Charles Fulton cd35f43eac MDL-34586 assignment: convert default format value during restore 2013-10-08 09:48:56 -07:00
Rajesh Taneja 788105dd3d MDL-41843 IMS-LTI: Fixed exception namespace 2013-10-08 15:56:52 +08:00
Dongsheng Cai 80cee53996 MDL-41843 Uses OAuthException in moodle\mod\lti namespace 2013-10-08 15:56:52 +08:00
Damyon Wiese dd94734d9a Merge branch 'MDL-41520-MOODLE_24_STABLE-mod_lti-completion-view' of github.com:Trii/moodle into MOODLE_24_STABLE 2013-10-08 14:34:49 +08:00
Damyon Wiese 786538f74f Merge branch 'MDL-32570-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-08 13:46:42 +08:00
Dan Poltawski 925ec67b22 Merge branch 'MDL-38655_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-10-08 13:21:44 +08:00
Marina Glancy b159b57207 Merge branch 'MDL-25176_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-10-08 12:04:12 +11:00
Petr Škoda c01c608fdc MDL-41197 normalize ascii text conversion 2013-10-08 00:04:46 +02:00
Frederic Massart ca887bc9bc MDL-22669 course: Display section number for orphaned activities 2013-10-07 16:52:29 +08:00
Sam Hemelryk 2ff9ac5608 MDL-41197 fix unit tests 2013-10-07 14:16:25 +13:00
Matteo Scaramuccia f63fc5c41a MDL-40226 Files: Added the correct MIME Type for JNLP files.
JNLP stands for Java Network Launch Protocol, used to launch
Java Web Start applications. More details in:
http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
2013-10-06 16:45:16 +02:00
Joshua Johnston d276541169 MDL-41520 LTI: Does not track page views for completion 2013-10-04 09:47:14 -04:00
Fred Woolard 72b266d54e MDL-42069 mod_quiz add lastname sort for manual grading 2013-10-04 09:09:00 -04:00
Petr Škoda 8f3702ee1a MDL-42047 fix cohort method name error after deleting cohort 2013-10-04 11:33:23 +02:00
Petr Škoda 54b951fb5f MDL-41197 ignore all problems when converting texts 2013-10-04 11:13:00 +02:00
Sam Hemelryk 9844660858 weekly release 2.4.6+ 2013-10-04 15:43:43 +13:00
Sam Hemelryk d0012b72ad Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-04 15:43:38 +13:00
Rajesh Taneja 623b678c3e MDL-41744 Users: Convert key to value in bulk upload
Menu profile field expects value, during bulk upload if value is passed by form
then options key is passed. So converting key to value if passed though form
2013-10-03 10:18:55 +08:00
Sam Hemelryk 75f6d03855 Revert "MDL-33569 themes: Labels create extra margin below content."
This reverts commit 05c3b5dd2f.
2013-10-03 14:43:51 +13:00
Eric Merrill 236a2fca9b MDL-25176 forum Redirects for new discussions shouldn't use SESSION
Unset the session->fromdiscussion var, because we know that the correct
path will be computed later.
2013-10-01 21:19:17 -04:00
Tim Lock a7c5e2d24d MDL-41996: Don't show the Review Attempt link if no attempts exist. 2013-10-01 20:05:12 +02:00
Eloy Lafuente (stronk7) 4ae75c1847 Merge branch 'w40_MDL-41999_m24_userpw' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-01 15:59:24 +02:00
Marina Glancy d7788d69f6 Merge branch 'MDL-32592-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-01 20:49:41 +10:00
Marina Glancy a033a6b4c1 Merge branch 'MDL-39653-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-01 20:44:07 +10:00
Adrian Greeve 0626a71686 MDL-41967 - Gradebook: Fixed an sql syntax error for gradebook custom profile fields. 2013-10-01 18:00:41 +08:00
Dan Poltawski 756fbd91fd MDL-32570 enrol_imsenterprise: don't hardcode default category id 2013-10-01 11:52:46 +08:00
Sam Hemelryk 3b5c7727f2 MDL-41828 mod: fixed navbar when adding modules to a course 2013-10-01 13:34:01 +10:00
Sam Hemelryk e5b13b7fc0 MDL-41900 events: avoid new debug call within unit tests 2013-10-01 16:21:19 +13:00
Sam Hemelryk 49c29a3f46 Merge branch 'MDL-41995_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-01 14:49:55 +13:00
Sam Hemelryk 92fdea041d Merge branch 'MDL-41900-m24' of git://github.com/micaherne/moodle into MOODLE_24_STABLE 2013-10-01 14:35:27 +13:00
Sam Hemelryk a7fd949571 Merge branch 'MDL-41894-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-01 13:44:44 +13:00
AMOS bot 32d77062b4 Automatically generated installer lang files 2013-10-01 00:41:49 +00:00
Sam Hemelryk 92416730d1 Merge branch 'MDL-37973_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-10-01 09:53:19 +13:00
Eloy Lafuente (stronk7) 4b95721a26 Merge branch 'MDL-26408-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-09-30 16:01:55 +02:00
Marina Glancy 29d526b495 Merge branch 'MDL-41954-workshop-zero-variance_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-30 16:11:44 +10:00
Adam Olley 227d3fcbd3 MDL-40515: report_log: List activities in optgroups 2013-09-30 11:20:44 +09:30
Mary Evans 05c3b5dd2f MDL-33569 themes: Labels create extra margin below content.
Conflicts:

	theme/bootstrapbase/less/moodle/course.less
2013-09-28 16:15:12 +01:00
Petr Škoda cf55843d07 MDL-41999 do not use $USER->password directly 2013-09-27 10:55:12 +02:00
Marina Glancy c7c613b45b weekly release 2.4.6+ 2013-09-27 14:50:19 +10:00
Marina Glancy 06450ed398 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-09-27 14:49:38 +10:00
Dan Poltawski 3d986cf8cd MDL-39653 enrol_imsenterprise: only mail admins on change
The existing beavhiour was sending useless emails to admins and
generating warnings.

Thanks to Matthew Orlando for the suggested fix.
2013-09-27 12:23:37 +08:00
Adam Olley 6e3013be7c MDL-38655: mod_assign: Use correct ordering on cap checks for submission downloads 2013-09-27 12:45:47 +09:30
Mark Nelson 63b66cf276 MDL-41995 calendar: moved the location the page layout was set for the export page
This was done so that the blocks are shown when logged in and viewing this page.
2013-09-26 17:04:30 +08:00
Dan Poltawski aaf95d0161 MDL-32592 enrol_imsenterprise: fix error when category not defined
thanks to Henrik Thorn for the fix
2013-09-26 14:59:08 +08:00
Dan Poltawski 473aab4ffb MDL-26408 enrol_imsenterprise: fix invalid component 2013-09-26 12:21:42 +08:00
Petr Škoda 2504a9d2ec MDL-41223 do not store any form of login URL in $SESSION->wantsurl
Credit goes to Michael Milette, thanks.
2013-09-25 10:58:39 +10:00
Matt Petro a24c22cd12 MDL-41660 backup ims-cc: Use correct temp directory 2013-09-25 02:16:05 +02:00
David Mudrák 2ccad8f967 MDL-41954 Fix the grade for assessment calculation in the Workshop module
In a pretty rare case of zero variance of received assessments, the "distance"
of the evaluated assessment from the referential ("best") one was not increased
regardless it's actual value. This led to higher grades for assessments in
certain situations (see the tracker for a particular example).
2013-09-25 02:03:02 +02:00
Eloy Lafuente (stronk7) b152769f44 Merge branch '40903-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-09-25 02:00:47 +02:00
Sam Hemelryk 77b4970559 Merge branch 'MDL-41907_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-09-25 10:17:55 +12:00
Marina Glancy 8492c192af Merge branch 'MDL-41929_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-09-24 21:33:12 +10:00
Sam Hemelryk f621e8e3d8 MDL-40903 cached: fixed up versions 2013-09-24 21:13:22 +12:00
Sam Hemelryk 5a804c0f54 MDL-40903 cache: renamed persistcache to staticacceleration 2013-09-24 21:13:22 +12:00
Sam Hemelryk bfff058cc8 MDL-40903 cache: fixed up event invalidation 2013-09-24 21:13:22 +12:00
Marina Glancy 9e72a16e14 MDL-40903 cache: Unittests and small fixes for persistent application cache 2013-09-24 21:13:22 +12:00
Sam Hemelryk 90317c258b MDL-40903 cache: coding style tidyup pre-integration 2013-09-24 21:13:22 +12:00
Sam Hemelryk fcb5548c38 MDL-40903 cache: converted persistent into persistentdata
At the same time all cache instances were made persistent
2013-09-24 21:13:21 +12:00
Ankit Agarwal 654f0c0cf7 MDL-41894 feedback: Remove unused code, which is generating warnings 2013-09-24 15:08:33 +08:00
AMOS bot 402469ce8b Automatically generated installer lang files 2013-09-24 00:42:02 +00:00
Sam Hemelryk fb092979bf Merge branch 'MDL-36465-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-09-24 08:32:46 +12:00
Tim Hunt 768779972e MDL-41929 quiz statistics, overall stats not displayed. 2013-09-23 18:07:25 +01:00
Marina Glancy b0124c9703 Merge branch 'MDL-41833-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-09-23 19:18:05 +10:00
Andrew Nicols d2674929ba MDL-36465 Course JavaScript: Ensure that the zero section is not draggable 2013-09-23 09:19:11 +01:00
Marina Glancy 47ba8d481e Merge branch 'wip-MDL-41772-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-09-23 14:41:22 +10:00
AMOS bot 814054616f Automatically generated installer lang files 2013-09-21 00:42:40 +00:00
Sam Hemelryk 7bc37de925 weekly release 2.4.6+ 2013-09-20 14:42:53 +12:00
Sam Hemelryk 0f00c5c594 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-09-20 14:34:56 +12:00
Eric Merrill 4b8ed14f54 MDL-41907 Repositories: Maintain the sortorder of a file when overwriting it. 2013-09-19 18:47:42 -04:00
Eric Merrill 9840da227e MDL-37973 gradebook Return a maxgrade of '-' if grade type is TEXT
Including tests for correct return from
grade_edit_tree_column_range->get_item_cell()

This commit includes some special code just for 2.4 in the test
related to a bug in assign.
2013-09-19 11:28:40 -04:00
Michael Aherne 4948ac2e0c MDL-41900 events Log handler failures 2013-09-19 15:58:06 +01:00
AMOS bot 954b1b5504 Automatically generated installer lang files 2013-09-19 00:44:12 +00:00
AMOS bot 9e81532432 Automatically generated installer lang files 2013-09-18 00:45:34 +00:00
Eloy Lafuente (stronk7) 6726f0073e Merge branch 'MDL-41728-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-17 21:18:48 +02:00
Ankit Agarwal 5011fb91ff MDL-41833 feedback: Fix setType() warning when deleting a response in feedback 2013-09-17 15:30:07 +08:00
Eloy Lafuente (stronk7) 657beb8924 Merge branch 'MDL-41595_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-09-17 02:15:42 +02:00
Sam Hemelryk 1d5c188798 Merge branch 'MDL-38317-moodle24' of git://github.com/StudiUM/moodle into MOODLE_24_STABLE 2013-09-17 08:38:51 +12:00
Sam Hemelryk ac7cbc012e Merge branch 'MDL-38194-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-16 13:54:52 +12:00
AMOS bot 05f1cccc37 Automatically generated installer lang files 2013-09-16 00:40:28 +00:00
Sam Hemelryk 1081b8ec84 Merge branch 'm24_MDL-37524' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-09-16 10:38:25 +12:00
Sam Hemelryk af0a06b521 Merge branch 'wip-MDL-27684-MOODLE_24_STABLE' of git://github.com/satrun77/moodle into MOODLE_24_STABLE 2013-09-16 10:26:50 +12:00
Dan Marsden 9963b0b6a6 MDL-37524 SCORM: mode not calculated correctly. 2013-09-16 10:13:47 +12:00
Sam Hemelryk d7b20f1650 Merge branch 'MDL-29987_24' of https://github.com/bostelm/moodle into MOODLE_24_STABLE 2013-09-16 10:12:51 +12:00
Sam Hemelryk 694cb9b053 Merge branch 'MDL-41534-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-16 09:40:00 +12:00
AMOS bot 14dcbdb0f4 Automatically generated installer lang files 2013-09-15 00:39:09 +00:00
AMOS bot 38753adc60 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-14 00:41:38 +00:00
sam marshall da7c844c30 MDL-38194 Files: Allow download of large backup files
The PHP readfile function does not work for files more than 2GB.
This commit provides a wrapper that can be used so that files less
than 2GB are sent with readfile, and files larger than 2GB are
sent manually.

The change applies to all uses of pluginfile.php, although in
reality, backup files are probably the only ones likely to be more
than two gigabytes.
2013-09-13 16:01:58 +01:00
Jean-Philippe Gaudreau 0f6d896e43 MDL-38317 grade import: Translation support for import mappings form. 2013-09-13 08:51:35 -04:00
Henning Bostelmann 0137a13d55 MDL-29987 File resource: fix problem with PDF display on mobile devices
Setting the default display option for PDF files from DISPLAY_EMBED to DISPLAY_OPEN
2013-09-13 10:28:41 +01:00
Adrian Greeve 254bf485f1 MDL-41772 - mod_data: Fixed database_module comments not being restored. 2013-09-13 15:35:32 +08:00
Damyon Wiese e81fce929a weekly release 2.4.6+ 2013-09-13 14:07:27 +08:00
Mohamed Alsharaf c1536ff1ef MDL-27684 repository: make require_login() throws exception instead of redirect 2013-09-13 16:06:51 +12:00
Damyon Wiese 43e1ed2cf3 MDL-37804 assign: Return proper notice when submissions closed.
MDL-38267 was returning the html page when it should have been adding to the list
of notices and returing false.

Conflicts:

	mod/assign/locallib.php
2013-09-12 10:38:45 +08:00
Damyon Wiese 46f15f03d2 MDL-41534 theme: Missed backporting a style to hide empty table rows 2013-09-12 09:27:02 +08:00
sam marshall 0cddce2c56 MDL-41728 Backup: Unnecessary use of in_array in base_plan
Remove unnecessary use of in_array which causes performance problems
when loading the plan for very large courses.
2013-09-11 14:38:37 +01:00
Dan Poltawski 18cbf0db95 Merge branch 'MDL-38267-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-11 12:00:15 +08:00
Sam Hemelryk 3b2c61fdb8 Merge branch 'MDL-41658_M24' of git://github.com/kordan/moodle into MOODLE_24_STABLE 2013-09-11 09:42:14 +12:00
Matthew Noorenberghe d64a0e9173 MDL-41634 - URL Download Repository doesn't warn when asked to download non-image files 2013-09-11 09:37:40 +12:00
Sam Hemelryk c88b113c1f Merge branch 'MDL-41528_MOODLE_24_STABLE' of https://github.com/nitzo/moodle into MOODLE_24_STABLE 2013-09-11 09:26:02 +12:00
Sam Hemelryk aa6699f4db Merge branch 'MDL-41630-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-09-11 09:20:27 +12:00
Rajesh Taneja 1e557db89d MDL-41590 Enrolments: If course is deleted, then use courseid for reference 2013-09-11 08:47:04 +12:00
Dan Poltawski 5e99c1f9a1 Merge branch 'MDL-40631-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-10 14:32:00 +08:00
Dan Poltawski 84197f41ca Merge branch '41189-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-09-10 14:12:30 +08:00
Damyon Wiese b604cb81e4 Merge branch 'wip-mdl-23335-m24' of https://github.com/deraadt/moodle into MOODLE_24_STABLE 2013-09-10 12:56:53 +08:00
Damyon Wiese 05f853e2db MDL-41497 auth_db: Fix typo in lang string. 2013-09-10 12:24:55 +08:00
Damyon Wiese a77864208e Merge branch 'MDL-41497-24' of https://github.com/willylee/moodle into MOODLE_24_STABLE 2013-09-10 12:23:17 +08:00
Dan Poltawski 4b3521ec69 Merge branch 'MDL-28561_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-09-10 12:05:10 +08:00
Damyon Wiese 294673628e Merge branch 'MDL-41451_24' of https://github.com/pauln/moodle into MOODLE_24_STABLE 2013-09-10 11:58:41 +08:00
Damyon Wiese 081e303415 Merge branch 'MDL-41626-moodle24' of github.com:StudiUM/moodle into MOODLE_24_STABLE 2013-09-10 09:30:14 +08:00
Sam Hemelryk b14d0e4713 Merge branch 'MDL-41600_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-09-10 13:11:21 +12:00
AMOS bot d2dc75fb4e Automatically generated installer lang files 2013-09-10 00:41:04 +00:00
Adam Olley 7c95cf02af MDL-41600: qformat_blackboard_six Fix test_import_match fail w/ddmatch
With qtype_ddmatch installed, the unit tests for qformat_blackboard_six
fail as they generate ddmatch questions instead of match ones. This
patch checks for ddmatch and changes the test to expect that instead if
its installed.
2013-09-10 09:16:29 +09:30
Sam Hemelryk a7f3f08722 MDL-32862 backup: fixed missing global 2013-09-10 10:40:11 +12:00
Sam Hemelryk 5db72d63c5 Merge branch 'wip-MDL-32862-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-09-10 09:38:23 +12:00
Sam Hemelryk d58d0239db Merge branch 'MDL-29378-survey-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-10 09:35:50 +12:00
Dan Poltawski e9ea8e9b63 Merge branch 'MDL-41254-m24' of git://github.com/micaherne/moodle into MOODLE_24_STABLE 2013-09-09 18:04:48 +08:00
David Mudrák e523503fb8 MDL-29378 Fix the recent string modification
But accident, I have modified the string 'collesaintro' in the previous patch.
The correct string to be amended is 'collesapintro'.
2013-09-09 11:22:14 +02:00
Dan Poltawski 4da2fefa4d Merge branch 'MDL-37804_24' of github.com:recreate/moodle into MOODLE_24_STABLE 2013-09-09 17:13:49 +08:00
Mary Evans 0f85e6ba0b MDL-41595 mod_book: Book mod does not add TOC to default region 2013-09-09 09:52:43 +01:00
Dan Poltawski 8baa0cab98 Merge branch 'MDL-41163-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-09 15:39:58 +08:00
Damyon Wiese 5a730d0a80 Merge branch 'wip-MDL-41517-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-09-09 12:11:10 +08:00
Damyon Wiese 5a36d6292d Merge branch 'm24_MDL-31232' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-09-09 11:13:27 +08:00
Sam Hemelryk b7a4701d1f MDL-41417 course: fixed idnumbertaken string 2013-09-09 12:15:59 +12:00
Paul Nicholls 6cb665f18c MDL-41451 - formslib: use create_function instead of inline function
As per MDL-39432, closure-style inline functions can result in fatal
errors when using eAccelerator and thus should be avoided.
2013-09-09 11:41:17 +12:00
Sam Hemelryk eae5890112 Merge branch 'MDL-38794_24' of https://github.com/prateeksachan/moodle into MOODLE_24_STABLE 2013-09-09 11:12:11 +12:00
Sam Hemelryk fd9ecb595f Merge branch 'MDL-41417_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-09-09 10:50:56 +12:00
Sam Hemelryk 1fdc20cbdb Merge branch 'MDL-29378-survey-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-09 10:48:49 +12:00
Sam Hemelryk 1830fc428c MDL-41189 fixed overflow issue with filepicker thumbnail 2013-09-09 08:24:40 +12:00
kordan c53069c60a MDL-41658 theme_formal_white: text in input select is now never centered (fixed at central level) 2013-09-08 21:08:09 +02:00
AMOS bot 97a0c05d46 Automatically generated installer lang files 2013-09-08 00:43:12 +00:00
AMOS bot 700e92b8d4 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-08 00:43:12 +00:00
Mark Nelson eb57e9e60b MDL-41417 course: allow the use of duplicated idnumbers if they existed before fix 2013-09-06 15:24:43 +08:00
Francis Devine 5f8e23c1a9 MDL-41417 course: prevent duplicate idnumbers being used when updating a course 2013-09-06 15:24:19 +08:00
Adrian Greeve 7ed78289b5 MDL-32862 - Backup: Rewriting resource_old links on backup. 2013-09-06 14:49:08 +08:00
Frederic Massart 77458d700b MDL-41630 oauth: Throw exception instead of dying on error 2013-09-06 14:18:29 +08:00
Paul Nicholls 52b617673c MDL-41451 - Large forms are truncated by max_input_vars
By parsing php://input in chunks, we can bypass max_input_vars for
forms which do not use the "multipart/form-data" enctype.  This can
be (and is) safely skipped if there are fewer than max_input_vars
fields submitted as part of $_POST.
2013-09-06 14:57:03 +12:00
AMOS bot efcbed9b73 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-06 00:47:50 +00:00
Nitzan Bar 2dd8a44c20 MDL-41528 enrol/ldap course default settings when no course template is selected 2013-09-06 02:14:20 +03:00
Jean-Philippe Gaudreau 3b8005fae7 MDL-41626 cas auth: Setting the right url for the multi-authentication page 2013-09-05 16:48:14 -04:00
sam marshall 097abcc59c MDL-41163 Restore: Large course restore timeout on schema page 2013-09-05 17:17:42 +01:00
David Mudrák f257805573 MDL-29378 Code cleanup in the Survey module
While working on the issue, I spotted these two places that were worth of
fixing. The first one is a trivial reminiscence of a previous refactoring,
after which both branches of the if() statement became equal.

The second one is actually a typo as in theory it could generate unexpected
input fields with the name like qPP1. Luckily this never happened due to the
way how survey questions are hardcoded (there are no questions with the type 2
that would require two answers to their subquestions).
2013-09-05 00:09:59 +02:00
David Mudrák 2e5d19ddfc MDL-29378 Fix the form display in the Survey/COLLES P+A module
In MDL-7501, we stopped using rowspanning cells in the form table due to
accessibility. That had introduced a regression so in the COLLES P+A survey,
all the rows were displayed with the same background colour. This patch returns
the previous behaviour that each couple of items can be distinguished by the
background colour.

Also, there is no need to display "I prefer that" and "I found that" as a small
text any more. It had made sense in rowspanning layout but not after MDL-7501
was fixed.

And finally, as all items are enumerated now sequentially, there are actually
48 lines, each couple covering one question in two variants. I think it's
correct to reflect this in the description of the form so the text was slightly
amended.
2013-09-05 00:09:59 +02:00
David Mudrák 708a1cec00 MDL-29378 Fix regression in the Survey/COLLES P+A module
This basically reverts the commit 5196df589b that
I believe was a result of misunderstanding of how question type field is
(ab)used in the Survey module. As it took significant time to get familiar with
the overall logic of questions and their processing in the module, I left my
findings in added inline comments. The point is that it is $question->type that
matters. Types of questions listed as subquestions in the multi field is
irrelevant in that case (and all have it set to 1 IIRC).

This patch re-enables the "COLLES (Preferred and Actual)" survey type that did
not work at all due to regression.
2013-09-05 00:09:59 +02:00
Mary Evans 53165cbc05 MDL-28561 blocks_rss_client: Fixes lines between RSS feed items are not showing in all themes. 2013-09-03 10:23:55 +01:00
Michael de Raadt 557b8de4cf MDL-23335 mod_forum: allow multi-lang filtering of shortened messages
MDL-23335 mod_forum: Correct ordering of filtering and shortening
2013-09-03 13:36:04 +08:00
Marina Glancy f68ebb8282 MDL-41517 Do not call fix_course_sortorder unnecessarily
Thanks to Thomas Worthington
2013-09-03 13:55:04 +10:00
prateeksachan 30d3f1d220 MDL-38267 assign: No Submit button after cut-off date
Conflicts:

	mod/assign/locallib.php
	mod/assign/tests/locallib_test.php
2013-09-02 22:49:42 +08:00
Damyon Wiese a7f94caa2e MDL-40631: Prevent students from submitting empty assignments.
Conflicts:

	mod/assign/locallib.php
	mod/assign/tests/locallib_test.php
2013-09-02 22:02:50 +08:00
Michael Aherne aadac9873b MDL-41254 backup Raise time and memory limit in precheck. 2013-09-02 14:06:44 +01:00
Willy Lee 4a3728ee50 MDL-41497 auth_db: Added help text for using odbc dsn names instead 2013-08-30 10:25:48 -05:00
Willy Lee c959f27415 MDL-41497 enrol_database: Added help text for using odbc dsn names instead 2013-08-30 09:03:41 -05:00
Dan Marsden e727d2aa2a MDL-31232 SCORM: Wrap suspend_data even when no spaces in value. 2013-08-30 20:37:09 +12:00
William Tam 5f11ce035d MDL-37804 mod/assign: Students no longer able to submit files after due date with Prevent late submissions turned on. 2013-05-29 13:30:41 -07:00
prateeksachan 004f868825 MDL-38794 passed overflowdiv parameter 2013-04-17 20:36:28 +05:30
259 changed files with 6899 additions and 3786 deletions
+2 -2
View File
@@ -288,9 +288,9 @@ if (($action == 'edit') || ($action == 'new')) {
// Get list of used plug-ins
$instances = repository::get_types();
// Array to store plugins being used
$alreadyplugins = array();
if (!empty($instances)) {
// Array to store plugins being used
$alreadyplugins = array();
$totalinstances = count($instances);
$updowncount = 1;
foreach ($instances as $i) {
@@ -38,7 +38,7 @@ $string['nolangupdateneeded'] = 'All your language packs are up to date, no upda
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['uninstall'] = 'Uninstall selected language pack(s)';
$string['uninstall'] = 'Uninstall selected language pack';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
+18 -4
View File
@@ -98,12 +98,16 @@ $STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email',
$PRF_FIELDS = array();
if ($prof_fields = $DB->get_records('user_info_field')) {
foreach ($prof_fields as $prof_field) {
$PRF_FIELDS[] = 'profile_field_'.$prof_field->shortname;
if ($proffields = $DB->get_records('user_info_field')) {
foreach ($proffields as $key => $proffield) {
$profilefieldname = 'profile_field_'.$proffield->shortname;
$PRF_FIELDS[] = $profilefieldname;
// Re-index $proffields with key as shortname. This will be
// used while checking if profile data is key and needs to be converted (eg. menu profile field)
$proffields[$profilefieldname] = $proffield;
unset($proffields[$key]);
}
}
unset($prof_fields);
if (empty($iid)) {
$mform1 = new admin_uploaduser_form1();
@@ -331,6 +335,16 @@ if ($formdata = $mform2->is_cancelled()) {
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
// Form contains key and later code expects value.
// Convert key to value for required profile fields.
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
$profilefield = new $profilefieldclass($proffields[$field]->id);
if (method_exists($profilefield, 'convert_external_data')) {
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
}
$formdefaults[$field] = true;
}
}
+2
View File
@@ -376,7 +376,9 @@
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
}
if (!empty($table)) {
echo html_writer::start_tag('div', array('class'=>'no-overflow'));
echo html_writer::table($table);
echo html_writer::end_tag('div');
echo $OUTPUT->paging_bar($usercount, $page, $perpage, $baseurl);
if (has_capability('moodle/user:create', $sitecontext)) {
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
+4 -4
View File
@@ -1370,7 +1370,7 @@ class CASClient
/**
* This method is used to validate a ST; halt on failure, and sets $validate_url,
* $text_reponse and $tree_response on success. These parameters are used later
* $text_response and $tree_response on success. These parameters are used later
* by CASClient::validatePGT() for CAS proxies.
* Used for all CAS 1.0 validations
* @param $validate_url the URL of the request to the CAS server.
@@ -1500,7 +1500,7 @@ class CASClient
/**
* This method is used to validate a SAML TICKET; halt on failure, and sets $validate_url,
* $text_reponse and $tree_response on success. These parameters are used later
* $text_response and $tree_response on success. These parameters are used later
* by CASClient::validatePGT() for CAS proxies.
*
* @param $validate_url the URL of the request to the CAS server.
@@ -2160,7 +2160,7 @@ class CASClient
if ($this->_cas_server_cert != '' && $this->_cas_server_ca_cert != '') {
// This branch added by IDMS. Seems phpCAS implementor got a bit confused about the curl options CURLOPT_SSLCERT and CURLOPT_CAINFO
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLCERT, $this->_cas_server_cert);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
curl_setopt($ch, CURLOPT_VERBOSE, '1');
@@ -2172,7 +2172,7 @@ class CASClient
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
+1 -1
View File
@@ -125,7 +125,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
// test pgtIou parameter for proxy mode (https connection
// in background from CAS server to the php server)
if ($authCAS != 'CAS' && !isset($_GET['pgtIou'])) {
$PAGE->set_url('/auth/cas/auth.php');
$PAGE->set_url('/login/index.php');
$PAGE->navbar->add($CASform);
$PAGE->set_title("$site->fullname: $CASform");
$PAGE->set_heading($site->fullname);
+1 -1
View File
@@ -307,7 +307,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
<label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
</td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
<?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
</td>
<td>
+1 -1
View File
@@ -124,7 +124,7 @@
<tr valign="top" class="required">
<td align="right"><label for="pass"><?php print_string("auth_dbpass_key", "auth_db") ?></label></td>
<td>
<input id="pass" name="pass" type="text" size="30" value="<?php echo $config->pass?>" />
<input id="pass" name="pass" type="password" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
<?php
if (isset($err["pass"])) {
+2 -2
View File
@@ -36,13 +36,13 @@ $string['auth_dbfieldpass'] = 'Name of the field containing passwords';
$string['auth_dbfieldpass_key'] = 'Password field';
$string['auth_dbfielduser'] = 'Name of the field containing usernames';
$string['auth_dbfielduser_key'] = 'Username field';
$string['auth_dbhost'] = 'The computer hosting the database server.';
$string['auth_dbhost'] = 'The computer hosting the database server. Use a system DSN entry if using ODBC.';
$string['auth_dbhost_key'] = 'Host';
$string['auth_dbchangepasswordurl_key'] = 'Password-change URL';
$string['auth_dbinsertuser'] = 'Inserted user {$a->name} id {$a->id}';
$string['auth_dbinsertuserduplicate'] = 'Error inserting user {$a->username} - user with this username was already created through \'{$a->auth}\' plugin.';
$string['auth_dbinsertusererror'] = 'Error inserting user {$a}';
$string['auth_dbname'] = 'Name of the database itself';
$string['auth_dbname'] = 'Name of the database itself. Leave empty if using an ODBC DSN.';
$string['auth_dbname_key'] = 'DB name';
$string['auth_dbpass'] = 'Password matching the above username';
$string['auth_dbpass_key'] = 'Password';
+1 -1
View File
@@ -61,7 +61,7 @@
<tr valign="top" class="required">
<td align="right"><label for="passwd"><?php print_string("auth_fcpasswd_key", "auth_fc") ?>:</label></td>
<td>
<input name="passwd" id="passwd" type="password" size="30" maxlength="12" value="<?php echo $config->passwd?>" />
<input name="passwd" id="passwd" type="password" size="30" maxlength="12" value="<?php echo $config->passwd?>" autocomplete="off"/>
<?php if (isset($err["passwd"])) echo $OUTPUT->error_text($err["passwd"]); ?>
</td>
<td>
+1 -1
View File
@@ -209,7 +209,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
<label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
</td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
<?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
</td>
<td>
-6
View File
@@ -1,12 +1,6 @@
This files describes API changes in /auth/* - plugins,
information provided here is intended especially for developers.
=== 2.4.6 ===
* can_be_manually_set() - This function was introduced in the base class and returns false by default. If overriden by
an authentication plugin to return true, the authentication plugin will be able to be manually set for users. For example,
when bulk uploading users you will be able to select it as the authentication method they use.
=== 2.4 ===
required changes in code:
@@ -335,6 +335,9 @@ class restore_controller extends backup implements loggable {
if ($this->status != backup::STATUS_NEED_PRECHECK) {
throw new restore_controller_exception('cannot_precheck_wrong_status', $this->status);
}
// Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
$this->precheck = restore_prechecks_helper::execute_prechecks($this, $droptemptablesafter);
if (!array_key_exists('errors', $this->precheck)) { // No errors, can be executed
$this->set_status(backup::STATUS_AWAITING);
+1 -1
View File
@@ -139,7 +139,7 @@ class imscc11_backup_convert extends backup_execution_step {
require_once($CFG->dirroot . '/backup/cc/cc_includes.php');
$tempdir = $CFG->dataroot . '/temp/backup/' . uniqid('', true);
$tempdir = $CFG->tempdir . '/backup/' . uniqid('', true);
if (mkdir($tempdir, 0777, true)) {
+15 -1
View File
@@ -37,6 +37,7 @@ class create_and_clean_temp_stuff extends backup_execution_step {
backup_helper::check_and_create_backup_dir($this->get_backupid());// Create backup temp dir
backup_helper::clear_backup_dir($this->get_backupid()); // Empty temp dir, just in case
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60)); // Delete > 4 hours temp dirs
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_controller_dbops::create_backup_ids_temp_table($this->get_backupid()); // Create ids temp table
}
}
@@ -1626,7 +1627,20 @@ class backup_zip_contents extends backup_execution_step {
$zippacker = get_file_packer('application/zip');
// Zip files
$zippacker->archive_to_pathname($files, $zipfile);
$result = $zippacker->archive_to_pathname($files, $zipfile, true, $this);
// Something went wrong.
if ($result === false) {
@unlink($zipfile);
throw new backup_step_exception('error_zip_packing', '', 'An error was encountered while trying to generate backup zip');
}
// Read to make sure it is a valid backup. Refer MDL-37877 . Delete it, if found not to be valid.
try {
backup_general_helper::get_backup_information_from_mbz($zipfile);
} catch (backup_helper_exception $e) {
@unlink($zipfile);
throw new backup_step_exception('error_zip_packing', '', $e->debuginfo);
}
}
}
@@ -35,7 +35,7 @@ global $LINKS_ENCODERS_CACHE;
$LINKS_ENCODERS_CACHE = array();
/**
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
* Class implementing the @xml_contenttransformed logic to be applied in moodle2 backups
*
* TODO: Finish phpdocs
*/
@@ -61,13 +61,13 @@ class backup_xml_transformer extends xml_contenttransformer {
// Array or object, debug and try our best recursively, shouldn't happen but...
if (is_array($content)) {
debugging('Backup XML transformer should process arrays but plain content always', DEBUG_DEVELOPER);
debugging('Backup XML transformer should not process arrays but plain content only', DEBUG_DEVELOPER);
foreach($content as $key => $plaincontent) {
$content[$key] = $this->process($plaincontent);
}
return $content;
} else if (is_object($content)) {
debugging('Backup XML transformer should not process objects but plain content always', DEBUG_DEVELOPER);
debugging('Backup XML transformer should not process objects but plain content only', DEBUG_DEVELOPER);
foreach((array)$content as $key => $plaincontent) {
$content[$key] = $this->process($plaincontent);
}
@@ -161,6 +161,9 @@ class restore_section_task extends restore_task {
$section_included = new restore_section_included_setting($settingname, base_setting::IS_BOOLEAN, true);
if (is_number($this->info->title)) {
$label = get_string('includesection', 'backup', $this->info->title);
} elseif (empty($this->info->title)) { // Don't throw error if title is empty, gracefully continue restore.
$this->log('Section title missing in backup for section id '.$this->info->sectionid, backup::LOG_WARNING, $this->name);
$label = get_string('unnamedsection', 'backup');
} else {
$label = $this->info->title;
}
@@ -164,8 +164,10 @@ abstract class backup_controller_dbops extends backup_dbops {
$dbman = $DB->get_manager(); // We are going to use database_manager services
$targettablename = 'backup_ids_temp';
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
if ($dbman->table_exists($targettablename)) {
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
}
}
/**
@@ -908,6 +908,15 @@ abstract class restore_dbops {
}
if (empty($file->repositoryid)) {
// If contenthash is empty then gracefully skip adding file.
if (empty($file->contenthash)) {
$result = new stdClass();
$result->code = 'file_missing_in_backup';
$result->message = sprintf('missing file (%s) contenthash in backup for component %s', $file->filename, $component);
$result->level = backup::LOG_WARNING;
$results[] = $result;
continue;
}
// this is a regular file, it must be present in the backup pool
$backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);
+68 -38
View File
@@ -32,11 +32,11 @@ defined('MOODLE_INTERNAL') || die();
*/
abstract class backup_cron_automated_helper {
/** automated backups are active and ready to run */
/** Automated backups are active and ready to run */
const STATE_OK = 0;
/** automated backups are disabled and will not be run */
/** Automated backups are disabled and will not be run */
const STATE_DISABLED = 1;
/** automated backups are all ready running! */
/** Automated backups are all ready running! */
const STATE_RUNNING = 2;
/** Course automated backup completed successfully */
@@ -49,6 +49,8 @@ abstract class backup_cron_automated_helper {
const BACKUP_STATUS_SKIPPED = 3;
/** Course automated backup had warnings */
const BACKUP_STATUS_WARNING = 4;
/** Course automated backup has yet to be run */
const BACKUP_STATUS_NOTYETRUN = 5;
/** Run if required by the schedule set in config. Default. **/
const RUN_ON_SCHEDULE = 0;
@@ -119,12 +121,13 @@ abstract class backup_cron_automated_helper {
$rs = $DB->get_recordset('course');
foreach ($rs as $course) {
$backupcourse = $DB->get_record('backup_courses', array('courseid'=>$course->id));
$backupcourse = $DB->get_record('backup_courses', array('courseid' => $course->id));
if (!$backupcourse) {
$backupcourse = new stdClass;
$backupcourse->courseid = $course->id;
$DB->insert_record('backup_courses',$backupcourse);
$backupcourse = $DB->get_record('backup_courses', array('courseid'=>$course->id));
$backupcourse->laststatus = self::BACKUP_STATUS_NOTYETRUN;
$DB->insert_record('backup_courses', $backupcourse);
$backupcourse = $DB->get_record('backup_courses', array('courseid' => $course->id));
}
// The last backup is considered as successful when OK or SKIPPED.
@@ -132,19 +135,23 @@ abstract class backup_cron_automated_helper {
$backupcourse->laststatus == self::BACKUP_STATUS_OK) && (
$backupcourse->laststarttime > 0 && $backupcourse->lastendtime > 0);
// Skip courses that do not yet need backup.
$skipped = !(($backupcourse->nextstarttime > 0 && $backupcourse->nextstarttime < $now) || $rundirective == self::RUN_IMMEDIATELY);
$skippedmessage = 'Does not require backup';
// Assume that we are not skipping anything.
$skipped = false;
$skippedmessage = '';
// Check if we are going to be running the backup now.
$shouldrunnow = (($backupcourse->nextstarttime > 0 && $backupcourse->nextstarttime < $now)
|| $rundirective == self::RUN_IMMEDIATELY);
// If config backup_auto_skip_hidden is set to true, skip courses that are not visible.
if (!$skipped && $config->backup_auto_skip_hidden) {
if ($shouldrunnow && $config->backup_auto_skip_hidden) {
$skipped = ($config->backup_auto_skip_hidden && !$course->visible);
$skippedmessage = 'Not visible';
}
// If config backup_auto_skip_modif_days is set to true, skip courses
// that have not been modified since the number of days defined.
if (!$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_days) {
if ($shouldrunnow && !$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_days) {
$sqlwhere = "course=:courseid AND time>:time AND ".$DB->sql_like('action', ':action', false, true, true);
$timenotmodifsincedays = $now - ($config->backup_auto_skip_modif_days * DAYSECS);
// Check log if there were any modifications to the course content.
@@ -159,8 +166,9 @@ abstract class backup_cron_automated_helper {
// If config backup_auto_skip_modif_prev is set to true, skip courses
// that have not been modified since previous backup.
if (!$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_prev) {
if ($shouldrunnow && !$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_prev) {
// Check log if there were any modifications to the course content.
$sqlwhere = "course=:courseid AND time>:time AND ".$DB->sql_like('action', ':action', false, true, true);
$params = array('courseid' => $course->id,
'time' => $backupcourse->laststarttime,
'action' => '%view%');
@@ -170,16 +178,17 @@ abstract class backup_cron_automated_helper {
$skippedmessage = 'Not modified since previous backup';
}
// Skip courses not needed for backup.
if ($skipped) {
// Output the next execution time when it has been updated.
if ($backupcourse->nextstarttime != $nextstarttime) {
mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
}
// Check if the course is not scheduled to run right now.
if (!$shouldrunnow) {
$backupcourse->nextstarttime = $nextstarttime;
$DB->update_record('backup_courses', $backupcourse);
mtrace('Skipping ' . $course->fullname . ' (Not scheduled for backup until ' . $showtime . ')');
} else if ($skipped) { // Must have been skipped for a reason.
$backupcourse->laststatus = self::BACKUP_STATUS_SKIPPED;
$backupcourse->nextstarttime = $nextstarttime;
$DB->update_record('backup_courses', $backupcourse);
mtrace('Skipping '.$course->fullname.' ('.$skippedmessage.')');
mtrace('Skipping ' . $course->fullname . ' (' . $skippedmessage . ')');
mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
} else {
// Backup every non-skipped courses.
mtrace('Backing up '.$course->fullname.'...');
@@ -223,16 +232,17 @@ abstract class backup_cron_automated_helper {
$count = backup_cron_automated_helper::get_backup_status_array();
$haserrors = ($count[self::BACKUP_STATUS_ERROR] != 0 || $count[self::BACKUP_STATUS_UNFINISHED] != 0);
//Build the message text
//Summary
$message .= get_string('summary')."\n";
// Build the message text.
// Summary.
$message .= get_string('summary') . "\n";
$message .= "==================================================\n";
$message .= " ".get_string('courses').": ".array_sum($count)."\n";
$message .= " ".get_string('ok').": ".$count[self::BACKUP_STATUS_OK]."\n";
$message .= " ".get_string('skipped').": ".$count[self::BACKUP_STATUS_SKIPPED]."\n";
$message .= " ".get_string('error').": ".$count[self::BACKUP_STATUS_ERROR]."\n";
$message .= " ".get_string('unfinished').": ".$count[self::BACKUP_STATUS_UNFINISHED]."\n";
$message .= " ".get_string('warning').": ".$count[self::BACKUP_STATUS_WARNING]."\n\n";
$message .= ' ' . get_string('courses') . '; ' . array_sum($count) . "\n";
$message .= ' ' . get_string('ok') . '; ' . $count[self::BACKUP_STATUS_OK] . "\n";
$message .= ' ' . get_string('skipped') . '; ' . $count[self::BACKUP_STATUS_SKIPPED] . "\n";
$message .= ' ' . get_string('error') . '; ' . $count[self::BACKUP_STATUS_ERROR] . "\n";
$message .= ' ' . get_string('unfinished') . '; ' . $count[self::BACKUP_STATUS_UNFINISHED] . "\n";
$message .= ' ' . get_string('warning') . '; ' . $count[self::BACKUP_STATUS_WARNING] . "\n";
$message .= ' ' . get_string('backupnotyetrun') . '; ' . $count[self::BACKUP_STATUS_NOTYETRUN]."\n\n";
//Reference
if ($haserrors) {
@@ -295,7 +305,8 @@ abstract class backup_cron_automated_helper {
self::BACKUP_STATUS_OK => 0,
self::BACKUP_STATUS_UNFINISHED => 0,
self::BACKUP_STATUS_SKIPPED => 0,
self::BACKUP_STATUS_WARNING => 0
self::BACKUP_STATUS_WARNING => 0,
self::BACKUP_STATUS_NOTYETRUN => 0
);
$statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
@@ -371,7 +382,11 @@ abstract class backup_cron_automated_helper {
$outcome = self::BACKUP_STATUS_OK;
$config = get_config('backup');
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_AUTOMATED, $userid);
$dir = $config->backup_auto_destination;
$storage = (int)$config->backup_auto_storage;
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO,
backup::MODE_AUTOMATED, $userid);
try {
@@ -392,27 +407,28 @@ abstract class backup_cron_automated_helper {
}
}
// Set the default filename
// Set the default filename.
$format = $bc->get_format();
$type = $bc->get_type();
$id = $bc->get_id();
$users = $bc->get_plan()->get_setting('users')->get_value();
$anonymised = $bc->get_plan()->get_setting('anonymize')->get_value();
$bc->get_plan()->get_setting('filename')->set_value(backup_plan_dbops::get_default_backup_filename($format, $type, $id, $users, $anonymised));
$bc->get_plan()->get_setting('filename')->set_value(backup_plan_dbops::get_default_backup_filename($format, $type,
$id, $users, $anonymised));
$bc->set_status(backup::STATUS_AWAITING);
$bc->execute_plan();
$results = $bc->get_results();
$outcome = self::outcome_from_results($results);
$file = $results['backup_destination']; // may be empty if file already moved to target location
$dir = $config->backup_auto_destination;
$storage = (int)$config->backup_auto_storage;
$file = $results['backup_destination']; // May be empty if file already moved to target location.
if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir)) {
$dir = null;
}
if ($file && !empty($dir) && $storage !== 0) {
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised, !$config->backup_shortname);
// Copy file only if there was no error.
if ($file && !empty($dir) && $storage !== 0 && $outcome != self::BACKUP_STATUS_ERROR) {
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised,
!$config->backup_shortname);
if (!$file->copy_content_to($dir.'/'.$filename)) {
$outcome = self::BACKUP_STATUS_ERROR;
}
@@ -428,6 +444,20 @@ abstract class backup_cron_automated_helper {
$outcome = self::BACKUP_STATUS_ERROR;
}
// Delete the backup file immediately if something went wrong.
if ($outcome === self::BACKUP_STATUS_ERROR) {
// Delete the file from file area if exists.
if (!empty($file)) {
$file->delete();
}
// Delete file from external storage if exists.
if ($storage !== 0 && !empty($filename) && file_exists($dir.'/'.$filename)) {
@unlink($dir.'/'.$filename);
}
}
$bc->destroy();
unset($bc);
@@ -524,7 +554,7 @@ abstract class backup_cron_automated_helper {
public static function set_state_running($running = true) {
if ($running === true) {
if (self::get_automated_backup_state() === self::STATE_RUNNING) {
throw new backup_exception('backup_automated_already_running');
throw new backup_helper_exception('backup_automated_already_running');
}
set_config('backup_auto_running', '1', 'backup');
} else {
+11 -7
View File
@@ -60,13 +60,17 @@ abstract class base_plan implements checksumable, executable {
$task->set_plan($this);
// Append task settings to plan array, if not present, for comodity
foreach ($task->get_settings() as $key => $setting) {
if (!in_array($setting, $this->settings)) {
$name = $setting->get_name();
if (!isset($this->settings[$name])) {
$this->settings[$name] = $setting;
} else {
throw new base_plan_exception('multiple_settings_by_name_found', $name);
}
// Check if there is already a setting for this name.
$name = $setting->get_name();
if (!isset($this->settings[$name])) {
// There is no setting, so add it.
$this->settings[$name] = $setting;
} else if ($this->settings[$name] != $setting) {
// If the setting already exists AND it is not the same setting,
// then throw an error. (I.e. you're allowed to add the same
// setting twice, but cannot add two different ones with same
// name.)
throw new base_plan_exception('multiple_settings_by_name_found', $name);
}
}
}
+1 -1
View File
@@ -73,7 +73,7 @@ class core_backup_renderer extends plugin_renderer_base {
*/
public function backup_details($details, $nextstageurl) {
$yestick = $this->output->pix_icon('i/valid', get_string('yes'));
$notick = $this->output->pix_icon('i/valid', get_string('no'));
$notick = $this->output->pix_icon('i/invalid', get_string('no'));
$html = html_writer::start_tag('div', array('class'=>'backup-restore'));
+15 -7
View File
@@ -475,8 +475,9 @@ class restore_ui_stage_schema extends restore_ui_stage {
if ($this->stageform === null) {
$form = new restore_schema_form($this, $PAGE->url);
$tasks = $this->ui->get_tasks();
$content = '';
$courseheading = false;
$allsettings = array();
foreach ($tasks as $task) {
if (!($task instanceof restore_root_task)) {
if (!$courseheading) {
@@ -484,13 +485,11 @@ class restore_ui_stage_schema extends restore_ui_stage {
$form->add_heading('coursesettings', get_string('coursesettings', 'backup'));
$courseheading = true;
}
// First add each setting
// Put each setting into an array of settings to add. Adding
// a setting individually is a very slow operation, so we add
// them all in a batch later on.
foreach ($task->get_settings() as $setting) {
$form->add_setting($setting, $task);
}
// The add all the dependencies
foreach ($task->get_settings() as $setting) {
$form->add_dependencies($setting);
$allsettings[] = array($setting, $task);
}
} else if ($this->ui->enforce_changed_dependencies()) {
// Only show these settings if dependencies changed them.
@@ -505,6 +504,15 @@ class restore_ui_stage_schema extends restore_ui_stage {
}
}
}
// Actually add all the settings that we put in the array.
$form->add_settings($allsettings);
// Add the dependencies for all the settings.
foreach ($allsettings as $settingtask) {
$form->add_dependencies($settingtask[0]);
}
$this->stageform = $form;
}
return $this->stageform;
+1 -1
View File
@@ -130,7 +130,7 @@ $communityid = optional_param('communityid', '', PARAM_INT);
if ($remove != -1 and !empty($communityid) and confirm_sesskey()) {
$communitymanager->block_community_remove_course($communityid, $USER->id);
echo $OUTPUT->header();
echo $renderer->remove_success(new moodle_url(get_referer(false)));
echo $renderer->remove_success(new moodle_url('/course/view.php', array('id' => $courseid)));
echo $OUTPUT->footer();
die();
}
+1
View File
@@ -38,6 +38,7 @@ class block_community_manager {
$community = $this->block_community_get_course($course->url, $userid);
if (empty($community)) {
$community = new stdClass();
$community->userid = $userid;
$community->coursename = $course->name;
$community->coursedescription = $course->description;
+9
View File
@@ -0,0 +1,9 @@
/* RSS Feeds
-------------------------*/
.block_rss_client .list li:first-child {
border-top-width: 0;
}
.block_rss_client .list li {
border-top: 1px solid;
padding: 5px;
}
+3 -3
View File
@@ -110,12 +110,12 @@ class block_tags extends block_base {
$content = '';
$moretags = new moodle_url('/tag/coursetags_more.php', array('show'=>$tagtype));
if ($tagtype == 'all') {
$tags = coursetag_get_tags(0, 0, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags(0, 0, $this->config->tagtype, $this->config->numberoftags);
} else if ($tagtype == 'course') {
$tags = coursetag_get_tags($this->page->course->id, 0, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags($this->page->course->id, 0, $this->config->tagtype, $this->config->numberoftags);
$moretags->param('courseid', $this->page->course->id);
} else if ($tagtype == 'my') {
$tags = coursetag_get_tags(0, $USER->id, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags(0, $USER->id, $this->config->tagtype, $this->config->numberoftags);
}
$tagcloud = tag_print_cloud($tags, 150, true);
if (!$tagcloud) {
+1
View File
@@ -120,6 +120,7 @@ if ($action === 'delete'){
print_error('nopermissionstodeleteentry', 'blog');
} else {
$entry->delete();
blog_rss_delete_file($userid);
redirect($returnurl);
}
} else if (blog_user_can_edit_entry($entry)) {
+14
View File
@@ -330,3 +330,17 @@ function blog_rss_save_file($type, $id, $tagid=0, $contents='') {
return $status;
}
/**
* Delete the supplied user's cached blog post RSS feed.
* Only user blogs are available by RSS.
* This doesn't call rss_delete_file() as blog RSS caching uses it's own file structure.
*
* @param int $userid
*/
function blog_rss_delete_file($userid) {
$filename = blog_rss_file_name('user', $userid);
if (file_exists($filename)) {
unlink($filename);
}
}
+7 -8
View File
@@ -24,8 +24,8 @@ A definition:
'overrideclassfile' => null, // Optional
'datasource' => null, // Optional
'datasourcefile' => null, // Optional
'persistent' => false, // Optional
'persistentmaxsize' => false, // Optional
'staticacceleration' => false, // Optional
'staticaccelerationsize' => false, // Optional
'ttl' => 0, // Optional
'mappingsonly' => false // Optional
'invalidationevents' => array( // Optional
@@ -142,19 +142,18 @@ The following optional settings can also be defined:
* overrideclassfile - Included if required when using the overrideclass param.
* datasource - If provided this class will be used as a data source for the definition. It must implement the cache_data_source interface.
* datasourcefile - Included if required when using the datasource param.
* persistent - If set to true the loader will be stored when first created and provided to subsequent requests. More on this later.
* persistentmaxsize - If set to an int this will be the maximum number of items stored in the persistent cache.
* staticacceleration - Any data passing through the cache will be held onto to make subsequent requests for it faster.
* staticaccelerationsize - If set to an int this will be the maximum number of items stored in the static acceleration array.
* ttl - Can be used to set a ttl value for data being set for this cache.
* mappingsonly - This definition can only be used if there is a store mapping for it. More on this later.
* invalidationevents - An array of events that should trigger this cache to invalidate.
It's important to note that internally the definition is also aware of the component. This is picked up when the definition is read, based upon the location of the caches.php file.
The persist option.
As noted the persist option causes the loader generated for this definition to be stored when first created. Subsequent requests for this definition will be given the original loader instance.
The staticacceleration option.
Data passed to or retrieved from the loader and its chained loaders gets cached by the instance.
This option should be used when you know you will require the loader several times and perhaps in different areas of code.
Because it caches key=>value data it avoids the need to re-fetch things from stores after the first request. Its good for performance, bad for memory.
Memory use can be controlled by setting the staticaccelerationsize option.
It should be used sparingly.
The mappingsonly option.
@@ -227,4 +226,4 @@ Cache information can be invalidated in two ways.
The first method is designed to be used when you have a single known definition you want to invalidate entries within.
The second method is a lot more intensive for the system. There are defined invalidation events that definitions can "subscribe" to (through the definitions invalidationevents option).
When you invalidate by event the cache API finds all of the definitions that subscribe to the event, it then loads the stores for each of those definitions and purges the keys from each store.
This is obviously a recursive, and therefore, intense process.
This is obviously a recursive, and therefore, intense process.
+74 -28
View File
@@ -75,19 +75,14 @@ defined('MOODLE_INTERNAL') || die();
* [string] A class to use as the data loader for this definition.
* Any class used here must inherit the cache_data_loader interface.
* + datasourcefile
* [string] Suplements the above setting indicated the file containing the class to be used. This file is included when
* [string] Supplements the above setting indicating the file containing the class to be used. This file is included when
* required.
* + persistent
* [bool] This setting does two important things. First it tells the cache API to only instantiate the cache structure for
* this definition once, further requests will be given the original instance.
* Second the cache loader will keep an array of the items set and retrieved to the cache during the request.
* This has several advantages including better performance without needing to start passing the cache instance between
* function calls, the downside is that the cache instance + the items used stay within memory.
* Consider using this setting when you know that there are going to be many calls to the cache for the same information
* or when you are converting existing code to the cache and need to access the cache within functions but don't want
* to add it as an argument to the function.
* + persistentmaxsize
* [int] This supplements the above setting by limiting the number of items in the caches persistent array of items.
* + staticacceleration
* The cache loader will keep an array of the items set and retrieved to the cache during the request.
* Consider using this setting when you know that there are going to be many calls to the cache for the same information.
* Requests for data in this array will be ultra fast, but it will cost memory.
* + staticaccelerationsize
* [int] This supplements the above setting by limiting the number of items in the static acceleration array.
* Tweaking this setting lower will allow you to minimise the memory implications above while hopefully still managing to
* offset calls to the cache store.
* + ttl
@@ -228,16 +223,16 @@ class cache_definition {
protected $datasourceaggregate = null;
/**
* Set to true if the definitions cache should be persistent
* Set to true if the cache should hold onto items passing through it to speed up subsequent requests.
* @var bool
*/
protected $persistent = false;
protected $staticacceleration = false;
/**
* The persistent item array max size.
* The maximum number of items that static acceleration cache should hold onto.
* @var int
*/
protected $persistentmaxsize = false;
protected $staticaccelerationsize = false;
/**
* The TTL for data in this cache. Please don't use this, instead use event driven invalidation.
@@ -320,8 +315,8 @@ class cache_definition {
$overrideclassfile = null;
$datasource = null;
$datasourcefile = null;
$persistent = false;
$persistentmaxsize = false;
$staticacceleration = false;
$staticaccelerationsize = false;
$ttl = 0;
$mappingsonly = false;
$invalidationevents = array();
@@ -373,10 +368,18 @@ class cache_definition {
}
if (array_key_exists('persistent', $definition)) {
$persistent = (bool)$definition['persistent'];
// Ahhh this is the legacy persistent option.
$staticacceleration = (bool)$definition['persistent'];
}
if (array_key_exists('staticacceleration', $definition)) {
$staticacceleration = (bool)$definition['staticacceleration'];
}
if (array_key_exists('persistentmaxsize', $definition)) {
$persistentmaxsize = (int)$definition['persistentmaxsize'];
// Ahhh this is the legacy persistentmaxsize option.
$staticaccelerationsize = (int)$definition['persistentmaxsize'];
}
if (array_key_exists('staticaccelerationsize', $definition)) {
$staticaccelerationsize = (int)$definition['staticaccelerationsize'];
}
if (array_key_exists('ttl', $definition)) {
$ttl = (int)$definition['ttl'];
@@ -452,8 +455,8 @@ class cache_definition {
$cachedefinition->datasource = $datasource;
$cachedefinition->datasourcefile = $datasourcefile;
$cachedefinition->datasourceaggregate = $datasourceaggregate;
$cachedefinition->persistent = $persistent;
$cachedefinition->persistentmaxsize = $persistentmaxsize;
$cachedefinition->staticacceleration = $staticacceleration;
$cachedefinition->staticaccelerationsize = $staticaccelerationsize;
$cachedefinition->ttl = $ttl;
$cachedefinition->mappingsonly = $mappingsonly;
$cachedefinition->invalidationevents = $invalidationevents;
@@ -474,7 +477,8 @@ class cache_definition {
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - overrideclass : The class to use as the loader.
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : Set it to an int to limit the size of the staticacceleration cache.
* @return cache_application|cache_session|cache_request
*/
public static function load_adhoc($mode, $component, $area, array $options = array()) {
@@ -491,7 +495,14 @@ class cache_definition {
$definition['simpledata'] = $options['simpledata'];
}
if (!empty($options['persistent'])) {
$definition['persistent'] = $options['persistent'];
// Ahhh this is the legacy persistent option.
$definition['staticacceleration'] = (bool)$options['persistent'];
}
if (!empty($options['staticacceleration'])) {
$definition['staticacceleration'] = (bool)$options['staticacceleration'];
}
if (!empty($options['staticaccelerationsize'])) {
$definition['staticaccelerationsize'] = (int)$options['staticaccelerationsize'];
}
if (!empty($options['overrideclass'])) {
$definition['overrideclass'] = $options['overrideclass'];
@@ -716,18 +727,53 @@ class cache_definition {
/**
* Returns true if this definitions cache should be made persistent.
*
* Please call {@link cache_definition::use_static_acceleration()} instead.
*
* @deprecated since 2.4.7
* @return bool
*/
public function should_be_persistent() {
return $this->persistent || $this->mode === cache_store::MODE_SESSION;
debugging('Please upgrade your code to use cache_definition::use_static_acceleration', DEBUG_DEVELOPER);
return $this->use_static_acceleration();
}
/**
* Returns the max size for the persistent item array in the cache.
* Returns true if we should hold onto the data flowing through the cache.
*
* If set to true data flowing through the cache will be stored in a static variable
* to make subsequent requests for the data much faster.
*
* @return bool
*/
public function use_static_acceleration() {
if ($this->mode === cache_store::MODE_REQUEST) {
// Request caches should never use static acceleration - it just doesn't make sense.
return false;
}
return $this->staticacceleration || $this->mode === cache_store::MODE_SESSION;
}
/**
* Returns the max size for the static acceleration array.
*
* Please call {@link cache_definition::get_static_acceleration_size()} instead.
*
* @see cache_definition::get_static_acceleration_size()
* @deprecated since 2.4.7
* @return int
*/
public function get_persistent_max_size() {
return $this->persistentmaxsize;
debugging('Please upgrade your code to call cache_definition::get_static_acceleration_size', DEBUG_DEVELOPER);
return $this->get_static_acceleration_size();
}
/**
* Returns the max size for the static acceleration array.
* @return int
*/
public function get_static_acceleration_size() {
return $this->staticaccelerationsize;
}
/**
@@ -821,4 +867,4 @@ class cache_definition {
protected function get_cache_identifier() {
return cache_helper::get_site_identifier();
}
}
}
+9 -8
View File
@@ -46,14 +46,15 @@ class cachestore_dummy extends cache_store {
protected $name;
/**
* Gets set to true if this store is going to persist data.
* This happens when the definition doesn't require it as the loader will not be persisting information and something has to.
* Gets set to true if this store is going to store data.
* This happens when the definition doesn't require static acceleration as the loader will not be storing information and
* something has to.
* @var bool
*/
protected $persist = false;
/**
* The persistent store array
* The stored data array
* @var array
*/
protected $store = array();
@@ -106,13 +107,13 @@ class cachestore_dummy extends cache_store {
* @param cache_definition $definition
*/
public function initialise(cache_definition $definition) {
// If the definition isn't persistent then we need to be persistent here.
// If the definition isn't using static acceleration then we need to be store data here.
// The reasoning behind this is that:
// - If the definition is persistent then the cache loader is going to
// store things in its persistent cache.
// - If the definition is not persistent then the cache loader won't try to store anything
// - If the definition is using static acceleration then the cache loader is going to
// store things in its static array.
// - If the definition is not using static acceleration then the cache loader won't try to store anything
// and we will need to store it here in order to make sure it is accessible.
$this->persist = !$definition->should_be_persistent();
$this->persist = !$definition->use_static_acceleration();
}
/**
+29 -10
View File
@@ -150,9 +150,7 @@ class cache_factory {
*/
public static function reset() {
$factory = self::instance();
$factory->cachesfromdefinitions = array();
$factory->cachesfromparams = array();
$factory->stores = array();
$factory->reset_cache_instances();
$factory->configs = array();
$factory->definitions = array();
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
@@ -160,6 +158,18 @@ class cache_factory {
$factory->state = self::STATE_UNINITIALISED;
}
/**
* Resets the stores, clearing the array of created stores.
*
* Cache objects still held onto by the code that initialised them will remain as is
* however all future requests for a cache/store will lead to a new instance being re-initialised.
*/
public function reset_cache_instances() {
$this->cachesfromdefinitions = array();
$this->cachesfromparams = array();
$this->stores = array();
}
/**
* Creates a cache object given the parameters for a definition.
*
@@ -181,9 +191,8 @@ class cache_factory {
$definition = $this->create_definition($component, $area, $aggregate);
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
if ($definition->should_be_persistent()) {
$this->cachesfromdefinitions[$definitionname] = $cache;
}
// Loaders are always held onto to speed up subsequent requests.
$this->cachesfromdefinitions[$definitionname] = $cache;
return $cache;
}
@@ -199,7 +208,8 @@ class cache_factory {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : The maximum number of items to hold onto for acceleration purposes.
* @return cache_application|cache_session|cache_request
*/
public function create_cache_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
@@ -210,9 +220,7 @@ class cache_factory {
$definition = cache_definition::load_adhoc($mode, $component, $area, $options);
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
if ($definition->should_be_persistent()) {
$this->cachesfromparams[$key] = $cache;
}
$this->cachesfromparams[$key] = $cache;
return $cache;
}
@@ -297,6 +305,15 @@ class cache_factory {
return $this->definitionstores[$id];
}
/**
* Returns the cache instances that have been used within this request.
* @since 2.4.7
* @return array
*/
public function get_caches_in_use() {
return $this->cachesfromdefinitions;
}
/**
* Creates a cache config instance with the ability to write if required.
*
@@ -585,7 +602,9 @@ class cache_factory {
* </code>
*/
public static function disable_stores() {
// First reset to clear any static acceleration array.
$factory = self::instance();
$factory->reset_cache_instances();
$factory->set_state(self::STATE_STORES_DISABLED);
}
}
+27 -20
View File
@@ -238,19 +238,24 @@ class cache_helper {
$instance = cache_config::instance();
$invalidationeventset = false;
$factory = cache_factory::instance();
$inuse = $factory->get_caches_in_use();
foreach ($instance->get_definitions() as $name => $definitionarr) {
$definition = cache_definition::load($name, $definitionarr);
if ($definition->invalidates_on_event($event)) {
// OK at this point we know that the definition has information to invalidate on the event.
// There are two routes, either its an application cache in which case we can invalidate it now.
// or it is a persistent cache that also needs to be invalidated now.
if ($definition->get_mode() === cache_store::MODE_APPLICATION || $definition->should_be_persistent()) {
$cache = $factory->create_cache_from_definition($definition->get_component(), $definition->get_area());
$cache->delete_many($keys);
// First up check if there is a cache loader for this definition already.
// If there is we need to invalidate the keys from there.
$definitionkey = $definition->get_component().'/'.$definition->get_area();
if (isset($inuse[$definitionkey])) {
$inuse[$definitionkey]->delete_many($keys);
}
// We need to flag the event in the "Event invalidation" cache if it hasn't already happened.
if ($invalidationeventset === false) {
// We should only log events for application and session caches.
// Request caches shouldn't have events as all data is lost at the end of the request.
// Events should only be logged once of course and likely several definitions are watching so we
// track its logging with $invalidationeventset.
$logevent = ($invalidationeventset === false && $definition->get_mode() !== cache_store::MODE_REQUEST);
if ($logevent) {
// Get the event invalidation cache.
$cache = cache::make('core', 'eventinvalidation');
// Get any existing invalidated keys for this cache.
@@ -307,23 +312,25 @@ class cache_helper {
$instance = cache_config::instance();
$invalidationeventset = false;
$factory = cache_factory::instance();
$inuse = $factory->get_caches_in_use();
foreach ($instance->get_definitions() as $name => $definitionarr) {
$definition = cache_definition::load($name, $definitionarr);
if ($definition->invalidates_on_event($event)) {
// Check if this definition would result in a persistent loader being in use.
if ($definition->should_be_persistent()) {
// There may be a persistent cache loader. Lets purge that first so that any persistent data is removed.
$cache = $factory->create_cache_from_definition($definition->get_component(), $definition->get_area());
$cache->purge();
}
// Get all of the store instances that are in use for this store.
$stores = $factory->get_store_instances_in_use($definition);
foreach ($stores as $store) {
// Purge each store individually.
$store->purge();
// First up check if there is a cache loader for this definition already.
// If there is we need to invalidate the keys from there.
$definitionkey = $definition->get_component().'/'.$definition->get_area();
if (isset($inuse[$definitionkey])) {
$inuse[$definitionkey]->purge();
}
// We should only log events for application and session caches.
// Request caches shouldn't have events as all data is lost at the end of the request.
// Events should only be logged once of course and likely several definitions are watching so we
// track its logging with $invalidationeventset.
$logevent = ($invalidationeventset === false && $definition->get_mode() !== cache_store::MODE_REQUEST);
// We need to flag the event in the "Event invalidation" cache if it hasn't already happened.
if ($invalidationeventset === false) {
if ($logevent && $invalidationeventset === false) {
// Get the event invalidation cache.
$cache = cache::make('core', 'eventinvalidation');
// Create a key to invalidate all.
+83 -68
View File
@@ -93,43 +93,46 @@ class cache implements cache_loader {
private $supportsnativettl = null;
/**
* Gets set to true if the cache is going to be using the build in static "persist" cache.
* The persist cache statically caches items used during the lifetime of the request. This greatly speeds up interaction
* Gets set to true if the cache is going to be using a static array for acceleration.
* The array statically caches items used during the lifetime of the request. This greatly speeds up interaction
* with the cache in areas where it will be repetitively hit for the same information such as with strings.
* There are several other variables to control how this persist cache works.
* There are several other variables to control how this static acceleration array works.
* @var bool
*/
private $persist = false;
private $staticacceleration = false;
/**
* The persist cache itself.
* The static acceleration array.
* Items will be stored in this cache as they were provided. This ensure there is no unnecessary processing taking place.
* @var array
*/
private $persistcache = array();
private $staticaccelerationarray = array();
/**
* The number of items in the persist cache. Avoids count calls like you wouldn't believe.
* The number of items in the static acceleration array. Avoids count calls like you wouldn't believe.
* @var int
*/
private $persistcount = 0;
private $staticaccelerationcount = 0;
/**
* An array containing just the keys being used in the persist cache.
* This seems redundant perhaps but is used when managing the size of the persist cache.
* An array containing just the keys being used in the static acceleration array.
* This seems redundant perhaps but is used when managing the size of the static acceleration array.
* Items are added to the end of the array and the when we need to reduce the size of the cache we use the
* key that is first on this array.
* @var array
*/
private $persistkeys = array();
private $staticaccelerationkeys = array();
/**
* The maximum size of the persist cache. If set to false there is no max size.
* Caches that make use of the persist cache should seriously consider setting this to something reasonably small, but
* The maximum size of the static acceleration array.
*
* If set to false there is no max size.
* Caches that make use of static acceleration should seriously consider setting this to something reasonably small, but
* still large enough to offset repetitive calls.
*
* @var int|false
*/
private $persistmaxsize = false;
private $staticaccelerationsize = false;
/**
* Gets set to true during initialisation if the definition is making use of a ttl.
@@ -181,7 +184,8 @@ class cache implements cache_loader {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : The max size for the static acceleration array.
* @return cache_application|cache_session|cache_store
*/
public static function make_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
@@ -218,9 +222,9 @@ class cache implements cache_loader {
$this->datasource = $loader;
}
$this->definition->generate_definition_hash();
$this->persist = $this->definition->should_be_persistent();
if ($this->persist) {
$this->persistmaxsize = $this->definition->get_persistent_max_size();
$this->staticacceleration = $this->definition->use_static_acceleration();
if ($this->staticacceleration) {
$this->staticaccelerationsize = $this->definition->get_static_acceleration_size();
}
$this->hasattl = ($this->definition->get_ttl() > 0);
}
@@ -228,7 +232,7 @@ class cache implements cache_loader {
/**
* Used to inform the loader of its state as a sub loader, or as the top of the chain.
*
* This is important as it ensures that we do not have more than one loader keeping persistent data.
* This is important as it ensures that we do not have more than one loader keeping static acceleration data.
* Subloaders need to be "pure" loaders in the sense that they are used to store and retrieve information from stores or the
* next loader/data source in the chain.
* Nothing fancy, nothing flash.
@@ -238,14 +242,14 @@ class cache implements cache_loader {
protected function set_is_sub_loader($setting = true) {
if ($setting) {
$this->subloader = true;
// Subloaders should not keep persistent data.
$this->persist = false;
$this->persistmaxsize = false;
// Subloaders should not keep static acceleration data.
$this->staticacceleration = false;
$this->staticaccelerationsize = false;
} else {
$this->subloader = true;
$this->persist = $this->definition->should_be_persistent();
if ($this->persist) {
$this->persistmaxsize = $this->definition->get_persistent_max_size();
$this->staticacceleration = $this->definition->use_static_acceleration();
if ($this->staticacceleration) {
$this->staticaccelerationsize = $this->definition->get_static_acceleration_size();
}
}
}
@@ -276,7 +280,7 @@ class cache implements cache_loader {
public function get($key, $strictness = IGNORE_MISSING) {
// 1. Parse the key.
$parsedkey = $this->parse_key($key);
// 2. Get it from the persist cache if we can (only when persist is enabled and it has already been requested/set).
// 2. Get it from the static acceleration array if we can (only when it is enabled and it has already been requested/set).
$result = false;
if ($this->is_using_persist_cache()) {
$result = $this->get_from_persist_cache($parsedkey);
@@ -291,7 +295,7 @@ class cache implements cache_loader {
}
return $result;
}
// 3. Get it from the store. Obviously wasn't in the persist cache.
// 3. Get it from the store. Obviously wasn't in the static acceleration array.
$result = $this->store->get($parsedkey);
if ($result !== false) {
if ($result instanceof cache_ttl_wrapper) {
@@ -404,6 +408,9 @@ class cache implements cache_loader {
if ($value instanceof cache_cached_object) {
$value = $value->restore_object();
}
if ($value !== false && $this->is_using_persist_cache()) {
$this->set_in_persist_cache($key, $value);
}
$resultstore[$key] = $value;
}
}
@@ -604,7 +611,7 @@ class cache implements cache_loader {
}
$data = array();
$simulatettl = $this->has_a_ttl() && !$this->store_supports_native_ttl();
$usepersistcache = $this->is_using_persist_cache();
$usestaticaccelerationarray = $this->is_using_persist_cache();
foreach ($keyvaluearray as $key => $value) {
if (is_object($value) && $value instanceof cacheable_object) {
$value = new cache_cached_object($value);
@@ -622,7 +629,7 @@ class cache implements cache_loader {
'key' => $this->parse_key($key),
'value' => $value
);
if ($usepersistcache) {
if ($usestaticaccelerationarray) {
$this->set_in_persist_cache($data[$key]['key'], $value);
}
}
@@ -656,7 +663,7 @@ class cache implements cache_loader {
public function has($key, $tryloadifpossible = false) {
$parsedkey = $this->parse_key($key);
if ($this->is_in_persist_cache($parsedkey)) {
// Hoorah, that was easy. It exists in the persist cache so we definitely have it.
// Hoorah, that was easy. It exists in the static acceleration array so we definitely have it.
return true;
}
if ($this->has_a_ttl() && !$this->store_supports_native_ttl()) {
@@ -798,8 +805,12 @@ class cache implements cache_loader {
* @return bool True on success, false otherwise
*/
public function purge() {
// 1. Purge the persist cache.
$this->persistcache = array();
// 1. Purge the static acceleration array.
$this->staticaccelerationarray = array();
if ($this->staticaccelerationsize !== false) {
$this->staticaccelerationkeys = array();
$this->staticaccelerationcount = 0;
}
// 2. Purge the store.
$this->store->purge();
// 3. Optionally pruge any stacked loaders.
@@ -908,16 +919,16 @@ class cache implements cache_loader {
}
/**
* Returns true if this cache is making use of the persist cache.
* Returns true if this cache is making use of the static acceleration array.
*
* @return bool
*/
protected function is_using_persist_cache() {
return $this->persist;
return $this->staticacceleration;
}
/**
* Returns true if the requested key exists within the persist cache.
* Returns true if the requested key exists within the static acceleration array.
*
* @param string $key The parsed key
* @return bool
@@ -929,20 +940,21 @@ class cache implements cache_loader {
}
// This could be written as a single line, however it has been split because the ttl check is faster than the instanceof
// and has_expired calls.
if (!$this->persist || !array_key_exists($key, $this->persistcache)) {
if (!$this->staticacceleration || !array_key_exists($key, $this->staticaccelerationarray)) {
return false;
}
if ($this->has_a_ttl() && $this->store_supports_native_ttl()) {
return !($this->persistcache[$key] instanceof cache_ttl_wrapper && $this->persistcache[$key]->has_expired());
return !($this->staticaccelerationarray[$key] instanceof cache_ttl_wrapper &&
$this->staticaccelerationarray[$key]->has_expired());
}
return true;
}
/**
* Returns the item from the persist cache if it exists there.
* Returns the item from the static acceleration array if it exists there.
*
* @param string $key The parsed key
* @return mixed|false The data from the persist cache or false if it wasn't there.
* @return mixed|false The data from the static acceleration array or false if it wasn't there.
*/
protected function get_from_persist_cache($key) {
// This method of checking if an array was supplied is faster than is_array.
@@ -951,12 +963,12 @@ class cache implements cache_loader {
}
// This isset check is faster than array_key_exists but will return false
// for null values, meaning null values will come from backing store not
// the persist cache. We think this okay because null usage should be
// the static acceleration array. We think this okay because null usage should be
// very rare (see comment in MDL-39472).
if (!$this->persist || !isset($this->persistcache[$key])) {
if (!$this->staticacceleration || !isset($this->staticaccelerationarray[$key])) {
$result = false;
} else {
$data = $this->persistcache[$key];
$data = $this->staticaccelerationarray[$key];
if (!$this->has_a_ttl() || !$data instanceof cache_ttl_wrapper) {
if ($data instanceof cache_cached_object) {
$data = $data->restore_object();
@@ -974,28 +986,28 @@ class cache implements cache_loader {
}
if ($result) {
if ($this->perfdebug) {
cache_helper::record_cache_hit('** static persist **', $this->definition->get_id());
cache_helper::record_cache_hit('** static acceleration **', $this->definition->get_id());
}
if ($this->persistmaxsize > 1 && $this->persistcount > 1) {
// Check to see if this is the last item on the persist keys array.
if (end($this->persistkeys) !== $key) {
if ($this->staticaccelerationsize > 1 && $this->staticaccelerationcount > 1) {
// Check to see if this is the last item on the static acceleration keys array.
if (end($this->staticaccelerationkeys) !== $key) {
// It isn't the last item.
// Move the item to the end of the array so that it is last to be removed.
unset($this->persistkeys[$key]);
$this->persistkeys[$key] = $key;
unset($this->staticaccelerationkeys[$key]);
$this->staticaccelerationkeys[$key] = $key;
}
}
return $result;
} else {
if ($this->perfdebug) {
cache_helper::record_cache_miss('** static persist **', $this->definition->get_id());
cache_helper::record_cache_miss('** static acceleration **', $this->definition->get_id());
}
return false;
}
}
/**
* Sets a key value pair into the persist cache.
* Sets a key value pair into the static acceleration array.
*
* @param string $key The parsed key
* @param mixed $data
@@ -1006,32 +1018,36 @@ class cache implements cache_loader {
if ($key === (array)$key) {
$key = $key['key'];
}
$this->persistcache[$key] = $data;
if ($this->persistmaxsize !== false) {
$this->persistcount++;
$this->persistkeys[$key] = $key;
if ($this->persistcount > $this->persistmaxsize) {
$dropkey = array_shift($this->persistkeys);
unset($this->persistcache[$dropkey]);
$this->persistcount--;
if ($this->staticaccelerationsize !== false && isset($this->staticaccelerationkeys[$key])) {
$this->staticaccelerationcount--;
unset($this->staticaccelerationkeys[$key]);
}
$this->staticaccelerationarray[$key] = $data;
if ($this->staticaccelerationsize !== false) {
$this->staticaccelerationcount++;
$this->staticaccelerationkeys[$key] = $key;
if ($this->staticaccelerationcount > $this->staticaccelerationsize) {
$dropkey = array_shift($this->staticaccelerationkeys);
unset($this->staticaccelerationarray[$dropkey]);
$this->staticaccelerationcount--;
}
}
return true;
}
/**
* Deletes an item from the persist cache.
* Deletes an item from the static acceleration array.
*
* @param string|int $key As given to get|set|delete
* @return bool True on success, false otherwise.
*/
protected function delete_from_persist_cache($key) {
unset($this->persistcache[$key]);
if ($this->persistmaxsize !== false) {
$dropkey = array_search($key, $this->persistkeys);
unset($this->staticaccelerationarray[$key]);
if ($this->staticaccelerationsize !== false) {
$dropkey = array_search($key, $this->staticaccelerationkeys);
if ($dropkey) {
unset($this->persistkeys[$dropkey]);
$this->persistcount--;
unset($this->staticaccelerationkeys[$dropkey]);
$this->staticaccelerationcount--;
}
}
return true;
@@ -1448,9 +1464,8 @@ class cache_application extends cache implements cache_loader_with_locking {
* This class is used for session caches returned by the cache::make methods.
*
* It differs from the application loader in a couple of noteable ways:
* 1. Sessions are always expected to be persistent.
* Because of this we don't ever use the persist cache and instead a session array
* containing all of the data is maintained by this object.
* 1. Sessions are always expected to exist.
* Because of this we don't ever use the static acceleration array.
* 2. Session data for a loader instance (store + definition) is consolidate into a
* single array for storage within the store.
* Along with this we embed a lastaccessed time with the data. This way we can
@@ -2063,7 +2078,7 @@ class cache_session extends cache {
}
/**
* The session loader never uses the persist cache.
* The session loader never uses static acceleration.
* Instead it stores things in the static $session variable. Shared between all session loaders.
*
* @return bool
+3 -3
View File
@@ -49,8 +49,7 @@ class cache_disabled extends cache {
* @param null $loader Unused.
*/
public function __construct(cache_definition $definition, cache_store $store, $loader = null) {
$this->definition = $definition;
$this->store = $store;
// Nothing to do here.
}
/**
@@ -228,7 +227,8 @@ class cache_factory_disabled extends cache_factory {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto all data passing through it.
* - staticaccelerationsize : Sets the max size of the static acceleration array.
* @return cache_application|cache_session|cache_request
*/
public function create_cache_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
+173 -15
View File
@@ -149,8 +149,8 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_default_application_cache',
'persistent' => true,
'persistentmaxsize' => 1
'staticacceleration' => true,
'staticaccelerationsize' => 1
));
$cache = cache::make('phpunit', 'test_default_application_cache');
$this->assertInstanceOf('cache_application', $cache);
@@ -189,7 +189,7 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'nostoretest2',
'persistent' => true
'staticacceleration' => true
));
$instance->phpunit_remove_stores();
@@ -907,11 +907,11 @@ class cache_phpunit_tests extends advanced_testcase {
'crazyevent'
)
));
$instance->phpunit_add_definition('phpunit/eventpurgetestpersistent', array(
$instance->phpunit_add_definition('phpunit/eventpurgetestaccelerated', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'eventpurgetestpersistent',
'persistent' => true,
'area' => 'eventpurgetestaccelerated',
'staticacceleration' => true,
'invalidationevents' => array(
'crazyevent'
)
@@ -930,8 +930,8 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
// Now test the persistent cache.
$cache = cache::make('phpunit', 'eventpurgetestpersistent');
// Now test the static acceleration array.
$cache = cache::make('phpunit', 'eventpurgetestaccelerated');
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
@@ -958,11 +958,11 @@ class cache_phpunit_tests extends advanced_testcase {
'crazyevent'
)
));
$instance->phpunit_add_definition('phpunit/eventpurgetestpersistent', array(
$instance->phpunit_add_definition('phpunit/eventpurgetestaccelerated', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'eventpurgetestpersistent',
'persistent' => true,
'area' => 'eventpurgetestaccelerated',
'staticacceleration' => true,
'invalidationevents' => array(
'crazyevent'
)
@@ -981,8 +981,8 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
// Now test the persistent cache.
$cache = cache::make('phpunit', 'eventpurgetestpersistent');
// Now test the static acceleration array.
$cache = cache::make('phpunit', 'eventpurgetestaccelerated');
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
@@ -1383,8 +1383,8 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_application_locking',
'persistent' => true,
'persistentmaxsize' => 1,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'requirelockingread' => true,
'requirelockingwrite' => true
));
@@ -1449,4 +1449,162 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertInstanceOf('cache_request', $cache);
$this->assertArrayHasKey('cache_is_searchable', $cache->phpunit_get_store_implements());
}
public function test_static_acceleration() {
$instance = cache_config_phpunittest::instance();
$instance->phpunit_add_definition('phpunit/accelerated', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated2', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated2',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated3', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated3',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated4', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated4',
'staticacceleration' => true,
'staticaccelerationsize' => 4,
));
$cache = cache::make('phpunit', 'accelerated');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Set and get three elements.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertEquals('A', $cache->get('a'));
$this->assertEquals(array('b' => 'B', 'c' => 'C'), $cache->get_many(array('b', 'c')));
// Make sure all items are in static acceleration array.
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Add new value and make sure it is in cache and it is in array.
$this->assertTrue($cache->set('d', 'D'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('D', $cache->get('d'));
// Now the least recent accessed item (a) is no longer in acceleration array.
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Adding and deleting element.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->delete('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->has('a'));
// Make sure "purge" deletes from the array as well.
$cache->purge();
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('e'));
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
/** @var cache_phpunit_application $cache */
$cache = cache::make('phpunit', 'accelerated2');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
// Current keys in the array: c, d, e.
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('A', $cache->get('a'));
// Current keys in the array: d, e, a.
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Current keys in the array: d, e, a.
$this->assertEquals(array('c' => 'C'), $cache->get_many(array('c')));
// Current keys in the array: e, a, c.
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$cache = cache::make('phpunit', 'accelerated3');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertTrue($cache->set('b', 'B2'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B2', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals(2, $cache->set_many(array('b' => 'B3', 'c' => 'C3')));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B3', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C3', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$cache = cache::make('phpunit', 'accelerated4');
$this->assertInstanceOf('cache_phpunit_application', $cache);
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('A', $cache->get('a'));
}
}
+11
View File
@@ -243,6 +243,17 @@ class cache_phpunit_application extends cache_application {
public function phpunit_get_store_implements() {
return class_implements($this->get_store());
}
/**
* Returns the given key directly from the static acceleration array.
*
* @param string $key
* @return false|mixed
*/
public function phpunit_get_directly_from_staticaccelerationarray($key) {
$key = $this->parse_key($key);
return $this->get_from_persist_cache($key);
}
}
/**
+10 -2
View File
@@ -1,8 +1,16 @@
This files describes API changes in /cache/stores/* - cache store plugins.
Information provided here is intended especially for developers.
=== 2.5 ===
=== 2.4.7 ===
* All cache instances are recorded and subsequent requests are given a reference to the original instance.
* The persistent option for the cache definition has been deprecated. Please use the staticacceleration option instead.
* There is a new static acceleration option. If enabled data passing through the cache is held onto.
* The persistentmaxsize option has been renamed to staticaccelerationsize. It does the same thing.
* cache_definition::should_be_persistent has been deprecated. Please call cache_definition::use_static_acceleration instead.
* cache_definition::get_persistent_max_size has been deprecated. Please call cache_definition::get_static_acceleration_size instead.
=== 2.4.2 ===
* cleanup method renamed to instance_deleted.
It is now called when the store is deleted as all comments suggested anyway.
* instance_created method added.
It is called when the store is created for the very first time.
It is called when the store is created for the very first time.
+2 -2
View File
@@ -106,8 +106,8 @@ $PAGE->navbar->add($pagetitle);
$PAGE->set_title($course->shortname.': '.get_string('calendar', 'calendar').': '.$pagetitle);
$PAGE->set_heading($course->fullname);
$PAGE->set_button(calendar_preferences_button($course));
$PAGE->set_pagelayout('standard');
$PAGE->set_button(calendar_preferences_button($course));
$renderer = $PAGE->get_renderer('core_calendar');
$calendar->add_sidecalendar_blocks($renderer);
@@ -125,7 +125,7 @@ switch($action) {
$weekend = intval($CFG->calendar_weekend);
}
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)). $CFG->calendar_exportsalt);
// Let's populate some vars to let "common tasks" be somewhat smart...
// If today it's weekend, give the "next week" option
$allownextweek = $weekend & (1 << $now['wday']);
+2 -2
View File
@@ -366,7 +366,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
} else if(isset($typesbyday[$day]['startuser'])) {
$class .= ' calendar_event_user';
}
$cell = html_writer::link($dayhref, $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));
$cell = html_writer::link($dayhref, $day, array('id' => $popupid));
} else {
$cell = $day;
}
@@ -409,7 +409,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
if(! isset($eventsbyday[$day])) {
$class .= ' eventnone';
$popupid = calendar_get_popup(true, false);
$cell = html_writer::link('#', $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));
$cell = html_writer::link('#', $day, array('id' => $popupid));
}
$cell = get_accesshide($today.' ').$cell;
}
+1 -1
View File
@@ -153,7 +153,7 @@ if (!empty($CFG->enablecalendarexport)) {
echo $OUTPUT->single_button(new moodle_url('/calendar/managesubscriptions.php', array('course'=>$courseid)), get_string('managesubscriptions', 'calendar'));
}
if (isloggedin()) {
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)) . $CFG->calendar_exportsalt);
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken));
$icon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/ical'), 'height'=>'14', 'width'=>'36', 'alt'=>get_string('ical', 'calendar'), 'title'=>get_string('quickdownloadcalendar', 'calendar')));
echo html_writer::tag('a', $icon, array('href'=>$link));
+1
View File
@@ -48,6 +48,7 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
width : Math.floor(constraint.get('offsetWidth')*0.9)+"px"
});
panel.render(td);
node.setAttribute('aria-controls', panel.get('id'));
panel.get('boundingBox').addClass('calendar-event-panel');
panel.get('boundingBox').setAttribute('aria-live', 'off');
this.on('showevent', panel.show, panel);
+13 -9
View File
@@ -328,19 +328,23 @@ class course_edit_form extends moodleform {
/// perform some extra moodle validation
function validation($data, $files) {
global $DB, $CFG;
global $DB;
$errors = parent::validation($data, $files);
if ($foundcourses = $DB->get_records('course', array('shortname'=>$data['shortname']))) {
if (!empty($data['id'])) {
unset($foundcourses[$data['id']]);
// Add field validation check for duplicate shortname.
if ($course = $DB->get_record('course', array('shortname' => $data['shortname']), '*', IGNORE_MULTIPLE)) {
if (empty($data['id']) || $course->id != $data['id']) {
$errors['shortname'] = get_string('shortnametaken', '', $course->fullname);
}
if (!empty($foundcourses)) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
// Add field validation check for duplicate idnumber.
if (!empty($data['idnumber']) && (empty($data['id']) || $this->course->idnumber != $data['idnumber'])) {
if ($course = $DB->get_record('course', array('idnumber' => $data['idnumber']), '*', IGNORE_MULTIPLE)) {
if (empty($data['id']) || $course->id != $data['id']) {
$errors['idnumber'] = get_string('idnumbertaken', 'error');
}
$foundcoursenamestring = implode(',', $foundcoursenames);
$errors['shortname']= get_string('shortnametaken', '', $foundcoursenamestring);
}
}
+2 -1
View File
@@ -22,9 +22,10 @@ class editsection_form extends moodleform {
$course = $this->_customdata['course'];
$elementgroup = array();
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30'));
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30', 'maxlength' => '255'));
$elementgroup[] = $mform->createElement('checkbox', 'usedefaultname', '', get_string('sectionusedefaultname'));
$mform->addGroup($elementgroup, 'name_group', get_string('sectionname'), ' ', false);
$mform->addGroupRule('name_group', array('name' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255))));
$mform->setDefault('usedefaultname', true);
$mform->setType('name', PARAM_TEXT);
+1 -1
View File
@@ -515,7 +515,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$o.= html_writer::tag('div', '', array('class' => 'left side'));
$o.= html_writer::tag('div', '', array('class' => 'right side'));
$o.= html_writer::start_tag('div', array('class' => 'content'));
$o.= $this->output->heading(get_string('orphanedactivities'), 3, 'sectionname');
$o.= $this->output->heading(get_string('orphanedactivitiesinsectionno', '', $sectionno), 3, 'sectionname');
return $o;
}
+17 -1
View File
@@ -3962,6 +3962,20 @@ function update_course($data, $editoroptions = NULL) {
$data = file_postupdate_standard_editor($data, 'summary', $editoroptions, $context, 'course', 'summary', 0);
}
// Check we don't have a duplicate shortname.
if (!empty($data->shortname) && $oldcourse->shortname != $data->shortname) {
if ($DB->record_exists('course', array('shortname' => $data->shortname))) {
throw new moodle_exception('shortnametaken', '', '', $data->shortname);
}
}
// Check we don't have a duplicate idnumber.
if (!empty($data->idnumber) && $oldcourse->idnumber != $data->idnumber) {
if ($DB->record_exists('course', array('idnumber' => $data->idnumber))) {
throw new moodle_exception('idnumbertaken', 'error');
}
}
if (!isset($data->category) or empty($data->category)) {
// prevent nulls and 0 in category field
unset($data->category);
@@ -4001,7 +4015,9 @@ function update_course($data, $editoroptions = NULL) {
context_moved($context, $newparent);
}
fix_course_sortorder();
if ($movecat || (isset($data->sortorder) && $oldcourse->sortorder != $data->sortorder)) {
fix_course_sortorder();
}
// Test for and remove blocks which aren't appropriate anymore
blocks_remove_inappropriate($course);
+12
View File
@@ -59,6 +59,11 @@ if (!empty($add)) {
$context = context_course::instance($course->id);
require_capability('moodle/course:manageactivities', $context);
// There is no page for this in the navigation. The closest we'll have is the course section.
// If the course section isn't displayed on the navigation this will fall back to the course which
// will be the closest match we have.
navigation_node::override_active_url(course_get_url($course, $section));
course_create_sections_if_missing($course, $section);
$cw = get_fast_modinfo($course)->get_section_info($section);
@@ -122,6 +127,7 @@ if (!empty($add)) {
} else {
$pageheading = get_string('addinganew', 'moodle', $fullmodulename);
}
$navbaraddition = $pageheading;
} else if (!empty($update)) {
@@ -228,6 +234,7 @@ if (!empty($add)) {
} else {
$pageheading = get_string('updatinga', 'moodle', $fullmodulename);
}
$navbaraddition = null;
} else {
require_login();
@@ -651,6 +658,11 @@ if ($mform->is_cancelled()) {
$PAGE->set_heading($course->fullname);
$PAGE->set_title($streditinga);
$PAGE->set_cacheable(false);
if (isset($navbaraddition)) {
$PAGE->navbar->add($navbaraddition);
}
echo $OUTPUT->header();
if (get_string_manager()->string_exists('modulename_help', $module->name)) {
+47
View File
@@ -97,6 +97,53 @@ class courselib_testcase extends advanced_testcase {
$this->assertEquals(range(0, $course->numsections + 1), $sectionscreated);
}
public function test_update_course() {
global $DB;
$this->resetAfterTest();
$defaultcategory = $DB->get_field_select('course_categories', 'MIN(id)', 'parent = 0');
$course = new stdClass();
$course->fullname = 'Apu loves Unit Təsts';
$course->shortname = 'test1';
$course->idnumber = '1';
$course->summary = 'Awesome!';
$course->summaryformat = FORMAT_PLAIN;
$course->format = 'topics';
$course->newsitems = 0;
$course->numsections = 5;
$course->category = $defaultcategory;
$created = create_course($course);
// Ensure the checks only work on idnumber/shortname that are not already ours.
update_course($created);
$course->shortname = 'test2';
$course->idnumber = '2';
$created2 = create_course($course);
// Test duplicate idnumber.
$created2->idnumber = '1';
try {
update_course($created2);
$this->fail('Expected exception when trying to update a course with duplicate idnumber');
} catch (moodle_exception $e) {
$this->assertEquals(get_string('idnumbertaken', 'error'), $e->getMessage());
}
// Test duplicate shortname.
$created2->idnumber = '2';
$created2->shortname = 'test1';
try {
update_course($created2);
$this->fail('Expected exception when trying to update a course with a duplicate shortname');
} catch (moodle_exception $e) {
$this->assertEquals(get_string('shortnametaken', 'error', $created2->shortname), $e->getMessage());
}
}
public function test_course_add_cm_to_section() {
global $DB;
$this->resetAfterTest(true);
+59 -27
View File
@@ -17,7 +17,8 @@ YUI.add('moodle-course-dragdrop', function(Y) {
SECTION : 'section',
SECTIONADDMENUS : 'section_add_menus',
SECTIONHANDLE : 'section-handle',
SUMMARY : 'summary'
SUMMARY : 'summary',
SECTIONDRAGGABLE: 'sectiondraggable'
};
var DRAGSECTION = function() {
@@ -28,7 +29,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
initializer : function(params) {
// Set group for parent class
this.groups = ['section'];
this.groups = [ CSS.SECTIONDRAGGABLE ];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
@@ -39,14 +40,16 @@ YUI.add('moodle-course-dragdrop', function(Y) {
// Initialise sections dragging
this.sectionlistselector = M.course.format.get_section_wrapper(Y);
if (this.sectionlistselector) {
// We need both the list of all sections, and just those which are moveable.
// When updating titles and orders, the immoveable sections may need to be updated too.
this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+this.sectionlistselector;
this.setup_for_section(this.sectionlistselector);
// Make each li element in the lists of sections draggable
var nodeselector = this.sectionlistselector.slice(CSS.COURSECONTENT.length+2);
var del = new Y.DD.Delegate({
container: '.'+CSS.COURSECONTENT,
nodes: nodeselector,
nodes: '.' + CSS.SECTIONDRAGGABLE,
target: true,
handles: ['.'+CSS.LEFT],
dragConfig: {groups: this.groups}
@@ -95,6 +98,9 @@ YUI.add('moodle-course-dragdrop', function(Y) {
if (movedown) {
movedown.remove();
}
// This section can be moved - add the class to indicate this to Y.DD.
sectionnode.addClass(CSS.SECTIONDRAGGABLE);
}
}
}, this);
@@ -129,20 +135,37 @@ YUI.add('moodle-course-dragdrop', function(Y) {
this.drop_hit(e);
},
get_section_index: function(node) {
var sectionlistselector = '.' + CSS.COURSECONTENT + ' ' + M.course.format.get_section_selector(Y),
sectionList = Y.all(sectionlistselector),
nodeIndex = sectionList.indexOf(node),
zeroIndex = sectionList.indexOf(Y.one('#section-0'));
return (nodeIndex - zeroIndex);
},
drop_hit : function(e) {
var drag = e.drag;
// Get a reference to our drag node
var dragnode = drag.get('node');
var dropnode = e.drop.get('node');
// Prepare some variables
var dragnodeid = Number(this.get_section_id(dragnode));
var dropnodeid = Number(this.get_section_id(dropnode));
var loopstart = dragnodeid;
var loopend = dropnodeid;
// Get references to our nodes and their IDs.
var dragnode = drag.get('node'),
dragnodeid = this.get_section_id(dragnode),
loopstart = dragnodeid,
if (this.goingup) {
loopstart = dropnodeid;
dropnodeindex = this.get_section_index(dragnode),
loopend = dropnodeindex;
if (dragnodeid === dropnodeindex) {
Y.log("Skipping move - same location moving " + dragnodeid + " to " + dropnodeindex, 'debug', 'moodle-course-dragdrop');
return;
}
Y.log("Moving from position " + dragnodeid + " to position " + dropnodeindex, 'debug', 'moodle-course-dragdrop');
if (loopstart > loopend) {
// If we're going up, we need to swap the loop order
// because loops can't go backwards.
loopstart = dropnodeindex;
loopend = dragnodeid;
}
@@ -167,7 +190,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
params['class'] = 'section';
params.field = 'move';
params.id = dragnodeid;
params.value = dropnodeid;
params.value = dropnodeindex;
// Do AJAX request
var uri = M.cfg.wwwroot + this.get('ajaxurl');
@@ -190,27 +213,36 @@ YUI.add('moodle-course-dragdrop', function(Y) {
M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend);
} catch (e) {}
// Update all of the section IDs - first unset them, then set them
// to avoid duplicates in the DOM.
var index;
// Classic bubble sort algorithm is applied to the section
// nodes between original drag node location and the new one.
var swapped = false;
do {
var swapped = false;
for (var i = loopstart; i <= loopend; i++) {
if (this.get_section_id(sectionlist.item(i-1)) > this.get_section_id(sectionlist.item(i))) {
// Swap section id
var sectionid = sectionlist.item(i-1).get('id');
sectionlist.item(i-1).set('id', sectionlist.item(i).get('id'));
sectionlist.item(i).set('id', sectionid);
// See what format needs to swap
M.course.format.swap_sections(Y, i-1, i);
// Update flag
swapped = false;
for (index = loopstart; index <= loopend; index++) {
if (this.get_section_id(sectionlist.item(index - 1)) >
this.get_section_id(sectionlist.item(index))) {
Y.log("Swapping " + this.get_section_id(sectionlist.item(index - 1)) +
" with " + this.get_section_id(sectionlist.item(index)));
// Swap section id.
var sectionid = sectionlist.item(index - 1).get('id');
sectionlist.item(index - 1).set('id', sectionlist.item(index).get('id'));
sectionlist.item(index).set('id', sectionid);
// See what format needs to swap.
M.course.format.swap_sections(Y, index - 1, index);
// Update flag.
swapped = true;
}
}
loopend = loopend - 1;
} while (swapped);
// Finally, hide the lightbox
window.setTimeout(function(e) {
window.setTimeout(function() {
lightbox.hide();
}, 250);
},
+3
View File
@@ -46,6 +46,9 @@ class enrol_cohort_plugin extends enrol_plugin {
} else if (empty($instance->name)) {
$enrol = $this->get_name();
$cohort = $DB->get_record('cohort', array('id'=>$instance->customint1));
if (!$cohort) {
return get_string('pluginname', 'enrol_'.$enrol);
}
$cohortname = format_string($cohort->name, true, array('context'=>context::instance_by_id($cohort->contextid)));
if ($role = $DB->get_record('role', array('id'=>$instance->roleid))) {
$role = role_get_name($role, context_course::instance($instance->courseid, IGNORE_MISSING));
+2 -1
View File
@@ -25,8 +25,9 @@
$string['database:unenrol'] = 'Unenrol suspended users';
$string['dbencoding'] = 'Database encoding';
$string['dbhost'] = 'Database host';
$string['dbhost_desc'] = 'Type database server IP address or host name';
$string['dbhost_desc'] = 'Type database server IP address or host name. Use a system DSN name if using ODBC.';
$string['dbname'] = 'Database name';
$string['dbname_desc'] = 'Leave empty if using a DSN name in database host.';
$string['dbpass'] = 'Database password';
$string['dbsetupsql'] = 'Database setup command';
$string['dbsetupsql_desc'] = 'SQL command for special database setup, often used to setup communication encoding - example for MySQL and PostgreSQL: <em>SET NAMES \'utf8\'</em>';
+1 -1
View File
@@ -41,7 +41,7 @@ if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configpasswordunmask('enrol_database/dbpass', get_string('dbpass', 'enrol_database'), '', ''));
$settings->add(new admin_setting_configtext('enrol_database/dbname', get_string('dbname', 'enrol_database'), '', ''));
$settings->add(new admin_setting_configtext('enrol_database/dbname', get_string('dbname', 'enrol_database'), get_string('dbname_desc', 'enrol_database'), ''));
$settings->add(new admin_setting_configtext('enrol_database/dbencoding', get_string('dbencoding', 'enrol_database'), '', 'utf-8'));
+24 -7
View File
@@ -86,6 +86,7 @@ function cron() {
$this->logfp = fopen($logtolocation, 'a');
}
$fileisnew = false;
if ( file_exists($filename) ) {
@set_time_limit(0);
$starttime = time();
@@ -106,10 +107,8 @@ function cron() {
if(empty($prev_path) || ($filename != $prev_path)) {
$fileisnew = true;
} elseif(isset($prev_time) && ($filemtime <= $prev_time)) {
$fileisnew = false;
$this->log_line('File modification time is not more recent than last update - skipping processing.');
} elseif(isset($prev_md5) && ($md5 == $prev_md5)) {
$fileisnew = false;
$this->log_line('File MD5 hash is same as on last update - skipping processing.');
} else {
$fileisnew = true; // Let's process it!
@@ -216,7 +215,7 @@ function cron() {
$this->log_line('File not found: '.$filename);
}
if (!empty($mailadmins)) {
if (!empty($mailadmins) && $fileisnew) {
$msg = "An IMS enrolment has been carried out within Moodle.\nTime taken: $timeelapsed seconds.\n\n";
if(!empty($logtolocation)){
if($this->logfp){
@@ -233,7 +232,7 @@ function cron() {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'imsenterprise';
$eventdata->component = 'enrol_imsenterprise';
$eventdata->name = 'imsenterprise_enrolment';
$eventdata->userfrom = get_admin();
$eventdata->userto = get_admin();
@@ -397,7 +396,7 @@ function process_group_tag($tagcontents) {
// Insert default names for teachers/students, from the current language
// Handle course categorisation (taken from the group.org.orgunit field if present)
if (strlen($group->category)>0) {
if (!empty($group->category)) {
// If the category is defined and exists in Moodle, we want to store it in that one
if ($catid = $DB->get_field('course_categories', 'id', array('name'=>$group->category))) {
$course->category = $catid;
@@ -412,10 +411,10 @@ function process_group_tag($tagcontents) {
} else {
// If not found and not allowed to create, stick with default
$this->log_line('Category '.$group->category.' not found in Moodle database, so using default category instead.');
$course->category = 1;
$course->category = $this->get_default_category_id();
}
} else {
$course->category = 1;
$course->category = $this->get_default_category_id();
}
$course->timecreated = time();
$course->startdate = time();
@@ -810,6 +809,24 @@ function load_role_mappings() {
return false;
}
/**
* Get the default category id (often known as 'Miscellaneous'),
* statically cached to avoid multiple DB lookups on big imports.
*
* @return int id of default category.
*/
private function get_default_category_id() {
static $defaultcategoryid = null;
if ($defaultcategoryid === null) {
$category = get_course_category();
$defaultcategoryid = $category->id;
}
return $defaultcategoryid;
}
} // end of class
+1 -1
View File
@@ -950,7 +950,7 @@ class enrol_ldap_plugin extends enrol_plugin {
$template->groupmodeforce = $courseconfig->groupmodeforce;
$template->visible = $courseconfig->visible;
$template->lang = $courseconfig->lang;
$template->groupmodeforce = $courseconfig->groupmodeforce;
$template->enablecompletion = $courseconfig->enablecompletion;
}
$course = $template;
+6 -1
View File
@@ -47,7 +47,12 @@ class enrol_meta_plugin extends enrol_plugin {
} else if (empty($instance->name)) {
$enrol = $this->get_name();
$course = $DB->get_record('course', array('id'=>$instance->customint1));
$coursename = format_string(get_course_display_name_for_list($course));
if ($course) {
$coursename = format_string(get_course_display_name_for_list($course));
} else {
// Use course id, if course is deleted.
$coursename = $instance->customint1;
}
return get_string('pluginname', 'enrol_' . $enrol) . ' (' . $coursename . ')';
} else {
return format_string($instance->name);
+2 -2
View File
@@ -399,7 +399,7 @@ class core_files_renderer extends plugin_renderer_base {
<button class="{!}fp-file-cancel">'.get_string('cancel').'</button>
</div>
</form>
<div class="fp-info">
<div class="fp-info clearfix">
<div class="fp-hr"></div>
<p class="{!}fp-thumbnail"></p>
<div class="fp-fileinfo">
@@ -698,7 +698,7 @@ class core_files_renderer extends plugin_renderer_base {
<button class="{!}fp-select-cancel">'.get_string('cancel').'</button>
</div>
</form>
<div class="fp-info">
<div class="fp-info clearfix">
<div class="fp-hr"></div>
<p class="{!}fp-thumbnail"></p>
<div class="fp-fileinfo">
+11 -2
View File
@@ -131,6 +131,11 @@ class filter_glossary extends moodle_text_filter {
foreach ($concepts as $key => $concept) {
// Trim empty or unlinkable concepts
$currentconcept = trim(strip_tags($concept->concept));
// Concept must be HTML-escaped, so do the same as print_string
// to turn ampersands into &amp;.
$currentconcept = replace_ampersands_not_followed_by_entity($currentconcept);
if (empty($currentconcept)) {
unset($concepts[$key]);
continue;
@@ -168,10 +173,14 @@ class filter_glossary extends moodle_text_filter {
'&amp;mode=cat&amp;hook='.$concept->id.'">';
} else { // Link to entry or alias
if (!empty($concept->originalconcept)) { // We are dealing with an alias (so show and point to original)
$title = str_replace('"', "'", strip_tags($glossaryname.': '.$concept->originalconcept));
$title = str_replace('"', "'", html_entity_decode(
strip_tags($glossaryname.': '.$concept->originalconcept)));
$concept->id = $concept->entryid;
} else { // This is an entry
$title = str_replace('"', "'", strip_tags($glossaryname.': '.$concept->concept));
// We need to remove entities from the content here because it
// will be escaped by html_writer below.
$title = str_replace('"', "'", html_entity_decode(
strip_tags($glossaryname.': '.$concept->concept)));
}
// hardcoding dictionary format in the URL rather than defaulting
// to the current glossary format which may not work in a popup.
+1
View File
@@ -33,6 +33,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
$scope = optional_param('scope', 'custom', PARAM_ALPHA);
$PAGE->set_url('/grade/edit/outcome/import.php', array('courseid' => $courseid));
$PAGE->set_pagelayout('admin');
/// Make sure they can even access this course
if ($courseid) {
+1 -1
View File
@@ -38,7 +38,7 @@ class import_outcomes_form extends moodleform {
$mform->addElement('hidden', 'action', 'upload');
$mform->setType('action', PARAM_ALPHANUMEXT);
$mform->addElement('hidden', 'courseid', $PAGE->course->id);
$mform->setType('id', PARAM_INT);
$mform->setType('courseid', PARAM_INT);
$scope = array();
if (($PAGE->course->id > 1) && has_capability('moodle/grade:manage', context_system::instance())) {
+5 -2
View File
@@ -793,9 +793,12 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
public function get_item_cell($item, $params) {
global $DB, $OUTPUT;
// If the parent aggregation is Sum of Grades, this cannot be changed
// If the parent aggregation is Sum of Grades, we should show the number, even for scales, as that value is used...
// ...in the computation. For text grades, the grademax is not used, so we can still show the no value string.
$parent_cat = $item->get_parent_category();
if ($parent_cat->aggregation == GRADE_AGGREGATE_SUM) {
if ($item->gradetype == GRADE_TYPE_TEXT) {
$grademax = ' - ';
} else if ($parent_cat->aggregation == GRADE_AGGREGATE_SUM) {
$grademax = format_float($item->grademax, $item->get_decimals());
} elseif ($item->gradetype == GRADE_TYPE_SCALE) {
$scale = $DB->get_record('scale', array('id' => $item->scaleid));
+2 -1
View File
@@ -63,7 +63,8 @@ if ($id) {
$displaystring = null;
if (!empty($grade_item->itemmodule)) {
$displaystring = get_string('modulename', $grade_item->itemmodule).': '.$grade_item->get_name();
$displaystring = get_string('modulename', $grade_item->itemmodule).get_string('labelsep', 'langconfig')
.$grade_item->get_name();
} else {
$displaystring = $grade_item->get_name();
}
+20 -10
View File
@@ -86,17 +86,22 @@ class grade_import_mapping_form extends moodleform {
}
$mform->addElement('select', 'mapfrom', get_string('mapfrom', 'grades'), $mapfromoptions);
$maptooptions = array('userid'=>'userid', 'username'=>'username', 'useridnumber'=>'useridnumber', 'useremail'=>'useremail', '0'=>'ignore');
$maptooptions = array(
'userid' => get_string('userid', 'grades'),
'username' => get_string('username'),
'useridnumber' => get_string('idnumber'),
'useremail' => get_string('email'),
'0' => get_string('ignore', 'grades')
);
$mform->addElement('select', 'mapto', get_string('mapto', 'grades'), $maptooptions);
$mform->addElement('header', 'general', get_string('mappings', 'grades'));
// add a comment option
$comments = array();
// Add a feedback option.
$feedbacks = array();
if ($gradeitems = $this->_customdata['gradeitems']) {
foreach ($gradeitems as $itemid => $itemname) {
$comments['feedback_'.$itemid] = 'comments for '.$itemname;
$feedbacks['feedback_'.$itemid] = get_string('feedbackforgradeitems', 'grades', $itemname);
}
}
@@ -104,11 +109,16 @@ class grade_import_mapping_form extends moodleform {
$i = 0; // index
foreach ($header as $h) {
$h = trim($h);
// this is what each header maps to
$mform->addElement('selectgroups', 'mapping_'.$i, s($h),
array('others'=>array('0'=>'ignore', 'new'=>'new gradeitem'),
'gradeitems'=>$gradeitems,
'comments'=>$comments));
// This is what each header maps to.
$headermapsto = array(
get_string('others', 'grades') => array(
'0' => get_string('ignore', 'grades'),
'new' => get_string('newitem', 'grades')
),
get_string('gradeitems', 'grades') => $gradeitems,
get_string('feedbacks', 'grades') => $feedbacks
);
$mform->addElement('selectgroups', 'mapping_'.$i, s($h), $headermapsto);
$i++;
}
}
+1 -1
View File
@@ -186,7 +186,7 @@ class graded_users_iterator {
LEFT JOIN (SELECT * FROM {user_info_data}
WHERE fieldid = :cf$customfieldscount) cf$customfieldscount
ON u.id = cf$customfieldscount.userid";
$userfields .= ", cf$customfieldscount.data AS 'customfield_{$field->shortname}'";
$userfields .= ", cf$customfieldscount.data AS customfield_{$field->shortname}";
$params['cf'.$customfieldscount] = $field->customid;
$customfieldscount++;
}
+100 -8
View File
@@ -32,21 +32,113 @@ require_once($CFG->dirroot.'/grade/edit/tree/lib.php');
/**
* Tests grade_edit_tree (deals with the data on the categories and items page in the gradebook)
*/
class gradeedittreelib_testcase extends basic_testcase {
var $courseid = 1;
var $context = null;
var $grade_edit_tree = null;
class gradeedittreelib_testcase extends advanced_testcase {
public function test_format_number() {
$numinput = array( 0, 1, 1.01, '1.010', 1.2345);
$numinput = array(0, 1, 1.01, '1.010', 1.2345);
$numoutput = array(0.0, 1.0, 1.01, 1.01, 1.2345);
for ($i=0; $i<sizeof($numinput); $i++) {
for ($i = 0; $i < count($numinput); $i++) {
$msg = 'format_number() testing '.$numinput[$i].' %s';
$this->assertEquals(grade_edit_tree::format_number($numinput[$i]),$numoutput[$i],$msg);
$this->assertEquals(grade_edit_tree::format_number($numinput[$i]), $numoutput[$i], $msg);
}
}
public function test_grade_edit_tree_column_range_get_item_cell() {
global $DB, $CFG;
$this->resetAfterTest(true);
// Make some things we need.
$scale = $this->getDataGenerator()->create_scale();
$course = $this->getDataGenerator()->create_course();
$assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id));
$modulecontext = context_module::instance($assign->id);
// The generator returns a dummy object, lets get the real assign object.
$assign = new assign($modulecontext, false, false);
$cm = $assign->get_course_module();
$subplugins = $assign->get_submission_plugins();
$feedplugins = $assign->get_feedback_plugins();
// Get range column.
$column = grade_edit_tree_column::factory('range');
$gradeitemparams = array(
'itemtype' => 'mod',
'itemmodule' => $cm->modname,
'iteminstance' => $cm->instance,
'courseid' => $cm->course,
'itemnumber' => 0
);
// Lets set the grade to something we know.
$instance = $assign->get_instance();
foreach ($subplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
foreach ($feedplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
$instance->grade = 70;
$instance->instance = $instance->id;
$assign->update_instance($instance);
$gradeitem = grade_item::fetch($gradeitemparams);
$cell = $column->get_item_cell($gradeitem, array());
$this->assertEquals(GRADE_TYPE_VALUE, $gradeitem->gradetype);
$this->assertEquals(null, $gradeitem->scaleid);
$this->assertEquals(70.0, (float) $cell->text, "Grade text is 70", 0.01);
// Now change it to a scale.
$instance = $assign->get_instance();
foreach ($subplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
foreach ($feedplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
$instance->grade = -($scale->id);
$instance->instance = $instance->id;
$assign->update_instance($instance);
$gradeitem = grade_item::fetch($gradeitemparams);
$cell = $column->get_item_cell($gradeitem, array());
// Make the expected scale text.
$scaleitems = null;
$scaleitems = explode(',', $scale->scale);
$scalestring = end($scaleitems) . ' (' . count($scaleitems) . ')';
$this->assertEquals(GRADE_TYPE_SCALE, $gradeitem->gradetype);
$this->assertEquals($scale->id, $gradeitem->scaleid);
$this->assertEquals($scalestring, $cell->text, "Grade text matches scale");
// Now change it to no grade.
$instance = $assign->get_instance();
foreach ($subplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
foreach ($feedplugins as $plugin) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
$instance->$enabledname = 0;
}
$instance->grade = 0;
$instance->instance = $instance->id;
$assign->update_instance($instance);
$gradeitem = grade_item::fetch($gradeitemparams);
$cell = $column->get_item_cell($gradeitem, array());
$this->assertEquals(GRADE_TYPE_TEXT, $gradeitem->gradetype);
$this->assertEquals(null, $gradeitem->scaleid);
$this->assertEquals(' - ', $cell->text, 'Grade text matches empty value of " - "');
}
}
+32 -17
View File
@@ -99,25 +99,40 @@ $PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('adduserstogroup', 'group').": $groupname", 3);
/// Print group info - TODO: remove tables for layout here
$groupinfotable = new html_table();
$groupinfotable->attributes['class'] = 'groupinfobox';
$picturecell = new html_table_cell();
$picturecell->attributes['class'] = 'left side picture';
$picturecell->text = print_group_picture($group, $course->id, true, true, false);
// Store the rows we want to display in the group info.
$groupinforow = array();
$contentcell = new html_table_cell();
$contentcell->attributes['class'] = 'content';
$group->description = file_rewrite_pluginfile_urls($group->description, 'pluginfile.php', $context->id, 'group', 'description', $group->id);
if (!isset($group->descriptionformat)) {
$group->descriptionformat = FORMAT_MOODLE;
// Check if there is a picture to display.
if (!empty($group->picture)) {
$picturecell = new html_table_cell();
$picturecell->attributes['class'] = 'left side picture';
$picturecell->text = print_group_picture($group, $course->id, true, true, false);
$groupinforow[] = $picturecell;
}
// Check if there is a description to display.
$group->description = file_rewrite_pluginfile_urls($group->description, 'pluginfile.php', $context->id, 'group', 'description', $group->id);
if (!empty($group->description)) {
if (!isset($group->descriptionformat)) {
$group->descriptionformat = FORMAT_MOODLE;
}
$options = new stdClass;
$options->overflowdiv = true;
$contentcell = new html_table_cell();
$contentcell->attributes['class'] = 'content';
$contentcell->text = format_text($group->description, $group->descriptionformat, $options);
$groupinforow[] = $contentcell;
}
// Check if we have something to show.
if (!empty($groupinforow)) {
$groupinfotable = new html_table();
$groupinfotable->attributes['class'] = 'groupinfobox';
$groupinfotable->data[] = new html_table_row($groupinforow);
echo html_writer::table($groupinfotable);
}
$options = new stdClass;
$options->overflowdiv = true;
$contentcell->text = format_text($group->description, $group->descriptionformat, $options);
$groupinfotable->data[] = new html_table_row(array($picturecell, $contentcell));
echo html_writer::table($groupinfotable);
/// Print the editing form
?>
+1 -1
View File
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
$string['availablelangs'] = 'Списък на наличните езици';
$string['availablelangs'] = 'Налични езикови пакети';
$string['chooselanguagehead'] = 'Изберете език';
$string['chooselanguagesub'] = 'Моля, изберете език за инсталацията. Този език ще бъде, също така, език по подразбиране на сайта, но може да бъде променен и по-късно след инсталирането.';
$string['databasehost'] = 'Хост на базата данни';
+34
View File
@@ -0,0 +1,34 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['language'] = 'زمان';
$string['reload'] = 'بارکردنەوە';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Admin directory';
$string['availablelangs'] = 'List of available languages';
$string['availablelangs'] = 'Available language packs';
$string['chooselanguagehead'] = 'Choose a language';
$string['chooselanguagesub'] = 'Please choose a language for the installation. This language will also be used as the default language for the site, though it may be changed later.';
$string['clialreadyconfigured'] = 'File config.php already exists, please use admin/cli/install_database.php if you want to install this site.';
+33
View File
@@ -0,0 +1,33 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['environmentrequireversion'] = 'version {$a->needed} is required and ye are running {$a->current}';
+33
View File
@@ -0,0 +1,33 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['remotedownloaderror'] = 'Download of component to yer server failed, please verify proxy settings, PHP cURL extension is highly recommended.<br /><br />Ye must download the <a href="{$a->url}">{$a->url}</a> file manually, copy it to "{$a->dest}" in yer server and unzip it there.';
+75
View File
@@ -0,0 +1,75 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['clialreadyconfigured'] = 'File config.php already exists, please use admin/cli/install_database.php if ye want to install this site.';
$string['clialreadyinstalled'] = 'File config.php already exists, please use admin/cli/upgrade.php if ye want to upgrade this site.';
$string['environmenthead'] = 'Checking yer environment ...';
$string['environmentsub2'] = 'Each Moodle release has some minimum PHP version requirement and a number of mandatory PHP extensions.
Full environment check is done before each install and upgrade. Please contact server administrator if ye do not know how to install new version or enable PHP extensions.';
$string['memorylimithelp'] = '<p>The PHP memory limit for yer server is currently set to {$a}.</p>
<p>This may cause Moodle to have memory problems later on, especially
if ye have a lot of modules enabled and/or a lot of users.</p>
<p>We recommend that ye configure PHP with a higher limit if possible, like 40M.
There are several ways of doing this that ye can try:</p>
<ol>
<li>If ye are able to, recompile PHP with <i>--enable-memory-limit</i>.
This will allow Moodle to set the memory limit itself.</li>
<li>If ye have access to yer php.ini file, ye can change the <b>memory_limit</b>
setting in there to something like 40M. If ye don\'t have access ye might
be able to ask yer administrator to do this for you.</li>
<li>On some PHP servers ye can create a .htaccess file in the Moodle directory
containing this line:
<blockquote><div>php_value memory_limit 40M</div></blockquote>
<p>However, on some servers this will prevent <b>all</b> PHP pages from working
(you will see errors when ye look at pages) so you\'ll have to remove the .htaccess file.</p></li>
</ol>';
$string['pathssubadmindir'] = 'A very few webhosts use /admin as a special URL for ye to access a
control panel or something. Unfortunately this conflicts with the standard location for the Moodle admin pages. Ye can fix this by
renaming the admin directory in yer installation, and putting that new name here. For example: <em>moodleadmin</em>. This will fix admin links in Moodle.';
$string['pathssubdataroot'] = 'Ye need a place where Moodle can save uploaded files. This directory should be readable AND WRITEABLE by the web server user
(usually \'nobody\' or \'apache\'), but it must not be accessible directly via the web. The installer will try to create it if doesn\'t exist.';
$string['pathssubwwwroot'] = 'Full web address where Moodle will be accessed.
It\'s not possible to access Moodle using multiple addresses.
If yer site has multiple public addresses ye must set up permanent redirects on all of them except this one.
If yer site is accessible both from Intranet and Internet use the public address here and set up DNS so that the Intranet users may use the public address too.
If the address is not correct please change the URL in yer browser to restart installation with a different value.';
$string['phpversionhelp'] = '<p>Moodle requires a PHP version of at least 4.3.0 or 5.1.0 (5.0.x has a number of known problems).</p>
<p>Ye are currently running version {$a}</p>
<p>Ye must upgrade PHP or move to a host with a newer version of PHP!<br />
(In case of 5.0.x ye could also downgrade to 4.4.x version)</p>';
$string['welcomep20'] = 'Ye are seeing this page because ye have successfully installed and
launched the <strong>{$a->packname} {$a->packversion}</strong> package in yer computer. Congratulations!';
$string['welcomep60'] = 'The following pages will lead ye through some easy to follow steps to
configure and set up <strong>Moodle</strong> on yer computer. Ye may accept the default
settings or, optionally, amend them to suit yer own needs.';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Directorio Admin';
$string['availablelangs'] = 'Lista de idiomas disponibles';
$string['availablelangs'] = 'Paquetes de idiomas disponibles';
$string['chooselanguagehead'] = 'Seleccionar idioma';
$string['chooselanguagesub'] = 'Por favor, seleccione un idioma para el proceso de instalación. Este idioma se usará también como idioma por defecto del sitio, si bien puede cambiarse más adelante.';
$string['clialreadyconfigured'] = 'El archivo config.php ya existe, por favor use admin/cli/install_database.php si desea instalar este sitio';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Admin direktorioa';
$string['availablelangs'] = 'Hizkuntza eskuragarrien zerrenda';
$string['availablelangs'] = 'Hizkuntza-pakete eskuragarriak';
$string['chooselanguagehead'] = 'Aukeratu hizkuntza bat';
$string['chooselanguagesub'] = 'Mesedez, aukeratu instalaziorako hizkuntza bat. Hizkuntza hori erabiliko da gunearen berezko hizkuntza gisa, baina aurrerago alda daiteke.';
$string['clialreadyconfigured'] = 'File config.php fitxategia badago, mesedez erabili admin/cli/install_database.php gune hau instalatu nahi baduzu.';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Dossier administration';
$string['availablelangs'] = 'Liste des langues disponibles';
$string['availablelangs'] = 'Paquetages de langue disponibles';
$string['chooselanguagehead'] = 'Choisissez une langue';
$string['chooselanguagesub'] = 'Veuillez choisir la langue d\'installation. Cette langue sera utilisée comme langue par défaut du site, que vous pourrez modifier ultérieurement.';
$string['clialreadyconfigured'] = 'Le fichier config.php existe déjà. Veuillez utiliser admin/cli/install_database.php si vous désirez mettre à jour ce site.';
+33
View File
@@ -0,0 +1,33 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['thislanguage'] = 'Kreyòl Ayisyen';
+1 -1
View File
@@ -42,7 +42,7 @@ $string['componentisuptodate'] = 'Il componente è aggiornato.';
$string['downloadedfilecheckfailed'] = 'Il controllo del file scaricato non è andato a buon fine.';
$string['invalidmd5'] = 'La variabile di controllo era errata - prova di nuovo';
$string['missingrequiredfield'] = 'Mancano alcuni campi richiesti';
$string['remotedownloaderror'] = 'Lo scaricamento delle componenti non è andato a buon fine. Verificate le impostazioni del proxy. L\'estensione PHP cURL è fortemente consigliata.<br /><br />Dovete scaricare manualmente il file <a href="{$a->url}">{$a->url}</a>, copiarlo in "{$a->dest}" e decomprimerlo.';
$string['remotedownloaderror'] = 'Lo scaricamento delle componenti non è andato a buon fine. Verificare le impostazioni del proxy. L\'estensione PHP cURL è fortemente consigliata.<br /><br />Devi scaricare manualmente il file <a href="{$a->url}">{$a->url}</a>, copiarlo in "{$a->dest}" e decomprimerlo.';
$string['wrongdestpath'] = 'Percorso di destinazione errato';
$string['wrongsourcebase'] = 'Indirizzo (URL) sorgente errato.';
$string['wrongzipfilename'] = 'Il nome del file ZIP è errato.';
+6 -7
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Cartella Admin';
$string['availablelangs'] = 'Elenco delle lingue disponibili:';
$string['availablelangs'] = 'Elenco delle lingue disponibili';
$string['chooselanguagehead'] = 'Scegli la lingua';
$string['chooselanguagesub'] = 'Scegli la lingua da usare durante l\'installazione. La lingua usata nel sito e dagli utenti potrà essere modificata in seguito.';
$string['clialreadyconfigured'] = 'Il file config.php esiste già, per favore utilizza admin/cli/install_database.php se desideri installare questo sito.';
@@ -53,8 +53,7 @@ $string['memorylimithelp'] = '<p>Il limite di memoria assegnata al PHP attualmen
<p>Tale limite potrà causare problemi nel funzionamento di Moodle, specialmente se usi molti moduli di attività con molti utenti.</p>
<p>Ti raccomandiamo di impostare il PHP con un limite più alto se possibile, ad esempio 40M.
Ci sono diversi modi che puoi provare:
<p>Ti raccomandiamo di impostare il PHP con un limite più alto, ad esempio 40M, usando uno dei modi seguenti:
<ol>
<li>Se possibile, ricompila il PHP con l\'opzione <i>--enable-memory-limit</i>.
Questo consentirà a Moodle di impostare in autonomia il limite di memoria.</li>
@@ -78,10 +77,10 @@ $string['pathsunsecuredataroot'] = 'La posizione della Cartella dati non è sicu
$string['pathswrongadmindir'] = 'La cartella Admin non esiste';
$string['phpextension'] = '{$a} estensioni PHP';
$string['phpversion'] = 'Versione PHP';
$string['phpversionhelp'] = '<p>Moodle necessita come minimo della versione 4.3.0 o 5.1.0 del PHP. (La versione 5.0.x soffre di problemi ben conosciuti)</p>
<p>La versione installata nel vostro sistema è la {$a}</p>
<p>Dovete aggiornare la versione del PHP oppure spostarsi su un host che abbia una versione più aggiornata del PHP!<br>
(Se avete la 5.0.x, potete fare il downgrade alla versione 4.4.x)</p>';
$string['phpversionhelp'] = '<p>Moodle necessita come minimo della versione 4.3.0 o 5.1.0 del PHP. (La versione 5.0.x soffre di problemi noti)</p>
<p>La versione installata nel sistema è la {$a}</p>
<p>E\' necessario aggiornare la versione del PHP oppure spostarsi su un host che abbia una versione più aggiornata del PHP!<br>
(Dalla 5.0.x, è possibile eseguire il downgrade alla versione 4.4.x)</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Se vedi questa pagina hai installato correttamente e lanciato il pacchetto <strong>{$a->packname} {$a->packversion}</strong>. Complimenti!';
$string['welcomep30'] = 'La release di <strong>{$a->installername}</strong> include l\'applicazione per creare l\'ambiente necessario a far girare <strong>Moodle</strong>:';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Adminディレクトリ';
$string['availablelangs'] = '利用可能な言語一覧';
$string['availablelangs'] = '利用可能な言語パック';
$string['chooselanguagehead'] = '言語を選択してください。';
$string['chooselanguagesub'] = 'インストールのみに使用する言語を選択してください。この言語は、サイトのデフォルト言語としても使用されます。サイト言語は、後で変更することが可能です。';
$string['clialreadyconfigured'] = 'ファイルconfig.phpは、すでに登録されています。このサイトをインストールしたい場合、admin/cli/install_database.phpを使用してください。';
+33
View File
@@ -0,0 +1,33 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['thislanguage'] = 'Кыргызча';
+5 -5
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Direktori admin';
$string['availablelangs'] = 'Senarai bahasa yang tersedia';
$string['chooselanguagehead'] = 'Pilih bahasa';
$string['chooselanguagesub'] = 'Sila pilih bahasa untuk pemasangan. Bahasa ini juga akan digunakan sebagai bahasa lalai untuk laman, ia boleh diubah kemudian.';
$string['chooselanguagesub'] = 'Sila pilih bahasa untuk pemasangan. Bahasa dipilih akan digunakan sebagai bahasa lalai untuk laman, walau bagaimanapun ia boleh diubah kemudian.';
$string['clialreadyinstalled'] = 'config.php fail sudah wujud, sila gunakan admin/cli/upgrade.php jika anda mahu menaik taraf laman web anda.';
$string['cliinstallheader'] = 'Baris arahan pemasangan program Moodle {$a}';
$string['databasehost'] = 'Hos pangkalan data';
@@ -46,7 +46,7 @@ $string['environmenthead'] = 'Memeriksa persekitaran anda ...';
$string['environmentsub2'] = 'Setiap pelepasan Moodle mempunyai keperluan minimum versi PHP dan beberapa sambungan mandatori PHP. Persekitaran penuh disemak sebelum setiap pemasangan dan naik taraf. Sila hubungi pentadbir pelayan jika anda tidak tahu bagaimana untuk memasang versi baru atau membolehkan sambungan PHP.';
$string['errorsinenvironment'] = 'Semakan persekitaran gagal!';
$string['installation'] = 'Pemasangan';
$string['langdownloaderror'] = 'Malangnya bahasa "{$a}" tidak boleh dimuat turun. Proses pemasangan akan diteruskan dalam bahasa Bahasa Inggeris.';
$string['langdownloaderror'] = 'Malangnya fail bahasa "{$a}" tidak dapat dimuat turun. Proses pemasangan akan diteruskan dalam Bahasa Inggeris.';
$string['memorylimithelp'] = '<p> Had memori PHP untuk pelayan anda ditetapkan kepada {$a}. </p>
<p> Hal ini akan menyebabkan Moodle untuk mendapat masalah memori di kemudian hari, terutama jika anda mempunyai banyak modul yang diaktifkan dan/atau ramai pengguna. </p>
@@ -63,9 +63,9 @@ $string['pathsrodataroot'] = 'Direktori dataroot tidak dapat ditulis.';
$string['pathsroparentdataroot'] = 'Direktori induk ({$a->parent}) tidak boleh tulis. Direktori data ({$a->dataroot}) tidak boleh diwujudkan oleh pemasang.';
$string['pathssubadmindir'] = 'Beberapa webhos menggunakan /admin sebagai URL khas untuk anda akses panel kawalan atau sesuatu yang lain. Malangnya, ini bertentangan dengan lokasi standard untuk halaman pentadbiran Moodle. Anda boleh memperbaiki ini dengan menamakan semula direktori admin dalam pemasangan anda, dan meletakkan nama baru di sini. Sebagai contoh: <br /> <br /> <b> moodleadmin </ b> <br /> <br />
Ini akan memulihkan pautan admin dalam Moodle.';
$string['pathssubdataroot'] = 'Anda perlukan lokasi di mana Moodle boleh menyimpan fail yang dimuat naik. Direktori ini sepatutnya boleh dibaca DAN BOLEH DITULIS oleh pengguna web server (biasanya \'nobody\' atau \'apache\'), tetapi ia mestilah tidak boleh diakses secara langsung melalui laman web. Pemasang akan cuba untuk mewujudkannya jika belum ada.';
$string['pathssubdirroot'] = 'Direktori laluan penuh untuk pemasangan Moodle.';
$string['pathssubwwwroot'] = 'Alamat penuh web di mana Moodle akan dicapai. Adalah tidak mungkin untuk mengakses Moodle menggunakan pelbagai alamat. Jika laman anda mempunyai beberapa alamat awam, anda mesti menubuhkan pelencongan kekal kepada semua mereka kecuali yang satu ini. Jika laman web anda boleh diakses kedua-duanya dari Intranet dan Internet menggunakan alamat awam di sini dan menubuhkan DNS supaya pengguna Intranet boleh menggunakan alamat awam juga. Jika alamat itu tidak betul, sila ubah URL di pelayar anda untuk memulakan semula pemasangan dengan nilai yang berbeza.';
$string['pathssubdataroot'] = 'Anda perlukan lokasi di mana Moodle boleh menyimpan fail yang dimuat naik. Direktori ini sepatutnya boleh dibaca DAN DITULIS oleh pengguna web server (biasanya \'nobody\' atau \'apache\'), tetapi ia mestilah tidak boleh diakses secara langsung melalui laman web. Pemasang akan cuba untuk wujudkannya jika belum ada.';
$string['pathssubdirroot'] = 'Laluan penuh direktori untuk pemasangan Moodle.';
$string['pathssubwwwroot'] = 'Alamat penuh web di mana Moodle akan dicapai. Ia tidak mungkin untuk mengakses Moodle menggunakan berbilang alamat. Jika laman anda mempunyai pelbagai alamat awam, anda mesti menubuhkan pelencongan kekal kepada yang lain kecuali yang satu ini. Jika laman web anda boleh diakses kedua-dua Intranet dan Internet, gunakan alamat awam di sini dan tubuhkan DNS supaya pengguna Intranet boleh gunakan alamat awam juga. Jika alamat sekarang tidak betul, sila ubah URL di pelayar anda untuk memulakan semula pemasangan dengan nilai yang berbeza.';
$string['pathsunsecuredataroot'] = 'Lokasi dataroot tidak selamat';
$string['pathswrongadmindir'] = 'Direktori admin tidak wujud';
$string['phpextension'] = 'Sambungan PHP {$a}';
+1 -1
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Admin-map';
$string['availablelangs'] = 'Lijst met beschikbare talen';
$string['availablelangs'] = 'Beschikbare taalpakketten';
$string['chooselanguagehead'] = 'Kies een taal';
$string['chooselanguagesub'] = 'Kies een taal voor de installatie. Deze taal zal ook als standaardtaal voor de site gebruikt worden, maar die instelling kun je later nog wijzigen.';
$string['clialreadyconfigured'] = 'Bestand config.php bestaat al, maak aub gebruik van admin/cli/install_database.php indien je deze site wenst te installeren.';
+1 -1
View File
@@ -42,7 +42,7 @@ $string['componentisuptodate'] = 'O componente está atualizado.';
$string['downloadedfilecheckfailed'] = 'A verificação do ficheiro descarregado falhou.';
$string['invalidmd5'] = 'A variável de verificação está errada - tente novamente.';
$string['missingrequiredfield'] = 'Um dos campos obrigatórios está em falta';
$string['remotedownloaderror'] = 'A descarga do componente para o servidor falhou. Verifique as configurações do proxy. A instalação da extensão cURL do PHP é muito recomendada.<br /><br />Terá que descarregar o ficheiro <a href="{$a->url}">{$a->url}</a> manualmente, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo.';
$string['remotedownloaderror'] = 'O download do componente para o servidor falhou. Verifique as configurações do proxy. A instalação da extensão cURL do PHP é muito recomendada.<br /><br />Terá que descarregar o ficheiro <a href="{$a->url}">{$a->url}</a> manualmente, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo.';
$string['wrongdestpath'] = 'Caminho de destino errado.';
$string['wrongsourcebase'] = 'Base do URL de origem errada';
$string['wrongzipfilename'] = 'Nome de ficheiro ZIP errado.';
+2 -2
View File
@@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Pasta de administração';
$string['availablelangs'] = 'Idiomas disponíveis';
$string['availablelangs'] = 'Pacotes de idiomas disponíveis';
$string['chooselanguagehead'] = 'Selecione um idioma';
$string['chooselanguagesub'] = 'Selecione o idioma a utilizar durante a instalação. Poderá depois selecionar um outro idioma para o site e para os utilizadores.';
$string['clialreadyconfigured'] = 'O ficheiro config.php já existe, use admin/cli/install_database.php se desejar instalar este site.';
@@ -48,7 +48,7 @@ $string['environmenthead'] = 'A verificar sistema...';
$string['environmentsub2'] = 'Cada nova versão do Moodle tem pré-requisitos mínimos relativamente à versão do PHP e extensões necessárias para o seu correto funcionamento. Estes pré-requisitos são verificados sempre que o Moodle é instalado ou atualizado. Contacte o administrador do servidor caso seja necessário atualizar a versão do PHP ou instalar novas extensões.';
$string['errorsinenvironment'] = 'A verificação do sistema falhou!';
$string['installation'] = 'Instalação';
$string['langdownloaderror'] = 'Não foi possível instalar o idioma <b>{$a}</b> por falha na descarga. O processo de instalação continuará em Inglês.';
$string['langdownloaderror'] = 'Não foi possível instalar o idioma <b>{$a}</b> por falha no download. O processo de instalação continuará em Inglês.';
$string['memorylimithelp'] = '<p>O limite de memória para o PHP definido atualmente no servidor é <b>{$a}</b>.</p><p>Um número elevado de módulos em utilização ou de utilizadores registados pode fazer com que o Moodle apresente problemas de falta de memória.</p><p>É recomendado que o PHP seja configurado com um limite de memória de pelo menos 40MB. Esta configuração pode ser definida de diversas formas:</p><ol><li>Compilação do PHP com o parâmetro <b>--enable-memory-limit</b>. Esta definição permitirá ao próprio Moodle definir o valor a utilizar.</li><li>Alteração do parâmetro <b>memory_limit</b> no ficheiro de configuração do PHP para um valor igual ou superior a 40MB.</li><li>Criação de um ficheiro <b>.htaccess</b> na raiz da pasta do Moodle com a linha <b>php_value memory_limit 40M</b><p>ATENÇÃO: Em alguns servidores esta configuração impedirá o funcionamento de <b>todas</b> as páginas PHP. Nestes casos, não poderá ser utilizado o ficheiro <b>.htaccess</b>.</p></li></ol>';
$string['paths'] = 'Caminhos';
$string['pathserrcreatedataroot'] = 'O programa de instalação não conseguiu criar a pasta de dados <b>{$a->dataroot}</b>.';
+6 -9
View File
@@ -161,15 +161,12 @@ $string['configcronremotepassword'] = 'This means that the cron.php script canno
$string['configcurlcache'] = 'Time-to-live for cURL cache, in seconds.';
$string['configcustommenuitems'] = 'You can configure a custom menu here to be shown by themes. Each line consists of some menu text, a link URL (optional), a tooltip title (optional) and a language code or comma-separated list of codes (optional, for displaying the line to users of the specified language only), separated by pipe characters. You can specify a structure using hyphens. For example:
<pre>
Moodle community|http://moodle.org
-Moodle free support|http://moodle.org/support
-Moodle development|http://moodle.org/development
--Moodle Tracker|http://tracker.moodle.org
--Moodle Docs|http://docs.moodle.org|Moodle Docs in German
Moodle community|https://moodle.org
-Moodle free support|https://moodle.org/support
-Moodle development|https://moodle.org/development
--Moodle Docs|http://docs.moodle.org|Moodle Docs
--German Moodle Docs|http://docs.moodle.org/de|Documentation in German|de
-Moodle News|http://moodle.org/news Moodle company
-Moodle commercial hosting|http://moodle.com/hosting
-Moodle commercial support|http://moodle.com/support
Moodle.com|http://moodle.com/
</pre>';
$string['configdbsessions'] = 'If enabled, this setting will use the database to store information about current sessions. This is especially useful for large/busy sites or sites built on cluster of servers. For most sites this should probably be left disabled so that the server disk is used instead. Note that changing this setting now will log out all current users (including you). If you are using MySQL please make sure that \'max_allowed_packet\' in my.cnf (or my.ini) is at least 4M.';
$string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.';
@@ -527,7 +524,7 @@ $string['forcelogin'] = 'Force users to log in';
$string['forceloginforprofileimage'] = 'Force users to log in to view user pictures';
$string['forceloginforprofileimage_help'] = 'If enabled, users must login in order to view user profile pictures and the default user picture will be used in all notification emails.';
$string['forceloginforprofiles'] = 'Force users to log in for profiles';
$string['forcetimezone'] = 'Force default timezone';
$string['forcetimezone'] = 'Force timezone';
$string['formatuninstallwithcourses'] = 'There are {$a->count} courses using {$a->format}. Their format will be changed to {$a->defaultformat} (default format for this site). Some format-specific data may be lost. Are you sure you want to proceed?';
$string['formatuninstallconfirm'] = '{$a} will be uninstalled. No courses currently use it. Continue?';
$string['formatuninstalled'] = 'All data associated with the format plugin \'{$a->plugin}\' has been deleted from the database. To complete the deletion (and prevent the plugin re-installing itself), you should now delete this directory from your server: {$a->directory}';
+1
View File
@@ -248,6 +248,7 @@ $string['skipmodifprevhelp'] = 'Choose whether or not to skip courses that have
$string['title'] = 'Title';
$string['totalcategorysearchresults'] = 'Total categories: {$a}';
$string['totalcoursesearchresults'] = 'Total courses: {$a}';
$string['unnamedsection'] = 'Unnamed section';
$string['userinfo'] = 'Userinfo';
$string['module'] = 'Module';
$string['morecoursesearchresults'] = 'More than {$a} courses found, showing first {$a} results';
+1 -1
View File
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['addfields'] = 'Add {$a} fields to form';
$string['addfields'] = 'Add {$a} field(s) to form';
$string['advancedelement'] = 'Advanced element';
$string['close'] = 'Close';
$string['day'] = 'Day';
+5
View File
@@ -202,6 +202,8 @@ $string['feedback'] = 'Feedback';
$string['feedback_help'] = 'This box enables any comments about the grade to be added.';
$string['feedbackadd'] = 'Add feedback';
$string['feedbackedit'] = 'Edit feedback';
$string['feedbackforgradeitems'] = 'Feedback for {$a}';
$string['feedbacks'] = 'Feedbacks';
$string['feedbacksaved'] = 'Feedback saved';
$string['feedbackview'] = 'View feedback';
$string['finalgrade'] = 'Final grade';
@@ -335,6 +337,7 @@ $string['chooseaction'] = 'Choose an action ...';
$string['choosecategory'] = 'Select category';
$string['identifier'] = 'Identify user by';
$string['idnumbers'] = 'ID numbers';
$string['ignore'] = 'Ignore';
$string['import'] = 'Import';
$string['importcsv'] = 'Import CSV';
$string['importcustom'] = 'Import as custom outcomes (only this course)';
@@ -446,6 +449,7 @@ $string['numberofgrades'] = 'Number of grades';
$string['onascaleof'] = 'on a scale of {$a->grademin} to {$a->grademax}';
$string['operations'] = 'Operations';
$string['options'] = 'Options';
$string['others'] = 'Others';
$string['outcome'] = 'Outcome';
$string['outcome_help'] = 'This setting determines the outcome which this grade item will represent in the gradebook.';
$string['outcomeassigntocourse'] = 'Assign another outcome to this course';
@@ -652,6 +656,7 @@ $string['usenoscale'] = 'Use no scale';
$string['usepercent'] = 'Use percent';
$string['user'] = 'User';
$string['usergrade'] = 'User {$a->fullname} ({$a->useridnumber}) on item {$a->gradeidnumber}';
$string['userid'] = 'User ID';
$string['userpreferences'] = 'User preferences';
$string['userenrolmentsuspended'] = 'User enrolment suspended';
$string['useweighted'] = 'Use weighted';
+4 -2
View File
@@ -71,7 +71,7 @@ $string['addresourceoractivity'] = 'Add an activity or resource';
$string['addresourcetosection'] = 'Add a resource to section \'{$a}\'';
$string['address'] = 'Address';
$string['addstudent'] = 'Add student';
$string['addsubcategory'] = 'Add a sub-category';
$string['addsubcategory'] = 'Add a subcategory';
$string['addteacher'] = 'Add teacher';
$string['admin'] = 'Admin';
$string['adminhelpaddnewuser'] = 'To manually create a new user account';
@@ -185,6 +185,7 @@ $string['backuploglaststatus'] = 'Last execution log';
$string['backupmissinguserinfoperms'] = 'Note: This backup contains no user data. Exercise and Workshop activities will not be included in the backup, since these modules are not compatible with this type of backup.';
$string['backupnext'] = 'Next backup';
$string['backupnonisowarning'] = 'Warning: this backup is from a non-Unicode version of Moodle (pre 1.6). If this backup contains any non-ISO-8859-1 texts then they may be CORRUPTED if you try to restore them to this Unicode version of Moodle. See the <a href="http://docs.moodle.org/en/Backup_FAQ">Backup FAQ</a> for more information about how to recover this backup correctly.';
$string['backupnotyetrun'] = 'Automated backup pending';
$string['backuporiginalname'] = 'Backup name';
$string['backuproleassignments'] = 'Backup role assignments for these roles';
$string['backupsavetohelp'] = 'Full path to the directory where you want to save the backup files<br />(leave blank to save in its course default dir)';
@@ -1246,6 +1247,7 @@ $string['options'] = 'options';
$string['order'] = 'Order';
$string['originalpath'] = 'Original path';
$string['orphanedactivities'] = 'Orphaned activities';
$string['orphanedactivitiesinsectionno'] = 'Orphaned activities (section {$a})';
$string['other'] = 'Other';
$string['outline'] = 'Outline';
$string['outlinereport'] = 'Outline report';
@@ -1631,7 +1633,7 @@ $string['stringsnotset'] = 'The following strings are not defined in {$a}';
$string['studentnotallowed'] = 'Sorry, but you can not enter this course as \'{$a}\'';
$string['students'] = 'Students';
$string['studentsandteachers'] = 'Students and teachers';
$string['subcategories'] = 'Sub-categories';
$string['subcategories'] = 'Subcategories';
$string['submit'] = 'Submit';
$string['success'] = 'Success';
$string['summary'] = 'Summary';
+2 -2
View File
@@ -344,7 +344,7 @@ Alternatively, you may wish for students to submit each question as they go alon
Those are probably the two most commonly used modes of behaviour. ';
$string['importfromcoursefiles'] = '... or choose a course file to import.';
$string['importfromupload'] = 'Select a file to upload ...';
$string['includesubcategories'] = 'Also show questions from sub-categories';
$string['includesubcategories'] = 'Also show questions from subcategories';
$string['incorrect'] = 'Incorrect';
$string['incorrectfeedback'] = 'For any incorrect response';
$string['information'] = 'Information';
@@ -370,7 +370,7 @@ $string['parent'] = 'Parent';
$string['partiallycorrect'] = 'Partially correct';
$string['partiallycorrectfeedback'] = 'For any partially correct response';
$string['penaltyforeachincorrecttry'] = 'Penalty for each incorrect try';
$string['penaltyforeachincorrecttry_help'] = 'When you run your questions using the \'Interactive with multiple tries\' or \'Adaptive mode\' behaviour, so that the the student will have several tries to get the question right, then this option controls how much they are penalised for each incorrect try.
$string['penaltyforeachincorrecttry_help'] = 'When questions are run using the \'Interactive with multiple tries\' or \'Adaptive mode\' behaviour, so that the student will have several tries to get the question right, then this option controls how much they are penalised for each incorrect try.
The penalty is a proportion of the total question grade, so if the question is worth three marks, and the penalty is 0.3333333, then the student will score 3 if they get the question right first time, 2 if they get it right second try, and 1 of they get it right on the third try.';
$string['previewquestion'] = 'Preview question: {$a}';
+244 -4
View File
@@ -15,10 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Box REST Client Library for PHP5 Developers
* Box.net client.
*
*
* @package moodlecore
* @package core
* @author James Levy <james@box.net>
* @link http://enabled.box.net
* @access public
@@ -27,10 +26,251 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/oauthlib.php');
/**
* @package moodlecore
* Box.net client class.
*
* @package core
* @copyright 2013 Frédéric Massart
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class boxnet_client extends oauth2_client {
/** @const API URL */
const API = 'https://api.box.com/2.0';
/** @const UPLOAD_API URL */
const UPLOAD_API = 'https://upload.box.com/api/2.0';
/**
* Return authorize URL.
*
* @return string
*/
protected function auth_url() {
return 'https://www.box.com/api/oauth2/authorize';
}
/**
* Create a folder.
*
* @param string $foldername The folder name.
* @param int $parentid The ID of the parent folder.
* @return array Information about the new folder.
*/
public function create_folder($foldername, $parentid = 0) {
$params = array('name' => $foldername, 'parent' => array('id' => (string) $parentid));
$this->reset_state();
$result = $this->post($this->make_url("/folders"), json_encode($params));
$result = json_decode($result);
return $result;
}
/**
* Download the file.
*
* @param int $fileid File ID.
* @param string $path Path to download the file to.
* @return bool Success or not.
*/
public function download_file($fileid, $path) {
$this->reset_state();
$result = $this->download_one($this->make_url("/files/$fileid/content"), array(),
array('filepath' => $path, 'CURLOPT_FOLLOWLOCATION' => true));
return ($result === true && $this->info['http_code'] === 200);
}
/**
* Get info of a file.
*
* @param int $fileid File ID.
* @return object
*/
public function get_file_info($fileid) {
$this->reset_state();
$result = $this->request($this->make_url("/files/$fileid"));
return json_decode($result);
}
/**
* Get a folder content.
*
* @param int $folderid Folder ID.
* @return object
*/
public function get_folder_items($folderid = 0) {
$this->reset_state();
$result = $this->request($this->make_url("/folders/$folderid/items",
array('fields' => 'id,name,type,modified_at,size,owned_by')));
return json_decode($result);
}
/**
* Log out.
*
* @return void
*/
public function log_out() {
if ($accesstoken = $this->get_accesstoken()) {
$params = array(
'client_id' => $this->get_clientid(),
'client_secret' => $this->get_clientsecret(),
'token' => $accesstoken->token
);
$this->reset_state();
$this->post($this->revoke_url(), $params);
}
parent::log_out();
}
/**
* Build a request URL.
*
* @param string $uri The URI to request.
* @param array $params Query string parameters.
* @param bool $uploadapi Whether this works with the upload API or not.
* @return string
*/
protected function make_url($uri, $params = array(), $uploadapi = false) {
$api = $uploadapi ? self::UPLOAD_API : self::API;
$url = new moodle_url($api . '/' . ltrim($uri, '/'), $params);
return $url->out(false);
}
/**
* Rename a file.
*
* @param int $fileid The file ID.
* @param string $newname The new file name.
* @return object Box.net file object.
*/
public function rename_file($fileid, $newname) {
// This requires a PUT request with data within it. We cannot use
// the standard PUT request 'CURLOPT_PUT' because it expects a file.
$data = array('name' => $newname);
$options = array(
'CURLOPT_CUSTOMREQUEST' => 'PUT',
'CURLOPT_POSTFIELDS' => json_encode($data)
);
$url = $this->make_url("/files/$fileid");
$this->reset_state();
$result = $this->request($url, $options);
$result = json_decode($result);
return $result;
}
/**
* Resets curl for multiple requests.
*
* @return void
*/
public function reset_state() {
$this->cleanopt();
$this->resetHeader();
}
/**
* Return the revoke URL.
*
* @return string
*/
protected function revoke_url() {
return 'https://www.box.com/api/oauth2/revoke';
}
/**
* Share a file and return the link to it.
*
* @param string $fileid The file ID.
* @param bool $businesscheck Whether or not to check if the user can share files, has a business account.
* @return object
*/
public function share_file($fileid, $businesscheck = true) {
// Sharing the file, this requires a PUT request with data within it. We cannot use
// the standard PUT request 'CURLOPT_PUT' because it expects a file.
$data = array('shared_link' => array('access' => 'open', 'permissions' =>
array('can_download' => true, 'can_preview' => true)));
$options = array(
'CURLOPT_CUSTOMREQUEST' => 'PUT',
'CURLOPT_POSTFIELDS' => json_encode($data)
);
$this->reset_state();
$result = $this->request($this->make_url("/files/$fileid"), $options);
$result = json_decode($result);
if ($businesscheck) {
// Checks that the user has the right to share the file. If not, throw an exception.
$this->reset_state();
$this->head($result->shared_link->download_url);
$info = $this->get_info();
if ($info['http_code'] == 403) {
throw new moodle_exception('No permission to share the file');
}
}
return $result->shared_link;
}
/**
* Search.
*
* @return object
*/
public function search($query) {
$this->reset_state();
$result = $this->request($this->make_url('/search', array('query' => $query, 'limit' => 50, 'offset' => 0)));
return json_decode($result);
}
/**
* Return token URL.
*
* @return string
*/
protected function token_url() {
return 'https://www.box.com/api/oauth2/token';
}
/**
* Upload a file.
*
* Please note that the file is named on Box.net using the path we are providing, and so
* the file has the name of the stored_file hash.
*
* @param stored_file $storedfile A stored_file.
* @param integer $parentid The ID of the parent folder.
* @return object Box.net file object.
*/
public function upload_file(stored_file $storedfile, $parentid = 0) {
$url = $this->make_url('/files/content', array(), true);
$options = array(
'filename' => $storedfile,
'parent_id' => $parentid
);
$this->reset_state();
$result = $this->post($url, $options);
$result = json_decode($result);
return $result;
}
}
/**
* Box REST Client Library for PHP5 Developers.
*
* Deprecation note: As of the 14th of December 2013 Box.net APIv1, used by this class,
* is reaching its end of life. Please use boxnet_client() instead.
*
* @package core
* @author James Levy <james@box.net>
* @link http://enabled.box.net
* @access public
* @version 1.0
* @copyright copyright Box.net 2007
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated since 2.6, 2.5.3, 2.4.7
*/
class boxclient {
/** @var string */
+13 -3
View File
@@ -825,6 +825,7 @@ abstract class condition_info_base {
$a = new stdclass;
// Display the fieldname into current lang.
if (is_numeric($field)) {
// Is a custom profile field (will use multilang).
$translatedfieldname = $details->fieldname;
} else {
$translatedfieldname = get_user_field_name($details->fieldname);
@@ -1035,8 +1036,15 @@ abstract class condition_info_base {
if (!$this->is_field_condition_met($details->operator, $uservalue, $details->value)) {
// Set available to false
$available = false;
// Display the fieldname into current lang.
if (is_numeric($field)) {
// Is a custom profile field (will use multilang).
$translatedfieldname = $details->fieldname;
} else {
$translatedfieldname = get_user_field_name($details->fieldname);
}
$a = new stdClass();
$a->field = format_string($details->fieldname, true, array('context' => $context));
$a->field = format_string($translatedfieldname, true, array('context' => $context));
$a->value = s($details->value);
$information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
}
@@ -1139,10 +1147,12 @@ abstract class condition_info_base {
private function get_cached_grade_score($gradeitemid, $grabthelot=false, $userid=0) {
global $USER, $DB, $SESSION;
if ($userid==0 || $userid==$USER->id) {
// For current user, go via cache in session
if (empty($SESSION->gradescorecache) || $SESSION->gradescorecacheuserid!=$USER->id) {
// For current user, go via cache in session. Force reset it every 10 minutes.
if (empty($SESSION->gradescorecache) || $SESSION->gradescorecacheuserid!=$USER->id
|| !isset($SESSION->gradescorecachereset) || $SESSION->gradescorecachereset+600<time()) {
$SESSION->gradescorecache = array();
$SESSION->gradescorecacheuserid = $USER->id;
$SESSION->gradescorecachereset = time();
}
if (!array_key_exists($gradeitemid, $SESSION->gradescorecache)) {
if ($grabthelot) {
+5 -5
View File
@@ -35,8 +35,8 @@ $definitions = array(
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true,
'simpledata' => true,
'persistent' => true,
'persistentmaxsize' => 30
'staticacceleration' => true,
'staticaccelerationsize' => 30
),
// Used to store database meta information.
@@ -48,8 +48,8 @@ $definitions = array(
'requireidentifiers' => array(
'dbfamily'
),
'persistent' => true,
'persistentmaxsize' => 15
'staticacceleration' => true,
'staticaccelerationsize' => 15
),
// Event invalidation cache.
@@ -61,7 +61,7 @@ $definitions = array(
// cache will likely be used either lots or never.
'eventinvalidation' => array(
'mode' => cache_store::MODE_APPLICATION,
'persistent' => true,
'staticacceleration' => true,
'requiredataguarantee' => true,
'simpledata' => true,
),
+2 -1
View File
@@ -43,9 +43,10 @@ $handlers = array(
* (it is just abusing cron to do very time consuming things which is wrong any way)
*
* TODO: this has to be moved into separate queueing framework....
* TODO: MDL-25508, MDL-41541
*/
'portfolio_send' => array (
'handlerfile' => '/lib/portfolio.php',
'handlerfile' => '/lib/portfoliolib.php',
'handlerfunction' => 'portfolio_handle_event', // argument to call_user_func(), could be an array
'schedule' => 'cron',
'internal' => 0,
+70
View File
@@ -1552,6 +1552,8 @@ function xmldb_main_upgrade($oldversion) {
}
if ($oldversion < 2012120301.11) {
// This upgrade step is re-written under MDL-38228 (see below).
/*
// Retrieve the list of course_sections as a recordset to save memory
$coursesections = $DB->get_recordset('course_sections', null, 'course, id', 'id, course, sequence');
foreach ($coursesections as $coursesection) {
@@ -1595,6 +1597,7 @@ function xmldb_main_upgrade($oldversion) {
}
}
$coursesections->close();
*/
// Main savepoint reached.
upgrade_main_savepoint(true, 2012120301.11);
@@ -1611,6 +1614,22 @@ function xmldb_main_upgrade($oldversion) {
}
if ($oldversion < 2012120302.01) {
// MDL-38228. Single script to upgrade course_modules instead of 2012120301.11.
// It replaces two scripts (now commented out) introduced in MDL-37939 and MDL-38173.
// This upgrade script fixes the mismatches between DB fields course_modules.section
// and course_sections.sequence. It makes sure that each module is included
// in the sequence of only one section and that course_modules.section points back to it.
// This script in included in each major version upgrade process so make sure we don't run it twice.
if (empty($CFG->movingmoduleupgradescriptwasrun)) {
upgrade_course_modules_sequences();
// To skip running the same script on the upgrade to the next major release.
set_config('movingmoduleupgradescriptwasrun', 1);
}
/*
// Retrieve the list of course_sections as a recordset to save memory.
// This is to fix a regression caused by MDL-37939.
// In this case the upgrade step is fixing records where:
@@ -1667,6 +1686,7 @@ function xmldb_main_upgrade($oldversion) {
}
}
$coursesections->close();
*/
upgrade_main_savepoint(true, 2012120302.01);
}
@@ -1779,5 +1799,55 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120305.08);
}
if ($oldversion < 2012120306.05) {
// Fixing possible wrong MIME type for Java Network Launch Protocol (JNLP) files.
$select = $DB->sql_like('filename', '?', false);
$DB->set_field_select(
'files',
'mimetype',
'application/x-java-jnlp-file',
$select,
array('%.jnlp')
);
// Main savepoint reached.
upgrade_main_savepoint(true, 2012120306.05);
}
if ($oldversion < 2012120306.09) {
// Find all fileareas that have missing root folder entry and add the root folder entry.
if (empty($CFG->filesrootrecordsfixed)) {
$sql = "SELECT distinct f1.contextid, f1.component, f1.filearea, f1.itemid
FROM {files} f1 left JOIN {files} f2
ON f1.contextid = f2.contextid
AND f1.component = f2.component
AND f1.filearea = f2.filearea
AND f1.itemid = f2.itemid
AND f2.filename = '.'
AND f2.filepath = '/'
WHERE (f1.component <> 'user' or f1.filearea <> 'draft')
and f2.id is null";
$rs = $DB->get_recordset_sql($sql);
$defaults = array('filepath' => '/',
'filename' => '.',
'userid' => $USER->id,
'filesize' => 0,
'timecreated' => time(),
'timemodified' => time(),
'contenthash' => sha1(''));
foreach ($rs as $r) {
$pathhash = sha1("/$r->contextid/$r->component/$r->filearea/$r->itemid".'/.');
$DB->insert_record('files', (array)$r + $defaults +
array('pathnamehash' => $pathhash));
}
$rs->close();
// To skip running the same script on the upgrade to the next major release.
set_config('filesrootrecordsfixed', 1);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2012120306.09);
}
return true;
}
+144
View File
@@ -164,3 +164,147 @@ function upgrade_mysql_fix_unsigned_and_lob_columns() {
$pbar->update($i, $tablecount, "Converted unsigned/lob columns in MySQL database - $i/$tablecount.");
}
}
/**
* This upgrade script fixes the mismatches between DB fields course_modules.section
* and course_sections.sequence. It makes sure that each module is included
* in the sequence of only one section and that course_modules.section points back to it.
*
* Orphaned modules (modules that were not included in any section sequence in this course)
* will be added to their sections (or 0-section if their section is not found) and
* made invisible since they were not accessible at all before this upgrade script.
*
* Note that this script does not remove non-existing modules from section sequences since
* such operation would require much more time.
*/
function upgrade_course_modules_sequences() {
global $DB;
$affectedcourses = array();
// Step 1. Find all modules that point to the section which does not point back to this module.
$sequenceconcat = $DB->sql_concat("','", "s.sequence", "','");
$moduleconcat = $DB->sql_concat("'%,'", "m.id", "',%'");
$sql = "SELECT m.id, m.course, m.section, s.sequence
FROM {course_modules} m LEFT OUTER JOIN {course_sections} s
ON m.course = s.course and m.section = s.id
WHERE s.sequence IS NULL OR ($sequenceconcat NOT LIKE $moduleconcat)
ORDER BY m.course";
$rs = $DB->get_recordset_sql($sql);
$sections = null;
foreach ($rs as $cm) {
if (!isset($sections[$cm->course])) {
// Retrieve all sections for the course (only once for each corrupt course).
$sections = array($cm->course =>
$DB->get_records('course_sections', array('course' => $cm->course),
'section', 'id, section, sequence, visible'));
if (empty($sections[$cm->course])) {
// Very odd - the course has a module in it but has no sections. Create 0-section.
$newsection = array('sequence' => '', 'section' => 0, 'visible' => 1);
$newsection['id'] = $DB->insert_record('course_sections',
$newsection + array('course' => $cm->course, 'summary' => '', 'summaryformat' => FORMAT_HTML));
$sections[$cm->course] = array($newsection['id'] => (object)$newsection);
}
$affectedcourses[$cm->course] = true;
}
// Attempt to find the section that has this module in it's sequence.
// If there are several of them, pick the last because this is what get_fast_modinfo() does.
$sectionid = null;
foreach ($sections[$cm->course] as $section) {
if (!empty($section->sequence) && in_array($cm->id, preg_split('/,/', $section->sequence))) {
$sectionid = $section->id;
}
}
if ($sectionid) {
// Found the section. Update course_module to point to the correct section.
$params = array('id' => $cm->id, 'section' => $sectionid);
if (!$sections[$cm->course][$sectionid]->visible) {
$params['visible'] = 0;
}
$DB->update_record('course_modules', $params);
} else {
// No section in the course has this module in it's sequence.
if (isset($sections[$cm->course][$cm->section])) {
// Try to add module to the section it points to (if it is valid).
$sectionid = $cm->section;
} else {
// Section not found. Just add to the first available section.
reset($sections[$cm->course]);
$sectionid = key($sections[$cm->course]);
}
$newsequence = ltrim($sections[$cm->course][$sectionid]->sequence . ',' . $cm->id, ',');
$sections[$cm->course][$sectionid]->sequence = $newsequence;
$DB->update_record('course_sections', array('id' => $sectionid, 'sequence' => $newsequence));
// Make module invisible because it was not displayed at all before this upgrade script.
$DB->update_record('course_modules', array('id' => $cm->id, 'section' => $sectionid, 'visible' => 0, 'visibleold' => 0));
}
}
$rs->close();
unset($sections);
// Step 2. Find all modules that are listed in sequence of another section or listed in sequence of their section twice.
$sequenceconcat = $DB->sql_concat("','", "s.sequence", "','");
$moduleconcat = $DB->sql_concat("'%,'", "m.id", "',%'");
$moduleconcatdup1 = $DB->sql_concat("'%,'", "m.id", "','", "m.id", "',%'");
$moduleconcatdup2 = $DB->sql_concat("'%,'", "m.id", "',%,'", "m.id", "',%'");
$sql = "SELECT m.id, m.course, m.section AS modulesectionid,
s.id AS sectionid, s.sequence AS sectionsequence, s.section AS sectionsectionnum,
ms.section AS modulesectionnum, ms.sequence AS modulesectionsequence
FROM {course_modules} m JOIN {course_sections} s
ON m.course = s.course AND
(
(m.section <> s.id AND $sequenceconcat LIKE $moduleconcat)
OR
(m.section = s.id AND $sequenceconcat LIKE $moduleconcatdup1)
OR
(m.section = s.id AND $sequenceconcat LIKE $moduleconcatdup2)
)
JOIN {course_sections} ms ON ms.id = m.section
ORDER BY m.course, m.id, m.section DESC";
$rs = $DB->get_recordset_sql($sql);
$updatedsequences = array();
$correctmodulesections = array();
foreach ($rs as $cm) {
$incorrectsectionid = $cm->sectionid;
$incorrectsequence = $cm->sectionsequence;
if (!isset($correctmodulesections[$cm->id])) {
// Function get_fast_modinfo() believes that the section with the biggest sectionnum is the correct one.
// Let's correct everything else to match with how course is displayed to the students.
if ($cm->modulesectionnum > $cm->sectionsectionnum) {
$correctmodulesections[$cm->id] = $cm->modulesectionid;
} else {
$correctmodulesections[$cm->id] = $cm->sectionid;
// oops our module points to the wrong section.
$DB->update_record('course_modules', array('id' => $cm->id,
'section' => $correctmodulesections[$cm->id]));
$incorrectsectionid = $cm->modulesectionid;
$incorrectsequence = $cm->modulesectionsequence;
}
}
if (isset($updatedsequences[$incorrectsectionid])) {
$sequence = $updatedsequences[$incorrectsectionid];
} else {
$sequence = preg_split('/,/', $incorrectsequence);
}
if ($correctmodulesections[$cm->id] <> $incorrectsectionid) {
// Remove all occurences of module id from section sequence.
$sequence = array_diff($sequence, array($cm->id));
} else {
// Remove all occurences of module id from section sequence except for the first one.
if (($idx = array_search($cm->id, $sequence)) !== false) {
$firstchunk = array_splice($sequence, 0, $idx+1);
$sequence = array_merge($firstchunk, array_diff($sequence, array($cm->id)));
}
}
$updatedsequences[$incorrectsectionid] = array_values($sequence);
$DB->update_record('course_sections', array('id' => $incorrectsectionid,
'sequence' => join(',', $sequence)));
$affectedcourses[$cm->course] = true;
}
$rs->close();
// Reset course cache for affected courses.
if (!empty($affectedcourses)) {
list($sql, $params) = $DB->get_in_or_equal(array_keys($affectedcourses));
$DB->execute("UPDATE {course} SET modinfo = null WHERE id ".$sql, $params);
}
}
@@ -59,7 +59,7 @@ header('Content-Type: text/html; charset=utf-8');
header('X-UA-Compatible: IE=edge');
?>
<!DOCTYPE html>
<html <?php echo $htmllang ?>
<html <?php echo $htmllang ?>>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php print_string('title', 'tinymce_dragmath')?></title>
@@ -78,8 +78,8 @@ header('X-UA-Compatible: IE=edge');
</object>
<form name="form" action="#">
<div class="mceActionPanel">
<input type="submit" id="insert" name="insert" value="{#insert}" onclick="return DragMathDialog.insert();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="return tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="<?php print_string('common:insert', 'editor_tinymce'); ?>" onclick="return DragMathDialog.insert();" />
<input type="button" id="cancel" name="cancel" value="<?php print_string('cancel'); ?>" onclick="return tinyMCEPopup.close();" />
</div>
</form>
+3 -1
View File
@@ -363,6 +363,8 @@ function events_process_queued_handler($qhandler) {
$qh->status = $qhandler->status + 1;
$DB->update_record('events_queue_handlers', $qh);
debugging($errormessage);
return false;
}
@@ -615,4 +617,4 @@ function events_pending_count($eventname) {
WHERE h.eventname = ?";
return $DB->count_records_sql($sql, array($eventname));
}
}
+1 -1
View File
@@ -323,7 +323,7 @@ class file_info_context_course extends file_info {
* @return string
*/
public function get_visible_name() {
return ($this->course->id == SITEID) ? get_string('frontpage', 'admin') : format_string($this->course->fullname, true, array('context'=>$this->context));
return ($this->course->id == SITEID) ? get_string('frontpage', 'admin') : format_string(get_course_display_name_for_list($this->course), true, array('context'=>$this->context));
}
/**
+54 -8
View File
@@ -794,7 +794,7 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea
$newhashes = array();
$filecount = 0;
foreach ($draftfiles as $file) {
if (!$options['subdirs'] && ($file->get_filepath() !== '/' or $file->is_directory())) {
if (!$options['subdirs'] && $file->get_filepath() !== '/') {
continue;
}
if (!$allowreferences && $file->is_external_file()) {
@@ -1478,6 +1478,7 @@ function &get_mimetypes_array() {
'jcw' => array ('type'=>'text/xml', 'icon'=>'markup'),
'jmt' => array ('type'=>'text/xml', 'icon'=>'markup'),
'jmx' => array ('type'=>'text/xml', 'icon'=>'markup'),
'jnlp' => array ('type'=>'application/x-java-jnlp-file', 'icon'=>'markup'),
'jpe' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
'jpeg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
'jpg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
@@ -1983,6 +1984,43 @@ function send_header_404() {
}
}
/**
* The readfile function can fail when files are larger than 2GB (even on 64-bit
* platforms). This wrapper uses readfile for small files and custom code for
* large ones.
*
* @param string $path Path to file
* @param int $filesize Size of file (if left out, will get it automatically)
* @return int|bool Size read (will always be $filesize) or false if failed
*/
function readfile_allow_large($path, $filesize = -1) {
// Automatically get size if not specified.
if ($filesize === -1) {
$filesize = filesize($path);
}
if ($filesize <= 2147483647) {
// If the file is up to 2^31 - 1, send it normally using readfile.
return readfile($path);
} else {
// For large files, read and output in 64KB chunks.
$handle = fopen($path, 'r');
if ($handle === false) {
return false;
}
$left = $filesize;
while ($left > 0) {
$size = min($left, 65536);
$buffer = fread($handle, $size);
if ($buffer === false) {
return false;
}
echo $buffer;
$left -= $size;
}
return $filesize;
}
}
/**
* Enhanced readfile() with optional acceleration.
* @param string|stored_file $file
@@ -2005,7 +2043,7 @@ function readfile_accel($file, $mimetype, $accelerate) {
if (is_object($file)) {
header('Etag: "' . $file->get_contenthash() . '"');
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) and $_SERVER['HTTP_IF_NONE_MATCH'] === $file->get_contenthash()) {
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) and trim($_SERVER['HTTP_IF_NONE_MATCH'], '"') === $file->get_contenthash()) {
header('HTTP/1.1 304 Not Modified');
return;
}
@@ -2105,7 +2143,7 @@ function readfile_accel($file, $mimetype, $accelerate) {
if (is_object($file)) {
$file->readfile();
} else {
readfile($file);
readfile_allow_large($file, $filesize);
}
}
@@ -2176,7 +2214,7 @@ function send_temp_file($path, $filename, $pathisstring=false) {
header('Content-Disposition: attachment; filename="'.$filename.'"');
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
header('Cache-Control: max-age=10');
header('Cache-Control: private, max-age=10');
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
header('Pragma: ');
} else { //normal http - prevent caching at all cost
@@ -2262,15 +2300,19 @@ function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathiss
}
if ($lifetime > 0) {
$private = '';
if (isloggedin() and !isguestuser()) {
$private = ' private,';
}
$nobyteserving = false;
header('Cache-Control: max-age='.$lifetime);
header('Cache-Control:'.$private.' max-age='.$lifetime);
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
header('Pragma: ');
} else { // Do not cache files in proxies and browsers
$nobyteserving = true;
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
header('Cache-Control: max-age=10');
header('Cache-Control: private, max-age=10');
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
header('Pragma: ');
} else { //normal http - prevent caching at all cost
@@ -2426,13 +2468,17 @@ function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownl
}
if ($lifetime > 0) {
header('Cache-Control: max-age='.$lifetime);
$private = '';
if (isloggedin() and !isguestuser()) {
$private = ' private,';
}
header('Cache-Control:'.$private.' max-age='.$lifetime);
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
header('Pragma: ');
} else { // Do not cache files in proxies and browsers
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
header('Cache-Control: max-age=10');
header('Cache-Control: private, max-age=10');
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
header('Pragma: ');
} else { //normal http - prevent caching at all cost

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