21279 Commits

Author SHA1 Message Date
Andrew Nicols
889b92c1c0 Merge branch 'MDL-53291_ajax_fix' of https://github.com/BenKelada/moodle 2016-03-08 07:43:31 +08:00
Krista Koivisto
7b9fbb1cf4 MDL-52774 ajax: Require authentication when getting nav branch
When getting the navigation branch data through AJAX, require
login if forcelogin is set.
2016-03-08 00:39:45 +01:00
Andrew Nicols
4ffe7e5070 MDL-30811 output: Adjust ARIA role to alert
https://www.w3.org/TR/wai-aria-practices/#alert
2016-03-03 15:09:18 +08:00
Andrew Nicols
c1cb65d470 MDL-30811 javascript: alert JS should be in template
By moving the JS required for an alert to the JavaScript we make it
possible for themers to use frameworks other than bootstrap if they so
wish.
2016-03-03 15:09:17 +08:00
Andrew Nicols
11a67b211b MDL-30811 javascript: Lazily load core dependencies
To prevent possible race conditions, we lazily load the templates, and ajax
dependencies.
2016-03-03 14:47:07 +08:00
Ben Kelada
023d6a6756 MDL-53291 javascript: fix jquery ajax requests when data contains ??
jQuery ajax requests containing multiple '?' get replaced with a
string similar to jQuery152330039032_1231231, this is because it
is processing a stringified data object as jsonp and thinks its a url.
 workaround is to add contenttype
see https://github.com/jquery/jquery/issues/1799
2016-03-03 09:15:24 +11:00
Eloy Lafuente (stronk7)
5aac4a23e5 Merge branch 'MDL-30811-fix2' of git://github.com/andrewnicols/moodle 2016-03-02 16:36:03 +01:00
Dan Poltawski
852f32f7b3 Merge branch 'wip-MDL-50887-master' of https://github.com/marinaglancy/moodle 2016-03-02 15:49:45 +08:00
Marina Glancy
d2de503c80 MDL-50887 antivirus: clamav is standard plugin, missing strings 2016-03-02 15:42:35 +08:00
Andrew Nicols
2f244f1cc6 MDL-30811 core: Initiate notifications on first use only 2016-03-02 13:30:09 +08:00
Eloy Lafuente (stronk7)
df190d18a1 MDL-52136 mod_forum: fix some out-of-sync stuff
Thanks CIs!
2016-03-02 05:42:29 +01:00
Eloy Lafuente (stronk7)
ce878562f3 Merge branch 'MDL-52136-master' of git://github.com/andrewnicols/moodle 2016-03-02 05:25:57 +01:00
Andrew Nicols
0b4bff8ca9 MDL-52136 core: Add support for quoting variables in mustache helpers
This is required for when helpers include json-encoded variables as arguments.
As an example, imagine a template with content:

