Compare commits
819 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 476626d39e | |||
| 5f51b09aec | |||
| 4ed9533352 | |||
| 6c43ac23f8 | |||
| 9be61d94fd | |||
| c44c8eb96b | |||
| be0b3ea0ea | |||
| 9e7fa5f2bb | |||
| 009d72139f | |||
| 478207515c | |||
| 1312ff8740 | |||
| bb3b8185a9 | |||
| 6f3e759ecb | |||
| 2615855713 | |||
| c904abc752 | |||
| bfcb69ef70 | |||
| 4d4e00682b | |||
| 1acc431b98 | |||
| 251ed425e4 | |||
| 5da8f5d11e | |||
| 49b4703187 | |||
| 0736188d75 | |||
| 20640e3597 | |||
| 1555c3d89f | |||
| deaf559402 | |||
| 8d11716bfc | |||
| a9b03dc661 | |||
| fc7776f50a | |||
| 27da392f3c | |||
| c583993d8c | |||
| bd87189222 | |||
| ad7ecc08d3 | |||
| 575a553094 | |||
| 7d6c1a19bb | |||
| 94cfcb36a5 | |||
| ec5a34443c | |||
| 0c0ae1c696 | |||
| 3d1573914c | |||
| 9772d6d376 | |||
| f8c24829ab | |||
| 141f588d8e | |||
| 835ecea7fe | |||
| 053a3ad67d | |||
| dfa28b875d | |||
| 4e738cab73 | |||
| 62a2c4fd22 | |||
| f8c083e968 | |||
| bf4649edb5 | |||
| e6f2103ce7 | |||
| fecb44d7b5 | |||
| c71b744a43 | |||
| 5c3c0a8ce5 | |||
| c3f525dc49 | |||
| 9e8fe8469b | |||
| 54ef6f4b01 | |||
| 0908a1a327 | |||
| 5cb002eaa6 | |||
| 683c8259ea | |||
| d1deac2d80 | |||
| 43956b2c68 | |||
| 72ffaf4e39 | |||
| d2943aa711 | |||
| d736ed90f7 | |||
| 50147ef444 | |||
| 2db787e242 | |||
| dff99bd6c5 | |||
| 80d78f3aae | |||
| 9b3a01563c | |||
| 9f4ad8a5dd | |||
| 6339bf1051 | |||
| 21356da7ee | |||
| ce3cd1f122 | |||
| e356fb68fd | |||
| e8681669bc | |||
| 6d29b2989f | |||
| ebbb914346 | |||
| ee3d7d8a71 | |||
| 044cd0a0d6 | |||
| 2e2ca2af54 | |||
| f2a6db61a9 | |||
| 3716fb55e1 | |||
| cafbb73f5b | |||
| efd5bc7eb0 | |||
| 46ccd8b12b | |||
| 313f98c88a | |||
| 2e0d0590da | |||
| 91470a354e | |||
| 01c7382881 | |||
| 9a7310e80b | |||
| 8b4e28f87e | |||
| 415dd485a5 | |||
| 844d4f0ce0 | |||
| fe4e706f3a | |||
| ca3cfd88cc | |||
| e61fabb720 | |||
| bb98f4fda3 | |||
| 845b165edf | |||
| aaa24bb35c | |||
| 0c93bbde9e | |||
| bd4b665ed6 | |||
| edb03ff65b | |||
| 98e9b0f21e | |||
| 515acf7914 | |||
| 1415ba2319 | |||
| bcf5427193 | |||
| 0d40a799e5 | |||
| 5775c7ec63 | |||
| ccd6fa9e44 | |||
| 69beea7165 | |||
| d049031e95 | |||
| e91dd85ed7 | |||
| 5b5ff2dac6 | |||
| 170c23d2d2 | |||
| 0bad02fd57 | |||
| afb0b3f421 | |||
| f013b576ec | |||
| ca69aa758f | |||
| f6df6e93db | |||
| 9ee937eb33 | |||
| 08bcf220b3 | |||
| cd1a0a72a5 | |||
| ed53f70413 | |||
| f356ebc979 | |||
| 26c1694fdc | |||
| 89ec652e10 | |||
| 82f50464f1 | |||
| ea9f1a8faa | |||
| db15713237 | |||
| 94cd982f84 | |||
| d1c12af76e | |||
| 17d8e3ec8a | |||
| 4fbf7ca46c | |||
| b69337ee63 | |||
| c468eab4f0 | |||
| 23aa41015a | |||
| cf38e1f2ef | |||
| 68eeca8621 | |||
| 7b1890513f | |||
| 2d89ead370 | |||
| 52f37a943c | |||
| d45c949f64 | |||
| 758e086b1c | |||
| 9551675cf9 | |||
| a92ed77229 | |||
| c39546eb72 | |||
| 31593361a8 | |||
| 3a9104cb54 | |||
| 9f260add10 | |||
| 894c5e0b86 | |||
| a8ea83c89b | |||
| f231525992 | |||
| e546d72787 | |||
| 9b228afffe | |||
| f24d063a5e | |||
| ab04c70d56 | |||
| ace2654b5d | |||
| c8072f8b50 | |||
| e86284fefd | |||
| c63a91d44a | |||
| cf6fa5025d | |||
| 5a91cf1e2a | |||
| 3ba632dce5 | |||
| 10701ea814 | |||
| 0ac0d06efb | |||
| a648791534 | |||
| e6510e0920 | |||
| 7654fe5811 | |||
| 34d7e1ce9b | |||
| 6f22c38b48 | |||
| 9ef38abc49 | |||
| 22f94b8ef7 | |||
| 21144ea8c6 | |||
| 7e19c5e1f5 | |||
| 47ac7c3668 | |||
| c05b26f9c9 | |||
| a55688b394 | |||
| bc392be2a8 | |||
| 11a3fcb1be | |||
| 8a40b2d894 | |||
| 3fe335c455 | |||
| 1acda0143c | |||
| ac98193cf3 | |||
| e90d5dcfb2 | |||
| bb8d8346ad | |||
| 5ac02b6e21 | |||
| 517609f295 | |||
| 2b6f171390 | |||
| 18a44d8a77 | |||
| cffba6db62 | |||
| dc71212c3c | |||
| 731882b52d | |||
| 644262726c | |||
| ad5202771a | |||
| cad211198a | |||
| 1d2b681ec0 | |||
| 6404d22954 | |||
| 124e846e83 | |||
| 671fc51e00 | |||
| 4821f14caa | |||
| 4b9f199c65 | |||
| 7a419e5789 | |||
| 646704c8d0 | |||
| 1ff9608513 | |||
| 943056a9e5 | |||
| 9e6edb0ee6 | |||
| b81c860628 | |||
| 5b45d2d0fa | |||
| 269754e487 | |||
| 8cd38f2535 | |||
| 32d4d0d1ce | |||
| 4ab3a01586 | |||
| 9c867cfef8 | |||
| 7fda50ccee | |||
| 83e83887e3 | |||
| 0c8c2969d0 | |||
| ebeacb73c9 | |||
| 47e6717105 | |||
| 43c6a29cc6 | |||
| 9c228a616a | |||
| 01348282b4 | |||
| bef1428345 | |||
| 4e01042343 | |||
| 8348cea56a | |||
| 5129af8051 | |||
| a6f81e7fd8 | |||
| af61dca6d0 | |||
| 03134095f9 | |||
| 908de866bd | |||
| 959ea1241a | |||
| 01080b468f | |||
| 66bd7ae432 | |||
| 08b213beea | |||
| 2787eeb9b3 | |||
| 6049f806f9 | |||
| bc967db3d4 | |||
| 877d9f8430 | |||
| a87151d552 | |||
| 8c51b948d6 | |||
| f7562f72fb | |||
| 38d0571f23 | |||
| ff60281e4f | |||
| 04773f2508 | |||
| 254a642146 | |||
| af7a1f2999 | |||
| 12ba874956 | |||
| 8b927cfb8b | |||
| b71bd1e6ec | |||
| 5eb8ad6129 | |||
| 8342143862 | |||
| ea75a579d1 | |||
| a72cf89d5e | |||
| 6ea4bd74a4 | |||
| 23071bd4ab | |||
| ddb931d3ab | |||
| e8d5c5a8ca | |||
| 76fe39b8d8 | |||
| 9f77a5bcfe | |||
| e336dd6438 | |||
| f8b8874dcf | |||
| 742cf42171 | |||
| 2080cbc2eb | |||
| d8b6bb542c | |||
| 6318805a04 | |||
| 3509aa0275 | |||
| feba87f45e | |||
| 4ec0b1caec | |||
| f26a347c25 | |||
| 025a0e65cd | |||
| 13c25d0f87 | |||
| 948a4d8c94 | |||
| 2ffd822e63 | |||
| 0c657454d6 | |||
| 018f49465c | |||
| e5f77fdae4 | |||
| 47475df527 | |||
| eb4d0c0d51 | |||
| 4bd74c8ddc | |||
| 822790437e | |||
| 76456cf5f2 | |||
| 6fe3c3907b | |||
| 16f5ffacd4 | |||
| c2db2793d2 | |||
| 357274c6b9 | |||
| e455406b69 | |||
| 3e299e464d | |||
| 5796c9223c | |||
| cdff347baa | |||
| 688c43ac3e | |||
| 6e1cf8fde8 | |||
| f2301c3258 | |||
| 2ad0278bd2 | |||
| 733196d843 | |||
| 0007843de0 | |||
| e8e2f4f62c | |||
| 648cf3397d | |||
| e1ded0ff55 | |||
| c31783bb34 | |||
| 4d2f89f85b | |||
| 18a727e6fd | |||
| 28a3a568aa | |||
| 6432e1b4e1 | |||
| 52453939f2 | |||
| be15c303e0 | |||
| acef9e8a7f | |||
| 6badc27a66 | |||
| c904d241d5 | |||
| 7da14ca7c5 | |||
| 14b273b3c8 | |||
| b1591e5081 | |||
| f22c2e015a | |||
| d4184875ce | |||
| 26be1bf17a | |||
| 5a1e6f2a6c | |||
| cfbde86579 | |||
| 5684c6ab99 | |||
| a5f1f8c0e2 | |||
| 7759183593 | |||
| 3d257cbf08 | |||
| 611d3bd71d | |||
| fc9ca7eca3 | |||
| 94e62d8d02 | |||
| e163fbc943 | |||
| 699f075ad2 | |||
| a3b0c9462f | |||
| d4d8a51fae | |||
| db78068443 | |||
| c8a11c7410 | |||
| 53cd3d4278 | |||
| 8c8a31c21d | |||
| 049c70ea9d | |||
| 17b629d458 | |||
| 15dd454840 | |||
| 1dee84c2be | |||
| bfeca9d6b9 | |||
| 68e719927e | |||
| d4b3034bb4 | |||
| 61622d9709 | |||
| d692e80d6b | |||
| e2a4d8f9d0 | |||
| 887ec885b1 | |||
| b292cea475 | |||
| fe3130a07d | |||
| 264189da87 | |||
| 9e3824a63d | |||
| 2af7ab97d6 | |||
| c327996e6b | |||
| ea5be5a976 | |||
| ba09a2619e | |||
| 5d2dce09b3 | |||
| d0c82a5609 | |||
| 11942210a2 | |||
| a67a3a8eec | |||
| ac2a99b1b8 | |||
| b7c8fb6610 | |||
| 2581c3cb70 | |||
| b19a440a04 | |||
| 787c2eefd3 | |||
| 9440efcd97 | |||
| 3b1e1d8964 | |||
| ec5bfaf5e0 | |||
| 58ac441cae | |||
| ddb621b78d | |||
| 6f421476a9 | |||
| 3c6d27b44b | |||
| f536a092d4 | |||
| d5d5ae432c | |||
| 5125c0e332 | |||
| a141bd9ca2 | |||
| 8772dd9202 | |||
| b0b6a8dac6 | |||
| 35888eee0d | |||
| ec0118dd5d | |||
| cd5189e266 | |||
| c95efa3936 | |||
| abb58a56f4 | |||
| 7ce803eeae | |||
| 196eedebb1 | |||
| ed6af81b50 | |||
| 9e2f748669 | |||
| 6daa6285cc | |||
| 984616805e | |||
| ec6c7d98f9 | |||
| 918bcdcfab | |||
| d0eb3fcf88 | |||
| ea5214d534 | |||
| c73dbf667d | |||
| 3397a096ba | |||
| 47649d4328 | |||
| 3370262bae | |||
| 06f7eb2a36 | |||
| 13a1eb3c10 | |||
| caa4912f70 | |||
| 68d4c5bc1f | |||
| 057d39bbc1 | |||
| 2f7d4b4213 | |||
| 4eac963a41 | |||
| 2b18b65f9a | |||
| 277106de6e | |||
| bc8e22c4cc | |||
| 8f8db0fc5f | |||
| 125e250a85 | |||
| 04d9550434 | |||
| e58dbe0fe8 | |||
| 135de8d007 | |||
| ac41de6697 | |||
| 5a479aa628 | |||
| 288503b780 | |||
| 5b01459102 | |||
| 6d3c3b02a6 | |||
| 54b1dc4950 | |||
| 269c884874 | |||
| 4a4c146e9f | |||
| bd9cbc32f5 | |||
| e639d0cca8 | |||
| e7a8905fc9 | |||
| 4416991914 | |||
| 11bb61041b | |||
| a1317d1b99 | |||
| 88e2bbae6d | |||
| 2aa4f06a88 | |||
| fc0a71999e | |||
| 4bc3f5a2da | |||
| 14a49d6d28 | |||
| b837c9e84d | |||
| 8838b16705 | |||
| e4715ab74a | |||
| 87be88ad2f | |||
| 27dd6a7c57 | |||
| fba6d4c169 | |||
| 9690f66447 | |||
| 1c1b04c994 | |||
| 8a9edd6dba | |||
| 282dcd3c03 | |||
| 76917f764f | |||
| d5c88f9333 | |||
| 1a3b5c6cfc | |||
| 199ba4286b | |||
| f0987e98ad | |||
| 735d8ce2ce | |||
| 0a52c0d63d | |||
| ec9cd69156 | |||
| 43812bf883 | |||
| 7b3dae9096 | |||
| 6f960202e7 | |||
| ff65ab25c2 | |||
| ac0d9c6411 | |||
| 1480ead173 | |||
| 2d48474f2a | |||
| 94828bec35 | |||
| 6a226839d0 | |||
| 6bf567100a | |||
| 00e4cad952 | |||
| 754eb73b23 | |||
| e09cfa968b | |||
| 8b23f31909 | |||
| 534f9fec11 | |||
| cee1176862 | |||
| 5274209ac1 | |||
| 12f2dc577d | |||
| 7e6f69b9af | |||
| 7991c4c000 | |||
| 7fdb5afc08 | |||
| a2c5642872 | |||
| fde76de588 | |||
| 45d88e56cb | |||
| 22d6b3da4f | |||
| f7ff057d0b | |||
| 04c0a7d205 | |||
| f543eea9d6 | |||
| a5a993abc2 | |||
| 38d341b0d7 | |||
| 1c83b13343 | |||
| 182f5cc6f6 | |||
| d8b06a25b2 | |||
| ef0376f4ef | |||
| 090d2f90e8 | |||
| ee5cf900f8 | |||
| e5a9af0a70 | |||
| b3c02fae54 | |||
| 87b8419f80 | |||
| 0a2569e55c | |||
| a8f912faf1 | |||
| 16f75808c7 | |||
| a364362b95 | |||
| d16597b557 | |||
| f70f6e9ad1 | |||
| cb5d7dbe14 | |||
| 7ecee68542 | |||
| 18930123e3 | |||
| f40f4013f1 | |||
| 86645a5e91 | |||
| e516577ec7 | |||
| 8261570853 | |||
| 4cb258fbdf | |||
| 859624f26c | |||
| 10c3c6d49c | |||
| 7e9f29178e | |||
| 7984be4a13 | |||
| efabe26141 | |||
| a7e79bfe78 | |||
| c4989dc75f | |||
| 0f504be67b | |||
| 54afb1ca01 | |||
| da744e0065 | |||
| 7a44fb4d97 | |||
| d43c4284e1 | |||
| f36884dde7 | |||
| 5dff4c565f | |||
| 0ca7b84953 | |||
| 995294dfa3 | |||
| cef1e7f444 | |||
| 23758a4588 | |||
| f35cacdc83 | |||
| 7e20d8e330 | |||
| ade2e5955e | |||
| ce40b669cc | |||
| 05042a7ed8 | |||
| 2824832a18 | |||
| 17330e8aae | |||
| 6ac158e9e3 | |||
| dfff77eedd | |||
| 77536bd387 | |||
| c56a8d4441 | |||
| a1d246334b | |||
| e71389830c | |||
| b886841fc8 | |||
| 25200f80f7 | |||
| fdac23f168 | |||
| 7ca0ece0db | |||
| dcfc7a875a | |||
| ffd6212152 | |||
| 1cf721e235 | |||
| aed7f32783 | |||
| dbc7d20cf5 | |||
| 6357d61912 | |||
| 3acce7a095 | |||
| a36531da4f | |||
| 7d1906cf7c | |||
| 8be58774cd | |||
| ffbcd681f3 | |||
| dc49c2d461 | |||
| 10357af3ef | |||
| 1800b35bf6 | |||
| 6ca2f1d3ce | |||
| 9f097a7248 | |||
| 8755b6aaca | |||
| bea916ae7c | |||
| 8ef685cf4c | |||
| e4b1208377 | |||
| cd735560d3 | |||
| a770897929 | |||
| 40ff6e3663 | |||
| b408061558 | |||
| be1af716b7 | |||
| f69ff3b72e | |||
| 0543bb679b | |||
| 9cad3e182d | |||
| 1243bf814b | |||
| e972cdc5ad | |||
| dc8d309c88 | |||
| 860848dca8 | |||
| aafe1618f8 | |||
| 358e5cf791 | |||
| a2c591662b | |||
| 64550fa6c1 | |||
| 267ff8cd27 | |||
| 32bbc36039 | |||
| 8129b01641 | |||
| a39a53fa6f | |||
| c50d05671b | |||
| 7f7d9ce6e8 | |||
| 58a44ab228 | |||
| b43c2e9d39 | |||
| 42cbe9be98 | |||
| fb93cfac00 | |||
| 0ba9f5a5e9 | |||
| 9d1963b421 | |||
| ed82e03798 | |||
| a89d501b72 | |||
| 4587d4f5b7 | |||
| cb0318b633 | |||
| 404e01f59e | |||
| 96ebc911d7 | |||
| 7d8c4fb5af | |||
| 929c26ccf1 | |||
| c994fe7430 | |||
| 1d4262608c | |||
| 0016ed0115 | |||
| 0c5e3d4564 | |||
| e0c00395b7 | |||
| 9e9e0732f5 | |||
| 965344c08f | |||
| 0f97c8afdb | |||
| 1b5afe64c4 | |||
| 5831b4c70c | |||
| 223e753520 | |||
| 72682b8868 | |||
| 8fe13ecf1a | |||
| dbfa519ad9 | |||
| 6ff99dde45 | |||
| 332748dd7e | |||
| db65026449 | |||
| 45c920b0af | |||
| 1be36988ac | |||
| d7964ccf87 | |||
| efa9f19281 | |||
| 6662dee76d | |||
| 1729746211 | |||
| fe2a74db60 | |||
| 72b01fbeb3 | |||
| 7259dbc551 | |||
| 39949b56ad | |||
| 7110207a34 | |||
| 40b67fca0a | |||
| b9c38ef120 | |||
| b8e5740796 | |||
| 8c9d533f3d | |||
| 18952a18fd | |||
| 53516a8ece | |||
| a5f35b4cf2 | |||
| fbb829b82d | |||
| ceec817f95 | |||
| 0cba7c0408 | |||
| 2df28fda6c | |||
| 9f83ba0887 | |||
| 956d1a3ab5 | |||
| 6005434b55 | |||
| a8fb78b142 | |||
| b3af6c110a | |||
| 58ca2c4b71 | |||
| 4e77491aff | |||
| c2ca1a3793 | |||
| 1f3933bee6 | |||
| e7af814b0d | |||
| 365e163946 | |||
| 9f689071a8 | |||
| 85daa5926c | |||
| 415be0ff94 | |||
| e50e70d12e | |||
| 8c14856d86 | |||
| d613d7d78e | |||
| 7c19940ca6 | |||
| ead158db7e | |||
| 3bcb2c1dff | |||
| 265dbb3a54 | |||
| 2253ea2592 | |||
| 5ff8144cc8 | |||
| 9cf83e67a1 | |||
| 4d199d6b33 | |||
| 8109fce46d | |||
| cb6ff0a71c | |||
| d107f1e2cd | |||
| ebad6e2f6f | |||
| 9660c98e57 | |||
| c34b325447 | |||
| 35cd08c96e | |||
| e5baaad498 | |||
| 8e8a8810de | |||
| 177bc9c8b9 | |||
| 33b8721c71 | |||
| 6cf3a65082 | |||
| 841b2a44ef | |||
| 98402da094 | |||
| 76ffac7f93 | |||
| 782b21dc0f | |||
| e0b587be49 | |||
| e60d8e5a42 | |||
| 67cb80dc09 | |||
| abe73c6d99 | |||
| f455e4e9bd | |||
| 6d3ac4035b | |||
| b057855440 | |||
| 92ec74a9a7 | |||
| 9abb69aacb | |||
| cb8e878573 | |||
| ba0c76e7a9 | |||
| 40ab5a4010 | |||
| a30e3c5a1a | |||
| cb140ca0d6 | |||
| 4026898f5c | |||
| 51d861632b | |||
| 72306a6ff4 | |||
| 9831354928 | |||
| 925d068de1 | |||
| 1a35796fba | |||
| b2b9890d08 | |||
| 4f7dc83fe8 | |||
| 7c183f44d4 | |||
| 7d919d8f27 | |||
| 324ea4d7de | |||
| 9ff12f3dae | |||
| 83688ab542 | |||
| 2b6d08a333 | |||
| e2acc0a010 | |||
| c5b8cda403 | |||
| d4b584c5f6 | |||
| 2f24a39b5b | |||
| de1b85d795 | |||
| d6b040af81 | |||
| a23463acec | |||
| 3b89933d9f | |||
| 903ab24de4 | |||
| 5c8e2b97d3 | |||
| 9dfd9a124d | |||
| db5602f751 | |||
| a3bb5afdd0 | |||
| 423dc3b17e | |||
| 3a353b12ba | |||
| 26ebc41703 | |||
| b23dd6ee72 | |||
| 03adb289ec | |||
| 1a52d9e2cc | |||
| 1daa8c0821 | |||
| 51a2716e6b | |||
| b3463f416c | |||
| fc97bb9863 | |||
| 8c495ea4ee | |||
| bb0ece5a0c | |||
| e79c09855c | |||
| 1f00dc45d4 | |||
| f9c5bd9234 | |||
| f6b9be73f5 | |||
| f08f05610b | |||
| b750cfde81 | |||
| 7210cb5d19 | |||
| 860f7f9195 | |||
| a3a3186770 | |||
| 424f91c056 | |||
| 56b77440ad | |||
| 92bf70765a | |||
| 653599b3a4 | |||
| ba9489ce91 | |||
| 6aabb69f9e | |||
| 02af5654f2 | |||
| 4e8da675ac | |||
| d3054582d5 | |||
| c3c2a213a2 | |||
| ed9c60fed7 | |||
| 9de951556f | |||
| ff4a2ddef7 | |||
| 8d7ec82427 | |||
| c4437be63b | |||
| 7f467e69c0 | |||
| d59ef547c9 | |||
| abf82af8f7 | |||
| 5cb418e9f8 | |||
| 7109330e9a | |||
| e467ed219f | |||
| f0c8bb711f | |||
| cfef4e754a | |||
| cbd8609407 | |||
| 2a1733aafc | |||
| 1357ab1d5b | |||
| 001f78b41f | |||
| 853f2e8eea | |||
| 00c7590c95 | |||
| 24e5fcbe26 | |||
| 4d8a37a0db | |||
| 3cba5809ae | |||
| d7320fc84a | |||
| cff596e51b | |||
| acb3bf8ac1 | |||
| ebd748fd71 | |||
| 653e811ec0 | |||
| 81dda1da15 | |||
| 9cd8fdda3c | |||
| c532957be2 | |||
| ad86ee91e9 | |||
| 11892d8fdf | |||
| 00aa596e8e | |||
| 7b80d3c65a | |||
| 7da6c0f82d | |||
| a6395af1b9 | |||
| 4dbdc834ff | |||
| bc3801cb9c | |||
| 4e7a371b2e | |||
| db48cf080d | |||
| e0745be16b | |||
| 9671325a35 | |||
| 1e92c729ba | |||
| 347f822856 | |||
| 0f69a9eaaf | |||
| cdbd44f00e | |||
| 6ae2048c1f | |||
| 02ed16902b | |||
| 30e1b79889 | |||
| d30043c852 | |||
| add75e9682 | |||
| 78baf38ea4 | |||
| cad8d5ccb0 | |||
| a52422abcb | |||
| a33d85b374 | |||
| da3494a8c4 | |||
| ae7aad593c | |||
| cf2d7311ab | |||
| 8f64668af2 | |||
| 2af51a1dc3 | |||
| 17e0ed7919 | |||
| 7e4c833c5a | |||
| 264ca6c58d | |||
| b1d4c42ad6 | |||
| 7f96df6222 | |||
| 73553ddbaa | |||
| a6adddfb7d | |||
| f10ad2d4eb | |||
| e61eecacc8 | |||
| 924deffba6 | |||
| de276c9216 | |||
| aed70c6d40 | |||
| b11d6236df | |||
| 4921fb4c9f | |||
| 6a8a17eb28 | |||
| c114ff92bb | |||
| a77b489d67 | |||
| 9d7ce57ae3 | |||
| 28a6552570 | |||
| 6f2d62d022 | |||
| a9cc3954b9 | |||
| 2324ddd3d5 |
@@ -25,8 +25,3 @@ CVS
|
||||
/.project
|
||||
/.buildpath
|
||||
/.cache
|
||||
phpunit.xml
|
||||
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
|
||||
composer.phar
|
||||
composer.lock
|
||||
/vendor/
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ 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).
|
||||
it's 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
|
||||
|
||||
+2
-2
@@ -12,13 +12,13 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths'));
|
||||
|
||||
$PAGE->set_url($returnurl);
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$auth = optional_param('auth', '', PARAM_PLUGIN);
|
||||
|
||||
get_enabled_auth_plugins(true); // fix the list of enabled auths
|
||||
|
||||
+12
-19
@@ -131,25 +131,12 @@
|
||||
$table->setup();
|
||||
$tablerows = array();
|
||||
|
||||
// Sort blocks using current locale.
|
||||
$blocknames = array();
|
||||
foreach ($blocks as $blockid=>$block) {
|
||||
$blockname = $block->name;
|
||||
if (file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
$blocknames[$blockid] = get_string('pluginname', 'block_'.$blockname);
|
||||
} else {
|
||||
$blocknames[$blockid] = $blockname;
|
||||
}
|
||||
}
|
||||
collatorlib::asort($blocknames);
|
||||
|
||||
foreach ($blocknames as $blockid=>$strblockname) {
|
||||
$block = $blocks[$blockid];
|
||||
$blockname = $block->name;
|
||||
|
||||
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
$blockobject = false;
|
||||
$strblockname = '<span class="notifyproblem">'.$strblockname.' ('.get_string('missingfromdisk').')</span>';
|
||||
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
|
||||
$plugin = new stdClass();
|
||||
$plugin->version = $block->version;
|
||||
|
||||
@@ -164,6 +151,7 @@
|
||||
$incompatible[] = $block;
|
||||
continue;
|
||||
}
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
}
|
||||
|
||||
$delete = '<a href="blocks.php?delete='.$blockid.'&sesskey='.sesskey().'">'.$strdelete.'</a>';
|
||||
@@ -201,10 +189,10 @@
|
||||
$visible = '';
|
||||
} else if ($blocks[$blockid]->visible) {
|
||||
$visible = '<a href="blocks.php?hide='.$blockid.'&sesskey='.sesskey().'" title="'.$strhide.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
|
||||
} else {
|
||||
$visible = '<a href="blocks.php?show='.$blockid.'&sesskey='.sesskey().'" title="'.$strshow.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
|
||||
$class = ' class="dimmed_text"'; // Leading space required!
|
||||
}
|
||||
|
||||
@@ -219,10 +207,10 @@
|
||||
$undeletable = '';
|
||||
} else if (in_array($blockname, $undeletableblocktypes)) {
|
||||
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&sesskey='.sesskey().'" title="'.$strunprotect.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
|
||||
} else {
|
||||
$undeletable = '<a href="blocks.php?protect='.$blockid.'&sesskey='.sesskey().'" title="'.$strprotect.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
|
||||
}
|
||||
|
||||
$row = array(
|
||||
@@ -234,7 +222,12 @@
|
||||
$delete,
|
||||
$settings
|
||||
);
|
||||
$table->add_data($row);
|
||||
$tablerows[] = array(strip_tags($strblockname), $row); // first element will be used for sorting
|
||||
}
|
||||
|
||||
collatorlib::asort($tablerows);
|
||||
foreach ($tablerows as $row) {
|
||||
$table->add_data($row[1]);
|
||||
}
|
||||
|
||||
$table->print_html();
|
||||
|
||||
@@ -1,160 +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 is used to display a categories sub categories, external pages, and settings.
|
||||
*
|
||||
* @since 2.3
|
||||
* @package admin
|
||||
* @copyright 2011 Sam Hemelryk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$category = required_param('category', PARAM_SAFEDIR);
|
||||
$return = optional_param('return','', PARAM_ALPHA);
|
||||
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
/// no guest autologin
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_url('/admin/category.php', array('category' => $category));
|
||||
$PAGE->set_pagetype('admin-setting-' . $category);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->navigation->clear_cache();
|
||||
|
||||
$adminroot = admin_get_root(); // need all settings
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
|
||||
if (empty($settingspage) or !($settingspage instanceof admin_category)) {
|
||||
print_error('categoryerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
|
||||
if (!($settingspage->check_access())) {
|
||||
print_error('accessdenied', 'admin');
|
||||
}
|
||||
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
|
||||
if (empty($adminroot->errors)) {
|
||||
switch ($return) {
|
||||
case 'site': redirect("$CFG->wwwroot/");
|
||||
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
|
||||
$USER->editing = $adminediting;
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
$url = clone($PAGE->url);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
$caption = get_string('blockseditoff');
|
||||
$url->param('adminedit', 'off');
|
||||
} else {
|
||||
$caption = get_string('blocksediton');
|
||||
$url->param('adminedit', 'on');
|
||||
}
|
||||
$buttons = $OUTPUT->single_button($url, $caption, 'get');
|
||||
}
|
||||
|
||||
$savebutton = false;
|
||||
$outputhtml = '';
|
||||
foreach ($settingspage->children as $childpage) {
|
||||
if ($childpage->is_hidden()) {
|
||||
continue;
|
||||
}
|
||||
if ($childpage instanceof admin_externalpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_settingpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_category) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (!empty($childpage->settings)) {
|
||||
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
|
||||
foreach ($childpage->settings as $setting) {
|
||||
if (empty($setting->nosave)) {
|
||||
$savebutton = true;
|
||||
}
|
||||
$fullname = $setting->get_full_name();
|
||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||
$data = $adminroot->errors[$fullname]->data;
|
||||
} else {
|
||||
$data = $setting->get_setting();
|
||||
}
|
||||
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
$outputhtml .= $setting->output_html($data);
|
||||
}
|
||||
$outputhtml .= html_writer::end_tag('fieldset');
|
||||
}
|
||||
}
|
||||
if ($savebutton) {
|
||||
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
$visiblepathtosection = array_reverse($settingspage->visiblepath);
|
||||
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
$PAGE->set_button($buttons);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($errormsg);
|
||||
} else if ($statusmsg !== '') {
|
||||
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
||||
}
|
||||
|
||||
$path = array_reverse($settingspage->visiblepath);
|
||||
if (is_array($path)) {
|
||||
$visiblename = join(' / ', $path);
|
||||
} else {
|
||||
$visiblename = $path;
|
||||
}
|
||||
echo $OUTPUT->heading(get_string('admincategory', 'admin', $visiblename), 2);
|
||||
|
||||
echo html_writer::start_tag('form', array('action' => '', 'method' => 'post', 'id' => 'adminsettings'));
|
||||
echo html_writer::start_tag('div');
|
||||
echo html_writer::input_hidden_params(new moodle_url($PAGE->url, array('sesskey' => sesskey(), 'return' => $return)));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
echo $outputhtml;
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
+14
-11
@@ -127,9 +127,6 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau
|
||||
/** Used by library scripts to check they are being called by Moodle */
|
||||
define('MOODLE_INTERNAL', true);
|
||||
|
||||
// Disables caching.. just in case.
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
if (version_compare(phpversion(), "5.3.2") < 0) {
|
||||
$phpversion = phpversion();
|
||||
@@ -167,7 +164,6 @@ require_once($CFG->libdir.'/moodlelib.php');
|
||||
require_once($CFG->libdir.'/deprecatedlib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
require_once($CFG->dirroot.'/cache/lib.php');
|
||||
|
||||
require($CFG->dirroot.'/version.php');
|
||||
$CFG->target_release = $release;
|
||||
@@ -244,8 +240,18 @@ echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
|
||||
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);
|
||||
// format the langs nicely - 3 per line
|
||||
$c = 0;
|
||||
$langlist = '';
|
||||
foreach ($languages as $key=>$lang) {
|
||||
$c++;
|
||||
$length = iconv_strlen($lang, 'UTF-8');
|
||||
$padded = $lang.str_repeat(' ', 38-$length);
|
||||
$langlist .= $padded;
|
||||
if ($c % 3 == 0) {
|
||||
$langlist .= "\n";
|
||||
}
|
||||
}
|
||||
$default = $CFG->lang;
|
||||
cli_heading(get_string('availablelangs', 'install'));
|
||||
echo $langlist."\n";
|
||||
@@ -419,8 +425,7 @@ if (isset($maturity)) {
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
cli_error(get_string('maturitycorewarning', 'admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -672,9 +677,7 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -161,9 +161,7 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,211 +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 collation conversion tool.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Petr Skoda (http://skodak.org)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
if ($DB->get_dbfamily() !== 'mysql') {
|
||||
cli_error('This function is designed for MySQL databases only!');
|
||||
}
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'collation'=>false, 'available'=>false),
|
||||
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
$help =
|
||||
"MySQL collation conversions script.
|
||||
|
||||
It is strongly recommended to stop the web server before the conversion.
|
||||
This script may be executed before the main upgrade - 1.9.x data for example.
|
||||
|
||||
Options:
|
||||
--collation=COLLATION Convert MySQL tables to different collation
|
||||
-l, --list Show table and column information
|
||||
-a, --available Show list of available collations
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8_general_ci
|
||||
";
|
||||
|
||||
if (!empty($options['collation'])) {
|
||||
$collations = mysql_get_collations();
|
||||
$collation = clean_param($options['collation'], PARAM_ALPHANUMEXT);
|
||||
$collation = strtolower($collation);
|
||||
if (!isset($collations[$collation])) {
|
||||
cli_error("Error: collation '$collation' is not available on this server!");
|
||||
}
|
||||
|
||||
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
foreach ($rs as $table) {
|
||||
echo str_pad($table->name, 40). " - ";
|
||||
|
||||
if ($table->collation === $collation) {
|
||||
echo "NO CHANGE\n";
|
||||
$skipped++;
|
||||
|
||||
} else {
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
|
||||
$rs2 = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs2 as $column) {
|
||||
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
|
||||
echo ' '.str_pad($column->field, 36). " - ";
|
||||
if ($column->collation === $collation) {
|
||||
echo "NO CHANGE\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
|
||||
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 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'" : '';
|
||||
// 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";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
$rs2->close();
|
||||
}
|
||||
$rs->close();
|
||||
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
echo "List of tables for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$counts = array();
|
||||
foreach ($rs as $table) {
|
||||
if (isset($counts[$table->collation])) {
|
||||
$counts[$table->collation]++;
|
||||
} else {
|
||||
$counts[$table->collation] = 1;
|
||||
}
|
||||
echo str_pad($table->name, 40);
|
||||
echo $table->collation. "\n";
|
||||
$collations = mysql_get_column_collations($table->name);
|
||||
foreach ($collations as $columname=>$collation) {
|
||||
if (isset($counts[$collation])) {
|
||||
$counts[$collation]++;
|
||||
} else {
|
||||
$counts[$collation] = 1;
|
||||
}
|
||||
echo ' ';
|
||||
echo str_pad($columname, 36);
|
||||
echo $collation. "\n";
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
echo "\n";
|
||||
echo "Table collations summary for $CFG->wwwroot:\n";
|
||||
foreach ($counts as $collation => $count) {
|
||||
echo "$collation: $count\n";
|
||||
}
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['available'])) {
|
||||
echo "List of available MySQL collations for $CFG->wwwroot:\n";
|
||||
$collations = mysql_get_collations();
|
||||
foreach ($collations as $collation) {
|
||||
echo " $collation\n";
|
||||
}
|
||||
die;
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========== Some functions ==============
|
||||
|
||||
function mysql_get_collations() {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$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;
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
$collation = $DB->get_dbcollation();
|
||||
if (isset($collations[$collation])) {
|
||||
$collations[$collation] .= ' (default)';
|
||||
}
|
||||
|
||||
return $collations;
|
||||
}
|
||||
|
||||
function mysql_get_column_collations($tablename) {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$sql = "SELECT column_name, collation_name
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_schema = DATABASE() AND table_name = ? AND collation_name IS NOT NULL";
|
||||
$rs = $DB->get_recordset_sql($sql, array($tablename));
|
||||
foreach($rs as $record) {
|
||||
$collations[$record->column_name] = $record->collation_name;
|
||||
}
|
||||
$rs->close();
|
||||
return $collations;
|
||||
}
|
||||
@@ -34,8 +34,8 @@ if ($DB->get_dbfamily() !== 'mysql') {
|
||||
}
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false),
|
||||
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false),
|
||||
array('h'=>'help', 'l'=>'list'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
@@ -52,7 +52,6 @@ and does not support transactions.
|
||||
Options:
|
||||
--engine=ENGINE Convert MySQL tables to different engine
|
||||
-l, --list Show table information
|
||||
-a, --available Show list of available engines
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -60,11 +59,7 @@ Example:
|
||||
";
|
||||
|
||||
if (!empty($options['engine'])) {
|
||||
$engines = mysql_get_engines();
|
||||
$engine = clean_param($options['engine'], PARAM_ALPHA);
|
||||
if (!isset($engines[strtoupper($engine)])) {
|
||||
cli_error("Error: engine '$engine' is not available on this server!");
|
||||
}
|
||||
|
||||
echo "Converting tables to '$engine' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
@@ -73,34 +68,20 @@ if (!empty($options['engine'])) {
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
foreach ($rs as $table) {
|
||||
if (strtoupper($table->engine) === strtoupper($engine)) {
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n";
|
||||
if ($table->engine === $engine) {
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
echo str_pad($table->name, 40). " - ";
|
||||
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
if (strtoupper($newengine) !== strtoupper($engine)) {
|
||||
echo "ERROR ($newengine)\n";
|
||||
$errors++;
|
||||
continue;
|
||||
}
|
||||
echo "DONE ($newengine)\n";
|
||||
$converted++;
|
||||
} catch (moodle_exception $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
$errors++;
|
||||
continue;
|
||||
}
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
|
||||
echo "DONE\n";
|
||||
$converted++;
|
||||
}
|
||||
$rs->close();
|
||||
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
|
||||
echo "Converted: $converted, skipped: $skipped\n";
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
@@ -128,53 +109,7 @@ if (!empty($options['engine'])) {
|
||||
}
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['available'])) {
|
||||
echo "List of available MySQL engines for $CFG->wwwroot:\n";
|
||||
$engines = mysql_get_engines();
|
||||
foreach ($engines as $engine) {
|
||||
echo " $engine\n";
|
||||
}
|
||||
die;
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========== Some functions ==============
|
||||
|
||||
function mysql_get_engines() {
|
||||
global $DB;
|
||||
|
||||
$sql = "SHOW Engines";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$engines = array();
|
||||
foreach ($rs as $engine) {
|
||||
if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') {
|
||||
continue;
|
||||
}
|
||||
$engines[strtoupper($engine->engine)] = $engine->engine;
|
||||
if (strtoupper($engine->support) === 'DEFAULT') {
|
||||
$engines[strtoupper($engine->engine)] .= ' (default)';
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
return $engines;
|
||||
}
|
||||
|
||||
function mysql_get_table_engine($tablename) {
|
||||
global $DB;
|
||||
|
||||
$engine = null;
|
||||
$sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
if ($rs->valid()) {
|
||||
$record = $rs->current();
|
||||
$engine = $record->engine;
|
||||
}
|
||||
$rs->close();
|
||||
return $engine;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ if (empty($CFG->version)) {
|
||||
cli_error(get_string('missingconfigversion', 'debug'));
|
||||
}
|
||||
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if ($version < $CFG->version) {
|
||||
@@ -109,9 +109,7 @@ if (!$envstatus) {
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
@@ -134,8 +132,7 @@ if (isset($maturity)) {
|
||||
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
|
||||
cli_separator();
|
||||
} else {
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,13 +150,14 @@ if ($version > $CFG->version) {
|
||||
upgrade_core($version, true);
|
||||
}
|
||||
set_config('release', $release);
|
||||
set_config('branch', $branch);
|
||||
|
||||
// unconditionally upgrade
|
||||
upgrade_noncore(true);
|
||||
|
||||
// log in as admin - we need doanything permission when applying defaults
|
||||
session_set_user(get_admin());
|
||||
$admins = get_admins();
|
||||
$admin = reset($admins);
|
||||
session_set_user($admin);
|
||||
|
||||
// apply all default settings, just in case do it twice to fill all defaults
|
||||
admin_apply_default_settings(NULL, false);
|
||||
|
||||
@@ -1,131 +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 the admin to enable, disable and uninstall course formats
|
||||
*
|
||||
* @package core_admin
|
||||
* @copyright 2012 Marina Glancy
|
||||
* @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.'/pluginlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$formatname = required_param('format', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
$PAGE->set_url('/admin/courseformats.php');
|
||||
$PAGE->set_context($syscontext);
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', $syscontext);
|
||||
require_sesskey();
|
||||
|
||||
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
|
||||
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
$formatplugins = $allplugins['format'];
|
||||
$sortorder = array_flip(array_keys($formatplugins));
|
||||
|
||||
if (!isset($formatplugins[$formatname])) {
|
||||
print_error('courseformatnotfound', 'error', $return, $formatname);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
if ($formatplugins[$formatname]->is_enabled()) {
|
||||
if (get_config('moodlecourse', 'format') === $formatname) {
|
||||
print_error('cannotdisableformat', 'error', $return);
|
||||
}
|
||||
set_config('disabled', 1, 'format_'. $formatname);
|
||||
}
|
||||
break;
|
||||
case 'enable':
|
||||
if (!$formatplugins[$formatname]->is_enabled()) {
|
||||
unset_config('disabled', 'format_'. $formatname);
|
||||
}
|
||||
break;
|
||||
case 'up':
|
||||
if ($sortorder[$formatname]) {
|
||||
$currentindex = $sortorder[$formatname];
|
||||
$seq = array_keys($formatplugins);
|
||||
$seq[$currentindex] = $seq[$currentindex-1];
|
||||
$seq[$currentindex-1] = $formatname;
|
||||
set_config('format_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
case 'down':
|
||||
if ($sortorder[$formatname] < count($sortorder)-1) {
|
||||
$currentindex = $sortorder[$formatname];
|
||||
$seq = array_keys($formatplugins);
|
||||
$seq[$currentindex] = $seq[$currentindex+1];
|
||||
$seq[$currentindex+1] = $formatname;
|
||||
set_config('format_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
case 'uninstall':
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('courseformats', 'moodle'));
|
||||
|
||||
$coursecount = $DB->count_records('course', array('format' => $formatname));
|
||||
if ($coursecount) {
|
||||
// Check that default format is set. It will be used to convert courses
|
||||
// using this format
|
||||
$defaultformat = get_config('moodlecourse', 'format');
|
||||
$defaultformat = $formatplugins[get_config('moodlecourse', 'format')];
|
||||
if (!$defaultformat) {
|
||||
echo $OUTPUT->error_text(get_string('defaultformatnotset', 'admin'));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$format = $formatplugins[$formatname];
|
||||
$deleteurl = $format->get_uninstall_url();
|
||||
if (!$deleteurl) {
|
||||
// somebody was trying to cheat and type non-existing link
|
||||
echo $OUTPUT->error_text(get_string('cannotuninstall', 'admin', $format->displayname));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$confirm) {
|
||||
if ($coursecount) {
|
||||
$message = get_string('formatuninstallwithcourses', 'admin',
|
||||
(object)array('count' => $coursecount, 'format' => $format->displayname,
|
||||
'defaultformat' => $defaultformat->displayname));
|
||||
} else {
|
||||
$message = get_string('formatuninstallconfirm', 'admin', $format->displayname);
|
||||
}
|
||||
$deleteurl->param('confirm', 1);
|
||||
echo $OUTPUT->confirm($message, $deleteurl, $return);
|
||||
} else {
|
||||
$a = new stdClass();
|
||||
$a->plugin = $format->displayname;
|
||||
$a->directory = $format->rootdir;
|
||||
uninstall_plugin('format', $formatname);
|
||||
echo $OUTPUT->notification(get_string('formatuninstalled', 'admin', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($return);
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
redirect($return);
|
||||
@@ -81,9 +81,6 @@ if (check_browser_version('MSIE')) {
|
||||
@header('Content-Type: text/plain; charset=utf-8');
|
||||
}
|
||||
|
||||
// we do not want html markup in emulated CLI
|
||||
@ini_set('html_errors', 'off');
|
||||
|
||||
// execute the cron
|
||||
cron_run();
|
||||
|
||||
|
||||
+4
-50
@@ -8,18 +8,14 @@ require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$editor = required_param('editor', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/editors.php', array('action'=>$action, 'editor'=>$editor));
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$editor = optional_param('editor', '', PARAM_PLUGIN);
|
||||
|
||||
// get currently installed and enabled auth plugins
|
||||
$available_editors = editors_get_available();
|
||||
if (!empty($editor) and empty($available_editors[$editor])) {
|
||||
@@ -82,48 +78,6 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'uninstall':
|
||||
if ($editor === 'textarea') {
|
||||
redirect($returnurl);
|
||||
}
|
||||
if (get_string_manager()->string_exists('pluginname', 'editor_'.$editor)) {
|
||||
$strplugin = get_string('pluginname', 'editor_'.$editor);
|
||||
} else {
|
||||
$strplugin = $editor;
|
||||
}
|
||||
|
||||
$PAGE->set_title($strplugin);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->heading(get_string('editors', 'core_editor'));
|
||||
|
||||
$deleteurl = new moodle_url('/admin/editors.php', array('action'=>'uninstall', 'editor'=>$editor, 'sesskey'=>sesskey(), 'confirm'=>1));
|
||||
|
||||
echo $OUTPUT->confirm(get_string('editordeleteconfirm', 'core_editor', $strplugin),
|
||||
$deleteurl, $returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
// Remove from enabled list.
|
||||
$key = array_search($editor, $active_editors);
|
||||
unset($active_editors[$key]);
|
||||
set_config('texteditors', implode(',', $active_editors));
|
||||
|
||||
// Delete everything!!
|
||||
uninstall_plugin('editor', $editor);
|
||||
|
||||
$a = new stdClass();
|
||||
$a->name = $strplugin;
|
||||
$a->directory = "$CFG->dirroot/lib/editor/$editor";
|
||||
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+9
-46
@@ -23,21 +23,18 @@
|
||||
* @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);
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$enrol = required_param('enrol', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
$migrate = optional_param('migrate', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/enrol.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
require_sesskey();
|
||||
|
||||
$enabled = enrol_get_plugins(true);
|
||||
@@ -97,58 +94,24 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'uninstall':
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
|
||||
|
||||
if (get_string_manager()->string_exists('pluginname', 'enrol_'.$enrol)) {
|
||||
$strplugin = get_string('pluginname', 'enrol_'.$enrol);
|
||||
} else {
|
||||
$strplugin = $enrol;
|
||||
}
|
||||
|
||||
$PAGE->set_title($strplugin);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
|
||||
|
||||
$deleteurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1, 'migrate'=>0));
|
||||
$migrateurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1, 'migrate'=>1));
|
||||
|
||||
$migrate = new single_button($migrateurl, get_string('uninstallmigrate', 'enrol'));
|
||||
$delete = new single_button($deleteurl, get_string('uninstalldelete', 'enrol'));
|
||||
$cancel = new single_button($return, get_string('cancel'), 'get');
|
||||
|
||||
$buttons = $OUTPUT->render($delete) . $OUTPUT->render($cancel);
|
||||
if ($enrol !== 'manual') {
|
||||
$buttons = $OUTPUT->render($migrate) . $buttons;
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
echo html_writer::tag('p', markdown_to_html(get_string('uninstallconfirm', 'enrol', $strplugin)));
|
||||
echo html_writer::tag('div', $buttons, array('class' => 'buttons'));
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
$uurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1));
|
||||
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'enrol', $strplugin), $uurl, $return);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
// This may take a long time.
|
||||
set_time_limit(0);
|
||||
|
||||
// Disable plugin to prevent concurrent cron execution.
|
||||
unset($enabled[$enrol]);
|
||||
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
|
||||
|
||||
if ($migrate) {
|
||||
echo $OUTPUT->heading(get_string('uninstallmigrating', 'enrol', 'enrol_'.$enrol));
|
||||
|
||||
require_once("$CFG->dirroot/enrol/manual/locallib.php");
|
||||
enrol_manual_migrate_plugin_enrolments($enrol);
|
||||
|
||||
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
|
||||
}
|
||||
|
||||
// Delete everything!!
|
||||
} else { // Delete everything!!
|
||||
uninstall_plugin('enrol', $enrol);
|
||||
$syscontext->mark_dirty(); // Resets all enrol caches.
|
||||
$syscontext->mark_dirty(); // resets all enrol caches
|
||||
|
||||
$a = new stdClass();
|
||||
$a->plugin = $strplugin;
|
||||
|
||||
@@ -33,7 +33,7 @@ require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
// Parameters
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$version = optional_param('version', '', PARAM_FILE); //
|
||||
|
||||
$extraurlparams = array();
|
||||
|
||||
+36
-257
@@ -214,7 +214,11 @@
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.0.25" />
|
||||
<VENDOR name="mysql" version="5.0.25">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
@@ -227,7 +231,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -237,7 +241,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -277,12 +281,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -331,7 +335,11 @@
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.0.25" />
|
||||
<VENDOR name="mysql" version="5.0.25">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
@@ -344,7 +352,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -354,7 +362,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -394,12 +402,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -441,7 +449,11 @@
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.0.25" />
|
||||
<VENDOR name="mysql" version="5.0.25">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
@@ -454,7 +466,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -464,7 +476,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -504,12 +516,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -551,7 +563,11 @@
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="mysql" version="5.0.25">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
@@ -561,15 +577,10 @@
|
||||
</DATABASE>
|
||||
<PHP version="5.3.2" 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" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -579,7 +590,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -619,244 +630,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK 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="40M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="safe_mode" value="0" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingsafemode" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.4" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
<VENDOR name="sqlite" version="2.0" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.2" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="gdrecommended" />
|
||||
</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="40M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="safe_mode" value="0" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingsafemode" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.5" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
<VENDOR name="sqlite" version="2.0" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.3" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
|
||||
+6
-8
@@ -34,11 +34,11 @@
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$filterpath = optional_param('filterpath', '', PARAM_PATH);
|
||||
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/filters.php";
|
||||
@@ -68,7 +68,7 @@
|
||||
switch ($action) {
|
||||
|
||||
case 'setstate':
|
||||
if ($newstate = optional_param('newstate', '', PARAM_INT)) {
|
||||
if ($newstate = optional_param('newstate', '', PARAM_INTEGER)) {
|
||||
filter_set_global_state($filterpath, $newstate);
|
||||
if ($newstate == TEXTFILTER_DISABLED) {
|
||||
filter_set_applies_to_strings($filterpath, false);
|
||||
@@ -242,20 +242,19 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
|
||||
|
||||
// Disable/off/on
|
||||
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
|
||||
$select->set_label(get_string('isactive', 'filters'), array('class' => 'accesshide'));
|
||||
$row[] = $OUTPUT->render($select);
|
||||
|
||||
// Re-order
|
||||
$updown = '';
|
||||
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
|
||||
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
|
||||
if ($filterinfo->active != TEXTFILTER_DISABLED) {
|
||||
if (!$isfirstrow) {
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
|
||||
} else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
if (!$islastactive) {
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
|
||||
} else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
@@ -264,7 +263,6 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
|
||||
|
||||
// Apply to strings.
|
||||
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
|
||||
$select->set_label(get_string('applyto', 'filters'), array('class' => 'accesshide'));
|
||||
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
|
||||
$row[] = $OUTPUT->render($select);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ while(!feof($fd)) {
|
||||
$a->date = userdate($log->time);
|
||||
|
||||
$a->action = $action;
|
||||
$a->course = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
|
||||
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
$a->user = fullname($user);
|
||||
|
||||
notify_user($user,$subject,$a);
|
||||
@@ -86,7 +86,7 @@ function notify_admins($user,$subject,$a) {
|
||||
foreach ($admins as $admin) {
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userfrom = $admin;
|
||||
$eventdata->userto = $admin;
|
||||
$eventdata->subject = $subject;
|
||||
$eventdata->fullmessage = $body;
|
||||
@@ -107,7 +107,7 @@ function notify_admins_unknown($file,$a) {
|
||||
foreach ($admins as $admin) {
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userfrom = $admin;
|
||||
$eventdata->userto = $admin;
|
||||
$eventdata->subject = $subject;
|
||||
$eventdata->fullmessage = $body;
|
||||
|
||||
+27
-146
@@ -44,13 +44,17 @@ if (!function_exists('iconv')) {
|
||||
echo 'Moodle requires the iconv PHP extension. Please install or enable the iconv extension.';
|
||||
die();
|
||||
}
|
||||
if (iconv('UTF-8', 'UTF-8//IGNORE', 'abc') !== 'abc') {
|
||||
// known to be broken in mid-2011 MAMP installations
|
||||
echo 'Broken iconv PHP extension detected, installation/upgrade can not continue.';
|
||||
die();
|
||||
}
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../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.'/pluginlib.php'); // available updates notifications
|
||||
|
||||
$id = optional_param('id', '', PARAM_TEXT);
|
||||
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
|
||||
@@ -58,7 +62,6 @@ $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);
|
||||
|
||||
// Check some PHP server settings
|
||||
|
||||
@@ -90,20 +93,25 @@ if (!isset($CFG->release)) {
|
||||
if (!isset($CFG->version)) {
|
||||
$CFG->version = '';
|
||||
}
|
||||
if (!isset($CFG->branch)) {
|
||||
$CFG->branch = '';
|
||||
}
|
||||
|
||||
$version = null;
|
||||
$release = null;
|
||||
$branch = null;
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if (!$version or !$release) {
|
||||
print_error('withoutversion', 'debug'); // without version, stop
|
||||
}
|
||||
|
||||
if (!isset($maturity)) {
|
||||
// Fallback for now. Should probably be removed in the future.
|
||||
$maturity = MATURITY_STABLE;
|
||||
}
|
||||
|
||||
// Turn off xmlstrictheaders during upgrade.
|
||||
$origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
|
||||
$CFG->xmlstrictheaders = false;
|
||||
|
||||
if (!core_tables_exist()) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
@@ -143,20 +151,6 @@ if (!core_tables_exist()) {
|
||||
die();
|
||||
}
|
||||
|
||||
// check plugin dependencies
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
//TODO: add a page with list of non-standard plugins here
|
||||
|
||||
$strdatabasesetup = get_string('databasesetup');
|
||||
@@ -185,7 +179,7 @@ if (!core_tables_exist()) {
|
||||
// and upgrade if possible.
|
||||
|
||||
$stradministration = get_string('administration');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
if (empty($CFG->version)) {
|
||||
print_error('missingconfigversion', 'debug');
|
||||
@@ -193,21 +187,10 @@ if (empty($CFG->version)) {
|
||||
|
||||
if ($version > $CFG->version) { // upgrade
|
||||
purge_all_caches();
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_stale_php_files_page();
|
||||
die();
|
||||
}
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$a = new stdClass();
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
@@ -242,40 +225,9 @@ if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
if ($fetchupdates) {
|
||||
// no sesskey support guaranteed here
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
available_update_checker::instance()->fetch();
|
||||
}
|
||||
redirect($reloadurl);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($reloadurl, $reloadurl);
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins, $reloadurl,
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)),
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
|
||||
die();
|
||||
|
||||
@@ -293,10 +245,6 @@ if ($release <> $CFG->release) { // Update the release version
|
||||
set_config('release', $release);
|
||||
}
|
||||
|
||||
if ($branch <> $CFG->branch) { // Update the branch
|
||||
set_config('branch', $branch);
|
||||
}
|
||||
|
||||
if (moodle_needs_upgrading()) {
|
||||
if (!$PAGE->headerprinted) {
|
||||
// means core upgrade or installation was not already done
|
||||
@@ -310,37 +258,9 @@ if (moodle_needs_upgrading()) {
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
if ($fetchupdates) {
|
||||
// no sesskey support guaranteed here
|
||||
available_update_checker::instance()->fetch();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($PAGE->url, $PAGE->url);
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
// dependencies check passed, let's rock!
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins,
|
||||
new moodle_url($PAGE->url),
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php'),
|
||||
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
|
||||
die();
|
||||
}
|
||||
@@ -377,13 +297,8 @@ if (during_initial_install()) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup SESSION to make sure other code does not complain in the future.
|
||||
unset($SESSION->has_timed_out);
|
||||
unset($SESSION->wantsurl);
|
||||
|
||||
// at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
|
||||
$adminids = explode(',', $CFG->siteadmins);
|
||||
$adminuser = get_complete_user_data('id', reset($adminids));
|
||||
$adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins)));
|
||||
|
||||
if ($adminuser->password === 'adminsetuppending') {
|
||||
// prevent installation hijacking
|
||||
@@ -404,9 +319,13 @@ if (during_initial_install()) {
|
||||
upgrade_finished('upgradesettings.php');
|
||||
}
|
||||
|
||||
// Turn xmlstrictheaders back on now.
|
||||
$CFG->xmlstrictheaders = $origxmlstrictheaders;
|
||||
unset($origxmlstrictheaders);
|
||||
|
||||
// Check for valid admin user - no guest autologin
|
||||
require_login(0, false);
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
// check that site is properly customized
|
||||
@@ -444,45 +363,7 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
|
||||
$dbproblems = $DB->diagnose();
|
||||
$maintenancemode = !empty($CFG->maintenance_enabled);
|
||||
|
||||
// Available updates for Moodle core
|
||||
$updateschecker = available_update_checker::instance();
|
||||
$availableupdates = array();
|
||||
$availableupdates['core'] = $updateschecker->get_update_info('core',
|
||||
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
|
||||
|
||||
// Available updates for contributed plugins
|
||||
$pluginman = 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();
|
||||
}
|
||||
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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));
|
||||
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
|
||||
if ($fetchupdates) {
|
||||
require_sesskey();
|
||||
$updateschecker->fetch();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
|
||||
$registered);
|
||||
$cronoverdue, $dbproblems, $maintenancemode);
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/licenselib.php');
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$license = optional_param('license', '', PARAM_SAFEDIR);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+5
-33
@@ -29,15 +29,11 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
admin_externalpage_setup('managemessageoutputs');
|
||||
|
||||
// Require site configuration capability
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
// Get the submitted params
|
||||
$disable = optional_param('disable', 0, PARAM_INT);
|
||||
$enable = optional_param('enable', 0, PARAM_INT);
|
||||
$uninstall = optional_param('uninstall', 0, PARAM_INT);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
$headingtitle = get_string('managemessageoutputs', 'message');
|
||||
|
||||
if (!empty($disable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
||||
@@ -46,43 +42,19 @@ if (!empty($disable) && confirm_sesskey()) {
|
||||
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
||||
}
|
||||
|
||||
if (!empty($enable) && confirm_sesskey()) {
|
||||
if (!empty($enable) && confirm_sesskey() ) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
||||
}
|
||||
|
||||
if (!empty($uninstall) && confirm_sesskey()) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$uninstall))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
|
||||
$processorname = get_string('pluginname', 'message_'.$processor->name);
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->confirm(get_string('processordeleteconfirm', 'message', $processorname), 'message.php?uninstall='.$processor->id.'&confirm=1', 'message.php');
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
message_processor_uninstall($processor->name);
|
||||
$a = new stdClass();
|
||||
$a->processor = $processorname;
|
||||
$a->directory = $CFG->dirroot.'/message/output/'.$processor->name;
|
||||
notice(get_string('processordeletefiles', 'message', $a), 'message.php');
|
||||
}
|
||||
}
|
||||
|
||||
if ($disable || $enable || $uninstall) {
|
||||
if ($disable || $enable) {
|
||||
$url = new moodle_url('message.php');
|
||||
redirect($url);
|
||||
}
|
||||
// Page settings
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
// Grab the renderer
|
||||
$renderer = $PAGE->get_renderer('core', 'message');
|
||||
@@ -93,6 +65,6 @@ $messageoutputs = $renderer->manage_messageoutputs($processors);
|
||||
|
||||
// Display the page
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
echo $OUTPUT->heading(get_string('managemessageoutputs', 'message'));
|
||||
echo $messageoutputs;
|
||||
echo $OUTPUT->footer();
|
||||
@@ -22,7 +22,7 @@ if (!extension_loaded('openssl')) {
|
||||
print_error('requiresopenssl', 'mnet');
|
||||
}
|
||||
|
||||
$sitecontext = context_system::instance();
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$sesskey = sesskey();
|
||||
$formerror = array();
|
||||
|
||||
@@ -103,7 +103,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
|
||||
$usernames = explode(',', $form->username);
|
||||
|
||||
foreach ($usernames as $username) {
|
||||
$username = trim(textlib::strtolower($username));
|
||||
$username = trim(moodle_strtolower($username));
|
||||
if (!empty($username)) {
|
||||
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
|
||||
if ($form->accessctrl == 'allow') {
|
||||
@@ -203,18 +203,17 @@ echo get_string('username') . ":\n";
|
||||
if (!empty($formerror['username'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::label(get_string('username'), 'menuusername', false, array('class' => 'accesshide'));
|
||||
echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
|
||||
echo '<input type="text" name="username" size="20" maxlength="100" />';
|
||||
|
||||
// choose a remote host
|
||||
echo " " . html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id') . ":\n";
|
||||
echo " " . get_string('remotehost', 'mnet') . ":\n";
|
||||
if (!empty($formerror['mnet_host_id'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::select($mnethosts, 'mnet_host_id');
|
||||
|
||||
// choose an access level
|
||||
echo " " . html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl') . ":\n";
|
||||
echo " " . get_string('accesslevel', 'mnet') . ":\n";
|
||||
if (!empty($formerror['accessctrl'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ $hostid = required_param('hostid', PARAM_INT);
|
||||
|
||||
require_login();
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
require_login();
|
||||
admin_externalpage_setup('net');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class mnet_simple_host_form extends moodleform {
|
||||
$this->add_action_buttons(false, get_string('addhost', 'mnet'));
|
||||
}
|
||||
|
||||
function validation($data, $files) {
|
||||
function validation($data) {
|
||||
global $DB;
|
||||
|
||||
$wwwroot = $data['wwwroot'];
|
||||
@@ -141,10 +141,10 @@ class mnet_review_host_form extends moodleform {
|
||||
|
||||
if ($mnet_peer && !empty($mnet_peer->deleted)) {
|
||||
$radioarray = array();
|
||||
$radioarray[] = $mform->createElement('static', 'deletedinfo', '',
|
||||
$radioarray[] = MoodleQuickForm::createElement('static', 'deletedinfo', '',
|
||||
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
|
||||
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1);
|
||||
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0);
|
||||
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('yes'), 1);
|
||||
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('no'), 0);
|
||||
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'deleted');
|
||||
@@ -154,7 +154,7 @@ class mnet_review_host_form extends moodleform {
|
||||
$this->add_action_buttons(false);
|
||||
}
|
||||
|
||||
function validation($data, $files) {
|
||||
function validation($data) {
|
||||
$errors = array();
|
||||
if ($data['oldpublickey'] == $data['public_key']) {
|
||||
return;
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
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');
|
||||
require_once($CFG->dirroot.'/admin/mnet/peer_forms.php');
|
||||
|
||||
require_login();
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
|
||||
|
||||
/// Initialize variables.
|
||||
|
||||
@@ -34,7 +34,7 @@ $hostid = required_param('hostid', PARAM_INT);
|
||||
$mnet_peer = new mnet_peer();
|
||||
$mnet_peer->set_id($hostid);
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
|
||||
admin_externalpage_setup('mnetpeers');
|
||||
|
||||
@@ -39,15 +39,6 @@ class mnet_profile_form extends moodleform {
|
||||
global $CFG;
|
||||
$mform =& $this->_form;
|
||||
|
||||
$mnetprofileimportfields = '';
|
||||
if (isset($CFG->mnetprofileimportfields)) {
|
||||
$mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
|
||||
}
|
||||
|
||||
$mnetprofileexportfields = '';
|
||||
if (isset($CFG->mnetprofileexportfields)) {
|
||||
$mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
|
||||
}
|
||||
|
||||
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
|
||||
$fields = mnet_profile_field_options();
|
||||
@@ -58,7 +49,7 @@ class mnet_profile_form extends moodleform {
|
||||
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
|
||||
$select->setMultiple(true);
|
||||
|
||||
$mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
|
||||
$mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileimportfields));
|
||||
|
||||
// Fields to export ----------------------------------------------------
|
||||
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
|
||||
@@ -66,7 +57,7 @@ class mnet_profile_form extends moodleform {
|
||||
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
|
||||
$select->setMultiple(true);
|
||||
|
||||
$mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
|
||||
$mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileexportfields));
|
||||
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ $mnet = get_mnet_environment();
|
||||
require_login();
|
||||
admin_externalpage_setup('mnetpeers');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
$hostid = required_param('hostid', PARAM_INT);
|
||||
|
||||
@@ -36,7 +36,7 @@ class mnet_services_form extends moodleform {
|
||||
function definition() {
|
||||
$mform =& $this->_form;
|
||||
$mnet_peer =& $this->_customdata['peer'];
|
||||
$myservices = mnet_get_service_info($mnet_peer);
|
||||
$myservices =& mnet_get_service_info($mnet_peer);
|
||||
|
||||
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
require_login();
|
||||
admin_externalpage_setup('mnettestclient');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
error_reporting(DEBUG_ALL);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
require_login();
|
||||
admin_externalpage_setup('trustedhosts');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
|
||||
+2
-2
@@ -161,11 +161,11 @@
|
||||
$class = '';
|
||||
} else if ($module->visible) {
|
||||
$visible = "<a href=\"modules.php?hide=$module->name&sesskey=".sesskey()."\" title=\"$strhide\">".
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
|
||||
"<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
|
||||
$class = '';
|
||||
} else {
|
||||
$visible = "<a href=\"modules.php?show=$module->name&sesskey=".sesskey()."\" title=\"$strshow\">".
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
|
||||
"<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
|
||||
$class = ' class="dimmed_text"';
|
||||
}
|
||||
if ($module->name == "forum") {
|
||||
|
||||
+3
-11
@@ -49,7 +49,7 @@ function online_assignment_cleanup($output=false) {
|
||||
/// cycle through each course
|
||||
foreach ($courses as $course) {
|
||||
context_instance_preload($course);
|
||||
$context = context_course::instance($course->id);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
if (empty($course->fullname)) {
|
||||
$fullname = get_string('course').': '.$course->id;
|
||||
@@ -59,19 +59,11 @@ function online_assignment_cleanup($output=false) {
|
||||
if ($output) echo $OUTPUT->heading($fullname);
|
||||
|
||||
/// retrieve a list of sections beyond what is currently being shown
|
||||
$courseformatoptions = course_get_format($course)->get_format_options();
|
||||
if (!isset($courseformatoptions['numsections'])) {
|
||||
// Course format does not use numsections
|
||||
if ($output) {
|
||||
echo 'No extra sections<br />';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$sql = "SELECT *
|
||||
FROM {course_sections}
|
||||
WHERE course=? AND section>?
|
||||
ORDER BY section ASC";
|
||||
$params = array($course->id, $courseformatoptions['numsections']);
|
||||
$params = array($course->id, $course->numsections);
|
||||
if (!($xsections = $DB->get_records_sql($sql, $params))) {
|
||||
if ($output) echo 'No extra sections<br />';
|
||||
continue;
|
||||
@@ -102,7 +94,7 @@ function online_assignment_cleanup($output=false) {
|
||||
/// the journal update erroneously stored it in course_sections->section
|
||||
$newsection = $xsection->section;
|
||||
/// double check the new section
|
||||
if ($newsection > $courseformatoptions['numsections']) {
|
||||
if ($newsection > $course->numsections) {
|
||||
/// get the record for section 0 for this course
|
||||
if (!($zerosection = $DB->get_record('course_sections', array('course'=>$course->id, 'section'=>'0')))) {
|
||||
continue;
|
||||
|
||||
@@ -1,46 +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/>.
|
||||
|
||||
/**
|
||||
* An oauth2 redirection endpoint which can be used for an application:
|
||||
* http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
|
||||
*
|
||||
* This is used because some oauth servers will not allow a redirect urls
|
||||
* with get params (like repository callback) and that needs to be called
|
||||
* using the state param.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Dan Poltawski
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
// The state parameter we've given (used in moodle as a redirect url).
|
||||
$state = required_param('state', PARAM_LOCALURL);
|
||||
|
||||
$redirecturl = new moodle_url($state);
|
||||
$params = $redirecturl->params();
|
||||
|
||||
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
|
||||
$redirecturl->param('oauth2code', $code);
|
||||
redirect($redirecturl);
|
||||
} else {
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
@@ -1,114 +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/>.
|
||||
|
||||
/**
|
||||
* Provides an overview of installed plagiarism plugins
|
||||
*
|
||||
* Displays the list of found plagiarism plugins, their version (if found) and
|
||||
* a link to delete the plagiarism plugin.
|
||||
*
|
||||
* @see http://docs.moodle.org/dev/Plagiarism_API
|
||||
* @package admin
|
||||
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
admin_externalpage_setup('manageplagiarismplugins');
|
||||
|
||||
$delete = optional_param('delete', '', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
if (!empty($delete) and confirm_sesskey()) { // If data submitted, then process and store.
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('manageplagiarism', 'plagiarism'));
|
||||
|
||||
if (!$confirm) {
|
||||
if (get_string_manager()->string_exists('pluginname', 'plagiarism_' . $delete)) {
|
||||
$strpluginname = get_string('pluginname', 'plagiarism_' . $delete);
|
||||
} else {
|
||||
$strpluginname = $delete;
|
||||
}
|
||||
echo $OUTPUT->confirm(get_string('plagiarismplugindeleteconfirm', 'plagiarism', $strpluginname),
|
||||
new moodle_url($PAGE->url, array('delete' => $delete, 'confirm' => 1)),
|
||||
$PAGE->url);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
uninstall_plugin('plagiarism', $delete);
|
||||
$a = new stdclass();
|
||||
$a->name = $delete;
|
||||
$pluginlocation = get_plugin_types();
|
||||
$a->directory = $pluginlocation['plagiarism'] . '/' . $delete;
|
||||
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($PAGE->url);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Print the table of all installed plagiarism plugins.
|
||||
|
||||
$txt = get_strings(array('settings', 'name', 'version', 'delete'));
|
||||
|
||||
$plagiarismplugins = get_plugin_list('plagiarism');
|
||||
if (empty($plagiarismplugins)) {
|
||||
echo $OUTPUT->notification(get_string('nopluginsinstalled', 'plagiarism'));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
|
||||
echo $OUTPUT->box_start('generalbox authsui');
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array($txt->name, $txt->version, $txt->delete, $txt->settings);
|
||||
$table->colclasses = array('mdl-left', 'mdl-align', 'mdl-align', 'mdl-align');
|
||||
$table->data = array();
|
||||
$table->attributes['class'] = 'manageplagiarismtable generaltable';
|
||||
|
||||
// Iterate through auth plugins and add to the display table.
|
||||
$authcount = count($plagiarismplugins);
|
||||
foreach ($plagiarismplugins as $plugin => $dir) {
|
||||
if (file_exists($dir.'/settings.php')) {
|
||||
$displayname = "<span>".get_string($plugin, 'plagiarism_'.$plugin)."</span>";
|
||||
// Settings link.
|
||||
$url = new moodle_url("/plagiarism/$plugin/settings.php");
|
||||
$settings = html_writer::link($url, $txt->settings);
|
||||
// Get version.
|
||||
$version = get_config('plagiarism_' . $plugin);
|
||||
if (!empty($version->version)) {
|
||||
$version = $version->version;
|
||||
} else {
|
||||
$version = '?';
|
||||
}
|
||||
// Delete link.
|
||||
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
|
||||
$delete = html_writer::link($delete, get_string('delete'));
|
||||
$table->data[] = array($displayname, $version, $delete, $settings);
|
||||
}
|
||||
}
|
||||
echo html_writer::table($table);
|
||||
echo get_string('configplagiarismplugins', 'plagiarism');
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
+2
-35
@@ -28,40 +28,7 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
|
||||
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL);
|
||||
$contribonly = optional_param('contribonly', false, PARAM_BOOL);
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
$checker = available_update_checker::instance();
|
||||
|
||||
// Filtering options.
|
||||
$options = array(
|
||||
'updatesonly' => $updatesonly,
|
||||
'contribonly' => $contribonly,
|
||||
);
|
||||
|
||||
if ($fetchremote) {
|
||||
require_sesskey();
|
||||
$checker->fetch();
|
||||
redirect(new moodle_url($PAGE->url, $options));
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
|
||||
$deployer->initialize($myurl, $myurl);
|
||||
|
||||
$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);
|
||||
echo $output->plugin_management_page(plugin_manager::instance());
|
||||
|
||||
+2
-4
@@ -5,7 +5,7 @@ require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->libdir . '/portfolio/forms.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$portfolio = optional_param('pf', '', PARAM_ALPHANUMEXT);
|
||||
$portfolio = optional_param('pf', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
@@ -35,7 +35,7 @@ if ($action == 'newon') {
|
||||
|
||||
admin_externalpage_setup($pagename);
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/portfolio.php?sesskey=" . sesskey();
|
||||
@@ -197,7 +197,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
$currentaction = 'hide';
|
||||
}
|
||||
$select = new single_select(portfolio_action_url($pluginid, 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $pluginid);
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
$table->data[] = array($pluginname, $OUTPUT->render($select), $settings);
|
||||
}
|
||||
if (!in_array($plugin, $usedplugins)) {
|
||||
@@ -219,7 +218,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
$insaneplugins[] = $p;
|
||||
} else {
|
||||
$select = new single_select(portfolio_action_url($p, 'pf'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . $p);
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
$table->data[] = array(portfolio_static_function($p, 'get_name'), $OUTPUT->render($select), '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
admin_externalpage_setup('purgecaches');
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
if ($confirm) {
|
||||
require_sesskey();
|
||||
|
||||
@@ -33,7 +33,7 @@ require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/question:config', $systemcontext);
|
||||
|
||||
admin_externalpage_setup('manageqbehaviours');
|
||||
@@ -258,7 +258,7 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
|
||||
$rowclass = 'dimmed_text';
|
||||
}
|
||||
} else {
|
||||
$icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
|
||||
$icons = $OUTPUT->spacer() . ' ';
|
||||
}
|
||||
|
||||
// Move icons.
|
||||
@@ -284,10 +284,10 @@ echo $OUTPUT->footer();
|
||||
|
||||
function question_behaviour_enable_disable_icons($behaviour, $enabled) {
|
||||
if ($enabled) {
|
||||
return question_behaviour_icon_html('disable', $behaviour, 't/hide',
|
||||
return question_behaviour_icon_html('disable', $behaviour, 'i/hide',
|
||||
get_string('enabled', 'question'), get_string('disable'));
|
||||
} else {
|
||||
return question_behaviour_icon_html('enable', $behaviour, 't/show',
|
||||
return question_behaviour_icon_html('enable', $behaviour, 'i/show',
|
||||
get_string('disabled', 'question'), get_string('enable'));
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ function question_behaviour_icon_html($action, $behaviour, $icon, $alt, $tip) {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
|
||||
array($action => $behaviour, 'sesskey' => sesskey())),
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => $tip));
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
|
||||
null, array('title' => $tip)) . ' ';
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -33,7 +33,7 @@ require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/question:config', $systemcontext);
|
||||
$canviewreports = has_capability('report/questioninstances:view', $systemcontext);
|
||||
|
||||
@@ -257,7 +257,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
|
||||
$rowclass = 'dimmed_text';
|
||||
}
|
||||
} else {
|
||||
$icons = $OUTPUT->spacer();
|
||||
$icons = $OUTPUT->spacer() . ' ';
|
||||
}
|
||||
|
||||
// Move icons.
|
||||
@@ -294,10 +294,10 @@ echo $OUTPUT->footer();
|
||||
|
||||
function question_types_enable_disable_icons($qtypename, $createable) {
|
||||
if ($createable) {
|
||||
return question_type_icon_html('disable', $qtypename, 't/hide',
|
||||
return question_type_icon_html('disable', $qtypename, 'i/hide',
|
||||
get_string('enabled', 'question'), get_string('disable'));
|
||||
} else {
|
||||
return question_type_icon_html('enable', $qtypename, 't/show',
|
||||
return question_type_icon_html('enable', $qtypename, 'i/show',
|
||||
get_string('disabled', 'question'), get_string('enable'));
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ function question_type_icon_html($action, $qtypename, $icon, $alt, $tip) {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
|
||||
array($action => $qtypename, 'sesskey' => sesskey())),
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => $tip));
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
|
||||
null, array('title' => $tip)) . ' ';
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ $hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
$error = optional_param('error', '', PARAM_ALPHANUM);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
if (!empty($error) and $error == 'urlalreadyexist') {
|
||||
throw new moodle_exception('urlalreadyregistered', 'hub',
|
||||
|
||||
@@ -203,7 +203,7 @@ class site_registration_form extends moodleform {
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
$sitename = get_config('hub', 'site_name_' . $cleanhuburl);
|
||||
if ($sitename === false) {
|
||||
$sitename = format_string($site->fullname, true, array('context' => context_course::instance(SITEID)));
|
||||
$sitename = format_string($site->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
}
|
||||
$sitedescription = get_config('hub', 'site_description_' . $cleanhuburl);
|
||||
if ($sitedescription === false) {
|
||||
@@ -236,7 +236,6 @@ class site_registration_form extends moodleform {
|
||||
$geolocation = get_config('hub', 'site_geolocation_' . $cleanhuburl);
|
||||
$contactable = get_config('hub', 'site_contactable_' . $cleanhuburl);
|
||||
$emailalert = get_config('hub', 'site_emailalert_' . $cleanhuburl);
|
||||
$emailalert = ($emailalert === 0) ? 0 : 1;
|
||||
$coursesnumber = get_config('hub', 'site_coursesnumber_' . $cleanhuburl);
|
||||
$usersnumber = get_config('hub', 'site_usersnumber_' . $cleanhuburl);
|
||||
$roleassignmentsnumber = get_config('hub', 'site_roleassignmentsnumber_' . $cleanhuburl);
|
||||
@@ -244,8 +243,6 @@ class site_registration_form extends moodleform {
|
||||
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
|
||||
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
|
||||
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
|
||||
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
|
||||
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
|
||||
|
||||
//hidden parameters
|
||||
$mform->addElement('hidden', 'huburl', $huburl);
|
||||
@@ -282,6 +279,9 @@ class site_registration_form extends moodleform {
|
||||
$mform->setType('description', PARAM_TEXT);
|
||||
$mform->addHelpButton('description', 'sitedesc', 'hub');
|
||||
|
||||
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
$languages = get_string_manager()->get_list_of_languages();
|
||||
collatorlib::asort($languages);
|
||||
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
|
||||
@@ -290,6 +290,16 @@ class site_registration_form extends moodleform {
|
||||
$mform->addHelpButton('language', 'sitelang', 'hub');
|
||||
$mform->setDefault('language', $language);
|
||||
|
||||
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
|
||||
$mform->addElement('hidden', 'moodleversion', $CFG->version);
|
||||
$mform->setType('moodleversion', PARAM_INT);
|
||||
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
|
||||
|
||||
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
|
||||
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
|
||||
$mform->setType('moodlerelease', PARAM_TEXT);
|
||||
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
|
||||
|
||||
$mform->addElement('textarea', 'address', get_string('postaladdress', 'hub'),
|
||||
array('rows' => 4, 'cols' => 41));
|
||||
$mform->setType('address', PARAM_TEXT);
|
||||
@@ -350,20 +360,6 @@ class site_registration_form extends moodleform {
|
||||
//TODO site logo
|
||||
$mform->addElement('hidden', 'imageurl', ''); //TODO: temporary
|
||||
$mform->setType('imageurl', PARAM_URL);
|
||||
|
||||
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
|
||||
$mform->addElement('hidden', 'moodleversion', $CFG->version);
|
||||
$mform->setType('moodleversion', PARAM_INT);
|
||||
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
|
||||
|
||||
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
|
||||
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
|
||||
$mform->setType('moodlerelease', PARAM_TEXT);
|
||||
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
|
||||
|
||||
/// Display statistic that are going to be retrieve by the hub
|
||||
$coursecount = $DB->count_records('course') - 1;
|
||||
$usercount = $DB->count_records('user', array('deleted' => 0));
|
||||
@@ -378,36 +374,36 @@ class site_registration_form extends moodleform {
|
||||
if (HUB_MOODLEORGHUBURL != $huburl) {
|
||||
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
$mform->setDefault('courses', $coursesnumber != -1);
|
||||
$mform->setDefault('courses', true);
|
||||
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
|
||||
|
||||
$mform->addElement('checkbox', 'users', '',
|
||||
" " . get_string('usersnumber', 'hub', $usercount));
|
||||
$mform->setDefault('users', $usersnumber != -1);
|
||||
$mform->setDefault('users', true);
|
||||
|
||||
$mform->addElement('checkbox', 'roleassignments', '',
|
||||
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
|
||||
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
|
||||
$mform->setDefault('roleassignments', true);
|
||||
|
||||
$mform->addElement('checkbox', 'posts', '',
|
||||
" " . get_string('postsnumber', 'hub', $postcount));
|
||||
$mform->setDefault('posts', $postsnumber != -1);
|
||||
$mform->setDefault('posts', true);
|
||||
|
||||
$mform->addElement('checkbox', 'questions', '',
|
||||
" " . get_string('questionsnumber', 'hub', $questioncount));
|
||||
$mform->setDefault('questions', $questionsnumber != -1);
|
||||
$mform->setDefault('questions', true);
|
||||
|
||||
$mform->addElement('checkbox', 'resources', '',
|
||||
" " . get_string('resourcesnumber', 'hub', $resourcecount));
|
||||
$mform->setDefault('resources', $resourcesnumber != -1);
|
||||
$mform->setDefault('resources', true);
|
||||
|
||||
$mform->addElement('checkbox', 'participantnumberaverage', '',
|
||||
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
|
||||
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
|
||||
$mform->setDefault('participantnumberaverage', true);
|
||||
|
||||
$mform->addElement('checkbox', 'modulenumberaverage', '',
|
||||
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
|
||||
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
|
||||
$mform->setDefault('modulenumberaverage', true);
|
||||
} else {
|
||||
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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/>.
|
||||
|
||||
/*
|
||||
* @package moodle
|
||||
* @subpackage registration
|
||||
* @author Jerome Mouneyrac <jerome@mouneyrac.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* Thsi page displays a hub selector or a hub URL + password. Then it will redirect to
|
||||
* the site registration form (with the selected hub as parameter)
|
||||
*/
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/forms.php');
|
||||
|
||||
admin_externalpage_setup('registrationselector');
|
||||
|
||||
$hubselectorform = new hub_selector_form();
|
||||
$fromform = $hubselectorform->get_data();
|
||||
|
||||
//// Redirect to the registration form if an URL has been choosen ////
|
||||
|
||||
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
|
||||
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
|
||||
$password = optional_param('password', '', PARAM_RAW);
|
||||
|
||||
if (!empty($unlistedhuburl)) {
|
||||
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
|
||||
$huburl = $unlistedhuburl;
|
||||
}
|
||||
} else if (!empty($selectedhuburl)) {
|
||||
$huburl = $selectedhuburl;
|
||||
}
|
||||
|
||||
|
||||
//redirect
|
||||
if (!empty($huburl) and confirm_sesskey()) {
|
||||
$hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
|
||||
$params = array('sesskey' => sesskey(), 'huburl' => $huburl,
|
||||
'password' => $password, 'hubname' => $hubname);
|
||||
redirect(new moodle_url($CFG->wwwroot."/" . $CFG->admin . "/registration/register.php",
|
||||
$params));
|
||||
}
|
||||
|
||||
|
||||
//// OUTPUT ////
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
|
||||
$hubselectorform->display();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -22,9 +22,8 @@
|
||||
* @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 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.
|
||||
* On this page the administrator select if he wants to register on Moodle.org or
|
||||
* a specific hub
|
||||
*/
|
||||
|
||||
require('../../config.php');
|
||||
@@ -35,7 +34,7 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/course/publish/lib.php');
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$renderer = $PAGE->get_renderer('core', 'register');
|
||||
|
||||
@@ -127,15 +126,13 @@ if (empty($cancel) and $unregistration and $confirm and confirm_sesskey()) {
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
if (empty($cancel) and $unregistration and !$confirm) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
|
||||
$hub = $registrationmanager->get_registeredhub($huburl);
|
||||
echo $OUTPUT->heading(get_string('unregisterfrom', 'hub', $hub->hubname), 3, 'main');
|
||||
if ($cleanregdata) {
|
||||
@@ -145,7 +142,6 @@ if (empty($cancel) and $unregistration and !$confirm) {
|
||||
$siteunregistrationform = new site_unregistration_form('',
|
||||
array('huburl' => $huburl, 'hubname' => $hub->hubname));
|
||||
}
|
||||
|
||||
$siteunregistrationform->display();
|
||||
} else {
|
||||
$registeredonmoodleorg = false;
|
||||
@@ -154,49 +150,8 @@ if (empty($cancel) and $unregistration and !$confirm) {
|
||||
$registeredonmoodleorg = true;
|
||||
}
|
||||
|
||||
// load the hub selector form
|
||||
$hubselectorform = new hub_selector_form();
|
||||
$fromform = $hubselectorform->get_data();
|
||||
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
|
||||
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
|
||||
$password = optional_param('password', '', PARAM_RAW);
|
||||
$registeringhuburl = null;
|
||||
if (!empty($unlistedhuburl)) {
|
||||
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
|
||||
$registeringhuburl = $unlistedhuburl;
|
||||
}
|
||||
} else if (!empty($selectedhuburl)) {
|
||||
$registeringhuburl = $selectedhuburl;
|
||||
}
|
||||
|
||||
// a hub has been selected, redirect to the hub registration page
|
||||
if (empty($cancel) and !empty($registeringhuburl) and confirm_sesskey()) {
|
||||
$hubname = optional_param(clean_param($registeringhuburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
|
||||
$params = array('sesskey' => sesskey(), 'huburl' => $registeringhuburl,
|
||||
'password' => $password, 'hubname' => $hubname);
|
||||
redirect(new moodle_url($CFG->wwwroot . "/" . $CFG->admin . "/registration/register.php",
|
||||
$params));
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//check if the site is registered on Moodle.org and display a message about registering on MOOCH
|
||||
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
|
||||
if (empty($registered)) {
|
||||
$warningmsg = get_string('registermoochtips', 'hub');
|
||||
$warningmsg .= $renderer->single_button(new moodle_url('register.php', array('huburl' => HUB_MOODLEORGHUBURL
|
||||
, 'hubname' => 'Moodle.org')), get_string('register', 'admin'));
|
||||
echo $renderer->box($warningmsg, 'buttons mdl-align generalbox adminwarning');
|
||||
}
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('registerwith', 'hub'));
|
||||
|
||||
$hubselectorform->display();
|
||||
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
|
||||
echo $renderer->registrationselector($registeredonmoodleorg);
|
||||
|
||||
if (extension_loaded('xmlrpc')) {
|
||||
$hubs = $registrationmanager->get_registered_on_hubs();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* This page displays the site registration form for Moodle.org/MOOCH or for a different hub.
|
||||
* This page displays the site registration form.
|
||||
* It handles redirection to the hub to continue the registration workflow process.
|
||||
* It also handles update operation by web service.
|
||||
*/
|
||||
@@ -39,17 +39,15 @@ 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');
|
||||
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) { // register to Moodle.org
|
||||
admin_externalpage_setup('registrationmoodleorg');
|
||||
} else { //register to a hub
|
||||
admin_externalpage_setup('registrationhub');
|
||||
}
|
||||
|
||||
$password = optional_param('password', '', PARAM_TEXT);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
if (!confirm_sesskey()) {
|
||||
throw new moodle_exception('missingparameter');
|
||||
}
|
||||
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
@@ -62,18 +60,7 @@ $siteregistrationform = new site_registration_form('',
|
||||
$fromform = $siteregistrationform->get_data();
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) {
|
||||
|
||||
// Set to -1 all optional data marked as "don't send" by the admin.
|
||||
// The function get_site_info() will not calculate the optional data if config is set to -1.
|
||||
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
|
||||
'modulenumberaverage', 'participantnumberaverage');
|
||||
foreach ($inputnames as $inputname) {
|
||||
if (empty($fromform->{$inputname})) {
|
||||
$fromform->{$inputname} = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Save the settings.
|
||||
//save the settings
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
|
||||
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
|
||||
@@ -124,19 +111,6 @@ if ($update and confirm_sesskey()) {
|
||||
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
|
||||
|
||||
// Retrieve the optional info (specially course number, user number, module number average...).
|
||||
$siteinfo = $registrationmanager->get_site_info($huburl);
|
||||
$fromform->courses = $siteinfo['courses'];
|
||||
$fromform->users = $siteinfo['users'];
|
||||
$fromform->enrolments = $siteinfo['enrolments'];
|
||||
$fromform->posts = $siteinfo['posts'];
|
||||
$fromform->questions = $siteinfo['questions'];
|
||||
$fromform->resources = $siteinfo['resources'];
|
||||
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
|
||||
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
|
||||
$fromform->street = $siteinfo['street'];
|
||||
|
||||
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
|
||||
|
||||
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
|
||||
@@ -171,12 +145,5 @@ if (!empty($error)) {
|
||||
echo $error;
|
||||
}
|
||||
|
||||
//some Moodle.org resitration explanation
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) {
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
|
||||
$renderer = $PAGE->get_renderer('core', 'register');
|
||||
echo $renderer->moodleorg_registration_message();
|
||||
}
|
||||
|
||||
$siteregistrationform->display();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -30,23 +30,6 @@
|
||||
*/
|
||||
class core_register_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display Moodle.org registration message about benefit to register on Moodle.org
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function moodleorg_registration_message() {
|
||||
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
|
||||
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
|
||||
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'Moodle.net');
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
|
||||
$items = array(get_string('registermoodleorgli1', 'admin'),
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
|
||||
get_string('registermoodleorgli3', 'admin', $moochurl));
|
||||
$moodleorgregmsg .= html_writer::alist($items);
|
||||
return $moodleorgregmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a box message confirming a site registration (add or update)
|
||||
* @param string $confirmationmessage
|
||||
@@ -59,6 +42,57 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return $this->output->box($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the page to register on Moodle.org or on a specific hub
|
||||
*/
|
||||
public function registrationselector($updatemoodleorg = false) {
|
||||
global $CFG;
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('moodleorg', 'hub'), get_string('specifichub', 'hub'));
|
||||
$table->size = array('50%', '50%');
|
||||
//$table->attributes['class'] = 'registerindextable';
|
||||
//Moodle.org information cell
|
||||
$moodleorgcell = get_string('moodleorgregistrationdetail', 'hub');
|
||||
$moodleorgcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$moodleorgcell = html_writer::tag('div', $moodleorgcell, array('class' => 'justifytext'));
|
||||
|
||||
//Specific hub information cell
|
||||
$specifichubcell = get_string('specifichubregistrationdetail', 'hub');
|
||||
$specifichubcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$specifichubcell = html_writer::tag('div', $specifichubcell, array('class' => 'justifytext'));
|
||||
|
||||
//add information cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
//Moodle.org button cell
|
||||
$registeronmoodleorgurl = new moodle_url("/" . $CFG->admin . "/registration/register.php",
|
||||
array('sesskey' => sesskey(), 'huburl' => HUB_MOODLEORGHUBURL
|
||||
, 'hubname' => 'Moodle.org'));
|
||||
$registeronmoodleorgbutton = new single_button($registeronmoodleorgurl,
|
||||
$updatemoodleorg ? get_string('updatesite', 'hub', 'Moodle.org') : get_string('registeronmoodleorg', 'hub'));
|
||||
$registeronmoodleorgbutton->class = 'centeredbutton';
|
||||
$registeronmoodleorgbuttonhtml = $this->output->render($registeronmoodleorgbutton);
|
||||
$moodleorgcell = $registeronmoodleorgbuttonhtml;
|
||||
|
||||
//Specific hub button cell
|
||||
$registeronspecifichuburl = new moodle_url("/" . $CFG->admin . "/registration/hubselector.php",
|
||||
array('sesskey' => sesskey()));
|
||||
$registeronspecifichubbutton = new single_button($registeronspecifichuburl,
|
||||
get_string('registeronspecifichub', 'hub'));
|
||||
$registeronspecifichubbutton->class = 'centeredbutton';
|
||||
$registeronspecifichubbuttonhtml = $this->output->render($registeronspecifichubbutton);
|
||||
$specifichubcell = $registeronspecifichubbuttonhtml;
|
||||
|
||||
//add button cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the listing of registered on hub
|
||||
*/
|
||||
@@ -92,4 +126,4 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ $url = optional_param('url', '', PARAM_URL);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
//check that we are waiting a confirmation from this hub, and check that the token is correct
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
+59
-538
@@ -57,26 +57,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display page explaining proper upgrade process,
|
||||
* there can not be any PHP file leftovers...
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_stale_php_files_page() {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('upgradestalefiles', 'admin'));
|
||||
$output .= $this->box_start('generalbox', 'notice');
|
||||
$output .= format_text(get_string('upgradestalefilesinfo', 'admin', get_docs_url('Upgrading')), FORMAT_MARKDOWN);
|
||||
$output .= html_writer::empty_tag('br');
|
||||
$output .= html_writer::tag('div', $this->single_button($this->page->url, get_string('reload'), 'get'), array('class' => 'buttons'));
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'environment check' page that is displayed during install.
|
||||
* @param int $maturity
|
||||
@@ -107,29 +87,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the list of plugins with unsatisfied dependencies
|
||||
*
|
||||
* @param double|string|int $version Moodle on-disk version
|
||||
* @param array $failed list of plugins with unsatisfied dependecies
|
||||
* @param moodle_url $reloadurl URL of the page to recheck the dependencies
|
||||
* @return string HTML
|
||||
*/
|
||||
public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginscheck', 'admin'));
|
||||
$output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
$output .= $this->plugins_check_table(plugin_manager::instance(), $version, array('xdep' => true));
|
||||
$output .= $this->warning(get_string('pluginschecktodo', 'admin'));
|
||||
$output .= $this->continue_button($reloadurl);
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'You are about to upgrade Moodle' page. The first page
|
||||
* during upgrade.
|
||||
@@ -188,103 +145,30 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
/**
|
||||
* Display the upgrade page that lists all the plugins that require attention.
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param available_update_checker $checker provides information about available updates.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param bool $showallplugins
|
||||
* @param moodle_url $reloadurl
|
||||
* @param moodle_url $continueurl
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_plugin_check_page(plugin_manager $pluginman, available_update_checker $checker,
|
||||
$version, $showallplugins, $reloadurl, $continueurl) {
|
||||
global $CFG;
|
||||
|
||||
public function upgrade_plugin_check_page(plugin_manager $pluginman, $version, $showallplugins, $reloadurl, $continueurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->box_start('generalbox');
|
||||
$output .= $this->container_start('generalbox', 'notice');
|
||||
$output .= html_writer::tag('p', get_string('pluginchecknotice', 'core_plugin'));
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$output .= $this->container_start('checkforupdates');
|
||||
$output .= $this->single_button(new moodle_url($reloadurl, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||
if ($timefetched = $checker->get_last_timefetched()) {
|
||||
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->container(get_string('pluginchecknotice', 'core_plugin'), 'generalbox', 'notice');
|
||||
$output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins));
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->upgrade_reload($reloadurl);
|
||||
|
||||
if ($pluginman->some_plugins_updatable()) {
|
||||
$output .= $this->container_start('upgradepluginsinfo');
|
||||
$output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a page with a summary of plugin deployment to be confirmed.
|
||||
*
|
||||
* @param available_update_deployer $deployer
|
||||
* @param array $data deployer's data package as returned by {@link available_update_deployer::submitted_data()}
|
||||
* @return string
|
||||
*/
|
||||
public function upgrade_plugin_confirm_deploy_page(available_update_deployer $deployer, array $data) {
|
||||
|
||||
if (!$deployer->initialized()) {
|
||||
throw new coding_exception('Unable to render a page for non-initialized deployer.');
|
||||
}
|
||||
|
||||
if (empty($data['updateinfo'])) {
|
||||
throw new coding_exception('Missing required data component.');
|
||||
}
|
||||
|
||||
$updateinfo = $data['updateinfo'];
|
||||
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->container_start('generalbox updateplugin', 'notice');
|
||||
|
||||
$a = new stdClass();
|
||||
if (get_string_manager()->string_exists('pluginname', $updateinfo->component)) {
|
||||
$a->name = get_string('pluginname', $updateinfo->component);
|
||||
if ($pluginman->all_plugins_ok($version)) {
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
} else {
|
||||
$a->name = $updateinfo->component;
|
||||
$output .= $this->box(get_string('pluginschecktodo', 'admin'), 'environmentbox errorbox');
|
||||
}
|
||||
|
||||
if (isset($updateinfo->release)) {
|
||||
$a->version = $updateinfo->release . ' (' . $updateinfo->version . ')';
|
||||
} else {
|
||||
$a->version = $updateinfo->version;
|
||||
}
|
||||
$a->url = $updateinfo->download;
|
||||
|
||||
$output .= $this->output->heading(get_string('updatepluginconfirm', 'core_plugin'));
|
||||
$output .= $this->output->container(format_text(get_string('updatepluginconfirminfo', 'core_plugin', $a)), 'updatepluginconfirminfo');
|
||||
$output .= $this->output->container(get_string('updatepluginconfirmwarning', 'core_plugin', 'updatepluginconfirmwarning'));
|
||||
|
||||
if ($repotype = $deployer->plugin_external_source($data['updateinfo'])) {
|
||||
$output .= $this->output->container(get_string('updatepluginconfirmexternal', 'core_plugin', $repotype), 'updatepluginconfirmexternal');
|
||||
}
|
||||
|
||||
$widget = $deployer->make_execution_widget($data['updateinfo']);
|
||||
$output .= $this->output->render($widget);
|
||||
|
||||
$output .= $this->output->single_button($data['returnurl'], get_string('cancel', 'core'), 'get');
|
||||
|
||||
$output .= $this->container_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
@@ -298,28 +182,19 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* @param bool $cronoverdue warn cron not running
|
||||
* @param bool $dbproblems warn db has problems
|
||||
* @param bool $maintenancemode warn in maintenance mode
|
||||
* @param bool $buggyiconvnomb warn iconv problems
|
||||
* @param array|null $availableupdates array of available_update_info objects or null
|
||||
* @param int|null $availableupdatesfetch timestamp of the most recent updates fetch or null (unknown)
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch,
|
||||
$buggyiconvnomb, $registered) {
|
||||
global $CFG;
|
||||
$cronoverdue, $dbproblems, $maintenancemode) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_info($maturity);
|
||||
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
|
||||
$output .= $this->insecure_dataroot_warning($insecuredataroot);
|
||||
$output .= $this->display_errors_warning($errorsdisplayed);
|
||||
$output .= $this->buggy_iconv_warning($buggyiconvnomb);
|
||||
$output .= $this->cron_overdue_warning($cronoverdue);
|
||||
$output .= $this->db_problems($dbproblems);
|
||||
$output .= $this->maintenance_mode_warning($maintenancemode);
|
||||
$output .= $this->registration_warning($registered);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
|
||||
@@ -333,39 +208,17 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display the plugin management page (admin/plugins.php).
|
||||
*
|
||||
* The filtering options array may contain following items:
|
||||
* bool contribonly - show only contributed extensions
|
||||
* bool updatesonly - show only plugins with an available update
|
||||
*
|
||||
* @param plugin_manager $pluginman
|
||||
* @param available_update_checker $checker
|
||||
* @param array $options filtering options
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function plugin_management_page(plugin_manager $pluginman, available_update_checker $checker, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
public function plugin_management_page(plugin_manager $pluginman) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginsoverview', 'core_admin'));
|
||||
$output .= $this->plugins_overview_panel($pluginman, $options);
|
||||
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$output .= $this->container_start('checkforupdates');
|
||||
$output .= $this->single_button(
|
||||
new moodle_url($this->page->url, array_merge($options, array('fetchremote' => 1))),
|
||||
get_string('checkforupdates', 'core_plugin')
|
||||
);
|
||||
if ($timefetched = $checker->get_last_timefetched()) {
|
||||
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$output .= $this->box($this->plugins_control_panel($pluginman, $options), 'generalbox');
|
||||
$output .= $this->box_start('generalbox');
|
||||
$output .= $this->plugins_control_panel($pluginman);
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
@@ -449,19 +302,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $this->warning(get_string('displayerrorswarning', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if iconv is buggy and mbstring missing.
|
||||
* @param bool $buggyiconvnomb
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function buggy_iconv_warning($buggyiconvnomb) {
|
||||
if (!$buggyiconvnomb) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning(get_string('warningiconvbuggy', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if cron has not been run recently.
|
||||
* @param bool $cronoverdue
|
||||
@@ -534,7 +374,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
|
||||
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
|
||||
'Copyright © 1999 onwards, Martin Dougiamas<br />'.
|
||||
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
|
||||
'and <a href="http://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
|
||||
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -555,123 +395,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $this->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$this->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo maturity'.$maturity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the info about available Moodle core and plugin updates
|
||||
*
|
||||
* The structure of the $updates param has changed since 2.4. It contains not only updates
|
||||
* for the core itself, but also for all other installed plugins.
|
||||
*
|
||||
* @param array|null $updates array of (string)component => array of available_update_info objects or null
|
||||
* @param int|null $fetch timestamp of the most recent updates fetch or null (unknown)
|
||||
* @return string
|
||||
*/
|
||||
protected function available_updates($updates, $fetch) {
|
||||
|
||||
$updateinfo = $this->box_start('generalbox adminwarning availableupdatesinfo');
|
||||
$someupdateavailable = false;
|
||||
if (is_array($updates)) {
|
||||
if (is_array($updates['core'])) {
|
||||
$someupdateavailable = true;
|
||||
$updateinfo .= $this->heading(get_string('updateavailable', 'core_admin'), 3);
|
||||
foreach ($updates['core'] as $update) {
|
||||
$updateinfo .= $this->moodle_available_update_info($update);
|
||||
}
|
||||
}
|
||||
unset($updates['core']);
|
||||
// If something has left in the $updates array now, it is updates for plugins.
|
||||
if (!empty($updates)) {
|
||||
$someupdateavailable = true;
|
||||
$updateinfo .= $this->heading(get_string('updateavailableforplugin', 'core_admin'), 3);
|
||||
$pluginsoverviewurl = new moodle_url('/admin/plugins.php', array('updatesonly' => 1));
|
||||
$updateinfo .= $this->container(get_string('pluginsoverviewsee', 'core_admin',
|
||||
array('url' => $pluginsoverviewurl->out())));
|
||||
}
|
||||
}
|
||||
|
||||
if (!$someupdateavailable) {
|
||||
$now = time();
|
||||
if ($fetch and ($fetch <= $now) and ($now - $fetch < HOURSECS)) {
|
||||
$updateinfo .= $this->heading(get_string('updateavailablenot', 'core_admin'), 3);
|
||||
}
|
||||
}
|
||||
|
||||
$updateinfo .= $this->container_start('checkforupdates');
|
||||
$updateinfo .= $this->single_button(new moodle_url($this->page->url, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||
if ($fetch) {
|
||||
$updateinfo .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($fetch, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$updateinfo .= $this->container_end();
|
||||
|
||||
$updateinfo .= $this->box_end();
|
||||
|
||||
return $updateinfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a warning about not being registered on Moodle.org if necesary.
|
||||
*
|
||||
* @param boolean $registered true if the site is registered on Moodle.org
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function registration_warning($registered) {
|
||||
|
||||
if (!$registered) {
|
||||
|
||||
$registerbutton = $this->single_button(new moodle_url('registration/register.php',
|
||||
array('huburl' => HUB_MOODLEORGHUBURL, 'hubname' => 'Moodle.org')),
|
||||
get_string('register', 'admin'));
|
||||
|
||||
return $this->warning( get_string('registrationwarning', 'admin')
|
||||
. ' ' . $this->help_icon('registration', 'admin') . $registerbutton );
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to render the information about the available Moodle update
|
||||
*
|
||||
* @param available_update_info $updateinfo information about the available Moodle core update
|
||||
*/
|
||||
protected function moodle_available_update_info(available_update_info $updateinfo) {
|
||||
|
||||
$boxclasses = 'moodleupdateinfo';
|
||||
$info = array();
|
||||
|
||||
if (isset($updateinfo->release)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_release', 'core_admin', $updateinfo->release),
|
||||
array('class' => 'info release'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->version)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_version', 'core_admin', $updateinfo->version),
|
||||
array('class' => 'info version'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->maturity)) {
|
||||
$info[] = html_writer::tag('span', get_string('maturity'.$updateinfo->maturity, 'core_admin'),
|
||||
array('class' => 'info maturity'));
|
||||
$boxclasses .= ' maturity'.$updateinfo->maturity;
|
||||
}
|
||||
|
||||
if (isset($updateinfo->download)) {
|
||||
$info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->url)) {
|
||||
$info[] = html_writer::link($updateinfo->url, get_string('updateavailable_moreinfo', 'core_plugin'),
|
||||
array('class' => 'info more'));
|
||||
}
|
||||
|
||||
$box = $this->output->box_start($boxclasses);
|
||||
$box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
|
||||
$box .= $this->output->box_end();
|
||||
|
||||
return $box;
|
||||
'generalbox adminwarning maturityinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -691,7 +415,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
function upgrade_reload($url) {
|
||||
return html_writer::empty_tag('br') .
|
||||
html_writer::tag('div',
|
||||
html_writer::link($url, $this->pix_icon('i/reload', '', '', array('class' => 'icon icon-pre')) .
|
||||
html_writer::link($url, $this->pix_icon('i/reload', '') .
|
||||
get_string('reload'), array('title' => get_string('reload'))),
|
||||
array('class' => 'continuebutton')) . html_writer::empty_tag('br');
|
||||
}
|
||||
@@ -702,24 +426,24 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* This default implementation renders all plugins into one big table. The rendering
|
||||
* options support:
|
||||
* (bool)full = false: whether to display up-to-date plugins, too
|
||||
* (bool)xdep = false: display the plugins with unsatisified dependecies only
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param array $options rendering options
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) {
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$options['full'] = isset($options['full']) ? (bool)$options['full'] : false;
|
||||
$options['xdep'] = isset($options['xdep']) ? (bool)$options['xdep'] : false;
|
||||
if (empty($options)) {
|
||||
$options = array(
|
||||
'full' => false,
|
||||
);
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'plugins-check';
|
||||
@@ -765,7 +489,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$row = new html_table_row();
|
||||
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
|
||||
|
||||
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name, null)) {
|
||||
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
|
||||
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'smallicon pluginicon'));
|
||||
} else {
|
||||
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'smallicon pluginicon noicon'));
|
||||
@@ -788,43 +512,23 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$statuscode = $plugin->get_status();
|
||||
$row->attributes['class'] .= ' status-' . $statuscode;
|
||||
$status = get_string('status_' . $statuscode, 'core_plugin');
|
||||
|
||||
$availableupdates = $plugin->available_updates();
|
||||
if (!empty($availableupdates) and empty($CFG->disableupdatenotifications)) {
|
||||
foreach ($availableupdates as $availableupdate) {
|
||||
$status .= $this->plugin_available_update_info($availableupdate);
|
||||
}
|
||||
}
|
||||
|
||||
$status = new html_table_cell($status);
|
||||
$status = new html_table_cell(get_string('status_' . $statuscode, 'core_plugin'));
|
||||
|
||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
||||
|
||||
$statusisboring = in_array($statuscode, array(
|
||||
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
|
||||
|
||||
$coredependency = $plugin->is_core_dependency_satisfied($version);
|
||||
$otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins());
|
||||
$dependenciesok = $coredependency && $otherpluginsdependencies;
|
||||
|
||||
if ($options['xdep']) {
|
||||
// we want to see only plugins with failed dependencies
|
||||
if ($dependenciesok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
|
||||
// no change is going to happen to the plugin - display it only
|
||||
// if the user wants to see the full list
|
||||
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
||||
$plugin->get_other_required_plugins());
|
||||
if ($isstandard and $statusisboring and $dependenciesok) {
|
||||
if (empty($options['full'])) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$numofhighlighted[$type]++;
|
||||
}
|
||||
|
||||
// ok, the plugin should be displayed
|
||||
$numofhighlighted[$type]++;
|
||||
|
||||
$row->cells = array($displayname, $rootdir, $source,
|
||||
$versiondb, $versiondisk, $requires, $status);
|
||||
$plugintyperows[] = $row;
|
||||
@@ -840,11 +544,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$sumofhighlighted = array_sum($numofhighlighted);
|
||||
|
||||
if ($options['xdep']) {
|
||||
// we do not want to display no heading and links in this mode
|
||||
$out = '';
|
||||
|
||||
} else if ($sumofhighlighted == 0) {
|
||||
if ($sumofhighlighted == 0) {
|
||||
$out = $this->output->container_start('nonehighlighted', 'plugins-check-info');
|
||||
$out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin'));
|
||||
if (empty($options['full'])) {
|
||||
@@ -861,10 +561,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$out .= html_writer::link(new moodle_url('/admin/index.php',
|
||||
array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 1)),
|
||||
get_string('somehighlightedinfo', 'core_plugin'));
|
||||
} else {
|
||||
$out .= html_writer::link(new moodle_url('/admin/index.php',
|
||||
array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 0)),
|
||||
get_string('somehighlightedonly', 'core_plugin'));
|
||||
}
|
||||
$out .= $this->output->container_end();
|
||||
}
|
||||
@@ -878,12 +574,12 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Formats the information that needs to go in the 'Requires' column.
|
||||
* @param plugininfo_base $plugin the plugin we are rendering the row for.
|
||||
* @param plugin_information $plugin the plugin we are rendering the row for.
|
||||
* @param plugin_manager $pluginman provides data on all the plugins.
|
||||
* @param string $version
|
||||
* @return string HTML code
|
||||
*/
|
||||
protected function required_column(plugininfo_base $plugin, plugin_manager $pluginman, $version) {
|
||||
protected function required_column(plugin_information $plugin, plugin_manager $pluginman, $version) {
|
||||
$requires = array();
|
||||
|
||||
if (!empty($plugin->versionrequires)) {
|
||||
@@ -930,127 +626,17 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return html_writer::tag('ul', implode("\n", $requires));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an overview about the plugins - number of installed, number of extensions etc.
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins
|
||||
* @param array $options filtering options
|
||||
* @return string as usually
|
||||
*/
|
||||
public function plugins_overview_panel(plugin_manager $pluginman, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
$numtotal = $numdisabled = $numextension = $numupdatable = 0;
|
||||
|
||||
foreach ($plugininfo as $type => $plugins) {
|
||||
foreach ($plugins as $name => $plugin) {
|
||||
if ($plugin->get_status() === plugin_manager::PLUGIN_STATUS_MISSING) {
|
||||
continue;
|
||||
}
|
||||
$numtotal++;
|
||||
if ($plugin->is_enabled() === false) {
|
||||
$numdisabled++;
|
||||
}
|
||||
if (!$plugin->is_standard()) {
|
||||
$numextension++;
|
||||
}
|
||||
if (empty($CFG->disableupdatenotifications) and $plugin->available_updates()) {
|
||||
$numupdatable++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info = array();
|
||||
$filter = array();
|
||||
$somefilteractive = false;
|
||||
$info[] = html_writer::tag('span', get_string('numtotal', 'core_plugin', $numtotal), array('class' => 'info total'));
|
||||
$info[] = html_writer::tag('span', get_string('numdisabled', 'core_plugin', $numdisabled), array('class' => 'info disabled'));
|
||||
$info[] = html_writer::tag('span', get_string('numextension', 'core_plugin', $numextension), array('class' => 'info extension'));
|
||||
if ($numextension > 0) {
|
||||
if (empty($options['contribonly'])) {
|
||||
$filter[] = html_writer::link(
|
||||
new moodle_url($this->page->url, array('contribonly' => 1)),
|
||||
get_string('filtercontribonly', 'core_plugin'),
|
||||
array('class' => 'filter-item show-contribonly')
|
||||
);
|
||||
} else {
|
||||
$filter[] = html_writer::tag('span', get_string('filtercontribonlyactive', 'core_plugin'),
|
||||
array('class' => 'filter-item active show-contribonly'));
|
||||
$somefilteractive = true;
|
||||
}
|
||||
}
|
||||
if ($numupdatable > 0) {
|
||||
$info[] = html_writer::tag('span', get_string('numupdatable', 'core_plugin', $numupdatable), array('class' => 'info updatable'));
|
||||
if (empty($options['updatesonly'])) {
|
||||
$filter[] = html_writer::link(
|
||||
new moodle_url($this->page->url, array('updatesonly' => 1)),
|
||||
get_string('filterupdatesonly', 'core_plugin'),
|
||||
array('class' => 'filter-item show-updatesonly')
|
||||
);
|
||||
} else {
|
||||
$filter[] = html_writer::tag('span', get_string('filterupdatesonlyactive', 'core_plugin'),
|
||||
array('class' => 'filter-item active show-updatesonly'));
|
||||
$somefilteractive = true;
|
||||
}
|
||||
}
|
||||
if ($somefilteractive) {
|
||||
$filter[] = html_writer::link($this->page->url, get_string('filterall', 'core_plugin'), array('class' => 'filter-item show-all'));
|
||||
}
|
||||
|
||||
$output = $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '', 'plugins-overview-panel');
|
||||
|
||||
if (!empty($filter)) {
|
||||
$output .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $filter), '', 'plugins-overview-filter');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays all known plugins and links to manage them
|
||||
*
|
||||
* This default implementation renders all plugins into one big table.
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param array $options filtering options
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_control_panel(plugin_manager $pluginman, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
public function plugins_control_panel(plugin_manager $pluginman) {
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
// Filter the list of plugins according the options.
|
||||
if (!empty($options['updatesonly'])) {
|
||||
$updateable = array();
|
||||
foreach ($plugininfo as $plugintype => $pluginnames) {
|
||||
foreach ($pluginnames as $pluginname => $pluginfo) {
|
||||
if (!empty($pluginfo->availableupdates)) {
|
||||
foreach ($pluginfo->availableupdates as $pluginavailableupdate) {
|
||||
if ($pluginavailableupdate->version > $pluginfo->versiondisk) {
|
||||
$updateable[$plugintype][$pluginname] = $pluginfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$plugininfo = $updateable;
|
||||
}
|
||||
|
||||
if (!empty($options['contribonly'])) {
|
||||
$contribs = array();
|
||||
foreach ($plugininfo as $plugintype => $pluginnames) {
|
||||
foreach ($pluginnames as $pluginname => $pluginfo) {
|
||||
if (!$pluginfo->is_standard()) {
|
||||
$contribs[$plugintype][$pluginname] = $pluginfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
$plugininfo = $contribs;
|
||||
}
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
return '';
|
||||
}
|
||||
@@ -1059,14 +645,15 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$table->id = 'plugins-control-panel';
|
||||
$table->head = array(
|
||||
get_string('displayname', 'core_plugin'),
|
||||
get_string('systemname', 'core_plugin'),
|
||||
get_string('source', 'core_plugin'),
|
||||
get_string('version', 'core_plugin'),
|
||||
get_string('availability', 'core_plugin'),
|
||||
get_string('actions', 'core_plugin'),
|
||||
get_string('notes','core_plugin'),
|
||||
get_string('settings', 'core_plugin'),
|
||||
get_string('uninstall','core_plugin'),
|
||||
);
|
||||
$table->colclasses = array(
|
||||
'pluginname', 'source', 'version', 'availability', 'actions', 'notes'
|
||||
'displayname', 'systemname', 'source', 'version', 'availability', 'settings', 'uninstall',
|
||||
);
|
||||
|
||||
foreach ($plugininfo as $type => $plugins) {
|
||||
@@ -1092,9 +679,9 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
|
||||
|
||||
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
|
||||
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
|
||||
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'smallicon pluginicon'));
|
||||
} else {
|
||||
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
|
||||
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'smallicon pluginicon noicon'));
|
||||
}
|
||||
if ($plugin->get_status() === plugin_manager::PLUGIN_STATUS_MISSING) {
|
||||
$msg = html_writer::tag('span', get_string('status_missing', 'core_plugin'), array('class' => 'notifyproblem'));
|
||||
@@ -1102,9 +689,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$msg = '';
|
||||
}
|
||||
$pluginname = html_writer::tag('div', $icon . '' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
|
||||
html_writer::tag('div', $plugin->component, array('class' => 'componentname'));
|
||||
$pluginname = new html_table_cell($pluginname);
|
||||
$displayname = $icon . ' ' . $plugin->displayname . ' ' . $msg;
|
||||
$displayname = new html_table_cell($displayname);
|
||||
|
||||
$systemname = new html_table_cell($plugin->type . '_' . $plugin->name);
|
||||
|
||||
if ($plugin->is_standard()) {
|
||||
$row->attributes['class'] .= ' standard';
|
||||
@@ -1121,45 +709,36 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$availability = new html_table_cell('');
|
||||
} else if ($isenabled) {
|
||||
$row->attributes['class'] .= ' enabled';
|
||||
$availability = new html_table_cell(get_string('pluginenabled', 'core_plugin'));
|
||||
$icon = $this->output->pix_icon('i/hide', get_string('pluginenabled', 'core_plugin'));
|
||||
$availability = new html_table_cell($icon . ' ' . get_string('pluginenabled', 'core_plugin'));
|
||||
} else {
|
||||
$row->attributes['class'] .= ' disabled';
|
||||
$availability = new html_table_cell(get_string('plugindisabled', 'core_plugin'));
|
||||
$icon = $this->output->pix_icon('i/show', get_string('plugindisabled', 'core_plugin'));
|
||||
$availability = new html_table_cell($icon . ' ' . get_string('plugindisabled', 'core_plugin'));
|
||||
}
|
||||
|
||||
$actions = array();
|
||||
|
||||
$settingsurl = $plugin->get_settings_url();
|
||||
if (!is_null($settingsurl)) {
|
||||
$actions[] = html_writer::link($settingsurl, get_string('settings', 'core_plugin'), array('class' => 'settings'));
|
||||
if (is_null($settingsurl)) {
|
||||
$settings = new html_table_cell('');
|
||||
} else {
|
||||
$settings = html_writer::link($settingsurl, get_string('settings', 'core_plugin'));
|
||||
$settings = new html_table_cell($settings);
|
||||
}
|
||||
|
||||
$uninstallurl = $plugin->get_uninstall_url();
|
||||
if (!is_null($uninstallurl)) {
|
||||
$actions[] = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'), array('class' => 'uninstall'));
|
||||
}
|
||||
|
||||
$actions = new html_table_cell(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $actions));
|
||||
|
||||
$requriedby = $pluginman->other_plugins_that_require($plugin->component);
|
||||
if ($requriedby) {
|
||||
$requiredby = html_writer::tag('div', get_string('requiredby', 'core_plugin', implode(', ', $requriedby)),
|
||||
array('class' => 'requiredby'));
|
||||
if (is_null($uninstallurl)) {
|
||||
$uninstall = new html_table_cell('');
|
||||
} else if ($requriedby) {
|
||||
$uninstall = new html_table_cell(get_string('requiredby', 'core_plugin', implode(', ', $requriedby)));
|
||||
$uninstall->attributes['class'] = 'requiredby';
|
||||
} else {
|
||||
$requiredby = '';
|
||||
$uninstall = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'));
|
||||
$uninstall = new html_table_cell($uninstall);
|
||||
}
|
||||
|
||||
$updateinfo = '';
|
||||
if (empty($CFG->disableupdatenotifications) and is_array($plugin->available_updates())) {
|
||||
foreach ($plugin->available_updates() as $availableupdate) {
|
||||
$updateinfo .= $this->plugin_available_update_info($availableupdate);
|
||||
}
|
||||
}
|
||||
|
||||
$notes = new html_table_cell($requiredby.$updateinfo);
|
||||
|
||||
$row->cells = array(
|
||||
$pluginname, $source, $version, $availability, $actions, $notes
|
||||
$displayname, $systemname, $source, $version, $availability, $settings, $uninstall
|
||||
);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
@@ -1168,64 +747,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to render the information about the available plugin update
|
||||
*
|
||||
* The passed objects always provides at least the 'version' property containing
|
||||
* the (higher) version of the plugin available.
|
||||
*
|
||||
* @param available_update_info $updateinfo information about the available update for the plugin
|
||||
*/
|
||||
protected function plugin_available_update_info(available_update_info $updateinfo) {
|
||||
|
||||
$boxclasses = 'pluginupdateinfo';
|
||||
$info = array();
|
||||
|
||||
if (isset($updateinfo->release)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_release', 'core_plugin', $updateinfo->release),
|
||||
array('class' => 'info release'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->maturity)) {
|
||||
$info[] = html_writer::tag('span', get_string('maturity'.$updateinfo->maturity, 'core_admin'),
|
||||
array('class' => 'info maturity'));
|
||||
$boxclasses .= ' maturity'.$updateinfo->maturity;
|
||||
}
|
||||
|
||||
if (isset($updateinfo->download)) {
|
||||
$info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->url)) {
|
||||
$info[] = html_writer::link($updateinfo->url, get_string('updateavailable_moreinfo', 'core_plugin'),
|
||||
array('class' => 'info more'));
|
||||
}
|
||||
|
||||
$box = $this->output->box_start($boxclasses);
|
||||
$box .= html_writer::tag('div', get_string('updateavailable', 'core_plugin', $updateinfo->version), array('class' => 'version'));
|
||||
$box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->initialized()) {
|
||||
$impediments = $deployer->deployment_impediments($updateinfo);
|
||||
if (empty($impediments)) {
|
||||
$widget = $deployer->make_confirm_widget($updateinfo);
|
||||
$box .= $this->output->render($widget);
|
||||
} else {
|
||||
if (isset($impediments['notwritable'])) {
|
||||
$box .= $this->output->help_icon('notwritable', 'core_plugin', get_string('notwritable', 'core_plugin'));
|
||||
}
|
||||
if (isset($impediments['notdownloadable'])) {
|
||||
$box .= $this->output->help_icon('notdownloadable', 'core_plugin', get_string('notdownloadable', 'core_plugin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$box .= $this->output->box_end();
|
||||
|
||||
return $box;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will render one beautiful table with all the environmental
|
||||
* configuration and how it suits Moodle needs.
|
||||
|
||||
+12
-60
@@ -1,27 +1,12 @@
|
||||
<?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/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
$repository = optional_param('repos', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
$display = true; // fall through to normal display
|
||||
|
||||
@@ -47,7 +32,7 @@ if ($action == 'newon') {
|
||||
$visible = false;
|
||||
}
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup($pagename);
|
||||
|
||||
$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
|
||||
@@ -57,10 +42,6 @@ $configstr = get_string('manage', 'repository');
|
||||
|
||||
$return = true;
|
||||
|
||||
if (!empty($action)) {
|
||||
require_sesskey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that generates a moodle_url object
|
||||
* relevant to the repository
|
||||
@@ -171,10 +152,10 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
// Display instances list and creation form
|
||||
if ($action == 'edit') {
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(context_system::instance(), $repository);
|
||||
}
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(get_context_instance(CONTEXT_SYSTEM), $repository);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($action == 'show') {
|
||||
@@ -204,8 +185,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
|
||||
if ($repositorytype->delete($downloadcontents)) {
|
||||
if ($repositorytype->delete()) {
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
@@ -213,34 +193,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
exit;
|
||||
} else {
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$message = get_string('confirmremove', 'repository', $repositorytype->get_readablename());
|
||||
|
||||
$output = $OUTPUT->box_start('generalbox', 'notice');
|
||||
$output .= html_writer::tag('p', $message);
|
||||
|
||||
$removeurl = new moodle_url($sesskeyurl);
|
||||
$removeurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos' => $repository,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
|
||||
$removeanddownloadurl = new moodle_url($sesskeyurl);
|
||||
$removeanddownloadurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos'=> $repository,
|
||||
'sure' => 'yes',
|
||||
'downloadcontents' => 1,
|
||||
));
|
||||
|
||||
$output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository'));
|
||||
$output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
$output .= $OUTPUT->single_button($baseurl, get_string('cancel'));
|
||||
$output .= $OUTPUT->box_end();
|
||||
|
||||
echo $output;
|
||||
|
||||
echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&action=delete&repos=' . $repository . '&sure=yes', $baseurl);
|
||||
$return = false;
|
||||
}
|
||||
} else if ($action == 'moveup') {
|
||||
@@ -302,7 +255,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Calculate number of instances in order to display them for the Moodle administrator
|
||||
if (!empty($instanceoptionnames)) {
|
||||
$params = array();
|
||||
$params['context'] = array(context_system::instance());
|
||||
$params['context'] = array(get_system_context());
|
||||
$params['onlyvisible'] = false;
|
||||
$params['type'] = $typename;
|
||||
$admininstancenumber = count(repository::static_function($typename, 'get_instances', $params));
|
||||
@@ -352,7 +305,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
}
|
||||
|
||||
$select = new single_select(repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
|
||||
// Display up/down link
|
||||
$updown = '';
|
||||
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
|
||||
@@ -389,7 +342,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Check that it has not already been listed
|
||||
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'));
|
||||
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,18 @@
|
||||
<?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/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// id of repository
|
||||
$edit = optional_param('edit', 0, PARAM_INT);
|
||||
$new = optional_param('new', '', PARAM_PLUGIN);
|
||||
$new = optional_param('new', '', PARAM_FORMAT);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$delete = optional_param('delete', 0, PARAM_INT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_PLUGIN);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$pagename = 'repositorycontroller';
|
||||
|
||||
@@ -41,20 +24,16 @@ if ($edit){
|
||||
$pagename = 'repositoryinstancenew';
|
||||
}
|
||||
|
||||
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstance.php'));
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
|
||||
|
||||
$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
|
||||
'sesskey'=>sesskey(),
|
||||
'action'=>'edit',
|
||||
));
|
||||
admin_externalpage_setup($pagename);
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey();
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos=';
|
||||
if ($new) {
|
||||
$parenturl->param('repos', $new);
|
||||
} else {
|
||||
$parenturl->param('repos', $type);
|
||||
$baseurl .= $new;
|
||||
}
|
||||
else {
|
||||
$baseurl .= $type;
|
||||
}
|
||||
|
||||
$return = true;
|
||||
@@ -62,9 +41,6 @@ $return = true;
|
||||
if (!empty($edit) || !empty($new)) {
|
||||
if (!empty($edit)) {
|
||||
$instance = repository::get_instance($edit);
|
||||
if ($instance->instance->contextid != $context->id) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
$instancetype = repository::get_type_by_id($instance->options['typeid']);
|
||||
$classname = 'repository_' . $instancetype->get_typename();
|
||||
$configs = $instance->get_instance_option_names();
|
||||
@@ -72,7 +48,7 @@ if (!empty($edit) || !empty($new)) {
|
||||
$typeid = $instance->options['typeid'];
|
||||
} else {
|
||||
$plugin = $new;
|
||||
$typeid = null;
|
||||
$typeid = $new;
|
||||
$instance = null;
|
||||
}
|
||||
|
||||
@@ -81,9 +57,12 @@ if (!empty($edit) || !empty($new)) {
|
||||
// end setup, begin output
|
||||
|
||||
if ($mform->is_cancelled()){
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
exit;
|
||||
} else if ($fromform = $mform->get_data()){
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($edit) {
|
||||
$settings = array();
|
||||
$settings['name'] = $fromform->name;
|
||||
@@ -98,13 +77,13 @@ if (!empty($edit) || !empty($new)) {
|
||||
}
|
||||
$success = $instance->set_option($settings);
|
||||
} else {
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform);
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform);
|
||||
$data = data_submitted();
|
||||
}
|
||||
if ($success) {
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotsaved', 'repository', $parenturl);
|
||||
print_error('instancenotsaved', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -116,50 +95,38 @@ if (!empty($edit) || !empty($new)) {
|
||||
$return = false;
|
||||
}
|
||||
} else if (!empty($hide)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
$instance = repository::get_type_by_typename($hide);
|
||||
$instance->hide();
|
||||
$return = true;
|
||||
} else if (!empty($delete)) {
|
||||
$instance = repository::get_instance($delete);
|
||||
//if you try to delete an instance set as readonly, display an error message
|
||||
if ($instance->readonly) {
|
||||
// If you try to delete an instance set as readonly, display an error message.
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
} else if ($instance->instance->contextid != $context->id) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
}
|
||||
if ($sure) {
|
||||
if ($instance->delete($downloadcontents)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($instance->delete()) {
|
||||
$deletedstr = get_string('instancedeleted', 'repository');
|
||||
redirect($parenturl, $deletedstr, 3);
|
||||
redirect($baseurl, $deletedstr, 3);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $parenturl);
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
$continueurl = new moodle_url($baseurl, array(
|
||||
'type' => $type,
|
||||
'delete' => $delete,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
$continueanddownloadurl = new moodle_url($continueurl, array(
|
||||
'downloadcontents' => 1
|
||||
));
|
||||
$message = get_string('confirmdelete', 'repository', $instance->name);
|
||||
echo html_writer::tag('p', $message);
|
||||
|
||||
echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository'));
|
||||
echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
echo $OUTPUT->single_button($parenturl, get_string('cancel'));
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
|
||||
$return = false;
|
||||
}
|
||||
|
||||
if (!empty($return)) {
|
||||
redirect($parenturl);
|
||||
|
||||
redirect($baseurl);
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -28,7 +28,7 @@ require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
|
||||
|
||||
$mode = required_param('mode', PARAM_ALPHANUMEXT);
|
||||
$mode = required_param('mode', PARAM_ACTION);
|
||||
$classformode = array(
|
||||
'assign' => 'role_allow_assign_page',
|
||||
'override' => 'role_allow_override_page',
|
||||
@@ -41,7 +41,7 @@ if (!isset($classformode[$mode])) {
|
||||
$baseurl = new moodle_url('/admin/roles/allow.php', array('mode'=>$mode));
|
||||
admin_externalpage_setup('defineroles', '', array(), $baseurl);
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
$syscontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/role:manage', $syscontext);
|
||||
|
||||
$controller = new $classformode[$mode]();
|
||||
|
||||
@@ -259,7 +259,7 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
foreach ($assignableroles as $roleid => $notused) {
|
||||
$roleusers = '';
|
||||
if (0 < $assigncounts[$roleid] && $assigncounts[$roleid] <= MAX_USERS_TO_LIST_PER_ROLE) {
|
||||
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname');
|
||||
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.lastname, u.firstname');
|
||||
if (!empty($roleusers)) {
|
||||
$strroleusers = array();
|
||||
foreach ($roleusers as $user) {
|
||||
|
||||
+15
-35
@@ -59,11 +59,16 @@ $courseid = $course->id;
|
||||
$contextname = print_context_name($context);
|
||||
|
||||
// Get the user_selector we will need.
|
||||
// Teachers within a course just get to see the same list of enrolled users.
|
||||
// Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('accesscontext' => $context);
|
||||
$userselector = new role_check_users_selector('reportuser', $options);
|
||||
$userselector->set_rows(20);
|
||||
// Teachers within a course just get to see the same list of people they can
|
||||
// assign roles to. Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('context' => $context, 'roleid' => 0);
|
||||
if (has_capability('moodle/role:manage', $context)) {
|
||||
$userselector = new potential_assignees_course_and_above('reportuser', $options);
|
||||
} else {
|
||||
$userselector = roles_get_potential_user_selector($context, 'reportuser', $options);
|
||||
}
|
||||
$userselector->set_multiselect(false);
|
||||
$userselector->set_rows(10);
|
||||
|
||||
// Work out an appropriate page title.
|
||||
$title = get_string('checkpermissionsin', 'role', $contextname);
|
||||
@@ -99,45 +104,20 @@ switch ($context->contextlevel) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the list of the reported-on user's role assignments - must be after
|
||||
// the page setup code above, or the language might be wrong.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
$roleassignments = get_user_roles_with_special($context, $reportuser->id);
|
||||
$rolenames = role_get_names($context);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
// These are needed early because of tabs.php
|
||||
$assignableroles = get_assignable_roles($context, ROLENAME_BOTH);
|
||||
$overridableroles = get_overridable_roles($context, ROLENAME_BOTH);
|
||||
|
||||
// Print heading.
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
// If a user has been chosen, show all the permissions for this user.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
|
||||
|
||||
if (!empty($roleassignments)) {
|
||||
echo $OUTPUT->heading(get_string('rolesforuser', 'role', fullname($reportuser)), 3);
|
||||
echo html_writer::start_tag('ul');
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
foreach ($roleassignments as $ra) {
|
||||
$racontext = context::instance_by_id($ra->contextid);
|
||||
$link = html_writer::link($racontext->get_url(), $racontext->get_context_name());
|
||||
|
||||
$rolename = $rolenames[$ra->roleid]->localname;
|
||||
if (has_capability('moodle/role:manage', $systemcontext)) {
|
||||
$rolename = html_writer::link(new moodle_url('/admin/roles/define.php',
|
||||
array('action' => 'view', 'roleid' => $ra->roleid)), $rolename);
|
||||
}
|
||||
|
||||
echo html_writer::tag('li', get_string('roleincontext', 'role',
|
||||
array('role' => $rolename, 'context' => $link)));
|
||||
}
|
||||
echo html_writer::end_tag('ul');
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('permissionsforuser', 'role', fullname($reportuser)), 3);
|
||||
|
||||
$table = new check_capability_table($context, $reportuser, $contextname);
|
||||
$table->display();
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
throw new moodle_exception('invalidaccess');
|
||||
}
|
||||
if ($action != 'add') {
|
||||
$roleid = required_param('roleid', PARAM_INT);
|
||||
$roleid = required_param('roleid', PARAM_INTEGER);
|
||||
} else {
|
||||
$roleid = 0;
|
||||
}
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
/// Check access permissions.
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_login();
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
admin_externalpage_setup('defineroles', '', array('action' => $action, 'roleid' => $roleid), $defineurl);
|
||||
|
||||
+62
-201
@@ -256,14 +256,19 @@ class permissions_table extends capability_table_base {
|
||||
* @param string $contextname print_context_name($context) - to save recomputing.
|
||||
*/
|
||||
public function __construct($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles) {
|
||||
global $DB;
|
||||
|
||||
parent::__construct($context, 'permissions');
|
||||
$this->contextname = $contextname;
|
||||
$this->allowoverrides = $allowoverrides;
|
||||
$this->allowsafeoverrides = $allowsafeoverrides;
|
||||
$this->overridableroles = $overridableroles;
|
||||
|
||||
$roles = get_all_roles($context);
|
||||
$this->roles = role_fix_names(array_reverse($roles, true), $context, ROLENAME_ALIAS, true);
|
||||
$roles = $DB->get_records('role', null, 'sortorder DESC');
|
||||
foreach ($roles as $roleid=>$role) {
|
||||
$roles[$roleid] = $role->name;
|
||||
}
|
||||
$this->roles = role_fix_names($roles, $context);
|
||||
|
||||
}
|
||||
|
||||
@@ -588,13 +593,25 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
global $DB;
|
||||
$this->errors = array();
|
||||
|
||||
// Role name.
|
||||
$name = optional_param('name', null, PARAM_MULTILANG);
|
||||
if (!is_null($name)) {
|
||||
$this->role->name = $name;
|
||||
if (html_is_blank($this->role->name)) {
|
||||
$this->errors['name'] = get_string('errorbadrolename', 'role');
|
||||
}
|
||||
}
|
||||
if ($DB->record_exists_select('role', 'name = ? and id <> ?', array($this->role->name, $this->roleid))) {
|
||||
$this->errors['name'] = get_string('errorexistsrolename', 'role');
|
||||
}
|
||||
|
||||
// Role short name. We clean this in a special way. We want to end up
|
||||
// with only lowercase safe ASCII characters.
|
||||
$shortname = optional_param('shortname', null, PARAM_RAW);
|
||||
if (!is_null($shortname)) {
|
||||
$this->role->shortname = $shortname;
|
||||
$this->role->shortname = textlib::specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = textlib::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
$this->role->shortname = textlib_get_instance()->specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = moodle_strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
if (empty($this->role->shortname)) {
|
||||
$this->errors['shortname'] = get_string('errorbadroleshortname', 'role');
|
||||
}
|
||||
@@ -603,20 +620,6 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
$this->errors['shortname'] = get_string('errorexistsroleshortname', 'role');
|
||||
}
|
||||
|
||||
// Role name.
|
||||
$name = optional_param('name', null, PARAM_TEXT);
|
||||
if (!is_null($name)) {
|
||||
$this->role->name = $name;
|
||||
// Hack: short names of standard roles are equal to archetypes, empty name means localised via lang packs.
|
||||
$archetypes = get_role_archetypes();
|
||||
if (!isset($archetypes[$shortname]) and html_is_blank($this->role->name)) {
|
||||
$this->errors['name'] = get_string('errorbadrolename', 'role');
|
||||
}
|
||||
}
|
||||
if ($this->role->name !== '' and $DB->record_exists_select('role', 'name = ? and id <> ?', array($this->role->name, $this->roleid))) {
|
||||
$this->errors['name'] = get_string('errorexistsrolename', 'role');
|
||||
}
|
||||
|
||||
// Description.
|
||||
$description = optional_param('description', null, PARAM_RAW);
|
||||
if (!is_null($description)) {
|
||||
@@ -661,7 +664,7 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
public function make_copy() {
|
||||
$this->roleid = 0;
|
||||
unset($this->role->id);
|
||||
$this->role->name = role_get_name($this->role, null, ROLENAME_ORIGINAL) . ' ' . get_string('copyasnoun');
|
||||
$this->role->name .= ' ' . get_string('copyasnoun');
|
||||
$this->role->shortname .= 'copy';
|
||||
}
|
||||
|
||||
@@ -776,9 +779,9 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
global $OUTPUT;
|
||||
// Extra fields at the top of the page.
|
||||
echo '<div class="topfields clearfix">';
|
||||
$this->print_field('shortname', get_string('roleshortname', 'role').' '.$OUTPUT->help_icon('roleshortname', 'role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('name', get_string('customrolename', 'role').' '.$OUTPUT->help_icon('customrolename', 'role'), $this->get_name_field('name'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'role').' '.$OUTPUT->help_icon('customroledescription', 'role'), $this->get_description_field('description'));
|
||||
$this->print_field('name', get_string('rolefullname', 'role'), $this->get_name_field('name'));
|
||||
$this->print_field('shortname', get_string('roleshortname', 'role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('edit-description', get_string('description'), $this->get_description_field('description'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'role').' '.$OUTPUT->help_icon('archetype', 'role'), $this->get_archetype_field('archetype'));
|
||||
$this->print_field('', get_string('maybeassignedin', 'role'), $this->get_assignable_levels_control());
|
||||
echo "</div>";
|
||||
@@ -859,7 +862,7 @@ class view_role_definition_table extends define_role_table_advanced {
|
||||
}
|
||||
|
||||
protected function get_name_field($id) {
|
||||
return role_get_name($this->role);
|
||||
return strip_tags(format_string($this->role->name));
|
||||
}
|
||||
|
||||
protected function get_shortname_field($id) {
|
||||
@@ -867,7 +870,7 @@ class view_role_definition_table extends define_role_table_advanced {
|
||||
}
|
||||
|
||||
protected function get_description_field($id) {
|
||||
return role_get_description($this->role);
|
||||
return format_text($this->role->description, FORMAT_HTML);
|
||||
}
|
||||
|
||||
protected function get_archetype_field($id) {
|
||||
@@ -933,7 +936,7 @@ class override_permissions_table_advanced extends capability_table_with_risks {
|
||||
global $DB;
|
||||
|
||||
/// Get the capabilities from the parent context, so that can be shown in the interface.
|
||||
$parentcontext = context::instance_by_id(get_parent_contextid($this->context));
|
||||
$parentcontext = get_context_instance_by_id(get_parent_contextid($this->context));
|
||||
$this->parentpermissions = role_context_capabilities($this->roleid, $parentcontext);
|
||||
}
|
||||
|
||||
@@ -996,7 +999,7 @@ abstract class role_assign_user_selector_base extends user_selector_base {
|
||||
if (isset($options['context'])) {
|
||||
$this->context = $options['context'];
|
||||
} else {
|
||||
$this->context = context::instance_by_id($options['contextid']);
|
||||
$this->context = get_context_instance_by_id($options['contextid']);
|
||||
}
|
||||
$options['accesscontext'] = $this->context;
|
||||
parent::__construct($name, $options);
|
||||
@@ -1039,16 +1042,17 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
$countfields = 'SELECT COUNT(u.id)';
|
||||
|
||||
$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";
|
||||
WHERE u.id IN ($enrolsql) $wherecondition
|
||||
AND u.id NOT IN (
|
||||
SELECT r.userid
|
||||
FROM {role_assignments} r
|
||||
WHERE r.contextid = :contextid
|
||||
AND r.roleid = :roleid)";
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$params['contextid'] = $this->context->id;
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
// Check to see if there are too many to show sensibly.
|
||||
if (!$this->is_validating()) {
|
||||
$potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
@@ -1058,7 +1062,7 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
}
|
||||
|
||||
// If not, show them.
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1074,135 +1078,6 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the selection of users in the check permissions page.
|
||||
*
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
*/
|
||||
class role_check_users_selector extends user_selector_base {
|
||||
const MAX_ENROLLED_PER_PAGE = 100;
|
||||
const MAX_POTENTIAL_PER_PAGE = 100;
|
||||
|
||||
/** @var bool limit listing of users to enrolled only */
|
||||
var $onlyenrolled;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name the control name/id for use in the HTML.
|
||||
* @param array $options other options needed to construct this selector.
|
||||
* You must be able to clone a userselector by doing new get_class($us)($us->get_name(), $us->get_options());
|
||||
*/
|
||||
public function __construct($name, $options) {
|
||||
if (!isset($options['multiselect'])) {
|
||||
$options['multiselect'] = false;
|
||||
}
|
||||
parent::__construct($name, $options);
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
if ($coursecontext and $coursecontext->id != SITEID and !has_capability('moodle/role:manage', $coursecontext)) {
|
||||
// Prevent normal teachers from looking up all users.
|
||||
$this->onlyenrolled = true;
|
||||
} else {
|
||||
$this->onlyenrolled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
global $DB;
|
||||
|
||||
list($wherecondition, $params) = $this->search_sql($search, 'u');
|
||||
|
||||
$fields = 'SELECT ' . $this->required_fields_sql('u');
|
||||
$countfields = 'SELECT COUNT(1)';
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
|
||||
if ($coursecontext and $coursecontext != SITEID) {
|
||||
$sql1 = " FROM {user} u
|
||||
JOIN {user_enrolments} ue ON (ue.userid = u.id)
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
|
||||
WHERE $wherecondition";
|
||||
$params['courseid1'] = $coursecontext->instanceid;
|
||||
|
||||
if ($this->onlyenrolled) {
|
||||
$sql2 = null;
|
||||
} else {
|
||||
$sql2 = " FROM {user} u
|
||||
LEFT JOIN ({user_enrolments} ue
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid2)) ON (ue.userid = u.id)
|
||||
WHERE $wherecondition
|
||||
AND ue.id IS NULL";
|
||||
$params['courseid2'] = $coursecontext->instanceid;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($this->onlyenrolled) {
|
||||
// Bad luck, current user may not view only enrolled users.
|
||||
return array();
|
||||
}
|
||||
$sql1 = null;
|
||||
$sql2 = " FROM {user} u
|
||||
WHERE $wherecondition";
|
||||
}
|
||||
|
||||
$params['contextid'] = $this->accesscontext->id;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
$result = array();
|
||||
|
||||
if ($search) {
|
||||
$groupname1 = get_string('enrolledusersmatching', 'enrol', $search);
|
||||
$groupname2 = get_string('potusersmatching', 'role', $search);
|
||||
} else {
|
||||
$groupname1 = get_string('enrolledusers', 'enrol');
|
||||
$groupname2 = get_string('potusers', 'role');
|
||||
}
|
||||
|
||||
if ($sql1) {
|
||||
$enrolleduserscount = $DB->count_records_sql($countfields . $sql1, $params);
|
||||
if (!$this->is_validating() and $enrolleduserscount > $this::MAX_ENROLLED_PER_PAGE) {
|
||||
$result[$groupname1] = array();
|
||||
$toomany = $this->too_many_results($search, $enrolleduserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
|
||||
} else {
|
||||
$enrolledusers = $DB->get_records_sql($fields . $sql1 . $order, array_merge($params, $sortparams));
|
||||
if ($enrolledusers) {
|
||||
$result[$groupname1] = $enrolledusers;
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$result[''] = array();
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$otheruserscount = $DB->count_records_sql($countfields . $sql2, $params);
|
||||
if (!$this->is_validating() and $otheruserscount > $this::MAX_POTENTIAL_PER_PAGE) {
|
||||
$result[$groupname2] = array();
|
||||
$toomany = $this->too_many_results($search, $otheruserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
} else {
|
||||
$otherusers = $DB->get_records_sql($fields . $sql2 . $order, array_merge($params, $sortparams));
|
||||
if ($otherusers) {
|
||||
$result[$groupname2] = $otherusers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function get_options() {
|
||||
global $CFG;
|
||||
$options = parent::get_options();
|
||||
$options['file'] = $CFG->admin . '/roles/lib.php';
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the list of potential users on the assign roles page,
|
||||
* when we are assigning in a context at or above the course level. In this case we
|
||||
@@ -1224,9 +1099,7 @@ class potential_assignees_course_and_above extends role_assign_user_selector_bas
|
||||
FROM {role_assignments} r
|
||||
WHERE r.contextid = :contextid
|
||||
AND r.roleid = :roleid)";
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$params['contextid'] = $this->context->id;
|
||||
$params['roleid'] = $this->roleid;
|
||||
@@ -1238,7 +1111,7 @@ class potential_assignees_course_and_above extends role_assign_user_selector_bas
|
||||
}
|
||||
}
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1272,9 +1145,6 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
$params = array_merge($params, $ctxparams);
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$params = array_merge($params, $sortparams);
|
||||
|
||||
$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
|
||||
@@ -1283,7 +1153,7 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
$wherecondition AND
|
||||
ctx.id $ctxcondition AND
|
||||
ra.roleid = :roleid
|
||||
ORDER BY ctx.depth DESC, ra.component, $sort";
|
||||
ORDER BY ctx.depth DESC, ra.component, u.lastname, u.firstname";
|
||||
$contextusers = $DB->get_records_sql($sql, $params);
|
||||
|
||||
// No users at all.
|
||||
@@ -1365,7 +1235,7 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
}
|
||||
|
||||
protected function parent_con_group_name($search, $contextid) {
|
||||
$context = context::instance_by_id($contextid);
|
||||
$context = get_context_instance_by_id($contextid);
|
||||
$contextname = print_context_name($context, true, true);
|
||||
if ($search) {
|
||||
$a = new stdClass;
|
||||
@@ -1403,7 +1273,8 @@ abstract class role_allow_role_page {
|
||||
*/
|
||||
protected function load_required_roles() {
|
||||
/// Get all roles
|
||||
$this->roles = role_fix_names(get_all_roles(), context_system::instance(), ROLENAME_ORIGINAL);
|
||||
$this->roles = get_all_roles();
|
||||
role_fix_names($this->roles, get_context_instance(CONTEXT_SYSTEM), ROLENAME_ORIGINAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1612,7 +1483,7 @@ class role_allow_switch_page extends role_allow_role_page {
|
||||
function roles_get_potential_user_selector($context, $name, $options) {
|
||||
$blockinsidecourse = false;
|
||||
if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
$parentcontext = context::instance_by_id(get_parent_contextid($context));
|
||||
$parentcontext = get_context_instance_by_id(get_parent_contextid($context));
|
||||
$blockinsidecourse = in_array($parentcontext->contextlevel, array(CONTEXT_MODULE, CONTEXT_COURSE));
|
||||
}
|
||||
|
||||
@@ -1630,14 +1501,10 @@ class admins_potential_selector extends user_selector_base {
|
||||
* @param string $name control name
|
||||
* @param array $options should have two elements with keys groupid and courseid.
|
||||
*/
|
||||
public function __construct($name = null, $options = array()) {
|
||||
global $CFG;
|
||||
if (is_null($name)) {
|
||||
$name = 'addselect';
|
||||
}
|
||||
$options['multiselect'] = false;
|
||||
$options['exclude'] = explode(',', $CFG->siteadmins);
|
||||
parent::__construct($name, $options);
|
||||
public function __construct() {
|
||||
global $CFG, $USER;
|
||||
$admins = explode(',', $CFG->siteadmins);
|
||||
parent::__construct('addselect', array('multiselect'=>false, 'exclude'=>$admins));
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
@@ -1649,12 +1516,9 @@ class admins_potential_selector extends user_selector_base {
|
||||
|
||||
$sql = " FROM {user}
|
||||
WHERE $wherecondition AND mnethostid = :localmnet";
|
||||
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
$params['localmnet'] = $CFG->mnet_localhost_id; // it could be dangerous to make remote users admins and also this could lead to other problems
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
// Check to see if there are too many to show sensibly.
|
||||
if (!$this->is_validating()) {
|
||||
$potentialcount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
@@ -1663,7 +1527,7 @@ class admins_potential_selector extends user_selector_base {
|
||||
}
|
||||
}
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1691,12 +1555,9 @@ class admins_existing_selector extends user_selector_base {
|
||||
* @param string $name control name
|
||||
* @param array $options should have two elements with keys groupid and courseid.
|
||||
*/
|
||||
public function __construct($name = null, $options = array()) {
|
||||
if (is_null($name)) {
|
||||
$name = 'removeselect';
|
||||
}
|
||||
$options['multiselect'] = false;
|
||||
parent::__construct($name, $options);
|
||||
public function __construct() {
|
||||
global $CFG, $USER;
|
||||
parent::__construct('removeselect', array('multiselect'=>false));
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
@@ -1713,10 +1574,7 @@ class admins_existing_selector extends user_selector_base {
|
||||
}
|
||||
$sql = " FROM {user}
|
||||
WHERE $wherecondition";
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$params = array_merge($params, $sortparams);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
@@ -1725,10 +1583,13 @@ class admins_existing_selector extends user_selector_base {
|
||||
}
|
||||
|
||||
$mainadmin = array();
|
||||
$mainadminuser = get_admin();
|
||||
if ($mainadminuser && isset($availableusers[$mainadminuser->id])) {
|
||||
$mainadmin = array($mainadminuser->id => $availableusers[$mainadminuser->id]);
|
||||
unset($availableusers[$mainadminuser->id]);
|
||||
$adminids = explode(',', $CFG->siteadmins);
|
||||
foreach ($adminids as $id) {
|
||||
if (isset($availableusers[$id])) {
|
||||
$mainadmin = array($id=>$availableusers[$id]);
|
||||
unset($availableusers[$id]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
@@ -47,13 +47,14 @@
|
||||
$defineurl = $CFG->wwwroot . '/' . $CFG->admin . '/roles/define.php';
|
||||
|
||||
/// Check access permissions.
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_login();
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
admin_externalpage_setup('defineroles');
|
||||
|
||||
/// Get some basic data we are going to need.
|
||||
$roles = role_fix_names(get_all_roles(), $systemcontext, ROLENAME_ORIGINAL);
|
||||
$roles = get_all_roles();
|
||||
role_fix_names($roles, $systemcontext, ROLENAME_ORIGINAL);
|
||||
|
||||
$undeletableroles = array();
|
||||
$undeletableroles[$CFG->notloggedinroleid] = 1;
|
||||
@@ -213,7 +214,7 @@
|
||||
/// Basic data.
|
||||
$row = array(
|
||||
'<a href="' . $defineurl . '?action=view&roleid=' . $role->id . '">' . $role->localname . '</a>',
|
||||
role_get_description($role),
|
||||
format_text($role->description, FORMAT_HTML),
|
||||
s($role->shortname),
|
||||
'',
|
||||
);
|
||||
|
||||
@@ -50,10 +50,8 @@ if ($course) {
|
||||
|
||||
// security first
|
||||
require_login($course, false, $cm);
|
||||
$safeoverridesonly = false;
|
||||
if (!has_capability('moodle/role:override', $context)) {
|
||||
require_capability('moodle/role:safeoverride', $context);
|
||||
$safeoverridesonly = true;
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
@@ -121,7 +119,7 @@ if (empty($overridableroles[$roleid])) {
|
||||
}
|
||||
|
||||
// If we are actually overriding a role, create the table object, and save changes if appropriate.
|
||||
$overridestable = new override_permissions_table_advanced($context, $roleid, $safeoverridesonly);
|
||||
$overridestable = new override_permissions_table_advanced($context, $roleid, false);
|
||||
$overridestable->read_submitted_permissions();
|
||||
|
||||
if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
|
||||
|
||||
+22
-26
@@ -36,9 +36,9 @@ $courseid = required_param('courseid', PARAM_INT);
|
||||
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
|
||||
|
||||
$usercontext = context_user::instance($user->id);
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$systemcontext = context_system::instance();
|
||||
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$baseurl = new moodle_url('/admin/roles/usersroles.php', array('userid'=>$userid, 'courseid'=>$courseid));
|
||||
|
||||
@@ -54,25 +54,17 @@ if (!$canview) {
|
||||
print_error('nopermissions', 'error', '', get_string('checkpermissions', 'role'));
|
||||
}
|
||||
|
||||
if ($userid != $USER->id) {
|
||||
// If its not the current user we need to extend the navigation for that user to ensure
|
||||
// their navigation is loaded and this page found upon it.
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
}
|
||||
if ($course->id != $SITE->id || $userid != $USER->id) {
|
||||
// If we're within a course OR if we're viewing another user then we need to include the
|
||||
// settings base on the navigation to ensure that the navbar will contain the users name.
|
||||
$PAGE->navbar->includesettingsbase = true;
|
||||
}
|
||||
|
||||
/// Now get the role assignments for this user.
|
||||
$sql = "SELECT
|
||||
ra.id, ra.userid, ra.contextid, ra.roleid, ra.component, ra.itemid,
|
||||
c.path
|
||||
c.path,
|
||||
r.name AS rolename,
|
||||
COALESCE(rn.name, r.name) AS localname
|
||||
FROM
|
||||
{role_assignments} ra
|
||||
JOIN {context} c ON ra.contextid = c.id
|
||||
JOIN {role} r ON ra.roleid = r.id
|
||||
LEFT JOIN {role_names} rn ON rn.roleid = ra.roleid AND rn.contextid = ra.contextid
|
||||
WHERE
|
||||
ra.userid = ?
|
||||
"./*AND ra.active = 1*/"
|
||||
@@ -80,8 +72,6 @@ $sql = "SELECT
|
||||
contextlevel DESC, contextid ASC, r.sortorder ASC";
|
||||
$roleassignments = $DB->get_records_sql($sql, array($user->id));
|
||||
|
||||
$allroles = role_fix_names(get_all_roles());
|
||||
|
||||
/// In order to display a nice tree of contexts, we need to get all the
|
||||
/// ancestors of all the contexts in the query we just did.
|
||||
$requiredcontexts = array();
|
||||
@@ -130,9 +120,14 @@ $title = get_string('xroleassignments', 'role', $fullname);
|
||||
$PAGE->set_title($title);
|
||||
if ($courseid != SITEID) {
|
||||
$PAGE->set_heading($fullname);
|
||||
if (has_capability('moodle/course:viewparticipants', $coursecontext)) {
|
||||
$PAGE->navbar->add(get_string('participants'),new moodle_url('/user/index.php', array('id'=>$courseid)));
|
||||
}
|
||||
} else {
|
||||
$PAGE->set_heading($course->fullname);
|
||||
}
|
||||
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
|
||||
$PAGE->navbar->add($straction);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title, 3);
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
|
||||
@@ -141,14 +136,14 @@ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
|
||||
if (!$roleassignments) {
|
||||
echo '<p>', get_string('noroleassignments', 'role'), '</p>';
|
||||
} else {
|
||||
print_report_tree($systemcontext->id, $contexts, $systemcontext, $fullname, $allroles);
|
||||
print_report_tree($systemcontext->id, $contexts, $systemcontext, $fullname);
|
||||
}
|
||||
|
||||
/// End of page.
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $allroles) {
|
||||
function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// Only compute lang strings, etc once.
|
||||
@@ -165,18 +160,19 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
$context = context::instance_by_id($contextid);
|
||||
|
||||
// Print the context name.
|
||||
echo $OUTPUT->heading(html_writer::link($context->get_url(), $context->get_context_name()),
|
||||
4, 'contextname');
|
||||
echo $OUTPUT->heading($context->get_context_name(), 4, 'contextname');
|
||||
|
||||
// If there are any role assignments here, print them.
|
||||
foreach ($contexts[$contextid]->roleassignments as $ra) {
|
||||
$role = $allroles[$ra->roleid];
|
||||
|
||||
$value = $ra->contextid . ',' . $ra->roleid;
|
||||
$inputid = 'unassign' . $value;
|
||||
|
||||
echo '<p>';
|
||||
echo $role->localname;
|
||||
if ($ra->rolename == $ra->localname) {
|
||||
echo strip_tags(format_string($ra->localname));
|
||||
} else {
|
||||
echo strip_tags(format_string($ra->localname . ' (' . $ra->rolename . ')'));
|
||||
}
|
||||
if (has_capability('moodle/role:assign', $context)) {
|
||||
$raurl = $assignurl . '?contextid=' . $ra->contextid . '&roleid=' .
|
||||
$ra->roleid . '&removeselect[]=' . $ra->userid;
|
||||
@@ -187,7 +183,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->fullname = $fullname;
|
||||
$a->contextlevel = $context->get_level_name();
|
||||
$a->contextlevel = get_contextlevel_name($context->contextlevel);
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM) {
|
||||
$strgoto = get_string('gotoassignsystemroles', 'role');
|
||||
$strcheck = get_string('checksystempermissionsfor', 'role', $a);
|
||||
@@ -208,7 +204,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
echo '<ul>';
|
||||
foreach ($contexts[$contextid]->children as $childcontextid) {
|
||||
echo '<li>';
|
||||
print_report_tree($childcontextid, $contexts, $systemcontext, $fullname, $allroles);
|
||||
print_report_tree($childcontextid, $contexts, $systemcontext, $fullname);
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
|
||||
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
|
||||
|
||||
|
||||
+5
-9
@@ -9,7 +9,7 @@ $adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
/// no guest autologin
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
$PAGE->set_url('/admin/settings.php', array('section' => $section));
|
||||
$PAGE->set_pagetype('admin-setting-' . $section);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
@@ -32,6 +32,7 @@ if (!($settingspage->check_access())) {
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
$focus = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
@@ -46,6 +47,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
$focus = $firsterror->id;
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($section, true);
|
||||
@@ -131,12 +133,6 @@ if (empty($SITE->fullname)) {
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$PAGE->requires->yui_module('moodle-core-formchangechecker',
|
||||
'M.core_formchangechecker.init',
|
||||
array(array(
|
||||
'formid' => 'adminsettings'
|
||||
))
|
||||
);
|
||||
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
|
||||
+83
-136
@@ -4,30 +4,30 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
||||
$ADMIN->add('appearance', new admin_category('themes', get_string('themes')));
|
||||
// "themesettings" settingpage
|
||||
$temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
|
||||
$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);
|
||||
$temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configcheckbox('themedesignermode', get_string('themedesignermode', 'admin'), get_string('configthemedesignermode', 'admin'), 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserthemes', new lang_string('allowuserthemes', 'admin'), new lang_string('configallowuserthemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', new lang_string('allowcoursethemes', 'admin'), new lang_string('configallowcoursethemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', new lang_string('allowcategorythemes', 'admin'), new lang_string('configallowcategorythemes', 'admin'), 0));
|
||||
$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_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'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', get_string('allowthemechangeonurl', 'admin'), get_string('configallowthemechangeonurl', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('allowblockstodock', get_string('allowblockstodock', 'admin'), get_string('configallowblockstodock', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', get_string('custommenuitems', 'admin'), get_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
|
||||
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', get_string('enabledevicedetection', 'admin'), get_string('configenabledevicedetection', 'admin'), 1));
|
||||
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', get_string('devicedetectregex', 'admin'), get_string('devicedetectregex_desc', 'admin'), ''));
|
||||
$ADMIN->add('themes', $temp);
|
||||
$ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
|
||||
$ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
|
||||
|
||||
// settings for each theme
|
||||
foreach (get_plugin_list('theme') as $theme => $themedir) {
|
||||
$settings_path = "$themedir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
$settings = new admin_settingpage('themesetting'.$theme, new lang_string('pluginname', 'theme_'.$theme));
|
||||
$settings = new admin_settingpage('themesetting'.$theme, get_string('pluginname', 'theme_'.$theme));
|
||||
include($settings_path);
|
||||
if ($settings) {
|
||||
$ADMIN->add('themes', $settings);
|
||||
@@ -37,174 +37,121 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// calendar
|
||||
$temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
|
||||
$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
|
||||
$temp->add(new admin_setting_special_adminseesall());
|
||||
//this is hacky because we do not want to include the stuff from calendar/lib.php
|
||||
$temp->add(new admin_setting_configselect('calendar_site_timeformat', new lang_string('pref_timeformat', 'calendar'),
|
||||
new lang_string('explain_site_timeformat', 'calendar'), '0',
|
||||
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'), 0,
|
||||
$temp->add(new admin_setting_configselect('calendar_site_timeformat', get_string('pref_timeformat', 'calendar'),
|
||||
get_string('explain_site_timeformat', 'calendar'), '0',
|
||||
array('0' => get_string('default', 'calendar'),
|
||||
'%I:%M %p' => get_string('timeformat_12', 'calendar'),
|
||||
'%H:%M' => get_string('timeformat_24', 'calendar'))));
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0,
|
||||
array(
|
||||
0 => new lang_string('sunday', 'calendar'),
|
||||
1 => new lang_string('monday', 'calendar'),
|
||||
2 => new lang_string('tuesday', 'calendar'),
|
||||
3 => new lang_string('wednesday', 'calendar'),
|
||||
4 => new lang_string('thursday', 'calendar'),
|
||||
5 => new lang_string('friday', 'calendar'),
|
||||
6 => new lang_string('saturday', 'calendar')
|
||||
0 => get_string('sunday', 'calendar'),
|
||||
1 => get_string('monday', 'calendar'),
|
||||
2 => get_string('tuesday', 'calendar'),
|
||||
3 => get_string('wednesday', 'calendar'),
|
||||
4 => get_string('thursday', 'calendar'),
|
||||
5 => get_string('friday', 'calendar'),
|
||||
6 => get_string('saturday', 'calendar')
|
||||
)));
|
||||
$temp->add(new admin_setting_special_calendar_weekend());
|
||||
$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));
|
||||
$temp->add(new admin_setting_configselect('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,$options));
|
||||
$options = array();
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('calendar_maxevents',new lang_string('configmaxevents','admin'),new lang_string('helpupcomingmaxevents', 'admin'),10,$options));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', new lang_string('enablecalendarexport', 'admin'), new lang_string('configenablecalendarexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('calendar_exportsalt', new lang_string('calendarexportsalt','admin'), new lang_string('configcalendarexportsalt', 'admin'), random_string(60)));
|
||||
$temp->add(new admin_setting_configselect('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,$options));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60)));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// blog
|
||||
$temp = new admin_settingpage('blog', new lang_string('blog','blog'), 'moodle/site:config', empty($CFG->enableblogs));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => new lang_string('personalblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => new lang_string('numhours', '', 12),
|
||||
86400 => new lang_string('numhours', '', 24),
|
||||
172800 => new lang_string('numdays', '', 2),
|
||||
604800 => new lang_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
|
||||
$temp = new admin_settingpage('blog', get_string('blog','blog'));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', get_string('useblogassociations', 'blog'), get_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'), get_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => get_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => get_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', get_string('useexternalblogs', 'blog'), get_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', get_string('externalblogcrontime', 'blog'), get_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => get_string('numhours', '', 12),
|
||||
86400 => get_string('numhours', '', 24),
|
||||
172800 => get_string('numdays', '', 2),
|
||||
604800 => get_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', get_string('showcommentscount', 'admin'), get_string('configshowcommentscount', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// Navigation settings
|
||||
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
|
||||
$temp = new admin_settingpage('navigation', get_string('navigation'));
|
||||
$choices = array(
|
||||
HOMEPAGE_SITE => new lang_string('site'),
|
||||
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
|
||||
HOMEPAGE_SITE => get_string('site'),
|
||||
HOMEPAGE_MY => get_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => get_string('userpreference', 'admin')
|
||||
);
|
||||
$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('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
|
||||
$sortoptions = array(
|
||||
'sortorder' => new lang_string('sort_sortorder', 'admin'),
|
||||
'fullname' => new lang_string('sort_fullname', 'admin'),
|
||||
'shortname' => new lang_string('sort_shortname', 'admin'),
|
||||
'idnumber' => new lang_string('sort_idnumber', 'admin'),
|
||||
);
|
||||
$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'), 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));
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', get_string('defaulthomepage', 'admin'), get_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',get_string('navcourselimit','admin'),get_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('navlinkcoursesections', get_string('navlinkcoursesections', 'admin'), get_string('navlinkcoursesections_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', get_string('usesitenameforsitepages', 'admin'), get_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', get_string('navadduserpostslinks', 'admin'), get_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// "htmlsettings" settingpage
|
||||
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp->add(new admin_setting_emoticons());
|
||||
$ADMIN->add('appearance', $temp);
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', get_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));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
|
||||
$temp = new admin_settingpage('documentation', get_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', get_string('doctonewwindow', 'admin'), get_string('configdoctonewwindow', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$temp = new admin_externalpage('mypage', get_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$temp = new admin_externalpage('profilepage', get_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
|
||||
$temp = new admin_settingpage('coursecontact', new lang_string('courses'));
|
||||
$temp = new admin_settingpage('coursecontact', get_string('courses'));
|
||||
$temp->add(new admin_setting_special_coursecontact());
|
||||
$temp->add(new admin_setting_configcheckbox('courselistshortnames',
|
||||
new lang_string('courselistshortnames', 'admin'),
|
||||
new lang_string('courselistshortnames_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', new lang_string('coursesperpage', 'admin'), new lang_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('courseswithsummarieslimit', new lang_string('courseswithsummarieslimit', 'admin'), new lang_string('configcourseswithsummarieslimit', 'admin'), 10, PARAM_INT));
|
||||
get_string('courselistshortnames', 'admin'),
|
||||
get_string('courselistshortnames_desc', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
|
||||
$setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
|
||||
$temp = new admin_settingpage('ajax', get_string('ajaxuse'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalyui', get_string('useexternalyui', 'admin'), get_string('configuseexternalyui', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('yuicomboloading', get_string('yuicomboloading', 'admin'), get_string('configyuicomboloading', 'admin'), 1));
|
||||
$setting = new admin_setting_configcheckbox('cachejs', get_string('cachejs', 'admin'), get_string('cachejs_help', 'admin'), 1);
|
||||
$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('enablecourseajax', get_string('enablecourseajax', 'admin'),
|
||||
get_string('enablecourseajax_desc', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// link to tag management interface
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
|
||||
|
||||
$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')));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp = new admin_settingpage('additionalhtml', get_string('additionalhtml', 'admin'));
|
||||
$temp->add(new admin_setting_heading('additionalhtml_heading', get_string('additionalhtml_heading', 'admin'), get_string('additionalhtml_desc', 'admin')));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlhead', get_string('additionalhtmlhead', 'admin'), get_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', get_string('additionalhtmltopofbody', 'admin'), get_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlfooter', get_string('additionalhtmlfooter', 'admin'), get_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+84
-135
@@ -8,154 +8,123 @@ if ($hassiteconfig
|
||||
or has_capability('moodle/course:create', $systemcontext)
|
||||
or has_capability('moodle/site:approvecourse', $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
|
||||
array('moodle/category:manage', 'moodle/course:create')));
|
||||
|
||||
/// Course Default Settings Page
|
||||
/// NOTE: these settings must be applied after all other settings because they depend on them
|
||||
///main course settings
|
||||
$temp = new admin_settingpage('coursesettings', new lang_string('coursesettings'));
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
$courseformats = get_sorted_course_formats(true);
|
||||
$temp = new admin_settingpage('coursesettings', get_string('coursesettings'));
|
||||
$courseformats = get_plugin_list('format');
|
||||
$formcourseformats = array();
|
||||
foreach ($courseformats as $courseformat) {
|
||||
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
||||
foreach ($courseformats as $courseformat => $courseformatdir) {
|
||||
$formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat");
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', get_string('format'), get_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'), new lang_string('maxnumberweeks_desc'), 52));
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', get_string('maxnumberweeks'), get_string('maxnumberweeks_desc'), 52));
|
||||
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'), new lang_string('coursehelpnumberweeks'), 10));
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', get_string('numberweeks'), get_string('coursehelpnumberweeks'), 10));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
||||
$choices['1'] = new lang_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'), new lang_string('coursehelphiddensections'), 0,$choices));
|
||||
$choices['0'] = get_string('hiddensectionscollapsed');
|
||||
$choices['1'] = get_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', get_string('hiddensections'), get_string('coursehelphiddensections'), 0,$choices));
|
||||
$options = range(0, 10);
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', new lang_string('newsitemsnumber'), new lang_string('coursehelpnewsitemsnumber'), 5,$options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'), new lang_string('coursehelpshowgrades'), 1,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', get_string('newsitemsnumber'), get_string('coursehelpnewsitemsnumber'), 5,$options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', get_string('showgrades'), get_string('coursehelpshowgrades'), 1,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', get_string('showreports'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
|
||||
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
||||
if (isset($CFG->maxbytes)) {
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
} else {
|
||||
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
||||
$choices = get_max_upload_sizes();
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'), new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', get_string('maximumupload'), get_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
if (!empty($CFG->legacyfilesinnewcourses)) {
|
||||
$choices = array('0'=>new lang_string('no'), '2'=>new lang_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'), new lang_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
$choices = array('0'=>get_string('no'), '2'=>get_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', get_string('courselegacyfiles'), get_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_heading('groups', get_string('groups', 'group'), ''));
|
||||
$choices = array();
|
||||
$choices[COURSE_DISPLAY_SINGLEPAGE] = new lang_string('coursedisplay_single');
|
||||
$choices[COURSE_DISPLAY_MULTIPAGE] = new lang_string('coursedisplay_multi');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'), new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
||||
$choices[NOGROUPS] = get_string('groupsnone', 'group');
|
||||
$choices[SEPARATEGROUPS] = get_string('groupsseparate', 'group');
|
||||
$choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', get_string('groupmode'), '', key($choices),$choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', get_string('force'), get_string('coursehelpforce'), 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
|
||||
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
||||
|
||||
$temp->add(new admin_setting_heading('availability', get_string('availability'), ''));
|
||||
$choices = array();
|
||||
$choices[NOGROUPS] = new lang_string('groupsnone', 'group');
|
||||
$choices[SEPARATEGROUPS] = new lang_string('groupsseparate', 'group');
|
||||
$choices[VISIBLEGROUPS] = new lang_string('groupsvisible', 'group');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', new lang_string('groupmode'), '', key($choices),$choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', new lang_string('force'), new lang_string('coursehelpforce'), 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$choices['0'] = get_string('courseavailablenot');
|
||||
$choices['1'] = get_string('courseavailable');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', get_string('visible'), '', 1,$choices));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('availability', new lang_string('availability'), ''));
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('courseavailablenot');
|
||||
$choices['1'] = new lang_string('courseavailable');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), '', 1,$choices));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('language', new lang_string('language'), ''));
|
||||
$temp->add(new admin_setting_heading('language', get_string('language'), ''));
|
||||
$languages=array();
|
||||
$languages[''] = new lang_string('forceno');
|
||||
$languages[''] = get_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', new lang_string('forcelanguage'), '',key($languages),$languages));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', get_string('forcelanguage'), '',key($languages),$languages));
|
||||
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('progress','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion','completion'), '',
|
||||
0, array(0 => new lang_string('completiondisabled','completion'), 1 => new lang_string('completionenabled','completion'))));
|
||||
$temp->add(new admin_setting_heading('progress', get_string('progress','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', get_string('completion','completion'), '',
|
||||
0, array(0 => get_string('completiondisabled','completion'), 1 => get_string('completionenabled','completion'))));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('moodlecourse/completionstartonenrol', new lang_string('completionstartonenrol','completion'), new lang_string('completionstartonenrolhelp', 'completion'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('moodlecourse/completionstartonenrol', get_string('completionstartonenrol','completion'), get_string('completionstartonenrolhelp', 'completion'), 0));
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
/// "courserequests" settingpage
|
||||
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', new lang_string('enablecourserequests', 'admin'), new lang_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', new lang_string('defaultrequestcategory', 'admin'), new lang_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('requestcategoryselection', new lang_string('requestcategoryselection', 'admin'), new lang_string('configrequestcategoryselection', 'admin'), 0));
|
||||
$temp->add(new admin_setting_users_with_capability('courserequestnotify', new lang_string('courserequestnotify', 'admin'), new lang_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
|
||||
$temp = new admin_settingpage('courserequest', get_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
$temp->add(new admin_setting_users_with_capability('courserequestnotify', get_string('courserequestnotify', 'admin'), get_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
/// Pending course requests.
|
||||
if (!empty($CFG->enablecourserequests)) {
|
||||
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
|
||||
$ADMIN->add('courses', new admin_externalpage('coursespending', get_string('pendingrequests'),
|
||||
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
|
||||
}
|
||||
|
||||
// Add a category for backups
|
||||
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
|
||||
$ADMIN->add('courses', new admin_category('backups', get_string('backups','admin')));
|
||||
|
||||
// Create a page for general backups configuration and defaults.
|
||||
$temp = new admin_settingpage('backupgeneralsettings', new lang_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
|
||||
|
||||
// General configuration section.
|
||||
$temp->add(new admin_setting_configselect('backup/loglifetime', new lang_string('loglifetime', 'backup'), new lang_string('configloglifetime', 'backup'), 30, array(
|
||||
1 => new lang_string('numdays', '', 1),
|
||||
2 => new lang_string('numdays', '', 2),
|
||||
3 => new lang_string('numdays', '', 3),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
7 => new lang_string('numdays', '', 7),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
14 => new lang_string('numdays', '', 14),
|
||||
20 => new lang_string('numdays', '', 20),
|
||||
30 => new lang_string('numdays', '', 30),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
365 => new lang_string('numdays', '', 365)
|
||||
)));
|
||||
|
||||
// General defaults section.
|
||||
$temp->add(new admin_setting_heading('generalsettings', new lang_string('generalsettings', 'backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_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_general_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_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_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)));
|
||||
// Create a page for general backup defaults
|
||||
$temp = new admin_settingpage('backupgeneralsettings', get_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', get_string('generalusers','backup'), get_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', get_string('generalanonymize','backup'), get_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', get_string('generalcomments','backup'), get_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', get_string('generaluserscompletion','backup'), get_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', get_string('generallogs','backup'), get_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', get_string('generalhistories','backup'), get_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for automated backups configuration and defaults.
|
||||
$temp = new admin_settingpage('automated', new lang_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
|
||||
|
||||
// Automated configuration section.
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_active', new lang_string('active'), new lang_string('autoactivedescription', 'backup'), 0, array(
|
||||
0 => new lang_string('autoactivedisabled', 'backup'),
|
||||
1 => new lang_string('autoactiveenabled', 'backup'),
|
||||
2 => new lang_string('autoactivemanual', 'backup')
|
||||
/// "backups" settingpage
|
||||
$temp = new admin_settingpage('automated', get_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_active', get_string('active'), get_string('autoactivedescription', 'backup'), 0, array(
|
||||
0 => get_string('autoactivedisabled', 'backup'),
|
||||
1 => get_string('autoactiveenabled', 'backup'),
|
||||
2 => get_string('autoactivemanual', 'backup')
|
||||
)));
|
||||
$temp->add(new admin_setting_special_backupdays());
|
||||
$temp->add(new admin_setting_configtime('backup/backup_auto_hour', 'backup_auto_minute', new lang_string('executeat'),
|
||||
new lang_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtime('backup/backup_auto_hour', 'backup_auto_minute', get_string('executeat'),
|
||||
get_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)));
|
||||
$storageoptions = array(
|
||||
0 => new lang_string('storagecourseonly', 'backup'),
|
||||
1 => new lang_string('storageexternalonly', 'backup'),
|
||||
2 => new lang_string('storagecourseandexternal', 'backup')
|
||||
0 => get_string('storagecourseonly', 'backup'),
|
||||
1 => get_string('storageexternalonly', 'backup'),
|
||||
2 => get_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_configdirectory('backup/backup_auto_destination', new lang_string('saveto'), new lang_string('backupsavetohelp'), ''));
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', get_string('automatedstorage', 'backup'), get_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
|
||||
$temp->add(new admin_setting_configdirectory('backup/backup_auto_destination', get_string('saveto'), get_string('backupsavetohelp'), ''));
|
||||
$keepoptoins = array(
|
||||
0 => new lang_string('all'), 1 => '1',
|
||||
0 => get_string('all'), 1 => '1',
|
||||
2 => '2',
|
||||
5 => '5',
|
||||
10 => '10',
|
||||
@@ -168,43 +137,23 @@ if ($hassiteconfig
|
||||
300 => '300',
|
||||
400 => '400',
|
||||
500 => '500');
|
||||
$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(
|
||||
0 => new lang_string('never'),
|
||||
1 => new lang_string('numdays', '', 1),
|
||||
2 => new lang_string('numdays', '', 2),
|
||||
3 => new lang_string('numdays', '', 3),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
7 => new lang_string('numdays', '', 7),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
14 => new lang_string('numdays', '', 14),
|
||||
20 => new lang_string('numdays', '', 20),
|
||||
30 => new lang_string('numdays', '', 30),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
365 => new lang_string('numdays', '', 365)
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));
|
||||
|
||||
// Automated defaults section.
|
||||
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
|
||||
$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_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_configselect('backup/backup_auto_keep', get_string('keep'), get_string('backupkeephelp'), 1, $keepoptoins));
|
||||
|
||||
|
||||
//$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));
|
||||
$temp->add(new admin_setting_heading('automatedsettings', get_string('automatedsettings','backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', get_string('generalusers', 'backup'), get_string('configgeneralusers', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', get_string('generalcomments','backup'), get_string('configgeneralcomments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', get_string('generaluserscompletion','backup'), get_string('configgeneraluserscompletion','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', get_string('generallogs', 'backup'), get_string('configgenerallogs', 'backup'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', get_string('generalhistories','backup'), get_string('configgeneralhistories','backup'), 0));
|
||||
|
||||
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', get_string('messages', 'message'), get_string('backupmessageshelp','message'), 0));
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', get_string('blogs', 'blog'), get_string('backupblogshelp','blog'), 0));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
|
||||
@@ -5,66 +5,61 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// Experimental settings page
|
||||
$ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
|
||||
$ADMIN->add('development', new admin_category('experimental', get_string('experimental','admin')));
|
||||
|
||||
$temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
|
||||
$temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
|
||||
//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);
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', get_string('enablesafebrowserintegration', 'admin'), get_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', get_string('enablegroupmembersonly', 'admin'), get_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$ADMIN->add('experimental', $temp);
|
||||
|
||||
// "debugging" settingpage
|
||||
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
|
||||
$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
|
||||
$temp->add(new admin_setting_special_debug());
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', get_string('debugvalidators', 'admin'), get_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', get_string('debugpageinfo', 'admin'), get_string('configdebugpageinfo', 'admin'), 0));
|
||||
$ADMIN->add('development', $temp);
|
||||
|
||||
// "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
|
||||
if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
|
||||
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
|
||||
$temp = new admin_settingpage('profiling', get_string('profiling', 'admin'));
|
||||
// Main profiling switch
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', get_string('profilingenabled', 'admin'), get_string('profilingenabled_help', 'admin'), false));
|
||||
// List of URLs that will be automatically profiled
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', get_string('profilingincluded', 'admin'), get_string('profilingincluded_help', 'admin'), ''));
|
||||
// List of URLs that won't be profiled ever
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', get_string('profilingexcluded', 'admin'), get_string('profilingexcluded_help', 'admin'), ''));
|
||||
// Allow random profiling each XX requests
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', get_string('profilingautofrec', 'admin'), get_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
// Allow PROFILEME/DONTPROFILEME GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', get_string('profilingallowme', 'admin'), get_string('profilingallowme_help', 'admin'), false));
|
||||
// Allow PROFILEALL/PROFILEALLSTOP GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', get_string('profilingallowall', 'admin'), get_string('profilingallowall_help', 'admin'), false));
|
||||
// TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
|
||||
// TODO: Allow to skip call_user functions (ignored_functions array)
|
||||
// Specify the life time (in minutes) of profiling runs
|
||||
$temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
|
||||
0 => new lang_string('neverdeleteruns', 'admin'),
|
||||
30*24*60 => new lang_string('numdays', '', 30),
|
||||
15*24*60 => new lang_string('numdays', '', 15),
|
||||
7*24*60 => new lang_string('numdays', '', 7),
|
||||
4*24*60 => new lang_string('numdays', '', 4),
|
||||
2*24*60 => new lang_string('numdays', '', 2),
|
||||
24*60 => new lang_string('numhours', '', 24),
|
||||
16*80 => new lang_string('numhours', '', 16),
|
||||
8*60 => new lang_string('numhours', '', 8),
|
||||
4*60 => new lang_string('numhours', '', 4),
|
||||
2*60 => new lang_string('numhours', '', 2),
|
||||
60 => new lang_string('numminutes', '', 60),
|
||||
30 => new lang_string('numminutes', '', 30),
|
||||
15 => new lang_string('numminutes', '', 15))));
|
||||
$temp->add(new admin_setting_configselect('profilinglifetime', get_string('profilinglifetime', 'admin'), get_string('profilinglifetime_help', 'admin'), 24*60, array(
|
||||
0 => get_string('neverdeleteruns', 'admin'),
|
||||
30*24*60 => get_string('numdays', '', 30),
|
||||
15*24*60 => get_string('numdays', '', 15),
|
||||
7*24*60 => get_string('numdays', '', 7),
|
||||
4*24*60 => get_string('numdays', '', 4),
|
||||
2*24*60 => get_string('numdays', '', 2),
|
||||
24*60 => get_string('numhours', '', 24),
|
||||
16*80 => get_string('numhours', '', 16),
|
||||
8*60 => get_string('numhours', '', 8),
|
||||
4*60 => get_string('numhours', '', 4),
|
||||
2*60 => get_string('numhours', '', 2),
|
||||
60 => get_string('numminutes', '', 60),
|
||||
30 => get_string('numminutes', '', 30),
|
||||
15 => get_string('numminutes', '', 15))));
|
||||
|
||||
// Add the 'profiling' page to admin block
|
||||
$ADMIN->add('development', $temp);
|
||||
@@ -72,12 +67,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', get_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', get_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
}
|
||||
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', get_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
} // end of speedup
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// This file defines everything related to frontpage
|
||||
|
||||
if (!during_initial_install()) { //do not use during installation
|
||||
$frontpagecontext = context_course::instance(SITEID);
|
||||
$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
|
||||
|
||||
if ($hassiteconfig or has_any_capability(array(
|
||||
'moodle/course:update',
|
||||
@@ -20,22 +20,22 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'moodle/question:moveall'), $frontpagecontext)) {
|
||||
|
||||
// "frontpage" settingpage
|
||||
$temp = new admin_settingpage('frontpagesettings', new lang_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
|
||||
$temp->add(new admin_setting_sitesettext('fullname', new lang_string('fullsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_sitesettext('shortname', new lang_string('shortsitename'), '', NULL)); // no default
|
||||
$temp = new admin_settingpage('frontpagesettings', get_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
|
||||
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_special_frontpagedesc());
|
||||
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
|
||||
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
|
||||
|
||||
$options = array();
|
||||
$options[] = new lang_string('unlimited');
|
||||
$options[] = get_string('unlimited');
|
||||
for ($i=1; $i<100; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('maxcategorydepth', new lang_string('configsitemaxcategorydepth','admin'), new lang_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
|
||||
$temp->add(new admin_setting_configselect('maxcategorydepth', get_string('configsitemaxcategorydepth','admin'), get_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
|
||||
|
||||
$temp->add(new admin_setting_sitesetcheckbox('numsections', new lang_string('sitesection'), new lang_string('sitesectionhelp','admin'), 1));
|
||||
$temp->add(new admin_setting_sitesetselect('newsitems', new lang_string('newsitemsnumber'), '', 3,
|
||||
$temp->add(new admin_setting_sitesetcheckbox('numsections', get_string('sitesection'), get_string('sitesectionhelp','admin'), 1));
|
||||
$temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnumber'), '', 3,
|
||||
array('0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
@@ -47,15 +47,16 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10')));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', new lang_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', get_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
|
||||
// front page default role
|
||||
$options = array(0=>new lang_string('none')); // roles to choose from
|
||||
$options = array(0=>get_string('none')); // roles to choose from
|
||||
$defaultfrontpageroleid = 0;
|
||||
$roles = role_fix_names(get_all_roles(), null, ROLENAME_ORIGINALANDSHORT);
|
||||
foreach ($roles as $role) {
|
||||
foreach (get_all_roles() as $role) {
|
||||
if (empty($role->archetype) or $role->archetype === 'guest' or $role->archetype === 'frontpage' or $role->archetype === 'student') {
|
||||
$options[$role->id] = $role->localname;
|
||||
$options[$role->id] = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
|
||||
if ($role->archetype === 'frontpage') {
|
||||
$defaultfrontpageroleid = $role->id;
|
||||
}
|
||||
@@ -65,18 +66,18 @@ if (!during_initial_install()) { //do not use during installation
|
||||
//frotpage role may not exist in old upgraded sites
|
||||
unset($options[0]);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('defaultfrontpageroleid', new lang_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
|
||||
$temp->add(new admin_setting_configselect('defaultfrontpageroleid', get_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
|
||||
|
||||
|
||||
$ADMIN->add('frontpage', $temp);
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', new lang_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', get_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagefilters', new lang_string('frontpagefilters', 'admin'), "$CFG->wwwroot/filter/manage.php?contextid=" . $frontpagecontext->id, 'moodle/filter:manage', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagefilters', get_string('frontpagefilters', 'admin'), "$CFG->wwwroot/filter/manage.php?contextid=" . $frontpagecontext->id, 'moodle/filter:manage', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', new lang_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/backup:backupcourse', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', get_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/backup:backupcourse', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', new lang_string('frontpagerestore', 'admin'), $CFG->wwwroot.'/backup/restorefile.php?contextid='.$frontpagecontext->id, 'moodle/restore:restorecourse', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', get_string('frontpagerestore', 'admin'), $CFG->wwwroot.'/files/index.php?id='.SITEID.'&wdir=/backupdata', 'moodle/restore:restorecourse', false, $frontpagecontext));
|
||||
|
||||
$questioncapabilities = array(
|
||||
'moodle/question:add',
|
||||
@@ -86,10 +87,10 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'moodle/question:viewall',
|
||||
'moodle/question:movemine',
|
||||
'moodle/question:moveall');
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', new lang_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', get_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
|
||||
if (!empty($SITE->legacyfiles) and $SITE->legacyfiles === 2) {
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', new lang_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+84
-90
@@ -6,21 +6,21 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
or has_capability('moodle/grade:manageletters', $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
require_once $CFG->libdir.'/grade/constants.php';
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => new lang_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => new lang_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => new lang_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => new lang_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => new lang_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => new lang_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => new lang_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => new lang_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => new lang_string('percentagereal', 'grades')
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades')
|
||||
);
|
||||
asort($display_types);
|
||||
|
||||
// General settings
|
||||
|
||||
$temp = new admin_settingpage('gradessettings', new lang_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradessettings', get_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
|
||||
// new CFG variable for gradebook (what roles to display)
|
||||
@@ -30,39 +30,33 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
$temp->add(new admin_setting_grade_profilereport());
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', new lang_string('aggregationposition', 'grades'),
|
||||
new lang_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => new lang_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => new lang_string('positionlast', 'grades'))));
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', get_string('aggregationposition', 'grades'),
|
||||
get_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', new lang_string('includescalesinaggregation', 'grades'), new lang_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', get_string('includescalesinaggregation', 'grades'), get_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', new lang_string('hiddenasdate', 'grades'), new lang_string('hiddenasdate_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('hiddenasdate_help', 'grades'), 0));
|
||||
|
||||
// enable publishing in exports/imports
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', new lang_string('gradepublishing', 'grades'), new lang_string('gradepublishing_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('gradepublishing_help', 'grades'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', new lang_string('gradeexportdisplaytype', 'grades'),
|
||||
new lang_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', get_string('gradeexportdisplaytype', 'grades'),
|
||||
get_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', new lang_string('gradeexportdecimalpoints', 'grades'),
|
||||
new lang_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', get_string('gradeexportdecimalpoints', 'grades'),
|
||||
get_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', new lang_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => new lang_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => new lang_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => new lang_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_userprofilefields', new lang_string('gradeexportuserprofilefields', 'grades'), new lang_string('gradeexportuserprofilefields_desc', 'grades'), 'firstname,lastname,idnumber,institution,department,email', PARAM_TEXT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_customprofilefields', new lang_string('gradeexportcustomprofilefields', 'grades'), new lang_string('gradeexportcustomprofilefields_desc', 'grades'), '', PARAM_TEXT));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('recovergradesdefault', new lang_string('recovergradesdefault', 'grades'), new lang_string('recovergradesdefault_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', get_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => get_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => get_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => get_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_special_gradeexport());
|
||||
|
||||
@@ -71,68 +65,68 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
/// Grade category settings
|
||||
$temp = new admin_settingpage('gradecategorysettings', new lang_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', new lang_string('hideforcedsettings', 'grades'), new lang_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', get_string('hideforcedsettings', 'grades'), get_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
|
||||
$strnoforce = new lang_string('noforce', 'grades');
|
||||
$strnoforce = get_string('noforce', 'grades');
|
||||
|
||||
// Aggregation type
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>new lang_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>new lang_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>new lang_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>new lang_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>new lang_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>new lang_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>new lang_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>new lang_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>new lang_string('aggregatesum', 'grades'));
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>get_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>get_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>get_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>get_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>get_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
|
||||
|
||||
$defaultvisible = array(GRADE_AGGREGATE_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN2,
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN, GRADE_AGGREGATE_MEDIAN, GRADE_AGGREGATE_MIN,
|
||||
GRADE_AGGREGATE_MAX, GRADE_AGGREGATE_MODE, GRADE_AGGREGATE_SUM);
|
||||
|
||||
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', new lang_string('aggregation', 'grades'), new lang_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', new lang_string('aggregationsvisible', 'grades'),
|
||||
new lang_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', get_string('aggregationsvisible', 'grades'),
|
||||
get_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
|
||||
$options = array(0 => new lang_string('no'), 1 => new lang_string('yes'));
|
||||
$options = array(0 => get_string('no'), 1 => get_string('yes'));
|
||||
|
||||
$defaults = array('value'=>1, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', new lang_string('aggregateonlygraded', 'grades'),
|
||||
new lang_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
|
||||
get_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$defaults = array('value'=>0, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', new lang_string('aggregateoutcomes', 'grades'),
|
||||
new lang_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', new lang_string('aggregatesubcats', 'grades'),
|
||||
new lang_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
|
||||
get_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'),
|
||||
get_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
|
||||
$options = array(0 => new lang_string('none'));
|
||||
$options = array(0 => get_string('none'));
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
|
||||
$defaults['value'] = 0;
|
||||
$defaults['forced'] = true;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', new lang_string('keephigh', 'grades'),
|
||||
new lang_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', get_string('keephigh', 'grades'),
|
||||
get_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$defaults['forced'] = false;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', new lang_string('droplow', 'grades'),
|
||||
new lang_string('droplow_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', get_string('droplow', 'grades'),
|
||||
get_string('droplow_help', 'grades'), $defaults, $options));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Grade item settings
|
||||
$temp = new admin_settingpage('gradeitemsettings', new lang_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradeitemsettings', get_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', new lang_string('gradedisplaytype', 'grades'),
|
||||
new lang_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', get_string('gradedisplaytype', 'grades'),
|
||||
get_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', new lang_string('decimalpoints', 'grades'),
|
||||
new lang_string('decimalpoints_help', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', get_string('decimalpoints', 'grades'),
|
||||
get_string('decimalpoints_help', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
@@ -140,48 +134,48 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', new lang_string('gradeitemadvanced', 'grades'), new lang_string('gradeitemadvanced_help', 'grades'),
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', get_string('gradeitemadvanced', 'grades'), get_string('gradeitemadvanced_help', 'grades'),
|
||||
array('iteminfo', 'idnumber', 'gradepass', 'plusfactor', 'multfactor', 'display', 'decimals', 'hiddenuntil', 'locktime'),
|
||||
array('iteminfo' => new lang_string('iteminfo', 'grades'),
|
||||
'idnumber' => new lang_string('idnumbermod'),
|
||||
'gradetype' => new lang_string('gradetype', 'grades'),
|
||||
'scaleid' => new lang_string('scale'),
|
||||
'grademin' => new lang_string('grademin', 'grades'),
|
||||
'grademax' => new lang_string('grademax', 'grades'),
|
||||
'gradepass' => new lang_string('gradepass', 'grades'),
|
||||
'plusfactor' => new lang_string('plusfactor', 'grades'),
|
||||
'multfactor' => new lang_string('multfactor', 'grades'),
|
||||
'display' => new lang_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => new lang_string('decimalpoints', 'grades'),
|
||||
'hidden' => new lang_string('hidden', 'grades'),
|
||||
'hiddenuntil' => new lang_string('hiddenuntil', 'grades'),
|
||||
'locked' => new lang_string('locked', 'grades'),
|
||||
'locktime' => new lang_string('locktime', 'grades'),
|
||||
'aggregationcoef' => new lang_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => new lang_string('parentcategory', 'grades'))));
|
||||
array('iteminfo' => get_string('iteminfo', 'grades'),
|
||||
'idnumber' => get_string('idnumbermod'),
|
||||
'gradetype' => get_string('gradetype', 'grades'),
|
||||
'scaleid' => get_string('scale'),
|
||||
'grademin' => get_string('grademin', 'grades'),
|
||||
'grademax' => get_string('grademax', 'grades'),
|
||||
'gradepass' => get_string('gradepass', 'grades'),
|
||||
'plusfactor' => get_string('plusfactor', 'grades'),
|
||||
'multfactor' => get_string('multfactor', 'grades'),
|
||||
'display' => get_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => get_string('decimalpoints', 'grades'),
|
||||
'hidden' => get_string('hidden', 'grades'),
|
||||
'hiddenuntil' => get_string('hiddenuntil', 'grades'),
|
||||
'locked' => get_string('locked', 'grades'),
|
||||
'locktime' => get_string('locktime', 'grades'),
|
||||
'aggregationcoef' => get_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => get_string('parentcategory', 'grades'))));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Scales and outcomes
|
||||
|
||||
$scales = new admin_externalpage('scales', new lang_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $scales);
|
||||
if (!empty($CFG->enableoutcomes)) {
|
||||
$outcomes = new admin_externalpage('outcomes', new lang_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $outcomes);
|
||||
}
|
||||
$letters = new admin_externalpage('letters', new lang_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$ADMIN->add('grades', $letters);
|
||||
|
||||
// The plugins must implement a settings.php file that adds their admin settings to the $settings object
|
||||
|
||||
// Reports
|
||||
$ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradereports', get_string('reportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, new lang_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, get_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradereports', $settings);
|
||||
@@ -190,12 +184,12 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
}
|
||||
|
||||
// Imports
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', get_string('importsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeimport') as $plugin => $plugindir) {
|
||||
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, new lang_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, get_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeimports', $settings);
|
||||
@@ -205,11 +199,11 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
|
||||
// Exports
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', get_string('exportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeexport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, new lang_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, get_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeexports', $settings);
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
if ($hassiteconfig) {
|
||||
|
||||
// "languageandlocation" settingpage
|
||||
$temp = new admin_settingpage('langsettings', new lang_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'), new lang_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'), new lang_string('configlangmenu', 'admin'), 1));
|
||||
$temp = new admin_settingpage('langsettings', get_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', get_string('autolang', 'admin'), get_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', get_string('lang', 'admin'), get_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', 'admin'), get_string('configlangmenu', 'admin'), 1));
|
||||
$temp->add(new admin_setting_langlist());
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'), new lang_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'), new lang_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'), new lang_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'), new lang_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', get_string('langstringcache', 'admin'), get_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
|
||||
$ADMIN->add('language', $temp);
|
||||
|
||||
|
||||
+11
-11
@@ -3,20 +3,20 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// "locations" settingpage
|
||||
$temp = new admin_settingpage('locationsettings', new lang_string('locationsettings', 'admin'));
|
||||
$temp = new admin_settingpage('locationsettings', get_string('locationsettings', 'admin'));
|
||||
$options = get_list_of_timezones();
|
||||
$options[99] = new lang_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', new lang_string('timezone','admin'), new lang_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = new lang_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', new lang_string('forcetimezone', 'admin'), new lang_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', new lang_string('country', 'admin'), new lang_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', new lang_string('defaultcity', 'admin'), new lang_string('defaultcity_help', 'admin'), ''));
|
||||
$options[99] = get_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', get_string('timezone','admin'), get_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = get_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', get_string('forcetimezone', 'admin'), get_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', get_string('defaultcity', 'admin'), get_string('defaultcity_help', 'admin'), ''));
|
||||
|
||||
$temp->add(new admin_setting_heading('iplookup', new lang_string('iplookup', 'admin'), new lang_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', new lang_string('geoipfile', 'admin'), new lang_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey3', new lang_string('googlemapkey3', 'admin'), new lang_string('googlemapkey3_help', 'admin'), '', PARAM_RAW, 60));
|
||||
$temp->add(new admin_setting_heading('iplookup', get_string('iplookup', 'admin'), get_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', get_string('geoipfile', 'admin'), get_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey', get_string('googlemapkey', 'admin'), get_string('configgooglemapkey', 'admin', $CFG->wwwroot), ''));
|
||||
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', new lang_string('allcountrycodes', 'admin'), new lang_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', get_string('allcountrycodes', 'admin'), get_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
|
||||
$ADMIN->add('location', $temp);
|
||||
|
||||
|
||||
+11
-11
@@ -4,18 +4,18 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', new lang_string('settings', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', get_string('settings', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/index.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', new lang_string('managemnetpeers', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', get_string('managemnetpeers', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/peers.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', new lang_string('mnetpeers', 'mnet')));
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', get_string('mnetpeers', 'mnet')));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
require_once($CFG->dirroot.'/mnet/lib.php');
|
||||
@@ -23,39 +23,39 @@ if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off')
|
||||
$hosts = mnet_get_hosts();
|
||||
foreach ($hosts as $host) {
|
||||
if ($host->id == $CFG->mnet_all_hosts_id) {
|
||||
$host->name = new lang_string('allhosts', 'core_mnet');
|
||||
$host->name = get_string('allhosts', 'core_mnet');
|
||||
}
|
||||
$ADMIN->add('mnetpeercat',
|
||||
new admin_externalpage(
|
||||
'mnetpeer' . $host->id,
|
||||
$host->name,
|
||||
$CFG->wwwroot . '/'.$CFG->admin.'/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
$CFG->wwwroot . '/admin/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
'moodle/site:config'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', new lang_string('ssoaccesscontrol', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', get_string('ssoaccesscontrol', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/access_control.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', new lang_string('clientname', 'mnetservice_enrol'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', get_string('clientname', 'mnetservice_enrol'),
|
||||
"$CFG->wwwroot/mnet/service/enrol/index.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', new lang_string('trustedhosts', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', get_string('trustedhosts', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/trustedhosts.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', new lang_string('profilefields', 'mnet'),
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', get_string('profilefields', 'mnet'),
|
||||
'moodle/site:config');
|
||||
$ADMIN->add('mnet', $profilefields);
|
||||
|
||||
$fields = mnet_profile_field_options();
|
||||
$forced = implode(', ', $fields['forced']);
|
||||
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', new lang_string('profileexportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', new lang_string('profileimportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', get_string('profileexportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', get_string('profileimportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+268
-193
@@ -5,144 +5,212 @@
|
||||
*/
|
||||
|
||||
if ($hassiteconfig) {
|
||||
require_once("$CFG->libdir/pluginlib.php");
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
|
||||
$ADMIN->add('modules', new admin_page_pluginsoverview());
|
||||
|
||||
// activity modules
|
||||
$ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
|
||||
$ADMIN->add('modules', new admin_category('modsettings', get_string('activitymodules')));
|
||||
$ADMIN->add('modsettings', new admin_page_managemods());
|
||||
foreach ($allplugins['mod'] as $module) {
|
||||
$module->load_settings($ADMIN, 'modsettings', $hassiteconfig);
|
||||
$modules = $DB->get_records('modules', array(), "name ASC");
|
||||
foreach ($modules as $module) {
|
||||
$modulename = $module->name;
|
||||
if (!file_exists("$CFG->dirroot/mod/$modulename/lib.php")) {
|
||||
continue;
|
||||
}
|
||||
$strmodulename = get_string('modulename', 'mod_'.$modulename);
|
||||
if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) {
|
||||
// do not show disabled modules in tree, keep only settings link on manage page
|
||||
$settings = new admin_settingpage('modsetting'.$modulename, $strmodulename, 'moodle/site:config', !$module->visible);
|
||||
include($CFG->dirroot.'/mod/'.$modulename.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('modsettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// hidden script for converting journals to online assignments (or something like that) linked from elsewhere
|
||||
$ADMIN->add('modsettings', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
|
||||
|
||||
// course formats
|
||||
$ADMIN->add('modules', new admin_category('formatsettings', new lang_string('courseformats')));
|
||||
$temp = new admin_settingpage('manageformats', new lang_string('manageformats', 'core_admin'));
|
||||
$temp->add(new admin_setting_manageformats());
|
||||
$ADMIN->add('formatsettings', $temp);
|
||||
foreach ($allplugins['format'] as $format) {
|
||||
$format->load_settings($ADMIN, 'formatsettings', $hassiteconfig);
|
||||
}
|
||||
|
||||
// blocks
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', get_string('blocks')));
|
||||
$ADMIN->add('blocksettings', new admin_page_manageblocks());
|
||||
foreach ($allplugins['block'] as $block) {
|
||||
$block->load_settings($ADMIN, 'blocksettings', $hassiteconfig);
|
||||
$blocks = $DB->get_records('block', array(), "name ASC");
|
||||
foreach ($blocks as $block) {
|
||||
$blockname = $block->name;
|
||||
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
continue;
|
||||
}
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
if (file_exists($CFG->dirroot.'/blocks/'.$blockname.'/settings.php')) {
|
||||
$settings = new admin_settingpage('blocksetting'.$blockname, $strblockname, 'moodle/site:config', !$block->visible);
|
||||
include($CFG->dirroot.'/blocks/'.$blockname.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('blocksettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// message outputs
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', new lang_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', get_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
|
||||
$ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
|
||||
foreach ($allplugins['message'] as $processor) {
|
||||
$processor->load_settings($ADMIN, 'messageoutputs', $hassiteconfig);
|
||||
require_once($CFG->dirroot.'/message/lib.php');
|
||||
$processors = get_message_processors();
|
||||
foreach ($processors as $processor) {
|
||||
$processorname = $processor->name;
|
||||
if (!$processor->available) {
|
||||
continue;
|
||||
}
|
||||
if ($processor->hassettings) {
|
||||
$strprocessorname = get_string('pluginname', 'message_'.$processorname);
|
||||
$settings = new admin_settingpage('messagesetting'.$processorname, $strprocessorname, 'moodle/site:config', !$processor->enabled);
|
||||
include($CFG->dirroot.'/message/output/'.$processor->name.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('messageoutputs', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// authentication plugins
|
||||
$ADMIN->add('modules', new admin_category('authsettings', new lang_string('authentication', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('authsettings', get_string('authentication', 'admin')));
|
||||
|
||||
$temp = new admin_settingpage('manageauths', new lang_string('authsettings', 'admin'));
|
||||
$temp = new admin_settingpage('manageauths', get_string('authsettings', 'admin'));
|
||||
$temp->add(new admin_setting_manageauths());
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', new lang_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', get_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_special_registerauth());
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', new lang_string('authpreventaccountcreation', 'admin'), new lang_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
|
||||
new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
|
||||
new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
|
||||
new lang_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
|
||||
new lang_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'), new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'), new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', get_string('authpreventaccountcreation', 'admin'), get_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', get_string('loginpageautofocus', 'admin'), get_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', get_string('guestloginbutton', 'auth'),
|
||||
get_string('showguestlogin', 'auth'), '1', array('0'=>get_string('hide'), '1'=>get_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', get_string('alternateloginurl', 'auth'),
|
||||
get_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', get_string('forgottenpasswordurl', 'auth'),
|
||||
get_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', get_string('instructions', 'auth'),
|
||||
get_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', get_string('verifychangedemail', 'admin'), get_string('configverifychangedemail', 'admin'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$ADMIN->add('authsettings', $temp);
|
||||
|
||||
foreach ($allplugins['auth'] as $auth) {
|
||||
$auth->load_settings($ADMIN, 'authsettings', $hassiteconfig);
|
||||
|
||||
$auths = get_plugin_list('auth');
|
||||
$authsenabled = get_enabled_auth_plugins();
|
||||
foreach ($auths as $authname => $authdir) {
|
||||
$strauthname = get_string('pluginname', "auth_{$authname}");
|
||||
// do not show disabled auths in tree, keep only settings link on manage page
|
||||
$enabled = in_array($authname, $authsenabled);
|
||||
if (file_exists($authdir.'/settings.php')) {
|
||||
// TODO: finish implementation of common settings - locking, etc.
|
||||
$settings = new admin_settingpage('authsetting'.$authname, $strauthname, 'moodle/site:config', !$enabled);
|
||||
include($authdir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('authsettings', $settings);
|
||||
}
|
||||
|
||||
} else {
|
||||
$ADMIN->add('authsettings', new admin_externalpage('authsetting'.$authname, $strauthname, "$CFG->wwwroot/$CFG->admin/auth_config.php?auth=$authname", 'moodle/site:config', !$enabled));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Enrolment plugins
|
||||
$ADMIN->add('modules', new admin_category('enrolments', new lang_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', new lang_string('manageenrols', 'enrol'));
|
||||
$ADMIN->add('modules', new admin_category('enrolments', get_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', get_string('manageenrols', 'enrol'));
|
||||
$temp->add(new admin_setting_manageenrols());
|
||||
$ADMIN->add('enrolments', $temp);
|
||||
foreach($allplugins['enrol'] as $enrol) {
|
||||
$enrol->load_settings($ADMIN, 'enrolments', $hassiteconfig);
|
||||
if (empty($CFG->enrol_plugins_enabled)) {
|
||||
$enabled = array();
|
||||
} else {
|
||||
$enabled = explode(',', $CFG->enrol_plugins_enabled);
|
||||
}
|
||||
$enrols = get_plugin_list('enrol');
|
||||
$ADMIN->add('enrolments', $temp);
|
||||
foreach($enrols as $enrol=>$enrolpath) {
|
||||
if (!file_exists("$enrolpath/settings.php")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('enrolsettings'.$enrol, get_string('pluginname', 'enrol_'.$enrol), 'moodle/site:config', !in_array($enrol, $enabled));
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include("$enrolpath/settings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('enrolments', $settings);
|
||||
}
|
||||
|
||||
}
|
||||
unset($enabled);
|
||||
unset($enrols);
|
||||
|
||||
|
||||
/// Editor plugins
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', get_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', get_string('editorsettings', 'editor'));
|
||||
$temp->add(new admin_setting_manageeditors());
|
||||
$htmleditors = editors_get_available();
|
||||
$ADMIN->add('editorsettings', $temp);
|
||||
foreach ($allplugins['editor'] as $editor) {
|
||||
$editor->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
|
||||
|
||||
$editors_available = editors_get_available();
|
||||
foreach ($editors_available as $editor=>$editorstr) {
|
||||
if (file_exists($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php')) {
|
||||
$settings = new admin_settingpage('editorsettings'.$editor, get_string('pluginname', 'editor_'.$editor), 'moodle/site:config');
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('editorsettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// License types
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', new lang_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', new lang_string('managelicenses', 'admin'));
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', get_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', get_string('managelicenses', 'admin'));
|
||||
|
||||
require_once($CFG->libdir . '/licenselib.php');
|
||||
$licenses = array();
|
||||
$array = explode(',', $CFG->licenses);
|
||||
foreach ($array as $value) {
|
||||
$licenses[$value] = new lang_string($value, 'license');
|
||||
$licenses[$value] = get_string($value, 'license');
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', new lang_string('configsitedefaultlicense','admin'), new lang_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', get_string('configsitedefaultlicense','admin'), get_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_managelicenses());
|
||||
$ADMIN->add('licensesettings', $temp);
|
||||
|
||||
/// Filter plugins
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', new lang_string('managefilters')));
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', get_string('managefilters')));
|
||||
|
||||
$ADMIN->add('filtersettings', new admin_page_managefilters());
|
||||
|
||||
// "filtersettings" settingpage
|
||||
$temp = new admin_settingpage('commonfiltersettings', new lang_string('commonfiltersettings', 'admin'));
|
||||
$temp = new admin_settingpage('commonfiltersettings', get_string('commonfiltersettings', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
$cachetimes = array(
|
||||
604800 => new lang_string('numdays','',7),
|
||||
86400 => new lang_string('numdays','',1),
|
||||
43200 => new lang_string('numhours','',12),
|
||||
10800 => new lang_string('numhours','',3),
|
||||
7200 => new lang_string('numhours','',2),
|
||||
3600 => new lang_string('numhours','',1),
|
||||
2700 => new lang_string('numminutes','',45),
|
||||
1800 => new lang_string('numminutes','',30),
|
||||
900 => new lang_string('numminutes','',15),
|
||||
600 => new lang_string('numminutes','',10),
|
||||
540 => new lang_string('numminutes','',9),
|
||||
480 => new lang_string('numminutes','',8),
|
||||
420 => new lang_string('numminutes','',7),
|
||||
360 => new lang_string('numminutes','',6),
|
||||
300 => new lang_string('numminutes','',5),
|
||||
240 => new lang_string('numminutes','',4),
|
||||
180 => new lang_string('numminutes','',3),
|
||||
120 => new lang_string('numminutes','',2),
|
||||
60 => new lang_string('numminutes','',1),
|
||||
30 => new lang_string('numseconds','',30),
|
||||
0 => new lang_string('no')
|
||||
604800 => get_string('numdays','',7),
|
||||
86400 => get_string('numdays','',1),
|
||||
43200 => get_string('numhours','',12),
|
||||
10800 => get_string('numhours','',3),
|
||||
7200 => get_string('numhours','',2),
|
||||
3600 => get_string('numhours','',1),
|
||||
2700 => get_string('numminutes','',45),
|
||||
1800 => get_string('numminutes','',30),
|
||||
900 => get_string('numminutes','',15),
|
||||
600 => get_string('numminutes','',10),
|
||||
540 => get_string('numminutes','',9),
|
||||
480 => get_string('numminutes','',8),
|
||||
420 => get_string('numminutes','',7),
|
||||
360 => get_string('numminutes','',6),
|
||||
300 => get_string('numminutes','',5),
|
||||
240 => get_string('numminutes','',4),
|
||||
180 => get_string('numminutes','',3),
|
||||
120 => get_string('numminutes','',2),
|
||||
60 => get_string('numminutes','',1),
|
||||
30 => get_string('numseconds','',30),
|
||||
0 => get_string('no')
|
||||
);
|
||||
$items = array();
|
||||
$items[] = new admin_setting_configselect('cachetext', new lang_string('cachetext', 'admin'), new lang_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', new lang_string('filteruploadedfiles', 'admin'), new lang_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
$items[] = new admin_setting_configselect('cachetext', get_string('cachetext', 'admin'), get_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', get_string('filteruploadedfiles', 'admin'), get_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', get_string('filtermatchoneperpage', 'admin'), get_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', get_string('filtermatchonepertext', 'admin'), get_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
foreach ($items as $item) {
|
||||
$item->set_updatedcallback('reset_text_filters_cache');
|
||||
$temp->add($item);
|
||||
@@ -150,15 +218,24 @@ if ($hassiteconfig) {
|
||||
}
|
||||
$ADMIN->add('filtersettings', $temp);
|
||||
|
||||
foreach ($allplugins['filter'] as $filter) {
|
||||
$filter->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
|
||||
$activefilters = filter_get_globally_enabled();
|
||||
$filternames = filter_get_all_installed();
|
||||
foreach ($filternames as $filterpath => $strfiltername) {
|
||||
if (file_exists("$CFG->dirroot/$filterpath/filtersettings.php")) {
|
||||
$settings = new admin_settingpage('filtersetting'.str_replace('/', '', $filterpath),
|
||||
$strfiltername, 'moodle/site:config', !isset($activefilters[$filterpath]));
|
||||
include("$CFG->dirroot/$filterpath/filtersettings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('filtersettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//== Portfolio settings ==
|
||||
require_once($CFG->libdir. '/portfoliolib.php');
|
||||
$catname = new lang_string('portfolios', 'portfolio');
|
||||
$manage = new lang_string('manageportfolios', 'portfolio');
|
||||
$catname = get_string('portfolios', 'portfolio');
|
||||
$manage = get_string('manageportfolios', 'portfolio');
|
||||
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
||||
|
||||
$ADMIN->add('modules', new admin_category('portfoliosettings', $catname, empty($CFG->enableportfolios)));
|
||||
@@ -168,37 +245,37 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('manageportfolioscommon', new lang_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', new lang_string('commonsettingsdesc', 'portfolio')));
|
||||
$temp = new admin_settingpage('manageportfolioscommon', get_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', get_string('commonsettingsdesc', 'portfolio')));
|
||||
$fileinfo = portfolio_filesize_info(); // make sure this is defined in one place since its used inside portfolio too to detect insane settings
|
||||
$fileoptions = $fileinfo['options'];
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_moderate_filesize_threshold',
|
||||
new lang_string('moderatefilesizethreshold', 'portfolio'),
|
||||
new lang_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
get_string('moderatefilesizethreshold', 'portfolio'),
|
||||
get_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['moderate'], $fileoptions));
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_high_filesize_threshold',
|
||||
new lang_string('highfilesizethreshold', 'portfolio'),
|
||||
new lang_string('highfilesizethresholddesc', 'portfolio'),
|
||||
get_string('highfilesizethreshold', 'portfolio'),
|
||||
get_string('highfilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['high'], $fileoptions));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_moderate_db_threshold',
|
||||
new lang_string('moderatedbsizethreshold', 'portfolio'),
|
||||
new lang_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
20, PARAM_INT, 3));
|
||||
get_string('moderatedbsizethreshold', 'portfolio'),
|
||||
get_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
20, PARAM_INTEGER, 3));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_high_db_threshold',
|
||||
new lang_string('highdbsizethreshold', 'portfolio'),
|
||||
new lang_string('highdbsizethresholddesc', 'portfolio'),
|
||||
50, PARAM_INT, 3));
|
||||
get_string('highdbsizethreshold', 'portfolio'),
|
||||
get_string('highdbsizethresholddesc', 'portfolio'),
|
||||
50, PARAM_INTEGER, 3));
|
||||
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', new lang_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', new lang_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', new lang_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', get_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', get_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', get_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
|
||||
foreach (portfolio_instances(false, false) as $portfolio) {
|
||||
require_once($CFG->dirroot . '/portfolio/' . $portfolio->get('plugin') . '/lib.php');
|
||||
@@ -218,8 +295,8 @@ if ($hassiteconfig) {
|
||||
|
||||
// repository setting
|
||||
require_once("$CFG->dirroot/repository/lib.php");
|
||||
$catname =new lang_string('repositories', 'repository');
|
||||
$managerepo = new lang_string('manage', 'repository');
|
||||
$catname =get_string('repositories', 'repository');
|
||||
$managerepo = get_string('manage', 'repository');
|
||||
$url = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php';
|
||||
$ADMIN->add('modules', new admin_category('repositorysettings', $catname));
|
||||
|
||||
@@ -228,117 +305,133 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('managerepositoriescommon', new lang_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', new lang_string('cacheexpire', 'repository'), new lang_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', new lang_string('allowexternallinks', 'repository'), new lang_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', new lang_string('legacyfilesinnewcourses', 'admin'), new lang_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$temp = new admin_settingpage('managerepositoriescommon', get_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', get_string('cacheexpire', 'repository'), get_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', get_string('allowexternallinks', 'repository'), get_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', get_string('legacyfilesinnewcourses', 'admin'), get_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
|
||||
new lang_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete',
|
||||
new lang_string('deleterepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('deleterepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller',
|
||||
new lang_string('manage', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('manage', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew',
|
||||
new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('createrepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
|
||||
new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
foreach ($allplugins['repository'] as $repositorytype) {
|
||||
$repositorytype->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
|
||||
foreach (repository::get_types() as $repositorytype) {
|
||||
//display setup page for plugins with: general options or multiple instances (e.g. has instance config)
|
||||
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
|
||||
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
|
||||
if (!empty($typeoptionnames) || !empty($instanceoptionnames)) {
|
||||
$ADMIN->add('repositorysettings',
|
||||
new admin_externalpage('repositorysettings'.$repositorytype->get_typename(),
|
||||
$repositorytype->get_readablename(),
|
||||
$url . '?action=edit&repos=' . $repositorytype->get_typename()),
|
||||
'moodle/site:config');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Web services
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
|
||||
// Mobile
|
||||
$temp = new admin_settingpage('mobile', new lang_string('mobile','admin'), 'moodle/site:config', false);
|
||||
$enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
|
||||
new lang_string('enablemobilewebservice', 'admin'),
|
||||
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'), new lang_string('configmobilecssurl','admin'), '', PARAM_URL));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
|
||||
/// overview page
|
||||
$temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
|
||||
$temp = new admin_settingpage('webservicesoverview', get_string('webservicesoverview', 'webservice'));
|
||||
$temp->add(new admin_setting_webservicesoverview());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
//API documentation
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', get_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
/// manage service
|
||||
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
|
||||
new lang_string('enablemobilewebservice', 'admin'),
|
||||
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
|
||||
$temp = new admin_settingpage('externalservices', get_string('externalservices', 'webservice'));
|
||||
$enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, get_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice', get_string('enablemobilewebservice', 'admin'), get_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', get_string('information', 'webservice'), get_string('servicehelpexplanation', 'webservice')));
|
||||
$temp->add(new admin_setting_manageexternalservices());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', new lang_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', new lang_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', new lang_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', get_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
/// manage protocol page link
|
||||
$temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
|
||||
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebserviceprotocols());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
|
||||
// We cannot use $OUTPUT this early, doing so means that we lose the ability
|
||||
// to set the page layout on all admin pages.
|
||||
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
|
||||
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
|
||||
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
|
||||
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$wsdoclink = html_writer::tag('a', get_string('supplyinfo'),array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', get_string('enablewsdocumentation',
|
||||
'admin'), get_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
/// links to protocol pages
|
||||
foreach ($allplugins['webservice'] as $webservice) {
|
||||
$webservice->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
|
||||
$webservices_available = get_plugin_list('webservice');
|
||||
$active_webservices = empty($CFG->webserviceprotocols) ? array() : explode(',', $CFG->webserviceprotocols);
|
||||
foreach ($webservices_available as $webservice => $location) {
|
||||
if (file_exists("$location/settings.php")) {
|
||||
$name = get_string('pluginname', 'webservice_'.$webservice);
|
||||
$settings = new admin_settingpage('webservicesetting'.$webservice, $name, 'moodle/site:config', !in_array($webservice, $active_webservices) or empty($CFG->enablewebservices));
|
||||
include("$location/settings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('webservicesettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// manage token page link
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice'));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', get_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', get_string('managetokens', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebservicetokens());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
}
|
||||
|
||||
// Question type settings
|
||||
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
||||
if (!$hassiteconfig) {
|
||||
require_once("$CFG->libdir/pluginlib.php");
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
}
|
||||
// Question behaviour settings.
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', get_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
|
||||
|
||||
// Question type settings.
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
|
||||
foreach ($allplugins['qtype'] as $qtype) {
|
||||
$qtype->load_settings($ADMIN, 'qtypesettings', $hassiteconfig);
|
||||
$qtypes = get_plugin_list('qtype');
|
||||
foreach ($qtypes as $qtype => $path) {
|
||||
$settingsfile = $path . '/settings.php';
|
||||
if (file_exists($settingsfile)) {
|
||||
$settings = new admin_settingpage('qtypesetting' . $qtype,
|
||||
get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
|
||||
include($settingsfile);
|
||||
if ($settings) {
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Plagiarism plugin settings
|
||||
if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', new lang_string('plagiarism', 'plagiarism')));
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('manageplagiarismplugins', new lang_string('manageplagiarism', 'plagiarism'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/plagiarism.php'));
|
||||
|
||||
foreach ($allplugins['plagiarism'] as $plugin) {
|
||||
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', get_string('plagiarism', 'plagiarism')));
|
||||
$temp = new admin_settingpage('plagiarismsettings', get_string('plagiarismsettings', 'plagiarism'));
|
||||
$temp->add(new admin_setting_manageplagiarism());
|
||||
$ADMIN->add('plagiarism', $temp);
|
||||
foreach (get_plugin_list('plagiarism') as $plugin => $plugindir) {
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('plagiarism'.$plugin, get_string($plugin, 'plagiarism_'.$plugin), "$CFG->wwwroot/plagiarism/$plugin/settings.php", 'moodle/site:config'));
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', get_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
|
||||
// Course reports settings
|
||||
if ($hassiteconfig) {
|
||||
@@ -347,7 +440,7 @@ if ($hassiteconfig) {
|
||||
$file = $CFG->dirroot . '/course/report/' . $report . '/settings.php';
|
||||
if (file_exists($file)) {
|
||||
$settings = new admin_settingpage('coursereport' . $report,
|
||||
new lang_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
|
||||
get_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include($file);
|
||||
if ($settings) {
|
||||
@@ -356,7 +449,7 @@ if ($hassiteconfig) {
|
||||
}
|
||||
}
|
||||
if (!empty($pages)) {
|
||||
$ADMIN->add('modules', new admin_category('coursereports', new lang_string('coursereports')));
|
||||
$ADMIN->add('modules', new admin_category('coursereports', get_string('coursereports')));
|
||||
foreach ($pages as $page) {
|
||||
$ADMIN->add('coursereports', $page);
|
||||
}
|
||||
@@ -370,27 +463,20 @@ foreach (get_plugin_list('report') as $report => $plugindir) {
|
||||
$settings_path = "$plugindir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
$settings = new admin_settingpage('report' . $report,
|
||||
new lang_string('pluginname', 'report_' . $report), 'moodle/site:config');
|
||||
get_string('pluginname', 'report_' . $report), 'moodle/site:config');
|
||||
include($settings_path);
|
||||
if ($settings) {
|
||||
$pages[] = $settings;
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('modules', new admin_category('reportplugins', new lang_string('reports')));
|
||||
$ADMIN->add('reportplugins', new admin_externalpage('managereports', new lang_string('reportsmanage', 'admin'),
|
||||
$ADMIN->add('modules', new admin_category('reportplugins', get_string('reports')));
|
||||
$ADMIN->add('reportplugins', new admin_externalpage('managereports', get_string('reportsmanage', 'admin'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/reports.php'));
|
||||
foreach ($pages as $page) {
|
||||
$ADMIN->add('reportplugins', $page);
|
||||
}
|
||||
|
||||
/// Add all admin tools
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('tools', new lang_string('tools', 'admin')));
|
||||
$ADMIN->add('tools', new admin_externalpage('managetools', new lang_string('toolsmanage', 'admin'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/tools.php'));
|
||||
}
|
||||
|
||||
// Now add various admin tools
|
||||
foreach (get_plugin_list('tool') as $plugin => $plugindir) {
|
||||
$settings_path = "$plugindir/settings.php";
|
||||
@@ -399,31 +485,20 @@ foreach (get_plugin_list('tool') as $plugin => $plugindir) {
|
||||
}
|
||||
}
|
||||
|
||||
// Now add the Cache plugins
|
||||
/// Add all admin tools
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('cache', new lang_string('caching', 'cache')));
|
||||
$ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
|
||||
$ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
|
||||
$ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
|
||||
foreach (get_plugin_list('cachestore') as $plugin => $path) {
|
||||
$settingspath = $path.'/settings.php';
|
||||
if (file_exists($settingspath)) {
|
||||
$settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config');
|
||||
include($settingspath);
|
||||
$ADMIN->add('cachestores', $settings);
|
||||
}
|
||||
}
|
||||
$ADMIN->add('modules', new admin_category('tools', get_string('tools', 'admin')));
|
||||
$ADMIN->add('tools', new admin_externalpage('managetools', get_string('toolsmanage', 'admin'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/tools.php'));
|
||||
}
|
||||
|
||||
/// Add all local plugins - must be always last!
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', new lang_string('localpluginsmanage'),
|
||||
$ADMIN->add('modules', new admin_category('localplugins', get_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', get_string('localpluginsmanage'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/localplugins.php'));
|
||||
}
|
||||
|
||||
// extend settings for each local plugin. Note that their settings may be in any part of the
|
||||
// settings tree and may be visible not only for administrators. We can not use $allplugins here
|
||||
foreach (get_plugin_list('local') as $plugin => $plugindir) {
|
||||
$settings_path = "$plugindir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
|
||||
+83
-70
@@ -3,101 +3,114 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// "ip blocker" settingpage
|
||||
$temp = new admin_settingpage('ipblocker', new lang_string('ipblocker', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowbeforeblock', new lang_string('allowbeforeblock', 'admin'), new lang_string('allowbeforeblockdesc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configiplist('allowedip', new lang_string('allowediplist', 'admin'),
|
||||
new lang_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configiplist('blockedip', new lang_string('blockediplist', 'admin'),
|
||||
new lang_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp = new admin_settingpage('ipblocker', get_string('ipblocker', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowbeforeblock', get_string('allowbeforeblock', 'admin'), get_string('allowbeforeblockdesc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configiplist('allowedip', get_string('allowediplist', 'admin'),
|
||||
get_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configiplist('blockedip', get_string('blockediplist', 'admin'),
|
||||
get_string('ipblockersyntax', 'admin'), ''));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
// "sitepolicies" settingpage
|
||||
$temp = new admin_settingpage('sitepolicies', new lang_string('sitepolicies', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('protectusernames', new lang_string('protectusernames', 'admin'), new lang_string('configprotectusernames', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forcelogin', new lang_string('forcelogin', 'admin'), new lang_string('configforcelogin', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', new lang_string('forceloginforprofiles', 'admin'), new lang_string('configforceloginforprofiles', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', new lang_string('forceloginforprofileimage', 'admin'), new lang_string('forceloginforprofileimage_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('opentogoogle', new lang_string('opentogoogle', 'admin'), new lang_string('configopentogoogle', 'admin'), 0));
|
||||
$temp = new admin_settingpage('sitepolicies', get_string('sitepolicies', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', get_string('forceloginforprofileimage', 'admin'), get_string('forceloginforprofileimage_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0));
|
||||
$temp->add(new admin_setting_pickroles('profileroles',
|
||||
new lang_string('profileroles','admin'),
|
||||
new lang_string('configprofileroles', 'admin'),
|
||||
get_string('profileroles','admin'),
|
||||
get_string('configprofileroles', 'admin'),
|
||||
array('student', 'teacher', 'editingteacher')));
|
||||
|
||||
$max_upload_choices = get_max_upload_sizes();
|
||||
// maxbytes set to 0 will allow the maximum server limit for uploads
|
||||
$max_upload_choices[0] = new lang_string('serverlimit', 'admin');
|
||||
$temp->add(new admin_setting_configselect('maxbytes', new lang_string('maxbytes', 'admin'), new lang_string('configmaxbytes', 'admin'), 0, $max_upload_choices));
|
||||
$max_upload_choices[0] = get_string('serverlimit', 'admin');
|
||||
$temp->add(new admin_setting_configselect('maxbytes', get_string('maxbytes', 'admin'), get_string('configmaxbytes', 'admin'), 0, $max_upload_choices));
|
||||
// 100MB
|
||||
$defaultuserquota = 104857600;
|
||||
$params = new stdClass();
|
||||
$params->bytes = $defaultuserquota;
|
||||
$params->displaysize = display_size($defaultuserquota);
|
||||
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
|
||||
$temp->add(new admin_setting_configtext('userquota', get_string('userquota', 'admin'), get_string('configuserquota', 'admin', $params), $defaultuserquota));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('maxeditingtime', new lang_string('maxeditingtime','admin'), new lang_string('configmaxeditingtime','admin'), 1800,
|
||||
array(60 => new lang_string('numminutes', '', 1),
|
||||
300 => new lang_string('numminutes', '', 5),
|
||||
900 => new lang_string('numminutes', '', 15),
|
||||
1800 => new lang_string('numminutes', '', 30),
|
||||
2700 => new lang_string('numminutes', '', 45),
|
||||
3600 => new lang_string('numminutes', '', 60))));
|
||||
$temp->add(new admin_setting_configselect('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'), new lang_string('configfullnamedisplay', 'admin'),
|
||||
'language', array('language' => new lang_string('language'),
|
||||
'firstname lastname' => new lang_string('firstname').' + '.new lang_string('lastname'),
|
||||
'lastname firstname' => new lang_string('lastname').' + '.new lang_string('firstname'),
|
||||
'firstname' => new lang_string('firstname'))));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', new lang_string('extendedusernamechars', 'admin'), new lang_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('sitepolicy', new lang_string('sitepolicy', 'admin'), new lang_string('sitepolicy_help', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sitepolicyguest', new lang_string('sitepolicyguest', 'admin'), new lang_string('sitepolicyguest_help', 'admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', new lang_string('extendedusernamechars', 'admin'), new lang_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('keeptagnamecase', new lang_string('keeptagnamecase','admin'),new lang_string('configkeeptagnamecase', 'admin'),'1'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowobjectembed', get_string('allowobjectembed', 'admin'), get_string('configallowobjectembed', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enabletrusttext', get_string('enabletrusttext', 'admin'), get_string('configenabletrusttext', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('maxeditingtime', get_string('maxeditingtime','admin'), get_string('configmaxeditingtime','admin'), 1800,
|
||||
array(60 => get_string('numminutes', '', 1),
|
||||
300 => get_string('numminutes', '', 5),
|
||||
900 => get_string('numminutes', '', 15),
|
||||
1800 => get_string('numminutes', '', 30),
|
||||
2700 => get_string('numminutes', '', 45),
|
||||
3600 => get_string('numminutes', '', 60))));
|
||||
$temp->add(new admin_setting_configselect('fullnamedisplay', get_string('fullnamedisplay', 'admin'), get_string('configfullnamedisplay', 'admin'),
|
||||
'language', array('language' => get_string('language'),
|
||||
'firstname lastname' => get_string('firstname').' + '.get_string('lastname'),
|
||||
'lastname firstname' => get_string('lastname').' + '.get_string('firstname'),
|
||||
'firstname' => get_string('firstname'))));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', get_string('extendedusernamechars', 'admin'), get_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('sitepolicy', get_string('sitepolicy', 'admin'), get_string('sitepolicy_help', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sitepolicyguest', get_string('sitepolicyguest', 'admin'), get_string('sitepolicyguest_help', 'admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', get_string('extendedusernamechars', 'admin'), get_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('keeptagnamecase', get_string('keeptagnamecase','admin'),get_string('configkeeptagnamecase', 'admin'),'1'));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('profilesforenrolledusersonly', new lang_string('profilesforenrolledusersonly','admin'),new lang_string('configprofilesforenrolledusersonly', 'admin'),'1'));
|
||||
$temp->add(new admin_setting_configcheckbox('profilesforenrolledusersonly', get_string('profilesforenrolledusersonly','admin'),get_string('configprofilesforenrolledusersonly', 'admin'),'1'));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('cronclionly', new lang_string('cronclionly', 'admin'), new lang_string('configcronclionly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', new lang_string('cronremotepassword', 'admin'), new lang_string('configcronremotepassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('cronclionly', get_string('cronclionly', 'admin'), get_string('configcronclionly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', get_string('cronremotepassword', 'admin'), get_string('configcronremotepassword', 'admin'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('passwordpolicy', new lang_string('passwordpolicy', 'admin'), new lang_string('configpasswordpolicy', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlength', new lang_string('minpasswordlength', 'admin'), new lang_string('configminpasswordlength', 'admin'), 8, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpassworddigits', new lang_string('minpassworddigits', 'admin'), new lang_string('configminpassworddigits', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlower', new lang_string('minpasswordlower', 'admin'), new lang_string('configminpasswordlower', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordupper', new lang_string('minpasswordupper', 'admin'), new lang_string('configminpasswordupper', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordnonalphanum', new lang_string('minpasswordnonalphanum', 'admin'), new lang_string('configminpasswordnonalphanum', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('maxconsecutiveidentchars', new lang_string('maxconsecutiveidentchars', 'admin'), new lang_string('configmaxconsecutiveidentchars', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', new lang_string('groupenrolmentkeypolicy', 'admin'), new lang_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('disableuserimages', new lang_string('disableuserimages', 'admin'), new lang_string('configdisableuserimages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', new lang_string('emailchangeconfirmation', 'admin'), new lang_string('configemailchangeconfirmation', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('rememberusername', new lang_string('rememberusername','admin'), new lang_string('rememberusername_desc','admin'), 2, array(1=>new lang_string('yes'), 0=>new lang_string('no'), 2=>new lang_string('optional'))));
|
||||
$temp->add(new admin_setting_configcheckbox('strictformsrequired', new lang_string('strictformsrequired', 'admin'), new lang_string('configstrictformsrequired', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('passwordpolicy', get_string('passwordpolicy', 'admin'), get_string('configpasswordpolicy', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlength', get_string('minpasswordlength', 'admin'), get_string('configminpasswordlength', 'admin'), 8, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpassworddigits', get_string('minpassworddigits', 'admin'), get_string('configminpassworddigits', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlower', get_string('minpasswordlower', 'admin'), get_string('configminpasswordlower', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordupper', get_string('minpasswordupper', 'admin'), get_string('configminpasswordupper', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordnonalphanum', get_string('minpasswordnonalphanum', 'admin'), get_string('configminpasswordnonalphanum', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('maxconsecutiveidentchars', get_string('maxconsecutiveidentchars', 'admin'), get_string('configmaxconsecutiveidentchars', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', get_string('groupenrolmentkeypolicy', 'admin'), get_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('disableuserimages', get_string('disableuserimages', 'admin'), get_string('configdisableuserimages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', get_string('emailchangeconfirmation', 'admin'), get_string('configemailchangeconfirmation', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('rememberusername', get_string('rememberusername','admin'), get_string('rememberusername_desc','admin'), 2, array(1=>get_string('yes'), 0=>get_string('no'), 2=>get_string('optional'))));
|
||||
$temp->add(new admin_setting_configcheckbox('strictformsrequired', get_string('strictformsrequired', 'admin'), get_string('configstrictformsrequired', 'admin'), 0));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
|
||||
|
||||
// "httpsecurity" settingpage
|
||||
$temp = new admin_settingpage('httpsecurity', new lang_string('httpsecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('loginhttps', new lang_string('loginhttps', 'admin'), new lang_string('configloginhttps', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', new lang_string('loginpasswordautocomplete', 'admin'), new lang_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
$temp = new admin_settingpage('httpsecurity', get_string('httpsecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('loginhttps', get_string('loginhttps', 'admin'), get_string('configloginhttps', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiesecure', get_string('cookiesecure', 'admin'), get_string('configcookiesecure', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', get_string('cookiehttponly', 'admin'), get_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', get_string('allowframembedding', 'admin'), get_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', get_string('loginpasswordautocomplete', 'admin'), get_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
// "modulesecurity" settingpage
|
||||
$temp = new admin_settingpage('modulesecurity', get_string('modulesecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('restrictmodulesfor', get_string('restrictmodulesfor', 'admin'), get_string('configrestrictmodulesfor', 'admin'), 'none', array('none' => get_string('nocourses'),
|
||||
'all' => get_string('fulllistofcourses'),
|
||||
'requested' => get_string('requestedcourses'))));
|
||||
$temp->add(new admin_setting_configcheckbox('restrictbydefault', get_string('restrictbydefault', 'admin'), get_string('configrestrictbydefault', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configmultiselect_modules('defaultallowedmodules',
|
||||
get_string('defaultallowedmodules', 'admin'),
|
||||
get_string('configdefaultallowedmodules', 'admin')));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
|
||||
// "notifications" settingpage
|
||||
$temp = new admin_settingpage('notifications', new lang_string('notifications', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('displayloginfailures', new lang_string('displayloginfailures', 'admin'), new lang_string('configdisplayloginfailures', 'admin'), '', array('' => new lang_string('nobody'),
|
||||
'admin' => new lang_string('administrators'),
|
||||
'teacher' => new lang_string('administratorsandteachers'),
|
||||
'everybody' => new lang_string('everybody'))));
|
||||
$temp->add(new admin_setting_users_with_capability('notifyloginfailures', new lang_string('notifyloginfailures', 'admin'), new lang_string('confignotifyloginfailures', 'admin'), array(), 'moodle/site:config'));
|
||||
$temp = new admin_settingpage('notifications', get_string('notifications', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('displayloginfailures', get_string('displayloginfailures', 'admin'), get_string('configdisplayloginfailures', 'admin'), '', array('' => get_string('nobody'),
|
||||
'admin' => get_string('administrators'),
|
||||
'teacher' => get_string('administratorsandteachers'),
|
||||
'everybody' => get_string('everybody'))));
|
||||
$temp->add(new admin_setting_users_with_capability('notifyloginfailures', get_string('notifyloginfailures', 'admin'), get_string('confignotifyloginfailures', 'admin'), array(), 'moodle/site:config'));
|
||||
$options = array();
|
||||
for ($i = 1; $i <= 100; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('notifyloginthreshold', new lang_string('notifyloginthreshold', 'admin'), new lang_string('confignotifyloginthreshold', 'admin'), '10', $options));
|
||||
$temp->add(new admin_setting_configselect('notifyloginthreshold', get_string('notifyloginthreshold', 'admin'), get_string('confignotifyloginthreshold', 'admin'), '10', $options));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
@@ -106,12 +119,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// "antivirus" settingpage
|
||||
$temp = new admin_settingpage('antivirus', new lang_string('antivirus', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('runclamonupload', new lang_string('runclamavonupload', 'admin'), new lang_string('configrunclamavonupload', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configexecutable('pathtoclam', new lang_string('pathtoclam', 'admin'), new lang_string('configpathtoclam', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configdirectory('quarantinedir', new lang_string('quarantinedir', 'admin'), new lang_string('configquarantinedir', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('clamfailureonupload', new lang_string('clamfailureonupload', 'admin'), new lang_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => new lang_string('configclamdonothing', 'admin'),
|
||||
'actlikevirus' => new lang_string('configclamactlikevirus', 'admin'))));
|
||||
$temp = new admin_settingpage('antivirus', get_string('antivirus', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('runclamonupload', get_string('runclamavonupload', 'admin'), get_string('configrunclamavonupload', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configexecutable('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configdirectory('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('clamfailureonupload', get_string('clamfailureonupload', 'admin'), get_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => get_string('configclamdonothing', 'admin'),
|
||||
'actlikevirus' => get_string('configclamactlikevirus', 'admin'))));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+147
-148
@@ -6,19 +6,19 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// "systempaths" settingpage
|
||||
$temp = new admin_settingpage('systempaths', new lang_string('systempaths','admin'));
|
||||
$temp->add(new admin_setting_configselect('gdversion', new lang_string('gdversion','admin'), new lang_string('configgdversion', 'admin'), check_gd_version(), array('0' => new lang_string('gdnot'),
|
||||
'1' => new lang_string('gd1'),
|
||||
'2' => new lang_string('gd2'))));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('pathtodu', 'admin'), new lang_string('configpathtodu', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
|
||||
$temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
|
||||
$temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
|
||||
'1' => get_string('gd1'),
|
||||
'2' => get_string('gd2'))));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodot', get_string('pathtodot', 'admin'), get_string('pathtodot_help', 'admin'), ''));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
|
||||
// "supportcontact" settingpage
|
||||
$temp = new admin_settingpage('supportcontact', new lang_string('supportcontact','admin'));
|
||||
$temp = new admin_settingpage('supportcontact', get_string('supportcontact','admin'));
|
||||
if (isloggedin()) {
|
||||
global $USER;
|
||||
$primaryadminemail = $USER->email;
|
||||
@@ -29,158 +29,158 @@ if (isloggedin()) {
|
||||
$primaryadminemail = NULL;
|
||||
$primaryadminname = NULL;
|
||||
}
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'), new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'), new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
$temp->add(new admin_setting_configtext('supportname', get_string('supportname', 'admin'), get_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportemail', get_string('supportemail', 'admin'), get_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportpage', get_string('supportpage', 'admin'), get_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "sessionhandling" settingpage
|
||||
$temp = new admin_settingpage('sessionhandling', new lang_string('sessionhandling', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('dbsessions', new lang_string('dbsessions', 'admin'), new lang_string('configdbsessions', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('sessiontimeout', new lang_string('sessiontimeout', 'admin'), new lang_string('configsessiontimeout', 'admin'), 7200, array(14400 => new lang_string('numhours', '', 4),
|
||||
10800 => new lang_string('numhours', '', 3),
|
||||
7200 => new lang_string('numhours', '', 2),
|
||||
5400 => new lang_string('numhours', '', '1.5'),
|
||||
3600 => new lang_string('numminutes', '', 60),
|
||||
2700 => new lang_string('numminutes', '', 45),
|
||||
1800 => new lang_string('numminutes', '', 30),
|
||||
900 => new lang_string('numminutes', '', 15),
|
||||
300 => new lang_string('numminutes', '', 5))));
|
||||
$temp->add(new admin_setting_configtext('sessioncookie', new lang_string('sessioncookie', 'admin'), new lang_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiepath', new lang_string('sessioncookiepath', 'admin'), new lang_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiedomain', new lang_string('sessioncookiedomain', 'admin'), new lang_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
|
||||
$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
|
||||
10800 => get_string('numhours', '', 3),
|
||||
7200 => get_string('numhours', '', 2),
|
||||
5400 => get_string('numhours', '', '1.5'),
|
||||
3600 => get_string('numminutes', '', 60),
|
||||
2700 => get_string('numminutes', '', 45),
|
||||
1800 => get_string('numminutes', '', 30),
|
||||
900 => get_string('numminutes', '', 15),
|
||||
300 => get_string('numminutes', '', 5))));
|
||||
$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiedomain', get_string('sessioncookiedomain', 'admin'), get_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "stats" settingpage
|
||||
$temp = new admin_settingpage('stats', new lang_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
|
||||
$temp->add(new admin_setting_configselect('statsfirstrun', new lang_string('statsfirstrun', 'admin'), new lang_string('configstatsfirstrun', 'admin'), 'none', array('none' => new lang_string('none'),
|
||||
60*60*24*7 => new lang_string('numweeks','moodle',1),
|
||||
60*60*24*14 => new lang_string('numweeks','moodle',2),
|
||||
60*60*24*21 => new lang_string('numweeks','moodle',3),
|
||||
60*60*24*28 => new lang_string('nummonths','moodle',1),
|
||||
60*60*24*56 => new lang_string('nummonths','moodle',2),
|
||||
60*60*24*84 => new lang_string('nummonths','moodle',3),
|
||||
60*60*24*112 => new lang_string('nummonths','moodle',4),
|
||||
60*60*24*140 => new lang_string('nummonths','moodle',5),
|
||||
60*60*24*168 => new lang_string('nummonths','moodle',6),
|
||||
'all' => new lang_string('all') )));
|
||||
$temp->add(new admin_setting_configselect('statsmaxruntime', new lang_string('statsmaxruntime', 'admin'), new lang_string('configstatsmaxruntime3', 'admin'), 0, array(0 => new lang_string('untilcomplete'),
|
||||
60*30 => '10 '.new lang_string('minutes'),
|
||||
60*30 => '30 '.new lang_string('minutes'),
|
||||
60*60 => '1 '.new lang_string('hour'),
|
||||
60*60*2 => '2 '.new lang_string('hours'),
|
||||
60*60*3 => '3 '.new lang_string('hours'),
|
||||
60*60*4 => '4 '.new lang_string('hours'),
|
||||
60*60*5 => '5 '.new lang_string('hours'),
|
||||
60*60*6 => '6 '.new lang_string('hours'),
|
||||
60*60*7 => '7 '.new lang_string('hours'),
|
||||
60*60*8 => '8 '.new lang_string('hours') )));
|
||||
$temp->add(new admin_setting_configtext('statsruntimedays', new lang_string('statsruntimedays', 'admin'), new lang_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', new lang_string('statsruntimestart', 'admin'), new lang_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtext('statsuserthreshold', new lang_string('statsuserthreshold', 'admin'), new lang_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
|
||||
$temp = new admin_settingpage('stats', get_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
|
||||
$temp->add(new admin_setting_configselect('statsfirstrun', get_string('statsfirstrun', 'admin'), get_string('configstatsfirstrun', 'admin'), 'none', array('none' => get_string('none'),
|
||||
60*60*24*7 => get_string('numweeks','moodle',1),
|
||||
60*60*24*14 => get_string('numweeks','moodle',2),
|
||||
60*60*24*21 => get_string('numweeks','moodle',3),
|
||||
60*60*24*28 => get_string('nummonths','moodle',1),
|
||||
60*60*24*56 => get_string('nummonths','moodle',2),
|
||||
60*60*24*84 => get_string('nummonths','moodle',3),
|
||||
60*60*24*112 => get_string('nummonths','moodle',4),
|
||||
60*60*24*140 => get_string('nummonths','moodle',5),
|
||||
60*60*24*168 => get_string('nummonths','moodle',6),
|
||||
'all' => get_string('all') )));
|
||||
$temp->add(new admin_setting_configselect('statsmaxruntime', get_string('statsmaxruntime', 'admin'), get_string('configstatsmaxruntime3', 'admin'), 0, array(0 => get_string('untilcomplete'),
|
||||
60*30 => '10 '.get_string('minutes'),
|
||||
60*30 => '30 '.get_string('minutes'),
|
||||
60*60 => '1 '.get_string('hour'),
|
||||
60*60*2 => '2 '.get_string('hours'),
|
||||
60*60*3 => '3 '.get_string('hours'),
|
||||
60*60*4 => '4 '.get_string('hours'),
|
||||
60*60*5 => '5 '.get_string('hours'),
|
||||
60*60*6 => '6 '.get_string('hours'),
|
||||
60*60*7 => '7 '.get_string('hours'),
|
||||
60*60*8 => '8 '.get_string('hours') )));
|
||||
$temp->add(new admin_setting_configtext('statsruntimedays', get_string('statsruntimedays', 'admin'), get_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', get_string('statsruntimestart', 'admin'), get_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtext('statsuserthreshold', get_string('statsuserthreshold', 'admin'), get_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "http" settingpage
|
||||
$temp = new admin_settingpage('http', new lang_string('http', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('slasharguments', new lang_string('slasharguments', 'admin'), new lang_string('configslasharguments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_heading('reverseproxy', new lang_string('reverseproxy', 'admin'), '', ''));
|
||||
$temp = new admin_settingpage('http', get_string('http', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_heading('reverseproxy', get_string('reverseproxy', 'admin'), '', ''));
|
||||
$options = array(
|
||||
0 => 'HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
|
||||
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'), new lang_string('configgetremoteaddrconf', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_heading('webproxy', new lang_string('webproxy', 'admin'), new lang_string('webproxyinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('proxyhost', new lang_string('proxyhost', 'admin'), new lang_string('configproxyhost', 'admin'), '', PARAM_HOST));
|
||||
$temp->add(new admin_setting_configtext('proxyport', new lang_string('proxyport', 'admin'), new lang_string('configproxyport', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configselect('getremoteaddrconf', get_string('getremoteaddrconf', 'admin'), get_string('configgetremoteaddrconf', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_heading('webproxy', get_string('webproxy', 'admin'), get_string('webproxyinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
|
||||
$temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
|
||||
$options = array('HTTP'=>'HTTP');
|
||||
if (defined('CURLPROXY_SOCKS5')) {
|
||||
$options['SOCKS5'] = 'SOCKS5';
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('proxytype', new lang_string('proxytype', 'admin'), new lang_string('configproxytype','admin'), 'HTTP', $options));
|
||||
$temp->add(new admin_setting_configtext('proxyuser', new lang_string('proxyuser', 'admin'), new lang_string('configproxyuser', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configpasswordunmask('proxypassword', new lang_string('proxypassword', 'admin'), new lang_string('configproxypassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtext('proxybypass', new lang_string('proxybypass', 'admin'), new lang_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
|
||||
$temp->add(new admin_setting_configselect('proxytype', get_string('proxytype', 'admin'), get_string('configproxytype','admin'), 'HTTP', $options));
|
||||
$temp->add(new admin_setting_configtext('proxyuser', get_string('proxyuser', 'admin'), get_string('configproxyuser', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configpasswordunmask('proxypassword', get_string('proxypassword', 'admin'), get_string('configproxypassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtext('proxybypass', get_string('proxybypass', 'admin'), get_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
$temp = new admin_settingpage('maintenancemode', new lang_string('sitemaintenancemode', 'admin'));
|
||||
$options = array(0=>new lang_string('disable'), 1=>new lang_string('enable'));
|
||||
$temp->add(new admin_setting_configselect('maintenance_enabled', new lang_string('sitemaintenancemode', 'admin'),
|
||||
new lang_string('helpsitemaintenance', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_confightmleditor('maintenance_message', new lang_string('optionalmaintenancemessage', 'admin'),
|
||||
$temp = new admin_settingpage('maintenancemode', get_string('sitemaintenancemode', 'admin'));
|
||||
$options = array(0=>get_string('disable'), 1=>get_string('enable'));
|
||||
$temp->add(new admin_setting_configselect('maintenance_enabled', get_string('sitemaintenancemode', 'admin'),
|
||||
get_string('helpsitemaintenance', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_confightmleditor('maintenance_message', get_string('optionalmaintenancemessage', 'admin'),
|
||||
'', ''));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
$temp = new admin_settingpage('cleanup', new lang_string('cleanup', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('deleteunconfirmed', new lang_string('deleteunconfirmed', 'admin'), new lang_string('configdeleteunconfirmed', 'admin'), 168, array(0 => new lang_string('never'),
|
||||
168 => new lang_string('numdays', '', 7),
|
||||
144 => new lang_string('numdays', '', 6),
|
||||
120 => new lang_string('numdays', '', 5),
|
||||
96 => new lang_string('numdays', '', 4),
|
||||
72 => new lang_string('numdays', '', 3),
|
||||
48 => new lang_string('numdays', '', 2),
|
||||
24 => new lang_string('numdays', '', 1),
|
||||
12 => new lang_string('numhours', '', 12),
|
||||
6 => new lang_string('numhours', '', 6),
|
||||
1 => new lang_string('numhours', '', 1))));
|
||||
$temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
|
||||
168 => get_string('numdays', '', 7),
|
||||
144 => get_string('numdays', '', 6),
|
||||
120 => get_string('numdays', '', 5),
|
||||
96 => get_string('numdays', '', 4),
|
||||
72 => get_string('numdays', '', 3),
|
||||
48 => get_string('numdays', '', 2),
|
||||
24 => get_string('numdays', '', 1),
|
||||
12 => get_string('numhours', '', 12),
|
||||
6 => get_string('numhours', '', 6),
|
||||
1 => get_string('numhours', '', 1))));
|
||||
|
||||
$temp->add(new admin_setting_configselect('deleteincompleteusers', new lang_string('deleteincompleteusers', 'admin'), new lang_string('configdeleteincompleteusers', 'admin'), 0, array(0 => new lang_string('never'),
|
||||
168 => new lang_string('numdays', '', 7),
|
||||
144 => new lang_string('numdays', '', 6),
|
||||
120 => new lang_string('numdays', '', 5),
|
||||
96 => new lang_string('numdays', '', 4),
|
||||
72 => new lang_string('numdays', '', 3),
|
||||
48 => new lang_string('numdays', '', 2),
|
||||
24 => new lang_string('numdays', '', 1))));
|
||||
$temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('deleteincompleteusers', 'admin'), get_string('configdeleteincompleteusers', 'admin'), 0, array(0 => get_string('never'),
|
||||
168 => get_string('numdays', '', 7),
|
||||
144 => get_string('numdays', '', 6),
|
||||
120 => get_string('numdays', '', 5),
|
||||
96 => get_string('numdays', '', 4),
|
||||
72 => get_string('numdays', '', 3),
|
||||
48 => get_string('numdays', '', 2),
|
||||
24 => get_string('numdays', '', 1))));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('logguests', new lang_string('logguests', 'admin'),
|
||||
new lang_string('logguests_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('loglifetime', new lang_string('loglifetime', 'admin'), new lang_string('configloglifetime', 'admin'), 0, array(0 => new lang_string('neverdeletelogs'),
|
||||
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_configcheckbox('logguests', get_string('logguests', 'admin'),
|
||||
get_string('logguests_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
|
||||
1000 => get_string('numdays', '', 1000),
|
||||
365 => get_string('numdays', '', 365),
|
||||
180 => get_string('numdays', '', 180),
|
||||
150 => get_string('numdays', '', 150),
|
||||
120 => get_string('numdays', '', 120),
|
||||
90 => get_string('numdays', '', 90),
|
||||
60 => get_string('numdays', '', 60),
|
||||
35 => get_string('numdays', '', 35),
|
||||
10 => get_string('numdays', '', 10),
|
||||
5 => get_string('numdays', '', 5),
|
||||
2 => get_string('numdays', '', 2))));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('disablegradehistory', new lang_string('disablegradehistory', 'grades'),
|
||||
new lang_string('disablegradehistory_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('disablegradehistory', get_string('disablegradehistory', 'grades'),
|
||||
get_string('disablegradehistory_help', 'grades'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_string('gradehistorylifetime', 'grades'),
|
||||
new lang_string('gradehistorylifetime_help', 'grades'), 0, array(0 => new lang_string('neverdeletehistory', 'grades'),
|
||||
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),
|
||||
30 => new lang_string('numdays', '', 30))));
|
||||
$temp->add(new admin_setting_configselect('gradehistorylifetime', get_string('gradehistorylifetime', 'grades'),
|
||||
get_string('gradehistorylifetime_help', 'grades'), 0, array(0 => get_string('neverdeletehistory', 'grades'),
|
||||
1000 => get_string('numdays', '', 1000),
|
||||
365 => get_string('numdays', '', 365),
|
||||
180 => get_string('numdays', '', 180),
|
||||
150 => get_string('numdays', '', 150),
|
||||
120 => get_string('numdays', '', 120),
|
||||
90 => get_string('numdays', '', 90),
|
||||
60 => get_string('numdays', '', 60),
|
||||
30 => get_string('numdays', '', 30))));
|
||||
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
|
||||
$ADMIN->add('server', new admin_externalpage('environment', new lang_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('phpinfo', new lang_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
||||
|
||||
|
||||
// "performance" settingpage
|
||||
$temp = new admin_settingpage('performance', new lang_string('performance', 'admin'));
|
||||
$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
|
||||
|
||||
$temp->add(new admin_setting_configtext('numcoursesincombo', new lang_string('numcoursesincombo', 'admin'), new lang_string('numcoursesincombo_help', 'admin'), 500));
|
||||
$temp->add(new admin_setting_configtext('numcoursesincombo', get_string('numcoursesincombo', 'admin'), get_string('numcoursesincombo_help', 'admin'), 500));
|
||||
|
||||
$temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('extramemorylimit', 'admin'),
|
||||
new lang_string('configextramemorylimit', 'admin'), '512M',
|
||||
$temp->add(new admin_setting_configselect('extramemorylimit', get_string('extramemorylimit', 'admin'),
|
||||
get_string('configextramemorylimit', 'admin'), '512M',
|
||||
// if this option is set to 0, default 128M will be used
|
||||
array( '64M' => '64M',
|
||||
'128M' => '128M',
|
||||
@@ -188,38 +188,37 @@ $temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('e
|
||||
'512M' => '512M',
|
||||
'1024M' => '1024M'
|
||||
)));
|
||||
$temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'),
|
||||
new lang_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'),
|
||||
new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('curlcache', get_string('curlcache', 'admin'),
|
||||
get_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', get_string('curltimeoutkbitrate', 'admin'),
|
||||
get_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
|
||||
$temp->add(new admin_setting_special_selectsetup('cachetype', get_string('cachetype', 'admin'),
|
||||
get_string('configcachetype', 'admin'), '',
|
||||
array( '' => get_string('none'),
|
||||
'internal' => 'internal',
|
||||
'memcached' => 'memcached',
|
||||
'eaccelerator' => 'eaccelerator')));
|
||||
// NOTE: $CFG->rcache is forced to bool in lib/setup.php
|
||||
$temp->add(new admin_setting_special_selectsetup('rcache', get_string('rcache', 'admin'),
|
||||
get_string('configrcache', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
|
||||
get_string('configrcachettl', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
|
||||
get_string('configintcachemax', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
|
||||
get_string('configmemcachedhosts', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
|
||||
get_string('configmemcachedpconn', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
*/
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
// "update notifications" settingpage
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$temp = new admin_settingpage('updatenotifications', new lang_string('updatenotifications', 'core_admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('updateautocheck', new lang_string('updateautocheck', 'core_admin'),
|
||||
new lang_string('updateautocheck_desc', 'core_admin'), 1));
|
||||
if (empty($CFG->disableupdateautodeploy)) {
|
||||
$temp->add(new admin_setting_configcheckbox('updateautodeploy', new lang_string('updateautodeploy', 'core_admin'),
|
||||
new lang_string('updateautodeploy_desc', 'core_admin'), 0));
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('updateminmaturity', new lang_string('updateminmaturity', 'core_admin'),
|
||||
new lang_string('updateminmaturity_desc', 'core_admin'), MATURITY_STABLE,
|
||||
array(
|
||||
MATURITY_ALPHA => new lang_string('maturity'.MATURITY_ALPHA, 'core_admin'),
|
||||
MATURITY_BETA => new lang_string('maturity'.MATURITY_BETA, 'core_admin'),
|
||||
MATURITY_RC => new lang_string('maturity'.MATURITY_RC, 'core_admin'),
|
||||
MATURITY_STABLE => new lang_string('maturity'.MATURITY_STABLE, 'core_admin'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('updatenotifybuilds', new lang_string('updatenotifybuilds', 'core_admin'),
|
||||
new lang_string('updatenotifybuilds_desc', 'core_admin'), 0));
|
||||
$ADMIN->add('server', $temp);
|
||||
}
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
@@ -2,43 +2,45 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', new lang_string('enableoutcomes', 'grades'), new lang_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', new lang_string('usetags','admin'),new lang_string('configusetags', 'admin'), '1'));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', get_string('usetags','admin'),get_string('configusetags', 'admin'), '1'));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', new lang_string('enablenotes', 'notes'), new lang_string('configenablenotes', 'notes'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', get_string('enablenotes', 'notes'), get_string('configenablenotes', 'notes'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', new lang_string('enabled', 'portfolio'), new lang_string('enableddesc', 'portfolio'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', get_string('enabled', 'portfolio'), get_string('enableddesc', 'portfolio'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', new lang_string('enablewebservices', 'admin'), new lang_string('configenablewebservices', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', get_string('enablewebservices', 'admin'), get_string('configenablewebservices', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', new lang_string('messaging', 'admin'), new lang_string('configmessaging','admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', get_string('messaging', 'admin'), get_string('configmessaging','admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', new lang_string('messaginghidereadnotifications', 'admin'), new lang_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', get_string('messaginghidereadnotifications', 'admin'), get_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
|
||||
$options = array(DAYSECS=>new lang_string('secondstotime86400'), WEEKSECS=>new lang_string('secondstotime604800'), 2620800=>new lang_string('nummonths', 'moodle', 1), 15724800=>new lang_string('nummonths', 'moodle', 6),0=>new lang_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', new lang_string('messagingdeletereadnotificationsdelay', 'admin'), new lang_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
$options = array(DAYSECS=>get_string('secondstotime86400'), WEEKSECS=>get_string('secondstotime604800'), 2620800=>get_string('nummonths', 'moodle', 1), 15724800=>get_string('nummonths', 'moodle', 6),0=>get_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', get_string('messagingdeletereadnotificationsdelay', 'admin'), get_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messagingallowemailoverride', new lang_string('messagingallowemailoverride', 'admin'), new lang_string('configmessagingallowemailoverride','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', get_string('enablestats', 'admin'), get_string('configenablestats', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', new lang_string('enablestats', 'admin'), new lang_string('configenablestats', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', new lang_string('enablerssfeeds', 'admin'), new lang_string('configenablerssfeeds', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'),
|
||||
get_string('configbloglevel', 'admin'), 4, array(5 => get_string('worldblogs','blog'),
|
||||
4 => get_string('siteblogs','blog'),
|
||||
1 => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableblogs', new lang_string('enableblogs', 'admin'), new lang_string('configenableblogs', 'admin'), 1));
|
||||
|
||||
$options = array('off'=>new lang_string('off', 'mnet'), 'strict'=>new lang_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', new lang_string('net', 'mnet'), new lang_string('configmnet', 'mnet'), 'off', $options));
|
||||
$options = array('off'=>get_string('off', 'mnet'), 'strict'=>get_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', get_string('net', 'mnet'), get_string('configmnet', 'mnet'), 'off', $options));
|
||||
|
||||
// Conditional activities: completion and availability
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
|
||||
new lang_string('enablecompletion','completion'),
|
||||
new lang_string('configenablecompletion','completion'), 0));
|
||||
get_string('enablecompletion','completion'),
|
||||
get_string('configenablecompletion','completion'), 0));
|
||||
$optionalsubsystems->add($checkbox = new admin_setting_configcheckbox('enableavailability',
|
||||
new lang_string('enableavailability','condition'),
|
||||
new lang_string('configenableavailability','condition'), 0));
|
||||
get_string('enableavailability','condition'),
|
||||
get_string('configenableavailability','condition'), 0));
|
||||
$checkbox->set_affects_modinfo(true);
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', new lang_string('enableplagiarism','plagiarism'), new lang_string('configenableplagiarism','plagiarism'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', get_string('enableplagiarism','plagiarism'), get_string('configenableplagiarism','plagiarism'), 0));
|
||||
}
|
||||
|
||||
+25
-25
@@ -5,44 +5,44 @@
|
||||
// since they need to exist *before* settingpages and externalpages
|
||||
// are added to them.
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$hassiteconfig = has_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
|
||||
$ADMIN->add('root', new admin_externalpage('registrationindex', get_string('registration','admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('registration', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationselector', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/hubselector.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('siteregistrationconfirmed',
|
||||
new lang_string('registrationconfirmed', 'hub'),
|
||||
get_string('registrationconfirmed', 'hub'),
|
||||
$CFG->wwwroot."/".$CFG->admin."/registration/confirmregistration.php", 'moodle/site:config', true));
|
||||
// hidden upgrade script
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', new lang_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', new lang_string('advancedfeatures', 'admin'));
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('advancedfeatures', 'admin'));
|
||||
$ADMIN->add('root', $optionalsubsystems);
|
||||
}
|
||||
|
||||
$ADMIN->add('root', new admin_category('users', new lang_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', new lang_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', new lang_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', new lang_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', new lang_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', new lang_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', new lang_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', new lang_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', new lang_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', new lang_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', new lang_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', new lang_string('development', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', get_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('location', get_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', get_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', get_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
|
||||
|
||||
// hidden unsupported category
|
||||
$ADMIN->add('root', new admin_category('unsupported', new lang_string('unsupported', 'admin'), true));
|
||||
$ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
|
||||
|
||||
// hidden search script
|
||||
$ADMIN->add('root', new admin_externalpage('search', new lang_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
|
||||
+54
-56
@@ -2,8 +2,8 @@
|
||||
|
||||
// This file defines settingpages and externalpages under the "users" category
|
||||
|
||||
$ADMIN->add('users', new admin_category('accounts', new lang_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', new lang_string('permissions', 'role')));
|
||||
$ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
|
||||
|
||||
if ($hassiteconfig
|
||||
or has_capability('moodle/user:create', $systemcontext)
|
||||
@@ -21,20 +21,20 @@ if ($hassiteconfig
|
||||
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
|
||||
}
|
||||
// stuff under the "accounts" subcategory
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', new lang_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', new lang_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', new lang_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', new lang_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', new lang_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', get_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
|
||||
|
||||
// stuff under the "roles" subcategory
|
||||
|
||||
// "userpolicies" settingpage
|
||||
$temp = new admin_settingpage('userpolicies', new lang_string('userpolicies', 'admin'));
|
||||
$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
if (!during_initial_install()) {
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$otherroles = array();
|
||||
$guestroles = array();
|
||||
@@ -45,9 +45,8 @@ if ($hassiteconfig
|
||||
$defaultuserid = null;
|
||||
$defaultguestid = null;
|
||||
|
||||
$roles = role_fix_names(get_all_roles(), null, ROLENAME_ORIGINALANDSHORT);
|
||||
foreach ($roles as $role) {
|
||||
$rolename = $role->localname;
|
||||
foreach (get_all_roles() as $role) {
|
||||
$rolename = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
|
||||
switch ($role->archetype) {
|
||||
case 'manager':
|
||||
$creatornewroles[$role->id] = $rolename;
|
||||
@@ -81,28 +80,28 @@ if ($hassiteconfig
|
||||
}
|
||||
|
||||
if (empty($guestroles)) {
|
||||
$guestroles[0] = new lang_string('none');
|
||||
$guestroles[0] = get_string('none');
|
||||
$defaultguestid = 0;
|
||||
}
|
||||
|
||||
if (empty($userroles)) {
|
||||
$userroles[0] = new lang_string('none');
|
||||
$userroles[0] = get_string('none');
|
||||
$defaultuserid = 0;
|
||||
}
|
||||
|
||||
$restorersnewrole = $creatornewroles;
|
||||
$restorersnewrole[0] = new lang_string('none');
|
||||
$restorersnewrole[0] = get_string('none');
|
||||
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', new lang_string('notloggedinroleid', 'admin'),
|
||||
new lang_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', new lang_string('guestroleid', 'admin'),
|
||||
new lang_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', new lang_string('defaultuserroleid', 'admin'),
|
||||
new lang_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', new lang_string('creatornewroleid', 'admin'),
|
||||
new lang_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', new lang_string('restorernewroleid', 'admin'),
|
||||
new lang_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
|
||||
get_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
|
||||
get_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
|
||||
get_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
|
||||
get_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', get_string('restorernewroleid', 'admin'),
|
||||
get_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
|
||||
// release memory
|
||||
unset($otherroles);
|
||||
@@ -112,24 +111,24 @@ if ($hassiteconfig
|
||||
unset($restorersnewrole);
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', new lang_string('autologinguests', 'admin'), new lang_string('configautologinguests', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', new lang_string('hiddenuserfields', 'admin'),
|
||||
new lang_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => new lang_string('description'),
|
||||
'city' => new lang_string('city'),
|
||||
'country' => new lang_string('country'),
|
||||
'webpage' => new lang_string('webpage'),
|
||||
'icqnumber' => new lang_string('icqnumber'),
|
||||
'skypeid' => new lang_string('skypeid'),
|
||||
'yahooid' => new lang_string('yahooid'),
|
||||
'aimid' => new lang_string('aimid'),
|
||||
'msnid' => new lang_string('msnid'),
|
||||
'firstaccess' => new lang_string('firstaccess'),
|
||||
'lastaccess' => new lang_string('lastaccess'),
|
||||
'mycourses' => new lang_string('mycourses'),
|
||||
'groups' => new lang_string('groups'),
|
||||
'suspended' => new lang_string('suspended', 'auth'),
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
|
||||
get_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => get_string('description'),
|
||||
'city' => get_string('city'),
|
||||
'country' => get_string('country'),
|
||||
'webpage' => get_string('webpage'),
|
||||
'icqnumber' => get_string('icqnumber'),
|
||||
'skypeid' => get_string('skypeid'),
|
||||
'yahooid' => get_string('yahooid'),
|
||||
'aimid' => get_string('aimid'),
|
||||
'msnid' => get_string('msnid'),
|
||||
'firstaccess' => get_string('firstaccess'),
|
||||
'lastaccess' => get_string('lastaccess'),
|
||||
'mycourses' => get_string('mycourses'),
|
||||
'groups' => get_string('groups'),
|
||||
'suspended' => get_string('suspended', 'auth'),
|
||||
)));
|
||||
|
||||
// Select fields to display as part of user identity (only to those
|
||||
@@ -141,26 +140,25 @@ if ($hassiteconfig
|
||||
// be a security problem to reveal usernames even to trusted staff.
|
||||
// Custom user profile fields are not currently supported.
|
||||
$temp->add(new admin_setting_configmulticheckbox('showuseridentity',
|
||||
new lang_string('showuseridentity', 'admin'),
|
||||
new lang_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
|
||||
'idnumber' => new lang_string('idnumber'),
|
||||
'email' => new lang_string('email'),
|
||||
'phone1' => new lang_string('phone'),
|
||||
'phone2' => new lang_string('phone2'),
|
||||
'department' => new lang_string('department'),
|
||||
'institution' => new lang_string('institution'),
|
||||
get_string('showuseridentity', 'admin'),
|
||||
get_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
|
||||
'idnumber' => get_string('idnumber'),
|
||||
'email' => get_string('email'),
|
||||
'phone1' => get_string('phone'),
|
||||
'phone2' => get_string('phone2'),
|
||||
'department' => get_string('department'),
|
||||
'institution' => get_string('institution'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', new lang_string('enablegravatar', 'admin'), new lang_string('enablegravatar_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('gravatardefaulturl', new lang_string('gravatardefaulturl', 'admin'), new lang_string('gravatardefaulturl_help', 'admin'), 'mm'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', get_string('enablegravatar', 'admin'), get_string('enablegravatar_help', 'admin'), 0));
|
||||
}
|
||||
|
||||
$ADMIN->add('roles', $temp);
|
||||
|
||||
if (is_siteadmin()) {
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', new lang_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', get_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
}
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', new lang_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', new lang_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', new lang_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', get_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+3
-5
@@ -9,18 +9,16 @@
|
||||
$zone = clean_param($zone, PARAM_PATH);
|
||||
}
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$strtimezone = get_string("timezone");
|
||||
$strsavechanges = get_string("savechanges");
|
||||
$strusers = get_string("users");
|
||||
$strall = get_string("all");
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_title($strtimezone);
|
||||
$PAGE->set_heading($strtimezone);
|
||||
$PAGE->navbar->add($strtimezone);
|
||||
@@ -44,7 +42,7 @@
|
||||
$timezones = get_list_of_timezones();
|
||||
|
||||
echo '<center><form action="timezone.php" method="post">';
|
||||
echo html_writer::label($strusers . ' (' . $strall . '): ', 'menuzone');
|
||||
echo "$strusers ($strall): ";
|
||||
echo html_writer::select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
|
||||
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
|
||||
echo '<input type="submit" value="'.s($strsavechanges).'" />';
|
||||
|
||||
@@ -1,70 +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/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade'));
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$confirm = required_param('confirm', PARAM_BOOL);
|
||||
if (!$confirm) {
|
||||
print_error('invalidrequest');
|
||||
die();
|
||||
}
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
session_get_instance()->write_close(); // release session
|
||||
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$current = 0;
|
||||
if (optional_param('upgradeall', false, PARAM_BOOL)) {
|
||||
$assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
|
||||
} else {
|
||||
$assignmentids = explode(',', optional_param('selected', '', PARAM_TEXT));
|
||||
}
|
||||
$total = count($assignmentids);
|
||||
|
||||
foreach ($assignmentids as $assignmentid) {
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
$current += 1;
|
||||
echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', array('current'=>$current, 'total'=>$total)), 3);
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
}
|
||||
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
@@ -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/>.
|
||||
|
||||
/**
|
||||
* This tool can upgrade old assignment activities to the new assignment activity type
|
||||
*
|
||||
* The upgrade can be done on any old assignment instance providing it is using one of the core
|
||||
* assignment subtypes (online text, single upload, etc).
|
||||
* The new assignment module was introduced in Moodle 2.3 and although it completely reproduces
|
||||
* the features of the existing assignment type it wasn't designed to replace it entirely as there
|
||||
* are many custom assignment types people use and it wouldn't be practical to try to convert them.
|
||||
* Instead the existing assignment type will be left in core and people will be encouraged to
|
||||
* use the new assignment type.
|
||||
*
|
||||
* This screen is the main entry-point to the plugin, it gives the admin a list
|
||||
* of options available to them.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade');
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$actions = array();
|
||||
|
||||
$header = get_string('pluginname', 'tool_assignmentupgrade');
|
||||
$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
|
||||
|
||||
echo $renderer->index_page($header, $actions);
|
||||
@@ -1,60 +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/>.
|
||||
|
||||
/**
|
||||
* Strings for the assignment upgrade tool
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['areyousure'] = 'Are you sure?';
|
||||
$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
|
||||
$string['assignmentid'] = 'Assignment ID';
|
||||
$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
|
||||
$string['assignmentsperpage'] = 'Assignments per page';
|
||||
$string['assignmenttype'] = 'Assignment type';
|
||||
$string['backtoindex'] = 'Back to index';
|
||||
$string['batchoperations'] = 'Batch operations';
|
||||
$string['batchupgrade'] = 'Upgrade multiple assignments';
|
||||
$string['confirmbatchupgrade'] = 'Confirm batch upgrade assignments';
|
||||
$string['conversioncomplete'] = 'Assignment converted';
|
||||
$string['conversionfailed'] = 'The assignment conversion was not successful. The log from the upgrade was: <br />{$a}';
|
||||
$string['listnotupgraded'] = 'List assignments that have not been upgraded';
|
||||
$string['listnotupgraded_desc'] = 'You can upgrade individual assignments from here';
|
||||
$string['noassignmentsselected'] = 'No assignments selected';
|
||||
$string['noassignmentstoupgrade'] = 'There are no assignments that require upgrading';
|
||||
$string['notsupported'] = '';
|
||||
$string['notupgradedintro'] = 'This page lists the assignments created with an older version of Moodle that have not been upgraded to the new assignment module in Moodle 2.3. Not all assignments can be upgraded - if they were created with a custom assignment subtype, then that subtype will need to be upgraded to the new assignment plugin format in order to complete the upgrade.';
|
||||
$string['notupgradedtitle'] = 'Assignments not upgraded';
|
||||
$string['pluginname'] = 'Assignment upgrade helper';
|
||||
$string['select'] = 'Select';
|
||||
$string['submissions'] = 'Submissions';
|
||||
$string['supported'] = 'Upgrade';
|
||||
$string['updatetable'] = 'Update table';
|
||||
$string['unknown'] = 'Unknown';
|
||||
$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
|
||||
$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
|
||||
$string['upgradeassignmentfailed'] = 'Result: Upgrade failed. The log from the upgrade was: <br/><div class="tool_assignmentupgrade_upgradelog">{$a->log}</div>';
|
||||
$string['upgradable'] = 'Upgradable';
|
||||
$string['upgradeselected'] = 'Upgrade selected assignments';
|
||||
$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
|
||||
$string['upgradeall'] = 'Upgrade all assignments';
|
||||
$string['upgradeallconfirm'] = 'Upgrade all assignments?';
|
||||
$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
|
||||
$string['upgradesingle'] = 'Upgrade single assignment';
|
||||
$string['viewcourse'] = 'View the course with the converted assignment';
|
||||
@@ -1,60 +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/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/paginationform.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded'));
|
||||
$PAGE->navbar->add(get_string('listnotupgraded', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$perpage = optional_param('perpage', 0, PARAM_INT);
|
||||
if (!$perpage) {
|
||||
$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 100);
|
||||
} else {
|
||||
set_user_preference('tool_assignmentupgrade_perpage', $perpage);
|
||||
}
|
||||
$assignments = new tool_assignmentupgrade_assignments_table($perpage);
|
||||
|
||||
$batchform = new tool_assignmentupgrade_batchoperations_form();
|
||||
$data = $batchform->get_data();
|
||||
|
||||
if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) {
|
||||
require_sesskey();
|
||||
echo $renderer->confirm_batch_operation_page($data);
|
||||
} else {
|
||||
$paginationform = new tool_assignmentupgrade_pagination_form();
|
||||
$pagedata = new stdClass();
|
||||
$pagedata->perpage = $perpage;
|
||||
$paginationform->set_data($pagedata);
|
||||
echo $renderer->assignment_list_page($assignments, $batchform, $paginationform);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,215 +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/>.
|
||||
|
||||
/**
|
||||
* Assignment upgrade tool library functions
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Get the URL of a script within this plugin.
|
||||
* @param string $script the script name, without .php. E.g. 'index'
|
||||
* @param array $params URL parameters (optional)
|
||||
* @return moodle_url
|
||||
*/
|
||||
function tool_assignmentupgrade_url($script, $params = array()) {
|
||||
return new moodle_url('/admin/tool/assignmentupgrade/' . $script . '.php', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to encapsulate the continue / cancel for batch operations
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_batchoperationconfirm implements renderable {
|
||||
/** @var string $continuemessage The message to show above the continue cancel buttons */
|
||||
public $continuemessage = '';
|
||||
/** @var string $continueurl The url to load if the user clicks continue */
|
||||
public $continueurl;
|
||||
|
||||
/**
|
||||
* Constructor for this class
|
||||
* @param stdClass $data - The data from the previous batch form
|
||||
*/
|
||||
function __construct($data) {
|
||||
if (isset($data->upgradeselected)) {
|
||||
$this->continuemessage = get_string('upgradeselectedcount', 'tool_assignmentupgrade', count(explode(',', $data->selectedassignments)));
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', array('upgradeselected'=>'1', 'confirm'=>'1', 'sesskey'=>sesskey(), 'selected'=>$data->selectedassignments));
|
||||
} else if (isset($data->upgradeall)) {
|
||||
if (!tool_assignmentupgrade_any_upgradable_assignments()) {
|
||||
$this->continuemessage = get_string('noassignmentstoupgrade', 'tool_assignmentupgrade');
|
||||
$this->continueurl = '';
|
||||
} else {
|
||||
$this->continuemessage = get_string('upgradeallconfirm', 'tool_assignmentupgrade');
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', array('upgradeall'=>'1', 'confirm'=>'1', 'sesskey'=>sesskey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class to encapsulate one of the functionalities that this plugin offers.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_action {
|
||||
/** @var string the name of this action. */
|
||||
public $name;
|
||||
/** @var moodle_url the URL to launch this action. */
|
||||
public $url;
|
||||
/** @var string a description of this aciton. */
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Constructor to set the fields.
|
||||
*
|
||||
* In order to create a new tool_assignmentupgrade_action instance you must use the tool_assignmentupgrade_action::make
|
||||
* method.
|
||||
*
|
||||
* @param string $name the name of this action.
|
||||
* @param moodle_url $url the URL to launch this action.
|
||||
* @param string $description a description of this aciton.
|
||||
*/
|
||||
protected function __construct($name, moodle_url $url, $description) {
|
||||
$this->name = $name;
|
||||
$this->url = $url;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make an action with standard values.
|
||||
* @param string $shortname internal name of the action. Used to get strings and build a URL.
|
||||
* @param array $params any URL params required.
|
||||
* @return tool_assignmentupgrade_action
|
||||
*/
|
||||
public static function make($shortname, $params = array()) {
|
||||
return new self(
|
||||
get_string($shortname, 'tool_assignmentupgrade'),
|
||||
tool_assignmentupgrade_url($shortname, $params),
|
||||
get_string($shortname . '_desc', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if there are any assignments that can be upgraded
|
||||
* @return boolean - Are there any assignments that can be upgraded
|
||||
*/
|
||||
function tool_assignmentupgrade_any_upgradable_assignments() {
|
||||
global $DB, $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
// first find all the unique assignment types
|
||||
$types = $DB->get_records_sql('SELECT plugin AS assignmenttype, value AS version FROM {config_plugins} WHERE name = ? AND plugin LIKE ?', array('version', 'assignment_%'));
|
||||
|
||||
$upgradabletypes = array();
|
||||
|
||||
foreach ($types as $assignment) {
|
||||
$shorttype = substr($assignment->assignmenttype, strlen('assignment_'));
|
||||
if (assign::can_upgrade_assignment($shorttype, $assignment->version)) {
|
||||
$upgradabletypes[] = $shorttype;
|
||||
}
|
||||
}
|
||||
list($sql, $params) = $DB->get_in_or_equal($upgradabletypes);
|
||||
|
||||
$count = $DB->count_records_sql('SELECT COUNT(id) from {assignment} where assignmenttype ' . $sql, $params);
|
||||
|
||||
return $count > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a list of all the assignmentids that can be upgraded
|
||||
* @return array of assignment ids
|
||||
*/
|
||||
function tool_assignmentupgrade_load_all_upgradable_assignmentids() {
|
||||
global $DB, $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
// first find all the unique assignment types
|
||||
$types = $DB->get_records_sql('SELECT plugin AS assignmenttype, value AS version FROM {config_plugins} WHERE name = ? AND plugin LIKE ?', array('version', 'assignment_%'));
|
||||
|
||||
$upgradabletypes = array();
|
||||
|
||||
foreach ($types as $assignment) {
|
||||
$shorttype = substr($assignment->assignmenttype, strlen('assignment_'));
|
||||
if (assign::can_upgrade_assignment($shorttype, $assignment->version)) {
|
||||
$upgradabletypes[] = $shorttype;
|
||||
}
|
||||
}
|
||||
|
||||
list($sql, $params) = $DB->get_in_or_equal($upgradabletypes);
|
||||
|
||||
$records = $DB->get_records_sql('SELECT id from {assignment} where assignmenttype ' . $sql, $params);
|
||||
$ids = array();
|
||||
foreach ($records as $record) {
|
||||
$ids[] = $record->id;
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upgrade a single assignment. This is used by both upgrade single and upgrade batch
|
||||
*
|
||||
* @param int $assignmentid - The assignment id to upgrade
|
||||
* @return array(string, boolean, string) -
|
||||
* The array contains
|
||||
* - the assignment summary (returned by tool_assignmentupgrade_get_assignment)
|
||||
* - success
|
||||
* - the upgrade log
|
||||
*/
|
||||
function tool_assignmentupgrade_upgrade_assignment($assignmentid) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
|
||||
|
||||
$assignment_upgrader = new assign_upgrade_manager();
|
||||
$info = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
if ($info) {
|
||||
$log = '';
|
||||
$success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
|
||||
} else {
|
||||
$success = false;
|
||||
$log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
|
||||
$info = new stdClass();
|
||||
$info->name = get_string('unknown', 'tool_assignmentupgrade');
|
||||
$info->shortname = get_string('unknown', 'tool_assignmentupgrade');
|
||||
}
|
||||
|
||||
return array($info, $success, $log);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the information about a assignment to be upgraded.
|
||||
* @param int $assignmentid the assignment id.
|
||||
* @return stdClass the information about that assignment.
|
||||
*/
|
||||
function tool_assignmentupgrade_get_assignment($assignmentid) {
|
||||
global $DB;
|
||||
return $DB->get_record_sql("
|
||||
SELECT a.id, a.name, c.shortname, c.id AS courseid
|
||||
FROM {assignment} a
|
||||
JOIN {course} c ON c.id = a.course
|
||||
WHERE a.id = ?", array($assignmentid));
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
M.tool_assignmentupgrade = {
|
||||
init_upgrade_table: function(Y) {
|
||||
|
||||
Y.use('node', function(Y) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
node.on('change', function(e) {
|
||||
rowelement = e.currentTarget.get('parentNode').get('parentNode');
|
||||
if (e.currentTarget.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
if (node.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var selectall = Y.one('th.c0 input');
|
||||
selectall.on('change', function(e) {
|
||||
if (e.currentTarget.get('checked')) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', true);
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
});
|
||||
} else {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', false);
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var upgradeselectedbutton = Y.one('#id_upgradeselected');
|
||||
upgradeselectedbutton.on('click', function(e) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
var selectedassignments = [];
|
||||
checkboxes.each(function(node) {
|
||||
if (node.get('checked')) {
|
||||
selectedassignments[selectedassignments.length] = node.get('value');
|
||||
}
|
||||
});
|
||||
|
||||
operation = Y.one('#id_operation');
|
||||
assignmentsinput = Y.one('input.selectedassignments');
|
||||
assignmentsinput.set('value', selectedassignments.join(','));
|
||||
if (selectedassignments.length == 0) {
|
||||
alert(M.str.tool_assignmentupgrade.noassignmentsselected);
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
var perpage = Y.one('#id_perpage');
|
||||
perpage.on('change', function(e) {
|
||||
window.onbeforeunload = null;
|
||||
Y.one('.tool_assignmentupgrade_paginationform form').submit();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,59 +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 contains the forms to create and edit an instance of this module
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
||||
|
||||
|
||||
/** Include formslib.php */
|
||||
require_once ($CFG->libdir.'/formslib.php');
|
||||
|
||||
/**
|
||||
* Assignment upgrade table display options
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_pagination_form extends moodleform {
|
||||
/**
|
||||
* Define this form - called from the parent constructor
|
||||
*/
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$instance = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('assignmentsperpage', 'tool_assignmentupgrade'));
|
||||
// visible elements
|
||||
$options = array(10=>'10', 20=>'20', 50=>'50', 100=>'100');
|
||||
$mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options);
|
||||
|
||||
// hidden params
|
||||
$mform->addElement('hidden', 'action', 'saveoptions');
|
||||
$mform->setType('action', PARAM_ALPHA);
|
||||
|
||||
// buttons
|
||||
$this->add_action_buttons(false, get_string('updatetable', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,244 +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/>.
|
||||
|
||||
/**
|
||||
* Defines the renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Render the index page.
|
||||
* @param string $detected information about what sort of site was detected.
|
||||
* @param array $actions list of actions to show on this page.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function index_page($detected, array $actions) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginname', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box($detected);
|
||||
$output .= html_writer::start_tag('ul');
|
||||
foreach ($actions as $action) {
|
||||
$output .= html_writer::tag('li',
|
||||
html_writer::link($action->url, $action->name) . ' - ' .
|
||||
$action->description);
|
||||
}
|
||||
$output .= html_writer::end_tag('ul');
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a page that is just a simple message.
|
||||
* @param string $message the message to display.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function simple_message_page($message) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading($message);
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch operation page
|
||||
* @param stdClass $data Submitted form data with list of assignments to upgrade
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function confirm_batch_operation_page(stdClass $data) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
|
||||
$output .= $this->heading(get_string('confirmbatchupgrade', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_confirmbatch');
|
||||
|
||||
$output .= $this->render(new tool_assignmentupgrade_batchoperationconfirm($data));
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch continue / cancel links
|
||||
* @param tool_assignmentupgrade_batchoperationconfirm $confirm Wrapper class to determine the continue message and url
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function render_tool_assignmentupgrade_batchoperationconfirm(tool_assignmentupgrade_batchoperationconfirm $confirm) {
|
||||
$output = '';
|
||||
|
||||
if ($confirm->continueurl) {
|
||||
$output .= $this->output->confirm($confirm->continuemessage, $confirm->continueurl, tool_assignmentupgrade_url('listnotupgraded'));
|
||||
} else {
|
||||
$output .= $this->output->box($confirm->continuemessage);
|
||||
$output .= $this->output->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the list of assignments that still need to be upgraded page.
|
||||
* @param tool_assignmentupgrade_assignments_table $assignments of data about assignments.
|
||||
* @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade
|
||||
* @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform, tool_assignmentupgrade_pagination_form $paginationform) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array());
|
||||
$this->page->requires->string_for_js('noassignmentsselected', 'tool_assignmentupgrade');
|
||||
|
||||
$output .= $this->heading(get_string('notupgradedtitle', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box(get_string('notupgradedintro', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_upgradetable');
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_paginationform');
|
||||
$output .= $this->moodleform($paginationform);
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true);
|
||||
$output .= $this->container_end();
|
||||
|
||||
if ($assignments->anyupgradableassignments) {
|
||||
$output .= $this->container_start('tool_assignmentupgrade_batchform');
|
||||
$output .= $this->moodleform($batchform);
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the result of an assignment conversion
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
* @param bool $success Set to true if the outcome of the conversion was a success
|
||||
* @param string $log The log from the conversion
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_assignment_result($assignmentsummary, $success, $log) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_result');
|
||||
$output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary));
|
||||
if (!$success) {
|
||||
$output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log));
|
||||
} else {
|
||||
$output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
|
||||
$output .= $this->container(html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the are-you-sure page to confirm a manual upgrade.
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_assignment_are_you_sure($assignmentsummary) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('areyousure', 'tool_assignmentupgrade'));
|
||||
|
||||
$params = array('id' => $assignmentsummary->id, 'confirmed' => 1, 'sesskey' => sesskey());
|
||||
$output .= $this->confirm(get_string('areyousuremessage', 'tool_assignmentupgrade', $assignmentsummary),
|
||||
new single_button(tool_assignmentupgrade_url('upgradesingle', $params), get_string('yes')),
|
||||
tool_assignmentupgrade_url('listnotupgraded'));
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method dealing with the fact we can not just fetch the output of flexible_table
|
||||
*
|
||||
* @param flexible_table $table
|
||||
* @param int $rowsperpage
|
||||
* @param bool $displaylinks Show links in the table
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function flexible_table(flexible_table $table, $rowsperpage, $displaylinks) {
|
||||
|
||||
$o = '';
|
||||
ob_start();
|
||||
$table->out($rowsperpage, $displaylinks);
|
||||
$o = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method dealing with the fact we can not just fetch the output of moodleforms
|
||||
*
|
||||
* @param moodleform $mform
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function moodleform(moodleform $mform) {
|
||||
|
||||
$o = '';
|
||||
ob_start();
|
||||
$mform->display();
|
||||
$o = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render a link in a div, such as the 'Back to plugin main page' link.
|
||||
* @param string|moodle_url $url the link URL.
|
||||
* @param string $text the link text.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function end_of_page_link($url, $text) {
|
||||
return html_writer::tag('div', html_writer::link($url, $text), array('class' => 'mdl-align'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a link back to the plugin index page.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function back_to_index() {
|
||||
return $this->end_of_page_link(tool_assignmentupgrade_url('index'), get_string('backtoindex', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
@@ -1,31 +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/>.
|
||||
|
||||
/**
|
||||
* Adds this plugin to the admin menu.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($hassiteconfig) { // needs this condition or there is error on login page
|
||||
$ADMIN->add('root', new admin_externalpage('assignmentupgrade',
|
||||
get_string('pluginname', 'tool_assignmentupgrade'),
|
||||
new moodle_url('/admin/tool/assignmentupgrade/index.php')));
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable .c0 { display: none; }
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded.jsenabled .tool_assignmentupgrade_upgradetable .c0 { display: table-cell; }
|
||||
/*
|
||||
.gradingbatchoperationsform { display: none; }
|
||||
.jsenabled .gradingbatchoperationsform { display: block; }
|
||||
*/
|
||||
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.selectedrow td { background-color: #ffeecc; }
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.unselectedrow td { background-color: white; }
|
||||
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_paginationform .hidden { display: none; }
|
||||
@@ -1,55 +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 contains the forms to create and edit an instance of this module
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
||||
|
||||
|
||||
/** Include formslib.php */
|
||||
require_once ($CFG->libdir.'/formslib.php');
|
||||
|
||||
/**
|
||||
* Assignment upgrade batch operations form
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_batchoperations_form extends moodleform {
|
||||
/**
|
||||
* Define this form - is called from parent constructor
|
||||
*/
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$instance = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('batchoperations', 'tool_assignmentupgrade'));
|
||||
// visible elements
|
||||
$mform->addElement('hidden', 'selectedassignments', '', array('class'=>'selectedassignments'));
|
||||
|
||||
$mform->addElement('submit', 'upgradeselected', get_string('upgradeselected', 'tool_assignmentupgrade'));
|
||||
$mform->addElement('submit', 'upgradeall', get_string('upgradeall', 'tool_assignmentupgrade'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,171 +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 contains the definition for the grading table which subclassses easy_table
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
require_once($CFG->libdir.'/gradelib.php');
|
||||
require_once($CFG->dirroot.'/mod/assign/locallib.php');
|
||||
|
||||
/**
|
||||
* Extends table_sql to provide a table of assignment submissions
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_assignments_table extends table_sql implements renderable {
|
||||
/** @var int $perpage */
|
||||
private $perpage = 10;
|
||||
/** @var int $rownum (global index of current row in table) */
|
||||
private $rownum = -1;
|
||||
/** @var renderer_base for getting output */
|
||||
private $output = null;
|
||||
/** @var boolean anyupgradableassignments - True if there is one or more assignments that can upgraded */
|
||||
public $anyupgradableassignments = false;
|
||||
|
||||
/**
|
||||
* This table loads a list of the old assignment instances and tests them to see if they can be upgraded
|
||||
*
|
||||
* @param int $perpage How many per page
|
||||
* @param int $rowoffset The starting row for pagination
|
||||
*/
|
||||
function __construct($perpage, $rowoffset=0) {
|
||||
global $PAGE;
|
||||
parent::__construct('tool_assignmentupgrade_assignments');
|
||||
$this->perpage = $perpage;
|
||||
$this->output = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$this->define_baseurl(new moodle_url('/admin/tool/assignmentupgrade/listnotupgraded.php'));
|
||||
|
||||
$this->anyupgradableassignments = tool_assignmentupgrade_any_upgradable_assignments();
|
||||
|
||||
// do some business - then set the sql
|
||||
if ($rowoffset) {
|
||||
$this->rownum = $rowoffset - 1;
|
||||
}
|
||||
|
||||
$fields = 'a.id as id, a.name as name, a.assignmenttype as type, c.shortname as courseshortname, c.id as courseid, COUNT(s.id) as submissioncount';
|
||||
$from = '{assignment} a JOIN {course} c ON a.course = c.id ' .
|
||||
' LEFT JOIN {assignment_submissions} s ON a.id = s.assignment';
|
||||
|
||||
$where = '1 = 1';
|
||||
$where .= ' GROUP BY a.id, a.name, a.assignmenttype, c.shortname, c.id ';
|
||||
|
||||
$this->set_sql($fields, $from, $where, array());
|
||||
$this->set_count_sql('SELECT COUNT(*) FROM {assignment} a JOIN {course} c ON a.course = c.id', array());
|
||||
|
||||
$columns = array();
|
||||
$headers = array();
|
||||
|
||||
$columns[] = 'select';
|
||||
$headers[] = get_string('select', 'tool_assignmentupgrade') . '<div class="selectall"><input type="checkbox" name="selectall" title="' . get_string('selectall') . '"/></div>';
|
||||
$columns[] = 'upgradable';
|
||||
$headers[] = get_string('upgradable', 'tool_assignmentupgrade');
|
||||
$columns[] = 'id';
|
||||
$headers[] = get_string('assignmentid', 'tool_assignmentupgrade');
|
||||
$columns[] = 'courseshortname';
|
||||
$headers[] = get_string('course');
|
||||
$columns[] = 'name';
|
||||
$headers[] = get_string('name');
|
||||
$columns[] = 'type';
|
||||
$headers[] = get_string('assignmenttype', 'tool_assignmentupgrade');
|
||||
$columns[] = 'submissioncount';
|
||||
$headers[] = get_string('submissions', 'tool_assignmentupgrade');
|
||||
|
||||
// set the columns
|
||||
$this->define_columns($columns);
|
||||
$this->define_headers($headers);
|
||||
$this->no_sorting('upgradable');
|
||||
$this->no_sorting('select');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of rows to display on a single page
|
||||
*
|
||||
* @return int The number of rows per page
|
||||
*/
|
||||
function get_rows_per_page() {
|
||||
return $this->perpage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a link to the assignment instance
|
||||
*
|
||||
* @param stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
function col_name(stdClass $row) {
|
||||
return html_writer::link(new moodle_url('/mod/assignment/view.php',
|
||||
array('a' => $row->id)), $row->name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format a link to the upgrade single tool
|
||||
*
|
||||
* @param stdClass $row (contains cached result from previous upgradable check)
|
||||
* @return string
|
||||
*/
|
||||
function col_upgradable(stdClass $row) {
|
||||
if ($row->upgradable) {
|
||||
return html_writer::link(new moodle_url('/admin/tool/assignmentupgrade/upgradesingleconfirm.php',
|
||||
array('id' => $row->id, 'sesskey' => sesskey())), get_string('supported', 'tool_assignmentupgrade'));
|
||||
} else {
|
||||
return get_string('notsupported', 'tool_assignmentupgrade');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a checkbox for selecting the current row for batch operations
|
||||
*
|
||||
* @param stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
function col_select(stdClass $row) {
|
||||
global $CFG;
|
||||
$version = get_config('assignment_' . $row->type, 'version');
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
if (assign::can_upgrade_assignment($row->type, $version)) {
|
||||
$row->upgradable = true;
|
||||
return '<input type="checkbox" name="selectedassignment" value="' . $row->id . '"/>';
|
||||
}
|
||||
$row->upgradable = false;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the table show_hide_link to not show for select column
|
||||
*
|
||||
* @param string $column the column name, index into various names.
|
||||
* @param int $index numerical index of the column.
|
||||
* @return string HTML fragment.
|
||||
*/
|
||||
protected function show_hide_link($column, $index) {
|
||||
if ($index > 0) {
|
||||
return parent::show_hide_link($column, $index);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -1,46 +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/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$assignmentid = required_param('id', PARAM_INT);
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('upgradesingle', array('id' => $assignmentid)));
|
||||
|
||||
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$log = '';
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
@@ -1,41 +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/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$assignmentid = required_param('id', PARAM_INT);
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('upgradesingle', array('id' => $assignmentid)));
|
||||
|
||||
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$assignmentinfo = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
|
||||
echo $renderer->convert_assignment_are_you_sure($assignmentinfo);
|
||||
@@ -1,30 +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/>.
|
||||
|
||||
/**
|
||||
* Version details.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900;
|
||||
$plugin->requires = 2012112900;
|
||||
$plugin->component = 'tool_assignmentupgrade';
|
||||
$plugin->dependencies = array('mod_assign' => 2012112900);
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Post installation and migration code.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage bloglevelupgrade
|
||||
* @copyright 2011 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
function xmldb_tool_bloglevelupgrade_install() {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// this is a hack - admins were long ago instructed to upgrade blog levels,
|
||||
// the problem is that blog is not supposed to be course level activity!!
|
||||
|
||||
if (!empty($CFG->bloglevel_upgrade_complete)) {
|
||||
// somebody already upgrades, we do not need this any more
|
||||
unset_config('bloglevel_upgrade_complete');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($CFG->bloglevel)) {
|
||||
// fresh install?
|
||||
return;
|
||||
}
|
||||
|
||||
if (($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL)) {
|
||||
// inform admins that some settings require attention after upgrade
|
||||
$site = get_site();
|
||||
|
||||
$a = new StdClass;
|
||||
$a->sitename = $site->fullname;
|
||||
$a->fixurl = "$CFG->wwwroot/$CFG->admin/tool/bloglevelupgrade/index.php";
|
||||
|
||||
$subject = get_string('bloglevelupgrade', 'tool_bloglevelupgrade');
|
||||
$description = get_string('bloglevelupgradedescription', 'tool_bloglevelupgrade', $a);
|
||||
|
||||
// can not use messaging here because it is not configured yet!
|
||||
upgrade_log(UPGRADE_LOG_NOTICE, null, $subject, $description);
|
||||
set_config('tool_bloglevelupgrade_pending', 1);
|
||||
|
||||
echo $OUTPUT->notification($description);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Create "blog" forums in each course and copy blog entries from these courses' participants in these forums
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage bloglevelupgrade
|
||||
* @copyright 2009 Nicolas Connault
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../../../config.php');
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
require_once($CFG->dirroot.'/blog/lib.php');
|
||||
require_once($CFG->dirroot.'/mod/forum/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toolbloglevelupgrade');
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
|
||||
$go = optional_param('go', 0, PARAM_BOOL);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_bloglevelupgrade'));
|
||||
|
||||
$strbloglevelupgrade = get_string('bloglevelupgradeinfo', 'tool_bloglevelupgrade');
|
||||
|
||||
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
|
||||
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
|
||||
echo $OUTPUT->confirm($strbloglevelupgrade, new moodle_url('/admin/tool/bloglevelupgrade/index.php', $optionsyes), new moodle_url('/admin/index.php'));
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start();
|
||||
|
||||
/// Turn off time limits, sometimes upgrades can be slow.
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
$i = 0;
|
||||
|
||||
// If $CFG->bloglevel is set to BLOG_GROUP_LEVEL or BLOG_COURSE_LEVEL, create a new "blog" forum in each course
|
||||
// whose enrolled students have written blog entries, copy these entries in that forum and switch off blogs at site level
|
||||
|
||||
if ($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL) {
|
||||
$pbar = new progress_bar('toolbloglevelupgrade', 500, true);
|
||||
|
||||
$bloggers = $DB->get_records_sql("SELECT userid FROM {post} WHERE module = 'blog' GROUP BY userid");
|
||||
require_once($CFG->dirroot.'/mod/forum/lib.php');
|
||||
|
||||
$a = new stdClass();
|
||||
$a->userscount = 0;
|
||||
$a->blogcount = 0;
|
||||
|
||||
foreach ($bloggers as $blogger) {
|
||||
$courses = enrol_get_users_courses($blogger->userid, true, 'groupmode,groupmodeforce');
|
||||
$blogentries = $DB->get_records('post', array('module' => 'blog', 'userid' => $blogger->userid));
|
||||
|
||||
foreach ($courses as $course) {
|
||||
$forum = forum_get_course_forum($course->id, 'blog');
|
||||
$cm = get_coursemodule_from_instance('forum', $forum->id);
|
||||
|
||||
if ($CFG->bloglevel == BLOG_GROUP_LEVEL && $course->groupmode != NOGROUPS) {
|
||||
// Unless the course is set to separate groups forced, force the forum to Separate groups
|
||||
if (!($course->groupmode == SEPARATEGROUPS && $course->groupmodeforce)) {
|
||||
$cm->groupmode = SEPARATEGROUPS;
|
||||
$DB->update_record('course_modules', $cm);
|
||||
}
|
||||
|
||||
$groups = groups_get_user_groups($course->id, $blogger->userid);
|
||||
foreach ($groups[0] as $groupid) { // [0] is for all groupings combined
|
||||
$a->blogcount += bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid);
|
||||
}
|
||||
} else {
|
||||
$a->blogcount += bloglevelupgrade_entries($blogentries, $forum, $cm);
|
||||
}
|
||||
}
|
||||
|
||||
$a->userscount = $i . '/' . count($bloggers);
|
||||
$pbar->update($i, count($bloggers), get_string('bloglevelupgradeprogress', 'tool_bloglevelupgrade', $a));
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
|
||||
$count = 0;
|
||||
|
||||
$forumcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
foreach ($blogentries as $blogentry) {
|
||||
$discussion = new stdClass();
|
||||
$discussion->course = $forum->course;
|
||||
$discussion->forum = $forum->id;
|
||||
$discussion->name = $blogentry->subject;
|
||||
$discussion->assessed = $forum->assessed;
|
||||
$discussion->message = $blogentry->summary;
|
||||
$discussion->messageformat = $blogentry->summaryformat;
|
||||
$discussion->messagetrust = 0;
|
||||
$discussion->attachments = 0;
|
||||
$discussion->mailnow = false;
|
||||
$discussion->timemodified = $blogentry->created;
|
||||
$discussion->itemid = null;
|
||||
$discussion->groupid = $groupid;
|
||||
$message = '';
|
||||
|
||||
$discussionid = forum_add_discussion($discussion, null, $message);
|
||||
|
||||
// Copy file attachment records
|
||||
$fs = get_file_storage();
|
||||
$files = $fs->get_area_files($sitecontext->id, 'blog', 'attachment', $blogentry->id);
|
||||
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $storedfile) {
|
||||
$newfile = new stdClass();
|
||||
$newfile->component = 'mod_forum';
|
||||
$newfile->filearea = 'attachment';
|
||||
$newfile->itemid = $discussion->firstpost;
|
||||
$newfile->contextid = $forumcontext->id;
|
||||
$fs->create_file_from_storedfile($newfile, $storedfile->get_id());
|
||||
}
|
||||
}
|
||||
|
||||
$files = $fs->get_area_files($sitecontext->id, 'blog', 'post', $blogentry->id);
|
||||
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $storedfile) {
|
||||
$newfile = new stdClass();
|
||||
$newfile->component = 'mod_forum';
|
||||
$newfile->filearea = 'post';
|
||||
$newfile->itemid = $discussion->firstpost;
|
||||
$newfile->contextid = $forumcontext->id;
|
||||
$fs->create_file_from_storedfile($newfile, $storedfile->get_id());
|
||||
}
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
// END OF LOOP
|
||||
|
||||
// set conversion flag - switches to new plugin automatically
|
||||
unset_config('tool_bloglevelupgrade_pending');
|
||||
// Finally switch bloglevel to 0 (disabled)
|
||||
set_config('bloglevel', 0);
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
/// Rebuild course cache which might be incorrect now
|
||||
echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
|
||||
rebuild_course_cache();
|
||||
echo $OUTPUT->notification('...finished', 'notifysuccess');
|
||||
|
||||
echo $OUTPUT->continue_button(new moodle_url('/admin/index.php'));
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_bloglevelupgrade', language 'en', branch 'MOODLE_22_STABLE'
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage bloglevelupgrade
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['bloglevelupgradedescription'] = '<p>This site has recently been upgraded to Moodle 2.0.</p>
|
||||
<p>Blog visibility was simplified in 2.0, but your site still uses one of the old visibility types. </p>
|
||||
<p>To preserve the course-based or group-based visibility of the blog entries on your site, you need to run the following upgrade script, which will create a special "blog" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum. </p>
|
||||
<p>Blogs will then be entirely switched off at the site level. No blog entries will be deleted in the process.</p>
|
||||
<p>You can run the script by visiting <a href="{$a->fixurl}">the blog level upgrade page</a>.</p>';
|
||||
$string['bloglevelupgradeinfo'] = 'Blog visibility was simplified in 2.0, but your site still uses one of the old visibility types. To preserve the course-based or group-based visibility of the blog entries on your site, the following upgrade script will create a special "blog" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum. Blogs will then be entirely switched off at the site level. No blog entries will be deleted in the process.';
|
||||
$string['bloglevelupgradeprogress'] = 'Conversion progress: {$a->userscount} users reviewed, {$a->blogcount} entries converted.';
|
||||
$string['pluginname'] = 'Blog visibility upgrade';
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Capability overview settings
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage bloglevelupgrade
|
||||
* @copyright 2011 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('root', new admin_externalpage('toolbloglevelupgrade', get_string('pluginname', 'tool_bloglevelupgrade'), $CFG->wwwroot.'/'.$CFG->admin.'/tool/bloglevelupgrade/index.php', 'moodle/site:config', empty($CFG->tool_bloglevelupgrade_pending)));
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Version details.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage bloglevelupgrade
|
||||
* @copyright 2011 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_bloglevelupgrade'; // Full name of the plugin (used for diagnostics)
|
||||
@@ -29,16 +29,16 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
// Check permissions.
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
|
||||
// Get URL parameters.
|
||||
$capability = optional_param('capability', '', PARAM_CAPABILITY);
|
||||
$roleids = optional_param_array('roles', array('0'), PARAM_INT);
|
||||
$roleids = optional_param_array('roles', array('0'), PARAM_INTEGER);
|
||||
|
||||
// Clean the passed in list of role ids. If 'All' selected as an option, or
|
||||
// if none were selected, do all roles.
|
||||
$allroles = role_fix_names(get_all_roles());
|
||||
$allroles = get_all_roles();
|
||||
$cleanedroleids = array();
|
||||
foreach ($roleids as $roleid) {
|
||||
if ($roleid == 0) {
|
||||
@@ -73,7 +73,7 @@ foreach ($allcapabilities as $cap) {
|
||||
// Prepare the list of roles to choose from
|
||||
$rolechoices = array('0' => get_string('all'));
|
||||
foreach ($allroles as $role) {
|
||||
$rolechoices[$role->id] = $role->localname;
|
||||
$rolechoices[$role->id] = $role->name;
|
||||
}
|
||||
if (count($cleanedroleids) == count($allroles)) {
|
||||
// Select 'All', rather than each role individually.
|
||||
@@ -162,7 +162,7 @@ if ($capability) {
|
||||
if (count($cleanedroleids) != count($allroles)) {
|
||||
$rolenames = array();
|
||||
foreach ($cleanedroleids as $roleid) {
|
||||
$rolenames[] = $allroles[$roleid]->localname;
|
||||
$rolenames[] = $allroles[$roleid]->name;
|
||||
}
|
||||
echo '<p>', get_string('forroles', 'tool_capability', implode(', ', $rolenames)), '</p>';
|
||||
}
|
||||
@@ -207,7 +207,7 @@ function print_report_tree($contextid, $contexts, $allroles) {
|
||||
foreach ($allroles as $role) {
|
||||
if (isset($contexts[$contextid]->rolecapabilities[$role->id])) {
|
||||
$permission = $contexts[$contextid]->rolecapabilities[$role->id];
|
||||
echo '<tr class="r' . ($rowcounter % 2) . '"><th class="cell">', $role->localname,
|
||||
echo '<tr class="r' . ($rowcounter % 2) . '"><th class="cell">', $role->name,
|
||||
'</th><td class="cell">' . $strpermissions[$permission] . '</td></tr>';
|
||||
$rowcounter++;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
/**
|
||||
* Defines the capabilities used by the Language customization admin tool
|
||||
*
|
||||
* @package tool_customlang
|
||||
* @package tool
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,24 @@ defined('MOODLE_INTERNAL') || die;
|
||||
function xmldb_tool_customlang_install() {
|
||||
global $CFG, $OUTPUT, $DB;
|
||||
|
||||
// this is a hack - this plugin used to live in admin/report/customlang,
|
||||
// we want to remove the orphaned version info and capability
|
||||
// unless there is a new report type with the same name
|
||||
// the original tables can be dropped because they are used for caching only
|
||||
|
||||
if (!file_exists("$CFG->dirroot/report/customlang")) {
|
||||
unset_all_config_for_plugin('report_customlang');
|
||||
capabilities_cleanup('report_customlang');
|
||||
$dbman = $DB->get_manager();
|
||||
$table = new xmldb_table('report_customlang');
|
||||
if ($dbman->table_exists($table)) {
|
||||
$dbman->drop_table($table);
|
||||
}
|
||||
$table = new xmldb_table('report_customlang_components');
|
||||
if ($dbman->table_exists($table)) {
|
||||
$dbman->drop_table($table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user