Compare commits
262 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca86a178c8 | |||
| 9b94006603 | |||
| 65eb6bd459 | |||
| 8ae126d9b3 | |||
| 9b6313b0b7 | |||
| 9381d3e9ca | |||
| 747225192f | |||
| 9c802cf1d4 | |||
| c29df134e7 | |||
| 0c8a667aa9 | |||
| 0d593bd003 | |||
| 0dd5c403cb | |||
| a788beadce | |||
| db7bb6eae5 | |||
| cda80862da | |||
| 6006cd746a | |||
| 93ccd9a8ed | |||
| 5e1b84ae0e | |||
| 20a03b8085 | |||
| 388b48ebcd | |||
| 317bcee9e4 | |||
| 75ed173bac | |||
| 396f819ce7 | |||
| fc701cb3a2 | |||
| 50a9aa3202 | |||
| 7733c75210 | |||
| 1d0df063a9 | |||
| 8faca311f1 | |||
| fd8435ce92 | |||
| 4165507baf | |||
| e2d1844913 | |||
| 688a698dc2 | |||
| 4152d926af | |||
| 218d1f0276 | |||
| 1b2ae4d7d3 | |||
| 6ff83aa7e4 | |||
| ab44e17338 | |||
| 8791b78091 | |||
| a7f71822ff | |||
| 78303a974d | |||
| b9f81ce7cb | |||
| 12abdd7cbc | |||
| a85576bf1a | |||
| eee689975a | |||
| c641721530 | |||
| 2688f5a4a9 | |||
| 4ccd9811d4 | |||
| f17db49ec6 | |||
| 1642ba1ea3 | |||
| fbbe6c88d6 | |||
| 8d68bbd484 | |||
| 07f06046e3 | |||
| 32f556dda0 | |||
| efec93b8e8 | |||
| d556156427 | |||
| 5644de2d37 | |||
| 3d9ed4ae61 | |||
| c5dd7b71da | |||
| d8ff21935d | |||
| 1454c203a9 | |||
| 3cc3a80a27 | |||
| 820d389575 | |||
| 7c882f4389 | |||
| 7540ee5e5e | |||
| dbda3be673 | |||
| 0b69e31402 | |||
| cd9927ac9f | |||
| 9e4c960c39 | |||
| 8b2fb6720c | |||
| b25dab817e | |||
| 82907dc43b | |||
| 7c889e2f08 | |||
| 8976674370 | |||
| 99b8d0a69d | |||
| 468d2770c5 | |||
| 2ce1d2c71b | |||
| 3fe2093f3b | |||
| 9273b920e5 | |||
| 03e398154c | |||
| fdac7064c2 | |||
| b6ed8fdf5f | |||
| 84f1341162 | |||
| 6be87e8003 | |||
| 25f472d2a0 | |||
| 232178eca2 | |||
| ca99df58e2 | |||
| 26d01a4e56 | |||
| 617528c5ae | |||
| cba517e826 | |||
| 0fed28f9c9 | |||
| caf74fff01 | |||
| 3e2295f008 | |||
| 9bfd78bafc | |||
| 0dc04c49bd | |||
| dd705dd7ff | |||
| 91c9d79227 | |||
| e9f7b1bcc5 | |||
| 811856d064 | |||
| bff2510df9 | |||
| 638b683ac5 | |||
| e40c822a58 | |||
| b45bc1d389 | |||
| 511b478297 | |||
| 3d13576463 | |||
| bf7e998500 | |||
| 6fdcba2544 | |||
| 7f5f314977 | |||
| 8d6eaed3b7 | |||
| e904f8c075 | |||
| 9f4f53f699 | |||
| 02cba0b682 | |||
| f9d95d9ed9 | |||
| 26bf333277 | |||
| 48bc44477d | |||
| 959cb13aad | |||
| 533e6018c6 | |||
| 89b8a5c82f | |||
| b7108061a4 | |||
| 49235cdd85 | |||
| a1e14a55db | |||
| 0822adfe49 | |||
| 4079f3ad90 | |||
| b90aa9570a | |||
| ea69caa2d6 | |||
| c5b6b52432 | |||
| 3de493704b | |||
| e6885a4e71 | |||
| 3292e36a21 | |||
| f330c27f67 | |||
| 3ac6d35915 | |||
| f83d4ceb24 | |||
| 003699dba4 | |||
| 5ac7b30bd3 | |||
| 6ce2b2b141 | |||
| 81c5d47c2a | |||
| 6d9c397d37 | |||
| 61a12d418e | |||
| 67a20af671 | |||
| a107243c61 | |||
| aa8d361b83 | |||
| 46da0ff5a5 | |||
| 36eebecef6 | |||
| bc6a3998b9 | |||
| 0fd4fe4fb3 | |||
| 015729e746 | |||
| 72de799d7b | |||
| 30078d7b9d | |||
| 5de9f1c0d3 | |||
| ce4ef5bd79 | |||
| dbff7477aa | |||
| c02fd57da7 | |||
| 8a5e17b2e1 | |||
| f608a42e09 | |||
| 6da1369913 | |||
| ef8da7069e | |||
| 7223cd2518 | |||
| 4be702669b | |||
| 98648c4242 | |||
| cc59a3e2af | |||
| 075f978ba2 | |||
| 331613ddb1 | |||
| 41d5e39323 | |||
| 7455f7d100 | |||
| 7d36214618 | |||
| a231d66dec | |||
| 21a20a0a65 | |||
| 5885ba383a | |||
| 9416c59e47 | |||
| 9fe421f29e | |||
| 4e2770b175 | |||
| 620ca55842 | |||
| 754c41eb9f | |||
| 8edc190aae | |||
| df42740f33 | |||
| 1b5cc6c463 | |||
| 3aebea76e0 | |||
| 223378c332 | |||
| 3320df92f5 | |||
| 8e2d2046c1 | |||
| 4e9f6420ff | |||
| 71d9056aef | |||
| 411fdd46c5 | |||
| 2a6ac3f844 | |||
| a30b21e86f | |||
| 08f8ff9ffc | |||
| 59fac4cf16 | |||
| 43f53ff0f5 | |||
| f9de835157 | |||
| daa9b4d3c2 | |||
| 895b108ff1 | |||
| 0de90550dc | |||
| d1b6cf4333 | |||
| 1c6999087f | |||
| 527dc0ce02 | |||
| 20a8c2e9c2 | |||
| e1043b0311 | |||
| ff085ba20b | |||
| 14f75eda28 | |||
| 5b99ccb9e3 | |||
| cd9cf364a1 | |||
| 875ee59a5a | |||
| 96de3cf711 | |||
| 750a1815b1 | |||
| aca1dc1b63 | |||
| 40b98690ed | |||
| 4296f2b9da | |||
| 1de74443af | |||
| 2073c4871b | |||
| b0a3467e82 | |||
| 9283ca1850 | |||
| d0f7cefec6 | |||
| 08e3be8806 | |||
| 93c60b87e4 | |||
| cdd3def5b6 | |||
| bfe06f7600 | |||
| 3df86df503 | |||
| b733fa7055 | |||
| d989883024 | |||
| 8c90381a31 | |||
| fdd56d83e3 | |||
| e5c03946e7 | |||
| 350b6ce426 | |||
| b11daeca71 | |||
| d6fd5d362f | |||
| 8a1a0bbbaf | |||
| ecc07981ad | |||
| 115f9cc02a | |||
| a4a2d1edd0 | |||
| 6ff87b25d4 | |||
| 20c207639a | |||
| cb3b8c222e | |||
| be08c8a7de | |||
| fe096488fe | |||
| 01ffc90d90 | |||
| 3c215fa3d2 | |||
| d7c33a1392 | |||
| 85efc6975a | |||
| 789b0b62c3 | |||
| 078d007b87 | |||
| 43e6d24c87 | |||
| bc48debf36 | |||
| 76b676b929 | |||
| 03eab92866 | |||
| 71bea77b6a | |||
| d4b14d6298 | |||
| d357ee7039 | |||
| be27606bf1 | |||
| 5a9d8d48ca | |||
| 16c89550d8 | |||
| 1e95a37cf3 | |||
| be50133b45 | |||
| 7416cc5d48 | |||
| 65c0e2b9b4 | |||
| 95c919d651 | |||
| 8dcf12afdc | |||
| 598e62100c | |||
| e9bf5a3998 | |||
| be4e216e6b | |||
| aaf50eed5d | |||
| 9074566c1d | |||
| e46c306d8e | |||
| b509663e15 |
@@ -0,0 +1,17 @@
|
||||
*/**/yui/src/*/meta/
|
||||
*/**/build/
|
||||
node_modules/
|
||||
vendor/
|
||||
lib/editor/atto/yui/src/rangy/js/
|
||||
lib/editor/tinymce/plugins/pdw/tinymce/
|
||||
lib/editor/tinymce/tiny_mce/
|
||||
lib/requirejs/
|
||||
lib/yuilib/
|
||||
lib/jquery/
|
||||
lib/htmlpurifier/
|
||||
lib/flowplayer/
|
||||
lib/xhprof/
|
||||
lib/amd/src/loglevel.js
|
||||
lib/amd/src/mustache.js
|
||||
theme/bootstrapbase/javascript/html5shiv.js
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
@@ -0,0 +1,172 @@
|
||||
{
|
||||
'env': {
|
||||
'browser': true,
|
||||
'amd': true
|
||||
},
|
||||
'globals': {
|
||||
'M': true,
|
||||
'Y': true
|
||||
},
|
||||
'rules': {
|
||||
// See http://eslint.org/docs/rules/ for all rules and explanations of all
|
||||
// rules.
|
||||
|
||||
// === Possible Errors ===
|
||||
'comma-dangle': 'off',
|
||||
'no-cond-assign': 'error',
|
||||
'no-console': 'error',
|
||||
'no-constant-condition': 'error',
|
||||
'no-control-regex': 'error',
|
||||
'no-debugger': 'error',
|
||||
'no-dupe-args': 'error',
|
||||
'no-dupe-keys': 'error',
|
||||
'no-duplicate-case': 'error',
|
||||
'no-empty': 'warn',
|
||||
'no-empty-character-class': 'error',
|
||||
'no-ex-assign': 'error',
|
||||
'no-extra-boolean-cast': 'error',
|
||||
'no-extra-parens': 'off',
|
||||
'no-extra-semi': 'error',
|
||||
'no-func-assign': 'error',
|
||||
'no-inner-declarations': 'error',
|
||||
'no-invalid-regexp': 'error',
|
||||
'no-irregular-whitespace': 'error',
|
||||
'no-negated-in-lhs': 'error',
|
||||
'no-obj-calls': 'error',
|
||||
'no-prototype-builtins': 'off',
|
||||
'no-regex-spaces': 'error',
|
||||
'no-sparse-arrays': 'error',
|
||||
'no-unexpected-multiline': 'error',
|
||||
'no-unreachable': 'warn',
|
||||
'no-unsafe-finally': 'error',
|
||||
'use-isnan': 'error',
|
||||
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
|
||||
'valid-typeof': 'error',
|
||||
|
||||
// === Best Practices ===
|
||||
// (these mostly match our jshint config)
|
||||
'array-callback-return': 'warn',
|
||||
'block-scoped-var': 'warn',
|
||||
'complexity': 'warn',
|
||||
'consistent-return': 'warn',
|
||||
'curly': 'error',
|
||||
'dot-notation': 'warn',
|
||||
'no-alert': 'warn',
|
||||
'no-caller': 'error',
|
||||
'no-case-declarations': 'error',
|
||||
'no-div-regex': 'error',
|
||||
'no-empty-pattern': 'error',
|
||||
'no-empty-function': 'warn',
|
||||
'no-eq-null': 'error',
|
||||
'no-eval': 'error',
|
||||
'no-extend-native': 'error',
|
||||
'no-extra-bind': 'warn',
|
||||
'no-fallthrough': 'error',
|
||||
'no-floating-decimal': 'warn',
|
||||
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
|
||||
'no-implied-eval': 'error',
|
||||
'no-invalid-this': 'error',
|
||||
'no-iterator': 'error',
|
||||
'no-labels': 'error',
|
||||
'no-loop-func': 'error',
|
||||
'no-multi-spaces': 'warn',
|
||||
'no-multi-str': 'error',
|
||||
'no-native-reassign': 'warn',
|
||||
'no-new-func': 'error',
|
||||
'no-new-wrappers': 'error',
|
||||
'no-octal': 'error',
|
||||
'no-octal-escape': 'error',
|
||||
'no-proto': 'error',
|
||||
'no-redeclare': 'warn',
|
||||
'no-return-assign': 'error',
|
||||
'no-script-url': 'error',
|
||||
'no-self-assign': 'error',
|
||||
'no-self-compare': 'error',
|
||||
'no-sequences': 'warn',
|
||||
'no-throw-literal': 'warn',
|
||||
'no-unmodified-loop-condition': 'error',
|
||||
'no-unused-expressions': 'error',
|
||||
'no-unused-labels': 'error',
|
||||
'no-useless-call': 'warn',
|
||||
'no-useless-escape': 'warn',
|
||||
'no-with': 'error',
|
||||
'wrap-iife': ['error', 'any'],
|
||||
|
||||
// === Variables ===
|
||||
'no-delete-var': 'error',
|
||||
'no-undef': 'error',
|
||||
'no-undef-init': 'error',
|
||||
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
|
||||
|
||||
// === Stylistic Issues ===
|
||||
'array-bracket-spacing': 'warn',
|
||||
'block-spacing': 'warn',
|
||||
'brace-style': ['warn', '1tbs'],
|
||||
'camelcase': 'warn',
|
||||
'comma-spacing': ['warn', { 'before': false, 'after': true }],
|
||||
'comma-style': ['warn', 'last'],
|
||||
'computed-property-spacing': 'error',
|
||||
'consistent-this': 'off',
|
||||
'eol-last': 'off',
|
||||
'func-names': 'off',
|
||||
'func-style': 'off',
|
||||
// indent currently not doing well with our wrapping style, so disabled.
|
||||
'indent': ['off', 4, { 'SwitchCase': 1 }],
|
||||
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
|
||||
'keyword-spacing': 'warn',
|
||||
'linebreak-style': ['error', 'unix'],
|
||||
'lines-around-comment': 'off',
|
||||
'max-len': ['error', 132],
|
||||
'max-lines': 'off',
|
||||
'max-depth': 'warn',
|
||||
'max-nested-callbacks': ['warn', 5],
|
||||
'max-params': 'off',
|
||||
'max-statements': 'off',
|
||||
'max-statements-per-line': ['warn', { max: 2 }],
|
||||
'new-cap': ['warn', { 'properties': false }],
|
||||
'new-parens': 'warn',
|
||||
'newline-after-var': 'off',
|
||||
'newline-before-return': 'off',
|
||||
'newline-per-chained-call': 'off',
|
||||
'no-array-constructor': 'off',
|
||||
'no-bitwise': 'error',
|
||||
'no-continue': 'off',
|
||||
'no-inline-comments': 'off',
|
||||
'no-lonely-if': 'off',
|
||||
'no-mixed-operators': 'off',
|
||||
'no-mixed-spaces-and-tabs': 'error',
|
||||
'no-multiple-empty-lines': 'warn',
|
||||
'no-negated-condition': 'off',
|
||||
'no-nested-ternary': 'warn',
|
||||
'no-new-object': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-spaced-func': 'warn',
|
||||
'no-ternary': 'off',
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-underscore-dangle': 'off',
|
||||
'no-unneeded-ternary': 'off',
|
||||
'no-whitespace-before-property': 'warn',
|
||||
'object-curly-newline': 'off',
|
||||
'object-curly-spacing': 'warn',
|
||||
'object-property-newline': 'off',
|
||||
'one-var': 'off',
|
||||
'one-var-declaration-per-line': ['warn', 'initializations'],
|
||||
'operator-assignment': 'off',
|
||||
'operator-linebreak': 'off',
|
||||
'padded-blocks': 'off',
|
||||
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
|
||||
'quotes': 'off',
|
||||
'require-jsdoc': 'warn',
|
||||
'semi': 'error',
|
||||
'semi-spacing': ['warn', {'before': false, 'after': true}],
|
||||
'sort-vars': 'off',
|
||||
'space-before-blocks': 'warn',
|
||||
'space-before-function-paren': ['warn', 'never'],
|
||||
'space-in-parens': 'warn',
|
||||
'space-infix-ops': 'warn',
|
||||
'space-unary-ops': 'warn',
|
||||
'spaced-comment': 'warn',
|
||||
'unicode-bom': 'error',
|
||||
'wrap-regex': 'off',
|
||||
}
|
||||
}
|
||||
+30
-13
@@ -35,15 +35,20 @@ env:
|
||||
# Run unit tests on Postgres
|
||||
- DB=pgsql TASK=PHPUNIT
|
||||
|
||||
# Run a check for unbuilt files with Grunt.
|
||||
- DB=none TASK=GRUNT
|
||||
|
||||
matrix:
|
||||
# Enable fast finish.
|
||||
# This will fail the build if a single job fails (except those in allow_failures).
|
||||
# It will not stop the jobs from running.
|
||||
fast_finish: true
|
||||
|
||||
include:
|
||||
# Run grunt/npm install on lowest supported npm version
|
||||
- php: 7
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='0.10'
|
||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||
- php: 7
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='node'
|
||||
|
||||
exclude:
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 7.0
|
||||
@@ -68,14 +73,26 @@ install:
|
||||
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
|
||||
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
|
||||
|
||||
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
|
||||
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
|
||||
- echo 'auth.json' >> .git/info/exclude
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
if [ -n "$GITHUB_APITOKEN" ]; then
|
||||
composer config github-oauth.github.com $GITHUB_APITOKEN;
|
||||
echo 'auth.json' >> .git/info/exclude
|
||||
fi
|
||||
|
||||
# Install composer dependencies.
|
||||
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
|
||||
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
|
||||
- travis_retry composer install --prefer-dist --no-interaction
|
||||
# Install composer dependencies.
|
||||
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
|
||||
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
|
||||
travis_retry composer install --prefer-dist --no-interaction;
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
nvm install $NVM_VERSION ;
|
||||
nvm use $NVM_VERSION ;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- >
|
||||
@@ -142,9 +159,8 @@ before_script:
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
npm install ;
|
||||
npm install -g grunt ;
|
||||
grunt ;
|
||||
npm install --no-spin;
|
||||
npm install --no-spin -g grunt ;
|
||||
fi
|
||||
|
||||
########################################################################
|
||||
@@ -197,6 +213,7 @@ script:
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
grunt ;
|
||||
# Add all files to the git index and then run diff --cached to see all changes.
|
||||
# This ensures that we get the status of all files, including new files.
|
||||
git add . ;
|
||||
|
||||
@@ -1145,6 +1145,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.8" requires="2.2">
|
||||
@@ -1418,6 +1423,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.0" requires="2.2">
|
||||
@@ -1434,6 +1444,7 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -1556,6 +1567,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.1" requires="2.7">
|
||||
@@ -1572,6 +1588,7 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -1696,6 +1713,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.2" requires="2.7">
|
||||
@@ -1841,6 +1863,11 @@
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -60,7 +60,8 @@ class mnet_simple_host_form extends moodleform {
|
||||
}
|
||||
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
|
||||
global $CFG;
|
||||
return array('wwwroot' => get_string('hostexists', 'mnet', $CFG->wwwroot . '/admin/mnet/peers.php?hostid=' . $host->id));
|
||||
return array('wwwroot' => get_string('hostexists', 'mnet',
|
||||
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ if (!empty($hostid)) {
|
||||
$mnet_peer->set_id($hostid);
|
||||
echo $OUTPUT->header();
|
||||
$currenttab = 'mnetdetails';
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
|
||||
if ($hostid != $CFG->mnet_all_hosts_id) {
|
||||
$mnet_peer->currentkey = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application);
|
||||
@@ -144,7 +144,7 @@ if (empty($noreviewform) && $id = optional_param('id', 0, PARAM_INT)) {
|
||||
// we're editing an existing one, so set up the tabs
|
||||
$currenttab = 'mnetdetails';
|
||||
$mnet_peer->set_id($id);
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
} else if (empty($noreviewform) && ($wwwroot = optional_param('wwwroot', '', PARAM_URL)) && ($applicationid = optional_param('applicationid', 0, PARAM_INT))) {
|
||||
$application = $DB->get_field('mnet_application', 'name', array('id'=>$applicationid));
|
||||
$mnet_peer->bootstrap($wwwroot, null, $application);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/profilefields_form.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin .'/mnet/profilefields_form.php');
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
require_login();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/services_form.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/services_form.php');
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
require_login();
|
||||
@@ -82,7 +82,7 @@ if ($formdata = $mform->get_data()) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
$currenttab = 'mnetservices';
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
echo $OUTPUT->box_start();
|
||||
$s = mnet_get_service_info($mnet_peer, false); // basic data only
|
||||
$mform->set_data($s);
|
||||
|
||||
@@ -32,6 +32,8 @@ $getroles = optional_param('getroles', 0, PARAM_BOOL);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
|
||||
$PAGE->set_context($context);
|
||||
|
||||
require_login($course, false, $cm);
|
||||
require_capability('moodle/role:review', $context);
|
||||
require_sesskey();
|
||||
|
||||
@@ -184,6 +184,8 @@ class controller {
|
||||
|
||||
if ($updated) {
|
||||
$this->info[] = get_string('langupdatecomplete', 'tool_langimport');
|
||||
// The strings have been changed so we need to purge their cache to ensure users see the changes.
|
||||
get_string_manager()->reset_caches();
|
||||
} else {
|
||||
$this->info[] = get_string('nolangupdateneeded', 'tool_langimport');
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class check_subscriptions extends \core\task\scheduled_task {
|
||||
*/
|
||||
protected function is_user_setup($user) {
|
||||
if (!isset($this->userssetupcache[$user->id])) {
|
||||
$this->userssetupcache[$user->id] = !user_not_fully_set_up($user);
|
||||
$this->userssetupcache[$user->id] = !user_not_fully_set_up($user, true);
|
||||
}
|
||||
return $this->userssetupcache[$user->id];
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/monitor/lib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/monitor/lib.php');
|
||||
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
|
||||
@@ -384,7 +384,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
|
||||
// Now let us trigger 7 instances of the event.
|
||||
$event = \mod_book\event\course_module_instance_list_viewed::create_from_course($course);
|
||||
$event->trigger();
|
||||
sleep(1); // Add a second delay, to prevent time collisions.
|
||||
$this->waitForSecond(); // Add a second delay, to prevent time collisions.
|
||||
}
|
||||
$this->run_adhock_tasks();
|
||||
$messages = $messagesink->get_messages();
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){var c="@template "+b,d=0,e=[];if(e=a.match(/{{!([\s\S]*?)}}/g),null!==e)for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(-1!==g){var h=g+c.length+1;return f=f.substr(h,f.length-2-h)}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a('[data-region="displaytemplateheader"]').text(b)}).fail(d.exception);var j=h(f,b);j===!1&&(j=h(i,b)),j&&(f=j),a('[data-region="displaytemplatesource"]').text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(n){c.debug("Could not parse json example context for template."),c.debug(n)}}l?e.render(b,l).done(function(b,c){e.replaceNodeContents(a('[data-region="displaytemplateexample"]'),b,c)}).fail(d.exception):g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a('[data-region="displaytemplateexample"]').text(b)}).fail(d.exception)},j=function(c){var e=c.split("/"),g=e.shift(),h=e.shift(),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};return a('[data-region="list-templates"]').on("click","[data-templatename]",function(b){var c=a(this).data("templatename");b.preventDefault(),j(c)}),{}});
|
||||
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){if(!a)return!1;var c="@template "+b,d=0,e=[];if(e=a.match(/{{!([\s\S]*?)}}/g),null!==e)for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(-1!==g){var h=g+c.length+1;return f=f.substr(h,f.length-2-h)}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a('[data-region="displaytemplateheader"]').text(b)}).fail(d.exception);var j=h(f,b);j===!1&&(j=h(i,b)),j&&(f=j),a('[data-region="displaytemplatesource"]').text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(n){c.debug("Could not parse json example context for template."),c.debug(n)}}l?e.render(b,l).done(function(b,c){e.replaceNodeContents(a('[data-region="displaytemplateexample"]'),b,c)}).fail(d.exception):g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a('[data-region="displaytemplateexample"]').text(b)}).fail(d.exception)},j=function(c){var e=c.split("/"),g=e.shift(),h=e.shift(),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};return a('[data-region="list-templates"]').on("click","[data-templatename]",function(b){var c=a(this).data("templatename");b.preventDefault(),j(c)}),{}});
|
||||
+1
-1
@@ -1 +1 @@
|
||||
define(["jquery","core/ajax","core/log","core/notification","core/templates"],function(a,b,c,d,e){var f=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a('[data-region="searchresults"]'),b,c)}).fail(d.exception)},g=function(){var c=a('[data-field="component"]').val(),e=a('[data-field="search"]').val();b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:c,search:e},done:f,fail:d.exception}],!0,!1)},h=null,i=function(a,b){null!==h&&window.clearTimeout(h),h=window.setTimeout(function(){a(),h=null},b)},j=function(){i(g,400)};return a('[data-region="list-templates"]').on("change",'[data-field="component"]',j),a('[data-region="list-templates"]').on("input",'[data-field="search"]',j),g(),{}});
|
||||
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a('[data-region="searchresults"]'),b,c)}).fail(d.exception)},h=function(c){var e=a('[data-field="component"]').val(),f=a('[data-field="search"]').val();b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){null!==i&&window.clearTimeout(i),i=window.setTimeout(function(){a(),i=null},b)},k=function(){j(h.bind(this,f.theme),400)};return a('[data-region="list-templates"]').on("change",'[data-field="component"]',k),a('[data-region="list-templates"]').on("input",'[data-field="search"]',k),h(f.theme),{}});
|
||||
@@ -33,6 +33,9 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
|
||||
*/
|
||||
var findDocsSection = function(templateSource, templateName) {
|
||||
|
||||
if (!templateSource) {
|
||||
return false;
|
||||
}
|
||||
// Find the comment section marked with @template component/template.
|
||||
var marker = "@template " + templateName,
|
||||
i = 0,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'],
|
||||
function($, ajax, log, notification, templates) {
|
||||
define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates', 'core/config'],
|
||||
function($, ajax, log, notification, templates, config) {
|
||||
|
||||
/**
|
||||
* The ajax call has returned with a new list of templates.
|
||||
@@ -42,15 +42,14 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
|
||||
*
|
||||
* @method refreshSearch
|
||||
*/
|
||||
var refreshSearch = function() {
|
||||
var refreshSearch = function(themename) {
|
||||
var componentStr = $('[data-field="component"]').val();
|
||||
var searchStr = $('[data-field="search"]').val();
|
||||
|
||||
// Trigger the search.
|
||||
|
||||
ajax.call([
|
||||
{ methodname: 'tool_templatelibrary_list_templates',
|
||||
args: { component: componentStr, search: searchStr },
|
||||
args: { component: componentStr, search: searchStr, themename: themename },
|
||||
done: reloadListTemplate,
|
||||
fail: notification.exception }
|
||||
], true, false);
|
||||
@@ -78,12 +77,12 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
|
||||
};
|
||||
|
||||
var changeHandler = function() {
|
||||
queueRefresh(refreshSearch, 400);
|
||||
queueRefresh(refreshSearch.bind(this, config.theme), 400);
|
||||
};
|
||||
// Add change handlers to refresh the list.
|
||||
$('[data-region="list-templates"]').on('change', '[data-field="component"]', changeHandler);
|
||||
$('[data-region="list-templates"]').on('input', '[data-field="search"]', changeHandler);
|
||||
|
||||
refreshSearch();
|
||||
refreshSearch(config.theme);
|
||||
return {};
|
||||
});
|
||||
|
||||
@@ -47,7 +47,12 @@ class api {
|
||||
* @return array[string] Where each template is in the form "component/templatename".
|
||||
*/
|
||||
public static function list_templates($component = '', $search = '', $themename = '') {
|
||||
global $CFG;
|
||||
global $CFG, $PAGE;
|
||||
|
||||
if (empty($themename)) {
|
||||
$themename = $PAGE->theme->name;
|
||||
}
|
||||
$themeconfig = \theme_config::load($themename);
|
||||
|
||||
$templatedirs = array();
|
||||
$results = array();
|
||||
@@ -77,6 +82,9 @@ class api {
|
||||
foreach ($plugintypes as $type => $dir) {
|
||||
$plugins = core_component::get_plugin_list_with_file($type, 'templates', false);
|
||||
foreach ($plugins as $plugin => $dir) {
|
||||
if ($type == 'theme' && $plugin != $themename && !in_array($plugin, $themeconfig->parents)) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($dir) && is_dir($dir)) {
|
||||
$pluginname = $type . '_' . $plugin;
|
||||
$dirs = mustache_template_finder::get_template_directories_for_component($pluginname, $themename);
|
||||
@@ -111,25 +119,30 @@ class api {
|
||||
*
|
||||
* @param string $component The component that holds the template.
|
||||
* @param string $template The name of the template.
|
||||
* @return string the template
|
||||
* @return string the template or false if template doesn't exist.
|
||||
*/
|
||||
public static function load_canonical_template($component, $template) {
|
||||
// Get the list of possible template directories.
|
||||
$dirs = mustache_template_finder::get_template_directories_for_component($component);
|
||||
$filename = false;
|
||||
$themedir = core_component::get_plugin_types()['theme'];
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
// Skip theme dirs - we only want the original plugin/core template.
|
||||
if (strpos($dir, "/theme/") === false) {
|
||||
$candidate = $dir . $template . '.mustache';
|
||||
if (file_exists($candidate)) {
|
||||
$filename = $candidate;
|
||||
break;
|
||||
}
|
||||
if (strpos($dir, $themedir) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$candidate = $dir . $template . '.mustache';
|
||||
if (file_exists($candidate)) {
|
||||
$filename = $candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filename === false) {
|
||||
throw new moodle_exception('filenotfound', 'error');
|
||||
// There are occasions where we don't have a core template.
|
||||
return false;
|
||||
}
|
||||
|
||||
$templatestr = file_get_contents($filename);
|
||||
|
||||
@@ -59,7 +59,13 @@ class external extends external_api {
|
||||
VALUE_DEFAULT,
|
||||
''
|
||||
);
|
||||
$params = array('component' => $component, 'search' => $search);
|
||||
$themename = new external_value(
|
||||
PARAM_COMPONENT,
|
||||
'The current theme',
|
||||
VALUE_DEFAULT,
|
||||
''
|
||||
);
|
||||
$params = array('component' => $component, 'search' => $search, 'themename' => $themename);
|
||||
return new external_function_parameters($params);
|
||||
}
|
||||
|
||||
@@ -67,16 +73,18 @@ class external extends external_api {
|
||||
* Loads the list of templates.
|
||||
* @param string $component Limit the search to a component.
|
||||
* @param string $search The search string.
|
||||
* @param string $themename The name of theme
|
||||
* @return array[string]
|
||||
*/
|
||||
public static function list_templates($component, $search) {
|
||||
public static function list_templates($component, $search, $themename = '') {
|
||||
$params = self::validate_parameters(self::list_templates_parameters(),
|
||||
array(
|
||||
'component' => $component,
|
||||
'search' => $search,
|
||||
'themename' => $themename,
|
||||
));
|
||||
|
||||
return api::list_templates($component, $search);
|
||||
return api::list_templates($component, $search, $themename);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +115,7 @@ class external extends external_api {
|
||||
*
|
||||
* @param string $component The component that holds the template.
|
||||
* @param string $template The name of the template.
|
||||
* @return string the template
|
||||
* @return string the template, false if template doesn't exist.
|
||||
*/
|
||||
public static function load_canonical_template($component, $template) {
|
||||
$params = self::validate_parameters(self::load_canonical_template_parameters(),
|
||||
|
||||
@@ -582,6 +582,11 @@ class tool_uploadcourse_course {
|
||||
}
|
||||
}
|
||||
|
||||
// Course start date.
|
||||
if (!empty($coursedata['startdate'])) {
|
||||
$coursedata['startdate'] = strtotime($coursedata['startdate']);
|
||||
}
|
||||
|
||||
// Ultimate check mode vs. existence.
|
||||
switch ($mode) {
|
||||
case tool_uploadcourse_processor::MODE_CREATE_NEW:
|
||||
@@ -631,11 +636,6 @@ class tool_uploadcourse_course {
|
||||
$this->do = self::DO_CREATE;
|
||||
}
|
||||
|
||||
// Course start date.
|
||||
if (!empty($coursedata['startdate'])) {
|
||||
$coursedata['startdate'] = strtotime($coursedata['startdate']);
|
||||
}
|
||||
|
||||
// Add role renaming.
|
||||
$errors = array();
|
||||
$rolenames = tool_uploadcourse_helper::get_role_names($this->rawdata, $errors);
|
||||
|
||||
@@ -425,7 +425,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
'fullname' => 'Fullname',
|
||||
'category' => '1',
|
||||
'visible' => '0',
|
||||
'startdate' => '8 June 1990',
|
||||
'startdate' => 644803200,
|
||||
'idnumber' => '123abc',
|
||||
'summary' => 'Summary',
|
||||
'format' => 'weeks',
|
||||
@@ -452,7 +452,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
$this->assertEquals($defaultdata['fullname'], $course->fullname);
|
||||
$this->assertEquals($defaultdata['category'], $course->category);
|
||||
$this->assertEquals($defaultdata['visible'], $course->visible);
|
||||
$this->assertEquals(mktime(0, 0, 0, 6, 8, 1990), $course->startdate);
|
||||
$this->assertEquals($defaultdata['startdate'], $course->startdate);
|
||||
$this->assertEquals($defaultdata['idnumber'], $course->idnumber);
|
||||
$this->assertEquals($defaultdata['summary'], $course->summary);
|
||||
$this->assertEquals($defaultdata['format'], $course->format);
|
||||
@@ -478,7 +478,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
'fullname' => 'Fullname 2',
|
||||
'category' => $cat->id,
|
||||
'visible' => '1',
|
||||
'startdate' => '11 June 1984',
|
||||
'startdate' => 455760000,
|
||||
'idnumber' => 'changedid',
|
||||
'summary' => 'Summary 2',
|
||||
'format' => 'topics',
|
||||
@@ -505,7 +505,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
$this->assertEquals($defaultdata['fullname'], $course->fullname);
|
||||
$this->assertEquals($defaultdata['category'], $course->category);
|
||||
$this->assertEquals($defaultdata['visible'], $course->visible);
|
||||
$this->assertEquals(mktime(0, 0, 0, 6, 11, 1984), $course->startdate);
|
||||
$this->assertEquals($defaultdata['startdate'], $course->startdate);
|
||||
$this->assertEquals($defaultdata['idnumber'], $course->idnumber);
|
||||
$this->assertEquals($defaultdata['summary'], $course->summary);
|
||||
$this->assertEquals($defaultdata['format'], $course->format);
|
||||
|
||||
+1
-1
@@ -1780,7 +1780,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
unset_cache_flag($this->pluginconfig.'/ntlmsess', $key);
|
||||
|
||||
// Redirection
|
||||
if (user_not_fully_set_up($USER)) {
|
||||
if (user_not_fully_set_up($USER, true)) {
|
||||
$urltogo = $CFG->wwwroot.'/user/edit.php';
|
||||
// We don't delete $SESSION->wantsurl yet, so we get there later
|
||||
} else if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ class auth_plugin_mnet extends auth_plugin_base {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (user_not_fully_set_up($remoteuser)) {
|
||||
if (user_not_fully_set_up($remoteuser, false)) {
|
||||
print_error('notenoughidpinfo', 'mnet');
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
&& $user = authenticate_user_login($frm->username, $frm->password)) {
|
||||
complete_user_login($user);
|
||||
|
||||
if (user_not_fully_set_up($USER)) {
|
||||
if (user_not_fully_set_up($USER, true)) {
|
||||
$urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&course='.SITEID;
|
||||
// We don't delete $SESSION->wantsurl yet, so we get there later
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class tree_node {
|
||||
|
||||
/** @var int Counter to be used in {@link tree_node::unique_sql_parameter()}. */
|
||||
protected static $uniquesqlparametercounter = 1;
|
||||
|
||||
/**
|
||||
* Determines whether this particular item is currently available
|
||||
* according to the availability criteria.
|
||||
@@ -242,10 +246,11 @@ abstract class tree_node {
|
||||
* @return SQL code for the parameter, e.g. ':pr1234'
|
||||
*/
|
||||
protected static function unique_sql_parameter(array &$params, $value) {
|
||||
static $count = 1;
|
||||
|
||||
// Note we intentionally do not use self:: here.
|
||||
$count = tree_node::$uniquesqlparametercounter++;
|
||||
$unique = 'usp' . $count;
|
||||
$params[$unique] = $value;
|
||||
$count++;
|
||||
return ':' . $unique;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,6 +675,63 @@ class tree_testcase extends \advanced_testcase {
|
||||
json_encode(tree::get_root_json(array($child, $child), tree::OP_AND, array(true, false))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the behaviour of the counter in unique_sql_parameter().
|
||||
*
|
||||
* There was a problem with static counters used to implement a sequence of
|
||||
* parameter placeholders (MDL-53481). As always with static variables, it
|
||||
* is a bit tricky to unit test the behaviour reliably as it depends on the
|
||||
* actual tests executed and also their order.
|
||||
*
|
||||
* To minimise risk of false expected behaviour, this test method should be
|
||||
* first one where {@link core_availability\tree::get_user_list_sql()} is
|
||||
* used. We also use higher number of condition instances to increase the
|
||||
* risk of the counter collision, should there remain a problem.
|
||||
*/
|
||||
public function test_unique_sql_parameter_behaviour() {
|
||||
global $DB;
|
||||
$this->resetAfterTest();
|
||||
$generator = $this->getDataGenerator();
|
||||
|
||||
// Create a test course with multiple groupings and groups and a student in each of them.
|
||||
$course = $generator->create_course();
|
||||
$user = $generator->create_user();
|
||||
$studentroleid = $DB->get_field('role', 'id', array('shortname' => 'student'));
|
||||
$generator->enrol_user($user->id, $course->id, $studentroleid);
|
||||
// The total number of groupings and groups must not be greater than 61.
|
||||
// There is a limit in MySQL on the max number of joined tables.
|
||||
$groups = [];
|
||||
for ($i = 0; $i < 25; $i++) {
|
||||
$group = $generator->create_group(array('courseid' => $course->id));
|
||||
groups_add_member($group, $user);
|
||||
$groups[] = $group;
|
||||
}
|
||||
$groupings = [];
|
||||
for ($i = 0; $i < 25; $i++) {
|
||||
$groupings[] = $generator->create_grouping(array('courseid' => $course->id));
|
||||
}
|
||||
foreach ($groupings as $grouping) {
|
||||
foreach ($groups as $group) {
|
||||
groups_assign_grouping($grouping->id, $group->id);
|
||||
}
|
||||
}
|
||||
$info = new \core_availability\mock_info($course);
|
||||
|
||||
// Make a huge tree with 'AND' of all groups and groupings conditions.
|
||||
$conditions = [];
|
||||
foreach ($groups as $group) {
|
||||
$conditions[] = \availability_group\condition::get_json($group->id);
|
||||
}
|
||||
foreach ($groupings as $groupingid) {
|
||||
$conditions[] = \availability_grouping\condition::get_json($grouping->id);
|
||||
}
|
||||
shuffle($conditions);
|
||||
$tree = new tree(tree::get_root_json($conditions));
|
||||
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
|
||||
// This must not throw exception.
|
||||
$DB->fix_sql_params($sql, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests get_user_list_sql.
|
||||
*/
|
||||
|
||||
@@ -381,7 +381,7 @@ class cc2moodle {
|
||||
if (!empty($format['defaultblocks'])) {
|
||||
$blocknames = $format['defaultblocks'];
|
||||
} else {
|
||||
if (!empty($CFG->defaultblocks)) {
|
||||
if (isset($CFG->defaultblocks)) {
|
||||
$blocknames = $CFG->defaultblocks;
|
||||
} else {
|
||||
$blocknames = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';
|
||||
|
||||
@@ -93,7 +93,9 @@ if ($action == 'choosebackupfile') {
|
||||
// If it's some weird other kind of file then use old code.
|
||||
$filename = restore_controller::get_tempdir_name($courseid, $USER->id);
|
||||
$pathname = $tmpdir . '/' . $filename;
|
||||
$fileinfo->copy_to_pathname($pathname);
|
||||
if (!$fileinfo->copy_to_pathname($pathname)) {
|
||||
throw new restore_ui_exception('errorcopyingbackupfile', null, $pathname);
|
||||
}
|
||||
$restore_url = new moodle_url('/backup/restore.php', array(
|
||||
'contextid' => $contextid, 'filename' => $filename));
|
||||
}
|
||||
@@ -115,7 +117,9 @@ $data = $form->get_data();
|
||||
if ($data && has_capability('moodle/restore:uploadfile', $context)) {
|
||||
$filename = restore_controller::get_tempdir_name($courseid, $USER->id);
|
||||
$pathname = $tmpdir . '/' . $filename;
|
||||
$form->save_file('backupfile', $pathname);
|
||||
if (!$form->save_file('backupfile', $pathname)) {
|
||||
throw new restore_ui_exception('errorcopyingbackupfile', null, $pathname);
|
||||
}
|
||||
$restore_url = new moodle_url('/backup/restore.php', array('contextid'=>$contextid, 'filename'=>$filename));
|
||||
redirect($restore_url);
|
||||
die;
|
||||
|
||||
@@ -95,7 +95,8 @@ class backup_logger_testcase extends basic_testcase {
|
||||
$lo3 = new mock_base_logger3(backup::LOG_ERROR);
|
||||
$lo1->set_next($lo2);
|
||||
$lo2->set_next($lo3);
|
||||
$this->assertFalse($lo1->process('test', backup::LOG_ERROR));
|
||||
$msg = 13;
|
||||
$this->assertFalse($lo1->process($msg, backup::LOG_ERROR));
|
||||
|
||||
// Test checksum correct
|
||||
$lo1 = new mock_base_logger1(backup::LOG_ERROR);
|
||||
|
||||
@@ -207,12 +207,15 @@ class award_criteria_manual extends award_criteria {
|
||||
return array($join, $where, $params);
|
||||
} else {
|
||||
foreach ($this->params as $param) {
|
||||
$join .= " LEFT JOIN {badge_manual_award} bma{$param['role']} ON
|
||||
bma{$param['role']}.recipientid = u.id AND
|
||||
bma{$param['role']}.issuerrole = :issuerrole{$param['role']} ";
|
||||
$where .= " AND bma{$param['role']}.issuerrole IS NOT NULL ";
|
||||
$roledata[] = " bma.issuerrole = :issuerrole{$param['role']} ";
|
||||
$params["issuerrole{$param['role']}"] = $param['role'];
|
||||
}
|
||||
if (!empty($roledata)) {
|
||||
$extraon = implode(' AND ', $roledata);
|
||||
$join = " JOIN {badge_manual_award} bma ON bma.recipientid = u.id
|
||||
AND bma.badgeid = :badgeid{$this->badgeid} AND ({$extraon})";
|
||||
$params["badgeid{$this->badgeid}"] = $this->badgeid;
|
||||
}
|
||||
return array($join, $where, $params);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ if ($type == BADGE_TYPE_SITE) {
|
||||
}
|
||||
echo $OUTPUT->box('', 'notifyproblem hide', 'check_connection');
|
||||
|
||||
$totalcount = count(badges_get_badges($type, $courseid, '', '' , '', ''));
|
||||
$totalcount = count(badges_get_badges($type, $courseid, '', '' , 0, 0));
|
||||
$records = badges_get_badges($type, $courseid, $sortby, $sorthow, $page, BADGE_PERPAGE);
|
||||
|
||||
if ($totalcount) {
|
||||
|
||||
@@ -288,6 +288,47 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
// The term Totara doesn't appear anywhere in the badges.
|
||||
$result = badges_get_user_badges($user2->id, 0, 0, 0, 'Totara');
|
||||
$this->assertCount(0, $result);
|
||||
|
||||
// Issue a user with a course badge and verify its returned based on if
|
||||
// coursebadges are enabled or disabled.
|
||||
$sitebadgeid = key($badges);
|
||||
$badges[$sitebadgeid]->issue($this->user->id, true);
|
||||
|
||||
$badge = new stdClass();
|
||||
$badge->id = null;
|
||||
$badge->name = "Test course badge";
|
||||
$badge->description = "Testing course badge";
|
||||
$badge->timecreated = $now;
|
||||
$badge->timemodified = $now;
|
||||
$badge->usercreated = $user1->id;
|
||||
$badge->usermodified = $user1->id;
|
||||
$badge->issuername = "Test issuer";
|
||||
$badge->issuerurl = "http://issuer-url.domain.co.nz";
|
||||
$badge->issuercontact = "issuer@example.com";
|
||||
$badge->expiredate = null;
|
||||
$badge->expireperiod = null;
|
||||
$badge->type = BADGE_TYPE_COURSE;
|
||||
$badge->courseid = $this->course->id;
|
||||
$badge->messagesubject = "Test message subject for course badge";
|
||||
$badge->message = "Test message body for course badge";
|
||||
$badge->attachment = 1;
|
||||
$badge->notification = 0;
|
||||
$badge->status = BADGE_STATUS_ACTIVE;
|
||||
|
||||
$badgeid = $DB->insert_record('badge', $badge, true);
|
||||
$badges[$badgeid] = new badge($badgeid);
|
||||
$badges[$badgeid]->issue($this->user->id, true);
|
||||
|
||||
// With coursebadges off, we should only get the site badge.
|
||||
set_config('badges_allowcoursebadges', false);
|
||||
$result = badges_get_user_badges($this->user->id);
|
||||
$this->assertCount(1, $result);
|
||||
|
||||
// With it on, we should get both.
|
||||
set_config('badges_allowcoursebadges', true);
|
||||
$result = badges_get_user_badges($this->user->id);
|
||||
$this->assertCount(2, $result);
|
||||
|
||||
}
|
||||
|
||||
public function data_for_message_from_template() {
|
||||
|
||||
@@ -231,3 +231,86 @@ Feature: Award badges
|
||||
And I log in as "student1"
|
||||
And I follow "Profile" in the user menu
|
||||
Then I should see "Course Badge"
|
||||
|
||||
@javascript
|
||||
Scenario: All of the selected roles can award badges
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| student2 | Student | 2 | student2@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category | groupmode |
|
||||
| Course 1 | C1 | 0 | 1 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
# Create course badge 1.
|
||||
And I navigate to "Add a new badge" node in "Course administration > Badges"
|
||||
And I follow "Add a new badge"
|
||||
And I set the following fields to these values:
|
||||
| Name | Course Badge 1 |
|
||||
| Description | Course badge description |
|
||||
| issuername | Tester of course badge |
|
||||
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
|
||||
And I press "Create badge"
|
||||
And I set the field "type" to "Manual issue by role"
|
||||
And I expand all fieldsets
|
||||
# Set to ANY of the roles awards badge.
|
||||
And I set the field "Teacher" to "1"
|
||||
And I set the field "Any of the selected roles awards the badge" to "1"
|
||||
And I press "Save"
|
||||
And I press "Enable access"
|
||||
And I press "Continue"
|
||||
And I follow "Recipients (0)"
|
||||
And I press "Award badge"
|
||||
# Award course badge 1 to student 1.
|
||||
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Award badge"
|
||||
And I follow "Course Badge 1"
|
||||
And I follow "Recipients (1)"
|
||||
Then I should see "Recipients (1)"
|
||||
# Add course badge 2.
|
||||
And I navigate to "Add a new badge" node in "Course administration > Badges"
|
||||
And I follow "Add a new badge"
|
||||
And I set the following fields to these values:
|
||||
| Name | Course Badge 2 |
|
||||
| Description | Course badge description |
|
||||
| issuername | Tester of course badge |
|
||||
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
|
||||
And I press "Create badge"
|
||||
And I set the field "type" to "Manual issue by role"
|
||||
And I expand all fieldsets
|
||||
# Set to ALL of the selected roles award badge.
|
||||
And I set the field "Teacher" to "1"
|
||||
And I set the field "All of the selected roles award the badge" to "1"
|
||||
And I press "Save"
|
||||
And I press "Enable access"
|
||||
And I press "Continue"
|
||||
And I follow "Recipients (0)"
|
||||
And I press "Award badge"
|
||||
# Award course badge 2 to student 2.
|
||||
And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)"
|
||||
When I press "Award badge"
|
||||
And I follow "Course Badge 2"
|
||||
And I follow "Recipients (1)"
|
||||
Then I should see "Recipients (1)"
|
||||
And I log out
|
||||
And I trigger cron
|
||||
# Student 1 should have just course badge 1.
|
||||
And I log in as "student1"
|
||||
And I follow "Profile" in the user menu
|
||||
When I follow "Course 1"
|
||||
Then I should see "Course Badge 1"
|
||||
And I should not see "Course Badge 2"
|
||||
And I log out
|
||||
# Student 2 should have just course badge 2.
|
||||
And I log in as "student2"
|
||||
And I follow "Profile" in the user menu
|
||||
When I follow "Course 1"
|
||||
Then I should see "Course Badge 2"
|
||||
Then I should not see "Course Badge 1"
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ $output = $PAGE->get_renderer('core', 'badges');
|
||||
echo $output->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
$totalcount = count(badges_get_badges($type, $courseid, '', '', '', '', $USER->id));
|
||||
$totalcount = count(badges_get_badges($type, $courseid, '', '', 0, 0, $USER->id));
|
||||
$records = badges_get_badges($type, $courseid, $sortby, $sorthow, $page, BADGE_PERPAGE, $USER->id);
|
||||
|
||||
if ($totalcount) {
|
||||
|
||||
@@ -86,7 +86,7 @@ class block_glossary_random extends block_base {
|
||||
switch ($this->config->type) {
|
||||
|
||||
case BGR_RANDOMLY:
|
||||
$i = rand(1,$numberofentries);
|
||||
$i = ($numberofentries > 1) ? rand(1, $numberofentries) : 1;
|
||||
$limitfrom = $i-1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -158,7 +158,8 @@ Feature: View structural changes in recent activity block
|
||||
And I should see "Added Forum" in the "Recent activity" "block"
|
||||
And I should see "ForumNew" in the "Recent activity" "block"
|
||||
And I log out
|
||||
# Update forum as a teacher
|
||||
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
|
||||
And I wait "1" seconds
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I follow "ForumNew"
|
||||
|
||||
@@ -56,7 +56,8 @@ class block_rss_client_edit_form extends block_edit_form {
|
||||
$params += $inparams;
|
||||
}
|
||||
|
||||
$titlesql = "CASE WHEN preferredtitle = '' THEN {$DB->sql_compare_text('title', 64)} ELSE preferredtitle END";
|
||||
$titlesql = "CASE WHEN {$DB->sql_isempty('block_rss_client','preferredtitle', false, false)}
|
||||
THEN {$DB->sql_compare_text('title', 64)} ELSE preferredtitle END";
|
||||
|
||||
$rssfeeds = $DB->get_records_sql_menu("
|
||||
SELECT id, $titlesql
|
||||
|
||||
@@ -68,7 +68,7 @@ Feature: Add and configure blocks throughout the site
|
||||
And I add the "HTML" block
|
||||
And I configure the "(new HTML block)" block
|
||||
And I set the following fields to these values:
|
||||
| Block title | Foo " onload="document.getElementsByTagName('body')[0].remove()" alt="
|
||||
| Content | Example
|
||||
| Block title | Foo " onload="document.getElementsByTagName('body')[0].remove()" alt=" |
|
||||
| Content | Example |
|
||||
When I press "Save changes"
|
||||
Then I should see "Course overview"
|
||||
|
||||
@@ -36,7 +36,7 @@ class blog_edit_external_form extends moodleform {
|
||||
|
||||
$mform =& $this->_form;
|
||||
|
||||
$mform->addElement('url', 'url', get_string('url', 'blog'), array('size' => 50));
|
||||
$mform->addElement('url', 'url', get_string('url', 'blog'), array('size' => 50), array('usefilepicker' => false));
|
||||
$mform->setType('url', PARAM_URL);
|
||||
$mform->addRule('url', get_string('emptyurl', 'blog'), 'required', null, 'client');
|
||||
$mform->addHelpButton('url', 'url', 'blog');
|
||||
|
||||
+2
-2
@@ -211,7 +211,7 @@ function blog_rss_get_feed($context, $args) {
|
||||
if ($blogentries) {
|
||||
$items = array();
|
||||
foreach ($blogentries as $blogentry) {
|
||||
$item = null;
|
||||
$item = new stdClass();
|
||||
$item->author = fullname($DB->get_record('user', array('id' => $blogentry->userid))); // TODO: this is slow.
|
||||
$item->title = $blogentry->subject;
|
||||
$item->pubdate = $blogentry->lastmodified;
|
||||
@@ -236,7 +236,7 @@ function blog_rss_get_feed($context, $args) {
|
||||
|
||||
switch ($type) {
|
||||
case 'user':
|
||||
$info = fullname($DB->get_record('user', array('id'=>$id), 'firstname,lastname'));
|
||||
$info = fullname($DB->get_record('user', array('id'=>$id), get_all_user_name_fields(true)));
|
||||
break;
|
||||
case 'course':
|
||||
$info = $DB->get_field('course', 'fullname', array('id'=>$id));
|
||||
|
||||
Vendored
+3
-2
@@ -161,6 +161,7 @@ class cache_factory {
|
||||
$factory->reset_cache_instances();
|
||||
$factory->configs = array();
|
||||
$factory->definitions = array();
|
||||
$factory->definitionstores = array();
|
||||
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
|
||||
// Reset the state to uninitialised.
|
||||
$factory->state = self::STATE_UNINITIALISED;
|
||||
@@ -198,7 +199,7 @@ class cache_factory {
|
||||
}
|
||||
$definition = $this->create_definition($component, $area);
|
||||
$definition->set_identifiers($identifiers);
|
||||
$cache = $this->create_cache($definition, $identifiers);
|
||||
$cache = $this->create_cache($definition);
|
||||
// Loaders are always held onto to speed up subsequent requests.
|
||||
$this->cachesfromdefinitions[$definitionname] = $cache;
|
||||
return $cache;
|
||||
@@ -227,7 +228,7 @@ class cache_factory {
|
||||
}
|
||||
$definition = cache_definition::load_adhoc($mode, $component, $area, $options);
|
||||
$definition->set_identifiers($identifiers);
|
||||
$cache = $this->create_cache($definition, $identifiers);
|
||||
$cache = $this->create_cache($definition);
|
||||
$this->cachesfromparams[$key] = $cache;
|
||||
return $cache;
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -213,7 +213,8 @@ class cache_factory_disabled extends cache_factory {
|
||||
*/
|
||||
public function create_cache_from_definition($component, $area, array $identifiers = array(), $unused = null) {
|
||||
$definition = $this->create_definition($component, $area);
|
||||
$cache = $this->create_cache($definition, $identifiers);
|
||||
$definition->set_identifiers($identifiers);
|
||||
$cache = $this->create_cache($definition);
|
||||
return $cache;
|
||||
}
|
||||
|
||||
@@ -233,7 +234,8 @@ class cache_factory_disabled extends cache_factory {
|
||||
*/
|
||||
public function create_cache_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
|
||||
$definition = cache_definition::load_adhoc($mode, $component, $area);
|
||||
$cache = $this->create_cache($definition, $identifiers);
|
||||
$definition->set_identifiers($identifiers);
|
||||
$cache = $this->create_cache($definition);
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -691,7 +691,7 @@ abstract class cache_administration_helper extends cache_helper {
|
||||
'plugin' => $details['plugin'],
|
||||
'default' => $details['default'],
|
||||
'isready' => $store->is_ready(),
|
||||
'requirementsmet' => $store->are_requirements_met(),
|
||||
'requirementsmet' => $class::are_requirements_met(),
|
||||
'mappings' => 0,
|
||||
'lock' => $lock,
|
||||
'modes' => array(
|
||||
|
||||
Vendored
+13
@@ -536,6 +536,11 @@ class cache_phpunit_factory extends cache_factory {
|
||||
parent::disable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var bool Whether the warning notice about alternative cache store used has been displayed.
|
||||
*/
|
||||
protected $altcachestorenotice = false;
|
||||
|
||||
/**
|
||||
* Creates a store instance given its name and configuration.
|
||||
*
|
||||
@@ -559,7 +564,15 @@ class cache_phpunit_factory extends cache_factory {
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
// Notify user that alternative store is being used, so action can be taken.
|
||||
if (!$this->altcachestorenotice) {
|
||||
echo PHP_EOL . "++ WARNING: " . 'Failed to use "' . $details['plugin'] . '" cache store, alt "' .
|
||||
$details['alt']['plugin'] . '" cache store is used.' . PHP_EOL . PHP_EOL;
|
||||
$this->altcachestorenotice = true;
|
||||
}
|
||||
$details = $details['alt'];
|
||||
$details['class'] = 'cachestore_'.$details['plugin'];
|
||||
$name = $details['name'];
|
||||
}
|
||||
|
||||
|
||||
+17
-10
@@ -702,12 +702,12 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
|
||||
// Events from a number of users
|
||||
if(!empty($whereclause)) $whereclause .= ' OR';
|
||||
list($insqlusers, $inparamsusers) = $DB->get_in_or_equal($users, SQL_PARAMS_NAMED);
|
||||
$whereclause .= " (userid $insqlusers AND courseid = 0 AND groupid = 0)";
|
||||
$whereclause .= " (e.userid $insqlusers AND e.courseid = 0 AND e.groupid = 0)";
|
||||
$params = array_merge($params, $inparamsusers);
|
||||
} else if($users === true) {
|
||||
// Events from ALL users
|
||||
if(!empty($whereclause)) $whereclause .= ' OR';
|
||||
$whereclause .= ' (userid != 0 AND courseid = 0 AND groupid = 0)';
|
||||
$whereclause .= ' (e.userid != 0 AND e.courseid = 0 AND e.groupid = 0)';
|
||||
} else if($users === false) {
|
||||
// No user at all, do nothing
|
||||
}
|
||||
@@ -716,24 +716,24 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
|
||||
// Events from a number of groups
|
||||
if(!empty($whereclause)) $whereclause .= ' OR';
|
||||
list($insqlgroups, $inparamsgroups) = $DB->get_in_or_equal($groups, SQL_PARAMS_NAMED);
|
||||
$whereclause .= " groupid $insqlgroups ";
|
||||
$whereclause .= " e.groupid $insqlgroups ";
|
||||
$params = array_merge($params, $inparamsgroups);
|
||||
} else if($groups === true) {
|
||||
// Events from ALL groups
|
||||
if(!empty($whereclause)) $whereclause .= ' OR ';
|
||||
$whereclause .= ' groupid != 0';
|
||||
$whereclause .= ' e.groupid != 0';
|
||||
}
|
||||
// boolean false (no groups at all): we don't need to do anything
|
||||
|
||||
if ((is_array($courses) && !empty($courses)) or is_numeric($courses)) {
|
||||
if(!empty($whereclause)) $whereclause .= ' OR';
|
||||
list($insqlcourses, $inparamscourses) = $DB->get_in_or_equal($courses, SQL_PARAMS_NAMED);
|
||||
$whereclause .= " (groupid = 0 AND courseid $insqlcourses)";
|
||||
$whereclause .= " (e.groupid = 0 AND e.courseid $insqlcourses)";
|
||||
$params = array_merge($params, $inparamscourses);
|
||||
} else if ($courses === true) {
|
||||
// Events from ALL courses
|
||||
if(!empty($whereclause)) $whereclause .= ' OR';
|
||||
$whereclause .= ' (groupid = 0 AND courseid != 0)';
|
||||
$whereclause .= ' (e.groupid = 0 AND e.courseid != 0)';
|
||||
}
|
||||
|
||||
// Security check: if, by now, we have NOTHING in $whereclause, then it means
|
||||
@@ -745,10 +745,10 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
|
||||
}
|
||||
|
||||
if($withduration) {
|
||||
$timeclause = '(timestart >= '.$tstart.' OR timestart + timeduration > '.$tstart.') AND timestart <= '.$tend;
|
||||
$timeclause = '(e.timestart >= '.$tstart.' OR e.timestart + e.timeduration > '.$tstart.') AND e.timestart <= '.$tend;
|
||||
}
|
||||
else {
|
||||
$timeclause = 'timestart >= '.$tstart.' AND timestart <= '.$tend;
|
||||
$timeclause = 'e.timestart >= '.$tstart.' AND e.timestart <= '.$tend;
|
||||
}
|
||||
if(!empty($whereclause)) {
|
||||
// We have additional constraints
|
||||
@@ -760,10 +760,17 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
|
||||
}
|
||||
|
||||
if ($ignorehidden) {
|
||||
$whereclause .= ' AND visible = 1';
|
||||
$whereclause .= ' AND e.visible = 1';
|
||||
}
|
||||
|
||||
$events = $DB->get_records_select('event', $whereclause, $params, 'timestart');
|
||||
$sql = "SELECT e.*
|
||||
FROM {event} e
|
||||
LEFT JOIN {modules} m ON e.modulename = m.name
|
||||
-- Non visible modules will have a value of 0.
|
||||
WHERE (m.visible = 1 OR m.visible IS NULL) AND $whereclause
|
||||
ORDER BY e.timestart";
|
||||
$events = $DB->get_records_sql($sql, $params);
|
||||
|
||||
if ($events === false) {
|
||||
$events = array();
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ class core_calendar_type_testcase extends advanced_testcase {
|
||||
$el->_createElements();
|
||||
$submitvalues = array('dateselector' => $date);
|
||||
|
||||
$this->assertSame($el->exportValue($submitvalues), array('dateselector' => $date['timestamp']));
|
||||
$this->assertSame(array('dateselector' => $date['timestamp']), $el->exportValue($submitvalues, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,4 +111,64 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
$this->expectOutputRegex('/Error updating calendar subscription: The given iCal URL is invalid/');
|
||||
calendar_cron();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the calendar_get_events() function only returns activity
|
||||
* events that are enabled.
|
||||
*/
|
||||
public function test_calendar_get_events_with_disabled_module() {
|
||||
global $DB;
|
||||
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$events = [[
|
||||
'name' => 'Start of assignment',
|
||||
'description' => '',
|
||||
'format' => 1,
|
||||
'courseid' => $course->id,
|
||||
'groupid' => 0,
|
||||
'userid' => 2,
|
||||
'modulename' => 'assign',
|
||||
'instance' => 1,
|
||||
'eventtype' => 'due',
|
||||
'timestart' => time(),
|
||||
'timeduration' => 86400,
|
||||
'visible' => 1
|
||||
], [
|
||||
'name' => 'Start of lesson',
|
||||
'description' => '',
|
||||
'format' => 1,
|
||||
'courseid' => $course->id,
|
||||
'groupid' => 0,
|
||||
'userid' => 2,
|
||||
'modulename' => 'lesson',
|
||||
'instance' => 1,
|
||||
'eventtype' => 'end',
|
||||
'timestart' => time(),
|
||||
'timeduration' => 86400,
|
||||
'visible' => 1
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($events as $event) {
|
||||
calendar_event::create($event, false);
|
||||
}
|
||||
|
||||
$timestart = time() - 60;
|
||||
$timeend = time() + 60;
|
||||
|
||||
// Get all events.
|
||||
$events = calendar_get_events($timestart, $timeend, true, 0, true);
|
||||
$this->assertCount(2, $events);
|
||||
|
||||
// Disable the lesson module.
|
||||
$modulerecord = $DB->get_record('modules', ['name' => 'lesson']);
|
||||
$modulerecord->visible = 0;
|
||||
$DB->update_record('modules', $modulerecord);
|
||||
|
||||
// Check that we only return the assign event.
|
||||
$events = calendar_get_events($timestart, $timeend, true, 0, true);
|
||||
$this->assertCount(1, $events);
|
||||
$event = reset($events);
|
||||
$this->assertEquals('assign', $event->modulename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +249,15 @@ $CFG->admin = 'admin';
|
||||
// $CFG->session_memcached_acquire_lock_timeout = 120;
|
||||
// $CFG->session_memcached_lock_expire = 7200; // Ignored if PECL memcached is below version 2.2.0
|
||||
//
|
||||
// Redis session handler (requires redis server and redis extension):
|
||||
// $CFG->session_handler_class = '\core\session\redis';
|
||||
// $CFG->session_redis_host = '127.0.0.1';
|
||||
// $CFG->session_redis_port = 6379; // Optional.
|
||||
// $CFG->session_redis_database = 0; // Optional, default is db 0.
|
||||
// $CFG->session_redis_prefix = ''; // Optional, default is don't set one.
|
||||
// $CFG->session_redis_acquire_lock_timeout = 120;
|
||||
// $CFG->session_redis_lock_expire = 7200;
|
||||
//
|
||||
// Memcache session handler (requires memcached server and memcache extension):
|
||||
// $CFG->session_handler_class = '\core\session\memcache';
|
||||
// $CFG->session_memcache_save_path = '127.0.0.1:11211';
|
||||
|
||||
@@ -96,6 +96,9 @@ abstract class format_base {
|
||||
* @return string
|
||||
*/
|
||||
protected static final function get_format_or_default($format) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
|
||||
if (array_key_exists($format, self::$classesforformat)) {
|
||||
return self::$classesforformat[$format];
|
||||
}
|
||||
@@ -477,7 +480,7 @@ abstract class format_base {
|
||||
*/
|
||||
public function get_default_blocks() {
|
||||
global $CFG;
|
||||
if (!empty($CFG->defaultblocks)){
|
||||
if (isset($CFG->defaultblocks)) {
|
||||
return blocks_parse_default_blocks_list($CFG->defaultblocks);
|
||||
}
|
||||
$blocknames = array(
|
||||
|
||||
@@ -2660,6 +2660,11 @@ function update_course($data, $editoroptions = NULL) {
|
||||
|
||||
$data->timemodified = time();
|
||||
|
||||
// Prevent changes on front page course.
|
||||
if ($data->id == SITEID) {
|
||||
throw new moodle_exception('invalidcourse', 'error');
|
||||
}
|
||||
|
||||
$oldcourse = course_get_format($data->id)->get_course();
|
||||
$context = context_course::instance($oldcourse->id);
|
||||
|
||||
|
||||
@@ -2735,4 +2735,16 @@ class core_course_courselib_testcase extends advanced_testcase {
|
||||
$this->assertNull($DB->get_field('course_modules', 'availability',
|
||||
array('id' => $label->cmid)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test test_update_course_frontpage_category.
|
||||
*/
|
||||
public function test_update_course_frontpage_category() {
|
||||
// Fetch front page course.
|
||||
$course = get_course(SITEID);
|
||||
// Test update information on front page course.
|
||||
$course->category = 99;
|
||||
$this->setExpectedException('moodle_exception');
|
||||
update_course($course);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
YUI.add('moodle-course-dragdrop', function (Y, NAME) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Drag and Drop for course sections and course modules.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
YUI.add('moodle-course-dragdrop', function (Y, NAME) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Drag and Drop for course sections and course modules.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
YUI.add('moodle-course-management', function (Y, NAME) {
|
||||
|
||||
/* global DragDrop, Category, Course */
|
||||
|
||||
/**
|
||||
* Provides drop down menus for list of action links.
|
||||
*
|
||||
@@ -588,6 +590,8 @@ M.course.management.console = null;
|
||||
M.course.management.init = function(config) {
|
||||
M.course.management.console = new Console(config);
|
||||
};
|
||||
/* global Console */
|
||||
|
||||
/**
|
||||
* Drag and Drop handler
|
||||
*
|
||||
@@ -1173,6 +1177,8 @@ Item.prototype = {
|
||||
}
|
||||
};
|
||||
Y.extend(Item, Y.Base, Item.prototype);
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed category.
|
||||
*
|
||||
@@ -1616,6 +1622,8 @@ Category.prototype = {
|
||||
}
|
||||
};
|
||||
Y.extend(Category, Item, Category.prototype);
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed course.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
YUI.add('moodle-course-management', function (Y, NAME) {
|
||||
|
||||
/* global DragDrop, Category, Course */
|
||||
|
||||
/**
|
||||
* Provides drop down menus for list of action links.
|
||||
*
|
||||
@@ -581,6 +583,8 @@ M.course.management.console = null;
|
||||
M.course.management.init = function(config) {
|
||||
M.course.management.console = new Console(config);
|
||||
};
|
||||
/* global Console */
|
||||
|
||||
/**
|
||||
* Drag and Drop handler
|
||||
*
|
||||
@@ -1147,6 +1151,8 @@ Item.prototype = {
|
||||
}
|
||||
};
|
||||
Y.extend(Item, Y.Base, Item.prototype);
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed category.
|
||||
*
|
||||
@@ -1575,6 +1581,8 @@ Category.prototype = {
|
||||
}
|
||||
};
|
||||
Y.extend(Category, Item, Category.prototype);
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed course.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
YUI.add('moodle-course-toolboxes', function (Y, NAME) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
@@ -201,6 +202,7 @@ Y.extend(TOOLBOX, Y.Base, {
|
||||
}
|
||||
}
|
||||
);
|
||||
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
@@ -931,6 +933,8 @@ M.course.init_resource_toolbox = function(config) {
|
||||
M.course.resource_toolbox = new RESOURCETOOLBOX(config);
|
||||
return M.course.resource_toolbox;
|
||||
};
|
||||
/* global SELECTOR, TOOLBOX */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
YUI.add('moodle-course-toolboxes', function (Y, NAME) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
@@ -201,6 +202,7 @@ Y.extend(TOOLBOX, Y.Base, {
|
||||
}
|
||||
}
|
||||
);
|
||||
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
@@ -931,6 +933,8 @@ M.course.init_resource_toolbox = function(config) {
|
||||
M.course.resource_toolbox = new RESOURCETOOLBOX(config);
|
||||
return M.course.resource_toolbox;
|
||||
};
|
||||
/* global SELECTOR, TOOLBOX */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Drag and Drop for course sections and course modules.
|
||||
*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed category.
|
||||
*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
/* global DragDrop, Category, Course */
|
||||
|
||||
/**
|
||||
* Provides drop down menus for list of action links.
|
||||
*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
/* global Item */
|
||||
|
||||
/**
|
||||
* A managed course.
|
||||
*
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
/* global Console */
|
||||
|
||||
/**
|
||||
* Drag and Drop handler
|
||||
*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
/* global SELECTOR, TOOLBOX */
|
||||
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Resource and activity toolbox class.
|
||||
*
|
||||
@@ -199,4 +200,3 @@ Y.extend(TOOLBOX, Y.Base, {
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ switch ($action) {
|
||||
break;
|
||||
case 'getassignable':
|
||||
$otheruserroles = optional_param('otherusers', false, PARAM_BOOL);
|
||||
$outcome->response = array_reverse($manager->get_assignable_roles($otheruserroles), true);
|
||||
$outcome->response = $manager->get_assignable_roles_for_json($otheruserroles);
|
||||
break;
|
||||
case 'searchotherusers':
|
||||
$search = optional_param('search', '', PARAM_RAW);
|
||||
|
||||
+28
-14
@@ -171,13 +171,12 @@ class course_enrolment_manager {
|
||||
$sqltotal = "SELECT COUNT(DISTINCT u.id)
|
||||
FROM {user} u
|
||||
JOIN {user_enrolments} ue ON (ue.userid = u.id AND ue.enrolid $instancessql)
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid)
|
||||
LEFT JOIN {groups_members} gm ON u.id = gm.userid AND gm.groupid IN (
|
||||
SELECT g.id
|
||||
FROM {groups} g
|
||||
WHERE g.courseid = e.courseid
|
||||
)
|
||||
WHERE $filtersql";
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid)";
|
||||
if ($this->groupfilter) {
|
||||
$sqltotal .= " LEFT JOIN ({groups_members} gm JOIN {groups} g ON (g.id = gm.groupid))
|
||||
ON (u.id = gm.userid AND g.courseid = e.courseid)";
|
||||
}
|
||||
$sqltotal .= "WHERE $filtersql";
|
||||
$this->totalusers = (int)$DB->count_records_sql($sqltotal, $params);
|
||||
}
|
||||
return $this->totalusers;
|
||||
@@ -245,13 +244,12 @@ class course_enrolment_manager {
|
||||
FROM {user} u
|
||||
JOIN {user_enrolments} ue ON (ue.userid = u.id AND ue.enrolid $instancessql)
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid)
|
||||
LEFT JOIN {user_lastaccess} ul ON (ul.courseid = e.courseid AND ul.userid = u.id)
|
||||
LEFT JOIN {groups_members} gm ON u.id = gm.userid AND gm.groupid IN (
|
||||
SELECT g.id
|
||||
FROM {groups} g
|
||||
WHERE g.courseid = e.courseid
|
||||
)
|
||||
WHERE $filtersql
|
||||
LEFT JOIN {user_lastaccess} ul ON (ul.courseid = e.courseid AND ul.userid = u.id)";
|
||||
if ($this->groupfilter) {
|
||||
$sql .= " LEFT JOIN ({groups_members} gm JOIN {groups} g ON (g.id = gm.groupid))
|
||||
ON (u.id = gm.userid AND g.courseid = e.courseid)";
|
||||
}
|
||||
$sql .= "WHERE $filtersql
|
||||
ORDER BY $sort $direction";
|
||||
$this->users[$key] = $DB->get_records_sql($sql, $params, $page*$perpage, $perpage);
|
||||
}
|
||||
@@ -623,6 +621,22 @@ class course_enrolment_manager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the assignable roles for this course, wrapped in an array to ensure
|
||||
* role sort order is not lost during json deserialisation.
|
||||
*
|
||||
* @param boolean $otherusers whether to include the assignable roles for other users
|
||||
* @return array
|
||||
*/
|
||||
public function get_assignable_roles_for_json($otherusers = false) {
|
||||
$rolesarray = array();
|
||||
$assignable = $this->get_assignable_roles($otherusers);
|
||||
foreach ($assignable as $id => $role) {
|
||||
$rolesarray[] = array('id' => $id, 'name' => $role);
|
||||
}
|
||||
return $rolesarray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the groups for this course.
|
||||
*
|
||||
|
||||
+2
-2
@@ -198,8 +198,8 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
var index = 0, count = 0;
|
||||
for (var i in roles) {
|
||||
count++;
|
||||
var option = create('<option value="'+i+'">'+roles[i]+'</option>');
|
||||
if (i == v) {
|
||||
var option = create('<option value="' + roles[i].id + '">' + roles[i].name + '</option>');
|
||||
if (roles[i].id == v) {
|
||||
index = count;
|
||||
}
|
||||
s.append(option);
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Test course_enrolment_manager parts.
|
||||
*
|
||||
* @package core_enrol
|
||||
* @category test
|
||||
* @copyright 2016 Ruslan Kabalin, Lancaster University
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
||||
/**
|
||||
* Test course_enrolment_manager parts.
|
||||
*
|
||||
* @package core
|
||||
* @category test
|
||||
* @copyright 2016 Ruslan Kabalin, Lancaster University
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_course_enrolment_manager_testcase extends advanced_testcase {
|
||||
/**
|
||||
* The course context used in tests.
|
||||
* @var stdClass
|
||||
*/
|
||||
private $course = null;
|
||||
/**
|
||||
* List of users used in tests.
|
||||
* @var array
|
||||
*/
|
||||
private $users = array();
|
||||
/**
|
||||
* List of groups used in tests.
|
||||
* @var array
|
||||
*/
|
||||
private $groups = array();
|
||||
|
||||
/**
|
||||
* Tests set up
|
||||
*/
|
||||
protected function setUp() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/enrol/locallib.php');
|
||||
$this->setAdminUser();
|
||||
|
||||
$users = array();
|
||||
$groups = array();
|
||||
// Create the course and the users.
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$users['user0'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'user0', 'firstname' => 'user0')); // A user without group.
|
||||
$users['user1'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'user1', 'firstname' => 'user1')); // User for group 1.
|
||||
$users['user21'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'user21', 'firstname' => 'user21')); // Two users for group 2.
|
||||
$users['user22'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'user22', 'firstname' => 'user22'));
|
||||
$users['userall'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'userall', 'firstname' => 'userall')); // A user in all groups.
|
||||
$users['usertch'] = $this->getDataGenerator()->create_user(
|
||||
array('username' => 'usertch', 'firstname' => 'usertch')); // A user with teacher role.
|
||||
|
||||
// Enrol the users in the course.
|
||||
$this->getDataGenerator()->enrol_user($users['user0']->id, $course->id, 'student'); // Student.
|
||||
$this->getDataGenerator()->enrol_user($users['user1']->id, $course->id, 'student'); // Student.
|
||||
$this->getDataGenerator()->enrol_user($users['user21']->id, $course->id, 'student'); // Student.
|
||||
$this->getDataGenerator()->enrol_user($users['user22']->id, $course->id, 'student', 'manual', 0, 0, ENROL_USER_SUSPENDED); // Suspended student.
|
||||
$this->getDataGenerator()->enrol_user($users['userall']->id, $course->id, 'student'); // Student.
|
||||
$this->getDataGenerator()->enrol_user($users['usertch']->id, $course->id, 'editingteacher'); // Teacher.
|
||||
|
||||
// Create 2 groups.
|
||||
$groups['group1'] = $this->getDataGenerator()->create_group(array('courseid' => $course->id));
|
||||
$groups['group2'] = $this->getDataGenerator()->create_group(array('courseid' => $course->id));
|
||||
|
||||
// Add the users to the groups.
|
||||
$this->getDataGenerator()->create_group_member(
|
||||
array('groupid' => $groups['group1']->id, 'userid' => $users['user1']->id));
|
||||
$this->getDataGenerator()->create_group_member(
|
||||
array('groupid' => $groups['group2']->id, 'userid' => $users['user21']->id));
|
||||
$this->getDataGenerator()->create_group_member(
|
||||
array('groupid' => $groups['group2']->id, 'userid' => $users['user22']->id));
|
||||
$this->getDataGenerator()->create_group_member(
|
||||
array('groupid' => $groups['group1']->id, 'userid' => $users['userall']->id));
|
||||
$this->getDataGenerator()->create_group_member(
|
||||
array('groupid' => $groups['group2']->id, 'userid' => $users['userall']->id));
|
||||
|
||||
// Make setup data accessible from test methods.
|
||||
$this->course = $course;
|
||||
$this->users = $users;
|
||||
$this->groups = $groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify get_total_users() returned number of users expected in every situation.
|
||||
*/
|
||||
public function test_get_total_users() {
|
||||
global $PAGE;
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
// All users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(6, $totalusers, 'All users must be returned when no filtering is applied.');
|
||||
|
||||
// Student role filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 5);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(5, $totalusers, 'Only students must be returned when student role filtering is applied.');
|
||||
|
||||
// Teacher role filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 3);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(1, $totalusers, 'Only teacher must be returned when teacher role filtering is applied.');
|
||||
|
||||
// Search user filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, 'userall');
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(1, $totalusers, 'Only searchable user must be returned when search filtering is applied.');
|
||||
|
||||
// Group 1 filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group1']->id);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(2, $totalusers, 'Only group members must be returned when group filtering is applied.');
|
||||
|
||||
// Group 2 filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group2']->id);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(3, $totalusers, 'Only group members must be returned when group filtering is applied.');
|
||||
|
||||
// 'No groups' filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', -1);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(2, $totalusers, 'Only non-group members must be returned when \'no groups\' filtering is applied.');
|
||||
|
||||
// Active users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_ACTIVE);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(5, $totalusers, 'Only active users must be returned when active users filtering is applied.');
|
||||
|
||||
// Suspended users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_SUSPENDED);
|
||||
$totalusers = $manager->get_total_users();
|
||||
$this->assertEquals(1, $totalusers, 'Only suspended users must be returned when suspended users filtering is applied.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify get_users() returned number of users expected in every situation.
|
||||
*/
|
||||
public function test_get_users() {
|
||||
global $PAGE;
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
// All users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(6, $users, 'All users must be returned when no filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user0']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user1']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user21']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user22']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['usertch']->id, $users);
|
||||
|
||||
// Student role filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 5);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(5, $users, 'Only students must be returned when student role filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user0']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user1']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user21']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user22']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
|
||||
// Teacher role filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 3);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(1, $users, 'Only teacher must be returned when teacher role filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['usertch']->id, $users);
|
||||
|
||||
// Search user filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, 'userall');
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(1, $users, 'Only searchable user must be returned when search filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
|
||||
// Group 1 filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group1']->id);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(2, $users, 'Only group members must be returned when group filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user1']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
|
||||
// Group 2 filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group2']->id);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(3, $users, 'Only group members must be returned when group filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user21']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user22']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
|
||||
// 'No groups' filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', -1);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(2, $users, 'Only non-group members must be returned when \'no groups\' filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user0']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['usertch']->id, $users);
|
||||
|
||||
// Active users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_ACTIVE);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(5, $users, 'Only active users must be returned when active users filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user0']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user1']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['user21']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['userall']->id, $users);
|
||||
$this->assertArrayHasKey($this->users['usertch']->id, $users);
|
||||
|
||||
// Suspended users filtering.
|
||||
$manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_SUSPENDED);
|
||||
$users = $manager->get_users('id');
|
||||
$this->assertCount(1, $users, 'Only suspended users must be returned when suspended users filtering is applied.');
|
||||
$this->assertArrayHasKey($this->users['user22']->id, $users);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -314,10 +314,10 @@ YUI.add('moodle-enrol-otherusersmanager', function(Y) {
|
||||
)
|
||||
.append(Y.Node.create('<div class="'+CSS.OPTIONS+'"><span class="label">'+M.util.get_string('assignrole', 'role')+': </span></div>'))
|
||||
);
|
||||
var id = 0, roles = this._manager.get(ASSIGNABLEROLES);
|
||||
for (id in roles) {
|
||||
var role = Y.Node.create('<a href="#" class="'+CSS.ROLEOPTION+'">'+roles[id]+'</a>');
|
||||
role.on('click', this.assignRoleToUser, this, id, role);
|
||||
var roles = this._manager.get(ASSIGNABLEROLES);
|
||||
for (var i in roles) {
|
||||
var role = Y.Node.create('<a href="#" class="' + CSS.ROLEOPTION + '">' + roles[i].name + '</a>');
|
||||
role.on('click', this.assignRoleToUser, this, roles[i].id, role);
|
||||
this._node.one('.'+CSS.OPTIONS).append(role);
|
||||
}
|
||||
return this._node;
|
||||
|
||||
Vendored
+15
-4
@@ -94,7 +94,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
if (o.error) {
|
||||
new M.core.ajaxException(o);
|
||||
} else {
|
||||
this.users[userid].addRoleToDisplay(args.roleid, this.get(ASSIGNABLEROLES)[args.roleid]);
|
||||
this.users[userid].addRoleToDisplay(args.roleid, this._getAssignableRole(args.roleid));
|
||||
}
|
||||
} catch (e) {
|
||||
new M.core.exception(e);
|
||||
@@ -152,6 +152,15 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
}
|
||||
});
|
||||
},
|
||||
_getAssignableRole: function(roleid) {
|
||||
var roles = this.get(ASSIGNABLEROLES);
|
||||
for (var i in roles) {
|
||||
if (roles[i].id == roleid) {
|
||||
return roles[i].name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
_loadAssignableRoles : function() {
|
||||
var c = this.get(COURSEID), params = {
|
||||
id : this.get(COURSEID),
|
||||
@@ -277,7 +286,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
var current = this.get(CURRENTROLES);
|
||||
var allroles = true, i = 0;
|
||||
for (i in roles) {
|
||||
if (!current[i]) {
|
||||
if (!current[roles[i].id]) {
|
||||
allroles = false;
|
||||
break;
|
||||
}
|
||||
@@ -353,8 +362,10 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
|
||||
var content = element.one('.content');
|
||||
var roles = m.get(ASSIGNABLEROLES);
|
||||
for (i in roles) {
|
||||
var button = Y.Node.create('<input type="button" value="'+roles[i]+'" id="add_assignable_role_'+i+'" />');
|
||||
button.on('click', this.submit, this, i);
|
||||
var buttonid = 'add_assignable_role_' + roles[i].id;
|
||||
var buttonhtml = '<input type="button" value="' + roles[i].name + '" id="' + buttonid + '" />';
|
||||
var button = Y.Node.create(buttonhtml);
|
||||
button.on('click', this.submit, this, roles[i].id);
|
||||
content.append(button);
|
||||
}
|
||||
Y.one(document.body).append(element);
|
||||
|
||||
@@ -70,6 +70,7 @@ if ($id) {
|
||||
$outcome_rec->courseid = $courseid;
|
||||
require_login();
|
||||
require_capability('moodle/grade:manage', $systemcontext);
|
||||
$PAGE->set_context($systemcontext);
|
||||
}
|
||||
|
||||
} else if ($courseid){
|
||||
@@ -87,6 +88,7 @@ if ($id) {
|
||||
} else {
|
||||
require_login();
|
||||
require_capability('moodle/grade:manage', $systemcontext);
|
||||
$PAGE->set_context($systemcontext);
|
||||
|
||||
/// adding new outcome from admin section
|
||||
$outcome_rec = new stdClass();
|
||||
|
||||
+2
@@ -14,6 +14,7 @@ YUI.add('moodle-gradereport_grader-gradereporttable', function (Y, NAME) {
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
/**
|
||||
* Grader Report Functionality.
|
||||
@@ -155,6 +156,7 @@ Y.namespace('M.gradereport_grader').init = function(config) {
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* global SELECTORS */
|
||||
|
||||
/**
|
||||
* @module moodle-gradereport_grader-gradereporttable
|
||||
|
||||
+2
@@ -14,6 +14,7 @@ YUI.add('moodle-gradereport_grader-gradereporttable', function (Y, NAME) {
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
/**
|
||||
* Grader Report Functionality.
|
||||
@@ -155,6 +156,7 @@ Y.namespace('M.gradereport_grader').init = function(config) {
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* global SELECTORS */
|
||||
|
||||
/**
|
||||
* @module moodle-gradereport_grader-gradereporttable
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* global SELECTORS */
|
||||
|
||||
/**
|
||||
* @module moodle-gradereport_grader-gradereporttable
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
/**
|
||||
* Grader Report Functionality.
|
||||
|
||||
@@ -45,6 +45,7 @@ $returnurl = $CFG->wwwroot.'/group/index.php?id='.$courseid;
|
||||
$course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST);
|
||||
|
||||
$url = new moodle_url('/group/index.php', array('id'=>$courseid));
|
||||
navigation_node::override_active_url($url);
|
||||
if ($userid) {
|
||||
$url->param('user', $userid);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ $string['phpversionhelp'] = '<p>Moodle vyžaduje PHP alespoň verze 4.3.0 nebo 5
|
||||
(U PHP 5.0.x můžete také přejít na nižší verzi 4.4.x )</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Podařilo se vám úspěšně nainstalovat a spustit balíček <strong>{$a->packname} {$a->packversion}</strong>. Gratulujeme!';
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong> obsahuje aplikace k vytvoření prostředí, ve kterém bude provozován váš <strong>Moodle</strong>. Jmenovitě se jedná o:';
|
||||
$string['welcomep30'] = 'Tato verze <strong>{$a->installername}</strong> obsahuje aplikace k vytvoření prostředí, ve kterém bude provozován váš <strong>Moodle</strong>. Jmenovitě se jedná o:';
|
||||
$string['welcomep40'] = 'Balíček rovněž obsahuje <strong>Moodle ve verzi {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Použití všech aplikací v tomto balíčku je vázáno jejich příslušnými licencemi. Kompletní balíček <strong>{$a->installername}</strong> je software s <a href="http://www.opensource.org/docs/definition_plain.html"> otevřeným kódem (open source)</a> a je šířen pod licencí <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'Následující stránky vás v několik jednoduchých krocích nastavením <strong>Moodlu</strong> na vašem počítači. Můžete přijmout výchozí nastavení, nebo si je upravit podle svých potřeb.';
|
||||
|
||||
@@ -40,12 +40,11 @@ $string['cannotsavemd5file'] = 'Kan ikke gemme md5-fil';
|
||||
$string['cannotsavezipfile'] = 'Kan ikke gemme zip-fil';
|
||||
$string['cannotunzipfile'] = 'Kan ikke pakke filen ud';
|
||||
$string['componentisuptodate'] = 'Komponenten er ajour';
|
||||
$string['dmlexceptiononinstall'] = '<p>En database fejl er opstået [{$a->errorcode}].<br />{$a->debuginfo}</p>';
|
||||
$string['downloadedfilecheckfailed'] = 'Downloadet fil-tjek fejlede';
|
||||
$string['dmlexceptiononinstall'] = '<p>En databasefejl er opstået [{$a->errorcode}].<br />{$a->debuginfo}</p>';
|
||||
$string['downloadedfilecheckfailed'] = 'Downloadet fil-tjek mislykkedes';
|
||||
$string['invalidmd5'] = 'Tjekvariablen var forkert - prøv igen';
|
||||
$string['missingrequiredfield'] = 'Der mangler nogle obligatoriske felter';
|
||||
$string['remotedownloaderror'] = '<p> Download af komponent til din server fejlede. Venligst verificer proxy indstillilnger; PHP cURL filtypen anbefales kraftigt. </p>
|
||||
<p>Du må downloade <a href="{$a->url}">{$a->url}</a> filen manuelt, kopier den til "{$a->dest}" på din server og udpak den her </p>';
|
||||
$string['remotedownloaderror'] = '<p>Download af komponenten til din server mislykkedes. Verificer proxy-indstillilngerne, udvidelsen PHP cURL anbefales kraftigt. </p> <p>Du skal downloade filen <a href="{$a->url}">{$a->url}</a> manuelt, kopiere den til "{$a->dest}" på din server og udpakke den der.</p>';
|
||||
$string['wrongdestpath'] = 'Forkert destinationssti';
|
||||
$string['wrongsourcebase'] = 'Forkert kilde-URL';
|
||||
$string['wrongzipfilename'] = 'Forkert zip-filnavn';
|
||||
|
||||
@@ -41,8 +41,8 @@ $string['databasehost'] = 'Databasevært';
|
||||
$string['databasename'] = 'Databasenavn';
|
||||
$string['databasetypehead'] = 'Vælg databasedriver';
|
||||
$string['dataroot'] = 'Datamappe';
|
||||
$string['datarootpermission'] = 'Rettighed til data mapper';
|
||||
$string['dbprefix'] = 'Præfix for tabeller';
|
||||
$string['datarootpermission'] = 'Rettighed til datamapper';
|
||||
$string['dbprefix'] = 'Præfiks for tabeller';
|
||||
$string['dirroot'] = 'Moodle-mappe';
|
||||
$string['environmenthead'] = 'Kontrollerer din serveropsætning...';
|
||||
$string['environmentsub2'] = 'Hver version af Moodle har nogle minimumskrav til PHP-version og nogle obligatoriske PHP-extensions.
|
||||
|
||||
@@ -42,3 +42,4 @@ 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}';
|
||||
$string['upgradekeyset'] = 'Chave de anovación (deixar baleiro para non estabelecela)';
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['language'] = 'Idioma';
|
||||
$string['moodlelogo'] = 'Logotipo de Moodle';
|
||||
$string['next'] = 'Seguinte';
|
||||
$string['previous'] = 'Anterior';
|
||||
$string['reload'] = 'Cargar de novo';
|
||||
|
||||
@@ -32,5 +32,8 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['clianswerno'] = 'ոչ';
|
||||
$string['cliansweryes'] = 'այո';
|
||||
$string['cliincorrectvalueerror'] = 'Սխալ, "{$a->value}"-ը ոչ ճիշտ արժեք է "{$a->option}"-ի համար';
|
||||
$string['cliincorrectvalueretry'] = 'Ոչ ճիշտ արժեք, կրկին փորձեք';
|
||||
$string['cliyesnoprompt'] = 'Մեքենագրեք y (նշանակում է այո) կամ n (նշանակում է ոչ):';
|
||||
$string['environmentrequireinstall'] = 'անհրաժեշտ է, որպեսզի տեղակայված և թույլատրված լինի';
|
||||
$string['environmentrequireversion'] = 'պահանջվում է {$a->needed} տարբերակը, դուք գործարկում եք՝ {$a->current}';
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['language'] = 'Լեզու';
|
||||
$string['moodlelogo'] = 'Moodle-ի լոգոտիպ';
|
||||
$string['next'] = 'Հաջորդը';
|
||||
$string['previous'] = 'Նախորդը';
|
||||
$string['reload'] = 'Վերաբեռնել';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'Taqbaylit';
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'Malagasy';
|
||||
@@ -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['parentlanguage'] = '';
|
||||
$string['thislanguage'] = 'Crnogorski';
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['paths'] = 'ठेगानाहरु';
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['next'] = 'अर्को';
|
||||
@@ -42,3 +42,4 @@ Utilisez l\'option --help.';
|
||||
$string['cliyesnoprompt'] = 'Picatz y (per òc) o n (per non)';
|
||||
$string['environmentrequireinstall'] = 'doit èsser installat e activat';
|
||||
$string['environmentrequireversion'] = 'la version {$a->needed} es requesida ; vous utilisez actualament la version {$a->current}';
|
||||
$string['upgradekeyset'] = 'Metre a jorn la clau (daissar void per la definir pas)';
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['language'] = 'Lenga';
|
||||
$string['moodlelogo'] = 'Lògo Moodle';
|
||||
$string['next'] = 'Seguent';
|
||||
$string['previous'] = 'Precedent';
|
||||
$string['reload'] = 'Actualizar';
|
||||
|
||||
@@ -42,3 +42,4 @@ Proszę użyć pomocy.';
|
||||
$string['cliyesnoprompt'] = 'wpisz y (czyli tak) lub n (czyli nie)';
|
||||
$string['environmentrequireinstall'] = 'jest niezbędnę, żeby było zainstalowane/włączone';
|
||||
$string['environmentrequireversion'] = 'wersja {$a->needed} jest niezbędna a ty używasz wersji {$a->current}';
|
||||
$string['upgradekeyset'] = 'Zaktualizuj klucz (pozostaw puste jeśli nie jest to skonfigurowane)';
|
||||
|
||||
@@ -613,6 +613,7 @@ $string['legacyfilesaddallowed'] = 'Allow adding to legacy course files';
|
||||
$string['legacyfilesaddallowed_help'] = 'If a course has legacy course files, allow new files and folders to be added to it.';
|
||||
$string['legacyfilesinnewcourses'] = 'Legacy course files in new courses';
|
||||
$string['legacyfilesinnewcourses_help'] = 'By default, legacy course files areas are available in upgraded courses only. Please note that some features such as activity backup and restore are not compatible with this setting.';
|
||||
$string['libcurlwarning'] = 'Libcurl with CURLOPT_PROTOCOL support has not been detected. It is recommended to have an up to date libcurl installation for security reasons.';
|
||||
$string['licensesettings'] = 'Licence settings';
|
||||
$string['linkadmincategories'] = 'Link admin categories';
|
||||
$string['linkadmincategories_help'] = 'If enabled admin setting categories will be displayed as links in the navigation and will lead to the admin category pages.';
|
||||
@@ -1074,6 +1075,7 @@ $string['unsupported'] = 'Unsupported';
|
||||
$string['unsupporteddbstorageengine'] = 'The database storage engine being used is no longer supported.';
|
||||
$string['unsupporteddbtablerowformat'] = 'Your database has tables using Antelope as the file format. You are recommended to convert the tables to the Barracuda file format. See the documentation <a href="https://docs.moodle.org/en/cli">Administration via command line</a> for details of a tool for converting InnoDB tables to Barracuda.';
|
||||
$string['unsupportedphpversion7'] = 'PHP version 7 is not supported.';
|
||||
$string['unsupportedphpversion71'] = 'PHP version 7.1 is not supported.';
|
||||
$string['unsuspenduser'] = 'Activate user account';
|
||||
$string['updateaccounts'] = 'Update existing accounts';
|
||||
$string['updatecomponent'] = 'Update component';
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ $string['auth_remove_keep'] = 'Keep internal';
|
||||
$string['auth_remove_suspend'] = 'Suspend internal';
|
||||
$string['auth_remove_user'] = 'Specify what to do with internal user account during mass synchronization when user was removed from external source. Only suspended users are automatically revived if they reappear in ext source.';
|
||||
$string['auth_remove_user_key'] = 'Removed ext user';
|
||||
$string['auth_sync_script'] = 'User account syncronisation';
|
||||
$string['auth_sync_script'] = 'User account synchronisation';
|
||||
$string['auth_updatelocal'] = 'Update local';
|
||||
$string['auth_updatelocal_expl'] = '<p><b>Update local:</b> If enabled, the field will be updated (from external auth) every time the user logs in or there is a user synchronization. Fields set to update locally should be locked.</p>';
|
||||
$string['auth_updateremote'] = 'Update external';
|
||||
|
||||
@@ -116,6 +116,7 @@ $string['currentstage16'] = 'Complete';
|
||||
$string['enterasearch'] = 'Enter a search';
|
||||
$string['error_block_for_module_not_found'] = 'Orphan block instance (id: {$a->bid}) for course module (id: {$a->mid}) found. This block will not be backed up';
|
||||
$string['error_course_module_not_found'] = 'Orphan course module (id: {$a}) found. This module will not be backed up.';
|
||||
$string['errorcopyingbackupfile'] = "Failed to copy the backup file to the temporary folder before restoring.";
|
||||
$string['errorfilenamerequired'] = 'You must enter a valid filename for this backup';
|
||||
$string['errorfilenamemustbezip'] = 'The filename you enter must be a ZIP file and have the .mbz extension';
|
||||
$string['errorminbackup20version'] = 'This backup file has been created with one development version of Moodle backup ({$a->backup}). Minimum required is {$a->min}. Cannot be restored.';
|
||||
|
||||
@@ -65,7 +65,7 @@ $string['CD'] = 'Congo, The Democratic Republic Of The';
|
||||
$string['CF'] = 'Central African Republic';
|
||||
$string['CG'] = 'Congo';
|
||||
$string['CH'] = 'Switzerland';
|
||||
$string['CI'] = 'Côte D\'Ivoire';
|
||||
$string['CI'] = 'Côte d\'Ivoire';
|
||||
$string['CK'] = 'Cook Islands';
|
||||
$string['CL'] = 'Chile';
|
||||
$string['CM'] = 'Cameroon';
|
||||
@@ -77,7 +77,7 @@ $string['CV'] = 'Cabo Verde';
|
||||
$string['CW'] = 'Curaçao';
|
||||
$string['CX'] = 'Christmas Island';
|
||||
$string['CY'] = 'Cyprus';
|
||||
$string['CZ'] = 'Czech Republic';
|
||||
$string['CZ'] = 'Czechia';
|
||||
$string['DE'] = 'Germany';
|
||||
$string['DJ'] = 'Djibouti';
|
||||
$string['DK'] = 'Denmark';
|
||||
|
||||
@@ -70,6 +70,7 @@ $string['addresource'] = 'Add a resource...';
|
||||
$string['addresourceoractivity'] = 'Add an activity or resource';
|
||||
$string['addresourcetosection'] = 'Add a resource to section \'{$a}\'';
|
||||
$string['address'] = 'Address';
|
||||
$string['addressedto'] = 'To';
|
||||
$string['addstudent'] = 'Add student';
|
||||
$string['addsubcategory'] = 'Add a subcategory';
|
||||
$string['addteacher'] = 'Add teacher';
|
||||
|
||||
@@ -36,7 +36,12 @@ $rawjson = file_get_contents('php://input');
|
||||
|
||||
$requests = json_decode($rawjson, true);
|
||||
if ($requests === null) {
|
||||
$lasterror = json_last_error_msg();
|
||||
if (function_exists('json_last_error_msg')) {
|
||||
$lasterror = json_last_error_msg();
|
||||
} else {
|
||||
// Fall back to numeric error for older PHP version.
|
||||
$lasterror = json_last_error();
|
||||
}
|
||||
throw new coding_exception('Invalid json in request: ' . $lasterror);
|
||||
}
|
||||
$responses = array();
|
||||
@@ -94,6 +99,7 @@ foreach ($requests as $request) {
|
||||
} catch (Exception $e) {
|
||||
$jsonexception = get_exception_info($e);
|
||||
unset($jsonexception->a);
|
||||
$jsonexception->backtrace = format_backtrace($jsonexception->backtrace, true);
|
||||
if (!debugging('', DEBUG_DEVELOPER)) {
|
||||
unset($jsonexception->debuginfo);
|
||||
unset($jsonexception->backtrace);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
define(["core/mustache","jquery","core/ajax","core/str","core/notification","core/url","core/config","core/localstorage","core/event","core/yui","core/log"],function(a,b,c,d,e,f,g,h,i,j,k){var l=0,m={},n=function(){this.requiredStrings=[],this.requiredJS=[],this.currentThemeName=""};n.prototype.requiredStrings=null,n.prototype.requiredJS=null,n.prototype.currentThemeName="",n.prototype.getTemplate=function(a,d){var e=b.Deferred(),f=a.split("/"),g=f.shift(),i=f.shift(),j=this.currentThemeName+"/"+a;if(j in m)return e.resolve(m[j]),e.promise();var k=h.get("core_template/"+j);if(k)return e.resolve(k),m[j]=k,e.promise();var l=c.call([{methodname:"core_output_load_template",args:{component:g,template:i,themename:this.currentThemeName}}],d,!1);return l[0].done(function(a){h.set("core_template/"+j,a),m[j]=a,e.resolve(a)}).fail(function(a){e.reject(a)}),e.promise()},n.prototype.partialHelper=function(a){var b="";return this.getTemplate(a,!1).done(function(a){b=a}).fail(e.exception),b},n.prototype.pixHelper=function(b,c,d){var e,g=c.split(","),h="",i="",j="";g.length>0&&(h=g.shift().trim()),g.length>0&&(i=g.shift().trim()),g.length>0&&(j=g.join(",").trim());var k=f.imageUrl(h,i),l={attributes:[{name:"src",value:k},{name:"alt",value:d(j)},{name:"title",value:d(j)},{name:"class",value:"smallicon"}]},n=m[this.currentThemeName+"/core/pix_icon"];return e=a.render(n,l,this.partialHelper.bind(this)),e.trim()},n.prototype.jsHelper=function(a,b,c){return this.requiredJS.push(c(b,a)),""},n.prototype.stringHelper=function(a,b,c){var d=b.split(","),e="",f="",g="";d.length>0&&(e=d.shift().trim()),d.length>0&&(f=d.shift().trim()),d.length>0&&(g=d.join(",").trim()),""!==g&&(g=c(g,a)),0===g.indexOf("{")&&0!==g.indexOf("{{")&&(g=JSON.parse(g));var h=this.requiredStrings.length;return this.requiredStrings.push({key:e,component:f,param:g}),"{{_s"+h+"}}"},n.prototype.quoteHelper=function(a,b,c){var d=c(b.trim(),a);return d=d.replace('"','\\"').replace(/([\{\}]{2,3})/g,"{{=<% %>=}}$1<%={{ }}=%>"),'"'+d+'"'},n.prototype.addHelpers=function(a,b){this.currentThemeName=b,this.requiredStrings=[],this.requiredJS=[],a.uniqid=l++,a.str=function(){return this.stringHelper.bind(this,a)}.bind(this),a.pix=function(){return this.pixHelper.bind(this,a)}.bind(this),a.js=function(){return this.jsHelper.bind(this,a)}.bind(this),a.quote=function(){return this.quoteHelper.bind(this,a)}.bind(this),a.globals={config:g},a.currentTheme=b},n.prototype.getJS=function(a){var b="";return this.requiredJS.length>0&&(b=this.requiredJS.join(";\n")),this.treatStringsInContent(b,a)},n.prototype.treatStringsInContent=function(a,b){var c,d,e,f,g,h,i=/{{_s\d+}}/;do{for(c="",d=a.search(i);d>-1;){c+=a.substring(0,d),a=a.substr(d),e="",f=4,g=a.substr(f,1);do e+=g,f++,g=a.substr(f,1);while("}"!=g);h=b[parseInt(e,10)],"undefined"==typeof h&&(k.debug("Could not find string for pattern {{_s"+e+"}}."),h=""),c+=h,a=a.substr(6+e.length),d=a.search(i)}a=c+a,d=a.search(i)}while(d>-1);return a},n.prototype.doRender=function(c,e,f){var g=b.Deferred();this.currentThemeName=f;var h=this.getTemplate("core/pix_icon",!0);return h.done(function(){this.addHelpers(e,f);var b="";try{b=a.render(c,e,this.partialHelper.bind(this))}catch(h){g.reject(h)}this.requiredStrings.length>0?d.get_strings(this.requiredStrings).then(function(a){b=this.treatStringsInContent(b,a),g.resolve(b,this.getJS(a))}.bind(this)).fail(g.reject):g.resolve(b.trim(),this.getJS([]))}.bind(this)).fail(g.reject),g.promise()};var o=function(a){if(""!==a.trim()){var c=b("<script>").attr("type","text/javascript").html(a);b("head").append(c)}},p=function(a,c,d,e){var f=b(a);if(f.length){var g=b(c),h=null;e?(h=new j.NodeList(f.children().get()),h.destroy(!0),f.empty(),f.append(g)):(h=new j.NodeList(f.get()),h.destroy(!0),f.replaceWith(g)),o(d),i.notifyFilterContentUpdated(g)}};return n.prototype.render=function(a,c,d){var e=b.Deferred();"undefined"==typeof d&&(d=g.theme),this.currentThemeName=d;var f=this.getTemplate(a,!0);return f.done(function(a){var b=this.doRender(a,c,d);b.done(function(a,b){e.resolve(a,b)}).fail(function(a){e.reject(a)})}.bind(this)).fail(function(a){e.reject(a)}),e.promise()},{render:function(a,b,c){var d=new n;return d.render(a,b,c)},runTemplateJS:o,replaceNodeContents:function(a,b,c){return p(a,b,c,!0)},replaceNode:function(a,b,c){return p(a,b,c,!1)}}});
|
||||
define(["core/mustache","jquery","core/ajax","core/str","core/notification","core/url","core/config","core/localstorage","core/event","core/yui","core/log"],function(a,b,c,d,e,f,g,h,i,j,k){var l=0,m={},n=function(){this.requiredStrings=[],this.requiredJS=[],this.currentThemeName=""};n.prototype.requiredStrings=null,n.prototype.requiredJS=null,n.prototype.currentThemeName="",n.prototype.getTemplate=function(a,d){var e=b.Deferred(),f=a.split("/"),g=f.shift(),i=f.shift(),j=this.currentThemeName+"/"+a;if(j in m)return e.resolve(m[j]),e.promise();var k=h.get("core_template/"+j);if(k)return e.resolve(k),m[j]=k,e.promise();var l=c.call([{methodname:"core_output_load_template",args:{component:g,template:i,themename:this.currentThemeName}}],d,!1);return l[0].done(function(a){h.set("core_template/"+j,a),m[j]=a,e.resolve(a)}).fail(function(a){e.reject(a)}),e.promise()},n.prototype.partialHelper=function(a){var b="";return this.getTemplate(a,!1).done(function(a){b=a}).fail(e.exception),b},n.prototype.pixHelper=function(b,c,d){var e,g=c.split(","),h="",i="",j="";g.length>0&&(h=g.shift().trim()),g.length>0&&(i=g.shift().trim()),g.length>0&&(j=g.join(",").trim());var k=f.imageUrl(h,i),l={attributes:[{name:"src",value:k},{name:"alt",value:d(j)},{name:"title",value:d(j)},{name:"class",value:"smallicon"}]},n=m[this.currentThemeName+"/core/pix_icon"];return e=a.render(n,l,this.partialHelper.bind(this)),e.trim()},n.prototype.jsHelper=function(a,b,c){return this.requiredJS.push(c(b,a)),""},n.prototype.stringHelper=function(a,b,c){var d=b.split(","),e="",f="",g="";d.length>0&&(e=d.shift().trim()),d.length>0&&(f=d.shift().trim()),d.length>0&&(g=d.join(",").trim()),""!==g&&(g=c(g,a)),0===g.indexOf("{")&&0!==g.indexOf("{{")&&(g=JSON.parse(g));var h=this.requiredStrings.length;return this.requiredStrings.push({key:e,component:f,param:g}),"[[_s"+h+"]]"},n.prototype.quoteHelper=function(a,b,c){var d=c(b.trim(),a);return d=d.replace('"','\\"').replace(/([\{\}]{2,3})/g,"{{=<% %>=}}$1<%={{ }}=%>"),'"'+d+'"'},n.prototype.addHelpers=function(a,b){this.currentThemeName=b,this.requiredStrings=[],this.requiredJS=[],a.uniqid=l++,a.str=function(){return this.stringHelper.bind(this,a)}.bind(this),a.pix=function(){return this.pixHelper.bind(this,a)}.bind(this),a.js=function(){return this.jsHelper.bind(this,a)}.bind(this),a.quote=function(){return this.quoteHelper.bind(this,a)}.bind(this),a.globals={config:g},a.currentTheme=b},n.prototype.getJS=function(a){var b="";return this.requiredJS.length>0&&(b=this.requiredJS.join(";\n")),this.treatStringsInContent(b,a)},n.prototype.treatStringsInContent=function(a,b){var c,d,e,f,g,h,i=/\[\[_s\d+\]\]/;do{for(c="",d=a.search(i);d>-1;){c+=a.substring(0,d),a=a.substr(d),e="",f=4,g=a.substr(f,1);do e+=g,f++,g=a.substr(f,1);while("]"!=g);h=b[parseInt(e,10)],"undefined"==typeof h&&(k.debug("Could not find string for pattern [[_s"+e+"]]."),h=""),c+=h,a=a.substr(6+e.length),d=a.search(i)}a=c+a,d=a.search(i)}while(d>-1);return a},n.prototype.doRender=function(c,e,f){var g=b.Deferred();this.currentThemeName=f;var h=this.getTemplate("core/pix_icon",!0);return h.done(function(){this.addHelpers(e,f);var b="";try{b=a.render(c,e,this.partialHelper.bind(this))}catch(h){g.reject(h)}this.requiredStrings.length>0?d.get_strings(this.requiredStrings).then(function(a){b=this.treatStringsInContent(b,a),g.resolve(b,this.getJS(a))}.bind(this)).fail(g.reject):g.resolve(b.trim(),this.getJS([]))}.bind(this)).fail(g.reject),g.promise()};var o=function(a){if(""!==a.trim()){var c=b("<script>").attr("type","text/javascript").html(a);b("head").append(c)}},p=function(a,c,d,e){var f=b(a);if(f.length){var g=b(c),h=null;e?(h=new j.NodeList(f.children().get()),h.destroy(!0),f.empty(),f.append(g)):(h=new j.NodeList(f.get()),h.destroy(!0),f.replaceWith(g)),o(d),i.notifyFilterContentUpdated(g)}};return n.prototype.render=function(a,c,d){var e=b.Deferred();"undefined"==typeof d&&(d=g.theme),this.currentThemeName=d;var f=this.getTemplate(a,!0);return f.done(function(a){var b=this.doRender(a,c,d);b.done(function(a,b){e.resolve(a,b)}).fail(function(a){e.reject(a)})}.bind(this)).fail(function(a){e.reject(a)}),e.promise()},{render:function(a,b,c){var d=new n;return d.render(a,b,c)},runTemplateJS:o,replaceNodeContents:function(a,b,c){return p(a,b,c,!0)},replaceNode:function(a,b,c){return p(a,b,c,!1)}}});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user