Compare commits

...

433 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) e038687c55 Moodle release 2.4.4 2013-05-13 12:38:41 +02:00
Eloy Lafuente (stronk7) fd6e84c5be Merge branch 'MDL-39642-en_fix-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-05-13 11:54:01 +02:00
Helen Foster 98f8613822 MDL-39642 Merge English strings from the en_fix language pack 2013-05-13 10:06:39 +02:00
Eloy Lafuente (stronk7) 573534c441 weekly release 2.4.3+ 2013-05-10 17:34:22 +02:00
Eloy Lafuente (stronk7) 82a69ceaa0 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-05-10 17:17:57 +02:00
Eloy Lafuente (stronk7) d6d685fd71 Merge branch 'MDL-39518-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-05-10 13:17:44 +02:00
Damyon Wiese ec2d67fd80 MDL-39518: Change hardcoded string MOOCH to Moodle.net 2013-05-10 14:28:02 +08:00
Sam Hemelryk e09afa5184 Merge branch 'MDL-39602-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-05-10 16:40:59 +12:00
Sam Hemelryk a32772051f Merge branch 'MDL-39488_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-05-10 16:30:52 +12:00
Damyon Wiese aa6d532b45 MDL-39602 cache: Move the includes for default stores
Putting them inside the function get_default_stores ensures
that they will be included from anywhere that calls get_default_stores.

Conflicts:

	cache/locallib.php
2013-05-10 11:55:35 +08:00
Rossiani Wijaya 5c635f6c62 MDL-39488: Lesson Module: Fixed the potential variable overwritting for answers 2013-05-10 11:16:34 +08:00
Damyon Wiese b97e174acf Merge branch 'MDL-39535_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-05-10 10:32:19 +08:00
Eloy Lafuente (stronk7) eb2080240a Merge branch 'MDL-38885-24-int' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-10 03:17:19 +02:00
Eloy Lafuente (stronk7) d5420db934 Merge branch 'MDL-29758_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-05-10 02:54:06 +02:00
Frederic Massart d39925c792 MDL-38885 form: Fix comments and stricter unit test 2013-05-10 08:36:19 +08:00
Eloy Lafuente (stronk7) 7f92387c85 Merge branch 'MDL-39488_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-05-09 15:49:24 +02:00
Jean-Michel Vedrine da4bd770f2 MDL-29758 make Cloze question feedback display more informative
as it was in Moodle 1.9
2013-05-09 08:56:33 +02:00
Frederic Massart 9d02febe9b MDL-38885 form: Unit tests for data cleaning 2013-05-09 14:08:08 +08:00
Frederic Massart feeb14b941 MDL-38885 form: Recursively clean parameters based on right type 2013-05-09 14:06:14 +08:00
Damyon Wiese 8d7f911c96 Merge branch 'wip-MDL-39436-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-05-09 11:32:47 +08:00
Marina Glancy 17a5b5a094 MDL-39436 fixing RTL in filemanager - contextmenu icon 2013-05-09 12:46:08 +10:00
Damyon Wiese 93c5c3b02c MDL-38289: Custom profile fields - added unit test
Added a unit test to cover the case when you are fetching a custom
profile field but you are not logged in.
2013-05-09 10:29:21 +08:00
Damyon Wiese 3f999f8120 Merge branch 'MDL-38289-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-09 10:26:07 +08:00
AMOS bot 5f5ff2b680 Automatically generated installer lang files 2013-05-09 00:37:29 +00:00
Jerome Mouneyrac 1d79b726d7 MDL-37822 fix checkboxes that were always set to on by default 2013-05-09 02:08:11 +02:00
Jerome Mouneyrac fd469033fa MDL-37822 move the default code above the set_config to not make the code less confusing 2013-05-09 02:08:11 +02:00
Jerome Mouneyrac 54a3ce69e9 MDL-37822 Moodle send site information to a hub even though it's unchecked 2013-05-09 02:08:11 +02:00
Eloy Lafuente (stronk7) ec00601863 Merge branch 'MDL-38487_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-09 00:54:54 +02:00
Damyon Wiese 781383a946 Merge branch 'MDL-31193-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-05-08 15:23:24 +08:00
Rossiani Wijaya ce4af8c4fe MDL-39488 Lesson Module: Improve code performance 2013-05-08 13:52:13 +08:00
Rossiani Wijaya a6b0fc1c93 MDL-39488 Lesson Module: Fixed PHP error matching question,
if one or more options have not been selected.
2013-05-08 13:52:13 +08:00
Joseph Rézeau eff38644cf MDL-39488 Lesson Module: Fix for "Match question throws PHP error if one or more options have not been selected "
Signed-off-by: Joseph Rézeau <moodle@rezeau.org>
2013-05-08 13:52:04 +08:00
Damyon Wiese cf0d08f661 Merge branch 'MDL-37552-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-05-08 12:43:52 +08:00
Andrew Davis 4b280ca679 MDL-37475 core_grade:fixed the handling of show totals 2013-05-08 10:35:17 +12:00
Eloy Lafuente (stronk7) b5e41dac94 Merge branch 'MDL-39452-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-05-07 22:06:27 +02:00
Mark Nielsen 0572012ef3 MDL-32301: Allow instructor custom parameters for LTI tools 2013-05-07 21:59:25 +02:00
Eloy Lafuente (stronk7) 1a77c6c263 Merge branch 'MDL-34275-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-05-07 19:14:58 +02:00
Dan Poltawski 54061d7cbf Merge branch 'MDL-36223-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-05-07 15:28:33 +01:00
Dan Poltawski 217eeccb26 Merge branch 'wip-MDL-39436-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-05-07 15:13:18 +01:00
Rajesh Taneja b6f8473cdb MDL-37245 Blog: Fixed comments. 2013-05-07 14:58:06 +01:00
Rajesh Taneja 5fde58a593 MDL-37245 Blog: Added permission check for blog comments 2013-05-07 14:58:06 +01:00
Dan Poltawski b15eea6009 Merge branch 'MDL-38500-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-07 11:54:24 +01:00
sam marshall 1df3b0ae24 MDL-39448 MUC: Memcache configurable key names 2013-05-07 11:44:11 +01:00
Jerome Mouneyrac 20c171f284 MDL-37552 external_format_text: missing require_once filelib.php (shared credits to Adam Fredericks for report and patch proposal) 2013-05-07 17:57:19 +08:00
Rex Lorenzo 5899b85fd6 MDL-34275 - Use default copyright license when restoring files 2013-05-07 09:10:30 +01:00
Damyon Wiese 06340a114f Merge branch 'MDL-31713_override_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-05-07 15:31:03 +08:00
Mark Nelson 7b178abfbb MDL-39535 grade: only display grade errors once 2013-05-07 15:15:07 +08:00
Andrew Davis 501afed36a MDL-31713 core_grade: added updating of grade min and max to update_final_grade() 2013-05-07 12:25:08 +08:00
Frederic Massart ac9d18dfa4 MDL-38289 condition: Do not fetch profile fields when not logged in 2013-05-07 10:19:27 +08:00
Maria Torres 242ef4590f MDL-39169: Now the question's tags are added in backup/restore options 2013-05-06 15:42:21 +01:00
Damyon Wiese 31dda933e6 Merge branch 'MDL-38315-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-05-06 22:19:55 +08:00
Damyon Wiese 9479d76a14 Merge branch 'MDL-38480_m24' of git://github.com/andreabix/moodle into MOODLE_24_STABLE 2013-05-06 21:56:05 +08:00
Dan Poltawski 8d0835e64b Merge branch 'MDL-39446_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-06 14:48:15 +01:00
Dan Poltawski fc7f2b1a2f Merge branch 'MDL-39473-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-05-06 14:33:02 +01:00
Dan Poltawski b73f62ef9b Merge branch 'MDL-39491-workshop-media_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-05-06 13:11:58 +01:00
Dan Poltawski 0ddf951c15 MDL-39470 cache: added missing component to get_string call 2013-05-06 12:41:44 +01:00
Damyon Wiese f23877abfb MDL-38443 Assignment: Missing permissions check on downloadall submissions 2013-05-06 10:20:49 +01:00
Damyon Wiese a20eeda845 Merge branch 'MDL-39445_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-06 15:17:13 +08:00
AMOS bot 0426c0dfac Automatically generated installer lang files 2013-05-06 00:40:36 +00:00
Dan Poltawski 56463941a8 Merge branch 'brokencalc_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-05-05 11:30:31 +01:00
David Mudrák fb1cb65868 MDL-39491 Fix order of Workshop submission text processing
The order of format_text() and file_rewrite_pluginfile_urls() is
important to make filters work correctly.
2013-05-03 11:51:43 +02:00
Jerome Mouneyrac ef2a243345 MDL-31193 display the correct and translated token valid until date 2013-05-03 14:14:38 +08:00
Marina Glancy d927075f0c MDL-39436 fixing RTL in filemanager 2013-05-03 11:32:44 +10:00
sam marshall 0f491109ca MDL-39472 MUC: Improve parse_key performance 2013-05-02 16:00:09 +01:00
Tim Hunt 319fc5cb74 MDL-39450 course formats: add static cache to get_format_or_default
This function gets called hundreds of times on every page, often with
exactly the same input, so I added a static cache.
2013-05-02 15:48:21 +01:00
Tim Hunt d8da3c0f5b MDL-39446 calculated qtype: make answer formula input bigger
This makes it easier for teachers editing questions.
2013-05-02 15:47:54 +01:00
Tim Hunt 2ec2d00dc8 MDL-39445 get_plugin_list clean_param use is slow
get_plugin_list was calling clean_param($pluginname, PARAM_PLUGIN) a
lot (600+ times per page), and that is much slower than you would guess.
A specific function for this case, (which we then also use from
clean_param) is a performance win.
2013-05-02 15:47:28 +01:00
Tim Hunt c1288cd726 MDL-38487 qtype match restore: problem with blank ids.
As it happens, this field is useless, and has been removed from the DB
in 2.5. Therefore, we only need a work-around for stable branches.
2013-05-02 15:46:58 +01:00
Dan Poltawski 43ded6701d weekly release 2.4.3+ 2013-05-02 14:37:50 +01:00
Dan Poltawski bffe667ae0 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-05-02 14:32:19 +01:00
Damyon Wiese ccd8763ce2 Merge branch 'MDL-30775-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE
Conflicts:
	course/externallib.php
2013-05-02 16:21:55 +08:00
Damyon Wiese 4d69adc760 MDL-36223 Assign: User outline report grade display
Use str_long_grade for user outline report because it handles scales and
no grade.

Thanks to Jean-Daniel Descoteaux for suggesting this fix.
2013-05-02 15:46:27 +08:00
Andrew Davis 0f60e9fe53 MDL-32913 core_grade:made it more obvious when the gradebook is broken due to a broken calculation 2013-05-02 09:23:43 +08:00
AMOS bot f1c2a058ad Automatically generated installer lang files 2013-05-02 00:38:14 +00:00
sam marshall 442406d3ec MDL-39452 Library: html_writer::attribute unnecessary is_array check 2013-05-01 17:01:32 +01:00
Eloy Lafuente (stronk7) eb244d3b87 Merge branch 'MDL-39444_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-01 16:55:25 +02:00
Tim Hunt 0dc15de222 MDL-39444 get_string: remove unnecessary clean_param
This clean_param was added as part of MDL-22015. It is a good idea when
developer debug is turned on, but it showed up as a surprisingly
expensive cost in our profiling.

This change:

1. Removes the check during string_extist. This will not change
behaviour, the method returns false if the string does not exist.

2. In get_string, it only does the check if debugging is set to
DEVELOPER level.
2013-05-01 10:17:34 +01:00
Frederic Massart 7b6ed67e0a MDL-38500 repository: Instance names must be unique 2013-05-01 16:14:39 +08:00
AMOS bot 35b10e19af Automatically generated installer lang files 2013-05-01 00:39:24 +00:00
Eloy Lafuente (stronk7) d8d636dfe4 Merge branch 'wip-MDL-39432-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-05-01 01:35:10 +02:00
Sam Hemelryk be9d851c07 Merge branch 'MDL-39422-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-05-01 11:14:28 +12:00
Sam Hemelryk eecd7b4412 Merge branch 'wip-MDL-39099_M24' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-05-01 11:04:50 +12:00
Sam Hemelryk 609d262c17 Merge branch 'MDL-39414-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-05-01 11:02:05 +12:00
Sam Hemelryk 5a682ca6f9 MDL-39432 course: converted closures to lambda functions 2013-05-01 10:41:42 +12:00
Sam Hemelryk 858131c09c Merge branch 'MDL-36060-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-05-01 10:14:09 +12:00
Mark Nielsen 75156589fd MDL-36060: Remove anonymous functions in mod/lti
This was breaking eaccelerator because it doesn't
support anonymous functions.
2013-04-30 17:50:29 +01:00
Dan Poltawski 41b2eb8400 MDL-39422 mod_forms: prevent long coruse module names
To prevent ugly DB errors.
2013-04-30 17:42:03 +01:00
Dan Poltawski da7b1ecb12 MDL-39422 course: prevent module names longer 255 chars
To prevent ugly DB errors.
2013-04-30 17:42:02 +01:00
Gareth J Barnard 34877d21af MDL-39099 course_format: Allow section_summary() to be overridden. 2013-04-30 17:02:44 +01:00
Dan Poltawski fb0698f344 Merge branch 'MDL-35385_chat_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-04-30 14:08:06 +01:00
Dan Poltawski dd9b396af4 MDL-39414 portfolio: don't queue google portfolio exports
This is a bit of an ugly way of saying 'I dont support queued exports'.

The google plugins need a valid user session in order to export to the
google services, thereforce we are forcing the export to be interactive
and not queued through cron, as this wont work in the current
implmenetation.

It's possible we could add offline access to the plugins, but I don't
believe it is worth the benefit for the additional complexity.
2013-04-30 10:37:47 +01:00
Damyon Wiese a1ffe7e235 Merge branch 'MDL-39354_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-30 16:25:08 +08:00
Jerome Mouneyrac e2bceb5018 MDL-30775 get_course_contents: remove warnings when the section is empty 2013-04-30 14:12:25 +08:00
Damyon Wiese 6476ff5a7c Merge branch 'MDL-37966_24' of git://github.com/jonof/moodle into MOODLE_24_STABLE 2013-04-30 12:51:27 +08:00
Damyon Wiese 00f0d5c97f Merge branch 'MDL-39246_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-30 12:16:02 +08:00
Andrew Davis e4f7ad5d55 MDL-31713 core_grade:added a unit test to replicate a raw grade max bug 2013-04-30 09:37:23 +08:00
Andrew Davis 9ffffa5ec7 MDL-35385 mod_chat: made sure no message popups display within the chat window 2013-04-30 09:10:18 +08:00
Sam Hemelryk 7de740be35 Merge branch 'MDL-39303_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-04-30 10:00:09 +12:00
Sam Hemelryk 7e1c6bf8b4 Merge branch 'MDL-39365-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-04-30 09:36:36 +12:00
Sam Hemelryk 38fdbcf001 Merge branch 'MDL-39398-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-04-30 09:31:42 +12:00
Tim Hunt b3c1e4b131 MDL-39354 put back a bit of margin on checkboxes. 2013-04-29 19:14:56 +01:00
Dan Poltawski c0f02f7c89 Merge branch 'MDL-39378_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-29 17:01:03 +01:00
Tim Hunt 70351389f7 MDL-39378 Improve s() performance.
These changes give about a 10% speed-up in this function. The significant changes are:
1. Simplify the if logic to remove unnecssary cases.
2. Dont pass default argument values to htmlspecialchars, just using the
   defaults is faster.
3. I can confirm that /i regex is faster than the equivalent regex without the i.

I also added more unit tests to test the edge cases.
2013-04-29 12:32:24 +01:00
Tim Hunt 7017ce1a30 MDL-39378 s(): fix bad hex regex 2013-04-29 12:32:20 +01:00
Frederic Massart 923f470056 MDL-39398 message: Prevent notice when sending Jabber messages
Not tracking the presence prevents a notice to be displayed during disconnect(),
where the the jabber server attempts to subscribe to $CFG->jabberusername presence.
As the server name does not include a resource identifier (stillwit@jabber.org/resource),
an explode('/') fails.
2013-04-29 19:17:58 +08:00
Dan Poltawski 3fb4ce7d58 Merge branch 'MDL-27071_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-04-29 10:27:41 +01:00
Damyon Wiese 49b18efa4e Merge branch 'MDL-39342_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-29 15:36:09 +08:00
Damyon Wiese 6f9d4498d2 Merge branch 'MDL-30940-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-04-29 14:06:11 +08:00
Ankit Agarwal d9ea44e5a3 MDL-39365 scorm reports: Return correct track count 2013-04-29 13:23:15 +08:00
Damyon Wiese 8927b51d23 Merge branch 'MDL-37845_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-29 11:46:33 +08:00
Damyon Wiese 58498bde56 Merge branch 'MDL-38440-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-04-29 11:10:35 +08:00
Eloy Lafuente (stronk7) f530a1f868 MDL-27071 Add big IN() unit tests
Let's verify how all databases perform with a big
number of parameters (10000) using IN() SQL clauses.
Both using QM and NAMED parameters.

Ideally only Oracle fails, and only it will need fixing.
2013-04-29 01:53:41 +02:00
Eloy Lafuente (stronk7) 0f987021a3 MDL-27071 Allow Oracle IN() to use > 1000 items
By using a pivoting strategy, we modify the list
of params (QM and NAMED supported) into a
subquery, so the 1000 limit in Oracle (ORA-01795)
is not thrown anymore.

Conflicts:
	lib/dml/oci_native_moodle_database.php
2013-04-29 01:53:01 +02:00
Sam Hemelryk 3e7b95b431 Merge branch 'MDL-39192_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-04-29 10:53:49 +12:00
AMOS bot 77474a85a1 Automatically generated installer lang files 2013-04-27 00:37:28 +00:00
Tim Hunt 2d57c26b8b MDL-39246 quiz timer: compute a more accurate stop time. 2013-04-26 12:29:15 +01:00
Tim Hunt 6b32bf8520 MDL-39246 JavaScript: store the time the page starts loading.
This helps synchronise time on the client side with time on the server.
If you wait until a js_init_call runs, you might have had to wait an
unknown number of seconds while all the JS loads. Therefore, we capture
the current time as soon as possible in <head>.

This is a bit like adding .jsenabled to <body> as soon as possible, to
reduce visual flicker.
2013-04-26 12:29:11 +01:00
Jerome Mouneyrac 5831c40c5c MDL-38440 WebService get_contents doesn't return the full text of labels 2013-04-26 15:59:14 +08:00
Tim Hunt 9a3d0206da MDL-37845 multichoice qtype: Fix some display issues.
1. Better handling of multi-line choices in the correct answer display.
2. Remove dangerous CSS that is no longer needed.
2013-04-25 17:21:11 +01:00
Dan Poltawski 0b8cda3b9e Merge branch 'MDL-34403-MOODLE_24_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_24_STABLE 2013-04-25 12:54:17 +01:00
Jason Platts 261aae298b MDL-39342 stop users entering too long matching answers.
Since they lead to an ugly DB error.
2013-04-25 12:00:09 +01:00
Dan Poltawski 3aba4326d4 Merge branch 'MDL-29258_24' of git://github.com/dmonllao/moodle into MOODLE_24_STABLE 2013-04-25 10:29:55 +01:00
Frederic Massart 442e59e785 MDL-39329 course: Strict standard warning during unpublishing 2013-04-25 10:11:42 +01:00
AMOS bot f368e4a731 Automatically generated installer lang files 2013-04-25 00:38:08 +00:00
Eloy Lafuente (stronk7) c6be1389b7 weekly release 2.4.3+ 2013-04-25 01:10:08 +02:00
Eloy Lafuente (stronk7) ff1e26aba4 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-04-25 01:03:38 +02:00
Eloy Lafuente (stronk7) 9c65b19cb5 Merge branch 'MDL-35364_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-24 23:36:55 +02:00
Matt Petro 7dc22c4ef1 MDL-34403 mod quiz: fix error during enrolment 2013-04-24 14:52:33 -04:00
Dan Poltawski ce024436be Merge branch 'MDL-39283_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-04-24 14:35:09 +01:00
Dan Poltawski fdeb0d80ed Merge branch 'MDL-39219_scorm_ie7_24' of git://github.com/davosmith/moodle into MOODLE_24_STABLE 2013-04-24 09:08:49 +01:00
Ruslan Kabalin 414095a014 MDL-34939: Fix clamdscan permissions-related issues
Use --fdpass parameter that passes the file descriptor permissions to clamd,
which allows to scan given file irrespective of directory and file
permissions. Changing file permissions is not required.
2013-04-24 14:59:19 +08:00
Mark Nelson ee02d17466 MDL-39303 mod_forum: prevent user from submitting when post threshold reached 2013-04-24 14:02:52 +08:00
Ankit Agarwal ca61ed1bbe MDL-39296 scorm reports: Fixing incorrect variable name 2013-04-24 13:43:35 +08:00
Mark Nelson 709c441e89 MDL-39192 mod_forum: do not need to check the posting threshold when editing a post 2013-04-24 12:32:39 +08:00
Davo Smith 7b443f87dd MDL-39219 mod_scorm - make sure YUI JSON module is loaded 2013-04-23 18:58:49 +01:00
Dan Poltawski 2a4eeac067 Merge branch 'MDL-37784_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-04-23 13:00:39 +01:00
Dan Poltawski 5559857f9e Merge branch 'MDL-39296-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-04-23 12:50:51 +01:00
Jean-Michel Vedrine c8fbd8b0c3 MDL-39283 GIFT and XML question export broken for unsupported qtypes
Do no write any data to the export for unsupported qtypes
2013-04-23 09:52:47 +02:00
Jean-Michel Vedrine 37eadb417b MDL-37784 Adaptive no penalty display wrong penalty info
Adaptive Mode tells students they have been penalized even when set to no penalties
2013-04-23 08:39:48 +02:00
Damyon Wiese 9723842bc0 Merge branch 'MDL-34933_24_STABLE' of https://github.com/mchurchward/moodle into MOODLE_24_STABLE
Conflicts:
	lib/db/upgrade.php
	version.php
2013-04-23 12:02:47 +08:00
Ankit Agarwal 2c2544877d MDL-39296 scorm reports: Fix undefined variables in graphs report 2013-04-23 11:55:41 +08:00
David Monllao d902ffe847 MDL-29258 core_portfolio: Fixing broken default breadcrumb 2013-04-23 11:16:38 +08:00
AMOS bot d4aca421df Automatically generated installer lang files 2013-04-23 00:37:55 +00:00
Tim Hunt 79ed1fe6c6 MDL-35364 shorten text: don't return invalid HTML.
I also broke the unit tests into more, smaller, named tests, so that
when things start failing, more tests are run, and it is clearer what
the problem is.

In a couple of cases, I adjusted the $ideal lenght in the test. A
careful counting of the characters in the test input (added as comments)
suggests that the new values make for better tests.
2013-04-22 19:24:50 +01:00
Alex Leontiev 22687af45a MDL-37514 module.js: fix .js for auto quiz submission in preview mode
The issue: when we attempt the quiz as teacher/admin and timer is up,
quiz is not submitted, even though "Open attempts are submitted
automatically" is set. I've changed the javascript for a timer,
responsible for submission, removing the special behaviour in case of
preview mode. Note, that when the admin/teacher is taking a quiz, the
"preview" mode is automatically switched on.

It is a bit strange, since in the javascript there was clearly no
expressed intention to really submit quiz in preview, even when timer
hits. It does not really seem like a accidental bug, rather it looks
like some misunderstanding. Worse still, it may happen that I did not
understand the intentions of previous editor and ruined some
functionality. Because of this, and the fact that this is my first bug,
I would like to ask about the peer review! Please, see my comments in
bug discussion for the testing steps.
2013-04-22 14:10:06 +01:00
Mike Churchward d75a987e36 MDL-34933 core_message: Adding index to improve database access on message_working table. 2013-04-22 08:38:03 -04:00
Jason Platts e1267ba041 MDL-37942 Images with non-alphanumeric chars in file name won't export 2013-04-22 12:43:39 +01:00
Dan Poltawski 3fd370acde Merge branch 'w16_MDL-39141_m24_toolbar' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-04-22 12:40:44 +01:00
Damyon Wiese 499c16040d Merge branch 'MDL-39050_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-22 10:29:20 +08:00
AMOS bot fb1b6c4fbc Automatically generated installer lang files 2013-04-22 00:38:29 +00:00
Sam Hemelryk b920c4096c Merge branch 'MDL-39172_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-04-22 11:02:14 +12:00
Dan Poltawski 6f69ef749e Merge branch 'MDL-39219_scorm_ie7_24' of git://github.com/davosmith/moodle into MOODLE_24_STABLE
Conflicts:
	mod/scorm/module.js
2013-04-19 15:20:36 +01:00
Dan Poltawski d9a277684f Merge branch 'MDL-38361_24' of https://github.com/prateeksachan/moodle into MOODLE_24_STABLE 2013-04-19 15:11:48 +01:00
Dan Poltawski 0c60dae522 Merge branch 'wip-MDL-38565-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-04-19 13:47:44 +01:00
Tim Hunt 98ccd4fa20 MDL-39050 quiz access rules: settings.php files should work. 2013-04-19 11:52:55 +01:00
Damyon Wiese 501dd08c6b Merge branch 'MDL-39084-moodle24' of github.com:StudiUM/moodle into MOODLE_24_STABLE 2013-04-19 14:07:15 +08:00
Damyon Wiese 3054e59f40 Merge branch 'MDL-39167_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-19 13:30:54 +08:00
Frederic Massart 8154dd8350 MDL-30940 form: Mutiple select work correctly without any selection 2013-04-19 11:06:29 +08:00
Sam Hemelryk d7b2888810 Merge branch 'MDL-39185_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-04-19 13:53:36 +12:00
Sam Hemelryk aec4f1e956 Merge branch 'MDL-39135-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-04-19 13:48:07 +12:00
Sam Hemelryk 6318a38885 MDL-38565 cache: tidy up pre-integration
Conflicts:
	lib/db/upgrade.php
2013-04-19 10:11:38 +12:00
Sam Hemelryk 1a038ed7d9 MDL-38565 cache: improve stats gathering 2013-04-19 10:11:37 +12:00
Sam Hemelryk 312ad653e9 MDL-38565 cache: upgrade code to amend default stores
Conflicts:
	version.php
2013-04-19 10:11:37 +12:00
Sam Hemelryk 73433c0995 MDL-38565 cache: cron routine to clean up old session data 2013-04-19 10:09:55 +12:00
Sam Hemelryk 2e0b7de1b1 MDL-38565 cache: session caches now function as expected
This change is a large change to the way sessions are handled
within MUC after it was discovered that session did not function
as expected when any store other than the default session store
was being used.
As part of this change the session loader has been largely
customised in order to consolidate session data for the loader.
The unit tests have also being greatly increased to provide
better coverage for sessions.

Conflicts:
	cache/README.md
	cache/tests/cache_test.php
2013-04-19 10:09:55 +12:00
Petr Škoda 7fcffb98bb MDL-39141 fix customtoolbar notices during upgrade 2013-04-18 20:22:52 +02:00
Jean-Michel Vedrine 3b44cab37b MDL-39172 Import of .dat files is broken in blackboard_six import format 2013-04-18 17:48:08 +02:00
Dan Poltawski d298661993 weekly release 2.4.3+ 2013-04-18 12:49:40 +01:00
Davo Smith 76bb36da6f MDL-39219 mod_scorm - replace JSON with Y.JSON for IE7 compatibility 2013-04-18 12:47:54 +01:00
Dan Poltawski 0d80c1cc7a Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-04-18 12:44:04 +01:00
Dan Poltawski 8803e9c7e1 Merge branch 'MDL-39203-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-04-18 08:44:10 +01:00
Frederic Massart c32c6c1c24 MDL-39203 repository: Fixed authentication errors with Dropbox 2013-04-18 14:54:19 +08:00
Dan Poltawski f8e976e56a Merge branch 'MDL-38824-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-04-17 14:38:06 +01:00
Tim Hunt ccbe8ca79e MDL-39167 quiz access rules: need to validate their settings.
We were missing the hook in the form validation method. We had them
everywhere else they were needed.
2013-04-17 14:26:08 +01:00
Dan Poltawski ea4841fbef Merge branch 'wip-mdl-39110-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-04-17 13:02:47 +01:00
Mark Nelson bb244cb482 MDL-39185 mod_forum: declare new object before creating member variables to prevent Strict Standards warning 2013-04-17 15:21:44 +08:00
Dan Poltawski ea99087d08 MDL-39135 assign_feedback: fix missing renderer argument
assign_user_summary expects extra profile fields

