Compare commits
1116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50ce778ad8 | |||
| 64f26a2673 | |||
| 7d93ab4189 | |||
| 9f28d15bc9 | |||
| 0407f9cda7 | |||
| b8321ca069 | |||
| cc0988ad2b | |||
| 3c7ea58432 | |||
| bd2790b2f2 | |||
| 1ed6756d80 | |||
| c3ef0a618d | |||
| 3174abc728 | |||
| 40cc2378f2 | |||
| 69180a0de7 | |||
| babd54537c | |||
| f0a173ff75 | |||
| 913a61a323 | |||
| 51050f4b3d | |||
| 4b67fa946b | |||
| 279fa1b994 | |||
| 6fe2462f98 | |||
| 1f8ca423da | |||
| 9e2c51dbf2 | |||
| 8ed17824f6 | |||
| 4397b907bd | |||
| f029a59e24 | |||
| 92939cd69a | |||
| 72b19bafdb | |||
| 5c2ca52338 | |||
| db90eb6883 | |||
| a2c65d52ce | |||
| 5a66a2b9c5 | |||
| 4df0583e21 | |||
| f99bd07ab6 | |||
| aa1d8c5cde | |||
| 673baa5a49 | |||
| 156ec7701e | |||
| 30a83348fe | |||
| 97186f31a8 | |||
| cd931a8f1b | |||
| 9599370dff | |||
| d81e6cc96e | |||
| 2b50d26f00 | |||
| f0c67f5f02 | |||
| 52f04e91a1 | |||
| a7371c4d8c | |||
| 70f24aebbf | |||
| da86b56615 | |||
| 4236448a19 | |||
| 785ff2b69f | |||
| 679d738636 | |||
| 79c4fef51f | |||
| 516a904af3 | |||
| 27bc295382 | |||
| 7c0df73abb | |||
| f249bab334 | |||
| 2f14dd463b | |||
| 12216d31ff | |||
| 7d584b168b | |||
| 2823fe83d9 | |||
| d047cf60ae | |||
| 8e74088cc1 | |||
| f6bbbbf33f | |||
| ced260583a | |||
| 737c229ea6 | |||
| 2712c59da7 | |||
| e0acecab96 | |||
| 484c3c70f7 | |||
| 16ada8d30e | |||
| 9694f1c114 | |||
| 1097299e59 | |||
| 81b24b17cf | |||
| 339beda38b | |||
| 6498060a7c | |||
| 97aef9b3ad | |||
| 7138495b4b | |||
| cf04ce3a50 | |||
| b7341aa136 | |||
| 2b38c7bea5 | |||
| 6c628d482a | |||
| 0f8e22ee96 | |||
| 473dfcee8d | |||
| 02c43cd86a | |||
| 2675160b8e | |||
| d3606a9a84 | |||
| 18b7d18959 | |||
| 1e7732cec6 | |||
| 372d9df650 | |||
| 71a215991d | |||
| 830969cc63 | |||
| 96ec3502f0 | |||
| 373c70e5d5 | |||
| edfcab2970 | |||
| 1db5119839 | |||
| 24dad096ca | |||
| 45918dedf9 | |||
| 552cff42a3 | |||
| 4e7cec54a2 | |||
| 71923e963b | |||
| 3815ecf471 | |||
| bf850b4b18 | |||
| 5255100dac | |||
| 256a93c9b5 | |||
| 4493fe9c90 | |||
| 471992218f | |||
| 195a8b7840 | |||
| 1af4e4a874 | |||
| 7a3cd7d57c | |||
| e25ecdfcf3 | |||
| 88f8312aa0 | |||
| c4972aca4a | |||
| fcd27b4981 | |||
| bf8ab84950 | |||
| 66e9f5c965 | |||
| 5ad0823134 | |||
| bf1f6c769f | |||
| bf98f9e6a0 | |||
| de3476d171 | |||
| 375c26deb3 | |||
| 1542c91c8e | |||
| 5c04356ed4 | |||
| cdc502c531 | |||
| 7159b53324 | |||
| cd6ac6c8b8 | |||
| 3a2fc5926a | |||
| c35c8eb8e6 | |||
| 4aef860aec | |||
| 5720c0b1ff | |||
| 0242c9ba9e | |||
| 8ec13b3312 | |||
| 147ec85e06 | |||
| a3367a1711 | |||
| 4ca2c772be | |||
| 4eeae5a673 | |||
| 0eb0583d9d | |||
| d56fe710e6 | |||
| be82e0a689 | |||
| 113f6b5c79 | |||
| 17ea5774eb | |||
| bc1f567d38 | |||
| 07340448fe | |||
| 18611b3dbc | |||
| bace4ce456 | |||
| fe23b6e72f | |||
| 8a65e45adf | |||
| b797666fe8 | |||
| 3aed25accd | |||
| b57566d3be | |||
| 40b90130a0 | |||
| f598387441 | |||
| aa2b2c4e31 | |||
| 5a301c16a1 | |||
| 5f30ffdac1 | |||
| 0ff996b0a9 | |||
| 3e99f27558 | |||
| a49a4aecb2 | |||
| 42d96d7c2e | |||
| d4d070fc35 | |||
| 1ceb53f945 | |||
| 2331e2eddd | |||
| c2d7c22962 | |||
| 3fb3517a00 | |||
| 5931af6ce5 | |||
| 6636527808 | |||
| bf870f7f2d | |||
| 253be7381f | |||
| cc9a416086 | |||
| c8972b9909 | |||
| 875ffd3734 | |||
| fb09c60c5e | |||
| ace2712e43 | |||
| 280854dc21 | |||
| 26fa36381d | |||
| 0bf39d0c55 | |||
| daccd72436 | |||
| e74ffa9215 | |||
| 43b5e6bf57 | |||
| c9b3258ccc | |||
| 7986e5260c | |||
| 82fe152cea | |||
| 8bf2359662 | |||
| d76a78afae | |||
| 5eb4001050 | |||
| 2dd93c071a | |||
| 930bbe97c6 | |||
| a5b30b0463 | |||
| b2595cb67b | |||
| 2c5be3e552 | |||
| 6b67218be3 | |||
| 76a526a270 | |||
| c28c9a2d89 | |||
| f08f22c267 | |||
| d4a8a15d7f | |||
| 500ba8b11e | |||
| fae4f8f1b9 | |||
| 0d7773c098 | |||
| 3d4bcfbddf | |||
| c3a648c342 | |||
| 541a9978a8 | |||
| 2c1773b908 | |||
| c880538684 | |||
| de79cbe32b | |||
| 7f422374c1 | |||
| 65af1129c5 | |||
| df1d01c9f7 | |||
| 2acd50840c | |||
| ce5b99077c | |||
| 5e876cd379 | |||
| 9fc8435c21 | |||
| 685cc34c18 | |||
| ec0a00ea27 | |||
| 5e56574d55 | |||
| 2d930dc6dd | |||
| 4f14428adc | |||
| 4f0ad6fc94 | |||
| 340aa2008f | |||
| 5fd928d633 | |||
| 1322584287 | |||
| 2df5a98299 | |||
| cb28940596 | |||
| 44915324c8 | |||
| 7a6d43a3ee | |||
| 1bd3952b19 | |||
| cfaa48041a | |||
| 376d035af9 | |||
| c440076d2b | |||
| d612fa300e | |||
| 84ac3ff122 | |||
| 516dd9c525 | |||
| 4064642b37 | |||
| 08fb23840e | |||
| 112f7d41ea | |||
| 364c32f0c1 | |||
| 75658ad2ca | |||
| a4ab3f9840 | |||
| 0d2672748c | |||
| bc577df6a9 | |||
| c915b922b7 | |||
| 3dfaec6d6e | |||
| 8c41a90a9c | |||
| 60a3ede47e | |||
| 46dd3d8f6d | |||
| 716267f233 | |||
| 9de8774f09 | |||
| 7f5d1ef3c0 | |||
| 6e03d19df5 | |||
| d21cdb8b3c | |||
| 21c5b22d97 | |||
| 006106d640 | |||
| 5c6ec45706 | |||
| 23f3d0e4ac | |||
| 3f4186c6dc | |||
| fd26ea4218 | |||
| c96deddbe7 | |||
| c963b7e15b | |||
| cd4336433c | |||
| 68bbf58745 | |||
| 523f4aa787 | |||
| b304495ee4 | |||
| ce50619835 | |||
| 9ee2ba4676 | |||
| 35e2ec4df5 | |||
| 3a87f672b7 | |||
| 9aa5b604ec | |||
| e52c5225ec | |||
| 3eb03012f0 | |||
| 8c7d6037e6 | |||
| 3cc9205676 | |||
| 3d336f2264 | |||
| 2cc4660758 | |||
| f1dc5d01e1 | |||
| fdb8574046 | |||
| e2236bac8c | |||
| 8eb6f9f7a7 | |||
| b35dc1beb7 | |||
| 515b891bb7 | |||
| 1973078427 | |||
| e4f1b4db59 | |||
| 49b266c07b | |||
| 06f72d26d7 | |||
| 68370e7bc6 | |||
| 0750c0e114 | |||
| 77425798fb | |||
| 57680da013 | |||
| e7448d5102 | |||
| e04dba08b7 | |||
| fbab740334 | |||
| 9065fddabb | |||
| 26c8e82338 | |||
| 73ebb5d7ab | |||
| 32cb53a832 | |||
| 63cdff2429 | |||
| 0b6713fe55 | |||
| 0e6186fb45 | |||
| 175bbb07f0 | |||
| bc23dbcf78 | |||
| 7edd6c250d | |||
| a258bda0b5 | |||
| f1618d9343 | |||
| 6adc168c96 | |||
| 24e5f9df63 | |||
| 297f40838a | |||
| dabf2c159f | |||
| 171bbdad02 | |||
| 4ca17ce1cd | |||
| 46d1d80388 | |||
| 1e42eedbad | |||
| c2dc95003e | |||
| a6bb03641e | |||
| a6c348362a | |||
| 52bc12cedc | |||
| 00a3005485 | |||
| cfb15041cf | |||
| 280f3a4a1c | |||
| a8b50f506a | |||
| d93fc6e1ad | |||
| cc6b535972 | |||
| 6bcfb5f23b | |||
| 4a17d78395 | |||
| c38cfee97b | |||
| c0c07d835d | |||
| 263c52843b | |||
| 9b0e51000e | |||
| 42f5db3ca8 | |||
| 4b7783da19 | |||
| 489f5b1338 | |||
| 28d838ba5e | |||
| d33c06621a | |||
| 415c4ee04f | |||
| 1d6bb3a897 | |||
| 63526ae3d5 | |||
| b1913094d4 | |||
| 2be90263ec | |||
| 63a778838e | |||
| 27625e0fca | |||
| b15dee25e0 | |||
| 7fbb52d717 | |||
| 2a0df64521 | |||
| 430ce6cca3 | |||
| c61c509f37 | |||
| 960262ffe4 | |||
| 63f81e076d | |||
| 28fb9fa8e2 | |||
| ffe1cc611c | |||
| 75371a7963 | |||
| 94d5bb3b50 | |||
| b15cd07d4b | |||
| 22363663b8 | |||
| 29bdd38e50 | |||
| dfdef4a231 | |||
| ec51da7d4b | |||
| ecbd8716f6 | |||
| 7820e5047d | |||
| c4101db016 | |||
| 36c402ba79 | |||
| 0b2d555f1a | |||
| 5993fccd1e | |||
| d1582f14d5 | |||
| e153abc018 | |||
| f1ae261bc9 | |||
| 19fcc09ac7 | |||
| 82bd683018 | |||
| 0d3a082373 | |||
| 19c8fd9e8b | |||
| 0bfc2dde8f | |||
| b801633a9c | |||
| 807f806ed7 | |||
| 85dd2a674a | |||
| fa8843c424 | |||
| fdca6e8321 | |||
| ae3056cb00 | |||
| 74969d8866 | |||
| 5e69fe4971 | |||
| 133173e213 | |||
| 747d6b5aac | |||
| 91a7a788aa | |||
| c3a4009a56 | |||
| f0837f65d8 | |||
| a70eda6cc8 | |||
| c5c9be022d | |||
| 96909b1597 | |||
| 8f40d27954 | |||
| 59c8be2362 | |||
| f289c698a9 | |||
| daf4471a40 | |||
| b056fee5ba | |||
| c6e321ccaf | |||
| f6705d681a | |||
| 30ed26a576 | |||
| 1e6c738c6c | |||
| 4cb89f4df4 | |||
| 1f2d15dc62 | |||
| 7d9cb204be | |||
| e6f5ebe25b | |||
| 6eeb293e04 | |||
| 124414cc5e | |||
| 69a62c2646 | |||
| add033dafe | |||
| 90e44b5068 | |||
| bf49e4404c | |||
| e4346a63ba | |||
| e438ff9942 | |||
| ddf0d0dcd7 | |||
| d85d6ccd3e | |||
| bd90c5891f | |||
| e58c72d050 | |||
| 77be201a0f | |||
| 73a48291b3 | |||
| cb7699c3a9 | |||
| 22ba72591c | |||
| 41be2f3587 | |||
| 7bbad2e268 | |||
| fc15f0837a | |||
| 9d0cc2cb4c | |||
| f058ea24c9 | |||
| b99d21aaa9 | |||
| 778854eef5 | |||
| 5c6377900a | |||
| a00b84e864 | |||
| 667ffef155 | |||
| 8258ddff3b | |||
| 03fb10da20 | |||
| 342f224f03 | |||
| 0623443356 | |||
| 4a313905bc | |||
| 9c36051feb | |||
| fa447a513e | |||
| 037afad8c3 | |||
| 72a32ea968 | |||
| 21973a92a4 | |||
| af9a00d398 | |||
| 3264974513 | |||
| 214784a4af | |||
| b15ab7630c | |||
| 3973662145 | |||
| f7bb84df23 | |||
| fc316236f5 | |||
| e9be98eed2 | |||
| ca92a99a2e | |||
| d021250bf0 | |||
| 2b4dcfdcbd | |||
| fe245b725b | |||
| 3dba01a40f | |||
| 5cac28fb2b | |||
| dc110687c8 | |||
| 0518140c31 | |||
| 4d7a9cd8f5 | |||
| ba1afa0d95 | |||
| f8431a1933 | |||
| 3cef27bf9f | |||
| 9551f03606 | |||
| 8daff43635 | |||
| e90206aaa4 | |||
| b967bf6005 | |||
| ded9134e03 | |||
| 9d7b02bec0 | |||
| d496829c61 | |||
| 9c43f8f7e1 | |||
| 7af777217d | |||
| 585bd02479 | |||
| d7749a10a6 | |||
| 65072bfdc2 | |||
| 9f05075c61 | |||
| ef4cf39174 | |||
| 7294a0649b | |||
| 9c49600397 | |||
| 0a5afc0583 | |||
| 2de4e3872c | |||
| d73581da42 | |||
| dbd388acef | |||
| 51fd4dd261 | |||
| dddcaf6b6b | |||
| 8710d49bec | |||
| a672bd8ad5 | |||
| 4d1e35d8c0 | |||
| 7bfc279ffb | |||
| cb59f50fb8 | |||
| 5d81093e3c | |||
| a9384ab0d0 | |||
| 18d81bdb3c | |||
| 4b5c0b461c | |||
| 0047a8f47d | |||
| a39eb49fc2 | |||
| cfb909d013 | |||
| 81fa243ea4 | |||
| 747d4d3e25 | |||
| 74ca90e5fb | |||
| 4e92a71fb3 | |||
| e6674da8ff | |||
| 136fa79e34 | |||
| 06a22aecb7 | |||
| f7cf17a853 | |||
| e63827ad98 | |||
| 84de2336fb | |||
| 7f0d91d546 | |||
| 14312ebc6a | |||
| 292faa4f7d | |||
| e93bb0ca52 | |||
| a886ad10ea | |||
| c4b234ec54 | |||
| 6831c9ff36 | |||
| 6a49c01825 | |||
| 0ff54e134f | |||
| 5af8bbf854 | |||
| 75ebacb1ec | |||
| 1859247e0c | |||
| f199117f05 | |||
| bc24c20388 | |||
| 4e970a5335 | |||
| 955f15a71f | |||
| 5585910ea7 | |||
| 1b17be9050 | |||
| 26c28d0821 | |||
| 8104e0f2df | |||
| 4ded0afd16 | |||
| 2e348a6643 | |||
| 84cae7bef8 | |||
| 3d2029f3d4 | |||
| 9acc5736a8 | |||
| 08d1ba7106 | |||
| e9197a3711 | |||
| 4394f91b26 | |||
| 25aa44ea97 | |||
| f9d4ab44e0 | |||
| 1f552b4c48 | |||
| b19539bf44 | |||
| ce0cb2451b | |||
| 929c1e4a8b | |||
| 7923d63b16 | |||
| efb0aacf37 | |||
| 9e312ed269 | |||
| 6aa9352f66 | |||
| 2023ca1f0f | |||
| 6f1156a6c2 | |||
| a7cb1e62f4 | |||
| edb8077e7b | |||
| d8f2500f46 | |||
| 6519a7769d | |||
| 995b4d16cd | |||
| 717c3395be | |||
| 6bc526319e | |||
| b3c64930ff | |||
| a6f388c664 | |||
| 90d14d089c | |||
| 9d8dbe645c | |||
| 937e0a23d9 | |||
| 910671644c | |||
| 9e6ef6ccc2 | |||
| 4a277f4f4e | |||
| 786a905607 | |||
| 20ff7e3279 | |||
| 2513a2b24f | |||
| 4966b0ee71 | |||
| 18fc309097 | |||
| 3bfe7ce57a | |||
| 366c19fabd | |||
| 56a1642c5b | |||
| 9d74bab3bc | |||
| 993261dcff | |||
| 4b5233f9c4 | |||
| 0cf269c1fc | |||
| e1e082a809 | |||
| 8cd0f221b6 | |||
| 94a720f287 | |||
| f6090a3531 | |||
| 3dfac46e97 | |||
| 3119ba9a2a | |||
| 74743b5e48 | |||
| 033a066e4f | |||
| 8ede1d5121 | |||
| 0347dd4d70 | |||
| 5da6f4eeb6 | |||
| 34c46428f1 | |||
| 9ec4220c84 | |||
| 22e8ad6134 | |||
| 0780ba7ca7 | |||
| 06b66d530b | |||
| 57d30b5276 | |||
| a640301b81 | |||
| 593b4518ad | |||
| abaff947c6 | |||
| ae115cf229 | |||
| 152ee16812 | |||
| ed2448a342 | |||
| 48f6a80092 | |||
| 85f5ab3145 | |||
| 26cfc10584 | |||
| 5f856fdfe9 | |||
| 0d7dcbf1ae | |||
| 6786f79ab4 | |||
| a010bfe63d | |||
| 3cabe2de8c | |||
| 7ecabfdce4 | |||
| c8fa99de72 | |||
| 02aac22ff8 | |||
| 05956888d7 | |||
| caff2aa640 | |||
| 5031249d84 | |||
| 3c7a83744e | |||
| 436135f52a | |||
| 41f17b384f | |||
| 47b9f44c6f | |||
| 7a8a938077 | |||
| e3a6a3878e | |||
| 35dd29564b | |||
| 5c71cfca6a | |||
| e5df0e3e17 | |||
| 6b94a62ff8 | |||
| e9a574454c | |||
| ddf322586e | |||
| ed9041c9ce | |||
| 3853dc585c | |||
| 132c116509 | |||
| 97dd4ec539 | |||
| 5266e929da | |||
| 9c89f307f8 | |||
| 4524a47a0a | |||
| 7816f5acb0 | |||
| ce4285c883 | |||
| 208b9e2a50 | |||
| 5a8f177c73 | |||
| fa3dff1318 | |||
| a4ad64950b | |||
| 6870b5dcbb | |||
| 6e582f1632 | |||
| 3bdb9bfd54 | |||
| 1dd41f0eb1 | |||
| 78b19caf0a | |||
| 4984e712e6 | |||
| 174245497e | |||
| 119b895133 | |||
| 04dc7f877b | |||
| 5e7d9e3e36 | |||
| c24ccde07f | |||
| b38bcc3a1d | |||
| 9b81b37eb9 | |||
| 2f2cf818c2 | |||
| ed32596d3a | |||
| 9651053bb4 | |||
| 15e6246359 | |||
| b1a24c1eb0 | |||
| 362d5c1ed1 | |||
| d5ae2ed112 | |||
| e4527c5497 | |||
| 200cb06bfc | |||
| 97e4e3953a | |||
| ee4dee99e8 | |||
| 7adfd55ec2 | |||
| efc2de0e97 | |||
| ddec658859 | |||
| e9f707d38a | |||
| 7faa5b4e9c | |||
| 2eb3bb390f | |||
| 2134aa6129 | |||
| adc0d74ac9 | |||
| b5013dc868 | |||
| b61fd419e8 | |||
| 8c412f122c | |||
| 7a4a1f14ca | |||
| fad5ec9b5a | |||
| 93e8c6c422 | |||
| 16dc846eb1 | |||
| c7c1a8cf14 | |||
| b13eda7e8d | |||
| a3ad8fd883 | |||
| 4ffedd8b0e | |||
| 71cf843ad2 | |||
| fd7bdf278c | |||
| 80fc30b7bd | |||
| 251037cefd | |||
| 3d95259d7e | |||
| 1b502dff19 | |||
| e9f8af2a1b | |||
| 35dd038144 | |||
| f403941133 | |||
| a1eeb0185a | |||
| dc70aa7378 | |||
| bb37aab093 | |||
| 72bd83e0f1 | |||
| 1b69c111cc | |||
| 23eccfcd77 | |||
| 68cfdb72f9 | |||
| 0570e81ecb | |||
| 5ce736caa8 | |||
| 8145290d43 | |||
| d94b4b327d | |||
| c896d5c54d | |||
| 5cfb119475 | |||
| 092c6089c9 | |||
| 8fb3542126 | |||
| 4b0fbfcbd9 | |||
| b1ea3fb2c6 | |||
| 94aa0fbe8c | |||
| 6be8a680e2 | |||
| 6310adb3f4 | |||
| 80fa621c50 | |||
| 60854b669a | |||
| 8db14e344b | |||
| a47827691a | |||
| 3b9bf6a949 | |||
| 5eb8c77850 | |||
| 51606ad2d8 | |||
| 812e3294be | |||
| 181b0dc545 | |||
| 6b3d645e9b | |||
| 3d233b9dab | |||
| 5c364504a6 | |||
| 0864c8a59d | |||
| c498bf796b | |||
| a32da065ae | |||
| 68d9daa187 | |||
| 4bdcd23e19 | |||
| 716f93efdb | |||
| ec5f40b1a9 | |||
| 01f9bc7948 | |||
| fc218ba9e2 | |||
| f3e0eac04f | |||
| da45306da5 | |||
| 96bab3e01d | |||
| cb5a7bba89 | |||
| 0a20ddbe7d | |||
| 3575052f81 | |||
| 6d9ae2adf0 | |||
| f76dc0ff65 | |||
| 1b64c78d36 | |||
| 24654d977b | |||
| cd91adc715 | |||
| e5ba71b479 | |||
| ad307c7121 | |||
| 1c64c52951 | |||
| 74475bd5d5 | |||
| c30dadce6f | |||
| f45cf8cb2c | |||
| 4239318be9 | |||
| 33868528bb | |||
| e3af6a00ba | |||
| 95caac3cc8 | |||
| c89c390759 | |||
| 25bde46869 | |||
| 269c653560 | |||
| 88b340161b | |||
| 5b18861bf0 | |||
| 84e093e143 | |||
| 02b36f79d2 | |||
| a6f18c98f4 | |||
| 273ac54baa | |||
| 549af292b6 | |||
| 28f9b39287 | |||
| e42213ab72 | |||
| 68d998c6cf | |||
| bf22dc969c | |||
| 0031600453 | |||
| 3bcd0781f1 | |||
| 26e3dce466 | |||
| 5e54da0a69 | |||
| a4f85cc579 | |||
| bf1b681560 | |||
| 2ce0d40694 | |||
| 7f10fbbf5f | |||
| e67a234c98 | |||
| 80e3f00091 | |||
| d3fd75d21d | |||
| 8ad92a30f1 | |||
| bee0152fda | |||
| 2c7cc519d8 | |||
| 643e2728df | |||
| 3a7de25755 | |||
| 56d57a9a4e | |||
| 1449e4faa2 | |||
| b51aac313f | |||
| ee124f531b | |||
| 63ff326835 | |||
| 5ce30862f2 | |||
| dbc61bc225 | |||
| f08cc8276c | |||
| 3a5778ec5a | |||
| d0aeb0abfa | |||
| f364d3f91d | |||
| 07b5fbb9ca | |||
| 7637e2e5e4 | |||
| d980c1d746 | |||
| 339c198ade | |||
| 4f4cbbad8f | |||
| 6a211fb52d | |||
| 9271414522 | |||
| f715589ee5 | |||
| 6c506c9a07 | |||
| a28b6620d6 | |||
| c0d30fbb75 | |||
| 3b97dedfbd | |||
| d04b3d580e | |||
| 0f61d7f97c | |||
| 37f5c92302 | |||
| dc4bff71a2 | |||
| fd6a17ecfb | |||
| fe34282df6 | |||
| 6b4422a086 | |||
| 9dba637233 | |||
| 5c5cb085c0 | |||
| 1c106106fd | |||
| 65be66e4d4 | |||
| 006776fc71 | |||
| 6f80b9b3e9 | |||
| 56f2ab3335 | |||
| 5553dcba67 | |||
| 806e82b7fc | |||
| 172007a066 | |||
| 9a2e30d8bc | |||
| 272d804840 | |||
| 40b4296d07 | |||
| f24eca0c6b | |||
| 9d660d5f0e | |||
| cf7daeae7e | |||
| 62bdb79c26 | |||
| 6f7c43c7de | |||
| cf8cc1bab1 | |||
| 6b9c6cc54e | |||
| 31b4fdabbf | |||
| a9fbf9fb87 | |||
| 2e81c307d0 | |||
| c2edea7cbd | |||
| f6589dd72d | |||
| 29a27d3ca4 | |||
| e24225351c | |||
| 520f687cde | |||
| e25df8c464 | |||
| a5410db4e3 | |||
| d84336c27d | |||
| cbe6399300 | |||
| c5fe3d7490 | |||
| c04c6e6b8a | |||
| 6f90ec4703 | |||
| e3b8930087 | |||
| 70ade8e8d7 | |||
| b312305ccc | |||
| 1ad4fb6f12 | |||
| 056a53e81f | |||
| 788e2b30a5 | |||
| 005900fd2a | |||
| f97a14ba27 | |||
| 3e1d47f2cc | |||
| ad66263bc1 | |||
| 64d8fed91c | |||
| 80eb52c415 | |||
| c0852d9a0c | |||
| 5dd9ee192e | |||
| e1bb4741f1 | |||
| 4a45ddbae2 | |||
| aa34ca4309 | |||
| 11351de2d3 | |||
| 08282ec16c | |||
| 8981b64a41 | |||
| c6b8bbfa9b | |||
| 275a6f59d7 | |||
| 308e4280e3 | |||
| 5d08b03e5b | |||
| e4e3b12325 | |||
| 97247fdadd | |||
| fb563a9949 | |||
| f166ab0bec | |||
| bae927bebd | |||
| 7f62477a87 | |||
| 5a5e7bb3b1 | |||
| 6f2723ae83 | |||
| 365ed23695 | |||
| c0c2b3dc1a | |||
| 26dcfcb542 | |||
| 34eee090a7 | |||
| 9a1f42da6d | |||
| 5be31c5bf2 | |||
| 3e2569f70d | |||
| fa0f970835 | |||
| f89a34fb77 | |||
| 09e7c66714 | |||
| c4eea3e21a | |||
| 189bdcf125 | |||
| b587abd989 | |||
| 9cacdc07d7 | |||
| e054707e9a | |||
| 9cd9d86640 | |||
| 919fcc6f12 | |||
| f9694db2cb | |||
| 2154de3b3c | |||
| 0c566ce339 | |||
| 5bda1372a1 | |||
| 877f061325 | |||
| 263f258ae2 | |||
| 06b04e5c62 | |||
| d0752d358e | |||
| c7f69afe4a | |||
| 2fa0daefca | |||
| 89c13e32a0 | |||
| 235a394e04 | |||
| a10ec7f66a | |||
| 0638e55b14 | |||
| a637417d78 | |||
| 9da3c2efad | |||
| 16e382f8c5 | |||
| e12ec6169a | |||
| 01528075a2 | |||
| 3cddd60db7 | |||
| 216113139f | |||
| f664cb7c29 | |||
| 4ac669f1e8 | |||
| 99b0cba0ec | |||
| 526d69522d | |||
| a24681a87a | |||
| e1ad3c38bc | |||
| 7ff71aca59 | |||
| e205686397 | |||
| ba295bba29 | |||
| 25f9dae427 | |||
| d8f77afbb8 | |||
| aa4292ad22 | |||
| 2d4c4b65d4 | |||
| ce9423eaa7 | |||
| 26a4f319a8 | |||
| 93c5c05423 | |||
| 2f74865eef | |||
| fc391624f0 | |||
| a5224e1f83 | |||
| 30bfe73981 | |||
| b835eebad9 | |||
| 3152ccf0a4 | |||
| 38a6a195a4 | |||
| 18c2fcf8f1 | |||
| dbb6d73c8c | |||
| ae5375722e | |||
| 274d9cf950 | |||
| 7b205e100b | |||
| 39a84a780b | |||
| c782b4bb58 | |||
| b1591c6568 | |||
| 6e48852633 | |||
| 88b014092d | |||
| 7d8b8d1abe | |||
| 13d0cc41eb | |||
| f76942869c | |||
| 50ecbad305 | |||
| 1e075c08a0 | |||
| 4cbc500d1f | |||
| 4e6464937c | |||
| cb52b340d3 | |||
| f1073b930b | |||
| 4133a3cd5b | |||
| bdbb48efe9 | |||
| 965c9b97ab | |||
| 22cf3b24a5 | |||
| d19983fac1 | |||
| 283ccdc71f | |||
| 279a874108 | |||
| e0d9ebc1f2 | |||
| aede1fe6a7 | |||
| f21656d5d0 | |||
| feccdaa0ff | |||
| fc7224bac7 | |||
| 27b4936fcf | |||
| cdf9c89416 | |||
| bf953fe670 | |||
| 677ee6dee7 | |||
| 8fa38242d0 | |||
| aa3097da63 | |||
| 719368f8cf | |||
| dd70519ab4 | |||
| 38a1040957 | |||
| ea3317e782 | |||
| f871cc1b8a | |||
| 29d4f2eeb3 | |||
| a699cbcdbc | |||
| 8910a2d15a | |||
| 0d9cdacf89 | |||
| 982ea16909 | |||
| 39b10270a1 | |||
| 4e579f6067 | |||
| f6c2b4fc13 | |||
| 056c04c9b4 | |||
| 03368c0b2e | |||
| 4bc43436b9 | |||
| 5dd5e31616 | |||
| bd202c1531 | |||
| 9190787dff | |||
| 3753033ef6 | |||
| 0a02548c23 | |||
| 8399f5a230 | |||
| ffbde27300 | |||
| dd6142b7d2 | |||
| d5cb69e9ba | |||
| 285e578ed7 | |||
| e7250e5bd0 | |||
| f2b1a6c2ad | |||
| 52bdbe7617 | |||
| bf225ac4c8 | |||
| 697c3ab6b6 | |||
| 0954c43f81 | |||
| 536ac72d51 | |||
| 1024510a4a | |||
| 659d31bf25 | |||
| 3012b215f6 | |||
| 7a97eccc48 | |||
| b8dd2bb73c | |||
| 2987d698b4 | |||
| 082325c271 | |||
| 93d82f4601 | |||
| 3a9e75e464 | |||
| accc55da27 | |||
| d1c368e050 | |||
| 35ef97232c | |||
| f3e47fc8d2 | |||
| 4479a18d52 | |||
| 7869e36193 | |||
| aa132e3f9b | |||
| 34ee79470f | |||
| 9b1ffd0159 | |||
| 9741999e77 | |||
| 3274dc1461 | |||
| fe97a3dc7a | |||
| 6f09ed8643 | |||
| e0dfb65718 | |||
| 9cf58aba08 | |||
| c43a4beda8 | |||
| 64149328dd | |||
| 15bec9a365 | |||
| 665120d4e6 | |||
| 74275cf6e5 | |||
| 1187c38d6d | |||
| a19c77bd24 | |||
| b8cde34b06 | |||
| 2d28584695 | |||
| c261b351cf | |||
| 934c878eaa | |||
| b11d374122 | |||
| 337284688d | |||
| 661dd2cf61 | |||
| b0e79df977 | |||
| 6ca0ba0104 | |||
| 153694ed0a | |||
| 1541d1a36b | |||
| c159d8e872 | |||
| a8361fc214 | |||
| 96c7aa3fe5 | |||
| a3b71db63b | |||
| 66c36644d3 | |||
| 903c12c74b | |||
| 73d78d8de4 | |||
| bbdd6f2dc1 | |||
| f738eb06e7 | |||
| 6f30a86bc7 | |||
| 4db5d94af5 | |||
| 5299507674 | |||
| d5a8ec5ccd | |||
| 4daa20bb5b | |||
| 3a32daedb5 | |||
| 130fcbd649 | |||
| 96ab22afc8 | |||
| b88f5de7ec | |||
| 0ae4c47c76 | |||
| 60201a66e0 | |||
| 5a062fcd8f | |||
| 4481d845e1 | |||
| fefd37d864 | |||
| a938306457 | |||
| 8718d91313 | |||
| 24813d35f7 | |||
| 8437ce030d | |||
| 583e6a6992 | |||
| f738546c8f | |||
| 0e24cfb800 | |||
| cabce0e259 | |||
| fbe00fbec7 | |||
| 2fa78e85e9 | |||
| dd402d1fa3 | |||
| 14cf05a2cf | |||
| acfa08a69f | |||
| e986a24a9d | |||
| 7a0374f6e7 | |||
| 78087ddfa5 | |||
| bde4f81335 | |||
| 334b4f6301 | |||
| e4318be030 | |||
| 4c26ea1713 | |||
| 40ff08d84f | |||
| 9a1da08340 | |||
| eeb78f323a | |||
| 54bf1cf7dc | |||
| 376d87ca03 | |||
| fbb580c38a | |||
| 35a39e35e2 | |||
| 84a05572c9 | |||
| c01d7b4d79 | |||
| baa97ed623 | |||
| 05f4555422 | |||
| a5dd15e921 | |||
| 05299908b4 | |||
| 9a49e6004b | |||
| a3fd215cb8 | |||
| 6ff0bacee1 | |||
| 757ca142ca | |||
| 98e86d8b27 | |||
| 69b88de0df | |||
| 17b8d59a0a | |||
| d396a03bac | |||
| f404343487 | |||
| f8632149ad | |||
| a056d4fa9e | |||
| 3c9cd14006 | |||
| d5670c612b | |||
| 88d9d9fba5 | |||
| cc3e8c536c | |||
| a43b8cf330 | |||
| 028fba6878 | |||
| 8f32d623c5 | |||
| 63e8936bb1 | |||
| 5b806d1524 | |||
| 7679e8d256 | |||
| e1a1827b59 | |||
| 9f098ef0ec |
+1
-1
@@ -19,7 +19,7 @@ $returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths
|
||||
$PAGE->set_url($returnurl);
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$auth = optional_param('auth', '', PARAM_PLUGIN);
|
||||
$auth = optional_param('auth', '', PARAM_SAFEDIR);
|
||||
|
||||
get_enabled_auth_plugins(true); // fix the list of enabled auths
|
||||
if (empty($CFG->auth)) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
require_once '../config.php';
|
||||
require_once $CFG->libdir.'/adminlib.php';
|
||||
|
||||
$auth = required_param('auth', PARAM_PLUGIN);
|
||||
$auth = required_param('auth', PARAM_SAFEDIR);
|
||||
$PAGE->set_pagetype('admin-auth-' . $auth);
|
||||
|
||||
admin_externalpage_setup('authsetting'.$auth);
|
||||
|
||||
+28
-3
@@ -98,9 +98,34 @@
|
||||
exit;
|
||||
|
||||
} else {
|
||||
uninstall_plugin('block', $block->name);
|
||||
// Inform block it's about to be deleted
|
||||
if (file_exists("$CFG->dirroot/blocks/$block->name/block_$block->name.php")) {
|
||||
$blockobject = block_instance($block->name);
|
||||
if ($blockobject) {
|
||||
$blockobject->before_delete(); //only if we can create instance, block might have been already removed
|
||||
}
|
||||
}
|
||||
|
||||
// First delete instances and then block
|
||||
$instances = $DB->get_records('block_instances', array('blockname' => $block->name));
|
||||
if(!empty($instances)) {
|
||||
foreach($instances as $instance) {
|
||||
blocks_delete_instance($instance);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete block
|
||||
$DB->delete_records('block', array('id'=>$block->id));
|
||||
|
||||
drop_plugin_tables($block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false); // old obsoleted table names
|
||||
drop_plugin_tables('block_'.$block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false);
|
||||
|
||||
// Delete the capabilities that were defined by this block
|
||||
capabilities_cleanup('block/'.$block->name);
|
||||
|
||||
// Remove event handlers and dequeue pending events
|
||||
events_uninstall('block/'.$block->name);
|
||||
|
||||
$a = new stdClass();
|
||||
$a->block = $strblockname;
|
||||
$a->directory = $CFG->dirroot.'/blocks/'.$block->name;
|
||||
notice(get_string('blockdeletefiles', '', $a), 'blocks.php');
|
||||
@@ -225,7 +250,7 @@
|
||||
$tablerows[] = array(strip_tags($strblockname), $row); // first element will be used for sorting
|
||||
}
|
||||
|
||||
collatorlib::asort($tablerows);
|
||||
textlib_get_instance()->asort($tablerows);
|
||||
foreach ($tablerows as $row) {
|
||||
$table->add_data($row[1]);
|
||||
}
|
||||
|
||||
@@ -1,49 +1,27 @@
|
||||
<?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
|
||||
*/
|
||||
/// Create "blog" forums in each course and copy blog entries from these courses' participants in these forums
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../../../config.php');
|
||||
require_once('../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');
|
||||
admin_externalpage_setup('bloglevelupgrade');
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
|
||||
$go = optional_param('go', 0, PARAM_BOOL);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_bloglevelupgrade'));
|
||||
echo $OUTPUT->heading(get_string('bloglevelupgrade', 'admin'));
|
||||
|
||||
$strbloglevelupgrade = get_string('bloglevelupgradeinfo', 'tool_bloglevelupgrade');
|
||||
$strbloglevelupgrade = get_string('bloglevelupgradeinfo', 'admin');
|
||||
|
||||
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->confirm($strbloglevelupgrade, new moodle_url('bloglevelupgrade.php', $optionsyes), 'index.php');
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
@@ -60,7 +38,7 @@ $i = 0;
|
||||
// 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);
|
||||
$pbar = new progress_bar('bloglevelupgrade', 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');
|
||||
@@ -94,7 +72,7 @@ if ($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL)
|
||||
}
|
||||
|
||||
$a->userscount = $i . '/' . count($bloggers);
|
||||
$pbar->update($i, count($bloggers), get_string('bloglevelupgradeprogress', 'tool_bloglevelupgrade', $a));
|
||||
$pbar->update($i, count($bloggers), get_string('bloglevelupgradeprogress', 'admin', $a));
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@@ -121,7 +99,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
|
||||
$discussion->groupid = $groupid;
|
||||
$message = '';
|
||||
|
||||
$discussionid = forum_add_discussion($discussion, null, $message, $blogentry->userid);
|
||||
$discussionid = forum_add_discussion($discussion, null, $message);
|
||||
|
||||
// Copy file attachment records
|
||||
$fs = get_file_storage();
|
||||
@@ -157,7 +135,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
|
||||
// END OF LOOP
|
||||
|
||||
// set conversion flag - switches to new plugin automatically
|
||||
unset_config('tool_bloglevelupgrade_pending');
|
||||
set_config('bloglevel_upgrade_complete', 1);
|
||||
// Finally switch bloglevel to 0 (disabled)
|
||||
set_config('bloglevel', 0);
|
||||
|
||||
@@ -168,7 +146,7 @@ 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->continue_button('index.php');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
+12
-48
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* This script is not intended for beginners!
|
||||
* Potential problems:
|
||||
* - environment check is not present yet
|
||||
* - su to apache account or sudo before execution
|
||||
* - not compatible with Windows platform
|
||||
*
|
||||
@@ -78,16 +79,6 @@ Example:
|
||||
"; //TODO: localize, mark as needed in install - to be translated later when everything is finished
|
||||
|
||||
|
||||
// distro specific customisation
|
||||
$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
|
||||
$distro = null;
|
||||
if (file_exists($distrolibfile)) {
|
||||
require_once($distrolibfile);
|
||||
if (function_exists('distro_get_config')) {
|
||||
$distro = distro_get_config();
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing to do if config.php exists
|
||||
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
|
||||
if (file_exists($configfile)) {
|
||||
@@ -100,16 +91,12 @@ if (file_exists($configfile)) {
|
||||
echo "\n\n";
|
||||
}
|
||||
|
||||
if ($DB->get_manager()->table_exists('config')) {
|
||||
cli_error(get_string('clialreadyinstalled', 'install'));
|
||||
} else {
|
||||
cli_error(get_string('clialreadyconfigured', 'install'));
|
||||
}
|
||||
cli_error(get_string('clialreadyinstalled', 'install'));
|
||||
}
|
||||
|
||||
$olddir = getcwd();
|
||||
|
||||
// change directory so that includes below work properly
|
||||
// change directory so that includes bellow work properly
|
||||
chdir(dirname($_SERVER['argv'][0]));
|
||||
|
||||
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
|
||||
@@ -143,6 +130,7 @@ $CFG->dirroot = dirname(dirname(dirname(__FILE__)));
|
||||
$CFG->libdir = "$CFG->dirroot/lib";
|
||||
$CFG->wwwroot = "http://localhost";
|
||||
$CFG->httpswwwroot = $CFG->wwwroot;
|
||||
$CFG->dataroot = str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata');
|
||||
$CFG->docroot = 'http://docs.moodle.org';
|
||||
$CFG->running_installer = true;
|
||||
$CFG->early_install_lang = true;
|
||||
@@ -190,14 +178,14 @@ if (empty($databases)) {
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
|
||||
'chmod' => '2777',
|
||||
'lang' => $CFG->lang,
|
||||
'wwwroot' => '',
|
||||
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
|
||||
'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
|
||||
'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
|
||||
'dataroot' => $CFG->dataroot,
|
||||
'dbtype' => $defaultdb,
|
||||
'dbhost' => 'localhost',
|
||||
'dbname' => 'moodle',
|
||||
'dbuser' => empty($distro->dbuser) ? 'root' : $distro->dbuser, // let distros set dbuser
|
||||
'dbuser' => 'root',
|
||||
'dbpass' => '',
|
||||
'dbsocket' => false,
|
||||
'prefix' => 'mdl_',
|
||||
@@ -337,7 +325,9 @@ $CFG->httpswwwroot = $CFG->wwwroot;
|
||||
|
||||
|
||||
//We need dataroot before lang download
|
||||
$CFG->dataroot = $options['dataroot'];
|
||||
if (!empty($options['dataroot'])) {
|
||||
$CFG->dataroot = $options['dataroot'];
|
||||
}
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
$i=0;
|
||||
@@ -385,8 +375,6 @@ if ($interactive) {
|
||||
cli_error(get_string('pathserrcreatedataroot', 'install', $a));
|
||||
}
|
||||
}
|
||||
$CFG->tempdir = $CFG->dataroot.'/temp';
|
||||
$CFG->cachedir = $CFG->dataroot.'/cache';
|
||||
|
||||
// download required lang packs
|
||||
if ($CFG->lang !== 'en') {
|
||||
@@ -528,9 +516,6 @@ if ($interactive) {
|
||||
}
|
||||
|
||||
$CFG->dbpass = cli_input($prompt, $options['dbpass']);
|
||||
if (function_exists('distro_pre_create_db')) { // Hook for distros needing to do something before DB creation
|
||||
$distro = distro_pre_create_db($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']), $distro);
|
||||
}
|
||||
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']));
|
||||
} while ($hint_database !== '');
|
||||
|
||||
@@ -660,27 +645,6 @@ require($configfile);
|
||||
$CFG->lang = $installlang;
|
||||
$SESSION->lang = $CFG->lang;
|
||||
|
||||
require("$CFG->dirroot/version.php");
|
||||
|
||||
// Test environment first.
|
||||
require_once($CFG->libdir . '/environmentlib.php');
|
||||
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
|
||||
if (!$envstatus) {
|
||||
$errors = environment_get_errors($environment_results);
|
||||
cli_heading(get_string('environment', 'admin'));
|
||||
foreach ($errors as $error) {
|
||||
list($info, $report) = $error;
|
||||
echo "!! $info !!\n$report\n\n";
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
install_cli_database($options, $interactive);
|
||||
|
||||
echo get_string('cliinstallfinished', 'install')."\n";
|
||||
|
||||
@@ -144,26 +144,6 @@ if ($CFG->lang !== 'en') {
|
||||
$CFG->early_install_lang = false;
|
||||
get_string_manager(true);
|
||||
|
||||
require("$CFG->dirroot/version.php");
|
||||
|
||||
// Test environment first.
|
||||
require_once($CFG->libdir . '/environmentlib.php');
|
||||
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
|
||||
if (!$envstatus) {
|
||||
$errors = environment_get_errors($environment_results);
|
||||
cli_heading(get_string('environment', 'admin'));
|
||||
foreach ($errors as $error) {
|
||||
list($info, $report) = $error;
|
||||
echo "!! $info !!\n$report\n\n";
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
install_cli_database($options, true);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -76,13 +76,7 @@ if (!empty($options['engine'])) {
|
||||
}
|
||||
echo str_pad($table->name, 40). " - ";
|
||||
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
|
||||
} catch (moodle_exception $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} TYPE = $engine");
|
||||
echo "DONE\n";
|
||||
$converted++;
|
||||
}
|
||||
|
||||
@@ -1,53 +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/>.
|
||||
|
||||
/**
|
||||
* @package core
|
||||
* @subpackage cli
|
||||
* @copyright 2011 David Mudrak <david@moodle.com>
|
||||
* @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');
|
||||
|
||||
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
|
||||
}
|
||||
|
||||
if ($options['help']) {
|
||||
$help =
|
||||
"Invalidates all Moodle internal caches
|
||||
|
||||
Options:
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/purge_caches.php
|
||||
";
|
||||
|
||||
echo $help;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
purge_all_caches();
|
||||
|
||||
exit(0);
|
||||
+4
-13
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* This script is not intended for beginners!
|
||||
* Potential problems:
|
||||
* - environment check is not present yet
|
||||
* - su to apache account or sudo before execution
|
||||
* - not compatible with Windows platform
|
||||
*
|
||||
@@ -36,7 +37,7 @@ require_once($CFG->libdir.'/adminlib.php'); // various admin-only function
|
||||
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/pluginlib.php');
|
||||
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
@@ -92,13 +93,8 @@ if ($version < $CFG->version) {
|
||||
$oldversion = "$CFG->release ($CFG->version)";
|
||||
$newversion = "$release ($version)";
|
||||
|
||||
if (!moodle_needs_upgrading()) {
|
||||
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 0);
|
||||
}
|
||||
|
||||
// Test environment first.
|
||||
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
|
||||
if (!$envstatus) {
|
||||
// test environment first
|
||||
if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) {
|
||||
$errors = environment_get_errors($environment_results);
|
||||
cli_heading(get_string('environment', 'admin'));
|
||||
foreach ($errors as $error) {
|
||||
@@ -108,11 +104,6 @@ if (!$envstatus) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
if ($interactive) {
|
||||
$a = new stdClass();
|
||||
$a->oldversion = $oldversion;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?PHP
|
||||
// dbperformance.php - shows latest ADOdb stats for the current server
|
||||
|
||||
// disable moodle specific debug messages and any errors in output
|
||||
define('NO_DEBUG_DISPLAY', true);
|
||||
|
||||
require_once('../config.php');
|
||||
|
||||
error('TODO: rewrite db perf code'); // TODO: rewrite
|
||||
|
||||
|
||||
$topframe = optional_param('topframe', 0, PARAM_BOOL);
|
||||
$bottomframe = optional_param('bottomframe', 0, PARAM_BOOL);
|
||||
$do = optional_param('do', '', PARAM_ALPHA);
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$strdatabaseperformance = get_string("databaseperformance");
|
||||
$stradministration = get_string("administration");
|
||||
$site = get_site();
|
||||
|
||||
if (!empty($topframe)) {
|
||||
$PAGE->set_url('/admin/dbperformance.php');
|
||||
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php'));
|
||||
$PAGE->navbar->add($strdatabaseperformance);
|
||||
$PAGE->set_title("$site->shortname: $strdatabaseperformance");
|
||||
$PAGE->set_heading($site->fullname);
|
||||
echo $OUTPUT->header();
|
||||
exit;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
||||
}
|
||||
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
class database_export_form extends moodleform {
|
||||
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'database', get_string('dbexport', 'dbtransfer'));
|
||||
$mform->addElement('textarea', 'description', get_string('description'), array('rows'=>5, 'cols'=>60));
|
||||
|
||||
$this->add_action_buttons(false, get_string('exportdata', 'dbtransfer'));
|
||||
}
|
||||
}
|
||||
+5
-28
@@ -1,29 +1,8 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Transfer form
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2008 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
||||
}
|
||||
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
@@ -32,7 +11,7 @@ class database_transfer_form extends moodleform {
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'database', get_string('dbtransfer', 'tool_dbtransfer'));
|
||||
$mform->addElement('header', 'database', get_string('dbtransfer', 'dbtransfer'));
|
||||
|
||||
$supported = array (
|
||||
'mysqli/native',
|
||||
@@ -57,8 +36,6 @@ class database_transfer_form extends moodleform {
|
||||
$mform->addElement('text', 'dbuser', get_string('user'));
|
||||
$mform->addElement('text', 'dbpass', get_string('password'));
|
||||
$mform->addElement('text', 'prefix', get_string('dbprefix', 'install'));
|
||||
$mform->addElement('text', 'dbport', get_string('dbport', 'install'));
|
||||
$mform->addElement('text', 'dbsocket', get_string('databasesocket', 'install'));
|
||||
|
||||
$mform->addRule('dbhost', get_string('required'), 'required', null);
|
||||
$mform->addRule('dbname', get_string('required'), 'required', null);
|
||||
@@ -66,6 +43,6 @@ class database_transfer_form extends moodleform {
|
||||
$mform->addRule('dbpass', get_string('required'), 'required', null);
|
||||
$mform->addRule('prefix', get_string('required'), 'required', null);
|
||||
|
||||
$this->add_action_buttons(false, get_string('transferdata', 'tool_dbtransfer'));
|
||||
$this->add_action_buttons(false, get_string('transferdata', 'dbtransfer'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
require('../../config.php');
|
||||
require_once('lib.php');
|
||||
require_once('database_export_form.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('dbexport');
|
||||
|
||||
//create form
|
||||
$form = new database_export_form();
|
||||
|
||||
if ($data = $form->get_data()) {
|
||||
dbtransfer_export_xml_database($data->description, $DB);
|
||||
die;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
// TODO: add some more info here
|
||||
$form->display();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
require('../../config.php');
|
||||
require_once('lib.php');
|
||||
require_once('database_transfer_form.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('dbtransfer');
|
||||
|
||||
// Create the form
|
||||
$form = new database_transfer_form();
|
||||
|
||||
// If we have valid input.
|
||||
if ($data = $form->get_data()) {
|
||||
// Connect to the other database.
|
||||
list($dbtype, $dblibrary) = explode('/', $data->driver);
|
||||
$targetdb = moodle_database::get_driver_instance($dbtype, $dblibrary);
|
||||
if (!$targetdb->connect($data->dbhost, $data->dbuser, $data->dbpass, $data->dbname, $data->prefix, null)) {
|
||||
throw new dbtransfer_exception('notargetconectexception', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
|
||||
}
|
||||
if ($targetdb->get_tables()) {
|
||||
throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
|
||||
}
|
||||
|
||||
// Start output.
|
||||
echo $OUTPUT->header();
|
||||
$data->dbtype = $dbtype;
|
||||
echo $OUTPUT->heading(get_string('transferringdbto', 'dbtransfer', $data));
|
||||
|
||||
// Do the transfer.
|
||||
$feedback = new html_list_progress_trace();
|
||||
dbtransfer_transfer_database($DB, $targetdb, $feedback);
|
||||
$feedback->finished();
|
||||
|
||||
// Finish up.
|
||||
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button("$CFG->wwwroot/$CFG->admin/");
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
// Otherwise display the settings form.
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('transferdbtoserver', 'dbtransfer'));
|
||||
echo '<p>', get_string('transferdbintro', 'dbtransfer'), "</p>\n\n";
|
||||
$form->display();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -1,34 +1,10 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Export db content to file.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
/*
|
||||
|
||||
TODO:
|
||||
- exporting to server file >2GB fails in 32bit operating systems - needs warning
|
||||
- we may run out of disk space exporting to server file - we must verify the file is not truncated; read from the end of file?
|
||||
- we may run out of disk space exporting to srever file - we must verify the file is not truncated; read from the end of file?
|
||||
- when sending file >4GB - FAT32 limit, Apache limit, browser limit - needs warning
|
||||
- there must be some form of progress bar during export, transfer - new tracking class could be passed around
|
||||
- command line operation - could work around some 2G/4G limits in PHP; useful for cron full backups
|
||||
@@ -37,7 +13,7 @@ TODO:
|
||||
(user would need file access to dataroot which might prevent various "accidents")
|
||||
- implement "Export/import running" notification in lib/setup.php (similar to new upgrade flag in config table)
|
||||
- gzip compression when storing xml file - the xml is very verbose and full of repeated tags (zip is not suitable here at all)
|
||||
this could help us keep the files below 2G (expected ratio is > 10:1)
|
||||
this could help us keep the files bellow 2G (expected ratio is > 10:1)
|
||||
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
// Deletes the moodledata directory, COMPLETELY!!
|
||||
// BE VERY CAREFUL USING THIS!
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('purgemoodledata');
|
||||
|
||||
require_login();
|
||||
|
||||
$sure = optional_param('sure', 0, PARAM_BOOL);
|
||||
$reallysure = optional_param('reallysure', 0, PARAM_BOOL);
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$deletedir = $CFG->dataroot; // The directory to delete!
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading('Purge moodledata');
|
||||
|
||||
if (empty($sure)) {
|
||||
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
|
||||
|
||||
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button('index.php', get_string('no'), 'get');
|
||||
echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!data_submitted() or empty($reallysure)) {
|
||||
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
|
||||
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button('index.php', get_string('no'), 'get');
|
||||
echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '.
|
||||
$deletedir .' (this includes all user images, and any other course files that have been created) ?',
|
||||
$formcontinue, $formcancel);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('wrongcall', 'error');
|
||||
}
|
||||
|
||||
/// OK, here goes ...
|
||||
|
||||
delete_subdirectories($deletedir);
|
||||
|
||||
echo '<h1 align="center">Done!</h1>';
|
||||
echo $OUTPUT->continue_button($CFG->wwwroot);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
|
||||
function delete_subdirectories($rootdir) {
|
||||
|
||||
$dir = opendir($rootdir);
|
||||
|
||||
while (false !== ($file = readdir($dir))) {
|
||||
if ($file != '.' and $file != '..') {
|
||||
$fullfile = $rootdir .'/'. $file;
|
||||
if (filetype($fullfile) == 'dir') {
|
||||
delete_subdirectories($fullfile);
|
||||
echo 'Deleting '. $fullfile .' ... ';
|
||||
if (rmdir($fullfile)) {
|
||||
echo 'Done.<br />';
|
||||
} else {
|
||||
echo 'FAILED.<br />';
|
||||
}
|
||||
} else {
|
||||
echo 'Deleting '. $fullfile .' ... ';
|
||||
if (unlink($fullfile)) {
|
||||
echo 'Done.<br />';
|
||||
} else {
|
||||
echo 'FAILED.<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ 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);
|
||||
$editor = optional_param('editor', '', PARAM_SAFEDIR);
|
||||
|
||||
// get currently installed and enabled auth plugins
|
||||
$available_editors = editors_get_available();
|
||||
|
||||
+1
-8
@@ -27,11 +27,10 @@ require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$enrol = required_param('enrol', PARAM_PLUGIN);
|
||||
$enrol = required_param('enrol', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/enrol.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
@@ -42,13 +41,10 @@ $all = enrol_get_plugins(false);
|
||||
|
||||
$return = new moodle_url('/admin/settings.php', array('section'=>'manageenrols'));
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
unset($enabled[$enrol]);
|
||||
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
|
||||
$syscontext->mark_dirty(); // resets all enrol caches
|
||||
break;
|
||||
|
||||
case 'enable':
|
||||
@@ -58,7 +54,6 @@ switch ($action) {
|
||||
$enabled = array_keys($enabled);
|
||||
$enabled[] = $enrol;
|
||||
set_config('enrol_plugins_enabled', implode(',', $enabled));
|
||||
$syscontext->mark_dirty(); // resets all enrol caches
|
||||
break;
|
||||
|
||||
case 'up':
|
||||
@@ -111,9 +106,7 @@ switch ($action) {
|
||||
|
||||
} else { // Delete everything!!
|
||||
uninstall_plugin('enrol', $enrol);
|
||||
$syscontext->mark_dirty(); // resets all enrol caches
|
||||
|
||||
$a = new stdClass();
|
||||
$a->plugin = $strplugin;
|
||||
$a->directory = "$CFG->dirroot/enrol/$enrol";
|
||||
echo $OUTPUT->notification(get_string('uninstalldeletefiles', 'enrol', $a), 'notifysuccess');
|
||||
|
||||
+124
-96
@@ -1,109 +1,137 @@
|
||||
<?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 the admin frontend to execute all the checks available
|
||||
* in the environment.xml file. It includes database, php and
|
||||
* php_extensions. Also, it's possible to update the xml file
|
||||
* from moodle.org be able to check more and more versions.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage admin
|
||||
* @copyright 2006 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is the admin frontend to execute all the checks available
|
||||
// in the environment.xml file. It includes database, php and
|
||||
// php_extensions. Also, it's possible to update the xml file
|
||||
// from moodle.org be able to check more and more versions.
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
admin_externalpage_setup('environment');
|
||||
|
||||
/// Parameters
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$version = optional_param('version', '', PARAM_FILE); //
|
||||
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
/// Get some strings
|
||||
$stradmin = get_string('administration');
|
||||
$stradminhelpenvironment = get_string("adminhelpenvironment");
|
||||
$strenvironment = get_string('environment', 'admin');
|
||||
$strerror = get_string('error');
|
||||
$strmoodleversion = get_string('moodleversion');
|
||||
$strupdate = get_string('updatecomponent', 'admin');
|
||||
$strupwards = get_string('upwards', 'admin');
|
||||
$strmisc = get_string('miscellaneous');
|
||||
|
||||
// Parameters
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$version = optional_param('version', '', PARAM_FILE); //
|
||||
/// Print the header stuff
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$extraurlparams = array();
|
||||
if ($version) {
|
||||
$extraurlparams['version'] = $version;
|
||||
}
|
||||
admin_externalpage_setup('environment', '', $extraurlparams);
|
||||
/// Print the component download link
|
||||
echo '<div class="reportlink"><a href="environment.php?action=updatecomponent&sesskey='.sesskey().'">'.$strupdate.'</a></div>';
|
||||
|
||||
// Handle the 'updatecomponent' action
|
||||
if ($action == 'updatecomponent' && confirm_sesskey()) {
|
||||
// Create component installer and execute it
|
||||
if ($cd = new component_installer('http://download.moodle.org',
|
||||
'environment',
|
||||
'environment.zip')) {
|
||||
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
|
||||
switch ($status) {
|
||||
case COMPONENT_ERROR:
|
||||
if ($cd->get_error() == 'remotedownloaderror') {
|
||||
$a = new stdClass();
|
||||
$a->url = 'http://download.moodle.org/environment/environment.zip';
|
||||
$a->dest = $CFG->dataroot . '/';
|
||||
print_error($cd->get_error(), 'error', $PAGE->url, $a);
|
||||
die();
|
||||
echo $OUTPUT->heading($strenvironment);
|
||||
|
||||
} else {
|
||||
print_error($cd->get_error(), 'error', $PAGE->url);
|
||||
die();
|
||||
}
|
||||
|
||||
case COMPONENT_UPTODATE:
|
||||
redirect($PAGE->url, get_string($cd->get_error(), 'error'));
|
||||
die;
|
||||
|
||||
case COMPONENT_INSTALLED:
|
||||
redirect($PAGE->url, get_string('componentinstalled', 'admin'));
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get current Moodle version
|
||||
$current_version = $CFG->release;
|
||||
|
||||
// Calculate list of versions
|
||||
$versions = array();
|
||||
if ($contents = load_environment_xml()) {
|
||||
if ($env_versions = get_list_of_environment_versions($contents)) {
|
||||
// Set the current version at the beginning
|
||||
$env_version = normalize_version($current_version); //We need this later (for the upwards)
|
||||
$versions[$env_version] = $current_version;
|
||||
// If no version has been previously selected, default to $current_version
|
||||
if (empty($version)) {
|
||||
$version = $env_version;
|
||||
}
|
||||
//Iterate over each version, adding bigger than current
|
||||
foreach ($env_versions as $env_version) {
|
||||
if (version_compare(normalize_version($current_version), $env_version, '<')) {
|
||||
$versions[$env_version] = $env_version;
|
||||
/// Handle the 'updatecomponent' action
|
||||
if ($action == 'updatecomponent' && confirm_sesskey()) {
|
||||
/// Create component installer and execute it
|
||||
if ($cd = new component_installer('http://download.moodle.org',
|
||||
'environment',
|
||||
'environment.zip')) {
|
||||
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
|
||||
switch ($status) {
|
||||
case COMPONENT_ERROR:
|
||||
if ($cd->get_error() == 'remotedownloaderror') {
|
||||
$a = new stdClass();
|
||||
$a->url = 'http://download.moodle.org/environment/environment.zip';
|
||||
$a->dest= $CFG->dataroot.'/';
|
||||
echo $OUTPUT->box(get_string($cd->get_error(), 'error', $a), 'errorbox');
|
||||
} else {
|
||||
echo $OUTPUT->box(get_string($cd->get_error(), 'error'), 'errorbox');
|
||||
}
|
||||
break;
|
||||
case COMPONENT_UPTODATE:
|
||||
echo $OUTPUT->box(get_string($cd->get_error(), 'error'));
|
||||
break;
|
||||
case COMPONENT_INSTALLED:
|
||||
echo $OUTPUT->box(get_string('componentinstalled', 'admin'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Add 'upwards' to the last element
|
||||
$versions[$env_version] = $env_version.' '.get_string('upwards', 'admin');
|
||||
} else {
|
||||
$versions = array('error' => get_string('error'));
|
||||
}
|
||||
}
|
||||
|
||||
// Get the results of the environment check.
|
||||
list($envstatus, $environment_results) = check_moodle_environment($version);
|
||||
/// Start of main box
|
||||
echo $OUTPUT->box_start();
|
||||
|
||||
echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
|
||||
|
||||
/// Get current Moodle version
|
||||
$current_version = $CFG->release;
|
||||
|
||||
/// Calculate list of versions
|
||||
$versions = array();
|
||||
if ($contents = load_environment_xml()) {
|
||||
if ($env_versions = get_list_of_environment_versions($contents)) {
|
||||
/// Set the current version at the beginning
|
||||
$env_version = normalize_version($current_version); //We need this later (for the upwards)
|
||||
$versions[$env_version] = $current_version;
|
||||
/// If no version has been previously selected, default to $current_version
|
||||
if (empty($version)) {
|
||||
$version = $env_version;
|
||||
}
|
||||
///Iterate over each version, adding bigger than current
|
||||
foreach ($env_versions as $env_version) {
|
||||
if (version_compare(normalize_version($current_version), $env_version, '<')) {
|
||||
$versions[$env_version] = $env_version;
|
||||
}
|
||||
}
|
||||
/// Add 'upwards' to the last element
|
||||
$versions[$env_version] = $env_version.' '.$strupwards;
|
||||
} else {
|
||||
$versions = array('error' => $strerror);
|
||||
}
|
||||
}
|
||||
|
||||
/// Print form and popup menu
|
||||
echo '<div style="text-align:center"> ';
|
||||
$select = new single_select(new moodle_url('/admin/environment.php'), 'version', $versions, $version, null);
|
||||
$select->label = $strmoodleversion;
|
||||
echo $OUTPUT->render($select);
|
||||
echo '</div>';
|
||||
|
||||
/// End of main box
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
/// Gather and show results
|
||||
$status = check_moodle_environment($version, $environment_results);
|
||||
|
||||
/// Print footer
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
// Display the page.
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->environment_check_page($versions, $version, $envstatus, $environment_results);
|
||||
|
||||
+15
-225
@@ -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" />
|
||||
@@ -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" />
|
||||
@@ -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" />
|
||||
@@ -544,226 +556,4 @@
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.3" 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>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK 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_CHECK 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_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK 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>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK 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_CHECK 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_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK 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>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -242,7 +242,6 @@ 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
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -17,14 +18,14 @@
|
||||
/**
|
||||
* Random course generator. By Nicolas Connault and friends.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage generator
|
||||
* @copyright 2009 Nicolas Connault
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* To use go to .../admin/generator.php?web_interface=1 in your browser.
|
||||
*
|
||||
* @package generator
|
||||
* @copyright 2009 Nicolas Connault
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once(dirname(__FILE__).'/../config.php');
|
||||
require_once($CFG->libdir . '/formslib.php');
|
||||
require_once($CFG->dirroot .'/course/lib.php');
|
||||
require_once($CFG->libdir .'/filelib.php');
|
||||
@@ -1119,7 +1120,7 @@ class generator_cli extends generator {
|
||||
$help .= " -{$argument->short},$paddingstr1--{$argument->long}$equal$paddingstr2{$argument->help}\n";
|
||||
}
|
||||
|
||||
$help .= "\nUse http://tracker.moodle.org for any suggestions or bug reports.\n";
|
||||
$help .= "\nEmail nicolas@moodle.com for any suggestions or bug reports.\n";
|
||||
|
||||
if ($argc == 1 || in_array($settings[1], array('--help', '-help', '-h', '-?'))) {
|
||||
echo $help;
|
||||
@@ -1175,12 +1176,14 @@ class generator_cli extends generator {
|
||||
echo "Invalid username or password!{$this->eolchar}";
|
||||
die();
|
||||
}
|
||||
if (!is_siteadmin($user)) {//TODO: add some proper access control check here!!
|
||||
complete_user_login($user);
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
if (!is_siteadmin($user->id)) {//TODO: add some proper access control check here!!
|
||||
echo "You do not have administration privileges on this Moodle site. "
|
||||
."These are required for running the generation script.{$this->eolchar}";
|
||||
die();
|
||||
}
|
||||
complete_user_login($user);
|
||||
}
|
||||
|
||||
parent::generate_data();
|
||||
@@ -1212,15 +1215,14 @@ class generator_web extends generator {
|
||||
global $CFG;
|
||||
$this->mform = new generator_form();
|
||||
|
||||
$this->do_generation = optional_param('do_generation', false, PARAM_BOOL);
|
||||
|
||||
if ($data = $this->mform->get_data(false)) {
|
||||
$this->do_generation = optional_param('do_generation', false, PARAM_BOOL);
|
||||
foreach ($this->settings as $setting) {
|
||||
if (isset($data->{$setting->long})) {
|
||||
$this->set($setting->long, $data->{$setting->long});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->do_generation = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1313,3 +1315,22 @@ class generator_form extends moodleform {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (CLI_SCRIPT) {
|
||||
$generator = new generator_cli($argv, $argc);
|
||||
$generator->generate_data();
|
||||
} elseif (strstr($_SERVER['REQUEST_URI'], 'generator.php')) {
|
||||
require_login();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$PAGE->set_url('/admin/generator.php');
|
||||
$PAGE->set_pagelayout('base');
|
||||
$generator = new generator_web();
|
||||
$generator->setup();
|
||||
$generator->display();
|
||||
$generator->generate_data();
|
||||
$generator->complete();
|
||||
} else {
|
||||
$generator = new generator_silent();
|
||||
}
|
||||
@@ -1,42 +1,25 @@
|
||||
<?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_health', language 'en', branch 'MOODLE_22_STABLE'
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage health
|
||||
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
ob_start(); //for whitespace test
|
||||
require('../../../config.php');
|
||||
$extraws = ob_get_clean();
|
||||
require_once('../config.php');
|
||||
|
||||
// extra whitespace test - intentionally breaks cookieless mode
|
||||
$extraws = '';
|
||||
while (ob_get_level()) {
|
||||
$extraws .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toolhealth');
|
||||
admin_externalpage_setup('healthcenter');
|
||||
|
||||
define('SEVERITY_NOTICE', 'notice');
|
||||
define('SEVERITY_ANNOYANCE', 'annoyance');
|
||||
define('SEVERITY_SIGNIFICANT', 'significant');
|
||||
define('SEVERITY_CRITICAL', 'critical');
|
||||
|
||||
$solution = optional_param('solution', 0, PARAM_PLUGIN);
|
||||
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
@@ -45,6 +28,68 @@
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo <<<STYLES
|
||||
<style type="text/css">
|
||||
div#healthnoproblemsfound {
|
||||
width: 60%;
|
||||
margin: auto;
|
||||
padding: 1em;
|
||||
border: 1px black solid;
|
||||
-moz-border-radius: 6px;
|
||||
}
|
||||
dl.healthissues {
|
||||
width: 60%;
|
||||
margin: auto;
|
||||
}
|
||||
dl.critical dt, dl.critical dd {
|
||||
background-color: #a71501;
|
||||
}
|
||||
dl.significant dt, dl.significant dd {
|
||||
background-color: #d36707;
|
||||
}
|
||||
dl.annoyance dt, dl.annoyance dd {
|
||||
background-color: #dba707;
|
||||
}
|
||||
dl.notice dt, dl.notice dd {
|
||||
background-color: #e5db36;
|
||||
}
|
||||
dt.solution, dd.solution, div#healthnoproblemsfound {
|
||||
background-color: #5BB83E !important;
|
||||
}
|
||||
dl.healthissues dt, dl.healthissues dd {
|
||||
margin: 0px;
|
||||
padding: 1em;
|
||||
border: 1px black solid;
|
||||
}
|
||||
dl.healthissues dt {
|
||||
font-weight: bold;
|
||||
border-bottom: none;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
dl.healthissues dd {
|
||||
border-top: none;
|
||||
padding-top: 0.5em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
dl.healthissues dd form {
|
||||
margin-top: 0.5em;
|
||||
text-align: right;
|
||||
}
|
||||
form#healthformreturn {
|
||||
text-align: center;
|
||||
margin: 2em;
|
||||
}
|
||||
dd.solution p {
|
||||
padding: 0px;
|
||||
margin: 1em 0px;
|
||||
}
|
||||
dd.solution li {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
</style>
|
||||
STYLES;
|
||||
|
||||
if(strpos($solution, 'problem_') === 0 && class_exists($solution)) {
|
||||
health_print_solution($solution);
|
||||
}
|
||||
@@ -59,7 +104,7 @@
|
||||
function health_find_problems() {
|
||||
global $OUTPUT;
|
||||
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_health'));
|
||||
echo $OUTPUT->heading(get_string('healthcenter'));
|
||||
|
||||
$issues = array(
|
||||
SEVERITY_CRITICAL => array(),
|
||||
@@ -72,10 +117,9 @@ function health_find_problems() {
|
||||
for($i = 1; $i < 1000000; ++$i) {
|
||||
$classname = sprintf('problem_%06d', $i);
|
||||
if(!class_exists($classname)) {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
$problem = new $classname;
|
||||
|
||||
if($problem->exists()) {
|
||||
$severity = $problem->severity();
|
||||
$issues[$severity][$classname] = array(
|
||||
@@ -90,11 +134,11 @@ function health_find_problems() {
|
||||
|
||||
if($problems == 0) {
|
||||
echo '<div id="healthnoproblemsfound">';
|
||||
echo get_string('healthnoproblemsfound', 'tool_health');
|
||||
echo get_string('healthnoproblemsfound');
|
||||
echo '</div>';
|
||||
}
|
||||
else {
|
||||
echo $OUTPUT->heading(get_string('healthproblemsdetected', 'tool_health'));
|
||||
echo $OUTPUT->heading(get_string('healthproblemsdetected'));
|
||||
$severities = array(SEVERITY_CRITICAL, SEVERITY_SIGNIFICANT, SEVERITY_ANNOYANCE, SEVERITY_NOTICE);
|
||||
foreach($severities as $severity) {
|
||||
if(!empty($issues[$severity])) {
|
||||
@@ -102,7 +146,7 @@ function health_find_problems() {
|
||||
foreach($issues[$severity] as $classname => $data) {
|
||||
echo '<dt id="'.$classname.'">'.$data['title'].'</dt>';
|
||||
echo '<dd>'.$data['description'];
|
||||
echo '<form action="index.php#solution" method="get">';
|
||||
echo '<form action="health.php#solution" method="get">';
|
||||
echo '<input type="hidden" name="solution" value="'.$classname.'" /><input type="submit" value="'.get_string('viewsolution').'" />';
|
||||
echo '</form></dd>';
|
||||
}
|
||||
@@ -122,15 +166,15 @@ function health_print_solution($classname) {
|
||||
'solution' => $problem->solution()
|
||||
);
|
||||
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_health'));
|
||||
echo $OUTPUT->heading(get_string('healthproblemsolution', 'tool_health'));
|
||||
echo $OUTPUT->heading(get_string('healthcenter'));
|
||||
echo $OUTPUT->heading(get_string('healthproblemsolution'));
|
||||
echo '<dl class="healthissues '.$data['severity'].'">';
|
||||
echo '<dt>'.$data['title'].'</dt>';
|
||||
echo '<dd>'.$data['description'].'</dd>';
|
||||
echo '<dt id="solution" class="solution">'.get_string('healthsolution', 'tool_health').'</dt>';
|
||||
echo '<dt id="solution" class="solution">'.get_string('healthsolution').'</dt>';
|
||||
echo '<dd class="solution">'.$data['solution'].'</dd></dl>';
|
||||
echo '<form id="healthformreturn" action="index.php#'.$classname.'" method="get">';
|
||||
echo '<input type="submit" value="'.get_string('healthreturntomain', 'tool_health').'" />';
|
||||
echo '<form id="healthformreturn" action="health.php#'.$classname.'" method="get">';
|
||||
echo '<input type="submit" value="'.get_string('healthreturntomain').'" />';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -742,3 +786,5 @@ TODO:
|
||||
detect unsupported characters in $CFG->wwwroot - see bug Bug #6091 - relative vs absolute path during backup/restore process
|
||||
|
||||
*/
|
||||
|
||||
|
||||
+173
-75
@@ -26,7 +26,7 @@
|
||||
// Check that config.php exists, if not then call the install script
|
||||
if (!file_exists('../config.php')) {
|
||||
header('Location: ../install.php');
|
||||
die();
|
||||
die;
|
||||
}
|
||||
|
||||
// Check that PHP is of a sufficient version as soon as possible
|
||||
@@ -35,19 +35,7 @@ if (version_compare(phpversion(), '5.3.2') < 0) {
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
|
||||
echo "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).<br />";
|
||||
echo "Please upgrade your server software or install older Moodle version.";
|
||||
die();
|
||||
}
|
||||
|
||||
// make sure iconv is available and actually works
|
||||
if (!function_exists('iconv')) {
|
||||
// this should not happen, this must be very borked install
|
||||
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();
|
||||
die;
|
||||
}
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
@@ -87,6 +75,9 @@ if (is_float_problem()) {
|
||||
}
|
||||
|
||||
// Set some necessary variables during set-up to avoid PHP warnings later on this page
|
||||
if (!isset($CFG->framename)) {
|
||||
$CFG->framename = '_top';
|
||||
}
|
||||
if (!isset($CFG->release)) {
|
||||
$CFG->release = '';
|
||||
}
|
||||
@@ -103,11 +94,6 @@ 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;
|
||||
@@ -126,43 +112,65 @@ if (!core_tables_exist()) {
|
||||
|
||||
if (empty($agreelicense)) {
|
||||
$strlicense = get_string('license');
|
||||
|
||||
$PAGE->navbar->add($strlicense);
|
||||
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
|
||||
$PAGE->set_heading($strinstallation);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->install_licence_page();
|
||||
die();
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading('<a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment');
|
||||
echo $OUTPUT->heading(get_string('copyrightnotice'));
|
||||
$copyrightnotice = text_to_html(get_string('gpl3'));
|
||||
$copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
|
||||
echo $OUTPUT->box($copyrightnotice, 'copyrightnotice');
|
||||
echo '<br />';
|
||||
$continue = new single_button(new moodle_url('/admin/index.php', array('lang'=>$CFG->lang, 'agreelicense'=>1)), get_string('continue'), 'get');
|
||||
echo $OUTPUT->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
if (empty($confirmrelease)) {
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
|
||||
$strcurrentrelease = get_string('currentrelease');
|
||||
|
||||
$PAGE->navbar->add($strcurrentrelease);
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading("Moodle $release");
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->install_environment_page($maturity, $envstatus, $environment_results, $release);
|
||||
die();
|
||||
if (isset($maturity)) {
|
||||
// main version.php declares moodle code maturity
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
}
|
||||
|
||||
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
|
||||
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
|
||||
echo $OUTPUT->box($releasenoteslink, 'generalbox releasenoteslink');
|
||||
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
if (!check_moodle_environment(normalize_version($release), $environment_results, true, ENV_SELECT_RELEASE)) {
|
||||
print_upgrade_reload("index.php?agreelicense=1&lang=$CFG->lang");
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button(new moodle_url('/admin/index.php', array('agreelicense'=>1, 'confirmrelease'=>1, 'lang'=>$CFG->lang)));
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
//TODO: add a page with list of non-standard plugins here
|
||||
|
||||
$strdatabasesetup = get_string('databasesetup');
|
||||
upgrade_init_javascript();
|
||||
|
||||
$PAGE->navbar->add($strdatabasesetup);
|
||||
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
|
||||
$PAGE->set_heading($strinstallation);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->header();
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$DB->setup_is_unicodedb()) {
|
||||
if (!$DB->change_db_encoding()) {
|
||||
@@ -190,45 +198,78 @@ if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_heading($strdatabasechecking);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_confirm_page($a->newversion, $maturity);
|
||||
die();
|
||||
echo $OUTPUT->header();
|
||||
if (isset($maturity)) {
|
||||
// main version.php declares moodle code maturity
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
}
|
||||
$continueurl = new moodle_url('index.php', array('confirmupgrade' => 1));
|
||||
$cancelurl = new moodle_url('index.php');
|
||||
echo $OUTPUT->confirm(get_string('upgradesure', 'admin', $a->newversion), $continueurl, $cancelurl);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else if (empty($confirmrelease)){
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
list($envstatus, $environment_results) = check_moodle_environment($release, ENV_SELECT_RELEASE);
|
||||
$strcurrentrelease = get_string('currentrelease');
|
||||
|
||||
$PAGE->navbar->add($strcurrentrelease);
|
||||
$PAGE->set_title($strcurrentrelease);
|
||||
$PAGE->set_heading($strcurrentrelease);
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading("Moodle $release");
|
||||
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
|
||||
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
|
||||
echo $OUTPUT->box($releasenoteslink);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
|
||||
die();
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
|
||||
print_upgrade_reload('index.php?confirmupgrade=1');
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess');
|
||||
if (empty($CFG->skiplangupgrade)) {
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
print_string('langpackwillbeupdated', 'admin');
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
echo $OUTPUT->continue_button('index.php?confirmupgrade=1&confirmrelease=1');
|
||||
}
|
||||
|
||||
} else if (empty($confirmplugins)) {
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
|
||||
} elseif (empty($confirmplugins)) {
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
|
||||
$PAGE->navbar->add($strplugincheck);
|
||||
$PAGE->set_title($strplugincheck);
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
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)));
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
echo $output->header();
|
||||
echo $output->box_start('generalbox');
|
||||
echo $output->container(get_string('pluginchecknotice', 'core_plugin'), 'generalbox', 'notice');
|
||||
echo $output->plugins_check($pluginman->get_plugins(), array('full' => $showallplugins));
|
||||
echo $output->box_end();
|
||||
print_upgrade_reload('index.php?confirmupgrade=1&confirmrelease=1');
|
||||
$button = new single_button(new moodle_url('index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
echo $output->render($button);
|
||||
echo $output->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
@@ -249,19 +290,26 @@ if (moodle_needs_upgrading()) {
|
||||
if (!$PAGE->headerprinted) {
|
||||
// means core upgrade or installation was not already done
|
||||
if (!$confirmplugins) {
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
$PAGE->navbar->add($strplugincheck);
|
||||
$PAGE->set_title($strplugincheck);
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
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)));
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
echo $output->header();
|
||||
echo $output->box_start('generalbox');
|
||||
echo $output->container(get_string('pluginchecknotice', 'core_plugin'), 'generalbox', 'notice');
|
||||
echo $output->plugins_check($pluginman->get_plugins(), array('full' => $showallplugins));
|
||||
echo $output->box_end();
|
||||
print_upgrade_reload('index.php');
|
||||
$button = new single_button(new moodle_url('index.php', array('confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
echo $output->render($button);
|
||||
echo $output->footer();
|
||||
die();
|
||||
}
|
||||
}
|
||||
@@ -297,8 +345,8 @@ if (during_initial_install()) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
$adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins)));
|
||||
// at this stage there can be only one admin - users may change username, so do not rely on that
|
||||
$adminuser = get_complete_user_data('id', $CFG->siteadmins);
|
||||
|
||||
if ($adminuser->password === 'adminsetuppending') {
|
||||
// prevent installation hijacking
|
||||
@@ -307,7 +355,7 @@ if (during_initial_install()) {
|
||||
}
|
||||
// login user and let him set password and admin details
|
||||
$adminuser->newadminuser = 1;
|
||||
complete_user_login($adminuser);
|
||||
complete_user_login($adminuser, false);
|
||||
redirect("$CFG->wwwroot/user/editadvanced.php?id=$adminuser->id"); // Edit thyself
|
||||
|
||||
} else {
|
||||
@@ -356,14 +404,64 @@ if (any_new_admin_settings($adminroot)){
|
||||
// Everything should now be set up, and the user is an admin
|
||||
|
||||
// Print default admin page with notifications.
|
||||
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
|
||||
|
||||
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
|
||||
$cronoverdue = ($lastcron < time() - 3600 * 24);
|
||||
$dbproblems = $DB->diagnose();
|
||||
$maintenancemode = !empty($CFG->maintenance_enabled);
|
||||
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Unstable code warning
|
||||
if (isset($maturity)) {
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$OUTPUT->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo');
|
||||
}
|
||||
}
|
||||
|
||||
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
|
||||
echo $OUTPUT->box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
|
||||
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
|
||||
echo $OUTPUT->box(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'generalbox adminerror');
|
||||
|
||||
}
|
||||
|
||||
if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
|
||||
echo $OUTPUT->box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
// If no recently cron run
|
||||
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
|
||||
if (time() - $lastcron > 3600 * 24) {
|
||||
$helpbutton = $OUTPUT->help_icon('cron', 'admin');
|
||||
echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
// Hidden bloglevel upgrade
|
||||
$showbloglevelupgrade = ($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL) && empty($CFG->bloglevel_upgrade_complete);
|
||||
if ($showbloglevelupgrade) {
|
||||
echo $OUTPUT->box(get_string('bloglevelupgradenotice', 'admin'), 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
// diagnose DB, especially the sloppy MyISAM tables
|
||||
$diagnose = $DB->diagnose();
|
||||
if ($diagnose !== NULL) {
|
||||
echo $OUTPUT->box($diagnose, 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
// Alert if we are currently in maintenance mode
|
||||
if (!empty($CFG->maintenance_enabled)) {
|
||||
echo $OUTPUT->box(get_string('sitemaintenancewarning2', 'admin', "$CFG->wwwroot/$CFG->admin/settings.php?section=maintenancemode"), 'generalbox adminwarning');
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
|
||||
$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://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
|
||||
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
|
||||
echo $OUTPUT->box($copyrighttext, 'copyright');
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toinodb');
|
||||
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading('Convert all MySQL tables from MYISAM to InnoDB');
|
||||
|
||||
if ($DB->get_dbfamily() != 'mysql') {
|
||||
notice('This function is for MySQL databases only!', 'index.php');
|
||||
}
|
||||
|
||||
if (data_submitted() and $confirm and confirm_sesskey()) {
|
||||
|
||||
echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
|
||||
|
||||
if ($tables = $DB->get_tables()) {
|
||||
$DB->set_debug(true);
|
||||
foreach ($tables as $table) {
|
||||
$fulltable = $DB->get_prefix().$table;
|
||||
$DB->change_database_structure("ALTER TABLE $fulltable TYPE=INNODB");
|
||||
}
|
||||
$DB->set_debug(false);
|
||||
}
|
||||
echo $OUTPUT->notification('... done.', 'notifysuccess');
|
||||
echo $OUTPUT->continue_button('index.php');
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
} else {
|
||||
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
|
||||
$formcontinue = new single_button(new moodle_url('/admin/innodb.php', $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button(new moodle_url('/admin/index.php'), get_string('no'), 'get');
|
||||
echo $OUTPUT->confirm('Are you sure you want convert all your tables to the InnoDB format?', $formcontinue, $formcancel);
|
||||
echo $OUTPUT->footer();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -22,43 +23,30 @@
|
||||
* and meta info.
|
||||
* Locally, language packs are saved into $CFG->dataroot/lang/
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage langimport
|
||||
* @copyright 2005 Yu Zhang
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package core
|
||||
* @copyright 2005 Yu Zhang
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
admin_externalpage_setup('toollangimport');
|
||||
|
||||
if (empty($CFG->langotherroot)) {
|
||||
throw new moodle_exception('missingcfglangotherroot', 'tool_langimport');
|
||||
}
|
||||
|
||||
$mode = optional_param('mode', 0, PARAM_INT); // action
|
||||
$pack = optional_param_array('pack', array(), PARAM_SAFEDIR); // pack to install
|
||||
$uninstalllang = optional_param('uninstalllang', '', PARAM_LANG); // installed pack to uninstall
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL); // uninstallation confirmation
|
||||
$purgecaches = optional_param('purgecaches', false, PARAM_BOOL); // explicit caches reset
|
||||
|
||||
if ($purgecaches) {
|
||||
require_sesskey();
|
||||
get_string_manager()->reset_caches();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
admin_externalpage_setup('langimport');
|
||||
|
||||
if (!empty($CFG->skiplangupgrade)) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box(get_string('langimportdisabled', 'tool_langimport'));
|
||||
echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('purgecaches' => 1)), get_string('purgestringcaches', 'tool_langimport'));
|
||||
echo $OUTPUT->box(get_string('langimportdisabled', 'admin'));
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
$mode = optional_param('mode', 0, PARAM_INT); // action
|
||||
$pack = optional_param('pack', array(), PARAM_SAFEDIR); // pack to install
|
||||
$uninstalllang = optional_param('uninstalllang', '', PARAM_LANG); // installed pack to uninstall
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL); // uninstallation confirmation
|
||||
|
||||
define('INSTALLATION_OF_SELECTED_LANG', 2);
|
||||
define('DELETION_OF_SELECTED_LANG', 4);
|
||||
define('UPDATE_ALL_LANG', 5);
|
||||
@@ -70,7 +58,7 @@ $notice_error = array();
|
||||
|
||||
if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($pack)) {
|
||||
set_time_limit(0);
|
||||
make_temp_directory('');
|
||||
make_upload_directory('temp');
|
||||
make_upload_directory('lang');
|
||||
|
||||
$installer = new lang_installer($pack);
|
||||
@@ -81,13 +69,13 @@ if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($p
|
||||
$a = new stdClass();
|
||||
$a->url = $installer->lang_pack_url($langcode);
|
||||
$a->dest = $CFG->dataroot.'/lang';
|
||||
print_error('remotedownloaderror', 'error', 'index.php', $a);
|
||||
print_error('remotedownloaderror', 'error', 'langimport.php', $a);
|
||||
break;
|
||||
case lang_installer::RESULT_INSTALLED:
|
||||
$notice_ok[] = get_string('langpackinstalled', 'tool_langimport', $langcode);
|
||||
$notice_ok[] = get_string('langpackinstalled', 'admin', $langcode);
|
||||
break;
|
||||
case lang_installer::RESULT_UPTODATE:
|
||||
$notice_ok[] = get_string('langpackuptodate', 'tool_langimport', $langcode);
|
||||
$notice_ok[] = get_string('langpackuptodate', 'admin', $langcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -99,9 +87,9 @@ if ($mode == DELETION_OF_SELECTED_LANG and !empty($uninstalllang)) {
|
||||
|
||||
} else if (!$confirm and confirm_sesskey()) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'tool_langimport', $uninstalllang),
|
||||
'index.php?mode='.DELETION_OF_SELECTED_LANG.'&uninstalllang='.$uninstalllang.'&confirm=1',
|
||||
'index.php');
|
||||
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'admin', $uninstalllang),
|
||||
'langimport.php?mode='.DELETION_OF_SELECTED_LANG.'&uninstalllang='.$uninstalllang.'&confirm=1',
|
||||
'langimport.php');
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
|
||||
@@ -117,7 +105,7 @@ if ($mode == DELETION_OF_SELECTED_LANG and !empty($uninstalllang)) {
|
||||
$rm2 = remove_dir($dest2);
|
||||
}
|
||||
if ($rm1 or $rm2) {
|
||||
$notice_ok[] = get_string('langpackremoved', 'tool_langimport');
|
||||
$notice_ok[] = get_string('langpackremoved','admin');
|
||||
} else { //nothing deleted, possibly due to permission error
|
||||
$notice_error[] = 'An error has occurred, language pack is not completely uninstalled, please check file permissions';
|
||||
}
|
||||
@@ -142,7 +130,7 @@ if ($mode == UPDATE_ALL_LANG) {
|
||||
$updateablelangs = array();
|
||||
foreach ($currentlangs as $clang) {
|
||||
if (!array_key_exists($clang, $md5array)) {
|
||||
$notice_ok[] = get_string('langpackupdateskipped', 'tool_langimport', $clang);
|
||||
$notice_ok[] = get_string('langpackupdateskipped', 'admin', $clang);
|
||||
continue;
|
||||
}
|
||||
$dest1 = $CFG->dataroot.'/lang/'.$clang;
|
||||
@@ -161,7 +149,7 @@ if ($mode == UPDATE_ALL_LANG) {
|
||||
}
|
||||
}
|
||||
|
||||
make_temp_directory('');
|
||||
make_upload_directory('temp');
|
||||
make_upload_directory('lang');
|
||||
|
||||
// clean-up currently installed versions of the packs
|
||||
@@ -201,22 +189,22 @@ if ($mode == UPDATE_ALL_LANG) {
|
||||
$a = new stdClass();
|
||||
$a->url = $installer->lang_pack_url($langcode);
|
||||
$a->dest = $CFG->dataroot.'/lang';
|
||||
print_error('remotedownloaderror', 'error', 'index.php', $a);
|
||||
print_error('remotedownloaderror', 'error', 'langimport.php', $a);
|
||||
break;
|
||||
case lang_installer::RESULT_INSTALLED:
|
||||
$updated = true;
|
||||
$notice_ok[] = get_string('langpackinstalled', 'tool_langimport', $langcode);
|
||||
$notice_ok[] = get_string('langpackinstalled', 'admin', $langcode);
|
||||
break;
|
||||
case lang_installer::RESULT_UPTODATE:
|
||||
$notice_ok[] = get_string('langpackuptodate', 'tool_langimport', $langcode);
|
||||
$notice_ok[] = get_string('langpackuptodate', 'admin', $langcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($updated) {
|
||||
$notice_ok[] = get_string('langupdatecomplete', 'tool_langimport');
|
||||
$notice_ok[] = get_string('langupdatecomplete','admin');
|
||||
} else {
|
||||
$notice_ok[] = get_string('nolangupdateneeded', 'tool_langimport');
|
||||
$notice_ok[] = get_string('nolangupdateneeded','admin');
|
||||
}
|
||||
|
||||
unset($installer);
|
||||
@@ -224,7 +212,7 @@ if ($mode == UPDATE_ALL_LANG) {
|
||||
get_string_manager()->reset_caches();
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('langimport', 'tool_langimport'));
|
||||
echo $OUTPUT->heading(get_string('langimport', 'admin'));
|
||||
|
||||
$installedlangs = get_string_manager()->get_list_of_translations(true);
|
||||
|
||||
@@ -247,7 +235,7 @@ if ($availablelangs = $installer->get_remote_list_of_languages()) {
|
||||
$remote = false;
|
||||
$availablelangs = array();
|
||||
echo $OUTPUT->box_start();
|
||||
print_string('remotelangnotavailable', 'tool_langimport', $CFG->dataroot.'/lang/');
|
||||
print_string('remotelangnotavailable', 'admin', $CFG->dataroot.'/lang/');
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
@@ -272,7 +260,7 @@ if ($missingparents) {
|
||||
$a->parent = $alang[2].' ('.$shortlang.')';
|
||||
}
|
||||
}
|
||||
$info = get_string('missinglangparent', 'tool_langimport', $a);
|
||||
$info = get_string('missinglangparent', 'admin', $a);
|
||||
echo $OUTPUT->notification($info, 'notifyproblem');
|
||||
}
|
||||
}
|
||||
@@ -283,22 +271,22 @@ echo html_writer::start_tag('table');
|
||||
echo html_writer::start_tag('tr');
|
||||
|
||||
// list of installed languages
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => DELETION_OF_SELECTED_LANG));
|
||||
$url = new moodle_url('/admin/langimport.php', array('mode' => DELETION_OF_SELECTED_LANG));
|
||||
echo html_writer::start_tag('td', array('valign' => 'top'));
|
||||
echo html_writer::start_tag('form', array('id' => 'uninstallform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::label(get_string('installedlangs', 'tool_langimport'), 'menuuninstalllang');
|
||||
echo html_writer::label(get_string('installedlangs','admin'), 'uninstalllang');
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::select($installedlangs, 'uninstalllang', '', false, array('size' => 15));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('uninstall', 'tool_langimport')));
|
||||
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('uninstall','admin')));
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
if ($remote) {
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => UPDATE_ALL_LANG));
|
||||
$url = new moodle_url('/admin/langimport.php', array('mode' => UPDATE_ALL_LANG));
|
||||
echo html_writer::start_tag('form', array('id' => 'updateform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::tag('fieldset', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('updatelangs','tool_langimport'))));
|
||||
echo html_writer::tag('fieldset', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('updatelangs','admin'))));
|
||||
echo html_writer::end_tag('form');
|
||||
}
|
||||
echo html_writer::end_tag('td');
|
||||
@@ -312,15 +300,15 @@ foreach ($availablelangs as $alang) {
|
||||
}
|
||||
if (!empty($options)) {
|
||||
echo html_writer::start_tag('td', array('valign' => 'top'));
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
|
||||
$url = new moodle_url('/admin/langimport.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
|
||||
echo html_writer::start_tag('form', array('id' => 'installform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::label(get_string('availablelangs','install'), 'menupack');
|
||||
echo html_writer::label(get_string('availablelangs','install'), 'pack');
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::select($options, 'pack[]', '', false, array('size' => 15, 'multiple' => 'multiple'));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('install','tool_langimport')));
|
||||
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('install','admin')));
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
echo html_writer::end_tag('td');
|
||||
+1
-12
@@ -35,16 +35,5 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
|
||||
'admin-*' => get_string('page-admin-x', 'pagetype'),
|
||||
$pagetype => get_string('page-admin-current', 'pagetype')
|
||||
);
|
||||
// Add the missing * (any page) option for them. MDL-30340
|
||||
// TODO: These pages are really 'pagetype-varying' - MDL-30564 -
|
||||
// and some day we should stop behaving that way, so proper pagetypes
|
||||
// can be specified for it (like course-category-* or so).
|
||||
// Luckly... the option we are introducing '*' is independent
|
||||
// of that varying behavior, so will work.
|
||||
if ($pagetype == 'admin-course-category') {
|
||||
$array += array(
|
||||
'*' => get_string('page-x', 'pagetype')
|
||||
);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
admin_externalpage_setup('managelocalplugins');
|
||||
|
||||
$delete = optional_param('delete', '', PARAM_PLUGIN);
|
||||
$delete = optional_param('delete', '', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', '', PARAM_BOOL);
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
@@ -89,7 +89,7 @@ foreach (get_plugin_list('local') as $plugin => $plugindir) {
|
||||
}
|
||||
$plugins[$plugin] = $strpluginname;
|
||||
}
|
||||
collatorlib::asort($plugins);
|
||||
textlib_get_instance()->asort($plugins);
|
||||
|
||||
foreach ($plugins as $plugin => $name) {
|
||||
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
+16
-25
@@ -38,10 +38,9 @@ class mnet_simple_host_form extends moodleform {
|
||||
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'), array('maxlength' => 255, 'size' => 50));
|
||||
$mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'));
|
||||
$mform->setType('wwwroot', PARAM_URL);
|
||||
$mform->addRule('wwwroot', null, 'required', null, 'client');
|
||||
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||
|
||||
$mform->addElement('select', 'applicationid', get_string('applicationtype', 'mnet'),
|
||||
$DB->get_records_menu('mnet_application', array(), 'id,display_name'));
|
||||
@@ -50,7 +49,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'];
|
||||
@@ -82,13 +81,11 @@ class mnet_review_host_form extends moodleform {
|
||||
$mform->addElement('hidden', 'applicationid');
|
||||
$mform->addElement('hidden', 'oldpublickey');
|
||||
|
||||
$mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50));
|
||||
$mform->addElement('text', 'name', get_string('site'));
|
||||
$mform->setType('name', PARAM_NOTAGS);
|
||||
$mform->addRule('name', get_string('maximumchars', '', 80), 'maxlength', 80, 'client');
|
||||
|
||||
$mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'), array('maxlength' => 255, 'size' => 50));
|
||||
$mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'));
|
||||
$mform->setType('wwwroot', PARAM_URL);
|
||||
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||
|
||||
$themes = array('' => get_string('forceno'));
|
||||
foreach (array_keys(get_plugin_list('theme')) as $themename) {
|
||||
@@ -98,7 +95,15 @@ class mnet_review_host_form extends moodleform {
|
||||
|
||||
$mform->addElement('textarea', 'public_key', get_string('publickey', 'mnet'), array('rows' => 17, 'cols' => 100, 'class' => 'smalltext'));
|
||||
$mform->setType('public_key', PARAM_PEM);
|
||||
$mform->addRule('public_key', get_string('required'), 'required');
|
||||
|
||||
if ($mnet_peer && !empty($mnet_peer->deleted)) {
|
||||
$radioarray = array();
|
||||
$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');
|
||||
}
|
||||
|
||||
// finished with form controls, now the static informational stuff
|
||||
if ($mnet_peer && !empty($mnet_peer->bootstrapped)) {
|
||||
@@ -135,35 +140,21 @@ class mnet_review_host_form extends moodleform {
|
||||
}
|
||||
}
|
||||
|
||||
$mform->addElement('static', 'certdetails', get_string('certdetails', 'mnet'),
|
||||
$OUTPUT->box('<pre>' . $credstr . '</pre>', 'generalbox certdetails'));
|
||||
}
|
||||
|
||||
if ($mnet_peer && !empty($mnet_peer->deleted)) {
|
||||
$radioarray = array();
|
||||
$radioarray[] = MoodleQuickForm::createElement('static', 'deletedinfo', '',
|
||||
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
|
||||
$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');
|
||||
$mform->addElement('static', 'certdetails', get_string('certdetails', 'mnet'), $OUTPUT->box('<pre>' . $credstr . '</pre>'));
|
||||
}
|
||||
|
||||
// finished with static stuff, print save button
|
||||
$this->add_action_buttons(false);
|
||||
}
|
||||
|
||||
function validation($data, $files) {
|
||||
function validation($data) {
|
||||
$errors = array();
|
||||
if ($data['oldpublickey'] == $data['public_key']) {
|
||||
return;
|
||||
}
|
||||
$mnet_peer = new mnet_peer(); // idiotic api
|
||||
$mnet_peer->wwwroot = $data['wwwroot']; // just hard-set this rather than bootstrap the object
|
||||
if (empty($data['public_key'])) {
|
||||
$errors['public_key'] = get_string('publickeyrequired', 'mnet');
|
||||
} else if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
|
||||
if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
|
||||
$errmsg = '';
|
||||
foreach ($mnet_peer->error as $err) {
|
||||
$errmsg .= $err['code'] . ': ' . $err['text'].'<br />';
|
||||
|
||||
+5
-20
@@ -30,7 +30,7 @@
|
||||
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();
|
||||
|
||||
@@ -190,7 +190,7 @@ if ($formdata = $reviewform->get_data()) {
|
||||
|
||||
// normal flow - just display all hosts with links
|
||||
echo $OUTPUT->header();
|
||||
$hosts = mnet_get_hosts(true);
|
||||
$hosts = mnet_get_hosts();
|
||||
|
||||
// print the table to display the register all hosts setting
|
||||
$table = new html_table();
|
||||
@@ -231,43 +231,28 @@ $table->head = array(
|
||||
);
|
||||
$table->wrap = array('nowrap', 'nowrap', 'nowrap', 'nowrap');
|
||||
$baseurl = new moodle_url('/admin/mnet/peers.php');
|
||||
$deleted = array();
|
||||
foreach($hosts as $host) {
|
||||
$hosturl = new moodle_url($baseurl, array('hostid' => $host->id));
|
||||
if (trim($host->name) === '') {
|
||||
// should not happen but...
|
||||
$host->name = '???';
|
||||
}
|
||||
// process all hosts first since it's the easiest
|
||||
if ($host->id == $CFG->mnet_all_hosts_id) {
|
||||
$table->data[] = array(html_writer::link($hosturl, get_string('allhosts', 'core_mnet')), '*', '', '');
|
||||
continue;
|
||||
}
|
||||
|
||||
// populate the list of deleted hosts
|
||||
if ($host->deleted) {
|
||||
$deleted[] = html_writer::link($hosturl, $host->name);
|
||||
$table->data[] = array(html_writer::tag('a', $host->name, array('href'=>$hosturl)), '', '', '');
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($host->last_connect_time == 0) {
|
||||
$last_connect = get_string('never');
|
||||
} else {
|
||||
$last_connect = userdate($host->last_connect_time, get_string('strftimedatetime', 'core_langconfig'));
|
||||
$last_connect = date('H:i:s d/m/Y', $host->last_connect_time);
|
||||
}
|
||||
$table->data[] = array(
|
||||
html_writer::link($hosturl, $host->name),
|
||||
html_writer::link($host->wwwroot, $host->wwwroot),
|
||||
html_writer::link($hosturl, $host->wwwroot),
|
||||
$last_connect,
|
||||
$OUTPUT->single_button(new moodle_url('/admin/mnet/delete.php', array('hostid' => $host->id)), get_string('delete'))
|
||||
);
|
||||
}
|
||||
echo html_writer::table($table);
|
||||
|
||||
if ($deleted) {
|
||||
echo $OUTPUT->box(get_string('deletedhosts', 'core_mnet', join(', ', $deleted)), 'deletedhosts');
|
||||
}
|
||||
|
||||
// finally, print the initial form to add a new host
|
||||
echo $OUTPUT->box_start();
|
||||
echo $OUTPUT->heading(get_string('addnewhost', 'mnet'), 3);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ $strmnetlog = get_string('mnetlog', 'mnet');
|
||||
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
|
||||
|
||||
$logurl = $CFG->wwwroot.
|
||||
'/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
|
||||
'/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
|
||||
'%2F1&user='.'0'.
|
||||
'&date=0'.
|
||||
'&modid=&modaction=0&logformat=showashtml';
|
||||
|
||||
+3
-4
@@ -11,9 +11,9 @@
|
||||
|
||||
admin_externalpage_setup('managemodules');
|
||||
|
||||
$show = optional_param('show', '', PARAM_PLUGIN);
|
||||
$hide = optional_param('hide', '', PARAM_PLUGIN);
|
||||
$delete = optional_param('delete', '', PARAM_PLUGIN);
|
||||
$show = optional_param('show', '', PARAM_SAFEDIR);
|
||||
$hide = optional_param('hide', '', PARAM_SAFEDIR);
|
||||
$delete = optional_param('delete', '', PARAM_SAFEDIR);
|
||||
$confirm = optional_param('confirm', '', PARAM_BOOL);
|
||||
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
}
|
||||
|
||||
uninstall_plugin('mod', $delete);
|
||||
$a = new stdClass();
|
||||
$a->module = $strmodulename;
|
||||
$a->directory = "$CFG->dirroot/mod/$delete";
|
||||
echo $OUTPUT->notification(get_string("moduledeletefiles", "", $a), 'notifysuccess');
|
||||
|
||||
@@ -1,51 +1,26 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Search and replace strings throughout all texts in the whole database.
|
||||
*
|
||||
* Unfortunately it was a bad idea to use spans for multilang because it
|
||||
* can not support nesting. Hopefully this will get thrown away soon....
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage multilangupgrade
|
||||
* @copyright 2006 Petr Skoda (http://skodak.org)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
/// Search and replace strings throughout all texts in the whole database
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../../../config.php');
|
||||
require_once('../config.php');
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toolmultilangupgrade');
|
||||
admin_externalpage_setup('multilangupgrade');
|
||||
|
||||
$go = optional_param('go', 0, PARAM_BOOL);
|
||||
|
||||
###################################################################
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_multilangupgrade'));
|
||||
echo $OUTPUT->heading(get_string('multilangupgrade', 'admin'));
|
||||
|
||||
$strmultilangupgrade = get_String('multilangupgradeinfo', 'tool_multilangupgrade');
|
||||
$strmultilangupgrade = get_String('multilangupgradeinfo', 'admin');
|
||||
|
||||
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
|
||||
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
|
||||
echo $OUTPUT->confirm($strmultilangupgrade, new moodle_url('/admin/tool/multilangupgrade/index.php', $optionsyes), new moodle_url('/admin/'));
|
||||
echo $OUTPUT->confirm($strmultilangupgrade, new moodle_url('multilangupgrade.php', $optionsyes), 'index.php');
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
@@ -63,7 +38,7 @@ echo $OUTPUT->box_start();
|
||||
|
||||
echo '<strong>Progress:</strong>';
|
||||
$i = 0;
|
||||
$skiptables = array('config', 'block_instances', 'sessions'); // we can not process tables with serialised data here
|
||||
$skiptables = array('config', 'user_students', 'user_teachers');
|
||||
|
||||
foreach ($tables as $table) {
|
||||
if (strpos($table,'pma') === 0) { // Not our tables
|
||||
@@ -124,7 +99,7 @@ echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
|
||||
rebuild_course_cache();
|
||||
echo $OUTPUT->notification('...finished', 'notifysuccess');
|
||||
|
||||
echo $OUTPUT->continue_button(new moodle_url('/admin/'));
|
||||
echo $OUTPUT->continue_button('index.php');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
+8
-1
@@ -31,4 +31,11 @@ require_once($CFG->libdir . '/pluginlib.php');
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->plugin_management_page(plugin_manager::instance());
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
echo $output->header();
|
||||
echo $output->heading(get_string('pluginsoverview', 'core_admin'));
|
||||
echo $output->box_start('generalbox');
|
||||
echo $output->plugins_control_panel($pluginman->get_plugins());
|
||||
echo $output->box_end();
|
||||
echo $output->footer();
|
||||
|
||||
@@ -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), '');
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -28,7 +28,6 @@
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
@@ -40,7 +39,6 @@ admin_externalpage_setup('manageqbehaviours');
|
||||
$thispageurl = new moodle_url('/admin/qbehaviours.php');
|
||||
|
||||
$behaviours = get_plugin_list('qbehaviour');
|
||||
$pluginmanager = plugin_manager::instance();
|
||||
|
||||
// Get some data we will need - question counts and which types are needed.
|
||||
$counts = $DB->get_records_sql_menu("
|
||||
@@ -52,16 +50,20 @@ foreach ($behaviours as $behaviour => $notused) {
|
||||
if (!array_key_exists($behaviour, $counts)) {
|
||||
$counts[$behaviour] = 0;
|
||||
}
|
||||
$needed[$behaviour] = ($counts[$behaviour] > 0) ||
|
||||
$pluginmanager->other_plugins_that_require('qbehaviour_' . $behaviour);
|
||||
$needed[$behaviour] = $counts[$behaviour] > 0;
|
||||
$archetypal[$behaviour] = question_engine::is_behaviour_archetypal($behaviour);
|
||||
}
|
||||
|
||||
foreach ($behaviours as $behaviour => $notused) {
|
||||
foreach (question_engine::get_behaviour_required_behaviours($behaviour) as $reqbehaviour) {
|
||||
$needed[$reqbehaviour] = true;
|
||||
}
|
||||
}
|
||||
foreach ($counts as $behaviour => $count) {
|
||||
if (!array_key_exists($behaviour, $behaviours)) {
|
||||
$counts['missing'] += $count;
|
||||
$counts['missingtype'] += $count;
|
||||
}
|
||||
}
|
||||
$needed['missing'] = true;
|
||||
|
||||
// Work of the correct sort order.
|
||||
$config = get_config('question');
|
||||
@@ -83,7 +85,7 @@ if (!empty($config->disabledbehaviours)) {
|
||||
// Process actions ============================================================
|
||||
|
||||
// Disable.
|
||||
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($behaviours[$disable])) {
|
||||
print_error('unknownbehaviour', 'question', $thispageurl, $disable);
|
||||
}
|
||||
@@ -96,7 +98,7 @@ if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey(
|
||||
}
|
||||
|
||||
// Enable.
|
||||
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($behaviours[$enable])) {
|
||||
print_error('unknownbehaviour', 'question', $thispageurl, $enable);
|
||||
}
|
||||
@@ -113,7 +115,7 @@ if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey())
|
||||
}
|
||||
|
||||
// Move up in order.
|
||||
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($behaviours[$up])) {
|
||||
print_error('unknownbehaviour', 'question', $thispageurl, $up);
|
||||
}
|
||||
@@ -125,7 +127,7 @@ if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
}
|
||||
|
||||
// Move down in order.
|
||||
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($behaviours[$down])) {
|
||||
print_error('unknownbehaviour', 'question', $thispageurl, $down);
|
||||
}
|
||||
@@ -137,7 +139,7 @@ if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
}
|
||||
|
||||
// Delete.
|
||||
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($delete = optional_param('delete', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
// Check it is OK to delete this question type.
|
||||
if ($delete == 'missing') {
|
||||
print_error('cannotdeletemissingbehaviour', 'question', $thispageurl);
|
||||
@@ -179,7 +181,7 @@ if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey())
|
||||
unset($disabledbehaviours[$key]);
|
||||
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
|
||||
}
|
||||
$behaviourorder = array_keys($sortedbehaviours);
|
||||
$behaviourorder = explode(',', $config->behavioursortorder);
|
||||
if (($key = array_search($delete, $behaviourorder)) !== false) {
|
||||
unset($behaviourorder[$key]);
|
||||
set_config('behavioursortorder', implode(',', $behaviourorder), 'question');
|
||||
@@ -191,7 +193,6 @@ if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey())
|
||||
// Remove event handlers and dequeue pending events
|
||||
events_uninstall('qbehaviour_' . $delete);
|
||||
|
||||
$a = new stdClass();
|
||||
$a->behaviour = $behaviourname;
|
||||
$a->directory = get_plugin_directory('qbehaviour', $delete);
|
||||
echo $OUTPUT->box(get_string('qbehaviourdeletefiles', 'question', $a), 'generalbox', 'notice');
|
||||
@@ -237,19 +238,18 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
|
||||
}
|
||||
|
||||
// Other question types required by this one.
|
||||
$plugin = $pluginmanager->get_plugin_info('qbehaviour_' . $behaviour);
|
||||
$required = $plugin->get_other_required_plugins();
|
||||
if (!empty($required)) {
|
||||
$strrequired = array();
|
||||
foreach ($required as $component => $notused) {
|
||||
$strrequired[] = $pluginmanager->plugin_name($component);
|
||||
$requiredbehaviours = question_engine::get_behaviour_required_behaviours($behaviour);
|
||||
if (!empty($requiredbehaviours)) {
|
||||
$strrequiredbehaviours = array();
|
||||
foreach ($requiredbehaviours as $required) {
|
||||
$strrequiredbehaviours[] = $sortedbehaviours[$required];
|
||||
}
|
||||
$row[] = implode(', ', $strrequired);
|
||||
$row[] = implode(', ', $strrequiredbehaviours);
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
|
||||
// Are people allowed to select this behaviour?
|
||||
// Are people allowed to create new questions of this type?
|
||||
$rowclass = '';
|
||||
if ($archetypal[$behaviour]) {
|
||||
$enabled = array_search($behaviour, $disabledbehaviours) === false;
|
||||
|
||||
+15
-15
@@ -28,7 +28,6 @@
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
@@ -41,7 +40,6 @@ admin_externalpage_setup('manageqtypes');
|
||||
$thispageurl = new moodle_url('/admin/qtypes.php');
|
||||
|
||||
$qtypes = question_bank::get_all_qtypes();
|
||||
$pluginmanager = plugin_manager::instance();
|
||||
|
||||
// Get some data we will need - question counts and which types are needed.
|
||||
$counts = $DB->get_records_sql("
|
||||
@@ -54,11 +52,15 @@ foreach ($qtypes as $qtypename => $qtype) {
|
||||
$counts[$qtypename]->numquestions = 0;
|
||||
$counts[$qtypename]->numhidden = 0;
|
||||
}
|
||||
$needed[$qtypename] = $counts[$qtypename]->numquestions > 0 ||
|
||||
$pluginmanager->other_plugins_that_require($qtype->plugin_name());
|
||||
$needed[$qtypename] = $counts[$qtypename]->numquestions > 0;
|
||||
$counts[$qtypename]->numquestions -= $counts[$qtypename]->numhidden;
|
||||
}
|
||||
$needed['missingtype'] = true; // The system needs the missing question type.
|
||||
foreach ($qtypes as $qtypename => $qtype) {
|
||||
foreach ($qtype->requires_qtypes() as $reqtype) {
|
||||
$needed[$reqtype] = true;
|
||||
}
|
||||
}
|
||||
foreach ($counts as $qtypename => $count) {
|
||||
if (!isset($qtypes[$qtypename])) {
|
||||
$counts['missingtype']->numquestions += $count->numquestions - $count->numhidden;
|
||||
@@ -77,7 +79,7 @@ $sortedqtypes = question_bank::sort_qtype_array($sortedqtypes, $config);
|
||||
// Process actions ============================================================
|
||||
|
||||
// Disable.
|
||||
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($qtypes[$disable])) {
|
||||
print_error('unknownquestiontype', 'question', $thispageurl, $disable);
|
||||
}
|
||||
@@ -87,7 +89,7 @@ if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey(
|
||||
}
|
||||
|
||||
// Enable.
|
||||
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($qtypes[$enable])) {
|
||||
print_error('unknownquestiontype', 'question', $thispageurl, $enable);
|
||||
}
|
||||
@@ -101,7 +103,7 @@ if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey())
|
||||
}
|
||||
|
||||
// Move up in order.
|
||||
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($qtypes[$up])) {
|
||||
print_error('unknownquestiontype', 'question', $thispageurl, $up);
|
||||
}
|
||||
@@ -112,7 +114,7 @@ if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
}
|
||||
|
||||
// Move down in order.
|
||||
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
if (!isset($qtypes[$down])) {
|
||||
print_error('unknownquestiontype', 'question', $thispageurl, $down);
|
||||
}
|
||||
@@ -123,7 +125,7 @@ if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
}
|
||||
|
||||
// Delete.
|
||||
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
|
||||
if (($delete = optional_param('delete', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
|
||||
// Check it is OK to delete this question type.
|
||||
if ($delete == 'missingtype') {
|
||||
print_error('cannotdeletemissingqtype', 'question', $thispageurl);
|
||||
@@ -171,7 +173,6 @@ if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey())
|
||||
// Remove event handlers and dequeue pending events
|
||||
events_uninstall('qtype_' . $delete);
|
||||
|
||||
$a = new stdClass();
|
||||
$a->qtype = $qtypename;
|
||||
$a->directory = $qtypes[$delete]->plugin_dir();
|
||||
echo $OUTPUT->box(get_string('qtypedeletefiles', 'question', $a), 'generalbox', 'notice');
|
||||
@@ -218,7 +219,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
|
||||
$strcount = $counts[$qtypename]->numquestions;
|
||||
}
|
||||
if ($canviewreports) {
|
||||
$row[] = html_writer::link(new moodle_url('/report/questioninstances/index.php',
|
||||
$row[] = html_writer::link(new moodle_url('/admin/report/questioninstances/index.php',
|
||||
array('qtype' => $qtypename)), $strcount, array('title' => get_string('showdetails', 'admin')));
|
||||
} else {
|
||||
$strcount;
|
||||
@@ -236,12 +237,11 @@ foreach ($sortedqtypes as $qtypename => $localname) {
|
||||
}
|
||||
|
||||
// Other question types required by this one.
|
||||
$plugin = $pluginmanager->get_plugin_info($qtype->plugin_name());
|
||||
$requiredtypes = $plugin->get_other_required_plugins();
|
||||
$requiredtypes = $qtype->requires_qtypes();
|
||||
$strtypes = array();
|
||||
if (!empty($requiredtypes)) {
|
||||
foreach ($requiredtypes as $required => $notused) {
|
||||
$strtypes[] = $pluginmanager->plugin_name($required);
|
||||
foreach ($requiredtypes as $required) {
|
||||
$strtypes[] = $qtypes[$required]->local_name();
|
||||
}
|
||||
$row[] = implode(', ', $strtypes);
|
||||
} else {
|
||||
|
||||
@@ -136,8 +136,8 @@ class hub_selector_form extends moodleform {
|
||||
$options = array();
|
||||
foreach ($hubs as $hub) {
|
||||
//to not display a name longer than 100 character (too big)
|
||||
if (textlib::strlen($hub['name']) > 100) {
|
||||
$hubname = textlib::substr($hub['name'], 0, 100);
|
||||
if (strlen($hub['name']) > 100) {
|
||||
$hubname = substr($hub['name'], 0, 100);
|
||||
$hubname = $hubname . "...";
|
||||
} else {
|
||||
$hubname = $hub['name'];
|
||||
@@ -283,7 +283,7 @@ class site_registration_form extends moodleform {
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
$languages = get_string_manager()->get_list_of_languages();
|
||||
collatorlib::asort($languages);
|
||||
textlib_get_instance()->asort($languages);
|
||||
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
|
||||
$languages);
|
||||
$mform->setType('language', PARAM_ALPHANUMEXT);
|
||||
|
||||
+11
-643
@@ -32,394 +32,6 @@ require_once($CFG->libdir . '/pluginlib.php');
|
||||
*/
|
||||
class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display the 'Do you acknowledge the terms of the GPL' page. The first page
|
||||
* during install.
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function install_licence_page() {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
$copyrightnotice = text_to_html(get_string('gpl3'));
|
||||
$copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
|
||||
|
||||
$continue = new single_button(new moodle_url('/admin/index.php', array('lang'=>$CFG->lang, 'agreelicense'=>1)), get_string('continue'), 'get');
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading('<a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment');
|
||||
$output .= $this->heading(get_string('copyrightnotice'));
|
||||
$output .= $this->box($copyrightnotice, 'copyrightnotice');
|
||||
$output .= html_writer::empty_tag('br');
|
||||
$output .= $this->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'environment check' page that is displayed during install.
|
||||
* @param int $maturity
|
||||
* @param boolean $envstatus final result of the check (true/false)
|
||||
* @param array $environment_results array of results gathered
|
||||
* @param string $release moodle release
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function install_environment_page($maturity, $envstatus, $environment_results, $release) {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_warning($maturity);
|
||||
$output .= $this->heading("Moodle $release");
|
||||
$output .= $this->release_notes_link();
|
||||
|
||||
$output .= $this->environment_check_table($envstatus, $environment_results);
|
||||
|
||||
if (!$envstatus) {
|
||||
$output .= $this->upgrade_reload(new moodle_url('/admin/index.php', array('agreelicense' => 1, 'lang' => $CFG->lang)));
|
||||
} else {
|
||||
$output .= $this->notification(get_string('environmentok', 'admin'), 'notifysuccess');
|
||||
$output .= $this->continue_button(new moodle_url('/admin/index.php', array('agreelicense'=>1, 'confirmrelease'=>1, 'lang'=>$CFG->lang)));
|
||||
}
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'You are about to upgrade Moodle' page. The first page
|
||||
* during upgrade.
|
||||
* @param string $strnewversion
|
||||
* @param int $maturity
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_confirm_page($strnewversion, $maturity) {
|
||||
$output = '';
|
||||
|
||||
$continueurl = new moodle_url('index.php', array('confirmupgrade' => 1));
|
||||
$cancelurl = new moodle_url('index.php');
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_warning($maturity);
|
||||
$output .= $this->confirm(get_string('upgradesure', 'admin', $strnewversion), $continueurl, $cancelurl);
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the environment page during the upgrade process.
|
||||
* @param string $release
|
||||
* @param boolean $envstatus final result of env check (true/false)
|
||||
* @param array $environment_results array of results gathered
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_environment_page($release, $envstatus, $environment_results) {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading("Moodle $release");
|
||||
$output .= $this->release_notes_link();
|
||||
$output .= $this->environment_check_table($envstatus, $environment_results);
|
||||
|
||||
if (!$envstatus) {
|
||||
$output .= $this->upgrade_reload(new moodle_url('/admin/index.php'), array('confirmupgrade' => 1));
|
||||
|
||||
} else {
|
||||
$output .= $this->notification(get_string('environmentok', 'admin'), 'notifysuccess');
|
||||
|
||||
if (empty($CFG->skiplangupgrade) and current_language() !== 'en') {
|
||||
$output .= $this->box(get_string('langpackwillbeupdated', 'admin'), 'generalbox', 'notice');
|
||||
}
|
||||
|
||||
$output .= $this->continue_button(new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)));
|
||||
}
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the upgrade page that lists all the plugins that require attention.
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @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, $version, $showallplugins, $reloadurl, $continueurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->box_start('generalbox');
|
||||
$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->all_plugins_ok($version)) {
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
} else {
|
||||
$output .= $this->box(get_string('pluginschecktodo', 'admin'), 'environmentbox errorbox');
|
||||
}
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the admin notifications page.
|
||||
* @param int $maturity
|
||||
* @param bool $insecuredataroot warn dataroot is invalid
|
||||
* @param bool $errorsdisplayed warn invalid dispaly error setting
|
||||
* @param bool $cronoverdue warn cron not running
|
||||
* @param bool $dbproblems warn db has problems
|
||||
* @param bool $maintenancemode warn in maintenance mode
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_info($maturity);
|
||||
$output .= $this->insecure_dataroot_warning($insecuredataroot);
|
||||
$output .= $this->display_errors_warning($errorsdisplayed);
|
||||
$output .= $this->cron_overdue_warning($cronoverdue);
|
||||
$output .= $this->db_problems($dbproblems);
|
||||
$output .= $this->maintenance_mode_warning($maintenancemode);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
|
||||
$output .= $this->moodle_copyright();
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the plugin management page (admin/plugins.php).
|
||||
* @param plugin_manager $pluginman
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function plugin_management_page(plugin_manager $pluginman) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginsoverview', 'core_admin'));
|
||||
$output .= $this->box_start('generalbox');
|
||||
$output .= $this->plugins_control_panel($pluginman);
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the plugin management page (admin/environment.php).
|
||||
* @param array $versions
|
||||
* @param string $version
|
||||
* @param boolean $envstatus final result of env check (true/false)
|
||||
* @param array $environment_results array of results gathered
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function environment_check_page($versions, $version, $envstatus, $environment_results) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
|
||||
// Print the component download link
|
||||
$output .= html_writer::tag('div', html_writer::link(
|
||||
new moodle_url('/admin/environment.php', array('action' => 'updatecomponent', 'sesskey' => sesskey())),
|
||||
get_string('updatecomponent', 'admin')),
|
||||
array('class' => 'reportlink'));
|
||||
|
||||
// Heading.
|
||||
$output .= $this->heading(get_string('environment', 'admin'));
|
||||
|
||||
// Box with info and a menu to choose the version.
|
||||
$output .= $this->box_start();
|
||||
$output .= html_writer::tag('div', get_string('adminhelpenvironment'));
|
||||
$select = new single_select(new moodle_url('/admin/environment.php'), 'version', $versions, $version, null);
|
||||
$select->label = get_string('moodleversion');
|
||||
$output .= $this->render($select);
|
||||
$output .= $this->box_end();
|
||||
|
||||
// The results
|
||||
$output .= $this->environment_check_table($envstatus, $environment_results);
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a warning message, of the type that appears on the admin notifications page.
|
||||
* @param string $message the message to display.
|
||||
* @param string $type type class
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function warning($message, $type = 'warning') {
|
||||
return $this->box($message, 'generalbox admin' . $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if dataroot is insecure.
|
||||
* @param bool $insecuredataroot
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function insecure_dataroot_warning($insecuredataroot) {
|
||||
global $CFG;
|
||||
|
||||
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
|
||||
return $this->warning(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot));
|
||||
|
||||
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
|
||||
return $this->warning(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'error');
|
||||
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if dataroot is insecure.
|
||||
* @param bool $errorsdisplayed
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function display_errors_warning($errorsdisplayed) {
|
||||
if (!$errorsdisplayed) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning(get_string('displayerrorswarning', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if cron has not been run recently.
|
||||
* @param bool $cronoverdue
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function cron_overdue_warning($cronoverdue) {
|
||||
if (!$cronoverdue) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning(get_string('cronwarning', 'admin') . ' ' .
|
||||
$this->help_icon('cron', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if there are any problems with the DB set-up.
|
||||
* @param bool $dbproblems
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function db_problems($dbproblems) {
|
||||
if (!$dbproblems) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning($dbproblems);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if the site in in maintenance mode.
|
||||
* @param bool $maintenancemode
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function maintenance_mode_warning($maintenancemode) {
|
||||
if (!$maintenancemode) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$url = new moodle_url('/admin/settings.php', array('section' => 'maintenancemode'));
|
||||
$url = $url->out(); // get_string() does not support objects in params
|
||||
|
||||
return $this->warning(get_string('sitemaintenancewarning2', 'admin', $url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a warning about installing development code if necesary.
|
||||
* @param int $maturity
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function maturity_warning($maturity) {
|
||||
if ($maturity == MATURITY_STABLE) {
|
||||
return ''; // No worries.
|
||||
}
|
||||
|
||||
$maturitylevel = get_string('maturity' . $maturity, 'admin');
|
||||
return $this->box(
|
||||
$this->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$this->container($this->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the copyright notice.
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function moodle_copyright() {
|
||||
global $CFG;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
|
||||
$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 />'.
|
||||
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return $this->box($copyrighttext, 'copyright');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a warning about installing development code if necesary.
|
||||
* @param int $maturity
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function maturity_info($maturity) {
|
||||
if ($maturity == MATURITY_STABLE) {
|
||||
return ''; // No worries.
|
||||
}
|
||||
|
||||
$maturitylevel = get_string('maturity' . $maturity, 'admin');
|
||||
return $this->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$this->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a link to the release notes.
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function release_notes_link() {
|
||||
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
|
||||
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
|
||||
return $this->box($releasenoteslink, 'generalbox releasenoteslink');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the reload link that appears on several upgrade/install pages.
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
function upgrade_reload($url) {
|
||||
return html_writer::empty_tag('br') .
|
||||
html_writer::tag('div',
|
||||
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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays all known plugins and information about their installation or upgrade
|
||||
*
|
||||
@@ -427,13 +39,11 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* options support:
|
||||
* (bool)full = false: whether to display up-to-date plugins, too
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param array $plugininfo as returned by {@see plugin_manager::get_plugins()}
|
||||
* @param array $options rendering options
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) {
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
public function plugins_check(array $plugininfo, array $options = null) {
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
return '';
|
||||
@@ -445,6 +55,8 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
);
|
||||
}
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'plugins-check';
|
||||
$table->head = array(
|
||||
@@ -453,11 +65,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
get_string('source', 'core_plugin'),
|
||||
get_string('versiondb', 'core_plugin'),
|
||||
get_string('versiondisk', 'core_plugin'),
|
||||
get_string('requires', 'core_plugin'),
|
||||
get_string('status', 'core_plugin'),
|
||||
);
|
||||
$table->colclasses = array(
|
||||
'displayname', 'rootdir', 'source', 'versiondb', 'versiondisk', 'requires', 'status',
|
||||
'displayname', 'rootdir', 'source', 'versiondb', 'versiondisk', 'status',
|
||||
);
|
||||
$table->data = array();
|
||||
|
||||
@@ -515,13 +126,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$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));
|
||||
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
||||
$plugin->get_other_required_plugins());
|
||||
if ($isstandard and $statusisboring and $dependenciesok) {
|
||||
if ($isstandard and in_array($statuscode, array(plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE))) {
|
||||
if (empty($options['full'])) {
|
||||
continue;
|
||||
}
|
||||
@@ -529,8 +134,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$numofhighlighted[$type]++;
|
||||
}
|
||||
|
||||
$row->cells = array($displayname, $rootdir, $source,
|
||||
$versiondb, $versiondisk, $requires, $status);
|
||||
$row->cells = array($displayname, $rootdir, $source, $versiondb, $versiondisk, $status);
|
||||
$plugintyperows[] = $row;
|
||||
}
|
||||
|
||||
@@ -572,75 +176,22 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the information that needs to go in the 'Requires' column.
|
||||
* @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(plugin_information $plugin, plugin_manager $pluginman, $version) {
|
||||
$requires = array();
|
||||
|
||||
if (!empty($plugin->versionrequires)) {
|
||||
if ($plugin->versionrequires <= $version) {
|
||||
$class = 'requires-ok';
|
||||
} else {
|
||||
$class = 'requires-failed';
|
||||
}
|
||||
$requires[] = html_writer::tag('li',
|
||||
get_string('moodleversion', 'core_plugin', $plugin->versionrequires),
|
||||
array('class' => $class));
|
||||
}
|
||||
|
||||
foreach ($plugin->get_other_required_plugins() as $component => $requiredversion) {
|
||||
$ok = true;
|
||||
$otherplugin = $pluginman->get_plugin_info($component);
|
||||
|
||||
if (is_null($otherplugin)) {
|
||||
$ok = false;
|
||||
} else if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
|
||||
$ok = false;
|
||||
}
|
||||
|
||||
if ($ok) {
|
||||
$class = 'requires-ok';
|
||||
} else {
|
||||
$class = 'requires-failed';
|
||||
}
|
||||
|
||||
if ($requiredversion != ANY_VERSION) {
|
||||
$str = 'otherpluginversion';
|
||||
} else {
|
||||
$str = 'otherplugin';
|
||||
}
|
||||
$requires[] = html_writer::tag('li',
|
||||
get_string($str, 'core_plugin',
|
||||
array('component' => $component, 'version' => $requiredversion)),
|
||||
array('class' => $class));
|
||||
}
|
||||
|
||||
if (!$requires) {
|
||||
return '';
|
||||
}
|
||||
return html_writer::tag('ul', implode("\n", $requires));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 $plugininfo as returned by {@see plugin_manager::get_plugins()}
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_control_panel(plugin_manager $pluginman) {
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
public function plugins_control_panel(array $plugininfo) {
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'plugins-control-panel';
|
||||
$table->head = array(
|
||||
@@ -726,12 +277,8 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
}
|
||||
|
||||
$uninstallurl = $plugin->get_uninstall_url();
|
||||
$requriedby = $pluginman->other_plugins_that_require($plugin->component);
|
||||
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 {
|
||||
$uninstall = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'));
|
||||
$uninstall = new html_table_cell($uninstall);
|
||||
@@ -746,183 +293,4 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will render one beautiful table with all the environmental
|
||||
* configuration and how it suits Moodle needs.
|
||||
*
|
||||
* @param boolean $result final result of the check (true/false)
|
||||
* @param array $environment_results array of results gathered
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function environment_check_table($result, $environment_results) {
|
||||
global $CFG;
|
||||
|
||||
// Table headers
|
||||
$servertable = new html_table();//table for server checks
|
||||
$servertable->head = array(
|
||||
get_string('name'),
|
||||
get_string('info'),
|
||||
get_string('report'),
|
||||
get_string('status'),
|
||||
);
|
||||
$servertable->align = array('center', 'center', 'left', 'center');
|
||||
$servertable->wrap = array('nowrap', '', '', 'nowrap');
|
||||
$servertable->size = array('10', 10, '100%', '10');
|
||||
$servertable->attributes['class'] = 'environmenttable generaltable';
|
||||
|
||||
$serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
|
||||
|
||||
$othertable = new html_table();//table for custom checks
|
||||
$othertable->head = array(
|
||||
get_string('info'),
|
||||
get_string('report'),
|
||||
get_string('status'),
|
||||
);
|
||||
$othertable->align = array('center', 'left', 'center');
|
||||
$othertable->wrap = array('', '', 'nowrap');
|
||||
$othertable->size = array(10, '100%', '10');
|
||||
$othertable->attributes['class'] = 'environmenttable generaltable';
|
||||
|
||||
$otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
|
||||
|
||||
// Iterate over each environment_result
|
||||
$continue = true;
|
||||
foreach ($environment_results as $environment_result) {
|
||||
$errorline = false;
|
||||
$warningline = false;
|
||||
$stringtouse = '';
|
||||
if ($continue) {
|
||||
$type = $environment_result->getPart();
|
||||
$info = $environment_result->getInfo();
|
||||
$status = $environment_result->getStatus();
|
||||
$error_code = $environment_result->getErrorCode();
|
||||
// Process Report field
|
||||
$rec = new stdClass();
|
||||
// Something has gone wrong at parsing time
|
||||
if ($error_code) {
|
||||
$stringtouse = 'environmentxmlerror';
|
||||
$rec->error_code = $error_code;
|
||||
$status = get_string('error');
|
||||
$errorline = true;
|
||||
$continue = false;
|
||||
}
|
||||
|
||||
if ($continue) {
|
||||
if ($rec->needed = $environment_result->getNeededVersion()) {
|
||||
// We are comparing versions
|
||||
$rec->current = $environment_result->getCurrentVersion();
|
||||
if ($environment_result->getLevel() == 'required') {
|
||||
$stringtouse = 'environmentrequireversion';
|
||||
} else {
|
||||
$stringtouse = 'environmentrecommendversion';
|
||||
}
|
||||
|
||||
} else if ($environment_result->getPart() == 'custom_check') {
|
||||
// We are checking installed & enabled things
|
||||
if ($environment_result->getLevel() == 'required') {
|
||||
$stringtouse = 'environmentrequirecustomcheck';
|
||||
} else {
|
||||
$stringtouse = 'environmentrecommendcustomcheck';
|
||||
}
|
||||
|
||||
} else if ($environment_result->getPart() == 'php_setting') {
|
||||
if ($status) {
|
||||
$stringtouse = 'environmentsettingok';
|
||||
} else if ($environment_result->getLevel() == 'required') {
|
||||
$stringtouse = 'environmentmustfixsetting';
|
||||
} else {
|
||||
$stringtouse = 'environmentshouldfixsetting';
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($environment_result->getLevel() == 'required') {
|
||||
$stringtouse = 'environmentrequireinstall';
|
||||
} else {
|
||||
$stringtouse = 'environmentrecommendinstall';
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the status value
|
||||
if ($environment_result->getBypassStr() != '') { //Handle bypassed result (warning)
|
||||
$status = get_string('bypassed');
|
||||
$warningline = true;
|
||||
} else if ($environment_result->getRestrictStr() != '') { //Handle restricted result (error)
|
||||
$status = get_string('restricted');
|
||||
$errorline = true;
|
||||
} else {
|
||||
if ($status) { //Handle ok result (ok)
|
||||
$status = get_string('ok');
|
||||
} else {
|
||||
if ($environment_result->getLevel() == 'optional') {//Handle check result (warning)
|
||||
$status = get_string('check');
|
||||
$warningline = true;
|
||||
} else { //Handle error result (error)
|
||||
$status = get_string('check');
|
||||
$errorline = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build the text
|
||||
$linkparts = array();
|
||||
$linkparts[] = 'admin/environment';
|
||||
$linkparts[] = $type;
|
||||
if (!empty($info)){
|
||||
$linkparts[] = $info;
|
||||
}
|
||||
if (empty($CFG->docroot)) {
|
||||
$report = get_string($stringtouse, 'admin', $rec);
|
||||
} else {
|
||||
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
|
||||
}
|
||||
|
||||
// Format error or warning line
|
||||
if ($errorline || $warningline) {
|
||||
$messagetype = $errorline? 'error':'warn';
|
||||
} else {
|
||||
$messagetype = 'ok';
|
||||
}
|
||||
$status = '<span class="'.$messagetype.'">'.$status.'</span>';
|
||||
// Here we'll store all the feedback found
|
||||
$feedbacktext = '';
|
||||
// Append the feedback if there is some
|
||||
$feedbacktext .= $environment_result->strToReport($environment_result->getFeedbackStr(), $messagetype);
|
||||
//Append the bypass if there is some
|
||||
$feedbacktext .= $environment_result->strToReport($environment_result->getBypassStr(), 'warn');
|
||||
//Append the restrict if there is some
|
||||
$feedbacktext .= $environment_result->strToReport($environment_result->getRestrictStr(), 'error');
|
||||
|
||||
$report .= $feedbacktext;
|
||||
|
||||
// Add the row to the table
|
||||
if ($environment_result->getPart() == 'custom_check'){
|
||||
$otherdata[$messagetype][] = array ($info, $report, $status);
|
||||
} else {
|
||||
$serverdata[$messagetype][] = array ($type, $info, $report, $status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//put errors first in
|
||||
$servertable->data = array_merge($serverdata['error'], $serverdata['warn'], $serverdata['ok']);
|
||||
$othertable->data = array_merge($otherdata['error'], $otherdata['warn'], $otherdata['ok']);
|
||||
|
||||
// Print table
|
||||
$output = '';
|
||||
$output .= $this->heading(get_string('serverchecks', 'admin'));
|
||||
$output .= html_writer::table($servertable);
|
||||
if (count($othertable->data)){
|
||||
$output .= $this->heading(get_string('customcheck', 'admin'));
|
||||
$output .= html_writer::table($othertable);
|
||||
}
|
||||
|
||||
// Finally, if any error has happened, print the summary box
|
||||
if (!$result) {
|
||||
$output .= $this->box(get_string('environmenterrortodo', 'admin'), 'environmentbox errorbox');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,13 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Search and replace strings throughout all texts in the whole database
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage replace
|
||||
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
/// Search and replace strings throughout all texts in the whole database
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once('../config.php');
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toolreplace');
|
||||
admin_externalpage_setup('replace');
|
||||
|
||||
$search = optional_param('search', '', PARAM_RAW);
|
||||
$replace = optional_param('replace', '', PARAM_RAW);
|
||||
@@ -52,7 +30,7 @@ if (!data_submitted() or !$search or !$replace or !confirm_sesskey() or !$sure)
|
||||
|
||||
echo $OUTPUT->box_start();
|
||||
echo '<div class="mdl-align">';
|
||||
echo '<form action="index.php" method="post"><div>';
|
||||
echo '<form action="replace.php" method="post"><div>';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<div><label for="search">Search whole database for: </label><input id="search" type="text" name="search" size="40" /> (usually previous server URL)</div>';
|
||||
echo '<div><label for="replace">Replace with this string: </label><input type="text" id="replace" name="replace" size="40" /> (usually new server URL)</div>';
|
||||
@@ -74,7 +52,7 @@ 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->continue_button('index.php');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
// index.php - scheduled backup logs
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/backup/lib.php');
|
||||
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
||||
|
||||
admin_externalpage_setup('reportbackups', '', null, '', array('pagelayout'=>'report'));
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// Automated backups aren't active by the site admin
|
||||
$backup_config = backup_get_config();
|
||||
if (empty($backup_config->backup_auto_active)) {
|
||||
echo $OUTPUT->notification(get_string('automatedbackupsinactive', 'backup'));
|
||||
}
|
||||
|
||||
/// Get needed strings
|
||||
$backuploglaststatus = get_string("backuploglaststatus");
|
||||
$backuplogdetailed = get_string("backuplogdetailed");
|
||||
$stradmin = get_string("administration");
|
||||
$strconfiguration = get_string("configuration");
|
||||
$strbackup = get_string("backup");
|
||||
$strbackupdetails = get_string("backupdetails");
|
||||
$strlogs = get_string("logs");
|
||||
$strftimedatetime = get_string("strftimerecent");
|
||||
$strftimetime = get_string("strftimetime").":%S";
|
||||
$strerror = get_string("error");
|
||||
$strok = get_string("ok");
|
||||
$strunfinished = get_string("unfinished");
|
||||
$strskipped = get_string("skipped");
|
||||
$strcourse = get_string("course");
|
||||
$strtimetaken = get_string("timetaken","quiz");
|
||||
$strstatus = get_string("status");
|
||||
$strnext = get_string("backupnext");
|
||||
|
||||
/// Decide when to show last execution logs or detailed logs
|
||||
/// Lastlog view
|
||||
if (!$courseid) {
|
||||
echo $OUTPUT->heading($backuploglaststatus);
|
||||
echo $OUTPUT->box_start();
|
||||
/// Now, get every record from backup_courses
|
||||
$courses = $DB->get_records("backup_courses");
|
||||
|
||||
if (!$courses) {
|
||||
echo $OUTPUT->notification(get_string('nologsfound'));
|
||||
} else {
|
||||
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
|
||||
//Print table header
|
||||
echo "<tr>";
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strcourse</font></td>";
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\"><font size=\"3\">$strtimetaken</font></td>";
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strstatus</font></td>";
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strnext</font></td></tr>";
|
||||
foreach ($courses as $course) {
|
||||
/// Get the course shortname
|
||||
$coursename = $DB->get_field ("course", "fullname", array("id"=>$course->courseid));
|
||||
if ($coursename) {
|
||||
echo "<tr>";
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\"><a href=\"index.php?courseid=$course->courseid\">".$coursename."</a></font></td>";
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->laststarttime,$strftimedatetime)."</font></td>";
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\"> - </font></td>";
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->lastendtime,$strftimedatetime)."</font></td>";
|
||||
if ($course->laststatus == 1) {
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strok."</font></td>";
|
||||
} else if ($course->laststatus == 2) {
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strunfinished."</font></td>";
|
||||
} else if ($course->laststatus == 3) {
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strskipped."</font></td>";
|
||||
} else {
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strerror."</font></td>";
|
||||
}
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->nextstarttime,$strftimedatetime)."</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo $OUTPUT->box_end();
|
||||
/// Detailed View !!
|
||||
} else {
|
||||
echo $OUTPUT->heading($backuplogdetailed);
|
||||
|
||||
$coursename = $DB->get_field("course", "fullname", array("id"=>"$courseid"));
|
||||
echo $OUTPUT->heading("$strcourse: $coursename");
|
||||
|
||||
echo $OUTPUT->box_start();
|
||||
|
||||
/// First, me get all the distinct backups for that course in backup_log
|
||||
$executions = $DB->get_records_sql("SELECT DISTINCT laststarttime
|
||||
FROM {backup_log}
|
||||
WHERE courseid = ? AND backuptype = ?
|
||||
ORDER BY laststarttime DESC", array($courseid,'scheduledbackup'));
|
||||
|
||||
/// Iterate over backup executions
|
||||
if (!$executions) {
|
||||
echo $OUTPUT->notification(get_string('nologsfound'));
|
||||
} else {
|
||||
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
|
||||
foreach($executions as $execution) {
|
||||
echo "<tr>";
|
||||
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\">";
|
||||
echo $OUTPUT->box(userdate($execution->laststarttime));
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
$logs = $DB->get_records_sql("SELECT *
|
||||
FROM {backup_log}
|
||||
WHERE courseid = ? AND laststarttime = ? AND backuptype = ?
|
||||
ORDER BY id", array($courseid, $execution->laststarttime,'scheduledbackup'));
|
||||
if ($logs) {
|
||||
foreach ($logs as $log) {
|
||||
echo "<tr>";
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($log->time,$strftimetime)."</font></td>";
|
||||
$log->info = str_replace("- ERROR!!","- <font color=\"red\">ERROR!!</font>",$log->info);
|
||||
$log->info = str_replace("- OK","- <font color=\"green\">OK</font>",$log->info);
|
||||
echo "<td nowrap=\"nowrap\"><font size=\"2\">".str_replace(" "," ",$log->info)."</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('reportbackups', get_string('backups', 'admin'), "$CFG->wwwroot/$CFG->admin/report/backups/index.php",'moodle/backup:backupcourse'));
|
||||
@@ -1,30 +1,14 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* For a given capability, show what permission it has for every role, and
|
||||
* everywhere that it is overridden.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage capability
|
||||
* @copyright 2008 Tim Hunt
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package roles
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
/** */
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
// Check permissions.
|
||||
@@ -34,7 +18,7 @@ require_capability('moodle/role:manage', $systemcontext);
|
||||
|
||||
// Get URL parameters.
|
||||
$capability = optional_param('capability', '', PARAM_CAPABILITY);
|
||||
$roleids = optional_param_array('roles', array('0'), PARAM_INTEGER);
|
||||
$roleids = optional_param('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.
|
||||
@@ -54,13 +38,13 @@ if (empty($cleanedroleids)) {
|
||||
}
|
||||
|
||||
// Include the required JavaScript.
|
||||
$PAGE->requires->js_init_call('M.tool_capability.init', array(get_string('search')));
|
||||
$PAGE->requires->js_init_call('M.report_capability.init', array(get_string('search')));
|
||||
|
||||
// Log.
|
||||
add_to_log(SITEID, "admin", "tool capability", "tool/capability/index.php?capability=$capability", $capability);
|
||||
add_to_log(SITEID, "admin", "report capability", "report/capability/index.php?capability=$capability", $capability);
|
||||
|
||||
// Print the header.
|
||||
admin_externalpage_setup('toolcapability');
|
||||
admin_externalpage_setup('reportcapability');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Prepare the list of capabilities to choose from
|
||||
@@ -84,14 +68,14 @@ if (count($cleanedroleids) == count($allroles)) {
|
||||
|
||||
// Print the settings form.
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
echo '<form method="get" action="" id="settingsform"><div>';
|
||||
echo $OUTPUT->heading(get_string('reportsettings', 'tool_capability'));
|
||||
echo '<p id="intro">', get_string('intro', 'tool_capability') , '</p>';
|
||||
echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'tool_capability') . '</label></p>';
|
||||
echo '<form method="get" action="." id="settingsform"><div>';
|
||||
echo $OUTPUT->heading(get_string('reportsettings', 'report_capability'));
|
||||
echo '<p id="intro">', get_string('intro', 'report_capability') , '</p>';
|
||||
echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'report_capability') . '</label></p>';
|
||||
echo html_writer::select($capabilitychoices, 'capability', $capability, array(''=>'choose'), array('size'=>10));
|
||||
echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'tool_capability') . '</label></p>';
|
||||
echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'report_capability') . '</label></p>';
|
||||
echo html_writer::select($rolechoices, 'roles[]', $selectedroleids, false, array('size'=>10, 'multiple'=>'multiple'));
|
||||
echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'tool_capability') . '" /></p>';
|
||||
echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'report_capability') . '" /></p>';
|
||||
echo '</div></form>';
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
@@ -138,8 +122,7 @@ if ($capability) {
|
||||
|
||||
// Put the contexts into a tree structure.
|
||||
foreach ($contexts as $conid => $con) {
|
||||
$context = context::instance_by_id($conid);
|
||||
$parentcontextid = get_parent_contextid($context);
|
||||
$parentcontextid = get_parent_contextid($con);
|
||||
if ($parentcontextid) {
|
||||
$contexts[$parentcontextid]->children[] = $conid;
|
||||
}
|
||||
@@ -158,13 +141,13 @@ if ($capability) {
|
||||
}
|
||||
|
||||
// Print the report heading.
|
||||
echo $OUTPUT->heading(get_string('reportforcapability', 'tool_capability', get_capability_string($capability)), 2, 'main', 'report');
|
||||
echo $OUTPUT->heading(get_string('reportforcapability', 'report_capability', get_capability_string($capability)), 2, 'main', 'report');
|
||||
if (count($cleanedroleids) != count($allroles)) {
|
||||
$rolenames = array();
|
||||
foreach ($cleanedroleids as $roleid) {
|
||||
$rolenames[] = $allroles[$roleid]->name;
|
||||
}
|
||||
echo '<p>', get_string('forroles', 'tool_capability', implode(', ', $rolenames)), '</p>';
|
||||
echo '<p>', get_string('forroles', 'report_capability', implode(', ', $rolenames)), '</p>';
|
||||
}
|
||||
|
||||
// Now, recursively print the contexts, and the role information.
|
||||
@@ -192,13 +175,12 @@ function print_report_tree($contextid, $contexts, $allroles) {
|
||||
// make changes.
|
||||
if ($contextid == get_system_context()->id) {
|
||||
$url = "$CFG->wwwroot/$CFG->admin/roles/manage.php";
|
||||
$title = get_string('changeroles', 'tool_capability');
|
||||
$title = get_string('changeroles', 'report_capability');
|
||||
} else {
|
||||
$url = "$CFG->wwwroot/$CFG->admin/roles/override.php?contextid=$contextid";
|
||||
$title = get_string('changeoverrides', 'tool_capability');
|
||||
$title = get_string('changeoverrides', 'report_capability');
|
||||
}
|
||||
$context = context::instance_by_id($contextid);
|
||||
echo '<h3><a href="' . $url . '" title="' . $title . '">', $context->get_context_name(), '</a></h3>';
|
||||
echo '<h3><a href="' . $url . '" title="' . $title . '">', print_context_name($contexts[$contextid]), '</a></h3>';
|
||||
|
||||
// If there are any role overrides here, print them.
|
||||
if (!empty($contexts[$contextid]->rolecapabilities)) {
|
||||
+8
-8
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,22 +16,21 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_capability', language 'en', branch 'MOODLE_22_STABLE'
|
||||
* Strings for component 'report_capability', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage capability
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_capability
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['capabilitylabel'] = 'Capability:';
|
||||
$string['capabilityreport'] = 'Capability overview';
|
||||
$string['capabilityreport'] = 'Capability report';
|
||||
$string['forroles'] = 'For roles {$a}';
|
||||
$string['getreport'] = 'Get the overview';
|
||||
$string['getreport'] = 'Get the report';
|
||||
$string['changeoverrides'] = 'Change overrides in this context';
|
||||
$string['changeroles'] = 'Change role definitions';
|
||||
$string['intro'] = 'This report shows, for a particular capability, what permission that capability has in the definition of every role (or a selection of roles), and everywhere in the site where that capability is overridden.';
|
||||
$string['pluginname'] = 'Capability overview';
|
||||
$string['pluginname'] = 'Capability report';
|
||||
$string['reportforcapability'] = 'Report for capability \'{$a}\'';
|
||||
$string['reportsettings'] = 'Report settings';
|
||||
$string['roleslabel'] = 'Roles:';
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
M.tool_capability = {
|
||||
M.report_capability = {
|
||||
select: null,
|
||||
input: null,
|
||||
button: null,
|
||||
|
||||
init: function(Y, strsearch) {
|
||||
var context = M.tool_capability;
|
||||
var context = M.report_capability;
|
||||
|
||||
// Find the form controls.
|
||||
context.select = document.getElementById('menucapability');
|
||||
@@ -37,7 +37,7 @@ M.tool_capability = {
|
||||
},
|
||||
|
||||
typed: function() {
|
||||
var context = M.tool_capability;
|
||||
var context = M.report_capability;
|
||||
|
||||
var filtertext = context.input.value;
|
||||
var options = context.select.options;
|
||||
@@ -69,7 +69,7 @@ M.tool_capability = {
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
var context = M.tool_capability;
|
||||
var context = M.report_capability;
|
||||
context.button.disabled = (context.select.value == '');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('roles', new admin_externalpage('reportcapability', get_string('pluginname', 'report_capability'), "$CFG->wwwroot/$CFG->admin/report/capability/index.php",'moodle/role:manage'));
|
||||
@@ -1,29 +1,6 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Config changes report
|
||||
*
|
||||
* @package report
|
||||
* @subpackage configlog
|
||||
* @copyright 2009 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(dirname(__FILE__).'/../../config.php');
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
// page parameters
|
||||
+3
-4
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -17,16 +18,14 @@
|
||||
/**
|
||||
* Strings for component 'report_configlog', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package report
|
||||
* @subplugin configlog
|
||||
* @copyright 2009 petr Skoda
|
||||
* @package report_configlog
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['configlog'] = 'Config changes';
|
||||
$string['oldvalue'] = 'Original value';
|
||||
$string['plugin'] = 'Plugin';
|
||||
$string['pluginname'] = 'Config changes';
|
||||
$string['setting'] = 'Setting';
|
||||
$string['timemodified'] = 'Date';
|
||||
$string['value'] = 'New value';
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('reportconfiglog', get_string('configlog', 'report_configlog'), "$CFG->wwwroot/$CFG->admin/report/configlog/index.php"));
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'report/courseoverview:view' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once($CFG->dirroot.'/lib/statslib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
|
||||
$time = optional_param('time', 0, PARAM_INT);
|
||||
$numcourses = optional_param('numcourses', 20, PARAM_INT);
|
||||
|
||||
if (empty($CFG->enablestats)) {
|
||||
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
|
||||
} else {
|
||||
print_error('statsdisable');
|
||||
}
|
||||
}
|
||||
|
||||
admin_externalpage_setup('reportcourseoverview', '', null, '', array('pagelayout'=>'report'));
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$course = get_site();
|
||||
stats_check_uptodate($course->id);
|
||||
|
||||
$strreports = get_string('reports');
|
||||
$strcourseoverview = get_string('courseoverview');
|
||||
|
||||
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
|
||||
|
||||
$earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_daily}');
|
||||
$earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_weekly}');
|
||||
$earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_monthly}');
|
||||
|
||||
if (empty($earliestday)) $earliestday = time();
|
||||
if (empty($earliestweek)) $earliestweek = time();
|
||||
if (empty($earliestmonth)) $earliestmonth = time();
|
||||
|
||||
$now = stats_get_base_daily();
|
||||
$lastweekend = stats_get_base_weekly();
|
||||
$lastmonthend = stats_get_base_monthly();
|
||||
|
||||
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
|
||||
|
||||
if (empty($timeoptions)) {
|
||||
print_error('nostatstodisplay', 'error', $CFG->wwwroot.'/course/view.php?id='.$course->id);
|
||||
}
|
||||
|
||||
echo '<form action="index.php" method="post">'."\n";
|
||||
echo '<div>';
|
||||
|
||||
$table = new html_table();
|
||||
$table->width = '*';
|
||||
$table->align = array('left','left','left','left','left','left');
|
||||
|
||||
$reporttypemenu = html_writer::select($reportoptions,'report',$report, false);
|
||||
$timeoptionsmenu = html_writer::select($timeoptions,'time',$time, false);
|
||||
|
||||
$table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
|
||||
get_string('statstimeperiod'),$timeoptionsmenu,
|
||||
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
|
||||
'<input type="submit" value="'.get_string('view').'" />') ;
|
||||
|
||||
echo html_writer::table($table);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
echo $OUTPUT->heading($reportoptions[$report]);
|
||||
|
||||
|
||||
if (!empty($report) && !empty($time)) {
|
||||
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
|
||||
if (!empty($param->sql)) {
|
||||
$sql = $param->sql;
|
||||
} else {
|
||||
$sql = "SELECT courseid,".$param->fields."
|
||||
FROM {".'stats_'.$param->table."}
|
||||
WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0
|
||||
GROUP BY courseid
|
||||
$param->extras
|
||||
ORDER BY $param->orderby";
|
||||
}
|
||||
|
||||
$courses = $DB->get_records_sql($sql, $param->params, 0, $numcourses);
|
||||
|
||||
if (empty($courses)) {
|
||||
echo $OUTPUT->notification(get_string('statsnodata'));
|
||||
echo '</td></tr></table>';
|
||||
|
||||
} else {
|
||||
if (empty($CFG->gdversion)) {
|
||||
echo '<div class="graph">(' . get_string("gdneed") .')</div>';
|
||||
} else {
|
||||
echo '<div class="graph"><img alt="'.get_string('courseoverviewgraph').'" src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->align = array('left','center','center','center');
|
||||
$table->head = array(get_string('course'),$param->line1);
|
||||
if (!empty($param->line2)) {
|
||||
$table->head[] = $param->line2;
|
||||
}
|
||||
if (!empty($param->line3)) {
|
||||
$table->head[] = $param->line3;
|
||||
}
|
||||
|
||||
foreach ($courses as $c) {
|
||||
$a = array();
|
||||
$a[] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$c->courseid.'">'.$DB->get_field('course', 'shortname', array('id'=>$c->courseid)).'</a>';
|
||||
|
||||
$a[] = $c->line1;
|
||||
if (isset($c->line2)) {
|
||||
$a[] = $c->line2;
|
||||
}
|
||||
if (isset($c->line3)) {
|
||||
$a[] = round($c->line3,2);
|
||||
}
|
||||
$table->data[] = $a;
|
||||
}
|
||||
echo html_writer::table($table);
|
||||
}
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
+5
-5
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,12 +16,11 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'report_courseoverview'.
|
||||
* Strings for component 'report_courseoverview', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package report
|
||||
* @subpackage courseoverview
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_courseoverview
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['courseoverview:view'] = 'View course overview report';
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once($CFG->dirroot.'/lib/statslib.php');
|
||||
require_once($CFG->dirroot.'/lib/graphlib.php');
|
||||
|
||||
$report = required_param('report', PARAM_INT);
|
||||
$time = required_param('time', PARAM_INT);
|
||||
$numcourses = required_param('numcourses', PARAM_INT);
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('report/courseoverview:view', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
stats_check_uptodate();
|
||||
|
||||
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
|
||||
|
||||
if (!empty($param->sql)) {
|
||||
$sql = $param->sql;
|
||||
} else {
|
||||
$sql = "SELECT courseid, $param->fields
|
||||
FROM {".'stats_'.$param->table."}
|
||||
WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0
|
||||
GROUP BY courseid
|
||||
$param->extras
|
||||
ORDER BY $param->orderby";
|
||||
}
|
||||
|
||||
$courses = $DB->get_records_sql($sql, $param->params, 0, $numcourses);
|
||||
|
||||
if (empty($courses)) {
|
||||
$PAGE->set_url('/admin/report/courseoverview/index.php');
|
||||
print_error('statsnodata', 'error', $PAGE->url->out());
|
||||
}
|
||||
|
||||
|
||||
$graph = new graph(750,400);
|
||||
|
||||
$graph->parameter['legend'] = 'outside-right';
|
||||
$graph->parameter['legend_size'] = 10;
|
||||
$graph->parameter['x_axis_angle'] = 90;
|
||||
$graph->parameter['title'] = false; // moodle will do a nicer job.
|
||||
$graph->y_tick_labels = null;
|
||||
$graph->offset_relation = null;
|
||||
if ($report != STATS_REPORT_ACTIVE_COURSES) {
|
||||
$graph->parameter['y_decimal_left'] = 2;
|
||||
}
|
||||
|
||||
foreach ($courses as $c) {
|
||||
$graph->x_data[] = $DB->get_field('course', 'shortname', array('id'=>$c->courseid));
|
||||
$graph->y_data['bar1'][] = $c->{$param->graphline};
|
||||
}
|
||||
$graph->y_order = array('bar1');
|
||||
$graph->y_format['bar1'] = array('colour' => 'blue','bar' => 'fill','legend' => $param->{$param->graphline});
|
||||
|
||||
$graph->draw_stack();
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('reportcourseoverview', get_string('pluginname', 'report_courseoverview'), "$CFG->wwwroot/$CFG->admin/report/courseoverview/index.php",'report/courseoverview:view'));
|
||||
@@ -0,0 +1,27 @@
|
||||
<?PHP
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2010090501;
|
||||
$plugin->requires = 2010090501;
|
||||
@@ -16,9 +16,9 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Defines the capabilities used by the Language customization admin tool
|
||||
* Defines the capabilities used by the Language customization admin report
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
$capabilities = array(
|
||||
|
||||
/* allows the user to view the current language customization */
|
||||
'tool/customlang:view' => array(
|
||||
'report/customlang:view' => array(
|
||||
'riskbitmask' => RISK_CONFIG,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
@@ -39,7 +39,7 @@ $capabilities = array(
|
||||
),
|
||||
|
||||
/* allows the user to edit the current language customization */
|
||||
'tool/customlang:edit' => array(
|
||||
'report/customlang:edit' => array(
|
||||
'riskbitmask' => RISK_CONFIG | RISK_XSS,
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="admin/tool/customlang/db" VERSION="20110925" COMMENT="XMLDB file for Moodle admin/tool/customlang"
|
||||
<XMLDB PATH="admin/report/customlang/db" VERSION="20110419" COMMENT="XMLDB file for Moodle admin/report/customlang"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
<TABLES>
|
||||
<TABLE NAME="tool_customlang" COMMENT="Contains the working checkout of all strings and their customization" NEXT="tool_customlang_components">
|
||||
<TABLE NAME="report_customlang" COMMENT="Contains the working checkout of all strings and their customization" NEXT="report_customlang_components">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="lang"/>
|
||||
<FIELD NAME="lang" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" COMMENT="The code of the language this string belongs to. Like en, cs or es" PREVIOUS="id" NEXT="componentid"/>
|
||||
@@ -20,13 +20,13 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fk_component"/>
|
||||
<KEY NAME="fk_component" TYPE="foreign" FIELDS="componentid" REFTABLE="tool_customlang_components" REFFIELDS="id" PREVIOUS="primary"/>
|
||||
<KEY NAME="fk_component" TYPE="foreign" FIELDS="componentid" REFTABLE="report_customlang_components" REFFIELDS="id" PREVIOUS="primary"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="uq_lang_component_string" UNIQUE="true" FIELDS="lang, componentid, stringid" COMMENT="For a given language and component, string identifiers must be unique"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="tool_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="tool_customlang">
|
||||
<TABLE NAME="report_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="report_customlang">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The normalized name of the plugin" PREVIOUS="id" NEXT="version"/>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Language customization report upgrades
|
||||
*
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
function xmldb_report_customlang_upgrade($oldversion) {
|
||||
global $CFG, $DB, $OUTPUT;
|
||||
|
||||
$dbman = $DB->get_manager();
|
||||
$result = true;
|
||||
|
||||
/**
|
||||
* Use proper plugin prefix for tables
|
||||
*/
|
||||
if ($oldversion < 2010111200) {
|
||||
if ($dbman->table_exists('customlang')) {
|
||||
$dbman->rename_table(new xmldb_table('customlang'), 'report_customlang');
|
||||
}
|
||||
if ($dbman->table_exists('customlang_components')) {
|
||||
$dbman->rename_table(new xmldb_table('customlang_components'), 'report_customlang_components');
|
||||
}
|
||||
upgrade_plugin_savepoint(true, 2010111200, 'report', 'customlang');
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate the foreign key after the tables rename
|
||||
*/
|
||||
if ($oldversion < 2010111500) {
|
||||
$table = new xmldb_table('report_customlang');
|
||||
$oldkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'customlang_components', array('id'));
|
||||
$newkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'report_customlang_components', array('id'));
|
||||
|
||||
$dbman->drop_key($table, $oldkey);
|
||||
$dbman->add_key($table, $newkey);
|
||||
|
||||
upgrade_plugin_savepoint(true, 2010111500, 'report', 'customlang');
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the version field from integer to varchar
|
||||
*/
|
||||
if ($oldversion < 2011041900) {
|
||||
$table = new xmldb_table('report_customlang_components');
|
||||
$field = new xmldb_field('version', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'name');
|
||||
|
||||
$dbman->change_field_type($table, $field);
|
||||
|
||||
upgrade_plugin_savepoint(true, 2011041900, 'report', 'customlang');
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,29 +16,29 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/filter_form.php');
|
||||
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/filter_form.php');
|
||||
|
||||
require_login(SITEID, false);
|
||||
require_capability('tool/customlang:edit', get_system_context());
|
||||
require_capability('report/customlang:edit', get_system_context());
|
||||
|
||||
$lng = required_param('lng', PARAM_LANG);
|
||||
$currentpage = optional_param('p', 0, PARAM_INT);
|
||||
$translatorsubmitted = optional_param('translatorsubmitted', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_pagelayout('standard');
|
||||
$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
|
||||
navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
|
||||
$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
|
||||
$PAGE->set_heading(get_string('pluginname', 'tool_customlang'));
|
||||
$PAGE->requires->js_init_call('M.tool_customlang.init_editor', array(), true);
|
||||
$PAGE->set_url('/admin/report/customlang/edit.php', array('lng' => $lng));
|
||||
navigation_node::override_active_url(new moodle_url('/admin/report/customlang/index.php'));
|
||||
$PAGE->set_title(get_string('pluginname', 'report_customlang'));
|
||||
$PAGE->set_heading(get_string('pluginname', 'report_customlang'));
|
||||
$PAGE->requires->js_init_call('M.report_customlang.init_editor', array(), true);
|
||||
|
||||
if (empty($lng)) {
|
||||
// PARAM_LANG validation failed
|
||||
@@ -45,33 +46,33 @@ if (empty($lng)) {
|
||||
}
|
||||
|
||||
// pre-output processing
|
||||
$filter = new tool_customlang_filter_form($PAGE->url, null, 'post', '', array('class'=>'filterform'));
|
||||
$filterdata = tool_customlang_utils::load_filter($USER);
|
||||
$filter = new report_customlang_filter_form($PAGE->url, null, 'post', '', array('class'=>'filterform'));
|
||||
$filterdata = report_customlang_utils::load_filter($USER);
|
||||
$filter->set_data($filterdata);
|
||||
|
||||
if ($filter->is_cancelled()) {
|
||||
redirect($PAGE->url);
|
||||
|
||||
} elseif ($submitted = $filter->get_data()) {
|
||||
tool_customlang_utils::save_filter($submitted, $USER);
|
||||
report_customlang_utils::save_filter($submitted, $USER);
|
||||
redirect(new moodle_url($PAGE->url, array('p'=>0)));
|
||||
}
|
||||
|
||||
if ($translatorsubmitted) {
|
||||
$strings = optional_param_array('cust', array(), PARAM_RAW);
|
||||
$updates = optional_param_array('updates', array(), PARAM_INT);
|
||||
$strings = optional_param('cust', array(), PARAM_RAW);
|
||||
$updates = optional_param('updates', array(), PARAM_INT);
|
||||
$checkin = optional_param('savecheckin', false, PARAM_RAW);
|
||||
|
||||
if ($checkin === false) {
|
||||
$nexturl = $PAGE->url;
|
||||
} else {
|
||||
$nexturl = new moodle_url('/admin/tool/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
|
||||
$nexturl = new moodle_url('/admin/report/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
|
||||
}
|
||||
|
||||
if (!is_array($strings)) {
|
||||
$strings = array();
|
||||
}
|
||||
$current = $DB->get_records_list('tool_customlang', 'id', array_keys($strings));
|
||||
$current = $DB->get_records_list('report_customlang', 'id', array_keys($strings));
|
||||
$now = time();
|
||||
|
||||
foreach ($strings as $recordid => $customization) {
|
||||
@@ -82,7 +83,7 @@ if ($translatorsubmitted) {
|
||||
$current[$recordid]->modified = 1;
|
||||
$current[$recordid]->outdated = 0;
|
||||
$current[$recordid]->timecustomized = null;
|
||||
$DB->update_record('tool_customlang', $current[$recordid]);
|
||||
$DB->update_record('report_customlang', $current[$recordid]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ if ($translatorsubmitted) {
|
||||
$current[$recordid]->modified = 1;
|
||||
$current[$recordid]->outdated = 0;
|
||||
$current[$recordid]->timecustomized = $now;
|
||||
$DB->update_record('tool_customlang', $current[$recordid]);
|
||||
$DB->update_record('report_customlang', $current[$recordid]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -105,17 +106,17 @@ if ($translatorsubmitted) {
|
||||
}
|
||||
if (!empty($updates)) {
|
||||
list($sql, $params) = $DB->get_in_or_equal($updates);
|
||||
$DB->set_field_select('tool_customlang', 'outdated', 0, "local IS NOT NULL AND id $sql", $params);
|
||||
$DB->set_field_select('report_customlang', 'outdated', 0, "local IS NOT NULL AND id $sql", $params);
|
||||
}
|
||||
|
||||
redirect($nexturl);
|
||||
}
|
||||
|
||||
$translator = new tool_customlang_translator($PAGE->url, $lng, $filterdata, $currentpage);
|
||||
$translator = new report_customlang_translator($PAGE->url, $lng, $filterdata, $currentpage);
|
||||
|
||||
// output starts here
|
||||
$output = $PAGE->get_renderer('tool_customlang');
|
||||
$paginator = $output->paging_bar($translator->numofrows, $currentpage, tool_customlang_translator::PERPAGE, $PAGE->url, 'p');
|
||||
$output = $PAGE->get_renderer('report_customlang');
|
||||
$paginator = $output->paging_bar($translator->numofrows, $currentpage, report_customlang_translator::PERPAGE, $PAGE->url, 'p');
|
||||
|
||||
echo $output->header();
|
||||
$filter->display();
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -28,51 +29,51 @@ require_once($CFG->dirroot . '/lib/formslib.php');
|
||||
/**
|
||||
* Form for filtering the strings to customize
|
||||
*/
|
||||
class tool_customlang_filter_form extends moodleform {
|
||||
class report_customlang_filter_form extends moodleform {
|
||||
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$current = $this->_customdata['current'];
|
||||
|
||||
$mform->addElement('header', 'filtersettings', get_string('filter', 'tool_customlang'));
|
||||
$mform->addElement('header', 'filtersettings', get_string('filter', 'report_customlang'));
|
||||
|
||||
// Component
|
||||
$options = array();
|
||||
foreach (tool_customlang_utils::list_components() as $component => $normalized) {
|
||||
foreach (report_customlang_utils::list_components() as $component => $normalized) {
|
||||
list($type, $plugin) = normalize_component($normalized);
|
||||
if ($type == 'core' and is_null($plugin)) {
|
||||
$plugin = 'moodle';
|
||||
}
|
||||
$options[$type][$normalized] = $component.'.php';
|
||||
}
|
||||
$mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'tool_customlang'), $options,
|
||||
$mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'report_customlang'), $options,
|
||||
array('multiple'=>'multiple', 'size'=>7));
|
||||
|
||||
// Customized only
|
||||
$mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'tool_customlang'));
|
||||
$mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'report_customlang'));
|
||||
$mform->setType('customized', PARAM_BOOL);
|
||||
$mform->setDefault('customized', 0);
|
||||
|
||||
// Only helps
|
||||
$mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'tool_customlang'));
|
||||
$mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'report_customlang'));
|
||||
$mform->setType('helps', PARAM_BOOL);
|
||||
$mform->setDefault('helps', 0);
|
||||
|
||||
// Modified only
|
||||
$mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'tool_customlang'));
|
||||
$mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'report_customlang'));
|
||||
$mform->setType('filtermodified', PARAM_BOOL);
|
||||
$mform->setDefault('filtermodified', 0);
|
||||
|
||||
// Substring
|
||||
$mform->addElement('text', 'substring', get_string('filtersubstring', 'tool_customlang'));
|
||||
$mform->addElement('text', 'substring', get_string('filtersubstring', 'report_customlang'));
|
||||
$mform->setType('substring', PARAM_RAW);
|
||||
|
||||
// String identifier
|
||||
$mform->addElement('text', 'stringid', get_string('filterstringid', 'tool_customlang'));
|
||||
$mform->addElement('text', 'stringid', get_string('filterstringid', 'report_customlang'));
|
||||
$mform->setType('stringid', PARAM_STRINGID);
|
||||
|
||||
// Show strings - submit button
|
||||
$mform->addElement('submit', 'submit', get_string('filtershowstrings', 'tool_customlang'));
|
||||
$mform->addElement('submit', 'submit', get_string('filtershowstrings', 'report_customlang'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -17,7 +18,7 @@
|
||||
/**
|
||||
* Performs checkout of the strings into the translation table
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -25,81 +26,81 @@
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true); // progress bar is used here
|
||||
|
||||
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
|
||||
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
require_login(SITEID, false);
|
||||
require_capability('tool/customlang:view', get_system_context());
|
||||
require_capability('report/customlang:view', get_system_context());
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
$lng = optional_param('lng', '', PARAM_LANG);
|
||||
|
||||
admin_externalpage_setup('toolcustomlang');
|
||||
admin_externalpage_setup('reportcustomlang');
|
||||
$langs = get_string_manager()->get_list_of_translations();
|
||||
|
||||
// pre-output actions
|
||||
if ($action === 'checkout') {
|
||||
require_sesskey();
|
||||
require_capability('tool/customlang:edit', get_system_context());
|
||||
require_capability('report/customlang:edit', get_system_context());
|
||||
if (empty($lng)) {
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
$PAGE->set_cacheable(false); // progress bar is used here
|
||||
$output = $PAGE->get_renderer('tool_customlang');
|
||||
$output = $PAGE->get_renderer('report_customlang');
|
||||
echo $output->header();
|
||||
echo $output->heading(get_string('pluginname', 'tool_customlang'));
|
||||
echo $output->heading(get_string('pluginname', 'report_customlang'));
|
||||
$progressbar = new progress_bar();
|
||||
$progressbar->create(); // prints the HTML code of the progress bar
|
||||
|
||||
// we may need a bit of extra execution time and memory here
|
||||
@set_time_limit(HOURSECS);
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
tool_customlang_utils::checkout($lng, $progressbar);
|
||||
report_customlang_utils::checkout($lng, $progressbar);
|
||||
|
||||
echo $output->continue_button(new moodle_url('/admin/tool/customlang/edit.php', array('lng' => $lng)), 'get');
|
||||
echo $output->continue_button(new moodle_url('/admin/report/customlang/edit.php', array('lng' => $lng)), 'get');
|
||||
echo $output->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'checkin') {
|
||||
require_sesskey();
|
||||
require_capability('tool/customlang:edit', get_system_context());
|
||||
require_capability('report/customlang:edit', get_system_context());
|
||||
if (empty($lng)) {
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
if (!$confirm) {
|
||||
$output = $PAGE->get_renderer('tool_customlang');
|
||||
$output = $PAGE->get_renderer('report_customlang');
|
||||
echo $output->header();
|
||||
echo $output->heading(get_string('pluginname', 'tool_customlang'));
|
||||
echo $output->heading(get_string('pluginname', 'report_customlang'));
|
||||
echo $output->heading($langs[$lng], 3);
|
||||
$numofmodified = tool_customlang_utils::get_count_of_modified($lng);
|
||||
$numofmodified = report_customlang_utils::get_count_of_modified($lng);
|
||||
if ($numofmodified != 0) {
|
||||
echo $output->heading(get_string('modifiednum', 'tool_customlang', $numofmodified), 3);
|
||||
echo $output->confirm(get_string('confirmcheckin', 'tool_customlang'),
|
||||
echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
|
||||
echo $output->confirm(get_string('confirmcheckin', 'report_customlang'),
|
||||
new moodle_url($PAGE->url, array('action'=>'checkin', 'lng'=>$lng, 'confirm'=>1)),
|
||||
new moodle_url($PAGE->url, array('lng'=>$lng)));
|
||||
} else {
|
||||
echo $output->heading(get_string('modifiedno', 'tool_customlang', $numofmodified), 3);
|
||||
echo $output->heading(get_string('modifiedno', 'report_customlang', $numofmodified), 3);
|
||||
echo $output->continue_button(new moodle_url($PAGE->url, array('lng' => $lng)));
|
||||
}
|
||||
echo $output->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
tool_customlang_utils::checkin($lng);
|
||||
report_customlang_utils::checkin($lng);
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('tool_customlang');
|
||||
$output = $PAGE->get_renderer('report_customlang');
|
||||
|
||||
// output starts here
|
||||
echo $output->header();
|
||||
echo $output->heading(get_string('pluginname', 'tool_customlang'));
|
||||
echo $output->heading(get_string('pluginname', 'report_customlang'));
|
||||
|
||||
if (empty($lng)) {
|
||||
$s = new single_select($PAGE->url, 'lng', $langs);
|
||||
@@ -112,27 +113,27 @@ if (empty($lng)) {
|
||||
|
||||
echo $output->heading($langs[$lng], 3);
|
||||
|
||||
$numofmodified = tool_customlang_utils::get_count_of_modified($lng);
|
||||
$numofmodified = report_customlang_utils::get_count_of_modified($lng);
|
||||
|
||||
if ($numofmodified != 0) {
|
||||
echo $output->heading(get_string('modifiednum', 'tool_customlang', $numofmodified), 3);
|
||||
echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
|
||||
}
|
||||
|
||||
$menu = array();
|
||||
if (has_capability('tool/customlang:edit', get_system_context())) {
|
||||
if (has_capability('report/customlang:edit', get_system_context())) {
|
||||
$menu['checkout'] = array(
|
||||
'title' => get_string('checkout', 'tool_customlang'),
|
||||
'title' => get_string('checkout', 'report_customlang'),
|
||||
'url' => new moodle_url($PAGE->url, array('action' => 'checkout', 'lng' => $lng)),
|
||||
'method' => 'post',
|
||||
);
|
||||
if ($numofmodified != 0) {
|
||||
$menu['checkin'] = array(
|
||||
'title' => get_string('checkin', 'tool_customlang'),
|
||||
'title' => get_string('checkin', 'report_customlang'),
|
||||
'url' => new moodle_url($PAGE->url, array('action' => 'checkin', 'lng' => $lng)),
|
||||
'method' => 'post',
|
||||
);
|
||||
}
|
||||
}
|
||||
echo $output->render(new tool_customlang_menu($menu));
|
||||
echo $output->render(new report_customlang_menu($menu));
|
||||
|
||||
echo $output->footer();
|
||||
+16
-16
@@ -16,9 +16,9 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for Language customisation admin tool
|
||||
* Strings for Language customization admin report
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -26,36 +26,36 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['checkin'] = 'Save strings to language pack';
|
||||
$string['checkout'] = 'Open language pack for editing';
|
||||
$string['checkoutdone'] = 'Language pack loaded';
|
||||
$string['checkoutinprogress'] = 'Loading language pack';
|
||||
$string['confirmcheckin'] = 'You are about to save modifications to your local language pack. This will export the customised strings from the translator into you Moodle data directory and Moodle will start using the modified strings. Press \'Continue\' to proceed with saving.';
|
||||
$string['checkin'] = 'Check in strings into disk';
|
||||
$string['checkout'] = 'Check out strings into the translator';
|
||||
$string['checkoutdone'] = 'Strings checked out successfully into the translator';
|
||||
$string['checkoutinprogress'] = 'Checking out strings into the translator';
|
||||
$string['confirmcheckin'] = 'You are about to check in modified strings into your local language pack. This will export the customized strings from the translator into the data directory and Moodle will start using the modified strings. Press \'Continue\' button to proceed check in.';
|
||||
$string['customlang:edit'] = 'Edit local translation';
|
||||
$string['customlang:view'] = 'View local translation';
|
||||
$string['filter'] = 'Filter strings';
|
||||
$string['filtercomponent'] = 'Show strings of these components';
|
||||
$string['filtercustomized'] = 'Customised only';
|
||||
$string['filtercustomized'] = 'Customized only';
|
||||
$string['filtermodified'] = 'Modified only';
|
||||
$string['filteronlyhelps'] = 'Help only';
|
||||
$string['filtershowstrings'] = 'Show strings';
|
||||
$string['filterstringid'] = 'String identifier';
|
||||
$string['filtersubstring'] = 'Only strings containing';
|
||||
$string['headingcomponent'] = 'Component';
|
||||
$string['headinglocal'] = 'Local customisation';
|
||||
$string['headinglocal'] = 'Local customization';
|
||||
$string['headingstandard'] = 'Standard text';
|
||||
$string['headingstringid'] = 'String';
|
||||
$string['markinguptodate'] = 'Marking the customisation as up-to-date';
|
||||
$string['markinguptodate_help'] = 'The customised translation may get outdated if either the English original or the master translation has modified since the string was customised on your site. Review the customised translation. If you find it up-to-date, click the checkbox. Edit it otherwise.';
|
||||
$string['markinguptodate'] = 'Marking the customization as up-to-date';
|
||||
$string['markinguptodate_help'] = 'The customized translation may get outdated if either the English original or the master translation has modified since the string was customized on your site. Review the customized translation. If you find it up-to-date, click the checkbox. Edit it otherwise.';
|
||||
$string['markuptodate'] = 'mark as up-to-date';
|
||||
$string['modifiedno'] = 'There are no modified strings to save.';
|
||||
$string['modifiednum'] = 'There are {$a} modified strings. Do you wish to save these changes to your local language pack?';
|
||||
$string['modifiedno'] = 'There are no modified strings to check in.';
|
||||
$string['modifiednum'] = 'There are {$a} modified strings. You must check in them into disk to store them permanently.';
|
||||
$string['nostringsfound'] = 'No strings found, please modify the filter settings';
|
||||
$string['placeholder'] = 'Placeholders';
|
||||
$string['placeholder_help'] = 'Placeholders are special statements like `{$a}` or `{$a->something}` within the string. They are replaced with a value when the string is actually printed.
|
||||
|
||||
It is important to copy them exactly as they are in the original string. Do not translate them nor change their left-to-right orientation.';
|
||||
$string['placeholderwarning'] = 'string contains a placeholder';
|
||||
$string['pluginname'] = 'Language customisation';
|
||||
$string['savecheckin'] = 'Save changes to the language pack';
|
||||
$string['savecontinue'] = 'Apply changes and continue editing';
|
||||
$string['pluginname'] = 'Language customization';
|
||||
$string['savecheckin'] = 'Save and check in strings into files';
|
||||
$string['savecontinue'] = 'Save and continue editing';
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,9 +16,9 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Definition of classes used by language customization admin tool
|
||||
* Definition of classes used by language customization admin report
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -30,7 +31,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*
|
||||
* All the public methods here are static ones, this class can not be instantiated
|
||||
*/
|
||||
class tool_customlang_utils {
|
||||
class report_customlang_utils {
|
||||
|
||||
/**
|
||||
* Rough number of strings that are being processed during a full checkout.
|
||||
@@ -94,7 +95,7 @@ class tool_customlang_utils {
|
||||
global $DB;
|
||||
|
||||
// make sure that all components are registered
|
||||
$current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
|
||||
$current = $DB->get_records('report_customlang_components', null, 'name', 'name,version,id');
|
||||
foreach (self::list_components() as $component) {
|
||||
if (empty($current[$component])) {
|
||||
$record = new stdclass();
|
||||
@@ -104,10 +105,10 @@ class tool_customlang_utils {
|
||||
} else {
|
||||
$record->version = $version;
|
||||
}
|
||||
$DB->insert_record('tool_customlang_components', $record);
|
||||
$DB->insert_record('report_customlang_components', $record);
|
||||
} elseif ($version = get_component_version($component)) {
|
||||
if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
|
||||
$DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
|
||||
$DB->set_field('report_customlang_components', 'version', $version, array('id' => $current[$component]->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,14 +116,14 @@ class tool_customlang_utils {
|
||||
|
||||
// initialize the progress counter - stores the number of processed strings
|
||||
$done = 0;
|
||||
$strinprogress = get_string('checkoutinprogress', 'tool_customlang');
|
||||
$strinprogress = get_string('checkoutinprogress', 'report_customlang');
|
||||
|
||||
// reload components and fetch their strings
|
||||
$stringman = get_string_manager();
|
||||
$components = $DB->get_records('tool_customlang_components');
|
||||
$components = $DB->get_records('report_customlang_components');
|
||||
foreach ($components as $component) {
|
||||
$sql = "SELECT stringid, id, lang, componentid, original, master, local, timemodified, timecustomized, outdated, modified
|
||||
FROM {tool_customlang} s
|
||||
FROM {report_customlang} s
|
||||
WHERE lang = ? AND componentid = ?
|
||||
ORDER BY stringid";
|
||||
$current = $DB->get_records_sql($sql, array($lang, $component->id));
|
||||
@@ -166,7 +167,7 @@ class tool_customlang_utils {
|
||||
}
|
||||
|
||||
if ($needsupdate) {
|
||||
$DB->update_record('tool_customlang', $current[$stringid]);
|
||||
$DB->update_record('report_customlang', $current[$stringid]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -187,13 +188,13 @@ class tool_customlang_utils {
|
||||
$record->timecustomized = null;
|
||||
}
|
||||
|
||||
$DB->insert_record('tool_customlang', $record);
|
||||
$DB->insert_record('report_customlang', $record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($progressbar)) {
|
||||
$progressbar->update_full(100, get_string('checkoutdone', 'tool_customlang'));
|
||||
$progressbar->update_full(100, get_string('checkoutdone', 'report_customlang'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,8 +213,8 @@ class tool_customlang_utils {
|
||||
|
||||
// get all customized strings from updated components
|
||||
$sql = "SELECT s.*, c.name AS component
|
||||
FROM {tool_customlang} s
|
||||
JOIN {tool_customlang_components} c ON s.componentid = c.id
|
||||
FROM {report_customlang} s
|
||||
JOIN {report_customlang_components} c ON s.componentid = c.id
|
||||
WHERE s.lang = ?
|
||||
AND (s.local IS NOT NULL OR s.modified = 1)
|
||||
ORDER BY componentid, stringid";
|
||||
@@ -231,7 +232,7 @@ class tool_customlang_utils {
|
||||
self::dump_strings($lang, $component, $strings);
|
||||
}
|
||||
|
||||
$DB->set_field_select('tool_customlang', 'modified', 0, 'lang = ?', array($lang));
|
||||
$DB->set_field_select('report_customlang', 'modified', 0, 'lang = ?', array($lang));
|
||||
$sm = get_string_manager();
|
||||
$sm->reset_caches();
|
||||
}
|
||||
@@ -261,7 +262,7 @@ class tool_customlang_utils {
|
||||
debugging('Unable to dump local strings for non-installed language pack .'.s($lang));
|
||||
return false;
|
||||
}
|
||||
if ($component !== clean_param($component, PARAM_COMPONENT)) {
|
||||
if ($component !== clean_param($component, PARAM_SAFEDIR)) {
|
||||
throw new coding_exception('Incorrect component name');
|
||||
}
|
||||
if (!$filename = self::get_component_filename($component)) {
|
||||
@@ -358,7 +359,7 @@ EOF
|
||||
public static function get_count_of_modified($lang) {
|
||||
global $DB;
|
||||
|
||||
return $DB->count_records('tool_customlang', array('lang'=>$lang, 'modified'=>1));
|
||||
return $DB->count_records('report_customlang', array('lang'=>$lang, 'modified'=>1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,12 +370,12 @@ EOF
|
||||
* @param stdclass $persistant storage object
|
||||
*/
|
||||
public static function save_filter(stdclass $data, stdclass $persistant) {
|
||||
if (!isset($persistant->tool_customlang_filter)) {
|
||||
$persistant->tool_customlang_filter = array();
|
||||
if (!isset($persistant->report_customlang_filter)) {
|
||||
$persistant->report_customlang_filter = array();
|
||||
}
|
||||
foreach ($data as $key => $value) {
|
||||
if ($key !== 'submit') {
|
||||
$persistant->tool_customlang_filter[$key] = serialize($value);
|
||||
$persistant->report_customlang_filter[$key] = serialize($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,8 +389,8 @@ EOF
|
||||
*/
|
||||
public static function load_filter(stdclass $persistant) {
|
||||
$data = new stdclass();
|
||||
if (isset($persistant->tool_customlang_filter)) {
|
||||
foreach ($persistant->tool_customlang_filter as $key => $value) {
|
||||
if (isset($persistant->report_customlang_filter)) {
|
||||
foreach ($persistant->report_customlang_filter as $key => $value) {
|
||||
$data->{$key} = unserialize($value);
|
||||
}
|
||||
}
|
||||
@@ -398,9 +399,9 @@ EOF
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the action menu of the tool
|
||||
* Represents the action menu of the report
|
||||
*/
|
||||
class tool_customlang_menu implements renderable {
|
||||
class report_customlang_menu implements renderable {
|
||||
|
||||
/** @var menu items */
|
||||
protected $items = array();
|
||||
@@ -448,7 +449,7 @@ class tool_customlang_menu implements renderable {
|
||||
/**
|
||||
* Represents the translation tool
|
||||
*/
|
||||
class tool_customlang_translator implements renderable {
|
||||
class report_customlang_translator implements renderable {
|
||||
|
||||
/** @const int number of rows per page */
|
||||
const PERPAGE = 100;
|
||||
@@ -488,9 +489,9 @@ class tool_customlang_translator implements renderable {
|
||||
list($insql, $inparams) = $DB->get_in_or_equal($filter->component, SQL_PARAMS_NAMED);
|
||||
|
||||
$csql = "SELECT COUNT(*)";
|
||||
$fsql = "SELECT s.*, c.name AS component";
|
||||
$sql = " FROM {tool_customlang_components} c
|
||||
JOIN {tool_customlang} s ON s.componentid = c.id
|
||||
$fsql = "SELECT s.id, s.*, c.name AS component";
|
||||
$sql = " FROM {report_customlang_components} c
|
||||
JOIN {report_customlang} s ON s.componentid = c.id
|
||||
WHERE s.lang = :lang
|
||||
AND c.name $insql";
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -23,20 +23,20 @@
|
||||
/**
|
||||
* @namespace
|
||||
*/
|
||||
M.tool_customlang = M.tool_customlang || {};
|
||||
M.report_customlang = M.report_customlang || {};
|
||||
|
||||
/**
|
||||
* YUI instance holder
|
||||
*/
|
||||
M.tool_customlang.Y = {};
|
||||
M.report_customlang.Y = {};
|
||||
|
||||
/**
|
||||
* Initialize JS support for the edit.php
|
||||
*
|
||||
* @param {Object} Y YUI instance
|
||||
*/
|
||||
M.tool_customlang.init_editor = function(Y) {
|
||||
M.tool_customlang.Y = Y;
|
||||
M.report_customlang.init_editor = function(Y) {
|
||||
M.report_customlang.Y = Y;
|
||||
|
||||
Y.all('#translator .local textarea').each(function (textarea) {
|
||||
var cell = textarea.get('parentNode');
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,9 +16,9 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Output rendering of Language customization admin tool
|
||||
* Output rendering of Language customization admin report
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -26,16 +27,16 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Rendering methods for the tool widgets
|
||||
* Rendering methods for the report widgets
|
||||
*/
|
||||
class tool_customlang_renderer extends plugin_renderer_base {
|
||||
class report_customlang_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Renders customlang tool menu
|
||||
* Renders customlang report menu
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function render_tool_customlang_menu(tool_customlang_menu $menu) {
|
||||
protected function render_report_customlang_menu(report_customlang_menu $menu) {
|
||||
$output = '';
|
||||
foreach ($menu->get_items() as $item) {
|
||||
$output .= $this->single_button($item->url, $item->title, $item->method);
|
||||
@@ -46,23 +47,23 @@ class tool_customlang_renderer extends plugin_renderer_base {
|
||||
/**
|
||||
* Renders customlang translation table
|
||||
*
|
||||
* @param tool_customlang_translator $translator
|
||||
* @param report_customlang_translator $translator
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function render_tool_customlang_translator(tool_customlang_translator $translator) {
|
||||
protected function render_report_customlang_translator(report_customlang_translator $translator) {
|
||||
$output = '';
|
||||
|
||||
if (empty($translator->strings)) {
|
||||
return $this->heading(get_string('nostringsfound', 'tool_customlang'), 3);
|
||||
return $this->heading(get_string('nostringsfound', 'report_customlang'), 3);
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'translator';
|
||||
$table->head = array(
|
||||
get_string('headingcomponent', 'tool_customlang'),
|
||||
get_string('headingstringid', 'tool_customlang'),
|
||||
get_string('headingstandard', 'tool_customlang'),
|
||||
get_string('headinglocal', 'tool_customlang'),
|
||||
get_string('headingcomponent', 'report_customlang'),
|
||||
get_string('headingstringid', 'report_customlang'),
|
||||
get_string('headingstandard', 'report_customlang'),
|
||||
get_string('headinglocal', 'report_customlang'),
|
||||
);
|
||||
|
||||
foreach ($translator->strings as $string) {
|
||||
@@ -77,8 +78,8 @@ class tool_customlang_renderer extends plugin_renderer_base {
|
||||
$master = html_writer::tag('div', s($string->master), array('class' => 'preformatted'));
|
||||
$minheight = strlen($string->master) / 200;
|
||||
if (preg_match('/\{\$a(->.+)?\}/', $string->master)) {
|
||||
$master .= html_writer::tag('div', $this->help_icon('placeholder', 'tool_customlang',
|
||||
get_string('placeholderwarning', 'tool_customlang')), array('class' => 'placeholderinfo'));
|
||||
$master .= html_writer::tag('div', $this->help_icon('placeholder', 'report_customlang',
|
||||
get_string('placeholderwarning', 'report_customlang')), array('class' => 'placeholderinfo'));
|
||||
}
|
||||
$cells[2] = new html_table_cell($master);
|
||||
$cells[2]->attributes['class'] = 'standard master';
|
||||
@@ -92,8 +93,8 @@ class tool_customlang_renderer extends plugin_renderer_base {
|
||||
if (!is_null($string->local) and $string->outdated) {
|
||||
$mark = html_writer::empty_tag('input', array('type' => 'checkbox', 'id' => 'update_' . $string->id,
|
||||
'name' => 'updates[]', 'value' => $string->id));
|
||||
$help = $this->help_icon('markinguptodate', 'tool_customlang');
|
||||
$mark .= html_writer::tag('label', get_string('markuptodate', 'tool_customlang') . $help,
|
||||
$help = $this->help_icon('markinguptodate', 'report_customlang');
|
||||
$mark .= html_writer::tag('label', get_string('markuptodate', 'report_customlang') . $help,
|
||||
array('for' => 'update_' . $string->id));
|
||||
$mark = html_writer::tag('div', $mark, array('class' => 'uptodatewrapper'));
|
||||
} else {
|
||||
@@ -133,8 +134,8 @@ class tool_customlang_renderer extends plugin_renderer_base {
|
||||
$output .= html_writer::start_tag('div');
|
||||
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'translatorsubmitted', 'value'=>1));
|
||||
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
|
||||
$save1 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'tool_customlang')));
|
||||
$save2 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'tool_customlang')));
|
||||
$save1 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'report_customlang')));
|
||||
$save2 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'report_customlang')));
|
||||
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
|
||||
$output .= html_writer::table($table);
|
||||
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -23,4 +24,4 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$ADMIN->add('language', new admin_externalpage('toolcustomlang', get_string('pluginname', 'tool_customlang'), "$CFG->wwwroot/$CFG->admin/tool/customlang/index.php", 'tool/customlang:view'));
|
||||
$ADMIN->add('language', new admin_externalpage('reportcustomlang', get_string('pluginname', 'report_customlang'), "$CFG->wwwroot/$CFG->admin/report/customlang/index.php", 'report/customlang:view'));
|
||||
@@ -0,0 +1,69 @@
|
||||
.path-admin-report-customlang .langselectorbox,
|
||||
.path-admin-report-customlang fieldset.buttonsbar,
|
||||
.path-admin-report-customlang .menu {
|
||||
margin: 5px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang .menu .singlebutton,
|
||||
.path-admin-report-customlang .menu .singlebutton form,
|
||||
.path-admin-report-customlang .menu .singlebutton form div {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
||||
.path-admin-report-customlang .mform.filterform {
|
||||
width: 70%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang .mform.filterform .fitem .fitemtitle {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang .mform.filterform .fitem .felement {
|
||||
width: 60%;
|
||||
margin-left: 31%;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .standard,
|
||||
.path-admin-report-customlang #translator .local {
|
||||
min-width: 35%;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .customized {
|
||||
background-color: #e7f1c3;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .customized.outdated {
|
||||
background-color: #f3f2aa;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .modified {
|
||||
background-color: #ffd3d9;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .customized.modified {
|
||||
background-color: #d2ebff;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator textarea {
|
||||
width: 100%;
|
||||
min-height: 4em;
|
||||
}
|
||||
|
||||
.path-admin-report-customlang #translator .placeholderinfo {
|
||||
text-align: center;
|
||||
border: 1px dotted #ddd;
|
||||
background-color: #f6f6f6;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
#page-admin-report-customlang-index .continuebutton {
|
||||
margin-top: 1em;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,9 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Version information
|
||||
*
|
||||
* @package tool
|
||||
* @package report
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -25,6 +24,5 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011092500;
|
||||
$plugin->requires = 2011092100;
|
||||
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->version = 2011041900;
|
||||
$plugin->requires = 2010120700;
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
// just a link to course report
|
||||
$ADMIN->add('reports', new admin_externalpage('reportlog', get_string('log', 'admin'), "$CFG->wwwroot/course/report/log/index.php?id=".SITEID, 'coursereport/log:view'));
|
||||
$ADMIN->add('reports', new admin_externalpage('reportloglive', get_string('loglive', 'coursereport_log'), "$CFG->wwwroot/course/report/log/indexlive.php?id=".SITEID, 'coursereport/log:viewlive'));
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,9 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Profiling tool.
|
||||
*
|
||||
* @package tool
|
||||
* @package core
|
||||
* @subpackage profiling
|
||||
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -25,9 +24,7 @@
|
||||
|
||||
// TODO: Move all the DB stuff to profiling_db_xxxx() function in xhprof_moodle.php
|
||||
|
||||
// TODO: it is wrong when core lib references ANY plugin lang strings, maybe more login could be moved here (skodak)
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
|
||||
|
||||
@@ -44,11 +41,11 @@ $runcomment = optional_param('runcomment', null, PARAM_TEXT);
|
||||
$dbfields = 'runid, url, totalexecutiontime, totalcputime, ' .
|
||||
'totalcalls, totalmemory, runreference, runcomment, timecreated';
|
||||
|
||||
admin_externalpage_setup('toolprofiling');
|
||||
admin_externalpage_setup('reportprofiling');
|
||||
|
||||
// Always add listurl if available
|
||||
if ($listurl) {
|
||||
$listurlnav = new moodle_url('/admin/tool/profiling/index.php', array('listurl' => $listurl));
|
||||
$listurlnav = new moodle_url('/admin/report/profiling/index.php', array('listurl' => $listurl));
|
||||
$PAGE->navbar->add($listurl, $listurlnav);
|
||||
}
|
||||
|
||||
@@ -68,7 +65,7 @@ if (isset($script)) {
|
||||
|
||||
// No run found for script, warn and exit
|
||||
if (!$run) {
|
||||
notice(get_string('cannotfindanyrunforurl', 'tool_profiling', $script), 'index.php');
|
||||
notice(get_string('cannotfindanyrunforurl', 'report_profiling', $script), 'index.php');
|
||||
}
|
||||
|
||||
// Check if there is any previous run marked as reference one
|
||||
@@ -78,7 +75,7 @@ if (isset($script)) {
|
||||
'timecreated DESC', 'runid', 0, 1);
|
||||
$prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
$header = get_string('lastrunof', 'tool_profiling', $script);
|
||||
$header = get_string('lastrunof', 'report_profiling', $script);
|
||||
echo $OUTPUT->heading($header);
|
||||
$table = profiling_print_run($run, $prevrunid);
|
||||
echo $table;
|
||||
@@ -96,7 +93,7 @@ if (isset($script)) {
|
||||
$run2 = $runtemp;
|
||||
}
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
$header = get_string('differencesbetween2runsof', 'tool_profiling', $run1->url);
|
||||
$header = get_string('differencesbetween2runsof', 'report_profiling', $run1->url);
|
||||
echo $OUTPUT->heading($header);
|
||||
$table = profiling_print_rundiff($run1, $run2);
|
||||
echo $table;
|
||||
@@ -120,7 +117,7 @@ if (isset($script)) {
|
||||
|
||||
// No run found for runid, warn and exit
|
||||
if (!$run) {
|
||||
notice(get_string('cannotfindanyrunforrunid', 'tool_profiling', $runid), 'index.php');
|
||||
notice(get_string('cannotfindanyrunforrunid', 'report_profiling', $runid), 'index.php');
|
||||
}
|
||||
|
||||
// Check if there is any previous run marked as reference one
|
||||
@@ -130,7 +127,7 @@ if (isset($script)) {
|
||||
'timecreated DESC', 'runid', 0, 1);
|
||||
$prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
$header = get_string('summaryof', 'tool_profiling', $run->url);
|
||||
$header = get_string('summaryof', 'report_profiling', $run->url);
|
||||
echo $OUTPUT->heading($header);
|
||||
$table = profiling_print_run($run, $prevrunid);
|
||||
echo $table;
|
||||
@@ -142,17 +139,17 @@ if (isset($script)) {
|
||||
|
||||
// The flexitable that will root listings
|
||||
$table = new xhprof_table_sql('profiling-list-table');
|
||||
$baseurl = $CFG->wwwroot . '/'.$CFG->admin.'/tool/profiling/index.php';
|
||||
$baseurl = $CFG->wwwroot . '/admin/report/profiling/index.php';
|
||||
|
||||
// Check if we are listing all or some URL ones
|
||||
$sqlconditions = '';
|
||||
$sqlparams = array();
|
||||
if (!isset($listurl)) {
|
||||
$header = get_string('pluginname', 'tool_profiling');
|
||||
$header = get_string('pluginname', 'report_profiling');
|
||||
$sqlconditions = '1 = 1';
|
||||
$table->set_listurlmode(false);
|
||||
} else {
|
||||
$header = get_string('profilingrunsfor', 'tool_profiling', $listurl);
|
||||
$header = get_string('profilingrunsfor', 'report_profiling', $listurl);
|
||||
$sqlconditions = 'url = :url';
|
||||
$sqlparams['url'] = $listurl;
|
||||
$table->set_listurlmode(true);
|
||||
@@ -170,9 +167,9 @@ if (isset($script)) {
|
||||
'url', 'timecreated', 'totalexecutiontime', 'totalcputime',
|
||||
'totalcalls', 'totalmemory', 'runcomment');
|
||||
$headers = array(
|
||||
get_string('url'), get_string('date'), get_string('executiontime', 'tool_profiling'),
|
||||
get_string('cputime', 'tool_profiling'), get_string('calls', 'tool_profiling'),
|
||||
get_string('memory', 'tool_profiling'), get_string('comment', 'tool_profiling'));
|
||||
get_string('url'), get_string('date'), get_string('executiontime', 'report_profiling'),
|
||||
get_string('cputime', 'report_profiling'), get_string('calls', 'report_profiling'),
|
||||
get_string('memory', 'report_profiling'), get_string('comment', 'report_profiling'));
|
||||
$table->define_columns($columns);
|
||||
$table->define_headers($headers);
|
||||
$table->sortable(true, 'timecreated', SORT_DESC);
|
||||
+4
-5
@@ -16,12 +16,11 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_profiling', language 'en', branch 'MOODLE_22_STABLE'
|
||||
* Strings for component 'report_profiling', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage profiling
|
||||
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_profiling
|
||||
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['calls'] = 'Function calls';
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
// profiling report, added to development
|
||||
if (extension_loaded('xhprof') && function_exists('xhprof_enable') && (!empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled))) {
|
||||
$ADMIN->add('development', new admin_externalpage('reportprofiling', get_string('pluginname', 'report_profiling'), "$CFG->wwwroot/$CFG->admin/report/profiling/index.php", 'moodle/site:config'));
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/* report_profiling styles */
|
||||
|
||||
.path-admin-report-profiling .profilingruntable .label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.path-admin-report-profiling .profiling_worse {
|
||||
color: red;
|
||||
}
|
||||
.path-admin-report-profiling .profiling_better {
|
||||
color: green;
|
||||
}
|
||||
.path-admin-report-profiling .profiling_same {
|
||||
color: dimgrey;
|
||||
}
|
||||
.path-admin-report-profiling .profiling_important,
|
||||
.path-admin-report-profiling .flexible .referencerun {
|
||||
font-weight: bold;
|
||||
}
|
||||
.path-admin-report-profiling .flexible .r1 .cell {
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
.path-admin-report-profiling .flexible {
|
||||
margin-left:auto;
|
||||
margin-right:auto
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'report/questioninstances:view' => array(
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:config',
|
||||
)
|
||||
);
|
||||
@@ -1,29 +1,13 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* For a given question type, list the number of
|
||||
*
|
||||
* @package report
|
||||
* @subpackage questioninstances
|
||||
* @copyright 2008 Tim Hunt
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package roles
|
||||
*/
|
||||
|
||||
require(dirname(__FILE__).'/../../config.php');
|
||||
/** */
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/questionlib.php');
|
||||
|
||||
@@ -62,39 +46,32 @@ if ($requestedqtype) {
|
||||
|
||||
// Work out the bits needed for the SQL WHERE clauses.
|
||||
if ($requestedqtype == 'missingtype') {
|
||||
$title = get_string('reportformissingqtypes', 'report_questioninstances');
|
||||
|
||||
$othertypes = array_keys($qtypes);
|
||||
$key = array_search('missingtype', $othertypes);
|
||||
unset($othertypes[$key]);
|
||||
list($sqlqtypetest, $params) = $DB->get_in_or_equal($othertypes, SQL_PARAMS_QM, '', false);
|
||||
$sqlqtypetest = 'WHERE qtype ' . $sqlqtypetest;
|
||||
|
||||
$title = get_string('reportformissingqtypes', 'report_questioninstances');
|
||||
} else if ($requestedqtype == '_all_') {
|
||||
$title = get_string('reportforallqtypes', 'report_questioninstances');
|
||||
|
||||
$sqlqtypetest = '';
|
||||
$params = array();
|
||||
|
||||
$title = get_string('reportforallqtypes', 'report_questioninstances');
|
||||
} else {
|
||||
$title = get_string('reportforqtype', 'report_questioninstances',
|
||||
question_bank::get_qtype($requestedqtype)->local_name());
|
||||
|
||||
$sqlqtypetest = 'WHERE qtype = ?';
|
||||
$params = array($requestedqtype);
|
||||
$title = get_string('reportforqtype', 'report_questioninstances',
|
||||
question_bank::get_qtype($requestedqtype)->local_name());
|
||||
}
|
||||
|
||||
// Get the question counts, and all the context information, for each
|
||||
// context. That is, rows of these results can be used as $context objects.
|
||||
$ctxpreload = context_helper::get_preload_record_columns_sql('con');
|
||||
$ctxgroupby = implode(',', array_keys(context_helper::get_preload_record_columns('con')));
|
||||
$counts = $DB->get_records_sql("
|
||||
SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, $ctxpreload
|
||||
SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, con.id, con.contextlevel, con.instanceid, con.path, con.depth
|
||||
FROM {question} q
|
||||
JOIN {question_categories} qc ON q.category = qc.id
|
||||
JOIN {context} con ON con.id = qc.contextid
|
||||
$sqlqtypetest
|
||||
GROUP BY qc.contextid, $ctxgroupby
|
||||
GROUP BY contextid, con.id, con.contextlevel, con.instanceid, con.path, con.depth
|
||||
ORDER BY numquestions DESC, numhidden ASC, con.contextlevel ASC, con.id ASC", $params);
|
||||
|
||||
// Print the report heading.
|
||||
@@ -117,10 +94,8 @@ if ($requestedqtype) {
|
||||
$totalhidden = 0;
|
||||
foreach ($counts as $count) {
|
||||
// Work out a link for editing questions in this context.
|
||||
context_helper::preload_from_record($count);
|
||||
$context = context::instance_by_id($count->contextid);
|
||||
$contextname = $context->get_context_name();
|
||||
$url = question_edit_url($context);
|
||||
$contextname = print_context_name($count);
|
||||
$url = question_edit_url($count);
|
||||
if ($url) {
|
||||
$contextname = '<a href="' . $url . '" title="' .
|
||||
get_string('editquestionshere', 'report_questioninstances') .
|
||||
+5
-5
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,12 +16,11 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* lang strings
|
||||
* Strings for component 'report_questioninstances', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package report
|
||||
* @subpackage questioninstances
|
||||
* @copyright 2008 Tim Hunt
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_questioninstances
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['editquestionshere'] = 'Edit questions in this context';
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('reportquestioninstances', get_string('pluginname', 'report_questioninstances'), "$CFG->wwwroot/$CFG->admin/report/questioninstances/index.php", 'report/questioninstances:view'));
|
||||
@@ -0,0 +1,27 @@
|
||||
<?PHP
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2010090501;
|
||||
$plugin->requires = 2010090501;
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'report/security:view' => array(
|
||||
'riskbitmask' => RISK_CONFIG,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -1,32 +1,32 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Security overview report
|
||||
*
|
||||
* @package report
|
||||
* @subpackage security
|
||||
* @copyright 2008 petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.org //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../../config.php');
|
||||
require_once($CFG->dirroot.'/report/security/locallib.php');
|
||||
require_once('../../../config.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/security/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
require_login();
|
||||
@@ -69,7 +69,7 @@ $statusarr = array(REPORT_SECURITY_OK => $strok,
|
||||
REPORT_SECURITY_SERIOUS => $strserious,
|
||||
REPORT_SECURITY_CRITICAL => $strcritical);
|
||||
|
||||
$url = "$CFG->wwwroot/report/security/index.php";
|
||||
$url = "$CFG->wwwroot/$CFG->admin/report/security/index.php";
|
||||
|
||||
if ($issue and ($result = $issue(true))) {
|
||||
report_security_hide_timearning();
|
||||
@@ -88,7 +88,7 @@ if ($issue and ($result = $issue(true))) {
|
||||
$row[2] = $result->info;
|
||||
$row[3] = is_null($result->link) ? ' ' : $result->link;
|
||||
|
||||
$PAGE->set_docs_path('report/security/' . $issue);
|
||||
$PAGE->set_docs_path('admin/report/security/' . $issue);
|
||||
|
||||
$table->data[] = $row;
|
||||
|
||||
+5
-5
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,12 +16,11 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Lang strings
|
||||
* Strings for component 'report_security', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package report
|
||||
* @subpackage security
|
||||
* @copyright 2008 petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_security
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['configuration'] = 'Configuration';
|
||||
@@ -1,29 +1,29 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Lib functions
|
||||
*
|
||||
* @package report
|
||||
* @subpackage security
|
||||
* @copyright 2008 petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.org //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
require_once("$CFG->libdir/adminlib.php");
|
||||
|
||||
|
||||
define('REPORT_SECURITY_OK', 'ok');
|
||||
@@ -752,7 +752,7 @@ function report_security_check_riskadmin($detailed=false) {
|
||||
$url = "$CFG->wwwroot/user/view.php?id=$user->id";
|
||||
$admins[$uid] = '<li><a href="'.$url.'">'.fullname($user).' ('.$user->email.')</a></li>';
|
||||
}
|
||||
$admins = '<ul>'.implode('', $admins).'</ul>';
|
||||
$admins = '<ul>'.implode($admins).'</ul>';
|
||||
}
|
||||
|
||||
$result->status = REPORT_SECURITY_OK;
|
||||
@@ -856,7 +856,7 @@ function report_security_check_riskbackup($detailed=false) {
|
||||
$role->url = "$CFG->wwwroot/$CFG->admin/roles/override.php?contextid=$role->contextid&roleid=$role->id";
|
||||
$links[] = '<li>'.get_string('check_riskbackup_editoverride', 'report_security', $role).'</li>';
|
||||
}
|
||||
$links = '<ul>'.implode('', $links).'</ul>';
|
||||
$links = '<ul>'.implode($links).'</ul>';
|
||||
$result->details .= get_string('check_riskbackup_details_overriddenroles', 'report_security', $links);
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ function report_security_check_riskbackup($detailed=false) {
|
||||
$users[] = '<li>'.get_string('check_riskbackup_unassign', 'report_security', $a).'</li>';
|
||||
}
|
||||
if (!empty($users)) {
|
||||
$users = '<ul>'.implode('', $users).'</ul>';
|
||||
$users = '<ul>'.implode($users).'</ul>';
|
||||
$result->details .= get_string('check_riskbackup_details_users', 'report_security', $users);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('reportsecurity', get_string('pluginname', 'report_security'), "$CFG->wwwroot/$CFG->admin/report/security/index.php",'report/security:view'));
|
||||
@@ -0,0 +1,27 @@
|
||||
<?PHP
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2010090501;
|
||||
$plugin->requires = 2010090501;
|
||||
@@ -40,7 +40,7 @@ $reset = optional_param('reset', '', PARAM_RAW);
|
||||
$id = optional_param('id', '', PARAM_INT);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('toolspamcleaner');
|
||||
admin_externalpage_setup('reportspamcleaner', '', null, '', array('pagelayout'=>'report'));
|
||||
|
||||
// Delete one user
|
||||
if (!empty($del) && confirm_sesskey() && ($id != $USER->id)) {
|
||||
@@ -79,14 +79,14 @@ if (!empty($ignore)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$PAGE->requires->js_init_call('M.tool_spamcleaner.init', array(me()), true);
|
||||
$PAGE->requires->js_init_call('M.report_spamcleaner.init', array(me()), true);
|
||||
$strings = Array('spaminvalidresult','spamdeleteallconfirm','spamcannotdelete','spamdeleteconfirm');
|
||||
$PAGE->requires->strings_for_js($strings, 'tool_spamcleaner');
|
||||
$PAGE->requires->strings_for_js($strings, 'report_spamcleaner');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Print headers and things
|
||||
echo $OUTPUT->box(get_string('spamcleanerintro', 'tool_spamcleaner'));
|
||||
echo $OUTPUT->box(get_string('spamcleanerintro', 'report_spamcleaner'));
|
||||
|
||||
echo $OUTPUT->box_start(); // The forms section at the top
|
||||
|
||||
@@ -96,19 +96,18 @@ echo $OUTPUT->box_start(); // The forms section at the top
|
||||
|
||||
<form method="post" action="index.php">
|
||||
<div>
|
||||
<label class="accesshide" for="keyword_el"><?php print_string('spamkeyword', 'tool_spamcleaner') ?></label>
|
||||
<input type="text" name="keyword" id="keyword_el" value="<?php p($keyword) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
|
||||
<input type="submit" value="<?php echo get_string('spamsearch', 'tool_spamcleaner')?>" />
|
||||
<input type="submit" value="<?php echo get_string('spamsearch', 'report_spamcleaner')?>" />
|
||||
</div>
|
||||
</form>
|
||||
<p><?php echo get_string('spameg', 'tool_spamcleaner');?></p>
|
||||
<p><?php echo get_string('spameg', 'report_spamcleaner');?></p>
|
||||
|
||||
<hr />
|
||||
|
||||
<form method="post" action="index.php">
|
||||
<div>
|
||||
<input type="submit" name="autodetect" value="<?php echo get_string('spamauto', 'tool_spamcleaner');?>" />
|
||||
<input type="submit" name="autodetect" value="<?php echo get_string('spamauto', 'report_spamcleaner');?>" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -158,54 +157,21 @@ function search_spammers($keywords) {
|
||||
$params['descpat'.$i] = "%$keyword%";
|
||||
$keywordfull2[] = $DB->sql_like('p.summary', ':sumpat'.$i, false);
|
||||
$params['sumpat'.$i] = "%$keyword%";
|
||||
$keywordfull3[] = $DB->sql_like('p.subject', ':subpat'.$i, false);
|
||||
$params['subpat'.$i] = "%$keyword%";
|
||||
$keywordfull4[] = $DB->sql_like('c.content', ':contpat'.$i, false);
|
||||
$params['contpat'.$i] = "%$keyword%";
|
||||
$keywordfull5[] = $DB->sql_like('m.fullmessage', ':msgpat'.$i, false);
|
||||
$params['msgpat'.$i] = "%$keyword%";
|
||||
$keywordfull6[] = $DB->sql_like('fp.message', ':forumpostpat'.$i, false);
|
||||
$params['forumpostpat'.$i] = "%$keyword%";
|
||||
$keywordfull7[] = $DB->sql_like('fp.subject', ':forumpostsubpat'.$i, false);
|
||||
$params['forumpostsubpat'.$i] = "%$keyword%";
|
||||
$i++;
|
||||
}
|
||||
$conditions = '( '.implode(' OR ', $keywordfull).' )';
|
||||
$conditions2 = '( '.implode(' OR ', $keywordfull2).' )';
|
||||
$conditions3 = '( '.implode(' OR ', $keywordfull3).' )';
|
||||
$conditions4 = '( '.implode(' OR ', $keywordfull4).' )';
|
||||
$conditions5 = '( '.implode(' OR ', $keywordfull5).' )';
|
||||
$conditions6 = '( '.implode(' OR ', $keywordfull6).' )';
|
||||
$conditions7 = '( '.implode(' OR ', $keywordfull7).' )';
|
||||
|
||||
$sql = "SELECT * FROM {user} WHERE deleted = 0 AND id <> :userid AND $conditions"; // Exclude oneself
|
||||
$sql2 = "SELECT u.*, p.summary FROM {user} AS u, {post} AS p WHERE $conditions2 AND u.deleted = 0 AND u.id=p.userid AND u.id <> :userid";
|
||||
$sql3 = "SELECT u.*, p.subject as postsubject FROM {user} AS u, {post} AS p WHERE $conditions3 AND u.deleted = 0 AND u.id=p.userid AND u.id <> :userid";
|
||||
$sql4 = "SELECT u.*, c.content FROM {user} AS u, {comments} AS c WHERE $conditions4 AND u.deleted = 0 AND u.id=c.userid AND u.id <> :userid";
|
||||
$sql5 = "SELECT u.*, m.fullmessage FROM {user} AS u, {message} AS m WHERE $conditions5 AND u.deleted = 0 AND u.id=m.useridfrom AND u.id <> :userid";
|
||||
$sql6 = "SELECT u.*, fp.message FROM {user} AS u, {forum_posts} AS fp WHERE $conditions6 AND u.deleted = 0 AND u.id=fp.userid AND u.id <> :userid";
|
||||
$sql7 = "SELECT u.*, fp.subject FROM {user} AS u, {forum_posts} AS fp WHERE $conditions7 AND u.deleted = 0 AND u.id=fp.userid AND u.id <> :userid";
|
||||
|
||||
$spamusers_desc = $DB->get_recordset_sql($sql, $params);
|
||||
$spamusers_blog = $DB->get_recordset_sql($sql2, $params);
|
||||
$spamusers_blogsub = $DB->get_recordset_sql($sql3, $params);
|
||||
$spamusers_comment = $DB->get_recordset_sql($sql4, $params);
|
||||
$spamusers_message = $DB->get_recordset_sql($sql5, $params);
|
||||
$spamusers_forumpost = $DB->get_recordset_sql($sql6, $params);
|
||||
$spamusers_forumpostsub = $DB->get_recordset_sql($sql7, $params);
|
||||
|
||||
$keywordlist = implode(', ', $keywords);
|
||||
echo $OUTPUT->box(get_string('spamresult', 'tool_spamcleaner').s($keywordlist)).' ...';
|
||||
echo $OUTPUT->box(get_string('spamresult', 'report_spamcleaner').s($keywordlist)).' ...';
|
||||
|
||||
print_user_list(array($spamusers_desc, $spamusers_blog), $keywords);
|
||||
|
||||
print_user_list(array($spamusers_desc,
|
||||
$spamusers_blog,
|
||||
$spamusers_blogsub,
|
||||
$spamusers_comment,
|
||||
$spamusers_message,
|
||||
$spamusers_forumpost,
|
||||
$spamusers_forumpostsub
|
||||
),
|
||||
$keywords);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +186,7 @@ function print_user_list($users_rs, $keywords) {
|
||||
foreach ($users_rs as $rs){
|
||||
foreach ($rs as $user) {
|
||||
if (!$count) {
|
||||
echo '<table border="1" width="100%" id="data-grid"><tr><th> </th><th>'.get_string('user','admin').'</th><th>'.get_string('spamdesc', 'tool_spamcleaner').'</th><th>'.get_string('spamoperation', 'tool_spamcleaner').'</th></tr>';
|
||||
echo '<table border="1" width="100%" id="data-grid"><tr><th> </th><th>'.get_string('user','admin').'</th><th>'.get_string('spamdesc', 'report_spamcleaner').'</th><th>'.get_string('spamoperation', 'report_spamcleaner').'</th></tr>';
|
||||
}
|
||||
$count++;
|
||||
filter_user($user, $keywords, $count);
|
||||
@@ -228,12 +194,12 @@ function print_user_list($users_rs, $keywords) {
|
||||
}
|
||||
|
||||
if (!$count) {
|
||||
echo get_string('spamcannotfinduser', 'tool_spamcleaner');
|
||||
echo get_string('spamcannotfinduser', 'report_spamcleaner');
|
||||
|
||||
} else {
|
||||
echo '</table>';
|
||||
echo '<div class="mld-align">
|
||||
<button id="removeall_btn">'.get_string('spamdeleteall', 'tool_spamcleaner').'</button>
|
||||
<button id="removeall_btn">'.get_string('spamdeleteall', 'report_spamcleaner').'</button>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
@@ -244,25 +210,9 @@ function filter_user($user, $keywords, $count) {
|
||||
$image_search = true;
|
||||
}
|
||||
if (isset($user->summary)) {
|
||||
$user->description = '<h3>'.get_string('spamfromblog', 'tool_spamcleaner').'</h3>'.$user->summary;
|
||||
$user->description = '<h3>'.get_string('spamfromblog', 'report_spamcleaner').'</h3>'.$user->summary;
|
||||
unset($user->summary);
|
||||
} else if (isset($user->postsubject)) {
|
||||
$user->description = '<h3>'.get_string('spamfromblog', 'tool_spamcleaner').'</h3>'.$user->postsubject;
|
||||
unset($user->postsubject);
|
||||
} else if (isset($user->content)) {
|
||||
$user->description = '<h3>'.get_string('spamfromcomments', 'tool_spamcleaner').'</h3>'.$user->content;
|
||||
unset($user->content);
|
||||
} else if (isset($user->fullmessage)) {
|
||||
$user->description = '<h3>'.get_string('spamfrommessages', 'tool_spamcleaner').'</h3>'.$user->fullmessage;
|
||||
unset($user->fullmessage);
|
||||
} else if (isset($user->message)) {
|
||||
$user->description = '<h3>'.get_string('spamfromforumpost', 'tool_spamcleaner').'</h3>'.$user->message;
|
||||
unset($user->message);
|
||||
} else if (isset($user->subject)) {
|
||||
$user->description = '<h3>'.get_string('spamfromforumpost', 'tool_spamcleaner').'</h3>'.$user->subject;
|
||||
unset($user->subject);
|
||||
}
|
||||
|
||||
if (preg_match('#<img.*src=[\"\']('.$CFG->wwwroot.')#', $user->description, $matches)
|
||||
&& $image_search) {
|
||||
$result = false;
|
||||
@@ -321,8 +271,8 @@ function print_user_entry($user, $keywords, $count) {
|
||||
|
||||
$html .= '<td align="left">'.format_text($user->description, $user->descriptionformat, array('overflowdiv'=>true)).'</td>';
|
||||
$html .= '<td width="100px" align="center">';
|
||||
$html .= '<button onclick="M.tool_spamcleaner.del_user(this,'.$user->id.')">'.get_string('deleteuser', 'admin').'</button><br />';
|
||||
$html .= '<button onclick="M.tool_spamcleaner.ignore_user(this,'.$user->id.')">'.get_string('ignore', 'admin').'</button>';
|
||||
$html .= '<button onclick="M.report_spamcleaner.del_user(this,'.$user->id.')">'.get_string('deleteuser', 'admin').'</button><br />';
|
||||
$html .= '<button onclick="M.report_spamcleaner.ignore_user(this,'.$user->id.')">'.get_string('ignore', 'admin').'</button>';
|
||||
$html .= '</td>';
|
||||
$html .= '</tr>';
|
||||
return $html;
|
||||
+5
-9
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,12 +16,11 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_spamcleaner', language 'en', branch 'MOODLE_22_STABLE'
|
||||
* Strings for component 'report_spamcleaner', language 'en', branch 'MOODLE_20_STABLE'
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage spamcleaner
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package report_spamcleaner
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['pluginname'] = 'Spam cleaner';
|
||||
@@ -34,11 +34,7 @@ $string['spamdeleteconfirm'] = 'Are you sure you want to delete this entry? You
|
||||
$string['spamdesc'] = 'Description';
|
||||
$string['spameg'] = 'eg: casino, porn, xxx';
|
||||
$string['spamfromblog'] = 'From blog post:';
|
||||
$string['spamfromcomments'] = 'From comments:';
|
||||
$string['spamfrommessages'] = 'From messages:';
|
||||
$string['spamfromforumpost'] = 'From forum post:';
|
||||
$string['spaminvalidresult'] = 'Unknown but invalid result';
|
||||
$string['spamkeyword'] = 'Keyword';
|
||||
$string['spamoperation'] = 'Operation';
|
||||
$string['spamresult'] = 'Results of searching user profiles containing:';
|
||||
$string['spamsearch'] = 'Search for these keywords';
|
||||
@@ -1,12 +1,12 @@
|
||||
M.tool_spamcleaner = {
|
||||
M.report_spamcleaner = {
|
||||
Y: null,
|
||||
row: null,
|
||||
me: null,
|
||||
|
||||
del_all: function() {
|
||||
var context = M.tool_spamcleaner;
|
||||
var context = M.report_spamcleaner;
|
||||
|
||||
var yes = confirm(M.str.tool_spamcleaner.spamdeleteallconfirm);
|
||||
var yes = confirm(M.str.report_spamcleaner.spamdeleteallconfirm);
|
||||
if (yes) {
|
||||
var cfg = {
|
||||
method: "POST",
|
||||
@@ -15,7 +15,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (resp == true) {
|
||||
@@ -29,14 +29,14 @@ M.tool_spamcleaner = {
|
||||
},
|
||||
|
||||
del_user: function(obj, id) {
|
||||
var context = M.tool_spamcleaner;
|
||||
var context = M.report_spamcleaner;
|
||||
|
||||
if (context.Y == null) {
|
||||
// not initialised yet
|
||||
return;
|
||||
}
|
||||
|
||||
var yes = confirm(M.str.tool_spamcleaner.spamdeleteconfirm);
|
||||
var yes = confirm(M.str.report_spamcleaner.spamdeleteconfirm);
|
||||
if (yes) {
|
||||
context.row = obj;
|
||||
var cfg = {
|
||||
@@ -46,7 +46,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
@@ -57,7 +57,7 @@ M.tool_spamcleaner = {
|
||||
context.row.parentNode.removeChild(context.row);
|
||||
context.row = null;
|
||||
} else {
|
||||
alert(M.str.tool_spamcleaner.spamcannotdelete);
|
||||
alert(M.str.report_spamcleaner.spamcannotdelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ M.tool_spamcleaner = {
|
||||
},
|
||||
|
||||
ignore_user: function(obj, id) {
|
||||
var context = M.tool_spamcleaner;
|
||||
var context = M.report_spamcleaner;
|
||||
|
||||
if (context.Y == null) {
|
||||
// not initilised yet
|
||||
@@ -83,7 +83,7 @@ M.tool_spamcleaner = {
|
||||
try {
|
||||
var resp = context.Y.JSON.parse(o.responseText);
|
||||
} catch(e) {
|
||||
alert(M.str.tool_spamcleaner.spaminvalidresult);
|
||||
alert(M.str.report_spamcleaner.spaminvalidresult);
|
||||
return;
|
||||
}
|
||||
if (context.row) {
|
||||
@@ -102,9 +102,9 @@ M.tool_spamcleaner = {
|
||||
},
|
||||
|
||||
init: function(Y, me) {
|
||||
var context = M.tool_spamcleaner;
|
||||
var context = M.report_spamcleaner;
|
||||
|
||||
Y.use('json', 'io-base', function (Y) {
|
||||
Y.use('json', 'io', function (Y) {
|
||||
context.Y = Y;
|
||||
context.me = me;
|
||||
if (Y.one("#removeall_btn")) {
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
// spam cleaner
|
||||
$ADMIN->add('reports', new admin_externalpage('reportspamcleaner', get_string('pluginname', 'report_spamcleaner'), "$CFG->wwwroot/$CFG->admin/report/spamcleaner/index.php", 'moodle/site:config'));
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
// just a link to course report
|
||||
$ADMIN->add('reports', new admin_externalpage('reportstats', get_string('stats', 'admin'), "$CFG->wwwroot/course/report/stats/index.php", 'coursereport/stats:view'));
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -20,8 +21,8 @@
|
||||
* Syntax: coveragefile.php/path/to/file/file.html
|
||||
* coveragefile.php?file=path/to/file/file.html
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage unittest
|
||||
* @package moodlecore
|
||||
* @subpackage simpletestcoverage
|
||||
* @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
@@ -29,12 +30,12 @@
|
||||
// disable moodle specific debug messages and any errors in output
|
||||
define('NO_DEBUG_DISPLAY', true);
|
||||
|
||||
require(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
// basic security, require login + require site config cap
|
||||
require_login();
|
||||
require_capability('tool/unittest:execute', get_context_instance(CONTEXT_SYSTEM));
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
// get file requested
|
||||
$relativepath = get_file_argument();
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
||||
// //
|
||||
// This program 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 2 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program 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: //
|
||||
// //
|
||||
// http://www.gnu.org/copyleft/gpl.html //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'report/unittest:view' => array(
|
||||
'riskbitmask' => RISK_DATALOSS,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:config',
|
||||
)
|
||||
);
|
||||
@@ -1,43 +1,23 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Run database functional tests.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage unittest
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package SimpleTestEx
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once('simpletestlib.php');
|
||||
require_once('simpletestcoveragelib.php');
|
||||
require_once($CFG->libdir.'/simpletestcoveragelib.php');
|
||||
require_once('ex_simple_test.php');
|
||||
require_once('ex_reporter.php');
|
||||
|
||||
$showpasses = optional_param('showpasses', false, PARAM_BOOL);
|
||||
$codecoverage = optional_param('codecoverage', false, PARAM_BOOL);
|
||||
$selected = optional_param_array('selected', array(), PARAM_INT);
|
||||
$selected = optional_param('selected', array(), PARAM_INT);
|
||||
|
||||
// Print the header and check access.
|
||||
admin_externalpage_setup('tooldbtest');
|
||||
admin_externalpage_setup('reportdbtest');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
global $UNITTEST;
|
||||
@@ -128,11 +108,11 @@ echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
echo '<form method="post" action="dbtest.php">';
|
||||
echo '<div>';
|
||||
echo $OUTPUT->heading("Run functional database tests"); // TODO: localise
|
||||
echo '<p>'.html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'tool_unittest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'simpletest')).'</p>';
|
||||
if (moodle_coverage_recorder::can_run_codecoverage()) {
|
||||
echo '<p>'.html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'tool_unittest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'simpletest')).'</p>';
|
||||
} else {
|
||||
echo '<p>'; print_string('codecoveragedisabled', 'tool_unittest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>';
|
||||
echo '<p>'; print_string('codecoveragedisabled', 'simpletest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>';
|
||||
}
|
||||
echo '<p><strong>'."Databases:".'</strong></p>';
|
||||
echo '<ul>';
|
||||
@@ -154,7 +134,7 @@ $CFG->func_test_db_1 = array("native", "pgsql", "localhost", "moodleuser", "pass
|
||||
$CFG->func_test_db_2 = array("native", "mssql", "localhost", "moodleuser", "password", "moodle", "test", null);
|
||||
</pre>
|
||||
<p>where order of parameters is: dblibrary, dbtype, dbhost, dbuser, dbpass, dbname, prefix, dboptions</p>';
|
||||
echo '<p><input type="submit" value="' . get_string('runtests', 'tool_unittest') . '" /></p>';
|
||||
echo '<p><input type="submit" value="' . get_string('runtests', 'simpletest') . '" /></p>';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
echo $OUTPUT->box_end();
|
||||
@@ -1,27 +1,11 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* A SimpleTest report format for Moodle.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage unittest
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package SimpleTestEx
|
||||
*/
|
||||
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
@@ -180,7 +164,7 @@ class ExHtmlReporter extends HtmlReporter {
|
||||
foreach ($stacktrace as $frame) {
|
||||
if (empty($frame['file']) || (strpos($frame['file'], 'simpletestlib') === false &&
|
||||
strpos($frame['file'], 'simpletestcoveragelib') === false
|
||||
&& strpos($frame['file'], 'tool/unittest') === false)) {
|
||||
&& strpos($frame['file'], 'report/unittest') === false)) {
|
||||
$filteredstacktrace[] = $frame;
|
||||
$interestinglines += 1;
|
||||
$dotsadded = false;
|
||||
@@ -287,11 +271,6 @@ class ExHtmlReporter extends HtmlReporter {
|
||||
* Look up a lang string in the appropriate file.
|
||||
*/
|
||||
function get_string($identifier, $a = NULL) {
|
||||
return get_string($identifier, 'tool_unittest', $a);
|
||||
}
|
||||
|
||||
function _htmlEntities($message) {
|
||||
// Override subclass message that breaks UTF8.
|
||||
return s($message);
|
||||
return get_string($identifier, 'simpletest', $a);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +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/>.
|
||||
|
||||
/**
|
||||
* A SimpleTest GroupTest that automatically finds all the
|
||||
* test files in a directory tree according to certain rules.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage unittest
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package SimpleTestEx
|
||||
*/
|
||||
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
@@ -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/>.
|
||||
|
||||
/**
|
||||
* Run the unit tests.
|
||||
*
|
||||
* @package tool
|
||||
* @subpackage unittest
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @copyright © 2006 The Open University
|
||||
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package SimpleTestEx
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once(dirname(__FILE__).'/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once('simpletestlib.php');
|
||||
require_once('simpletestcoveragelib.php');
|
||||
require_once($CFG->libdir.'/simpletestcoveragelib.php');
|
||||
require_once('ex_simple_test.php');
|
||||
require_once('ex_reporter.php');
|
||||
|
||||
@@ -44,7 +27,7 @@ $showpasses = optional_param('showpasses', false, PARAM_BOOL);
|
||||
$codecoverage = optional_param('codecoverage', false, PARAM_BOOL);
|
||||
$showsearch = optional_param('showsearch', false, PARAM_BOOL);
|
||||
|
||||
admin_externalpage_setup('toolsimpletest', '', array('showpasses'=>$showpasses, 'showsearch'=>$showsearch));
|
||||
admin_externalpage_setup('reportsimpletest', '', array('showpasses'=>$showpasses, 'showsearch'=>$showsearch));
|
||||
|
||||
$unittest = true;
|
||||
|
||||
@@ -58,7 +41,7 @@ $UNITTEST = new stdClass();
|
||||
define('TIME_ALLOWED_PER_UNIT_TEST', 60);
|
||||
|
||||
// Print the header.
|
||||
$strtitle = get_string('unittests', 'tool_unittest');
|
||||
$strtitle = get_string('unittests', 'simpletest');
|
||||
|
||||
if (!is_null($path)) {
|
||||
//trim so user doesn't get an error if they include a space on the end of the path (ie by pasting path)
|
||||
@@ -102,68 +85,48 @@ if (!is_null($path)) {
|
||||
} else if (is_dir($path)){
|
||||
$test->findTestFiles($path);
|
||||
} else {
|
||||
echo $OUTPUT->box(get_string('pathdoesnotexist', 'tool_unittest', $path), 'errorbox');
|
||||
echo $OUTPUT->box(get_string('pathdoesnotexist', 'simpletest', $path), 'errorbox');
|
||||
$ok = false;
|
||||
}
|
||||
|
||||
// If we have something to test, do it.
|
||||
if ($ok) {
|
||||
if ($path == $CFG->dirroot) {
|
||||
$title = get_string('moodleunittests', 'tool_unittest', get_string('all', 'tool_unittest'));
|
||||
$title = get_string('moodleunittests', 'simpletest', get_string('all', 'simpletest'));
|
||||
} else {
|
||||
$title = get_string('moodleunittests', 'tool_unittest', $displaypath);
|
||||
$title = get_string('moodleunittests', 'simpletest', $displaypath);
|
||||
}
|
||||
echo $OUTPUT->heading($title);
|
||||
$test->run($reporter);
|
||||
}
|
||||
|
||||
$formheader = get_string('retest', 'tool_unittest');
|
||||
$formheader = get_string('retest', 'simpletest');
|
||||
} else {
|
||||
$displaypath = '';
|
||||
echo $OUTPUT->header();
|
||||
$formheader = get_string('rununittests', 'tool_unittest');
|
||||
$formheader = get_string('rununittests', 'simpletest');
|
||||
}
|
||||
// Print the form for adjusting options.
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
echo $OUTPUT->heading($formheader);
|
||||
echo '<form method="get" action="index.php">';
|
||||
echo '<fieldset class="invisiblefieldset">';
|
||||
echo '<p>'.html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'tool_unittest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('showsearch', 1, $showsearch, get_string('showsearch', 'tool_unittest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'simpletest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('showsearch', 1, $showsearch, get_string('showsearch', 'simpletest')).'</p>';
|
||||
if (moodle_coverage_recorder::can_run_codecoverage()) {
|
||||
echo '<p>'.html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'tool_unittest')).'</p>';
|
||||
echo '<p>'.html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'simpletest')).'</p>';
|
||||
} else {
|
||||
echo '<p>'; print_string('codecoveragedisabled', 'tool_unittest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>';
|
||||
echo '<p>'; print_string('codecoveragedisabled', 'simpletest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>';
|
||||
}
|
||||
echo '<p>';
|
||||
echo '<label for="path">', get_string('onlytest', 'tool_unittest'), '</label> ';
|
||||
echo '<label for="path">', get_string('onlytest', 'simpletest'), '</label> ';
|
||||
echo '<input type="text" id="path" name="path" value="', $displaypath, '" size="40" />';
|
||||
echo '</p>';
|
||||
echo '<input type="submit" value="' . get_string('runtests', 'tool_unittest') . '" />';
|
||||
echo '<input type="submit" value="' . get_string('runtests', 'simpletest') . '" />';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
$otherpages = array();
|
||||
$otherpages['PDF lib test'] = new moodle_url('/admin/tool/unittest/other/pdflibtestpage.php');
|
||||
if (debugging('', DEBUG_DEVELOPER)) {
|
||||
$otherpages['TODO checker'] = new moodle_url('/admin/tool/unittest/other/todochecker.php');
|
||||
}
|
||||
|
||||
// print list of extra test pages that are not simpletests,
|
||||
// not everything there is good enough to show to our users
|
||||
if ($otherpages) {
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
echo $OUTPUT->heading(get_string('othertestpages', 'tool_unittest'));
|
||||
echo '<ul>';
|
||||
foreach ($otherpages as $name=>$url) {
|
||||
echo '<li>'.html_writer::link($url, $name).'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
|
||||
// Print link to latest code coverage for this report type
|
||||
if (is_null($path) || !$codecoverage) {
|
||||
moodle_coverage_reporter::print_link_to_latest('unittest');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user