{{# str }} somekey, someidentifier, { "fullname": "{{ fullname }}" } {{/ str }}

If the fullname variable were to include the double-quote character (e.g.
John "Trevor" Doe) because of the way in which mustache renders content, it
would become:

{{# str }} somekey, someidentifier, { "fullname": "John "Trevor" Doe" } {{/ str }}

This results in an invalid JSON structure.

To work around this issue, the quote characters in the passed variable
must be escaped:

{{# str }} somekey, someidentifier, { "fullname": "John \"Trevor\" Doe" } {{/ str }}

Unfortunately, Mustache provides no way of doing so natively.

With this function, we can quote the text as appropriate:

{{# str }} somekey, someidentifier, { "fullname": {{# quote }}{{ fullname }}{{/ quote }} } {{/ str }}

This also handles the case where the quoted content includes the Mustache
delimeter ({{ or }}).

For example:
fullname = 'John "}}Trevor{{" Doe'

Ordinarily this would be rendered as:
{{# str }} somekey, someidentifier, { "fullname": "John "}}Trevor{{" Doe" } {{/ str }}

This rendering is both a JSON error, and also a mustache syntax error because of the mustache delimeters.

The quote helper also escapes these by wrapping them in change delimeter
tags:

{{# str }} somekey, someidentifier, { "fullname": "John "{{=<% %>=}}}}<%={{ }}=%>Trevor{{=<% %>=}}{{{{=<% %>=}}" Doe" } {{/ str }}
2016-03-02 08:48:46 +08:00
Dan Poltawski
73911de50d MDL-50887 clam: upgrade step with wrong version 2016-03-01 21:37:56 +08:00
Dan Poltawski
b8b7f33acd Merge branch 'MDL-52669-master' of git://github.com/jleyva/moodle 2016-03-01 14:56:58 +08:00
Dan Poltawski
2158e87492 Merge branch 'MDL-50887-master' of https://github.com/lucisgit/moodle 2016-03-01 14:49:33 +08:00
Andrew Nicols
614173c7dc Merge branch 'MDL-50546-master' of git://github.com/jleyva/moodle 2016-03-01 13:41:35 +08:00
Dan Poltawski
792508cb7f Merge branch 'MDL-30811-fix' of git://github.com/andrewnicols/moodle 2016-03-01 12:26:33 +08:00
Dan Poltawski
fd8e293030 Merge branch 'MDL-52809-master' of git://github.com/dpalou/moodle 2016-03-01 12:23:54 +08:00
Andrew Nicols
cf633c555e MDL-30811 form: Remove continue from test. 2016-03-01 12:11:10 +08:00
Andrew Nicols
05b0f579ca Merge branch 'MDL-52974-master' of git://github.com/jleyva/moodle 2016-03-01 11:48:16 +08:00
Eloy Lafuente (stronk7)
d9dfc410ad Merge branch 'wip-MDL-53172-master' of https://github.com/marinaglancy/moodle 2016-03-01 01:59:31 +01:00
Ruslan Kabalin
324a45833a MDL-50887 tests: Increment number of plugins in core_component_testcase.
We have got one more core plugin now.
2016-02-29 09:31:30 +00:00
Ruslan Kabalin
71f74dd165 MDL-50887 antivirus_clamav: Add unit tests for scanner class.
We are using "stubbing" method to replace real component (clamav) control
points with doubles in order to avoid direct calls to clamav. For more
details, please refer to https://phpunit.de/manual/4.8/en/test-doubles.html

Notice, that while it is possible to use setExpectedException in the tests,
this does not seem play correctly with consecutive assertions in the same
test after exception is thrown (they seem omitted). Explicit try/catch
construction has been used in testing instead.

To run just this test, use:
vendor/bin/phpunit antivirus_clamav_scanner_testcase lib/antivirus/clamav/tests/scanner_test.php
2016-02-29 09:31:30 +00:00
Ruslan Kabalin
ae3ba48272 MDL-50887 antivirus: Add unit tests for manager class.
To run just this test, use:
vendor/bin/phpunit core_antivirus_testcase lib/tests/antivirus_test.php
2016-02-29 09:31:29 +00:00
Ruslan Kabalin
d08667a271 MDL-50887 antivirus_clamav: Access config properties using getter. 2016-02-29 09:31:29 +00:00
Ruslan Kabalin
17d7ee0eea MDL-50887 antivirus: Add config getter to base class.
Improving architecture to make it testable.
2016-02-29 09:31:29 +00:00
Ruslan Kabalin
5b6a0f2c15 MDL-50887 antivirus_clamav: Split scanning logic and results processing.
This refactoring will make possible to assert scan results processing
behaviour in unit testing.
2016-02-29 09:31:29 +00:00
Ruslan Kabalin
ae784f716e MDL-50887 antivirus: Refactor adminlib to use html_writer. 2016-02-29 09:31:29 +00:00
Ruslan Kabalin
11362ae3ff MDL-50887 antivirus: Use namespace referenced classes. 2016-02-29 09:31:09 +00:00
Dan Poltawski
9b44810fbf Merge branch 'MDL-53213' of https://github.com/mr-russ/moodle 2016-02-29 15:37:25 +08:00
Andrew Nicols
7f1303728d Merge branch 'MDL-52965_master' of git://github.com/dmonllao/moodle 2016-02-29 15:20:44 +08:00
Andrew Nicols
dfc18848db Merge branch 'MDL-48362-master' of git://github.com/damyon/moodle 2016-02-29 14:46:20 +08:00
Damyon Wiese
f758951565 MDL-48362 enrol: Convert guest to standard enrolment ui
Also - provide automatic course navigation links when using the standard ui.
2016-02-29 14:33:06 +08:00
Andrew Nicols
90a11c2abb Merge branch 'MDL-53249-master' of git://github.com/merrill-oakland/moodle 2016-02-29 14:22:31 +08:00
Andrew Nicols
ae3c6ee42d MDL-52346 caching: Coding style fixes 2016-02-29 14:14:01 +08:00
Andrew Nicols
8bd28ed696 Merge branch 'MDL-52346' of git://github.com/mr-russ/moodle 2016-02-29 14:12:03 +08:00
Damyon Wiese
51c736f037 MDL-48362 enrol: Auto generate the edit action icons when using the new ui 2016-02-29 14:00:31 +08:00
Damyon Wiese
60010fd614 MDL-48362 enrol: Use a standard UI and validation for enrolment plugins
Convert core enrolment plugins to use standard editing ui.
2016-02-29 12:31:41 +08:00
Andrew Nicols
372d6b923b MDL-30811 core: Replace use of continue_button with redirect 2016-02-29 09:05:58 +08:00
Andrew Nicols
3ad964190c MDL-30811 core: Make use of session notifications in redirect() 2016-02-29 09:05:57 +08:00
Andrew Nicols
0346323cec MDL-30811 output: Add support for session notifications 2016-02-29 09:05:56 +08:00
Andrew Nicols
243468030a MDL-30811 output: Tidy up notifications 2016-02-28 19:16:34 +08:00
Russell Smith
d22a01fd99 MDL-53213 caching: Faster databasemeta caching for all databases. 2016-02-28 17:03:14 +11:00
Marina Glancy
b259fa6645 MDL-53172 core: adjust CSS for inplace_editable 2016-02-27 11:29:27 +08:00
Andrew Nicols
490934a4ed MDL-53172 javascript: Fix coding style violations 2016-02-27 11:29:27 +08:00
Andrew Nicols
38cf8b6661 MDL-53172 javascript: Stop requiring body manipulation on load 2016-02-27 11:29:27 +08:00
Marina Glancy
8de48ad0ae MDL-53172 core: toggle and select in inplace_editable 2016-02-27 11:29:24 +08:00
Juan Leyva
4064dd0ec4 MDL-52669 mod_quiz: New Web Service mod_quiz_view_quiz 2016-02-26 15:45:22 +01:00
Juan Leyva
51e27aac2b MDL-50546 mod_quiz: New WS mod_quiz_get_quizzes_by_courses 2016-02-26 15:42:11 +01:00