Conflicts:

	mod/assign/feedback/file/locallib.php
2013-04-17 14:05:31 +08:00
Jean-Philippe Gaudreau efc0be399e MDL-39084 grade: Capability checks are incoherent for the Course grade settings section 2013-04-16 09:28:25 -04:00
Dan Poltawski 464ab7894b Merge branch 'MDL-39080_M24' of git://github.com/kordan/moodle into MOODLE_24_STABLE 2013-04-16 12:45:01 +01:00
Daniel Neis Araujo 461ccadab0 MDL-38136: fix user_get_user_details doesn't return idnumber (thanks to Antonio Carlos Mariani) 2013-04-16 15:47:16 +08:00
Damyon Wiese 20d52c6b9c Merge branch 'wip-MDL-38055-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-04-16 14:42:20 +08:00
Sam Hemelryk d203a50c02 MDL-39127 navigation: fixed loading of categories for navbar
Conflicts:

	lib/navigationlib.php
2013-04-16 10:04:55 +08:00
Eloy Lafuente (stronk7) 1e803a3e45 Merge branch 'm24_MDL-37844' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-04-16 01:15:06 +02:00
Dan Poltawski dd79ab10b3 Merge branch 'MDL-38880_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-04-15 16:25:15 +01:00
Dan Poltawski ef9c4b6ef5 Merge branch 'MDL-39000-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-04-15 08:30:16 +01:00
Dan Poltawski 7af74e7f19 Merge branch 'MDL-38011-24' of git://github.com/srynot4sale/moodle into MOODLE_24_STABLE 2013-04-15 07:59:10 +01:00
Rajesh Taneja 1f02e1548f MDL-39110 Administration: Get role from get_roles function to display as filter label 2013-04-15 14:29:49 +08:00
Damyon Wiese 5ac9166740 Merge branch 'MDL-39068_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-04-15 14:24:02 +08:00
Damyon Wiese 25105b650a MDL-37762 navbar - fold some long lines in previous patch 2013-04-15 13:26:36 +08:00
Damyon Wiese 6bf520165b Merge branch 'wip-MDL-37762-m24' of https://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-04-15 12:37:54 +08:00
Eloy Lafuente (stronk7) 6e0b5a725d Merge branch 'MDL-39089_24' of git://github.com/dmonllao/moodle into MOODLE_24_STABLE 2013-04-15 01:57:35 +02:00
Sam Hemelryk ce520e0470 MDL-37762 navbar: shows categories for current course again 2013-04-15 11:35:23 +12:00
Paul Nicholls 7a5f3762d0 MDL-37762: Breadcrumb not showing categories on course page 2013-04-15 11:30:23 +12:00
Eloy Lafuente (stronk7) a68e6026ca MDL-39068 use cross-db text column ORDER BY
Credit goes to Valerii Kuznetsov, thanks!
2013-04-14 16:09:54 +02:00
AMOS bot 6c5a661606 Automatically generated installer lang files 2013-04-13 00:37:25 +00:00
David Monllao 42cff3b54a MDL-38089 mod_wiki: Fix incorrect links 2013-04-12 13:17:13 +08:00
Damyon Wiese aa17028b35 MDL-29877 Grades - Remove hardcoded prefix from upgrade step 2013-04-12 11:53:20 +08:00
Damyon Wiese 870f78b0fd MDL-29877 Grades - version bump for upgrade step.
And whitespace...
2013-04-12 11:41:54 +08:00
Damyon Wiese d4a997b7d7 Merge branch 'MDL-29877_bad_grade_item_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE
Conflicts:
	version.php
2013-04-12 11:36:17 +08:00
Jayesh Anandani 7ec3994f78 MDL-39054 quiz statistics: move hard-coded text to lang file 2013-04-12 11:09:24 +08:00
Dan Poltawski 5c58c88545 Merge branch 'MDL-37537-24' of git://github.com/srynot4sale/moodle into MOODLE_24_STABLE 2013-04-12 10:26:45 +08:00
Jean-Philippe Gaudreau 4d06b6a841 MDL-38637 CAS Authentication: Undefined index: QUERY_STRING when executing cron 2013-04-11 10:55:02 -04:00
Jean-Michel Vedrine 50a9a7d498 MDL-38880 Imported Cloze questions lose embedded images or other media 2013-04-11 16:29:34 +02:00
Aaron Barnes d20826dc4c MDL-37537 completion: Fix incorrect lang string reference in block 2013-04-12 01:49:35 +12:00
Aaron Barnes 3220058b14 MDL-38011 completion: Use new localised role names 2013-04-12 01:39:52 +12:00
Eloy Lafuente (stronk7) 931eff3b84 weekly release 2.4.3+ 2013-04-11 12:42:07 +02:00
Eloy Lafuente (stronk7) 112c8e8812 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-04-11 12:32:51 +02:00
Kordan 871a4102dc MDL-39080 theme_formal_white: modified "Main menu" block look to resemble the "Navigation" one 2013-04-11 11:01:20 +02:00
Dan Poltawski caf6774576 Revert "MDL-38254 Assignment Module: add avaialble message to all assignment types"
This reverts commit 079a76bb37.
2013-04-11 16:53:02 +08:00
Damyon Wiese 1b68e51133 MDL-35144 Categories - Allow editing by custom roles
Users with category:manage or course:create should be able to edit
the course/category.php page.
2013-04-11 14:07:46 +08:00
Eloy Lafuente (stronk7) 0d9a2ce8e0 Merge branch 'MDL-38525-24' of https://github.com/damyon/moodle into MOODLE_24_STABLE 2013-04-11 00:57:07 +02:00
Damyon Wiese 3133c8e4ac MDL-38525: Assignment upgrade - Error with comments for unenrolled students.
Students with comments on 'upload' assignments cause errors for the upgrade
tool if they are no longer enrolled. The solution is to allow siteadmin to
see student submissions even if the student is not currently enrolled (you
must be siteadmin to run the upgrade tool).
2013-04-10 16:17:43 +08:00
Ryan Panning 1fbe4f46ba MDL-38525: Assignment - print exception message when assignment upgrade fails.
Change to use getMessage() from the Exception class will prevent "{$a}" when
$e->error is null.
2013-04-10 16:17:33 +08:00
Dan Poltawski 4e7aef7651 Merge branch 'MDL-19072_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-04-10 14:10:51 +08:00
Dan Poltawski 5bad124045 Merge branch 'MOODLE_24_MDL35144' of git://github.com/thepurpleblob/gumoodle into MOODLE_24_STABLE 2013-04-10 12:23:53 +08:00
Dan Poltawski eda9f7bd43 Merge branch 'wip-mdl-35883-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-04-10 12:16:40 +08:00
Dan Poltawski 3a44f70e62 Merge branch 'MDL-38254_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-04-10 12:13:28 +08:00
Dan Poltawski a1ec118378 Merge branch 'MDL-38999_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-04-10 10:35:52 +08:00
Andrew Davis 166102e9b3 MDL-29877 core_grade:add some upgrade code to fix broken grade items introduced by bad restores 2013-04-10 08:28:05 +08:00
Petr Škoda 1802cb2536 MDL-38912 fix incorrect timeout reset 2013-04-10 00:07:26 +02:00
sam marshall 58404f0ab4 MDL-39000 Conditional activities: Section condition restore errors 2013-04-09 17:35:39 +01:00
Jean-Michel Vedrine 720b0f5eb0 MDL-19072 XHTML export for match questions fix for distractors 2013-04-09 11:02:27 +02:00
Dan Poltawski 892c4e1bc6 Merge branch 'wip-MDL-38442-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-04-09 15:40:19 +08:00
Aparup Banerjee 883050603c Merge branch 'w14_MDL-38798_m24_php55' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-04-09 14:31:10 +08:00
Aparup Banerjee 6b9fc96f8e Merge branch 'wip-MDL-38887-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-04-09 14:21:32 +08:00
Dan Poltawski dec2c2086f Merge branch 'MDL-38766/MOODLE_24_STABLE' of github.com:kemitix/moodle into MOODLE_24_STABLE 2013-04-09 10:38:09 +08:00
Dan Poltawski 927416c2f3 Merge branch 'wip-MDL-38541-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-04-09 09:48:05 +08:00
Marina Glancy 69778612db MDL-38541 Restrict calling rebuild_course_cache() from upgrade process
only plugins upgrade scripts can call rebuild_course_cache() and for clearing cache only.
2013-04-09 11:13:50 +10:00
AMOS bot dea31c3040 Automatically generated installer lang files 2013-04-09 00:37:50 +00:00
Eloy Lafuente (stronk7) 989a8abc44 Merge branch 'w14_MDL-38753_m24_ocicount' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-04-09 02:25:31 +02:00
Petr Škoda cfbdf4d2a0 MDL-39028 fix sqlsrv concat type conversion 2013-04-09 02:18:34 +02:00
Sam Hemelryk a95fb6895d MDL-38442 navigation: set_expansion_limit now only hides structural nodes 2013-04-09 12:06:26 +12:00
Petr Škoda 239fb7ac41 MDL-39024 fix MSSQL seek past the end of recordset 2013-04-09 01:59:43 +02:00
Petr Škoda 0816f853fa MDL-39022 fix MSSQL concat type conversion 2013-04-09 01:56:48 +02:00
Eloy Lafuente (stronk7) f6a2e02702 Merge branch 'MDL-38912_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-09 01:39:49 +02:00
Damyon Wiese d11c78a127 MDL-38907 Course: Remove unused CSS causing jump menu to be center aligned. 2013-04-09 01:09:50 +02:00
Eloy Lafuente (stronk7) a387569134 Merge branch 'MDL-39023-parentlang_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-04-08 16:57:47 +02:00
Howard Miller de6e4874ef MDL-35144 adding editing capabiltities to page 2013-04-08 15:47:03 +01:00
Eloy Lafuente (stronk7) eecfff557d MDL-38999 timezones: add some TZ/stamps know to be problematic to tests. 2013-04-08 16:32:28 +02:00
Eloy Lafuente (stronk7) 8874028e9e MDL-38999 timezones: fixed timezone information. 2013-04-08 16:32:19 +02:00
sam marshall cfd41befd5 MDL-38824 Activity completion: Automatic completion quotes not escaped 2013-04-08 14:53:38 +01:00
David Mudrák 5c0877079c MDL-39023 Make get_language_dependencies() aware of circular dependency risk
The patch reimplements the core_string_manager::get_language_dependencies()
so that potentially mis-configured language packs with circular
dependencies or self dependency do not make the site unavailable.
Unit tests for the expected behaviour are added.
2013-04-08 14:26:23 +02:00
Petr Škoda b795853f5b MDL-38753 tweak count SQL to make stupid Oracle happy 2013-04-08 12:34:46 +02:00
Damyon Wiese 0ab296bd10 Merge branch 'MDL-38452-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-04-08 14:08:24 +08:00
Dan Poltawski 99a66861b7 Merge branch 'MDL-37676_24_STABLE' of git://github.com/appalachianstate/moodle into MOODLE_24_STABLE 2013-04-08 14:07:04 +08:00
Tim Lock 0852e56af6 MDL-35868: quiz: Use correct attemptnumber when a last attempt exists. 2013-04-08 11:09:42 +08:00
Dan Poltawski 3a509e1a6a Merge branch 'wip-MDL-38701-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-04-08 10:23:21 +08:00
Marina Glancy 4ea004cf9e MDL-38701 Added missing require_once() before calling course_get_format 2013-04-08 11:37:33 +10:00
Marina Glancy 11799954dc MDL-38887 dim hidden branches in navigation expanded via AJAX requests 2013-04-08 11:36:15 +10:00
AMOS bot ddc9ca757d Automatically generated installer lang files 2013-04-08 00:36:05 +00:00
Matteo Scaramuccia 18c3001eb4 MDL-35840 SCORM TOC: fixed a typo, improvements on getting the focus 2013-04-08 09:45:07 +12:00
Dan Marsden 9e8c6c7bff MDL-37844 SCORM: fix js error and highlight selected node in TOC. 2013-04-08 09:45:00 +12:00
Petr Škoda 5364ee6b09 MDL-38798 remove unused property which was giving notices in PHP 5.5beta 2013-04-07 11:53:50 +02:00
AMOS bot 7ecf4f1360 Automatically generated installer lang files 2013-04-07 00:37:25 +00:00
Tim Hunt 1e659c865a MDL-38912 prevent time-outs during unit tests. 2013-04-05 18:39:20 +01:00
Andrea Bicciolo 704e2ecaaa MDL-38480_m24 Fix for messy usage of language strings in block course overview 2013-04-05 12:25:04 +02:00
Dan Poltawski bd11908373 weekly release 2.4.3+ 2013-04-05 18:01:38 +08:00
Dan Poltawski 76593ae5e6 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-04-05 17:52:35 +08:00
Paul Campbell 3519df7631 MDL-38766 wiki2.0: fix redirects
Signed-off-by: Paul Campbell <pcampbell@carnegiecollege.ac.uk>
2013-04-05 09:38:30 +01:00
Rossiani Wijaya 079a76bb37 MDL-38254 Assignment Module: add avaialble message to all assignment types 2013-04-04 11:08:57 +08:00
AMOS bot 362add0f4f Automatically generated installer lang files 2013-04-04 00:36:09 +00:00
Eloy Lafuente (stronk7) 3a5cb521c9 Merge branch 'MDL-38112-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-04-04 00:57:59 +02:00
Dan Poltawski b7f0af199d Merge branch 'MDL-38657_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-04-03 16:51:13 +08:00
Aparup Banerjee 20a98af525 Merge branch 'MDL-38809_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-04-03 16:33:00 +08:00
AMOS bot 5ac884c9a3 Automatically generated installer lang files 2013-04-03 00:35:46 +00:00
Damyon Wiese 70a9bf863b MDL-38840 Statslib - Fix failing unit tests on ci server (DST change) 2013-04-02 16:49:21 +02:00
Rajesh Taneja 819ad10fa3 MDL-35883 Accessibility: Added title for login as user link in header and footer for accessibility 2013-04-02 16:00:29 +08:00
Rajesh Taneja 9c14f808ed MDL-35883 Accessibility: Added title for user link in header and footer for accessibility 2013-04-02 16:00:29 +08:00
Dan Poltawski b2c04be9c5 MDL-35603 backup: fix coding style issues
Conflicts:
	backup/util/ui/restore_ui_components.php
2013-04-02 14:34:29 +08:00
Dan Poltawski ecfa79b801 Merge branch 'MDL-35603_24' of git://github.com/rlorenzo/moodle into MOODLE_24_STABLE 2013-04-02 14:26:47 +08:00
Damyon Wiese 0c61dbecf7 Merge branch 'MDL-38713-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-04-02 13:19:51 +08:00
Damyon Wiese f034c23b0a Merge branch 'MDL-38700-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-04-02 13:11:13 +08:00
Dan Poltawski 536780c5de Merge branch 'MDL-38702_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-04-02 10:04:47 +08:00
Mary Evans f246415143 MDL-38657 theme_base: Fixes misalignment issue in User Report page. 2013-03-31 02:30:57 +01:00
prateeksachan e8803d5293 MDL-38361: Fixed typos in mod/assign/locallib.php 2013-03-30 23:42:25 +05:30
Tim Hunt 56054396c4 MDL-38809 quiz manual grading: delete expensive unnecssary code. 2013-03-30 17:27:16 +00:00
Rex Lorenzo 1936dbe341 MDL-35603 - Backup - Course import/restore max results
* Unified UI for import and restore course search
2013-03-28 15:24:33 -07:00
Damyon Wiese fe33d24cab weekly release 2.4.3+ 2013-03-28 14:48:58 +08:00
Damyon Wiese 994bc95e2a Merge branch 'MDL-25631_m24' of git://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-03-28 10:41:20 +08:00
Jonathon Fowler bbf86cd4f3 MDL-37966 Assignment: put upgraded modules where the originals were 2013-03-27 12:52:36 +10:00
Aparup Banerjee 843093789d Merge branch 'MDL-38659_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-03-27 10:38:48 +08:00
Eloy Lafuente (stronk7) 821c60617e Merge branch 'MDL-38557_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-26 23:41:31 +01:00
Eloy Lafuente (stronk7) 673ff9d82e Merge branch 'MDL-38647_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-26 23:22:53 +01:00
Eric Merrill 59c5f4cd35 MDL-25631 backup Decoupling legacy files from course config settigs. If they are present, they will be restored. 2013-03-26 17:02:51 -04:00
Petr Škoda 0fe975bbf2 MDL-37782 reset DB after each failed database test 2013-03-26 16:11:08 +01:00
Eloy Lafuente (stronk7) 25ce2cfbeb MDL-38659 environment: fix incorrect feedback messages 2013-03-26 15:36:37 +01:00
Dan Poltawski 85c361d3ea MDL-38713 course: correctly set visibleold on mod creation
Remove uncessary set of visibleold in the form
2013-03-26 16:21:16 +08:00
Damyon Wiese 48bf094142 Merge branch 'm24_MDL-38336_SCORM_TOC_links_when_Display_course_structure_is_on' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-03-26 16:02:28 +08:00
Damyon Wiese cacbbb46ce MDL-38468 Filelib: Fix ordering of new mimetypes 2013-03-26 15:25:56 +08:00
Damyon Wiese 11ba99ea72 Merge branch 'm24_MDL-38468_Fix_MHTML_files_delivery' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-03-26 15:23:57 +08:00
Charles Fulton 914624d51d MDL-38700 course: only change visibility if a module moves to a different section 2013-03-26 15:00:26 +08:00
Dan Poltawski ba97fbe855 MDL-38700 course: add tests for moveto_module()
* Test visibility when moving around hidden sections
* Test for visiblity changes when moving around in the same sections.
2013-03-26 15:00:26 +08:00
Damyon Wiese fe33e80077 Merge branch 'wip-MDL-35875-stable24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-03-26 14:48:40 +08:00
Damyon Wiese 06b3c7e961 Merge branch 'MDL-30438_b_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-03-26 14:36:28 +08:00
Damyon Wiese a9cb8b73c8 Merge branch 'MDL-38380_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-03-26 13:24:47 +08:00
Dan Poltawski d0732e589f MDL-38112 - update to the ISO list of countries
According to ISO 3166-1
2013-03-26 10:46:19 +08:00
Damyon Wiese 0e91ef2d66 Merge branch 'wip-mdl-36882-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-03-26 10:42:18 +08:00
Rajesh Taneja 6299d9a1a7 MDL-36882 course: Added aria-live for manual completion
This is required so that assistive technologies can notify user about change on completion status
2013-03-26 10:26:28 +08:00
Damyon Wiese a5a3618c66 Merge branch 'wip-mdl-36125-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-03-26 10:13:38 +08:00
Mary Evans db5cbad673 MDL-38702 theme_mymobile: Replaced missing theme setting to disable CSS Optimiser.
The missing setting was a regression casued by MDL-33357.
2013-03-26 00:50:29 +00:00
Damyon Wiese 33c1b04c2a Merge branch 'MDL-38668_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-03-25 15:51:29 +08:00
Jason Fowler b055a241b8 MDL-35875 - Accessibility - Remove empty summary attribute for user information table in view user's profile 2013-03-25 10:30:31 +08:00
Damyon Wiese eb6f546b1b MDL-37033 Environment - Fix indenting in XML 2013-03-25 09:26:11 +08:00
Damyon Wiese 9fcdee8692 Merge branch 'MDL-37033_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-03-25 09:22:19 +08:00
Eloy Lafuente (stronk7) 864a5cfd2f Merge branch 'MDL-38658-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-03-24 23:40:55 +01:00
Eloy Lafuente (stronk7) d2db86448e Merge branch 'MDL-36927-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-03-24 23:39:22 +01:00
Matteo Scaramuccia 417d004cad MDL-38336 SCORM: incorrect TOC bulding when 'Display course structure' is on 2013-03-24 11:06:54 +01:00
Eloy Lafuente (stronk7) 3adedb6f00 MDL-38668 timezones: update to tzdata 2013b 2013-03-24 10:45:49 +01:00
Andrew Robert Nicols 65f302ac4d MDL-38658 JavaScript: Correct fullpath for dndupload definition 2013-03-23 22:07:35 +00:00
Matteo Scaramuccia 9992ee729e MDL-38468 Files API: fixed the support for MTHML (MIME HTML: web page archive) files 2013-03-23 12:26:03 +01:00
Eloy Lafuente (stronk7) d9e93de2eb MDL-37033 environment: add 2.5 brach details 2013-03-22 18:41:23 +01:00
Fred Woolard 7a257bb0f7 MDL-37676 Use course grade category if mapping fails for manual grade items 2013-03-22 08:27:21 -04:00
Tim Hunt 37b6904b8c MDL-38647 quiz review question issues
1. Page URL should contain 'step=0' if necessary, but not 'step='.
2. Review specific step was not using the right display options.
2013-03-22 11:17:48 +00:00
Tim Hunt 519c20adb8 MDL-38557 quiz manual grading should check mod/quiz:grade 2013-03-22 10:19:47 +00:00
Damyon Wiese b9ef2c9607 weekly release 2.4.3+ 2013-03-22 13:52:56 +08:00
Damyon Wiese 4b5c4e2637 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-03-22 13:35:55 +08:00
Rajesh Taneja 6d1e592c2a MDL-36125 course: Added aria-describedby for editing activity title 2013-03-22 12:42:04 +08:00
AMOS bot 526bcd44cd Automatically generated installer lang files 2013-03-21 00:37:30 +00:00
Eloy Lafuente (stronk7) 6ef445a515 Merge branch 'MDL-38035-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-03-20 17:09:22 +01:00
sam marshall 50701d1e89 MDL-38035 Conditional availability: Support multilang custom user fields 2013-03-20 15:58:59 +00:00
David Monllao 3bb4d9b400 MDL-38364 phpunit: PHPUnit autoload uses capital A 2013-03-20 16:06:10 +08:00
Ankit Agarwal 9df92fcacb MDL-36927 Reports: Page layout is not defined in course/recent.php 2013-03-20 14:13:26 +08:00
Damyon Wiese 3ab41b9779 Merge branch 'wip-MDL-38387-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-03-20 13:46:59 +08:00
Frederic Massart 6c402aa73d MDL-38452 repositories: User logged in as have access to non-private repositories 2013-03-20 13:32:43 +08:00
Damyon Wiese 6e2f8aa9f1 MDL-38373 Auth - Additional strict warning fix for radius authentication 2013-03-20 12:37:39 +08:00
Damyon Wiese 81c8a28c72 Merge branch 'MDL-38373_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-03-20 12:34:26 +08:00
Sam Hemelryk fb3ff98014 MDL-38055 course: fixed double encoding of title properties
Conflicts:
	lib/navigationlib.php
2013-03-20 17:28:43 +13:00
Sam Hemelryk bf07f4e212 MDL-38387 cache: removed call to plugins API from cache API 2013-03-20 16:07:53 +13:00
Sam Hemelryk 7588627b8b MDL-38350 cache: fixed issue with siteidentifier === false 2013-03-20 16:07:53 +13:00
AMOS bot 9427beaf77 Automatically generated installer lang files 2013-03-20 00:36:55 +00:00
Eloy Lafuente (stronk7) 6407ca6927 Revert "MDL-38515 JavaScript: Correct module dependencies for core_filepicker"
This reverts commit 573571d727.
2013-03-20 00:56:41 +01:00
Eloy Lafuente (stronk7) 8bcca79594 Merge branch 'MDL-38490_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-20 00:43:43 +01:00
Eloy Lafuente (stronk7) e285f93242 Merge branch 'MDL-38370-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-03-20 00:32:02 +01:00
Eloy Lafuente (stronk7) d4aac84fbe Merge branch 'w12_MDL-38364_m24_phpunitloading' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-03-20 00:19:57 +01:00
Eloy Lafuente (stronk7) 7765766512 MDL-38035 api: doc get_condition_user_fields() new param. 2013-03-20 00:06:28 +01:00
Eloy Lafuente (stronk7) 87342f4cfb Merge branch 'MDL-38035-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-03-19 23:57:51 +01:00
Eloy Lafuente (stronk7) e4095955ed Merge branch 'MDL-37664-MOODLE_24_STABLE' of https://github.com/lucisgit/moodle into MOODLE_24_STABLE 2013-03-19 23:37:31 +01:00
Eloy Lafuente (stronk7) 5efd762f7a Merge branch 'MDL-38424_m24' of git://github.com/kordan/moodle into MOODLE_24_STABLE 2013-03-19 23:18:51 +01:00
Eloy Lafuente (stronk7) 581e9db8e0 Merge branch 'MDL-38395_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 23:07:24 +01:00
Eloy Lafuente (stronk7) 745a0dc660 Merge branch 'MDL-38460_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-03-19 21:14:55 +01:00
Eloy Lafuente (stronk7) dc122b32b3 Merge branch 'wip-MDL-38422_M24' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-03-19 21:12:53 +01:00
Eloy Lafuente (stronk7) 82f27d5bbd Merge branch 'MDL-38363_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 21:07:08 +01:00
Eloy Lafuente (stronk7) bc353318b2 Merge branch 'MDL-38355_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 21:01:10 +01:00
Eloy Lafuente (stronk7) 4b6963eb6d Merge branch 'MDL-38388_24' of git://github.com/jonof/moodle into MOODLE_24_STABLE 2013-03-19 19:03:21 +01:00
Eloy Lafuente (stronk7) 60d7878a3a Merge branch 'MDL-38412_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 18:22:53 +01:00
Eloy Lafuente (stronk7) f0f28e3c3b Merge branch 'w12_MDL-38329_m24_webkit' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-03-19 18:17:35 +01:00
Petr Škoda 8cdc6bfc4f MDL-38180 do not add links for enrol and other users candidates 2013-03-19 18:03:13 +01:00
Petr Škoda 15d001fc28 MDL-38202 fix loginas logout redirection 2013-03-19 16:53:57 +01:00
Eloy Lafuente (stronk7) 59faf92e1f Merge branch 'MDL-38542_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 16:49:23 +01:00
Eloy Lafuente (stronk7) 332e3c0153 Merge branch 'MDL-38444_24' of https://github.com/ppichet/moodle into MOODLE_24_STABLE 2013-03-19 16:35:30 +01:00
Tim Hunt 708c1b7fc8 MDL-38542 shortanswer qtype: was broken for responses of '0'.
This was a regression caused by MDL-37157 & MDL-37746.
2013-03-19 13:55:41 +00:00
Eloy Lafuente (stronk7) 38b7d50139 Merge branch 'MDL-38515-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-03-19 12:58:07 +01:00
Eloy Lafuente (stronk7) f6a52da112 Merge branch 'MDL-38397_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-19 12:28:52 +01:00
Eloy Lafuente (stronk7) d4ce77f624 Merge branch 'wip-mdl-38431-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-03-19 10:24:39 +01:00
Eloy Lafuente (stronk7) 834a0c1a55 Merge branch 'MDL-36872-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-03-19 09:37:24 +01:00
Damyon Wiese f402d3225f Merge branch 'w12_MDL-38320_m24_logininfo' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-03-19 15:02:23 +08:00
Damyon Wiese 0cb081f51f Merge branch 'MDL-38456-mdeploy-paths_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-03-19 14:12:23 +08:00
AMOS bot 00e2eb15a6 Automatically generated installer lang files 2013-03-19 00:36:22 +00:00
Damyon Wiese 147400d846 Merge branch 'MDL-38215-workshop-oracle_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-03-18 11:45:53 +08:00
Petr Škoda 54aabc8200 MDL-38320 fix role name display when roles switched 2013-03-17 21:16:33 +01:00
Petr Škoda 92ce0a63cb MDL-38329 use proper plugin name for the webkit lists workaround
Credit goes to Mauno Korpelainen, thanks.
2013-03-17 21:03:22 +01:00
Petr Škoda 6bc755274a MDL-38364 rework PHPUnit autoloading
This is related to BC incompatibility introduced in https://github.com/sebastianbergmann/phpunit/issues/848
2013-03-17 19:56:15 +01:00
Andrew Robert Nicols 573571d727 MDL-38515 JavaScript: Correct module dependencies for core_filepicker 2013-03-17 16:51:16 +00:00
ppichet 1e9f48c9bc MDL-38444 Saving datasets from edit_calculatedsimple_form.php
Bypassing the 3 steps savequestion() of calculated.
2013-03-17 00:45:00 -04:00
Eloy Lafuente (stronk7) 0713cc584d MDL-25655 glossary: non full searches now working.
In the process of updting the module from 1.9 to
2.0 the (non) full search feature was lost without notice.

This restitutes it with the same behavior present in 1.9:

