Compare commits
541 Commits
v3.3.0-rc3
..
v3.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 70fa678586 | |||
| 0c6de97371 | |||
| 63981e5a82 | |||
| 6a0dfc60d6 | |||
| 38c4435a37 | |||
| 3cc4e2f725 | |||
| ca3cbbc233 | |||
| 7d196ef3b3 | |||
| 069b9d5820 | |||
| 454a3d34d5 | |||
| db3a985faf | |||
| c535520966 | |||
| e35ad40de1 | |||
| 436acc27fe | |||
| 73fd6f2928 | |||
| 84e17f59c5 | |||
| 63464df041 | |||
| 17c82085fc | |||
| 5e3ce67f37 | |||
| ec02a34e1f | |||
| 1e1e1b8229 | |||
| f7af2c5fc7 | |||
| 92194c1c8d | |||
| 7bbe8a1c76 | |||
| 22ee65c275 | |||
| 9354f9de64 | |||
| 04d2305788 | |||
| e21e294072 | |||
| 19b7ac05ad | |||
| 4294bbd50f | |||
| b1ffb73177 | |||
| cde1ac3eea | |||
| 059759aab9 | |||
| 188d41ccc9 | |||
| 0b5f9f6e60 | |||
| fa60a11522 | |||
| 29cdf58116 | |||
| 3db24b8015 | |||
| b21b210f41 | |||
| 79482e3fe8 | |||
| 3935371599 | |||
| 14026572ae | |||
| ee66d63054 | |||
| af2d6085cd | |||
| e615d70923 | |||
| ae8388d51c | |||
| 962e3eb662 | |||
| 4c586b025e | |||
| 8612c8aa3e | |||
| a7db91030b | |||
| d807d3c603 | |||
| 8f61b909e8 | |||
| e44ce23c9f | |||
| 6c87b08240 | |||
| 9afdc8fc12 | |||
| e30a500fb9 | |||
| 121d3e0d29 | |||
| 5b7356cdde | |||
| 169d972bf6 | |||
| 4fef0dadf0 | |||
| 96a0d1bc7a | |||
| 01c2ca76c0 | |||
| 46c68c1b42 | |||
| e65f6a7e40 | |||
| 800da1b13d | |||
| a53008f1f0 | |||
| f1a117b86b | |||
| bcbd4140a1 | |||
| c99c5a436e | |||
| b7d36bdbaf | |||
| c21f12e786 | |||
| 2dd1bb44c2 | |||
| 63de9b5cdb | |||
| 24a00cadec | |||
| 3f709d3272 | |||
| def32a798d | |||
| b63524492f | |||
| 46f0136a5a | |||
| 83dbc72f38 | |||
| c6911cefb4 | |||
| dfbdf40af9 | |||
| 3e0fb6862e | |||
| 0e8eba7e1f | |||
| d0209e611f | |||
| ec9ed6d067 | |||
| 3e340aba45 | |||
| de80be59bb | |||
| 310172571b | |||
| a550b70a94 | |||
| 3cd6842501 | |||
| f17c1aadb3 | |||
| 043dffdd34 | |||
| 6fef2ab3db | |||
| 9ffcf8a3e9 | |||
| 56b8f8c8be | |||
| fede68a0ac | |||
| 6588079c5d | |||
| f7e4c3627c | |||
| 6c3f7e0ae6 | |||
| 89d948d86b | |||
| e1dcad3d13 | |||
| 07d000c51e | |||
| 636e7a13b6 | |||
| a57bdfa055 | |||
| 80a57cf924 | |||
| 059d6ffd9f | |||
| fd13953a8a | |||
| 488e115027 | |||
| 72e3ff3c15 | |||
| bd4f6ce186 | |||
| 5416d932d7 | |||
| 27e719e709 | |||
| b577d34861 | |||
| dcd27d9cee | |||
| 863dcb14a8 | |||
| 1a754e8446 | |||
| 95e9f4cc02 | |||
| bac13609ca | |||
| df90a44f3f | |||
| 23fd4f3afc | |||
| 9b39a92170 | |||
| 69c5e60f8c | |||
| cc36a37ea4 | |||
| 2678ee4e81 | |||
| 5a9f3039a7 | |||
| 667784420f | |||
| f628e0ecf6 | |||
| 9ae3b89cc5 | |||
| 098a875e4e | |||
| 9d64f4f078 | |||
| 5fac573391 | |||
| def9c15904 | |||
| d4e9fe521e | |||
| 343cdba46b | |||
| aca74d0d74 | |||
| ce01dbab40 | |||
| 21cf201536 | |||
| dfefe26665 | |||
| de70bc556c | |||
| 7b06a12ef3 | |||
| a415eb505e | |||
| 54a20ea8fc | |||
| a1740aad65 | |||
| 3680b1efa0 | |||
| b90c2e2627 | |||
| 5c53893f97 | |||
| 3049c086a3 | |||
| c644b03f02 | |||
| 7693409caa | |||
| eac59c38f8 | |||
| cd6612b079 | |||
| 7d88829470 | |||
| 9fde80dfa0 | |||
| e787fa6ab4 | |||
| 24cfd4c7d8 | |||
| de33f85405 | |||
| 57e38e1d12 | |||
| ddbf8c29ae | |||
| f265312fcf | |||
| 7dc6674cc4 | |||
| c1b9c51914 | |||
| 14da7f58a4 | |||
| 18221902bc | |||
| 7d9ee66a2f | |||
| de60425a16 | |||
| 4eb3f8d9b7 | |||
| 994e94bf76 | |||
| 2f9f8b5903 | |||
| 3923610e6c | |||
| 0913eb3c2a | |||
| f5b50e0472 | |||
| 09261027b6 | |||
| e0c4e6496f | |||
| 672ce4c6cd | |||
| 13a2a8344c | |||
| 8184f47d6c | |||
| 7a7320af90 | |||
| 70fd9fbb39 | |||
| e16448d3f1 | |||
| 2b4eb2cb71 | |||
| ed798679bb | |||
| 299dcca1b1 | |||
| c16c53d137 | |||
| 52723e1e3f | |||
| 0bcbd5b205 | |||
| ec319d13df | |||
| 0c4422af0b | |||
| 40dcbac3d6 | |||
| 62eb5ef8eb | |||
| 434e8abac8 | |||
| 28add18d9b | |||
| f9220d8138 | |||
| 32237b8308 | |||
| c2ae90c553 | |||
| 7035e0f5b5 | |||
| 6a3777f90c | |||
| de7a6ff47e | |||
| 46e26a1b69 | |||
| 0db0a63e50 | |||
| 120798e85f | |||
| 4679634e36 | |||
| 1c0462deb3 | |||
| 7dc8cc1ab6 | |||
| 170cd579ff | |||
| 6c83de1d51 | |||
| 0ef42d5f6d | |||
| ffc60d23b4 | |||
| 4f5a6ca40e | |||
| a669c6b21e | |||
| e7734513b8 | |||
| 44b4f83298 | |||
| 49053808a2 | |||
| 8ea5d72218 | |||
| e33b7b342a | |||
| f33a8d4eee | |||
| 6a4a1d812c | |||
| c94dce9c89 | |||
| a551ea0210 | |||
| 72b489ef65 | |||
| 827d93f88a | |||
| 884f4d3ec3 | |||
| a072271853 | |||
| 95c794075a | |||
| 890f84cdb2 | |||
| b4e1bbef47 | |||
| 678d051bee | |||
| c83ef7e25b | |||
| 1ee447d3a4 | |||
| 217d523d43 | |||
| 76cebe50cb | |||
| 7dfc04ff98 | |||
| ff037d9698 | |||
| 39dc183d9f | |||
| f7ddcd23f8 | |||
| 92f57f8397 | |||
| 98f246ae97 | |||
| f9e7ee4534 | |||
| b14507a31f | |||
| 4436b9e9dd | |||
| 2568183232 | |||
| bcca23f9c5 | |||
| bab24efe70 | |||
| 45a46ecbd8 | |||
| 64cfe467f8 | |||
| 48f0ebcd49 | |||
| 6537c557b5 | |||
| 225e039e73 | |||
| c8dddb5ccb | |||
| 3e276d6efa | |||
| adf2ea6166 | |||
| fd90d0e925 | |||
| 58a4ce4774 | |||
| b44972cc8b | |||
| 655570df00 | |||
| dbf70dec42 | |||
| c40ed5f6ff | |||
| 2827c7f997 | |||
| 2259fb5f36 | |||
| 6dc7039af9 | |||
| ee7b977a8b | |||
| f4841f394c | |||
| 6973e38a91 | |||
| c1b158b569 | |||
| 21a8a95869 | |||
| 359914c8f6 | |||
| 95208fe135 | |||
| df428648ee | |||
| 9148905e9a | |||
| 64df3fed13 | |||
| ed4aaea57b | |||
| 163fc8588d | |||
| 39e34b9586 | |||
| 5c63ab7ee8 | |||
| 3e3068cd11 | |||
| a27dde0ba7 | |||
| b92400a49f | |||
| a477c8b752 | |||
| 7f52d5c740 | |||
| f52bdbb885 | |||
| 7c519588f1 | |||
| 7345917de4 | |||
| 8a71b10a68 | |||
| 18907a51d5 | |||
| 11d04ffe8a | |||
| 5e1014a76e | |||
| 6e497e6e7d | |||
| 66a4a376ee | |||
| 3563244314 | |||
| bf02dc9819 | |||
| 8e8c066448 | |||
| 67f83d9279 | |||
| bcd1915dd0 | |||
| 992ffccfd2 | |||
| 97fd5a9841 | |||
| 6b47a070e7 | |||
| b4cfb7d733 | |||
| a9fa51024f | |||
| 2eec6ffc6c | |||
| 3f1574f849 | |||
| 40b78a23e9 | |||
| fb5655b5c2 | |||
| 405dcba6f3 | |||
| 7f32c5a447 | |||
| ec3eeb7ace | |||
| 1af3d13bf3 | |||
| 84122523ba | |||
| 382c069e52 | |||
| 3f58a36504 | |||
| 9e41e4e8ea | |||
| 7523d99558 | |||
| 9a375bdf6c | |||
| 07f6358b03 | |||
| 7ffb98d0f5 | |||
| dda99bb3f2 | |||
| 9cff26295b | |||
| 2fd5ceadb5 | |||
| 5865a6875b | |||
| ef2eed1b3c | |||
| 6601017d02 | |||
| a204d7d921 | |||
| bf345fc4ca | |||
| 2722404791 | |||
| 256f820dfd | |||
| 173f5515e3 | |||
| 7ed6f330c6 | |||
| 418d01aaf4 | |||
| 11f9ff55e1 | |||
| 04d4796089 | |||
| e889aee562 | |||
| 228157ebf5 | |||
| c77ae4e017 | |||
| 1da3022e50 | |||
| f6507b8e35 | |||
| d52b937932 | |||
| ce36e3626f | |||
| 063f7c198b | |||
| 83dedbcd33 | |||
| 0ad466926d | |||
| ced9a33352 | |||
| 3b4fba5588 | |||
| 926d5a53ff | |||
| 9cc9dabf17 | |||
| cb8be0b6b8 | |||
| c6bd4c1a45 | |||
| 31e4c05002 | |||
| c5f11c0f3c | |||
| 6158379f75 | |||
| bc076bf1b8 | |||
| 27a3a42efd | |||
| b0c2ea4640 | |||
| 00ef7b1caa | |||
| 7914b0035f | |||
| cb358279b7 | |||
| 339edb47e2 | |||
| bd6bc508df | |||
| c53194f3f9 | |||
| c477dc23c0 | |||
| 8cd421e941 | |||
| f18c2a9d15 | |||
| 403e0d96e5 | |||
| 5984ffded4 | |||
| cd9a925e6a | |||
| 40471ed54c | |||
| 000b0949e6 | |||
| 6c7f60dbc0 | |||
| 3b37e372f2 | |||
| 44b94d9324 | |||
| e5bc84f84f | |||
| a38d0650d4 | |||
| 8d9edc0e7c | |||
| 4e0357c1e3 | |||
| 9efd73abec | |||
| c31b5bbf9d | |||
| 7606ba2133 | |||
| 88c0fcb03f | |||
| 51b7f8f0a4 | |||
| 40fdf0f84f | |||
| 3e99f4f642 | |||
| 324e613b48 | |||
| 502397dcbc | |||
| f1f83c3ba1 | |||
| 2c3f09ccf7 | |||
| e2f5592b8f | |||
| 522fcf2ffc | |||
| 96e743ff78 | |||
| e514ae345e | |||
| 2659b808ab | |||
| 54037cf3e2 | |||
| b0773d70c6 | |||
| 4348fffe0c | |||
| 216c68b834 | |||
| a3c1bd86ed | |||
| e0006399ff | |||
| 2084c59b82 | |||
| a09a9879e5 | |||
| a3a095b6eb | |||
| 0edf724367 | |||
| a953ac5942 | |||
| 5627b0b1a1 | |||
| 5d3a7be453 | |||
| 8f27fdf1ab | |||
| 1d5c2c6560 | |||
| 18317c7c1c | |||
| b83fd5b1fe | |||
| 972304f4cb | |||
| 11eeb2e347 | |||
| 0aa8b11f5c | |||
| 829cafc050 | |||
| 25474b5e84 | |||
| b7f902b5b3 | |||
| 11488775eb | |||
| 32ec7e3d30 | |||
| 1a1eef4345 | |||
| 4942dfc7cd | |||
| d469fb2181 | |||
| 0213ce081c | |||
| 70b6a6618a | |||
| 089cf944f3 | |||
| 68d9adcba8 | |||
| 32636d1757 | |||
| 48ff43d3bd | |||
| 725863abe4 | |||
| 9de4bbf8a8 | |||
| cd7ca81fdd | |||
| 1ca30f2503 | |||
| c47a9439d3 | |||
| 2ce5b1d637 | |||
| c4ade76ee5 | |||
| 62fc665ff6 | |||
| 263865899e | |||
| f927f3e196 | |||
| 70f5e9ba61 | |||
| 3b7bf2cee0 | |||
| a57a9053d7 | |||
| 0292245755 | |||
| dd7aa695b2 | |||
| 2626dce64c | |||
| 7e2e135943 | |||
| cc15b9d46f | |||
| ce47bacfe9 | |||
| 7c89091995 | |||
| 7766ffc618 | |||
| 75efa0860c | |||
| d31412392c | |||
| da694c75ff | |||
| 76f5d7b9ab | |||
| e7d8926583 | |||
| c87f1ac4c7 | |||
| 75c4f5b0ca | |||
| f7b3774380 | |||
| 78293c74bf | |||
| 406fc019c1 | |||
| 903cd37434 | |||
| 6fd8b0098a | |||
| 34954a6050 | |||
| 949d8ae04e | |||
| 1c7cbed23c | |||
| 9156498826 | |||
| 71adc9a9a3 | |||
| 49612b733f | |||
| bc0721c7d9 | |||
| c5452484ee | |||
| 74eecb6078 | |||
| 725be51c11 | |||
| d0d8a7f984 | |||
| 4a50811ae3 | |||
| b82ddcbcac | |||
| 6e4cc6caf4 | |||
| fe8e9b1b4e | |||
| 72770e9a60 | |||
| a847efc70b | |||
| 9e99327888 | |||
| 9973eebb91 | |||
| a162f636d8 | |||
| 8ff8d598fe | |||
| 8704d2e5fc | |||
| f9dd21a17a | |||
| eb349bdfc4 | |||
| 89d186af72 | |||
| 65de977483 | |||
| e167481759 | |||
| 457c913461 | |||
| 422449dca8 | |||
| 53c8f0ca3c | |||
| b094b88a9a | |||
| 49e5d04a8d | |||
| 38e28dfbcd | |||
| 44047dc78d | |||
| c06b8145b1 | |||
| 79da2c5bfa | |||
| a5800adaf0 | |||
| c1c3f50965 | |||
| cff14cf0d1 | |||
| c95ea731bc | |||
| b98f14632b | |||
| a1e1b45ae7 | |||
| 2d44bb544b | |||
| c60d333578 | |||
| 182690b018 | |||
| b36b54179d | |||
| fc4b768e25 | |||
| 7e0f1972f1 | |||
| 93e64c823c | |||
| 20d598f094 | |||
| e376549179 | |||
| 163a317bcc | |||
| 7ecf13ac1d | |||
| 2fbe4fca87 | |||
| d07a8ebd7e | |||
| d4feb70e17 | |||
| f477809e38 | |||
| 94caed45db | |||
| 8c4fdb1073 | |||
| e5bbe44230 | |||
| d0a58fe035 | |||
| 9c68157292 | |||
| 44f71599df | |||
| 1fac7b914b | |||
| cede73411f | |||
| 47deb83b5c | |||
| 4ea56c1c80 | |||
| 311121b16c | |||
| 5863f1b073 | |||
| 2bb195f64f | |||
| f6b50d9901 | |||
| a0b0234a18 | |||
| f8b8a363ae | |||
| b197272987 | |||
| e4976aefc5 | |||
| dcd408b81f | |||
| 4a564ca40b | |||
| 5da06d632a | |||
| d797e57255 | |||
| 55d2042f0a | |||
| 8cd6972966 | |||
| 9cbc0a0cdb | |||
| 931d12b589 | |||
| 0beeb95a8a | |||
| 617f8bb911 | |||
| 75dd21a002 | |||
| a0c13477ab |
+1
-5
@@ -56,8 +56,6 @@ lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
lib/amd/src/truncate.js
|
||||
lib/fonts/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
@@ -76,8 +74,6 @@ theme/boost/amd/src/tab.js
|
||||
theme/boost/amd/src/tooltip.js
|
||||
theme/boost/amd/src/util.js
|
||||
theme/boost/amd/src/tether.js
|
||||
theme/boost/scss/fontawesome/
|
||||
theme/bootstrapbase/less/bootstrap/
|
||||
theme/bootstrapbase/javascript/html5shiv.js
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
theme/bootstrapbase/less/fontawesome/
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"indentation": ["on",{
|
||||
"Feature": 0,
|
||||
"Background": 2,
|
||||
"Scenario": 2,
|
||||
"Step": 4,
|
||||
"given": 4,
|
||||
"and": 4
|
||||
}],
|
||||
"no-dupe-feature-names": "on",
|
||||
"no-dupe-scenario-names": "off",
|
||||
"no-empty-file": "on",
|
||||
"no-files-without-scenarios": "on",
|
||||
"no-multiple-empty-lines": "on",
|
||||
"no-partially-commented-tag-lines": "on",
|
||||
"no-trailing-spaces": "on",
|
||||
"no-unamed-features": "on",
|
||||
"no-unamed-scenarios": "on",
|
||||
"no-scenario-outlines-without-examples": "on"
|
||||
}
|
||||
+1
-5
@@ -57,8 +57,6 @@ lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
lib/amd/src/truncate.js
|
||||
lib/fonts/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
@@ -77,8 +75,6 @@ theme/boost/amd/src/tab.js
|
||||
theme/boost/amd/src/tooltip.js
|
||||
theme/boost/amd/src/util.js
|
||||
theme/boost/amd/src/tether.js
|
||||
theme/boost/scss/fontawesome/
|
||||
theme/bootstrapbase/less/bootstrap/
|
||||
theme/bootstrapbase/javascript/html5shiv.js
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
theme/bootstrapbase/less/fontawesome/
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
+2
-5
@@ -16,9 +16,6 @@ php:
|
||||
- 7.1
|
||||
- 5.6
|
||||
|
||||
addons:
|
||||
postgresql: "9.3"
|
||||
|
||||
services:
|
||||
- redis-server
|
||||
|
||||
@@ -117,7 +114,7 @@ before_script:
|
||||
|
||||
# The wwwroot and dataroot.
|
||||
sed -i \
|
||||
-e "s%http://example.com/moodle%https://localhost%" \
|
||||
-e "s%http://example.com/moodle%http://localhost%" \
|
||||
-e "s%/home/example/moodledata%/home/travis/roots/base%" \
|
||||
config.php ;
|
||||
|
||||
@@ -187,7 +184,7 @@ before_script:
|
||||
# We need the official upstream for comparison
|
||||
git remote add upstream https://github.com/moodle/moodle.git;
|
||||
|
||||
git fetch upstream master;
|
||||
git fetch upstream MOODLE_32_STABLE;
|
||||
export GIT_PREVIOUS_COMMIT="`git merge-base FETCH_HEAD $TRAVIS_COMMIT`";
|
||||
export GIT_COMMIT="$TRAVIS_COMMIT";
|
||||
export UPSTREAM_FETCH_HEAD=`git rev-parse FETCH_HEAD`
|
||||
|
||||
+1
-28
@@ -106,6 +106,7 @@ module.exports = function(grunt) {
|
||||
return libs;
|
||||
};
|
||||
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
eslint: {
|
||||
@@ -170,10 +171,6 @@ module.exports = function(grunt) {
|
||||
files: ['**/yui/src/**/*.js'],
|
||||
tasks: ['yui']
|
||||
},
|
||||
gherkinlint: {
|
||||
files: ['**/tests/behat/*.feature'],
|
||||
tasks: ['gherkinlint']
|
||||
}
|
||||
},
|
||||
shifter: {
|
||||
options: {
|
||||
@@ -181,11 +178,6 @@ module.exports = function(grunt) {
|
||||
paths: [cwd]
|
||||
}
|
||||
},
|
||||
gherkinlint: {
|
||||
options: {
|
||||
files: ['**/tests/behat/*.feature'],
|
||||
}
|
||||
},
|
||||
stylelint: {
|
||||
less: {
|
||||
options: {
|
||||
@@ -326,22 +318,6 @@ module.exports = function(grunt) {
|
||||
}, done);
|
||||
};
|
||||
|
||||
tasks.gherkinlint = function() {
|
||||
var done = this.async(),
|
||||
options = grunt.config('gherkinlint.options');
|
||||
|
||||
var args = grunt.file.expand(options.files);
|
||||
args.unshift(path.normalize(__dirname + '/node_modules/.bin/gherkin-lint'));
|
||||
grunt.util.spawn({
|
||||
cmd: 'node',
|
||||
args: args,
|
||||
opts: {stdio: 'inherit', env: process.env}
|
||||
}, function(error, result, code) {
|
||||
// Propagate the exit code.
|
||||
done(code);
|
||||
});
|
||||
};
|
||||
|
||||
tasks.startup = function() {
|
||||
// Are we in a YUI directory?
|
||||
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
|
||||
@@ -353,7 +329,6 @@ module.exports = function(grunt) {
|
||||
// Run them all!.
|
||||
grunt.task.run('css');
|
||||
grunt.task.run('js');
|
||||
grunt.task.run('gherkinlint');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -368,7 +343,6 @@ module.exports = function(grunt) {
|
||||
grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]);
|
||||
grunt.config('shifter.options.paths', files);
|
||||
grunt.config('stylelint.less.src', files);
|
||||
grunt.config('gherkinlint.options.files', files);
|
||||
changedFiles = Object.create(null);
|
||||
}, 200);
|
||||
|
||||
@@ -386,7 +360,6 @@ module.exports = function(grunt) {
|
||||
|
||||
// Register JS tasks.
|
||||
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
|
||||
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', tasks.gherkinlint);
|
||||
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
|
||||
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
|
||||
grunt.registerTask('amd', ['eslint:amd', 'uglify']);
|
||||
|
||||
+4
-23
@@ -16,9 +16,6 @@ $err = array();
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
|
||||
|
||||
debugging("Use of config.html files in authentication plugins have been deprecated. " .
|
||||
" Please migrate your plugin to use the admin settings API", DEBUG_DEVELOPER);
|
||||
|
||||
// save configuration changes
|
||||
if ($frm = data_submitted() and confirm_sesskey()) {
|
||||
|
||||
@@ -89,28 +86,12 @@ exit;
|
||||
|
||||
/// Functions /////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* auth field locking
|
||||
* Good enough for most auth plugins
|
||||
* but some may want a custom one if they are offering
|
||||
* other options
|
||||
* Note: lockconfig_ fields have special handling.
|
||||
*
|
||||
* @param string $auth authentication plugin shortname
|
||||
* @param array $user_fields user profile fields
|
||||
* @param string $helptext help text to be displayed at top of form
|
||||
* @param boolean $retrieveopts Map fields or lock only.
|
||||
* @param boolean $updateopts Allow remote updates
|
||||
* @param array $customfields list of custom profile fields
|
||||
* @deprecated since Moodle 3.3
|
||||
*/
|
||||
// Good enough for most auth plugins
|
||||
// but some may want a custom one if they are offering
|
||||
// other options
|
||||
// Note: lockconfig_ fields have special handling.
|
||||
function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts, $updateopts, $customfields = array()) {
|
||||
global $DB, $OUTPUT;
|
||||
debugging("The function 'print_auth_lock_options' has been deprecated, " .
|
||||
"Please migrate your code to use the admin settings API and use the function 'display_auth_lock_options' instead. ",
|
||||
DEBUG_DEVELOPER);
|
||||
|
||||
echo '<tr><td colspan="3">';
|
||||
if ($retrieveopts) {
|
||||
echo $OUTPUT->heading(get_string('auth_data_mapping', 'auth'));
|
||||
|
||||
+4
-4
@@ -168,10 +168,10 @@
|
||||
$visible = '';
|
||||
} else if ($blocks[$blockid]->visible) {
|
||||
$visible = '<a href="blocks.php?hide='.$blockid.'&sesskey='.sesskey().'" title="'.$strhide.'">'.
|
||||
$OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
|
||||
} else {
|
||||
$visible = '<a href="blocks.php?show='.$blockid.'&sesskey='.sesskey().'" title="'.$strshow.'">'.
|
||||
$OUTPUT->pix_icon('t/show', $strshow) . '</a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
|
||||
$class = 'dimmed_text';
|
||||
}
|
||||
|
||||
@@ -186,10 +186,10 @@
|
||||
$undeletable = '';
|
||||
} else if (in_array($blockname, $undeletableblocktypes)) {
|
||||
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&sesskey='.sesskey().'" title="'.$strunprotect.'">'.
|
||||
$OUTPUT->pix_icon('t/unlock', $strunprotect) . '</a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
|
||||
} else {
|
||||
$undeletable = '<a href="blocks.php?protect='.$blockid.'&sesskey='.sesskey().'" title="'.$strprotect.'">'.
|
||||
$OUTPUT->pix_icon('t/lock', $strprotect) . '</a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
|
||||
}
|
||||
|
||||
$row = array(
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* CLI script allowing to get and set config values.
|
||||
*
|
||||
* This is technically just a thin wrapper for {@link get_config()} and
|
||||
* {@link set_config()} functions.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage cli
|
||||
* @copyright 2017 David Mudrák <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
|
||||
$usage = "Displays the current value of the given site setting. Allows to set it to the given value, too.
|
||||
|
||||
Usage:
|
||||
# php cfg.php [--component=<componentname>] [--json] [--shell-arg]
|
||||
# php cfg.php --name=<configname> [--component=<componentname>] [--shell-arg] [--no-eol]
|
||||
# php cfg.php --name=<configname> [--component=<componentname>] --set=<value>
|
||||
# php cfg.php --name=<configname> [--component=<componentname>] --unset
|
||||
# php cfg.php [--help|-h]
|
||||
|
||||
Options:
|
||||
-h --help Print this help.
|
||||
--component=<frankenstyle> Name of the component the variable is part of. Defaults to core.
|
||||
--name=<configname> Name of the configuration variable to get/set. If missing, print all
|
||||
configuration variables of the given component.
|
||||
--set=<value> Set the given variable to this value.
|
||||
--unset Unset the given variable.
|
||||
--shell-arg Escape output values so that they can be directly used as shell script arguments.
|
||||
--json Encode output list of values using JSON notation.
|
||||
--no-eol Do not include the trailing new line character when printing the value.
|
||||
|
||||
The list of all variables of the given component can be printed as
|
||||
tab-separated list (default) or JSON object (--json). Particular values are
|
||||
printed as raw text values, optionally escaped so that they can be directly
|
||||
used as shell script arguments (--shell-arg). Single values are displayed with
|
||||
trailing new line by default, unless explicitly disabled (--no-eol).
|
||||
|
||||
In the read mode, the script exits with success status 0 if the requested value
|
||||
is found. If the requested variable is not set, the script exits with status 3.
|
||||
When listing all variables of the component, the exit status is always 0 even
|
||||
if no variables for the given component are found. When setting/unsetting a
|
||||
value, the exit status is 0. When attempting to set/unset a value that has
|
||||
already been hard-set in config.php, the script exits with error status 4. In
|
||||
case of unexpected error, the script exits with error status 1.
|
||||
|
||||
Examples:
|
||||
|
||||
# php cfg.php
|
||||
Prints tab-separated list of all core configuration variables and their values.
|
||||
|
||||
# php cfg.php --json
|
||||
Prints list of all core configuration variables and their values as a JSON object.
|
||||
|
||||
# php cfg.php --name=release
|
||||
Prints the given configuration variable - e.g. \$CFG->release in this case.
|
||||
|
||||
# php cfg.php --component=tool_recyclebin
|
||||
# Prints tab-separated list of the plugin's configuration variables.
|
||||
|
||||
# export DATAROOT=\$(php cfg.php --name=dataroot --shell-arg --no-eol)
|
||||
Stores the given configuration variable in the shell variable, escaped
|
||||
so that it can be safely used as a shell argument.
|
||||
|
||||
# php cfg.php --name=theme --set=clean
|
||||
Sets the given configuration variable to the given value.
|
||||
|
||||
# php cfg.php --name=noemailever --unset
|
||||
Unsets the previously configured variable.
|
||||
";
|
||||
|
||||
list($options, $unrecognised) = cli_get_params([
|
||||
'help' => false,
|
||||
'component' => null,
|
||||
'name' => null,
|
||||
'set' => null,
|
||||
'unset' => false,
|
||||
'shell-arg' => false,
|
||||
'json' => false,
|
||||
'no-eol' => false,
|
||||
], [
|
||||
'h' => 'help'
|
||||
]);
|
||||
|
||||
if ($unrecognised) {
|
||||
$unrecognised = implode(PHP_EOL.' ', $unrecognised);
|
||||
cli_error(get_string('cliunknowoption', 'core_admin', $unrecognised));
|
||||
}
|
||||
|
||||
if ($options['help']) {
|
||||
cli_writeln($usage);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if ($options['unset'] || $options['set'] !== null) {
|
||||
// Unset the variable or set it to the given value.
|
||||
if (empty($options['name'])) {
|
||||
cli_error('Missing configuration variable name', 2);
|
||||
}
|
||||
|
||||
// Check that the variable is not hard-set in the main config.php already.
|
||||
if (array_key_exists($options['name'], $CFG->config_php_settings)) {
|
||||
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
|
||||
}
|
||||
|
||||
set_config($options['name'], $options['set'], $options['component']);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($options['name'] === null) {
|
||||
// List all variables provided by the component (defaults to core).
|
||||
$got = get_config($options['component']);
|
||||
|
||||
if ($options['json']) {
|
||||
cli_writeln(json_encode($got));
|
||||
|
||||
} else {
|
||||
foreach ($got as $name => $value) {
|
||||
if ($options['shell-arg']) {
|
||||
$value = escapeshellarg($value);
|
||||
}
|
||||
cli_writeln($name."\t".$value);
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
} else {
|
||||
// Display the value of a single variable.
|
||||
|
||||
$got = get_config($options['component'], $options['name']);
|
||||
|
||||
if ($got === false) {
|
||||
cli_error('No such configuration variable found.', 3);
|
||||
}
|
||||
|
||||
if ($options['shell-arg']) {
|
||||
$got = escapeshellarg($got);
|
||||
}
|
||||
|
||||
if ($options['json']) {
|
||||
$got = json_encode($got);
|
||||
}
|
||||
|
||||
if ($options['no-eol']) {
|
||||
cli_write($got);
|
||||
} else {
|
||||
cli_writeln($got);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -47,7 +47,6 @@ switch ($action) {
|
||||
// remove from enabled list
|
||||
$key = array_search($editor, $active_editors);
|
||||
unset($active_editors[$key]);
|
||||
add_to_config_log('editor_visibility', '1', '0', $editor);
|
||||
break;
|
||||
|
||||
case 'enable':
|
||||
@@ -55,7 +54,6 @@ switch ($action) {
|
||||
if (!in_array($editor, $active_editors)) {
|
||||
$active_editors[] = $editor;
|
||||
$active_editors = array_unique($active_editors);
|
||||
add_to_config_log('editor_visibility', '0', '1', $editor);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -68,7 +66,6 @@ switch ($action) {
|
||||
$fsave = $active_editors[$key];
|
||||
$active_editors[$key] = $active_editors[$key + 1];
|
||||
$active_editors[$key + 1] = $fsave;
|
||||
add_to_config_log('editor_position', $key, $key + 1, $editor);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -82,7 +79,6 @@ switch ($action) {
|
||||
$fsave = $active_editors[$key];
|
||||
$active_editors[$key] = $active_editors[$key - 1];
|
||||
$active_editors[$key - 1] = $fsave;
|
||||
add_to_config_log('editor_position', $key, $key - 1, $editor);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1905,180 +1905,4 @@
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.3" requires="2.7">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="5.5.31" />
|
||||
<VENDOR name="mysql" version="5.5.31" />
|
||||
<VENDOR name="postgres" version="9.3" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.6.5" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="opensslrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlreader" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
<PHP_EXTENSION name="fileinfo" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="96M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="opcache.enable" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opcacherecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
<CUSTOM_CHECKS>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbstorageengine" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="quizattemptsupgradedmessage" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="slashargumentswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<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_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="ishttpswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="incompleteunicodesupport" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
|
||||
|
||||
// Re-order.
|
||||
$updown = '';
|
||||
$spacer = $OUTPUT->spacer();
|
||||
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
|
||||
if ($state->active != TEXTFILTER_DISABLED) {
|
||||
if (!$isfirstrow) {
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
|
||||
|
||||
@@ -101,12 +101,6 @@ if (function_exists('opcache_invalidate')) {
|
||||
// indirectly calls the protected init() method is good here.
|
||||
core_component::get_core_subsystems();
|
||||
|
||||
if (is_major_upgrade_required() && isloggedin()) {
|
||||
// A major upgrade is required.
|
||||
// Terminate the session and redirect back here before anything DB-related happens.
|
||||
redirect_if_major_upgrade_required();
|
||||
}
|
||||
|
||||
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
|
||||
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ foreach ($columns as $column) {
|
||||
} else {
|
||||
$columndir = $dir == "ASC" ? "DESC" : "ASC";
|
||||
$columnicon = $dir == "ASC" ? "down" : "up";
|
||||
$columnicon = " " . $OUTPUT->pix_icon('t/' . $columnicon, get_string('sort'));
|
||||
$columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
|
||||
}
|
||||
$headings[$column] = "<a href=\"?sort=$column&dir=$columndir&\">".$string[$column]."</a>$columnicon";
|
||||
}
|
||||
|
||||
+3
-3
@@ -94,7 +94,7 @@
|
||||
$missing = true;
|
||||
} else {
|
||||
// took out hspace="\10\", because it does not validate. don't know what to replace with.
|
||||
$icon = "<img src=\"" . $OUTPUT->image_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
|
||||
$icon = "<img src=\"" . $OUTPUT->pix_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
|
||||
$strmodulename = $icon.' '.get_string('modulename', $module->name);
|
||||
$missing = false;
|
||||
}
|
||||
@@ -130,11 +130,11 @@
|
||||
$class = '';
|
||||
} else if ($module->visible) {
|
||||
$visible = "<a href=\"modules.php?hide=$module->name&sesskey=".sesskey()."\" title=\"$strhide\">".
|
||||
$OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
|
||||
$class = '';
|
||||
} else {
|
||||
$visible = "<a href=\"modules.php?show=$module->name&sesskey=".sesskey()."\" title=\"$strshow\">".
|
||||
$OUTPUT->pix_icon('t/show', $strshow) . '</a>';
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
|
||||
$class = 'dimmed_text';
|
||||
}
|
||||
if ($module->name == "forum") {
|
||||
|
||||
@@ -30,17 +30,6 @@
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
|
||||
$error = optional_param('error', '', PARAM_RAW);
|
||||
if ($error) {
|
||||
$message = optional_param('error_description', '', PARAM_RAW);
|
||||
if ($message) {
|
||||
print_error($message);
|
||||
} else {
|
||||
print_error($error);
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
// The state parameter we've given (used in moodle as a redirect url).
|
||||
|
||||
@@ -422,12 +422,12 @@ class site_registration_form extends moodleform {
|
||||
$mform->addElement('checkbox', 'badges', '',
|
||||
" " . get_string('badgesnumber', 'hub', $badges));
|
||||
$mform->setDefault('badges', $badgesnumber != -1);
|
||||
$mform->setType('badges', PARAM_INT);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
|
||||
$mform->addElement('checkbox', 'issuedbadges', '',
|
||||
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
|
||||
$mform->setDefault('issuedbadges', $issuedbadgesnumber != -1);
|
||||
$mform->setType('issuedbadges', PARAM_INT);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
|
||||
$mform->addElement('checkbox', 'participantnumberaverage', '',
|
||||
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
|
||||
|
||||
+2
-2
@@ -1612,10 +1612,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$row = new html_table_row();
|
||||
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
|
||||
|
||||
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name, null)) {
|
||||
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
|
||||
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
|
||||
} else {
|
||||
$icon = $this->output->spacer();
|
||||
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
|
||||
}
|
||||
$status = $plugin->get_status();
|
||||
$row->attributes['class'] .= ' status-'.$status;
|
||||
|
||||
@@ -370,14 +370,14 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
if ($updowncount > 1) {
|
||||
$updown .= "<a href=\"$sesskeyurl&action=moveup&repos=".$typename."\">";
|
||||
$updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . "</a> ";
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"up\" /></a> ";
|
||||
}
|
||||
else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
if ($updowncount < $totalrepositorytypes) {
|
||||
$updown .= "<a href=\"$sesskeyurl&action=movedown&repos=".$typename."\">";
|
||||
$updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . "</a> ";
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" /></a>";
|
||||
}
|
||||
else {
|
||||
$updown .= $spacer;
|
||||
|
||||
@@ -183,7 +183,8 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
||||
public function get_risk_icon($type) {
|
||||
global $OUTPUT;
|
||||
|
||||
$text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
|
||||
$iconurl = $OUTPUT->pix_url('i/' . str_replace('risk', 'risk_', $type));
|
||||
$text = '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />';
|
||||
$action = new popup_action('click', $this->risksurl, 'docspopup');
|
||||
$riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin')));
|
||||
|
||||
|
||||
@@ -56,24 +56,6 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds an additional class to a row if capability is other than inherited.
|
||||
*
|
||||
* @param stdClass $capability
|
||||
* @return array
|
||||
*/
|
||||
protected function get_row_attributes($capability) {
|
||||
$rowattributes = parent::get_row_attributes($capability);
|
||||
if ($this->permissions[$capability->name] !== 0) {
|
||||
if (empty($rowattributes['class'])) {
|
||||
$rowattributes['class'] = "overriddenpermission";
|
||||
} else {
|
||||
$rowattributes['class'] .= " overriddenpermission";
|
||||
}
|
||||
}
|
||||
return $rowattributes;
|
||||
}
|
||||
|
||||
protected function load_parent_permissions() {
|
||||
// Get the capabilities from the parent context, so that can be shown in the interface.
|
||||
$parentcontext = $this->context->get_parent_context();
|
||||
|
||||
@@ -93,10 +93,9 @@ class core_role_permissions_table extends core_role_capability_table_base {
|
||||
foreach ($roles as $id => $name) {
|
||||
if (isset($needed[$id])) {
|
||||
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "prevent", "spanclass" => "allowed",
|
||||
"linkclass" => "preventlink", "adminurl" => $adminurl->out(), "icon" => "", "iconalt" => "");
|
||||
"linkclass" => "preventlink", "adminurl" => $adminurl->out(), "imageurl" => "");
|
||||
if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
|
||||
$templatecontext['icon'] = 't/delete';
|
||||
$templatecontext['iconalt'] = get_string('delete');
|
||||
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
|
||||
}
|
||||
$neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
|
||||
}
|
||||
@@ -106,10 +105,9 @@ class core_role_permissions_table extends core_role_capability_table_base {
|
||||
if (isset($forbidden[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
|
||||
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "unprohibit",
|
||||
"spanclass" => "forbidden", "linkclass" => "unprohibitlink", "adminurl" => $adminurl->out(),
|
||||
"icon" => "", "iconalt" => "");
|
||||
"imageurl" => "");
|
||||
if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) {
|
||||
$templatecontext['icon'] = 't/delete';
|
||||
$templatecontext['iconalt'] = get_string('delete');
|
||||
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
|
||||
}
|
||||
$forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
|
||||
}
|
||||
|
||||
@@ -216,9 +216,9 @@ die;
|
||||
function get_action_icon($url, $icon, $alt, $tooltip) {
|
||||
global $OUTPUT;
|
||||
return '<a title="' . $tooltip . '" href="'. $url . '">' .
|
||||
$OUTPUT->pix_icon('t/' . $icon, $alt) . '</a> ';
|
||||
'<img src="' . $OUTPUT->pix_url('t/' . $icon) . '" class="iconsmall" alt="' . $alt . '" /></a> ';
|
||||
}
|
||||
function get_spacer() {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->spacer();
|
||||
return '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
@core @core_admin @core_admin_roles
|
||||
Feature: Highlight non-inherited permissions
|
||||
In order that the status of capabilities can be more easily seen
|
||||
As an admin
|
||||
I need altered permissions to be highlighted
|
||||
|
||||
Background:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course fullname | C_shortname |
|
||||
And I log in as "admin"
|
||||
|
||||
@javascript
|
||||
Scenario: Override a permission
|
||||
Given I am on "Course fullname" course homepage
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I select "Manager (0)" from the "roleid" singleselect
|
||||
And I click on "Prohibit" "radio" in the "View added and updated modules in recent activity block" "table_row"
|
||||
And I press "Save changes"
|
||||
And I select "Manager (1)" from the "roleid" singleselect
|
||||
Then the "class" attribute of "View added and updated modules in recent activity block" "table_row" should contain "overriddenpermission"
|
||||
@@ -193,8 +193,10 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
$strgoto = get_string('gotoassignroles', 'core_role', $a);
|
||||
$strcheck = get_string('checkuserspermissionshere', 'core_role', $a);
|
||||
}
|
||||
echo ' <a title="' . $strgoto . '" href="' . $raurl . '">' . $OUTPUT->pix_icon('t/edit', 'core', $stredit) . '</a> ';
|
||||
echo ' <a title="' . $strcheck . '" href="' . $churl . '">' . $OUTPUT->pix_icon('t/preview', 'core', $strcheckpermissions) . '</a> ';
|
||||
echo ' <a title="' . $strgoto . '" href="' . $raurl . '"><img class="iconsmall" src="' .
|
||||
$OUTPUT->pix_url('t/edit') . '" alt="' . $stredit . '" /></a> ';
|
||||
echo ' <a title="' . $strcheck . '" href="' . $churl . '"><img class="iconsmall" src="' .
|
||||
$OUTPUT->pix_url('t/preview') . '" alt="' . $strcheckpermissions . '" /></a> ';
|
||||
echo "</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
+1
-102
@@ -133,7 +133,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
// Completion tracking.
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('completion','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion', 'completion'),
|
||||
new lang_string('enablecompletion_help', 'completion'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
new lang_string('enablecompletion_help', 'completion'), 0, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
|
||||
// Groups.
|
||||
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
||||
@@ -343,105 +343,4 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', new lang_string('blogs', 'blog'), new lang_string('backupblogshelp','blog'), 0));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for general restore configuration and defaults.
|
||||
$temp = new admin_settingpage('restoregeneralsettings', new lang_string('generalrestoredefaults', 'backup'));
|
||||
|
||||
// General restore defaults.
|
||||
$temp->add(new admin_setting_heading('generalsettings', new lang_string('generalrestoresettings', 'backup'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_users',
|
||||
new lang_string('generalusers', 'backup'), new lang_string('configrestoreusers', 'backup'),
|
||||
array('value' => 1, 'locked' => 0)));
|
||||
// Can not use actual constants here because we'd need to include 100 of backup/restore files.
|
||||
$options = [
|
||||
0/*backup::ENROL_NEVER*/ => get_string('rootsettingenrolments_never', 'backup'),
|
||||
1/*backup::ENROL_WITHUSERS*/ => get_string('rootsettingenrolments_withusers', 'backup'),
|
||||
2/*backup::ENROL_ALWAYS*/ => get_string('rootsettingenrolments_always', 'backup'),
|
||||
];
|
||||
$temp->add(new admin_setting_configselect_with_lock('restore/restore_general_enrolments',
|
||||
new lang_string('generalenrolments', 'backup'), new lang_string('configrestoreenrolments', 'backup'),
|
||||
array('value' => 1/*backup::ENROL_WITHUSERS*/, 'locked' => 0), $options));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_role_assignments',
|
||||
new lang_string('generalroleassignments', 'backup'),
|
||||
new lang_string('configrestoreroleassignments', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_activities',
|
||||
new lang_string('generalactivities', 'backup'),
|
||||
new lang_string('configrestoreactivities', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_blocks',
|
||||
new lang_string('generalblocks', 'backup'),
|
||||
new lang_string('configrestoreblocks', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_filters',
|
||||
new lang_string('generalfilters', 'backup'),
|
||||
new lang_string('configrestorefilters', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_comments',
|
||||
new lang_string('generalcomments', 'backup'),
|
||||
new lang_string('configrestorecomments', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_badges',
|
||||
new lang_string('generalbadges', 'backup'),
|
||||
new lang_string('configrestorebadges', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_calendarevents',
|
||||
new lang_string('generalcalendarevents', 'backup'),
|
||||
new lang_string('configrestorecalendarevents', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_userscompletion',
|
||||
new lang_string('generaluserscompletion', 'backup'),
|
||||
new lang_string('configrestoreuserscompletion', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_logs',
|
||||
new lang_string('generallogs', 'backup'),
|
||||
new lang_string('configrestorelogs', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_histories',
|
||||
new lang_string('generalhistories', 'backup'),
|
||||
new lang_string('configrestorehistories', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_groups',
|
||||
new lang_string('generalgroups', 'backup'), new lang_string('configrestoregroups', 'backup'),
|
||||
array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies',
|
||||
new lang_string('generalcompetencies', 'backup'),
|
||||
new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
|
||||
// Restore defaults when merging into another course.
|
||||
$temp->add(new admin_setting_heading('mergerestoredefaults', new lang_string('mergerestoredefaults', 'backup'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_overwrite_conf',
|
||||
new lang_string('setting_overwrite_conf', 'backup'),
|
||||
new lang_string('config_overwrite_conf', 'backup'), array('value' => 0, 'locked' => 0)));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_fullname',
|
||||
new lang_string('setting_overwrite_course_fullname', 'backup'),
|
||||
new lang_string('config_overwrite_course_fullname', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_shortname',
|
||||
new lang_string('setting_overwrite_course_shortname', 'backup'),
|
||||
new lang_string('config_overwrite_course_shortname', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_startdate',
|
||||
new lang_string('setting_overwrite_course_startdate', 'backup'),
|
||||
new lang_string('config_overwrite_course_startdate', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
|
||||
// Restore defaults when replacing course contents.
|
||||
$temp->add(new admin_setting_heading('replacerestoredefaults', new lang_string('replacerestoredefaults', 'backup'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_overwrite_conf',
|
||||
new lang_string('setting_overwrite_conf', 'backup'),
|
||||
new lang_string('config_overwrite_conf', 'backup'), array('value' => 0, 'locked' => 0)));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_fullname',
|
||||
new lang_string('setting_overwrite_course_fullname', 'backup'),
|
||||
new lang_string('config_overwrite_course_fullname', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_shortname',
|
||||
new lang_string('setting_overwrite_course_shortname', 'backup'),
|
||||
new lang_string('config_overwrite_course_shortname', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_startdate',
|
||||
new lang_string('setting_overwrite_course_startdate', 'backup'),
|
||||
new lang_string('config_overwrite_course_startdate', 'backup'), array('value' => 1, 'locked' => 0)));
|
||||
|
||||
$temp->add(new admin_setting_configselect_with_lock('restore/restore_replace_keep_roles_and_enrolments',
|
||||
new lang_string('setting_keep_roles_and_enrolments', 'backup'),
|
||||
new lang_string('config_keep_roles_and_enrolments', 'backup'), array('value' => 0, 'locked' => 0),
|
||||
array(1 => get_string('yes'), 0 => get_string('no'))));
|
||||
$temp->add(new admin_setting_configselect_with_lock('restore/restore_replace_keep_groups_and_groupings',
|
||||
new lang_string('setting_keep_groups_and_groupings', 'backup'),
|
||||
new lang_string('config_keep_groups_and_groupings', 'backup'), array('value' => 0, 'locked' => 0),
|
||||
array(1 => get_string('yes'), 0 => get_string('no'))));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
}
|
||||
|
||||
@@ -230,19 +230,6 @@ if ($hassiteconfig) {
|
||||
300, PARAM_INT, 10));
|
||||
$ADMIN->add('mediaplayers', $temp);
|
||||
|
||||
// Convert plugins.
|
||||
$ADMIN->add('modules', new admin_category('fileconverterplugins', new lang_string('type_fileconverter_plural', 'plugin')));
|
||||
$temp = new admin_settingpage('managefileconverterplugins', new lang_string('type_fileconverter', 'plugin'));
|
||||
$temp->add(new admin_setting_manage_fileconverter_plugins());
|
||||
$ADMIN->add('fileconverterplugins', $temp);
|
||||
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('fileconverter');
|
||||
core_collator::asort_objects_by_property($plugins, 'displayname');
|
||||
foreach ($plugins as $plugin) {
|
||||
/** @var \core\plugininfo\media $plugin */
|
||||
$plugin->load_settings($ADMIN, 'fileconverterplugins', $hassiteconfig);
|
||||
}
|
||||
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('media');
|
||||
core_collator::asort_objects_by_property($plugins, 'displayname');
|
||||
foreach ($plugins as $plugin) {
|
||||
|
||||
@@ -59,8 +59,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$temp->add(new admin_setting_configcheckbox('cronclionly', new lang_string('cronclionly', 'admin'), new lang_string
|
||||
('configcronclionly', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', new lang_string('cronremotepassword', 'admin'), new lang_string('configcronremotepassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('tool_task/enablerunnow', new lang_string('enablerunnow', 'tool_task'),
|
||||
new lang_string('enablerunnow_desc', 'tool_task'), 1));
|
||||
|
||||
$options = array(0=>get_string('no'), 3=>3, 5=>5, 7=>7, 10=>10, 20=>20, 30=>30, 50=>50, 100=>100);
|
||||
$temp->add(new admin_setting_configselect('lockoutthreshold', new lang_string('lockoutthreshold', 'admin'), new lang_string('lockoutthreshold_desc', 'admin'), 0, $options));
|
||||
@@ -119,6 +117,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', new lang_string('loginpasswordautocomplete', 'admin'), new lang_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
|
||||
// Settings elements used by the \core\files\curl_security_helper class.
|
||||
$temp->add(new admin_setting_configmixedhostiplist('curlsecurityblockedhosts',
|
||||
|
||||
@@ -12,6 +12,7 @@ $temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('patht
|
||||
$temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtogs', new lang_string('pathtogs', 'admin'), new lang_string('pathtogs_help', 'admin'), '/usr/bin/gs'));
|
||||
$temp->add(new admin_setting_configexecutable('pathtounoconv', new lang_string('pathtounoconv', 'admin'), new lang_string('pathtounoconv_help', 'admin'), '/usr/bin/unoconv'));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
|
||||
@@ -54,10 +54,4 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableglobalsearch', new lang_string('enableglobalsearch', 'admin'),
|
||||
new lang_string('enableglobalsearch_desc', 'admin'), 0, 1, 0));
|
||||
|
||||
$choices = array();
|
||||
$choices[0] = new lang_string('no');
|
||||
$choices[1] = new lang_string('yes');
|
||||
$optionalsubsystems->add(new admin_setting_configselect('allowstealth', new lang_string('allowstealthmodules'),
|
||||
new lang_string('allowstealthmodules_help'), 0, $choices));
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template core_admin/setting_configmultiselect_optgroup
|
||||
|
||||
Admin multiselect setting template with optgroup support.
|
||||
|
||||
Context variables required for this template:
|
||||
* name - form element name
|
||||
* id - element id
|
||||
* size - element size
|
||||
* options - list of options not grouped
|
||||
* optgroups - list of options grouped containing the group label and for each option: name, value, selected
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"name": "test",
|
||||
"id": "test0",
|
||||
"size": "3",
|
||||
"options": [
|
||||
{ "name": "Option 1", "value": "V", "selected": false },
|
||||
{ "name": "Option 2", "value": "V", "selected": true }
|
||||
],
|
||||
"optgroups": [
|
||||
{
|
||||
"label": "Group 1",
|
||||
"options": [
|
||||
{ "name": "Option 3", "value": "V", "selected": false },
|
||||
{ "name": "Option 4", "value": "V", "selected": true }
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Group 2",
|
||||
"options": [
|
||||
{ "name": "Option 5", "value": "V", "selected": false },
|
||||
{ "name": "Option 6", "value": "V", "selected": true }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
<div class="form-select">
|
||||
<input type="hidden" name="{{name}}[xxxxx]" value="1">
|
||||
<select id="{{id}}" name="{{name}}[]" size="{{size}}" multiple>
|
||||
{{#options}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/options}}
|
||||
{{#optgroups}}
|
||||
<optgroup label="{{label}}">
|
||||
{{#options}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/options}}
|
||||
</optgroup>
|
||||
{{/optgroups}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template core_admin/setting_configselect_optgroup
|
||||
|
||||
Admin select with optgroup setting template.
|
||||
|
||||
Context variables required for this template:
|
||||
* name - form element name
|
||||
* id - element id
|
||||
* options - list of options (not grouped)
|
||||
* optgroups - list of options grouped containing the group label and for each option: name, value, selected
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"name": "test",
|
||||
"id": "test0",
|
||||
"options": [
|
||||
{ "name": "Option 1", "value": "V", "selected": false },
|
||||
{ "name": "Option 2", "value": "V", "selected": false }
|
||||
],
|
||||
"optgroups": [
|
||||
{
|
||||
"label": "Group 1",
|
||||
"options": [
|
||||
{ "name": "Option 3", "value": "V", "selected": true },
|
||||
{ "name": "Option 4", "value": "V", "selected": false }
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Group 2",
|
||||
"options": [
|
||||
{ "name": "Option 5", "value": "V", "selected": false },
|
||||
{ "name": "Option 6", "value": "V", "selected": false }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
<div class="form-select defaultsnext">
|
||||
<select id="{{id}}" name="{{name}}">
|
||||
{{#options}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/options}}
|
||||
{{#optgroups}}
|
||||
<optgroup label="{{label}}">
|
||||
{{#options}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/options}}
|
||||
</optgroup>
|
||||
{{/optgroups}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<table class="admintable generaltable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="header">{{#str}}name, moodle{{/str}}</th>
|
||||
{{#infocolumnname}}
|
||||
<th class="header">{{infocolumnname}}</th>
|
||||
{{/infocolumnname}}
|
||||
<th class="header">{{#str}}order, moodle{{/str}}</th>
|
||||
<th class="header">{{#str}}isenabled, plugin{{/str}}</th>
|
||||
<th class="header">{{#str}}settings, moodle{{/str}}</th>
|
||||
<th class="header">{{#str}}uninstall, plugin{{/str}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#plugins}}
|
||||
<tr>
|
||||
<td>{{plugin}}</td>
|
||||
{{#infocolumnname}}
|
||||
<td>
|
||||
{{info}}
|
||||
</td>
|
||||
{{/infocolumnname}}
|
||||
<td class="text-nowrap">
|
||||
{{#moveuplink}}
|
||||
<a href="{{{moveuplink}}}">
|
||||
{{#pix}}t/up, moodle, {{#str}} up, moodle {{/str}}{{/pix}}
|
||||
</a>
|
||||
{{/moveuplink}}
|
||||
{{^moveuplink}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
{{/moveuplink}}
|
||||
|
||||
{{#movedownlink}}
|
||||
<a href="{{{movedownlink}}}">
|
||||
{{#pix}}t/down, moodle, {{#str}} down, moodle {{/str}}{{/pix}}
|
||||
</a>
|
||||
{{/movedownlink}}
|
||||
{{^movedownlink}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
{{/movedownlink}}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{{togglelink}}}">
|
||||
{{#toggletarget}}
|
||||
{{#pix}}i/show, moodle, {{#str}} enable, moodle {{/str}}{{/pix}}
|
||||
{{/toggletarget}}
|
||||
{{^toggletarget}}
|
||||
{{#pix}}i/hide, moodle, {{#str}} disable, moodle {{/str}}{{/pix}}
|
||||
{{/toggletarget}}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{#settingslink}}
|
||||
<a href="{{{settingslink}}}">{{#str}}settings,plugin{{/str}}</a>
|
||||
{{/settingslink}}
|
||||
</td>
|
||||
<td>
|
||||
{{#uninstalllink}}
|
||||
<a href="{{{uninstalllink}}}">{{#str}}uninstall,plugin{{/str}}</a>
|
||||
{{/uninstalllink}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/plugins}}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->component = 'tool_assignmentupgrade';
|
||||
$plugin->dependencies = array('mod_assign' => 2017050500);
|
||||
$plugin->dependencies = array('mod_assign' => 2016112900);
|
||||
|
||||
@@ -103,9 +103,18 @@ foreach ($plugins as $plugin => $name) {
|
||||
|
||||
// Make enable control. This is a POST request (using a form control rather
|
||||
// than just a link) because it makes a database change.
|
||||
$params = array('sesskey' => sesskey(), 'plugin' => $plugin, 'action' => $enabledaction);
|
||||
$url = new moodle_url('/' . $CFG->admin . '/tool/availabilityconditions/', $params);
|
||||
$enablecontrol = html_writer::link($url, $OUTPUT->pix_icon('t/' . $enabledaction, $enabledstr));
|
||||
$enablecontrol = html_writer::tag('form', html_writer::div(
|
||||
html_writer::empty_tag('input', array('type' => 'hidden',
|
||||
'name' => 'sesskey', 'value' => sesskey())) .
|
||||
html_writer::empty_tag('input', array('type' => 'hidden',
|
||||
'name' => 'plugin', 'value' => $plugin)) .
|
||||
html_writer::empty_tag('input', array('type' => 'hidden',
|
||||
'name' => 'action', 'value' => $enabledaction)) .
|
||||
html_writer::empty_tag('input', array('type' => 'image',
|
||||
'src' => $OUTPUT->pix_url('t/' . $enabledaction), 'alt' => $enabledstr,
|
||||
'title' => $enabledstr))
|
||||
), array(
|
||||
'method' => 'post', 'action' => './'));
|
||||
|
||||
$table->add_data(array($namespan, $version, $enablecontrol));
|
||||
}
|
||||
|
||||
@@ -37,19 +37,21 @@ Feature: Manage availability conditions
|
||||
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
|
||||
|
||||
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
|
||||
Then "Hide" "icon" should exist in the "Restriction by date" "table_row"
|
||||
Then "input[title=Hide]" "css_element" should exist in the "Restriction by date" "table_row"
|
||||
|
||||
# Click the icon. It should toggle to hidden (title=Show).
|
||||
And I click on "Hide" "icon" in the "Restriction by date" "table_row"
|
||||
And "Show" "icon" should exist in the "Restriction by date" "table_row"
|
||||
And I click on "input[title=Hide]" "css_element" in the "Restriction by date" "table_row"
|
||||
And "input[title=Show]" "css_element" should exist in the "Restriction by date" "table_row"
|
||||
|
||||
# Toggle it back to visible (title=Hide).
|
||||
And I click on "Show" "icon" in the "Restriction by date" "table_row"
|
||||
And "Hide" "icon" should exist in the "Restriction by date" "table_row"
|
||||
And I click on "input[title=Show]" "css_element" in the "Restriction by date" "table_row"
|
||||
And "input[title=Hide]" "css_element" should exist in the "Restriction by date" "table_row"
|
||||
|
||||
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
|
||||
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "input[title=Hide]" "css_element" in the "Restriction by grade" "table_row"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->component = 'tool_availabilityconditions';
|
||||
|
||||
@@ -325,7 +325,6 @@ if ($verbose || $status) {
|
||||
}
|
||||
|
||||
// Update status after auto-rerun finished.
|
||||
$status = 0;
|
||||
foreach ($exitcodes as $name => $exitcode) {
|
||||
if ($exitcode) {
|
||||
if (!empty($parallelrun)) {
|
||||
|
||||
@@ -57,7 +57,8 @@ Feature: Set up contextual data for tests
|
||||
| Grouping 1 | C1 | GG1 |
|
||||
| Grouping 2 | C1 | GG2 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then I should see "Group 1"
|
||||
And I should see "Group 2"
|
||||
@@ -86,7 +87,8 @@ Feature: Set up contextual data for tests
|
||||
| mod/forum:editanypost | Allow | student | Course | C1 |
|
||||
| mod/forum:replynews | Prevent | editingteacher | Course | C1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I set the field "Advanced role override" to "Student (1)"
|
||||
Then "mod/forum:editanypost" capability has "Allow" permission
|
||||
@@ -106,7 +108,7 @@ Feature: Set up contextual data for tests
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
Then I should see "Topic 1"
|
||||
|
||||
Scenario: Add role assigns
|
||||
@@ -142,20 +144,24 @@ Feature: Set up contextual data for tests
|
||||
Then "Edit settings" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user3"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user4"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user5"
|
||||
And I should see "You are logged in as"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "You can not enrol yourself in this course."
|
||||
|
||||
Scenario: Add modules
|
||||
@@ -193,7 +199,8 @@ Feature: Set up contextual data for tests
|
||||
| activity | name | intro | course | idnumber | grade |
|
||||
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
Then I should see "Test assignment name"
|
||||
# Assignment 2.2 module type is disabled by default
|
||||
# And I should see "Test assignment22 name"
|
||||
@@ -254,7 +261,8 @@ Feature: Set up contextual data for tests
|
||||
| grouping | group |
|
||||
| GG1 | G1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then the "groups" select box should contain "Group 1 (1)"
|
||||
And the "groups" select box should contain "Group 2 (1)"
|
||||
@@ -313,7 +321,7 @@ Feature: Set up contextual data for tests
|
||||
| Grade sub category 2 | C1 | Grade category 1 |
|
||||
When I log in as "admin"
|
||||
And I am on course index
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
Then I should see "Grade category 1"
|
||||
And I should see "Grade sub category 2"
|
||||
@@ -336,7 +344,8 @@ Feature: Set up contextual data for tests
|
||||
| Test Grade Item 2 | C1 | Grade category 1 |
|
||||
| Test Grade Item 3 | C1 | Grade sub category 2 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Grade Item 1"
|
||||
And I follow "Edit Test Grade Item 1"
|
||||
@@ -364,7 +373,8 @@ Feature: Set up contextual data for tests
|
||||
| name | scale |
|
||||
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
Then I should see "Test Scale 1"
|
||||
And I should see "Disappointing, Good, Very good, Excellent"
|
||||
@@ -385,7 +395,8 @@ Feature: Set up contextual data for tests
|
||||
And the following config values are set as admin:
|
||||
| enableoutcomes | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I follow "Outcomes"
|
||||
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
|
||||
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
|
||||
@@ -413,7 +424,8 @@ Feature: Set up contextual data for tests
|
||||
And the following config values are set as admin:
|
||||
| enableoutcomes | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Outcome Grade Item 1"
|
||||
And I follow "Edit Test Outcome Grade Item 1"
|
||||
@@ -430,5 +442,6 @@ Feature: Set up contextual data for tests
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| online_users | Course | C1 | course-view-* | site-pre |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
Then I should see "Online users"
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Transform date time string arguments
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
And I follow "Test assignment name"
|
||||
And I should see "##yesterday##l, j F Y##"
|
||||
And I log out
|
||||
|
||||
@@ -31,7 +31,7 @@ Feature: Edit capabilities
|
||||
|
||||
Scenario: Course capabilities overrides
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
@@ -45,7 +45,8 @@ Feature: Edit capabilities
|
||||
|
||||
Scenario: Module capabilities overrides
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | I'm the name |
|
||||
| Description | I'm the introduction |
|
||||
|
||||
@@ -33,7 +33,8 @@ Feature: Verify that all form fields values can be get and set
|
||||
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
|
||||
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Reset" node in "Course administration"
|
||||
# Select (multi-select) - Checking "the select box should contain".
|
||||
And I expand all fieldsets
|
||||
@@ -47,7 +48,9 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the "Unenrol users" select box should not contain "President"
|
||||
And the "Unenrol users" select box should not contain "Baker"
|
||||
And the "Unenrol users" select box should not contain "President, Baker"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I follow "Test this one"
|
||||
And I press "Create page"
|
||||
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
|
||||
@@ -58,51 +61,30 @@ Feature: Verify that all form fields values can be get and set
|
||||
# Select (multi-select) - Checking "I set the field".
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
|
||||
And I set the field "Force format" to "1"
|
||||
# Checkbox - Checking "I set the field".
|
||||
And I set the field "Display description on course page" to "1"
|
||||
# Checkbox - Checking "I set the following fields to these values:".
|
||||
And I set the following fields to these values:
|
||||
| Force format | 1 |
|
||||
# Checkbox - Checking "the field matches value" and "the field does not match value".
|
||||
And the field "Display description on course page" matches value "1"
|
||||
And the field "Display description on course page" does not match value ""
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
# Checkbox - Checking "the field matches value" and "the following fields match these values".
|
||||
And the following fields match these values:
|
||||
| Display description on course page | 1 |
|
||||
| Default format | HTML |
|
||||
| Wiki name | Test this one |
|
||||
And the field "Force format" matches value "1"
|
||||
And the field "Force format" does not match value ""
|
||||
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
|
||||
And I set the field "Force format" to ""
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the field "Force format" matches value ""
|
||||
And the field "Force format" does not match value "1"
|
||||
# Checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
|
||||
And I set the following fields to these values:
|
||||
| Force format | 1 |
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the following fields match these values:
|
||||
| Force format | 1 |
|
||||
And the following fields do not match these values:
|
||||
| Force format | |
|
||||
# Checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" unticked.
|
||||
And I set the following fields to these values:
|
||||
| Force format | |
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the following fields match these values:
|
||||
| Force format | |
|
||||
And the following fields do not match these values:
|
||||
| Force format | 1 |
|
||||
# Select (simple) - Checking "I set the following fields to these values:".
|
||||
And I set the following fields to these values:
|
||||
| Default format | NWiki |
|
||||
| Display description on course page | |
|
||||
# Checkbox - Checking "I set the field" to uncheck.
|
||||
And I set the field "Force format" to ""
|
||||
# Select (simple) - Checking "I set the field".
|
||||
And I set the field "Group mode" to "Separate groups"
|
||||
And I press "Save and display"
|
||||
@@ -110,12 +92,15 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the following fields match these values:
|
||||
| Default format | NWiki |
|
||||
| Group mode | Separate groups |
|
||||
| Display description on course page | |
|
||||
| Force format | |
|
||||
# All fields - Checking "the following fields do not match these values".
|
||||
And the following fields do not match these values:
|
||||
| Wiki name | Test this one baby |
|
||||
| Default format | HTML |
|
||||
| Force format | 1 |
|
||||
And I press "Cancel"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
# Radio - Checking "I set the field" and "the field matches value".
|
||||
And I add a "Choice" to section "1" and I fill the form with:
|
||||
| Choice name | Test choice name |
|
||||
@@ -130,7 +115,8 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the field "one" matches value "1"
|
||||
And the field "two" matches value ""
|
||||
# Check if field xpath set/match works.
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
|
||||
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
|
||||
@@ -139,11 +125,12 @@ Feature: Verify that all form fields values can be get and set
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And the field "Course ID number" matches value "Course id number"
|
||||
|
||||
|
||||
Scenario: with JS disabled all form fields getters and setters works as expected
|
||||
|
||||
@javascript
|
||||
Scenario: with JS enabled all form fields getters and setters works as expected
|
||||
Then I am on "Course 1" course homepage
|
||||
Then I follow "Course 1"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
|
||||
And I set the field "groups" to "Group 2"
|
||||
@@ -155,7 +142,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the "members" select box should contain "Student 2"
|
||||
And the "members" select box should not contain "Student 3"
|
||||
# Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values".
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Course 1"
|
||||
And I add a "Lesson" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test lesson |
|
||||
@@ -172,45 +159,3 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the "available[day]" "field" should be enabled
|
||||
And the field "deadline[enabled]" matches value "1"
|
||||
And I press "Cancel"
|
||||
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
|
||||
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the field "Display description on course page" to "1"
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the field "Display description on course page" matches value "1"
|
||||
And the field "Display description on course page" does not match value ""
|
||||
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
|
||||
And I set the field "Display description on course page" to ""
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the field "Display description on course page" matches value ""
|
||||
And the field "Display description on course page" does not match value "1"
|
||||
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
|
||||
And I set the following fields to these values:
|
||||
| Display description on course page | 1 |
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the following fields match these values:
|
||||
| Display description on course page | 1 |
|
||||
And the following fields do not match these values:
|
||||
| Display description on course page | |
|
||||
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" unticked.
|
||||
And I set the following fields to these values:
|
||||
| Display description on course page | |
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the following fields match these values:
|
||||
| Display description on course page | |
|
||||
And the following fields do not match these values:
|
||||
| Display description on course page | 1 |
|
||||
|
||||
@@ -26,3 +26,4 @@ Feature: List the system steps definitions
|
||||
Given I set the field "Contains" to "homepage"
|
||||
When I press "Filter"
|
||||
Then I should see "Opens Moodle homepage."
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@ Feature: Forms manipulation
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Quiz" to section "1"
|
||||
When I expand all fieldsets
|
||||
Then I should see "Close the quiz"
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version
|
||||
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -149,13 +149,13 @@ class api {
|
||||
// We build an better structure to loop on.
|
||||
$info = array();
|
||||
foreach ($all as $cra) {
|
||||
if (!isset($info[$cra->get('userid')])) {
|
||||
$info[$cra->get('userid')] = array();
|
||||
if (!isset($info[$cra->get_userid()])) {
|
||||
$info[$cra->get_userid()] = array();
|
||||
}
|
||||
if (!isset($info[$cra->get('userid')][$cra->get('roleid')])) {
|
||||
$info[$cra->get('userid')][$cra->get('roleid')] = array();
|
||||
if (!isset($info[$cra->get_userid()][$cra->get_roleid()])) {
|
||||
$info[$cra->get_userid()][$cra->get_roleid()] = array();
|
||||
}
|
||||
array_push($info[$cra->get('userid')][$cra->get('roleid')], $cra->get('cohortid'));
|
||||
array_push($info[$cra->get_userid()][$cra->get_roleid()], $cra->get_cohortid());
|
||||
}
|
||||
// Then for each user+role combo - find user context in the cohort without a role assigned.
|
||||
|
||||
|
||||
@@ -96,10 +96,10 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
|
||||
'cohortid' => $this->cohort->id
|
||||
);
|
||||
$result = api::create_cohort_role_assignment($params);
|
||||
$this->assertNotEmpty($result->get('id'));
|
||||
$this->assertEquals($result->get('userid'), $this->userassignto->id);
|
||||
$this->assertEquals($result->get('roleid'), $this->roleid);
|
||||
$this->assertEquals($result->get('cohortid'), $this->cohort->id);
|
||||
$this->assertNotEmpty($result->get_id());
|
||||
$this->assertEquals($result->get_userid(), $this->userassignto->id);
|
||||
$this->assertEquals($result->get_roleid(), $this->roleid);
|
||||
$this->assertEquals($result->get_cohortid(), $this->cohort->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
|
||||
);
|
||||
$result = api::create_cohort_role_assignment($params);
|
||||
$this->setUser($this->userassignto);
|
||||
api::delete_cohort_role_assignment($result->get('id'));
|
||||
api::delete_cohort_role_assignment($result->get_id());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
|
||||
'cohortid' => $this->cohort->id
|
||||
);
|
||||
$result = api::create_cohort_role_assignment($params);
|
||||
api::delete_cohort_role_assignment($result->get('id') + 1);
|
||||
api::delete_cohort_role_assignment($result->get_id() + 1);
|
||||
}
|
||||
|
||||
public function test_delete_cohort_role_assignment() {
|
||||
@@ -139,7 +139,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
|
||||
'cohortid' => $this->cohort->id
|
||||
);
|
||||
$result = api::create_cohort_role_assignment($params);
|
||||
$worked = api::delete_cohort_role_assignment($result->get('id'));
|
||||
$worked = api::delete_cohort_role_assignment($result->get_id());
|
||||
$this->assertTrue($worked);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
$plugin->dependencies = array(
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -97,7 +97,7 @@ class utils {
|
||||
if ($handle = @opendir($path)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$matches = array();
|
||||
if (preg_match('~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:svg|gif|png)$~',
|
||||
if (preg_match('~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:gif|png)$~',
|
||||
$file, $matches)) {
|
||||
$key = $matches[1];
|
||||
$icons[$key] = $key;
|
||||
|
||||
@@ -116,7 +116,7 @@ class tool_filetypes_renderer extends plugin_renderer_base {
|
||||
$editurl = new \moodle_url('/admin/tool/filetypes/edit.php',
|
||||
array('oldextension' => $extension));
|
||||
$editbutton = html_writer::link($editurl, $this->pix_icon('t/edit',
|
||||
get_string('edita', 'moodle', s($extension))));
|
||||
get_string('edita', '', s($extension))));
|
||||
$deleteurl = new \moodle_url('/admin/tool/filetypes/delete.php',
|
||||
array('extension' => $extension));
|
||||
$deletebutton = html_writer::link($deleteurl, $this->pix_icon('t/delete',
|
||||
|
||||
@@ -21,6 +21,7 @@ Feature: Add customised file types
|
||||
Then I should see "Froggy file" in the "application/x-frog" "table_row"
|
||||
And I should see "document" in the "application/x-frog" "table_row"
|
||||
And I should see "frog" in the "application/x-frog" "table_row"
|
||||
And "//img[contains(@src, 'archive')]" "xpath_element" should exist in the "application/x-frog" "table_row"
|
||||
|
||||
Scenario: Update an existing file type
|
||||
Given I log in as "admin"
|
||||
@@ -98,11 +99,11 @@ Feature: Add customised file types
|
||||
And I navigate to "File types" node in "Site administration > Server"
|
||||
And I click on "Edit 7z" "link"
|
||||
And I set the following fields to these values:
|
||||
| Type groups | document |
|
||||
| File icon | document |
|
||||
And I press "Save changes"
|
||||
And I follow "Restore 7z to Moodle defaults"
|
||||
When I follow "Restore 7z to Moodle defaults"
|
||||
And I press "Yes"
|
||||
Then "//*[contains(text(), 'archive')]" "xpath_element" should exist in the "7z" "table_row"
|
||||
Then "//img[contains(@src, 'archive')]" "xpath_element" should exist in the "7z" "table_row"
|
||||
|
||||
@javascript @_file_upload
|
||||
Scenario: Create a resource activity which contains a customised file type
|
||||
@@ -120,7 +121,9 @@ Feature: Add customised file types
|
||||
| Custom description | Froggy file |
|
||||
And I press "Save changes"
|
||||
# Create a resource activity and add it to a course
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
When I add a "File" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | An example of customised file type |
|
||||
@@ -130,3 +133,4 @@ Feature: Add customised file types
|
||||
And I set the field "Show type" to "1"
|
||||
And I press "Save and return to course"
|
||||
Then I should see "Froggy file"
|
||||
And the "src" attribute of ".modtype_resource a img" "css_element" should contain "archive"
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->component = 'tool_filetypes';
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->component = 'tool_generator';
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version
|
||||
$plugin->component = 'tool_health'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version
|
||||
$plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->component = 'tool_installaddon';
|
||||
$plugin->version = 2017051500;
|
||||
$plugin->requires = 2017050500;
|
||||
$plugin->version = 2016120500;
|
||||
$plugin->requires = 2016112900;
|
||||
$plugin->maturity = MATURITY_STABLE;
|
||||
|
||||
@@ -208,17 +208,6 @@ class controller {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL where a given language pack can be downloaded
|
||||
*
|
||||
* Alternatively, if the parameter is empty, returns URL of the page with the
|
||||
* list of all available language packs.
|
||||
*
|
||||
* @param string $langcode language code like 'cs' or empty for unknown
|
||||
* @return string URL
|
||||
*/
|
||||
public function lang_pack_url($langcode = '') {
|
||||
return $this->installer->lang_pack_url($langcode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Language import page.
|
||||
*
|
||||
* @package tool_langimport
|
||||
* @copyright 2016 Jun Pataleta
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tool_langimport\output;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use moodle_url;
|
||||
use renderable;
|
||||
use renderer_base;
|
||||
use stdClass;
|
||||
use templatable;
|
||||
|
||||
/**
|
||||
* Language import page class.
|
||||
*
|
||||
* @package tool_langimport
|
||||
* @copyright 2016 Jun Pataleta
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class langimport_page implements renderable, templatable {
|
||||
|
||||
/** @var array Array of currently installed languages. */
|
||||
protected $installedlanguages;
|
||||
|
||||
/** @var array Array of languages that can be installed. */
|
||||
protected $availablelanguages;
|
||||
|
||||
/** @var moodle_url The URL to be used for uninstalling the selected existing language packs. */
|
||||
protected $uninstallurl;
|
||||
|
||||
/** @var moodle_url The URL to be used for updating the installed language packs. */
|
||||
protected $updateurl;
|
||||
|
||||
/** @var moodle_url The URL to be used for installing the selected language packs to be installed. */
|
||||
protected $installurl;
|
||||
|
||||
|
||||
/**
|
||||
* langimport_page constructor.
|
||||
*
|
||||
* @param array $installedlanguages Array of currently installed languages.
|
||||
* @param array $availablelanguages Array of languages that can be installed.
|
||||
* @param moodle_url $uninstallurl The URL to be used for uninstalling the selected existing language packs.
|
||||
* @param moodle_url $updateurl The URL to be used for updating the installed language packs.
|
||||
* @param moodle_url $installurl The URL to be used for installing the selected language packs to be installed.
|
||||
*/
|
||||
public function __construct($installedlanguages, $availablelanguages, $uninstallurl, $updateurl, $installurl) {
|
||||
$this->installedlanguages = $installedlanguages;
|
||||
$this->availablelanguages = $availablelanguages;
|
||||
$this->uninstallurl = $uninstallurl;
|
||||
$this->updateurl = $updateurl;
|
||||
$this->installurl = $installurl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the data.
|
||||
*
|
||||
* @param renderer_base $output
|
||||
* @return stdClass
|
||||
*/
|
||||
public function export_for_template(renderer_base $output) {
|
||||
$data = new stdClass();
|
||||
$data->uninstallurl = $this->uninstallurl;
|
||||
$data->sesskey = sesskey();
|
||||
|
||||
$data->installedoptions = [];
|
||||
foreach ($this->installedlanguages as $code => $language) {
|
||||
$option = new stdClass();
|
||||
$option->value = $code;
|
||||
$option->text = $language;
|
||||
$data->installedoptions[] = $option;
|
||||
}
|
||||
|
||||
$data->updateurl = $this->updateurl;
|
||||
|
||||
if (!empty($this->availablelanguages)) {
|
||||
$data->toinstalloptions = [];
|
||||
foreach ($this->availablelanguages as $code => $language) {
|
||||
$option = new stdClass();
|
||||
$option->value = $code;
|
||||
$option->text = $language;
|
||||
$data->toinstalloptions[] = $option;
|
||||
}
|
||||
$data->installurl = $this->installurl;
|
||||
$data->caninstall = true;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Renderers.
|
||||
*
|
||||
* @package tool_langimport
|
||||
* @copyright 2016 Jun Pataleta
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tool_langimport\output;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use plugin_renderer_base;
|
||||
|
||||
/**
|
||||
* Renderer class.
|
||||
*
|
||||
* @package tool_langimport
|
||||
* @copyright 2016 Jun Pataleta
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Defer to template.
|
||||
*
|
||||
* @param langimport_page $page
|
||||
* @return string
|
||||
*/
|
||||
public function render_langimport_page(langimport_page $page) {
|
||||
$data = $page->export_for_template($this);
|
||||
return parent::render_from_template('tool_langimport/langimport', $data);
|
||||
}
|
||||
}
|
||||
@@ -124,22 +124,19 @@ if ($availablelangs = $controller->availablelangs) {
|
||||
} else {
|
||||
$remote = false;
|
||||
$availablelangs = array();
|
||||
$a = [
|
||||
'src' => $controller->lang_pack_url(),
|
||||
'dest' => $CFG->dataroot.'/lang/',
|
||||
];
|
||||
$errormessage = get_string('downloadnotavailable', 'tool_langimport', $a);
|
||||
\core\notification::error($errormessage);
|
||||
echo $OUTPUT->box_start();
|
||||
print_string('remotelangnotavailable', 'tool_langimport', $CFG->dataroot.'/lang/');
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
if ($controller->info) {
|
||||
$info = implode('<br />', $controller->info);
|
||||
\core\notification::success($info);
|
||||
echo $OUTPUT->notification($info, 'notifysuccess');
|
||||
}
|
||||
|
||||
if ($controller->errors) {
|
||||
$info = implode('<br />', $controller->errors);
|
||||
\core\notification::error($info);
|
||||
echo $OUTPUT->notification($info, 'notifyproblem');
|
||||
}
|
||||
|
||||
if ($missingparents) {
|
||||
@@ -154,29 +151,67 @@ if ($missingparents) {
|
||||
}
|
||||
}
|
||||
$info = get_string('missinglangparent', 'tool_langimport', $a);
|
||||
\core\notification::error($info);
|
||||
echo $OUTPUT->notification($info, 'notifyproblem');
|
||||
}
|
||||
}
|
||||
|
||||
$uninstallurl = new moodle_url('/admin/tool/langimport/index.php', array('mode' => DELETION_OF_SELECTED_LANG));
|
||||
$updateurl = null;
|
||||
if ($remote) {
|
||||
$updateurl = new moodle_url('/admin/tool/langimport/index.php', array('mode' => UPDATE_ALL_LANG));
|
||||
}
|
||||
$installurl = new moodle_url('/admin/tool/langimport/index.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
|
||||
echo $OUTPUT->box_start();
|
||||
|
||||
// List of available languages.
|
||||
echo html_writer::start_tag('table');
|
||||
echo html_writer::start_tag('tr');
|
||||
|
||||
// list of installed languages
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => DELETION_OF_SELECTED_LANG));
|
||||
echo html_writer::start_tag('td', array('valign' => 'top'));
|
||||
echo html_writer::start_tag('form', array('id' => 'uninstallform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::label(get_string('installedlangs', 'tool_langimport'), 'menuuninstalllang');
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::select($installedlangs, 'uninstalllang[]', '', false, array('size' => 15, 'multiple' => 'multiple'));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::empty_tag('input', array('id' => 'languninstallbutton',
|
||||
'type' => 'submit',
|
||||
'value' => get_string('uninstall', 'tool_langimport'))
|
||||
);
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
if ($remote) {
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => UPDATE_ALL_LANG));
|
||||
echo html_writer::start_tag('form', array('id' => 'updateform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::tag('fieldset', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('updatelangs','tool_langimport'))));
|
||||
echo html_writer::end_tag('form');
|
||||
}
|
||||
echo html_writer::end_tag('td');
|
||||
|
||||
// list of available languages
|
||||
$options = array();
|
||||
foreach ($availablelangs as $alang) {
|
||||
if (!empty($alang[0]) and trim($alang[0]) !== 'en' and !$controller->is_installed_lang($alang[0], $alang[1])) {
|
||||
$options[$alang[0]] = $alang[2].' ‎('.$alang[0].')‎';
|
||||
}
|
||||
}
|
||||
if (!empty($options)) {
|
||||
echo html_writer::start_tag('td', array('valign' => 'top'));
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
|
||||
echo html_writer::start_tag('form', array('id' => 'installform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::label(get_string('availablelangs','install'), 'menupack');
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::select($options, 'pack[]', '', false, array('size' => 15, 'multiple' => 'multiple'));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('install','tool_langimport')));
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
echo html_writer::end_tag('td');
|
||||
}
|
||||
|
||||
$renderable = new \tool_langimport\output\langimport_page($installedlangs, $options, $uninstallurl, $updateurl, $installurl);
|
||||
$output = $PAGE->get_renderer('tool_langimport');
|
||||
echo $output->render($renderable);
|
||||
echo html_writer::end_tag('tr');
|
||||
echo html_writer::end_tag('table');
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
$uninstallurl = new moodle_url('/admin/tool/langimport/index.php');
|
||||
$PAGE->requires->strings_for_js(array('uninstallconfirm', 'uninstall', 'selectlangs', 'noenglishuninstall'),
|
||||
'tool_langimport');
|
||||
$PAGE->requires->yui_module('moodle-core-languninstallconfirm',
|
||||
@@ -184,3 +219,4 @@ $PAGE->requires->yui_module('moodle-core-languninstallconfirm',
|
||||
array(array('uninstallUrl' => $uninstallurl->out()))
|
||||
);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['downloadnotavailable'] = 'Unable to connect to the download server. It is not possible to install or update the language packs automatically. Please download the appropriate ZIP file(s) from <a href="{$a->src}">{$a->src}</a> and unzip them manually to your data directory <code>{$a->dest}</code>';
|
||||
$string['install'] = 'Install selected language pack(s)';
|
||||
$string['installedlangs'] = 'Installed language packs';
|
||||
$string['langimport'] = 'Language import utility';
|
||||
@@ -44,6 +43,7 @@ $string['noenglishuninstall'] = 'The English language pack cannot be uninstalled
|
||||
$string['nolangupdateneeded'] = 'All your language packs are up to date, no update is needed';
|
||||
$string['pluginname'] = 'Language packs';
|
||||
$string['purgestringcaches'] = 'Purge string caches';
|
||||
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="https://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
|
||||
$string['selectlangs'] = 'Select languages to uninstall';
|
||||
$string['uninstall'] = 'Uninstall selected language pack(s)';
|
||||
$string['uninstallconfirm'] = 'You are about to completely uninstall these language packs: <strong>{$a}</strong>. Are you sure?';
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#page-admin-tool-langimport-index .langimport {
|
||||
#page-admin-tool-langimport-index .generalbox table {
|
||||
margin: auto;
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#page-admin-tool-langimport-index .generalbox,
|
||||
#page-admin-tool-langimport-index .generalbox table {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template tool_langimport/langimport
|
||||
|
||||
Template for the language import page.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Data attributes required for JS:
|
||||
* none
|
||||
|
||||
Context variables required for this template:
|
||||
* sesskey string The session key.
|
||||
* uninstallurl string The URL for the uninstall action.
|
||||
* updateurl string The URL for the update-language-packs action.
|
||||
* installurl string The URL for the install action.
|
||||
* installedoptions array The list of languages installed.
|
||||
* toinstalloptions array The list of languages to be installed.
|
||||
* caninstall boolean Flag to indicate if there are language packs that can be installed.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"sesskey": "sesskey",
|
||||
"uninstallurl": "#",
|
||||
"updateurl": "#",
|
||||
"installurl": "#",
|
||||
"installedoptions": [
|
||||
{
|
||||
"value": "en",
|
||||
"text": "English",
|
||||
"selected": true
|
||||
}
|
||||
],
|
||||
"toinstalloptions": [
|
||||
{
|
||||
"value": "ja",
|
||||
"text": "Japanese"
|
||||
},
|
||||
{
|
||||
"value": "fr",
|
||||
"text": "French"
|
||||
},
|
||||
{
|
||||
"value": "es",
|
||||
"text": "Spanish"
|
||||
}
|
||||
],
|
||||
"caninstall": true
|
||||
}
|
||||
}}
|
||||
<div class="container-fluid langimport">
|
||||
<div class="row row-fluid rtl-compatible">
|
||||
<div class="col-md-{{#caninstall}}6{{/caninstall}}{{^caninstall}}12{{/caninstall}} span{{#caninstall}}6{{/caninstall}}{{^caninstall}}12{{/caninstall}} m-b-1">
|
||||
<form id="uninstallform" action="{{uninstallurl}}" method="post">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="menuuninstalllang">{{#str}}installedlangs, tool_langimport{{/str}}</label>
|
||||
<select size="15" multiple="multiple" id="menuuninstalllang" class="form-control input-block-level" name="uninstalllang[]">
|
||||
{{#installedoptions}}
|
||||
<option value="{{value}}" {{#selected}}selected="selected"{{/selected}}>{{{text}}}</option>
|
||||
{{/installedoptions}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="sesskey" value="{{sesskey}}">
|
||||
<input id="languninstallbutton" type="submit" value="{{#str}}uninstall, tool_langimport{{/str}}" class="btn btn-default">
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{{#updateurl}}
|
||||
<div>
|
||||
<form id="updateform" action="{{updateurl}}" method="post">
|
||||
<fieldset>
|
||||
<input type="submit" value="{{#str}}updatelangs, tool_langimport{{/str}}" class="btn btn-default">
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{{/updateurl}}
|
||||
</div>
|
||||
{{#caninstall}}
|
||||
<div class="col-md-6 span6 m-b-1">
|
||||
<form id="installform" action="{{installurl}}" method="post">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="menupack">{{#str}}availablelangs, install{{/str}}</label>
|
||||
<select size="15" multiple="multiple" class="form-control input-block-level" id="menupack" name="pack[]">
|
||||
{{#toinstalloptions}}
|
||||
<option value="{{value}}" {{#selected}}selected="selected"{{/selected}}>{{{text}}}</option>
|
||||
{{/toinstalloptions}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="sesskey" value="{{sesskey}}">
|
||||
<input type="submit" value="{{#str}}install, tool_langimport{{/str}}" class="btn btn-default">
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{{/caninstall}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,7 @@ Feature: Manage language packs
|
||||
As an administrator
|
||||
I need to be able to add, update and remove language packs
|
||||
|
||||
|
||||
Background:
|
||||
Given remote langimport tests are enabled
|
||||
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version
|
||||
$plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -169,14 +169,14 @@ class tool_log_setting_managestores extends admin_setting {
|
||||
if (isset($enabled[$store])) {
|
||||
$aurl = new moodle_url($url, array('action' => 'disable', 'store' => $store));
|
||||
$hideshow = "<a href=\"$aurl\">";
|
||||
$hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . '</a>';
|
||||
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>";
|
||||
$isenabled = true;
|
||||
$displayname = "<span>$name</span>";
|
||||
} else {
|
||||
if (isset($available[$store])) {
|
||||
$aurl = new moodle_url($url, array('action' => 'enable', 'store' => $store));
|
||||
$hideshow = "<a href=\"$aurl\">";
|
||||
$hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . '</a>';
|
||||
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>";
|
||||
$isenabled = false;
|
||||
$displayname = "<span class=\"dimmed_text\">$name</span>";
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ class tool_log_setting_managestores extends admin_setting {
|
||||
if ($PAGE->theme->resolve_image_location('icon', $store, false)) {
|
||||
$icon = $OUTPUT->pix_icon('icon', '', $store, array('class' => 'icon pluginicon'));
|
||||
} else {
|
||||
$icon = $OUTPUT->spacer();
|
||||
$icon = $OUTPUT->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
|
||||
}
|
||||
|
||||
// Up/down link (only if store is enabled).
|
||||
@@ -197,16 +197,16 @@ class tool_log_setting_managestores extends admin_setting {
|
||||
if ($updowncount > 1) {
|
||||
$aurl = new moodle_url($url, array('action' => 'up', 'store' => $store));
|
||||
$updown .= "<a href=\"$aurl\">";
|
||||
$updown .= $OUTPUT->pix_icon('t/up', $strup) . '</a> ';
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"$strup\" class=\"iconsmall\" /></a> ";
|
||||
} else {
|
||||
$updown .= $OUTPUT->spacer();
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" /> ";
|
||||
}
|
||||
if ($updowncount < $storecount) {
|
||||
$aurl = new moodle_url($url, array('action' => 'down', 'store' => $store));
|
||||
$updown .= "<a href=\"$aurl\">";
|
||||
$updown .= $OUTPUT->pix_icon('t/down', $strdown) . '</a> ';
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"$strdown\" class=\"iconsmall\" /></a>";
|
||||
} else {
|
||||
$updown .= $OUTPUT->spacer();
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />";
|
||||
}
|
||||
++$updowncount;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'logstore_database'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017051500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017050500; // Requires this Moodle version.
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_log'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -65,7 +65,7 @@ class tool_lp_course_competencies_form_element extends MoodleQuickForm_autocompl
|
||||
$current = \core_competency\api::list_course_module_competencies_in_course_module($options['cmid']);
|
||||
$ids = array();
|
||||
foreach ($current as $coursemodulecompetency) {
|
||||
array_push($ids, $coursemodulecompetency->get('competencyid'));
|
||||
array_push($ids, $coursemodulecompetency->get_competencyid());
|
||||
}
|
||||
$this->setValue($ids);
|
||||
}
|
||||
@@ -76,10 +76,10 @@ class tool_lp_course_competencies_form_element extends MoodleQuickForm_autocompl
|
||||
$context = context_course::instance($courseid);
|
||||
foreach ($competencies as $competency) {
|
||||
// We don't need to show the description as part of the options, so just set this to null.
|
||||
$competency['competency']->set('description', null);
|
||||
$competency['competency']->set_description(null);
|
||||
$exporter = new competency_exporter($competency['competency'], array('context' => $context));
|
||||
$templatecontext = array('competency' => $exporter->export($OUTPUT));
|
||||
$id = $competency['competency']->get('id');
|
||||
$id = $competency['competency']->get_id();
|
||||
$validoptions[$id] = $OUTPUT->render_from_template('tool_lp/competency_summary', $templatecontext);
|
||||
}
|
||||
$attributes['tags'] = false;
|
||||
|
||||
@@ -65,7 +65,7 @@ class tool_lp_course_competency_rule_form_element extends MoodleQuickForm_select
|
||||
// forcing them to be all the same for each activity.
|
||||
if (!empty($current)) {
|
||||
$one = array_pop($current);
|
||||
$this->setValue($one->get('ruleoutcome'));
|
||||
$this->setValue($one->get_ruleoutcome());
|
||||
}
|
||||
}
|
||||
$validoptions = course_module_competency::get_ruleoutcome_list();
|
||||
|
||||
@@ -42,12 +42,12 @@ use external_multiple_structure;
|
||||
use invalid_parameter_exception;
|
||||
use required_capability_exception;
|
||||
|
||||
use core_cohort\external\cohort_summary_exporter;
|
||||
use tool_lp\external\cohort_summary_exporter;
|
||||
use tool_lp\external\competency_path_exporter;
|
||||
use tool_lp\external\competency_summary_exporter;
|
||||
use tool_lp\external\course_competency_statistics_exporter;
|
||||
use core_course\external\course_module_summary_exporter;
|
||||
use core_course\external\course_summary_exporter;
|
||||
use tool_lp\external\course_module_summary_exporter;
|
||||
use tool_lp\external\course_summary_exporter;
|
||||
use tool_lp\external\template_statistics_exporter;
|
||||
use tool_lp\external\user_competency_summary_exporter;
|
||||
use tool_lp\external\user_competency_summary_in_course_exporter;
|
||||
@@ -66,7 +66,7 @@ use core_competency\external\template_exporter;
|
||||
use core_competency\external\user_competency_course_exporter;
|
||||
use core_competency\external\user_competency_exporter;
|
||||
use core_competency\external\user_competency_plan_exporter;
|
||||
use core_user\external\user_summary_exporter;
|
||||
use core_competency\external\user_summary_exporter;
|
||||
|
||||
/**
|
||||
* This is the external API for this tool.
|
||||
|
||||
+5
-5
@@ -17,14 +17,15 @@
|
||||
/**
|
||||
* Class for exporting a cohort summary from an stdClass.
|
||||
*
|
||||
* @package core_cohort
|
||||
* @package tool_lp
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace core_cohort\external;
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use renderer_base;
|
||||
use moodle_url;
|
||||
|
||||
/**
|
||||
* Class for exporting a cohort summary from an stdClass.
|
||||
@@ -32,7 +33,7 @@ use renderer_base;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class cohort_summary_exporter extends \core\external\exporter {
|
||||
class cohort_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// Cohorts can exist on a category context.
|
||||
@@ -61,8 +62,7 @@ class cohort_summary_exporter extends \core\external\exporter {
|
||||
public static function define_other_properties() {
|
||||
return array(
|
||||
'contextname' => array(
|
||||
// The method context::get_context_name() already formats the string, and may return HTML.
|
||||
'type' => PARAM_RAW
|
||||
'type' => PARAM_TEXT
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ use moodle_url;
|
||||
* @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class competency_path_exporter extends \core\external\exporter {
|
||||
class competency_path_exporter extends \core_competency\external\exporter {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -72,7 +72,7 @@ class competency_path_exporter extends \core\external\exporter {
|
||||
'type' => path_node_exporter::read_properties_definition()
|
||||
],
|
||||
'pluginbaseurl' => [
|
||||
'type' => PARAM_URL
|
||||
'type' => PARAM_TEXT
|
||||
],
|
||||
'pagecontextid' => [
|
||||
'type' => PARAM_INT
|
||||
@@ -93,8 +93,8 @@ class competency_path_exporter extends \core\external\exporter {
|
||||
$i = 1;
|
||||
foreach ($this->related['ancestors'] as $competency) {
|
||||
$exporter = new path_node_exporter([
|
||||
'id' => $competency->get('id'),
|
||||
'name' => $competency->get('idnumber'),
|
||||
'id' => $competency->get_id(),
|
||||
'name' => $competency->get_idnumber(),
|
||||
'position' => $i,
|
||||
'first' => $i == 1,
|
||||
'last' => $i == $nodescount
|
||||
@@ -107,8 +107,8 @@ class competency_path_exporter extends \core\external\exporter {
|
||||
}
|
||||
$result->ancestors = $ancestors;
|
||||
$exporter = new path_node_exporter([
|
||||
'id' => $this->related['framework']->get('id'),
|
||||
'name' => $this->related['framework']->get('shortname'),
|
||||
'id' => $this->related['framework']->get_id(),
|
||||
'name' => $this->related['framework']->get_shortname(),
|
||||
'first' => 0,
|
||||
'last' => 0,
|
||||
'position' => -1
|
||||
|
||||
@@ -30,7 +30,6 @@ use stdClass;
|
||||
use core_competency\competency_framework;
|
||||
use core_competency\external\competency_exporter;
|
||||
use core_competency\external\competency_framework_exporter;
|
||||
use core_course\external\course_summary_exporter;
|
||||
|
||||
/**
|
||||
* Class for exporting competency data with additional related data.
|
||||
@@ -38,7 +37,7 @@ use core_course\external\course_summary_exporter;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class competency_summary_exporter extends \core\external\exporter {
|
||||
class competency_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// We cache the context so it does not need to be retrieved from the framework every time.
|
||||
@@ -116,11 +115,11 @@ class competency_summary_exporter extends \core\external\exporter {
|
||||
|
||||
$exporter = new competency_framework_exporter($this->related['framework']);
|
||||
$result->framework = $exporter->export($output);
|
||||
$scaleconfiguration = $this->related['framework']->get('scaleconfiguration');
|
||||
$scaleid = $this->related['framework']->get('scaleid');
|
||||
if ($competency->get('scaleid')) {
|
||||
$scaleconfiguration = $competency->get('scaleconfiguration');
|
||||
$scaleid = $competency->get('scaleid');
|
||||
$scaleconfiguration = $this->related['framework']->get_scaleconfiguration();
|
||||
$scaleid = $this->related['framework']->get_scaleid();
|
||||
if ($competency->get_scaleid()) {
|
||||
$scaleconfiguration = $competency->get_scaleconfiguration();
|
||||
$scaleid = $competency->get_scaleid();
|
||||
}
|
||||
$result->scaleconfiguration = $scaleconfiguration;
|
||||
$result->scaleid = $scaleid;
|
||||
|
||||
@@ -27,7 +27,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
use renderer_base;
|
||||
use moodle_url;
|
||||
use core_competency\external\competency_exporter;
|
||||
use core_competency\external\performance_helper;
|
||||
|
||||
/**
|
||||
* Class for exporting a course competency statistics summary.
|
||||
@@ -35,7 +34,7 @@ use core_competency\external\performance_helper;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class course_competency_statistics_exporter extends \core\external\exporter {
|
||||
class course_competency_statistics_exporter extends \core_competency\external\exporter {
|
||||
|
||||
public static function define_properties() {
|
||||
return array(
|
||||
@@ -85,9 +84,12 @@ class course_competency_statistics_exporter extends \core\external\exporter {
|
||||
$proficientcompetencypercentageformatted = format_float($proficientcompetencypercentage);
|
||||
}
|
||||
$competencies = array();
|
||||
$helper = new performance_helper();
|
||||
$contextcache = array();
|
||||
foreach ($this->data->leastproficientcompetencies as $competency) {
|
||||
$context = $helper->get_context_from_competency($competency);
|
||||
if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
|
||||
$contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
|
||||
}
|
||||
$context = $contextcache[$competency->get_competencyframeworkid()];
|
||||
$exporter = new competency_exporter($competency, array('context' => $context));
|
||||
$competencies[] = $exporter->export($output);
|
||||
}
|
||||
|
||||
+6
-16
@@ -17,22 +17,23 @@
|
||||
/**
|
||||
* Class for exporting a course module summary from an stdClass.
|
||||
*
|
||||
* @package core_course
|
||||
* @package tool_lp
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace core_course\external;
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use renderer_base;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exporting a course module summary from a cm_info class.
|
||||
*
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class course_module_summary_exporter extends \core\external\exporter {
|
||||
class course_module_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
return array('cm' => 'cm_info');
|
||||
@@ -40,10 +41,11 @@ class course_module_summary_exporter extends \core\external\exporter {
|
||||
|
||||
protected function get_other_values(renderer_base $output) {
|
||||
$cm = $this->related['cm'];
|
||||
$context = $cm->context;
|
||||
|
||||
$values = array(
|
||||
'id' => $cm->id,
|
||||
'name' => $cm->name,
|
||||
'name' => external_format_string($cm->name, $context->id),
|
||||
'iconurl' => $cm->get_icon_url()->out()
|
||||
);
|
||||
if ($cm->url) {
|
||||
@@ -52,18 +54,6 @@ class course_module_summary_exporter extends \core\external\exporter {
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the format parameters for name.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_format_parameters_for_name() {
|
||||
$cm = $this->related['cm'];
|
||||
$context = $cm->context;
|
||||
return [
|
||||
'context' => $context,
|
||||
];
|
||||
}
|
||||
|
||||
public static function define_other_properties() {
|
||||
return array(
|
||||
+3
-32
@@ -17,11 +17,11 @@
|
||||
/**
|
||||
* Class for exporting a course summary from an stdClass.
|
||||
*
|
||||
* @package core_course
|
||||
* @package tool_lp
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace core_course\external;
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use renderer_base;
|
||||
@@ -33,7 +33,7 @@ use moodle_url;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class course_summary_exporter extends \core\external\exporter {
|
||||
class course_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// We cache the context so it does not need to be retrieved from the course.
|
||||
@@ -42,7 +42,6 @@ class course_summary_exporter extends \core\external\exporter {
|
||||
|
||||
protected function get_other_values(renderer_base $output) {
|
||||
return array(
|
||||
'fullnamedisplay' => get_course_display_name_for_list($this->data),
|
||||
'viewurl' => (new moodle_url('/course/view.php', array('id' => $this->data->id)))->out(false)
|
||||
);
|
||||
}
|
||||
@@ -60,40 +59,12 @@ class course_summary_exporter extends \core\external\exporter {
|
||||
),
|
||||
'idnumber' => array(
|
||||
'type' => PARAM_RAW,
|
||||
),
|
||||
'summary' => array(
|
||||
'type' => PARAM_RAW,
|
||||
'null' => NULL_ALLOWED
|
||||
),
|
||||
'summaryformat' => array(
|
||||
'type' => PARAM_INT,
|
||||
),
|
||||
'startdate' => array(
|
||||
'type' => PARAM_INT,
|
||||
),
|
||||
'enddate' => array(
|
||||
'type' => PARAM_INT,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatting parameters for the summary.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_format_parameters_for_summary() {
|
||||
return [
|
||||
'component' => 'course',
|
||||
'filearea' => 'summary',
|
||||
];
|
||||
}
|
||||
|
||||
public static function define_other_properties() {
|
||||
return array(
|
||||
'fullnamedisplay' => array(
|
||||
'type' => PARAM_TEXT,
|
||||
),
|
||||
'viewurl' => array(
|
||||
'type' => PARAM_URL,
|
||||
)
|
||||
+1
-30
@@ -24,7 +24,6 @@
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use context_system;
|
||||
|
||||
/**
|
||||
* Class for exporting path_node data.
|
||||
@@ -32,35 +31,7 @@ use context_system;
|
||||
* @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class path_node_exporter extends \core\external\exporter {
|
||||
|
||||
/**
|
||||
* Constructor - saves the persistent object, and the related objects.
|
||||
*
|
||||
* @param mixed $data The data.
|
||||
* @param array $related Array of relateds.
|
||||
*/
|
||||
public function __construct($data, $related = array()) {
|
||||
if (!isset($related['context'])) {
|
||||
// Previous code was automatically using the system context which was not always correct.
|
||||
// We let developers know that they must fix their code without breaking anything,
|
||||
// and fallback on the previous behaviour. This should be removed at a later stage: Moodle 3.5.
|
||||
debugging('Missing related context in path_node_exporter.', DEBUG_DEVELOPER);
|
||||
$related['context'] = context_system::instance();
|
||||
}
|
||||
parent::__construct($data, $related);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of properties.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function define_related() {
|
||||
return [
|
||||
'context' => 'context'
|
||||
];
|
||||
}
|
||||
class path_node_exporter extends \core_competency\external\exporter {
|
||||
|
||||
/**
|
||||
* Return the list of properties.
|
||||
|
||||
@@ -27,7 +27,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
use renderer_base;
|
||||
use moodle_url;
|
||||
use core_competency\external\competency_exporter;
|
||||
use core_competency\external\performance_helper;
|
||||
|
||||
/**
|
||||
* Class for exporting a cohort summary from an stdClass.
|
||||
@@ -35,7 +34,7 @@ use core_competency\external\performance_helper;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class template_statistics_exporter extends \core\external\exporter {
|
||||
class template_statistics_exporter extends \core_competency\external\exporter {
|
||||
|
||||
public static function define_properties() {
|
||||
return array(
|
||||
@@ -119,9 +118,12 @@ class template_statistics_exporter extends \core\external\exporter {
|
||||
$proficientusercompetencyplanpercentageformatted = format_float($proficientusercompetencyplanpercentage);
|
||||
}
|
||||
$competencies = array();
|
||||
$helper = new performance_helper();
|
||||
$contextcache = array();
|
||||
foreach ($this->data->leastproficientcompetencies as $competency) {
|
||||
$context = $helper->get_context_from_competency($competency);
|
||||
if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
|
||||
$contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
|
||||
}
|
||||
$context = $contextcache[$competency->get_competencyframeworkid()];
|
||||
$exporter = new competency_exporter($competency, array('context' => $context));
|
||||
$competencies[] = $exporter->export($output);
|
||||
}
|
||||
|
||||
@@ -22,17 +22,16 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use context_user;
|
||||
use renderer_base;
|
||||
use stdClass;
|
||||
use core_comment\external\comment_area_exporter;
|
||||
use core_competency\external\comment_area_exporter;
|
||||
use core_competency\external\evidence_exporter;
|
||||
use core_competency\external\user_competency_exporter;
|
||||
use core_competency\external\user_competency_plan_exporter;
|
||||
use core_competency\external\user_competency_course_exporter;
|
||||
use core_user\external\user_summary_exporter;
|
||||
use core_competency\external\user_summary_exporter;
|
||||
use core_competency\user_competency;
|
||||
|
||||
/**
|
||||
@@ -41,7 +40,7 @@ use core_competency\user_competency;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_competency_summary_exporter extends \core\external\exporter {
|
||||
class user_competency_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// We cache the context so it does not need to be retrieved from the framework every time.
|
||||
@@ -133,9 +132,9 @@ class user_competency_summary_exporter extends \core\external\exporter {
|
||||
$result->evidence = array();
|
||||
if (count($this->related['evidence'])) {
|
||||
foreach ($this->related['evidence'] as $evidence) {
|
||||
$actionuserid = $evidence->get('actionuserid');
|
||||
$actionuserid = $evidence->get_actionuserid();
|
||||
if (!empty($actionuserid)) {
|
||||
$usercache[$evidence->get('actionuserid')] = true;
|
||||
$usercache[$evidence->get_actionuserid()] = true;
|
||||
}
|
||||
}
|
||||
$users = array();
|
||||
@@ -149,12 +148,11 @@ class user_competency_summary_exporter extends \core\external\exporter {
|
||||
}
|
||||
|
||||
foreach ($this->related['evidence'] as $evidence) {
|
||||
$actionuserid = $evidence->get('actionuserid');
|
||||
$actionuserid = $evidence->get_actionuserid();
|
||||
$related = array(
|
||||
'scale' => $scale,
|
||||
'usercompetency' => ($this->related['usercompetency'] ? $this->related['usercompetency'] : null),
|
||||
'usercompetencyplan' => ($this->related['usercompetencyplan'] ? $this->related['usercompetencyplan'] : null),
|
||||
'context' => $evidence->get_context()
|
||||
);
|
||||
$related['actionuser'] = !empty($actionuserid) ? $usercache[$actionuserid] : null;
|
||||
$exporter = new evidence_exporter($evidence, $related);
|
||||
|
||||
+2
-5
@@ -22,12 +22,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core_competency\api;
|
||||
use core_competency\user_competency;
|
||||
use core_course\external\course_module_summary_exporter;
|
||||
use core_course\external\course_summary_exporter;
|
||||
use context_course;
|
||||
use renderer_base;
|
||||
use stdClass;
|
||||
@@ -38,7 +35,7 @@ use stdClass;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_competency_summary_in_course_exporter extends \core\external\exporter {
|
||||
class user_competency_summary_in_course_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// We cache the context so it does not need to be retrieved from the framework every time.
|
||||
@@ -83,7 +80,7 @@ class user_competency_summary_in_course_exporter extends \core\external\exporter
|
||||
$exporter = new course_summary_exporter($this->related['course'], array('context' => $context));
|
||||
$result->course = $exporter->export($output);
|
||||
|
||||
$coursemodules = api::list_course_modules_using_competency($this->related['competency']->get('id'),
|
||||
$coursemodules = api::list_course_modules_using_competency($this->related['competency']->get_id(),
|
||||
$this->related['course']->id);
|
||||
|
||||
$fastmodinfo = get_fast_modinfo($this->related['course']->id);
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use context_user;
|
||||
use renderer_base;
|
||||
@@ -35,7 +34,7 @@ use core_competency\external\plan_exporter;
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_competency_summary_in_plan_exporter extends \core\external\exporter {
|
||||
class user_competency_summary_in_plan_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
// We cache the context so it does not need to be retrieved from the framework every time.
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tool_lp\external;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use moodle_url;
|
||||
use renderer_base;
|
||||
@@ -35,7 +34,7 @@ use core_competency\external\user_competency_exporter;
|
||||
* @copyright 2016 Serge Gauthier - <serge.gauthier.2@umontreal.ca>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_evidence_competency_summary_exporter extends \core\external\exporter {
|
||||
class user_evidence_competency_summary_exporter extends \core_competency\external\exporter {
|
||||
|
||||
protected static function define_related() {
|
||||
return array('competency' => '\\core_competency\\competency',
|
||||
|
||||
@@ -26,8 +26,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use moodle_url;
|
||||
use renderer_base;
|
||||
use core_files\external\stored_file_exporter;
|
||||
use core_competency\external\performance_helper;
|
||||
use core_competency\external\stored_file_exporter;
|
||||
|
||||
/**
|
||||
* Class for exporting user evidence with all competencies.
|
||||
@@ -35,10 +34,10 @@ use core_competency\external\performance_helper;
|
||||
* @copyright 2016 Serge Gauthier - <serge.gauthier.2@umontreal.ca>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_evidence_summary_exporter extends \core\external\persistent_exporter {
|
||||
class user_evidence_summary_exporter extends \core_competency\external\persistent_exporter {
|
||||
|
||||
protected static function define_class() {
|
||||
return \core_competency\user_evidence::class;
|
||||
return 'core_competency\\user_evidence';
|
||||
}
|
||||
|
||||
protected static function define_other_properties() {
|
||||
@@ -75,7 +74,7 @@ class user_evidence_summary_exporter extends \core\external\persistent_exporter
|
||||
|
||||
protected function get_other_values(renderer_base $output) {
|
||||
$urlshort = '';
|
||||
$url = $this->persistent->get('url');
|
||||
$url = $this->persistent->get_url();
|
||||
if (!empty($url)) {
|
||||
$murl = new moodle_url($url);
|
||||
$shorturl = preg_replace('@^https?://(www\.)?@', '', $murl->out(false));
|
||||
@@ -92,19 +91,32 @@ class user_evidence_summary_exporter extends \core\external\persistent_exporter
|
||||
}
|
||||
|
||||
$userevidencecompetencies = array();
|
||||
$frameworks = array();
|
||||
$scales = array();
|
||||
$usercompetencies = $this->persistent->get_user_competencies();
|
||||
$helper = new performance_helper();
|
||||
foreach ($usercompetencies as $usercompetency) {
|
||||
$competency = $usercompetency->get_competency();
|
||||
|
||||
$context = $helper->get_context_from_competency($competency);
|
||||
$framework = $helper->get_framework_from_competency($competency);
|
||||
$scale = $helper->get_scale_from_competency($competency);
|
||||
// Get the framework.
|
||||
if (!isset($frameworks[$competency->get_competencyframeworkid()])) {
|
||||
$frameworks[$competency->get_competencyframeworkid()] = $competency->get_framework();
|
||||
}
|
||||
$framework = $frameworks[$competency->get_competencyframeworkid()];
|
||||
|
||||
// Get the scale.
|
||||
$scaleid = $competency->get_scaleid();
|
||||
if ($scaleid === null) {
|
||||
$scaleid = $framework->get_scaleid();
|
||||
}
|
||||
if (!isset($scales[$framework->get_scaleid()])) {
|
||||
$scales[$framework->get_scaleid()] = $framework->get_scale();
|
||||
}
|
||||
$scale = $scales[$framework->get_scaleid()];
|
||||
|
||||
$related = array('competency' => $competency,
|
||||
'usercompetency' => $usercompetency,
|
||||
'scale' => $scale,
|
||||
'context' => $context);
|
||||
'context' => $framework->get_context());
|
||||
|
||||
$userevidencecompetencysummaryexporter = new user_evidence_competency_summary_exporter(null, $related);
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use stdClass;
|
||||
use core\form\persistent;
|
||||
|
||||
/**
|
||||
* Competency framework form.
|
||||
@@ -54,29 +53,26 @@ class competency extends persistent {
|
||||
|
||||
$mform->addElement('hidden', 'competencyframeworkid');
|
||||
$mform->setType('competencyframeworkid', PARAM_INT);
|
||||
$mform->setConstant('competencyframeworkid', $framework->get('id'));
|
||||
$mform->setConstant('competencyframeworkid', $framework->get_id());
|
||||
|
||||
$mform->addElement('header', 'generalhdr', get_string('general'));
|
||||
|
||||
$mform->addElement('static',
|
||||
'frameworkdesc',
|
||||
get_string('competencyframework', 'tool_lp'),
|
||||
s($framework->get('shortname')));
|
||||
s($framework->get_shortname()));
|
||||
|
||||
$mform->addElement('hidden', 'parentid', '', array('id' => 'tool_lp_parentcompetency'));
|
||||
|
||||
$mform->setType('parentid', PARAM_INT);
|
||||
$mform->setConstant('parentid', ($parent) ? $parent->get('id') : 0);
|
||||
$mform->setConstant('parentid', ($parent) ? $parent->get_id() : 0);
|
||||
$parentlevel = ($parent) ? $parent->get_level() : 0;
|
||||
$parentname = ($parent) ? $parent->get('shortname') : get_string('competencyframeworkroot', 'tool_lp');
|
||||
$parentlabel = '';
|
||||
if (!empty($competency->get('id'))) {
|
||||
$parentlabel = get_string('taxonomy_parent_' . $framework->get_taxonomy($parentlevel), 'tool_lp');
|
||||
} else {
|
||||
$parentlabel = get_string('parentcompetency', 'tool_lp');
|
||||
}
|
||||
$parentname = ($parent) ? $parent->get_shortname() : get_string('competencyframeworkroot', 'tool_lp');
|
||||
$parentlabel = ($competency->get_id()) ?
|
||||
get_string('taxonomy_parent_' . $framework->get_taxonomy($parentlevel), 'tool_lp') :
|
||||
get_string('parentcompetency', 'tool_lp');
|
||||
$editaction = '';
|
||||
if (!$competency->get('id')) {
|
||||
if (!$competency->get_id()) {
|
||||
$icon = $OUTPUT->pix_icon('t/editinline', get_string('parentcompetency_edit', 'tool_lp'));
|
||||
$editaction = $OUTPUT->action_link('#', $icon, null, array('id' => 'id_parentcompetencybutton'));
|
||||
}
|
||||
@@ -86,12 +82,12 @@ class competency extends persistent {
|
||||
$parentlabel,
|
||||
"<span id='id_parentdesc'>$parentname</span> ".$editaction);
|
||||
// Set the picker competency when adding new competency.
|
||||
if (!$competency->get('id')) {
|
||||
if (!$competency->get_id()) {
|
||||
// Call the parentcompetency_form init to initialize the competency picker for parent competency.
|
||||
$PAGE->requires->js_call_amd('tool_lp/parentcompetency_form', 'init', array('#id_parentcompetencybutton',
|
||||
'#tool_lp_parentcompetency',
|
||||
'#id_parentdesc',
|
||||
$framework->get('id'),
|
||||
$framework->get_id(),
|
||||
$pagecontextid));
|
||||
}
|
||||
|
||||
@@ -127,7 +123,7 @@ class competency extends persistent {
|
||||
// configuration requires this field so we only disable it. It is fine as setting the value
|
||||
// as a constant will ensure that nobody can change it. And it's validated in the persistent anyway.
|
||||
$scaleid->updateAttributes(array('disabled' => 'disabled'));
|
||||
$mform->setConstant('scaleid', $competency->get('scaleid'));
|
||||
$mform->setConstant('scaleid', $competency->get_scaleid());
|
||||
}
|
||||
|
||||
// Disable short forms.
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use stdClass;
|
||||
use core\form\persistent;
|
||||
|
||||
/**
|
||||
* Competency framework form.
|
||||
@@ -80,7 +79,7 @@ class competency_framework extends persistent {
|
||||
// configuration requires this field so we only disable it. It is fine as setting the value
|
||||
// as a constant will ensure that nobody can change it. And it's validated in the persistent anyway.
|
||||
$scaleid->updateAttributes(array('readonly' => 'readonly'));
|
||||
$mform->setConstant('scaleid', $framework->get('scaleid'));
|
||||
$mform->setConstant('scaleid', $framework->get_scaleid());
|
||||
}
|
||||
|
||||
$mform->addElement('button', 'scaleconfigbutton', get_string('configurescale', 'tool_lp'));
|
||||
@@ -149,7 +148,7 @@ class competency_framework extends persistent {
|
||||
*/
|
||||
protected function get_default_data() {
|
||||
$data = parent::get_default_data();
|
||||
$data->taxonomies = $this->get_persistent()->get('taxonomies');
|
||||
$data->taxonomies = $this->get_persistent()->get_taxonomies();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,11 +109,11 @@ class framework_autocomplete extends MoodleQuickForm_autocomplete {
|
||||
if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
|
||||
$framework->get_context())) {
|
||||
continue;
|
||||
} else if ($this->onlyvisible && !$framework->get('visible')) {
|
||||
} else if ($this->onlyvisible && !$framework->get_visible()) {
|
||||
continue;
|
||||
}
|
||||
$this->addOption($framework->get('shortname') . ' ' . $framework->get('idnumber'), $framework->get('id'));
|
||||
array_push($toselect, $framework->get('id'));
|
||||
$this->addOption($framework->get_shortname() . ' ' . $framework->get_idnumber(), $framework->get_id());
|
||||
array_push($toselect, $framework->get_id());
|
||||
}
|
||||
|
||||
return $this->setSelected($toselect);
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
/**
|
||||
* Persistent form abstract.
|
||||
*
|
||||
* @package core
|
||||
* @package tool_lp
|
||||
* @copyright 2015 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\form;
|
||||
namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use coding_exception;
|
||||
@@ -47,7 +47,7 @@ require_once($CFG->libdir.'/formslib.php');
|
||||
* You may exclude some fields from the validation should your form include other
|
||||
* properties such as files. To do so use the $foreignfields property.
|
||||
*
|
||||
* @package core
|
||||
* @package tool_lp
|
||||
* @copyright 2015 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ abstract class persistent extends moodleform {
|
||||
/** @var array Fields to remove from the persistent validation. */
|
||||
protected static $foreignfields = array();
|
||||
|
||||
/** @var \core\peristent Reference to the persistent. */
|
||||
/** @var \tool_lp\peristent Reference to the persistent. */
|
||||
private $persistent = null;
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ abstract class persistent extends moodleform {
|
||||
$attributes = null, $editable = true) {
|
||||
if (empty(static::$persistentclass)) {
|
||||
throw new coding_exception('Static property $persistentclass must be set.');
|
||||
} else if (!is_subclass_of(static::$persistentclass, 'core\\persistent')) {
|
||||
} else if (!is_subclass_of(static::$persistentclass, 'core_competency\\persistent')) {
|
||||
throw new coding_exception('Static property $persistentclass is not valid.');
|
||||
} else if (!array_key_exists('persistent', $customdata)) {
|
||||
throw new coding_exception('The custom data \'persistent\' key must be set, even if it is null.');
|
||||
@@ -134,45 +134,6 @@ abstract class persistent extends moodleform {
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* After definition hook.
|
||||
*
|
||||
* Automatically try to set the types of simple fields using the persistent properties definition.
|
||||
* This only applies to hidden, text and url types. Groups are also ignored as they are most likely custom.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function after_definition() {
|
||||
parent::after_definition();
|
||||
$mform = $this->_form;
|
||||
|
||||
$class = static::$persistentclass;
|
||||
$properties = $class::properties_definition();
|
||||
|
||||
foreach ($mform->_elements as $element) {
|
||||
$name = $element->getName();
|
||||
|
||||
if (isset($mform->_types[$name])) {
|
||||
// We already have a PARAM_* type for this field.
|
||||
continue;
|
||||
|
||||
} else if (!isset($properties[$name]) || in_array($name, static::$fieldstoremove)
|
||||
|| in_array($name, static::$foreignfields)) {
|
||||
// Ignoring foreign and unknown fields.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set the type on the element.
|
||||
switch ($element->getType()) {
|
||||
case 'hidden':
|
||||
case 'text':
|
||||
case 'url':
|
||||
$mform->setType($name, $properties[$name]['type']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define extra validation mechanims.
|
||||
*
|
||||
@@ -231,6 +192,7 @@ abstract class persistent extends moodleform {
|
||||
$data->$field = clean_param($data->$field, $allproperties[$field]['type']);
|
||||
}
|
||||
|
||||
// Convert formatted properties.
|
||||
if (isset($properties[$field])) {
|
||||
$data->$field = array(
|
||||
'text' => $data->$field,
|
||||
@@ -259,7 +221,7 @@ abstract class persistent extends moodleform {
|
||||
$data = static::convert_fields($data);
|
||||
|
||||
// Ensure that the ID is set.
|
||||
$data->id = $this->persistent->get('id');
|
||||
$data->id = $this->persistent->get_id();
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@@ -267,7 +229,7 @@ abstract class persistent extends moodleform {
|
||||
/**
|
||||
* Return the persistent object associated with this form instance.
|
||||
*
|
||||
* @return core\persistent
|
||||
* @return tool_lp\persistent
|
||||
*/
|
||||
final protected function get_persistent() {
|
||||
return $this->persistent;
|
||||
@@ -25,7 +25,6 @@
|
||||
namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core\form\persistent;
|
||||
use core_competency\plan as planpersistent;
|
||||
use required_capability_exception;
|
||||
|
||||
@@ -69,7 +68,7 @@ class plan extends persistent {
|
||||
// When the plan was already saved then the status can not be changed via this form.
|
||||
$status = planpersistent::get_status_list($this->_customdata['userid']);
|
||||
$plan = $this->get_persistent();
|
||||
if ($plan->get('id')) {
|
||||
if ($plan->get_id()) {
|
||||
// The current status is not selectable (workflow status probably), we just display it.
|
||||
$mform->addElement('static', 'staticstatus', get_string('status', 'tool_lp'), $plan->get_statusname());
|
||||
} else if (!empty($status) && count($status) > 1) {
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core\form\persistent;
|
||||
|
||||
/**
|
||||
* Learning plan template form.
|
||||
*
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use moodleform;
|
||||
use core\form\persistent;
|
||||
|
||||
require_once($CFG->libdir . '/formslib.php');
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use moodleform;
|
||||
use core\form\persistent;
|
||||
|
||||
require_once($CFG->libdir . '/formslib.php');
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
namespace tool_lp\form;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core\form\persistent;
|
||||
|
||||
/**
|
||||
* User evidence form class.
|
||||
*
|
||||
|
||||
@@ -27,8 +27,7 @@ use renderable;
|
||||
use renderer_base;
|
||||
use templatable;
|
||||
use context_course;
|
||||
use core_competency\external\competency_exporter;
|
||||
use core_competency\external\performance_helper;
|
||||
use \core_competency\external\competency_exporter;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
@@ -83,9 +82,13 @@ class competency_plan_navigation implements renderable, templatable {
|
||||
|
||||
$plancompetencies = \core_competency\api::list_plan_competencies($data->planid);
|
||||
$data->competencies = array();
|
||||
$helper = new performance_helper();
|
||||
$contextcache = array();
|
||||
foreach ($plancompetencies as $plancompetency) {
|
||||
$context = $helper->get_context_from_competency($plancompetency->competency);
|
||||
$frameworkid = $plancompetency->competency->get_competencyframeworkid();
|
||||
if (!isset($contextcache[$frameworkid])) {
|
||||
$contextcache[$frameworkid] = $plancompetency->competency->get_context();
|
||||
}
|
||||
$context = $contextcache[$frameworkid];
|
||||
$exporter = new competency_exporter($plancompetency->competency, array('context' => $context));
|
||||
$competency = $exporter->export($output);
|
||||
if ($competency->id == $this->competencyid) {
|
||||
|
||||
@@ -63,11 +63,11 @@ class competency_summary implements renderable, templatable {
|
||||
$this->competency = $competency;
|
||||
$this->framework = $framework;
|
||||
if ($includerelated) {
|
||||
$this->relatedcompetencies = api::list_related_competencies($competency->get('id'));
|
||||
$this->relatedcompetencies = api::list_related_competencies($competency->get_id());
|
||||
}
|
||||
|
||||
if ($includecourses) {
|
||||
$this->courses = api::list_courses_using_competency($competency->get('id'));
|
||||
$this->courses = api::list_courses_using_competency($competency->get_id());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ use core_competency\api;
|
||||
use tool_lp\course_competency_statistics;
|
||||
use core_competency\competency;
|
||||
use core_competency\course_competency;
|
||||
use core_competency\external\performance_helper;
|
||||
use core_competency\external\competency_exporter;
|
||||
use core_competency\external\course_competency_exporter;
|
||||
use core_competency\external\course_competency_settings_exporter;
|
||||
@@ -43,7 +42,7 @@ use core_competency\external\user_competency_course_exporter;
|
||||
use core_competency\external\user_competency_exporter;
|
||||
use tool_lp\external\competency_path_exporter;
|
||||
use tool_lp\external\course_competency_statistics_exporter;
|
||||
use core_course\external\course_module_summary_exporter;
|
||||
use tool_lp\external\course_module_summary_exporter;
|
||||
|
||||
/**
|
||||
* Class containing data for course competencies page
|
||||
@@ -113,6 +112,7 @@ class course_competencies_page implements renderable, templatable {
|
||||
$data->courseid = $this->courseid;
|
||||
$data->pagecontextid = $this->context->id;
|
||||
$data->competencies = array();
|
||||
$contextcache = array();
|
||||
|
||||
$gradable = is_enrolled($this->context, $USER, 'moodle/competency:coursecompetencygradable');
|
||||
if ($gradable) {
|
||||
@@ -126,19 +126,21 @@ class course_competencies_page implements renderable, templatable {
|
||||
$ruleoutcomeoptions[$value] = array('value' => $value, 'text' => (string) $text, 'selected' => false);
|
||||
}
|
||||
|
||||
$helper = new performance_helper();
|
||||
foreach ($this->coursecompetencylist as $coursecompetencyelement) {
|
||||
$coursecompetency = $coursecompetencyelement['coursecompetency'];
|
||||
$competency = $coursecompetencyelement['competency'];
|
||||
$context = $helper->get_context_from_competency($competency);
|
||||
if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
|
||||
$contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
|
||||
}
|
||||
$context = $contextcache[$competency->get_competencyframeworkid()];
|
||||
|
||||
$compexporter = new competency_exporter($competency, array('context' => $context));
|
||||
$ccexporter = new course_competency_exporter($coursecompetency, array('context' => $context));
|
||||
|
||||
$ccoutcomeoptions = (array) (object) $ruleoutcomeoptions;
|
||||
$ccoutcomeoptions[$coursecompetency->get('ruleoutcome')]['selected'] = true;
|
||||
$ccoutcomeoptions[$coursecompetency->get_ruleoutcome()]['selected'] = true;
|
||||
|
||||
$coursemodules = api::list_course_modules_using_competency($competency->get('id'), $this->courseid);
|
||||
$coursemodules = api::list_course_modules_using_competency($competency->get_id(), $this->courseid);
|
||||
|
||||
$fastmodinfo = get_fast_modinfo($this->courseid);
|
||||
$exportedmodules = array();
|
||||
@@ -150,7 +152,7 @@ class course_competencies_page implements renderable, templatable {
|
||||
// Competency path.
|
||||
$pathexporter = new competency_path_exporter([
|
||||
'ancestors' => $competency->get_ancestors(),
|
||||
'framework' => $helper->get_framework_from_competency($competency),
|
||||
'framework' => $competency->get_framework(),
|
||||
'context' => $context
|
||||
]);
|
||||
|
||||
@@ -164,13 +166,13 @@ class course_competencies_page implements renderable, templatable {
|
||||
if ($gradable) {
|
||||
$foundusercompetencycourse = false;
|
||||
foreach ($usercompetencycourses as $usercompetencycourse) {
|
||||
if ($usercompetencycourse->get('competencyid') == $competency->get('id')) {
|
||||
if ($usercompetencycourse->get_competencyid() == $competency->get_id()) {
|
||||
$foundusercompetencycourse = $usercompetencycourse;
|
||||
}
|
||||
}
|
||||
if ($foundusercompetencycourse) {
|
||||
$related = array(
|
||||
'scale' => $helper->get_scale_from_competency($competency)
|
||||
'scale' => $competency->get_scale()
|
||||
);
|
||||
$exporter = new user_competency_course_exporter($foundusercompetencycourse, $related);
|
||||
$onerow['usercompetencycourse'] = $exporter->export($output);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user