Compare commits
862 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31059fd653 | |||
| cbdde9a495 | |||
| ce65706ceb | |||
| 65f8dc31d8 | |||
| 779303d869 | |||
| 28c9a1993d | |||
| 8f866fa1c3 | |||
| a556c4d02c | |||
| 87c0820260 | |||
| 0444bcffc7 | |||
| 15990b65ac | |||
| 1f3066f197 | |||
| 532c25d5bd | |||
| c256614eab | |||
| 0f67177a54 | |||
| 2e6e70ccd2 | |||
| a13ae2ac2d | |||
| e19f164fc7 | |||
| 702c4b1206 | |||
| 17a31c7a1f | |||
| 7b258d7186 | |||
| 609a129b84 | |||
| ecd01922e9 | |||
| c8782c56d7 | |||
| 4deed68f49 | |||
| 40b705e153 | |||
| 3b35ea4686 | |||
| 5a9dde69b1 | |||
| a02ad260e0 | |||
| 15f15ccddd | |||
| 346e41d042 | |||
| 36bf61e152 | |||
| bc180cd111 | |||
| b10d7c59ae | |||
| 6aee251874 | |||
| d1e9bdfbc8 | |||
| 0c18577317 | |||
| 255221acdf | |||
| 93bd10c300 | |||
| 03bdfbd37b | |||
| d7de792dac | |||
| 763e5d6c83 | |||
| 436c7825b1 | |||
| 9074f5914f | |||
| 62ff078fcf | |||
| df174952fd | |||
| 9d97806c7e | |||
| e6f1c141bf | |||
| 687f244a6f | |||
| 461532ecfc | |||
| 16b6239a88 | |||
| 8121a2fad0 | |||
| d78e72a940 | |||
| 16a175de06 | |||
| ec4f31f984 | |||
| 323a7a151b | |||
| 14eb0c478d | |||
| e8b487e010 | |||
| 641351118e | |||
| 12e42d2246 | |||
| 0a668af390 | |||
| 22290d726a | |||
| 03fc135cb6 | |||
| 0459ed43e1 | |||
| 928f531307 | |||
| 767dfb307d | |||
| 3efe531af4 | |||
| ef54b1272a | |||
| 2e97e57edb | |||
| 2f64ea2a2e | |||
| 3fda0a9736 | |||
| 0047e4612c | |||
| 44088a5aeb | |||
| 2507ecbd3e | |||
| 439f2e7e83 | |||
| b523d5bc33 | |||
| 63e0fee364 | |||
| 063c6e23d4 | |||
| 5c1f1690bb | |||
| b46ad4bdd5 | |||
| 8001ddd8b2 | |||
| b9894e1e9f | |||
| 0e26b1d309 | |||
| 5cc6700f27 | |||
| 090f8f300d | |||
| fc36873f61 | |||
| 315392626b | |||
| c27add8d87 | |||
| ae18cf2461 | |||
| deab7fda59 | |||
| af3085d2d5 | |||
| 55a8f72251 | |||
| af02385d49 | |||
| c5b3017b49 | |||
| 5ec684b353 | |||
| 0a03803081 | |||
| 6527b097e8 | |||
| 8f5c4f6b34 | |||
| b1325427ec | |||
| 5de6795ec0 | |||
| 0dc138d47c | |||
| f367cfcbef | |||
| c2b526c484 | |||
| b01092111c | |||
| 8ef945280c | |||
| fbfeb98d39 | |||
| 24276da9ce | |||
| 1f316df7d9 | |||
| 467aefd1a6 | |||
| f354a67357 | |||
| 32193155f5 | |||
| b3f6c093aa | |||
| 82a678c91e | |||
| f3f21f18c4 | |||
| 05c7b75672 | |||
| 39c01271f0 | |||
| c09f63c5ac | |||
| 9f9bcb251c | |||
| 39864d9e88 | |||
| 2a46808ed3 | |||
| 4221300426 | |||
| d14fe6017f | |||
| cdc0a8db3f | |||
| 9ddb811866 | |||
| 29dd7397e2 | |||
| bef5900bdb | |||
| 623379d82b | |||
| 8480fd9364 | |||
| 5faaf18173 | |||
| d23d771071 | |||
| 5f690a9be6 | |||
| 95dae00235 | |||
| 7c4e3db7c0 | |||
| 0ed1b7d277 | |||
| 690988d958 | |||
| 26b3b4e80e | |||
| a5e67c5bcc | |||
| 01327cfcf5 | |||
| 1b775e96c1 | |||
| ef467ee957 | |||
| 247b756248 | |||
| 1eedfdf2c0 | |||
| d4bbbedbde | |||
| c8abe81b99 | |||
| 7943aabfbe | |||
| 2de77919d8 | |||
| 5094443f65 | |||
| 9ec65dc485 | |||
| 068ef548de | |||
| bad563d2f4 | |||
| 50eb74065b | |||
| febd8afc8e | |||
| cac959739b | |||
| cef5600303 | |||
| 63a2e24bc2 | |||
| 35eefad6b3 | |||
| c8121c53d1 | |||
| 74f6a6ae5b | |||
| d560fb3e26 | |||
| 213220c159 | |||
| baa476ce92 | |||
| 795dc143c2 | |||
| a18e060c5b | |||
| 84ebf61b82 | |||
| 300dff939f | |||
| 2aa6dd4c60 | |||
| e59d25c944 | |||
| a86531f20b | |||
| 239bfa31b0 | |||
| 9056ee506a | |||
| 5a8fdd1c27 | |||
| be14be6175 | |||
| 0b09c8e48f | |||
| 90e4b26229 | |||
| 8b9c45b666 | |||
| 2c3eea86fa | |||
| 39259ea58b | |||
| 3ce36f6ac1 | |||
| 6a9a7005b0 | |||
| 2d9145638c | |||
| 531b675632 | |||
| c41d4355ac | |||
| ac4bf23c02 | |||
| 51c59e8b9f | |||
| 606db83726 | |||
| a62801941e | |||
| 0282c20862 | |||
| 915e21170c | |||
| 11b6abd02c | |||
| 6005337c33 | |||
| ea2833bc35 | |||
| 2271f1845c | |||
| b4875aa348 | |||
| 3b4cc68ff4 | |||
| 2f0d26c522 | |||
| 3dd8bd5069 | |||
| eede6aae43 | |||
| a623fdf11b | |||
| 617144f163 | |||
| 61d3898de9 | |||
| ec297cc65b | |||
| 5e33ee65e5 | |||
| 3bf4cc3887 | |||
| 4f88c9f38d | |||
| 096ef13c79 | |||
| c49e848571 | |||
| 25a0be8b27 | |||
| b760c63189 | |||
| b3569fb6fa | |||
| db14163584 | |||
| c58559191a | |||
| d86be9c53e | |||
| 7de6a916a2 | |||
| cf93e03ea0 | |||
| f2774239cb | |||
| 5049dfceca | |||
| 186af5a430 | |||
| 7a4826bc3e | |||
| 1b1432ab88 | |||
| 5bfbec5521 | |||
| eee25b4a13 | |||
| a175c5d1ba | |||
| d209e7161a | |||
| ef494edcd6 | |||
| 20ada5de55 | |||
| c21c4761d1 | |||
| 9ab9793c53 | |||
| 4a106a5759 | |||
| b5256231a6 | |||
| b29e02d57e | |||
| 95bb29b902 | |||
| 59fe1b009f | |||
| ab8571d19a | |||
| 90ff64881e | |||
| 1818308bca | |||
| b47604e938 | |||
| c1ee5cf31b | |||
| 18f802f85a | |||
| ea8c5bdc74 | |||
| 6b7a5f86a0 | |||
| f28ce6eb2e | |||
| 5bb55eeb21 | |||
| ddb652c706 | |||
| 648cc055c2 | |||
| 0fbda60bb3 | |||
| 486ad6e842 | |||
| 74980995b4 | |||
| 33c3193f06 | |||
| 95924516fa | |||
| 1663aa1fb9 | |||
| 970536b659 | |||
| b6fadf63d4 | |||
| f1213f3a75 | |||
| adac041f8c | |||
| acadd22a65 | |||
| acafcb18f5 | |||
| 71f4cb812c | |||
| b1f78408a5 | |||
| 1669cf37f0 | |||
| 71e7387f43 | |||
| 4eb9f7dd72 | |||
| 568e9560af | |||
| dc7fe6acca | |||
| 786a6227d0 | |||
| fd9ee7dd8b | |||
| 8ba664e245 | |||
| b88a31a654 | |||
| 76dc0848c1 | |||
| c838cb15d8 | |||
| 3b1fec6fb2 | |||
| 4939d0d71a | |||
| d61604b455 | |||
| ec085021f2 | |||
| 4c6481694e | |||
| fdeb6af76e | |||
| ee7af1e19d | |||
| 7561f3d64a | |||
| a65c0da40d | |||
| 1e07291026 | |||
| 1215c112c0 | |||
| 0e37d94b67 | |||
| 3264dcece0 | |||
| cc1dc858c0 | |||
| 6ca7efb157 | |||
| 72d49e8419 | |||
| cd2f4a87a4 | |||
| b8ba7f3619 | |||
| aa8ae42d24 | |||
| 1c7509bc86 | |||
| 7ed94cbe9c | |||
| 7c7d086ae1 | |||
| 725ce55546 | |||
| 1f55a12bf8 | |||
| ee0f0b3986 | |||
| 92d4bcd9f7 | |||
| e7215ce5b7 | |||
| 6dc0b5482b | |||
| 45d7ec6123 | |||
| a7e348e937 | |||
| eba7490c31 | |||
| a4798ada52 | |||
| 0cc8a0b4b2 | |||
| 6d32f6300e | |||
| 08348b8f86 | |||
| 519eec044c | |||
| ab156686ff | |||
| 1fc8ebf085 | |||
| 0086364857 | |||
| 05cc5bf052 | |||
| 8bd3dfd6f5 | |||
| 1c9e079b7c | |||
| 8b90e93c94 | |||
| 94f0349745 | |||
| 50cc7daa0f | |||
| 0a841ac85c | |||
| 28d6752d07 | |||
| 1d0f235097 | |||
| 93d7596d3f | |||
| aa9f17df92 | |||
| d251180b31 | |||
| 67a77fa36f | |||
| c3cf035fad | |||
| 8a52ccea0c | |||
| d35f49ba45 | |||
| 38748c6ada | |||
| 68fb3969e1 | |||
| 527afcfb8c | |||
| c62f8bc71f | |||
| d3c034f8e8 | |||
| 5f399d0c52 | |||
| a9e0505fde | |||
| 96d73266ef | |||
| 66a0fea650 | |||
| a4bba406ad | |||
| 20914ba26a | |||
| 8b5520877b | |||
| 7cacba3db3 | |||
| f4c37747dc | |||
| 3e65f72a40 | |||
| d613a0db57 | |||
| 26f004f29b | |||
| 0ed87e5063 | |||
| 87cc899c44 | |||
| e1661a6346 | |||
| 3ba2b5c925 | |||
| 7c5d28c26c | |||
| 67711964d1 | |||
| bf394372d8 | |||
| d927f222a9 | |||
| bbcbbcd130 | |||
| cc0b20ba9d | |||
| 8f15eebc22 | |||
| d8b6437fa9 | |||
| e257ad8372 | |||
| ba03dc18ad | |||
| 7c15d3b34c | |||
| 1c76803ec1 | |||
| 5660ceba8d | |||
| ae59c35eb9 | |||
| 3c129829ce | |||
| 050720be90 | |||
| 7573d5ff21 | |||
| b3656b26be | |||
| 804c22b8f1 | |||
| 8716b6c89f | |||
| 8b3d19c2f5 | |||
| cf9ed67a4e | |||
| 417b6921d5 | |||
| f72a23d69b | |||
| ca602b6beb | |||
| 2b8647034a | |||
| 956ec418c6 | |||
| 31d453f735 | |||
| b4d0a4479c | |||
| 3e07b8a2f3 | |||
| 383776876b | |||
| 91c8d4da71 | |||
| 1721c8eb85 | |||
| ad3d9452bf | |||
| c5f351435e | |||
| 03b06dedbc | |||
| da80885cc6 | |||
| 94ac7a87fa | |||
| 10b02d6d41 | |||
| ebb6f3e80b | |||
| 7f4db6f4d9 | |||
| 4fc5861cba | |||
| 40b205197c | |||
| cb914a71aa | |||
| 85f376892d | |||
| e0708141f8 | |||
| 76b012d611 | |||
| 53ca351f7a | |||
| ea9f3057da | |||
| f1406d3b39 | |||
| 91251e4889 | |||
| 8994593332 | |||
| 67b3704318 | |||
| 37e7d91b8c | |||
| 3fe64cbd7d | |||
| 22051a4e34 | |||
| e7cd680765 | |||
| 84d2c6f761 | |||
| f97581eda7 | |||
| 2c0b608cda | |||
| eb1381de1d | |||
| c7bfbb01c6 | |||
| 4eacb77012 | |||
| 93835758f3 | |||
| a238e7ed72 | |||
| 98ac33bcb0 | |||
| 0caa8c60d2 | |||
| 2dbdaedc3e | |||
| 30a264540b | |||
| 6d05bee940 | |||
| 2535dfaf64 | |||
| 35186e3725 | |||
| bfe4417cb7 | |||
| 6b6affec1f | |||
| 9e13649c89 | |||
| 1465b22f7d | |||
| f549deed15 | |||
| ab59b7db71 | |||
| 200a2b7fad | |||
| 9945bcec41 | |||
| b4ac5653ed | |||
| 0207466e77 | |||
| 2ca9e09dab | |||
| 6eaf5ec8e3 | |||
| 1d110af2d6 | |||
| 2d121036cc | |||
| 61961447c2 | |||
| 867f40990b | |||
| da6ce47102 | |||
| 78ba7d9e6b | |||
| 63010978b4 | |||
| c5e9bc48f0 | |||
| cd90445d4a | |||
| 0052796dbb | |||
| b522356839 | |||
| 1d45b926f3 | |||
| 0ba5f02b15 | |||
| a31fdfb145 | |||
| d019ffd21f | |||
| a93f8344ae | |||
| 2d7617aa18 | |||
| 84acc68175 | |||
| 38d8b7b703 | |||
| 69ddeb42e2 | |||
| 2bd9cd1077 | |||
| 35588aa876 | |||
| fc415ee908 | |||
| 10b4bda916 | |||
| 3708e1bb7c | |||
| e7e79055e1 | |||
| 3d4cf404df | |||
| 31c0efeac7 | |||
| 3571cd46d2 | |||
| fa6db7b8c1 | |||
| 947a90339a | |||
| dc30afaafc | |||
| 03a5278a38 | |||
| d683942c6a | |||
| 24c0432bbc | |||
| c16de45a14 | |||
| 9d19781014 | |||
| ab6ae906cd | |||
| f45b59d427 | |||
| 3add7d878f | |||
| c9bd902bd3 | |||
| 366124d222 | |||
| 89203e11a7 | |||
| dd83fbfbbc | |||
| 1fb374121a | |||
| f3163a2002 | |||
| 65764352dd | |||
| 2c7b800f2f | |||
| ed7d676329 | |||
| b23bc0a148 | |||
| df9a669791 | |||
| b1ab535efa | |||
| 1e9dce0df4 | |||
| 8dd0756226 | |||
| 8458e3d2c2 | |||
| 951a64f6ef | |||
| b336cf98b4 | |||
| b6ac868d71 | |||
| 57ce05c631 | |||
| f0538cee92 | |||
| f4f4965a1c | |||
| 93a593daab | |||
| c8c1a2cb10 | |||
| 793ab11d95 | |||
| 47221d5fdd | |||
| 1affa3ea22 | |||
| 70971d43eb | |||
| 99e0bb23bf | |||
| d95453d903 | |||
| 53fb01aef0 | |||
| cfd5ba4101 | |||
| 5eb386fd09 | |||
| 594848bb15 | |||
| 64fea720ce | |||
| 83d08fcc21 | |||
| 01e7204646 | |||
| 3152864fd5 | |||
| 2997bd6dce | |||
| 083d5a6f0c | |||
| c1ee80fef5 | |||
| 0a9815d14e | |||
| 3ac5a3544c | |||
| b7cb9c60c1 | |||
| 6f5ca6613f | |||
| a16755314a | |||
| a4919abf4f | |||
| 022a58af8d | |||
| 6480ec0c48 | |||
| 1e4e4a05d7 | |||
| 9dc9608795 | |||
| e08d290469 | |||
| 80bb90c3ca | |||
| a3ddcab336 | |||
| a839769c23 | |||
| 1eb503b379 | |||
| cc5f8bd53f | |||
| bb512f7c1f | |||
| 5b5a73019d | |||
| ce0b9bb7ca | |||
| 38063e7d1b | |||
| ee5b9e137d | |||
| 55103810f0 | |||
| e5b111f26b | |||
| 7c2e2133cc | |||
| 3352ffcfa2 | |||
| 8e74bfa8e8 | |||
| 9f630b6cc4 | |||
| c2779c9f29 | |||
| 7fecbba80b | |||
| 80b81e5094 | |||
| 6e977fcdd6 | |||
| 9c8c5f2d01 | |||
| 9134f3f0df | |||
| b093752289 | |||
| bd87c3e225 | |||
| 7bea1ea240 | |||
| afd6e7d542 | |||
| e29eef4bde | |||
| 63dd180030 | |||
| 8eacbd5a32 | |||
| 680ff52414 | |||
| 884e310a3b | |||
| 7eac026a02 | |||
| deaddfb6b8 | |||
| 85b40b18d5 | |||
| 3b6987cea3 | |||
| 14ff3d59b3 | |||
| dd02a787d8 | |||
| cefe7c7f59 | |||
| d9fc73dc7a | |||
| 3bc1e345ca | |||
| 5d3fe21ab2 | |||
| 17db3e8af1 | |||
| a0da864ac2 | |||
| 0978aab839 | |||
| 7d947ad66c | |||
| 5e63c8e57e | |||
| 34bcea8159 | |||
| 2a56e3c8b9 | |||
| 1fb1c6d456 | |||
| 469e7dd82d | |||
| 1461f9d664 | |||
| 8791525d88 | |||
| a0f39f2b57 | |||
| 6fc2264a8a | |||
| 8893b111c2 | |||
| 3362673173 | |||
| 49703ecf1d | |||
| d56f3531b4 | |||
| 902a36137a | |||
| 19e4d5ada8 | |||
| d81917322f | |||
| b657f6db05 | |||
| abd980d36d | |||
| 7b27045680 | |||
| e4a56bd9dd | |||
| 5807b224d9 | |||
| 8b1596c257 | |||
| 2649eefe1c | |||
| b3bb3a4422 | |||
| 6e10f195c5 | |||
| ab7c329acf | |||
| 95d39aabc7 | |||
| 6e515be94f | |||
| b3b4f9a4a4 | |||
| c71d8267ed | |||
| 1742e76777 | |||
| 2797fcc75e | |||
| 2538e2dab1 | |||
| 6bf5eeed56 | |||
| c14d87daaa | |||
| cb201e866b | |||
| cc6a8bc792 | |||
| fa71841e9d | |||
| be7809f5fd | |||
| 655cdde2dc | |||
| 7f75f1507e | |||
| 3fbf089303 | |||
| 8a453265d2 | |||
| 807d45073a | |||
| 253bbbb668 | |||
| 8fbc1919df | |||
| c41ace2f7a | |||
| 3be351cabc | |||
| 53bd21e7d8 | |||
| 217530dfca | |||
| 30271d87aa | |||
| f271df32ec | |||
| 77ae35faba | |||
| 32d746479b | |||
| b18fd23232 | |||
| bbd644ea34 | |||
| c4bfba91c2 | |||
| 6e7a7aecf3 | |||
| 635493f6dd | |||
| 0f583e0c91 | |||
| 1a7ded8989 | |||
| 159e18c977 | |||
| 801dea3298 | |||
| d468b949f1 | |||
| a0881872c7 | |||
| a9e9cd31e1 | |||
| 0085d95576 | |||
| e4226ddc26 | |||
| 4c7169437b | |||
| b2cdd35a46 | |||
| aa0fad65e3 | |||
| 4c06cef684 | |||
| 6871df272d | |||
| 40a4427420 | |||
| f76b5133a5 | |||
| d5a7b7873e | |||
| ffa71ca45e | |||
| 5248eb8831 | |||
| 5468d02e60 | |||
| 251fd097bb | |||
| 3ac721e5a3 | |||
| ecd99dc88a | |||
| 3097fca71c | |||
| bc1c896692 | |||
| 6a927661f2 | |||
| 601d32ae66 | |||
| 2dde0b96da | |||
| d420bf952f | |||
| a02d7831b6 | |||
| 604db7d557 | |||
| 41ab96e7ff | |||
| 9dfb59fa28 | |||
| ad94e63238 | |||
| 82c0485aab | |||
| 4524454ff2 | |||
| 658bba713a | |||
| 238c388016 | |||
| 5e10e88673 | |||
| 7b6bad24ee | |||
| 11be1e8b2b | |||
| 42126ff6a5 | |||
| f12f99241c | |||
| 8fde6e8ef9 | |||
| 36bd6f3319 | |||
| 0f52f263ca | |||
| b9e1842e02 | |||
| 99261fdf05 | |||
| 07388eaded | |||
| d983601e46 | |||
| fd85f4eeb9 | |||
| c11ac48868 | |||
| 0d5c68bfd8 | |||
| a6b91c8407 | |||
| f6cac05e9c | |||
| 9a2938c57c | |||
| f4d6bab1b4 | |||
| ebfbd63b3c | |||
| 9ec7228b03 | |||
| 0a1f0c4b1f | |||
| 7180fb19c1 | |||
| ac2015f2ce | |||
| 6fc8187375 | |||
| 81e433d505 | |||
| 9fbdee633a | |||
| f1dee5ce23 | |||
| 1ffce0c735 | |||
| 3e307259ac | |||
| 8455124070 | |||
| a1d932bd82 | |||
| d9ef98fc80 | |||
| 4affd3c42e | |||
| 8771f49c0a | |||
| b018b44b49 | |||
| 3d4f5c6bf8 | |||
| 6bbdb16bb1 | |||
| 07783f9c20 | |||
| b19370bd35 | |||
| 9d18c714b8 | |||
| 474dd3da66 | |||
| 5095725a00 | |||
| 02da49597c | |||
| 5f86aa9d14 | |||
| ae916b5d6a | |||
| ea66859873 | |||
| 23f43bb4c4 | |||
| 108d281f6b | |||
| 4a0e272c5b | |||
| 647a688de3 | |||
| 3f9ea21ae3 | |||
| 34a46904c2 | |||
| d73b1f3e71 | |||
| 2c356d8ecd | |||
| 62c7d543f6 | |||
| 008cfb2a1f | |||
| 243f766222 | |||
| 2b9259ed7f | |||
| c5d9d36e79 | |||
| 296029fadf | |||
| 7e78f9c4a5 | |||
| 83bc3ccfdf | |||
| 6a001a3223 | |||
| 1974f5ade7 | |||
| 837e3741fd | |||
| 4bdb702918 | |||
| e588f20b6c | |||
| ad7d8edf0c | |||
| 9f4a69a8cd | |||
| fd4c7d7b69 | |||
| e77b4ac0de | |||
| 4fe4fbba9d | |||
| 331298218b | |||
| db52d4058d | |||
| b5d1353575 | |||
| fb3663ae5c | |||
| 6825f882e2 | |||
| 04b949a8f5 | |||
| 86976c5bd9 | |||
| 33238bb24b | |||
| 2b548c27ee | |||
| e0cd7e44db | |||
| 184cdf0d52 | |||
| 472896acdd | |||
| 1ff977a5e5 | |||
| 68a1c2a8d9 | |||
| db77228155 | |||
| 8a0dcb91cc | |||
| 11b5d9b763 | |||
| dc195425ee | |||
| 72cf8ec5eb | |||
| 1130c181f9 | |||
| 443d4dae06 | |||
| a2720952c2 | |||
| 89262fa9f1 | |||
| bc3c2a8eed | |||
| fb7e5c42cd | |||
| 2e2a229f58 | |||
| d12b20d022 | |||
| 5ce5bc6bdd | |||
| 54c9048405 | |||
| 7b04f1fa49 | |||
| eebd7f8964 | |||
| 871af2ebc5 | |||
| 0d4b11ff88 | |||
| e342149a37 | |||
| 9054cd2a25 | |||
| 7d5e56cffd | |||
| 137c0261ee | |||
| 1c500e2157 | |||
| 46021b98b2 | |||
| 55739cdfb6 | |||
| 63e5416f5b | |||
| 689a8f383c | |||
| 10f981a794 | |||
| 556a760d0c | |||
| 2ba0565d7d | |||
| 16d5729223 | |||
| 38ef7ab379 | |||
| 740cb942ce | |||
| 3725adf852 | |||
| b9c49aefb2 | |||
| 60f8e19ce1 | |||
| d0f43772fb | |||
| 106be68e82 | |||
| f12ad8521f | |||
| 9efa210e32 | |||
| 79b146cb5c | |||
| 8711ce1f4a | |||
| 417fa07162 | |||
| 1910d01a86 | |||
| c9c530fd6e | |||
| dadeff80c9 | |||
| cc41096ad5 | |||
| db9987c267 | |||
| 8d8a5e8035 | |||
| b60373f3e4 | |||
| 1d8bebfeaf | |||
| 41d178f9da | |||
| d144e53188 | |||
| 49b50ef5ab | |||
| 4fac06549a | |||
| 7141921ad4 | |||
| 70e78a4315 | |||
| 520592c43d | |||
| 553b1e6f6d | |||
| bb5652829f | |||
| 288a79ccd4 | |||
| 8f6d8a5653 | |||
| c64368bb1d | |||
| 177beaf23a | |||
| 147d7af758 | |||
| 20bd24b70d | |||
| 7c75924319 | |||
| d90846033b | |||
| da02a3c472 | |||
| 61609ec274 | |||
| 228fc821e0 | |||
| d44071ee09 | |||
| 91fae7e9b4 | |||
| 3e7b9158f4 | |||
| 95f9c8f716 | |||
| 170392d4a0 | |||
| 3724b3aa8d | |||
| 9af90f03bb | |||
| 64a2dfba1f | |||
| 043cf8bab7 | |||
| 832393cfc9 | |||
| d8e7fa9196 | |||
| 075e999c1a | |||
| 8efb66741f | |||
| fa348b5d46 | |||
| ac2eafee91 | |||
| e6c69d835d | |||
| bfa6c5080e | |||
| 0f0729b157 | |||
| f75d82450a | |||
| 3dd33e3862 | |||
| e3b98ac6b6 | |||
| 3951213860 | |||
| 24b81e0566 | |||
| 0ab271dcfd | |||
| b9cb39eaf6 | |||
| c83407f033 | |||
| da75ffce68 | |||
| d48b1de9f7 | |||
| 38d1c9a886 | |||
| 1c48d7e188 | |||
| 11b39253d2 | |||
| 56e84a7985 | |||
| 133f83d557 | |||
| 17e57aa07d | |||
| 710b364b44 | |||
| 81d72831b8 | |||
| 3cfabf7190 | |||
| 0e5791a6cd | |||
| da3e5e0c5c | |||
| ae3b9e1e1f | |||
| 3485ecf225 |
@@ -1,79 +0,0 @@
|
||||
# Generated by "grunt ignorefiles"
|
||||
*/**/yui/src/*/meta/
|
||||
*/**/build/
|
||||
node_modules/
|
||||
vendor/
|
||||
admin/tool/usertours/amd/src/tour.js
|
||||
admin/tool/usertours/amd/src/popper.js
|
||||
auth/cas/CAS/
|
||||
auth/fc/fcFPP.php
|
||||
enrol/lti/ims-blti/
|
||||
filter/algebra/AlgParser.pm
|
||||
filter/tex/mimetex.*
|
||||
lib/editor/atto/yui/src/rangy/js/*.*
|
||||
lib/editor/tinymce/plugins/pdw/tinymce/
|
||||
lib/editor/tinymce/plugins/spellchecker/rpc.php
|
||||
lib/editor/tinymce/tiny_mce/
|
||||
lib/adodb/
|
||||
lib/bennu/
|
||||
lib/evalmath/
|
||||
lib/lessphp/
|
||||
lib/phpexcel/
|
||||
lib/google/
|
||||
lib/htmlpurifier/
|
||||
lib/jabber/
|
||||
lib/minify/matthiasmullie-minify/
|
||||
lib/minify/matthiasmullie-pathconverter/
|
||||
lib/pear/Auth/RADIUS.php
|
||||
lib/pear/Crypt/CHAP.php
|
||||
lib/pear/HTML/Common.php
|
||||
lib/pear/HTML/QuickForm.php
|
||||
lib/pear/HTML/QuickForm/
|
||||
lib/pear/PEAR.php
|
||||
lib/phpmailer/
|
||||
lib/simplepie/
|
||||
lib/tcpdf/
|
||||
lib/typo3/
|
||||
lib/yuilib/
|
||||
lib/yuilib/gallery/
|
||||
lib/jquery/
|
||||
lib/html2text/
|
||||
lib/markdown/
|
||||
lib/recaptchalib.php
|
||||
lib/xhprof/
|
||||
lib/xmlize.php
|
||||
lib/horde/
|
||||
lib/requirejs/
|
||||
lib/amd/src/loglevel.js
|
||||
lib/mustache/
|
||||
lib/amd/src/mustache.js
|
||||
lib/graphlib.php
|
||||
lib/php-css-parser/
|
||||
lib/rtlcss/
|
||||
lib/scssphp/
|
||||
lib/spout/
|
||||
lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
mod/assign/feedback/editpdf/fpdi/
|
||||
repository/s3/S3.php
|
||||
theme/boost/scss/bootstrap/
|
||||
theme/boost/amd/src/alert.js
|
||||
theme/boost/amd/src/button.js
|
||||
theme/boost/amd/src/carousel.js
|
||||
theme/boost/amd/src/collapse.js
|
||||
theme/boost/amd/src/dropdown.js
|
||||
theme/boost/amd/src/modal.js
|
||||
theme/boost/amd/src/popover.js
|
||||
theme/boost/amd/src/scrollspy.js
|
||||
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/bootstrapbase/less/bootstrap/
|
||||
theme/bootstrapbase/javascript/html5shiv.js
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
@@ -1,180 +0,0 @@
|
||||
{
|
||||
'env': {
|
||||
'browser': true,
|
||||
'amd': true
|
||||
},
|
||||
'globals': {
|
||||
'M': true,
|
||||
'Y': true
|
||||
},
|
||||
'rules': {
|
||||
// See http://eslint.org/docs/rules/ for all rules and explanations of all
|
||||
// rules.
|
||||
|
||||
// === Possible Errors ===
|
||||
'comma-dangle': 'off',
|
||||
'no-cond-assign': 'error',
|
||||
'no-console': 'error',
|
||||
'no-constant-condition': 'error',
|
||||
'no-control-regex': 'error',
|
||||
'no-debugger': 'error',
|
||||
'no-dupe-args': 'error',
|
||||
'no-dupe-keys': 'error',
|
||||
'no-duplicate-case': 'error',
|
||||
'no-empty': 'warn',
|
||||
'no-empty-character-class': 'error',
|
||||
'no-ex-assign': 'error',
|
||||
'no-extra-boolean-cast': 'error',
|
||||
'no-extra-parens': 'off',
|
||||
'no-extra-semi': 'error',
|
||||
'no-func-assign': 'error',
|
||||
'no-inner-declarations': 'error',
|
||||
'no-invalid-regexp': 'error',
|
||||
'no-irregular-whitespace': 'error',
|
||||
'no-obj-calls': 'error',
|
||||
'no-prototype-builtins': 'off',
|
||||
'no-regex-spaces': 'error',
|
||||
'no-sparse-arrays': 'error',
|
||||
'no-unexpected-multiline': 'error',
|
||||
'no-unreachable': 'warn',
|
||||
'no-unsafe-finally': 'error',
|
||||
'no-unsafe-negation': 'error',
|
||||
'use-isnan': 'error',
|
||||
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
|
||||
'valid-typeof': 'error',
|
||||
|
||||
// === Best Practices ===
|
||||
// (these mostly match our jshint config)
|
||||
'array-callback-return': 'warn',
|
||||
'block-scoped-var': 'warn',
|
||||
'complexity': 'warn',
|
||||
'consistent-return': 'warn',
|
||||
'curly': 'error',
|
||||
'dot-notation': 'warn',
|
||||
'no-alert': 'warn',
|
||||
'no-caller': 'error',
|
||||
'no-case-declarations': 'error',
|
||||
'no-div-regex': 'error',
|
||||
'no-empty-pattern': 'error',
|
||||
'no-empty-function': 'warn',
|
||||
'no-eq-null': 'error',
|
||||
'no-eval': 'error',
|
||||
'no-extend-native': 'error',
|
||||
'no-extra-bind': 'warn',
|
||||
'no-fallthrough': 'error',
|
||||
'no-floating-decimal': 'warn',
|
||||
'no-global-assign': 'warn',
|
||||
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
|
||||
'no-implied-eval': 'error',
|
||||
'no-invalid-this': 'error',
|
||||
'no-iterator': 'error',
|
||||
'no-labels': 'error',
|
||||
'no-loop-func': 'error',
|
||||
'no-multi-spaces': 'warn',
|
||||
'no-multi-str': 'error',
|
||||
'no-new-func': 'error',
|
||||
'no-new-wrappers': 'error',
|
||||
'no-octal': 'error',
|
||||
'no-octal-escape': 'error',
|
||||
'no-proto': 'error',
|
||||
'no-redeclare': 'warn',
|
||||
'no-return-assign': 'error',
|
||||
'no-script-url': 'error',
|
||||
'no-self-assign': 'error',
|
||||
'no-self-compare': 'error',
|
||||
'no-sequences': 'warn',
|
||||
'no-throw-literal': 'warn',
|
||||
'no-unmodified-loop-condition': 'error',
|
||||
'no-unused-expressions': 'error',
|
||||
'no-unused-labels': 'error',
|
||||
'no-useless-call': 'warn',
|
||||
'no-useless-escape': 'warn',
|
||||
'no-with': 'error',
|
||||
'wrap-iife': ['error', 'any'],
|
||||
|
||||
// === Variables ===
|
||||
'no-delete-var': 'error',
|
||||
'no-undef': 'error',
|
||||
'no-undef-init': 'error',
|
||||
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
|
||||
|
||||
// === Stylistic Issues ===
|
||||
'array-bracket-spacing': 'warn',
|
||||
'block-spacing': 'warn',
|
||||
'brace-style': ['warn', '1tbs'],
|
||||
'camelcase': 'warn',
|
||||
'comma-spacing': ['warn', { 'before': false, 'after': true }],
|
||||
'comma-style': ['warn', 'last'],
|
||||
'computed-property-spacing': 'error',
|
||||
'consistent-this': 'off',
|
||||
'eol-last': 'off',
|
||||
'func-call-spacing': ['warn', 'never'],
|
||||
'func-names': 'off',
|
||||
'func-style': 'off',
|
||||
// indent currently not doing well with our wrapping style, so disabled.
|
||||
'indent': ['off', 4, { 'SwitchCase': 1 }],
|
||||
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
|
||||
'keyword-spacing': 'warn',
|
||||
'linebreak-style': ['error', 'unix'],
|
||||
'lines-around-comment': 'off',
|
||||
'max-len': ['error', 132],
|
||||
'max-lines': 'off',
|
||||
'max-depth': 'warn',
|
||||
'max-nested-callbacks': ['warn', 5],
|
||||
'max-params': 'off',
|
||||
'max-statements': 'off',
|
||||
'max-statements-per-line': ['warn', { max: 2 }],
|
||||
'new-cap': ['warn', { 'properties': false }],
|
||||
'new-parens': 'warn',
|
||||
'newline-after-var': 'off',
|
||||
'newline-before-return': 'off',
|
||||
'newline-per-chained-call': 'off',
|
||||
'no-array-constructor': 'off',
|
||||
'no-bitwise': 'error',
|
||||
'no-continue': 'off',
|
||||
'no-inline-comments': 'off',
|
||||
'no-lonely-if': 'off',
|
||||
'no-mixed-operators': 'off',
|
||||
'no-mixed-spaces-and-tabs': 'error',
|
||||
'no-multiple-empty-lines': 'warn',
|
||||
'no-negated-condition': 'off',
|
||||
'no-nested-ternary': 'warn',
|
||||
'no-new-object': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-tabs': 'error',
|
||||
'no-ternary': 'off',
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-underscore-dangle': 'off',
|
||||
'no-unneeded-ternary': 'off',
|
||||
'no-whitespace-before-property': 'warn',
|
||||
'object-curly-newline': 'off',
|
||||
'object-curly-spacing': 'warn',
|
||||
'object-property-newline': 'off',
|
||||
'one-var': 'off',
|
||||
'one-var-declaration-per-line': ['warn', 'initializations'],
|
||||
'operator-assignment': 'off',
|
||||
'operator-linebreak': 'off',
|
||||
'padded-blocks': 'off',
|
||||
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
|
||||
'quotes': 'off',
|
||||
'require-jsdoc': 'warn',
|
||||
'semi': 'error',
|
||||
'semi-spacing': ['warn', {'before': false, 'after': true}],
|
||||
'sort-vars': 'off',
|
||||
'space-before-blocks': 'warn',
|
||||
'space-before-function-paren': ['warn', 'never'],
|
||||
'space-in-parens': 'warn',
|
||||
'space-infix-ops': 'warn',
|
||||
'space-unary-ops': 'warn',
|
||||
'spaced-comment': 'warn',
|
||||
'unicode-bom': 'error',
|
||||
'wrap-regex': 'off',
|
||||
|
||||
// === Deprecations ===
|
||||
"no-restricted-properties": ['warn', {
|
||||
'object': 'M',
|
||||
'property': 'str',
|
||||
'message': 'Use AMD module "core/str" or M.util.get_string()'
|
||||
}],
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
**/yui/build/** -diff
|
||||
**/amd/build/** -diff
|
||||
theme/bootstrapbase/style/editor.css -diff
|
||||
theme/bootstrapbase/style/moodle.css -diff
|
||||
+2
-3
@@ -26,13 +26,12 @@ CVS
|
||||
/.buildpath
|
||||
/.cache
|
||||
phpunit.xml
|
||||
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
|
||||
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
|
||||
composer.phar
|
||||
composer.lock
|
||||
/vendor/
|
||||
/behat.yml
|
||||
*/yui/build/*/*-coverage.js
|
||||
/lib/yuilib/*/build/*/*-coverage.js
|
||||
# lib/yuilib/version/module/module-coverage.js
|
||||
/lib/yuilib/*/*/*-coverage.js
|
||||
atlassian-ide-plugin.xml
|
||||
/node_modules/
|
||||
|
||||
@@ -1,58 +1,48 @@
|
||||
// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
|
||||
// here because shifter uses jshint after modules have been concating. Eslint can't
|
||||
// currently do this.
|
||||
{
|
||||
"asi": false,
|
||||
"bitwise": true,
|
||||
"boss": false,
|
||||
"browser": true,
|
||||
"yui": true,
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"forin": false,
|
||||
"immed": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nomen": false,
|
||||
"onevar": false,
|
||||
"plusplus": false,
|
||||
"regexp": false,
|
||||
"strict": false,
|
||||
"trailing": true,
|
||||
"unused": true,
|
||||
"white": false,
|
||||
"asi": false,
|
||||
"boss": false,
|
||||
"debug": false,
|
||||
"eqeqeq": false,
|
||||
"eqnull": false,
|
||||
"es5": false,
|
||||
"esnext": false,
|
||||
"evil": false,
|
||||
"expr": false,
|
||||
"forin": false,
|
||||
"funcscope": false,
|
||||
"globalstrict": false,
|
||||
"immed": true,
|
||||
"indent": 4,
|
||||
"iterator": false,
|
||||
"lastsemic": false,
|
||||
"latedef": true,
|
||||
"laxbreak": true,
|
||||
"laxcomma": false,
|
||||
"loopfunc": false,
|
||||
"maxerr": 500,
|
||||
"maxlen": 132,
|
||||
"multistr": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nomen": false,
|
||||
"onecase": false,
|
||||
"onevar": false,
|
||||
"passfail": false,
|
||||
"plusplus": false,
|
||||
"predef": [
|
||||
"M",
|
||||
"define",
|
||||
"require"
|
||||
],
|
||||
"proto": false,
|
||||
"regexdash": false,
|
||||
"regexp": false,
|
||||
"scripturl": false,
|
||||
"shadow": false,
|
||||
"smarttabs": false,
|
||||
"strict": false,
|
||||
"sub": false,
|
||||
"supernew": false,
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"white": false,
|
||||
"yui": true
|
||||
"maxerr": 500,
|
||||
"maxlen": 180,
|
||||
"passfail": false,
|
||||
"latedef": true
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# Generated by "grunt ignorefiles"
|
||||
theme/bootstrapbase/style/
|
||||
theme/clean/style/custom.css
|
||||
theme/more/style/custom.css
|
||||
node_modules/
|
||||
vendor/
|
||||
admin/tool/usertours/amd/src/tour.js
|
||||
admin/tool/usertours/amd/src/popper.js
|
||||
auth/cas/CAS/
|
||||
auth/fc/fcFPP.php
|
||||
enrol/lti/ims-blti/
|
||||
filter/algebra/AlgParser.pm
|
||||
filter/tex/mimetex.*
|
||||
lib/editor/atto/yui/src/rangy/js/*.*
|
||||
lib/editor/tinymce/plugins/pdw/tinymce/
|
||||
lib/editor/tinymce/plugins/spellchecker/rpc.php
|
||||
lib/editor/tinymce/tiny_mce/
|
||||
lib/adodb/
|
||||
lib/bennu/
|
||||
lib/evalmath/
|
||||
lib/lessphp/
|
||||
lib/phpexcel/
|
||||
lib/google/
|
||||
lib/htmlpurifier/
|
||||
lib/jabber/
|
||||
lib/minify/matthiasmullie-minify/
|
||||
lib/minify/matthiasmullie-pathconverter/
|
||||
lib/pear/Auth/RADIUS.php
|
||||
lib/pear/Crypt/CHAP.php
|
||||
lib/pear/HTML/Common.php
|
||||
lib/pear/HTML/QuickForm.php
|
||||
lib/pear/HTML/QuickForm/
|
||||
lib/pear/PEAR.php
|
||||
lib/phpmailer/
|
||||
lib/simplepie/
|
||||
lib/tcpdf/
|
||||
lib/typo3/
|
||||
lib/yuilib/
|
||||
lib/yuilib/gallery/
|
||||
lib/jquery/
|
||||
lib/html2text/
|
||||
lib/markdown/
|
||||
lib/recaptchalib.php
|
||||
lib/xhprof/
|
||||
lib/xmlize.php
|
||||
lib/horde/
|
||||
lib/requirejs/
|
||||
lib/amd/src/loglevel.js
|
||||
lib/mustache/
|
||||
lib/amd/src/mustache.js
|
||||
lib/graphlib.php
|
||||
lib/php-css-parser/
|
||||
lib/rtlcss/
|
||||
lib/scssphp/
|
||||
lib/spout/
|
||||
lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
mod/assign/feedback/editpdf/fpdi/
|
||||
repository/s3/S3.php
|
||||
theme/boost/scss/bootstrap/
|
||||
theme/boost/amd/src/alert.js
|
||||
theme/boost/amd/src/button.js
|
||||
theme/boost/amd/src/carousel.js
|
||||
theme/boost/amd/src/collapse.js
|
||||
theme/boost/amd/src/dropdown.js
|
||||
theme/boost/amd/src/modal.js
|
||||
theme/boost/amd/src/popover.js
|
||||
theme/boost/amd/src/scrollspy.js
|
||||
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/bootstrapbase/less/bootstrap/
|
||||
theme/bootstrapbase/javascript/html5shiv.js
|
||||
theme/bootstrapbase/amd/src/bootstrap.js
|
||||
@@ -1,94 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"at-rule-empty-line-before": [ "always",
|
||||
{"except": [ "blockless-group"], ignore: ["after-comment", "all-nested"]}
|
||||
],
|
||||
"at-rule-name-case": "lower",
|
||||
"at-rule-name-space-after": "always-single-line",
|
||||
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
|
||||
"at-rule-semicolon-newline-after": "always",
|
||||
"block-closing-brace-newline-after": "always",
|
||||
"block-closing-brace-newline-before": "always-multi-line",
|
||||
"block-closing-brace-space-before": "always-single-line",
|
||||
"block-no-empty": true,
|
||||
"block-no-single-line": true,
|
||||
"block-opening-brace-newline-after": "always-multi-line",
|
||||
"block-opening-brace-space-after": "always-single-line",
|
||||
"block-opening-brace-space-before": "always",
|
||||
"color-hex-case": ["lower", { "severity": "warning" }],
|
||||
"color-hex-length": ["short", { "severity": "warning" }],
|
||||
"color-no-invalid-hex": true,
|
||||
"declaration-bang-space-after": "never",
|
||||
"declaration-bang-space-before": "always",
|
||||
"declaration-block-no-duplicate-properties": true,
|
||||
"declaration-block-no-ignored-properties": true,
|
||||
"declaration-block-no-shorthand-property-overrides": true,
|
||||
"declaration-block-semicolon-newline-after": "always-multi-line",
|
||||
"declaration-block-semicolon-space-after": "always-single-line",
|
||||
"declaration-block-semicolon-space-before": "never",
|
||||
"declaration-block-single-line-max-declarations": 1,
|
||||
"declaration-block-trailing-semicolon": "always",
|
||||
"declaration-colon-newline-after": "always-multi-line",
|
||||
"declaration-colon-space-after": "always-single-line",
|
||||
"declaration-colon-space-before": "never",
|
||||
"declaration-no-important": true,
|
||||
"function-calc-no-unspaced-operator": true,
|
||||
"function-comma-newline-after": "always-multi-line",
|
||||
"function-comma-space-after": "always-single-line",
|
||||
"function-comma-space-before": "never",
|
||||
"function-linear-gradient-no-nonstandard-direction": true,
|
||||
"function-max-empty-lines": 0,
|
||||
"function-name-case": "lower",
|
||||
"function-parentheses-newline-inside": "always-multi-line",
|
||||
"function-parentheses-space-inside": "never-single-line",
|
||||
"function-url-data-uris": never,
|
||||
"function-whitespace-after": "always",
|
||||
"indentation": 4,
|
||||
"keyframe-declaration-no-important": true,
|
||||
"length-zero-no-unit": [true, { "severity": "warning" }],
|
||||
"max-empty-lines": 2,
|
||||
"max-line-length": [132, { "severity": "warning" }],
|
||||
"media-feature-colon-space-after": "always",
|
||||
"media-feature-colon-space-before": "never",
|
||||
"media-feature-no-missing-punctuation": true,
|
||||
"media-feature-parentheses-space-inside": "never",
|
||||
"media-feature-range-operator-space-after": "always",
|
||||
"media-feature-range-operator-space-before": "always",
|
||||
"media-query-list-comma-newline-after": "always-multi-line",
|
||||
"media-query-list-comma-space-after": "always-single-line",
|
||||
"media-query-list-comma-space-before": "never",
|
||||
"no-browser-hacks": null, # Enabled for non-scss in grunt.
|
||||
"no-empty-source": true,
|
||||
"no-eol-whitespace": true,
|
||||
"no-extra-semicolons": [true, { "severity": "warning" }],
|
||||
"no-invalid-double-slash-comments": true,
|
||||
"no-unknown-animations": true,
|
||||
"property-case": "lower",
|
||||
"property-no-unknown": true,
|
||||
"selector-attribute-brackets-space-inside": "never",
|
||||
"selector-attribute-operator-space-after": "never",
|
||||
"selector-attribute-operator-space-before": "never",
|
||||
"selector-combinator-space-after": "always",
|
||||
"selector-combinator-space-before": "always",
|
||||
"selector-list-comma-newline-after": "always",
|
||||
"selector-list-comma-space-before": "never",
|
||||
"selector-max-empty-lines": 0,
|
||||
"selector-pseudo-class-case": "lower",
|
||||
"selector-pseudo-class-no-unknown": true,
|
||||
"selector-pseudo-class-parentheses-space-inside": "never",
|
||||
"selector-pseudo-element-case": "lower",
|
||||
"selector-pseudo-element-no-unknown": true,
|
||||
"selector-root-no-composition": true,
|
||||
"selector-type-case": "lower",
|
||||
"selector-type-no-unknown": true,
|
||||
"string-no-newline": true,
|
||||
"time-no-imperceptible": true,
|
||||
"unit-blacklist": ["pt"],
|
||||
"unit-case": "lower",
|
||||
"unit-no-unknown": true,
|
||||
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
|
||||
"value-list-comma-newline-after": "always-multi-line",
|
||||
"value-list-comma-space-after": "always-single-line",
|
||||
"value-list-comma-space-before": "never",
|
||||
}
|
||||
}
|
||||
-262
@@ -1,262 +0,0 @@
|
||||
# PLEASE NOTE: Travis is not currently utilised by the Moodle core integration
|
||||
# process (which uses our internal CI system) this file is here for the benefit
|
||||
# of community developers git clones - see MDL-51458.
|
||||
|
||||
sudo: false
|
||||
|
||||
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
|
||||
# is fixed.
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||
- 7.1
|
||||
- 5.6
|
||||
|
||||
services:
|
||||
- redis-server
|
||||
|
||||
env:
|
||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
||||
# start first so that the total run time is not too high.
|
||||
#
|
||||
# We only run MySQL on PHP 7.1, so run that first.
|
||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
||||
# Postgres is significantly is pretty reasonable in its run-time.
|
||||
|
||||
# Run unit tests on MySQL
|
||||
- DB=mysqli TASK=PHPUNIT
|
||||
|
||||
# Run CI Tests without running PHPUnit.
|
||||
- DB=none TASK=CITEST
|
||||
|
||||
# Run unit tests on Postgres
|
||||
- DB=pgsql TASK=PHPUNIT
|
||||
|
||||
# Perform an upgrade test too.
|
||||
- DB=pgsql TASK=UPGRADE
|
||||
|
||||
matrix:
|
||||
# Enable fast finish.
|
||||
# This will fail the build if a single job fails (except those in allow_failures).
|
||||
# It will not stop the jobs from running.
|
||||
fast_finish: true
|
||||
|
||||
include:
|
||||
# Run grunt/npm install on lowest supported npm version
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='4'
|
||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='node'
|
||||
|
||||
exclude:
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 7.1
|
||||
|
||||
- env: DB=mysqli TASK=PHPUNIT
|
||||
php: 5.6
|
||||
|
||||
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
|
||||
- env: DB=pgsql TASK=UPGRADE
|
||||
php: 7.1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
- $HOME/.npm
|
||||
|
||||
install:
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
if [ -n "$GITHUB_APITOKEN" ]; then
|
||||
composer config github-oauth.github.com $GITHUB_APITOKEN;
|
||||
echo 'auth.json' >> .git/info/exclude
|
||||
fi
|
||||
|
||||
# Enable Redis.
|
||||
echo 'extension="redis.so"' > /tmp/redis.ini
|
||||
phpenv config-add /tmp/redis.ini
|
||||
|
||||
# Install composer dependencies.
|
||||
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
|
||||
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
|
||||
travis_retry composer install --prefer-dist --no-interaction;
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
nvm install $NVM_VERSION ;
|
||||
nvm use $NVM_VERSION ;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- phpenv config-rm xdebug.ini
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
|
||||
then
|
||||
# Copy generic configuration in place.
|
||||
cp config-dist.php config.php ;
|
||||
|
||||
# Create the moodledata directory.
|
||||
mkdir -p "$HOME"/roots/base
|
||||
|
||||
# The database name and password.
|
||||
sed -i \
|
||||
-e "s%= 'moodle'%= 'travis_ci_test'%" \
|
||||
-e "s%= 'password'%= ''%" \
|
||||
config.php ;
|
||||
|
||||
# The wwwroot and dataroot.
|
||||
sed -i \
|
||||
-e "s%http://example.com/moodle%http://localhost%" \
|
||||
-e "s%/home/example/moodledata%/home/travis/roots/base%" \
|
||||
config.php ;
|
||||
|
||||
if [ "$DB" = 'pgsql' ];
|
||||
then
|
||||
# Postgres-specific setup.
|
||||
sed -i \
|
||||
-e "s%= 'username'%= 'postgres'%" \
|
||||
config.php ;
|
||||
|
||||
psql -c 'CREATE DATABASE travis_ci_test;' -U postgres;
|
||||
fi
|
||||
|
||||
if [ "$DB" = 'mysqli' ];
|
||||
then
|
||||
# MySQL-specific setup.
|
||||
sed -i \
|
||||
-e "s%= 'pgsql'%= 'mysqli'%" \
|
||||
-e "s%= 'username'%= 'travis'%" \
|
||||
-e "s%=> 'utf8mb4_unicode_ci'%=> 'utf8mb4_bin'%" \
|
||||
config.php;
|
||||
|
||||
mysql -u root -e 'SET GLOBAL innodb_file_format=barracuda;' ;
|
||||
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
|
||||
mysql -u root -e 'SET GLOBAL innodb_large_prefix=ON;' ;
|
||||
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;' ;
|
||||
fi
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
# Create a directory for the phpunit dataroot.
|
||||
mkdir -p "$HOME"/roots/phpunit
|
||||
|
||||
# The phpunit dataroot and prefix..
|
||||
sed -i \
|
||||
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
||||
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
||||
-e "/require_once/i \\define('TEST_SESSION_REDIS_HOST', '127.0.0.1');" \
|
||||
config.php ;
|
||||
|
||||
# Initialise PHPUnit for Moodle.
|
||||
php admin/tool/phpunit/cli/init.php
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
npm install --no-spin;
|
||||
npm install --no-spin -g grunt ;
|
||||
fi
|
||||
|
||||
########################################################################
|
||||
# CI Tests
|
||||
########################################################################
|
||||
- >
|
||||
if [ "$TASK" = 'CITEST' ];
|
||||
then
|
||||
# Note - this is deliberately placed in the script section as we
|
||||
# should not add any code until after phpunit has run.
|
||||
|
||||
# The following repositories are required.
|
||||
# The local_ci repository does the actual checking.
|
||||
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci
|
||||
|
||||
# We need the official upstream for comparison
|
||||
git remote add upstream https://github.com/moodle/moodle.git;
|
||||
|
||||
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`
|
||||
|
||||
# Variables required by our linter.
|
||||
export gitcmd=`which git`;
|
||||
export gitdir="$TRAVIS_BUILD_DIR";
|
||||
export phpcmd=`which php`;
|
||||
fi
|
||||
|
||||
########################################################################
|
||||
# Upgrade test
|
||||
########################################################################
|
||||
- >
|
||||
if [ "$TASK" = 'UPGRADE' ];
|
||||
then
|
||||
# We need the official upstream.
|
||||
git remote add upstream https://github.com/moodle/moodle.git;
|
||||
|
||||
# Checkout 27 STABLE branch.
|
||||
git fetch upstream MOODLE_27_STABLE;
|
||||
git checkout MOODLE_27_STABLE;
|
||||
|
||||
# Perform the upgrade
|
||||
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
|
||||
|
||||
# Return to the previous commit
|
||||
git checkout -;
|
||||
|
||||
# Perform the upgrade
|
||||
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
|
||||
|
||||
# The local_ci repository can be used to check upgrade savepoints.
|
||||
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
|
||||
fi
|
||||
|
||||
script:
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
vendor/bin/phpunit;
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'CITEST' ];
|
||||
then
|
||||
bash local/ci/php_lint/php_lint.sh;
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'GRUNT' ];
|
||||
then
|
||||
grunt ;
|
||||
# Add all files to the git index and then run diff --cached to see all changes.
|
||||
# This ensures that we get the status of all files, including new files.
|
||||
git add . ;
|
||||
git diff --cached --exit-code ;
|
||||
fi
|
||||
|
||||
########################################################################
|
||||
# Upgrade test
|
||||
########################################################################
|
||||
- >
|
||||
if [ "$TASK" = 'UPGRADE' ];
|
||||
then
|
||||
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
|
||||
result=`php check_upgrade_savepoints.php`;
|
||||
# Check if there are problems
|
||||
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
|
||||
if (($count > 0));
|
||||
then
|
||||
echo "$result"
|
||||
exit 1 ;
|
||||
fi
|
||||
fi
|
||||
@@ -1,56 +0,0 @@
|
||||
CONTRIBUTING TO MOODLE
|
||||
======================
|
||||
|
||||
Moodle is made by people like you. We are members of a big worldwide community
|
||||
of developers, designers, teachers, testers, translators and other users. We
|
||||
work in universities, schools, companies and other places. You are very welcome
|
||||
to join us and contribute to the project.
|
||||
|
||||
See <https://docs.moodle.org/dev/Contributing_to_Moodle> for the many ways you
|
||||
can help, not only with coding.
|
||||
|
||||
Moodle is open to community contributions to core, though all code must go
|
||||
through peer-review, automated behaviour testing, continuous integration and
|
||||
human post-integration checks.
|
||||
|
||||
Pull requests
|
||||
-------------
|
||||
|
||||
Please do not open pull requests via Github. The repository there is just a
|
||||
mirror of the official repository at <https://git.moodle.org>. Issues are
|
||||
reported and patches provided via <https://tracker.moodle.org>. See below for
|
||||
more information.
|
||||
|
||||
Moodle core bug fixes and new features
|
||||
--------------------------------------
|
||||
|
||||
During the years of intensive development, a mature process of including
|
||||
submitted patches has evolved.
|
||||
|
||||
* Every bug fix or new feature must have a tracker issue.
|
||||
* You publish the branch implementing the fix or new feature in your public
|
||||
clone of the moodle.git repository (typically on Github).
|
||||
* Your patch is peer-reviewed, discussed, integrated, tested and then released
|
||||
as a part of moodle.git.
|
||||
* New features are developed on the master branch. Bug fixes are also
|
||||
backported to currently supported maintenance (stable) branches.
|
||||
|
||||
For further details, see <https://docs.moodle.org/dev/Process>.
|
||||
|
||||
Moodle plugins
|
||||
--------------
|
||||
|
||||
Moodle has a framework for additional plugins to extend its functionality. We
|
||||
have a Moodle plugins directory <https://moodle.org/plugins/> where you can
|
||||
register and maintain your plugin. Plugins hosted in the plugins directory can
|
||||
be easily installed and updated via the Moodle administration interface.
|
||||
|
||||
* You are expected to have a public source code repository with your plugin
|
||||
code.
|
||||
* After registering your plugin in the plugins directory it is reviewed before
|
||||
being published.
|
||||
* You are expected to continuously release updated versions of the plugin via
|
||||
the plugins directory. We do not pull from your code repository; you must do
|
||||
it explicitly.
|
||||
|
||||
For further details, see <https://docs.moodle.org/dev/Plugin_contribution>.
|
||||
-376
@@ -1,376 +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/>.
|
||||
/* jshint node: true, browser: false */
|
||||
/* eslint-env node */
|
||||
|
||||
/**
|
||||
* @copyright 2014 Andrew Nicols
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Grunt configuration
|
||||
*/
|
||||
|
||||
module.exports = function(grunt) {
|
||||
var path = require('path'),
|
||||
tasks = {},
|
||||
cwd = process.env.PWD || process.cwd(),
|
||||
async = require('async'),
|
||||
DOMParser = require('xmldom').DOMParser,
|
||||
xpath = require('xpath'),
|
||||
semver = require('semver');
|
||||
|
||||
// Verify the node version is new enough.
|
||||
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
|
||||
var actual = semver.valid(process.version);
|
||||
if (!semver.satisfies(actual, expected)) {
|
||||
grunt.fail.fatal('Node version too old. Require ' + expected + ', version installed: ' + actual);
|
||||
}
|
||||
|
||||
// Windows users can't run grunt in a subdirectory, so allow them to set
|
||||
// the root by passing --root=path/to/dir.
|
||||
if (grunt.option('root')) {
|
||||
var root = grunt.option('root');
|
||||
if (grunt.file.exists(__dirname, root)) {
|
||||
cwd = path.join(__dirname, root);
|
||||
grunt.log.ok('Setting root to ' + cwd);
|
||||
} else {
|
||||
grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
var inAMD = path.basename(cwd) == 'amd';
|
||||
|
||||
// Globbing pattern for matching all AMD JS source files.
|
||||
var amdSrc = [inAMD ? cwd + '/src/*.js' : '**/amd/src/*.js'];
|
||||
|
||||
/**
|
||||
* Function to generate the destination for the uglify task
|
||||
* (e.g. build/file.min.js). This function will be passed to
|
||||
* the rename property of files array when building dynamically:
|
||||
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
|
||||
*
|
||||
* @param {String} destPath the current destination
|
||||
* @param {String} srcPath the matched src path
|
||||
* @return {String} The rewritten destination path.
|
||||
*/
|
||||
var uglifyRename = function(destPath, srcPath) {
|
||||
destPath = srcPath.replace('src', 'build');
|
||||
destPath = destPath.replace('.js', '.min.js');
|
||||
destPath = path.resolve(cwd, destPath);
|
||||
return destPath;
|
||||
};
|
||||
|
||||
/**
|
||||
* Find thirdpartylibs.xml and generate an array of paths contained within
|
||||
* them (used to generate ignore files and so on).
|
||||
*
|
||||
* @return {array} The list of thirdparty paths.
|
||||
*/
|
||||
var getThirdPartyPathsFromXML = function() {
|
||||
var thirdpartyfiles = grunt.file.expand('*/**/thirdpartylibs.xml');
|
||||
var libs = ['node_modules/', 'vendor/'];
|
||||
|
||||
thirdpartyfiles.forEach(function(file) {
|
||||
var dirname = path.dirname(file);
|
||||
|
||||
var doc = new DOMParser().parseFromString(grunt.file.read(file));
|
||||
var nodes = xpath.select("/libraries/library/location/text()", doc);
|
||||
|
||||
nodes.forEach(function(node) {
|
||||
var lib = path.join(dirname, node.toString());
|
||||
if (grunt.file.isDir(lib)) {
|
||||
// Ensure trailing slash on dirs.
|
||||
lib = lib.replace(/\/?$/, '/');
|
||||
}
|
||||
|
||||
// Look for duplicate paths before adding to array.
|
||||
if (libs.indexOf(lib) === -1) {
|
||||
libs.push(lib);
|
||||
}
|
||||
});
|
||||
});
|
||||
return libs;
|
||||
};
|
||||
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
eslint: {
|
||||
// Even though warnings dont stop the build we don't display warnings by default because
|
||||
// at this moment we've got too many core warnings.
|
||||
options: {quiet: !grunt.option('show-lint-warnings')},
|
||||
amd: {
|
||||
src: amdSrc,
|
||||
// Check AMD with some slightly stricter rules.
|
||||
rules: {
|
||||
'no-unused-vars': 'error',
|
||||
'no-implicit-globals': 'error'
|
||||
}
|
||||
},
|
||||
// Check YUI module source files.
|
||||
yui: {
|
||||
src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
|
||||
options: {
|
||||
// Disable some rules which we can't safely define for YUI rollups.
|
||||
rules: {
|
||||
'no-undef': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-unused-expressions': 'off'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
amd: {
|
||||
files: [{
|
||||
expand: true,
|
||||
src: amdSrc,
|
||||
rename: uglifyRename
|
||||
}],
|
||||
options: {report: 'none'}
|
||||
}
|
||||
},
|
||||
less: {
|
||||
bootstrapbase: {
|
||||
files: {
|
||||
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
|
||||
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
|
||||
},
|
||||
options: {
|
||||
compress: false // We must not compress to keep the comments.
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
nospawn: true // We need not to spawn so config can be changed dynamically.
|
||||
},
|
||||
amd: {
|
||||
files: ['**/amd/src/**/*.js'],
|
||||
tasks: ['amd']
|
||||
},
|
||||
bootstrapbase: {
|
||||
files: ["theme/bootstrapbase/less/**/*.less"],
|
||||
tasks: ["css"]
|
||||
},
|
||||
yui: {
|
||||
files: ['**/yui/src/**/*.js'],
|
||||
tasks: ['yui']
|
||||
},
|
||||
},
|
||||
shifter: {
|
||||
options: {
|
||||
recursive: true,
|
||||
paths: [cwd]
|
||||
}
|
||||
},
|
||||
stylelint: {
|
||||
less: {
|
||||
options: {
|
||||
syntax: 'less',
|
||||
configOverrides: {
|
||||
rules: {
|
||||
// These rules have to be disabled in .stylelintrc for scss compat.
|
||||
"at-rule-no-unknown": true,
|
||||
"no-browser-hacks": [true, {"severity": "warning"}]
|
||||
}
|
||||
}
|
||||
},
|
||||
src: ['theme/**/*.less']
|
||||
},
|
||||
scss: {
|
||||
options: {syntax: 'scss'},
|
||||
src: ['*/**/*.scss']
|
||||
},
|
||||
css: {
|
||||
src: ['*/**/*.css'],
|
||||
options: {
|
||||
configOverrides: {
|
||||
rules: {
|
||||
// These rules have to be disabled in .stylelintrc for scss compat.
|
||||
"at-rule-no-unknown": true,
|
||||
"no-browser-hacks": [true, {"severity": "warning"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Generate ignore files (utilising thirdpartylibs.xml data)
|
||||
*/
|
||||
tasks.ignorefiles = function() {
|
||||
// An array of paths to third party directories.
|
||||
var thirdPartyPaths = getThirdPartyPathsFromXML();
|
||||
// Generate .eslintignore.
|
||||
var eslintIgnores = ['# Generated by "grunt ignorefiles"', '*/**/yui/src/*/meta/', '*/**/build/'].concat(thirdPartyPaths);
|
||||
grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
|
||||
// Generate .stylelintignore.
|
||||
var stylelintIgnores = [
|
||||
'# Generated by "grunt ignorefiles"',
|
||||
'theme/bootstrapbase/style/',
|
||||
'theme/clean/style/custom.css',
|
||||
'theme/more/style/custom.css'
|
||||
].concat(thirdPartyPaths);
|
||||
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Shifter task. Is configured with a path to a specific file or a directory,
|
||||
* in the case of a specific file it will work out the right module to be built.
|
||||
*
|
||||
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
|
||||
* so be careful to to call done().
|
||||
*/
|
||||
tasks.shifter = function() {
|
||||
var done = this.async(),
|
||||
options = grunt.config('shifter.options');
|
||||
|
||||
// Run the shifter processes one at a time to avoid confusing output.
|
||||
async.eachSeries(options.paths, function(src, filedone) {
|
||||
var args = [];
|
||||
args.push(path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
|
||||
|
||||
// Always ignore the node_modules directory.
|
||||
args.push('--excludes', 'node_modules');
|
||||
|
||||
// Determine the most appropriate options to run with based upon the current location.
|
||||
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
|
||||
// When passed a JS file, build our containing module (this happen with
|
||||
// watch).
|
||||
grunt.log.debug('Shifter passed a specific JS file');
|
||||
src = path.dirname(path.dirname(src));
|
||||
options.recursive = false;
|
||||
} else if (grunt.file.isMatch('**/yui/src', src)) {
|
||||
// When in a src directory --walk all modules.
|
||||
grunt.log.debug('In a src directory');
|
||||
args.push('--walk');
|
||||
options.recursive = false;
|
||||
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
|
||||
// When in module, only build our module.
|
||||
grunt.log.debug('In a module directory');
|
||||
options.recursive = false;
|
||||
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
|
||||
// When in module src, only build our module.
|
||||
grunt.log.debug('In a source directory');
|
||||
src = path.dirname(src);
|
||||
options.recursive = false;
|
||||
}
|
||||
|
||||
if (grunt.option('watch')) {
|
||||
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
|
||||
}
|
||||
|
||||
// Add the stderr option if appropriate
|
||||
if (grunt.option('verbose')) {
|
||||
args.push('--lint-stderr');
|
||||
}
|
||||
|
||||
if (grunt.option('no-color')) {
|
||||
args.push('--color=false');
|
||||
}
|
||||
|
||||
var execShifter = function() {
|
||||
|
||||
grunt.log.ok("Running shifter on " + src);
|
||||
grunt.util.spawn({
|
||||
cmd: "node",
|
||||
args: args,
|
||||
opts: {cwd: src, stdio: 'inherit', env: process.env}
|
||||
}, function(error, result, code) {
|
||||
if (code) {
|
||||
grunt.fail.fatal('Shifter failed with code: ' + code);
|
||||
} else {
|
||||
grunt.log.ok('Shifter build complete.');
|
||||
filedone();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Actually run shifter.
|
||||
if (!options.recursive) {
|
||||
execShifter();
|
||||
} else {
|
||||
// Check that there are yui modules otherwise shifter ends with exit code 1.
|
||||
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
|
||||
args.push('--recursive');
|
||||
execShifter();
|
||||
} else {
|
||||
grunt.log.ok('No YUI modules to build.');
|
||||
filedone();
|
||||
}
|
||||
}
|
||||
}, done);
|
||||
};
|
||||
|
||||
tasks.startup = function() {
|
||||
// Are we in a YUI directory?
|
||||
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
|
||||
grunt.task.run('yui');
|
||||
// Are we in an AMD directory?
|
||||
} else if (inAMD) {
|
||||
grunt.task.run('amd');
|
||||
} else {
|
||||
// Run them all!.
|
||||
grunt.task.run('css');
|
||||
grunt.task.run('js');
|
||||
}
|
||||
};
|
||||
|
||||
// On watch, we dynamically modify config to build only affected files. This
|
||||
// method is slightly complicated to deal with multiple changed files at once (copied
|
||||
// from the grunt-contrib-watch readme).
|
||||
var changedFiles = Object.create(null);
|
||||
var onChange = grunt.util._.debounce(function() {
|
||||
var files = Object.keys(changedFiles);
|
||||
grunt.config('eslint.amd.src', files);
|
||||
grunt.config('eslint.yui.src', files);
|
||||
grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]);
|
||||
grunt.config('shifter.options.paths', files);
|
||||
grunt.config('stylelint.less.src', files);
|
||||
changedFiles = Object.create(null);
|
||||
}, 200);
|
||||
|
||||
grunt.event.on('watch', function(action, filepath) {
|
||||
changedFiles[filepath] = action;
|
||||
onChange();
|
||||
});
|
||||
|
||||
// Register NPM tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-eslint');
|
||||
grunt.loadNpmTasks('grunt-stylelint');
|
||||
|
||||
// Register JS tasks.
|
||||
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
|
||||
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
|
||||
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
|
||||
grunt.registerTask('amd', ['eslint:amd', 'uglify']);
|
||||
grunt.registerTask('js', ['amd', 'yui']);
|
||||
|
||||
// Register CSS taks.
|
||||
grunt.registerTask('css', ['stylelint:scss', 'stylelint:less', 'less:bootstrapbase', 'stylelint:css']);
|
||||
|
||||
// Register the startup task.
|
||||
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
|
||||
|
||||
// Register the default task.
|
||||
grunt.registerTask('default', ['startup']);
|
||||
};
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
MOODLE INSTALLATION
|
||||
===================
|
||||
|
||||
Here is a short summary of the installation process (which can take just a few
|
||||
minutes):
|
||||
|
||||
1. Move the Moodle files into your web directory.
|
||||
|
||||
2. Create a single database for Moodle to store all its tables in (or choose an
|
||||
existing database).
|
||||
|
||||
3. Visit your Moodle site with a browser. You should be taken to the
|
||||
install.php script, which will lead you through creating a config.php file
|
||||
and then setting up Moodle, creating an admin account etc.
|
||||
|
||||
4. Set up a cron task to call the file admin/cron.php every minute.
|
||||
|
||||
For more information, see <https://docs.moodle.org/en/Installing_Moodle>.
|
||||
|
||||
Good luck and have fun!
|
||||
@@ -1,7 +0,0 @@
|
||||
*** PLEASE DO NOT OPEN PULL REQUESTS VIA GITHUB ***
|
||||
|
||||
The moodle.git repository at Github is just a mirror of the official repository. We do not accept pull requests at Github.
|
||||
|
||||
See CONTRIBUTING.txt guidelines for how to contribute patches for Moodle. Thank you.
|
||||
|
||||
--
|
||||
+22
-21
@@ -1,28 +1,29 @@
|
||||
.-..-.
|
||||
_____ | || |
|
||||
/____/-.---_ .---. .---. .-.| || | .---.
|
||||
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
|
||||
* | | | | | || |_| || |_| || |_| || || |___/
|
||||
|_| |_| |_|\_____/\_____/\_____||_|\_____)
|
||||
QUICK INSTALL
|
||||
=============
|
||||
|
||||
Moodle - the world's open source learning platform
|
||||
For the impatient, here is a basic outline of the
|
||||
installation process, which normally takes me only
|
||||
a few minutes:
|
||||
|
||||
Moodle <https://moodle.org> is a learning platform designed to provide
|
||||
educators, administrators and learners with a single robust, secure and
|
||||
integrated system to create personalised learning environments.
|
||||
1) Move the Moodle files into your web directory.
|
||||
|
||||
You can download Moodle <https://download.moodle.org> and run it on your own
|
||||
web server, ask one of our Moodle Partners <https://moodle.com/partners/> to
|
||||
assist you, or have a MoodleCloud site <https://moodle.com/cloud/> set up for
|
||||
you.
|
||||
2) Create a single database for Moodle to store all
|
||||
its tables in (or choose an existing database).
|
||||
|
||||
Moodle is widely used around the world by universities, schools, companies and
|
||||
all manner of organisations and individuals.
|
||||
3) Visit your Moodle site with a browser, you should
|
||||
be taken to the install.php script, which will lead
|
||||
you through creating a config.php file and then
|
||||
setting up Moodle, creating an admin account etc.
|
||||
|
||||
Moodle is provided freely as open source software, under the GNU General Public
|
||||
License <https://docs.moodle.org/dev/License>.
|
||||
4) Set up a cron task to call the file admin/cron.php
|
||||
every five minutes or so.
|
||||
|
||||
Moodle is written in PHP and JavaScript and uses an SQL database for storing
|
||||
the data.
|
||||
|
||||
See <https://docs.moodle.org> for details of Moodle's many features.
|
||||
For more information, see the INSTALL DOCUMENTATION:
|
||||
|
||||
http://docs.moodle.org/en/Installing_Moodle
|
||||
|
||||
|
||||
Good luck and have fun!
|
||||
Martin Dougiamas, Lead Developer
|
||||
|
||||
|
||||
+28
-42
@@ -1,48 +1,34 @@
|
||||
MOODLE TRADEMARKS POLICY
|
||||
========================
|
||||
------------------------
|
||||
Moodle Trademark License
|
||||
------------------------
|
||||
|
||||
The word "Moodle" is trademarked in many countries around the world. The word
|
||||
was originally an acronym: Modular Object-Oriented Dynamic Learning
|
||||
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
|
||||
of Moodle.
|
||||
The name Moodle™ is a registered trademark of the Moodle Trust.
|
||||
|
||||
The law obligates trademark owners to police their marks and prevent the use of
|
||||
confusingly similar names by third parties. Through this policy we’d like to
|
||||
make it clear how Moodle-related projects, organisations, and people can use
|
||||
the Moodle trademark. We’d also like to be clear about how use of the word is
|
||||
restricted when used to promote commercial Moodle services. We do this to
|
||||
protect the very business model that allows us to continue developing Moodle
|
||||
for you.
|
||||
A key part of the business model that allows us to produce and
|
||||
distribute Moodle as completely Free open source software is that
|
||||
we restrict the commercial use of the Moodle trademark to those
|
||||
who have contracted to support Moodle development (Moodle Partners).
|
||||
|
||||
Allowed uses
|
||||
------------
|
||||
If you are intending to use the name (and/or logo) to advertise
|
||||
generic Moodle™ services (eg Moodle Hosting, Moodle Support,
|
||||
Moodle Certification, Moodle Training, Moodle Consulting,
|
||||
Moodle Customisation, Moodle Courseware Development, Moodle
|
||||
Theme design, Moodle Integrations, Moodle Installations, etc)
|
||||
or as the name of a software package, then you must seek
|
||||
direct permission in writing from the Moodle Trust via the
|
||||
moodle.com helpdesk, in accordance with normal trademark
|
||||
restrictions.
|
||||
|
||||
The following uses don’t require any permission at all:
|
||||
There are no restrictions on how you use the name in other
|
||||
contexts (for example, if you use Moodle just to provide
|
||||
courses then you can use the name freely to refer to it.)
|
||||
|
||||
* Referring to the software or the Moodle project.
|
||||
* Describing your own Moodle implementation (including within corporate
|
||||
settings).
|
||||
* Describing a Moodle-based community hub.
|
||||
* Describing some software you’ve made that integrates with Moodle
|
||||
(eg a Moodle integration feature on another system).
|
||||
If you aren't sure of a particular case, please ask us via
|
||||
http://moodle.com/helpdesk: we'll be happy to either provide
|
||||
you with official permission in writing or help you fix
|
||||
your wording.
|
||||
|
||||
Restricted uses
|
||||
---------------
|
||||
|
||||
The following uses are generally prohibited without explicit and direct
|
||||
permission being granted to you by Moodle Pty Ltd. We do this to protect the
|
||||
Moodle project from software and sites which could confuse people. Please
|
||||
contact us to ask for permission in writing.
|
||||
|
||||
* You can’t use "Moodle" in the name of your software (including Mobile apps)
|
||||
* You can’t use "Moodle" in your company name
|
||||
* You can’t use "Moodle" in your domain name
|
||||
* You can’t use "Moodle" in advertising-related keywords (such as Adsense)
|
||||
* You can’t use "Moodle" to describe services around Moodle (such as hosting,
|
||||
training, support, consulting, course creation services, theme development,
|
||||
customisation, installation, integration and certification). This applies
|
||||
even if you do not charge for the services. Note that usually only Moodle
|
||||
Partners have this permission.
|
||||
|
||||
For information about the Moodle Partner Certification Mark as well as for how
|
||||
to contact us, please see <https://moodle.com/trademarks/>.
|
||||
Martin Dougiamas
|
||||
Executive Director
|
||||
Moodle Trust
|
||||
http://moodle.com
|
||||
|
||||
@@ -1,48 +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/>.
|
||||
|
||||
/**
|
||||
* Admin settings search form
|
||||
*
|
||||
* @package admin
|
||||
* @copyright 2016 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
/**
|
||||
* Admin settings search form
|
||||
*
|
||||
* @package admin
|
||||
* @copyright 2016 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_settings_search_form extends moodleform {
|
||||
function definition () {
|
||||
$mform = $this->_form;
|
||||
|
||||
//$mform->addElement('header', 'settingsheader', get_string('search', 'admin'));
|
||||
$elements = [];
|
||||
$elements[] = $mform->createElement('text', 'query', get_string('query', 'admin'));
|
||||
$elements[] = $mform->createElement('submit', 'search', get_string('search'));
|
||||
$mform->addGroup($elements);
|
||||
$mform->setType('query', PARAM_RAW);
|
||||
$mform->setDefault('query', optional_param('query', '', PARAM_RAW));
|
||||
}
|
||||
}
|
||||
@@ -1,106 +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/>.
|
||||
|
||||
/**
|
||||
* Allows admin to configure antiviruses.
|
||||
*
|
||||
* @package core_antivirus
|
||||
* @copyright 2015 Ruslan Kabalin, Lancaster University.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$antivirus = required_param('antivirus', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/antiviruses.php', array('action' => $action, 'antivirus' => $antivirus));
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageantiviruses";
|
||||
|
||||
// Get currently installed and enabled antivirus plugins.
|
||||
$availableantiviruses = \core\antivirus\manager::get_available();
|
||||
if (!empty($antivirus) and empty($availableantiviruses[$antivirus])) {
|
||||
redirect ($returnurl);
|
||||
}
|
||||
|
||||
$activeantiviruses = explode(',', $CFG->antiviruses);
|
||||
foreach ($activeantiviruses as $key => $active) {
|
||||
if (empty($availableantiviruses[$active])) {
|
||||
unset($activeantiviruses[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!confirm_sesskey()) {
|
||||
redirect($returnurl);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
// Remove from enabled list.
|
||||
$key = array_search($antivirus, $activeantiviruses);
|
||||
unset($activeantiviruses[$key]);
|
||||
break;
|
||||
|
||||
case 'enable':
|
||||
// Add to enabled list.
|
||||
if (!in_array($antivirus, $activeantiviruses)) {
|
||||
$activeantiviruses[] = $antivirus;
|
||||
$activeantiviruses = array_unique($activeantiviruses);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$key = array_search($antivirus, $activeantiviruses);
|
||||
// Check auth plugin is valid.
|
||||
if ($key !== false) {
|
||||
// Move down the list.
|
||||
if ($key < (count($activeantiviruses) - 1)) {
|
||||
$fsave = $activeantiviruses[$key];
|
||||
$activeantiviruses[$key] = $activeantiviruses[$key + 1];
|
||||
$activeantiviruses[$key + 1] = $fsave;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'up':
|
||||
$key = array_search($antivirus, $activeantiviruses);
|
||||
// Check auth is valid.
|
||||
if ($key !== false) {
|
||||
// Move up the list.
|
||||
if ($key >= 1) {
|
||||
$fsave = $activeantiviruses[$key];
|
||||
$activeantiviruses[$key] = $activeantiviruses[$key - 1];
|
||||
$activeantiviruses[$key - 1] = $fsave;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
set_config('antiviruses', implode(',', $activeantiviruses));
|
||||
core_plugin_manager::reset_caches();
|
||||
|
||||
redirect ($returnurl);
|
||||
@@ -146,6 +146,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
|
||||
// If custom field then pick name from database.
|
||||
$fieldshortname = str_replace('profile_field_', '', $fieldname);
|
||||
$fieldname = $customfieldname[$fieldshortname]->name;
|
||||
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
|
||||
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
|
||||
} elseif ($fieldname == 'url') {
|
||||
$fieldname = get_string('webpage');
|
||||
} else {
|
||||
|
||||
+24
-13
@@ -4,7 +4,6 @@
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/blocklib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
admin_externalpage_setup('manageblocks');
|
||||
@@ -37,7 +36,6 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
|
||||
add_to_config_log('block_visibility', $block->visible, '0', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
@@ -47,23 +45,40 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
|
||||
add_to_config_log('block_visibility', $block->visible, '1', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
|
||||
if (!isset($CFG->undeletableblocktypes) || (!is_array($CFG->undeletableblocktypes) && !is_string($CFG->undeletableblocktypes))) {
|
||||
$undeletableblocktypes = array('navigation', 'settings');
|
||||
} else if (is_string($CFG->undeletableblocktypes)) {
|
||||
$undeletableblocktypes = explode(',', $CFG->undeletableblocktypes);
|
||||
} else {
|
||||
$undeletableblocktypes = $CFG->undeletableblocktypes;
|
||||
}
|
||||
|
||||
if (!empty($protect) && confirm_sesskey()) {
|
||||
block_manager::protect_block((int)$protect);
|
||||
if (!$block = $DB->get_record('block', array('id'=>$protect))) {
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
if (!in_array($block->name, $undeletableblocktypes)) {
|
||||
$undeletableblocktypes[] = $block->name;
|
||||
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
|
||||
}
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
|
||||
if (!empty($unprotect) && confirm_sesskey()) {
|
||||
block_manager::unprotect_block((int)$unprotect);
|
||||
if (!$block = $DB->get_record('block', array('id'=>$unprotect))) {
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
if (in_array($block->name, $undeletableblocktypes)) {
|
||||
$undeletableblocktypes = array_diff($undeletableblocktypes, array($block->name));
|
||||
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
|
||||
}
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
|
||||
$undeletableblocktypes = block_manager::get_undeletable_block_types();
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($strmanageblocks);
|
||||
|
||||
@@ -139,12 +154,8 @@
|
||||
$settings = '<a href="' . $blocksettings->url . '">' . get_string('settings') . '</a>';
|
||||
} else if ($blocksettings instanceof admin_settingpage) {
|
||||
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
|
||||
} else if (!file_exists($CFG->dirroot.'/blocks/'.$block->name.'/settings.php')) {
|
||||
// If the block's settings node was not found, we check that the block really provides the settings.php file.
|
||||
// Note that blocks can inject their settings to other nodes in the admin tree without using the default locations.
|
||||
// This can be done by assigning null to $setting in settings.php and it is a valid case.
|
||||
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
|
||||
DEBUG_DEVELOPER);
|
||||
} else {
|
||||
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -67,6 +67,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
}
|
||||
|
||||
@@ -120,7 +121,7 @@ foreach ($settingspage->children as $childpage) {
|
||||
}
|
||||
if ($savebutton) {
|
||||
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'btn btn-primary form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
@@ -155,4 +156,4 @@ echo $outputhtml;
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
require_once($CFG->libdir.'/cronlib.php');
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
define('CLI_SCRIPT', 1);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
|
||||
|
||||
|
||||
@@ -1,76 +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/>.
|
||||
|
||||
/**
|
||||
* Validate that the current db structure matches the install.xml files.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @author Petr Skoda <petr.skoda@totaralms.com>
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__ . '/../../config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
|
||||
$help = "Validate database structure
|
||||
|
||||
Options:
|
||||
-h, --help Print out this help.
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/cli/check_database_schema.php
|
||||
";
|
||||
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'help' => false,
|
||||
),
|
||||
array(
|
||||
'h' => 'help',
|
||||
)
|
||||
);
|
||||
|
||||
if ($options['help']) {
|
||||
echo $help;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (empty($CFG->version)) {
|
||||
echo "Database is not yet installed.\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
$dbmanager = $DB->get_manager();
|
||||
$schema = $dbmanager->get_install_xml_schema();
|
||||
|
||||
if (!$errors = $dbmanager->check_database_schema($schema)) {
|
||||
echo "Database structure is ok.\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
foreach ($errors as $table => $items) {
|
||||
cli_separator();
|
||||
echo "$table\n";
|
||||
foreach ($items as $item) {
|
||||
echo " * $item\n";
|
||||
}
|
||||
}
|
||||
cli_separator();
|
||||
|
||||
exit(1);
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
require_once($CFG->libdir.'/cronlib.php');
|
||||
|
||||
|
||||
@@ -1,103 +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/>.
|
||||
|
||||
/**
|
||||
* This script fixes orphaned question categories.
|
||||
*
|
||||
* Orphaned question categories have had their associated context deleted
|
||||
* but the category itself remains in the database with an invalid context.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage cli
|
||||
* @copyright 2013 Tyler Bannister (tyler.bannister@remote-learner.net)
|
||||
* @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');
|
||||
require_once($CFG->libdir.'/questionlib.php');
|
||||
|
||||
$long = array('fix' => false, 'help' => false);
|
||||
$short = array('f' => 'fix', 'h' => 'help');
|
||||
|
||||
// Now get cli options.
|
||||
list($options, $unrecognized) = cli_get_params($long, $short);
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
if ($options['help']) {
|
||||
$help =
|
||||
"Fix orphaned question categories.
|
||||
|
||||
This scripts detects question categories that have had their
|
||||
context deleted, thus severing them from their original purpose.
|
||||
|
||||
This script will find the orphaned categories and delete the unused
|
||||
questions in each category found. Used questions will not be
|
||||
deleted, instead they will be moved to a rescue question category.
|
||||
|
||||
Options:
|
||||
-h, --help Print out this help
|
||||
-f, --fix Fix the orphaned question categories in the DB.
|
||||
If not specified only check and report problems to STDERR.
|
||||
Example:
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php -f
|
||||
";
|
||||
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
cli_heading('Checking for orphaned categories');
|
||||
|
||||
|
||||
$sql = 'SELECT qc.id, qc.contextid, qc.name
|
||||
FROM {question_categories} qc
|
||||
LEFT JOIN {context} c ON qc.contextid = c.id
|
||||
WHERE c.id IS NULL';
|
||||
$categories = $DB->get_recordset_sql($sql);
|
||||
|
||||
$i = 0;
|
||||
foreach ($categories as $category) {
|
||||
$i += 1;
|
||||
echo "Found orphaned category: {$category->name}\n";
|
||||
if (!empty($options['fix'])) {
|
||||
echo "Cleaning...";
|
||||
// One transaction per category.
|
||||
$transaction = $DB->start_delegated_transaction();
|
||||
question_category_delete_safe($category);
|
||||
$transaction->allow_commit();
|
||||
echo " Done!\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (($i > 0) && !empty($options['fix'])) {
|
||||
echo "Found and removed {$i} orphaned question categories\n";
|
||||
} else if ($i > 0) {
|
||||
echo "Found {$i} orphaned question categories. To fix, run:\n";
|
||||
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php --fix\n";
|
||||
} else {
|
||||
echo "No orphaned question categories found.\n";
|
||||
}
|
||||
|
||||
|
||||
$categories->close();
|
||||
+20
-79
@@ -69,19 +69,15 @@ Options:
|
||||
--prefix=STRING Table prefix for above database tables. Default is mdl_
|
||||
--fullname=STRING The fullname of the site
|
||||
--shortname=STRING The shortname of the site
|
||||
--summary=STRING The summary to be displayed on the front page
|
||||
--adminuser=USERNAME Username for the moodle admin account. Default is admin
|
||||
--adminpass=PASSWORD Password for the moodle admin account,
|
||||
required in non-interactive mode.
|
||||
--adminemail=STRING Email address for the moodle admin account.
|
||||
--upgradekey=STRING The upgrade key to be set in the config.php, leave empty to not set it.
|
||||
--non-interactive No interactive questions, installation fails if any
|
||||
problem encountered.
|
||||
--agree-license Indicates agreement with software license,
|
||||
required in non-interactive mode.
|
||||
--allow-unstable Install even if the version is not marked as stable yet,
|
||||
required in non-interactive mode.
|
||||
--skip-database Stop the installation before installing the database.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -90,7 +86,7 @@ Example:
|
||||
|
||||
|
||||
// distro specific customisation
|
||||
$distrolibfile = __DIR__.'/../../install/distrolib.php';
|
||||
$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
|
||||
$distro = null;
|
||||
if (file_exists($distrolibfile)) {
|
||||
require_once($distrolibfile);
|
||||
@@ -100,7 +96,7 @@ if (file_exists($distrolibfile)) {
|
||||
}
|
||||
|
||||
// Nothing to do if config.php exists
|
||||
$configfile = __DIR__.'/../../config.php';
|
||||
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
|
||||
if (file_exists($configfile)) {
|
||||
require($configfile);
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
@@ -124,11 +120,10 @@ $olddir = getcwd();
|
||||
chdir(dirname($_SERVER['argv'][0]));
|
||||
|
||||
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
|
||||
if (!function_exists('date_default_timezone_set') or !function_exists('date_default_timezone_get')) {
|
||||
fwrite(STDERR, "Timezone functions are not available.\n");
|
||||
exit(1);
|
||||
// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this.
|
||||
if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) {
|
||||
@date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
|
||||
// make sure PHP errors are displayed - helps with diagnosing of problems
|
||||
@error_reporting(E_ALL);
|
||||
@@ -147,10 +142,10 @@ define('PHPUNIT_TEST', false);
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
if (version_compare(phpversion(), "5.6.5") < 0) {
|
||||
if (version_compare(phpversion(), "5.4.4") < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
|
||||
fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -159,7 +154,7 @@ if (version_compare(phpversion(), "5.6.5") < 0) {
|
||||
global $CFG;
|
||||
$CFG = new stdClass();
|
||||
$CFG->lang = 'en';
|
||||
$CFG->dirroot = dirname(dirname(__DIR__));
|
||||
$CFG->dirroot = dirname(dirname(dirname(__FILE__)));
|
||||
$CFG->libdir = "$CFG->dirroot/lib";
|
||||
$CFG->wwwroot = "http://localhost";
|
||||
$CFG->httpswwwroot = $CFG->wwwroot;
|
||||
@@ -172,7 +167,7 @@ $CFG->debug = (E_ALL | E_STRICT);
|
||||
$CFG->debugdisplay = true;
|
||||
$CFG->debugdeveloper = true;
|
||||
|
||||
$parts = explode('/', str_replace('\\', '/', dirname(__DIR__)));
|
||||
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
|
||||
$CFG->admin = array_pop($parts);
|
||||
|
||||
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
|
||||
@@ -244,7 +239,7 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
|
||||
'lang' => $CFG->lang,
|
||||
'wwwroot' => '',
|
||||
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(__DIR__))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
|
||||
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
|
||||
'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
|
||||
'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
|
||||
'dbname' => 'moodle',
|
||||
@@ -255,15 +250,11 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'prefix' => 'mdl_',
|
||||
'fullname' => '',
|
||||
'shortname' => '',
|
||||
'summary' => '',
|
||||
'adminuser' => 'admin',
|
||||
'adminpass' => '',
|
||||
'adminemail' => '',
|
||||
'upgradekey' => '',
|
||||
'non-interactive' => false,
|
||||
'agree-license' => false,
|
||||
'allow-unstable' => false,
|
||||
'skip-database' => false,
|
||||
'help' => false
|
||||
),
|
||||
array(
|
||||
@@ -275,8 +266,7 @@ $interactive = empty($options['non-interactive']);
|
||||
|
||||
// set up language
|
||||
$lang = clean_param($options['lang'], PARAM_SAFEDIR);
|
||||
$languages = get_string_manager()->get_list_of_translations();
|
||||
if (array_key_exists($lang, $languages)) {
|
||||
if (file_exists($CFG->dirroot.'/install/lang/'.$lang)) {
|
||||
$CFG->lang = $lang;
|
||||
}
|
||||
|
||||
@@ -291,41 +281,28 @@ if ($options['help']) {
|
||||
}
|
||||
|
||||
//Print header
|
||||
cli_logo();
|
||||
echo PHP_EOL;
|
||||
echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
|
||||
|
||||
//Fist select language
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
$languages = get_string_manager()->get_list_of_translations();
|
||||
// Do not put the langs into columns because it is not compatible with RTL.
|
||||
$langlist = implode("\n", $languages);
|
||||
$default = $CFG->lang;
|
||||
cli_heading(get_string('chooselanguagehead', 'install'));
|
||||
if (array_key_exists($default, $languages)) {
|
||||
echo $default.' - '.$languages[$default]."\n";
|
||||
}
|
||||
if ($default !== 'en') {
|
||||
echo 'en - English (en)'."\n";
|
||||
}
|
||||
echo '? - '.get_string('availablelangs', 'install')."\n";
|
||||
cli_heading(get_string('availablelangs', 'install'));
|
||||
echo $langlist."\n";
|
||||
$prompt = get_string('clitypevaluedefault', 'admin', $CFG->lang);
|
||||
$error = '';
|
||||
do {
|
||||
echo $error;
|
||||
$input = cli_input($prompt, $default);
|
||||
$input = clean_param($input, PARAM_SAFEDIR);
|
||||
|
||||
if ($input === '?') {
|
||||
echo implode("\n", $languages)."\n";
|
||||
$error = "\n";
|
||||
|
||||
if (!file_exists($CFG->dirroot.'/install/lang/'.$input)) {
|
||||
$error = get_string('cliincorrectvalueretry', 'admin')."\n";
|
||||
} else {
|
||||
$input = clean_param($input, PARAM_SAFEDIR);
|
||||
|
||||
if (!array_key_exists($input, $languages)) {
|
||||
$error = get_string('cliincorrectvalueretry', 'admin')."\n";
|
||||
} else {
|
||||
$error = '';
|
||||
}
|
||||
$error = '';
|
||||
}
|
||||
} while ($error !== '');
|
||||
$CFG->lang = $input;
|
||||
@@ -710,38 +687,6 @@ if ($interactive) {
|
||||
}
|
||||
}
|
||||
|
||||
// Ask for the admin email address.
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
cli_heading(get_string('cliadminemail', 'install'));
|
||||
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminemail']);
|
||||
$options['adminemail'] = cli_input($prompt);
|
||||
}
|
||||
|
||||
// Validate that the address provided was an e-mail address.
|
||||
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
|
||||
$a = (object) array('option' => 'adminemail', 'value' => $options['adminemail']);
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
// Ask for the upgrade key.
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
cli_heading(get_string('upgradekeyset', 'admin'));
|
||||
if ($options['upgradekey'] !== '') {
|
||||
$prompt = get_string('clitypevaluedefault', 'admin', $options['upgradekey']);
|
||||
$options['upgradekey'] = cli_input($prompt, $options['upgradekey']);
|
||||
} else {
|
||||
$prompt = get_string('clitypevalue', 'admin');
|
||||
$options['upgradekey'] = cli_input($prompt);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the upgrade key if it was provided.
|
||||
if ($options['upgradekey'] !== '') {
|
||||
$CFG->upgradekey = $options['upgradekey'];
|
||||
}
|
||||
|
||||
if ($interactive) {
|
||||
if (!$options['agree-license']) {
|
||||
cli_separator();
|
||||
@@ -806,11 +751,7 @@ if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
if (!$options['skip-database']) {
|
||||
install_cli_database($options, $interactive);
|
||||
} else {
|
||||
echo get_string('cliskipdatabase', 'install')."\n";
|
||||
}
|
||||
install_cli_database($options, $interactive);
|
||||
|
||||
echo get_string('cliinstallfinished', 'install')."\n";
|
||||
exit(0); // 0 means success
|
||||
|
||||
@@ -52,7 +52,6 @@ Options:
|
||||
--lang=CODE Installation and default site language. Default is en.
|
||||
--adminuser=USERNAME Username for the moodle admin account. Default is admin.
|
||||
--adminpass=PASSWORD Password for the moodle admin account.
|
||||
--adminemail=STRING Email address for the moodle admin account.
|
||||
--agree-license Indicates agreement with software license.
|
||||
--fullname=STRING Name of the site
|
||||
--shortname=STRING Name of the site
|
||||
@@ -63,16 +62,16 @@ Example:
|
||||
";
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
if (version_compare(phpversion(), "5.6.5") < 0) {
|
||||
if (version_compare(phpversion(), "5.4.4") < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
|
||||
fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Nothing to do if config.php does not exist
|
||||
$configfile = __DIR__.'/../../config.php';
|
||||
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
|
||||
if (!file_exists($configfile)) {
|
||||
fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize
|
||||
fwrite(STDERR, "\n");
|
||||
@@ -103,7 +102,6 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'lang' => 'en',
|
||||
'adminuser' => 'admin',
|
||||
'adminpass' => '',
|
||||
'adminemail' => '',
|
||||
'fullname' => '',
|
||||
'shortname' => '',
|
||||
'agree-license' => false,
|
||||
@@ -128,12 +126,6 @@ if ($options['adminpass'] === true or $options['adminpass'] === '') {
|
||||
cli_error('You have to specify admin password. --help prints out the help'); // TODO: localize
|
||||
}
|
||||
|
||||
// Validate that the address provided was an e-mail address.
|
||||
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
|
||||
$a = (object) array('option' => 'adminemail', 'value' => $options['adminemail']);
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
|
||||
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
|
||||
$options['lang'] = 'en';
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
if ($DB->get_dbfamily() !== 'mysql') {
|
||||
@@ -64,71 +64,6 @@ if (!empty($options['collation'])) {
|
||||
cli_error("Error: collation '$collation' is not available on this server!");
|
||||
}
|
||||
|
||||
$collationinfo = explode('_', $collation);
|
||||
$charset = reset($collationinfo);
|
||||
|
||||
$engine = strtolower($DB->get_dbengine());
|
||||
|
||||
// Do checks for utf8mb4.
|
||||
if (strpos($collation, 'utf8mb4') === 0) {
|
||||
// Do we have the right engine?
|
||||
if ($engine !== 'innodb' && $engine !== 'xtradb') {
|
||||
cli_error("Error: '$collation' requires InnoDB or XtraDB set as the engine.");
|
||||
}
|
||||
// Are we using Barracuda?
|
||||
if ($DB->get_row_format() != 'Barracuda') {
|
||||
// Try setting it here.
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the file format to be set to Barracuda.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_file_format changed to Barracuda\n";
|
||||
}
|
||||
// Is one file per table being used?
|
||||
if (!$DB->is_file_per_table_enabled()) {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_per_table=1");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the setting 'innodb_file_per_table' be set to 'ON'.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_file_per_table changed to 1\n";
|
||||
}
|
||||
// Is large prefix set?
|
||||
if (!$DB->is_large_prefix_enabled()) {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_large_prefix=1");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the setting 'innodb_large_prefix' be set to 'ON'.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_large_prefix changed to 1\n";
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SHOW VARIABLES LIKE 'collation_database'";
|
||||
if (!$dbcollation = $DB->get_record_sql($sql)) {
|
||||
cli_error("Error: Could not access collation information on the database.");
|
||||
}
|
||||
$sql = "SHOW VARIABLES LIKE 'character_set_database'";
|
||||
if (!$dbcharset = $DB->get_record_sql($sql)) {
|
||||
cli_error("Error: Could not access character set information on the database.");
|
||||
}
|
||||
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
|
||||
// Try to convert the DB.
|
||||
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
|
||||
$sql = "ALTER DATABASE $CFG->dbname DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
|
||||
try {
|
||||
$DB->change_database_structure($sql);
|
||||
} catch (exception $e) {
|
||||
cli_error("Error: Tried to alter the database with no success. Please try manually changing the database
|
||||
to the new collation and character set and then run this script again.");
|
||||
}
|
||||
echo "DATABASE CONVERTED\n";
|
||||
}
|
||||
|
||||
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
@@ -145,7 +80,7 @@ if (!empty($options['collation'])) {
|
||||
$skipped++;
|
||||
|
||||
} else {
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation");
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
@@ -161,32 +96,18 @@ if (!empty($options['collation'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for utf8mb4 collation.
|
||||
$rowformat = $DB->get_row_format_sql($engine, $collation);
|
||||
|
||||
if ($column->type === 'tinytext' or $column->type === 'mediumtext' or $column->type === 'text' or $column->type === 'longtext') {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name
|
||||
MODIFY COLUMN $column->field $column->type
|
||||
CHARACTER SET $charset
|
||||
COLLATE $collation $notnull $default";
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
|
||||
} else if (strpos($column->type, 'varchar') === 0) {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
|
||||
|
||||
if ($rowformat != '') {
|
||||
$sql = "ALTER TABLE $table->name $rowformat";
|
||||
$DB->change_database_structure($sql);
|
||||
}
|
||||
|
||||
$sql = "ALTER TABLE $table->name
|
||||
MODIFY COLUMN $column->field $column->type
|
||||
CHARACTER SET $charset
|
||||
COLLATE $collation $notnull $default";
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
} else {
|
||||
echo "ERROR (unknown column type: $column->type)\n";
|
||||
@@ -259,9 +180,7 @@ function mysql_get_collations() {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$sql = "SHOW COLLATION
|
||||
WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'
|
||||
OR Collation LIKE 'utf8mb4\_%' AND Charset = 'utf8mb4'";
|
||||
$sql = "SHOW COLLATION WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs as $collation) {
|
||||
$collations[$collation->collation] = $collation->collation;
|
||||
|
||||
@@ -1,202 +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/>.
|
||||
|
||||
/**
|
||||
* MySQL table row compression tool tool.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @author Petr Skoda <petr.skoda@totaralms.com>
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once($CFG->libdir . '/clilib.php');
|
||||
|
||||
if ($DB->get_dbfamily() !== 'mysql') {
|
||||
cli_error('This script is used for MySQL databases only.');
|
||||
}
|
||||
|
||||
$engine = strtolower($DB->get_dbengine());
|
||||
if ($engine !== 'innodb' and $engine !== 'xtradb') {
|
||||
cli_error('This script is for MySQL servers using InnoDB or XtraDB engines only.');
|
||||
}
|
||||
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array('help' => false, 'info' => false, 'list' => false, 'fix' => false, 'showsql' => false),
|
||||
array('h' => 'help', 'i' => 'info', 'l' => 'list', 'f' => 'fix', 's' => 'showsql')
|
||||
);
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
$help =
|
||||
"Script for detection of row size problems in MySQL InnoDB tables.
|
||||
|
||||
By default InnoDB storage table is using legacy Antelope file format
|
||||
which has major restriction on database row size.
|
||||
Use this script to detect and fix database tables with potential data
|
||||
overflow problems.
|
||||
|
||||
Options:
|
||||
-i, --info Show database information
|
||||
-l, --list List problematic tables
|
||||
-f, --fix Attempt to fix all tables (requires SUPER privilege)
|
||||
-s, --showsql Print SQL statements for fixing of tables
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_compressed_rows.php -l
|
||||
";
|
||||
|
||||
/** @var mysql_sql_generator $generator */
|
||||
$generator = $DB->get_manager()->generator;
|
||||
|
||||
$info = $DB->get_server_info();
|
||||
$filepertable = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_per_table'");
|
||||
$filepertable = $filepertable ? $filepertable->value : '';
|
||||
$fileformat = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_format'");
|
||||
$fileformat = $fileformat ? $fileformat->value : '';
|
||||
$prefix = $DB->get_prefix();
|
||||
$database = $CFG->dbname;
|
||||
|
||||
if (!empty($options['info'])) {
|
||||
echo "Database version: " . $info['description'] . "\n";
|
||||
echo "Database name: $database\n";
|
||||
echo "Database engine: " . $DB->get_dbengine() . "\n";
|
||||
echo "innodb_file_per_table: $filepertable\n";
|
||||
echo "innodb_file_format: $fileformat\n";
|
||||
|
||||
exit(0);
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
$problem = false;
|
||||
foreach ($DB->get_tables(false) as $table) {
|
||||
$columns = $DB->get_columns($table, false);
|
||||
$size = $generator->guess_antelope_row_size($columns);
|
||||
$format = $DB->get_row_format($table);
|
||||
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT);
|
||||
echo str_pad($format, 11, ' ', STR_PAD_RIGHT);
|
||||
|
||||
if ($format === 'Compact' or $format === 'Redundant') {
|
||||
$problem = true;
|
||||
echo " (needs fixing)\n";
|
||||
|
||||
} else if ($format !== 'Compressed' and $format !== 'Dynamic') {
|
||||
echo " (unknown)\n";
|
||||
|
||||
} else {
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($problem) {
|
||||
exit(1);
|
||||
}
|
||||
exit(0);
|
||||
|
||||
} else if (!empty($options['fix'])) {
|
||||
$fixtables = array();
|
||||
foreach ($DB->get_tables(false) as $table) {
|
||||
$columns = $DB->get_columns($table, false);
|
||||
$size = $generator->guess_antelope_row_size($columns);
|
||||
$format = $DB->get_row_format($table);
|
||||
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
|
||||
continue;
|
||||
}
|
||||
if ($format === 'Compact' or $format === 'Redundant') {
|
||||
$fixtables[$table] = $table;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fixtables) {
|
||||
echo "No changes necessary\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($filepertable !== 'ON') {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_per_table=1");
|
||||
} catch (dml_exception $e) {
|
||||
echo "Cannot enable GLOBAL innodb_file_per_table setting, use --showsql option and execute the statements manually.";
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
if ($fileformat !== 'Barracuda') {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
|
||||
} catch (dml_exception $e) {
|
||||
echo "Cannot change GLOBAL innodb_file_format setting, use --showsql option and execute the statements manually.";
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$DB->is_compressed_row_format_supported(false)) {
|
||||
echo "MySQL server is not compatible with compressed row format.";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
foreach ($fixtables as $table) {
|
||||
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
|
||||
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
} else if (!empty($options['showsql'])) {
|
||||
$fixtables = array();
|
||||
|
||||
foreach ($DB->get_tables(false) as $table) {
|
||||
$columns = $DB->get_columns($table, false);
|
||||
$size = $generator->guess_antelope_row_size($columns);
|
||||
$format = $DB->get_row_format($table);
|
||||
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
|
||||
continue;
|
||||
}
|
||||
if ($format === 'Compact' or $format === 'Redundant') {
|
||||
$fixtables[$table] = $table;
|
||||
}
|
||||
}
|
||||
if (!$fixtables) {
|
||||
echo "No changes necessary\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
echo "Copy the following SQL statements and execute them using account with SUPER privilege:\n\n";
|
||||
echo "USE $database;\n";
|
||||
echo "SET SESSION sql_mode=STRICT_ALL_TABLES;\n";
|
||||
echo "SET GLOBAL innodb_file_per_table=1;\n";
|
||||
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
|
||||
foreach ($fixtables as $table) {
|
||||
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
|
||||
}
|
||||
echo "\n";
|
||||
exit(0);
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
if ($DB->get_dbfamily() !== 'mysql') {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
|
||||
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
|
||||
|
||||
@@ -26,26 +26,13 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
// Define the input options.
|
||||
$longparams = array(
|
||||
'help' => false,
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'ignore-password-policy' => false
|
||||
);
|
||||
|
||||
$shortparams = array(
|
||||
'h' => 'help',
|
||||
'u' => 'username',
|
||||
'p' => 'password',
|
||||
'i' => 'ignore-password-policy'
|
||||
);
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params($longparams, $shortparams);
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false),
|
||||
array('h'=>'help'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
@@ -60,43 +47,29 @@ There are no security checks here because anybody who is able to
|
||||
execute this file may execute any PHP too.
|
||||
|
||||
Options:
|
||||
-h, --help Print out this help
|
||||
-u, --username=username Specify username to change
|
||||
-p, --password=newpassword Specify new password
|
||||
--ignore-password-policy Ignore password policy when setting password
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php --username=rosaura --password=jiu3jiu --ignore-password-policy
|
||||
";
|
||||
"; //TODO: localize - to be translated later when everything is finished
|
||||
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
if ($options['username'] == '' ) {
|
||||
cli_heading('Password reset');
|
||||
$prompt = "Enter username (manual authentication only)";
|
||||
$username = cli_input($prompt);
|
||||
} else {
|
||||
$username = $options['username'];
|
||||
}
|
||||
cli_heading('Password reset'); // TODO: localize
|
||||
$prompt = "enter username (manual authentication only)"; // TODO: localize
|
||||
$username = cli_input($prompt);
|
||||
|
||||
if (!$user = $DB->get_record('user', array('auth'=>'manual', 'username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
cli_error("Can not find user '$username'");
|
||||
}
|
||||
|
||||
if ($options['password'] == '' ) {
|
||||
$prompt = "Enter new password";
|
||||
$password = cli_input($prompt);
|
||||
} else {
|
||||
$password = $options['password'];
|
||||
}
|
||||
$prompt = "Enter new password"; // TODO: localize
|
||||
$password = cli_input($prompt);
|
||||
|
||||
$errmsg = '';//prevent eclipse warning
|
||||
if (!$options['ignore-password-policy'] ) {
|
||||
if (!check_password_policy($password, $errmsg)) {
|
||||
cli_error(html_to_text($errmsg, 0));
|
||||
}
|
||||
if (!check_password_policy($password, $errmsg)) {
|
||||
cli_error($errmsg);
|
||||
}
|
||||
|
||||
$hashedpassword = hash_internal_user_password($password);
|
||||
@@ -105,4 +78,4 @@ $DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
|
||||
|
||||
echo "Password changed\n";
|
||||
|
||||
exit(0); // 0 means success.
|
||||
exit(0); // 0 means success
|
||||
+2
-12
@@ -38,30 +38,24 @@ if (function_exists('opcache_reset') and !isset($_SERVER['REMOTE_ADDR'])) {
|
||||
define('CLI_SCRIPT', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
|
||||
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
|
||||
// now get cli options
|
||||
$lang = isset($SESSION->lang) ? $SESSION->lang : $CFG->lang;
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'non-interactive' => false,
|
||||
'allow-unstable' => false,
|
||||
'help' => false,
|
||||
'lang' => $lang
|
||||
'help' => false
|
||||
),
|
||||
array(
|
||||
'h' => 'help'
|
||||
)
|
||||
);
|
||||
|
||||
if ($options['lang']) {
|
||||
$SESSION->lang = $options['lang'];
|
||||
}
|
||||
|
||||
$interactive = empty($options['non-interactive']);
|
||||
|
||||
if ($unrecognized) {
|
||||
@@ -80,10 +74,6 @@ Options:
|
||||
--non-interactive No interactive questions or confirmations
|
||||
--allow-unstable Upgrade even if the version is not marked as stable yet,
|
||||
required in non-interactive mode.
|
||||
--lang=CODE Set preferred language for CLI output. Defaults to the
|
||||
site language if not set. Defaults to 'en' if the lang
|
||||
parameter is invalid or if the language pack is not
|
||||
installed.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
|
||||
@@ -1,82 +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/>.
|
||||
|
||||
/**
|
||||
* Lets users manage data formats
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @copyright 2016 Brendan Heywood (brendan@catalyst-au.net)
|
||||
* @package core
|
||||
* @subpackage dataformat
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$name = required_param('name', PARAM_PLUGIN);
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
$PAGE->set_url('/admin/dataformats.php');
|
||||
$PAGE->set_context($syscontext);
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', $syscontext);
|
||||
require_sesskey();
|
||||
|
||||
$return = new moodle_url('/admin/settings.php', array('section' => 'managedataformats'));
|
||||
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
|
||||
$sortorder = array_flip(array_keys($plugins));
|
||||
|
||||
if (!isset($plugins[$name])) {
|
||||
print_error('courseformatnotfound', 'error', $return, $name);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
if ($plugins[$name]->is_enabled()) {
|
||||
set_config('disabled', 1, 'dataformat_'. $name);
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
break;
|
||||
case 'enable':
|
||||
if (!$plugins[$name]->is_enabled()) {
|
||||
unset_config('disabled', 'dataformat_'. $name);
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
break;
|
||||
case 'up':
|
||||
if ($sortorder[$name]) {
|
||||
$currentindex = $sortorder[$name];
|
||||
$seq = array_keys($plugins);
|
||||
$seq[$currentindex] = $seq[$currentindex - 1];
|
||||
$seq[$currentindex - 1] = $name;
|
||||
set_config('dataformat_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
case 'down':
|
||||
if ($sortorder[$name] < count($sortorder) - 1) {
|
||||
$currentindex = $sortorder[$name];
|
||||
$seq = array_keys($plugins);
|
||||
$seq[$currentindex] = $seq[$currentindex + 1];
|
||||
$seq[$currentindex + 1] = $name;
|
||||
set_config('dataformat_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
}
|
||||
redirect($return);
|
||||
|
||||
@@ -45,7 +45,7 @@ admin_externalpage_setup('environment', '', $extraurlparams);
|
||||
// Handle the 'updatecomponent' action
|
||||
if ($action == 'updatecomponent' && confirm_sesskey()) {
|
||||
// Create component installer and execute it
|
||||
if ($cd = new component_installer('https://download.moodle.org',
|
||||
if ($cd = new component_installer('http://download.moodle.org',
|
||||
'environment',
|
||||
'environment.zip')) {
|
||||
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
|
||||
@@ -53,7 +53,7 @@ if ($action == 'updatecomponent' && confirm_sesskey()) {
|
||||
case COMPONENT_ERROR:
|
||||
if ($cd->get_error() == 'remotedownloaderror') {
|
||||
$a = new stdClass();
|
||||
$a->url = 'https://download.moodle.org/environment/environment.zip';
|
||||
$a->url = 'http://download.moodle.org/environment/environment.zip';
|
||||
$a->dest = $CFG->dataroot . '/';
|
||||
print_error($cd->get_error(), 'error', $PAGE->url, $a);
|
||||
die();
|
||||
|
||||
@@ -1027,7 +1027,6 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -1135,774 +1134,6 @@
|
||||
<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_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.8" requires="2.2">
|
||||
<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.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="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="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="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="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_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.9" requires="2.2">
|
||||
<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.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="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="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="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_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.0" requires="2.2">
|
||||
<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.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="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="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="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_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.1" 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.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="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_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_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.2" 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.1" />
|
||||
<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="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="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_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_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
|
||||
+68
-338
@@ -30,10 +30,10 @@ if (!file_exists('../config.php')) {
|
||||
}
|
||||
|
||||
// Check that PHP is of a sufficient version as soon as possible
|
||||
if (version_compare(phpversion(), '5.6.5') < 0) {
|
||||
if (version_compare(phpversion(), '5.4.4') < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
|
||||
echo "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).<br />";
|
||||
echo "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).<br />";
|
||||
echo "Please upgrade your server software or install older Moodle version.";
|
||||
die();
|
||||
}
|
||||
@@ -52,24 +52,8 @@ if (!function_exists('json_encode') || !function_exists('json_decode')) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Make sure xml extension is available.
|
||||
if (!extension_loaded('xml')) {
|
||||
echo 'Moodle requires the xml PHP extension. Please install or enable the xml extension.';
|
||||
die();
|
||||
}
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
if (isset($_POST['upgradekey'])) {
|
||||
// Before you start reporting issues about the collision attacks against
|
||||
// SHA-1, you should understand that we are not actually attempting to do
|
||||
// any cryptography here. This is hashed purely so that the key is not
|
||||
// that apparent in the address bar itself. Anyone who catches the HTTP
|
||||
// traffic can immediately use it as a valid admin key.
|
||||
header('Location: index.php?cache=0&upgradekeyhash='.sha1($_POST['upgradekey']));
|
||||
die();
|
||||
}
|
||||
|
||||
if ((isset($_GET['cache']) and $_GET['cache'] === '0')
|
||||
or (isset($_POST['cache']) and $_POST['cache'] === '0')
|
||||
or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
|
||||
@@ -104,51 +88,23 @@ core_component::get_core_subsystems();
|
||||
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
|
||||
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
|
||||
|
||||
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL); // Core upgrade confirmed?
|
||||
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL); // Core release info and server checks confirmed?
|
||||
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL); // Plugins check page confirmed?
|
||||
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL); // Show all plugins on the plugins check page?
|
||||
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL); // GPL license confirmed for installation?
|
||||
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL); // Should check for available updates?
|
||||
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW); // Plugin installation requested at moodle.org/plugins.
|
||||
$upgradekeyhash = optional_param('upgradekeyhash', null, PARAM_ALPHANUM); // Hash of provided upgrade key.
|
||||
$installdep = optional_param('installdep', null, PARAM_COMPONENT); // Install given missing dependency (required plugin).
|
||||
$installdepx = optional_param('installdepx', false, PARAM_BOOL); // Install all missing dependencies.
|
||||
$confirminstalldep = optional_param('confirminstalldep', false, PARAM_BOOL); // Installing dependencies confirmed.
|
||||
$abortinstall = optional_param('abortinstall', null, PARAM_COMPONENT); // Cancel installation of the given new plugin.
|
||||
$abortinstallx = optional_param('abortinstallx', null, PARAM_BOOL); // Cancel installation of all new plugins.
|
||||
$confirmabortinstall = optional_param('confirmabortinstall', false, PARAM_BOOL); // Installation cancel confirmed.
|
||||
$abortupgrade = optional_param('abortupgrade', null, PARAM_COMPONENT); // Cancel upgrade of the given existing plugin.
|
||||
$abortupgradex = optional_param('abortupgradex', null, PARAM_BOOL); // Cancel upgrade of all upgradable plugins.
|
||||
$confirmabortupgrade = optional_param('confirmabortupgrade', false, PARAM_BOOL); // Upgrade cancel confirmed.
|
||||
$installupdate = optional_param('installupdate', null, PARAM_COMPONENT); // Install given available update.
|
||||
$installupdateversion = optional_param('installupdateversion', null, PARAM_INT); // Version of the available update to install.
|
||||
$installupdatex = optional_param('installupdatex', false, PARAM_BOOL); // Install all available plugin updates.
|
||||
$confirminstallupdate = optional_param('confirminstallupdate', false, PARAM_BOOL); // Available update(s) install confirmed?
|
||||
|
||||
if (!empty($CFG->disableupdateautodeploy)) {
|
||||
// Invalidate all requests to install plugins via the admin UI.
|
||||
$newaddonreq = null;
|
||||
$installdep = null;
|
||||
$installdepx = false;
|
||||
$abortupgrade = null;
|
||||
$abortupgradex = null;
|
||||
$installupdate = null;
|
||||
$installupdateversion = null;
|
||||
$installupdatex = false;
|
||||
}
|
||||
$id = optional_param('id', '', PARAM_TEXT);
|
||||
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
|
||||
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
|
||||
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
|
||||
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
|
||||
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
|
||||
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
|
||||
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW);
|
||||
|
||||
// Set up PAGE.
|
||||
$url = new moodle_url('/admin/index.php');
|
||||
$url->param('cache', $cache);
|
||||
if (isset($upgradekeyhash)) {
|
||||
$url->param('upgradekeyhash', $upgradekeyhash);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
unset($url);
|
||||
|
||||
// Are we returning from an add-on installation request at moodle.org/plugins?
|
||||
if ($newaddonreq and !$cache and empty($CFG->disableupdateautodeploy)) {
|
||||
if ($newaddonreq and !$cache and empty($CFG->disableonclickaddoninstall)) {
|
||||
$target = new moodle_url('/admin/tool/installaddon/index.php', array(
|
||||
'installaddonrequest' => $newaddonreq,
|
||||
'confirm' => 0));
|
||||
@@ -219,6 +175,7 @@ if (!core_tables_exist()) {
|
||||
$PAGE->set_heading($strinstallation);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->install_licence_page();
|
||||
die();
|
||||
@@ -233,6 +190,7 @@ if (!core_tables_exist()) {
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->install_environment_page($maturity, $envstatus, $environment_results, $release);
|
||||
die();
|
||||
@@ -246,7 +204,7 @@ if (!core_tables_exist()) {
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
$url = new moodle_url($PAGE->url, array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
|
||||
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
|
||||
die();
|
||||
}
|
||||
@@ -296,30 +254,17 @@ if (empty($CFG->version)) {
|
||||
// Detect config cache inconsistency, this happens when you switch branches on dev servers.
|
||||
if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))) {
|
||||
purge_all_caches();
|
||||
redirect(new moodle_url($PAGE->url), 'Config cache inconsistency detected, resetting caches...');
|
||||
redirect(new moodle_url('/admin/index.php'), 'Config cache inconsistency detected, resetting caches...');
|
||||
}
|
||||
|
||||
if (!$cache and $version > $CFG->version) { // upgrade
|
||||
|
||||
$PAGE->set_url(new moodle_url($PAGE->url, array(
|
||||
'confirmupgrade' => $confirmupgrade,
|
||||
'confirmrelease' => $confirmrelease,
|
||||
'confirmplugincheck' => $confirmplugins,
|
||||
)));
|
||||
|
||||
check_upgrade_key($upgradekeyhash);
|
||||
|
||||
// Warning about upgrading a test site.
|
||||
$testsite = false;
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$testsite = 'behat';
|
||||
}
|
||||
|
||||
if (isset($CFG->themerev)) {
|
||||
// Store the themerev to restore after purging caches.
|
||||
$themerev = $CFG->themerev;
|
||||
}
|
||||
|
||||
// We purge all of MUC's caches here.
|
||||
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
|
||||
// This ensures a real config object is loaded and the stores will be purged.
|
||||
@@ -329,11 +274,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
||||
// We then purge the regular caches.
|
||||
purge_all_caches();
|
||||
|
||||
if (isset($themerev)) {
|
||||
// Restore the themerev
|
||||
set_config('themerev', $themerev);
|
||||
}
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
@@ -378,137 +319,40 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$pluginman = core_plugin_manager::instance();
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
|
||||
|
||||
// Check for available updates.
|
||||
if ($fetchupdates) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$updateschecker = \core\update\checker::instance();
|
||||
if ($updateschecker->enabled()) {
|
||||
$updateschecker->fetch();
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
redirect($reloadurl);
|
||||
}
|
||||
|
||||
// Cancel all plugin installations.
|
||||
if ($abortinstallx) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$abortables = $pluginman->list_cancellable_installations();
|
||||
if ($abortables) {
|
||||
if ($confirmabortinstall) {
|
||||
foreach ($abortables as $plugin) {
|
||||
$pluginman->cancel_plugin_installation($plugin->component);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$continue = new moodle_url($PAGE->url, array('abortinstallx' => $abortinstallx, 'confirmabortinstall' => 1));
|
||||
echo $output->upgrade_confirm_abort_install_page($abortables, $continue);
|
||||
die();
|
||||
}
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
$deployer = \core\update\deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($reloadurl, $reloadurl);
|
||||
|
||||
// Cancel single plugin installation.
|
||||
if ($abortinstall) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
if ($confirmabortinstall) {
|
||||
$pluginman->cancel_plugin_installation($abortinstall);
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$continue = new moodle_url($PAGE->url, array('abortinstall' => $abortinstall, 'confirmabortinstall' => 1));
|
||||
$abortable = $pluginman->get_plugin_info($abortinstall);
|
||||
if ($pluginman->can_cancel_plugin_installation($abortable)) {
|
||||
echo $output->upgrade_confirm_abort_install_page(array($abortable), $continue);
|
||||
die();
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel all plugins upgrades (that is, restore archived versions).
|
||||
if ($abortupgradex) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$restorable = $pluginman->list_restorable_archives();
|
||||
if ($restorable) {
|
||||
upgrade_install_plugins($restorable, $confirmabortupgrade,
|
||||
get_string('cancelupgradehead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('abortupgradex' => 1, 'confirmabortupgrade' => 1))
|
||||
);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
// Cancel single plugin upgrade (that is, install the archived version).
|
||||
if ($abortupgrade) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$restorable = $pluginman->list_restorable_archives();
|
||||
if (isset($restorable[$abortupgrade])) {
|
||||
$restorable = array($restorable[$abortupgrade]);
|
||||
upgrade_install_plugins($restorable, $confirmabortupgrade,
|
||||
get_string('cancelupgradehead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('abortupgrade' => $abortupgrade, 'confirmabortupgrade' => 1))
|
||||
);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
// Install all available missing dependencies.
|
||||
if ($installdepx) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
|
||||
upgrade_install_plugins($installable, $confirminstalldep,
|
||||
get_string('dependencyinstallhead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('installdepx' => 1, 'confirminstalldep' => 1))
|
||||
);
|
||||
}
|
||||
|
||||
// Install single available missing dependency.
|
||||
if ($installdep) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
|
||||
if (!empty($installable[$installdep])) {
|
||||
$installable = array($installable[$installdep]);
|
||||
upgrade_install_plugins($installable, $confirminstalldep,
|
||||
get_string('dependencyinstallhead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('installdep' => $installdep, 'confirminstalldep' => 1))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Install all available updates.
|
||||
if ($installupdatex) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$installable = $pluginman->filter_installable($pluginman->available_updates());
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
|
||||
);
|
||||
}
|
||||
|
||||
// Install single available update.
|
||||
if ($installupdate and $installupdateversion) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
|
||||
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
|
||||
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
|
||||
)
|
||||
);
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
|
||||
$version, $showallplugins, $PAGE->url, new moodle_url($PAGE->url, array('confirmplugincheck' => 1)));
|
||||
$version, $showallplugins, $reloadurl,
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1, 'cache'=>0)));
|
||||
die();
|
||||
|
||||
} else {
|
||||
// Always verify plugin dependencies!
|
||||
$failed = array();
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
@@ -531,17 +375,9 @@ if (!$cache and $branch <> $CFG->branch) { // Update the branch
|
||||
}
|
||||
|
||||
if (!$cache and moodle_needs_upgrading()) {
|
||||
|
||||
$PAGE->set_url(new moodle_url($PAGE->url, array('confirmplugincheck' => $confirmplugins)));
|
||||
|
||||
check_upgrade_key($upgradekeyhash);
|
||||
|
||||
if (!$PAGE->headerprinted) {
|
||||
// means core upgrade or installation was not already done
|
||||
|
||||
$pluginman = core_plugin_manager::instance();
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
if (!$confirmplugins) {
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
|
||||
@@ -550,7 +386,6 @@ if (!$cache and moodle_needs_upgrading()) {
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
// Check for available updates.
|
||||
if ($fetchupdates) {
|
||||
require_sesskey();
|
||||
$updateschecker = \core\update\checker::instance();
|
||||
@@ -560,130 +395,36 @@ if (!$cache and moodle_needs_upgrading()) {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
// Cancel all plugin installations.
|
||||
if ($abortinstallx) {
|
||||
require_sesskey();
|
||||
$abortables = $pluginman->list_cancellable_installations();
|
||||
if ($abortables) {
|
||||
if ($confirmabortinstall) {
|
||||
foreach ($abortables as $plugin) {
|
||||
$pluginman->cancel_plugin_installation($plugin->component);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$continue = new moodle_url($PAGE->url, array('abortinstallx' => $abortinstallx,
|
||||
'confirmabortinstall' => 1));
|
||||
echo $output->upgrade_confirm_abort_install_page($abortables, $continue);
|
||||
die();
|
||||
}
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
// Cancel single plugin installation.
|
||||
if ($abortinstall) {
|
||||
require_sesskey();
|
||||
if ($confirmabortinstall) {
|
||||
$pluginman->cancel_plugin_installation($abortinstall);
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$continue = new moodle_url($PAGE->url, array('abortinstall' => $abortinstall, 'confirmabortinstall' => 1));
|
||||
$abortable = $pluginman->get_plugin_info($abortinstall);
|
||||
if ($pluginman->can_cancel_plugin_installation($abortable)) {
|
||||
echo $output->upgrade_confirm_abort_install_page(array($abortable), $continue);
|
||||
die();
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
$deployer = \core\update\deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($PAGE->url, $PAGE->url);
|
||||
|
||||
// Cancel all plugins upgrades (that is, restore archived versions).
|
||||
if ($abortupgradex) {
|
||||
require_sesskey();
|
||||
$restorable = $pluginman->list_restorable_archives();
|
||||
if ($restorable) {
|
||||
upgrade_install_plugins($restorable, $confirmabortupgrade,
|
||||
get_string('cancelupgradehead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('abortupgradex' => 1, 'confirmabortupgrade' => 1))
|
||||
);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
// Cancel single plugin upgrade (that is, install the archived version).
|
||||
if ($abortupgrade) {
|
||||
require_sesskey();
|
||||
$restorable = $pluginman->list_restorable_archives();
|
||||
if (isset($restorable[$abortupgrade])) {
|
||||
$restorable = array($restorable[$abortupgrade]);
|
||||
upgrade_install_plugins($restorable, $confirmabortupgrade,
|
||||
get_string('cancelupgradehead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('abortupgrade' => $abortupgrade, 'confirmabortupgrade' => 1))
|
||||
);
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
// Install all available missing dependencies.
|
||||
if ($installdepx) {
|
||||
require_sesskey();
|
||||
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
|
||||
upgrade_install_plugins($installable, $confirminstalldep,
|
||||
get_string('dependencyinstallhead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('installdepx' => 1, 'confirminstalldep' => 1))
|
||||
);
|
||||
}
|
||||
|
||||
// Install single available missing dependency.
|
||||
if ($installdep) {
|
||||
require_sesskey();
|
||||
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
|
||||
if (!empty($installable[$installdep])) {
|
||||
$installable = array($installable[$installdep]);
|
||||
upgrade_install_plugins($installable, $confirminstalldep,
|
||||
get_string('dependencyinstallhead', 'core_plugin'),
|
||||
new moodle_url($PAGE->url, array('installdep' => $installdep, 'confirminstalldep' => 1))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Install all available updates.
|
||||
if ($installupdatex) {
|
||||
require_sesskey();
|
||||
$installable = $pluginman->filter_installable($pluginman->available_updates());
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
|
||||
);
|
||||
}
|
||||
|
||||
// Install single available update.
|
||||
if ($installupdate and $installupdateversion) {
|
||||
require_sesskey();
|
||||
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
|
||||
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
|
||||
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
|
||||
)
|
||||
);
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
require_sesskey();
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
// Show plugins info.
|
||||
echo $output->upgrade_plugin_check_page($pluginman, \core\update\checker::instance(),
|
||||
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
|
||||
$version, $showallplugins,
|
||||
new moodle_url($PAGE->url),
|
||||
new moodle_url($PAGE->url, array('confirmplugincheck' => 1, 'cache' => 0)));
|
||||
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1, 'cache'=>0)));
|
||||
die();
|
||||
}
|
||||
|
||||
// Make sure plugin dependencies are always checked.
|
||||
$failed = array();
|
||||
if (!$pluginman->all_plugins_ok($version, $failed)) {
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('cache' => 0));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
@@ -773,15 +514,7 @@ if (isguestuser()) {
|
||||
redirect(get_login_url());
|
||||
}
|
||||
$context = context_system::instance();
|
||||
|
||||
if (!has_capability('moodle/site:config', $context)) {
|
||||
// Do not throw exception display an empty page with administration menu if visible for current user.
|
||||
$PAGE->set_title($SITE->fullname);
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
// check that site is properly customized
|
||||
$site = get_site();
|
||||
@@ -789,10 +522,14 @@ if (empty($site->shortname)) {
|
||||
// probably new installation - lets return to frontpage after this step
|
||||
// remove settings that we want uninitialised
|
||||
unset_config('registerauth');
|
||||
unset_config('timezone'); // Force admin to select timezone!
|
||||
redirect('upgradesettings.php?return=site');
|
||||
}
|
||||
|
||||
// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
|
||||
if (!empty($id) and $id == $CFG->siteidentifier) {
|
||||
set_config('registered', time());
|
||||
}
|
||||
|
||||
// setup critical warnings before printing admin tree block
|
||||
$insecuredataroot = is_dataroot_insecure(true);
|
||||
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
|
||||
@@ -818,29 +555,24 @@ if (isset($SESSION->pluginuninstallreturn)) {
|
||||
// Print default admin page with notifications.
|
||||
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
|
||||
|
||||
// We make the assumption that at least one schedule task should run once per day.
|
||||
$lastcron = $DB->get_field_sql('SELECT MAX(lastruntime) FROM {task_scheduled}');
|
||||
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
|
||||
$cronoverdue = ($lastcron < time() - 3600 * 24);
|
||||
$dbproblems = $DB->diagnose();
|
||||
$maintenancemode = !empty($CFG->maintenance_enabled);
|
||||
|
||||
// Available updates for Moodle core.
|
||||
// Available updates for Moodle core
|
||||
$updateschecker = \core\update\checker::instance();
|
||||
$availableupdates = array();
|
||||
$availableupdatesfetch = null;
|
||||
$availableupdates['core'] = $updateschecker->get_update_info('core',
|
||||
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
|
||||
|
||||
if ($updateschecker->enabled()) {
|
||||
// Only compute the update information when it is going to be displayed to the user.
|
||||
$availableupdates['core'] = $updateschecker->get_update_info('core',
|
||||
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
|
||||
|
||||
// Available updates for contributed plugins
|
||||
$pluginman = core_plugin_manager::instance();
|
||||
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
|
||||
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
|
||||
$pluginavailableupdates = $plugininfo->available_updates();
|
||||
if (!empty($pluginavailableupdates)) {
|
||||
foreach ($pluginavailableupdates as $pluginavailableupdate) {
|
||||
// Available updates for contributed plugins
|
||||
$pluginman = core_plugin_manager::instance();
|
||||
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
|
||||
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
|
||||
if (!empty($plugininfo->availableupdates)) {
|
||||
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
|
||||
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
|
||||
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
|
||||
$availableupdates[$plugintype.'_'.$pluginname] = array();
|
||||
}
|
||||
@@ -849,24 +581,22 @@ if ($updateschecker->enabled()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The timestamp of the most recent check for available updates
|
||||
$availableupdatesfetch = $updateschecker->get_last_timefetched();
|
||||
}
|
||||
|
||||
// The timestamp of the most recent check for available updates
|
||||
$availableupdatesfetch = $updateschecker->get_last_timefetched();
|
||||
|
||||
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
|
||||
//check if the site is registered on Moodle.org
|
||||
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
|
||||
// Check if there are any cache warnings.
|
||||
$cachewarnings = cache_helper::warnings();
|
||||
// Check if there are events 1 API handlers.
|
||||
$eventshandlers = $DB->get_records_sql('SELECT DISTINCT component FROM {events_handlers}');
|
||||
$themedesignermode = !empty($CFG->themedesignermode);
|
||||
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
|
||||
/* @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems,
|
||||
$maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
|
||||
$registered, $cachewarnings, $eventshandlers, $themedesignermode);
|
||||
$registered, $cachewarnings);
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Return a list of page types
|
||||
* @param string $pagetype current page type
|
||||
@@ -39,86 +37,3 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
|
||||
);
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* File serving.
|
||||
*
|
||||
* @param stdClass $course The course object.
|
||||
* @param stdClass $cm The cm object.
|
||||
* @param context $context The context object.
|
||||
* @param string $filearea The file area.
|
||||
* @param array $args List of arguments.
|
||||
* @param bool $forcedownload Whether or not to force the download of the file.
|
||||
* @param array $options Array of options.
|
||||
* @return void|false
|
||||
*/
|
||||
function core_admin_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
if (in_array($filearea, ['logo', 'logocompact'])) {
|
||||
$size = array_shift($args); // The path hides the size.
|
||||
$itemid = clean_param(array_shift($args), PARAM_INT);
|
||||
$filename = clean_param(array_shift($args), PARAM_FILE);
|
||||
$themerev = theme_get_revision();
|
||||
if ($themerev <= 0) {
|
||||
// Normalise to 0 as -1 doesn't place well with paths.
|
||||
$themerev = 0;
|
||||
}
|
||||
|
||||
// Extract the requested width and height.
|
||||
$maxwidth = 0;
|
||||
$maxheight = 0;
|
||||
if (preg_match('/^\d+x\d+$/', $size)) {
|
||||
list($maxwidth, $maxheight) = explode('x', $size);
|
||||
$maxwidth = clean_param($maxwidth, PARAM_INT);
|
||||
$maxheight = clean_param($maxheight, PARAM_INT);
|
||||
}
|
||||
|
||||
$lifetime = 0;
|
||||
if ($itemid > 0 && $themerev == $itemid) {
|
||||
// The itemid is $CFG->themerev, when 0 or less no caching. Also no caching when they don't match.
|
||||
$lifetime = DAYSECS * 60;
|
||||
}
|
||||
|
||||
// Anyone, including guests and non-logged in users, can view the logos.
|
||||
$options = ['cacheability' => 'public'];
|
||||
|
||||
// Check if we've got a cached file to return. When lifetime is 0 then we don't want to cached one.
|
||||
$candidate = $CFG->localcachedir . "/core_admin/$themerev/$filearea/{$maxwidth}x{$maxheight}/$filename";
|
||||
if (file_exists($candidate) && $lifetime > 0) {
|
||||
send_file($candidate, $filename, $lifetime, 0, false, false, '', false, $options);
|
||||
}
|
||||
|
||||
// Find the original file.
|
||||
$fs = get_file_storage();
|
||||
$filepath = "/{$context->id}/core_admin/{$filearea}/0/{$filename}";
|
||||
if (!$file = $fs->get_file_by_hash(sha1($filepath))) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
// No need for resizing, but if the file should be cached we save it so we can serve it fast next time.
|
||||
if (empty($maxwidth) && empty($maxheight)) {
|
||||
if ($lifetime) {
|
||||
file_safe_save_content($file->get_content(), $candidate);
|
||||
}
|
||||
send_stored_file($file, $lifetime, 0, false, $options);
|
||||
}
|
||||
|
||||
// Proceed with the resizing.
|
||||
$filedata = $file->resize_image($maxwidth, $maxheight);
|
||||
if (!$filedata) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
// If we don't want to cached the file, serve now and quit.
|
||||
if (!$lifetime) {
|
||||
send_content_uncached($filedata, $filename);
|
||||
}
|
||||
|
||||
// Save, serve and quit.
|
||||
file_safe_save_content($filedata, $candidate);
|
||||
send_file($candidate, $filename, $lifetime, 0, false, false, '', false, $options);
|
||||
}
|
||||
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
// Security check.
|
||||
if (!file_exists(__DIR__.'/mailout-debugger.enable')) {
|
||||
if (!file_exists(dirname(__FILE__).'/mailout-debugger.enable')) {
|
||||
mdie("Disabled.");
|
||||
}
|
||||
$tmpdir=sys_get_temp_dir(); // default
|
||||
|
||||
@@ -1,79 +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/>.
|
||||
|
||||
/**
|
||||
* Enrol config manipulation script.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage media
|
||||
* @copyright 2016 Marina Glancy
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$media = required_param('media', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/media.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_sesskey();
|
||||
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('media');
|
||||
$sortorder = array_values(\core\plugininfo\media::get_enabled_plugins());
|
||||
|
||||
$return = new moodle_url('/admin/settings.php', array('section' => 'managemediaplayers'));
|
||||
|
||||
if (!array_key_exists($media, $plugins)) {
|
||||
redirect($return);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
$plugins[$media]->set_enabled(false);
|
||||
break;
|
||||
|
||||
case 'enable':
|
||||
$plugins[$media]->set_enabled(true);
|
||||
break;
|
||||
|
||||
case 'up':
|
||||
if (($pos = array_search($media, $sortorder)) > 0) {
|
||||
$tmp = $sortorder[$pos - 1];
|
||||
$sortorder[$pos - 1] = $sortorder[$pos];
|
||||
$sortorder[$pos] = $tmp;
|
||||
\core\plugininfo\media::set_enabled_plugins($sortorder);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
if ((($pos = array_search($media, $sortorder)) !== false) && ($pos < count($sortorder) - 1)) {
|
||||
$tmp = $sortorder[$pos + 1];
|
||||
$sortorder[$pos + 1] = $sortorder[$pos];
|
||||
$sortorder[$pos] = $tmp;
|
||||
\core\plugininfo\media::set_enabled_plugins($sortorder);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
redirect($return);
|
||||
+3
-3
@@ -21,7 +21,7 @@
|
||||
* @copyright 2011 Lancaster University Network Services Limited
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->dirroot . '/message/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
@@ -41,7 +41,7 @@ if (!empty($disable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
\core_message\api::update_processor_status($processor, 0); // Disable output.
|
||||
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ if (!empty($enable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
\core_message\api::update_processor_status($processor, 1); // Enable output.
|
||||
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Allows the admin to control user logins from remote moodles.
|
||||
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
include_once($CFG->dirroot.'/mnet/lib.php');
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$step = optional_param('step', 'verify', PARAM_ALPHA);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
<?PHP
|
||||
|
||||
// Allows the admin to configure mnet stuff
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
include_once($CFG->dirroot.'/mnet/lib.php');
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ class mnet_simple_host_form extends moodleform {
|
||||
}
|
||||
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
|
||||
global $CFG;
|
||||
return array('wwwroot' => get_string('hostexists', 'mnet',
|
||||
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
|
||||
return array('wwwroot' => get_string('hostexists', 'mnet', $CFG->wwwroot . '/admin/mnet/peers.php?hostid=' . $host->id));
|
||||
}
|
||||
return array();
|
||||
}
|
||||
@@ -95,15 +94,6 @@ class mnet_review_host_form extends moodleform {
|
||||
$mform->setType('wwwroot', PARAM_URL);
|
||||
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||
|
||||
$options = array(
|
||||
mnet_peer::SSL_NONE => get_string('none'),
|
||||
mnet_peer::SSL_HOST => get_string('verifyhostonly', 'core_mnet'),
|
||||
mnet_peer::SSL_HOST_AND_PEER => get_string('verifyhostandpeer', 'core_mnet')
|
||||
);
|
||||
$mform->addElement('select', 'sslverification', get_string('sslverification', 'core_mnet'), $options);
|
||||
$mform->setDefault('sslverification', mnet_peer::SSL_HOST_AND_PEER);
|
||||
$mform->addHelpButton('sslverification', 'sslverification', 'core_mnet');
|
||||
|
||||
$themes = array('' => get_string('forceno'));
|
||||
foreach (array_keys(core_component::get_plugin_list('theme')) as $themename) {
|
||||
$themes[$themename] = get_string('pluginname', 'theme_'.$themename);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/mnet/lib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
|
||||
@@ -109,7 +109,7 @@ if (!empty($hostid)) {
|
||||
$mnet_peer->set_id($hostid);
|
||||
echo $OUTPUT->header();
|
||||
$currenttab = 'mnetdetails';
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
|
||||
if ($hostid != $CFG->mnet_all_hosts_id) {
|
||||
$mnet_peer->currentkey = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application);
|
||||
@@ -144,7 +144,7 @@ if (empty($noreviewform) && $id = optional_param('id', 0, PARAM_INT)) {
|
||||
// we're editing an existing one, so set up the tabs
|
||||
$currenttab = 'mnetdetails';
|
||||
$mnet_peer->set_id($id);
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
} else if (empty($noreviewform) && ($wwwroot = optional_param('wwwroot', '', PARAM_URL)) && ($applicationid = optional_param('applicationid', 0, PARAM_INT))) {
|
||||
$application = $DB->get_field('mnet_application', 'name', array('id'=>$applicationid));
|
||||
$mnet_peer->bootstrap($wwwroot, null, $application);
|
||||
@@ -172,7 +172,6 @@ if ($formdata = $reviewform->get_data()) {
|
||||
$mnet_peer->public_key = $formdata->public_key;
|
||||
$credentials = $mnet_peer->check_credentials($mnet_peer->public_key);
|
||||
$mnet_peer->public_key_expires = $credentials['validTo_time_t'];
|
||||
$mnet_peer->sslverification = $formdata->sslverification;
|
||||
|
||||
if ($mnet_peer->commit()) {
|
||||
redirect(new moodle_url('/admin/mnet/peers.php', array('hostid' => $mnet_peer->id)), get_string('changessaved'));
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin .'/mnet/profilefields_form.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/profilefields_form.php');
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
require_login();
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/services_form.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/services_form.php');
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
require_login();
|
||||
@@ -82,7 +82,7 @@ if ($formdata = $mform->get_data()) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
$currenttab = 'mnetservices';
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
|
||||
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
|
||||
echo $OUTPUT->box_start();
|
||||
$s = mnet_get_service_info($mnet_peer, false); // basic data only
|
||||
$mform->set_data($s);
|
||||
|
||||
@@ -34,12 +34,21 @@ if (!defined('MOODLE_INTERNAL')) {
|
||||
}
|
||||
|
||||
$strmnetservices = get_string('mnetservices', 'mnet');
|
||||
$strmnetlog = get_string('mnetlog', 'mnet');
|
||||
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
|
||||
|
||||
$logurl = $CFG->wwwroot.
|
||||
'/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
|
||||
'%2F1&user='.'0'.
|
||||
'&date=0'.
|
||||
'&modid=&modaction=0&logformat=showashtml';
|
||||
$tabs = array();
|
||||
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
|
||||
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
|
||||
$tabs[] = new tabobject('mnetservices', 'services.php?hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
|
||||
if ($mnet_peer->application->name == 'moodle' && $mnet_peer->id != $CFG->mnet_all_hosts_id) {
|
||||
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
|
||||
}
|
||||
$tabs[] = new tabobject('mnetprofilefields', 'profilefields.php?hostid=' . $mnet_peer->id, get_string('profilefields', 'mnet'), get_string('profilefields', 'mnet'), false);
|
||||
} else {
|
||||
$tabs[] = new tabobject('mnetdetails', '#', $strmnetedithost, $strmnetedithost, false);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package mnet
|
||||
*/
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
include_once($CFG->dirroot.'/mnet/lib.php');
|
||||
@@ -66,19 +66,12 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
|
||||
|
||||
$mnet_request->set_method('system/listServices');
|
||||
$mnet_request->send($mnet_peer);
|
||||
|
||||
$services = $mnet_request->response;
|
||||
$yesno = array('No', 'Yes');
|
||||
$servicenames = array();
|
||||
|
||||
echo $OUTPUT->heading(get_string('servicesavailableonhost', 'mnet', $host->wwwroot));
|
||||
|
||||
if (!empty($mnet_request->error)) {
|
||||
echo $OUTPUT->heading(get_string('error'), 3);
|
||||
echo html_writer::alist($mnet_request->error);
|
||||
$services = array();
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array(
|
||||
get_string('serviceid', 'mnet'),
|
||||
@@ -134,7 +127,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
|
||||
echo html_writer::table($table);
|
||||
|
||||
|
||||
$mnet_request = new mnet_xmlrpc_client();
|
||||
$mnet_request->set_method('system/listMethods');
|
||||
if (isset($servicename) && array_key_exists($servicename, $serviceinfo)) {
|
||||
echo $OUTPUT->heading(get_string('methodsavailableonhostinservice', 'mnet', (object)array('host' => $host->wwwroot, 'service' => $servicename)));
|
||||
@@ -147,11 +139,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
|
||||
$mnet_request->send($mnet_peer);
|
||||
$methods = $mnet_request->response;
|
||||
|
||||
if (!empty($mnet_request->error)) {
|
||||
echo $OUTPUT->heading(get_string('error'), 3);
|
||||
echo html_writer::alist($mnet_request->error);
|
||||
$methods = array();
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array(
|
||||
@@ -184,12 +171,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
|
||||
|
||||
echo $OUTPUT->heading(get_string('methodsignature', 'mnet', $method));
|
||||
|
||||
if (!empty($mnet_request->error)) {
|
||||
echo $OUTPUT->heading(get_string('error'), 3);
|
||||
echo html_writer::alist($mnet_request->error);
|
||||
$signature = array();
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array(
|
||||
get_string('position', 'mnet'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
// Allows the admin to configure services for remote hosts
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
include_once($CFG->dirroot.'/mnet/lib.php');
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
|
||||
+2
-2
@@ -8,10 +8,10 @@
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo '<div class="phpinfo text-ltr">';
|
||||
echo '<div class="phpinfo">';
|
||||
|
||||
ob_start();
|
||||
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);
|
||||
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
|
||||
$html = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
|
||||
+54
-63
@@ -18,27 +18,32 @@
|
||||
/**
|
||||
* UI for general plugins management
|
||||
*
|
||||
* Supported HTTP parameters:
|
||||
*
|
||||
* ?fetchremote=1 - check for available updates
|
||||
* ?updatesonly=1 - display plugins with available update only
|
||||
* ?contribonly=1 - display non-standard add-ons only
|
||||
* ?uninstall=foo_bar - uninstall the given plugin
|
||||
* ?delete=foo_bar - delete the plugin folder (it must not be installed)
|
||||
* &confirm=1 - confirm the uninstall or delete action
|
||||
*
|
||||
* @package core
|
||||
* @subpackage admin
|
||||
* @copyright 2011 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
$fetchupdates = optional_param('fetchupdates', false, PARAM_BOOL); // Check for available plugins updates.
|
||||
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL); // Show updateable plugins only.
|
||||
$contribonly = optional_param('contribonly', false, PARAM_BOOL); // Show additional plugins only.
|
||||
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT); // Uninstall the plugin.
|
||||
$delete = optional_param('delete', '', PARAM_COMPONENT); // Delete the plugin folder after it is uninstalled.
|
||||
$confirmed = optional_param('confirm', false, PARAM_BOOL); // Confirm the uninstall/delete action.
|
||||
$return = optional_param('return', 'overview', PARAM_ALPHA); // Where to return after uninstall.
|
||||
$installupdate = optional_param('installupdate', null, PARAM_COMPONENT); // Install given available update.
|
||||
$installupdateversion = optional_param('installupdateversion', null, PARAM_INT); // Version of the available update to install.
|
||||
$installupdatex = optional_param('installupdatex', false, PARAM_BOOL); // Install all available plugin updates.
|
||||
$confirminstallupdate = optional_param('confirminstallupdate', false, PARAM_BOOL); // Available update(s) install confirmed?
|
||||
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
|
||||
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL);
|
||||
$contribonly = optional_param('contribonly', false, PARAM_BOOL);
|
||||
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT);
|
||||
$delete = optional_param('delete', '', PARAM_COMPONENT);
|
||||
$confirmed = optional_param('confirm', false, PARAM_BOOL);
|
||||
$return = optional_param('return', 'overview', PARAM_ALPHA);
|
||||
|
||||
// NOTE: do not use admin_externalpage_setup() here because it loads
|
||||
// full admin tree which is not possible during uninstallation.
|
||||
@@ -47,19 +52,15 @@ require_login();
|
||||
$syscontext = context_system::instance();
|
||||
require_capability('moodle/site:config', $syscontext);
|
||||
|
||||
// URL params we want to maintain on redirects.
|
||||
$pageparams = array('updatesonly' => $updatesonly, 'contribonly' => $contribonly);
|
||||
$pageurl = new moodle_url('/admin/plugins.php', $pageparams);
|
||||
|
||||
$pluginman = core_plugin_manager::instance();
|
||||
|
||||
if ($uninstall) {
|
||||
require_sesskey();
|
||||
|
||||
if (!$confirmed) {
|
||||
admin_externalpage_setup('pluginsoverview', '', $pageparams);
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
} else {
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_url('/admin/plugins.php');
|
||||
$PAGE->set_context($syscontext);
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
@@ -121,7 +122,7 @@ if ($uninstall) {
|
||||
if ($delete and $confirmed) {
|
||||
require_sesskey();
|
||||
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_url('/admin/plugins.php');
|
||||
$PAGE->set_context($syscontext);
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
@@ -148,6 +149,13 @@ if ($delete and $confirmed) {
|
||||
'core_plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
|
||||
}
|
||||
|
||||
// Make sure the folder is removable.
|
||||
if (!$pluginman->is_plugin_folder_removable($pluginfo->component)) {
|
||||
throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
|
||||
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir),
|
||||
'plugin root folder is not removable as expected');
|
||||
}
|
||||
|
||||
// Make sure the folder is within Moodle installation tree.
|
||||
if (strpos($pluginfo->rootdir, $CFG->dirroot) !== 0) {
|
||||
throw new moodle_exception('err_unexpected_plugin_rootdir', 'core_plugin', '',
|
||||
@@ -156,61 +164,44 @@ if ($delete and $confirmed) {
|
||||
}
|
||||
|
||||
// So long, and thanks for all the bugs.
|
||||
$pluginman->remove_plugin_folder($pluginfo);
|
||||
|
||||
fulldelete($pluginfo->rootdir);
|
||||
// Reset op code caches.
|
||||
if (function_exists('opcache_reset')) {
|
||||
opcache_reset();
|
||||
}
|
||||
// We need to execute upgrade to make sure everything including caches is up to date.
|
||||
redirect(new moodle_url('/admin/index.php'));
|
||||
}
|
||||
|
||||
// Install all avilable updates.
|
||||
if ($installupdatex) {
|
||||
require_once($CFG->libdir.'/upgradelib.php');
|
||||
require_sesskey();
|
||||
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_context($syscontext);
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
$installable = $pluginman->filter_installable($pluginman->available_updates());
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
|
||||
);
|
||||
}
|
||||
|
||||
// Install single available update.
|
||||
if ($installupdate and $installupdateversion) {
|
||||
require_once($CFG->libdir.'/upgradelib.php');
|
||||
require_sesskey();
|
||||
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_context($syscontext);
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
|
||||
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
|
||||
upgrade_install_plugins($installable, $confirminstallupdate,
|
||||
get_string('updateavailableinstallallhead', 'core_admin'),
|
||||
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
|
||||
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
admin_externalpage_setup('pluginsoverview', '', $pageparams);
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
$checker = \core\update\checker::instance();
|
||||
|
||||
if ($fetchupdates) {
|
||||
// Filtering options.
|
||||
$options = array(
|
||||
'updatesonly' => $updatesonly,
|
||||
'contribonly' => $contribonly,
|
||||
);
|
||||
|
||||
if ($fetchremote) {
|
||||
require_sesskey();
|
||||
$checker->fetch();
|
||||
redirect($PAGE->url);
|
||||
redirect(new moodle_url($PAGE->url, $options));
|
||||
}
|
||||
|
||||
echo $output->plugin_management_page($pluginman, $checker, $pageparams);
|
||||
$deployer = \core\update\deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
|
||||
$deployer->initialize($myurl, new moodle_url('/admin'));
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $output->plugin_management_page($pluginman, $checker, $options);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->libdir . '/portfolio/forms.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
//error_reporting(0);
|
||||
//ini_set('display_errors',0);
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
$tmp = explode('@',$_ENV['RECIPIENT']);
|
||||
$address = $tmp[0];
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
@@ -58,14 +58,17 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('registrationconfirmed', 'hub'), 3, 'main');
|
||||
$hublink = html_writer::tag('a', $hubname, array('href' => $url));
|
||||
|
||||
$registeredhub->token = $newtoken;
|
||||
$registeredhub->confirmed = 1;
|
||||
$registeredhub->hubname = $hubname;
|
||||
$registrationmanager->update_registeredhub($registeredhub);
|
||||
|
||||
// Display notification message.
|
||||
echo $OUTPUT->notification(get_string('registrationconfirmedon', 'hub'), 'notifysuccess');
|
||||
//display notficiation message
|
||||
$notificationmessage = $OUTPUT->notification(
|
||||
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
|
||||
echo $notificationmessage;
|
||||
|
||||
//display continue button
|
||||
$registrationpage = new moodle_url('/admin/registration/index.php');
|
||||
|
||||
@@ -329,7 +329,6 @@ class site_registration_form extends moodleform {
|
||||
array('class' => 'registration_textfield'));
|
||||
$mform->setType('contactphone', PARAM_TEXT);
|
||||
$mform->addHelpButton('contactphone', 'sitephone', 'hub');
|
||||
$mform->setForceLtr('contactphone');
|
||||
|
||||
$mform->addElement('text', 'contactemail', get_string('siteemail', 'hub'),
|
||||
array('class' => 'registration_textfield'));
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* On this page the administrator selects which hub he wants to register (except for moodle.net)
|
||||
* Admins can register with moodle.net via the site admin menu "Registration" link.
|
||||
* On this page the administrator can also unregister from any hubs including moodle.net.
|
||||
* On this page the administrator selects which hub he wants to register,
|
||||
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
|
||||
* On this page the administrator can also unregister from any hubs, including MOOCH.
|
||||
*/
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
+27
-28
@@ -53,30 +53,31 @@ class registration_manager {
|
||||
public function cron() {
|
||||
global $CFG;
|
||||
if (extension_loaded('xmlrpc')) {
|
||||
$function = 'hub_update_site_info';
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
//check if the last registration cron update was less than a week ago
|
||||
$lastcron = get_config('registration', 'crontime');
|
||||
if ($lastcron === false or $lastcron < strtotime("-7 day")) { //set to a week, see MDL-23704
|
||||
$function = 'hub_update_site_info';
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
|
||||
// Update all hubs where the site is registered.
|
||||
$hubs = $this->get_registered_on_hubs();
|
||||
if (empty($hubs)) {
|
||||
mtrace(get_string('registrationwarning', 'admin'));
|
||||
}
|
||||
foreach ($hubs as $hub) {
|
||||
// Update the registration.
|
||||
$siteinfo = $this->get_site_info($hub->huburl);
|
||||
$params = array('siteinfo' => $siteinfo);
|
||||
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
|
||||
try {
|
||||
$result = $xmlrpcclient->call($function, $params);
|
||||
$this->update_registeredhub($hub); // To update timemodified.
|
||||
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
|
||||
} catch (Exception $e) {
|
||||
$errorparam = new stdClass();
|
||||
$errorparam->errormessage = $e->getMessage();
|
||||
$errorparam->hubname = $hub->hubname;
|
||||
mtrace(get_string('errorcron', 'hub', $errorparam));
|
||||
//update all hub where the site is registered on
|
||||
$hubs = $this->get_registered_on_hubs();
|
||||
foreach ($hubs as $hub) {
|
||||
//update the registration
|
||||
$siteinfo = $this->get_site_info($hub->huburl);
|
||||
$params = array('siteinfo' => $siteinfo);
|
||||
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
|
||||
try {
|
||||
$result = $xmlrpcclient->call($function, $params);
|
||||
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
|
||||
} catch (Exception $e) {
|
||||
$errorparam = new stdClass();
|
||||
$errorparam->errormessage = $e->getMessage();
|
||||
$errorparam->hubname = $hub->hubname;
|
||||
mtrace(get_string('errorcron', 'hub', $errorparam));
|
||||
}
|
||||
}
|
||||
set_config('crontime', time(), 'registration');
|
||||
}
|
||||
} else {
|
||||
mtrace(get_string('errorcronnoxmlrpc', 'hub'));
|
||||
@@ -117,7 +118,6 @@ class registration_manager {
|
||||
*/
|
||||
public function add_registeredhub($hub) {
|
||||
global $DB;
|
||||
$hub->timemodified = time();
|
||||
$id = $DB->insert_record('registration_hubs', $hub);
|
||||
return $id;
|
||||
}
|
||||
@@ -171,16 +171,15 @@ class registration_manager {
|
||||
|
||||
/**
|
||||
* Update a registered hub (mostly use to update the confirmation status)
|
||||
* @param object $hub the hub
|
||||
* @param object $communication the hub
|
||||
*/
|
||||
public function update_registeredhub($hub) {
|
||||
public function update_registeredhub($communication) {
|
||||
global $DB;
|
||||
$hub->timemodified = time();
|
||||
$DB->update_record('registration_hubs', $hub);
|
||||
$DB->update_record('registration_hubs', $communication);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all hubs where the site is registered
|
||||
* Return all hubs where the site is registered on
|
||||
*/
|
||||
public function get_registered_on_hubs() {
|
||||
global $DB;
|
||||
|
||||
@@ -39,8 +39,6 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
|
||||
@@ -118,7 +116,6 @@ if ($update and confirm_sesskey()) {
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
|
||||
try {
|
||||
$result = $xmlrpcclient->call($function, $params);
|
||||
$registrationmanager->update_registeredhub($registeredhub); // To update timemodified.
|
||||
} catch (Exception $e) {
|
||||
$error = $OUTPUT->notification(get_string('errorregistration', 'hub', $e->getMessage()));
|
||||
}
|
||||
@@ -178,20 +175,8 @@ if (!empty($error)) {
|
||||
echo $error;
|
||||
}
|
||||
|
||||
// Some Moodle.org registration explanation.
|
||||
//some Moodle.org resitration explanation
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) {
|
||||
if (!empty($registeredhub->token)) {
|
||||
if ($registeredhub->timemodified == 0) {
|
||||
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
|
||||
} else {
|
||||
$lastupdated = userdate($registeredhub->timemodified, get_string('strftimedate', 'langconfig'));
|
||||
$registrationmessage = get_string('pleaserefreshregistration', 'admin', $lastupdated);
|
||||
}
|
||||
} else {
|
||||
$registrationmessage = get_string('registrationwarning', 'admin');
|
||||
}
|
||||
echo $OUTPUT->notification($registrationmessage);
|
||||
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
|
||||
$renderer = $PAGE->get_renderer('core', 'register');
|
||||
echo $renderer->moodleorg_registration_message();
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
class core_register_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display message about the benefits of registering on Moodle.org
|
||||
* Display Moodle.org registration message about benefit to register on Moodle.org
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function moodleorg_registration_message() {
|
||||
$moodleorgstatslink = html_writer::link('http://moodle.net/stats',
|
||||
get_string('statsmoodleorg', 'admin'),
|
||||
array('target' => '_blank'));
|
||||
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin');
|
||||
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
|
||||
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
|
||||
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, get_string('moodleorghubname', 'admin'));
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
|
||||
$items = array(get_string('registermoodleorgli1', 'admin'),
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
|
||||
get_string('registermoodleorgli3', 'admin', $moochurl));
|
||||
$moodleorgregmsg .= html_writer::alist($items);
|
||||
return $moodleorgregmsg;
|
||||
}
|
||||
|
||||
+277
-708
File diff suppressed because it is too large
Load Diff
+3
-7
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
@@ -50,8 +50,7 @@ $table->set_attribute('class', 'admintable generaltable');
|
||||
$table->setup();
|
||||
|
||||
$plugins = array();
|
||||
$availableplugins = core_component::get_plugin_list('report');
|
||||
foreach ($availableplugins as $plugin => $plugindir) {
|
||||
foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
|
||||
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
|
||||
$strpluginname = get_string('pluginname', 'report_' . $plugin);
|
||||
} else {
|
||||
@@ -81,10 +80,7 @@ foreach ($plugins as $plugin => $name) {
|
||||
$uninstall = html_writer::link($uninstallurl, $struninstall);
|
||||
}
|
||||
|
||||
$stores = array();
|
||||
if (isset($availableplugins[$plugin])) {
|
||||
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
|
||||
}
|
||||
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
|
||||
if ($stores === false) {
|
||||
$supportedstores = get_string('logstorenotrequired', 'admin');
|
||||
} else if (!empty($stores)) {
|
||||
|
||||
+5
-15
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
@@ -264,7 +264,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
$strshow = get_string('on', 'repository');
|
||||
$strhide = get_string('off', 'repository');
|
||||
$strdelete = get_string('disabled', 'repository');
|
||||
$struninstall = get_string('uninstallplugin', 'core_admin');
|
||||
|
||||
$actionchoicesforexisting = array(
|
||||
'show' => $strshow,
|
||||
@@ -287,9 +286,9 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
// Table to list plug-ins
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr, $struninstall);
|
||||
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
|
||||
|
||||
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
|
||||
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
|
||||
$table->id = 'repositoriessetting';
|
||||
$table->data = array();
|
||||
$table->attributes['class'] = 'admintable generaltable';
|
||||
@@ -385,12 +384,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
$updowncount++;
|
||||
|
||||
$uninstall = '';
|
||||
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $typename, 'manage')) {
|
||||
$uninstall = html_writer::link($uninstallurl, $struninstall);
|
||||
}
|
||||
|
||||
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings, $uninstall);
|
||||
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings);
|
||||
|
||||
if (!in_array($typename, $alreadyplugins)) {
|
||||
$alreadyplugins[] = $typename;
|
||||
@@ -406,11 +400,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
if (!in_array($plugin, $alreadyplugins)) {
|
||||
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
$uninstall = '';
|
||||
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
|
||||
$uninstall = html_writer::link($uninstallurl, $struninstall);
|
||||
}
|
||||
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '', $uninstall);
|
||||
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(__DIR__ . '/../config.php');
|
||||
require(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('resetemoticons');
|
||||
|
||||
@@ -133,12 +133,9 @@ echo $OUTPUT->header();
|
||||
</td>
|
||||
<td id="buttonscell">
|
||||
<p class="arrow_button">
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>"
|
||||
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>"
|
||||
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/><br />
|
||||
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>"
|
||||
title="<?php print_string('mainadminset', 'core_role'); ?>" class="btn btn-secondary"/>
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
|
||||
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>" title="<?php print_string('mainadminset', 'core_role'); ?>" />
|
||||
</p>
|
||||
</td>
|
||||
<td id="potentialcell">
|
||||
|
||||
@@ -1,85 +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/>.
|
||||
|
||||
/**
|
||||
* This file processes AJAX requests and returns JSON
|
||||
*
|
||||
* This is a server part of yui permissions manager module
|
||||
*
|
||||
* @package core_role
|
||||
* @copyright 2015 Martin Mastny
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
define('AJAX_SCRIPT', true);
|
||||
|
||||
require(__DIR__ . '/../../config.php');
|
||||
|
||||
$contextid = required_param('contextid', PARAM_INT);
|
||||
$getroles = optional_param('getroles', 0, PARAM_BOOL);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
|
||||
$PAGE->set_context($context);
|
||||
|
||||
require_login($course, false, $cm);
|
||||
require_capability('moodle/role:review', $context);
|
||||
require_sesskey();
|
||||
|
||||
$OUTPUT->header();
|
||||
|
||||
list($overridableroles, $overridecounts, $nameswithcounts) = get_overridable_roles($context,
|
||||
ROLENAME_BOTH, true);
|
||||
|
||||
if ($getroles) {
|
||||
echo json_encode($overridableroles);
|
||||
die();
|
||||
}
|
||||
|
||||
$capability = required_param('capability', PARAM_CAPABILITY);
|
||||
$roleid = required_param('roleid', PARAM_INT);
|
||||
$action = required_param('action', PARAM_ALPHA);
|
||||
|
||||
$capability = $DB->get_record('capabilities', array('name' => $capability), '*', MUST_EXIST);
|
||||
|
||||
if (!isset($overridableroles[$roleid])) {
|
||||
throw new moodle_exception('invalidarguments');
|
||||
}
|
||||
|
||||
if (!has_capability('moodle/role:override', $context)) {
|
||||
if (!has_capability('moodle/role:safeoverride', $context) || !is_safe_capability($capability)) {
|
||||
require_capability('moodle/role:override', $context);
|
||||
}
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'allow':
|
||||
role_change_permission($roleid, $context, $capability->name, CAP_ALLOW);
|
||||
break;
|
||||
case 'prevent':
|
||||
role_change_permission($roleid, $context, $capability->name, CAP_PREVENT);
|
||||
break;
|
||||
case 'prohibit':
|
||||
role_change_permission($roleid, $context, $capability->name, CAP_PROHIBIT);
|
||||
break;
|
||||
case 'unprohibit':
|
||||
role_change_permission($roleid, $context, $capability->name, CAP_INHERIT);
|
||||
break;
|
||||
default:
|
||||
throw new moodle_exception('invalidarguments');
|
||||
}
|
||||
|
||||
echo json_encode($action);
|
||||
die();
|
||||
@@ -22,7 +22,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$mode = required_param('mode', PARAM_ALPHANUMEXT);
|
||||
@@ -80,8 +80,7 @@ echo $OUTPUT->box($controller->get_intro_text());
|
||||
echo '<form action="' . $baseurl . '" method="post">';
|
||||
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
|
||||
echo html_writer::table($table);
|
||||
echo '<div class="buttons">';
|
||||
echo '<input type="submit" class="btn btn-primary" name="submit" value="' . get_string('savechanges') . '"/>';
|
||||
echo '<div class="buttons"><input type="submit" name="submit" value="'.get_string('savechanges').'"/>';
|
||||
echo '</div></form>';
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+25
-25
@@ -29,7 +29,7 @@ define("MAX_USERS_TO_LIST_PER_ROLE", 10);
|
||||
|
||||
$contextid = required_param('contextid', PARAM_INT);
|
||||
$roleid = optional_param('roleid', 0, PARAM_INT);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
$returnto = optional_param('return', null, PARAM_ALPHANUMEXT);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
|
||||
@@ -53,13 +53,7 @@ if ($course) {
|
||||
// Security.
|
||||
require_login($course, false, $cm);
|
||||
require_capability('moodle/role:assign', $context);
|
||||
|
||||
navigation_node::override_active_url($url);
|
||||
$pageurl = new moodle_url($url);
|
||||
if ($returnurl) {
|
||||
$pageurl->param('returnurl', $returnurl);
|
||||
}
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
|
||||
$contextname = $context->get_context_name();
|
||||
@@ -141,16 +135,7 @@ if ($roleid) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($user) && ($user->id != $USER->id)) {
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
$PAGE->navbar->includesettingsbase = true;
|
||||
}
|
||||
|
||||
$PAGE->set_pagelayout('admin');
|
||||
if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
// Do not show blocks when changing block's settings, it is confusing.
|
||||
$PAGE->blocks->show_only_fake_blocks(true);
|
||||
}
|
||||
$PAGE->set_title($title);
|
||||
|
||||
switch ($context->contextlevel) {
|
||||
@@ -196,6 +181,9 @@ if ($roleid) {
|
||||
|
||||
// Print the form.
|
||||
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
if ($returnto !== null) {
|
||||
$assignurl->param('return', $returnto);
|
||||
}
|
||||
?>
|
||||
<form id="assignform" method="post" action="<?php echo $assignurl ?>"><div>
|
||||
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
|
||||
@@ -208,13 +196,11 @@ if ($roleid) {
|
||||
</td>
|
||||
<td id="buttonscell">
|
||||
<div id="addcontrols">
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>"
|
||||
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
|
||||
</div>
|
||||
|
||||
<div id="removecontrols">
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>"
|
||||
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/>
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
|
||||
</div>
|
||||
</td>
|
||||
<td id="potentialcell">
|
||||
@@ -242,10 +228,18 @@ if ($roleid) {
|
||||
// Print a form to swap roles, and a link back to the all roles list.
|
||||
echo '<div class="backlink">';
|
||||
|
||||
$select = new single_select($PAGE->url, 'roleid', $nameswithcounts, $roleid, null);
|
||||
$newroleurl = new moodle_url($PAGE->url);
|
||||
if ($returnto !== null) {
|
||||
$newroleurl->param('return', $returnto);
|
||||
}
|
||||
$select = new single_select($newroleurl, 'roleid', $nameswithcounts, $roleid, null);
|
||||
$select->label = get_string('assignanotherrole', 'core_role');
|
||||
echo $OUTPUT->render($select);
|
||||
echo '<p><a href="' . $PAGE->url . '">' . get_string('backtoallroles', 'core_role') . '</a></p>';
|
||||
$backurl = new moodle_url('/admin/roles/assign.php', array('contextid' => $contextid));
|
||||
if ($returnto !== null) {
|
||||
$backurl->param('return', $returnto);
|
||||
}
|
||||
echo '<p><a href="' . $backurl->out() . '">' . get_string('backtoallroles', 'core_role') . '</a></p>';
|
||||
echo '</div>';
|
||||
|
||||
} else if (empty($assignableroles)) {
|
||||
@@ -283,6 +277,9 @@ if ($roleid) {
|
||||
}
|
||||
} else if ($assigncounts[$roleid] > MAX_USERS_TO_LIST_PER_ROLE) {
|
||||
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
if ($returnto !== null) {
|
||||
$assignurl->param('return', $returnto);
|
||||
}
|
||||
$roleholdernames[$roleid] = '<a href="'.$assignurl.'">'.$strmorethanmax.'</a>';
|
||||
} else {
|
||||
$roleholdernames[$roleid] = '';
|
||||
@@ -303,6 +300,9 @@ if ($roleid) {
|
||||
foreach ($assignableroles as $roleid => $rolename) {
|
||||
$description = format_string($DB->get_field('role', 'description', array('id'=>$roleid)));
|
||||
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
if ($returnto !== null) {
|
||||
$assignurl->param('return', $returnto);
|
||||
}
|
||||
$row = array('<a href="'.$assignurl.'">'.$rolename.'</a>',
|
||||
$description, $assigncounts[$roleid]);
|
||||
if ($showroleholders) {
|
||||
@@ -315,8 +315,8 @@ if ($roleid) {
|
||||
|
||||
if ($context->contextlevel > CONTEXT_USER) {
|
||||
|
||||
if ($returnurl) {
|
||||
$url = new moodle_url($returnurl);
|
||||
if ($context->contextlevel === CONTEXT_COURSECAT && $returnto === 'management') {
|
||||
$url = new moodle_url('/course/management.php', array('categoryid' => $context->instanceid));
|
||||
} else {
|
||||
$url = $context->get_url();
|
||||
}
|
||||
|
||||
+14
-23
@@ -22,10 +22,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once(dirname(__FILE__) . '/../../config.php');
|
||||
|
||||
$contextid = required_param('contextid', PARAM_INT);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
|
||||
@@ -50,16 +49,9 @@ require_login($course, false, $cm);
|
||||
if (!has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage'), $context)) {
|
||||
print_error('nopermissions', 'error', '', get_string('checkpermissions', 'core_role'));
|
||||
}
|
||||
|
||||
navigation_node::override_active_url($url);
|
||||
$pageurl = new moodle_url($url);
|
||||
if ($returnurl) {
|
||||
$pageurl->param('returnurl', $returnurl);
|
||||
}
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_url($url);
|
||||
|
||||
if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
|
||||
$PAGE->navbar->includesettingsbase = true;
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
$PAGE->set_context(context_course::instance($course->id));
|
||||
} else {
|
||||
@@ -82,10 +74,6 @@ $userselector->set_rows(20);
|
||||
$title = get_string('checkpermissionsin', 'core_role', $contextname);
|
||||
|
||||
$PAGE->set_pagelayout('admin');
|
||||
if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
// Do not show blocks when changing block's settings, it is confusing.
|
||||
$PAGE->blocks->show_only_fake_blocks(true);
|
||||
}
|
||||
$PAGE->set_title($title);
|
||||
|
||||
switch ($context->contextlevel) {
|
||||
@@ -167,27 +155,30 @@ if (!is_null($reportuser)) {
|
||||
|
||||
// Show UI for choosing a user to report on.
|
||||
echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseuser');
|
||||
echo '<form method="post" action="' . $PAGE->url . '" >';
|
||||
echo '<form method="get" action="' . $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php" >';
|
||||
|
||||
// Hidden fields.
|
||||
echo '<input type="hidden" name="contextid" value="' . $context->id . '" />';
|
||||
if (!empty($user->id)) {
|
||||
echo '<input type="hidden" name="userid" value="' . $user->id . '" />';
|
||||
}
|
||||
if ($isfrontpage) {
|
||||
echo '<input type="hidden" name="courseid" value="' . $courseid . '" />';
|
||||
}
|
||||
|
||||
// User selector.
|
||||
echo $OUTPUT->heading('<label for="reportuser">' . $selectheading . '</label>', 3);
|
||||
$userselector->display();
|
||||
|
||||
// Submit button and the end of the form.
|
||||
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" ' .
|
||||
'class="btn btn-primary"/></p>';
|
||||
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" /></p>';
|
||||
echo '</form>';
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
// Appropriate back link.
|
||||
if ($context->contextlevel > CONTEXT_USER) {
|
||||
echo html_writer::start_tag('div', array('class'=>'backlink'));
|
||||
if ($returnurl) {
|
||||
$backurl = new moodle_url($returnurl);
|
||||
} else {
|
||||
$backurl = $context->get_url();
|
||||
}
|
||||
echo html_writer::link($backurl, get_string('backto', '', $contextname));
|
||||
echo html_writer::tag('a', get_string('backto', '', $contextname), array('href'=>$context->get_url()));
|
||||
echo html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
|
||||
@@ -106,22 +106,18 @@ abstract class core_role_capability_table_base {
|
||||
$component = $capability->component;
|
||||
|
||||
// Start the row.
|
||||
$rowattributes = $this->get_row_attributes($capability);
|
||||
// Handle class attributes same as other.
|
||||
$rowclasses = array_unique(array_merge(array('rolecap'), $this->get_row_classes($capability)));
|
||||
if (array_key_exists('class', $rowattributes)) {
|
||||
$rowclasses = array_unique(array_merge($rowclasses, array($rowattributes['class'])));
|
||||
}
|
||||
$rowattributes['class'] = implode(' ', $rowclasses);
|
||||
echo '<tr class="' . implode(' ', array_unique(array_merge(array('rolecap'),
|
||||
$this->get_row_classes($capability)))) . '">';
|
||||
|
||||
// Table cell for the capability name.
|
||||
$contents = '<th scope="row" class="name"><span class="cap-desc">' . get_capability_docs_link($capability) .
|
||||
echo '<th scope="row" class="name"><span class="cap-desc">' . get_capability_docs_link($capability) .
|
||||
'<span class="cap-name">' . $capability->name . '</span></span></th>';
|
||||
|
||||
// Add the cells specific to this table.
|
||||
$contents .= $this->add_row_cells($capability);
|
||||
$this->add_row_cells($capability);
|
||||
|
||||
echo html_writer::tag('tr', $contents, $rowattributes);
|
||||
// End the row.
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
// End of the table.
|
||||
@@ -171,17 +167,6 @@ abstract class core_role_capability_table_base {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* For subclasses to override. Additional attributes to be added to
|
||||
* each table row for the capability
|
||||
*
|
||||
* @param stdClass $capability the capability this row relates to.
|
||||
* @return array attribute names and their values.
|
||||
*/
|
||||
protected function get_row_attributes($capability) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* For subclasses to override. Output the data cells for this capability. The
|
||||
* capability name cell will already have been output.
|
||||
@@ -189,7 +174,6 @@ abstract class core_role_capability_table_base {
|
||||
* You can rely on get_row_classes always being called before add_row_cells.
|
||||
*
|
||||
* @param stdClass $capability the capability this row relates to.
|
||||
* @return string html of row cells
|
||||
*/
|
||||
protected abstract function add_row_cells($capability);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
||||
protected $allpermissions; // We don't need perms ourselves, but all our subclasses do.
|
||||
protected $strperms; // Language string cache.
|
||||
protected $risksurl; // URL in moodledocs about risks.
|
||||
protected $riskicons = array(); // Cache to avoid regenerating the HTML for each risk icon.
|
||||
/** @var array The capabilities to highlight as default/inherited. */
|
||||
protected $parentpermissions;
|
||||
protected $displaypermissions;
|
||||
@@ -162,16 +163,15 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
||||
protected abstract function add_permission_cells($capability);
|
||||
|
||||
protected function add_row_cells($capability) {
|
||||
$cells = $this->add_permission_cells($capability);
|
||||
$this->add_permission_cells($capability);
|
||||
// One cell for each possible risk.
|
||||
foreach ($this->allrisks as $riskname => $risk) {
|
||||
$cells .= '<td class="risk ' . str_replace('risk', '', $riskname) . '">';
|
||||
echo '<td class="risk ' . str_replace('risk', '', $riskname) . '">';
|
||||
if ($risk & (int)$capability->riskbitmask) {
|
||||
$cells .= $this->get_risk_icon($riskname);
|
||||
echo $this->get_risk_icon($riskname);
|
||||
}
|
||||
$cells .= '</td>';
|
||||
echo '</td>';
|
||||
}
|
||||
return $cells;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,12 +182,12 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
||||
*/
|
||||
public function get_risk_icon($type) {
|
||||
global $OUTPUT;
|
||||
|
||||
$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')));
|
||||
|
||||
return $riskicon;
|
||||
if (!isset($this->riskicons[$type])) {
|
||||
$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');
|
||||
$this->riskicons[$type] = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin')));
|
||||
}
|
||||
return $this->riskicons[$type];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,6 @@ class core_role_check_capability_table extends core_role_capability_table_base {
|
||||
$a->fullname = $this->fullname;
|
||||
$a->capability = $capability->name;
|
||||
$a->context = $this->contextname;
|
||||
return '<td>' . $result . '</td>';
|
||||
echo '<td>' . $result . '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
}
|
||||
|
||||
public function save_changes() {
|
||||
global $DB, $CFG;
|
||||
global $DB;
|
||||
|
||||
if (!$this->roleid) {
|
||||
// Creating role.
|
||||
@@ -422,13 +422,6 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
} else {
|
||||
// Updating role.
|
||||
$DB->update_record('role', $this->role);
|
||||
|
||||
// This will ensure the course contacts cache is purged so name changes get updated in
|
||||
// the UI. It would be better to do this only when we know that fields affected are
|
||||
// updated. But thats getting into the weeds of the coursecat cache and role edits
|
||||
// should not be that frequent, so here is the ugly brutal approach.
|
||||
require_once($CFG->libdir . '/coursecatlib.php');
|
||||
coursecat::role_assignment_changed($this->role->id, context_system::instance());
|
||||
}
|
||||
|
||||
// Assignable contexts.
|
||||
@@ -471,19 +464,15 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
}
|
||||
|
||||
protected function get_name_field($id) {
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '"' .
|
||||
' class="form-control"/>';
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '" />';
|
||||
}
|
||||
|
||||
protected function get_shortname_field($id) {
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '"' .
|
||||
' class="form-control"/>';
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '" />';
|
||||
}
|
||||
|
||||
protected function get_description_field($id) {
|
||||
return '<textarea class="form-textarea form-control" id="'. s($id) .'" name="description" rows="10" cols="50">' .
|
||||
htmlspecialchars($this->role->description) .
|
||||
'</textarea>';
|
||||
return print_textarea(true, 10, 50, 50, 10, 'description', $this->role->description, 0, true);
|
||||
}
|
||||
|
||||
protected function get_archetype_field($id) {
|
||||
@@ -492,8 +481,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
foreach (get_role_archetypes() as $type) {
|
||||
$options[$type] = get_string('archetype'.$type, 'role');
|
||||
}
|
||||
return html_writer::select($options, 'archetype', $this->role->archetype, false,
|
||||
array('class' => 'custom-select'));
|
||||
return html_writer::select($options, 'archetype', $this->role->archetype, false);
|
||||
}
|
||||
|
||||
protected function get_assignable_levels_control() {
|
||||
@@ -566,8 +554,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($this->roleid == 0) {
|
||||
$options[-1] = get_string('thisnewrole', 'core_role');
|
||||
}
|
||||
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
|
||||
'size' => 10, 'class' => 'form-control'));
|
||||
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple'=>'multiple', 'size'=>10));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -579,19 +566,11 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Print labels, fields and help icon on role administration page.
|
||||
*
|
||||
* @param string $name The field name.
|
||||
* @param string $caption The field caption.
|
||||
* @param string $field The field type.
|
||||
* @param null|string $helpicon The help icon content.
|
||||
*/
|
||||
protected function print_field($name, $caption, $field, $helpicon = null) {
|
||||
protected function print_field($name, $caption, $field) {
|
||||
global $OUTPUT;
|
||||
// Attempt to generate HTML like formslib.
|
||||
echo '<div class="fitem row form-group">';
|
||||
echo '<div class="fitemtitle col-md-3">';
|
||||
echo '<div class="fitem">';
|
||||
echo '<div class="fitemtitle">';
|
||||
if ($name) {
|
||||
echo '<label for="' . $name . '">';
|
||||
}
|
||||
@@ -599,16 +578,13 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($name) {
|
||||
echo "</label>\n";
|
||||
}
|
||||
if ($helpicon) {
|
||||
echo '<span class="pull-xs-right text-nowrap">'.$helpicon.'</span>';
|
||||
}
|
||||
echo '</div>';
|
||||
if (isset($this->errors[$name])) {
|
||||
$extraclass = ' error';
|
||||
} else {
|
||||
$extraclass = '';
|
||||
}
|
||||
echo '<div class="felement col-md-9 form-inline' . $extraclass . '">';
|
||||
echo '<div class="felement' . $extraclass . '">';
|
||||
echo $field;
|
||||
if (isset($this->errors[$name])) {
|
||||
echo $OUTPUT->error_text($this->errors[$name]);
|
||||
@@ -620,8 +596,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
protected function print_show_hide_advanced_button() {
|
||||
echo '<p class="definenotice">' . get_string('highlightedcellsshowdefault', 'core_role') . ' </p>';
|
||||
echo '<div class="advancedbutton">';
|
||||
echo '<input type="submit" class="btn btn-secondary" name="toggleadvanced" value="' .
|
||||
get_string('hideadvanced', 'form') . '" />';
|
||||
echo '<input type="submit" name="toggleadvanced" value="' . get_string('hideadvanced', 'form') . '" />';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -629,14 +604,11 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
global $OUTPUT;
|
||||
// Extra fields at the top of the page.
|
||||
echo '<div class="topfields clearfix">';
|
||||
$this->print_field('shortname', get_string('roleshortname', 'core_role'),
|
||||
$this->get_shortname_field('shortname'), $OUTPUT->help_icon('roleshortname', 'core_role'));
|
||||
$this->print_field('name', get_string('customrolename', 'core_role'), $this->get_name_field('name'),
|
||||
$OUTPUT->help_icon('customrolename', 'core_role'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'core_role'),
|
||||
$this->get_description_field('description'), $OUTPUT->help_icon('customroledescription', 'core_role'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'core_role'), $this->get_archetype_field('archetype'),
|
||||
$OUTPUT->help_icon('archetype', 'core_role'));
|
||||
$this->print_field('shortname', get_string('roleshortname', 'core_role').' '.$OUTPUT->help_icon('roleshortname', 'core_role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('name', get_string('customrolename', 'core_role').' '.$OUTPUT->help_icon('customrolename', 'core_role'), $this->get_name_field('name'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'core_role').' '.$OUTPUT->help_icon('customroledescription', 'core_role'),
|
||||
$this->get_description_field('description'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'core_role').' '.$OUTPUT->help_icon('archetype', 'core_role'), $this->get_archetype_field('archetype'));
|
||||
$this->print_field('', get_string('maybeassignedin', 'core_role'), $this->get_assignable_levels_control());
|
||||
$this->print_field('menuallowassign', get_string('allowassign', 'core_role'), $this->get_allow_role_control('assign'));
|
||||
$this->print_field('menuallowoverride', get_string('allowoverride', 'core_role'), $this->get_allow_role_control('override'));
|
||||
@@ -654,7 +626,6 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
|
||||
protected function add_permission_cells($capability) {
|
||||
// One cell for each possible permission.
|
||||
$content = '';
|
||||
foreach ($this->displaypermissions as $perm => $permname) {
|
||||
$strperm = $this->strperms[$permname];
|
||||
$extraclass = '';
|
||||
@@ -665,12 +636,11 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($this->permissions[$capability->name] == $perm) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
$content .= '<td class="' . $permname . $extraclass . '">';
|
||||
$content .= '<label><input type="radio" name="' . $capability->name .
|
||||
echo '<td class="' . $permname . $extraclass . '">';
|
||||
echo '<label><input type="radio" name="' . $capability->name .
|
||||
'" value="' . $perm . '" ' . $checked . '/> ';
|
||||
$content .= '<span class="note">' . $strperm . '</span>';
|
||||
$content .= '</label></td>';
|
||||
echo '<span class="note">' . $strperm . '</span>';
|
||||
echo '</label></td>';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,7 @@ class core_role_define_role_table_basic extends core_role_define_role_table_adva
|
||||
|
||||
protected function print_show_hide_advanced_button() {
|
||||
echo '<div class="advancedbutton">';
|
||||
echo '<input type="submit" class="btn btn-secondary" name="toggleadvanced"
|
||||
value="' . get_string('showadvanced', 'form') . '" />';
|
||||
echo '<input type="submit" name="toggleadvanced" value="' . get_string('showadvanced', 'form') . '" />';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -46,20 +45,19 @@ class core_role_define_role_table_basic extends core_role_define_role_table_adva
|
||||
$perm = $this->permissions[$capability->name];
|
||||
$permname = $this->allpermissions[$perm];
|
||||
$defaultperm = $this->allpermissions[$this->parentpermissions[$capability->name]];
|
||||
$content = '<td class="' . $permname . '">';
|
||||
echo '<td class="' . $permname . '">';
|
||||
if ($perm == CAP_ALLOW || $perm == CAP_INHERIT) {
|
||||
$checked = '';
|
||||
if ($perm == CAP_ALLOW) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . CAP_INHERIT . '" />';
|
||||
$content .= '<label><input type="checkbox" name="' . $capability->name .
|
||||
echo '<input type="hidden" name="' . $capability->name . '" value="' . CAP_INHERIT . '" />';
|
||||
echo '<label><input type="checkbox" name="' . $capability->name .
|
||||
'" value="' . CAP_ALLOW . '" ' . $checked . '/> ' . $this->strallow . '</label>';
|
||||
} else {
|
||||
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . $perm . '" />';
|
||||
$content .= $this->strperms[$permname] . '<span class="note">' . $this->stradvmessage . '</span>';
|
||||
echo '<input type="hidden" name="' . $capability->name . '" value="' . $perm . '" />';
|
||||
echo $this->strperms[$permname] . '<span class="note">' . $this->stradvmessage . '</span>';
|
||||
}
|
||||
$content .= '</td>';
|
||||
return $content;
|
||||
echo '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,24 +41,15 @@ class core_role_existing_role_holders extends core_role_assign_user_selector_bas
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$params = array_merge($params, $sortparams);
|
||||
|
||||
$fields = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component ";
|
||||
$countfields = "SELECT COUNT(1) ";
|
||||
$sql = "FROM {role_assignments} ra
|
||||
$sql = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component
|
||||
FROM {role_assignments} ra
|
||||
JOIN {user} u ON u.id = ra.userid
|
||||
JOIN {context} ctx ON ra.contextid = ctx.id
|
||||
WHERE $wherecondition
|
||||
AND ctx.id $ctxcondition
|
||||
AND ra.roleid = :roleid";
|
||||
$order = " ORDER BY ctx.depth DESC, ra.component, $sort";
|
||||
|
||||
if (!$this->is_validating()) {
|
||||
$existinguserscount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
if ($existinguserscount > $this->maxusersperpage) {
|
||||
return $this->too_many_results($search, $existinguserscount);
|
||||
}
|
||||
}
|
||||
|
||||
$contextusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
AND ra.roleid = :roleid
|
||||
ORDER BY ctx.depth DESC, ra.component, $sort";
|
||||
$contextusers = $DB->get_records_sql($sql, $params);
|
||||
|
||||
// No users at all.
|
||||
if (empty($contextusers)) {
|
||||
|
||||
@@ -73,7 +73,6 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
|
||||
// One cell for each possible permission.
|
||||
$content = '';
|
||||
foreach ($this->displaypermissions as $perm => $permname) {
|
||||
$strperm = $this->strperms[$permname];
|
||||
$extraclass = '';
|
||||
@@ -84,8 +83,8 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
if ($this->permissions[$capability->name] == $perm) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
$content .= '<td class="' . $permname . $extraclass . '">';
|
||||
$content .= '<label><input type="radio" name="' . $capability->name .
|
||||
echo '<td class="' . $permname . $extraclass . '">';
|
||||
echo '<label><input type="radio" name="' . $capability->name .
|
||||
'" value="' . $perm . '" ' . $checked . $disabled . '/> ';
|
||||
if ($perm == CAP_INHERIT) {
|
||||
$inherited = $this->parentpermissions[$capability->name];
|
||||
@@ -96,9 +95,8 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
$strperm .= ' (' . $inherited . ')';
|
||||
}
|
||||
$content .= '<span class="note">' . $strperm . '</span>';
|
||||
$content .= '</label></td>';
|
||||
echo '<span class="note">' . $strperm . '</span>';
|
||||
echo '</label></td>';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,6 @@ class core_role_permissions_table extends core_role_capability_table_base {
|
||||
|
||||
protected function add_row_cells($capability) {
|
||||
global $OUTPUT, $PAGE;
|
||||
$renderer = $PAGE->get_renderer('core');
|
||||
$adminurl = new moodle_url("/admin/");
|
||||
|
||||
$context = $this->context;
|
||||
$contextid = $this->context->id;
|
||||
@@ -77,6 +75,7 @@ class core_role_permissions_table extends core_role_capability_table_base {
|
||||
$overridableroles = $this->overridableroles;
|
||||
$roles = $this->roles;
|
||||
|
||||
|
||||
list($needed, $forbidden) = get_roles_with_cap_in_context($context, $capability->name);
|
||||
$neededroles = array();
|
||||
$forbiddenroles = array();
|
||||
@@ -92,50 +91,40 @@ 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(), "imageurl" => "");
|
||||
$neededroles[$id] = $roles[$id];
|
||||
if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
|
||||
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
|
||||
$preventurl = new moodle_url($PAGE->url, array('contextid'=>$contextid, 'roleid'=>$id, 'capability'=>$capability->name, 'prevent'=>1));
|
||||
$neededroles[$id] .= $OUTPUT->action_icon($preventurl, new pix_icon('t/delete', get_string('prevent', 'core_role')));
|
||||
}
|
||||
$neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
|
||||
}
|
||||
}
|
||||
$neededroles = implode(' ', $neededroles);
|
||||
$neededroles = implode(', ', $neededroles);
|
||||
foreach ($roles as $id => $name) {
|
||||
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(),
|
||||
"imageurl" => "");
|
||||
$forbiddenroles[$id] = $roles[$id];
|
||||
if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) {
|
||||
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
|
||||
$unprohibiturl = new moodle_url($PAGE->url, array('contextid'=>$contextid, 'roleid'=>$id, 'capability'=>$capability->name, 'unprohibit'=>1));
|
||||
$forbiddenroles[$id] .= $OUTPUT->action_icon($unprohibiturl, new pix_icon('t/delete', get_string('delete')));
|
||||
}
|
||||
$forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
|
||||
}
|
||||
}
|
||||
$forbiddenroles = implode(' ', $forbiddenroles);
|
||||
$forbiddenroles = implode(', ', $forbiddenroles);
|
||||
|
||||
if ($allowable and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
|
||||
$allowurl = new moodle_url($PAGE->url, array('contextid' => $contextid,
|
||||
'capability' => $capability->name, 'allow' => 1));
|
||||
$allowicon = $OUTPUT->action_icon($allowurl, new pix_icon('t/add', get_string('allow', 'core_role')), null,
|
||||
array('class' => 'allowlink', 'data-action' => 'allow'));
|
||||
$neededroles .= html_writer::div($allowicon, 'allowmore');
|
||||
$allowurl = new moodle_url($PAGE->url, array('contextid'=>$contextid, 'capability'=>$capability->name, 'allow'=>1));
|
||||
$neededroles .= '<div class="allowmore">'.$OUTPUT->action_icon($allowurl, new pix_icon('t/add', get_string('allow', 'core_role'))).'</div>';
|
||||
}
|
||||
|
||||
if ($forbitable and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
|
||||
$prohibiturl = new moodle_url($PAGE->url, array('contextid' => $contextid,
|
||||
'capability' => $capability->name, 'prohibit' => 1));
|
||||
$prohibiticon = $OUTPUT->action_icon($prohibiturl, new pix_icon('t/add', get_string('prohibit', 'core_role')), null,
|
||||
array('class' => 'prohibitlink', 'data-action' => 'prohibit'));
|
||||
$forbiddenroles .= html_writer::div($prohibiticon, 'prohibitmore');
|
||||
$prohibiturl = new moodle_url($PAGE->url, array('contextid'=>$contextid, 'capability'=>$capability->name, 'prohibit'=>1));
|
||||
$forbiddenroles .= '<div class="prohibitmore">'.$OUTPUT->action_icon($prohibiturl, new pix_icon('t/add', get_string('prohibit', 'core_role'))).'</div>';
|
||||
}
|
||||
|
||||
$risks = $this->get_risks($capability);
|
||||
|
||||
$contents = html_writer::tag('td', $risks, array('class' => 'risks text-nowrap'));
|
||||
$contents .= html_writer::tag('td', $neededroles, array('class' => 'allowedroles'));
|
||||
$contents .= html_writer::tag('td', $forbiddenroles, array('class' => 'forbiddenroles'));
|
||||
return $contents;
|
||||
echo '<td>' . $risks . '</td>';
|
||||
echo '<td>' . $neededroles . '</td>';
|
||||
echo '<td>' . $forbiddenroles . '</td>';
|
||||
}
|
||||
|
||||
protected function get_risks($capability) {
|
||||
@@ -158,18 +147,4 @@ class core_role_permissions_table extends core_role_capability_table_base {
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional attributes to row
|
||||
*
|
||||
* @param stdClass $capability capability that this table row relates to.
|
||||
* @return array key value pairs of attribute names and values.
|
||||
*/
|
||||
protected function get_row_attributes($capability) {
|
||||
return array(
|
||||
'data-id' => $capability->id,
|
||||
'data-name' => $capability->name,
|
||||
'data-humanname' => get_capability_string($capability->name),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,12 +48,11 @@ class core_role_potential_assignees_below_course extends core_role_assign_user_s
|
||||
$fields = 'SELECT ' . $this->required_fields_sql('u');
|
||||
$countfields = 'SELECT COUNT(u.id)';
|
||||
|
||||
$sql = " FROM ($enrolsql) enrolled_users_view
|
||||
JOIN {user} u ON u.id = enrolled_users_view.id
|
||||
LEFT JOIN {role_assignments} ra ON (ra.userid = enrolled_users_view.id AND
|
||||
ra.roleid = :roleid AND ra.contextid = :contextid)
|
||||
WHERE ra.id IS NULL
|
||||
$wherecondition";
|
||||
$sql = " FROM {user} u
|
||||
LEFT JOIN {role_assignments} ra ON (ra.userid = u.id AND ra.roleid = :roleid AND ra.contextid = :contextid)
|
||||
WHERE u.id IN ($enrolsql)
|
||||
$wherecondition
|
||||
AND ra.id IS NULL";
|
||||
$params['contextid'] = $this->context->id;
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
|
||||
@@ -71,9 +71,8 @@ class core_role_preset {
|
||||
$dom->appendChild($top);
|
||||
|
||||
$top->appendChild($dom->createElement('shortname', $role->shortname));
|
||||
$top->appendChild($dom->createElement('name', htmlspecialchars($role->name, ENT_COMPAT | ENT_HTML401, 'UTF-8')));
|
||||
$top->appendChild($dom->createElement('description', htmlspecialchars($role->description, ENT_COMPAT | ENT_HTML401,
|
||||
'UTF-8')));
|
||||
$top->appendChild($dom->createElement('name', $role->name));
|
||||
$top->appendChild($dom->createElement('description', $role->description));
|
||||
$top->appendChild($dom->createElement('archetype', $role->archetype));
|
||||
|
||||
$contextlevels = $dom->createElement('contextlevels');
|
||||
|
||||
@@ -129,7 +129,7 @@ class core_role_view_role_definition_table extends core_role_define_role_table_a
|
||||
} else {
|
||||
$default = " ";
|
||||
}
|
||||
return '<td class="' . $permname . '">' . $this->strperms[$permname] . '<span class="note">' .
|
||||
echo '<td class="' . $permname . '">' . $this->strperms[$permname] . '<span class="note">' .
|
||||
$default . '</span></td>';
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHA);
|
||||
@@ -201,7 +201,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey() && $de
|
||||
$event = \core\event\role_capabilities_updated::create(
|
||||
array(
|
||||
'context' => $systemcontext,
|
||||
'objectid' => $tableroleid
|
||||
'objectid' => $roleid
|
||||
)
|
||||
);
|
||||
$event->set_legacy_logdata(array(SITEID, 'role', $action, 'admin/roles/define.php?action=view&roleid=' . $tableroleid,
|
||||
@@ -252,13 +252,13 @@ if ($action === 'view') {
|
||||
echo '<div class="mform">';
|
||||
} else {
|
||||
?>
|
||||
<form id="rolesform" class="mform fcontainer" action="<?php p($baseurl->out(false)); ?>" method="post"><div>
|
||||
<form id="rolesform" class="mform" action="<?php p($baseurl->out(false)); ?>" method="post"><div>
|
||||
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
|
||||
<input type="hidden" name="return" value="<?php p($return); ?>" />
|
||||
<input type="hidden" name="resettype" value="none" />
|
||||
<div class="submitbuttons">
|
||||
<input type="submit" name="savechanges" class="btn btn-primary" value="<?php p($submitlabel); ?>" />
|
||||
<input type="submit" name="cancel" class="btn btn-secondary" value="<?php print_string('cancel'); ?>" />
|
||||
<div class="submit buttons">
|
||||
<input type="submit" name="savechanges" value="<?php p($submitlabel); ?>" />
|
||||
<input type="submit" name="cancel" value="<?php print_string('cancel'); ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -271,9 +271,9 @@ if ($action === 'view') {
|
||||
echo '</div>';
|
||||
} else {
|
||||
?>
|
||||
<div class="submitbuttons">
|
||||
<input type="submit" name="savechanges" class="btn btn-primary" value="<?php p($submitlabel); ?>" />
|
||||
<input type="submit" name="cancel" class="btn btn-secondary" value="<?php print_string('cancel'); ?>" />
|
||||
<div class="submit buttons">
|
||||
<input type="submit" name="savechanges" value="<?php p($submitlabel); ?>" />
|
||||
<input type="submit" name="cancel" value="<?php print_string('cancel'); ?>" />
|
||||
</div>
|
||||
</div></form>
|
||||
<?php
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../config.php');
|
||||
require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
|
||||
|
||||
|
||||
@@ -45,20 +45,17 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
|
||||
this.table = Y.one('#'+this.tableid);
|
||||
|
||||
// Create a div to hold the search UI.
|
||||
this.div = Y.Node.create('<div class="capabilitysearchui form-inline"></div>').setStyles({
|
||||
this.div = Y.Node.create('<div class="capabilitysearchui"></div>').setStyles({
|
||||
width : this.table.get('offsetWidth'),
|
||||
marginLeft : 'auto',
|
||||
marginRight : 'auto'
|
||||
});
|
||||
// Create the capability search input.
|
||||
this.input = Y.Node.create('<input class="form-control m-x-1" type="text"' +
|
||||
' id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
|
||||
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
|
||||
// Create a label for the search input.
|
||||
this.label = Y.Node.create('<label for="' + this.input.get('id') + '">' +
|
||||
M.util.get_string('filter', 'moodle') + ' </label>');
|
||||
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>');
|
||||
// Create a clear button to clear the input.
|
||||
this.button = Y.Node.create('<input type="button" class="btn btn-primary"' +
|
||||
' value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
|
||||
this.button = Y.Node.create('<input type="button" value="'+M.str.moodle.clear+'" />').set('disabled', filtervalue=='');
|
||||
|
||||
// Tie it all together
|
||||
this.div.append(this.label).append(this.input).append(this.button);
|
||||
|
||||
@@ -177,10 +177,8 @@ if (!empty($capabilities)) {
|
||||
}
|
||||
|
||||
echo html_writer::start_tag('div', array('class'=>'submit_buttons'));
|
||||
$attrs = array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges'), 'class'=>'btn btn-primary');
|
||||
echo html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel'), 'class' => 'btn btn-secondary');
|
||||
echo html_writer::empty_tag('input', $attrs);
|
||||
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges')));
|
||||
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel')));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
@@ -33,7 +33,7 @@ $prevent = optional_param('prevent', 0, PARAM_BOOL);
|
||||
$allow = optional_param('allow', 0, PARAM_BOOL);
|
||||
$unprohibit = optional_param('unprohibit', 0, PARAM_BOOL);
|
||||
$prohibit = optional_param('prohibit', 0, PARAM_BOOL);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
$return = optional_param('return', null, PARAM_ALPHANUMEXT);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
|
||||
@@ -56,18 +56,11 @@ if ($course) {
|
||||
// Security first.
|
||||
require_login($course, false, $cm);
|
||||
require_capability('moodle/role:review', $context);
|
||||
|
||||
navigation_node::override_active_url($url);
|
||||
$pageurl = new moodle_url($url);
|
||||
if ($returnurl) {
|
||||
$pageurl->param('returnurl', $returnurl);
|
||||
}
|
||||
$PAGE->set_url($pageurl);
|
||||
$PAGE->set_url($url);
|
||||
|
||||
if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
|
||||
$PAGE->navbar->includesettingsbase = true;
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
$PAGE->set_context(context_user::instance($user->id));
|
||||
$PAGE->set_context(context_course::instance($course->id));
|
||||
} else {
|
||||
$PAGE->set_context($context);
|
||||
}
|
||||
@@ -91,11 +84,6 @@ $straction = get_string('permissions', 'core_role'); // Used by tabs.php.
|
||||
$currenttab = 'permissions';
|
||||
|
||||
$PAGE->set_pagelayout('admin');
|
||||
if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
// Do not show blocks when changing block's settings, it is confusing.
|
||||
$PAGE->blocks->show_only_fake_blocks(true);
|
||||
}
|
||||
|
||||
$PAGE->set_title($title);
|
||||
switch ($context->contextlevel) {
|
||||
case CONTEXT_SYSTEM:
|
||||
@@ -206,15 +194,6 @@ if ($capability && ($allowoverrides || ($allowsafeoverrides && is_safe_capabilit
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
$adminurl = new moodle_url('/admin/');
|
||||
$arguments = array('contextid' => $contextid,
|
||||
'contextname' => $contextname,
|
||||
'adminurl' => $adminurl->out());
|
||||
$PAGE->requires->strings_for_js(
|
||||
array('roleprohibitinfo', 'roleprohibitheader', 'roleallowinfo', 'roleallowheader',
|
||||
'confirmunassigntitle', 'confirmroleunprohibit', 'confirmroleprevent', 'confirmunassignyes',
|
||||
'confirmunassignno'), 'core_role');
|
||||
$PAGE->requires->js_call_amd('core/permissionmanager', 'initialize', array($arguments));
|
||||
$table = new core_role_permissions_table($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles);
|
||||
echo $OUTPUT->box_start('generalbox capbox');
|
||||
// Print link to advanced override page.
|
||||
@@ -230,8 +209,8 @@ echo $OUTPUT->box_end();
|
||||
|
||||
if ($context->contextlevel > CONTEXT_USER) {
|
||||
|
||||
if ($returnurl) {
|
||||
$url = new moodle_url($returnurl);
|
||||
if ($context->contextlevel === CONTEXT_COURSECAT && $return === 'management') {
|
||||
$url = new moodle_url('/course/management.php', array('categoryid' => $context->instanceid));
|
||||
} else {
|
||||
$url = $context->get_url();
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ if ($courseid == SITEID) {
|
||||
$PAGE->set_heading($course->fullname.': '.$fullname);
|
||||
}
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
echo $OUTPUT->heading($title, 3);
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
|
||||
|
||||
// Display them.
|
||||
|
||||
+20
-26
@@ -7,8 +7,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
|
||||
|
||||
$context = context_system::instance();
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
|
||||
|
||||
@@ -19,18 +18,16 @@ $errormsg = '';
|
||||
$focus = '';
|
||||
|
||||
// now we'll deal with the case that the admin has submitted the form with changed settings
|
||||
if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') {
|
||||
require_capability('moodle/site:config', $context);
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
|
||||
if (!empty($adminroot->errors)) {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
$focus = $firsterror->id;
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +35,6 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
|
||||
// to modify them
|
||||
echo $OUTPUT->header($focus);
|
||||
|
||||
echo $OUTPUT->heading(get_string('administrationsite'));
|
||||
|
||||
if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($errormsg);
|
||||
|
||||
@@ -47,24 +42,23 @@ if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
||||
}
|
||||
|
||||
$showsettingslinks = true;
|
||||
$resultshtml = admin_search_settings_html($query); // case insensitive search only
|
||||
|
||||
if (has_capability('moodle/site:config', $context)) {
|
||||
require_once("admin_settings_search_form.php");
|
||||
$form = new admin_settings_search_form();
|
||||
$form->display();
|
||||
echo '<hr>';
|
||||
if ($query) {
|
||||
echo admin_search_settings_html($query);
|
||||
$showsettingslinks = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($showsettingslinks) {
|
||||
$node = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN);
|
||||
if ($node) {
|
||||
echo $OUTPUT->render_from_template('core/settings_link_page', ['node' => $node]);
|
||||
}
|
||||
echo '<form action="search.php" method="post" id="adminsettings">';
|
||||
echo '<div>';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<input type="hidden" name="query" value="'.s($query).'" />';
|
||||
echo '</div>';
|
||||
echo '<fieldset>';
|
||||
echo '<div class="clearer"><!-- --></div>';
|
||||
if ($resultshtml != '') {
|
||||
echo $resultshtml;
|
||||
} else {
|
||||
echo get_string('noresults','admin');
|
||||
}
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
|
||||
@@ -1,180 +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/>.
|
||||
|
||||
/**
|
||||
* Manage global search areas.
|
||||
*
|
||||
* @package core_search
|
||||
* @copyright 2016 Dan Poltawski <dan@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('searchareas');
|
||||
|
||||
$areaid = optional_param('areaid', null, PARAM_ALPHAEXT);
|
||||
$action = optional_param('action', null, PARAM_ALPHA);
|
||||
|
||||
try {
|
||||
$searchmanager = \core_search\manager::instance();
|
||||
} catch (core_search\engine_exception $searchmanagererror) {
|
||||
// Continue, we return an error later depending on the requested action.
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($action) {
|
||||
require_sesskey();
|
||||
|
||||
if ($areaid) {
|
||||
// We need to check that the area exists.
|
||||
$area = \core_search\manager::get_search_area($areaid);
|
||||
if ($area === false) {
|
||||
throw new moodle_exception('invalidrequest');
|
||||
}
|
||||
}
|
||||
|
||||
// All actions but enable/disable need the search engine to be ready.
|
||||
if ($action !== 'enable' && $action !== 'disable') {
|
||||
if (!empty($searchmanagererror)) {
|
||||
throw $searchmanagererror;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'enable':
|
||||
$area->set_enabled(true);
|
||||
echo $OUTPUT->notification(get_string('searchareaenabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
case 'disable':
|
||||
$area->set_enabled(false);
|
||||
echo $OUTPUT->notification(get_string('searchareadisabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
case 'delete':
|
||||
$search = \core_search\manager::instance();
|
||||
$search->delete_index($areaid);
|
||||
echo $OUTPUT->notification(get_string('searchindexdeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
case 'indexall':
|
||||
$searchmanager->index();
|
||||
echo $OUTPUT->notification(get_string('searchindexupdated', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
case 'reindexall':
|
||||
$searchmanager->index(true);
|
||||
echo $OUTPUT->notification(get_string('searchreindexed', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
case 'deleteall':
|
||||
$searchmanager->delete_index();
|
||||
echo $OUTPUT->notification(get_string('searchalldeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
|
||||
break;
|
||||
default:
|
||||
throw new moodle_exception('invalidaction');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$searchareas = \core_search\manager::get_search_areas_list();
|
||||
if (empty($searchmanagererror)) {
|
||||
$areasconfig = $searchmanager->get_areas_config($searchareas);
|
||||
} else {
|
||||
$areasconfig = false;
|
||||
}
|
||||
|
||||
if (!empty($searchmanagererror)) {
|
||||
$errorstr = get_string($searchmanagererror->errorcode, $searchmanagererror->module, $searchmanagererror->a);
|
||||
echo $OUTPUT->notification($errorstr, \core\output\notification::NOTIFY_ERROR);
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('indexinginfo', 'admin'), \core\output\notification::NOTIFY_INFO);
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'core-search-areas';
|
||||
|
||||
$table->head = array(get_string('searcharea', 'search'), get_string('enable'), get_string('newestdocindexed', 'admin'),
|
||||
get_string('searchlastrun', 'admin'), get_string('searchindexactions', 'admin'));
|
||||
|
||||
foreach ($searchareas as $area) {
|
||||
$areaid = $area->get_area_id();
|
||||
$columns = array(new html_table_cell($area->get_visible_name()));
|
||||
|
||||
if ($area->is_enabled()) {
|
||||
$columns[] = $OUTPUT->action_icon(admin_searcharea_action_url('disable', $areaid),
|
||||
new pix_icon('t/hide', get_string('disable'), 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => get_string('disable')));
|
||||
|
||||
if ($areasconfig) {
|
||||
$columns[] = $areasconfig[$areaid]->lastindexrun;
|
||||
|
||||
if ($areasconfig[$areaid]->indexingstart) {
|
||||
$timediff = $areasconfig[$areaid]->indexingend - $areasconfig[$areaid]->indexingstart;
|
||||
$laststatus = $timediff . ' , ' .
|
||||
$areasconfig[$areaid]->docsprocessed . ' , ' .
|
||||
$areasconfig[$areaid]->recordsprocessed . ' , ' .
|
||||
$areasconfig[$areaid]->docsignored;
|
||||
} else {
|
||||
$laststatus = '';
|
||||
}
|
||||
$columns[] = $laststatus;
|
||||
$columns[] = html_writer::link(admin_searcharea_action_url('delete', $areaid), 'Delete index');
|
||||
|
||||
} else {
|
||||
$blankrow = new html_table_cell(get_string('searchnotavailable', 'admin'));
|
||||
$blankrow->colspan = 3;
|
||||
$columns[] = $blankrow;
|
||||
}
|
||||
|
||||
} else {
|
||||
$columns[] = $OUTPUT->action_icon(admin_searcharea_action_url('enable', $areaid),
|
||||
new pix_icon('t/show', get_string('enable'), 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => get_string('enable')));
|
||||
|
||||
$blankrow = new html_table_cell(get_string('searchareadisabled', 'admin'));
|
||||
$blankrow->colspan = 3;
|
||||
$columns[] = $blankrow;
|
||||
}
|
||||
$row = new html_table_row($columns);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
|
||||
// Cross-search area tasks.
|
||||
$options = array();
|
||||
if (!empty($searchmanagererror)) {
|
||||
$options['disabled'] = true;
|
||||
}
|
||||
echo $OUTPUT->box_start('search-areas-actions');
|
||||
echo $OUTPUT->single_button(admin_searcharea_action_url('indexall'), get_string('searchupdateindex', 'admin'), 'get', $options);
|
||||
echo $OUTPUT->single_button(admin_searcharea_action_url('reindexall'), get_string('searchreindexindex', 'admin'), 'get', $options);
|
||||
echo $OUTPUT->single_button(admin_searcharea_action_url('deleteall'), get_string('searchdeleteindex', 'admin'), 'get', $options);
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo html_writer::table($table);
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
/**
|
||||
* Helper for generating url for management actions.
|
||||
*
|
||||
* @param string $action
|
||||
* @param string $areaid
|
||||
* @return moodle_url
|
||||
*/
|
||||
function admin_searcharea_action_url($action, $areaid = false) {
|
||||
$params = array('action' => $action, 'sesskey' => sesskey());
|
||||
if ($areaid) {
|
||||
$params['areaid'] = $areaid;
|
||||
}
|
||||
return new moodle_url('/admin/searchareas.php', $params);
|
||||
}
|
||||
+28
-39
@@ -20,11 +20,7 @@ $adminroot = admin_get_root(); // need all settings
|
||||
$settingspage = $adminroot->locate($section, true);
|
||||
|
||||
if (empty($settingspage) or !($settingspage instanceof admin_settingpage)) {
|
||||
if (moodle_needs_upgrading()) {
|
||||
redirect(new moodle_url('/admin/index.php'));
|
||||
} else {
|
||||
print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
die;
|
||||
}
|
||||
|
||||
@@ -40,7 +36,7 @@ $errormsg = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
|
||||
if (empty($adminroot->errors)) {
|
||||
@@ -48,11 +44,11 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
case 'site': redirect("$CFG->wwwroot/");
|
||||
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($section, true);
|
||||
}
|
||||
|
||||
@@ -77,23 +73,18 @@ if (empty($SITE->fullname)) {
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$pageparams = $PAGE->url->params();
|
||||
$context = [
|
||||
'actionurl' => $PAGE->url->out(false),
|
||||
'params' => array_map(function($param) use ($pageparams) {
|
||||
return [
|
||||
'name' => $param,
|
||||
'value' => $pageparams[$param]
|
||||
];
|
||||
}, array_keys($pageparams)),
|
||||
'sesskey' => sesskey(),
|
||||
'return' => $return,
|
||||
'title' => null,
|
||||
'settings' => $settingspage->output_html(),
|
||||
'showsave' => true
|
||||
];
|
||||
echo '<form action="settings.php" method="post" id="adminsettings">';
|
||||
echo '<div class="settingsform clearfix">';
|
||||
echo html_writer::input_hidden_params($PAGE->url);
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<input type="hidden" name="return" value="'.$return.'" />';
|
||||
|
||||
echo $OUTPUT->render_from_template('core_admin/settings', $context);
|
||||
echo $settingspage->output_html();
|
||||
|
||||
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
} else {
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
@@ -124,23 +115,21 @@ if (empty($SITE->fullname)) {
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$pageparams = $PAGE->url->params();
|
||||
$context = [
|
||||
'actionurl' => $PAGE->url->out(false),
|
||||
'params' => array_map(function($param) use ($pageparams) {
|
||||
return [
|
||||
'name' => $param,
|
||||
'value' => $pageparams[$param]
|
||||
];
|
||||
}, array_keys($pageparams)),
|
||||
'sesskey' => sesskey(),
|
||||
'return' => $return,
|
||||
'title' => $settingspage->visiblename,
|
||||
'settings' => $settingspage->output_html(),
|
||||
'showsave' => $settingspage->show_save()
|
||||
];
|
||||
echo '<form action="settings.php" method="post" id="adminsettings">';
|
||||
echo '<div class="settingsform clearfix">';
|
||||
echo html_writer::input_hidden_params($PAGE->url);
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<input type="hidden" name="return" value="'.$return.'" />';
|
||||
echo $OUTPUT->heading($settingspage->visiblename);
|
||||
|
||||
echo $OUTPUT->render_from_template('core_admin/settings', $context);
|
||||
echo $settingspage->output_html();
|
||||
|
||||
if ($settingspage->show_save()) {
|
||||
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$PAGE->requires->yui_module('moodle-core-formchangechecker',
|
||||
|
||||
@@ -12,10 +12,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
||||
// "themesettings" settingpage
|
||||
$temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
|
||||
$setting = new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'),
|
||||
new lang_string('configthemelist', 'admin'), '', PARAM_NOTAGS);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'), new lang_string('configthemelist','admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'), new lang_string('configthemedesignermode', 'admin'), 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
@@ -25,19 +22,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
|
||||
new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
|
||||
$temp->add(new admin_setting_configtextarea(
|
||||
'customusermenuitems',
|
||||
new lang_string('customusermenuitems', 'admin'),
|
||||
new lang_string('configcustomusermenuitems', 'admin'),
|
||||
'grades,grades|/grade/report/mygrades.php|grades
|
||||
messages,message|/message/index.php|message
|
||||
preferences,moodle|/user/preferences.php|preferences',
|
||||
PARAM_RAW,
|
||||
'50',
|
||||
'10'
|
||||
));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
|
||||
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
|
||||
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
|
||||
$ADMIN->add('themes', $temp);
|
||||
@@ -55,26 +40,6 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
}
|
||||
}
|
||||
|
||||
// Logos section.
|
||||
$temp = new admin_settingpage('logos', new lang_string('logossettings', 'admin'));
|
||||
|
||||
// Logo file setting.
|
||||
$title = get_string('logo', 'admin');
|
||||
$description = get_string('logo_desc', 'admin');
|
||||
$setting = new admin_setting_configstoredfile('core_admin/logo', $title, $description, 'logo', 0,
|
||||
['maxfiles' => 1, 'accepted_types' => ['.jpg', '.png']]);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
|
||||
// Small logo file setting.
|
||||
$title = get_string('logocompact', 'admin');
|
||||
$description = get_string('logocompact_desc', 'admin');
|
||||
$setting = new admin_setting_configstoredfile('core_admin/logocompact', $title, $description, 'logocompact', 0,
|
||||
['maxfiles' => 1, 'accepted_types' => ['.jpg', '.png']]);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// Calendar settings.
|
||||
$temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
|
||||
@@ -88,8 +53,7 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
array('0' => new lang_string('default', 'calendar'),
|
||||
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
|
||||
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
|
||||
new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
|
||||
array(
|
||||
0 => new lang_string('sunday', 'calendar'),
|
||||
1 => new lang_string('monday', 'calendar'),
|
||||
@@ -100,24 +64,11 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
6 => new lang_string('saturday', 'calendar')
|
||||
)));
|
||||
$temp->add(new admin_setting_special_calendar_weekend());
|
||||
$options = array(365 => new lang_string('numyear', '', 1),
|
||||
270 => new lang_string('nummonths', '', 9),
|
||||
180 => new lang_string('nummonths', '', 6),
|
||||
150 => new lang_string('nummonths', '', 5),
|
||||
120 => new lang_string('nummonths', '', 4),
|
||||
90 => new lang_string('nummonths', '', 3),
|
||||
60 => new lang_string('nummonths', '', 2),
|
||||
30 => new lang_string('nummonth', '', 1),
|
||||
21 => new lang_string('numweeks', '', 3),
|
||||
14 => new lang_string('numweeks', '', 2),
|
||||
7 => new lang_string('numweek', '', 1),
|
||||
6 => new lang_string('numdays', '', 6),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
4 => new lang_string('numdays', '', 4),
|
||||
3 => new lang_string('numdays', '', 3),
|
||||
2 => new lang_string('numdays', '', 2),
|
||||
1 => new lang_string('numday', '', 1));
|
||||
$temp->add(new admin_setting_configselect('calendar_lookahead', new lang_string('configlookahead', 'admin'), new lang_string('helpupcominglookahead', 'admin'), 21, $options));
|
||||
$options = array();
|
||||
for ($i=1; $i<=99; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('calendar_lookahead',new lang_string('configlookahead','admin'),new lang_string('helpupcominglookahead', 'admin'),21,$options));
|
||||
$options = array();
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
@@ -165,8 +116,7 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'),
|
||||
new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_MY, $choices));
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('allowguestmymoodle', new lang_string('allowguestmymoodle', 'admin'), new lang_string('configallowguestmymoodle', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfullcoursenames', new lang_string('navshowfullcoursenames', 'admin'), new lang_string('navshowfullcoursenames_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
|
||||
@@ -181,8 +131,7 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
$temp->add(new admin_setting_configselect('navsortmycoursessort', new lang_string('navsortmycoursessort', 'admin'), new lang_string('navsortmycoursessort_help', 'admin'), 'sortorder', $sortoptions));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('linkcoursesections', new lang_string('linkcoursesections', 'admin'), new lang_string('linkcoursesections_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
|
||||
@@ -196,6 +145,49 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
|
||||
new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
|
||||
|
||||
|
||||
// The "media" subpage.
|
||||
$temp = new admin_settingpage('mediasettings', get_string('mediasettings', 'core_media'));
|
||||
|
||||
$temp->add(new admin_setting_heading('mediaformats', get_string('mediaformats', 'core_media'),
|
||||
format_text(get_string('mediaformats_desc', 'core_media'), FORMAT_MARKDOWN)));
|
||||
|
||||
// External services.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_youtube',
|
||||
get_string('siteyoutube', 'core_media'), get_string('siteyoutube_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_vimeo',
|
||||
get_string('sitevimeo', 'core_media'), get_string('sitevimeo_desc', 'core_media'), 0));
|
||||
|
||||
// Options which require Flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_mp3',
|
||||
get_string('mp3audio', 'core_media'), get_string('mp3audio_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_flv',
|
||||
get_string('flashvideo', 'core_media'), get_string('flashvideo_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_swf',
|
||||
get_string('flashanimation', 'core_media'), get_string('flashanimation_desc', 'core_media'), 1));
|
||||
|
||||
// HTML 5 media.
|
||||
// Audio now enabled by default so that it can provide a fallback for mp3 on devices without flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5audio',
|
||||
get_string('html5audio', 'core_media'), get_string('html5audio_desc', 'core_media'), 1));
|
||||
// Video now enabled by default so it can provide mp4 support.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5video',
|
||||
get_string('html5video', 'core_media'), get_string('html5video_desc', 'core_media'), 1));
|
||||
|
||||
// Legacy players.
|
||||
$temp->add(new admin_setting_heading('legacymediaformats',
|
||||
get_string('legacyheading', 'core_media'), get_string('legacyheading_desc', 'core_media')));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_qt',
|
||||
get_string('legacyquicktime', 'core_media'), get_string('legacyquicktime_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_wmp',
|
||||
get_string('legacywmp', 'core_media'), get_string('legacywmp_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_rm',
|
||||
get_string('legacyreal', 'core_media'), get_string('legacyreal_desc', 'core_media'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
|
||||
// "documentation" settingpage
|
||||
$temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
@@ -234,13 +226,12 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
$setting->set_updatedcallback('js_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('modeditingmenu', new lang_string('modeditingmenu', 'admin'), new lang_string('modeditingmenu_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blockeditingmenu', new lang_string('blockeditingmenu', 'admin'), new lang_string('blockeditingmenu_desc', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// Link to tag management interface.
|
||||
$url = new moodle_url('/tag/manage.php');
|
||||
$hidden = empty($CFG->usetags);
|
||||
$page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden);
|
||||
$ADMIN->add('appearance', $page);
|
||||
// link to tag management interface
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $CFG->wwwroot.'/tag/manage.php', 'moodle/tag:manage'));
|
||||
|
||||
$temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
|
||||
$temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
|
||||
|
||||
@@ -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/>.
|
||||
|
||||
/**
|
||||
* File.
|
||||
*
|
||||
* @package core_competency
|
||||
* @copyright 2016 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Save processing when the user will not be able to access anything.
|
||||
if (has_capability('moodle/site:config', $systemcontext)) {
|
||||
|
||||
$parentname = 'competencies';
|
||||
|
||||
// Settings page.
|
||||
$settings = new admin_settingpage('competencysettings', new lang_string('competenciessettings', 'core_competency'),
|
||||
'moodle/site:config', false);
|
||||
$ADMIN->add($parentname, $settings);
|
||||
|
||||
// Load the full tree of settings.
|
||||
if ($ADMIN->fulltree) {
|
||||
$setting = new admin_setting_configcheckbox('core_competency/enabled',
|
||||
new lang_string('enablecompetencies', 'core_competency'),
|
||||
new lang_string('enablecompetencies_desc', 'core_competency'), 1);
|
||||
$settings->add($setting);
|
||||
|
||||
$setting = new admin_setting_configcheckbox('core_competency/pushcourseratingstouserplans',
|
||||
new lang_string('pushcourseratingstouserplans', 'core_competency'),
|
||||
new lang_string('pushcourseratingstouserplans_desc', 'core_competency'), 1);
|
||||
$settings->add($setting);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
$ADMIN->add('courses',
|
||||
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
|
||||
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
|
||||
array('moodle/restore:restorecourse')
|
||||
array('moodle/course:create')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -72,13 +72,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
|
||||
'topics', $formcourseformats));
|
||||
'weeks',$formcourseformats));
|
||||
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
|
||||
new lang_string('maxnumberweeks_desc'), 52));
|
||||
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
|
||||
new lang_string('coursehelpnumberweeks'), 4));
|
||||
new lang_string('coursehelpnumberweeks'), 10));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
||||
@@ -92,9 +92,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'),
|
||||
new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
||||
|
||||
$temp->add(new admin_setting_configduration('moodlecourse/courseduration', get_string('courseduration'),
|
||||
get_string('courseduration_desc'), YEARSECS));
|
||||
|
||||
// Appearance.
|
||||
$temp->add(new admin_setting_heading('appearancehdr', new lang_string('appearance'), ''));
|
||||
|
||||
@@ -195,37 +192,15 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_groups',
|
||||
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
||||
array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for general import configuration and defaults.
|
||||
$temp = new admin_settingpage('importgeneralsettings', new lang_string('importgeneralsettings', 'backup'), 'moodle/backup:backupcourse');
|
||||
$temp->add(new admin_setting_configtext('backup/import_general_maxresults', new lang_string('importgeneralmaxresults', 'backup'), new lang_string('importgeneralmaxresults_desc', 'backup'), 10));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/import_general_duplicate_admin_allowed',
|
||||
new lang_string('importgeneralduplicateadminallowed', 'backup'),
|
||||
new lang_string('importgeneralduplicateadminallowed_desc', 'backup'), 0));
|
||||
|
||||
// Import defaults section.
|
||||
$temp->add(new admin_setting_heading('importsettings', new lang_string('importsettings', 'backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_groups',
|
||||
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
||||
array('value' => 1, 'locked' => 0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for automated backups configuration and defaults.
|
||||
@@ -246,9 +221,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
2 => new lang_string('storagecourseandexternal', 'backup')
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
|
||||
$temp->add(new admin_setting_special_backup_auto_destination());
|
||||
|
||||
$maxkeptoptions = array(
|
||||
$temp->add(new admin_setting_configdirectory('backup/backup_auto_destination', new lang_string('saveto'), new lang_string('backupsavetohelp'), ''));
|
||||
$keepoptoins = array(
|
||||
0 => new lang_string('all'), 1 => '1',
|
||||
2 => '2',
|
||||
5 => '5',
|
||||
@@ -262,44 +236,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
300 => '300',
|
||||
400 => '400',
|
||||
500 => '500');
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_max_kept', new lang_string('automatedmaxkept', 'backup'),
|
||||
new lang_string('automatedmaxkepthelp', 'backup'), 1, $maxkeptoptions));
|
||||
|
||||
$automateddeletedaysoptions = array(
|
||||
0 => new lang_string('never'),
|
||||
1000 => new lang_string('numdays', '', 1000),
|
||||
365 => new lang_string('numdays', '', 365),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
150 => new lang_string('numdays', '', 150),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
35 => new lang_string('numdays', '', 35),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
2 => new lang_string('numdays', '', 2)
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_delete_days', new lang_string('automateddeletedays', 'backup'),
|
||||
'', 0, $automateddeletedaysoptions));
|
||||
|
||||
$minkeptoptions = array(
|
||||
0 => new lang_string('none'),
|
||||
1 => '1',
|
||||
2 => '2',
|
||||
5 => '5',
|
||||
10 => '10',
|
||||
20 => '20',
|
||||
30 => '30',
|
||||
40 => '40',
|
||||
50 => '50',
|
||||
100 => '100',
|
||||
200 => '200',
|
||||
300 => '300',
|
||||
400 => '400'
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_min_kept', new lang_string('automatedminkept', 'backup'),
|
||||
new lang_string('automatedminkepthelp', 'backup'), 0, $minkeptoptions));
|
||||
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
|
||||
@@ -330,14 +267,10 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
|
||||
new lang_string('configgeneralgroups', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1));
|
||||
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', new lang_string('messages', 'message'), new lang_string('backupmessageshelp','message'), 0));
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', new lang_string('blogs', 'blog'), new lang_string('backupblogshelp','blog'), 0));
|
||||
|
||||
@@ -11,8 +11,22 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
//TODO: Re-enable cc-import once re-implemented in 2.0.x
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
|
||||
// The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
|
||||
$enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0);
|
||||
$enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($enablecssoptimiser);
|
||||
|
||||
// Backup archive .mbz format: switching to .tar.gz enables larger files, better
|
||||
// progress reporting and possibly better performance. This is an experimental
|
||||
// setting but if successful, should be removed and enabled by default in a future
|
||||
// version. Note: this setting controls newly-created backups only; restore always
|
||||
// supports both formats.
|
||||
$temp->add(new admin_setting_configcheckbox('enabletgzbackups',
|
||||
new lang_string('enabletgzbackups', 'admin'),
|
||||
new lang_string('enabletgzbackups_desc', 'admin'), 0));
|
||||
|
||||
$ADMIN->add('experimental', $temp);
|
||||
|
||||
@@ -28,7 +42,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$ADMIN->add('development', $temp);
|
||||
|
||||
// "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
|
||||
$xhprofenabled = extension_loaded('xhprof') || extension_loaded('tideways');
|
||||
$xhprofenabled = extension_loaded('xhprof') && function_exists('xhprof_enable');
|
||||
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
|
||||
// Main profiling switch.
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user