- fullsearch disabled: look into concepts and aliases.
- fullsearch enabled (default): look also into definitions.
2013-03-16 18:08:51 +01:00
Eloy Lafuente (stronk7) ee40219d6a MDL-38373 Use correct PEAR->loadExtension()
Current use is wrong (static) and leads to strict standards notice.
2013-03-16 11:43:41 +01:00
Mary Evans 2ff2d96916 MDL-38380 theme_magazine: Fixed typo in style/core.css. 2013-03-16 01:42:16 +00:00
Tim Hunt d1fa204c0f MDL-38412 fix quiz reports group mode weirdness.
Moodle currently selected group uses the session. This can cause weird
effects when you have two tabs open. This is particularly weird in the
quiz reports, where some actions like delete attempt are checked against
the currently selected group.

The solution is to put the currently selected group into the URL for all
actions like delete/regrade attempt, regrade all attempts, download and
sort table.
2013-03-15 12:02:11 +00:00
Tim Hunt 7b62eec877 MDL-38363 qtype_calculated. Fix warnings. 2013-03-15 11:23:33 +00:00
Eloy Lafuente (stronk7) 29f8c0937a Moodle release 2.4.3 2013-03-15 12:03:30 +01:00
Eloy Lafuente (stronk7) 01d6191b81 weekly release 2.4.2+ 2013-03-15 09:50:08 +01:00
Tim Hunt ddd11cbf0b MDL-38395 question categories: wrong URLs after editing.
The problem was that array1 + array2 takes the values from
array1 when a key appears in both places.

While working on this area, I updated it to use html_writer.
2013-03-15 08:15:13 +00:00
Damyon Wiese cd824e74d8 Merge branch 'MDL-38474-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-03-15 13:06:04 +08:00
Frederic Massart abf0c9fc9e MDL-38474 repository: Undefined variable 2013-03-15 13:00:35 +08:00
Damyon Wiese 54c0c9e58e Merge branch 'MDL-38474-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-03-15 10:50:47 +08:00
Frederic Massart 7c78db604b MDL-38474 repository: Correct context when checking permissions to access a repository 2013-03-15 10:04:50 +08:00
Jonathon Fowler ffbc0d6f2f MDL-38388 qformat_blackboard_six: fix question image import
This works on the expectation that the returned array from readdata()
is opaque and will be fed directly into readquestions() since
filebase is different per file and needs to be set up appropriately
before each parse.
2013-03-15 09:09:54 +10:00
Tim Hunt 16442e5cfd MDL-38355 qtype_multianswer: input boxes too big in Russian.
... and any other language where the characters take multiple
bytes in UTF-8.

This fix was worked out by Dušan Ristić. I am just committing it.
2013-03-14 22:26:40 +00:00
Tim Hunt 3d8c5cb044 MDL-38397 question editing: only validate default mark if present.
Most qtypes have that field, but not all. multianswer is an example in core.
Also some contrib qtypes.
2013-03-14 22:13:44 +00:00
Tim Hunt fe9f42de4d MDL-38490 question preview, variant is attempt (not display) option 2013-03-14 17:22:32 +00:00
Eloy Lafuente (stronk7) a812924762 weekly release 2.4.2+ 2013-03-14 15:48:11 +01:00
Damyon Wiese ea8393591f Merge branch 'wip-MDL-38303-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-03-14 15:32:34 +08:00
Ankit Agarwal 5c18a83649 MDL-36872 reports: Fixing incorrect sorting of recent activites by timestamp 2013-03-14 14:45:24 +08:00
Aparup Banerjee ecbf8aee6e Merge branch 'MDL-38356-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-03-14 11:03:54 +08:00
Aparup Banerjee 8513176415 Revert "Merge branch 'MDL-38356-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE"
This reverts commit aebfad51a0, reversing
changes made to 484dcc9b90.
2013-03-14 11:02:27 +08:00
Mary Evans b7295e8e5d MDL-38460 theme_mymobile: Fixes resources folders to show properly on first access. 2013-03-14 01:20:18 +00:00
Eloy Lafuente (stronk7) 6b2510f4c7 Revert "Merge branch 'MDL-34818_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE"
This reverts commit 6a34b93223, reversing
changes made to c9b9abc090.
2013-03-14 00:24:07 +01:00
Andrew Robert Nicols 4969eb20ac MDL-38356 JavaScript: Correct check for currentform 2013-03-13 18:22:00 +00:00
Brent Boghosian db23afadac MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
2013-03-13 18:08:33 +00:00
David Mudrák e8c660394d MDL-38215 Fix cross-db support in workshop SQL queries
The $sql used in these methods may contain multiple parts glued
together by the UNION operator. Simply appending the ORDER BY statement
to the end of the query does not work in all DBs (failure reported at
Oracle). Following the pattern already applied in MDL-30051, we wrap the
SQL into yet another SELECT statement and perform ordering there.

Credit goes to Sara Cenni for suggesting the fix.
2013-03-13 15:04:37 +01:00
David Mudrák a1ba9e89d9 MDL-38456 Allow colons in paths passed to mdeploy.php utility
The input_manager now accepts colons (:) in TYPE_PATH options, but only
in cases where the colon is used as a part of Windows drive labels, as
in C:\apache.
2013-03-13 12:14:19 +01:00
Ankit Agarwal fc427a8cbc MDL-38370 scorm: Fixing strict standard errors in outline report 2013-03-13 16:02:38 +08:00
Eloy Lafuente (stronk7) eeb0efd7d8 Merge branch 'MDL-38268-m24' of https://github.com/jfilip/moodle into MOODLE_24_STABLE 2013-03-13 01:14:38 +01:00
Eloy Lafuente (stronk7) ddaf467f31 Merge branch 'MDL-30166-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-03-13 01:09:31 +01:00
Eloy Lafuente (stronk7) b3a5ae03d0 Merge branch 'wip-mdl-38332-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-03-12 22:53:16 +01:00
Shamim Rezaie d4677b4059 MDL-37664 course: Fix drag & drop RTL mode issue 2013-03-12 15:47:23 +00:00
sam marshall 0e79c3ee74 MDL-38035 Activity settings: Support multilang names for custom user fields 2013-03-12 15:39:38 +00:00
Kordan f1820fdd6a MDL-38424 theme_formal_white: added suggestions to css custom styles description 2013-03-12 13:49:07 +01:00
Damyon Wiese 2b2d3244cd Merge branch 'MDL-34011_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-03-12 16:04:54 +08:00
Aparup Banerjee 86070a3ed9 Merge branch 'MDL-35615_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-03-12 15:50:39 +08:00
Rossiani Wijaya 7a28bba4d3 MDL-34011 Lesson module - short answer question: fixed student attempt statistics 2013-03-12 15:02:37 +08:00
Damyon Wiese a8a71bbad3 MDL-34011 Lesson module: fixed incorrect display of student attempt for short answer question 2013-03-12 15:02:26 +08:00
Aparup Banerjee aebfad51a0 Merge branch 'MDL-38356-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-03-12 13:37:45 +08:00
Aparup Banerjee 484dcc9b90 Merge branch 'MDL-35582_message_labels_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-03-12 13:27:19 +08:00
Rajesh Taneja 967bfb4334 MDL-38431 comment: Pass formated comment created time to JS and print_comment 2013-03-12 12:38:46 +08:00
Aparup Banerjee 46640b7e53 Merge branch 'MDL-38386-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE
Conflicts:
	version.php - 2012120302.01 in db/upgrade.php too
2013-03-12 11:35:03 +08:00
Damyon Wiese a22f7cb864 Merge branch 'MDL-37771-M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-03-12 11:22:16 +08:00
Ankit Agarwal 13bb9cee30 MDL-30166 Remove deprecated %fullname% from core
Thanks to Matheus Kautzmann for the initial patch.
2013-03-12 11:16:11 +08:00
Eloy Lafuente (stronk7) 2f286d7658 Merge branch 'MDL-34774_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-03-12 00:55:05 +01:00
Eloy Lafuente (stronk7) 7b8110d4b0 Merge branch 'MDL-38337_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-03-12 00:25:13 +01:00
Eloy Lafuente (stronk7) 6a34b93223 Merge branch 'MDL-34818_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-03-12 00:22:27 +01:00
Eloy Lafuente (stronk7) c9b9abc090 Merge branch 'wip_24_mdl-38262' of git://github.com/iarenaza/moodle into MOODLE_24_STABLE 2013-03-12 00:05:02 +01:00
Gareth J Barnard bc8e5bce36 MDL-38422 theme_mymobile: TinyMCE editor difficulties. 2013-03-11 18:07:56 +00:00
Rossiani Wijaya 4ee9853a78 MDL-30438 Lesson Module: fixed input text editable capability after checking/unchecking unmask option for all browsers except IE8 or lower 2013-03-11 15:43:35 +08:00
Damyon Wiese ff28c81cb6 Merge branch 'wip-MDL-34713-stable24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-03-11 13:47:22 +08:00
Rossiani Wijaya b3af55b363 MDL-30438 Lesson Module: improve password field to disabled when password protect is set to no. 2013-03-11 13:18:56 +08:00
Damyon Wiese 494c554bf3 Merge branch 'MDL-33424_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-03-11 13:18:04 +08:00
Rajesh Taneja 58c8b68c3c MDL-38332 Users: Browse list of users should not contain guest user record 2013-03-11 10:18:03 +08:00
Mary Evans 5d61ac8012 MDL-34818 theme_mymobile: Fixes resources folders to show properly on first access. 2013-03-11 00:18:44 +00:00
Mary Evans 89bcfc4aac MDL-37771 themes: Fixed table header color in Question Bank window block.
modified: theme/anomaly/style/general.css
modified: theme/base/style/question.css
modified: theme/magazine/style/core.css
modified: theme/serenity/style/core.css
modified: theme/splash/style/blue.css
modified: theme/splash/style/green.css
modified: theme/splash/style/orange.css
modified: theme/splash/style/pagelayout.css
modified: theme/splash/style/red.css
2013-03-10 19:04:43 +00:00
Sam Hemelryk 95d3b8e1f2 MDL-38387 cache: fixed inifinite initialisation loop with site id 2013-03-10 11:31:58 +13:00
Sam Hemelryk d55276ee51 MDL-38303 cache: fixed purging of session cache when switching users 2013-03-10 11:31:38 +13:00
Jean-Michel Vedrine c16e466de2 MDL-33424 Images missing when restoring a 1.9 backup 2013-03-09 13:41:03 +01:00
Tim Hunt 0e4511877e MDL-38337 quiz: respect maximum grade config for new quizzes. 2013-03-08 21:33:03 +00:00
Jason Fowler 586fff6894 MDL-34713 - Blog - Fixing undefined index for blog menu block 2013-03-08 14:13:07 +08:00
Lalit Khattar 9dc58f9b26 MDL-34724 Accessibility: At the bottom of Messaging settings page put the label of the checkboxes in <label> 2013-03-08 10:01:45 +08:00
Damyon Wiese 0d9c836ab2 MDL-38386 Courselib: Make sure the upgrade step for MDL-38173 always runs 2013-03-08 09:19:31 +08:00
Brent Boghosian 057f509fad MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
2013-03-06 21:47:15 +00:00
sam marshall cc59085352 MDL-38315 Completion: Bugs with 'locked' status in activity form 2013-03-05 16:34:38 +00:00
Justin Filip 3000c6bde7 MDL-38268 files: Must be explicit about switching cURL request method from HEAD to GET. 2013-03-05 11:30:16 -05:00
Daniele Cordella 9593527b54 MDL-35615 Course section: fixed alignment for userdefaultname checkbox to be inline with section name text input 2013-03-05 16:05:28 +08:00
Iñaki Arenaza 04c258ee19 MDL-38262 auth/{ldap,cas}: Fix undefined property notification on first config
Just move the test after we've set the default configuration values if
they are not defined.

Signed-off-by: Iñaki Arenaza <iarenaza@mondragon.edu>
2013-03-03 21:19:21 +01:00
Rossiani Wijaya 5fe2acd17b MDL-34774 Lesson module: fixed report stats for 'high score' and 'low score' values where there is only one attempt with 0 score 2013-02-28 16:01:40 +08:00
319 changed files with 7438 additions and 3371 deletions
+136 -20
View File
@@ -227,7 +227,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -237,7 +237,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -277,12 +277,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -344,7 +344,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -354,7 +354,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -394,12 +394,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -454,7 +454,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -464,7 +464,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -504,12 +504,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -569,7 +569,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -579,7 +579,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -619,12 +619,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -685,7 +685,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -695,7 +695,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -735,12 +735,128 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.5" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
+10 -8
View File
@@ -244,6 +244,8 @@ class site_registration_form extends moodleform {
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
//hidden parameters
$mform->addElement('hidden', 'huburl', $huburl);
@@ -376,36 +378,36 @@ class site_registration_form extends moodleform {
if (HUB_MOODLEORGHUBURL != $huburl) {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->setDefault('courses', true);
$mform->setDefault('courses', $coursesnumber != -1);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->setDefault('users', true);
$mform->setDefault('users', $usersnumber != -1);
$mform->addElement('checkbox', 'roleassignments', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->setDefault('roleassignments', true);
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
$mform->addElement('checkbox', 'posts', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->setDefault('posts', true);
$mform->setDefault('posts', $postsnumber != -1);
$mform->addElement('checkbox', 'questions', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->setDefault('questions', true);
$mform->setDefault('questions', $questionsnumber != -1);
$mform->addElement('checkbox', 'resources', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->setDefault('resources', true);
$mform->setDefault('resources', $resourcesnumber != -1);
$mform->addElement('checkbox', 'participantnumberaverage', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->setDefault('participantnumberaverage', true);
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
$mform->addElement('checkbox', 'modulenumberaverage', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->setDefault('modulenumberaverage', true);
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
} else {
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
+25 -1
View File
@@ -62,7 +62,18 @@ $siteregistrationform = new site_registration_form('',
$fromform = $siteregistrationform->get_data();
if (!empty($fromform) and confirm_sesskey()) {
//save the settings
// Set to -1 all optional data marked as "don't send" by the admin.
// The function get_site_info() will not calculate the optional data if config is set to -1.
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
'modulenumberaverage', 'participantnumberaverage');
foreach ($inputnames as $inputname) {
if (empty($fromform->{$inputname})) {
$fromform->{$inputname} = -1;
}
}
// Save the settings.
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
@@ -113,6 +124,19 @@ if ($update and confirm_sesskey()) {
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
// Retrieve the optional info (specially course number, user number, module number average...).
$siteinfo = $registrationmanager->get_site_info($huburl);
$fromform->courses = $siteinfo['courses'];
$fromform->users = $siteinfo['users'];
$fromform->enrolments = $siteinfo['enrolments'];
$fromform->posts = $siteinfo['posts'];
$fromform->questions = $siteinfo['questions'];
$fromform->resources = $siteinfo['resources'];
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
$fromform->street = $siteinfo['street'];
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
+2 -2
View File
@@ -38,7 +38,7 @@ class core_register_renderer extends plugin_renderer_base {
public function moodleorg_registration_message() {
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'MOOCH');
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'Moodle.net');
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
@@ -92,4 +92,4 @@ class core_register_renderer extends plugin_renderer_base {
return html_writer::table($table);
}
}
}
+7 -5
View File
@@ -47,14 +47,16 @@ list($options, $unrecognized) = cli_get_params(
)
);
if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
if (file_exists(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php')) {
// Composer packages present.
require_once(__DIR__.'/../../../../vendor/autoload.php');
}
require_once(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php');
// Verify PHPUnit libs can be loaded.
if (!include_once('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
} else {
// Verify PHPUnit PEAR libs can be loaded.
if (!include('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
}
}
if ($options['run']) {
+11 -2
View File
@@ -196,11 +196,20 @@
}
list($extrasql, $params) = $ufiltering->get_sql_filter();
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
$extrasql, $params, $context);
$usercount = get_users(false);
$usersearchcount = get_users(false, '', false, null, "", '', '', '', '', '*', $extrasql, $params);
// Exclude guest user from list.
$noguestsql = '';
if (!empty($extrasql)) {
$noguestsql .= ' AND';
}
$noguestsql .= " id <> :guestid";
$params['guestid'] = $CFG->siteguest;
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
$extrasql.$noguestsql, $params, $context);
if ($extrasql !== '') {
echo $OUTPUT->heading("$usersearchcount / $usercount ".get_string('users'));
$usercount = $usersearchcount;
+3 -2
View File
@@ -32,8 +32,9 @@
//
// hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS
//
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
//
-4
View File
@@ -206,10 +206,6 @@ class auth_plugin_cas extends auth_plugin_ldap {
}
}
if (!ldap_paged_results_supported($this->config->ldap_version)) {
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
}
include($CFG->dirroot.'/auth/cas/config.html');
}
+6 -1
View File
@@ -92,6 +92,12 @@ if (!isset($config->removeuser)) {
$yesno = array( get_string('no'), get_string('yes') );
$disabled = '';
if (!ldap_paged_results_supported($config->ldap_version)) {
$disabled = ' disabled="disabled"';
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
}
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -266,7 +272,6 @@ $yesno = array( get_string('no'), get_string('yes') );
<label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
</td>
<td>
<?php $disabled = (!ldap_paged_results_supported($config->ldap_version)) ? ' disabled="disabled"' : '' ; ?>
<input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
<?php
if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }
-4
View File
@@ -1711,10 +1711,6 @@ class auth_plugin_ldap extends auth_plugin_base {
return;
}
if (!ldap_paged_results_supported($this->config->ldap_version)) {
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
}
include($CFG->dirroot.'/auth/ldap/config.html');
}
+6 -1
View File
@@ -103,6 +103,12 @@ if (!isset($config->ntlmsso_remoteuserformat)) {
$yesno = array(get_string('no'), get_string('yes'));
$disabled = '';
if (!ldap_paged_results_supported($config->ldap_version)) {
$disabled = ' disabled="disabled"';
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
}
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -156,7 +162,6 @@ $yesno = array(get_string('no'), get_string('yes'));
<label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
</td>
<td>
<?php $disabled = (!ldap_paged_results_supported($config->ldap_version)) ? ' disabled="disabled"' : '' ; ?>
<input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
<?php
if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }
+1 -1
View File
@@ -105,7 +105,7 @@ class auth_plugin_radius extends auth_plugin_base {
}
$result = $rauth->send();
if (PEAR::isError($result)) {
if ($rauth->isError($result)) {
printf("Radius send failed: %s<br/>\n", $result->getMessage());
exit;
} else if ($result === true) {
+60 -1
View File
@@ -1040,6 +1040,24 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
/** @var array holds the instances of qtype specific conversion handlers */
private $qtypehandlers = null;
/**
* Return the file manager instance used.
*
* @return moodle1_file_manager
*/
public function get_file_manager() {
return $this->fileman;
}
/**
* Returns the information about the question category context being currently parsed
*
* @return array with keys contextid, contextlevel and contextinstanceid
*/
public function get_current_category_context() {
return $this->currentcategory;
}
/**
* Registers path that are not qtype-specific
*/
@@ -1191,6 +1209,17 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
$data['generalfeedbackformat'] = FORMAT_HTML;
}
// Migrate files in questiontext.
$this->fileman->contextid = $this->currentcategory['contextid'];
$this->fileman->component = 'question';
$this->fileman->filearea = 'questiontext';
$this->fileman->itemid = $data['id'];
$data['questiontext'] = moodle1_converter::migrate_referenced_files($data['questiontext'], $this->fileman);
// Migrate files in generalfeedback.
$this->fileman->filearea = 'generalfeedback';
$data['generalfeedback'] = moodle1_converter::migrate_referenced_files($data['generalfeedback'], $this->fileman);
// replay the upgrade step 2010080901 - updating question image
if (!empty($data['image'])) {
if (textlib::substr(textlib::strtolower($data['image']), 0, 7) == 'http://') {
@@ -1736,12 +1765,41 @@ abstract class moodle1_qtype_handler extends moodle1_plugin_handler {
foreach ($answers as $elementname => $elements) {
foreach ($elements as $element) {
$answer = $this->convert_answer($element, $qtype);
// Migrate images in answertext.
if ($answer['answerformat'] == FORMAT_HTML) {
$answer['answertext'] = $this->migrate_files($answer['answertext'], 'question', 'answer', $answer['id']);
}
// Migrate images in feedback.
if ($answer['feedbackformat'] == FORMAT_HTML) {
$answer['feedback'] = $this->migrate_files($answer['feedback'], 'question', 'answerfeedback', $answer['id']);
}
$this->write_xml('answer', $answer, array('/answer/id'));
}
}
$this->xmlwriter->end_tag('answers');
}
/**
* Migrate files belonging to one qtype plugin text field.
*
* @param array $text the html fragment containing references to files
* @param string $component the component for restored files
* @param string $filearea the file area for restored files
* @param int $itemid the itemid for restored files
*
* @return string the text for this field, after files references have been processed
*/
protected function migrate_files($text, $component, $filearea, $itemid) {
$context = $this->qbankhandler->get_current_category_context();
$fileman = $this->qbankhandler->get_file_manager();
$fileman->contextid = $context['contextid'];
$fileman->component = $component;
$fileman->filearea = $filearea;
$fileman->itemid = $itemid;
$text = moodle1_converter::migrate_referenced_files($text, $fileman);
return $text;
}
/**
* Writes the grouped numerical_units structure
*
@@ -1900,7 +1958,8 @@ abstract class moodle1_qtype_handler extends moodle1_plugin_handler {
if ($qtype !== 'multichoice') {
$new['answerformat'] = FORMAT_PLAIN;
} else {
$new['answerformat'] = FORMAT_MOODLE;
$new['answertext'] = text_to_html($new['answertext'], false, false, true);
$new['answerformat'] = FORMAT_HTML;
}
if ($CFG->texteditors !== 'textarea') {
+13
View File
@@ -1820,6 +1820,10 @@ class backup_questions_structure_step extends backup_structure_step {
$qhint = new backup_nested_element('question_hint', array('id'), array(
'hint', 'hintformat', 'shownumcorrect', 'clearwrong', 'options'));
$tags = new backup_nested_element('tags');
$tag = new backup_nested_element('tag', array('id'), array('name', 'rawname'));
// Build the tree
$qcategories->add_child($qcategory);
@@ -1828,6 +1832,9 @@ class backup_questions_structure_step extends backup_structure_step {
$question->add_child($qhints);
$qhints->add_child($qhint);
$question->add_child($tags);
$tags->add_child($tag);
// Define the sources
$qcategory->set_source_sql("
@@ -1847,6 +1854,12 @@ class backup_questions_structure_step extends backup_structure_step {
ORDER BY id',
array('questionid' => backup::VAR_PARENTID));
$tag->set_source_sql("SELECT t.id, t.name, t.rawname
FROM {tag} t
JOIN {tag_instance} ti ON ti.tagid = t.id
WHERE ti.itemid = ?
AND ti.itemtype = 'question'", array(backup::VAR_PARENTID));
// don't need to annotate ids nor files
// (already done by {@link backup_annotate_all_question_files}
@@ -71,6 +71,8 @@ class restore_course_task extends restore_task {
$this->add_step(new restore_course_structure_step('course_info', 'course.xml'));
}
$this->add_step(new restore_course_legacy_files_step('legacy_files'));
// Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
+61 -4
View File
@@ -150,6 +150,11 @@ class restore_gradebook_structure_step extends restore_structure_step {
if ($data->itemtype=='manual') {
// manual grade items store category id in categoryid
$data->categoryid = $this->get_mappingid('grade_category', $data->categoryid, NULL);
// if mapping failed put in course's grade category
if (NULL == $data->categoryid) {
$coursecat = grade_category::fetch_course_category($this->get_courseid());
$data->categoryid = $coursecat->id;
}
} else if ($data->itemtype=='course') {
// course grade item stores their category id in iteminstance
$coursecat = grade_category::fetch_course_category($this->get_courseid());
@@ -1274,7 +1279,7 @@ class restore_section_structure_step extends restore_structure_step {
// Otherwise, when you restore to an existing course, it will mess up
// existing section availability entries.
if (!$this->get_mappingid('course_sections_availability', $data->id, false)) {
return;
continue;
}
// Update source cmid / grade id to new value.
@@ -1287,7 +1292,12 @@ class restore_section_structure_step extends restore_structure_step {
$data->gradeitemid = null;
}
$DB->update_record('course_sections_availability', $data);
// Delete the record if the condition wasn't found, otherwise update it.
if ($data->sourcecmid === null && $data->gradeitemid === null) {
$DB->delete_records('course_sections_availability', array('id' => $data->id));
} else {
$DB->update_record('course_sections_availability', $data);
}
}
}
}
@@ -1453,7 +1463,6 @@ class restore_course_structure_step extends restore_structure_step {
// Add course related files, without itemid to match
$this->add_related_files('course', 'summary', null);
$this->add_related_files('course', 'legacy', null);
// Deal with legacy allowed modules.
if ($this->legacyrestrictmodules) {
@@ -1480,6 +1489,29 @@ class restore_course_structure_step extends restore_structure_step {
}
}
/**
* Execution step that will migrate legacy files if present.
*/
class restore_course_legacy_files_step extends restore_execution_step {
public function define_execution() {
global $DB;
// Do a check for legacy files and skip if there are none.
$sql = 'SELECT count(*)
FROM {backup_files_temp}
WHERE backupid = ?
AND contextid = ?
AND component = ?
AND filearea = ?';
$params = array($this->get_restoreid(), $this->task->get_old_contextid(), 'course', 'legacy');
if ($DB->count_records_sql($sql, $params)) {
$DB->set_field('course', 'legacyfiles', 2, array('id' => $this->get_courseid()));
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'course',
'legacy', $this->task->get_old_contextid(), $this->task->get_userid());
}
}
}
/*
* Structure step that will read the roles.xml file (at course/activity/block levels)
@@ -3008,13 +3040,15 @@ class restore_create_categories_and_questions extends restore_structure_step {
$hint = new restore_path_element('question_hint',
'/question_categories/question_category/questions/question/question_hints/question_hint');
$tag = new restore_path_element('tag','/question_categories/question_category/questions/question/tags/tag');
// Apply for 'qtype' plugins optional paths at question level
$this->add_plugin_structure('qtype', $question);
// Apply for 'local' plugins optional paths at question level
$this->add_plugin_structure('local', $question);
return array($category, $question, $hint);
return array($category, $question, $hint, $tag);
}
protected function process_question_category($data) {
@@ -3161,6 +3195,29 @@ class restore_create_categories_and_questions extends restore_structure_step {
$this->set_mapping('question_hint', $oldid, $newitemid);
}
protected function process_tag($data) {
global $CFG, $DB;
$data = (object)$data;
$newquestion = $this->get_new_parentid('question');
if (!empty($CFG->usetags)) { // if enabled in server
// TODO: This is highly inneficient. Each time we add one tag
// we fetch all the existing because tag_set() deletes them
// so everything must be reinserted on each call
$tags = array();
$existingtags = tag_get_tags('question', $newquestion);
// Re-add all the existitng tags
foreach ($existingtags as $existingtag) {
$tags[] = $existingtag->rawname;
}
// Add the one being restored
$tags[] = $data->rawname;
// Send all the tags back to the question
tag_set('question', $newquestion, $tags);
}
}
protected function after_execute() {
global $DB;
+7 -1
View File
@@ -821,7 +821,7 @@ abstract class restore_dbops {
* @return array of result object
*/
public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) {
global $DB;
global $DB, $CFG;
$results = array();
@@ -916,6 +916,12 @@ abstract class restore_dbops {
// create the file in the filepool if it does not exist yet
if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
// If no license found, use default.
if ($file->license == null){
$file->license = $CFG->sitedefaultlicense;
}
$file_record = array(
'contextid' => $newcontextid,
'component' => $component,
+24 -1
View File
@@ -521,6 +521,15 @@ class core_backup_renderer extends plugin_renderer_base {
$url = $component->get_url();
$output = html_writer::start_tag('div', array('class' => 'restore-course-search'));
$countstr = '';
if ($component->has_more_results()) {
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
} else {
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
}
$output .= html_writer::tag('div', $countstr, array('class'=>'rcs-totalresults'));
$output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
$table = new html_table();
@@ -590,8 +599,14 @@ class core_backup_renderer extends plugin_renderer_base {
return $output;
}
$output .= html_writer::tag('div', get_string('totalcoursesearchresults', 'backup', $component->get_count()), array('class'=>'ics-totalresults'));
$countstr = '';
if ($component->has_more_results()) {
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
} else {
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
}
$output .= html_writer::tag('div', $countstr, array('class'=>'ics-totalresults'));
$output .= html_writer::start_tag('div', array('class' => 'ics-results'));
$table = new html_table();
@@ -610,6 +625,14 @@ class core_backup_renderer extends plugin_renderer_base {
);
$table->data[] = $row;
}
if ($component->has_more_results()) {
$cell = new html_table_cell(get_string('moreresults', 'backup'));
$cell->colspan = 3;
$cell->attributes['class'] = 'notifyproblem';
$row = new html_table_row(array($cell));
$row->attributes['class'] = 'rcs-course';
$table->data[] = $row;
}
$output .= html_writer::table($table);
$output .= html_writer::end_tag('div');
+16 -5
View File
@@ -65,6 +65,11 @@ abstract class restore_search_base implements renderable {
* @var array
*/
private $requiredcapabilities = array();
/**
* Indicates if we have more than maxresults found.
* @var boolean
*/
private $hasmoreresults = false;
/**
* Constructor
@@ -177,7 +182,7 @@ abstract class restore_search_base implements renderable {
foreach ($this->requiredcapabilities as $cap) {
$requiredcaps[] = $cap['capability'];
}
// Iterate while we have records and haven't reached MAXRESULTS
// Iterate while we have records and haven't reached $this->maxresults.
while ($totalcourses > $offs and $this->totalcount < self::$MAXRESULTS) {
$resultset = $DB->get_records_sql($sql, $params, $offs, $blocksz);
foreach ($resultset as $result) {
@@ -189,11 +194,14 @@ abstract class restore_search_base implements renderable {
continue;
}
}
$this->results[$result->id] = $result;
$this->totalcount++;
if ($this->totalcount >= self::$MAXRESULTS) {
// Check if we are over the limit.
if ($this->totalcount+1 > self::$MAXRESULTS) {
$this->hasmoreresults = true;
break;
}
// If not, then continue.
$this->totalcount++;
$this->results[$result->id] = $result;
}
$offs += $blocksz;
}
@@ -202,7 +210,10 @@ abstract class restore_search_base implements renderable {
}
final public function has_more_results() {
return $this->get_count() >= self::$MAXRESULTS;
if ($this->results === null) {
$this->search();
}
return $this->hasmoreresults;
}
/**
+2 -2
View File
@@ -216,9 +216,9 @@ if (empty($completions)) {
echo '(<i>';
if ($agg == COMPLETION_AGGREGATION_ALL) {
echo strtolower(get_string('aggregateall', 'completion'));
echo strtolower(get_string('all', 'completion'));
} else {
echo strtolower(get_string('aggregateany', 'completion'));
echo strtolower(get_string('any', 'completion'));
}
echo '</i> '.strtolower(get_string('required')).')';
+2 -1
View File
@@ -104,7 +104,8 @@ class block_course_overview_renderer extends plugin_renderer_base {
$html .= html_writer::end_tag('div');
}
$attributes = array('title' => s($course->fullname));
// No need to pass title through s() here as it will be done automatically by html_writer.
$attributes = array('title' => $course->fullname);
if ($course->id > 0) {
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$coursefullname = format_string($course->fullname, true, $course->id);
@@ -28,7 +28,7 @@ $string['askaddentry'] = 'When users can add entries to the glossary, show a lin
$string['askinvisible'] = 'When users cannot edit or view the glossary, show this text (without link)';
$string['askviewglossary'] = 'When users can view the glossary but not add entries, show a link with this text';
$string['glossary_random:addinstance'] = 'Add a new random glossary entry block';
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to the My Moodle page';
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to My home';
$string['intro'] = 'Make sure you have at least one glossary with at least one entry added to this course. Then you can adjust the following settings';
$string['invisible'] = '(to be continued)';
$string['lastmodified'] = 'Last modified entry';
+1 -1
View File
@@ -27,6 +27,6 @@ $string['configtitle'] = 'Block title';
$string['configtitleblankhides'] = 'Block title (no title if blank)';
$string['leaveblanktohide'] = 'leave blank to hide the title';
$string['mentees:addinstance'] = 'Add a new mentees block';
$string['mentees:myaddinstance'] = 'Add a new mentees block to the My Moodle page';
$string['mentees:myaddinstance'] = 'Add a new mentees block to My home';
$string['newmenteesblock'] = '(new Mentees block)';
$string['pluginname'] = 'Mentees';
+7 -2
View File
@@ -348,10 +348,15 @@ BRANCH.prototype = {
}
if (!link) {
var branchspan = Y.Node.create('<span></span>');
if (branchicon) {
branchp.appendChild(branchicon);
branchspan.appendChild(branchicon);
}
branchp.append(this.get('name'));
branchspan.append(this.get('name'));
if (this.get('hidden')) {
branchspan.addClass('dimmed_text');
}
branchp.appendChild(branchspan);
} else {
var branchlink = Y.Node.create('<a title="'+this.get('title')+'" href="'+link+'"></a>');
if (branchicon) {
@@ -24,5 +24,5 @@
*/
$string['news_items:addinstance'] = 'Add a new latest news block';
$string['news_items:myaddinstance'] = 'Add a new latest news block to the My Moodle page';
$string['news_items:myaddinstance'] = 'Add a new latest news block to My home';
$string['pluginname'] = 'Latest news';
@@ -25,7 +25,7 @@
$string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.';
$string['online_users:addinstance'] = 'Add a new online users block';
$string['online_users:myaddinstance'] = 'Add a new online users block to the My Moodle page';
$string['online_users:myaddinstance'] = 'Add a new online users block to My home';
$string['online_users:viewlist'] = 'View list of online users';
$string['periodnminutes'] = 'last {$a} minutes';
$string['pluginname'] = 'Online users';
+1 -7
View File
@@ -183,13 +183,7 @@ if (!empty($userid)) {
print_error('donothaveblog', 'blog');
}
} else {
$personalcontext = context_user::instance($userid);
if (!has_capability('moodle/blog:view', $sitecontext) && !has_capability('moodle/user:readuserblogs', $personalcontext)) {
print_error('cannotviewuserblog', 'blog');
}
if (!blog_user_can_view_user_entry($userid)) {
if (!has_capability('moodle/blog:view', $sitecontext) || !blog_user_can_view_user_entry($userid)) {
print_error('cannotviewcourseblog', 'blog');
}
+39 -16
View File
@@ -65,35 +65,36 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
global $CFG, $USER, $DB;
if (empty($CFG->enableblogs)) {
return false; // blog system disabled
return false; // Blog system disabled.
}
if (isloggedin() && $USER->id == $targetuserid) {
return true; // can view own entries in any case
return true; // Can view own entries in any case.
}
$sitecontext = context_system::instance();
if (has_capability('moodle/blog:manageentries', $sitecontext)) {
return true; // can manage all entries
return true; // Can manage all entries.
}
// coming for 1 entry, make sure it's not a draft
// If blog is in draft state, then make sure user have proper capability.
if ($blogentry && $blogentry->publishstate == 'draft' && !has_capability('moodle/blog:viewdrafts', $sitecontext)) {
return false; // can not view draft of others
return false; // Can not view draft of others.
}
// coming for 0 entry, make sure user is logged in, if not a public blog
// If blog entry is not public, make sure user is logged in.
if ($blogentry && $blogentry->publishstate != 'public' && !isloggedin()) {
return false;
}
// If blogentry is not passed or all above checks pass, then check capability based on system config.
switch ($CFG->bloglevel) {
case BLOG_GLOBAL_LEVEL:
return true;
break;
case BLOG_SITE_LEVEL:
if (isloggedin()) { // not logged in viewers forbidden
if (isloggedin()) { // Not logged in viewers forbidden.
return true;
}
return false;
@@ -101,6 +102,7 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
case BLOG_USER_LEVEL:
default:
// If user is viewing other user blog, then user should have user:readuserblogs capability.
$personalcontext = context_user::instance($targetuserid);
return has_capability('moodle/user:readuserblogs', $personalcontext);
break;
@@ -601,7 +603,7 @@ function blog_get_options_for_module($module, $user=null) {
}
if (array_key_exists($key, $moduleoptions)) {
// Serve from the cache so we don't have to regenerate
return $moduleoptions[$module->id];
return $moduleoptions[$key];
}
$canparticipate = (is_enrolled($modcontext) or is_viewing($modcontext));
@@ -1000,6 +1002,8 @@ function blog_get_associated_count($courseid, $cmid=null) {
* may have switch to turn on/off comments option, this callback will
* affect UI display, not like pluginname_comment_validate only throw
* exceptions.
* blog_comment_validate will be called before viewing/adding/deleting
* comment, so don't repeat checks.
* Capability check has been done in comment->check_permissions(), we
* don't need to do it again here.
*
@@ -1016,7 +1020,17 @@ function blog_get_associated_count($courseid, $cmid=null) {
* @return array
*/
function blog_comment_permissions($comment_param) {
return array('post'=>true, 'view'=>true);
global $DB;
// If blog is public and current user is guest, then don't let him post comments.
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), 'publishstate', MUST_EXIST);
if ($blogentry->publishstate != 'public') {
if (!isloggedin() || isguestuser()) {
return array('post' => false, 'view' => true);
}
}
return array('post' => true, 'view' => true);
}
/**
@@ -1035,16 +1049,21 @@ function blog_comment_permissions($comment_param) {
* @return boolean
*/
function blog_comment_validate($comment_param) {
global $DB;
// validate comment itemid
if (!$entry = $DB->get_record('post', array('id'=>$comment_param->itemid))) {
throw new comment_exception('invalidcommentitemid');
global $CFG, $DB, $USER;
// Check if blogs are enabled user can comment.
if (empty($CFG->enableblogs) || empty($CFG->blogusecomments)) {
throw new comment_exception('nopermissiontocomment');
}
// validate comment area
// Validate comment area.
if ($comment_param->commentarea != 'format_blog') {
throw new comment_exception('invalidcommentarea');
}
// validation for comment deletion
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), '*', MUST_EXIST);
// Validation for comment deletion.
if (!empty($comment_param->commentid)) {
if ($record = $DB->get_record('comments', array('id'=>$comment_param->commentid))) {
if ($record->commentarea != 'format_blog') {
@@ -1060,7 +1079,11 @@ function blog_comment_validate($comment_param) {
throw new comment_exception('invalidcommentid');
}
}
return true;
// Validate if user has blog view permission.
$sitecontext = context_system::instance();
return has_capability('moodle/blog:view', $sitecontext) &&
blog_user_can_view_user_entry($blogentry->userid, $blogentry);
}
/**
+3 -1
View File
@@ -18,6 +18,7 @@ A definition:
'requiremultipleidentifiers' => false, // Optional
'requirelockingread' => false, // Optional
'requirelockingwrite' => false, // Optional
'requiresearchable' => false, // Optional
'maxsize' => null, // Optional
'overrideclass' => null, // Optional
'overrideclassfile' => null, // Optional
@@ -135,6 +136,7 @@ The following optional settings can also be defined:
* requiremultipleidentifiers - If set to true then only stores that support multiple identifiers will be used.
* requirelockingread - If set to true a lock will be acquired for reading. Don't use this setting unless you have a REALLY good reason to.
* requirelockingwrite - If set to true a lock will be acquired before writing to the cache. Avoid this unless necessary.
* requiresearchable - If set to true only stores that support key searching will be used for this definition. Its not recommended to use this unless absolutely unavoidable.
* maxsize - This gives a cache an indication about the maximum items it should store. Cache stores don't have to use this, it is up to them to decide if its required.
* overrideclass - If provided this class will be used for the loader. It must extend one of the core loader classes (based upon mode).
* overrideclassfile - Included if required when using the overrideclass param.
@@ -225,4 +227,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.
+1 -1
View File
@@ -100,7 +100,7 @@ if (!empty($action) && confirm_sesskey()) {
if (!array_key_exists($store, $stores)) {
$notifysuccess = false;
$notification = get_string('invalidstore');
$notification = get_string('invalidstore', 'cache');
} else if ($stores[$store]['mappings'] > 0) {
$notifysuccess = false;
$notification = get_string('deletestorehasmappings', 'cache');
+26 -1
View File
@@ -183,6 +183,13 @@ class cache_definition {
*/
protected $requirelockingwrite = false;
/**
* Gets set to true if this definition requires searchable stores.
* @since 2.4.4
* @var bool
*/
protected $requiresearchable = false;
/**
* Sets the maximum number of items that can exist in the cache.
* Please note this isn't a hard limit, and doesn't need to be enforced by the caches. They can choose to do so optionally.
@@ -307,6 +314,7 @@ class cache_definition {
$requiremultipleidentifiers = false;
$requirelockingread = false;
$requirelockingwrite = false;
$requiresearchable = ($mode === cache_store::MODE_SESSION) ? true : false;
$maxsize = null;
$overrideclass = null;
$overrideclassfile = null;
@@ -342,6 +350,10 @@ class cache_definition {
}
$requirelocking = $requirelockingwrite || $requirelockingread;
if (array_key_exists('requiresearchable', $definition)) {
$requiresearchable = (bool)$definition['requiresearchable'];
}
if (array_key_exists('maxsize', $definition)) {
$maxsize = (int)$definition['maxsize'];
}
@@ -433,6 +445,7 @@ class cache_definition {
$cachedefinition->requirelocking = $requirelocking;
$cachedefinition->requirelockingread = $requirelockingread;
$cachedefinition->requirelockingwrite = $requirelockingwrite;
$cachedefinition->requiresearchable = $requiresearchable;
$cachedefinition->maxsize = $maxsize;
$cachedefinition->overrideclass = $overrideclass;
$cachedefinition->overrideclassfile = $overrideclassfile;
@@ -633,6 +646,15 @@ class cache_definition {
return $this->requirelockingwrite;
}
/**
* Returns true if this definition requires a searchable cache.
* @since 2.4.4
* @return bool
*/
public function require_searchable() {
return $this->requiresearchable;
}
/**
* Returns true if this definition has an associated data source.
* @return bool
@@ -686,6 +708,9 @@ class cache_definition {
if ($this->require_multiple_identifiers()) {
$requires += cache_store::SUPPORTS_MULTIPLE_IDENTIFIERS;
}
if ($this->require_searchable()) {
$requires += cache_store::IS_SEARCHABLE;
}
return $requires;
}
@@ -694,7 +719,7 @@ class cache_definition {
* @return bool
*/
public function should_be_persistent() {
return $this->persistent;
return $this->persistent || $this->mode === cache_store::MODE_SESSION;
}
/**
+14 -7
View File
@@ -103,7 +103,7 @@ class cache_factory {
* An array of lock plugins.
* @var array
*/
protected $lockplugins = null;
protected $lockplugins = array();
/**
* The current state of the cache API.
@@ -155,7 +155,7 @@ class cache_factory {
$factory->stores = array();
$factory->configs = array();
$factory->definitions = array();
$factory->lockplugins = null; // MUST be null in order to force its regeneration.
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
// Reset the state to uninitialised.
$factory->state = self::STATE_UNINITIALISED;
}
@@ -207,9 +207,7 @@ class cache_factory {
if (array_key_exists($key, $this->cachesfromparams)) {
return $this->cachesfromparams[$key];
}
// Get the class. Note this is a late static binding so we need to use get_called_class.
$definition = cache_definition::load_adhoc($mode, $component, $area, $options);
$config = $this->create_config_instance();
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
if ($definition->should_be_persistent()) {
@@ -406,7 +404,7 @@ class cache_factory {
$definition = $instance->get_definition_by_id($id);
if (!$definition) {
throw new coding_exception('The requested cache definition does not exist.'. $id, $id);
} else {
} else if (!$this->is_disabled()) {
debugging('Cache definitions reparsed causing cache reset in order to locate definition.
You should bump the version number to ensure definitions are reprocessed.', DEBUG_DEVELOPER);
}
@@ -442,6 +440,7 @@ class cache_factory {
* @return cache_lock_interface
*/
public function create_lock_instance(array $config) {
global $CFG;
if (!array_key_exists('name', $config) || !array_key_exists('type', $config)) {
throw new coding_exception('Invalid cache lock instance provided');
}
@@ -450,8 +449,16 @@ class cache_factory {
unset($config['name']);
unset($config['type']);
if ($this->lockplugins === null) {
$this->lockplugins = get_plugin_list_with_class('cachelock', '', 'lib.php');
if (!isset($this->lockplugins[$type])) {
$pluginname = substr($type, 10);
$file = $CFG->dirroot."/cache/locks/{$pluginname}/lib.php";
if (file_exists($file) && is_readable($file)) {
require_once($file);
}
if (!class_exists($type)) {
throw new coding_exception('Invalid lock plugin requested.');
}
$this->lockplugins[$type] = $type;
}
if (!array_key_exists($type, $this->lockplugins)) {
throw new coding_exception('Invalid cache lock type.');
+88 -9
View File
@@ -192,8 +192,7 @@ class cache_helper {
if (in_array($pluginname, $ignored)) {
continue;
}
$pluginname = clean_param($pluginname, PARAM_PLUGIN);
if (empty($pluginname)) {
if (!is_valid_plugin_name($pluginname)) {
// Better ignore plugins with problematic names here.
continue;
}
@@ -244,10 +243,9 @@ class cache_helper {
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 session cache in which case we need to set something to the "Event invalidation" definition.
// No need to deal with request caches, we don't want to change data half way through a request.
if ($definition->get_mode() === cache_store::MODE_APPLICATION) {
$cache = $factory->create_cache($definition);
// 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);
}
@@ -511,6 +509,7 @@ class cache_helper {
* Update the site identifier stored by the cache API.
*
* @param string $siteidentifier
* @return string The new site identifier.
*/
public static function update_site_identifier($siteidentifier) {
global $CFG;
@@ -519,9 +518,10 @@ class cache_helper {
$factory = cache_factory::instance();
$factory->updating_started();
$config = $factory->create_config_instance(true);
$config->update_site_identifier($siteidentifier);
$siteidentifier = $config->update_site_identifier($siteidentifier);
$factory->updating_finished();
cache_factory::reset();
return $siteidentifier;
}
/**
@@ -530,11 +530,30 @@ class cache_helper {
* @return string
*/
public static function get_site_identifier() {
if (is_null(self::$siteidentifier)) {
$factory = cache_factory::instance();
global $CFG;
if (!is_null(self::$siteidentifier)) {
return self::$siteidentifier;
}
// If site identifier hasn't been collected yet attempt to get it from the cache config.
$factory = cache_factory::instance();
// If the factory is initialising then we don't want to try to get it from the config or we risk
// causing the cache to enter an infinite initialisation loop.
if (!$factory->is_initialising()) {
$config = $factory->create_config_instance();
self::$siteidentifier = $config->get_site_identifier();
}
if (is_null(self::$siteidentifier)) {
// If the site identifier is still null then config isn't aware of it yet.
// We'll see if the CFG is loaded, and if not we will just use unknown.
// It's very important here that we don't use get_config. We don't want an endless cache loop!
if (!empty($CFG->siteidentifier)) {
self::$siteidentifier = self::update_site_identifier($CFG->siteidentifier);
} else {
// It's not being recorded in MUC's config and the config data hasn't been loaded yet.
// Likely we are initialising.
return 'unknown';
}
}
return self::$siteidentifier;
}
@@ -547,4 +566,64 @@ class cache_helper {
global $CFG;
return (string)$CFG->version;
}
/**
* Runs cron routines for MUC.
*/
public static function cron() {
self::clean_old_session_data(true);
}
/**
* Cleans old session data from cache stores used for session based definitions.
*
* @param bool $output If set to true output will be given.
*/
public static function clean_old_session_data($output = false) {
global $CFG;
if ($output) {
mtrace('Cleaning up stale session data from cache stores.');
}
$factory = cache_factory::instance();
$config = $factory->create_config_instance();
$definitions = $config->get_definitions();
$purgetime = time() - $CFG->sessiontimeout;
foreach ($definitions as $definitionarray) {
// We are only interested in session caches.
if (!($definitionarray['mode'] & cache_store::MODE_SESSION)) {
continue;
}
$definition = $factory->create_definition($definitionarray['component'], $definitionarray['area']);
$stores = $config->get_stores_for_definition($definition);
// Turn them into store instances.
$stores = self::initialise_cachestore_instances($stores, $definition);
// Initialise all of the stores used for that definition.
foreach ($stores as $store) {
// If the store doesn't support searching we can skip it.
if (!($store instanceof cache_is_searchable)) {
debugging('Cache stores used for session definitions should ideally be searchable.', DEBUG_DEVELOPER);
continue;
}
// Get all of the keys.
$keys = $store->find_by_prefix(cache_session::KEY_PREFIX);
$todelete = array();
foreach ($store->get_many($keys) as $key => $value) {
if (strpos($key, cache_session::KEY_PREFIX) !== 0 || !is_array($value) || !isset($value['lastaccess'])) {
continue;
}
if ((int)$value['lastaccess'] < $purgetime || true) {
$todelete[] = $key;
}
}
if (count($todelete)) {
$outcome = (int)$store->delete_many($todelete);
if ($output) {
$strdef = s($definition->get_id());
$strstore = s($store->my_name());
mtrace("- Removed {$outcome} old {$strdef} sessions from the '{$strstore}' cache store.");
}
}
}
}
}
}
+24
View File
@@ -338,6 +338,30 @@ interface cache_is_key_aware {
public function has_all(array $keys);
}
/**
* Cache store feature: keys are searchable.
*
* Cache stores can choose to implement this interface.
* In order for a store to be usable as a session cache it must implement this interface.
*
* @since 2.4.4
*/
interface cache_is_searchable {
/**
* Finds all of the keys being used by the cache store.
*
* @return array.
*/
public function find_all();
/**
* Finds all of the keys whose keys start with the given prefix.
*
* @param string $prefix
*/
public function find_by_prefix($prefix);
}
/**
* Cache store feature: configurable.
*
+538 -5
View File
@@ -141,7 +141,7 @@ class cache implements cache_loader {
* and having it here helps speed up processing.
* @var strubg
*/
private $storetype = 'unknown';
protected $storetype = 'unknown';
/**
* Gets set to true if we want to collect performance information about the cache API.
@@ -365,6 +365,7 @@ class cache implements cache_loader {
*/
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
$keysparsed = array();
$parsedkeys = array();
$resultpersist = array();
$resultstore = array();
@@ -374,6 +375,7 @@ class cache implements cache_loader {
$isusingpersist = $this->is_using_persist_cache();
foreach ($keys as $key) {
$pkey = $this->parse_key($key);
$keysparsed[$key] = $pkey;
$parsedkeys[$pkey] = $key;
$keystofind[$pkey] = $key;
if ($isusingpersist) {
@@ -426,9 +428,11 @@ class cache implements cache_loader {
$resultmissing = $this->datasource->load_many_for_cache($missingkeys);
}
foreach ($resultmissing as $key => $value) {
$result[$key] = $value;
$pkey = ($usingloader) ? $key : $keysparsed[$key];
$realkey = ($usingloader) ? $parsedkeys[$key] : $key;
$result[$pkey] = $value;
if ($value !== false) {
$this->set($parsedkeys[$key], $value);
$this->set($realkey, $value);
}
}
unset($resultmissing);
@@ -748,7 +752,7 @@ class cache implements cache_loader {
public function delete($key, $recurse = true) {
$parsedkey = $this->parse_key($key);
$this->delete_from_persist_cache($parsedkey);
if ($recurse && !empty($this->loader)) {
if ($recurse && $this->loader !== false) {
// Delete from the bottom of the stack first.
$this->loader->delete($key, $recurse);
}
@@ -770,7 +774,7 @@ class cache implements cache_loader {
$this->delete_from_persist_cache($parsedkey);
}
}
if ($recurse && !empty($this->loader)) {
if ($recurse && $this->loader !== false) {
// Delete from the bottom of the stack first.
$this->loader->delete_many($keys, $recurse);
}
@@ -848,6 +852,26 @@ class cache implements cache_loader {
return $this->store;
}
/**
* Returns the loader associated with this instance.
*
* @since 2.4.4
* @return cache_loader|false
*/
protected function get_loader() {
return $this->loader;
}
/**
* Returns the data source associated with this cache.
*
* @since 2.4.4
* @return cache_data_source|false
*/
protected function get_datasource() {
return $this->datasource;
}
/**
* Returns true if the store supports key awareness.
*
@@ -1396,6 +1420,18 @@ 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.
* 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
* check sessions for a last access time.
* 3. Session stores are required to support key searching and must
* implement cache_is_searchable. This ensures stores used for the cache can be
* targetted for garbage collection of session data.
*
* This cache class should never be interacted with directly. Instead you should always use the cache::make methods.
* It is technically possible to call those methods through this class however there is no guarantee that you will get an
* instance of this class back again.
@@ -1410,6 +1446,35 @@ class cache_application extends cache implements cache_loader_with_locking {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cache_session extends cache {
/**
* The user the session has been established for.
* @var int
*/
protected static $loadeduserid = null;
/**
* The userid this cache is currently using.
* @var int
*/
protected $currentuserid = null;
/**
* The session id we are currently using.
* @var array
*/
protected $sessionid = null;
/**
* The session data for the above session id.
* @var array
*/
protected $session = null;
/**
* Constant used to prefix keys.
*/
const KEY_PREFIX = 'sess_';
/**
* Override the cache::construct method.
*
@@ -1426,6 +1491,8 @@ class cache_session extends cache {
* @return void
*/
public function __construct(cache_definition $definition, cache_store $store, $loader = null) {
// First up copy the loadeduserid to the current user id.
$this->currentuserid = self::$loadeduserid;
parent::__construct($definition, $store, $loader);
if ($definition->has_invalidation_events()) {
$lastinvalidation = $this->get('lastsessioninvalidation');
@@ -1474,6 +1541,472 @@ class cache_session extends cache {
$this->set('lastsessioninvalidation', cache::now());
}
}
/**
* Parses the key turning it into a string (or array is required) suitable to be passed to the cache store.
*
* This function is called for every operation that uses keys. For this reason we use this function to also check
* that the current user is the same as the user who last used this cache.
*
* On top of that if prepends the string 'sess_' to the start of all keys. The _ ensures things are easily identifiable.
*
* @param string|int $key As passed to get|set|delete etc.
* @return string|array String unless the store supports multi-identifiers in which case an array if returned.
*/
protected function parse_key($key) {
if ($key === 'lastaccess') {
$key = '__lastaccess__';
}
return 'sess_'.parent::parse_key($key);
}
/**
* Check that this cache instance is tracking the current user.
*/
protected function check_tracked_user() {
if (isset($_SESSION['USER']->id)) {
// Get the id of the current user.
$new = $_SESSION['USER']->id;
} else {
// No user set up yet.
$new = 0;
}
if ($new !== self::$loadeduserid) {
// The current user doesn't match the tracked userid for this request.
if (!is_null(self::$loadeduserid)) {
// Purge the data we have for the old user.
// This way we don't bloat the session.
$this->purge();
// Update the session id just in case!
$this->sessionid = session_id();
}
self::$loadeduserid = $new;
$this->currentuserid = $new;
} else if ($new !== $this->currentuserid) {
// The current user matches the loaded user but not the user last used by this cache.
$this->purge();
$this->currentuserid = $new;
// Update the session id just in case!
$this->sessionid = session_id();
}
}
/**
* Gets the session data.
*
* @param bool $force If true the session data will be loaded from the store again.
* @return array An array of session data.
*/
protected function get_session_data($force = false) {
if ($this->sessionid === null) {
$this->sessionid = session_id();
}
if (is_array($this->session) && !$force) {
return $this->session;
}
$session = parent::get($this->sessionid);
if ($session === false) {
$session = array();
}
// We have to write here to ensure that the lastaccess time is recorded.
// And also in order to ensure the session entry exists as when we save it on __destruct
// $CFG is likely to have already been destroyed.
$this->save_session($session);
return $this->session;
}
/**
* Saves the session data.
*
* This function also updates the last access time.
*
* @param array $session
* @return bool
*/
protected function save_session(array $session) {
$session['lastaccess'] = time();
$this->session = $session;
return parent::set($this->sessionid, $this->session);
}
/**
* Retrieves the value for the given key from the cache.
*
* @param string|int $key The key for the data being requested.
* It can be any structure although using a scalar string or int is recommended in the interests of performance.
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
* @param int $strictness One of IGNORE_MISSING | MUST_EXIST
* @return mixed|false The data from the cache or false if the key did not exist within the cache.
* @throws moodle_exception
*/
public function get($key, $strictness = IGNORE_MISSING) {
// Check the tracked user.
$this->check_tracked_user();
// 2. Parse the key.
$parsedkey = $this->parse_key($key);
// 3. Get it from the store.
$result = false;
$session = $this->get_session_data();
if (array_key_exists($parsedkey, $session)) {
$result = $session[$parsedkey];
if ($result instanceof cache_ttl_wrapper) {
if ($result->has_expired()) {
$this->get_store()->delete($parsedkey);
$result = false;
} else {
$result = $result->data;
}
}
if ($result instanceof cache_cached_object) {
$result = $result->restore_object();
}
}
// 4. Load if from the loader/datasource if we don't already have it.
$setaftervalidation = false;
if ($result === false) {
if ($this->perfdebug) {
cache_helper::record_cache_miss('**static session**', $this->get_definition()->get_id());
}
if ($this->get_loader() !== false) {
// We must pass the original (unparsed) key to the next loader in the chain.
// The next loader will parse the key as it sees fit. It may be parsed differently
// depending upon the capabilities of the store associated with the loader.
$result = $this->get_loader()->get($key);
} else if ($this->get_datasource() !== false) {
$result = $this->get_datasource()->load_for_cache($key);
}
$setaftervalidation = ($result !== false);
} else if ($this->perfdebug) {
cache_helper::record_cache_hit('**static session**', $this->get_definition()->get_id());
}
// 5. Validate strictness.
if ($strictness === MUST_EXIST && $result === false) {
throw new moodle_exception('Requested key did not exist in any cache stores and could not be loaded.');
}
// 6. Set it to the store if we got it from the loader/datasource.
if ($setaftervalidation) {
$this->set($key, $result);
}
// 7. Make sure we don't pass back anything that could be a reference.
// We don't want people modifying the data in the cache.
if (!is_scalar($result)) {
// If data is an object it will be a reference.
// If data is an array if may contain references.
// We want to break references so that the cache cannot be modified outside of itself.
// Call the function to unreference it (in the best way possible).
$result = $this->unref($result);
}
return $result;
}
/**
* Sends a key => value pair to the cache.
*
* <code>
* // This code will add four entries to the cache, one for each url.
* $cache->set('main', 'http://moodle.org');
* $cache->set('docs', 'http://docs.moodle.org');
* $cache->set('tracker', 'http://tracker.moodle.org');
* $cache->set('qa', 'http://qa.moodle.net');
* </code>
*
* @param string|int $key The key for the data being requested.
* It can be any structure although using a scalar string or int is recommended in the interests of performance.
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
* @param mixed $data The data to set against the key.
* @return bool True on success, false otherwise.
*/
public function set($key, $data) {
$this->check_tracked_user();
if ($this->perfdebug) {
cache_helper::record_cache_set('**static session**', $this->get_definition()->get_id());
}
if (is_object($data) && $data instanceof cacheable_object) {
$data = new cache_cached_object($data);
} else if (!is_scalar($data)) {
// If data is an object it will be a reference.
// If data is an array if may contain references.
// We want to break references so that the cache cannot be modified outside of itself.
// Call the function to unreference it (in the best way possible).
$data = $this->unref($data);
}
// We dont' support native TTL here as we consolidate data for sessions.
if ($this->has_a_ttl()) {
$data = new cache_ttl_wrapper($data, $this->get_definition()->get_ttl());
}
$session = $this->get_session_data();
$session[$this->parse_key($key)] = $data;
return $this->save_session($session);
}
/**
* Delete the given key from the cache.
*
* @param string|int $key The key to delete.
* @param bool $recurse When set to true the key will also be deleted from all stacked cache loaders and their stores.
* This happens by default and ensure that all the caches are consistent. It is NOT recommended to change this.
* @return bool True of success, false otherwise.
*/
public function delete($key, $recurse = true) {
$this->check_tracked_user();
$parsedkey = $this->parse_key($key);
if ($recurse && $this->get_loader() !== false) {
// Delete from the bottom of the stack first.
$this->get_loader()->delete($key, $recurse);
}
$session = $this->get_session_data();
unset($session[$parsedkey]);
return $this->save_session($session);
}
/**
* Retrieves an array of values for an array of keys.
*
* Using this function comes with potential performance implications.
* Not all cache stores will support get_many/set_many operations and in order to replicate this functionality will call
* the equivalent singular method for each item provided.
* This should not deter you from using this function as there is a performance benefit in situations where the cache store
* does support it, but you should be aware of this fact.
*
* @param array $keys The keys of the data being requested.
* Each key can be any structure although using a scalar string or int is recommended in the interests of performance.
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
* @param int $strictness One of IGNORE_MISSING or MUST_EXIST.
* @return array An array of key value pairs for the items that could be retrieved from the cache.
* If MUST_EXIST was used and not all keys existed within the cache then an exception will be thrown.
* Otherwise any key that did not exist will have a data value of false within the results.
* @throws moodle_exception
*/
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
$this->check_tracked_user();
$return = array();
foreach ($keys as $key) {
$return[$key] = $this->get($key, $strictness);
}
return $return;
}
/**
* Delete all of the given keys from the cache.
*
* @param array $keys The key to delete.
* @param bool $recurse When set to true the key will also be deleted from all stacked cache loaders and their stores.
* This happens by default and ensure that all the caches are consistent. It is NOT recommended to change this.
* @return int The number of items successfully deleted.
*/
public function delete_many(array $keys, $recurse = true) {
$this->check_tracked_user();
$parsedkeys = array_map(array($this, 'parse_key'), $keys);
if ($recurse && $this->get_loader() !== false) {
// Delete from the bottom of the stack first.
$this->get_loader()->delete_many($keys, $recurse);
}
$session = $this->get_session_data();
foreach ($parsedkeys as $parsedkey) {
unset($session[$parsedkey]);
}
$this->save_session($session);
return count($keys);
}
/**
* Sends several key => value pairs to the cache.
*
* Using this function comes with potential performance implications.
* Not all cache stores will support get_many/set_many operations and in order to replicate this functionality will call
* the equivalent singular method for each item provided.
* This should not deter you from using this function as there is a performance benefit in situations where the cache store
* does support it, but you should be aware of this fact.
*
* <code>
* // This code will add four entries to the cache, one for each url.
* $cache->set_many(array(
* 'main' => 'http://moodle.org',
* 'docs' => 'http://docs.moodle.org',
* 'tracker' => 'http://tracker.moodle.org',
* 'qa' => ''http://qa.moodle.net'
* ));
* </code>
*
* @param array $keyvaluearray An array of key => value pairs to send to the cache.
* @return int The number of items successfully set. It is up to the developer to check this matches the number of items.
* ... if they care that is.
*/
public function set_many(array $keyvaluearray) {
$this->check_tracked_user();
$session = $this->get_session_data();
$simulatettl = $this->has_a_ttl();
foreach ($keyvaluearray as $key => $value) {
if (is_object($value) && $value instanceof cacheable_object) {
$value = new cache_cached_object($value);
} else if (!is_scalar($value)) {
// If data is an object it will be a reference.
// If data is an array if may contain references.
// We want to break references so that the cache cannot be modified outside of itself.
// Call the function to unreference it (in the best way possible).
$value = $this->unref($value);
}
if ($simulatettl) {
$value = new cache_ttl_wrapper($value, $this->get_definition()->get_ttl());
}
$parsedkey = $this->parse_key($key);
$session[$parsedkey] = $value;
}
if ($this->perfdebug) {
cache_helper::record_cache_set($this->storetype, $this->get_definition()->get_id());
}
$this->save_session($session);
return count($keyvaluearray);
}
/**
* Purges the cache store, and loader if there is one.
*
* @return bool True on success, false otherwise
*/
public function purge() {
// 1. Purge the session object.
$this->session = array();
// 2. Delete the record for this users session from the store.
$this->get_store()->delete($this->sessionid);
// 3. Optionally purge any stacked loaders in the same way.
if ($this->get_loader()) {
$this->get_loader()->delete($this->sessionid);
}
return true;
}
/**
* Test is a cache has a key.
*
* The use of the has methods is strongly discouraged. In a high load environment the cache may well change between the
* test and any subsequent action (get, set, delete etc).
* Instead it is recommended to write your code in such a way they it performs the following steps:
* <ol>
* <li>Attempt to retrieve the information.</li>
* <li>Generate the information.</li>
* <li>Attempt to set the information</li>
* </ol>
*
* Its also worth mentioning that not all stores support key tests.
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
* Just one more reason you should not use these methods unless you have a very good reason to do so.
*
* @param string|int $key
* @param bool $tryloadifpossible If set to true, the cache doesn't contain the key, and there is another cache loader or
* data source then the code will try load the key value from the next item in the chain.
* @return bool True if the cache has the requested key, false otherwise.
*/
public function has($key, $tryloadifpossible = false) {
$this->check_tracked_user();
$parsedkey = $this->parse_key($key);
$session = $this->get_session_data();
$has = false;
if ($this->has_a_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
}
} else {
$has = array_key_exists($parsedkey, $session);
}
if (!$has && $tryloadifpossible) {
if ($this->get_loader() !== false) {
$result = $this->get_loader()->get($key);
} else if ($this->get_datasource() !== null) {
$result = $this->get_datasource()->load_for_cache($key);
}
$has = ($result !== null);
if ($has) {
$this->set($key, $result);
}
}
return $has;
}
/**
* Test is a cache has all of the given keys.
*
* It is strongly recommended to avoid the use of this function if not absolutely required.
* In a high load environment the cache may well change between the test and any subsequent action (get, set, delete etc).
*
* Its also worth mentioning that not all stores support key tests.
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
* Just one more reason you should not use these methods unless you have a very good reason to do so.
*
* @param array $keys
* @return bool True if the cache has all of the given keys, false otherwise.
*/
public function has_all(array $keys) {
$this->check_tracked_user();
$session = $this->get_session_data();
foreach ($keys as $key) {
$has = false;
$parsedkey = $this->parse_key($key);
if ($this->has_a_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
}
} else {
$has = array_key_exists($parsedkey, $session);
}
if (!$has) {
return false;
}
}
return true;
}
/**
* Test if a cache has at least one of the given keys.
*
* It is strongly recommended to avoid the use of this function if not absolutely required.
* In a high load environment the cache may well change between the test and any subsequent action (get, set, delete etc).
*
* Its also worth mentioning that not all stores support key tests.
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
* Just one more reason you should not use these methods unless you have a very good reason to do so.
*
* @param array $keys
* @return bool True if the cache has at least one of the given keys
*/
public function has_any(array $keys) {
$this->check_tracked_user();
$session = $this->get_session_data();
foreach ($keys as $key) {
$has = false;
$parsedkey = $this->parse_key($key);
if ($this->has_a_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
}
} else {
$has = array_key_exists($parsedkey, $session);
}
if ($has) {
return true;
}
}
return false;
}
/**
* The session loader never uses the persist cache.
* Instead it stores things in the static $session variable. Shared between all session loaders.
*
* @return bool
*/
protected function is_using_persist_cache() {
return false;
}
}
/**
+14
View File
@@ -110,6 +110,11 @@ abstract class cache_store implements cache_store_interface {
*/
const SUPPORTS_NATIVE_TTL = 4;
/**
* The cache is searchable by key.
*/
const IS_SEARCHABLE = 8;
// Constants for the modes of a cache store
/**
@@ -307,6 +312,15 @@ abstract class cache_store implements cache_store_interface {
return $this::get_supported_features() & self::SUPPORTS_NATIVE_TTL;
}
/**
* Returns true if the store instance is searchable.
*
* @return bool
*/
public function is_searchable() {
return in_array('cache_is_searchable', class_implements($this));
}
/**
* Creates a clone of this store instance ready to be initialised.
*
+2 -2
View File
@@ -197,7 +197,7 @@ class cache_mode_mappings_form extends moodleform {
);
foreach ($stores as $storename => $store) {
foreach ($store['modes'] as $mode => $enabled) {
if ($enabled) {
if ($enabled && ($mode !== cache_store::MODE_SESSION || $store['supports']['searchable'])) {
if (empty($store['default'])) {
$options[$mode][$storename] = $store['name'];
} else {
@@ -214,4 +214,4 @@ class cache_mode_mappings_form extends moodleform {
$this->add_action_buttons();
}
}
}
+56 -32
View File
@@ -330,42 +330,11 @@ class cache_config_writer extends cache_config {
* Returns a configuration array if it could not be saved. This is a bad situation. Check your error logs.
*/
public static function create_default_configuration() {
global $CFG;
// HACK ALERT.
// We probably need to come up with a better way to create the default stores, or at least ensure 100% that the
// default store plugins are protected from deletion.
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
require_once($CFG->dirroot.'/cache/stores/session/lib.php');
require_once($CFG->dirroot.'/cache/stores/static/lib.php');
$writer = new self;
$writer->configstores = array(
'default_application' => array(
'name' => 'default_application',
'plugin' => 'file',
'configuration' => array(),
'features' => cachestore_file::get_supported_features(),
'modes' => cache_store::MODE_APPLICATION,
'default' => true,
),
'default_session' => array(
'name' => 'default_session',
'plugin' => 'session',
'configuration' => array(),
'features' => cachestore_session::get_supported_features(),
'modes' => cache_store::MODE_SESSION,
'default' => true,
),
'default_request' => array(
'name' => 'default_request',
'plugin' => 'static',
'configuration' => array(),
'features' => cachestore_static::get_supported_features(),
'modes' => cache_store::MODE_REQUEST,
'default' => true,
)
);
$writer->configstores = self::get_default_stores();
$writer->configdefinitions = self::locate_definitions();
$writer->configmodemappings = array(
array(
@@ -404,6 +373,58 @@ class cache_config_writer extends cache_config {
return true;
}
/**
* Returns an array of default stores for use.
*
* @return array
*/
protected static function get_default_stores() {
global $CFG;
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
require_once($CFG->dirroot.'/cache/stores/session/lib.php');
require_once($CFG->dirroot.'/cache/stores/static/lib.php');
return array(
'default_application' => array(
'name' => 'default_application',
'plugin' => 'file',
'configuration' => array(),
'features' => cachestore_file::get_supported_features(),
'modes' => cachestore_file::get_supported_modes(),
'default' => true,
),
'default_session' => array(
'name' => 'default_session',
'plugin' => 'session',
'configuration' => array(),
'features' => cachestore_session::get_supported_features(),
'modes' => cachestore_session::get_supported_modes(),
'default' => true,
),
'default_request' => array(
'name' => 'default_request',
'plugin' => 'static',
'configuration' => array(),
'features' => cachestore_static::get_supported_features(),
'modes' => cachestore_static::get_supported_modes(),
'default' => true,
)
);
}
/**
* Updates the default stores within the MUC config file.
*/
public static function update_default_config_stores() {
$factory = cache_factory::instance();
$factory->updating_started();
$config = $factory->create_config_instance(true);
$config->configstores = array_merge($config->configstores, self::get_default_stores());
$config->config_save();
$factory->updating_finished();
}
/**
* Updates the definition in the configuration from those found in the cache files.
*
@@ -529,10 +550,12 @@ class cache_config_writer extends cache_config {
* Update the site identifier stored by the cache API.
*
* @param string $siteidentifier
* @return string The new site identifier.
*/
public function update_site_identifier($siteidentifier) {
$this->siteidentifier = md5((string)$siteidentifier);
$this->config_save();
return $this->siteidentifier;
}
}
@@ -579,6 +602,7 @@ abstract class cache_administration_helper extends cache_helper {
'nativettl' => $store->supports_native_ttl(),
'nativelocking' => ($store instanceof cache_is_lockable),
'keyawareness' => ($store instanceof cache_is_key_aware),
'searchable' => ($store instanceof cache_is_searchable)
)
);
if (empty($details['default'])) {
+57 -6
View File
@@ -37,7 +37,7 @@
* @copyright 2012 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cachestore_file extends cache_store implements cache_is_key_aware, cache_is_configurable {
class cachestore_file extends cache_store implements cache_is_key_aware, cache_is_configurable, cache_is_searchable {
/**
* The name of the store.
@@ -190,10 +190,22 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
*/
public static function get_supported_features(array $configuration = array()) {
$supported = self::SUPPORTS_DATA_GUARANTEE +
self::SUPPORTS_NATIVE_TTL;
self::SUPPORTS_NATIVE_TTL +
self::IS_SEARCHABLE;
return $supported;
}
/**
* Returns false as this store does not support multiple identifiers.
* (This optional function is a performance optimisation; it must be
* consistent with the value from get_supported_features.)
*
* @return bool False
*/
public function supports_multiple_identifiers() {
return false;
}
/**
* Returns the supported modes as a combined int.
*
@@ -257,13 +269,15 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
/**
* Gets a pattern suitable for use with glob to find all keys in the cache.
*
* @param string $prefix A prefix to use.
* @return string The pattern.
*/
protected function glob_keys_pattern() {
protected function glob_keys_pattern($prefix = '') {
if ($this->singledirectory) {
return $this->path . '/*.cache';
return $this->path . '/'.$prefix.'*.cache';
} else {
return $this->path . '/*/*.cache';
return $this->path . '/*/'.$prefix.'*.cache';
}
}
@@ -365,7 +379,6 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
public function delete($key) {
$filename = $key.'.cache';
$file = $this->file_path_for_key($key);
if (@unlink($file)) {
unset($this->keys[$filename]);
return true;
@@ -687,4 +700,42 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
public function my_name() {
return $this->name;
}
/**
* Finds all of the keys being used by this cache store instance.
*
* @return array
*/
public function find_all() {
$this->ensure_path_exists();
$files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
$return = array();
if ($files === false) {
return $return;
}
foreach ($files as $file) {
$return[] = substr(basename($file), 0, -6);
}
return $return;
}
/**
* Finds all of the keys whose keys start with the given prefix.
*
* @param string $prefix
*/
public function find_by_prefix($prefix) {
$this->ensure_path_exists();
$prefix = preg_replace('#(\*|\?|\[)#', '[$1]', $prefix);
$files = glob($this->glob_keys_pattern($prefix), GLOB_MARK | GLOB_NOSORT);
$return = array();
if ($files === false) {
return $return;
}
foreach ($files as $file) {
// Trim off ".cache" from the end.
$return[] = substr(basename($file), 0, -6);
}
return $return;
}
}
+6
View File
@@ -46,5 +46,11 @@ class cachestore_memcache_addinstance_form extends cachestore_addinstance_form {
$form->addHelpButton('servers', 'servers', 'cachestore_memcache');
$form->addRule('servers', get_string('required'), 'required');
$form->setType('servers', PARAM_RAW);
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcache'),
array('maxlength' => 5, 'size' => 5));
$form->addHelpButton('prefix', 'prefix', 'cachestore_memcache');
$form->setType('prefix', PARAM_ALPHAEXT);
$form->setDefault('prefix', 'mdl_');
}
}
+4
View File
@@ -27,6 +27,10 @@
defined('MOODLE_INTERNAL') || die();
$string['pluginname'] = 'Memcache';
$string['prefix'] = 'Key prefix';
$string['prefix_help'] = 'This prefix is used for all key names on the memcache server.
* If you only have one Moodle instance using this server, you can leave this value default.
* Due to key length restrictions, a maximum of 5 characters is permitted.';
$string['servers'] = 'Servers';
$string['servers_help'] = 'This sets the servers that should be utilised by this memcache adapter.
Servers should be defined one per line and consist of a server address and optionally a port and weight.
+36 -1
View File
@@ -51,6 +51,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
*/
protected $connection;
/**
* Key prefix for this memcache.
* @var string
*/
protected $prefix;
/**
* An array of servers to use in the connection args.
* @var array
@@ -81,6 +87,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
*/
protected $definition;
/**
* Default prefix for key names.
* @var string
*/
const DEFAULT_PREFIX = 'mdl_';
/**
* Constructs the store instance.
*
@@ -111,6 +123,11 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
}
$this->servers[] = $server;
}
if (empty($configuration['prefix'])) {
$this->prefix = self::DEFAULT_PREFIX;
} else {
$this->prefix = $configuration['prefix'];
}
$this->connection = new Memcache;
foreach ($this->servers as $server) {
@@ -181,6 +198,17 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
return self::SUPPORTS_NATIVE_TTL;
}
/**
* Returns false as this store does not support multiple identifiers.
* (This optional function is a performance optimisation; it must be
* consistent with the value from get_supported_features.)
*
* @return bool False
*/
public function supports_multiple_identifiers() {
return false;
}
/**
* Returns the supported modes as a combined int.
*
@@ -201,7 +229,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
if (strlen($key) > 245) {
$key = '_sha1_'.sha1($key);
}
$key = 'mdl_'.$key;
$key = $this->prefix . $key;
return $key;
}
@@ -327,6 +355,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
}
return array(
'servers' => $servers,
'prefix' => $data->prefix,
);
}
@@ -345,6 +374,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
}
$data['servers'] = join("\n", $servers);
}
if (!empty($config['prefix'])) {
$data['prefix'] = $config['prefix'];
} else {
$data['prefix'] = self::DEFAULT_PREFIX;
}
$editform->set_data($data);
}
+2 -2
View File
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2012112900; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2012112901; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2012112900; // Requires this Moodle version.
$plugin->component = 'cachestore_memcache'; // Full name of the plugin.
$plugin->component = 'cachestore_memcache'; // Full name of the plugin.
+11
View File
@@ -205,6 +205,17 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
return self::SUPPORTS_NATIVE_TTL;
}
/**
* Returns false as this store does not support multiple identifiers.
* (This optional function is a performance optimisation; it must be
* consistent with the value from get_supported_features.)
*
* @return bool False
*/
public function supports_multiple_identifiers() {
return false;
}
/**
* Returns the supported modes as a combined int.
*
+38 -2
View File
@@ -90,7 +90,7 @@ abstract class session_data_store extends cache_store {
* @copyright 2012 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cachestore_session extends session_data_store implements cache_is_key_aware {
class cachestore_session extends session_data_store implements cache_is_key_aware, cache_is_searchable {
/**
* The name of the store
@@ -137,7 +137,19 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
*/
public static function get_supported_features(array $configuration = array()) {
return self::SUPPORTS_DATA_GUARANTEE +
self::SUPPORTS_NATIVE_TTL;
self::SUPPORTS_NATIVE_TTL +
self::IS_SEARCHABLE;
}
/**
* Returns false as this store does not support multiple identifiers.
* (This optional function is a performance optimisation; it must be
* consistent with the value from get_supported_features.)
*
* @return bool False
*/
public function supports_multiple_identifiers() {
return false;
}
/**
@@ -400,4 +412,28 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
public function my_name() {
return $this->name;
}
/**
* Finds all of the keys being stored in the cache store instance.
*
* @return array
*/
public function find_all() {
return array_keys($this->store);
}
/**
* Finds all of the keys whose keys start with the given prefix.
*
* @param string $prefix
*/
public function find_by_prefix($prefix) {
$return = array();
foreach ($this->find_all() as $key) {
if (strpos($key, $prefix) === 0) {
$return[] = $key;
}
}
return $return;
}
}
+11
View File
@@ -136,6 +136,17 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
self::SUPPORTS_NATIVE_TTL;
}
/**
* Returns false as this store does not support multiple identifiers.
* (This optional function is a performance optimisation; it must be
* consistent with the value from get_supported_features.)
*
* @return bool False
*/
public function supports_multiple_identifiers() {
return false;
}
/**
* Returns the supported modes as a combined int.
*
+441 -2
View File
@@ -126,6 +126,18 @@ class cache_phpunit_tests extends advanced_testcase {
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'phpunit', 'applicationtest');
$this->assertInstanceOf('cache_application', $cache);
$this->run_on_cache($cache);
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/test_default_application_cache', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_default_application_cache',
'persistent' => true,
'persistentmaxsize' => 1
));
$cache = cache::make('phpunit', 'test_default_application_cache');
$this->assertInstanceOf('cache_application', $cache);
$this->run_on_cache($cache);
}
/**
@@ -238,6 +250,18 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertTrue($cache->delete('key1'));
$this->assertTrue($cache->delete('key2'));
$cache->set_many(array(
'key1' => array(1, 2, 3),
'key2' => array(3, 2, 1),
));
$this->assertInternalType('array', $cache->get('key1'));
$this->assertInternalType('array', $cache->get('key2'));
$this->assertCount(3, $cache->get('key1'));
$this->assertCount(3, $cache->get('key2'));
$this->assertInternalType('array', $cache->get_many(array('key1', 'key2')));
$this->assertCount(2, $cache->get_many(array('key1', 'key2')));
$this->assertEquals(2, $cache->delete_many(array('key1', 'key2')));
// Test delete many.
$this->assertTrue($cache->set('key1', 'data1'));
$this->assertTrue($cache->set('key2', 'data2'));
@@ -316,6 +340,27 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertEquals('value', $var2->key);
$this->assertTrue($cache->delete('obj'));
// Test strictness exceptions.
try {
$cache->get('exception', MUST_EXIST);
$this->fail('Exception expected from cache::get using MUST_EXIST');
} catch (Exception $e) {
$this->assertTrue(true);
}
try {
$cache->get_many(array('exception1', 'exception2'), MUST_EXIST);
$this->fail('Exception expected from cache::get_many using MUST_EXIST');
} catch (Exception $e) {
$this->assertTrue(true);
}
$cache->set('test', 'test');
try {
$cache->get_many(array('test', 'exception'), MUST_EXIST);
$this->fail('Exception expected from cache::get_many using MUST_EXIST');
} catch (Exception $e) {
$this->assertTrue(true);
}
}
/**
@@ -338,13 +383,25 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertTrue($cache->purge());
// It won't be there yet.
$this->assertFalse($cache->has('Test'));
// It should load it ;).
$this->assertTrue($cache->has('Test', true));
// Purge it to be sure.
$this->assertTrue($cache->purge());
$this->assertEquals('Test has no value really.', $cache->get('Test'));
// Test multiple values.
$this->assertTrue($cache->purge());
$this->assertTrue($cache->set('b', 'B'));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertEquals('a has no value really.', $result['a']);
$this->assertEquals('B', $result['b']);
$this->assertEquals('c has no value really.', $result['c']);
}
/**
@@ -416,7 +473,10 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertEquals('test data 2', $cache->get('2'));
}
public function test_definition_ttl() {
/**
* Test a negative TTL on an application cache.
*/
public function test_application_ttl_negative() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/ttltest', array(
'mode' => cache_store::MODE_APPLICATION,
@@ -437,6 +497,127 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->has('Test'));
// Double check by trying to get it.
$this->assertFalse($cache->get('Test'));
// Test with multiple keys.
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertFalse($result['a']);
$this->assertFalse($result['b']);
$this->assertFalse($result['c']);
// Test with multiple keys including missing ones.
$result = $cache->get_many(array('a', 'c', 'e'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('c', $result);
$this->assertArrayHasKey('e', $result);
$this->assertFalse($result['a']);
$this->assertFalse($result['c']);
$this->assertFalse($result['e']);
}
/**
* Test a positive TTL on an application cache.
*/
public function test_application_ttl_positive() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/ttltest', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'ttltest',
'ttl' => 86400 // Set to a day in the future to be extra sure.
));
$cache = cache::make('phpunit', 'ttltest');
$this->assertInstanceOf('cache_application', $cache);
// Purge it to be sure.
$this->assertTrue($cache->purge());
// It won't be there yet.
$this->assertFalse($cache->has('Test'));
// Set it now.
$this->assertTrue($cache->set('Test', 'Test'));
// Check its there.
$this->assertTrue($cache->has('Test'));
// Double check by trying to get it.
$this->assertEquals('Test', $cache->get('Test'));
// Test with multiple keys.
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('B', $result['b']);
$this->assertEquals('C', $result['c']);
// Test with multiple keys including missing ones.
$result = $cache->get_many(array('a', 'c', 'e'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('c', $result);
$this->assertArrayHasKey('e', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('C', $result['c']);
$this->assertEquals(false, $result['e']);
}
/**
* Test a negative TTL on an session cache.
*/
public function test_session_ttl_positive() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/ttltest', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'ttltest',
'ttl' => 86400 // Set to a day in the future to be extra sure.
));
$cache = cache::make('phpunit', 'ttltest');
$this->assertInstanceOf('cache_session', $cache);
// Purge it to be sure.
$this->assertTrue($cache->purge());
// It won't be there yet.
$this->assertFalse($cache->has('Test'));
// Set it now.
$this->assertTrue($cache->set('Test', 'Test'));
// Check its there.
$this->assertTrue($cache->has('Test'));
// Double check by trying to get it.
$this->assertEquals('Test', $cache->get('Test'));
// Test with multiple keys.
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('B', $result['b']);
$this->assertEquals('C', $result['c']);
// Test with multiple keys including missing ones.
$result = $cache->get_many(array('a', 'c', 'e'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('c', $result);
$this->assertArrayHasKey('e', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('C', $result['c']);
$this->assertEquals(false, $result['e']);
}
/**
@@ -503,6 +684,42 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey2'));
}
/**
* Tests session cache event invalidation
*/
public function test_session_event_invalidation() {
$instance = cache_config_phpunittest::instance();
$instance->phpunit_add_definition('phpunit/test_session_event_invalidation', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'test_session_event_invalidation',
'invalidationevents' => array(
'crazyevent'
)
));
$cache = cache::make('phpunit', 'test_session_event_invalidation');
$this->assertInstanceOf('cache_session', $cache);
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
$this->assertEquals('test data 2', $cache->get('testkey2'));
// Test invalidating a single entry.
cache_helper::invalidate_by_event('crazyevent', array('testkey1'));
$this->assertFalse($cache->get('testkey1'));
$this->assertEquals('test data 2', $cache->get('testkey2'));
$this->assertTrue($cache->set('testkey1', 'test data 1'));
// Test invalidating both entries.
cache_helper::invalidate_by_event('crazyevent', array('testkey1', 'testkey2'));
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
}
/**
* Tests application cache definition invalidation
*/
@@ -539,6 +756,45 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey2'));
}
/**
* Tests session cache definition invalidation
*/
public function test_session_definition_invalidation() {
$instance = cache_config_phpunittest::instance();
$instance->phpunit_add_definition('phpunit/test_session_definition_invalidation', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'test_session_definition_invalidation'
));
$cache = cache::make('phpunit', 'test_session_definition_invalidation');
$this->assertInstanceOf('cache_session', $cache);
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
$this->assertEquals('test data 2', $cache->get('testkey2'));
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(), 'testkey1');
$this->assertFalse($cache->get('testkey1'));
$this->assertEquals('test data 2', $cache->get('testkey2'));
$this->assertTrue($cache->set('testkey1', 'test data 1'));
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(),
array('testkey1'));
$this->assertFalse($cache->get('testkey1'));
$this->assertEquals('test data 2', $cache->get('testkey2'));
$this->assertTrue($cache->set('testkey1', 'test data 1'));
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(),
array('testkey1', 'testkey2'));
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
}
/**
* Tests application cache event invalidation over a distributed setup.
*/
@@ -848,5 +1104,188 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('test'));
$this->assertTrue($cache->set('test', 'test'));
$this->assertEquals('test', $cache->get('test'));
$this->assertTrue($cache->delete('test'));
$this->assertFalse($cache->get('test'));
$this->assertTrue($cache->set('test', 'test'));
$this->assertTrue($cache->purge());
$this->assertFalse($cache->get('test'));
// Test the many commands.
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('B', $result['b']);
$this->assertEquals('C', $result['c']);
$this->assertEquals($result, $cache->get_many(array('a', 'b', 'c')));
$this->assertEquals(2, $cache->delete_many(array('a', 'c')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertFalse($result['a']);
$this->assertEquals('B', $result['b']);
$this->assertFalse($result['c']);
}
/**
* Test switching users with session caches.
*/
public function test_session_cache_switch_user() {
$this->resetAfterTest(true);
$cache = cache::make_from_params(cache_store::MODE_SESSION, 'phpunit', 'sessioncache');
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
// Log in as the first user.
$this->setUser($user1);
$sesskey1 = sesskey();
// Set a basic value in the cache.
$cache->set('var', 1);
$this->assertTrue($cache->has('var'));
$this->assertEquals(1, $cache->get('var'));
// Change to the second user.
$this->setUser($user2);
$sesskey2 = sesskey();
// Make sure the cache doesn't give us the data for the last user.
$this->assertNotEquals($sesskey1, $sesskey2);
$this->assertFalse($cache->has('var'));
$this->assertEquals(false, $cache->get('var'));
}
/**
* Test switching users with session caches.
*/
public function test_session_cache_switch_user_application_mapping() {
$this->resetAfterTest(true);
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_file_store('testfilestore');
$instance->phpunit_add_definition('phpunit/testappsession', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'testappsession'
));
$instance->phpunit_add_definition_mapping('phpunit/testappsession', 'testfilestore', 3);
$cache = cache::make('phpunit', 'testappsession');
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
// Log in as the first user.
$this->setUser($user1);
$sesskey1 = sesskey();
// Set a basic value in the cache.
$cache->set('var', 1);
$this->assertTrue($cache->has('var'));
$this->assertEquals(1, $cache->get('var'));
// Change to the second user.
$this->setUser($user2);
$sesskey2 = sesskey();
// Make sure the cache doesn't give us the data for the last user.
$this->assertNotEquals($sesskey1, $sesskey2);
$this->assertFalse($cache->has('var'));
$this->assertEquals(false, $cache->get('var'));
}
/**
* Test two session caches being used at once to confirm collisions don't occur.
*/
public function test_dual_session_caches() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/testsess1', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'testsess1'
));
$instance->phpunit_add_definition('phpunit/testsess2', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'testsess2'
));
$cache1 = cache::make('phpunit', 'testsess1');
$cache2 = cache::make('phpunit', 'testsess2');
$this->assertFalse($cache1->has('test'));
$this->assertFalse($cache2->has('test'));
$this->assertTrue($cache1->set('test', '1'));
$this->assertTrue($cache1->has('test'));
$this->assertFalse($cache2->has('test'));
$this->assertTrue($cache2->set('test', '2'));
$this->assertEquals(1, $cache1->get('test'));
$this->assertEquals(2, $cache2->get('test'));
$this->assertTrue($cache1->delete('test'));
}
/**
* Test multiple session caches when switching user.
*/
public function test_session_cache_switch_user_multiple() {
$this->resetAfterTest(true);
$cache1 = cache::make_from_params(cache_store::MODE_SESSION, 'phpunit', 'sessioncache1');
$cache2 = cache::make_from_params(cache_store::MODE_SESSION, 'phpunit', 'sessioncache2');
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
// Log in as the first user.
$this->setUser($user1);
$sesskey1 = sesskey();
// Set a basic value in the caches.
$cache1->set('var', 1);
$cache2->set('var', 2);
$this->assertEquals(1, $cache1->get('var'));
$this->assertEquals(2, $cache2->get('var'));
// Change to the second user.
$this->setUser($user2);
$sesskey2 = sesskey();
// Make sure the cache doesn't give us the data for the last user.
// Also make sure that switching the user has lead to both caches being purged.
$this->assertNotEquals($sesskey1, $sesskey2);
$this->assertEquals(false, $cache1->get('var'));
$this->assertEquals(false, $cache2->get('var'));
}
/**
* Test application locking.
*/
public function test_application_locking() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/test_application_locking', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_application_locking',
'persistent' => true,
'persistentmaxsize' => 1,
'requirelockingread' => true,
'requirelockingwrite' => true
));
$cache = cache::make('phpunit', 'test_application_locking');
$this->assertInstanceOf('cache_application', $cache);
$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')));
$this->assertTrue($cache->delete('a'));
$this->assertFalse($cache->has('a'));
}
}
+1
View File
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cache_config_phpunittest extends cache_config_writer {
/**
* Adds a definition to the stack
* @param string $area
+3 -2
View File
@@ -528,8 +528,9 @@ class comment {
$c->timecreated = $u->ctimecreated;
$c->strftimeformat = get_string('strftimerecent', 'langconfig');
$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
$c->profileurl = $url->out(false);
$c->profileurl = $url->out(true);
$c->fullname = fullname($u);
$c->time = userdate($c->timecreated, $c->strftimeformat);
$c->content = format_text($c->content, $c->format, $formatoptions);
$c->avatar = $OUTPUT->user_picture($u, array('size'=>18));
@@ -808,7 +809,7 @@ class comment {
$replacements[] = $cmt->avatar;
$replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname);
$replacements[] = $cmt->content;
$replacements[] = userdate($cmt->timecreated, $cmt->strftimeformat);
$replacements[] = $cmt->time;
// use html template to format a single comment.
return str_replace($patterns, $replacements, $this->template);
@@ -59,7 +59,7 @@ class completion_criteria_role extends completion_criteria {
*/
public function config_form_display(&$mform, $data = null) {
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $data->name);
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $this->get_title($data));
if ($this->id) {
$mform->setDefault('criteria_role['.$data->id.']', 1);
@@ -122,8 +122,8 @@ class completion_criteria_role extends completion_criteria {
*/
public function get_title() {
global $DB;
$role = $DB->get_field('role', 'name', array('id' => $this->role));
return $role;
$role = $DB->get_record('role', array('id' => $this->role));
return role_get_name($role, context_course::instance($this->course));
}
/**
@@ -132,8 +132,7 @@ class completion_criteria_role extends completion_criteria {
* @return string
*/
public function get_title_detailed() {
global $DB;
return $DB->get_field('role', 'name', array('id' => $this->role));
return $this->get_title();
}
/**
+6
View File
@@ -61,6 +61,12 @@ $context = $PAGE->context;
// And the object has been loaded for us no need for another DB call
$category = $PAGE->category;
// This needs to match caps checked in can_edit_in_category below.
$PAGE->set_other_editing_capability(array(
'moodle/category:manage',
'moodle/course:create'
));
$canedit = can_edit_in_category($category->id);
if ($canedit) {
if ($categoryedit !== -1) {
+1 -1
View File
@@ -51,7 +51,7 @@ function dndupload_add_to_course($course, $modnames) {
// Add the javascript to the page.
$jsmodule = array(
'name' => 'coursedndupload',
'fullpath' => new moodle_url('/course/dndupload.js'),
'fullpath' => '/course/dndupload.js',
'strings' => array(
array('addfilehere', 'moodle'),
array('dndworkingfiletextlink', 'moodle'),
+8 -5
View File
@@ -20,10 +20,13 @@ class editsection_form extends moodleform {
$mform = $this->_form;
$course = $this->_customdata['course'];
$mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname'));
$mform->setDefault('usedefaultname', true);
$mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30'));
$elementgroup = array();
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30'));
$elementgroup[] = $mform->createElement('checkbox', 'usedefaultname', '', get_string('sectionusedefaultname'));
$mform->addGroup($elementgroup, 'name_group', get_string('sectionname'), ' ', false);
$mform->setDefault('usedefaultname', true);
$mform->setType('name', PARAM_TEXT);
$mform->disabledIf('name','usedefaultname','checked');
@@ -51,6 +54,7 @@ class editsection_form extends moodleform {
$mform = $this->_form;
$course = $this->_customdata['course'];
$context = context_course::instance($course->id);
if (!empty($CFG->enableavailability)) {
$mform->addElement('header', '', get_string('availabilityconditions', 'condition'));
@@ -62,7 +66,6 @@ class editsection_form extends moodleform {
$options[0] = get_string('none');
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id))) {
foreach ($groupings as $grouping) {
$context = context_course::instance($course->id);
$options[$grouping->id] = format_string(
$grouping->name, true, array('context' => $context));
}
@@ -119,7 +122,7 @@ class editsection_form extends moodleform {
// Conditions based on user fields
$operators = condition_info::get_condition_user_field_operators();
$useroptions = condition_info::get_condition_user_fields();
$useroptions = condition_info::get_condition_user_fields(array('context' => $context));
asort($useroptions);
$useroptions = array(0 => $strcondnone) + $useroptions;
+58 -53
View File
@@ -108,6 +108,7 @@ class core_course_external extends external_api {
$sections = $modinfo->get_section_info_all();
//for each sections (first displayed to last displayed)
$modinfosections = $modinfo->get_sections();
foreach ($sections as $key => $section) {
if (!$section->uservisible) {
@@ -125,62 +126,66 @@ class core_course_external extends external_api {
$sectioncontents = array();
//for each module of the section
foreach ($modinfo->sections[$section->section] as $cmid) { //matching /course/lib.php:print_section() logic
$cm = $modinfo->cms[$cmid];
if (!empty($modinfosections[$section->section])) {
foreach ($modinfosections[$section->section] as $cmid) {
$cm = $modinfo->cms[$cmid];
// stop here if the module is not visible to the user
if (!$cm->uservisible) {
continue;
}
$module = array();
//common info (for people being able to see the module or availability dates)
$module['id'] = $cm->id;
$module['name'] = format_string($cm->name, true);
$module['modname'] = $cm->modname;
$module['modplural'] = $cm->modplural;
$module['modicon'] = $cm->get_icon_url()->out(false);
$module['indent'] = $cm->indent;
$modcontext = context_module::instance($cm->id);
if (!empty($cm->showdescription)) {
$module['description'] = $cm->get_content();
}
//url of the module
$url = $cm->get_url();
if ($url) { //labels don't have url
$module['url'] = $cm->get_url()->out();
}
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
context_module::instance($cm->id));
//user that can view hidden module should know about the visibility
$module['visible'] = $cm->visible;
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
$module['availablefrom'] = $cm->availablefrom;
$module['availableuntil'] = $cm->availableuntil;
}
$baseurl = 'webservice/pluginfile.php';
//call $modulename_export_contents
//(each module callback take care about checking the capabilities)
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
$getcontentfunction = $cm->modname.'_export_contents';
if (function_exists($getcontentfunction)) {
if ($contents = $getcontentfunction($cm, $baseurl)) {
$module['contents'] = $contents;
// stop here if the module is not visible to the user
if (!$cm->uservisible) {
continue;
}
$module = array();
//common info (for people being able to see the module or availability dates)
$module['id'] = $cm->id;
$module['name'] = format_string($cm->name, true);
$module['modname'] = $cm->modname;
$module['modplural'] = $cm->modplural;
$module['modicon'] = $cm->get_icon_url()->out(false);
$module['indent'] = $cm->indent;
$modcontext = context_module::instance($cm->id);
if (!empty($cm->showdescription) or $cm->modname == 'label') {
// We want to use the external format. However from reading get_formatted_content(), get_content() format is always FORMAT_HTML.
list($module['description'], $descriptionformat) = external_format_text($cm->get_content(),
FORMAT_HTML, $modcontext->id, $cm->modname, 'intro', $cm->id);
}
//url of the module
$url = $cm->get_url();
if ($url) { //labels don't have url
$module['url'] = $cm->get_url()->out();
}
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
context_module::instance($cm->id));
//user that can view hidden module should know about the visibility
$module['visible'] = $cm->visible;
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
$module['availablefrom'] = $cm->availablefrom;
$module['availableuntil'] = $cm->availableuntil;
}
$baseurl = 'webservice/pluginfile.php';
//call $modulename_export_contents
//(each module callback take care about checking the capabilities)
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
$getcontentfunction = $cm->modname.'_export_contents';
if (function_exists($getcontentfunction)) {
if ($contents = $getcontentfunction($cm, $baseurl)) {
$module['contents'] = $contents;
}
}
//assign result to $sectioncontents
$sectioncontents[] = $module;
}
//assign result to $sectioncontents
$sectioncontents[] = $module;
}
$sectionvalues['modules'] = $sectioncontents;
+15 -9
View File
@@ -72,6 +72,8 @@ abstract class format_base {
protected $formatoptions = array();
/** @var array cached instances */
private static $instances = array();
/** @var array plugin name => class name. */
private static $classesforformat = array('site' => 'site');
/**
* Creates a new instance of class
@@ -94,24 +96,28 @@ abstract class format_base {
* @return string
*/
protected static final function get_format_or_default($format) {
if ($format === 'site') {
return $format;
if (array_key_exists($format, self::$classesforformat)) {
return self::$classesforformat[$format];
}
$plugins = get_sorted_course_formats();
if (in_array($format, $plugins)) {
return $format;
foreach ($plugins as $plugin) {
self::$classesforformat[$plugin] = $plugin;
}
if (array_key_exists($format, self::$classesforformat)) {
return self::$classesforformat[$format];
}
// Else return default format
$defaultformat = get_config('moodlecourse', 'format');
if (!in_array($defaultformat, $plugins)) {
// when default format is not set correctly, use the first available format
$defaultformat = reset($plugins);
}
static $warningprinted = array();
if (empty($warningprinted[$format])) {
debugging('Format plugin format_'.$format.' is not found. Using default format_'.$defaultformat, DEBUG_DEVELOPER);
$warningprinted[$format] = true;
}
debugging('Format plugin format_'.$format.' is not found. Using default format_'.$defaultformat, DEBUG_DEVELOPER);
self::$classesforformat[$format] = $defaultformat;
return $defaultformat;
}
+1 -1
View File
@@ -324,7 +324,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
* @param array $mods (argument not used)
* @return string HTML to output.
*/
private function section_activity_summary($section, $course, $mods) {
protected function section_activity_summary($section, $course, $mods) {
$modinfo = get_fast_modinfo($course);
if (empty($modinfo->sections[$section->section])) {
return '';
-1
View File
@@ -7,4 +7,3 @@
.course-content ul.topics li.section .right {width:40px;text-align:center;padding: 6px 0;}
.course-content ul.topics li.section .right img.icon { padding: 0 0 4px 0;}
.course-content ul.topics li.section .left .section-handle img.icon { padding:0; vertical-align: baseline; }
.jumpmenu {text-align:center;}
-1
View File
@@ -7,4 +7,3 @@
.course-content ul.weeks li.section .right {width:40px;text-align:center;padding: 6px 0;}
.course-content ul.weeks li.section .right img.icon { padding: 0 0 4px 0;}
.course-content ul.weeks li.section .left .section-handle img.icon { padding:0; vertical-align: baseline; }
.jumpmenu {text-align:center;}
+6
View File
@@ -44,6 +44,12 @@ $PAGE->set_url('/course/index.php');
$PAGE->set_context($systemcontext);
$PAGE->set_pagelayout('admin');
// This needs to match caps checked in can_edit_in_category below.
$PAGE->set_other_editing_capability(array(
'moodle/category:manage',
'moodle/course:create'
));
if (can_edit_in_category()) {
if ($categoryedit !== -1) {
$USER->editing = $categoryedit;
+19 -15
View File
@@ -1674,13 +1674,15 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
'type' => 'hidden', 'name' => 'completionstate',
'value' => $newstate));
echo html_writer::empty_tag('input', array(
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle,
'aria-live' => 'polite'));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
} else {
// In auto mode, or when editing, the icon is just an image
echo "<span class='autocompletion'>";
echo "<img src='$imgsrc' alt='$imgalt' title='$imgalt' /></span>";
// In auto mode, or when editing, the icon is just an image.
echo html_writer::tag('span', html_writer::empty_tag('img', array(
'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgalt)),
array('class' => 'autocompletion'));
}
}
}
@@ -3163,17 +3165,19 @@ function moveto_module($mod, $section, $beforemod=NULL) {
}
// if moving to a hidden section then hide module
if (!$section->visible && $mod->visible) {
// Set this in the object because it is sent as a response to ajax calls.
$mod->visible = 0;
set_coursemodule_visible($mod->id, 0);
// Set visibleold to 1 so module will be visible when section is made visible.
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $mod->id));
}
if ($section->visible && !$mod->visible) {
set_coursemodule_visible($mod->id, $mod->visibleold);
// Set this in the object because it is sent as a response to ajax calls.
$mod->visible = $mod->visibleold;
if ($mod->section != $section->id) {
if (!$section->visible && $mod->visible) {
// Set this in the object because it is sent as a response to ajax calls.
$mod->visible = 0;
set_coursemodule_visible($mod->id, 0);
// Set visibleold to 1 so module will be visible when section is made visible.
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $mod->id));
}
if ($section->visible && !$mod->visible) {
set_coursemodule_visible($mod->id, $mod->visibleold);
// Set this in the object because it is sent as a response to ajax calls.
$mod->visible = $mod->visibleold;
}
}
/// Add the module into the new section
+10 -7
View File
@@ -4,13 +4,22 @@
require_once('../config.php');
require_once('lib.php');
$id = optional_param('id', SITEID, PARAM_INT); // course id
$id = optional_param('id', SITEID, PARAM_INT); // course id
$redirect = optional_param('redirect', 0, PARAM_BOOL);
$url = new moodle_url('/course/loginas.php', array('id'=>$id));
$PAGE->set_url($url);
/// Reset user back to their real self if needed, for security reasons you need to log out and log in again
if (session_is_loggedinas()) {
require_sesskey();
require_logout();
// We can not set wanted URL here because the session is closed.
redirect(new moodle_url($url, array('redirect'=>1)));
}
if ($redirect) {
if ($id and $id != SITEID) {
$SESSION->wantsurl = "$CFG->wwwroot/course/view.php?id=".$id;
} else {
@@ -25,12 +34,6 @@ if (session_is_loggedinas()) {
$userid = required_param('user', PARAM_INT); // login as this user
$url = new moodle_url('/course/loginas.php', array('user'=>$userid, 'sesskey'=>sesskey()));
if ($id !== SITEID) {
$url->param('id', $id);
}
$PAGE->set_url($url);
require_sesskey();
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
+2 -2
View File
@@ -336,7 +336,7 @@ if ($mform->is_cancelled()) {
$cm->groupmembersonly = $fromform->groupmembersonly;
$completion = new completion_info($course);
if ($completion->is_enabled()) {
if ($completion->is_enabled() && !empty($fromform->completionunlocked)) {
// Update completion settings
$cm->completion = $fromform->completion;
$cm->completiongradeitemnumber = $fromform->completiongradeitemnumber;
@@ -413,6 +413,7 @@ if ($mform->is_cancelled()) {
$newcm->module = $fromform->module;
$newcm->instance = 0; // not known yet, will be updated later (this is similar to restore code)
$newcm->visible = $fromform->visible;
$newcm->visibleold = $fromform->visible;
$newcm->groupmode = $fromform->groupmode;
$newcm->groupingid = $fromform->groupingid;
$newcm->groupmembersonly = $fromform->groupmembersonly;
@@ -480,7 +481,6 @@ if ($mform->is_cancelled()) {
// make sure visibility is set correctly (in particular in calendar)
// note: allow them to set it even without moodle/course:activityvisibility
set_coursemodule_visible($fromform->coursemodule, $fromform->visible);
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $fromform->coursemodule));
if (isset($fromform->cmidnumber)) { //label
// set cm idnumber - uniqueness is already verified by form validation
+7 -3
View File
@@ -312,8 +312,11 @@ abstract class moodleform_mod extends moodleform {
}
// Completion: Don't let them choose automatic completion without turning
// on some conditions
if (array_key_exists('completion', $data) && $data['completion']==COMPLETION_TRACKING_AUTOMATIC) {
// on some conditions. Ignore this check when completion settings are
// locked, as the options are then disabled.
if (array_key_exists('completion', $data) &&
$data['completion'] == COMPLETION_TRACKING_AUTOMATIC &&
!empty($data['completionunlocked'])) {
if (empty($data['completionview']) && empty($data['completionusegrade']) &&
!$this->completion_rule_enabled($data)) {
$errors['completion'] = get_string('badautocompletion', 'completion');
@@ -564,7 +567,8 @@ abstract class moodleform_mod extends moodleform {
// Conditions based on user fields
$operators = condition_info::get_condition_user_field_operators();
$useroptions = condition_info::get_condition_user_fields();
$useroptions = condition_info::get_condition_user_fields(
array('context' => $this->context));
asort($useroptions);
$useroptions = array(0 => $strnone) + $useroptions;
+1
View File
@@ -118,6 +118,7 @@ if (has_capability('moodle/course:publish', context_course::instance($id))) {
$hubcourseid = optional_param('hubcourseid', 0, PARAM_INT);
$publicationid = optional_param('publicationid', 0, PARAM_INT);
$timepublished = optional_param('timepublished', 0, PARAM_INT);
$publication = new stdClass();
$publication->courseshortname = $course->shortname;
$publication->courseid = $course->id;
$publication->hubname = $hubname;
+23 -6
View File
@@ -30,6 +30,7 @@ require_once('recent_form.php');
$id = required_param('id', PARAM_INT);
$PAGE->set_url('/course/recent.php', array('id'=>$id));
$PAGE->set_pagelayout('report');
if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error("That's an invalid course id");
@@ -274,21 +275,37 @@ echo $OUTPUT->footer();
function compare_activities_by_time_desc($a, $b) {
// make sure the activities actually have a timestamp property
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
return 0;
}
if ($a->timestamp == $b->timestamp)
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 0;
}
// We treat instances without timestamp as if they have a timestamp of 0.
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
return 1;
}
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return -1;
}
if ($a->timestamp == $b->timestamp) {
return 0;
}
return ($a->timestamp > $b->timestamp) ? -1 : 1;
}
function compare_activities_by_time_asc($a, $b) {
// make sure the activities actually have a timestamp property
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 0;
}
if ($a->timestamp == $b->timestamp)
// We treat instances without timestamp as if they have a timestamp of 0.
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
return -1;
}
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 1;
}
if ($a->timestamp == $b->timestamp) {
return 0;
}
return ($a->timestamp < $b->timestamp) ? -1 : 1;
}
+2 -6
View File
@@ -236,18 +236,14 @@ class core_course_renderer extends plugin_renderer_base {
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
// Activities
$activities = array_filter($modules, function($mod) {
return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);
});
$activities = array_filter($modules, create_function('$mod', 'return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);'));
if (count($activities)) {
$formcontent .= $this->course_modchooser_title('activities');
$formcontent .= $this->course_modchooser_module_types($activities);
}
// Resources
$resources = array_filter($modules, function($mod) {
return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);
});
$resources = array_filter($modules, create_function('$mod', 'return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);'));
if (count($resources)) {
$formcontent .= $this->course_modchooser_title('resources');
$formcontent .= $this->course_modchooser_module_types($resources);
+133
View File
@@ -535,4 +535,137 @@ class courselib_testcase extends advanced_testcase {
$pagetypelist = course_page_type_list($pagetype, null, null);
$this->assertEquals($pagetypelist, $testpagetypelist1);
}
/**
* Tests moving a module between hidden/visible sections and
* verifies that the course/module visiblity seettings are
* retained.
*/
public function test_moveto_module_between_hidden_sections() {
global $DB;
$this->resetAfterTest(true);
$course = $this->getDataGenerator()->create_course(array('numsections' => 4), array('createsections' => true));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$quiz= $this->getDataGenerator()->create_module('quiz', array('course' => $course->id));
// Set the page as hidden
set_coursemodule_visible($page->cmid, 0);
// Set sections 3 as hidden.
set_section_visible($course->id, 3, 0);
$modinfo = get_fast_modinfo($course);
$hiddensection = $modinfo->get_section_info(3);
// New section is definitely not visible:
$this->assertEquals($hiddensection->visible, 0);
$forumcm = $modinfo->cms[$forum->cmid];
$pagecm = $modinfo->cms[$page->cmid];
// Move the forum and the page to a hidden section.
moveto_module($forumcm, $hiddensection);
moveto_module($pagecm, $hiddensection);
// Reset modinfo cache.
get_fast_modinfo(0, 0, true);
$modinfo = get_fast_modinfo($course);
// Verify that forum and page have been moved to the hidden section and quiz has not.
$this->assertContains($forum->cmid, $modinfo->sections[3]);
$this->assertContains($page->cmid, $modinfo->sections[3]);
$this->assertNotContains($quiz->cmid, $modinfo->sections[3]);
// Verify that forum has been made invisible.
$forumcm = $modinfo->cms[$forum->cmid];
$this->assertEquals($forumcm->visible, 0);
// Verify that old state has been retained.
$this->assertEquals($forumcm->visibleold, 1);
// Verify that page has stayed invisible.
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
// Verify that old state has been retained.
$this->assertEquals($pagecm->visibleold, 0);
// Verify that quiz has been unaffected.
$quizcm = $modinfo->cms[$quiz->cmid];
$this->assertEquals($quizcm->visible, 1);
// Move forum and page back to visible section.
$visiblesection = $modinfo->get_section_info(2);
moveto_module($forumcm, $visiblesection);
moveto_module($pagecm, $visiblesection);
// Reset modinfo cache.
get_fast_modinfo(0, 0, true);
$modinfo = get_fast_modinfo($course);
// Verify that forum has been made visible.
$forumcm = $modinfo->cms[$forum->cmid];
$this->assertEquals($forumcm->visible, 1);
// Verify that page has stayed invisible.
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
// Move the page in the same section (this is what mod duplicate does_
moveto_module($pagecm, $visiblesection, $forumcm);
// Reset modinfo cache.
get_fast_modinfo(0, 0, true);
// Verify that the the page is still hidden
$modinfo = get_fast_modinfo($course);
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
}
/**
* Tests moving a module around in the same section. moveto_module()
* is called this way in modduplicate.
*/
public function test_moveto_module_in_same_section() {
global $DB;
$this->resetAfterTest(true);
$course = $this->getDataGenerator()->create_course(array('numsections' => 3), array('createsections' => true));
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
// Simulate inconsistent visible/visibleold values (MDL-38713).
$cm = $DB->get_record('course_modules', array('id' => $page->cmid), '*', MUST_EXIST);
$cm->visible = 0;
$cm->visibleold = 1;
$DB->update_record('course_modules', $cm);
$modinfo = get_fast_modinfo($course);
$forumcm = $modinfo->cms[$forum->cmid];
$pagecm = $modinfo->cms[$page->cmid];
// Verify that page is hidden.
$this->assertEquals($pagecm->visible, 0);
// Verify section 0 is where all mods added.
$section = $modinfo->get_section_info(0);
$this->assertEquals($section->id, $forumcm->section);
$this->assertEquals($section->id, $pagecm->section);
// Move the forum and the page to a hidden section.
moveto_module($pagecm, $section, $forumcm);
// Reset modinfo cache.
get_fast_modinfo(0, 0, true);
// Verify that the the page is still hidden
$modinfo = get_fast_modinfo($course);
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
}
}
+34 -8
View File
@@ -572,28 +572,54 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$this->resetAfterTest(true);
$course = self::getDataGenerator()->create_course();
$forum = $this->getDataGenerator()->create_module('forum', array('course'=>$course->id));
$forumdescription = 'This is the forum description';
$forum = $this->getDataGenerator()->create_module('forum',
array('course'=>$course->id, 'intro' => $forumdescription),
array('showdescription' => true));
$forumcm = get_coursemodule_from_id('forum', $forum->cmid);
$forumcontext = context_module::instance($forum->cmid);
$data = $this->getDataGenerator()->create_module('data', array('assessed'=>1, 'scale'=>100, 'course'=>$course->id));
$datacontext = context_module::instance($data->cmid);
$datacm = get_coursemodule_from_instance('page', $data->id);
$page = $this->getDataGenerator()->create_module('page', array('course'=>$course->id));
$pagecontext = context_module::instance($page->cmid);
$pagecm = get_coursemodule_from_instance('page', $page->id);
$labeldescription = 'This is a very long label to test if more than 50 characters are returned.
So bla bla bla bla <b>bold bold bold</b> bla bla bla bla.';
$label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
'intro' => $labeldescription));
$labelcm = get_coursemodule_from_instance('label', $label->id);
// Set the required capabilities by the external function.
$context = context_course::instance($course->id);
$roleid = $this->assignUserCapability('moodle/course:view', $context->id);
$this->assignUserCapability('moodle/course:update', $context->id, $roleid);
$courses = core_course_external::get_course_contents($course->id, array());
$sections = core_course_external::get_course_contents($course->id, array());
// We need to execute the return values cleaning process to simulate the web service server.
$courses = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $courses);
$sections = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $sections);
// Check that the course has the 3 created modules
$this->assertEquals(3, count($courses[0]['modules']));
// Check that forum and label descriptions are correctly returned.
$firstsection = array_pop($sections);
$modinfo = get_fast_modinfo($course);
$testexecuted = 0;
foreach($firstsection['modules'] as $module) {
if ($module['id'] == $forumcm->id and $module['modname'] == 'forum') {
$cm = $modinfo->cms[$forumcm->id];
$formattedtext = format_text($cm->get_content(), FORMAT_HTML,
array('noclean' => true, 'para' => false, 'filter' => false));
$this->assertEquals($formattedtext, $module['description']);
$testexecuted = $testexecuted + 1;
} else if ($module['id'] == $labelcm->id and $module['modname'] == 'label') {
$cm = $modinfo->cms[$labelcm->id];
$formattedtext = format_text($cm->get_content(), FORMAT_HTML,
array('noclean' => true, 'para' => false, 'filter' => false));
$this->assertEquals($formattedtext, $module['description']);
$testexecuted = $testexecuted + 1;
}
}
$this->assertEquals(2, $testexecuted);
// Check that the only return section has the 4 created modules
$this->assertEquals(4, count($firstsection['modules']));
}
/**
+4 -1
View File
@@ -509,7 +509,9 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.setAttrs({
'name' : 'title',
'value' : titletext,
'autocomplete' : 'off'
'autocomplete' : 'off',
'aria-describedby' : 'id_editinstructions',
'maxLength' : '255'
})
.addClass('titleeditor');
var editform = Y.Node.create('<form />')
@@ -517,6 +519,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.setAttribute('action', '#');
var editinstructions = Y.Node.create('<span />')
.addClass('editinstructions')
.setAttrs({'id' : 'id_editinstructions'})
.set('innerHTML', M.util.get_string('edittitleinstructions', 'moodle'));
var activityicon = element.one('img.activityicon').cloneNode();
+8 -1
View File
@@ -96,9 +96,16 @@ switch ($action) {
$page = optional_param('page', 0, PARAM_INT);
$outcome->response = $manager->search_other_users($search, $searchanywhere, $page);
$extrafields = get_extra_user_fields($context);
$useroptions = array();
// User is not enrolled, either link to site profile or do not link at all.
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
$useroptions['courseid'] = SITEID;
} else {
$useroptions['link'] = false;
}
foreach ($outcome->response['users'] as &$user) {
$user->userId = $user->id;
$user->picture = $OUTPUT->user_picture($user);
$user->picture = $OUTPUT->user_picture($user, $useroptions);
$user->fullname = fullname($user);
$fieldvalues = array();
foreach ($extrafields as $field) {
+1 -1
View File
@@ -316,7 +316,7 @@ class core_enrol_external extends external_api {
}
list($enrolledsqlselect, $enrolledparams) = get_enrolled_sql($context);
$enrolledsql = "SELECT COUNT(*) FROM ($enrolledsqlselect) AS enrolleduserids";
$enrolledsql = "SELECT COUNT('x') FROM ($enrolledsqlselect) enrolleduserids";
$enrolledusercount = $DB->count_records_sql($enrolledsql, $enrolledparams);
$result[] = array('id'=>$course->id, 'shortname'=>$course->shortname, 'fullname'=>$course->fullname, 'idnumber'=>$course->idnumber,'visible'=>$course->visible, 'enrolledusercount'=>$enrolledusercount);
+8 -1
View File
@@ -71,8 +71,15 @@ switch ($action) {
$perpage = optional_param('perpage', 25, PARAM_INT); // This value is hard-coded to 25 in quickenrolment.js
$outcome->response = $manager->get_potential_users($enrolid, $search, $searchanywhere, $page, $perpage, $addedenrollment);
$extrafields = get_extra_user_fields($context);
$useroptions = array();
// User is not enrolled yet, either link to site profile or do not link at all.
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
$useroptions['courseid'] = SITEID;
} else {
$useroptions['link'] = false;
}
foreach ($outcome->response['users'] as &$user) {
$user->picture = $OUTPUT->user_picture($user);
$user->picture = $OUTPUT->user_picture($user, $useroptions);
$user->fullname = fullname($user);
$fieldvalues = array();
foreach ($extrafields as $field) {
+10
View File
@@ -420,3 +420,13 @@ class grade_export_update_buffer {
}
}
/**
* Verify that there is a valid set of grades to export.
* @param $courseid int The course being exported
*/
function export_verify_grades($courseid) {
$regraderesult = grade_regrade_final_grades($courseid);
if (is_array($regraderesult)) {
throw new moodle_exception('gradecantregrade', 'error', '', implode(', ', array_unique($regraderesult)));
}
}
+1
View File
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
require_capability('gradeexport/ods:view', $context);
print_grade_page_head($COURSE->id, 'export', 'ods', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods'));
export_verify_grades($COURSE->id);
if (!empty($CFG->gradepublishing)) {
$CFG->gradepublishing = has_capability('gradeexport/ods:publish', $context);
+1
View File
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
require_capability('gradeexport/txt:view', $context);
print_grade_page_head($COURSE->id, 'export', 'txt', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt'));
export_verify_grades($COURSE->id);
if (!empty($CFG->gradepublishing)) {
$CFG->gradepublishing = has_capability('gradeexport/txt:publish', $context);
+1
View File
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
require_capability('gradeexport/xls:view', $context);
print_grade_page_head($COURSE->id, 'export', 'xls', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls'));
export_verify_grades($COURSE->id);
if (!empty($CFG->gradepublishing)) {
$CFG->gradepublishing = has_capability('gradeexport/xls:publish', $context);
+1
View File
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
require_capability('gradeexport/xml:view', $context);
print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml'));
export_verify_grades($COURSE->id);
if (!empty($CFG->gradepublishing)) {
$CFG->gradepublishing = has_capability('gradeexport/xml:publish', $context);
@@ -36,7 +36,7 @@ $string['criterionmovedown'] = 'Move down';
$string['criterionmoveup'] = 'Move up';
$string['definerubric'] = 'Define rubric';
$string['description'] = 'Description';
$string['enableremarks'] = 'Allow grader to add text remarks for each criteria';
$string['enableremarks'] = 'Allow grader to add text remarks for each criterion';
$string['err_mintwolevels'] = 'Each criterion must have at least two levels';
$string['err_nocriteria'] = 'Rubric must contain at least one criterion';
$string['err_nodefinition'] = 'Level definition can not be empty';
+4 -3
View File
@@ -22,7 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once $CFG->libdir.'/gradelib.php';
require_once($CFG->libdir . '/gradelib.php');
require_once($CFG->dirroot . '/grade/export/lib.php');
/**
* This class iterates over all users that are graded in a course.
@@ -128,7 +129,7 @@ class graded_users_iterator {
$this->close();
grade_regrade_final_grades($this->course->id);
export_verify_grades($this->course->id);
$course_item = grade_item::fetch_course_item($this->course->id);
if ($course_item->needsupdate) {
// can not calculate all final grades - sorry
@@ -2461,7 +2462,7 @@ abstract class grade_helper {
return self::$managesetting;
}
$context = context_course::instance($courseid);
if (has_capability('moodle/course:update', $context)) {
if (has_capability('moodle/grade:manage', $context)) {
self::$managesetting = new grade_plugin_info('coursesettings', new moodle_url('/grade/edit/settings/index.php', array('id'=>$courseid)), get_string('course'));
} else {
self::$managesetting = false;
+8 -3
View File
@@ -358,7 +358,12 @@ abstract class grade_report {
// If we're dealing with multiple courses we need to know when we've moved on to a new course.
static $previous_courseid = null;
if( $this->showtotalsifcontainhidden==GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN ) {
if (!is_array($this->showtotalsifcontainhidden)) {
debugging('showtotalsifcontainhidden should be an array', DEBUG_DEVELOPER);
$this->showtotalsifcontainhidden = array($courseid => $this->showtotalsifcontainhidden);
}
if ($this->showtotalsifcontainhidden[$courseid] == GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN) {
return $finalgrade;
}
@@ -396,7 +401,7 @@ abstract class grade_report {
//if the item definitely depends on a hidden item
if (array_key_exists($course_item->id, $hiding_affected['altered'])) {
if( !$this->showtotalsifcontainhidden ) {
if( !$this->showtotalsifcontainhidden[$courseid] ) {
//hide the grade
$finalgrade = null;
}
@@ -406,7 +411,7 @@ abstract class grade_report {
}
} else if (!empty($hiding_affected['unknown'][$course_item->id])) {
//not sure whether or not this item depends on a hidden item
if( !$this->showtotalsifcontainhidden ) {
if( !$this->showtotalsifcontainhidden[$courseid] ) {
//hide the grade
$finalgrade = null;
}
+5 -2
View File
@@ -71,8 +71,6 @@ class grade_report_overview extends grade_report {
global $CFG, $COURSE, $DB;
parent::__construct($COURSE->id, $gpr, $context);
$this->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
// Get the user (for full name).
$this->user = $DB->get_record('user', array('id' => $userid));
@@ -81,12 +79,17 @@ class grade_report_overview extends grade_report {
$this->showrank = array();
$this->showrank['any'] = false;
$this->showtotalsifcontainhidden = array();
if ($this->courses) {
foreach ($this->courses as $course) {
$this->showrank[$course->id] = grade_get_setting($course->id, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank));
if ($this->showrank[$course->id]) {
$this->showrank['any'] = true;
}
$this->showtotalsifcontainhidden[$course->id] = grade_get_setting($course->id, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
}
}
+7
View File
@@ -0,0 +1,7 @@
This files describes API changes in /grade/report/*,
information provided here is intended especially for developers.
=== 2.3.5, 2.4.2 ===
* class_grade_report::showtotalsifcontainhidden has been switched from a single integer value to an array.
The array keys are course IDs while the array values are the value of the course setting "report_overview_showtotalsifcontainhidden".
+1 -1
View File
@@ -165,7 +165,7 @@ class grade_report_user extends grade_report {
$this->showrank = grade_get_setting($this->courseid, 'report_user_showrank', $CFG->grade_report_user_showrank);
$this->showpercentage = grade_get_setting($this->courseid, 'report_user_showpercentage', $CFG->grade_report_user_showpercentage);
$this->showhiddenitems = grade_get_setting($this->courseid, 'report_user_showhiddenitems', $CFG->grade_report_user_showhiddenitems);
$this->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden);
$this->showtotalsifcontainhidden = array($this->courseid => grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden));
$this->showgrade = grade_get_setting($this->courseid, 'report_user_showgrade', !empty($CFG->grade_report_user_showgrade));
$this->showrange = grade_get_setting($this->courseid, 'report_user_showrange', !empty($CFG->grade_report_user_showrange));
+6 -6
View File
@@ -120,15 +120,15 @@ class gradereportlib_testcase extends advanced_testcase {
$report = new grade_report_test($course->id, $gpr, $coursecontext, $student);
// Should return the supplied student total grade regardless of hiding.
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals($datagrade + $forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
// Should blank the student total as course grade depends on a hidden item.
$report->showtotalsifcontainhidden = GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
// Should return the course total minus the hidden database activity grade.
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals($forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
// Note: we cannot simply hide modules and call $report->blank_hidden_total() again.
@@ -182,16 +182,16 @@ class gradereportlib_testcase extends advanced_testcase {
$report = new grade_report_test($course->id, $gpr, $coursecontext, $student);
// Should return the supplied student total grade regardless of hiding.
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals($datagrade + $forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
// Should blank the student total as course grade depends on a hidden item.
$report->showtotalsifcontainhidden = GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
// Should return the course total minus the hidden activity grades.
// They are both hidden so should return null.
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN;
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN);
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
}
}
+1 -1
View File
@@ -45,7 +45,7 @@ $string['datarootpermission'] = 'Zugriffsrechte zum Datenverzeichnis';
$string['dbprefix'] = 'Tabellen-Prefix';
$string['dirroot'] = 'Moodle-Verzeichnis';
$string['environmenthead'] = 'Installationsvoraussetzungen werden geprüft ...';
$string['environmentsub2'] = 'Jede Moodle-Version hat Mindestvoraussetzungen für der PHP-Version und für verbindliche PHP-Extensions. Vor einer Installation oder einer Aktualisierung wird eine vollständige Prüfung durchgeführt. Bitte fragen Sie den Server-Administrator, wenn Sie mit der Installation einer neuen Version oder mit der Aktivierung von PHP-Extensions nicht weiterkommen.';
$string['environmentsub2'] = 'Jede Version hat Mindestvoraussetzungen für der PHP-Version und für verbindliche PHP-Extensions. Vor einer Installation oder einer Aktualisierung wird eine vollständige Prüfung durchgeführt. Bitte fragen Sie den Administrator des Servers, wenn Sie mit der Installation einer neuen Version oder mit der Aktivierung von PHP-Extensions nicht weiterkommen.';
$string['errorsinenvironment'] = 'Fehler bei der Prüfung der Systemvoraussetzungen!';
$string['installation'] = 'Installation';
$string['langdownloaderror'] = 'Leider konnte das Sprachpaket \'{$a}\' nicht heruntergeladen werden. Die Installation wird in englischer Sprache fortgesetzt.';
+42
View File
@@ -0,0 +1,42 @@
<?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['clianswerno'] = 'n';
$string['cliansweryes'] = 'y';
$string['cliincorrectvalueerror'] = 'ནོར་བ། "{$a->option}"དོན་ལུ་ འཛོལ་འཛོལ་བའི་གནས་ཚད "{$a->value}"';
$string['cliincorrectvalueretry'] = 'འཛོལ་འཛོལ་བའི་གནད་ཚད་ནང་འདུག སླར་རྩོལ།';
$string['clitypevalue'] = 'གནས་ཚད་དབྱེ་བ།';
$string['clitypevaluedefault'] = 'གནས་ཚད་དབྱེ་བ། Enter ཨེབ་སྟེ་སྔོན་སྒྲིག་གི་ཨང་({$a})';
$string['cliunknowoption'] = 'ངོས་འཛིན་འབད་མ་ཚུགས་པའི་གདམ་ཁ་འདུག: {$a} གྲོགས་རམ་གྱི་གདམ་ཁ་འདི་ལག་ལེན་འཐབ་ད།';
$string['cliyesnoprompt'] = 'y ཟེར་འབྲི་བ་ཅིན་ཨིནཟེརཝ་དང་ n ཟེར་འབྲི་བ་ཅིན་མིན་)';
$string['environmentrequireinstall'] = 'གཞི་བཙུགས་འབད་དི་ལྕོགས་ཅན་བཟོ་དགོ།';
$string['environmentrequireversion'] = 'ཐོན་རིམ་ {$a->needed}དགོས་མཁོ་ཡོདཔ་ལས་ ཁྱོད་ཀྱི་ {$a->current}གཡོག་བཀོལ་བའི་བསྒང་ཡོད།';
+48
View File
@@ -0,0 +1,48 @@
<?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['cannotcreatelangdir'] = 'སྐད་ཡིག་སྣོད་ཐོ་ གསར་བསྐྲུན་འབད་མི་བཏུབ།';
$string['cannotcreatetempdir'] = 'གནས་སྐབས་ཀྱི་སྣོད་ཐོ་ གསར་བསྐྲུན་འབད་མི་བཏུབ།';
$string['cannotdownloadcomponents'] = 'ཆ་ཤས་ཚུ་ཕབ་ལེན་འབད་མི་བཏུབ།';
$string['cannotdownloadzipfile'] = 'ZIP ཡིག་སྣོད་ཕབ་ལེན་འབད་མི་བཏུབ།';
$string['cannotfindcomponent'] = 'ཆ་ཤས་མི་ཐོབ།';
$string['cannotsavemd5file'] = 'md5 ཡིག་སྣོད་ སྲུངས་མི་བཏུབ།';
$string['cannotsavezipfile'] = 'ZIP ཡིག་སྣོད་ སྲུངས་མི་བཏུབ།';
$string['cannotunzipfile'] = 'ཡིག་སྣོད་ unzip འབད་མི་བཏུབ།';
$string['componentisuptodate'] = 'ཆ་ཤས་འདི་ དུས་མཐུན་སྦེ་ཡོད།';
$string['downloadedfilecheckfailed'] = 'ཕབ་ལེན་འབད་ཡོད་པའི་ཡིག་སྣོད་ཞིབ་དཔྱད་འཐུས་ཤོར་བྱུང་ཡོདཔ།';
$string['invalidmd5'] = 'check འགྱུར་ཅནའདི་ཕྱི་འགྱུར་ཨིན་མས་ - ལོག་འབད་གནང་།';
$string['missingrequiredfield'] = 'དགོ་པའི་ས་སྒོ་འདི་མིན་འདུག';
$string['remotedownloaderror'] = 'ཁྱོད་ཀྱི་server ་ལུ་ཆ་ཤས་ཕབ་ལེན་འབདཝ་ད་འཛོལ་བ་བྱུང་ཡོདཔ་ལས་ པོརོག་སི་སྒྲིག་སྟངས་ཚུ་བདེན་སྦྱོར་འབད་དགོ་པའི་ཁར་ PHP cURLརྒྱ་བསྐྱེད་འདི་འོས་སྦྱོར་འབད་ཡོདཔ་ཨིན། <br /><br />ཁྱོད་ཀྱིས་ ལག་ཐོག་ལས་ <a href="{$a->url}">{$a->url}</a>་ཕབ་ལེན་འབད་ཞིནམ་ལས་ ཁྱོད་རའི་སར་བར་ "{$a->dest}" ནང་འདྲ་བཤུས་བརྐྱབ་ཞིནམ་ལས་ དེ་ཁར་ཛིབ་འབད་བཤོལ།';
$string['wrongdestpath'] = 'བཞག་སྣོད་རྒྱུ་ལམ་འཛོལ་བ།';
$string['wrongsourcebase'] = 'འབྱུང་ས་URLགཞི་རྟེན་འཛོལ་བ།';
$string['wrongzipfilename'] = 'ZIP་ཡིག་སྣོད་མིང་འཛོལ་བ།';
+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['admindirname'] = 'བདག་སྐྱོང་ སྣོད་ཐོ་';
$string['availablelangs'] = 'ཐོབ་ཡོད་པའི་སྐད་ཡིག་ཚུ་གྱི་ཐོ་བཀོད།';
$string['chooselanguagehead'] = 'སྐད་ཡིག་ སེལ་འཐུ་འབད།';
$string['chooselanguagesub'] = 'གཞི་བཙུགས་ཀྱི་དོན་ལུ་རྐྱངམ་ཅིག་ སྐད་ཡིག་གཅིག་སེལ་འཐུ་འབད། ཁྱོད་ཀྱིས་ ས་ཁོངས་དང་ ལག་ལེན་པའི་སྐད་ཡིག་ཚུ་ ཤུལ་མམ་གྱི་ གསལ་གཞི་ནང་ སེལ་འཐུ་འབད་ཚུགས།';
$string['clialreadyconfigured'] = 'ཡིག་སྣོད་config.php་འདི་ཧེ་མ་ལས་འདུག།ཁྱོད་ཨ་ནཱི་ས་ཁོངས་གཞི་བཙུགས་འབད་བ་ཅིན་admin/cli/install_database.php་དེ་ལག་ལོན་འཐབ་གནང།';
$string['clialreadyinstalled'] = 'ཡིག་སྣོད་config.php་འདི་ཧེ་མ་ལས་འདུག།ཁྱོད་ཨ་ནཱི་ས་ཁོངས་ཡར་བསྐྱེད་འབད་བ་ཅིན་admin/cli/upgrade.php་དེ་ལག་ལོན་འཐབ་གནང།';
$string['cliinstallheader'] = 'Moodle {$a} command line installation program';
$string['databasehost'] = 'གནས་སྡུད་གཞི་རྟེན་host';
$string['databasename'] = 'གནས་སྡུད་གཞི་རྟེན་ མིང་།';
$string['databasetypehead'] = 'Choose database driver';
$string['dataroot'] = 'གནས་སྡུད་ སྣོད་ཐོ་';
$string['datarootpermission'] = 'Data directories permission';
$string['dbprefix'] = 'Tables prefix';
$string['dirroot'] = 'Moodle སྣོད་ཐོ།';
$string['environmenthead'] = 'ཁྱོད་རའི་ མཐའ་འཁོར་ཞིབ་དཔྱད་འབད་དོ་་་';
$string['environmentsub2'] = 'Moodleའཛིན་གྲོལ་རེ་རེ་གྱི་PHP་འཛིན་གྲོལ་དག་པ་ཅིག་དང་PHP extensionsངེས་མཁོ་དགོཔ་ཨིན།གཞི་བཙུགས་དང་ཡར་བསྐྱེད་་མ་བཟོ་བའི་ཧེ་མFull environmentཞིབ་དཔྱད་འབད་འོང་།';
$string['errorsinenvironment'] = 'Environment check failed!';
$string['installation'] = 'གཞི་བཙུགས།';
$string['langdownloaderror'] = 'སྐད་ཡིག་ "{$a}"འདི་ གཞི་བཙུགས་འབད་དེ་མིན་ནུག། གཞི་བཙུགས་འདི་ ཨིན་སྐད་ནང་ འཕྲོ་མཐུད་དེ་འབད་ནི་ཨིན།';
$string['memorylimithelp'] = '<p>ད་ལྟོ་ཁྱོད་ཀྱི་སར་བར་གྱི་དོན་ལུ་ PHP དྲན་ཚད་དེ་ $a ལུ་གཞི་སྒྲིག་འབད་དེ་འདུག།</p> <p> འདི་གིས་ཤུལ་ལས་ མུ་ཌལ་ལུ་ དྲན་ཚད་ཀྱི་དཀའ་ངལ་ཚུ་འབྱུང་བཅུག་འོང་ཝ། འདི་གི་ནང་ལས་ཡང་ ཁྱོད་ཀྱི་མུ་ཌལ་དང་ལག་ལེན་པ་ལོ་ཤ་ལྕོགས་ཅན་བཟོ་ཡོད་པ་ཅིན་ དཀའ་ངལ་འབྱུང་འོང་།</p> <p> ཁྱོད་ཀྱིས་ 40M བཟུམ་གྱི་ PHP དྲན་ཚད་ མང་སུ་ཡོད་མི་ རིམ་སྒྲིག་འབད་བ་ཅིན་ ལེགས་ཤོམ་འོང་། འདི་འབད་ནི་གི་དོན་ལུ་ ཐབས་ཤེས་ ལེ་ཤ་ཡོད་:</p> <ol> <li> ཁྱོད་ཀྱིས་ <i>--enable-memory-limit</i> དང་གཅིག་ཁར་ PHP ལོག་ཕྱོགས་སྒྲིག་འབད་ཚུགས་པ་ཅིན་ འདི་གི་ས་ མུ་ཌལ་གི་དྲན་ཚད་ཁོ་ར་གིས་སྦེ་ གཞི་སྒྲིག་འབད་ཚུགས།</li> <li>ཁྱོད་རའི་ php.ini ཡིག་སྣོད་ནང་འཛུལ་སྤྱོད་འབད་ཚུགས་པ་ཅིན་ ཁྱོད་ཀྱི་ <b>memory_limit</b>སྒྲིག་སྟངས་འདི་ 40M བཟུམ་གཅིག་ལུ་ བསྒྱུར་བཅོས་འབད་ཚུགས། ག་དེམ་ཅིག་སྦེ་འཛུལ་སྤྱོད་འབད་མ་ཚུགས་པ་ཅིན་ ཁྱོད་རའི་བདག་སྐྱོང་པ་ལུ་ འབད་བཅུག། <li> PHP སར་བར་ ལ་ལོ་གཅིག་ནང་ འོག་གི་གྲལ་ཐིག་ཚུ་ཡོད་མི་ མུ་ཌལ་སྣོད་ཐོ་ནང་ཁྱོད་ཀྱིས་ .htaccess ཡིག་སྣོད་གསར་བསྐྲུན་འབད་ཚུགས། <blockquote><div>php_value memory_limit 40M</div></blockquote> <p> དེ་འབདཝ་ད་ལུ་ སར་བར་ལ་ལོ་གཅིག་ནང་ འདི་གིས་ <b>all</b> PHP ཤོག་ལེབ་ཚུ་ གཡོག་བཀོལ་ནི་ལུ་སྔོན་བཀག་འབདཝ་ཨིན། (ཤོག་ལེབ་ཚུ་ནང་བལྟ་བའི་སྐབས་ འཛོལ་བ་ཚུ་མཐོང་འོང་) དེ་འབདཝ་ལས་ .htaccess ཡིག་སྣོད་་རྩ་བསྐྲད་གཏང་དགོ།</p></li> </ol>';
$string['paths'] = 'Paths';
$string['pathserrcreatedataroot'] = 'Data directory ({$a->dataroot}) cannot be created by the installer.';
$string['pathshead'] = 'Confirm paths';
$string['pathsrodataroot'] = 'Dataroot directory is not writable.';
$string['pathsroparentdataroot'] = 'Parent directory ({$a->parent}) is not writeable. Data directory ({$a->dataroot}) cannot be created by the installer.';
$string['pathssubadmindir'] = 'webhostsདག་པ་ཅིག་ /admin ལག་ལེན་འཐབ་འབད་དམིགས་བསལ་ URL འདི་control panel or somethingའཛུལ་སྤྱོད་འབདཝ་ཨིན། ཁ་རྗེ་མེད་པར་ Moodleབདག་སྐྱོང་ཤོག་ལེབ་ཚུ་གྱི་ཚད་ལྡན་གནས་ཁོངས་གཅིག་ཁར་མི་མཐུན་ཨིན། ཁྱོད་ཀྱི་དཀའ་ངལ་དེ་ བདག་སྐྱོང་ཀྱི་སྣོད་ཐོ་ གཞི་བཙུགས་འབད་བའི་གང་བསྐྱར་མིང་བཏགས་སྦེ་སེལ་ཚུགས། དཔེར་ན: <em>moodleadmin</em>. འདི་གྱི་Moodle ནང་ན་བདག་སྐྱོང་འབྲེལ་ལམ་ཚུ་གྱི་དཀའ་ངལ་་སེལ་ཚུགས་ཨིན།';
$string['pathssubdataroot'] = 'སྐྱེལ་བཙུགས་ཚར་མི་ཡིག་སྣོད་ཚུ་Moodleགྱི་སྲུངས་བཞག་ནི་གྱི་དོན་ལུ་ས་གནས་དགོ།ཨ་ནི་སྣོད་ཐོ(ས་གནས་)དི་web serverལག་ལེན་པ་(usually \'nobody\' or \'apache\')གྱི་readable AND WRITEABLE དགོ འདི་འབདཝ་ད་ web ལས་འཛུལ་སྤྱོད་ཐད་ཀར་འབད་ནི་མེད་འོང་།་The installer will try to create it if doesn\'t exist.';
$string['pathssubdirroot'] = 'Moodle installation ལུ་སྣོད་ཐོ་གི་འགྲུལ་ལམ་ག་ར་བྱིན་།';
$string['pathssubwwwroot'] = 'Moodleའཛུལ་སྤྱོད་འབད་ནི་དོན་ལུ་Web གྱི་ཁ་བྱང་ག་ར་བྱིན་དགོ། སྣ་མང་ཁ་བྱང་ཚུ་གྱི་Moodleའཛུལ་སྤྱོད་འབད་མི་ཚུགས། ག་དེམ་ཅིག་འབད་ཁྱོད་ཀྱི་སྣ་མང་མི་མང་གི་ཁ་བྱང་ཚུ་ཡོད་པ་ཅིན་ འདི་མ་གཏོགས་གཞན་ག་ར་གུ་རྟག་བརྟན་སླར་ལོག་གཏང་ནི་དོན་ལུ་གཞི་སྒྲིག་འབད་དགོ། Intranet and Internet་གཉིས་ལས་ཁྱོད་ཀྱི་ས་ཁོངས་དེ་འཛུལ་སྤྱོད་འབད་བ་ཅིན་ མི་མང་གི་ཁ་བྱང་ལག་ལེན་འཐབ་དི་འབདཝ་ལས་Intranetལག་ལེན་པ་ཚུ་གྱི་ཡང་མི་མང་གི་ཁ་བྱང་ལག་ལེན་འཐབ་ཚུགས།
ག་དེམ་ཅིག་འབད་ཁྱོད་ཀྱི་ཁ་བྱང་ངེས་བདེན་མེན་བ་ཅིན་ཁྱོད་ཀྱི་browserནང་ན་URL་དེ་བསྒྱུར་བཅོས་འབད་སྦེ་ ལོག་installation with a different value.འགོ་བཙུགས།';
$string['pathsunsecuredataroot'] = 'Dataroot location is not secure';
$string['pathswrongadmindir'] = 'Admin directory does not exist';
$string['phpextension'] = '{$a} PHP extension';
$string['phpversion'] = 'PHP ཐོན་རིམ།';
$string['phpversionhelp'] = '<p>Moodle་ལུ་ ཐོན་རིམ་འདི་ ཉུང་མཐའ་ལུ་ 4.3.0 ཡང་ན་ 5.1.0 དགོ། (5.0.x ལུ་ ཤེས་ཚུགས་པའི་དཀའ་ངལ་ ལེ་ཤ་འདུག་)</p> <p>ཁྱོད་ད་ལྟོ་ཐོན་རིམ་$a གཡོག་བཀོལ་དོ་</p> <p>PHP ཡར་བསྐྱེད་འབད་དགོ་ ཡང་ན་ PHP ཐོན་རིམ་གསརཔ་ཡོད་མི་ ཧོསིཊ་གཅིག་དང་གཅིག་ཁར་ སྤོ་བཤུད་འབད།!<br /> (5.0.x ནང་ལུ་ ཁྱོད་ཀྱིས་ ཐོན་རིམ་ 4.4.x ལུ་ མར་ཕབ་འབད་ཚུགས།)</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'ཁྱོད་རའི་ གློག་རིག་ནང་ <strong>{$a->packname} {$a->packversion}</strong> package འདི་ མཐའ་འཁྱོལཅན་སྦེ་ གཞི་བཙུགས་དང་ གསར་བཙུགས་འབད་ཡོདཔ་ལས་བརྟེན་ ཁྱོད་ཀྱིས་འ་ནི་ ཤོག་ལེབ་འདི་བལྟ་ཚུགསཔ་ཨིན། བཀྲིས་བདེ་ལེགས་!';
$string['welcomep30'] = '<strong>{$a->installername}</strong> གསར་བཏོན་འབད་མི་ནང་ <strong>Moodle</strong> བཀོལ་སྤྱོད་འབད་བཏུབ་མི་ མཐའ་འཁོར་གསར་བསྐྲུན་འབད་མི་གློག་རིམ་ཚུ་ཡང་ཚུདཔ་ཨིན།';
$string['welcomep40'] = 'ཐུམ་སྒྲིལ་འདི་ནང་ལུ་ <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong> ཡང་ ཚུདཔ་ཨིན།';
$string['welcomep50'] = 'ཐུམ་སྒྲིལ་འདི་ནང་ལུ་ གློག་རིམ་ཆ་མཉམ་གྱི་ལག་ལེན་ཚུ་ ཁོང་རའི་ ཆོག་ཐམ་ལུ་ དབང་ཚད་ཡོདཔ་ཨིན། <strong>{$a->installername}</strong> ཐུམ་སྒྲིལ་ཆ་ཚང་འདི་ <a href="http://www.opensource.org/docs/definition_plain.html">open source</a> ཨིནམ་དང་ <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> ཆོག་ཐམ་དང་འཁྲིལ་ཏེ་ བགོ་བཀྲམ་འབད་འབདཝ་ཨིན།';
$string['welcomep60'] = 'འོག་གི་ཤོག་ལེབ་ཚུ་གིས་ ཁྱོད་རའི་གློག་རིག་ནང<strong>Moodle</strong> རིམ་སྒྲིག་འབད་ནིའི་ ཐབས་ལམ་ འཇམ་ཏོང་ཏོ་ཚུ་སྟོན་འོང་། སྔོན་སྒྲིག་ སྒྲིག་སྟངས་ཚུ་ དང་ལེན་འབད་ ཡང་ན་ ཁྱོད་རའི་དགོས་མཁོ་དང་བསྟུན་ཏེ་ འདི་ཚུ་ བསྒྱུར་བཅོས་འབད།';
$string['welcomep70'] = '<strong>Moodle</strong> གཞི་སྒྲིག་ འཕྲོ་མཐུད་དེ་འབད་ནིའི་དོན་ལུ་ "Next" ཨེབ་རྟ་གུ་ ཨེབ་གཏང་འབད།';
$string['wwwroot'] = 'Web ཁ་བྱང་ཚུ་';
+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['thisdirection'] = 'ltr';
$string['thislanguage'] = 'རྫོང་ཁ';
+1 -1
View File
@@ -41,7 +41,7 @@ $string['databasehost'] = 'Serveur de base de données';
$string['databasename'] = 'Nom de la base de données';
$string['databasetypehead'] = 'Sélectionner un pilote de base de données';
$string['dataroot'] = 'Dossier de données';
$string['datarootpermission'] = 'Permissions du dossier de données';
$string['datarootpermission'] = 'Droits d\'accès au dossier de données';
$string['dbprefix'] = 'Préfixe des tables';
$string['dirroot'] = 'Dossier Moodle';
$string['environmenthead'] = 'Vérification de l\'environnement...';
+12 -2
View File
@@ -30,5 +30,15 @@
defined('MOODLE_INTERNAL') || die();
$string['environmentrequireinstall'] = 'é solicitada para ser instalada/activada.';
$string['environmentrequireversion'] = 'Solicítase a versión {$a->needed} e está a executar a {$a->current}';
$string['clianswerno'] = 'n';
$string['cliansweryes'] = 's';
$string['cliincorrectvalueerror'] = 'Erro, o valor «{$a->value}» é incorrecto para «{$a->option}»';
$string['cliincorrectvalueretry'] = 'Valor incorrecto. Ténteo outra vez.';
$string['clitypevalue'] = 'valor do tipo';
$string['clitypevaluedefault'] = 'valor do tipo, prema Intro para empregar o valor predeterminado ({$a})';
$string['cliunknowoption'] = 'Opcións non recoñecidas:
{$a}
Use a opción --help.';
$string['cliyesnoprompt'] = 'escriba s (si) ou n (non)';
$string['environmentrequireinstall'] = 'debe ser instalado e activado';
$string['environmentrequireversion'] = 'requírese a versión {$a->needed} e está a executar a {$a->current}';
+10 -10
View File
@@ -30,16 +30,16 @@
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatelangdir'] = 'Non pode crear directorio de idioma';
$string['cannotcreatetempdir'] = 'Non pode crear directorio de tempo';
$string['cannotdownloadcomponents'] = 'Non pode descargar compoñentes.';
$string['cannotdownloadzipfile'] = 'Non pode descargar ficheiros ZIP.';
$string['cannotfindcomponent'] = 'Non pode encontrar compoñentes';
$string['cannotsavemd5file'] = 'Non pode gardar o ficheiro md5.';
$string['cannotsavezipfile'] = 'Non pode gardar un ficheiro ZIP.';
$string['cannotunzipfile'] = 'Non pode descomprimir o ficheiro.';
$string['componentisuptodate'] = 'O compoñente está actualizado.';
$string['downloadedfilecheckfailed'] = 'Fallou a verificación do ficheiro descargado.';
$string['cannotcreatelangdir'] = 'Non se pode crear o directorio de idioma';
$string['cannotcreatetempdir'] = 'Non se pode crear un directorio temporal';
$string['cannotdownloadcomponents'] = 'Non foi posíbel descargar compoñentes';
$string['cannotdownloadzipfile'] = 'Non foi posíbel descargar o ficheiro ZIP';
$string['cannotfindcomponent'] = 'Non foi posíbel atopar o compoñente';
$string['cannotsavemd5file'] = 'Non é posíbel gardar o ficheiro md5';
$string['cannotsavezipfile'] = 'Non é posíbel gardar o ficheiro ZIP';
$string['cannotunzipfile'] = 'Non é posíbel descomprimir o ficheiro';
$string['componentisuptodate'] = 'O compoñente está actualizado';
$string['downloadedfilecheckfailed'] = 'A comprobación do ficheiro descargado non foi satisfactoria';
$string['invalidmd5'] = 'md5 non válido';
$string['missingrequiredfield'] = 'Falta algún campo obrigatorio';
$string['wrongdestpath'] = 'Camiño de destino errado.';
+68 -28
View File
@@ -30,41 +30,81 @@
defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Directorio de administración';
$string['availablelangs'] = 'Paquetes de idioma dispoñibles';
$string['chooselanguagehead'] = 'Escolla idioma';
$string['chooselanguagesub'] = 'Escolla un idioma para a instalación. Poderá escoller o idioma do sitio e o idioma de usuario en próximas pantallas.';
$string['admindirname'] = 'Directorio Admin';
$string['availablelangs'] = 'Lista de idiomas dispoñíbeis';
$string['chooselanguagehead'] = 'Escolla un idioma';
$string['chooselanguagesub'] = 'Escolla un idioma para o proceso de instalación. Este idioma empregarase tamén como idioma predeterminado do sitio, se ben pode cambiarse máis adiante.';
$string['clialreadyconfigured'] = 'Xa existe o ficheiro config.php. Empregue admin/cli/install_database.php se quere actualizar o seu sitio web.';
$string['clialreadyinstalled'] = 'Xa existe o ficheiro config.php. Empregue admin/cli/upgrade.php se quere actualizar o seu sitio web.';
$string['cliinstallheader'] = 'Programa de instalación de Moodle en liña de ordes {$a}';
$string['databasehost'] = 'Enderezo/máquina da base de datos';
$string['databasename'] = 'Nome de base de datos';
$string['databasetypehead'] = 'Escolla o controlador da base de datos';
$string['dataroot'] = 'Directorio de datos';
$string['datarootpermission'] = 'Permisos dos directorios de datos';
$string['dbprefix'] = 'Prefixo das táboas';
$string['dirroot'] = 'Directorio Moodle';
$string['environmenthead'] = 'Verificando o seu ámbito ...';
$string['dirroot'] = 'Directorio de Moodle';
$string['environmenthead'] = 'Comprobando o seu entorno ...';
$string['environmentsub2'] = 'Cada versión de Moodle ten algún requisito mínimo da versión de PHP e un número obrigatorio de extensións de PHP.
Antes de cada instalación ou actualización faise unha comprobación completa do entorno . Póñase en contacto co administrador do servidor se non sabe como instalar a nova versión ou activar as extensións PHP.';
$string['errorsinenvironment'] = 'A comprobación do entorno no foi satisfactoria!';
$string['installation'] = 'Instalación';
$string['langdownloaderror'] = 'Desafortunadamente o idioma "{$a}" non foi instalado. O proceso de instalación continuará en inglés.';
$string['memorylimithelp'] = '<p>O límite de memoria para PHP do seu servidor está actualmente establecido en {$a}.</p>
$string['langdownloaderror'] = 'Non foi posíbel descargar o idioma «{$a}». O proceso de instalación continuará en inglés.';
$string['memorylimithelp'] = '<p>O límite de memoria PHP no seu servidor está estabelecido en {$a}.</p>
<p>Isto fará que Moodle teña problemas de memoria máis tarde, especialmente se ten un número de módulos significativo e/ou un gran número de usuarios.</p>
<p>Isto pode facer que Moodle teña problemas de memoria máis adiante, especialmente
se vostede ten activados un feixe de módulos e/ou unha gran cantidade de usuarios.</p>
<p>Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M.
Existen varias formas que pode tentar para facer esta modificación:</p>
<p>Recomendámoslle que configure PHP co límite máis alto posíbel, p.ex. 40M.
Hai varias maneiras de facer isto que vostede pode probar:</p>
<ol>
<li>Se pode, recompile PHP con <i>--enable-memory-limit</i>.
Iso permitirá que o propio Moodle modifique o límite de memoria.</li>
<li>Se ten acceso ao seu ficheiro php.ini pode modificar o valor de <b>memory_limit</b> para algo semellante a 16M. Se non ten acceso a ese ficheiro tal vez poida pedir ao administrador do sistema que o faga.</li>
<li>Nalgúns servidores PHP servers pode crear un ficheiro .htaccess no directorio Moodle coa liña seguinte:
<p><blockquote>php_value memory_limit 16M</blockquote></p>
<p>Porén, nalgúns servidores provocará que <b>non funcione ningunha</b>páxina en PHP (verá erros cando tente visualizar as páxinas) polo que terá que eliminar o ficheiro .htaccess.</p></li>
<li>Se vostede e quen de facelo, volva compilar PHP con <i>--enable-memory-limit</i>.
Isto fai que sexa Moodle quen estabeleza o límite de memoria.</li>
<li>Se vostede ten acceso ao ficheiro php.ini, pode cambiar o <b>memory_limit</b>
estabelecéndoo en, digamos, 40M. Se vostede non ten acceso, podería
solicitarlle ao administrador que o faga por vostede.</li>
<li>Nalgúns servidores PHP, pode crear un ficheiro .htaccess no directorio Moodle
que conteña a seguinte liña:
<blockquote><div>php_value memory_limit 40M</div></blockquote>
<p>Porén, nalgúns servidores isto impide que traballen <b>todas</b> as páxinas PHP
(poderá ver os erros cando se miran as páxinas) de modo que terá que eliminar o ficheiro .htaccess.</p></li>
</ol>';
$string['paths'] = 'Rutas';
$string['pathserrcreatedataroot'] = 'O directorio de datos ({$a->dataroot}) non puido ser creado polo instalador.';
$string['pathshead'] = 'Confirme as rutas';
$string['pathsrodataroot'] = 'O directorio dataroot non ten permisos de escritura.';
$string['pathsroparentdataroot'] = 'O directorio principal ({$a->parent}) non ten permisos de escritura. O instalador non pode crear o directorio de datos ({$a->dataroot}).';
$string['pathssubadmindir'] = 'Moi poucos enderezos web empregan /admin como URL especial para
permitirlle acceder a un panel de control ou semellante. Desafortunadamente, isto entra en conflito coa localización estándar das páxinas de administración de Moodle. Vostede pode corrixir isto
renomeando o directorio admin na súa instalación, e poñendo aquí ese novo nome. Por exemplo: <em>moodleadmin</em>. Iso corrixirá as ligazóns admin en Moodle.';
$string['pathssubdataroot'] = 'Necesitase un lugar no que Moodle poida gardar os ficheiros enviados. Este directorio debe ser lexíbel E ESCRIBÍBEL polo usuario do servidor web
(normalmente «nobody», «apache», «www-data»), mais non debería ser accesíbel directamente desde o web. Se non existe o instalador tentará crealo.';
$string['pathssubdirroot'] = 'Ruta completa do directorio de instalación de Moodle.';
$string['pathssubwwwroot'] = 'Enderezo web completo para acceder a Moodle.
Non é posíbel acceder a Moodle empregando enderezos múltiplos.
Se o seu sitio ten varios enderezos públicos debe configurar encamiñamentos permanentes en todos eles, agás neste.
Se o seu sitio web é accesíbel tanto desde unha Intranet como desde Internet, escriba aquí o enderezo público e configure o DNS para que os usuarios da Intranet poidan empregar tamén o enderezo público.
Se o enderezo non é correcto, cambie o URL no seu navegador para reiniciar a instalación cun valor diferente.';
$string['pathsunsecuredataroot'] = 'A localización de dataroot non é segura';
$string['pathswrongadmindir'] = 'Non existe o directorio Admin';
$string['phpextension'] = 'Extensión PHP {$a}';
$string['phpversion'] = 'Versión PHP';
$string['phpversionhelp'] = '<p>Moodle require unha versión de PHP de 4.3.0 como mínimo ou 5.1.0 (5.0.x ten problemas coñecidos).</p>
<p>Actualmente está a executar a versión {$a}</p>
<p>Debe actualizar o PHP ou migrar a outro servidor cunha versión máis nova de PHP!<br/>
(No caso de ter unha versión 5.0.x pode retornar para unha versión 4.4.x)</p>';
$string['phpversionhelp'] = '<p>Moodle require polo menos unha das versións de PHP 4.3.0 ou 5.1.0 ( as versións 5.0.x teñen unha serie de problemas coñecidos).</p>
<p>Neste momento está executandose a versión {$a}</p>
<p>Debe actualizar PHP ou trasladarse a outro servidor cunha versión máis recente de PHP!<br />
(NO caso de 5.0.x podería tamén reverter cara a versión 4.4.x)</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Está a ver esta páxina porque conseguiu instalar e iniciar o paquete <strong>{$a->packname} {$a->packversion}</strong> no seu computador. Parabéns!';
$string['welcomep30'] = 'Esta versión do <strong>{$a->installername}</strong> inclúe as aplicacións
para crear o ámbito en que <strong>Moodle</strong> pode funcionar, nomeadamente:';
$string['welcomep40'] = 'O paquete tamén inclúe <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
$string['welcomep50'] = 'A utilización de todas as aplicacións deste paquete réxese polas respectivas licenzas. O paquete <strong>{$a->installername}</strong> completo é <a href="http://www.opensource.org/docs/definition_plain.html"> código aberto</a> distribuído nos termos da licenza <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
$string['welcomep60'] = 'As páxinas seguintes irán conducilo por algúns pasos fáciles de seguir para configurar o <strong>Moodle</strong> no computador. Pode aceptar a configuración por defecto ou, opcionalmente, utilizar outras máis adecuadas ás súas necesidades.';
$string['welcomep70'] = 'Prema o botón "Seguinte" debaixo para continuar coa configuración de <strong>Moodle</strong>.';
$string['welcomep20'] = 'Se esta a ver esta páxina é porque puido instalar satisfactoriamente e
executar o paquete <strong>{$a->packname} {$a->packversion}</strong> no seu computador. Parabéns!';
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> inclúe os aplicativos
para crear un entorno no que <strong>Moodle</strong> funcione, nomeadamente:';
$string['welcomep40'] = 'O paquete inclúe tamen <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
$string['welcomep50'] = 'O uso de todos os aplicativos do paquete está rexido polas súas respectivas
licenzas. O paquete completo <strong>{$a->installername}</strong> é
<a href="http://www.opensource.org/docs/definition_plain.html">código aberto</a> e distribúese
baixo a licenza <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
$string['welcomep60'] = 'As páxinas seguintes guiarano a través de algúns sinxelos pasos para configurar
e axustar <strong>Moodle</strong> no seu computador. Pode empregar os axustes predeterminados
ou, opcionalmente, modificalos para que se axusten ás súas necesidades.';
$string['welcomep70'] = 'Prema no botón «Seguinte» para continuar coa configuración de <strong>Moodle</strong>.';
$string['wwwroot'] = 'Enderezo web';
+1 -1
View File
@@ -30,6 +30,6 @@
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'pt';
$string['parentlanguage'] = '';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Galego';
+1 -1
View File
@@ -31,6 +31,6 @@
defined('MOODLE_INTERNAL') || die();
$string['language'] = 'שפת ממשק';
$string['next'] = לאה';
$string['next'] = בא';
$string['previous'] = 'קודם';
$string['reload'] = 'טען מחדש';
+1 -1
View File
@@ -31,4 +31,4 @@
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'he';
$string['thislanguage'] = 'Hebrew kids';
$string['thislanguage'] = 'עברית בתי־ספר';
+2 -2
View File
@@ -41,8 +41,8 @@ $string['cannotunzipfile'] = 'Nije moguće otpakirati datoteku';
$string['componentisuptodate'] = 'Komponenta je dostupna u svojoj najnovijoj inačici.';
$string['downloadedfilecheckfailed'] = 'Došlo je do pogreške pri provjeri preuzete datoteke';
$string['invalidmd5'] = 'Neispravna md5 datoteka';
$string['missingrequiredfield'] = 'Nedostaje neko obavezno polje';
$string['remotedownloaderror'] = 'Nije uspjelo preuzimanje komponente na poslužitelj, provjerite postavke proxyja. Preporuča se uporaba PHP cURL dodatka.<br /><br />Ručno preuzmite datoteku s <a href="{$a->url}">{$a->url}</a> iskopirajte ju u "{$a->dest}" na poslužitelj i raspakirajte.';
$string['missingrequiredfield'] = 'Nedostaje neko obvezno polje';
$string['remotedownloaderror'] = 'Nije uspjelo preuzimanje komponente na poslužitelj, provjerite postavke proxyja. Preporuča se uporaba PHP cURL dodatka.<br /><br />Ručno preuzmite datoteku s <a href="{$a->url}">{$a->url}</a> iskopirajte ju u "{$a->dest}" na poslužitelju i raspakirajte.';
$string['wrongdestpath'] = 'Pogrešna odredišna putanja.';
$string['wrongsourcebase'] = 'Pogrešna baza izvornog URL-a';
$string['wrongzipfilename'] = 'Pogrešno ime ZIP datoteke';
+4 -4
View File
@@ -45,14 +45,14 @@ $string['datarootpermission'] = 'Ovlasti nad mapom s podacima';
$string['dbprefix'] = 'Prefiks tablice';
$string['dirroot'] = 'Moodle mapa';
$string['environmenthead'] = 'Provjera okruženja vašeg poslužitelja ...';
$string['environmentsub2'] = 'Svaka inačica Moodle-a ima minimalne zahtjeve po pitanju odgovarajuće PHP inačice i nekoliko obaveznih PHP ekstenzija.
$string['environmentsub2'] = 'Svaka inačica Moodle-a ima minimalne zahtjeve po pitanju odgovarajuće PHP inačice i nekoliko obveznih PHP ekstenzija.
Puna provjera okruženja se obavlja prije svake instalacije ili nadogradnje postojeće inačice. Ako ne znate kako instalirati novu inačicu ili omogućiti PHP ekstenzije, kontaktirajte administratora vašeg poslužitelja.';
$string['errorsinenvironment'] = 'Pogreške u okruženju poslužitelja!';
$string['installation'] = 'Instalacija';
$string['langdownloaderror'] = 'Nažalost, jezik "{$a}" nije instaliran. Proces instalacije će biti nastavljen na engleskom jeziku.';
$string['memorylimithelp'] = '<p>PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.</p>
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.</p>
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj omogućenih modula i/ili veći broj korisnika.</p>
<p>Preporučujemo da konfigurirate PHP s većim ograničenjem ako je moguće, recimo 40M. Postoji nekoliko načina na koje to možete napraviti:</p>
<ol>
@@ -67,7 +67,7 @@ $string['pathsrodataroot'] = 'Nije moguće zapisivanje u podatkovnu (dataroot) m
$string['pathsroparentdataroot'] = 'Nije moguće zapisivati podatke u nadređenu mapu ({$a->parent}). Instalacijska skripta ne može stvoriti mapu za podatke ({$a->dataroot}).';
$string['pathssubadmindir'] = 'Manji broj webhosting tvrtki koristi /admin kao posebni URL za Vaš pristup upravljanju vašim hosting paketom. Nažalost, to rezultira konfliktom sa standardnom lokacijom za Moodle administratorsku stranicu. Navedenu lokaciju unutar Moodle sustava možete preimenovati. Na primjer: <br /> <br /><em>moodleadmin</em><br /> <br />
Ovo će promijeniti administratorsku poveznicu na Moodle sustavu u novu vrijednost.';
$string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti upload datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.';
$string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti prenešene datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.';
$string['pathssubdirroot'] = 'Puna putanja (PATH) do Moodle instalacije.';
$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu.
Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara.
@@ -78,7 +78,7 @@ $string['pathsunsecuredataroot'] = 'Podatkovna (dataroot) mapa nije sigurna';
$string['pathswrongadmindir'] = 'Admin mapa ne postoji';
$string['phpextension'] = 'PHP ekstenzija {$a}';
$string['phpversion'] = 'PHP inačica';
$string['phpversionhelp'] = '<p>Moodle zahtijeva najmanje PHP inačicu 4.3.0 ili 5.1.0 (5.0.x funkcionira uz brojne uočene probleme).</p> <p>Trenutno imate inačicu {$a}</p> <p>Morate nadograditi PHP ili premestiti Moodle instalaciju na web poslužitelj s novijom verzijom PHP-a!</br> (U slučaju inačice 5.0.x bilo bi najbolje da je vratite na inačicu 4.4.x)</p>';
$string['phpversionhelp'] = '<p>Moodle zahtijeva najmanje PHP inačicu 4.3.0 ili 5.1.0 (5.0.x funkcionira uz brojne uočene probleme).</p> <p>Trenutno imate inačicu {$a}</p> <p>Morate nadograditi PHP ili premestiti Moodle instalaciju na web poslužitelj s novijom inačicom PHP-a!</br> (U slučaju inačice 5.0.x bilo bi najbolje da je vratite na inačicu 4.4.x)</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Prikazana vam je ova stranica jer ste uspješno instalirali i pokrenuli <strong>{$a->packname} {$a->packversion}</strong> paket na svom poslužitelju. Čestitamo!';
$string['welcomep30'] = 'Ova inačica <strong>{$a->installername}</strong> uključuje aplikacije za stvaranje okruženja u kojem će sustav <strong>Moodle</strong> uspješno funkcionirati, konkretno:';
+37
View File
@@ -0,0 +1,37 @@
<?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['clitypevalue'] = 'tipo reikšmė';
$string['clitypevaluedefault'] = 'tipo reikšmė, paspauskite „Enter“, jei norite naudoti numatytąją reikšmę ({$a})';
$string['cliunknowoption'] = 'Neatpažintos parinktys: {$a} naudokite --žinyno parinktį.';
$string['environmentrequireinstall'] = 'turi būti įdiegta ir įjungta';
$string['environmentrequireversion'] = 'būtina naudoti versiją {$a->needed}, o jūs naudojate {$a->current}';
+48
View File
@@ -0,0 +1,48 @@
<?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['cannotcreatelangdir'] = 'Negalima sukurti kalbos katalogo';
$string['cannotcreatetempdir'] = 'Negalima sukurti laikinojo katalogo';
$string['cannotdownloadcomponents'] = 'Negalima atsisiųsti komponentų';
$string['cannotdownloadzipfile'] = 'Negalima atsisiųsti ZIP failo';
$string['cannotfindcomponent'] = 'Nepavyko rasti komponento';
$string['cannotsavemd5file'] = 'Negalima įrašyti md5 failo';
$string['cannotsavezipfile'] = 'Negalima įrašyti ZIP failo';
$string['cannotunzipfile'] = 'Negalima išskleisti failo';
$string['componentisuptodate'] = 'Komponentas atnaujintas';
$string['downloadedfilecheckfailed'] = 'Nepavyko patikrinti atsisiųsto failo';
$string['invalidmd5'] = 'Kintamojo patikra nepavyko bandykite dar kartą';
$string['missingrequiredfield'] = 'Trūksta būtino lauko';
$string['remotedownloaderror'] = 'Nepavyko į serverį atsisiųsti komponento, patikrinkite tarpinio serverio parametrus, labai rekomenduojama naudoti PHP cURL plėtinį.<br /><br />Turite rankiniu būdu atsisiųsti <a href="{$a->url}">{$a->url}</a> failą, nukopijuoti jį į {$a->dest} serveryje ir ten jį išskleisti.';
$string['wrongdestpath'] = 'Neteisingas paskirties kelias';
$string['wrongsourcebase'] = 'Neteisingas šaltinio URL pagrindas';
$string['wrongzipfilename'] = 'Neteisingas ZIP failo vardas';

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