Compare commits
1263 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d3704f293 | |||
| ce4126c7a9 | |||
| 48861429c7 | |||
| 6cf9033d8d | |||
| 94b0258dc3 | |||
| f818719f11 | |||
| 194c653a11 | |||
| 3782723995 | |||
| 6ba42caef7 | |||
| b37bb96b0f | |||
| ad9fee8416 | |||
| 1357fde409 | |||
| c0ba02d066 | |||
| 93af314f78 | |||
| a1f173f774 | |||
| 3a48019ea3 | |||
| ed88a0b815 | |||
| 8d716acba5 | |||
| f4e4ac8c59 | |||
| 329920fa22 | |||
| d6a84028e5 | |||
| 22f754bae6 | |||
| ffeebe6088 | |||
| 0bfc4d763a | |||
| 4b641eaf82 | |||
| 47b43d0b4c | |||
| d28da62e34 | |||
| 9d3f3b5093 | |||
| e71b8ccbd1 | |||
| 9d669d60bd | |||
| 73db83bfaa | |||
| 35f7fa3d36 | |||
| 5c85ac9572 | |||
| fee082d56c | |||
| 9622a33982 | |||
| fca1061612 | |||
| 8075bd8d8a | |||
| 4553925614 | |||
| 08546a8973 | |||
| 3bb5950c7e | |||
| fd1e4d5039 | |||
| 1cecb26b18 | |||
| 8b727da971 | |||
| 46d732c252 | |||
| 3416857d84 | |||
| 58d053313f | |||
| e0a57f8ccc | |||
| 3dde1fcafb | |||
| cc2a87e3fe | |||
| d0eeb25a64 | |||
| 0ee1c3db00 | |||
| 9a260ddd2c | |||
| fc3a00dc64 | |||
| 6e3ef95711 | |||
| 44835cdc8b | |||
| 81308ee649 | |||
| 1434fdf7a6 | |||
| daa44ab05e | |||
| 3464845868 | |||
| 390c3bc54a | |||
| ead5f3793b | |||
| b5907a8674 | |||
| 839e233f17 | |||
| d76ac3bab6 | |||
| 8a8f68ff97 | |||
| b969338742 | |||
| ba69b6952a | |||
| e1765762c2 | |||
| ceb66eb1fd | |||
| d68cf3877c | |||
| 9257815ff1 | |||
| 446dbeed7a | |||
| 5f5990903f | |||
| 0baa0a305d | |||
| 23caf506ba | |||
| 50223a8ae1 | |||
| 1fc08528c7 | |||
| 79c0996c64 | |||
| 923ea459d8 | |||
| ab01926c99 | |||
| 47a6c7ee31 | |||
| c821346cfe | |||
| b8fffc6128 | |||
| 08258a6dfb | |||
| cf1f0dfb43 | |||
| 8c19c9cfd0 | |||
| 76c51e3b9b | |||
| 48dd268c8d | |||
| d71590772f | |||
| 89d13f61ca | |||
| 5f250cff88 | |||
| 46c485a63c | |||
| 36e673a766 | |||
| 352476d131 | |||
| b5dd45511d | |||
| 5c487f23ae | |||
| 8a28dbd4e1 | |||
| 8589241024 | |||
| 525a4642cd | |||
| d25f6a8ecb | |||
| 1d6070951a | |||
| 958f4ff45f | |||
| 8d66adc9b8 | |||
| 186fe7abe9 | |||
| 80f9011c00 | |||
| 0742a01d54 | |||
| cbc6589769 | |||
| f46c9dd0f2 | |||
| 5a2d320ca6 | |||
| 3b1055ee4c | |||
| f7de3d4360 | |||
| 1e13c7b154 | |||
| ac05e65ef2 | |||
| c609c3968e | |||
| 7b969f0bb0 | |||
| 3691c0de24 | |||
| 4be12986aa | |||
| 2d3659da69 | |||
| 7c4e7f8fdf | |||
| ced892ebb2 | |||
| 6d8e40a429 | |||
| 2bda67fa52 | |||
| ead9fe0cdf | |||
| d97f2caf13 | |||
| f084d74ed1 | |||
| b795d69cc3 | |||
| f778133a99 | |||
| 6a726a9901 | |||
| 412ae7b629 | |||
| c3cc54fcce | |||
| 9fed35fb09 | |||
| 6e41a68058 | |||
| 65634948fa | |||
| 85427358fc | |||
| edb257109e | |||
| e89535552b | |||
| c08ea5202f | |||
| bd680d8a01 | |||
| 1ac84ccdfc | |||
| 661fc73a96 | |||
| 62c325eefe | |||
| e5a5ca2bcb | |||
| 595b68e2fd | |||
| 804feede10 | |||
| 93fb7b528b | |||
| d6f387e262 | |||
| a25ac01e95 | |||
| adca1840c4 | |||
| 54ba4bf583 | |||
| 403c191be1 | |||
| 69065330c4 | |||
| c8ad77f876 | |||
| 35eb31fa38 | |||
| dc52f193eb | |||
| e449096842 | |||
| 49eb5cf372 | |||
| 36ddd604b5 | |||
| 1399a5bc41 | |||
| 2547042fe6 | |||
| 5335b7deb8 | |||
| afa1de62b2 | |||
| d2db892076 | |||
| ddbc74866d | |||
| 80bc3d9880 | |||
| d4608845b2 | |||
| 4a979297aa | |||
| ce4ca89ef1 | |||
| 41d2e418a7 | |||
| 11990142b0 | |||
| 253b5f4d7e | |||
| 8858129c17 | |||
| 0656d45fbc | |||
| 98a4be5176 | |||
| b2fd3caea6 | |||
| 77b300ca51 | |||
| cb36e6ba4a | |||
| b182c1238e | |||
| fead3b432a | |||
| 877a07f709 | |||
| e0538fa845 | |||
| 41f8ca66e0 | |||
| a68b0363bf | |||
| 47860563bc | |||
| ade4de356e | |||
| 4494053b02 | |||
| 6c6042404a | |||
| 085cc4ef9a | |||
| b1d3043354 | |||
| dc201dce9e | |||
| 92a7892d42 | |||
| c2e8445bf1 | |||
| e6524dcbf9 | |||
| 2ed2d8c111 | |||
| e8a2384eb6 | |||
| 61231c48fa | |||
| b0a994f460 | |||
| bd8d0b81d6 | |||
| 999f7e3e17 | |||
| ec01a02d8b | |||
| e71b08c529 | |||
| d4341ff79c | |||
| 697f104ac1 | |||
| 167c8c6714 | |||
| d8c5082b76 | |||
| b054ead121 | |||
| 3f046db150 | |||
| d9cc6b7a31 | |||
| eb11030b38 | |||
| 43400d60de | |||
| 2719e7c8f9 | |||
| 767ed44ca4 | |||
| f24ff8f8d4 | |||
| 42bcf023b4 | |||
| c461a6a0a7 | |||
| bdd773ba40 | |||
| fcc24148d6 | |||
| 729ef69705 | |||
| 8c6bc1e000 | |||
| d6b01141a1 | |||
| 4f4bf67a31 | |||
| d0f6d6172a | |||
| 3ba909de87 | |||
| 97c0418e64 | |||
| a028969cc7 | |||
| cb2c45b31f | |||
| 65e5640a94 | |||
| f65eadd42d | |||
| ed9cc071d5 | |||
| 41b4bb03b2 | |||
| 18ca35b3fa | |||
| 17ee774fdf | |||
| 2de2d0d2cd | |||
| 94bea73f29 | |||
| a99a9a163e | |||
| d54abc73a1 | |||
| 46303d1deb | |||
| 0292c465fe | |||
| 12376c971f | |||
| 84c10aaa7c | |||
| fc0acdfacd | |||
| 59c0293d9e | |||
| 04b1865d44 | |||
| d2fbfb5f73 | |||
| f01c7ddc7c | |||
| 48e43c12e6 | |||
| f90a927b52 | |||
| 120aa6fd38 | |||
| 11c5042847 | |||
| 76fae9b6ab | |||
| 431c68a867 | |||
| 7b88b81a49 | |||
| 4b023f2a10 | |||
| 2be11d5faf | |||
| d6105bc1e1 | |||
| 7068811aa9 | |||
| 2c92dc7bab | |||
| 0971dd7939 | |||
| 5e9050d1fb | |||
| d55cca19cf | |||
| 0175c5efaa | |||
| 29e247e44e | |||
| 112bbb8ff4 | |||
| e4a8f90479 | |||
| 58db57ad53 | |||
| cf6b626f39 | |||
| bddec3c1d6 | |||
| 340691baab | |||
| 67ace38c82 | |||
| 4bc0b067b6 | |||
| 9d0610f0f3 | |||
| 3bf0bb64fd | |||
| 59fccfb0cf | |||
| 0161e20b65 | |||
| da496c52f8 | |||
| ec202ddbba | |||
| 015c334a73 | |||
| e0f6644dc0 | |||
| 26420be610 | |||
| 4270267ee9 | |||
| 55878aa09b | |||
| e30281eed5 | |||
| d06b2e0c89 | |||
| 071746fb4a | |||
| 07435fc117 | |||
| 2733a8c4d5 | |||
| ea496d1a00 | |||
| f6fd27e70a | |||
| e06bc8c074 | |||
| 46424df47a | |||
| abdbeec6bb | |||
| 772c720527 | |||
| 4cfd77fc0e | |||
| 7ec66c7da8 | |||
| 44f2c95717 | |||
| a69d0091fa | |||
| c0254bafa8 | |||
| e8e1b85e72 | |||
| a81e8c47f1 | |||
| 292f509cff | |||
| 7ebb628d8d | |||
| ef1889484b | |||
| 4941396825 | |||
| 366d7c0aba | |||
| 11c86239b7 | |||
| 89399cb129 | |||
| 0d2001b756 | |||
| 9c6d59285e | |||
| 91e79a37cc | |||
| 9530780571 | |||
| a57b5479db | |||
| 6a680dd4aa | |||
| a8e1b6b3ef | |||
| e9ed7e0ed0 | |||
| 9f84da6969 | |||
| fbc708dc4d | |||
| 507e6a2eda | |||
| dff9c69fa8 | |||
| 26777ab2c3 | |||
| e9d7fb3a88 | |||
| e6c9fdb384 | |||
| cff8f5db55 | |||
| 5691235ace | |||
| 33ce9928d8 | |||
| 2cd9cfcc97 | |||
| a440a25c64 | |||
| 59307a664c | |||
| 42ec1aa258 | |||
| 246e844e5f | |||
| ad6c9ad223 | |||
| 56f55380a9 | |||
| aa7574545f | |||
| 739d5c91b9 | |||
| 2e83093eba | |||
| 2e32076884 | |||
| e10faa46a6 | |||
| 8b66d25681 | |||
| 51ffccda4d | |||
| fc109fac2d | |||
| 3905c1f75b | |||
| 2c4e52a7df | |||
| fb2e8f82c9 | |||
| ce539ad701 | |||
| 4bf46b6e96 | |||
| 5c1a9d64ac | |||
| 466b9bad29 | |||
| b1ddd85ca1 | |||
| 1f373dfef0 | |||
| 69439955e6 | |||
| 96f953cbe2 | |||
| 0ce936b081 | |||
| c232e12bf2 | |||
| fa0f103c89 | |||
| fc08a60dc1 | |||
| 51f205a7e3 | |||
| 7d0f9cef34 | |||
| 832626da76 | |||
| f51ba2033b | |||
| 3db8d8499e | |||
| be626b193e | |||
| 658762de67 | |||
| 494884fe7c | |||
| 104ed36274 | |||
| 27c202c1c0 | |||
| 3ef24c6f3b | |||
| 9616f3f71d | |||
| e6be794910 | |||
| b87ca9b713 | |||
| 7f40235c18 | |||
| 378ef32da0 | |||
| da9cfb9630 | |||
| 999e6901c8 | |||
| b2ace0016f | |||
| d22a68bd18 | |||
| a784430288 | |||
| 08b6184488 | |||
| 3da552e27c | |||
| 489981eaba | |||
| 6014124ea3 | |||
| c04109fcb1 | |||
| 7f7aac7ad1 | |||
| 298dd4ca5d | |||
| 08ba77f32e | |||
| 33e69c39ef | |||
| d047098e46 | |||
| 52b26f8a5b | |||
| 66e23d6a6c | |||
| e9f2ede177 | |||
| 861de3cda1 | |||
| 2b6a38f5c2 | |||
| 3ad6f443b4 | |||
| 22dde645f4 | |||
| d254ae8cfe | |||
| ec2b87aede | |||
| 0b1579b2d8 | |||
| 07f641f250 | |||
| 33d1075328 | |||
| 1b75985a39 | |||
| 3e6e265d1a | |||
| 7fabd5af5c | |||
| c81e5bc9cc | |||
| 13cd1994af | |||
| 6ac047c7de | |||
| f29d40dc03 | |||
| b3fe3fb6c8 | |||
| 12d0b6c5ae | |||
| 25ff180756 | |||
| cbb8087b30 | |||
| 030f323fbb | |||
| 10fd3cd054 | |||
| 840dc3cb94 | |||
| 495baea515 | |||
| 7f2d783fad | |||
| 1b99f0565a | |||
| f5ee52a7fe | |||
| 06d09486b5 | |||
| 337e7897de | |||
| aacacde221 | |||
| 0c1e3a753b | |||
| 15958e8677 | |||
| eb1f147000 | |||
| cfaa50a61d | |||
| 7ac10ac609 | |||
| 113b864ffc | |||
| 7303944957 | |||
| dd21fb11f0 | |||
| 10a6003a3a | |||
| 476626d39e | |||
| ed4a909035 | |||
| 2bf4996444 | |||
| 4e68456832 | |||
| caec0405f4 | |||
| 181918691c | |||
| 45962a179c | |||
| 61df8b24d2 | |||
| 5b585b8ddf | |||
| 0aa433a054 | |||
| 53e40ebe2d | |||
| 5f51b09aec | |||
| 4ed9533352 | |||
| 6c43ac23f8 | |||
| 9be61d94fd | |||
| f822433322 | |||
| c44c8eb96b | |||
| be0b3ea0ea | |||
| 44b4c10a47 | |||
| 9e7fa5f2bb | |||
| 009d72139f | |||
| 478207515c | |||
| b1f60fe2f7 | |||
| 9d75f3a0b9 | |||
| 1312ff8740 | |||
| bb3b8185a9 | |||
| 6f3e759ecb | |||
| 2615855713 | |||
| c904abc752 | |||
| bfcb69ef70 | |||
| 4d4e00682b | |||
| 1acc431b98 | |||
| 251ed425e4 | |||
| 5da8f5d11e | |||
| 49b4703187 | |||
| 0736188d75 | |||
| 20640e3597 | |||
| 1555c3d89f | |||
| deaf559402 | |||
| 8d11716bfc | |||
| a9b03dc661 | |||
| cbf6a4989e | |||
| fc7776f50a | |||
| 27da392f3c | |||
| 35d565ad8f | |||
| c583993d8c | |||
| bd87189222 | |||
| ad7ecc08d3 | |||
| 575a553094 | |||
| 7d6c1a19bb | |||
| 94cfcb36a5 | |||
| ec5a34443c | |||
| 0c0ae1c696 | |||
| 3d1573914c | |||
| 9772d6d376 | |||
| f8c24829ab | |||
| 141f588d8e | |||
| 835ecea7fe | |||
| 053a3ad67d | |||
| dfa28b875d | |||
| 4e738cab73 | |||
| 62a2c4fd22 | |||
| f8c083e968 | |||
| bf4649edb5 | |||
| e6f2103ce7 | |||
| fecb44d7b5 | |||
| c71b744a43 | |||
| 5c3c0a8ce5 | |||
| c3f525dc49 | |||
| 9e8fe8469b | |||
| 54ef6f4b01 | |||
| 0908a1a327 | |||
| 5cb002eaa6 | |||
| 683c8259ea | |||
| a7bc85ea03 | |||
| d1deac2d80 | |||
| 43956b2c68 | |||
| 72ffaf4e39 | |||
| d2943aa711 | |||
| d736ed90f7 | |||
| 50147ef444 | |||
| 2db787e242 | |||
| dff99bd6c5 | |||
| 80d78f3aae | |||
| 9b3a01563c | |||
| 9f4ad8a5dd | |||
| 6339bf1051 | |||
| 21356da7ee | |||
| ce3cd1f122 | |||
| e356fb68fd | |||
| e8681669bc | |||
| 6d29b2989f | |||
| ebbb914346 | |||
| ee3d7d8a71 | |||
| 044cd0a0d6 | |||
| 2e2ca2af54 | |||
| f2a6db61a9 | |||
| 3716fb55e1 | |||
| cafbb73f5b | |||
| efd5bc7eb0 | |||
| 46ccd8b12b | |||
| 313f98c88a | |||
| 2e0d0590da | |||
| 91470a354e | |||
| 01c7382881 | |||
| 9a7310e80b | |||
| 8b4e28f87e | |||
| 415dd485a5 | |||
| 844d4f0ce0 | |||
| fe4e706f3a | |||
| ca3cfd88cc | |||
| e61fabb720 | |||
| bb98f4fda3 | |||
| 845b165edf | |||
| aaa24bb35c | |||
| 0c93bbde9e | |||
| bd4b665ed6 | |||
| edb03ff65b | |||
| 98e9b0f21e | |||
| 515acf7914 | |||
| 1415ba2319 | |||
| bcf5427193 | |||
| 0d40a799e5 | |||
| 5775c7ec63 | |||
| ccd6fa9e44 | |||
| 69beea7165 | |||
| d049031e95 | |||
| e91dd85ed7 | |||
| 5b5ff2dac6 | |||
| 170c23d2d2 | |||
| 0bad02fd57 | |||
| afb0b3f421 | |||
| f013b576ec | |||
| ca69aa758f | |||
| f6df6e93db | |||
| 9ee937eb33 | |||
| 08bcf220b3 | |||
| cd1a0a72a5 | |||
| ed53f70413 | |||
| f356ebc979 | |||
| 26c1694fdc | |||
| 89ec652e10 | |||
| 82f50464f1 | |||
| ea9f1a8faa | |||
| db15713237 | |||
| 94cd982f84 | |||
| d1c12af76e | |||
| 17d8e3ec8a | |||
| 4fbf7ca46c | |||
| b69337ee63 | |||
| c468eab4f0 | |||
| 23aa41015a | |||
| cf38e1f2ef | |||
| 68eeca8621 | |||
| 7b1890513f | |||
| 2d89ead370 | |||
| 52f37a943c | |||
| d45c949f64 | |||
| 758e086b1c | |||
| 9551675cf9 | |||
| a92ed77229 | |||
| c39546eb72 | |||
| 31593361a8 | |||
| 3a9104cb54 | |||
| 9f260add10 | |||
| 894c5e0b86 | |||
| a8ea83c89b | |||
| f231525992 | |||
| e546d72787 | |||
| 9b228afffe | |||
| f24d063a5e | |||
| ab04c70d56 | |||
| ace2654b5d | |||
| c8072f8b50 | |||
| e86284fefd | |||
| c63a91d44a | |||
| cf6fa5025d | |||
| 5a91cf1e2a | |||
| 3ba632dce5 | |||
| 10701ea814 | |||
| 0ac0d06efb | |||
| a648791534 | |||
| e6510e0920 | |||
| 7654fe5811 | |||
| 34d7e1ce9b | |||
| 6f22c38b48 | |||
| 9ef38abc49 | |||
| 22f94b8ef7 | |||
| 21144ea8c6 | |||
| 7e19c5e1f5 | |||
| 47ac7c3668 | |||
| c05b26f9c9 | |||
| a55688b394 | |||
| bc392be2a8 | |||
| 11a3fcb1be | |||
| 8a40b2d894 | |||
| 3fe335c455 | |||
| 1acda0143c | |||
| 3bb16960af | |||
| ac98193cf3 | |||
| e90d5dcfb2 | |||
| bb8d8346ad | |||
| 5ac02b6e21 | |||
| 517609f295 | |||
| 2b6f171390 | |||
| 18a44d8a77 | |||
| cffba6db62 | |||
| dc71212c3c | |||
| 731882b52d | |||
| 644262726c | |||
| ad5202771a | |||
| cad211198a | |||
| 1d2b681ec0 | |||
| 6404d22954 | |||
| 124e846e83 | |||
| 671fc51e00 | |||
| 4821f14caa | |||
| 4b9f199c65 | |||
| 7a419e5789 | |||
| 646704c8d0 | |||
| 1ff9608513 | |||
| 943056a9e5 | |||
| 9e6edb0ee6 | |||
| b81c860628 | |||
| 5b45d2d0fa | |||
| 269754e487 | |||
| 8cd38f2535 | |||
| 32d4d0d1ce | |||
| 4ab3a01586 | |||
| 9c867cfef8 | |||
| 7fda50ccee | |||
| 83e83887e3 | |||
| 0c8c2969d0 | |||
| ebeacb73c9 | |||
| 47e6717105 | |||
| 43c6a29cc6 | |||
| 9c228a616a | |||
| 01348282b4 | |||
| bef1428345 | |||
| 4e01042343 | |||
| 8348cea56a | |||
| 5129af8051 | |||
| a6f81e7fd8 | |||
| af61dca6d0 | |||
| 03134095f9 | |||
| 908de866bd | |||
| 959ea1241a | |||
| 01080b468f | |||
| 66bd7ae432 | |||
| 08b213beea | |||
| 2787eeb9b3 | |||
| 6049f806f9 | |||
| bc967db3d4 | |||
| 877d9f8430 | |||
| a87151d552 | |||
| 8c51b948d6 | |||
| f7562f72fb | |||
| 38d0571f23 | |||
| ff60281e4f | |||
| 04773f2508 | |||
| 254a642146 | |||
| af7a1f2999 | |||
| 12ba874956 | |||
| 8b927cfb8b | |||
| b71bd1e6ec | |||
| 5eb8ad6129 | |||
| 8342143862 | |||
| ea75a579d1 | |||
| a72cf89d5e | |||
| 6ea4bd74a4 | |||
| 23071bd4ab | |||
| ddb931d3ab | |||
| e8d5c5a8ca | |||
| 76fe39b8d8 | |||
| 9f77a5bcfe | |||
| e336dd6438 | |||
| f8b8874dcf | |||
| 742cf42171 | |||
| 2080cbc2eb | |||
| d8b6bb542c | |||
| 6318805a04 | |||
| 3509aa0275 | |||
| feba87f45e | |||
| 4ec0b1caec | |||
| f26a347c25 | |||
| 025a0e65cd | |||
| 13c25d0f87 | |||
| 948a4d8c94 | |||
| 2ffd822e63 | |||
| 0c657454d6 | |||
| 018f49465c | |||
| e5f77fdae4 | |||
| 47475df527 | |||
| eb4d0c0d51 | |||
| 4bd74c8ddc | |||
| 822790437e | |||
| 76456cf5f2 | |||
| 6fe3c3907b | |||
| 16f5ffacd4 | |||
| c2db2793d2 | |||
| 357274c6b9 | |||
| e455406b69 | |||
| 3e299e464d | |||
| 5796c9223c | |||
| cdff347baa | |||
| 688c43ac3e | |||
| 6e1cf8fde8 | |||
| f2301c3258 | |||
| 2ad0278bd2 | |||
| 733196d843 | |||
| 0007843de0 | |||
| e8e2f4f62c | |||
| 648cf3397d | |||
| e1ded0ff55 | |||
| c31783bb34 | |||
| 4d2f89f85b | |||
| 18a727e6fd | |||
| 28a3a568aa | |||
| 6432e1b4e1 | |||
| 52453939f2 | |||
| be15c303e0 | |||
| acef9e8a7f | |||
| 6badc27a66 | |||
| c904d241d5 | |||
| 7da14ca7c5 | |||
| 14b273b3c8 | |||
| b1591e5081 | |||
| f22c2e015a | |||
| d4184875ce | |||
| 26be1bf17a | |||
| 5a1e6f2a6c | |||
| cfbde86579 | |||
| 5684c6ab99 | |||
| a5f1f8c0e2 | |||
| 7759183593 | |||
| 3d257cbf08 | |||
| 611d3bd71d | |||
| fc9ca7eca3 | |||
| 94e62d8d02 | |||
| e163fbc943 | |||
| 699f075ad2 | |||
| a3b0c9462f | |||
| d4d8a51fae | |||
| db78068443 | |||
| c8a11c7410 | |||
| 53cd3d4278 | |||
| 8c8a31c21d | |||
| 049c70ea9d | |||
| 17b629d458 | |||
| 15dd454840 | |||
| 1dee84c2be | |||
| bfeca9d6b9 | |||
| 68e719927e | |||
| d4b3034bb4 | |||
| 61622d9709 | |||
| d692e80d6b | |||
| e2a4d8f9d0 | |||
| 887ec885b1 | |||
| b292cea475 | |||
| fe3130a07d | |||
| 264189da87 | |||
| 9e3824a63d | |||
| 2af7ab97d6 | |||
| c327996e6b | |||
| ea5be5a976 | |||
| ba09a2619e | |||
| 5d2dce09b3 | |||
| d0c82a5609 | |||
| 11942210a2 | |||
| a67a3a8eec | |||
| ac2a99b1b8 | |||
| b7c8fb6610 | |||
| 2581c3cb70 | |||
| b19a440a04 | |||
| 787c2eefd3 | |||
| 9440efcd97 | |||
| 3b1e1d8964 | |||
| ec5bfaf5e0 | |||
| 58ac441cae | |||
| ddb621b78d | |||
| 6f421476a9 | |||
| 3c6d27b44b | |||
| f536a092d4 | |||
| d5d5ae432c | |||
| 5125c0e332 | |||
| a141bd9ca2 | |||
| 8772dd9202 | |||
| b0b6a8dac6 | |||
| 35888eee0d | |||
| ec0118dd5d | |||
| cd5189e266 | |||
| c95efa3936 | |||
| abb58a56f4 | |||
| 7ce803eeae | |||
| 196eedebb1 | |||
| ed6af81b50 | |||
| 9e2f748669 | |||
| 6daa6285cc | |||
| 984616805e | |||
| ec6c7d98f9 | |||
| 918bcdcfab | |||
| d0eb3fcf88 | |||
| ea5214d534 | |||
| c73dbf667d | |||
| 3397a096ba | |||
| 47649d4328 | |||
| 3370262bae | |||
| 06f7eb2a36 | |||
| 13a1eb3c10 | |||
| caa4912f70 | |||
| 68d4c5bc1f | |||
| 057d39bbc1 | |||
| 2f7d4b4213 | |||
| 4eac963a41 | |||
| 2b18b65f9a | |||
| 277106de6e | |||
| bc8e22c4cc | |||
| 8f8db0fc5f | |||
| 125e250a85 | |||
| 04d9550434 | |||
| e58dbe0fe8 | |||
| 135de8d007 | |||
| ac41de6697 | |||
| 5a479aa628 | |||
| 288503b780 | |||
| 5b01459102 | |||
| 6d3c3b02a6 | |||
| 54b1dc4950 | |||
| 269c884874 | |||
| 4a4c146e9f | |||
| bd9cbc32f5 | |||
| e639d0cca8 | |||
| e7a8905fc9 | |||
| 4416991914 | |||
| 11bb61041b | |||
| a1317d1b99 | |||
| 88e2bbae6d | |||
| 2aa4f06a88 | |||
| fc0a71999e | |||
| 4bc3f5a2da | |||
| 14a49d6d28 | |||
| b837c9e84d | |||
| 8838b16705 | |||
| e4715ab74a | |||
| 87be88ad2f | |||
| 27dd6a7c57 | |||
| fba6d4c169 | |||
| 9690f66447 | |||
| 1c1b04c994 | |||
| 8a9edd6dba | |||
| 282dcd3c03 | |||
| 76917f764f | |||
| d5c88f9333 | |||
| 1a3b5c6cfc | |||
| 199ba4286b | |||
| f0987e98ad | |||
| 735d8ce2ce | |||
| 0a52c0d63d | |||
| ec9cd69156 | |||
| 43812bf883 | |||
| 7b3dae9096 | |||
| 6f960202e7 | |||
| ff65ab25c2 | |||
| ac0d9c6411 | |||
| 1480ead173 | |||
| 2d48474f2a | |||
| 94828bec35 | |||
| 6a226839d0 | |||
| 6bf567100a | |||
| 00e4cad952 | |||
| 754eb73b23 | |||
| e09cfa968b | |||
| 8b23f31909 | |||
| 534f9fec11 | |||
| cee1176862 | |||
| 5274209ac1 | |||
| 12f2dc577d | |||
| 7e6f69b9af | |||
| 7991c4c000 | |||
| 7fdb5afc08 | |||
| a2c5642872 | |||
| fde76de588 | |||
| 45d88e56cb | |||
| 22d6b3da4f | |||
| f7ff057d0b | |||
| 04c0a7d205 | |||
| f543eea9d6 | |||
| a5a993abc2 | |||
| 38d341b0d7 | |||
| 1c83b13343 | |||
| 182f5cc6f6 | |||
| d8b06a25b2 | |||
| ef0376f4ef | |||
| 090d2f90e8 | |||
| ee5cf900f8 | |||
| e5a9af0a70 | |||
| b3c02fae54 | |||
| 87b8419f80 | |||
| 0a2569e55c | |||
| a8f912faf1 | |||
| 16f75808c7 | |||
| a364362b95 | |||
| d16597b557 | |||
| f70f6e9ad1 | |||
| cb5d7dbe14 | |||
| 7ecee68542 | |||
| 18930123e3 | |||
| f40f4013f1 | |||
| 86645a5e91 | |||
| e516577ec7 | |||
| 8261570853 | |||
| 4cb258fbdf | |||
| 859624f26c | |||
| 10c3c6d49c | |||
| 7e9f29178e | |||
| 7984be4a13 | |||
| efabe26141 | |||
| a7e79bfe78 | |||
| c4989dc75f | |||
| 0f504be67b | |||
| 54afb1ca01 | |||
| da744e0065 | |||
| 7a44fb4d97 | |||
| d43c4284e1 | |||
| f36884dde7 | |||
| 5dff4c565f | |||
| 0ca7b84953 | |||
| 995294dfa3 | |||
| cef1e7f444 | |||
| 23758a4588 | |||
| f35cacdc83 | |||
| 7e20d8e330 | |||
| ade2e5955e | |||
| ce40b669cc | |||
| 05042a7ed8 | |||
| 2824832a18 | |||
| 17330e8aae | |||
| 6ac158e9e3 | |||
| dfff77eedd | |||
| 77536bd387 | |||
| c56a8d4441 | |||
| a1d246334b | |||
| e71389830c | |||
| b886841fc8 | |||
| 25200f80f7 | |||
| fdac23f168 | |||
| 7ca0ece0db | |||
| dcfc7a875a | |||
| ffd6212152 | |||
| 1cf721e235 | |||
| aed7f32783 | |||
| dbc7d20cf5 | |||
| 6357d61912 | |||
| 3acce7a095 | |||
| a36531da4f | |||
| 7d1906cf7c | |||
| 8be58774cd | |||
| ffbcd681f3 | |||
| dc49c2d461 | |||
| 10357af3ef | |||
| 1800b35bf6 | |||
| 6ca2f1d3ce | |||
| 9f097a7248 | |||
| 8755b6aaca | |||
| bea916ae7c | |||
| 8ef685cf4c | |||
| e4b1208377 | |||
| cd735560d3 | |||
| a770897929 | |||
| 40ff6e3663 | |||
| b408061558 | |||
| be1af716b7 | |||
| f69ff3b72e | |||
| 0543bb679b | |||
| 9cad3e182d | |||
| 1243bf814b | |||
| e972cdc5ad | |||
| dc8d309c88 | |||
| 860848dca8 | |||
| aafe1618f8 | |||
| 358e5cf791 | |||
| a2c591662b | |||
| 64550fa6c1 | |||
| 267ff8cd27 | |||
| 32bbc36039 | |||
| 8129b01641 | |||
| a39a53fa6f | |||
| c50d05671b | |||
| 7f7d9ce6e8 | |||
| 58a44ab228 | |||
| b43c2e9d39 | |||
| 42cbe9be98 | |||
| fb93cfac00 | |||
| 0ba9f5a5e9 | |||
| 9d1963b421 | |||
| ed82e03798 | |||
| a89d501b72 | |||
| 4587d4f5b7 | |||
| cb0318b633 | |||
| 404e01f59e | |||
| 96ebc911d7 | |||
| 7d8c4fb5af | |||
| 929c26ccf1 | |||
| c994fe7430 | |||
| 1d4262608c | |||
| 0016ed0115 | |||
| 0c5e3d4564 | |||
| e0c00395b7 | |||
| 9e9e0732f5 | |||
| 965344c08f | |||
| 0f97c8afdb | |||
| 1b5afe64c4 | |||
| 5831b4c70c | |||
| 223e753520 | |||
| 72682b8868 | |||
| 8fe13ecf1a | |||
| dbfa519ad9 | |||
| 6ff99dde45 | |||
| 332748dd7e | |||
| db65026449 | |||
| 45c920b0af | |||
| 1be36988ac | |||
| d7964ccf87 | |||
| efa9f19281 | |||
| 6662dee76d | |||
| 1729746211 | |||
| fe2a74db60 | |||
| 72b01fbeb3 | |||
| 7259dbc551 | |||
| 39949b56ad | |||
| 7110207a34 | |||
| 40b67fca0a | |||
| b9c38ef120 | |||
| b8e5740796 | |||
| 8c9d533f3d | |||
| 18952a18fd | |||
| 53516a8ece | |||
| a5f35b4cf2 | |||
| fbb829b82d | |||
| ceec817f95 | |||
| 0cba7c0408 | |||
| 2df28fda6c | |||
| 9f83ba0887 | |||
| 956d1a3ab5 | |||
| 6005434b55 | |||
| a8fb78b142 | |||
| b3af6c110a | |||
| 58ca2c4b71 | |||
| 4e77491aff | |||
| c2ca1a3793 | |||
| 1f3933bee6 | |||
| e7af814b0d | |||
| 365e163946 | |||
| 9f689071a8 | |||
| 85daa5926c | |||
| 415be0ff94 | |||
| e50e70d12e | |||
| 8c14856d86 | |||
| d613d7d78e | |||
| 7c19940ca6 | |||
| ead158db7e | |||
| 3bcb2c1dff | |||
| 265dbb3a54 | |||
| 2253ea2592 | |||
| 5ff8144cc8 | |||
| 9cf83e67a1 | |||
| 4d199d6b33 | |||
| 8109fce46d | |||
| cb6ff0a71c | |||
| d107f1e2cd | |||
| ebad6e2f6f | |||
| 9660c98e57 | |||
| c34b325447 | |||
| 35cd08c96e | |||
| e5baaad498 | |||
| 8e8a8810de | |||
| 177bc9c8b9 | |||
| 33b8721c71 | |||
| 6cf3a65082 | |||
| 841b2a44ef | |||
| 98402da094 | |||
| 76ffac7f93 | |||
| 782b21dc0f | |||
| e0b587be49 | |||
| e60d8e5a42 | |||
| 67cb80dc09 | |||
| abe73c6d99 | |||
| f455e4e9bd | |||
| 6d3ac4035b | |||
| b057855440 | |||
| 92ec74a9a7 | |||
| 9abb69aacb | |||
| cb8e878573 | |||
| ba0c76e7a9 | |||
| 40ab5a4010 | |||
| a30e3c5a1a | |||
| cb140ca0d6 | |||
| 4026898f5c | |||
| 51d861632b | |||
| 72306a6ff4 | |||
| 9831354928 | |||
| 925d068de1 | |||
| 1a35796fba | |||
| b2b9890d08 | |||
| 4f7dc83fe8 | |||
| 7c183f44d4 | |||
| 7d919d8f27 | |||
| 324ea4d7de | |||
| 9ff12f3dae | |||
| 83688ab542 | |||
| 2b6d08a333 | |||
| e2acc0a010 | |||
| c5b8cda403 | |||
| d4b584c5f6 | |||
| 2f24a39b5b | |||
| de1b85d795 | |||
| d6b040af81 | |||
| a23463acec | |||
| 3b89933d9f | |||
| 903ab24de4 | |||
| 5c8e2b97d3 | |||
| 9dfd9a124d | |||
| db5602f751 | |||
| a3bb5afdd0 | |||
| 423dc3b17e | |||
| 3a353b12ba | |||
| 26ebc41703 | |||
| b23dd6ee72 | |||
| 03adb289ec | |||
| 1a52d9e2cc | |||
| 1daa8c0821 | |||
| 51a2716e6b | |||
| b3463f416c | |||
| fc97bb9863 | |||
| 8c495ea4ee | |||
| bb0ece5a0c | |||
| e79c09855c | |||
| 1f00dc45d4 | |||
| f9c5bd9234 | |||
| f6b9be73f5 | |||
| f08f05610b | |||
| b750cfde81 | |||
| 7210cb5d19 | |||
| 860f7f9195 | |||
| a3a3186770 | |||
| 424f91c056 | |||
| 56b77440ad | |||
| 92bf70765a | |||
| 653599b3a4 | |||
| ba9489ce91 | |||
| 6aabb69f9e | |||
| 02af5654f2 | |||
| 4e8da675ac | |||
| d3054582d5 | |||
| c3c2a213a2 | |||
| ed9c60fed7 | |||
| 9de951556f | |||
| ff4a2ddef7 | |||
| 8d7ec82427 | |||
| c4437be63b | |||
| 7f467e69c0 | |||
| d59ef547c9 | |||
| abf82af8f7 | |||
| 5cb418e9f8 | |||
| 7109330e9a | |||
| e467ed219f | |||
| f0c8bb711f | |||
| cfef4e754a | |||
| cbd8609407 | |||
| 2a1733aafc | |||
| 1357ab1d5b | |||
| 001f78b41f | |||
| 853f2e8eea | |||
| 00c7590c95 | |||
| 24e5fcbe26 | |||
| 4d8a37a0db | |||
| 3cba5809ae | |||
| d7320fc84a | |||
| cff596e51b | |||
| acb3bf8ac1 | |||
| ebd748fd71 | |||
| 653e811ec0 | |||
| 81dda1da15 | |||
| 9cd8fdda3c | |||
| c532957be2 | |||
| ad86ee91e9 | |||
| 11892d8fdf | |||
| 00aa596e8e | |||
| 7b80d3c65a | |||
| 7da6c0f82d | |||
| a6395af1b9 | |||
| 4dbdc834ff | |||
| bc3801cb9c | |||
| 4e7a371b2e | |||
| db48cf080d | |||
| e0745be16b | |||
| 9671325a35 | |||
| 1e92c729ba | |||
| 347f822856 | |||
| 0f69a9eaaf | |||
| cdbd44f00e | |||
| 6ae2048c1f | |||
| 02ed16902b | |||
| 30e1b79889 | |||
| d30043c852 | |||
| add75e9682 | |||
| 78baf38ea4 | |||
| cad8d5ccb0 | |||
| a52422abcb | |||
| a33d85b374 | |||
| da3494a8c4 | |||
| ae7aad593c | |||
| cf2d7311ab | |||
| 8f64668af2 | |||
| 2af51a1dc3 | |||
| 17e0ed7919 | |||
| 7e4c833c5a | |||
| 264ca6c58d | |||
| b1d4c42ad6 | |||
| 7f96df6222 | |||
| 73553ddbaa | |||
| a6adddfb7d | |||
| f10ad2d4eb | |||
| e61eecacc8 | |||
| 924deffba6 | |||
| de276c9216 | |||
| aed70c6d40 | |||
| b11d6236df | |||
| 4921fb4c9f | |||
| 6a8a17eb28 | |||
| c114ff92bb | |||
| a77b489d67 | |||
| 9d7ce57ae3 | |||
| 28a6552570 | |||
| 6f2d62d022 | |||
| a9cc3954b9 | |||
| 2324ddd3d5 |
@@ -25,4 +25,3 @@ CVS
|
||||
/.project
|
||||
/.buildpath
|
||||
/.cache
|
||||
phpunit.xml
|
||||
+8
-15
@@ -131,25 +131,12 @@
|
||||
$table->setup();
|
||||
$tablerows = array();
|
||||
|
||||
// Sort blocks using current locale.
|
||||
$blocknames = array();
|
||||
foreach ($blocks as $blockid=>$block) {
|
||||
$blockname = $block->name;
|
||||
if (file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
$blocknames[$blockid] = get_string('pluginname', 'block_'.$blockname);
|
||||
} else {
|
||||
$blocknames[$blockid] = $blockname;
|
||||
}
|
||||
}
|
||||
collatorlib::asort($blocknames);
|
||||
|
||||
foreach ($blocknames as $blockid=>$strblockname) {
|
||||
$block = $blocks[$blockid];
|
||||
$blockname = $block->name;
|
||||
|
||||
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
$blockobject = false;
|
||||
$strblockname = '<span class="notifyproblem">'.$strblockname.' ('.get_string('missingfromdisk').')</span>';
|
||||
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
|
||||
$plugin = new stdClass();
|
||||
$plugin->version = $block->version;
|
||||
|
||||
@@ -164,6 +151,7 @@
|
||||
$incompatible[] = $block;
|
||||
continue;
|
||||
}
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
}
|
||||
|
||||
$delete = '<a href="blocks.php?delete='.$blockid.'&sesskey='.sesskey().'">'.$strdelete.'</a>';
|
||||
@@ -234,7 +222,12 @@
|
||||
$delete,
|
||||
$settings
|
||||
);
|
||||
$table->add_data($row);
|
||||
$tablerows[] = array(strip_tags($strblockname), $row); // first element will be used for sorting
|
||||
}
|
||||
|
||||
collatorlib::asort($tablerows);
|
||||
foreach ($tablerows as $row) {
|
||||
$table->add_data($row[1]);
|
||||
}
|
||||
|
||||
$table->print_html();
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file is used to display a categories sub categories, external pages, and settings.
|
||||
*
|
||||
* @since 2.3
|
||||
* @package admin
|
||||
* @copyright 2011 Sam Hemelryk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$category = required_param('category', PARAM_SAFEDIR);
|
||||
$return = optional_param('return','', PARAM_ALPHA);
|
||||
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
/// no guest autologin
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
$PAGE->set_url('/admin/category.php', array('category' => $category));
|
||||
$PAGE->set_pagetype('admin-setting-' . $category);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->navigation->clear_cache();
|
||||
|
||||
$adminroot = admin_get_root(); // need all settings
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
|
||||
if (empty($settingspage) or !($settingspage instanceof admin_category)) {
|
||||
print_error('categoryerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
|
||||
if (!($settingspage->check_access())) {
|
||||
print_error('accessdenied', 'admin');
|
||||
}
|
||||
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
|
||||
if (empty($adminroot->errors)) {
|
||||
switch ($return) {
|
||||
case 'site': redirect("$CFG->wwwroot/");
|
||||
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
|
||||
$USER->editing = $adminediting;
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
$url = clone($PAGE->url);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
$caption = get_string('blockseditoff');
|
||||
$url->param('adminedit', 'off');
|
||||
} else {
|
||||
$caption = get_string('blocksediton');
|
||||
$url->param('adminedit', 'on');
|
||||
}
|
||||
$buttons = $OUTPUT->single_button($url, $caption, 'get');
|
||||
}
|
||||
|
||||
$savebutton = false;
|
||||
$outputhtml = '';
|
||||
foreach ($settingspage->children as $childpage) {
|
||||
if ($childpage->is_hidden()) {
|
||||
continue;
|
||||
}
|
||||
if ($childpage instanceof admin_externalpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_settingpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_category) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (!empty($childpage->settings)) {
|
||||
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
|
||||
foreach ($childpage->settings as $setting) {
|
||||
if (empty($setting->nosave)) {
|
||||
$savebutton = true;
|
||||
}
|
||||
$fullname = $setting->get_full_name();
|
||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||
$data = $adminroot->errors[$fullname]->data;
|
||||
} else {
|
||||
$data = $setting->get_setting();
|
||||
}
|
||||
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
$outputhtml .= $setting->output_html($data);
|
||||
}
|
||||
$outputhtml .= html_writer::end_tag('fieldset');
|
||||
}
|
||||
}
|
||||
if ($savebutton) {
|
||||
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
$visiblepathtosection = array_reverse($settingspage->visiblepath);
|
||||
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
$PAGE->set_button($buttons);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($errormsg);
|
||||
} else if ($statusmsg !== '') {
|
||||
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
||||
}
|
||||
|
||||
$path = array_reverse($settingspage->visiblepath);
|
||||
if (is_array($path)) {
|
||||
$visiblename = join(' / ', $path);
|
||||
} else {
|
||||
$visiblename = $path;
|
||||
}
|
||||
echo $OUTPUT->heading(get_string('admincategory', 'admin', $visiblename), 2);
|
||||
|
||||
echo html_writer::start_tag('form', array('action' => '', 'method' => 'post', 'id' => 'adminsettings'));
|
||||
echo html_writer::start_tag('div');
|
||||
echo html_writer::input_hidden_params(new moodle_url($PAGE->url, array('sesskey' => sesskey(), 'return' => $return)));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
echo $outputhtml;
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
@@ -425,8 +425,7 @@ if (isset($maturity)) {
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
cli_error(get_string('maturitycorewarning', 'admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,9 +677,7 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -161,9 +161,7 @@ if (!$envstatus) {
|
||||
|
||||
// Test plugin dependencies.
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* MySQL collation conversion tool.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Petr Skoda (http://skodak.org)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
if ($DB->get_dbfamily() !== 'mysql') {
|
||||
cli_error('This function is designed for MySQL databases only!');
|
||||
}
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'collation'=>false, 'available'=>false),
|
||||
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
$help =
|
||||
"MySQL collation conversions script.
|
||||
|
||||
It is strongly recommended to stop the web server before the conversion.
|
||||
This script may be executed before the main upgrade - 1.9.x data for example.
|
||||
|
||||
Options:
|
||||
--collation=COLLATION Convert MySQL tables to different collation
|
||||
-l, --list Show table and column information
|
||||
-a, --available Show list of available collations
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8_general_ci
|
||||
";
|
||||
|
||||
if (!empty($options['collation'])) {
|
||||
$collations = mysql_get_collations();
|
||||
$collation = clean_param($options['collation'], PARAM_ALPHANUMEXT);
|
||||
$collation = strtolower($collation);
|
||||
if (!isset($collations[$collation])) {
|
||||
cli_error("Error: collation '$collation' is not available on this server!");
|
||||
}
|
||||
|
||||
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
foreach ($rs as $table) {
|
||||
echo str_pad($table->name, 40). " - ";
|
||||
|
||||
if ($table->collation === $collation) {
|
||||
echo "NO CHANGE\n";
|
||||
$skipped++;
|
||||
|
||||
} else {
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
|
||||
$rs2 = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs2 as $column) {
|
||||
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
|
||||
echo ' '.str_pad($column->field, 36). " - ";
|
||||
if ($column->collation === $collation) {
|
||||
echo "NO CHANGE\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($column->type === 'tinytext' or $column->type === 'mediumtext' or $column->type === 'text' or $column->type === 'longtext') {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
|
||||
} else if (strpos($column->type, 'varchar') === 0) {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
} else {
|
||||
echo "ERROR (unknown column type: $column->type)\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
$rs2->close();
|
||||
}
|
||||
$rs->close();
|
||||
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
echo "List of tables for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
$sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$counts = array();
|
||||
foreach ($rs as $table) {
|
||||
if (isset($counts[$table->collation])) {
|
||||
$counts[$table->collation]++;
|
||||
} else {
|
||||
$counts[$table->collation] = 1;
|
||||
}
|
||||
echo str_pad($table->name, 40);
|
||||
echo $table->collation. "\n";
|
||||
$collations = mysql_get_column_collations($table->name);
|
||||
foreach ($collations as $columname=>$collation) {
|
||||
if (isset($counts[$collation])) {
|
||||
$counts[$collation]++;
|
||||
} else {
|
||||
$counts[$collation] = 1;
|
||||
}
|
||||
echo ' ';
|
||||
echo str_pad($columname, 36);
|
||||
echo $collation. "\n";
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
echo "\n";
|
||||
echo "Table collations summary for $CFG->wwwroot:\n";
|
||||
foreach ($counts as $collation => $count) {
|
||||
echo "$collation: $count\n";
|
||||
}
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['available'])) {
|
||||
echo "List of available MySQL collations for $CFG->wwwroot:\n";
|
||||
$collations = mysql_get_collations();
|
||||
foreach ($collations as $collation) {
|
||||
echo " $collation\n";
|
||||
}
|
||||
die;
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========== Some functions ==============
|
||||
|
||||
function mysql_get_collations() {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$sql = "SHOW COLLATION WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs as $collation) {
|
||||
$collations[$collation->collation] = $collation->collation;
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
$collation = $DB->get_dbcollation();
|
||||
if (isset($collations[$collation])) {
|
||||
$collations[$collation] .= ' (default)';
|
||||
}
|
||||
|
||||
return $collations;
|
||||
}
|
||||
|
||||
function mysql_get_column_collations($tablename) {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$sql = "SELECT column_name, collation_name
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_schema = DATABASE() AND table_name = ? AND collation_name IS NOT NULL";
|
||||
$rs = $DB->get_recordset_sql($sql, array($tablename));
|
||||
foreach($rs as $record) {
|
||||
$collations[$record->column_name] = $record->collation_name;
|
||||
}
|
||||
$rs->close();
|
||||
return $collations;
|
||||
}
|
||||
@@ -34,8 +34,8 @@ if ($DB->get_dbfamily() !== 'mysql') {
|
||||
}
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false),
|
||||
array('h'=>'help', 'l'=>'list', 'a'=>'available'));
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false),
|
||||
array('h'=>'help', 'l'=>'list'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
@@ -52,7 +52,6 @@ and does not support transactions.
|
||||
Options:
|
||||
--engine=ENGINE Convert MySQL tables to different engine
|
||||
-l, --list Show table information
|
||||
-a, --available Show list of available engines
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -60,11 +59,7 @@ Example:
|
||||
";
|
||||
|
||||
if (!empty($options['engine'])) {
|
||||
$engines = mysql_get_engines();
|
||||
$engine = clean_param($options['engine'], PARAM_ALPHA);
|
||||
if (!isset($engines[strtoupper($engine)])) {
|
||||
cli_error("Error: engine '$engine' is not available on this server!");
|
||||
}
|
||||
|
||||
echo "Converting tables to '$engine' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
@@ -73,11 +68,9 @@ if (!empty($options['engine'])) {
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
foreach ($rs as $table) {
|
||||
if (strtoupper($table->engine) === strtoupper($engine)) {
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n";
|
||||
if ($table->engine === $engine) {
|
||||
echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n";
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
@@ -85,22 +78,16 @@ if (!empty($options['engine'])) {
|
||||
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
|
||||
$newengine = mysql_get_table_engine($table->name);
|
||||
if (strtoupper($newengine) !== strtoupper($engine)) {
|
||||
echo "ERROR ($newengine)\n";
|
||||
$errors++;
|
||||
continue;
|
||||
}
|
||||
echo "DONE ($newengine)\n";
|
||||
$converted++;
|
||||
} catch (moodle_exception $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
$errors++;
|
||||
$skipped++;
|
||||
continue;
|
||||
}
|
||||
echo "DONE\n";
|
||||
$converted++;
|
||||
}
|
||||
$rs->close();
|
||||
echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
|
||||
echo "Converted: $converted, skipped: $skipped\n";
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['list'])) {
|
||||
@@ -128,53 +115,7 @@ if (!empty($options['engine'])) {
|
||||
}
|
||||
exit(0); // success
|
||||
|
||||
} else if (!empty($options['available'])) {
|
||||
echo "List of available MySQL engines for $CFG->wwwroot:\n";
|
||||
$engines = mysql_get_engines();
|
||||
foreach ($engines as $engine) {
|
||||
echo " $engine\n";
|
||||
}
|
||||
die;
|
||||
|
||||
} else {
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========== Some functions ==============
|
||||
|
||||
function mysql_get_engines() {
|
||||
global $DB;
|
||||
|
||||
$sql = "SHOW Engines";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
$engines = array();
|
||||
foreach ($rs as $engine) {
|
||||
if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') {
|
||||
continue;
|
||||
}
|
||||
$engines[strtoupper($engine->engine)] = $engine->engine;
|
||||
if (strtoupper($engine->support) === 'DEFAULT') {
|
||||
$engines[strtoupper($engine->engine)] .= ' (default)';
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
return $engines;
|
||||
}
|
||||
|
||||
function mysql_get_table_engine($tablename) {
|
||||
global $DB;
|
||||
|
||||
$engine = null;
|
||||
$sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
if ($rs->valid()) {
|
||||
$record = $rs->current();
|
||||
$engine = $record->engine;
|
||||
}
|
||||
$rs->close();
|
||||
return $engine;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ if (empty($CFG->version)) {
|
||||
cli_error(get_string('missingconfigversion', 'debug'));
|
||||
}
|
||||
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if ($version < $CFG->version) {
|
||||
@@ -109,9 +109,7 @@ if (!$envstatus) {
|
||||
}
|
||||
|
||||
// Test plugin dependencies.
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version)) {
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
||||
@@ -134,8 +132,7 @@ if (isset($maturity)) {
|
||||
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
|
||||
cli_separator();
|
||||
} else {
|
||||
cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
cli_error(get_string('maturityallowunstable', 'admin'));
|
||||
cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +150,6 @@ if ($version > $CFG->version) {
|
||||
upgrade_core($version, true);
|
||||
}
|
||||
set_config('release', $release);
|
||||
set_config('branch', $branch);
|
||||
|
||||
// unconditionally upgrade
|
||||
upgrade_noncore(true);
|
||||
|
||||
@@ -81,9 +81,6 @@ if (check_browser_version('MSIE')) {
|
||||
@header('Content-Type: text/plain; charset=utf-8');
|
||||
}
|
||||
|
||||
// we do not want html markup in emulated CLI
|
||||
@ini_set('html_errors', 'off');
|
||||
|
||||
// execute the cron
|
||||
cron_run();
|
||||
|
||||
|
||||
+20
-125
@@ -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" />
|
||||
@@ -551,7 +563,11 @@
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="mysql" version="5.0.25">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
@@ -561,127 +577,6 @@
|
||||
</DATABASE>
|
||||
<PHP version="5.3.2" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_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>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+17
-95
@@ -44,13 +44,17 @@ if (!function_exists('iconv')) {
|
||||
echo 'Moodle requires the iconv PHP extension. Please install or enable the iconv extension.';
|
||||
die();
|
||||
}
|
||||
if (iconv('UTF-8', 'UTF-8//IGNORE', 'abc') !== 'abc') {
|
||||
// known to be broken in mid-2011 MAMP installations
|
||||
echo 'Broken iconv PHP extension detected, installation/upgrade can not continue.';
|
||||
die();
|
||||
}
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
|
||||
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
|
||||
require_once($CFG->libdir.'/pluginlib.php'); // available updates notifications
|
||||
|
||||
$id = optional_param('id', '', PARAM_TEXT);
|
||||
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
|
||||
@@ -58,7 +62,6 @@ $confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
|
||||
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
|
||||
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
|
||||
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
|
||||
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
|
||||
|
||||
// Check some PHP server settings
|
||||
|
||||
@@ -90,20 +93,21 @@ if (!isset($CFG->release)) {
|
||||
if (!isset($CFG->version)) {
|
||||
$CFG->version = '';
|
||||
}
|
||||
if (!isset($CFG->branch)) {
|
||||
$CFG->branch = '';
|
||||
}
|
||||
|
||||
$version = null;
|
||||
$release = null;
|
||||
$branch = null;
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if (!$version or !$release) {
|
||||
print_error('withoutversion', 'debug'); // without version, stop
|
||||
}
|
||||
|
||||
if (!isset($maturity)) {
|
||||
// Fallback for now. Should probably be removed in the future.
|
||||
$maturity = MATURITY_STABLE;
|
||||
}
|
||||
|
||||
// Turn off xmlstrictheaders during upgrade.
|
||||
$origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
|
||||
$CFG->xmlstrictheaders = false;
|
||||
@@ -147,20 +151,6 @@ if (!core_tables_exist()) {
|
||||
die();
|
||||
}
|
||||
|
||||
// check plugin dependencies
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
//TODO: add a page with list of non-standard plugins here
|
||||
|
||||
$strdatabasesetup = get_string('databasesetup');
|
||||
@@ -200,17 +190,7 @@ if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_stale_php_files_page();
|
||||
die();
|
||||
}
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$a = new stdClass();
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
@@ -245,28 +225,9 @@ if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
if ($fetchupdates) {
|
||||
// no sesskey support guaranteed here
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
available_update_checker::instance()->fetch();
|
||||
}
|
||||
redirect($reloadurl);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins, $reloadurl,
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)),
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
|
||||
die();
|
||||
|
||||
@@ -284,10 +245,6 @@ if ($release <> $CFG->release) { // Update the release version
|
||||
set_config('release', $release);
|
||||
}
|
||||
|
||||
if ($branch <> $CFG->branch) { // Update the branch
|
||||
set_config('branch', $branch);
|
||||
}
|
||||
|
||||
if (moodle_needs_upgrading()) {
|
||||
if (!$PAGE->headerprinted) {
|
||||
// means core upgrade or installation was not already done
|
||||
@@ -301,26 +258,9 @@ if (moodle_needs_upgrading()) {
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
if ($fetchupdates) {
|
||||
// no sesskey support guaranteed here
|
||||
available_update_checker::instance()->fetch();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
// check plugin dependencies first
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
// dependencies check passed, let's rock!
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins,
|
||||
new moodle_url($PAGE->url),
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php'),
|
||||
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
|
||||
die();
|
||||
}
|
||||
@@ -358,8 +298,7 @@ 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
|
||||
$adminids = explode(',', $CFG->siteadmins);
|
||||
$adminuser = get_complete_user_data('id', reset($adminids));
|
||||
$adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins)));
|
||||
|
||||
if ($adminuser->password === 'adminsetuppending') {
|
||||
// prevent installation hijacking
|
||||
@@ -424,24 +363,7 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
|
||||
$dbproblems = $DB->diagnose();
|
||||
$maintenancemode = !empty($CFG->maintenance_enabled);
|
||||
|
||||
$updateschecker = available_update_checker::instance();
|
||||
$availableupdates = $updateschecker->get_update_info('core',
|
||||
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
|
||||
$availableupdatesfetch = $updateschecker->get_last_timefetched();
|
||||
|
||||
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
|
||||
//check if the site is registered on Moodle.org
|
||||
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
|
||||
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
|
||||
if ($fetchupdates) {
|
||||
require_sesskey();
|
||||
$updateschecker->fetch();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
|
||||
$registered);
|
||||
$cronoverdue, $dbproblems, $maintenancemode);
|
||||
|
||||
+3
-31
@@ -34,10 +34,6 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
// Get the submitted params
|
||||
$disable = optional_param('disable', 0, PARAM_INT);
|
||||
$enable = optional_param('enable', 0, PARAM_INT);
|
||||
$uninstall = optional_param('uninstall', 0, PARAM_INT);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
$headingtitle = get_string('managemessageoutputs', 'message');
|
||||
|
||||
if (!empty($disable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
||||
@@ -46,38 +42,14 @@ if (!empty($disable) && confirm_sesskey()) {
|
||||
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
||||
}
|
||||
|
||||
if (!empty($enable) && confirm_sesskey()) {
|
||||
if (!empty($enable) && confirm_sesskey() ) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
||||
}
|
||||
|
||||
if (!empty($uninstall) && confirm_sesskey()) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$uninstall))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
|
||||
$processorname = get_string('pluginname', 'message_'.$processor->name);
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->confirm(get_string('processordeleteconfirm', 'message', $processorname), 'message.php?uninstall='.$processor->id.'&confirm=1', 'message.php');
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
message_processor_uninstall($processor->name);
|
||||
$a = new stdClass();
|
||||
$a->processor = $processorname;
|
||||
$a->directory = $CFG->dirroot.'/message/output/'.$processor->name;
|
||||
notice(get_string('processordeletefiles', 'message', $a), 'message.php');
|
||||
}
|
||||
}
|
||||
|
||||
if ($disable || $enable || $uninstall) {
|
||||
if ($disable || $enable) {
|
||||
$url = new moodle_url('message.php');
|
||||
redirect($url);
|
||||
}
|
||||
@@ -93,6 +65,6 @@ $messageoutputs = $renderer->manage_messageoutputs($processors);
|
||||
|
||||
// Display the page
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
echo $OUTPUT->heading(get_string('managemessageoutputs', 'message'));
|
||||
echo $messageoutputs;
|
||||
echo $OUTPUT->footer();
|
||||
@@ -103,7 +103,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
|
||||
$usernames = explode(',', $form->username);
|
||||
|
||||
foreach ($usernames as $username) {
|
||||
$username = trim(textlib::strtolower($username));
|
||||
$username = trim(moodle_strtolower($username));
|
||||
if (!empty($username)) {
|
||||
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
|
||||
if ($form->accessctrl == 'allow') {
|
||||
@@ -203,18 +203,17 @@ echo get_string('username') . ":\n";
|
||||
if (!empty($formerror['username'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::label(get_string('username'), 'menuusername', false, array('class' => 'accesshide'));
|
||||
echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
|
||||
echo '<input type="text" name="username" size="20" maxlength="100" />';
|
||||
|
||||
// choose a remote host
|
||||
echo " " . html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id') . ":\n";
|
||||
echo " " . get_string('remotehost', 'mnet') . ":\n";
|
||||
if (!empty($formerror['mnet_host_id'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::select($mnethosts, 'mnet_host_id');
|
||||
|
||||
// choose an access level
|
||||
echo " " . html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl') . ":\n";
|
||||
echo " " . get_string('accesslevel', 'mnet') . ":\n";
|
||||
if (!empty($formerror['accessctrl'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
|
||||
@@ -141,10 +141,10 @@ class mnet_review_host_form extends moodleform {
|
||||
|
||||
if ($mnet_peer && !empty($mnet_peer->deleted)) {
|
||||
$radioarray = array();
|
||||
$radioarray[] = $mform->createElement('static', 'deletedinfo', '',
|
||||
$radioarray[] = MoodleQuickForm::createElement('static', 'deletedinfo', '',
|
||||
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
|
||||
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1);
|
||||
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0);
|
||||
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('yes'), 1);
|
||||
$radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('no'), 0);
|
||||
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'deleted');
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* An oauth2 redirection endpoint which can be used for an application:
|
||||
* http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
|
||||
*
|
||||
* This is used because some oauth servers will not allow a redirect urls
|
||||
* with get params (like repository callback) and that needs to be called
|
||||
* using the state param.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Dan Poltawski
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
// The state parameter we've given (used in moodle as a redirect url).
|
||||
$state = required_param('state', PARAM_LOCALURL);
|
||||
|
||||
$redirecturl = new moodle_url($state);
|
||||
$params = $redirecturl->params();
|
||||
|
||||
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
|
||||
$redirecturl->param('oauth2code', $code);
|
||||
redirect($redirecturl);
|
||||
} else {
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
+1
-13
@@ -30,17 +30,5 @@ require_once($CFG->libdir . '/pluginlib.php');
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
|
||||
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
$checker = available_update_checker::instance();
|
||||
|
||||
if ($fetchremote) {
|
||||
require_sesskey();
|
||||
$checker->fetch();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->plugin_management_page($pluginman, $checker);
|
||||
echo $output->plugin_management_page(plugin_manager::instance());
|
||||
|
||||
@@ -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), '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ $hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
$error = optional_param('error', '', PARAM_ALPHANUM);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
if (!empty($error) and $error == 'urlalreadyexist') {
|
||||
throw new moodle_exception('urlalreadyregistered', 'hub',
|
||||
|
||||
@@ -236,7 +236,6 @@ class site_registration_form extends moodleform {
|
||||
$geolocation = get_config('hub', 'site_geolocation_' . $cleanhuburl);
|
||||
$contactable = get_config('hub', 'site_contactable_' . $cleanhuburl);
|
||||
$emailalert = get_config('hub', 'site_emailalert_' . $cleanhuburl);
|
||||
$emailalert = ($emailalert === 0) ? 0 : 1;
|
||||
$coursesnumber = get_config('hub', 'site_coursesnumber_' . $cleanhuburl);
|
||||
$usersnumber = get_config('hub', 'site_usersnumber_' . $cleanhuburl);
|
||||
$roleassignmentsnumber = get_config('hub', 'site_roleassignmentsnumber_' . $cleanhuburl);
|
||||
@@ -280,6 +279,9 @@ class site_registration_form extends moodleform {
|
||||
$mform->setType('description', PARAM_TEXT);
|
||||
$mform->addHelpButton('description', 'sitedesc', 'hub');
|
||||
|
||||
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
$languages = get_string_manager()->get_list_of_languages();
|
||||
collatorlib::asort($languages);
|
||||
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
|
||||
@@ -288,6 +290,16 @@ class site_registration_form extends moodleform {
|
||||
$mform->addHelpButton('language', 'sitelang', 'hub');
|
||||
$mform->setDefault('language', $language);
|
||||
|
||||
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
|
||||
$mform->addElement('hidden', 'moodleversion', $CFG->version);
|
||||
$mform->setType('moodleversion', PARAM_INT);
|
||||
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
|
||||
|
||||
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
|
||||
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
|
||||
$mform->setType('moodlerelease', PARAM_TEXT);
|
||||
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
|
||||
|
||||
$mform->addElement('textarea', 'address', get_string('postaladdress', 'hub'),
|
||||
array('rows' => 4, 'cols' => 41));
|
||||
$mform->setType('address', PARAM_TEXT);
|
||||
@@ -348,20 +360,6 @@ class site_registration_form extends moodleform {
|
||||
//TODO site logo
|
||||
$mform->addElement('hidden', 'imageurl', ''); //TODO: temporary
|
||||
$mform->setType('imageurl', PARAM_URL);
|
||||
|
||||
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $CFG->wwwroot);
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
$mform->addElement('static', 'versionstring', get_string('siteversion', 'hub'), $CFG->version);
|
||||
$mform->addElement('hidden', 'moodleversion', $CFG->version);
|
||||
$mform->setType('moodleversion', PARAM_INT);
|
||||
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
|
||||
|
||||
$mform->addElement('static', 'releasestring', get_string('siterelease', 'hub'), $CFG->release);
|
||||
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
|
||||
$mform->setType('moodlerelease', PARAM_TEXT);
|
||||
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
|
||||
|
||||
/// Display statistic that are going to be retrieve by the hub
|
||||
$coursecount = $DB->count_records('course') - 1;
|
||||
$usercount = $DB->count_records('user', array('deleted' => 0));
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/*
|
||||
* @package moodle
|
||||
* @subpackage registration
|
||||
* @author Jerome Mouneyrac <jerome@mouneyrac.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* Thsi page displays a hub selector or a hub URL + password. Then it will redirect to
|
||||
* the site registration form (with the selected hub as parameter)
|
||||
*/
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/forms.php');
|
||||
|
||||
admin_externalpage_setup('registrationselector');
|
||||
|
||||
$hubselectorform = new hub_selector_form();
|
||||
$fromform = $hubselectorform->get_data();
|
||||
|
||||
//// Redirect to the registration form if an URL has been choosen ////
|
||||
|
||||
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
|
||||
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
|
||||
$password = optional_param('password', '', PARAM_RAW);
|
||||
|
||||
if (!empty($unlistedhuburl)) {
|
||||
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
|
||||
$huburl = $unlistedhuburl;
|
||||
}
|
||||
} else if (!empty($selectedhuburl)) {
|
||||
$huburl = $selectedhuburl;
|
||||
}
|
||||
|
||||
|
||||
//redirect
|
||||
if (!empty($huburl) and confirm_sesskey()) {
|
||||
$hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
|
||||
$params = array('sesskey' => sesskey(), 'huburl' => $huburl,
|
||||
'password' => $password, 'hubname' => $hubname);
|
||||
redirect(new moodle_url($CFG->wwwroot."/" . $CFG->admin . "/registration/register.php",
|
||||
$params));
|
||||
}
|
||||
|
||||
|
||||
//// OUTPUT ////
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
|
||||
$hubselectorform->display();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -22,9 +22,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* On this page the administrator selects which hub he wants to register,
|
||||
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
|
||||
* On this page the administrator can also unregister from any hubs, including MOOCH.
|
||||
* On this page the administrator select if he wants to register on Moodle.org or
|
||||
* a specific hub
|
||||
*/
|
||||
|
||||
require('../../config.php');
|
||||
@@ -35,7 +34,7 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/course/publish/lib.php');
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$renderer = $PAGE->get_renderer('core', 'register');
|
||||
|
||||
@@ -127,15 +126,13 @@ if (empty($cancel) and $unregistration and $confirm and confirm_sesskey()) {
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
if (empty($cancel) and $unregistration and !$confirm) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
|
||||
$hub = $registrationmanager->get_registeredhub($huburl);
|
||||
echo $OUTPUT->heading(get_string('unregisterfrom', 'hub', $hub->hubname), 3, 'main');
|
||||
if ($cleanregdata) {
|
||||
@@ -145,7 +142,6 @@ if (empty($cancel) and $unregistration and !$confirm) {
|
||||
$siteunregistrationform = new site_unregistration_form('',
|
||||
array('huburl' => $huburl, 'hubname' => $hub->hubname));
|
||||
}
|
||||
|
||||
$siteunregistrationform->display();
|
||||
} else {
|
||||
$registeredonmoodleorg = false;
|
||||
@@ -154,49 +150,8 @@ if (empty($cancel) and $unregistration and !$confirm) {
|
||||
$registeredonmoodleorg = true;
|
||||
}
|
||||
|
||||
// load the hub selector form
|
||||
$hubselectorform = new hub_selector_form();
|
||||
$fromform = $hubselectorform->get_data();
|
||||
$selectedhuburl = optional_param('publichub', false, PARAM_URL);
|
||||
$unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
|
||||
$password = optional_param('password', '', PARAM_RAW);
|
||||
$registeringhuburl = null;
|
||||
if (!empty($unlistedhuburl)) {
|
||||
if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
|
||||
$registeringhuburl = $unlistedhuburl;
|
||||
}
|
||||
} else if (!empty($selectedhuburl)) {
|
||||
$registeringhuburl = $selectedhuburl;
|
||||
}
|
||||
|
||||
// a hub has been selected, redirect to the hub registration page
|
||||
if (empty($cancel) and !empty($registeringhuburl) and confirm_sesskey()) {
|
||||
$hubname = optional_param(clean_param($registeringhuburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
|
||||
$params = array('sesskey' => sesskey(), 'huburl' => $registeringhuburl,
|
||||
'password' => $password, 'hubname' => $hubname);
|
||||
redirect(new moodle_url($CFG->wwwroot . "/" . $CFG->admin . "/registration/register.php",
|
||||
$params));
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
//check if the site is registered on Moodle.org and display a message about registering on MOOCH
|
||||
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
|
||||
if (empty($registered)) {
|
||||
$warningmsg = get_string('registermoochtips', 'hub');
|
||||
$warningmsg .= $renderer->single_button(new moodle_url('register.php', array('huburl' => HUB_MOODLEORGHUBURL
|
||||
, 'hubname' => 'Moodle.org')), get_string('register', 'admin'));
|
||||
echo $renderer->box($warningmsg, 'buttons mdl-align generalbox adminwarning');
|
||||
}
|
||||
|
||||
//do not check sesskey if confirm = false because this script is linked into email message
|
||||
if (!empty($errormessage)) {
|
||||
echo $OUTPUT->notification(get_string('unregistrationerror', 'hub', $errormessage));
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('registerwith', 'hub'));
|
||||
|
||||
$hubselectorform->display();
|
||||
echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
|
||||
echo $renderer->registrationselector($registeredonmoodleorg);
|
||||
|
||||
if (extension_loaded('xmlrpc')) {
|
||||
$hubs = $registrationmanager->get_registered_on_hubs();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* This page displays the site registration form for Moodle.org/MOOCH or for a different hub.
|
||||
* This page displays the site registration form.
|
||||
* It handles redirection to the hub to continue the registration workflow process.
|
||||
* It also handles update operation by web service.
|
||||
*/
|
||||
@@ -39,17 +39,15 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
||||
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) { // register to Moodle.org
|
||||
admin_externalpage_setup('registrationmoodleorg');
|
||||
} else { //register to a hub
|
||||
admin_externalpage_setup('registrationhub');
|
||||
}
|
||||
|
||||
$password = optional_param('password', '', PARAM_TEXT);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
if (!confirm_sesskey()) {
|
||||
throw new moodle_exception('missingparameter');
|
||||
}
|
||||
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
@@ -147,12 +145,5 @@ if (!empty($error)) {
|
||||
echo $error;
|
||||
}
|
||||
|
||||
//some Moodle.org resitration explanation
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) {
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
|
||||
$renderer = $PAGE->get_renderer('core', 'register');
|
||||
echo $renderer->moodleorg_registration_message();
|
||||
}
|
||||
|
||||
$siteregistrationform->display();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -30,23 +30,6 @@
|
||||
*/
|
||||
class core_register_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display Moodle.org registration message about benefit to register on Moodle.org
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function moodleorg_registration_message() {
|
||||
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
|
||||
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
|
||||
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'MOOCH');
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
|
||||
$items = array(get_string('registermoodleorgli1', 'admin'),
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
|
||||
get_string('registermoodleorgli3', 'admin', $moochurl));
|
||||
$moodleorgregmsg .= html_writer::alist($items);
|
||||
return $moodleorgregmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a box message confirming a site registration (add or update)
|
||||
* @param string $confirmationmessage
|
||||
@@ -59,6 +42,57 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return $this->output->box($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the page to register on Moodle.org or on a specific hub
|
||||
*/
|
||||
public function registrationselector($updatemoodleorg = false) {
|
||||
global $CFG;
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('moodleorg', 'hub'), get_string('specifichub', 'hub'));
|
||||
$table->size = array('50%', '50%');
|
||||
//$table->attributes['class'] = 'registerindextable';
|
||||
//Moodle.org information cell
|
||||
$moodleorgcell = get_string('moodleorgregistrationdetail', 'hub');
|
||||
$moodleorgcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$moodleorgcell = html_writer::tag('div', $moodleorgcell, array('class' => 'justifytext'));
|
||||
|
||||
//Specific hub information cell
|
||||
$specifichubcell = get_string('specifichubregistrationdetail', 'hub');
|
||||
$specifichubcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$specifichubcell = html_writer::tag('div', $specifichubcell, array('class' => 'justifytext'));
|
||||
|
||||
//add information cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
//Moodle.org button cell
|
||||
$registeronmoodleorgurl = new moodle_url("/" . $CFG->admin . "/registration/register.php",
|
||||
array('sesskey' => sesskey(), 'huburl' => HUB_MOODLEORGHUBURL
|
||||
, 'hubname' => 'Moodle.org'));
|
||||
$registeronmoodleorgbutton = new single_button($registeronmoodleorgurl,
|
||||
$updatemoodleorg ? get_string('updatesite', 'hub', 'Moodle.org') : get_string('registeronmoodleorg', 'hub'));
|
||||
$registeronmoodleorgbutton->class = 'centeredbutton';
|
||||
$registeronmoodleorgbuttonhtml = $this->output->render($registeronmoodleorgbutton);
|
||||
$moodleorgcell = $registeronmoodleorgbuttonhtml;
|
||||
|
||||
//Specific hub button cell
|
||||
$registeronspecifichuburl = new moodle_url("/" . $CFG->admin . "/registration/hubselector.php",
|
||||
array('sesskey' => sesskey()));
|
||||
$registeronspecifichubbutton = new single_button($registeronspecifichuburl,
|
||||
get_string('registeronspecifichub', 'hub'));
|
||||
$registeronspecifichubbutton->class = 'centeredbutton';
|
||||
$registeronspecifichubbuttonhtml = $this->output->render($registeronspecifichubbutton);
|
||||
$specifichubcell = $registeronspecifichubbuttonhtml;
|
||||
|
||||
//add button cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the listing of registered on hub
|
||||
*/
|
||||
|
||||
@@ -39,7 +39,7 @@ $url = optional_param('url', '', PARAM_URL);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
//check that we are waiting a confirmation from this hub, and check that the token is correct
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
+50
-366
@@ -57,26 +57,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display page explaining proper upgrade process,
|
||||
* there can not be any PHP file leftovers...
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_stale_php_files_page() {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('upgradestalefiles', 'admin'));
|
||||
$output .= $this->box_start('generalbox', 'notice');
|
||||
$output .= format_text(get_string('upgradestalefilesinfo', 'admin', get_docs_url('Upgrading')), FORMAT_MARKDOWN);
|
||||
$output .= html_writer::empty_tag('br');
|
||||
$output .= html_writer::tag('div', $this->single_button($this->page->url, get_string('reload'), 'get'), array('class' => 'buttons'));
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'environment check' page that is displayed during install.
|
||||
* @param int $maturity
|
||||
@@ -107,29 +87,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the list of plugins with unsatisfied dependencies
|
||||
*
|
||||
* @param double|string|int $version Moodle on-disk version
|
||||
* @param array $failed list of plugins with unsatisfied dependecies
|
||||
* @param moodle_url $reloadurl URL of the page to recheck the dependencies
|
||||
* @return string HTML
|
||||
*/
|
||||
public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginscheck', 'admin'));
|
||||
$output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
$output .= $this->plugins_check_table(plugin_manager::instance(), $version, array('xdep' => true));
|
||||
$output .= $this->warning(get_string('pluginschecktodo', 'admin'));
|
||||
$output .= $this->continue_button($reloadurl);
|
||||
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'You are about to upgrade Moodle' page. The first page
|
||||
* during upgrade.
|
||||
@@ -188,47 +145,30 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
/**
|
||||
* Display the upgrade page that lists all the plugins that require attention.
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param available_update_checker $checker provides information about available updates.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param bool $showallplugins
|
||||
* @param moodle_url $reloadurl
|
||||
* @param moodle_url $continueurl
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_plugin_check_page(plugin_manager $pluginman, available_update_checker $checker,
|
||||
$version, $showallplugins, $reloadurl, $continueurl) {
|
||||
global $CFG;
|
||||
|
||||
public function upgrade_plugin_check_page(plugin_manager $pluginman, $version, $showallplugins, $reloadurl, $continueurl) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->box_start('generalbox');
|
||||
$output .= $this->container_start('generalbox', 'notice');
|
||||
$output .= html_writer::tag('p', get_string('pluginchecknotice', 'core_plugin'));
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$output .= $this->container_start('checkforupdates');
|
||||
$output .= $this->single_button(new moodle_url($reloadurl, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||
if ($timefetched = $checker->get_last_timefetched()) {
|
||||
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->container(get_string('pluginchecknotice', 'core_plugin'), 'generalbox', 'notice');
|
||||
$output .= $this->plugins_check_table($pluginman, $version, array('full' => $showallplugins));
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->upgrade_reload($reloadurl);
|
||||
|
||||
if ($pluginman->some_plugins_updatable()) {
|
||||
$output .= $this->container_start('upgradepluginsinfo');
|
||||
$output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
|
||||
$output .= $this->container_end();
|
||||
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');
|
||||
}
|
||||
|
||||
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
|
||||
$button->class = 'continuebutton';
|
||||
$output .= $this->render($button);
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
@@ -242,28 +182,19 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* @param bool $cronoverdue warn cron not running
|
||||
* @param bool $dbproblems warn db has problems
|
||||
* @param bool $maintenancemode warn in maintenance mode
|
||||
* @param bool $buggyiconvnomb warn iconv problems
|
||||
* @param array|null $availableupdates array of available_update_info objects or null
|
||||
* @param int|null $availableupdatesfetch timestamp of the most recent updates fetch or null (unknown)
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch,
|
||||
$buggyiconvnomb, $registered) {
|
||||
global $CFG;
|
||||
$cronoverdue, $dbproblems, $maintenancemode) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->maturity_info($maturity);
|
||||
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
|
||||
$output .= $this->insecure_dataroot_warning($insecuredataroot);
|
||||
$output .= $this->display_errors_warning($errorsdisplayed);
|
||||
$output .= $this->buggy_iconv_warning($buggyiconvnomb);
|
||||
$output .= $this->cron_overdue_warning($cronoverdue);
|
||||
$output .= $this->db_problems($dbproblems);
|
||||
$output .= $this->maintenance_mode_warning($maintenancemode);
|
||||
$output .= $this->registration_warning($registered);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
|
||||
@@ -277,31 +208,17 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Display the plugin management page (admin/plugins.php).
|
||||
*
|
||||
* @param plugin_manager $pluginman
|
||||
* @param available_update_checker $checker
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function plugin_management_page(plugin_manager $pluginman, available_update_checker $checker) {
|
||||
global $CFG;
|
||||
|
||||
public function plugin_management_page(plugin_manager $pluginman) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginsoverview', 'core_admin'));
|
||||
$output .= $this->plugins_overview_panel($pluginman);
|
||||
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$output .= $this->container_start('checkforupdates');
|
||||
$output .= $this->single_button(new moodle_url($this->page->url, array('fetchremote' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||
if ($timefetched = $checker->get_last_timefetched()) {
|
||||
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$output .= $this->box($this->plugins_control_panel($pluginman), 'generalbox');
|
||||
$output .= $this->box_start('generalbox');
|
||||
$output .= $this->plugins_control_panel($pluginman);
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
@@ -385,19 +302,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $this->warning(get_string('displayerrorswarning', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if iconv is buggy and mbstring missing.
|
||||
* @param bool $buggyiconvnomb
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function buggy_iconv_warning($buggyiconvnomb) {
|
||||
if (!$buggyiconvnomb) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning(get_string('warningiconvbuggy', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if cron has not been run recently.
|
||||
* @param bool $cronoverdue
|
||||
@@ -491,105 +395,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return $this->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$this->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo maturity'.$maturity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the info about available Moodle updates
|
||||
*
|
||||
* @param array|null $updates array of available_update_info objects or null
|
||||
* @param int|null $fetch timestamp of the most recent updates fetch or null (unknown)
|
||||
* @return string
|
||||
*/
|
||||
protected function available_updates($updates, $fetch) {
|
||||
|
||||
$updateinfo = $this->box_start('generalbox adminwarning availableupdatesinfo');
|
||||
if (is_array($updates)) {
|
||||
$updateinfo .= $this->heading(get_string('updateavailable', 'core_admin'), 3);
|
||||
foreach ($updates as $update) {
|
||||
$updateinfo .= $this->moodle_available_update_info($update);
|
||||
}
|
||||
} else {
|
||||
$now = time();
|
||||
if ($fetch and ($fetch <= $now) and ($now - $fetch < HOURSECS)) {
|
||||
$updateinfo .= $this->heading(get_string('updateavailablenot', 'core_admin'), 3);
|
||||
}
|
||||
}
|
||||
|
||||
$updateinfo .= $this->container_start('checkforupdates');
|
||||
$updateinfo .= $this->single_button(new moodle_url($this->page->url, array('fetchupdates' => 1)), get_string('checkforupdates', 'core_plugin'));
|
||||
if ($fetch) {
|
||||
$updateinfo .= $this->container(get_string('checkforupdateslast', 'core_plugin',
|
||||
userdate($fetch, get_string('strftimedatetime', 'core_langconfig'))));
|
||||
}
|
||||
$updateinfo .= $this->container_end();
|
||||
|
||||
$updateinfo .= $this->box_end();
|
||||
|
||||
return $updateinfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a warning about not being registered on Moodle.org if necesary.
|
||||
*
|
||||
* @param boolean $registered true if the site is registered on Moodle.org
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function registration_warning($registered) {
|
||||
|
||||
if (!$registered) {
|
||||
|
||||
$registerbutton = $this->single_button(new moodle_url('registration/register.php',
|
||||
array('huburl' => HUB_MOODLEORGHUBURL, 'hubname' => 'Moodle.org')),
|
||||
get_string('register', 'admin'));
|
||||
|
||||
return $this->warning( get_string('registrationwarning', 'admin')
|
||||
. ' ' . $this->help_icon('registration', 'admin') . $registerbutton );
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to render the information about the available Moodle update
|
||||
*
|
||||
* @param available_update_info $updateinfo information about the available Moodle core update
|
||||
*/
|
||||
protected function moodle_available_update_info(available_update_info $updateinfo) {
|
||||
|
||||
$boxclasses = 'moodleupdateinfo';
|
||||
$info = array();
|
||||
|
||||
if (isset($updateinfo->release)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_release', 'core_admin', $updateinfo->release),
|
||||
array('class' => 'info release'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->version)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_version', 'core_admin', $updateinfo->version),
|
||||
array('class' => 'info version'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->maturity)) {
|
||||
$info[] = html_writer::tag('span', get_string('maturity'.$updateinfo->maturity, 'core_admin'),
|
||||
array('class' => 'info maturity'));
|
||||
$boxclasses .= ' maturity'.$updateinfo->maturity;
|
||||
}
|
||||
|
||||
if (isset($updateinfo->download)) {
|
||||
$info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->url)) {
|
||||
$info[] = html_writer::link($updateinfo->url, get_string('updateavailable_moreinfo', 'core_plugin'),
|
||||
array('class' => 'info more'));
|
||||
}
|
||||
|
||||
$box = $this->output->box_start($boxclasses);
|
||||
$box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
|
||||
$box .= $this->output->box_end();
|
||||
|
||||
return $box;
|
||||
'generalbox adminwarning maturityinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -620,24 +426,24 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* This default implementation renders all plugins into one big table. The rendering
|
||||
* options support:
|
||||
* (bool)full = false: whether to display up-to-date plugins, too
|
||||
* (bool)xdep = false: display the plugins with unsatisified dependecies only
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins.
|
||||
* @param int $version the version of the Moodle code from version.php.
|
||||
* @param array $options rendering options
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = array()) {
|
||||
global $CFG;
|
||||
|
||||
public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) {
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$options['full'] = isset($options['full']) ? (bool)$options['full'] : false;
|
||||
$options['xdep'] = isset($options['xdep']) ? (bool)$options['xdep'] : false;
|
||||
if (empty($options)) {
|
||||
$options = array(
|
||||
'full' => false,
|
||||
);
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
$table->id = 'plugins-check';
|
||||
@@ -706,43 +512,23 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$statuscode = $plugin->get_status();
|
||||
$row->attributes['class'] .= ' status-' . $statuscode;
|
||||
$status = get_string('status_' . $statuscode, 'core_plugin');
|
||||
|
||||
$availableupdates = $plugin->available_updates();
|
||||
if (!empty($availableupdates) and empty($CFG->disableupdatenotifications)) {
|
||||
foreach ($availableupdates as $availableupdate) {
|
||||
$status .= $this->plugin_available_update_info($availableupdate);
|
||||
}
|
||||
}
|
||||
|
||||
$status = new html_table_cell($status);
|
||||
$status = new html_table_cell(get_string('status_' . $statuscode, 'core_plugin'));
|
||||
|
||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
||||
|
||||
$statusisboring = in_array($statuscode, array(
|
||||
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
|
||||
|
||||
$coredependency = $plugin->is_core_dependency_satisfied($version);
|
||||
$otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins());
|
||||
$dependenciesok = $coredependency && $otherpluginsdependencies;
|
||||
|
||||
if ($options['xdep']) {
|
||||
// we want to see only plugins with failed dependencies
|
||||
if ($dependenciesok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
|
||||
// no change is going to happen to the plugin - display it only
|
||||
// if the user wants to see the full list
|
||||
$dependenciesok = $pluginman->are_dependencies_satisfied(
|
||||
$plugin->get_other_required_plugins());
|
||||
if ($isstandard and $statusisboring and $dependenciesok) {
|
||||
if (empty($options['full'])) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$numofhighlighted[$type]++;
|
||||
}
|
||||
|
||||
// ok, the plugin should be displayed
|
||||
$numofhighlighted[$type]++;
|
||||
|
||||
$row->cells = array($displayname, $rootdir, $source,
|
||||
$versiondb, $versiondisk, $requires, $status);
|
||||
$plugintyperows[] = $row;
|
||||
@@ -758,11 +544,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
$sumofhighlighted = array_sum($numofhighlighted);
|
||||
|
||||
if ($options['xdep']) {
|
||||
// we do not want to display no heading and links in this mode
|
||||
$out = '';
|
||||
|
||||
} else if ($sumofhighlighted == 0) {
|
||||
if ($sumofhighlighted == 0) {
|
||||
$out = $this->output->container_start('nonehighlighted', 'plugins-check-info');
|
||||
$out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin'));
|
||||
if (empty($options['full'])) {
|
||||
@@ -779,10 +561,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$out .= html_writer::link(new moodle_url('/admin/index.php',
|
||||
array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 1)),
|
||||
get_string('somehighlightedinfo', 'core_plugin'));
|
||||
} else {
|
||||
$out .= html_writer::link(new moodle_url('/admin/index.php',
|
||||
array('confirmupgrade' => 1, 'confirmrelease' => 1, 'showallplugins' => 0)),
|
||||
get_string('somehighlightedonly', 'core_plugin'));
|
||||
}
|
||||
$out .= $this->output->container_end();
|
||||
}
|
||||
@@ -796,12 +574,12 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Formats the information that needs to go in the 'Requires' column.
|
||||
* @param plugininfo_base $plugin the plugin we are rendering the row for.
|
||||
* @param plugin_information $plugin the plugin we are rendering the row for.
|
||||
* @param plugin_manager $pluginman provides data on all the plugins.
|
||||
* @param string $version
|
||||
* @return string HTML code
|
||||
*/
|
||||
protected function required_column(plugininfo_base $plugin, plugin_manager $pluginman, $version) {
|
||||
protected function required_column(plugin_information $plugin, plugin_manager $pluginman, $version) {
|
||||
$requires = array();
|
||||
|
||||
if (!empty($plugin->versionrequires)) {
|
||||
@@ -848,48 +626,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return html_writer::tag('ul', implode("\n", $requires));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an overview about the plugins - number of installed, number of extensions etc.
|
||||
*
|
||||
* @param plugin_manager $pluginman provides information about the plugins
|
||||
* @return string as usually
|
||||
*/
|
||||
public function plugins_overview_panel(plugin_manager $pluginman) {
|
||||
global $CFG;
|
||||
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
$numtotal = $numdisabled = $numextension = $numupdatable = 0;
|
||||
|
||||
foreach ($plugininfo as $type => $plugins) {
|
||||
foreach ($plugins as $name => $plugin) {
|
||||
if ($plugin->get_status() === plugin_manager::PLUGIN_STATUS_MISSING) {
|
||||
continue;
|
||||
}
|
||||
$numtotal++;
|
||||
if ($plugin->is_enabled() === false) {
|
||||
$numdisabled++;
|
||||
}
|
||||
if (!$plugin->is_standard()) {
|
||||
$numextension++;
|
||||
}
|
||||
if (empty($CFG->disableupdatenotifications) and $plugin->available_updates()) {
|
||||
$numupdatable++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info = array();
|
||||
$info[] = html_writer::tag('span', get_string('numtotal', 'core_plugin', $numtotal), array('class' => 'info total'));
|
||||
$info[] = html_writer::tag('span', get_string('numdisabled', 'core_plugin', $numdisabled), array('class' => 'info disabled'));
|
||||
$info[] = html_writer::tag('span', get_string('numextension', 'core_plugin', $numextension), array('class' => 'info extension'));
|
||||
if ($numupdatable > 0) {
|
||||
$info[] = html_writer::tag('span', get_string('numupdatable', 'core_plugin', $numupdatable), array('class' => 'info updatable'));
|
||||
}
|
||||
|
||||
return $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '', 'plugins-overview-panel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays all known plugins and links to manage them
|
||||
*
|
||||
@@ -899,8 +635,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_control_panel(plugin_manager $pluginman) {
|
||||
global $CFG;
|
||||
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
@@ -911,14 +645,15 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$table->id = 'plugins-control-panel';
|
||||
$table->head = array(
|
||||
get_string('displayname', 'core_plugin'),
|
||||
get_string('systemname', 'core_plugin'),
|
||||
get_string('source', 'core_plugin'),
|
||||
get_string('version', 'core_plugin'),
|
||||
get_string('availability', 'core_plugin'),
|
||||
get_string('actions', 'core_plugin'),
|
||||
get_string('notes','core_plugin'),
|
||||
get_string('settings', 'core_plugin'),
|
||||
get_string('uninstall','core_plugin'),
|
||||
);
|
||||
$table->colclasses = array(
|
||||
'pluginname', 'source', 'version', 'availability', 'actions', 'notes'
|
||||
'displayname', 'systemname', 'source', 'version', 'availability', 'settings', 'uninstall',
|
||||
);
|
||||
|
||||
foreach ($plugininfo as $type => $plugins) {
|
||||
@@ -954,9 +689,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$msg = '';
|
||||
}
|
||||
$pluginname = html_writer::tag('div', $icon . ' ' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
|
||||
html_writer::tag('div', $plugin->component, array('class' => 'componentname'));
|
||||
$pluginname = new html_table_cell($pluginname);
|
||||
$displayname = $icon . ' ' . $plugin->displayname . ' ' . $msg;
|
||||
$displayname = new html_table_cell($displayname);
|
||||
|
||||
$systemname = new html_table_cell($plugin->type . '_' . $plugin->name);
|
||||
|
||||
if ($plugin->is_standard()) {
|
||||
$row->attributes['class'] .= ' standard';
|
||||
@@ -981,39 +717,28 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$availability = new html_table_cell($icon . ' ' . get_string('plugindisabled', 'core_plugin'));
|
||||
}
|
||||
|
||||
$actions = array();
|
||||
|
||||
$settingsurl = $plugin->get_settings_url();
|
||||
if (!is_null($settingsurl)) {
|
||||
$actions[] = html_writer::link($settingsurl, get_string('settings', 'core_plugin'), array('class' => 'settings'));
|
||||
if (is_null($settingsurl)) {
|
||||
$settings = new html_table_cell('');
|
||||
} else {
|
||||
$settings = html_writer::link($settingsurl, get_string('settings', 'core_plugin'));
|
||||
$settings = new html_table_cell($settings);
|
||||
}
|
||||
|
||||
$uninstallurl = $plugin->get_uninstall_url();
|
||||
if (!is_null($uninstallurl)) {
|
||||
$actions[] = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'), array('class' => 'uninstall'));
|
||||
}
|
||||
|
||||
$actions = new html_table_cell(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $actions));
|
||||
|
||||
$requriedby = $pluginman->other_plugins_that_require($plugin->component);
|
||||
if ($requriedby) {
|
||||
$requiredby = html_writer::tag('div', get_string('requiredby', 'core_plugin', implode(', ', $requriedby)),
|
||||
array('class' => 'requiredby'));
|
||||
if (is_null($uninstallurl)) {
|
||||
$uninstall = new html_table_cell('');
|
||||
} else if ($requriedby) {
|
||||
$uninstall = new html_table_cell(get_string('requiredby', 'core_plugin', implode(', ', $requriedby)));
|
||||
$uninstall->attributes['class'] = 'requiredby';
|
||||
} else {
|
||||
$requiredby = '';
|
||||
$uninstall = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'));
|
||||
$uninstall = new html_table_cell($uninstall);
|
||||
}
|
||||
|
||||
$updateinfo = '';
|
||||
if (empty($CFG->disableupdatenotifications) and is_array($plugin->available_updates())) {
|
||||
foreach ($plugin->available_updates() as $availableupdate) {
|
||||
$updateinfo .= $this->plugin_available_update_info($availableupdate);
|
||||
}
|
||||
}
|
||||
|
||||
$notes = new html_table_cell($requiredby.$updateinfo);
|
||||
|
||||
$row->cells = array(
|
||||
$pluginname, $source, $version, $availability, $actions, $notes
|
||||
$displayname, $systemname, $source, $version, $availability, $settings, $uninstall
|
||||
);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
@@ -1022,47 +747,6 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to render the information about the available plugin update
|
||||
*
|
||||
* The passed objects always provides at least the 'version' property containing
|
||||
* the (higher) version of the plugin available.
|
||||
*
|
||||
* @param available_update_info $updateinfo information about the available update for the plugin
|
||||
*/
|
||||
protected function plugin_available_update_info(available_update_info $updateinfo) {
|
||||
|
||||
$boxclasses = 'pluginupdateinfo';
|
||||
$info = array();
|
||||
|
||||
if (isset($updateinfo->release)) {
|
||||
$info[] = html_writer::tag('span', get_string('updateavailable_release', 'core_plugin', $updateinfo->release),
|
||||
array('class' => 'info release'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->maturity)) {
|
||||
$info[] = html_writer::tag('span', get_string('maturity'.$updateinfo->maturity, 'core_admin'),
|
||||
array('class' => 'info maturity'));
|
||||
$boxclasses .= ' maturity'.$updateinfo->maturity;
|
||||
}
|
||||
|
||||
if (isset($updateinfo->download)) {
|
||||
$info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
|
||||
}
|
||||
|
||||
if (isset($updateinfo->url)) {
|
||||
$info[] = html_writer::link($updateinfo->url, get_string('updateavailable_moreinfo', 'core_plugin'),
|
||||
array('class' => 'info more'));
|
||||
}
|
||||
|
||||
$box = $this->output->box_start($boxclasses);
|
||||
$box .= html_writer::tag('div', get_string('updateavailable', 'core_plugin', $updateinfo->version), array('class' => 'version'));
|
||||
$box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
|
||||
$box .= $this->output->box_end();
|
||||
|
||||
return $box;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will render one beautiful table with all the environmental
|
||||
* configuration and how it suits Moodle needs.
|
||||
|
||||
+11
-59
@@ -1,27 +1,12 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
$repository = optional_param('repos', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
$display = true; // fall through to normal display
|
||||
|
||||
@@ -57,10 +42,6 @@ $configstr = get_string('manage', 'repository');
|
||||
|
||||
$return = true;
|
||||
|
||||
if (!empty($action)) {
|
||||
require_sesskey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that generates a moodle_url object
|
||||
* relevant to the repository
|
||||
@@ -171,10 +152,10 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
|
||||
// Display instances list and creation form
|
||||
if ($action == 'edit') {
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(context_system::instance(), $repository);
|
||||
}
|
||||
$instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
|
||||
if (!empty($instanceoptionnames)) {
|
||||
repository::display_instances_list(get_context_instance(CONTEXT_SYSTEM), $repository);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($action == 'show') {
|
||||
@@ -204,8 +185,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
|
||||
if ($repositorytype->delete($downloadcontents)) {
|
||||
if ($repositorytype->delete()) {
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
@@ -213,34 +193,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
exit;
|
||||
} else {
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$message = get_string('confirmremove', 'repository', $repositorytype->get_readablename());
|
||||
|
||||
$output = $OUTPUT->box_start('generalbox', 'notice');
|
||||
$output .= html_writer::tag('p', $message);
|
||||
|
||||
$removeurl = new moodle_url($sesskeyurl);
|
||||
$removeurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos' => $repository,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
|
||||
$removeanddownloadurl = new moodle_url($sesskeyurl);
|
||||
$removeanddownloadurl->params(array(
|
||||
'action' =>'delete',
|
||||
'repos'=> $repository,
|
||||
'sure' => 'yes',
|
||||
'downloadcontents' => 1,
|
||||
));
|
||||
|
||||
$output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository'));
|
||||
$output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
$output .= $OUTPUT->single_button($baseurl, get_string('cancel'));
|
||||
$output .= $OUTPUT->box_end();
|
||||
|
||||
echo $output;
|
||||
|
||||
echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&action=delete&repos=' . $repository . '&sure=yes', $baseurl);
|
||||
$return = false;
|
||||
}
|
||||
} else if ($action == 'moveup') {
|
||||
@@ -302,7 +255,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Calculate number of instances in order to display them for the Moodle administrator
|
||||
if (!empty($instanceoptionnames)) {
|
||||
$params = array();
|
||||
$params['context'] = array(context_system::instance());
|
||||
$params['context'] = array(get_system_context());
|
||||
$params['onlyvisible'] = false;
|
||||
$params['type'] = $typename;
|
||||
$admininstancenumber = count(repository::static_function($typename, 'get_instances', $params));
|
||||
@@ -352,7 +305,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
}
|
||||
|
||||
$select = new single_select(repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
|
||||
// Display up/down link
|
||||
$updown = '';
|
||||
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
|
||||
@@ -389,7 +342,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Check that it has not already been listed
|
||||
if (!in_array($plugin, $alreadyplugins)) {
|
||||
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,18 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// id of repository
|
||||
$edit = optional_param('edit', 0, PARAM_INT);
|
||||
$new = optional_param('new', '', PARAM_PLUGIN);
|
||||
$new = optional_param('new', '', PARAM_FORMAT);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$delete = optional_param('delete', 0, PARAM_INT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_PLUGIN);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$pagename = 'repositorycontroller';
|
||||
|
||||
@@ -41,20 +24,16 @@ if ($edit){
|
||||
$pagename = 'repositoryinstancenew';
|
||||
}
|
||||
|
||||
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstance.php'));
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
|
||||
|
||||
$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
|
||||
'sesskey'=>sesskey(),
|
||||
'action'=>'edit',
|
||||
));
|
||||
admin_externalpage_setup($pagename);
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey();
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos=';
|
||||
if ($new) {
|
||||
$parenturl->param('repos', $new);
|
||||
} else {
|
||||
$parenturl->param('repos', $type);
|
||||
$baseurl .= $new;
|
||||
}
|
||||
else {
|
||||
$baseurl .= $type;
|
||||
}
|
||||
|
||||
$return = true;
|
||||
@@ -69,7 +48,7 @@ if (!empty($edit) || !empty($new)) {
|
||||
$typeid = $instance->options['typeid'];
|
||||
} else {
|
||||
$plugin = $new;
|
||||
$typeid = null;
|
||||
$typeid = $new;
|
||||
$instance = null;
|
||||
}
|
||||
|
||||
@@ -78,9 +57,12 @@ if (!empty($edit) || !empty($new)) {
|
||||
// end setup, begin output
|
||||
|
||||
if ($mform->is_cancelled()){
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
exit;
|
||||
} else if ($fromform = $mform->get_data()){
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($edit) {
|
||||
$settings = array();
|
||||
$settings['name'] = $fromform->name;
|
||||
@@ -95,13 +77,13 @@ if (!empty($edit) || !empty($new)) {
|
||||
}
|
||||
$success = $instance->set_option($settings);
|
||||
} else {
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform);
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform);
|
||||
$data = data_submitted();
|
||||
}
|
||||
if ($success) {
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotsaved', 'repository', $parenturl);
|
||||
print_error('instancenotsaved', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -113,6 +95,9 @@ if (!empty($edit) || !empty($new)) {
|
||||
$return = false;
|
||||
}
|
||||
} else if (!empty($hide)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
$instance = repository::get_type_by_typename($hide);
|
||||
$instance->hide();
|
||||
$return = true;
|
||||
@@ -123,38 +108,25 @@ if (!empty($edit) || !empty($new)) {
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
}
|
||||
if ($sure) {
|
||||
if ($instance->delete($downloadcontents)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($instance->delete()) {
|
||||
$deletedstr = get_string('instancedeleted', 'repository');
|
||||
redirect($parenturl, $deletedstr, 3);
|
||||
redirect($baseurl, $deletedstr, 3);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $parenturl);
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
$continueurl = new moodle_url($baseurl, array(
|
||||
'type' => $type,
|
||||
'delete' => $delete,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
$continueanddownloadurl = new moodle_url($continueurl, array(
|
||||
'downloadcontents' => 1
|
||||
));
|
||||
$message = get_string('confirmdelete', 'repository', $instance->name);
|
||||
echo html_writer::tag('p', $message);
|
||||
|
||||
echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository'));
|
||||
echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
echo $OUTPUT->single_button($parenturl, get_string('cancel'));
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
|
||||
$return = false;
|
||||
}
|
||||
|
||||
if (!empty($return)) {
|
||||
redirect($parenturl);
|
||||
|
||||
redirect($baseurl);
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+5
-30
@@ -104,45 +104,20 @@ switch ($context->contextlevel) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the list of the reported-on user's role assignments - must be after
|
||||
// the page setup code above, or the language might be wrong.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
$roleassignments = get_user_roles_with_special($context, $reportuser->id);
|
||||
$rolenames = role_get_names($context);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
// These are needed early because of tabs.php
|
||||
$assignableroles = get_assignable_roles($context, ROLENAME_BOTH);
|
||||
$overridableroles = get_overridable_roles($context, ROLENAME_BOTH);
|
||||
|
||||
// Print heading.
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
// If a user has been chosen, show all the permissions for this user.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
|
||||
|
||||
if (!empty($roleassignments)) {
|
||||
echo $OUTPUT->heading(get_string('rolesforuser', 'role', fullname($reportuser)), 3);
|
||||
echo html_writer::start_tag('ul');
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
foreach ($roleassignments as $ra) {
|
||||
$racontext = context::instance_by_id($ra->contextid);
|
||||
$link = html_writer::link($racontext->get_url(), $racontext->get_context_name());
|
||||
|
||||
$rolename = $rolenames[$ra->roleid]->localname;
|
||||
if (has_capability('moodle/role:manage', $systemcontext)) {
|
||||
$rolename = html_writer::link(new moodle_url('/admin/roles/define.php',
|
||||
array('action' => 'view', 'roleid' => $ra->roleid)), $rolename);
|
||||
}
|
||||
|
||||
echo html_writer::tag('li', get_string('roleincontext', 'role',
|
||||
array('role' => $rolename, 'context' => $link)));
|
||||
}
|
||||
echo html_writer::end_tag('ul');
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('permissionsforuser', 'role', fullname($reportuser)), 3);
|
||||
|
||||
$table = new check_capability_table($context, $reportuser, $contextname);
|
||||
$table->display();
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
+8
-6
@@ -610,8 +610,8 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
$shortname = optional_param('shortname', null, PARAM_RAW);
|
||||
if (!is_null($shortname)) {
|
||||
$this->role->shortname = $shortname;
|
||||
$this->role->shortname = textlib::specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = textlib::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
$this->role->shortname = textlib_get_instance()->specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = moodle_strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
if (empty($this->role->shortname)) {
|
||||
$this->errors['shortname'] = get_string('errorbadroleshortname', 'role');
|
||||
}
|
||||
@@ -1042,10 +1042,12 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
$countfields = 'SELECT COUNT(u.id)';
|
||||
|
||||
$sql = " FROM {user} u
|
||||
LEFT JOIN {role_assignments} ra ON (ra.userid = u.id AND ra.roleid = :roleid AND ra.contextid = :contextid)
|
||||
WHERE u.id IN ($enrolsql)
|
||||
$wherecondition
|
||||
AND ra.id IS NULL";
|
||||
WHERE u.id IN ($enrolsql) $wherecondition
|
||||
AND u.id NOT IN (
|
||||
SELECT r.userid
|
||||
FROM {role_assignments} r
|
||||
WHERE r.contextid = :contextid
|
||||
AND r.roleid = :roleid)";
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$params['contextid'] = $this->context->id;
|
||||
|
||||
@@ -54,17 +54,6 @@ if (!$canview) {
|
||||
print_error('nopermissions', 'error', '', get_string('checkpermissions', 'role'));
|
||||
}
|
||||
|
||||
if ($userid != $USER->id) {
|
||||
// If its not the current user we need to extend the navigation for that user to ensure
|
||||
// their navigation is loaded and this page found upon it.
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
}
|
||||
if ($course->id != $SITE->id || $userid != $USER->id) {
|
||||
// If we're within a course OR if we're viewing another user then we need to include the
|
||||
// settings base on the navigation to ensure that the navbar will contain the users name.
|
||||
$PAGE->navbar->includesettingsbase = true;
|
||||
}
|
||||
|
||||
/// Now get the role assignments for this user.
|
||||
$sql = "SELECT
|
||||
ra.id, ra.userid, ra.contextid, ra.roleid, ra.component, ra.itemid,
|
||||
@@ -131,9 +120,14 @@ $title = get_string('xroleassignments', 'role', $fullname);
|
||||
$PAGE->set_title($title);
|
||||
if ($courseid != SITEID) {
|
||||
$PAGE->set_heading($fullname);
|
||||
if (has_capability('moodle/course:viewparticipants', $coursecontext)) {
|
||||
$PAGE->navbar->add(get_string('participants'),new moodle_url('/user/index.php', array('id'=>$courseid)));
|
||||
}
|
||||
} else {
|
||||
$PAGE->set_heading($course->fullname);
|
||||
}
|
||||
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
|
||||
$PAGE->navbar->add($straction);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title, 3);
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
|
||||
@@ -166,8 +160,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
|
||||
$context = context::instance_by_id($contextid);
|
||||
|
||||
// Print the context name.
|
||||
echo $OUTPUT->heading(html_writer::link($context->get_url(), $context->get_context_name()),
|
||||
4, 'contextname');
|
||||
echo $OUTPUT->heading($context->get_context_name(), 4, 'contextname');
|
||||
|
||||
// If there are any role assignments here, print them.
|
||||
foreach ($contexts[$contextid]->roleassignments as $ra) {
|
||||
@@ -190,7 +183,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->fullname = $fullname;
|
||||
$a->contextlevel = $context->get_level_name();
|
||||
$a->contextlevel = get_contextlevel_name($context->contextlevel);
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM) {
|
||||
$strgoto = get_string('gotoassignsystemroles', 'role');
|
||||
$strcheck = get_string('checksystempermissionsfor', 'role', $a);
|
||||
|
||||
+4
-8
@@ -32,6 +32,7 @@ if (!($settingspage->check_access())) {
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
$focus = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
@@ -46,6 +47,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
$focus = $firsterror->id;
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($section, true);
|
||||
@@ -131,12 +133,6 @@ if (empty($SITE->fullname)) {
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$PAGE->requires->yui_module('moodle-core-formchangechecker',
|
||||
'M.core_formchangechecker.init',
|
||||
array(array(
|
||||
'formid' => 'adminsettings'
|
||||
))
|
||||
);
|
||||
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
|
||||
+83
-127
@@ -4,30 +4,30 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
||||
$ADMIN->add('appearance', new admin_category('themes', get_string('themes')));
|
||||
// "themesettings" settingpage
|
||||
$temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'), new lang_string('configthemelist','admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'), new lang_string('configthemedesignermode', 'admin'), 0);
|
||||
$temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configcheckbox('themedesignermode', get_string('themedesignermode', 'admin'), get_string('configthemedesignermode', 'admin'), 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserthemes', new lang_string('allowuserthemes', 'admin'), new lang_string('configallowuserthemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', new lang_string('allowcoursethemes', 'admin'), new lang_string('configallowcoursethemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', new lang_string('allowcategorythemes', 'admin'), new lang_string('configallowcategorythemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
|
||||
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
|
||||
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', get_string('allowthemechangeonurl', 'admin'), get_string('configallowthemechangeonurl', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('allowblockstodock', get_string('allowblockstodock', 'admin'), get_string('configallowblockstodock', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtextarea('custommenuitems', get_string('custommenuitems', 'admin'), get_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
|
||||
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', get_string('enabledevicedetection', 'admin'), get_string('configenabledevicedetection', 'admin'), 1));
|
||||
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', get_string('devicedetectregex', 'admin'), get_string('devicedetectregex_desc', 'admin'), ''));
|
||||
$ADMIN->add('themes', $temp);
|
||||
$ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
|
||||
$ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
|
||||
|
||||
// settings for each theme
|
||||
foreach (get_plugin_list('theme') as $theme => $themedir) {
|
||||
$settings_path = "$themedir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
$settings = new admin_settingpage('themesetting'.$theme, new lang_string('pluginname', 'theme_'.$theme));
|
||||
$settings = new admin_settingpage('themesetting'.$theme, get_string('pluginname', 'theme_'.$theme));
|
||||
include($settings_path);
|
||||
if ($settings) {
|
||||
$ADMIN->add('themes', $settings);
|
||||
@@ -37,165 +37,121 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// calendar
|
||||
$temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
|
||||
$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
|
||||
$temp->add(new admin_setting_special_adminseesall());
|
||||
//this is hacky because we do not want to include the stuff from calendar/lib.php
|
||||
$temp->add(new admin_setting_configselect('calendar_site_timeformat', new lang_string('pref_timeformat', 'calendar'),
|
||||
new lang_string('explain_site_timeformat', 'calendar'), '0',
|
||||
array('0' => new lang_string('default', 'calendar'),
|
||||
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
|
||||
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
|
||||
$temp->add(new admin_setting_configselect('calendar_site_timeformat', get_string('pref_timeformat', 'calendar'),
|
||||
get_string('explain_site_timeformat', 'calendar'), '0',
|
||||
array('0' => get_string('default', 'calendar'),
|
||||
'%I:%M %p' => get_string('timeformat_12', 'calendar'),
|
||||
'%H:%M' => get_string('timeformat_24', 'calendar'))));
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0,
|
||||
array(
|
||||
0 => new lang_string('sunday', 'calendar'),
|
||||
1 => new lang_string('monday', 'calendar'),
|
||||
2 => new lang_string('tuesday', 'calendar'),
|
||||
3 => new lang_string('wednesday', 'calendar'),
|
||||
4 => new lang_string('thursday', 'calendar'),
|
||||
5 => new lang_string('friday', 'calendar'),
|
||||
6 => new lang_string('saturday', 'calendar')
|
||||
0 => get_string('sunday', 'calendar'),
|
||||
1 => get_string('monday', 'calendar'),
|
||||
2 => get_string('tuesday', 'calendar'),
|
||||
3 => get_string('wednesday', 'calendar'),
|
||||
4 => get_string('thursday', 'calendar'),
|
||||
5 => get_string('friday', 'calendar'),
|
||||
6 => get_string('saturday', 'calendar')
|
||||
)));
|
||||
$temp->add(new admin_setting_special_calendar_weekend());
|
||||
$options = array();
|
||||
for ($i=1; $i<=99; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('calendar_lookahead',new lang_string('configlookahead','admin'),new lang_string('helpupcominglookahead', 'admin'),21,$options));
|
||||
$temp->add(new admin_setting_configselect('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,$options));
|
||||
$options = array();
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('calendar_maxevents',new lang_string('configmaxevents','admin'),new lang_string('helpupcomingmaxevents', 'admin'),10,$options));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', new lang_string('enablecalendarexport', 'admin'), new lang_string('configenablecalendarexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('calendar_exportsalt', new lang_string('calendarexportsalt','admin'), new lang_string('configcalendarexportsalt', 'admin'), random_string(60)));
|
||||
$temp->add(new admin_setting_configselect('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,$options));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60)));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// blog
|
||||
$temp = new admin_settingpage('blog', new lang_string('blog','blog'));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => new lang_string('personalblogs','blog'),
|
||||
0 => new lang_string('disableblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => new lang_string('numhours', '', 12),
|
||||
86400 => new lang_string('numhours', '', 24),
|
||||
172800 => new lang_string('numdays', '', 2),
|
||||
604800 => new lang_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
|
||||
$temp = new admin_settingpage('blog', get_string('blog','blog'));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', get_string('useblogassociations', 'blog'), get_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'), get_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => get_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => get_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', get_string('useexternalblogs', 'blog'), get_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', get_string('externalblogcrontime', 'blog'), get_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => get_string('numhours', '', 12),
|
||||
86400 => get_string('numhours', '', 24),
|
||||
172800 => get_string('numdays', '', 2),
|
||||
604800 => get_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', get_string('showcommentscount', 'admin'), get_string('configshowcommentscount', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// Navigation settings
|
||||
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
|
||||
$temp = new admin_settingpage('navigation', get_string('navigation'));
|
||||
$choices = array(
|
||||
HOMEPAGE_SITE => new lang_string('site'),
|
||||
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
|
||||
HOMEPAGE_SITE => get_string('site'),
|
||||
HOMEPAGE_MY => get_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => get_string('userpreference', 'admin')
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', get_string('defaulthomepage', 'admin'), get_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',get_string('navcourselimit','admin'),get_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('navlinkcoursesections', get_string('navlinkcoursesections', 'admin'), get_string('navlinkcoursesections_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', get_string('usesitenameforsitepages', 'admin'), get_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', get_string('navadduserpostslinks', 'admin'), get_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// "htmlsettings" settingpage
|
||||
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp->add(new admin_setting_emoticons());
|
||||
$ADMIN->add('appearance', $temp);
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', get_string('emoticonsreset', 'admin'),
|
||||
new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
|
||||
|
||||
|
||||
// The "media" subpage.
|
||||
$temp = new admin_settingpage('mediasettings', get_string('mediasettings', 'core_media'));
|
||||
|
||||
$temp->add(new admin_setting_heading('mediaformats', get_string('mediaformats', 'core_media'),
|
||||
format_text(get_string('mediaformats_desc', 'core_media'), FORMAT_MARKDOWN)));
|
||||
|
||||
// External services.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_youtube',
|
||||
get_string('siteyoutube', 'core_media'), get_string('siteyoutube_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_vimeo',
|
||||
get_string('sitevimeo', 'core_media'), get_string('sitevimeo_desc', 'core_media'), 0));
|
||||
|
||||
// Options which require Flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_mp3',
|
||||
get_string('mp3audio', 'core_media'), get_string('mp3audio_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_flv',
|
||||
get_string('flashvideo', 'core_media'), get_string('flashvideo_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_swf',
|
||||
get_string('flashanimation', 'core_media'), get_string('flashanimation_desc', 'core_media'), 1));
|
||||
|
||||
// HTML 5 media.
|
||||
// Audio now enabled by default so that it can provide a fallback for mp3 on devices without flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5audio',
|
||||
get_string('html5audio', 'core_media'), get_string('html5audio_desc', 'core_media'), 1));
|
||||
// Video now enabled by default so it can provide mp4 support.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5video',
|
||||
get_string('html5video', 'core_media'), get_string('html5video_desc', 'core_media'), 1));
|
||||
|
||||
// Legacy players.
|
||||
$temp->add(new admin_setting_heading('legacymediaformats',
|
||||
get_string('legacyheading', 'core_media'), get_string('legacyheading_desc', 'core_media')));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_qt',
|
||||
get_string('legacyquicktime', 'core_media'), get_string('legacyquicktime_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_wmp',
|
||||
get_string('legacywmp', 'core_media'), get_string('legacywmp_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_rm',
|
||||
get_string('legacyreal', 'core_media'), get_string('legacyreal_desc', 'core_media'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
|
||||
// "documentation" settingpage
|
||||
$temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
|
||||
$temp = new admin_settingpage('documentation', get_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', get_string('doctonewwindow', 'admin'), get_string('configdoctonewwindow', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$temp = new admin_externalpage('mypage', get_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$temp = new admin_externalpage('profilepage', get_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
|
||||
$temp = new admin_settingpage('coursecontact', new lang_string('courses'));
|
||||
$temp = new admin_settingpage('coursecontact', get_string('courses'));
|
||||
$temp->add(new admin_setting_special_coursecontact());
|
||||
$temp->add(new admin_setting_configcheckbox('courselistshortnames',
|
||||
new lang_string('courselistshortnames', 'admin'),
|
||||
new lang_string('courselistshortnames_desc', 'admin'), 0));
|
||||
get_string('courselistshortnames', 'admin'),
|
||||
get_string('courselistshortnames_desc', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
|
||||
$setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
|
||||
$temp = new admin_settingpage('ajax', get_string('ajaxuse'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalyui', get_string('useexternalyui', 'admin'), get_string('configuseexternalyui', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('yuicomboloading', get_string('yuicomboloading', 'admin'), get_string('configyuicomboloading', 'admin'), 1));
|
||||
$setting = new admin_setting_configcheckbox('cachejs', get_string('cachejs', 'admin'), get_string('cachejs_help', 'admin'), 1);
|
||||
$setting->set_updatedcallback('js_reset_all_caches');
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourseajax', get_string('enablecourseajax', 'admin'),
|
||||
get_string('enablecourseajax_desc', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// link to tag management interface
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
|
||||
|
||||
$temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
|
||||
$temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp = new admin_settingpage('additionalhtml', get_string('additionalhtml', 'admin'));
|
||||
$temp->add(new admin_setting_heading('additionalhtml_heading', get_string('additionalhtml_heading', 'admin'), get_string('additionalhtml_desc', 'admin')));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlhead', get_string('additionalhtmlhead', 'admin'), get_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', get_string('additionalhtmltopofbody', 'admin'), get_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtextarea('additionalhtmlfooter', get_string('additionalhtmlfooter', 'admin'), get_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+93
-98
@@ -8,151 +8,146 @@ if ($hassiteconfig
|
||||
or has_capability('moodle/course:create', $systemcontext)
|
||||
or has_capability('moodle/site:approvecourse', $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
|
||||
array('moodle/category:manage', 'moodle/course:create')));
|
||||
|
||||
/// Course Default Settings Page
|
||||
/// NOTE: these settings must be applied after all other settings because they depend on them
|
||||
///main course settings
|
||||
$temp = new admin_settingpage('coursesettings', new lang_string('coursesettings'));
|
||||
$temp = new admin_settingpage('coursesettings', get_string('coursesettings'));
|
||||
$courseformats = get_plugin_list('format');
|
||||
$formcourseformats = array();
|
||||
foreach ($courseformats as $courseformat => $courseformatdir) {
|
||||
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
||||
$formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat");
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', get_string('format'), get_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'), new lang_string('maxnumberweeks_desc'), 52));
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', get_string('maxnumberweeks'), get_string('maxnumberweeks_desc'), 52));
|
||||
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'), new lang_string('coursehelpnumberweeks'), 10));
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', get_string('numberweeks'), get_string('coursehelpnumberweeks'), 10));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
||||
$choices['1'] = new lang_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'), new lang_string('coursehelphiddensections'), 0,$choices));
|
||||
$choices['0'] = get_string('hiddensectionscollapsed');
|
||||
$choices['1'] = get_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', get_string('hiddensections'), get_string('coursehelphiddensections'), 0,$choices));
|
||||
$options = range(0, 10);
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', new lang_string('newsitemsnumber'), new lang_string('coursehelpnewsitemsnumber'), 5,$options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'), new lang_string('coursehelpshowgrades'), 1,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', get_string('newsitemsnumber'), get_string('coursehelpnewsitemsnumber'), 5,$options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', get_string('showgrades'), get_string('coursehelpshowgrades'), 1,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', get_string('showreports'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
|
||||
if (isset($CFG->maxbytes)) {
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
} else {
|
||||
$choices = get_max_upload_sizes();
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'), new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', get_string('maximumupload'), get_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
if (!empty($CFG->legacyfilesinnewcourses)) {
|
||||
$choices = array('0'=>new lang_string('no'), '2'=>new lang_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'), new lang_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
$choices = array('0'=>get_string('no'), '2'=>get_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', get_string('courselegacyfiles'), get_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_heading('groups', get_string('groups', 'group'), ''));
|
||||
$choices = array();
|
||||
$choices[COURSE_DISPLAY_SINGLEPAGE] = new lang_string('coursedisplay_single');
|
||||
$choices[COURSE_DISPLAY_MULTIPAGE] = new lang_string('coursedisplay_multi');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'), new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
||||
$choices[NOGROUPS] = get_string('groupsnone', 'group');
|
||||
$choices[SEPARATEGROUPS] = get_string('groupsseparate', 'group');
|
||||
$choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', get_string('groupmode'), '', key($choices),$choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', get_string('force'), get_string('coursehelpforce'), 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
|
||||
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
||||
|
||||
$temp->add(new admin_setting_heading('availability', get_string('availability'), ''));
|
||||
$choices = array();
|
||||
$choices[NOGROUPS] = new lang_string('groupsnone', 'group');
|
||||
$choices[SEPARATEGROUPS] = new lang_string('groupsseparate', 'group');
|
||||
$choices[VISIBLEGROUPS] = new lang_string('groupsvisible', 'group');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', new lang_string('groupmode'), '', key($choices),$choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', new lang_string('force'), new lang_string('coursehelpforce'), 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$choices['0'] = get_string('courseavailablenot');
|
||||
$choices['1'] = get_string('courseavailable');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', get_string('visible'), '', 1,$choices));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('availability', new lang_string('availability'), ''));
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('courseavailablenot');
|
||||
$choices['1'] = new lang_string('courseavailable');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), '', 1,$choices));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('language', new lang_string('language'), ''));
|
||||
$temp->add(new admin_setting_heading('language', get_string('language'), ''));
|
||||
$languages=array();
|
||||
$languages[''] = new lang_string('forceno');
|
||||
$languages[''] = get_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', new lang_string('forcelanguage'), '',key($languages),$languages));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', get_string('forcelanguage'), '',key($languages),$languages));
|
||||
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('progress','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion','completion'), '',
|
||||
0, array(0 => new lang_string('completiondisabled','completion'), 1 => new lang_string('completionenabled','completion'))));
|
||||
$temp->add(new admin_setting_heading('progress', get_string('progress','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', get_string('completion','completion'), '',
|
||||
0, array(0 => get_string('completiondisabled','completion'), 1 => get_string('completionenabled','completion'))));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('moodlecourse/completionstartonenrol', new lang_string('completionstartonenrol','completion'), new lang_string('completionstartonenrolhelp', 'completion'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('moodlecourse/completionstartonenrol', get_string('completionstartonenrol','completion'), get_string('completionstartonenrolhelp', 'completion'), 0));
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
/// "courserequests" settingpage
|
||||
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', new lang_string('enablecourserequests', 'admin'), new lang_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', new lang_string('defaultrequestcategory', 'admin'), new lang_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
$temp->add(new admin_setting_users_with_capability('courserequestnotify', new lang_string('courserequestnotify', 'admin'), new lang_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
|
||||
$temp = new admin_settingpage('courserequest', get_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
$temp->add(new admin_setting_users_with_capability('courserequestnotify', get_string('courserequestnotify', 'admin'), get_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
/// Pending course requests.
|
||||
if (!empty($CFG->enablecourserequests)) {
|
||||
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
|
||||
$ADMIN->add('courses', new admin_externalpage('coursespending', get_string('pendingrequests'),
|
||||
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
|
||||
}
|
||||
|
||||
// Add a category for backups
|
||||
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
|
||||
$ADMIN->add('courses', new admin_category('backups', get_string('backups','admin')));
|
||||
|
||||
// Create a page for general backups configuration and defaults.
|
||||
$temp = new admin_settingpage('backupgeneralsettings', new lang_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
|
||||
$temp = new admin_settingpage('backupgeneralsettings', get_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
|
||||
|
||||
// General configuration section.
|
||||
$temp->add(new admin_setting_configselect('backup/loglifetime', new lang_string('loglifetime', 'backup'), new lang_string('configloglifetime', 'backup'), 30, array(
|
||||
1 => new lang_string('numdays', '', 1),
|
||||
2 => new lang_string('numdays', '', 2),
|
||||
3 => new lang_string('numdays', '', 3),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
7 => new lang_string('numdays', '', 7),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
14 => new lang_string('numdays', '', 14),
|
||||
20 => new lang_string('numdays', '', 20),
|
||||
30 => new lang_string('numdays', '', 30),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
365 => new lang_string('numdays', '', 365)
|
||||
$temp->add(new admin_setting_configselect('backup/loglifetime', get_string('loglifetime', 'backup'), get_string('configloglifetime', 'backup'), 30, array(
|
||||
1 => get_string('numdays', '', 1),
|
||||
2 => get_string('numdays', '', 2),
|
||||
3 => get_string('numdays', '', 3),
|
||||
5 => get_string('numdays', '', 5),
|
||||
7 => get_string('numdays', '', 7),
|
||||
10 => get_string('numdays', '', 10),
|
||||
14 => get_string('numdays', '', 14),
|
||||
20 => get_string('numdays', '', 20),
|
||||
30 => get_string('numdays', '', 30),
|
||||
60 => get_string('numdays', '', 60),
|
||||
90 => get_string('numdays', '', 90),
|
||||
120 => get_string('numdays', '', 120),
|
||||
180 => get_string('numdays', '', 180),
|
||||
365 => get_string('numdays', '', 365)
|
||||
)));
|
||||
|
||||
// General defaults section.
|
||||
$temp->add(new admin_setting_heading('generalsettings', new lang_string('generalsettings', 'backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_heading('generalsettings', get_string('generalsettings', 'backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', get_string('generalusers','backup'), get_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', get_string('generalanonymize','backup'), get_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', get_string('generalcomments','backup'), get_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', get_string('generaluserscompletion','backup'), get_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', get_string('generallogs','backup'), get_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', get_string('generalhistories','backup'), get_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for automated backups configuration and defaults.
|
||||
$temp = new admin_settingpage('automated', new lang_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
|
||||
$temp = new admin_settingpage('automated', get_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
|
||||
|
||||
// Automated configuration section.
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_active', new lang_string('active'), new lang_string('autoactivedescription', 'backup'), 0, array(
|
||||
0 => new lang_string('autoactivedisabled', 'backup'),
|
||||
1 => new lang_string('autoactiveenabled', 'backup'),
|
||||
2 => new lang_string('autoactivemanual', 'backup')
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_active', get_string('active'), get_string('autoactivedescription', 'backup'), 0, array(
|
||||
0 => get_string('autoactivedisabled', 'backup'),
|
||||
1 => get_string('autoactiveenabled', 'backup'),
|
||||
2 => get_string('autoactivemanual', 'backup')
|
||||
)));
|
||||
$temp->add(new admin_setting_special_backupdays());
|
||||
$temp->add(new admin_setting_configtime('backup/backup_auto_hour', 'backup_auto_minute', new lang_string('executeat'),
|
||||
new lang_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtime('backup/backup_auto_hour', 'backup_auto_minute', get_string('executeat'),
|
||||
get_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)));
|
||||
$storageoptions = array(
|
||||
0 => new lang_string('storagecourseonly', 'backup'),
|
||||
1 => new lang_string('storageexternalonly', 'backup'),
|
||||
2 => new lang_string('storagecourseandexternal', 'backup')
|
||||
0 => get_string('storagecourseonly', 'backup'),
|
||||
1 => get_string('storageexternalonly', 'backup'),
|
||||
2 => get_string('storagecourseandexternal', 'backup')
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
|
||||
$temp->add(new admin_setting_configdirectory('backup/backup_auto_destination', new lang_string('saveto'), new lang_string('backupsavetohelp'), ''));
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', get_string('automatedstorage', 'backup'), get_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
|
||||
$temp->add(new admin_setting_configdirectory('backup/backup_auto_destination', get_string('saveto'), get_string('backupsavetohelp'), ''));
|
||||
$keepoptoins = array(
|
||||
0 => new lang_string('all'), 1 => '1',
|
||||
0 => get_string('all'), 1 => '1',
|
||||
2 => '2',
|
||||
5 => '5',
|
||||
10 => '10',
|
||||
@@ -165,24 +160,24 @@ if ($hassiteconfig
|
||||
300 => '300',
|
||||
400 => '400',
|
||||
500 => '500');
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', get_string('keep'), get_string('backupkeephelp'), 1, $keepoptoins));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', get_string('backup_shortname', 'admin'), get_string('backup_shortnamehelp', 'admin'), 0));
|
||||
|
||||
// Automated defaults section.
|
||||
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
|
||||
$temp->add(new admin_setting_heading('automatedsettings', get_string('automatedsettings','backup'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', get_string('generalusers', 'backup'), get_string('configgeneralusers', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', get_string('generalcomments','backup'), get_string('configgeneralcomments','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', get_string('generaluserscompletion','backup'), get_string('configgeneraluserscompletion','backup'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', get_string('generallogs', 'backup'), get_string('configgenerallogs', 'backup'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', get_string('generalhistories','backup'), get_string('configgeneralhistories','backup'), 0));
|
||||
|
||||
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', new lang_string('messages', 'message'), new lang_string('backupmessageshelp','message'), 0));
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', new lang_string('blogs', 'blog'), new lang_string('backupblogshelp','blog'), 0));
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', get_string('messages', 'message'), get_string('backupmessageshelp','message'), 0));
|
||||
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', get_string('blogs', 'blog'), get_string('backupblogshelp','blog'), 0));
|
||||
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
|
||||
@@ -5,67 +5,61 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// Experimental settings page
|
||||
$ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
|
||||
$ADMIN->add('development', new admin_category('experimental', get_string('experimental','admin')));
|
||||
|
||||
$temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
|
||||
$temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
|
||||
//TODO: Re-enable cc-import once re-implemented in 2.0.x
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
|
||||
// The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
|
||||
$enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0);
|
||||
$enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($enablecssoptimiser);
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', get_string('enablesafebrowserintegration', 'admin'), get_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', get_string('enablegroupmembersonly', 'admin'), get_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$ADMIN->add('experimental', $temp);
|
||||
|
||||
// "debugging" settingpage
|
||||
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
|
||||
$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
|
||||
$temp->add(new admin_setting_special_debug());
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', new lang_string('xmlstrictheaders', 'admin'), new lang_string('configxmlstrictheaders', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', get_string('debugvalidators', 'admin'), get_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', get_string('debugpageinfo', 'admin'), get_string('configdebugpageinfo', 'admin'), 0));
|
||||
$ADMIN->add('development', $temp);
|
||||
|
||||
// "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
|
||||
if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
|
||||
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
|
||||
$temp = new admin_settingpage('profiling', get_string('profiling', 'admin'));
|
||||
// Main profiling switch
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', get_string('profilingenabled', 'admin'), get_string('profilingenabled_help', 'admin'), false));
|
||||
// List of URLs that will be automatically profiled
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', get_string('profilingincluded', 'admin'), get_string('profilingincluded_help', 'admin'), ''));
|
||||
// List of URLs that won't be profiled ever
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', get_string('profilingexcluded', 'admin'), get_string('profilingexcluded_help', 'admin'), ''));
|
||||
// Allow random profiling each XX requests
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', get_string('profilingautofrec', 'admin'), get_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
// Allow PROFILEME/DONTPROFILEME GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', get_string('profilingallowme', 'admin'), get_string('profilingallowme_help', 'admin'), false));
|
||||
// Allow PROFILEALL/PROFILEALLSTOP GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', get_string('profilingallowall', 'admin'), get_string('profilingallowall_help', 'admin'), false));
|
||||
// TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
|
||||
// TODO: Allow to skip call_user functions (ignored_functions array)
|
||||
// Specify the life time (in minutes) of profiling runs
|
||||
$temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
|
||||
0 => new lang_string('neverdeleteruns', 'admin'),
|
||||
30*24*60 => new lang_string('numdays', '', 30),
|
||||
15*24*60 => new lang_string('numdays', '', 15),
|
||||
7*24*60 => new lang_string('numdays', '', 7),
|
||||
4*24*60 => new lang_string('numdays', '', 4),
|
||||
2*24*60 => new lang_string('numdays', '', 2),
|
||||
24*60 => new lang_string('numhours', '', 24),
|
||||
16*80 => new lang_string('numhours', '', 16),
|
||||
8*60 => new lang_string('numhours', '', 8),
|
||||
4*60 => new lang_string('numhours', '', 4),
|
||||
2*60 => new lang_string('numhours', '', 2),
|
||||
60 => new lang_string('numminutes', '', 60),
|
||||
30 => new lang_string('numminutes', '', 30),
|
||||
15 => new lang_string('numminutes', '', 15))));
|
||||
$temp->add(new admin_setting_configselect('profilinglifetime', get_string('profilinglifetime', 'admin'), get_string('profilinglifetime_help', 'admin'), 24*60, array(
|
||||
0 => get_string('neverdeleteruns', 'admin'),
|
||||
30*24*60 => get_string('numdays', '', 30),
|
||||
15*24*60 => get_string('numdays', '', 15),
|
||||
7*24*60 => get_string('numdays', '', 7),
|
||||
4*24*60 => get_string('numdays', '', 4),
|
||||
2*24*60 => get_string('numdays', '', 2),
|
||||
24*60 => get_string('numhours', '', 24),
|
||||
16*80 => get_string('numhours', '', 16),
|
||||
8*60 => get_string('numhours', '', 8),
|
||||
4*60 => get_string('numhours', '', 4),
|
||||
2*60 => get_string('numhours', '', 2),
|
||||
60 => get_string('numminutes', '', 60),
|
||||
30 => get_string('numminutes', '', 30),
|
||||
15 => get_string('numminutes', '', 15))));
|
||||
|
||||
// Add the 'profiling' page to admin block
|
||||
$ADMIN->add('development', $temp);
|
||||
@@ -73,12 +67,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', get_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', get_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
}
|
||||
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', get_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
} // end of speedup
|
||||
|
||||
@@ -20,22 +20,22 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'moodle/question:moveall'), $frontpagecontext)) {
|
||||
|
||||
// "frontpage" settingpage
|
||||
$temp = new admin_settingpage('frontpagesettings', new lang_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
|
||||
$temp->add(new admin_setting_sitesettext('fullname', new lang_string('fullsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_sitesettext('shortname', new lang_string('shortsitename'), '', NULL)); // no default
|
||||
$temp = new admin_settingpage('frontpagesettings', get_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
|
||||
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', NULL)); // no default
|
||||
$temp->add(new admin_setting_special_frontpagedesc());
|
||||
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
|
||||
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
|
||||
|
||||
$options = array();
|
||||
$options[] = new lang_string('unlimited');
|
||||
$options[] = get_string('unlimited');
|
||||
for ($i=1; $i<100; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('maxcategorydepth', new lang_string('configsitemaxcategorydepth','admin'), new lang_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
|
||||
$temp->add(new admin_setting_configselect('maxcategorydepth', get_string('configsitemaxcategorydepth','admin'), get_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
|
||||
|
||||
$temp->add(new admin_setting_sitesetcheckbox('numsections', new lang_string('sitesection'), new lang_string('sitesectionhelp','admin'), 1));
|
||||
$temp->add(new admin_setting_sitesetselect('newsitems', new lang_string('newsitemsnumber'), '', 3,
|
||||
$temp->add(new admin_setting_sitesetcheckbox('numsections', get_string('sitesection'), get_string('sitesectionhelp','admin'), 1));
|
||||
$temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnumber'), '', 3,
|
||||
array('0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
@@ -47,12 +47,12 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10')));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', new lang_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', get_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', new lang_string('coursesperpage', 'admin'), new lang_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
|
||||
// front page default role
|
||||
$options = array(0=>new lang_string('none')); // roles to choose from
|
||||
$options = array(0=>get_string('none')); // roles to choose from
|
||||
$defaultfrontpageroleid = 0;
|
||||
foreach (get_all_roles() as $role) {
|
||||
if (empty($role->archetype) or $role->archetype === 'guest' or $role->archetype === 'frontpage' or $role->archetype === 'student') {
|
||||
@@ -66,18 +66,18 @@ if (!during_initial_install()) { //do not use during installation
|
||||
//frotpage role may not exist in old upgraded sites
|
||||
unset($options[0]);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('defaultfrontpageroleid', new lang_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
|
||||
$temp->add(new admin_setting_configselect('defaultfrontpageroleid', get_string('frontpagedefaultrole', 'admin'), '', $defaultfrontpageroleid, $options));
|
||||
|
||||
|
||||
$ADMIN->add('frontpage', $temp);
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', new lang_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', get_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagefilters', new lang_string('frontpagefilters', 'admin'), "$CFG->wwwroot/filter/manage.php?contextid=" . $frontpagecontext->id, 'moodle/filter:manage', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagefilters', get_string('frontpagefilters', 'admin'), "$CFG->wwwroot/filter/manage.php?contextid=" . $frontpagecontext->id, 'moodle/filter:manage', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', new lang_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/backup:backupcourse', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', get_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/backup:backupcourse', false, $frontpagecontext));
|
||||
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', new lang_string('frontpagerestore', 'admin'), $CFG->wwwroot.'/backup/restorefile.php?contextid='.$frontpagecontext->id, 'moodle/restore:restorecourse', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', get_string('frontpagerestore', 'admin'), $CFG->wwwroot.'/files/index.php?id='.SITEID.'&wdir=/backupdata', 'moodle/restore:restorecourse', false, $frontpagecontext));
|
||||
|
||||
$questioncapabilities = array(
|
||||
'moodle/question:add',
|
||||
@@ -87,10 +87,10 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'moodle/question:viewall',
|
||||
'moodle/question:movemine',
|
||||
'moodle/question:moveall');
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', new lang_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', get_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
|
||||
if (!empty($SITE->legacyfiles) and $SITE->legacyfiles === 2) {
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', new lang_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+84
-86
@@ -6,21 +6,21 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
or has_capability('moodle/grade:manageletters', $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
require_once $CFG->libdir.'/grade/constants.php';
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => new lang_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => new lang_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => new lang_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => new lang_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => new lang_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => new lang_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => new lang_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => new lang_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => new lang_string('percentagereal', 'grades')
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades')
|
||||
);
|
||||
asort($display_types);
|
||||
|
||||
// General settings
|
||||
|
||||
$temp = new admin_settingpage('gradessettings', new lang_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradessettings', get_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
|
||||
// new CFG variable for gradebook (what roles to display)
|
||||
@@ -30,35 +30,33 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
$temp->add(new admin_setting_grade_profilereport());
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', new lang_string('aggregationposition', 'grades'),
|
||||
new lang_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => new lang_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => new lang_string('positionlast', 'grades'))));
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', get_string('aggregationposition', 'grades'),
|
||||
get_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', new lang_string('includescalesinaggregation', 'grades'), new lang_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', get_string('includescalesinaggregation', 'grades'), get_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', new lang_string('hiddenasdate', 'grades'), new lang_string('hiddenasdate_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('hiddenasdate_help', 'grades'), 0));
|
||||
|
||||
// enable publishing in exports/imports
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', new lang_string('gradepublishing', 'grades'), new lang_string('gradepublishing_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('gradepublishing_help', 'grades'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', new lang_string('gradeexportdisplaytype', 'grades'),
|
||||
new lang_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', get_string('gradeexportdisplaytype', 'grades'),
|
||||
get_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', new lang_string('gradeexportdecimalpoints', 'grades'),
|
||||
new lang_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', get_string('gradeexportdecimalpoints', 'grades'),
|
||||
get_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', new lang_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => new lang_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => new lang_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => new lang_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('recovergradesdefault', new lang_string('recovergradesdefault', 'grades'), new lang_string('recovergradesdefault_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', get_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => get_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => get_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => get_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_special_gradeexport());
|
||||
|
||||
@@ -67,68 +65,68 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
/// Grade category settings
|
||||
$temp = new admin_settingpage('gradecategorysettings', new lang_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', new lang_string('hideforcedsettings', 'grades'), new lang_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', get_string('hideforcedsettings', 'grades'), get_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
|
||||
$strnoforce = new lang_string('noforce', 'grades');
|
||||
$strnoforce = get_string('noforce', 'grades');
|
||||
|
||||
// Aggregation type
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>new lang_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>new lang_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>new lang_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>new lang_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>new lang_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>new lang_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>new lang_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>new lang_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>new lang_string('aggregatesum', 'grades'));
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>get_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>get_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>get_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>get_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>get_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
|
||||
|
||||
$defaultvisible = array(GRADE_AGGREGATE_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN2,
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN, GRADE_AGGREGATE_MEDIAN, GRADE_AGGREGATE_MIN,
|
||||
GRADE_AGGREGATE_MAX, GRADE_AGGREGATE_MODE, GRADE_AGGREGATE_SUM);
|
||||
|
||||
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', new lang_string('aggregation', 'grades'), new lang_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', new lang_string('aggregationsvisible', 'grades'),
|
||||
new lang_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', get_string('aggregationsvisible', 'grades'),
|
||||
get_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
|
||||
$options = array(0 => new lang_string('no'), 1 => new lang_string('yes'));
|
||||
$options = array(0 => get_string('no'), 1 => get_string('yes'));
|
||||
|
||||
$defaults = array('value'=>1, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', new lang_string('aggregateonlygraded', 'grades'),
|
||||
new lang_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
|
||||
get_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$defaults = array('value'=>0, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', new lang_string('aggregateoutcomes', 'grades'),
|
||||
new lang_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', new lang_string('aggregatesubcats', 'grades'),
|
||||
new lang_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
|
||||
get_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'),
|
||||
get_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
|
||||
$options = array(0 => new lang_string('none'));
|
||||
$options = array(0 => get_string('none'));
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
|
||||
$defaults['value'] = 0;
|
||||
$defaults['forced'] = true;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', new lang_string('keephigh', 'grades'),
|
||||
new lang_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', get_string('keephigh', 'grades'),
|
||||
get_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$defaults['forced'] = false;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', new lang_string('droplow', 'grades'),
|
||||
new lang_string('droplow_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', get_string('droplow', 'grades'),
|
||||
get_string('droplow_help', 'grades'), $defaults, $options));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Grade item settings
|
||||
$temp = new admin_settingpage('gradeitemsettings', new lang_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradeitemsettings', get_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', new lang_string('gradedisplaytype', 'grades'),
|
||||
new lang_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', get_string('gradedisplaytype', 'grades'),
|
||||
get_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', new lang_string('decimalpoints', 'grades'),
|
||||
new lang_string('decimalpoints_help', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', get_string('decimalpoints', 'grades'),
|
||||
get_string('decimalpoints_help', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
@@ -136,48 +134,48 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', new lang_string('gradeitemadvanced', 'grades'), new lang_string('gradeitemadvanced_help', 'grades'),
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', get_string('gradeitemadvanced', 'grades'), get_string('gradeitemadvanced_help', 'grades'),
|
||||
array('iteminfo', 'idnumber', 'gradepass', 'plusfactor', 'multfactor', 'display', 'decimals', 'hiddenuntil', 'locktime'),
|
||||
array('iteminfo' => new lang_string('iteminfo', 'grades'),
|
||||
'idnumber' => new lang_string('idnumbermod'),
|
||||
'gradetype' => new lang_string('gradetype', 'grades'),
|
||||
'scaleid' => new lang_string('scale'),
|
||||
'grademin' => new lang_string('grademin', 'grades'),
|
||||
'grademax' => new lang_string('grademax', 'grades'),
|
||||
'gradepass' => new lang_string('gradepass', 'grades'),
|
||||
'plusfactor' => new lang_string('plusfactor', 'grades'),
|
||||
'multfactor' => new lang_string('multfactor', 'grades'),
|
||||
'display' => new lang_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => new lang_string('decimalpoints', 'grades'),
|
||||
'hidden' => new lang_string('hidden', 'grades'),
|
||||
'hiddenuntil' => new lang_string('hiddenuntil', 'grades'),
|
||||
'locked' => new lang_string('locked', 'grades'),
|
||||
'locktime' => new lang_string('locktime', 'grades'),
|
||||
'aggregationcoef' => new lang_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => new lang_string('parentcategory', 'grades'))));
|
||||
array('iteminfo' => get_string('iteminfo', 'grades'),
|
||||
'idnumber' => get_string('idnumbermod'),
|
||||
'gradetype' => get_string('gradetype', 'grades'),
|
||||
'scaleid' => get_string('scale'),
|
||||
'grademin' => get_string('grademin', 'grades'),
|
||||
'grademax' => get_string('grademax', 'grades'),
|
||||
'gradepass' => get_string('gradepass', 'grades'),
|
||||
'plusfactor' => get_string('plusfactor', 'grades'),
|
||||
'multfactor' => get_string('multfactor', 'grades'),
|
||||
'display' => get_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => get_string('decimalpoints', 'grades'),
|
||||
'hidden' => get_string('hidden', 'grades'),
|
||||
'hiddenuntil' => get_string('hiddenuntil', 'grades'),
|
||||
'locked' => get_string('locked', 'grades'),
|
||||
'locktime' => get_string('locktime', 'grades'),
|
||||
'aggregationcoef' => get_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => get_string('parentcategory', 'grades'))));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Scales and outcomes
|
||||
|
||||
$scales = new admin_externalpage('scales', new lang_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $scales);
|
||||
if (!empty($CFG->enableoutcomes)) {
|
||||
$outcomes = new admin_externalpage('outcomes', new lang_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $outcomes);
|
||||
}
|
||||
$letters = new admin_externalpage('letters', new lang_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$ADMIN->add('grades', $letters);
|
||||
|
||||
// The plugins must implement a settings.php file that adds their admin settings to the $settings object
|
||||
|
||||
// Reports
|
||||
$ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradereports', get_string('reportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, new lang_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, get_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradereports', $settings);
|
||||
@@ -186,12 +184,12 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
}
|
||||
|
||||
// Imports
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', get_string('importsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeimport') as $plugin => $plugindir) {
|
||||
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, new lang_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, get_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeimports', $settings);
|
||||
@@ -201,11 +199,11 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
|
||||
// Exports
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', get_string('exportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeexport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, new lang_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, get_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeexports', $settings);
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
if ($hassiteconfig) {
|
||||
|
||||
// "languageandlocation" settingpage
|
||||
$temp = new admin_settingpage('langsettings', new lang_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'), new lang_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'), new lang_string('configlangmenu', 'admin'), 1));
|
||||
$temp = new admin_settingpage('langsettings', get_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', get_string('autolang', 'admin'), get_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', get_string('lang', 'admin'), get_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', 'admin'), get_string('configlangmenu', 'admin'), 1));
|
||||
$temp->add(new admin_setting_langlist());
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'), new lang_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'), new lang_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'), new lang_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'), new lang_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', get_string('langstringcache', 'admin'), get_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
|
||||
$ADMIN->add('language', $temp);
|
||||
|
||||
|
||||
+11
-12
@@ -3,21 +3,20 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// "locations" settingpage
|
||||
$temp = new admin_settingpage('locationsettings', new lang_string('locationsettings', 'admin'));
|
||||
$temp = new admin_settingpage('locationsettings', get_string('locationsettings', 'admin'));
|
||||
$options = get_list_of_timezones();
|
||||
$options[99] = new lang_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', new lang_string('timezone','admin'), new lang_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = new lang_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', new lang_string('forcetimezone', 'admin'), new lang_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', new lang_string('country', 'admin'), new lang_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', new lang_string('defaultcity', 'admin'), new lang_string('defaultcity_help', 'admin'), ''));
|
||||
$options[99] = get_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', get_string('timezone','admin'), get_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = get_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', get_string('forcetimezone', 'admin'), get_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', get_string('defaultcity', 'admin'), get_string('defaultcity_help', 'admin'), ''));
|
||||
|
||||
$temp->add(new admin_setting_heading('iplookup', new lang_string('iplookup', 'admin'), new lang_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', new lang_string('geoipfile', 'admin'), new lang_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey', new lang_string('googlemapkey', 'admin'), new lang_string('configgooglemapkey', 'admin', $CFG->wwwroot), '', PARAM_RAW, 60));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey3', new lang_string('googlemapkey3', 'admin'), new lang_string('googlemapkey3_help', 'admin'), '', PARAM_RAW, 60));
|
||||
$temp->add(new admin_setting_heading('iplookup', get_string('iplookup', 'admin'), get_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', get_string('geoipfile', 'admin'), get_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey', get_string('googlemapkey', 'admin'), get_string('configgooglemapkey', 'admin', $CFG->wwwroot), ''));
|
||||
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', new lang_string('allcountrycodes', 'admin'), new lang_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', get_string('allcountrycodes', 'admin'), get_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
|
||||
$ADMIN->add('location', $temp);
|
||||
|
||||
|
||||
+11
-11
@@ -4,18 +4,18 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', new lang_string('settings', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', get_string('settings', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/index.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', new lang_string('managemnetpeers', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', get_string('managemnetpeers', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/peers.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', new lang_string('mnetpeers', 'mnet')));
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', get_string('mnetpeers', 'mnet')));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
require_once($CFG->dirroot.'/mnet/lib.php');
|
||||
@@ -23,39 +23,39 @@ if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off')
|
||||
$hosts = mnet_get_hosts();
|
||||
foreach ($hosts as $host) {
|
||||
if ($host->id == $CFG->mnet_all_hosts_id) {
|
||||
$host->name = new lang_string('allhosts', 'core_mnet');
|
||||
$host->name = get_string('allhosts', 'core_mnet');
|
||||
}
|
||||
$ADMIN->add('mnetpeercat',
|
||||
new admin_externalpage(
|
||||
'mnetpeer' . $host->id,
|
||||
$host->name,
|
||||
$CFG->wwwroot . '/'.$CFG->admin.'/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
$CFG->wwwroot . '/admin/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
'moodle/site:config'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', new lang_string('ssoaccesscontrol', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', get_string('ssoaccesscontrol', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/access_control.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', new lang_string('clientname', 'mnetservice_enrol'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', get_string('clientname', 'mnetservice_enrol'),
|
||||
"$CFG->wwwroot/mnet/service/enrol/index.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', new lang_string('trustedhosts', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', get_string('trustedhosts', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/trustedhosts.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', new lang_string('profilefields', 'mnet'),
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', get_string('profilefields', 'mnet'),
|
||||
'moodle/site:config');
|
||||
$ADMIN->add('mnet', $profilefields);
|
||||
|
||||
$fields = mnet_profile_field_options();
|
||||
$forced = implode(', ', $fields['forced']);
|
||||
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', new lang_string('profileexportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', new lang_string('profileimportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', get_string('profileexportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', get_string('profileimportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+131
-131
@@ -6,7 +6,7 @@
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_page_pluginsoverview());
|
||||
$ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
|
||||
$ADMIN->add('modules', new admin_category('modsettings', get_string('activitymodules')));
|
||||
$ADMIN->add('modsettings', new admin_page_managemods());
|
||||
$modules = $DB->get_records('modules', array(), "name ASC");
|
||||
foreach ($modules as $module) {
|
||||
@@ -14,7 +14,7 @@ if ($hassiteconfig) {
|
||||
if (!file_exists("$CFG->dirroot/mod/$modulename/lib.php")) {
|
||||
continue;
|
||||
}
|
||||
$strmodulename = new lang_string('modulename', 'mod_'.$modulename);
|
||||
$strmodulename = get_string('modulename', 'mod_'.$modulename);
|
||||
if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) {
|
||||
// do not show disabled modules in tree, keep only settings link on manage page
|
||||
$settings = new admin_settingpage('modsetting'.$modulename, $strmodulename, 'moodle/site:config', !$module->visible);
|
||||
@@ -28,7 +28,7 @@ if ($hassiteconfig) {
|
||||
// hidden script for converting journals to online assignments (or something like that) linked from elsewhere
|
||||
$ADMIN->add('modsettings', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
|
||||
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', get_string('blocks')));
|
||||
$ADMIN->add('blocksettings', new admin_page_manageblocks());
|
||||
$blocks = $DB->get_records('block', array(), "name ASC");
|
||||
foreach ($blocks as $block) {
|
||||
@@ -36,7 +36,7 @@ if ($hassiteconfig) {
|
||||
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
continue;
|
||||
}
|
||||
$strblockname = new lang_string('pluginname', 'block_'.$blockname);
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
if (file_exists($CFG->dirroot.'/blocks/'.$blockname.'/settings.php')) {
|
||||
$settings = new admin_settingpage('blocksetting'.$blockname, $strblockname, 'moodle/site:config', !$block->visible);
|
||||
include($CFG->dirroot.'/blocks/'.$blockname.'/settings.php');
|
||||
@@ -47,7 +47,7 @@ if ($hassiteconfig) {
|
||||
}
|
||||
|
||||
// message outputs
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', new lang_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', get_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
|
||||
$ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
|
||||
require_once($CFG->dirroot.'/message/lib.php');
|
||||
@@ -58,7 +58,7 @@ if ($hassiteconfig) {
|
||||
continue;
|
||||
}
|
||||
if ($processor->hassettings) {
|
||||
$strprocessorname = new lang_string('pluginname', 'message_'.$processorname);
|
||||
$strprocessorname = get_string('pluginname', 'message_'.$processorname);
|
||||
$settings = new admin_settingpage('messagesetting'.$processorname, $strprocessorname, 'moodle/site:config', !$processor->enabled);
|
||||
include($CFG->dirroot.'/message/output/'.$processor->name.'/settings.php');
|
||||
if ($settings) {
|
||||
@@ -68,35 +68,35 @@ if ($hassiteconfig) {
|
||||
}
|
||||
|
||||
// authentication plugins
|
||||
$ADMIN->add('modules', new admin_category('authsettings', new lang_string('authentication', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('authsettings', get_string('authentication', 'admin')));
|
||||
|
||||
$temp = new admin_settingpage('manageauths', new lang_string('authsettings', 'admin'));
|
||||
$temp = new admin_settingpage('manageauths', get_string('authsettings', 'admin'));
|
||||
$temp->add(new admin_setting_manageauths());
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', new lang_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', get_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_special_registerauth());
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', new lang_string('authpreventaccountcreation', 'admin'), new lang_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
|
||||
new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
|
||||
new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
|
||||
new lang_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
|
||||
new lang_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'), new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'), new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', get_string('authpreventaccountcreation', 'admin'), get_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', get_string('loginpageautofocus', 'admin'), get_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', get_string('guestloginbutton', 'auth'),
|
||||
get_string('showguestlogin', 'auth'), '1', array('0'=>get_string('hide'), '1'=>get_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', get_string('alternateloginurl', 'auth'),
|
||||
get_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', get_string('forgottenpasswordurl', 'auth'),
|
||||
get_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', get_string('instructions', 'auth'),
|
||||
get_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', get_string('verifychangedemail', 'admin'), get_string('configverifychangedemail', 'admin'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$ADMIN->add('authsettings', $temp);
|
||||
|
||||
|
||||
$auths = get_plugin_list('auth');
|
||||
$authsenabled = get_enabled_auth_plugins();
|
||||
foreach ($auths as $authname => $authdir) {
|
||||
$strauthname = new lang_string('pluginname', "auth_{$authname}");
|
||||
$strauthname = get_string('pluginname', "auth_{$authname}");
|
||||
// do not show disabled auths in tree, keep only settings link on manage page
|
||||
$enabled = in_array($authname, $authsenabled);
|
||||
if (file_exists($authdir.'/settings.php')) {
|
||||
@@ -114,8 +114,8 @@ if ($hassiteconfig) {
|
||||
|
||||
|
||||
// Enrolment plugins
|
||||
$ADMIN->add('modules', new admin_category('enrolments', new lang_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', new lang_string('manageenrols', 'enrol'));
|
||||
$ADMIN->add('modules', new admin_category('enrolments', get_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', get_string('manageenrols', 'enrol'));
|
||||
$temp->add(new admin_setting_manageenrols());
|
||||
if (empty($CFG->enrol_plugins_enabled)) {
|
||||
$enabled = array();
|
||||
@@ -129,7 +129,7 @@ if ($hassiteconfig) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('enrolsettings'.$enrol, new lang_string('pluginname', 'enrol_'.$enrol), 'moodle/site:config', !in_array($enrol, $enabled));
|
||||
$settings = new admin_settingpage('enrolsettings'.$enrol, get_string('pluginname', 'enrol_'.$enrol), 'moodle/site:config', !in_array($enrol, $enabled));
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include("$enrolpath/settings.php");
|
||||
if ($settings) {
|
||||
@@ -142,8 +142,8 @@ if ($hassiteconfig) {
|
||||
|
||||
|
||||
/// Editor plugins
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', get_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', get_string('editorsettings', 'editor'));
|
||||
$temp->add(new admin_setting_manageeditors());
|
||||
$htmleditors = editors_get_available();
|
||||
$ADMIN->add('editorsettings', $temp);
|
||||
@@ -151,7 +151,7 @@ if ($hassiteconfig) {
|
||||
$editors_available = editors_get_available();
|
||||
foreach ($editors_available as $editor=>$editorstr) {
|
||||
if (file_exists($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php')) {
|
||||
$settings = new admin_settingpage('editorsettings'.$editor, new lang_string('pluginname', 'editor_'.$editor), 'moodle/site:config');
|
||||
$settings = new admin_settingpage('editorsettings'.$editor, get_string('pluginname', 'editor_'.$editor), 'moodle/site:config');
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php');
|
||||
if ($settings) {
|
||||
@@ -161,56 +161,56 @@ if ($hassiteconfig) {
|
||||
}
|
||||
|
||||
/// License types
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', new lang_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', new lang_string('managelicenses', 'admin'));
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', get_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', get_string('managelicenses', 'admin'));
|
||||
|
||||
require_once($CFG->libdir . '/licenselib.php');
|
||||
$licenses = array();
|
||||
$array = explode(',', $CFG->licenses);
|
||||
foreach ($array as $value) {
|
||||
$licenses[$value] = new lang_string($value, 'license');
|
||||
$licenses[$value] = get_string($value, 'license');
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', new lang_string('configsitedefaultlicense','admin'), new lang_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', get_string('configsitedefaultlicense','admin'), get_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_managelicenses());
|
||||
$ADMIN->add('licensesettings', $temp);
|
||||
|
||||
/// Filter plugins
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', new lang_string('managefilters')));
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', get_string('managefilters')));
|
||||
|
||||
$ADMIN->add('filtersettings', new admin_page_managefilters());
|
||||
|
||||
// "filtersettings" settingpage
|
||||
$temp = new admin_settingpage('commonfiltersettings', new lang_string('commonfiltersettings', 'admin'));
|
||||
$temp = new admin_settingpage('commonfiltersettings', get_string('commonfiltersettings', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
$cachetimes = array(
|
||||
604800 => new lang_string('numdays','',7),
|
||||
86400 => new lang_string('numdays','',1),
|
||||
43200 => new lang_string('numhours','',12),
|
||||
10800 => new lang_string('numhours','',3),
|
||||
7200 => new lang_string('numhours','',2),
|
||||
3600 => new lang_string('numhours','',1),
|
||||
2700 => new lang_string('numminutes','',45),
|
||||
1800 => new lang_string('numminutes','',30),
|
||||
900 => new lang_string('numminutes','',15),
|
||||
600 => new lang_string('numminutes','',10),
|
||||
540 => new lang_string('numminutes','',9),
|
||||
480 => new lang_string('numminutes','',8),
|
||||
420 => new lang_string('numminutes','',7),
|
||||
360 => new lang_string('numminutes','',6),
|
||||
300 => new lang_string('numminutes','',5),
|
||||
240 => new lang_string('numminutes','',4),
|
||||
180 => new lang_string('numminutes','',3),
|
||||
120 => new lang_string('numminutes','',2),
|
||||
60 => new lang_string('numminutes','',1),
|
||||
30 => new lang_string('numseconds','',30),
|
||||
0 => new lang_string('no')
|
||||
604800 => get_string('numdays','',7),
|
||||
86400 => get_string('numdays','',1),
|
||||
43200 => get_string('numhours','',12),
|
||||
10800 => get_string('numhours','',3),
|
||||
7200 => get_string('numhours','',2),
|
||||
3600 => get_string('numhours','',1),
|
||||
2700 => get_string('numminutes','',45),
|
||||
1800 => get_string('numminutes','',30),
|
||||
900 => get_string('numminutes','',15),
|
||||
600 => get_string('numminutes','',10),
|
||||
540 => get_string('numminutes','',9),
|
||||
480 => get_string('numminutes','',8),
|
||||
420 => get_string('numminutes','',7),
|
||||
360 => get_string('numminutes','',6),
|
||||
300 => get_string('numminutes','',5),
|
||||
240 => get_string('numminutes','',4),
|
||||
180 => get_string('numminutes','',3),
|
||||
120 => get_string('numminutes','',2),
|
||||
60 => get_string('numminutes','',1),
|
||||
30 => get_string('numseconds','',30),
|
||||
0 => get_string('no')
|
||||
);
|
||||
$items = array();
|
||||
$items[] = new admin_setting_configselect('cachetext', new lang_string('cachetext', 'admin'), new lang_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', new lang_string('filteruploadedfiles', 'admin'), new lang_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
$items[] = new admin_setting_configselect('cachetext', get_string('cachetext', 'admin'), get_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', get_string('filteruploadedfiles', 'admin'), get_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', get_string('filtermatchoneperpage', 'admin'), get_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', get_string('filtermatchonepertext', 'admin'), get_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
foreach ($items as $item) {
|
||||
$item->set_updatedcallback('reset_text_filters_cache');
|
||||
$temp->add($item);
|
||||
@@ -234,8 +234,8 @@ if ($hassiteconfig) {
|
||||
|
||||
//== Portfolio settings ==
|
||||
require_once($CFG->libdir. '/portfoliolib.php');
|
||||
$catname = new lang_string('portfolios', 'portfolio');
|
||||
$manage = new lang_string('manageportfolios', 'portfolio');
|
||||
$catname = get_string('portfolios', 'portfolio');
|
||||
$manage = get_string('manageportfolios', 'portfolio');
|
||||
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
||||
|
||||
$ADMIN->add('modules', new admin_category('portfoliosettings', $catname, empty($CFG->enableportfolios)));
|
||||
@@ -245,37 +245,37 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('manageportfolioscommon', new lang_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', new lang_string('commonsettingsdesc', 'portfolio')));
|
||||
$temp = new admin_settingpage('manageportfolioscommon', get_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', get_string('commonsettingsdesc', 'portfolio')));
|
||||
$fileinfo = portfolio_filesize_info(); // make sure this is defined in one place since its used inside portfolio too to detect insane settings
|
||||
$fileoptions = $fileinfo['options'];
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_moderate_filesize_threshold',
|
||||
new lang_string('moderatefilesizethreshold', 'portfolio'),
|
||||
new lang_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
get_string('moderatefilesizethreshold', 'portfolio'),
|
||||
get_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['moderate'], $fileoptions));
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_high_filesize_threshold',
|
||||
new lang_string('highfilesizethreshold', 'portfolio'),
|
||||
new lang_string('highfilesizethresholddesc', 'portfolio'),
|
||||
get_string('highfilesizethreshold', 'portfolio'),
|
||||
get_string('highfilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['high'], $fileoptions));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_moderate_db_threshold',
|
||||
new lang_string('moderatedbsizethreshold', 'portfolio'),
|
||||
new lang_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
get_string('moderatedbsizethreshold', 'portfolio'),
|
||||
get_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
20, PARAM_INTEGER, 3));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_high_db_threshold',
|
||||
new lang_string('highdbsizethreshold', 'portfolio'),
|
||||
new lang_string('highdbsizethresholddesc', 'portfolio'),
|
||||
get_string('highdbsizethreshold', 'portfolio'),
|
||||
get_string('highdbsizethresholddesc', 'portfolio'),
|
||||
50, PARAM_INTEGER, 3));
|
||||
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', new lang_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', new lang_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', new lang_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', get_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', get_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', get_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
|
||||
|
||||
foreach (portfolio_instances(false, false) as $portfolio) {
|
||||
require_once($CFG->dirroot . '/portfolio/' . $portfolio->get('plugin') . '/lib.php');
|
||||
@@ -295,8 +295,8 @@ if ($hassiteconfig) {
|
||||
|
||||
// repository setting
|
||||
require_once("$CFG->dirroot/repository/lib.php");
|
||||
$catname =new lang_string('repositories', 'repository');
|
||||
$managerepo = new lang_string('manage', 'repository');
|
||||
$catname =get_string('repositories', 'repository');
|
||||
$managerepo = get_string('manage', 'repository');
|
||||
$url = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php';
|
||||
$ADMIN->add('modules', new admin_category('repositorysettings', $catname));
|
||||
|
||||
@@ -305,81 +305,81 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('managerepositoriescommon', new lang_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', new lang_string('cacheexpire', 'repository'), new lang_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', new lang_string('allowexternallinks', 'repository'), new lang_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', new lang_string('legacyfilesinnewcourses', 'admin'), new lang_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$temp = new admin_settingpage('managerepositoriescommon', get_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', get_string('cacheexpire', 'repository'), get_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', get_string('allowexternallinks', 'repository'), get_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', get_string('legacyfilesinnewcourses', 'admin'), get_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
|
||||
new lang_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete',
|
||||
new lang_string('deleterepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('deleterepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller',
|
||||
new lang_string('manage', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('manage', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew',
|
||||
new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('createrepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
|
||||
new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
|
||||
get_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
foreach (repository::get_types() as $repositorytype) {
|
||||
//display setup page for plugins with: general options or multiple instances (e.g. has instance config)
|
||||
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
|
||||
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
|
||||
if (!empty($typeoptionnames) || !empty($instanceoptionnames)) {
|
||||
|
||||
$params = array('action'=>'edit', 'sesskey'=>sesskey(), 'repos'=>$repositorytype->get_typename());
|
||||
$settingsurl = new moodle_url("/$CFG->admin/repository.php", $params);
|
||||
$repositoryexternalpage = new admin_externalpage('repositorysettings'.$repositorytype->get_typename(), $repositorytype->get_readablename(), $settingsurl);
|
||||
$ADMIN->add('repositorysettings', $repositoryexternalpage);
|
||||
}
|
||||
$ADMIN->add('repositorysettings',
|
||||
new admin_externalpage('repositorysettings'.$repositorytype->get_typename(),
|
||||
$repositorytype->get_readablename(),
|
||||
$url . '?action=edit&repos=' . $repositorytype->get_typename()),
|
||||
'moodle/site:config');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Web services
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
|
||||
/// overview page
|
||||
$temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
|
||||
$temp = new admin_settingpage('webservicesoverview', get_string('webservicesoverview', 'webservice'));
|
||||
$temp->add(new admin_setting_webservicesoverview());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
//API documentation
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', get_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
/// manage service
|
||||
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
|
||||
$temp = new admin_settingpage('externalservices', get_string('externalservices', 'webservice'));
|
||||
$enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice', new lang_string('enablemobilewebservice', 'admin'), new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, get_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice', get_string('enablemobilewebservice', 'admin'), get_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', get_string('information', 'webservice'), get_string('servicehelpexplanation', 'webservice')));
|
||||
$temp->add(new admin_setting_manageexternalservices());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', new lang_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', new lang_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', new lang_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', get_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
/// manage protocol page link
|
||||
$temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
|
||||
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebserviceprotocols());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
|
||||
// We cannot use $OUTPUT this early, doing so means that we lose the ability
|
||||
// to set the page layout on all admin pages.
|
||||
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
|
||||
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
|
||||
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
|
||||
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$wsdoclink = html_writer::tag('a', get_string('supplyinfo'),array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', get_string('enablewsdocumentation',
|
||||
'admin'), get_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
/// links to protocol pages
|
||||
$webservices_available = get_plugin_list('webservice');
|
||||
$active_webservices = empty($CFG->webserviceprotocols) ? array() : explode(',', $CFG->webserviceprotocols);
|
||||
foreach ($webservices_available as $webservice => $location) {
|
||||
if (file_exists("$location/settings.php")) {
|
||||
$name = new lang_string('pluginname', 'webservice_'.$webservice);
|
||||
$name = get_string('pluginname', 'webservice_'.$webservice);
|
||||
$settings = new admin_settingpage('webservicesetting'.$webservice, $name, 'moodle/site:config', !in_array($webservice, $active_webservices) or empty($CFG->enablewebservices));
|
||||
include("$location/settings.php");
|
||||
if ($settings) {
|
||||
@@ -388,29 +388,29 @@ if ($hassiteconfig) {
|
||||
}
|
||||
}
|
||||
/// manage token page link
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice'));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', get_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', get_string('managetokens', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebservicetokens());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
|
||||
// Question type settings
|
||||
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
||||
// Question behaviour settings.
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', get_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
|
||||
|
||||
// Question type settings.
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
|
||||
$qtypes = get_plugin_list('qtype');
|
||||
foreach ($qtypes as $qtype => $path) {
|
||||
$settingsfile = $path . '/settings.php';
|
||||
if (file_exists($settingsfile)) {
|
||||
$settings = new admin_settingpage('qtypesetting' . $qtype,
|
||||
new lang_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
|
||||
get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
|
||||
include($settingsfile);
|
||||
if ($settings) {
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
@@ -421,17 +421,17 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
|
||||
// Plagiarism plugin settings
|
||||
if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', new lang_string('plagiarism', 'plagiarism')));
|
||||
$temp = new admin_settingpage('plagiarismsettings', new lang_string('plagiarismsettings', 'plagiarism'));
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', get_string('plagiarism', 'plagiarism')));
|
||||
$temp = new admin_settingpage('plagiarismsettings', get_string('plagiarismsettings', 'plagiarism'));
|
||||
$temp->add(new admin_setting_manageplagiarism());
|
||||
$ADMIN->add('plagiarism', $temp);
|
||||
foreach (get_plugin_list('plagiarism') as $plugin => $plugindir) {
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('plagiarism'.$plugin, new lang_string($plugin, 'plagiarism_'.$plugin), "$CFG->wwwroot/plagiarism/$plugin/settings.php", 'moodle/site:config'));
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('plagiarism'.$plugin, get_string($plugin, 'plagiarism_'.$plugin), "$CFG->wwwroot/plagiarism/$plugin/settings.php", 'moodle/site:config'));
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', get_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
|
||||
// Course reports settings
|
||||
if ($hassiteconfig) {
|
||||
@@ -440,7 +440,7 @@ if ($hassiteconfig) {
|
||||
$file = $CFG->dirroot . '/course/report/' . $report . '/settings.php';
|
||||
if (file_exists($file)) {
|
||||
$settings = new admin_settingpage('coursereport' . $report,
|
||||
new lang_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
|
||||
get_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include($file);
|
||||
if ($settings) {
|
||||
@@ -449,7 +449,7 @@ if ($hassiteconfig) {
|
||||
}
|
||||
}
|
||||
if (!empty($pages)) {
|
||||
$ADMIN->add('modules', new admin_category('coursereports', new lang_string('coursereports')));
|
||||
$ADMIN->add('modules', new admin_category('coursereports', get_string('coursereports')));
|
||||
foreach ($pages as $page) {
|
||||
$ADMIN->add('coursereports', $page);
|
||||
}
|
||||
@@ -463,15 +463,15 @@ foreach (get_plugin_list('report') as $report => $plugindir) {
|
||||
$settings_path = "$plugindir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
$settings = new admin_settingpage('report' . $report,
|
||||
new lang_string('pluginname', 'report_' . $report), 'moodle/site:config');
|
||||
get_string('pluginname', 'report_' . $report), 'moodle/site:config');
|
||||
include($settings_path);
|
||||
if ($settings) {
|
||||
$pages[] = $settings;
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('modules', new admin_category('reportplugins', new lang_string('reports')));
|
||||
$ADMIN->add('reportplugins', new admin_externalpage('managereports', new lang_string('reportsmanage', 'admin'),
|
||||
$ADMIN->add('modules', new admin_category('reportplugins', get_string('reports')));
|
||||
$ADMIN->add('reportplugins', new admin_externalpage('managereports', get_string('reportsmanage', 'admin'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/reports.php'));
|
||||
foreach ($pages as $page) {
|
||||
$ADMIN->add('reportplugins', $page);
|
||||
@@ -479,8 +479,8 @@ foreach ($pages as $page) {
|
||||
|
||||
/// Add all admin tools
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('tools', new lang_string('tools', 'admin')));
|
||||
$ADMIN->add('tools', new admin_externalpage('managetools', new lang_string('toolsmanage', 'admin'),
|
||||
$ADMIN->add('modules', new admin_category('tools', get_string('tools', 'admin')));
|
||||
$ADMIN->add('tools', new admin_externalpage('managetools', get_string('toolsmanage', 'admin'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/tools.php'));
|
||||
}
|
||||
|
||||
@@ -494,8 +494,8 @@ foreach (get_plugin_list('tool') as $plugin => $plugindir) {
|
||||
|
||||
/// Add all local plugins - must be always last!
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', new lang_string('localpluginsmanage'),
|
||||
$ADMIN->add('modules', new admin_category('localplugins', get_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', get_string('localpluginsmanage'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/localplugins.php'));
|
||||
}
|
||||
|
||||
|
||||
+83
-70
@@ -3,101 +3,114 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// "ip blocker" settingpage
|
||||
$temp = new admin_settingpage('ipblocker', new lang_string('ipblocker', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowbeforeblock', new lang_string('allowbeforeblock', 'admin'), new lang_string('allowbeforeblockdesc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configiplist('allowedip', new lang_string('allowediplist', 'admin'),
|
||||
new lang_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configiplist('blockedip', new lang_string('blockediplist', 'admin'),
|
||||
new lang_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp = new admin_settingpage('ipblocker', get_string('ipblocker', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowbeforeblock', get_string('allowbeforeblock', 'admin'), get_string('allowbeforeblockdesc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configiplist('allowedip', get_string('allowediplist', 'admin'),
|
||||
get_string('ipblockersyntax', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configiplist('blockedip', get_string('blockediplist', 'admin'),
|
||||
get_string('ipblockersyntax', 'admin'), ''));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
// "sitepolicies" settingpage
|
||||
$temp = new admin_settingpage('sitepolicies', new lang_string('sitepolicies', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('protectusernames', new lang_string('protectusernames', 'admin'), new lang_string('configprotectusernames', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forcelogin', new lang_string('forcelogin', 'admin'), new lang_string('configforcelogin', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', new lang_string('forceloginforprofiles', 'admin'), new lang_string('configforceloginforprofiles', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', new lang_string('forceloginforprofileimage', 'admin'), new lang_string('forceloginforprofileimage_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('opentogoogle', new lang_string('opentogoogle', 'admin'), new lang_string('configopentogoogle', 'admin'), 0));
|
||||
$temp = new admin_settingpage('sitepolicies', get_string('sitepolicies', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', get_string('forceloginforprofileimage', 'admin'), get_string('forceloginforprofileimage_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0));
|
||||
$temp->add(new admin_setting_pickroles('profileroles',
|
||||
new lang_string('profileroles','admin'),
|
||||
new lang_string('configprofileroles', 'admin'),
|
||||
get_string('profileroles','admin'),
|
||||
get_string('configprofileroles', 'admin'),
|
||||
array('student', 'teacher', 'editingteacher')));
|
||||
|
||||
$max_upload_choices = get_max_upload_sizes();
|
||||
// maxbytes set to 0 will allow the maximum server limit for uploads
|
||||
$max_upload_choices[0] = new lang_string('serverlimit', 'admin');
|
||||
$temp->add(new admin_setting_configselect('maxbytes', new lang_string('maxbytes', 'admin'), new lang_string('configmaxbytes', 'admin'), 0, $max_upload_choices));
|
||||
$max_upload_choices[0] = get_string('serverlimit', 'admin');
|
||||
$temp->add(new admin_setting_configselect('maxbytes', get_string('maxbytes', 'admin'), get_string('configmaxbytes', 'admin'), 0, $max_upload_choices));
|
||||
// 100MB
|
||||
$defaultuserquota = 104857600;
|
||||
$params = new stdClass();
|
||||
$params->bytes = $defaultuserquota;
|
||||
$params->displaysize = display_size($defaultuserquota);
|
||||
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
|
||||
$temp->add(new admin_setting_configtext('userquota', get_string('userquota', 'admin'), get_string('configuserquota', 'admin', $params), $defaultuserquota));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('maxeditingtime', new lang_string('maxeditingtime','admin'), new lang_string('configmaxeditingtime','admin'), 1800,
|
||||
array(60 => new lang_string('numminutes', '', 1),
|
||||
300 => new lang_string('numminutes', '', 5),
|
||||
900 => new lang_string('numminutes', '', 15),
|
||||
1800 => new lang_string('numminutes', '', 30),
|
||||
2700 => new lang_string('numminutes', '', 45),
|
||||
3600 => new lang_string('numminutes', '', 60))));
|
||||
$temp->add(new admin_setting_configselect('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'), new lang_string('configfullnamedisplay', 'admin'),
|
||||
'language', array('language' => new lang_string('language'),
|
||||
'firstname lastname' => new lang_string('firstname').' + '.new lang_string('lastname'),
|
||||
'lastname firstname' => new lang_string('lastname').' + '.new lang_string('firstname'),
|
||||
'firstname' => new lang_string('firstname'))));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', new lang_string('extendedusernamechars', 'admin'), new lang_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('sitepolicy', new lang_string('sitepolicy', 'admin'), new lang_string('sitepolicy_help', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sitepolicyguest', new lang_string('sitepolicyguest', 'admin'), new lang_string('sitepolicyguest_help', 'admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', new lang_string('extendedusernamechars', 'admin'), new lang_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('keeptagnamecase', new lang_string('keeptagnamecase','admin'),new lang_string('configkeeptagnamecase', 'admin'),'1'));
|
||||
$temp->add(new admin_setting_configcheckbox('allowobjectembed', get_string('allowobjectembed', 'admin'), get_string('configallowobjectembed', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enabletrusttext', get_string('enabletrusttext', 'admin'), get_string('configenabletrusttext', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('maxeditingtime', get_string('maxeditingtime','admin'), get_string('configmaxeditingtime','admin'), 1800,
|
||||
array(60 => get_string('numminutes', '', 1),
|
||||
300 => get_string('numminutes', '', 5),
|
||||
900 => get_string('numminutes', '', 15),
|
||||
1800 => get_string('numminutes', '', 30),
|
||||
2700 => get_string('numminutes', '', 45),
|
||||
3600 => get_string('numminutes', '', 60))));
|
||||
$temp->add(new admin_setting_configselect('fullnamedisplay', get_string('fullnamedisplay', 'admin'), get_string('configfullnamedisplay', 'admin'),
|
||||
'language', array('language' => get_string('language'),
|
||||
'firstname lastname' => get_string('firstname').' + '.get_string('lastname'),
|
||||
'lastname firstname' => get_string('lastname').' + '.get_string('firstname'),
|
||||
'firstname' => get_string('firstname'))));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', get_string('extendedusernamechars', 'admin'), get_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('sitepolicy', get_string('sitepolicy', 'admin'), get_string('sitepolicy_help', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sitepolicyguest', get_string('sitepolicyguest', 'admin'), get_string('sitepolicyguest_help', 'admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
|
||||
$temp->add(new admin_setting_configcheckbox('extendedusernamechars', get_string('extendedusernamechars', 'admin'), get_string('configextendedusernamechars', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('keeptagnamecase', get_string('keeptagnamecase','admin'),get_string('configkeeptagnamecase', 'admin'),'1'));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('profilesforenrolledusersonly', new lang_string('profilesforenrolledusersonly','admin'),new lang_string('configprofilesforenrolledusersonly', 'admin'),'1'));
|
||||
$temp->add(new admin_setting_configcheckbox('profilesforenrolledusersonly', get_string('profilesforenrolledusersonly','admin'),get_string('configprofilesforenrolledusersonly', 'admin'),'1'));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('cronclionly', new lang_string('cronclionly', 'admin'), new lang_string('configcronclionly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', new lang_string('cronremotepassword', 'admin'), new lang_string('configcronremotepassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configcheckbox('cronclionly', get_string('cronclionly', 'admin'), get_string('configcronclionly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', get_string('cronremotepassword', 'admin'), get_string('configcronremotepassword', 'admin'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('passwordpolicy', new lang_string('passwordpolicy', 'admin'), new lang_string('configpasswordpolicy', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlength', new lang_string('minpasswordlength', 'admin'), new lang_string('configminpasswordlength', 'admin'), 8, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpassworddigits', new lang_string('minpassworddigits', 'admin'), new lang_string('configminpassworddigits', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlower', new lang_string('minpasswordlower', 'admin'), new lang_string('configminpasswordlower', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordupper', new lang_string('minpasswordupper', 'admin'), new lang_string('configminpasswordupper', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordnonalphanum', new lang_string('minpasswordnonalphanum', 'admin'), new lang_string('configminpasswordnonalphanum', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('maxconsecutiveidentchars', new lang_string('maxconsecutiveidentchars', 'admin'), new lang_string('configmaxconsecutiveidentchars', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', new lang_string('groupenrolmentkeypolicy', 'admin'), new lang_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('disableuserimages', new lang_string('disableuserimages', 'admin'), new lang_string('configdisableuserimages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', new lang_string('emailchangeconfirmation', 'admin'), new lang_string('configemailchangeconfirmation', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('rememberusername', new lang_string('rememberusername','admin'), new lang_string('rememberusername_desc','admin'), 2, array(1=>new lang_string('yes'), 0=>new lang_string('no'), 2=>new lang_string('optional'))));
|
||||
$temp->add(new admin_setting_configcheckbox('strictformsrequired', new lang_string('strictformsrequired', 'admin'), new lang_string('configstrictformsrequired', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('passwordpolicy', get_string('passwordpolicy', 'admin'), get_string('configpasswordpolicy', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlength', get_string('minpasswordlength', 'admin'), get_string('configminpasswordlength', 'admin'), 8, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpassworddigits', get_string('minpassworddigits', 'admin'), get_string('configminpassworddigits', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordlower', get_string('minpasswordlower', 'admin'), get_string('configminpasswordlower', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordupper', get_string('minpasswordupper', 'admin'), get_string('configminpasswordupper', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('minpasswordnonalphanum', get_string('minpasswordnonalphanum', 'admin'), get_string('configminpasswordnonalphanum', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('maxconsecutiveidentchars', get_string('maxconsecutiveidentchars', 'admin'), get_string('configmaxconsecutiveidentchars', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', get_string('groupenrolmentkeypolicy', 'admin'), get_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('disableuserimages', get_string('disableuserimages', 'admin'), get_string('configdisableuserimages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', get_string('emailchangeconfirmation', 'admin'), get_string('configemailchangeconfirmation', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('rememberusername', get_string('rememberusername','admin'), get_string('rememberusername_desc','admin'), 2, array(1=>get_string('yes'), 0=>get_string('no'), 2=>get_string('optional'))));
|
||||
$temp->add(new admin_setting_configcheckbox('strictformsrequired', get_string('strictformsrequired', 'admin'), get_string('configstrictformsrequired', 'admin'), 0));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
|
||||
|
||||
// "httpsecurity" settingpage
|
||||
$temp = new admin_settingpage('httpsecurity', new lang_string('httpsecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('loginhttps', new lang_string('loginhttps', 'admin'), new lang_string('configloginhttps', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', new lang_string('loginpasswordautocomplete', 'admin'), new lang_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
$temp = new admin_settingpage('httpsecurity', get_string('httpsecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('loginhttps', get_string('loginhttps', 'admin'), get_string('configloginhttps', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiesecure', get_string('cookiesecure', 'admin'), get_string('configcookiesecure', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', get_string('cookiehttponly', 'admin'), get_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', get_string('allowframembedding', 'admin'), get_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', get_string('loginpasswordautocomplete', 'admin'), get_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
// "modulesecurity" settingpage
|
||||
$temp = new admin_settingpage('modulesecurity', get_string('modulesecurity', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('restrictmodulesfor', get_string('restrictmodulesfor', 'admin'), get_string('configrestrictmodulesfor', 'admin'), 'none', array('none' => get_string('nocourses'),
|
||||
'all' => get_string('fulllistofcourses'),
|
||||
'requested' => get_string('requestedcourses'))));
|
||||
$temp->add(new admin_setting_configcheckbox('restrictbydefault', get_string('restrictbydefault', 'admin'), get_string('configrestrictbydefault', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configmultiselect_modules('defaultallowedmodules',
|
||||
get_string('defaultallowedmodules', 'admin'),
|
||||
get_string('configdefaultallowedmodules', 'admin')));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
|
||||
// "notifications" settingpage
|
||||
$temp = new admin_settingpage('notifications', new lang_string('notifications', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('displayloginfailures', new lang_string('displayloginfailures', 'admin'), new lang_string('configdisplayloginfailures', 'admin'), '', array('' => new lang_string('nobody'),
|
||||
'admin' => new lang_string('administrators'),
|
||||
'teacher' => new lang_string('administratorsandteachers'),
|
||||
'everybody' => new lang_string('everybody'))));
|
||||
$temp->add(new admin_setting_users_with_capability('notifyloginfailures', new lang_string('notifyloginfailures', 'admin'), new lang_string('confignotifyloginfailures', 'admin'), array(), 'moodle/site:config'));
|
||||
$temp = new admin_settingpage('notifications', get_string('notifications', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('displayloginfailures', get_string('displayloginfailures', 'admin'), get_string('configdisplayloginfailures', 'admin'), '', array('' => get_string('nobody'),
|
||||
'admin' => get_string('administrators'),
|
||||
'teacher' => get_string('administratorsandteachers'),
|
||||
'everybody' => get_string('everybody'))));
|
||||
$temp->add(new admin_setting_users_with_capability('notifyloginfailures', get_string('notifyloginfailures', 'admin'), get_string('confignotifyloginfailures', 'admin'), array(), 'moodle/site:config'));
|
||||
$options = array();
|
||||
for ($i = 1; $i <= 100; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('notifyloginthreshold', new lang_string('notifyloginthreshold', 'admin'), new lang_string('confignotifyloginthreshold', 'admin'), '10', $options));
|
||||
$temp->add(new admin_setting_configselect('notifyloginthreshold', get_string('notifyloginthreshold', 'admin'), get_string('confignotifyloginthreshold', 'admin'), '10', $options));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
|
||||
@@ -106,12 +119,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// "antivirus" settingpage
|
||||
$temp = new admin_settingpage('antivirus', new lang_string('antivirus', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('runclamonupload', new lang_string('runclamavonupload', 'admin'), new lang_string('configrunclamavonupload', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configexecutable('pathtoclam', new lang_string('pathtoclam', 'admin'), new lang_string('configpathtoclam', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configdirectory('quarantinedir', new lang_string('quarantinedir', 'admin'), new lang_string('configquarantinedir', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('clamfailureonupload', new lang_string('clamfailureonupload', 'admin'), new lang_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => new lang_string('configclamdonothing', 'admin'),
|
||||
'actlikevirus' => new lang_string('configclamactlikevirus', 'admin'))));
|
||||
$temp = new admin_settingpage('antivirus', get_string('antivirus', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('runclamonupload', get_string('runclamavonupload', 'admin'), get_string('configrunclamavonupload', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configexecutable('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configdirectory('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('clamfailureonupload', get_string('clamfailureonupload', 'admin'), get_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => get_string('configclamdonothing', 'admin'),
|
||||
'actlikevirus' => get_string('configclamactlikevirus', 'admin'))));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+141
-160
@@ -6,19 +6,19 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// "systempaths" settingpage
|
||||
$temp = new admin_settingpage('systempaths', new lang_string('systempaths','admin'));
|
||||
$temp->add(new admin_setting_configselect('gdversion', new lang_string('gdversion','admin'), new lang_string('configgdversion', 'admin'), check_gd_version(), array('0' => new lang_string('gdnot'),
|
||||
'1' => new lang_string('gd1'),
|
||||
'2' => new lang_string('gd2'))));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('pathtodu', 'admin'), new lang_string('configpathtodu', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
|
||||
$temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
|
||||
$temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
|
||||
'1' => get_string('gd1'),
|
||||
'2' => get_string('gd2'))));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), ''));
|
||||
$temp->add(new admin_setting_configexecutable('pathtodot', get_string('pathtodot', 'admin'), get_string('pathtodot_help', 'admin'), ''));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
|
||||
// "supportcontact" settingpage
|
||||
$temp = new admin_settingpage('supportcontact', new lang_string('supportcontact','admin'));
|
||||
$temp = new admin_settingpage('supportcontact', get_string('supportcontact','admin'));
|
||||
if (isloggedin()) {
|
||||
global $USER;
|
||||
$primaryadminemail = $USER->email;
|
||||
@@ -29,158 +29,158 @@ if (isloggedin()) {
|
||||
$primaryadminemail = NULL;
|
||||
$primaryadminname = NULL;
|
||||
}
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'), new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'), new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
$temp->add(new admin_setting_configtext('supportname', get_string('supportname', 'admin'), get_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportemail', get_string('supportemail', 'admin'), get_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('supportpage', get_string('supportpage', 'admin'), get_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "sessionhandling" settingpage
|
||||
$temp = new admin_settingpage('sessionhandling', new lang_string('sessionhandling', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('dbsessions', new lang_string('dbsessions', 'admin'), new lang_string('configdbsessions', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('sessiontimeout', new lang_string('sessiontimeout', 'admin'), new lang_string('configsessiontimeout', 'admin'), 7200, array(14400 => new lang_string('numhours', '', 4),
|
||||
10800 => new lang_string('numhours', '', 3),
|
||||
7200 => new lang_string('numhours', '', 2),
|
||||
5400 => new lang_string('numhours', '', '1.5'),
|
||||
3600 => new lang_string('numminutes', '', 60),
|
||||
2700 => new lang_string('numminutes', '', 45),
|
||||
1800 => new lang_string('numminutes', '', 30),
|
||||
900 => new lang_string('numminutes', '', 15),
|
||||
300 => new lang_string('numminutes', '', 5))));
|
||||
$temp->add(new admin_setting_configtext('sessioncookie', new lang_string('sessioncookie', 'admin'), new lang_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiepath', new lang_string('sessioncookiepath', 'admin'), new lang_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiedomain', new lang_string('sessioncookiedomain', 'admin'), new lang_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
|
||||
$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
|
||||
10800 => get_string('numhours', '', 3),
|
||||
7200 => get_string('numhours', '', 2),
|
||||
5400 => get_string('numhours', '', '1.5'),
|
||||
3600 => get_string('numminutes', '', 60),
|
||||
2700 => get_string('numminutes', '', 45),
|
||||
1800 => get_string('numminutes', '', 30),
|
||||
900 => get_string('numminutes', '', 15),
|
||||
300 => get_string('numminutes', '', 5))));
|
||||
$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
|
||||
$temp->add(new admin_setting_configtext('sessioncookiedomain', get_string('sessioncookiedomain', 'admin'), get_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "stats" settingpage
|
||||
$temp = new admin_settingpage('stats', new lang_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
|
||||
$temp->add(new admin_setting_configselect('statsfirstrun', new lang_string('statsfirstrun', 'admin'), new lang_string('configstatsfirstrun', 'admin'), 'none', array('none' => new lang_string('none'),
|
||||
60*60*24*7 => new lang_string('numweeks','moodle',1),
|
||||
60*60*24*14 => new lang_string('numweeks','moodle',2),
|
||||
60*60*24*21 => new lang_string('numweeks','moodle',3),
|
||||
60*60*24*28 => new lang_string('nummonths','moodle',1),
|
||||
60*60*24*56 => new lang_string('nummonths','moodle',2),
|
||||
60*60*24*84 => new lang_string('nummonths','moodle',3),
|
||||
60*60*24*112 => new lang_string('nummonths','moodle',4),
|
||||
60*60*24*140 => new lang_string('nummonths','moodle',5),
|
||||
60*60*24*168 => new lang_string('nummonths','moodle',6),
|
||||
'all' => new lang_string('all') )));
|
||||
$temp->add(new admin_setting_configselect('statsmaxruntime', new lang_string('statsmaxruntime', 'admin'), new lang_string('configstatsmaxruntime3', 'admin'), 0, array(0 => new lang_string('untilcomplete'),
|
||||
60*30 => '10 '.new lang_string('minutes'),
|
||||
60*30 => '30 '.new lang_string('minutes'),
|
||||
60*60 => '1 '.new lang_string('hour'),
|
||||
60*60*2 => '2 '.new lang_string('hours'),
|
||||
60*60*3 => '3 '.new lang_string('hours'),
|
||||
60*60*4 => '4 '.new lang_string('hours'),
|
||||
60*60*5 => '5 '.new lang_string('hours'),
|
||||
60*60*6 => '6 '.new lang_string('hours'),
|
||||
60*60*7 => '7 '.new lang_string('hours'),
|
||||
60*60*8 => '8 '.new lang_string('hours') )));
|
||||
$temp->add(new admin_setting_configtext('statsruntimedays', new lang_string('statsruntimedays', 'admin'), new lang_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', new lang_string('statsruntimestart', 'admin'), new lang_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtext('statsuserthreshold', new lang_string('statsuserthreshold', 'admin'), new lang_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
|
||||
$temp = new admin_settingpage('stats', get_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
|
||||
$temp->add(new admin_setting_configselect('statsfirstrun', get_string('statsfirstrun', 'admin'), get_string('configstatsfirstrun', 'admin'), 'none', array('none' => get_string('none'),
|
||||
60*60*24*7 => get_string('numweeks','moodle',1),
|
||||
60*60*24*14 => get_string('numweeks','moodle',2),
|
||||
60*60*24*21 => get_string('numweeks','moodle',3),
|
||||
60*60*24*28 => get_string('nummonths','moodle',1),
|
||||
60*60*24*56 => get_string('nummonths','moodle',2),
|
||||
60*60*24*84 => get_string('nummonths','moodle',3),
|
||||
60*60*24*112 => get_string('nummonths','moodle',4),
|
||||
60*60*24*140 => get_string('nummonths','moodle',5),
|
||||
60*60*24*168 => get_string('nummonths','moodle',6),
|
||||
'all' => get_string('all') )));
|
||||
$temp->add(new admin_setting_configselect('statsmaxruntime', get_string('statsmaxruntime', 'admin'), get_string('configstatsmaxruntime3', 'admin'), 0, array(0 => get_string('untilcomplete'),
|
||||
60*30 => '10 '.get_string('minutes'),
|
||||
60*30 => '30 '.get_string('minutes'),
|
||||
60*60 => '1 '.get_string('hour'),
|
||||
60*60*2 => '2 '.get_string('hours'),
|
||||
60*60*3 => '3 '.get_string('hours'),
|
||||
60*60*4 => '4 '.get_string('hours'),
|
||||
60*60*5 => '5 '.get_string('hours'),
|
||||
60*60*6 => '6 '.get_string('hours'),
|
||||
60*60*7 => '7 '.get_string('hours'),
|
||||
60*60*8 => '8 '.get_string('hours') )));
|
||||
$temp->add(new admin_setting_configtext('statsruntimedays', get_string('statsruntimedays', 'admin'), get_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', get_string('statsruntimestart', 'admin'), get_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
|
||||
$temp->add(new admin_setting_configtext('statsuserthreshold', get_string('statsuserthreshold', 'admin'), get_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
// "http" settingpage
|
||||
$temp = new admin_settingpage('http', new lang_string('http', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('slasharguments', new lang_string('slasharguments', 'admin'), new lang_string('configslasharguments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_heading('reverseproxy', new lang_string('reverseproxy', 'admin'), '', ''));
|
||||
$temp = new admin_settingpage('http', get_string('http', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_heading('reverseproxy', get_string('reverseproxy', 'admin'), '', ''));
|
||||
$options = array(
|
||||
0 => 'HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
|
||||
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
|
||||
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'), new lang_string('configgetremoteaddrconf', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_heading('webproxy', new lang_string('webproxy', 'admin'), new lang_string('webproxyinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('proxyhost', new lang_string('proxyhost', 'admin'), new lang_string('configproxyhost', 'admin'), '', PARAM_HOST));
|
||||
$temp->add(new admin_setting_configtext('proxyport', new lang_string('proxyport', 'admin'), new lang_string('configproxyport', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configselect('getremoteaddrconf', get_string('getremoteaddrconf', 'admin'), get_string('configgetremoteaddrconf', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_heading('webproxy', get_string('webproxy', 'admin'), get_string('webproxyinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
|
||||
$temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
|
||||
$options = array('HTTP'=>'HTTP');
|
||||
if (defined('CURLPROXY_SOCKS5')) {
|
||||
$options['SOCKS5'] = 'SOCKS5';
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('proxytype', new lang_string('proxytype', 'admin'), new lang_string('configproxytype','admin'), 'HTTP', $options));
|
||||
$temp->add(new admin_setting_configtext('proxyuser', new lang_string('proxyuser', 'admin'), new lang_string('configproxyuser', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configpasswordunmask('proxypassword', new lang_string('proxypassword', 'admin'), new lang_string('configproxypassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtext('proxybypass', new lang_string('proxybypass', 'admin'), new lang_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
|
||||
$temp->add(new admin_setting_configselect('proxytype', get_string('proxytype', 'admin'), get_string('configproxytype','admin'), 'HTTP', $options));
|
||||
$temp->add(new admin_setting_configtext('proxyuser', get_string('proxyuser', 'admin'), get_string('configproxyuser', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configpasswordunmask('proxypassword', get_string('proxypassword', 'admin'), get_string('configproxypassword', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtext('proxybypass', get_string('proxybypass', 'admin'), get_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
$temp = new admin_settingpage('maintenancemode', new lang_string('sitemaintenancemode', 'admin'));
|
||||
$options = array(0=>new lang_string('disable'), 1=>new lang_string('enable'));
|
||||
$temp->add(new admin_setting_configselect('maintenance_enabled', new lang_string('sitemaintenancemode', 'admin'),
|
||||
new lang_string('helpsitemaintenance', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_confightmleditor('maintenance_message', new lang_string('optionalmaintenancemessage', 'admin'),
|
||||
$temp = new admin_settingpage('maintenancemode', get_string('sitemaintenancemode', 'admin'));
|
||||
$options = array(0=>get_string('disable'), 1=>get_string('enable'));
|
||||
$temp->add(new admin_setting_configselect('maintenance_enabled', get_string('sitemaintenancemode', 'admin'),
|
||||
get_string('helpsitemaintenance', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_confightmleditor('maintenance_message', get_string('optionalmaintenancemessage', 'admin'),
|
||||
'', ''));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
$temp = new admin_settingpage('cleanup', new lang_string('cleanup', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('deleteunconfirmed', new lang_string('deleteunconfirmed', 'admin'), new lang_string('configdeleteunconfirmed', 'admin'), 168, array(0 => new lang_string('never'),
|
||||
168 => new lang_string('numdays', '', 7),
|
||||
144 => new lang_string('numdays', '', 6),
|
||||
120 => new lang_string('numdays', '', 5),
|
||||
96 => new lang_string('numdays', '', 4),
|
||||
72 => new lang_string('numdays', '', 3),
|
||||
48 => new lang_string('numdays', '', 2),
|
||||
24 => new lang_string('numdays', '', 1),
|
||||
12 => new lang_string('numhours', '', 12),
|
||||
6 => new lang_string('numhours', '', 6),
|
||||
1 => new lang_string('numhours', '', 1))));
|
||||
$temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
|
||||
$temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
|
||||
168 => get_string('numdays', '', 7),
|
||||
144 => get_string('numdays', '', 6),
|
||||
120 => get_string('numdays', '', 5),
|
||||
96 => get_string('numdays', '', 4),
|
||||
72 => get_string('numdays', '', 3),
|
||||
48 => get_string('numdays', '', 2),
|
||||
24 => get_string('numdays', '', 1),
|
||||
12 => get_string('numhours', '', 12),
|
||||
6 => get_string('numhours', '', 6),
|
||||
1 => get_string('numhours', '', 1))));
|
||||
|
||||
$temp->add(new admin_setting_configselect('deleteincompleteusers', new lang_string('deleteincompleteusers', 'admin'), new lang_string('configdeleteincompleteusers', 'admin'), 0, array(0 => new lang_string('never'),
|
||||
168 => new lang_string('numdays', '', 7),
|
||||
144 => new lang_string('numdays', '', 6),
|
||||
120 => new lang_string('numdays', '', 5),
|
||||
96 => new lang_string('numdays', '', 4),
|
||||
72 => new lang_string('numdays', '', 3),
|
||||
48 => new lang_string('numdays', '', 2),
|
||||
24 => new lang_string('numdays', '', 1))));
|
||||
$temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('deleteincompleteusers', 'admin'), get_string('configdeleteincompleteusers', 'admin'), 0, array(0 => get_string('never'),
|
||||
168 => get_string('numdays', '', 7),
|
||||
144 => get_string('numdays', '', 6),
|
||||
120 => get_string('numdays', '', 5),
|
||||
96 => get_string('numdays', '', 4),
|
||||
72 => get_string('numdays', '', 3),
|
||||
48 => get_string('numdays', '', 2),
|
||||
24 => get_string('numdays', '', 1))));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('logguests', new lang_string('logguests', 'admin'),
|
||||
new lang_string('logguests_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('loglifetime', new lang_string('loglifetime', 'admin'), new lang_string('configloglifetime', 'admin'), 0, array(0 => new lang_string('neverdeletelogs'),
|
||||
1000 => new lang_string('numdays', '', 1000),
|
||||
365 => new lang_string('numdays', '', 365),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
150 => new lang_string('numdays', '', 150),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
35 => new lang_string('numdays', '', 35),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
2 => new lang_string('numdays', '', 2))));
|
||||
$temp->add(new admin_setting_configcheckbox('logguests', get_string('logguests', 'admin'),
|
||||
get_string('logguests_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
|
||||
1000 => get_string('numdays', '', 1000),
|
||||
365 => get_string('numdays', '', 365),
|
||||
180 => get_string('numdays', '', 180),
|
||||
150 => get_string('numdays', '', 150),
|
||||
120 => get_string('numdays', '', 120),
|
||||
90 => get_string('numdays', '', 90),
|
||||
60 => get_string('numdays', '', 60),
|
||||
35 => get_string('numdays', '', 35),
|
||||
10 => get_string('numdays', '', 10),
|
||||
5 => get_string('numdays', '', 5),
|
||||
2 => get_string('numdays', '', 2))));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('disablegradehistory', new lang_string('disablegradehistory', 'grades'),
|
||||
new lang_string('disablegradehistory_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('disablegradehistory', get_string('disablegradehistory', 'grades'),
|
||||
get_string('disablegradehistory_help', 'grades'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_string('gradehistorylifetime', 'grades'),
|
||||
new lang_string('gradehistorylifetime_help', 'grades'), 0, array(0 => new lang_string('neverdeletehistory', 'grades'),
|
||||
1000 => new lang_string('numdays', '', 1000),
|
||||
365 => new lang_string('numdays', '', 365),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
150 => new lang_string('numdays', '', 150),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
30 => new lang_string('numdays', '', 30))));
|
||||
$temp->add(new admin_setting_configselect('gradehistorylifetime', get_string('gradehistorylifetime', 'grades'),
|
||||
get_string('gradehistorylifetime_help', 'grades'), 0, array(0 => get_string('neverdeletehistory', 'grades'),
|
||||
1000 => get_string('numdays', '', 1000),
|
||||
365 => get_string('numdays', '', 365),
|
||||
180 => get_string('numdays', '', 180),
|
||||
150 => get_string('numdays', '', 150),
|
||||
120 => get_string('numdays', '', 120),
|
||||
90 => get_string('numdays', '', 90),
|
||||
60 => get_string('numdays', '', 60),
|
||||
30 => get_string('numdays', '', 30))));
|
||||
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
|
||||
$ADMIN->add('server', new admin_externalpage('environment', new lang_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('phpinfo', new lang_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
|
||||
$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
||||
|
||||
|
||||
// "performance" settingpage
|
||||
$temp = new admin_settingpage('performance', new lang_string('performance', 'admin'));
|
||||
$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
|
||||
|
||||
$temp->add(new admin_setting_configtext('numcoursesincombo', new lang_string('numcoursesincombo', 'admin'), new lang_string('numcoursesincombo_help', 'admin'), 500));
|
||||
$temp->add(new admin_setting_configtext('numcoursesincombo', get_string('numcoursesincombo', 'admin'), get_string('numcoursesincombo_help', 'admin'), 500));
|
||||
|
||||
$temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('extramemorylimit', 'admin'),
|
||||
new lang_string('configextramemorylimit', 'admin'), '512M',
|
||||
$temp->add(new admin_setting_configselect('extramemorylimit', get_string('extramemorylimit', 'admin'),
|
||||
get_string('configextramemorylimit', 'admin'), '512M',
|
||||
// if this option is set to 0, default 128M will be used
|
||||
array( '64M' => '64M',
|
||||
'128M' => '128M',
|
||||
@@ -188,56 +188,37 @@ $temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('e
|
||||
'512M' => '512M',
|
||||
'1024M' => '1024M'
|
||||
)));
|
||||
$temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'),
|
||||
new lang_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('curlcache', get_string('curlcache', 'admin'),
|
||||
get_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'),
|
||||
new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', get_string('curltimeoutkbitrate', 'admin'),
|
||||
get_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
|
||||
$temp->add(new admin_setting_special_selectsetup('cachetype', new lang_string('cachetype', 'admin'),
|
||||
new lang_string('configcachetype', 'admin'), '',
|
||||
array( '' => new lang_string('none'),
|
||||
$temp->add(new admin_setting_special_selectsetup('cachetype', get_string('cachetype', 'admin'),
|
||||
get_string('configcachetype', 'admin'), '',
|
||||
array( '' => get_string('none'),
|
||||
'internal' => 'internal',
|
||||
'memcached' => 'memcached',
|
||||
'eaccelerator' => 'eaccelerator')));
|
||||
// NOTE: $CFG->rcache is forced to bool in lib/setup.php
|
||||
$temp->add(new admin_setting_special_selectsetup('rcache', new lang_string('rcache', 'admin'),
|
||||
new lang_string('configrcache', 'admin'), 0,
|
||||
array( '0' => new lang_string('no'),
|
||||
'1' => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configtext('rcachettl', new lang_string('rcachettl', 'admin'),
|
||||
new lang_string('configrcachettl', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('intcachemax', new lang_string('intcachemax', 'admin'),
|
||||
new lang_string('configintcachemax', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('memcachedhosts', new lang_string('memcachedhosts', 'admin'),
|
||||
new lang_string('configmemcachedhosts', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('memcachedpconn', new lang_string('memcachedpconn', 'admin'),
|
||||
new lang_string('configmemcachedpconn', 'admin'), 0,
|
||||
array( '0' => new lang_string('no'),
|
||||
'1' => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_special_selectsetup('rcache', get_string('rcache', 'admin'),
|
||||
get_string('configrcache', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
|
||||
get_string('configrcachettl', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
|
||||
get_string('configintcachemax', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
|
||||
get_string('configmemcachedhosts', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
|
||||
get_string('configmemcachedpconn', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
*/
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
// "update notifications" settingpage
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$temp = new admin_settingpage('updatenotifications', new lang_string('updatenotifications', 'core_admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('updateautocheck', new lang_string('updateautocheck', 'core_admin'),
|
||||
new lang_string('updateautocheck_desc', 'core_admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('updateminmaturity', new lang_string('updateminmaturity', 'core_admin'),
|
||||
new lang_string('updateminmaturity_desc', 'core_admin'), MATURITY_STABLE,
|
||||
array(
|
||||
MATURITY_ALPHA => new lang_string('maturity'.MATURITY_ALPHA, 'core_admin'),
|
||||
MATURITY_BETA => new lang_string('maturity'.MATURITY_BETA, 'core_admin'),
|
||||
MATURITY_RC => new lang_string('maturity'.MATURITY_RC, 'core_admin'),
|
||||
MATURITY_STABLE => new lang_string('maturity'.MATURITY_STABLE, 'core_admin'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('updatenotifybuilds', new lang_string('updatenotifybuilds', 'core_admin'),
|
||||
new lang_string('updatenotifybuilds_desc', 'core_admin'), 0));
|
||||
$ADMIN->add('server', $temp);
|
||||
}
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
@@ -2,47 +2,45 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', new lang_string('enableoutcomes', 'grades'), new lang_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', new lang_string('usetags','admin'),new lang_string('configusetags', 'admin'), '1'));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', get_string('usetags','admin'),get_string('configusetags', 'admin'), '1'));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', new lang_string('enablenotes', 'notes'), new lang_string('configenablenotes', 'notes'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', get_string('enablenotes', 'notes'), get_string('configenablenotes', 'notes'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', new lang_string('enabled', 'portfolio'), new lang_string('enableddesc', 'portfolio'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', get_string('enabled', 'portfolio'), get_string('enableddesc', 'portfolio'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', new lang_string('enablewebservices', 'admin'), new lang_string('configenablewebservices', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', get_string('enablewebservices', 'admin'), get_string('configenablewebservices', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', new lang_string('messaging', 'admin'), new lang_string('configmessaging','admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', get_string('messaging', 'admin'), get_string('configmessaging','admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', new lang_string('messaginghidereadnotifications', 'admin'), new lang_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', get_string('messaginghidereadnotifications', 'admin'), get_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
|
||||
$options = array(DAYSECS=>new lang_string('secondstotime86400'), WEEKSECS=>new lang_string('secondstotime604800'), 2620800=>new lang_string('nummonths', 'moodle', 1), 15724800=>new lang_string('nummonths', 'moodle', 6),0=>new lang_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', new lang_string('messagingdeletereadnotificationsdelay', 'admin'), new lang_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
$options = array(DAYSECS=>get_string('secondstotime86400'), WEEKSECS=>get_string('secondstotime604800'), 2620800=>get_string('nummonths', 'moodle', 1), 15724800=>get_string('nummonths', 'moodle', 6),0=>get_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', get_string('messagingdeletereadnotificationsdelay', 'admin'), get_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messagingallowemailoverride', new lang_string('messagingallowemailoverride', 'admin'), new lang_string('configmessagingallowemailoverride','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', get_string('enablestats', 'admin'), get_string('configenablestats', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', new lang_string('enablestats', 'admin'), new lang_string('configenablestats', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', new lang_string('enablerssfeeds', 'admin'), new lang_string('configenablerssfeeds', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'),
|
||||
get_string('configbloglevel', 'admin'), 4, array(5 => get_string('worldblogs','blog'),
|
||||
4 => get_string('siteblogs','blog'),
|
||||
1 => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'),
|
||||
new lang_string('configbloglevel', 'admin'), 4, array(5 => new lang_string('worldblogs','blog'),
|
||||
4 => new lang_string('siteblogs','blog'),
|
||||
1 => new lang_string('personalblogs','blog'),
|
||||
0 => new lang_string('disableblogs','blog'))));
|
||||
|
||||
$options = array('off'=>new lang_string('off', 'mnet'), 'strict'=>new lang_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', new lang_string('net', 'mnet'), new lang_string('configmnet', 'mnet'), 'off', $options));
|
||||
$options = array('off'=>get_string('off', 'mnet'), 'strict'=>get_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', get_string('net', 'mnet'), get_string('configmnet', 'mnet'), 'off', $options));
|
||||
|
||||
// Conditional activities: completion and availability
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
|
||||
new lang_string('enablecompletion','completion'),
|
||||
new lang_string('configenablecompletion','completion'), 0));
|
||||
get_string('enablecompletion','completion'),
|
||||
get_string('configenablecompletion','completion'), 0));
|
||||
$optionalsubsystems->add($checkbox = new admin_setting_configcheckbox('enableavailability',
|
||||
new lang_string('enableavailability','condition'),
|
||||
new lang_string('configenableavailability','condition'), 0));
|
||||
get_string('enableavailability','condition'),
|
||||
get_string('configenableavailability','condition'), 0));
|
||||
$checkbox->set_affects_modinfo(true);
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', new lang_string('enableplagiarism','plagiarism'), new lang_string('configenableplagiarism','plagiarism'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', get_string('enableplagiarism','plagiarism'), get_string('configenableplagiarism','plagiarism'), 0));
|
||||
}
|
||||
|
||||
+24
-24
@@ -8,41 +8,41 @@
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$hassiteconfig = has_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
|
||||
$ADMIN->add('root', new admin_externalpage('registrationindex', get_string('registration','admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('registration', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationselector', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/hubselector.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('siteregistrationconfirmed',
|
||||
new lang_string('registrationconfirmed', 'hub'),
|
||||
get_string('registrationconfirmed', 'hub'),
|
||||
$CFG->wwwroot."/".$CFG->admin."/registration/confirmregistration.php", 'moodle/site:config', true));
|
||||
// hidden upgrade script
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', new lang_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', new lang_string('advancedfeatures', 'admin'));
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('advancedfeatures', 'admin'));
|
||||
$ADMIN->add('root', $optionalsubsystems);
|
||||
}
|
||||
|
||||
$ADMIN->add('root', new admin_category('users', new lang_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', new lang_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', new lang_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', new lang_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', new lang_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', new lang_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', new lang_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', new lang_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', new lang_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', new lang_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', new lang_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', new lang_string('development', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', get_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('location', get_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', get_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', get_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
|
||||
|
||||
// hidden unsupported category
|
||||
$ADMIN->add('root', new admin_category('unsupported', new lang_string('unsupported', 'admin'), true));
|
||||
$ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
|
||||
|
||||
// hidden search script
|
||||
$ADMIN->add('root', new admin_externalpage('search', new lang_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
|
||||
+51
-51
@@ -2,8 +2,8 @@
|
||||
|
||||
// This file defines settingpages and externalpages under the "users" category
|
||||
|
||||
$ADMIN->add('users', new admin_category('accounts', new lang_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', new lang_string('permissions', 'role')));
|
||||
$ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
|
||||
|
||||
if ($hassiteconfig
|
||||
or has_capability('moodle/user:create', $systemcontext)
|
||||
@@ -21,17 +21,17 @@ if ($hassiteconfig
|
||||
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
|
||||
}
|
||||
// stuff under the "accounts" subcategory
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', new lang_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', new lang_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', new lang_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', new lang_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', new lang_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', get_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
|
||||
|
||||
// stuff under the "roles" subcategory
|
||||
|
||||
// "userpolicies" settingpage
|
||||
$temp = new admin_settingpage('userpolicies', new lang_string('userpolicies', 'admin'));
|
||||
$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
if (!during_initial_install()) {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
@@ -80,28 +80,28 @@ if ($hassiteconfig
|
||||
}
|
||||
|
||||
if (empty($guestroles)) {
|
||||
$guestroles[0] = new lang_string('none');
|
||||
$guestroles[0] = get_string('none');
|
||||
$defaultguestid = 0;
|
||||
}
|
||||
|
||||
if (empty($userroles)) {
|
||||
$userroles[0] = new lang_string('none');
|
||||
$userroles[0] = get_string('none');
|
||||
$defaultuserid = 0;
|
||||
}
|
||||
|
||||
$restorersnewrole = $creatornewroles;
|
||||
$restorersnewrole[0] = new lang_string('none');
|
||||
$restorersnewrole[0] = get_string('none');
|
||||
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', new lang_string('notloggedinroleid', 'admin'),
|
||||
new lang_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', new lang_string('guestroleid', 'admin'),
|
||||
new lang_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', new lang_string('defaultuserroleid', 'admin'),
|
||||
new lang_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', new lang_string('creatornewroleid', 'admin'),
|
||||
new lang_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', new lang_string('restorernewroleid', 'admin'),
|
||||
new lang_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
|
||||
get_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
|
||||
get_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
|
||||
get_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
|
||||
get_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', get_string('restorernewroleid', 'admin'),
|
||||
get_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
|
||||
// release memory
|
||||
unset($otherroles);
|
||||
@@ -111,24 +111,24 @@ if ($hassiteconfig
|
||||
unset($restorersnewrole);
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', new lang_string('autologinguests', 'admin'), new lang_string('configautologinguests', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', new lang_string('hiddenuserfields', 'admin'),
|
||||
new lang_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => new lang_string('description'),
|
||||
'city' => new lang_string('city'),
|
||||
'country' => new lang_string('country'),
|
||||
'webpage' => new lang_string('webpage'),
|
||||
'icqnumber' => new lang_string('icqnumber'),
|
||||
'skypeid' => new lang_string('skypeid'),
|
||||
'yahooid' => new lang_string('yahooid'),
|
||||
'aimid' => new lang_string('aimid'),
|
||||
'msnid' => new lang_string('msnid'),
|
||||
'firstaccess' => new lang_string('firstaccess'),
|
||||
'lastaccess' => new lang_string('lastaccess'),
|
||||
'mycourses' => new lang_string('mycourses'),
|
||||
'groups' => new lang_string('groups'),
|
||||
'suspended' => new lang_string('suspended', 'auth'),
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
|
||||
get_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => get_string('description'),
|
||||
'city' => get_string('city'),
|
||||
'country' => get_string('country'),
|
||||
'webpage' => get_string('webpage'),
|
||||
'icqnumber' => get_string('icqnumber'),
|
||||
'skypeid' => get_string('skypeid'),
|
||||
'yahooid' => get_string('yahooid'),
|
||||
'aimid' => get_string('aimid'),
|
||||
'msnid' => get_string('msnid'),
|
||||
'firstaccess' => get_string('firstaccess'),
|
||||
'lastaccess' => get_string('lastaccess'),
|
||||
'mycourses' => get_string('mycourses'),
|
||||
'groups' => get_string('groups'),
|
||||
'suspended' => get_string('suspended', 'auth'),
|
||||
)));
|
||||
|
||||
// Select fields to display as part of user identity (only to those
|
||||
@@ -140,25 +140,25 @@ if ($hassiteconfig
|
||||
// be a security problem to reveal usernames even to trusted staff.
|
||||
// Custom user profile fields are not currently supported.
|
||||
$temp->add(new admin_setting_configmulticheckbox('showuseridentity',
|
||||
new lang_string('showuseridentity', 'admin'),
|
||||
new lang_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
|
||||
'idnumber' => new lang_string('idnumber'),
|
||||
'email' => new lang_string('email'),
|
||||
'phone1' => new lang_string('phone'),
|
||||
'phone2' => new lang_string('phone2'),
|
||||
'department' => new lang_string('department'),
|
||||
'institution' => new lang_string('institution'),
|
||||
get_string('showuseridentity', 'admin'),
|
||||
get_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
|
||||
'idnumber' => get_string('idnumber'),
|
||||
'email' => get_string('email'),
|
||||
'phone1' => get_string('phone'),
|
||||
'phone2' => get_string('phone2'),
|
||||
'department' => get_string('department'),
|
||||
'institution' => get_string('institution'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', new lang_string('enablegravatar', 'admin'), new lang_string('enablegravatar_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', get_string('enablegravatar', 'admin'), get_string('enablegravatar_help', 'admin'), 0));
|
||||
}
|
||||
|
||||
$ADMIN->add('roles', $temp);
|
||||
|
||||
if (is_siteadmin()) {
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', new lang_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', get_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
}
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', new lang_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', new lang_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', new lang_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', get_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
+2
-4
@@ -9,9 +9,6 @@
|
||||
$zone = clean_param($zone, PARAM_PATH);
|
||||
}
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
@@ -21,6 +18,7 @@
|
||||
$strusers = get_string("users");
|
||||
$strall = get_string("all");
|
||||
|
||||
$PAGE->set_url('/admin/timezone.php');
|
||||
$PAGE->set_title($strtimezone);
|
||||
$PAGE->set_heading($strtimezone);
|
||||
$PAGE->navbar->add($strtimezone);
|
||||
@@ -44,7 +42,7 @@
|
||||
$timezones = get_list_of_timezones();
|
||||
|
||||
echo '<center><form action="timezone.php" method="post">';
|
||||
echo html_writer::label($strusers . ' (' . $strall . '): ', 'menuzone');
|
||||
echo "$strusers ($strall): ";
|
||||
echo html_writer::select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
|
||||
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
|
||||
echo '<input type="submit" value="'.s($strsavechanges).'" />';
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade'));
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$confirm = required_param('confirm', PARAM_BOOL);
|
||||
if (!$confirm) {
|
||||
print_error('invalidrequest');
|
||||
die();
|
||||
}
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
session_get_instance()->write_close(); // release session
|
||||
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
|
||||
|
||||
$current = 0;
|
||||
if (optional_param('upgradeall', false, PARAM_BOOL)) {
|
||||
$assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
|
||||
} else {
|
||||
$assignmentids = explode(',', optional_param('selected', '', PARAM_TEXT));
|
||||
}
|
||||
$total = count($assignmentids);
|
||||
|
||||
foreach ($assignmentids as $assignmentid) {
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
$current += 1;
|
||||
echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', array('current'=>$current, 'total'=>$total)), 3);
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
}
|
||||
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This tool can upgrade old assignment activities to the new assignment activity type
|
||||
*
|
||||
* The upgrade can be done on any old assignment instance providing it is using one of the core
|
||||
* assignment subtypes (online text, single upload, etc).
|
||||
* The new assignment module was introduced in Moodle 2.3 and although it completely reproduces
|
||||
* the features of the existing assignment type it wasn't designed to replace it entirely as there
|
||||
* are many custom assignment types people use and it wouldn't be practical to try to convert them.
|
||||
* Instead the existing assignment type will be left in core and people will be encouraged to
|
||||
* use the new assignment type.
|
||||
*
|
||||
* This screen is the main entry-point to the plugin, it gives the admin a list
|
||||
* of options available to them.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade');
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$actions = array();
|
||||
|
||||
$header = get_string('pluginname', 'tool_assignmentupgrade');
|
||||
$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
|
||||
|
||||
echo $renderer->index_page($header, $actions);
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for the assignment upgrade tool
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['areyousure'] = 'Are you sure?';
|
||||
$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
|
||||
$string['assignmentid'] = 'Assignment ID';
|
||||
$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
|
||||
$string['assignmentsperpage'] = 'Assignments per page';
|
||||
$string['assignmenttype'] = 'Assignment type';
|
||||
$string['backtoindex'] = 'Back to index';
|
||||
$string['batchoperations'] = 'Batch operations';
|
||||
$string['batchupgrade'] = 'Upgrade multiple assignments';
|
||||
$string['confirmbatchupgrade'] = 'Confirm batch upgrade assignments';
|
||||
$string['conversioncomplete'] = 'Assignment converted';
|
||||
$string['conversionfailed'] = 'The assignment conversion was not successful. The log from the upgrade was: <br />{$a}';
|
||||
$string['listnotupgraded'] = 'List assignments that have not been upgraded';
|
||||
$string['listnotupgraded_desc'] = 'You can upgrade individual assignments from here';
|
||||
$string['noassignmentstoupgrade'] = 'There are no assignments that require upgrading';
|
||||
$string['notsupported'] = '';
|
||||
$string['notupgradedintro'] = 'This page lists the assignments created with an older version of Moodle that have not been upgraded to the new assignment module in Moodle 2.3. Not all assignments can be upgraded - if they were created with a custom assignment subtype, then that subtype will need to be upgraded to the new assignment plugin format in order to complete the upgrade.';
|
||||
$string['notupgradedtitle'] = 'Assignments not upgraded';
|
||||
$string['pluginname'] = 'Assignment upgrade helper';
|
||||
$string['select'] = 'Select';
|
||||
$string['submissions'] = 'Submissions';
|
||||
$string['supported'] = 'Upgrade';
|
||||
$string['updatetable'] = 'Update table';
|
||||
$string['unknown'] = 'Unknown';
|
||||
$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
|
||||
$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
|
||||
$string['upgradeassignmentfailed'] = 'Result: Upgrade failed. The log from the upgrade was: <br/><div class="tool_assignmentupgrade_upgradelog">{$a->log}</div>';
|
||||
$string['upgradable'] = 'Upgradable';
|
||||
$string['upgradeselected'] = 'Upgrade selected assignments';
|
||||
$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
|
||||
$string['upgradeall'] = 'Upgrade all assignments';
|
||||
$string['upgradeallconfirm'] = 'Upgrade all assignments?';
|
||||
$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
|
||||
$string['upgradesingle'] = 'Upgrade single assignment';
|
||||
$string['viewcourse'] = 'View the course with the converted assignment';
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/paginationform.php');
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded'));
|
||||
$PAGE->navbar->add(get_string('listnotupgraded', 'tool_assignmentupgrade'));
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$perpage = optional_param('perpage', 0, PARAM_INT);
|
||||
if (!$perpage) {
|
||||
$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 100);
|
||||
} else {
|
||||
set_user_preference('tool_assignmentupgrade_perpage', $perpage);
|
||||
}
|
||||
$assignments = new tool_assignmentupgrade_assignments_table($perpage);
|
||||
|
||||
$batchform = new tool_assignmentupgrade_batchoperations_form();
|
||||
$data = $batchform->get_data();
|
||||
|
||||
if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) {
|
||||
require_sesskey();
|
||||
echo $renderer->confirm_batch_operation_page($data);
|
||||
} else {
|
||||
$paginationform = new tool_assignmentupgrade_pagination_form();
|
||||
$pagedata = new stdClass();
|
||||
$pagedata->perpage = $perpage;
|
||||
$paginationform->set_data($pagedata);
|
||||
echo $renderer->assignment_list_page($assignments, $batchform, $paginationform);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Assignment upgrade tool library functions
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Get the URL of a script within this plugin.
|
||||
* @param string $script the script name, without .php. E.g. 'index'
|
||||
* @param array $params URL parameters (optional)
|
||||
* @return moodle_url
|
||||
*/
|
||||
function tool_assignmentupgrade_url($script, $params = array()) {
|
||||
return new moodle_url('/admin/tool/assignmentupgrade/' . $script . '.php', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to encapsulate the continue / cancel for batch operations
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_batchoperationconfirm implements renderable {
|
||||
/** @var string $continuemessage The message to show above the continue cancel buttons */
|
||||
public $continuemessage = '';
|
||||
/** @var string $continueurl The url to load if the user clicks continue */
|
||||
public $continueurl;
|
||||
|
||||
/**
|
||||
* Constructor for this class
|
||||
* @param stdClass $data - The data from the previous batch form
|
||||
*/
|
||||
function __construct($data) {
|
||||
if (isset($data->upgradeselected)) {
|
||||
$this->continuemessage = get_string('upgradeselectedcount', 'tool_assignmentupgrade', count(explode(',', $data->selectedassignments)));
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', array('upgradeselected'=>'1', 'confirm'=>'1', 'sesskey'=>sesskey(), 'selected'=>$data->selectedassignments));
|
||||
} else if (isset($data->upgradeall)) {
|
||||
if (!tool_assignmentupgrade_any_upgradable_assignments()) {
|
||||
$this->continuemessage = get_string('noassignmentstoupgrade', 'tool_assignmentupgrade');
|
||||
$this->continueurl = '';
|
||||
} else {
|
||||
$this->continuemessage = get_string('upgradeallconfirm', 'tool_assignmentupgrade');
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', array('upgradeall'=>'1', 'confirm'=>'1', 'sesskey'=>sesskey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class to encapsulate one of the functionalities that this plugin offers.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_action {
|
||||
/** @var string the name of this action. */
|
||||
public $name;
|
||||
/** @var moodle_url the URL to launch this action. */
|
||||
public $url;
|
||||
/** @var string a description of this aciton. */
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Constructor to set the fields.
|
||||
*
|
||||
* In order to create a new tool_assignmentupgrade_action instance you must use the tool_assignmentupgrade_action::make
|
||||
* method.
|
||||
*
|
||||
* @param string $name the name of this action.
|
||||
* @param moodle_url $url the URL to launch this action.
|
||||
* @param string $description a description of this aciton.
|
||||
*/
|
||||
protected function __construct($name, moodle_url $url, $description) {
|
||||
$this->name = $name;
|
||||
$this->url = $url;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make an action with standard values.
|
||||
* @param string $shortname internal name of the action. Used to get strings and build a URL.
|
||||
* @param array $params any URL params required.
|
||||
* @return tool_assignmentupgrade_action
|
||||
*/
|
||||
public static function make($shortname, $params = array()) {
|
||||
return new self(
|
||||
get_string($shortname, 'tool_assignmentupgrade'),
|
||||
tool_assignmentupgrade_url($shortname, $params),
|
||||
get_string($shortname . '_desc', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if there are any assignments that can be upgraded
|
||||
* @return boolean - Are there any assignments that can be upgraded
|
||||
*/
|
||||
function tool_assignmentupgrade_any_upgradable_assignments() {
|
||||
global $DB, $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
// first find all the unique assignment types
|
||||
$types = $DB->get_records_sql('SELECT plugin AS assignmenttype, value AS version FROM {config_plugins} WHERE name = ? AND plugin LIKE ?', array('version', 'assignment_%'));
|
||||
|
||||
$upgradabletypes = array();
|
||||
|
||||
foreach ($types as $assignment) {
|
||||
$shorttype = substr($assignment->assignmenttype, strlen('assignment_'));
|
||||
if (assign::can_upgrade_assignment($shorttype, $assignment->version)) {
|
||||
$upgradabletypes[] = $shorttype;
|
||||
}
|
||||
}
|
||||
list($sql, $params) = $DB->get_in_or_equal($upgradabletypes);
|
||||
|
||||
$count = $DB->count_records_sql('SELECT COUNT(id) from {assignment} where assignmenttype ' . $sql, $params);
|
||||
|
||||
return $count > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a list of all the assignmentids that can be upgraded
|
||||
* @return array of assignment ids
|
||||
*/
|
||||
function tool_assignmentupgrade_load_all_upgradable_assignmentids() {
|
||||
global $DB, $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
// first find all the unique assignment types
|
||||
$types = $DB->get_records_sql('SELECT plugin AS assignmenttype, value AS version FROM {config_plugins} WHERE name = ? AND plugin LIKE ?', array('version', 'assignment_%'));
|
||||
|
||||
$upgradabletypes = array();
|
||||
|
||||
foreach ($types as $assignment) {
|
||||
$shorttype = substr($assignment->assignmenttype, strlen('assignment_'));
|
||||
if (assign::can_upgrade_assignment($shorttype, $assignment->version)) {
|
||||
$upgradabletypes[] = $shorttype;
|
||||
}
|
||||
}
|
||||
|
||||
list($sql, $params) = $DB->get_in_or_equal($upgradabletypes);
|
||||
|
||||
$records = $DB->get_records_sql('SELECT id from {assignment} where assignmenttype ' . $sql, $params);
|
||||
$ids = array();
|
||||
foreach ($records as $record) {
|
||||
$ids[] = $record->id;
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upgrade a single assignment. This is used by both upgrade single and upgrade batch
|
||||
*
|
||||
* @param int $assignmentid - The assignment id to upgrade
|
||||
* @return array(string, boolean, string) -
|
||||
* The array contains
|
||||
* - the assignment summary (returned by tool_assignmentupgrade_get_assignment)
|
||||
* - success
|
||||
* - the upgrade log
|
||||
*/
|
||||
function tool_assignmentupgrade_upgrade_assignment($assignmentid) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
|
||||
|
||||
$assignment_upgrader = new assign_upgrade_manager();
|
||||
$info = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
if ($info) {
|
||||
$log = '';
|
||||
$success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
|
||||
} else {
|
||||
$success = false;
|
||||
$log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
|
||||
$info = new stdClass();
|
||||
$info->name = get_string('unknown', 'tool_assignmentupgrade');
|
||||
$info->shortname = get_string('unknown', 'tool_assignmentupgrade');
|
||||
}
|
||||
|
||||
return array($info, $success, $log);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the information about a assignment to be upgraded.
|
||||
* @param int $assignmentid the assignment id.
|
||||
* @return stdClass the information about that assignment.
|
||||
*/
|
||||
function tool_assignmentupgrade_get_assignment($assignmentid) {
|
||||
global $DB;
|
||||
return $DB->get_record_sql("
|
||||
SELECT a.id, a.name, c.shortname, c.id AS courseid
|
||||
FROM {assignment} a
|
||||
JOIN {course} c ON c.id = a.course
|
||||
WHERE a.id = ?", array($assignmentid));
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
M.tool_assignmentupgrade = {
|
||||
init_upgrade_table: function(Y) {
|
||||
|
||||
Y.use('node', function(Y) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
node.on('change', function(e) {
|
||||
rowelement = e.currentTarget.get('parentNode').get('parentNode');
|
||||
if (e.currentTarget.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
if (node.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var selectall = Y.one('th.c0 input');
|
||||
selectall.on('change', function(e) {
|
||||
if (e.currentTarget.get('checked')) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', true);
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
});
|
||||
} else {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', false);
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var upgradeselectedbutton = Y.one('#id_upgradeselected');
|
||||
upgradeselectedbutton.on('click', function(e) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
var selectedassignments = [];
|
||||
checkboxes.each(function(node) {
|
||||
if (node.get('checked')) {
|
||||
selectedassignments[selectedassignments.length] = node.get('value');
|
||||
}
|
||||
});
|
||||
|
||||
operation = Y.one('#id_operation');
|
||||
assignmentsinput = Y.one('input.selectedassignments');
|
||||
assignmentsinput.set('value', selectedassignments.join(','));
|
||||
if (selectedassignments.length == 0) {
|
||||
alert(M.str.assign.noassignmentsselected);
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
var perpage = Y.one('#id_perpage');
|
||||
perpage.on('change', function(e) {
|
||||
window.onbeforeunload = null;
|
||||
Y.one('.tool_assignmentupgrade_paginationform form').submit();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file contains the forms to create and edit an instance of this module
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
||||
|
||||
|
||||
/** Include formslib.php */
|
||||
require_once ($CFG->libdir.'/formslib.php');
|
||||
|
||||
/**
|
||||
* Assignment upgrade table display options
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_pagination_form extends moodleform {
|
||||
/**
|
||||
* Define this form - called from the parent constructor
|
||||
*/
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$instance = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('assignmentsperpage', 'tool_assignmentupgrade'));
|
||||
// visible elements
|
||||
$options = array(10=>'10', 20=>'20', 50=>'50', 100=>'100');
|
||||
$mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options);
|
||||
|
||||
// hidden params
|
||||
$mform->addElement('hidden', 'action', 'saveoptions');
|
||||
$mform->setType('action', PARAM_ALPHA);
|
||||
|
||||
// buttons
|
||||
$this->add_action_buttons(false, get_string('updatetable', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Defines the renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Render the index page.
|
||||
* @param string $detected information about what sort of site was detected.
|
||||
* @param array $actions list of actions to show on this page.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function index_page($detected, array $actions) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginname', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box($detected);
|
||||
$output .= html_writer::start_tag('ul');
|
||||
foreach ($actions as $action) {
|
||||
$output .= html_writer::tag('li',
|
||||
html_writer::link($action->url, $action->name) . ' - ' .
|
||||
$action->description);
|
||||
}
|
||||
$output .= html_writer::end_tag('ul');
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a page that is just a simple message.
|
||||
* @param string $message the message to display.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function simple_message_page($message) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading($message);
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch operation page
|
||||
* @param stdClass $data Submitted form data with list of assignments to upgrade
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function confirm_batch_operation_page(stdClass $data) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
|
||||
$output .= $this->heading(get_string('confirmbatchupgrade', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_confirmbatch');
|
||||
|
||||
$output .= $this->render(new tool_assignmentupgrade_batchoperationconfirm($data));
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch continue / cancel links
|
||||
* @param tool_assignmentupgrade_batchoperationconfirm $confirm Wrapper class to determine the continue message and url
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function render_tool_assignmentupgrade_batchoperationconfirm(tool_assignmentupgrade_batchoperationconfirm $confirm) {
|
||||
$output = '';
|
||||
|
||||
if ($confirm->continueurl) {
|
||||
$output .= $this->output->confirm($confirm->continuemessage, $confirm->continueurl, tool_assignmentupgrade_url('listnotupgraded'));
|
||||
} else {
|
||||
$output .= $this->output->box($confirm->continuemessage);
|
||||
$output .= $this->output->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the list of assignments that still need to be upgraded page.
|
||||
* @param tool_assignmentupgrade_assignments_table $assignments of data about assignments.
|
||||
* @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade
|
||||
* @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform, tool_assignmentupgrade_pagination_form $paginationform) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array());
|
||||
|
||||
|
||||
$output .= $this->heading(get_string('notupgradedtitle', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box(get_string('notupgradedintro', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_upgradetable');
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_paginationform');
|
||||
$output .= $this->moodleform($paginationform);
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true);
|
||||
$output .= $this->container_end();
|
||||
|
||||
if ($assignments->anyupgradableassignments) {
|
||||
$output .= $this->container_start('tool_assignmentupgrade_batchform');
|
||||
$output .= $this->moodleform($batchform);
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the result of an assignment conversion
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
* @param bool $success Set to true if the outcome of the conversion was a success
|
||||
* @param string $log The log from the conversion
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_assignment_result($assignmentsummary, $success, $log) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_result');
|
||||
$output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary));
|
||||
if (!$success) {
|
||||
$output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log));
|
||||
} else {
|
||||
$output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
|
||||
$output .= $this->container(html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')));
|
||||
}
|
||||
$output .= $this->container_end();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the are-you-sure page to confirm a manual upgrade.
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_assignment_are_you_sure($assignmentsummary) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('areyousure', 'tool_assignmentupgrade'));
|
||||
|
||||
$params = array('id' => $assignmentsummary->id, 'confirmed' => 1, 'sesskey' => sesskey());
|
||||
$output .= $this->confirm(get_string('areyousuremessage', 'tool_assignmentupgrade', $assignmentsummary),
|
||||
new single_button(tool_assignmentupgrade_url('upgradesingle', $params), get_string('yes')),
|
||||
tool_assignmentupgrade_url('listnotupgraded'));
|
||||
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method dealing with the fact we can not just fetch the output of flexible_table
|
||||
*
|
||||
* @param flexible_table $table
|
||||
* @param int $rowsperpage
|
||||
* @param bool $displaylinks Show links in the table
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function flexible_table(flexible_table $table, $rowsperpage, $displaylinks) {
|
||||
|
||||
$o = '';
|
||||
ob_start();
|
||||
$table->out($rowsperpage, $displaylinks);
|
||||
$o = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method dealing with the fact we can not just fetch the output of moodleforms
|
||||
*
|
||||
* @param moodleform $mform
|
||||
* @return string HTML
|
||||
*/
|
||||
protected function moodleform(moodleform $mform) {
|
||||
|
||||
$o = '';
|
||||
ob_start();
|
||||
$mform->display();
|
||||
$o = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render a link in a div, such as the 'Back to plugin main page' link.
|
||||
* @param string|moodle_url $url the link URL.
|
||||
* @param string $text the link text.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function end_of_page_link($url, $text) {
|
||||
return html_writer::tag('div', html_writer::link($url, $text), array('class' => 'mdl-align'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a link back to the plugin index page.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function back_to_index() {
|
||||
return $this->end_of_page_link(tool_assignmentupgrade_url('index'), get_string('backtoindex', 'tool_assignmentupgrade'));
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Adds this plugin to the admin menu.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($hassiteconfig) { // needs this condition or there is error on login page
|
||||
$ADMIN->add('root', new admin_externalpage('assignmentupgrade',
|
||||
get_string('pluginname', 'tool_assignmentupgrade'),
|
||||
new moodle_url('/admin/tool/assignmentupgrade/index.php')));
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable .c0 { display: none; }
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded.jsenabled .tool_assignmentupgrade_upgradetable .c0 { display: table-cell; }
|
||||
/*
|
||||
.gradingbatchoperationsform { display: none; }
|
||||
.jsenabled .gradingbatchoperationsform { display: block; }
|
||||
*/
|
||||
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.selectedrow td { background-color: #ffeecc; }
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.unselectedrow td { background-color: white; }
|
||||
|
||||
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_paginationform .hidden { display: none; }
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file contains the forms to create and edit an instance of this module
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
||||
|
||||
|
||||
/** Include formslib.php */
|
||||
require_once ($CFG->libdir.'/formslib.php');
|
||||
|
||||
/**
|
||||
* Assignment upgrade batch operations form
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_batchoperations_form extends moodleform {
|
||||
/**
|
||||
* Define this form - is called from parent constructor
|
||||
*/
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
$instance = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'general', get_string('batchoperations', 'tool_assignmentupgrade'));
|
||||
// visible elements
|
||||
$mform->addElement('hidden', 'selectedassignments', '', array('class'=>'selectedassignments'));
|
||||
|
||||
$mform->addElement('submit', 'upgradeselected', get_string('upgradeselected', 'tool_assignmentupgrade'));
|
||||
$mform->addElement('submit', 'upgradeall', get_string('upgradeall', 'tool_assignmentupgrade'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file contains the definition for the grading table which subclassses easy_table
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
require_once($CFG->libdir.'/gradelib.php');
|
||||
require_once($CFG->dirroot.'/mod/assign/locallib.php');
|
||||
|
||||
/**
|
||||
* Extends table_sql to provide a table of assignment submissions
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_assignments_table extends table_sql implements renderable {
|
||||
/** @var int $perpage */
|
||||
private $perpage = 10;
|
||||
/** @var int $rownum (global index of current row in table) */
|
||||
private $rownum = -1;
|
||||
/** @var renderer_base for getting output */
|
||||
private $output = null;
|
||||
/** @var boolean anyupgradableassignments - True if there is one or more assignments that can upgraded */
|
||||
public $anyupgradableassignments = false;
|
||||
|
||||
/**
|
||||
* This table loads a list of the old assignment instances and tests them to see if they can be upgraded
|
||||
*
|
||||
* @param int $perpage How many per page
|
||||
* @param int $rowoffset The starting row for pagination
|
||||
*/
|
||||
function __construct($perpage, $rowoffset=0) {
|
||||
global $PAGE;
|
||||
parent::__construct('tool_assignmentupgrade_assignments');
|
||||
$this->perpage = $perpage;
|
||||
$this->output = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$this->define_baseurl(new moodle_url('/admin/tool/assignmentupgrade/listnotupgraded.php'));
|
||||
|
||||
$this->anyupgradableassignments = tool_assignmentupgrade_any_upgradable_assignments();
|
||||
|
||||
// do some business - then set the sql
|
||||
if ($rowoffset) {
|
||||
$this->rownum = $rowoffset - 1;
|
||||
}
|
||||
|
||||
$fields = 'a.id as id, a.name as name, a.assignmenttype as type, c.shortname as courseshortname, c.id as courseid, COUNT(s.id) as submissioncount';
|
||||
$from = '{assignment} a JOIN {course} c ON a.course = c.id ' .
|
||||
' LEFT JOIN {assignment_submissions} s ON a.id = s.assignment';
|
||||
|
||||
$where = '1 = 1';
|
||||
$where .= ' GROUP BY a.id, a.name, a.assignmenttype, c.shortname, c.id ';
|
||||
|
||||
$this->set_sql($fields, $from, $where, array());
|
||||
$this->set_count_sql('SELECT COUNT(*) FROM {assignment} a JOIN {course} c ON a.course = c.id', array());
|
||||
|
||||
$columns = array();
|
||||
$headers = array();
|
||||
|
||||
$columns[] = 'select';
|
||||
$headers[] = get_string('select', 'tool_assignmentupgrade') . '<div class="selectall"><input type="checkbox" name="selectall" title="' . get_string('selectall') . '"/></div>';
|
||||
$columns[] = 'upgradable';
|
||||
$headers[] = get_string('upgradable', 'tool_assignmentupgrade');
|
||||
$columns[] = 'id';
|
||||
$headers[] = get_string('assignmentid', 'tool_assignmentupgrade');
|
||||
$columns[] = 'courseshortname';
|
||||
$headers[] = get_string('course');
|
||||
$columns[] = 'name';
|
||||
$headers[] = get_string('name');
|
||||
$columns[] = 'type';
|
||||
$headers[] = get_string('assignmenttype', 'tool_assignmentupgrade');
|
||||
$columns[] = 'submissioncount';
|
||||
$headers[] = get_string('submissions', 'tool_assignmentupgrade');
|
||||
|
||||
// set the columns
|
||||
$this->define_columns($columns);
|
||||
$this->define_headers($headers);
|
||||
$this->no_sorting('upgradable');
|
||||
$this->no_sorting('select');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of rows to display on a single page
|
||||
*
|
||||
* @return int The number of rows per page
|
||||
*/
|
||||
function get_rows_per_page() {
|
||||
return $this->perpage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a link to the assignment instance
|
||||
*
|
||||
* @param stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
function col_name(stdClass $row) {
|
||||
return html_writer::link(new moodle_url('/mod/assignment/view.php',
|
||||
array('a' => $row->id)), $row->name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format a link to the upgrade single tool
|
||||
*
|
||||
* @param stdClass $row (contains cached result from previous upgradable check)
|
||||
* @return string
|
||||
*/
|
||||
function col_upgradable(stdClass $row) {
|
||||
if ($row->upgradable) {
|
||||
return html_writer::link(new moodle_url('/admin/tool/assignmentupgrade/upgradesingleconfirm.php',
|
||||
array('id' => $row->id, 'sesskey' => sesskey())), get_string('supported', 'tool_assignmentupgrade'));
|
||||
} else {
|
||||
return get_string('notsupported', 'tool_assignmentupgrade');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a checkbox for selecting the current row for batch operations
|
||||
*
|
||||
* @param stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
function col_select(stdClass $row) {
|
||||
global $CFG;
|
||||
$version = get_config('assignment_' . $row->type, 'version');
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
if (assign::can_upgrade_assignment($row->type, $version)) {
|
||||
$row->upgradable = true;
|
||||
return '<input type="checkbox" name="selectedassignment" value="' . $row->id . '"/>';
|
||||
}
|
||||
$row->upgradable = false;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the table show_hide_link to not show for select column
|
||||
*
|
||||
* @param string $column the column name, index into various names.
|
||||
* @param int $index numerical index of the column.
|
||||
* @return string HTML fragment.
|
||||
*/
|
||||
protected function show_hide_link($column, $index) {
|
||||
if ($index > 0) {
|
||||
return parent::show_hide_link($column, $index);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$assignmentid = required_param('id', PARAM_INT);
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('upgradesingle', array('id' => $assignmentid)));
|
||||
|
||||
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$log = '';
|
||||
list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
|
||||
|
||||
echo $renderer->header();
|
||||
echo $renderer->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
|
||||
echo $renderer->convert_assignment_result($summary, $success, $log);
|
||||
echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
echo $renderer->footer();
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Script to show all the assignments that have not been upgraded after the main upgrade.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$assignmentid = required_param('id', PARAM_INT);
|
||||
|
||||
// admin_externalpage_setup calls require_login and checks moodle/site:config
|
||||
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('upgradesingle', array('id' => $assignmentid)));
|
||||
|
||||
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$assignmentinfo = tool_assignmentupgrade_get_assignment($assignmentid);
|
||||
|
||||
echo $renderer->convert_assignment_are_you_sure($assignmentinfo);
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Version details.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700;
|
||||
$plugin->requires = 2012061700;
|
||||
$plugin->component = 'tool_assignmentupgrade';
|
||||
$plugin->dependencies = array('mod_assign' => 2012061700);
|
||||
@@ -28,6 +28,37 @@ defined('MOODLE_INTERNAL') || die;
|
||||
function xmldb_tool_bloglevelupgrade_install() {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// this is a hack - admins were long ago instructed to upgrade blog levels,
|
||||
// the problem is that blog is not supposed to be course level activity!!
|
||||
|
||||
if (!empty($CFG->bloglevel_upgrade_complete)) {
|
||||
// somebody already upgrades, we do not need this any more
|
||||
unset_config('bloglevel_upgrade_complete');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($CFG->bloglevel)) {
|
||||
// fresh install?
|
||||
return;
|
||||
}
|
||||
|
||||
if (($CFG->bloglevel == BLOG_COURSE_LEVEL || $CFG->bloglevel == BLOG_GROUP_LEVEL)) {
|
||||
// inform admins that some settings require attention after upgrade
|
||||
$site = get_site();
|
||||
|
||||
$a = new StdClass;
|
||||
$a->sitename = $site->fullname;
|
||||
$a->fixurl = "$CFG->wwwroot/$CFG->admin/tool/bloglevelupgrade/index.php";
|
||||
|
||||
$subject = get_string('bloglevelupgrade', 'tool_bloglevelupgrade');
|
||||
$description = get_string('bloglevelupgradedescription', 'tool_bloglevelupgrade', $a);
|
||||
|
||||
// can not use messaging here because it is not configured yet!
|
||||
upgrade_log(UPGRADE_LOG_NOTICE, null, $subject, $description);
|
||||
set_config('tool_bloglevelupgrade_pending', 1);
|
||||
|
||||
echo $OUTPUT->notification($description);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -121,7 +121,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();
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_bloglevelupgrade'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
/**
|
||||
* Defines the capabilities used by the Language customization admin tool
|
||||
*
|
||||
* @package tool_customlang
|
||||
* @package tool
|
||||
* @subpackage customlang
|
||||
* @copyright 2010 David Mudrak <david@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,24 @@ defined('MOODLE_INTERNAL') || die;
|
||||
function xmldb_tool_customlang_install() {
|
||||
global $CFG, $OUTPUT, $DB;
|
||||
|
||||
// this is a hack - this plugin used to live in admin/report/customlang,
|
||||
// we want to remove the orphaned version info and capability
|
||||
// unless there is a new report type with the same name
|
||||
// the original tables can be dropped because they are used for caching only
|
||||
|
||||
if (!file_exists("$CFG->dirroot/report/customlang")) {
|
||||
unset_all_config_for_plugin('report_customlang');
|
||||
capabilities_cleanup('report_customlang');
|
||||
$dbman = $DB->get_manager();
|
||||
$table = new xmldb_table('report_customlang');
|
||||
if ($dbman->table_exists($table)) {
|
||||
$dbman->drop_table($table);
|
||||
}
|
||||
$table = new xmldb_table('report_customlang_components');
|
||||
if ($dbman->table_exists($table)) {
|
||||
$dbman->drop_table($table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="admin/tool/customlang/db" VERSION="20120122" COMMENT="XMLDB file for Moodle admin/tool/customlang"
|
||||
<XMLDB PATH="admin/tool/customlang/db" VERSION="20110925" COMMENT="XMLDB file for Moodle admin/tool/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">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="lang"/>
|
||||
<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"/>
|
||||
<FIELD NAME="componentid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The id of the component" PREVIOUS="lang" NEXT="stringid"/>
|
||||
<FIELD NAME="componentid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The id of the component" PREVIOUS="lang" NEXT="stringid"/>
|
||||
<FIELD NAME="stringid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The identifier of the string" PREVIOUS="componentid" NEXT="original"/>
|
||||
<FIELD NAME="original" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="English original of the string" PREVIOUS="stringid" NEXT="master"/>
|
||||
<FIELD NAME="master" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Master translation of the string as is distributed in the official lang pack, null if not translated" PREVIOUS="original" NEXT="local"/>
|
||||
<FIELD NAME="local" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Local customization of the string, null if not customized" PREVIOUS="master" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The timestamp of when the original or master was recently modified" PREVIOUS="local" NEXT="timecustomized"/>
|
||||
<FIELD NAME="timecustomized" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The timestamp of when the value of the local translation was recently modified, null if not customized yet" PREVIOUS="timemodified" NEXT="outdated"/>
|
||||
<FIELD NAME="outdated" TYPE="int" LENGTH="3" NOTNULL="false" DEFAULT="0" SEQUENCE="false" COMMENT="Either the English original or the master translation changed and the customization may be outdated" PREVIOUS="timecustomized" NEXT="modified"/>
|
||||
<FIELD NAME="modified" TYPE="int" LENGTH="3" NOTNULL="false" DEFAULT="0" SEQUENCE="false" COMMENT="Has the string been modified via the translator?" PREVIOUS="outdated"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The timestamp of when the original or master was recently modified" PREVIOUS="local" NEXT="timecustomized"/>
|
||||
<FIELD NAME="timecustomized" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The timestamp of when the value of the local translation was recently modified, null if not customized yet" PREVIOUS="timemodified" NEXT="outdated"/>
|
||||
<FIELD NAME="outdated" TYPE="int" LENGTH="3" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Either the English original or the master translation changed and the customization may be outdated" PREVIOUS="timecustomized" NEXT="modified"/>
|
||||
<FIELD NAME="modified" TYPE="int" LENGTH="3" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Has the string been modified via the translator?" PREVIOUS="outdated"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fk_component"/>
|
||||
@@ -28,7 +28,7 @@
|
||||
</TABLE>
|
||||
<TABLE NAME="tool_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="tool_customlang">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="name"/>
|
||||
<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"/>
|
||||
<FIELD NAME="version" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The checked out version of the plugin, null if the version is unknown" PREVIOUS="name"/>
|
||||
</FIELDS>
|
||||
|
||||
@@ -29,10 +29,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
|
||||
$dbman = $DB->get_manager();
|
||||
|
||||
|
||||
// Moodle v2.3.0 release upgrade line
|
||||
// Moodle v2.2.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700;
|
||||
$plugin->requires = 2012061700;
|
||||
$plugin->version = 2011092500;
|
||||
$plugin->requires = 2011092100;
|
||||
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This script migrates data from current database to another
|
||||
*
|
||||
* This script is not intended for beginners!
|
||||
* Potential problems:
|
||||
* - su to apache account or sudo before execution
|
||||
* - already broken DB scheme or invalid data
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../../../config.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
require_once(__DIR__.'/../locallib.php');
|
||||
|
||||
$help =
|
||||
"Database migration script.
|
||||
|
||||
It is strongly recommended to turn off the web server
|
||||
or enable CLI maintenance mode before starting the migration.
|
||||
|
||||
Options:
|
||||
--dbtype=TYPE Database type.
|
||||
--dblibrary=TYPE Database library. Defaults to 'native'.
|
||||
--dbhost=HOST Database host.
|
||||
--dbname=NAME Database name.
|
||||
--dbuser=USERNAME Database user.
|
||||
--dbpass=PASSWORD Database password.
|
||||
--dbport=NUMBER Database port.
|
||||
--prefix=STRING Table prefix for above database tables.
|
||||
--dbsocket=PATH Use database sockets. Available for some databases only.
|
||||
-h, --help Print out this help.
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/tool/dbtransfer/cli/migrate.php
|
||||
";
|
||||
|
||||
// Now get cli options.
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'dbtype' => null,
|
||||
'dblibrary' => 'native',
|
||||
'dbhost' => null,
|
||||
'dbname' => null,
|
||||
'dbuser' => null,
|
||||
'dbpass' => null,
|
||||
'dbport' => null,
|
||||
'prefix' => null,
|
||||
'dbsocket' => null,
|
||||
'maintenance' => null,
|
||||
'list' => false,
|
||||
'help' => false,
|
||||
),
|
||||
array(
|
||||
'm' => 'maintenance',
|
||||
'l' => 'list',
|
||||
'h' => 'help',
|
||||
)
|
||||
);
|
||||
|
||||
if ($options['help']) {
|
||||
echo $help;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (empty($CFG->version)) {
|
||||
cli_error(get_string('missingconfigversion', 'debug'));
|
||||
}
|
||||
|
||||
echo "\n".get_string('cliheading', 'tool_dbtransfer')."\n\n";
|
||||
|
||||
$drivers = tool_dbtransfer_get_drivers();
|
||||
|
||||
if (!isset($options['dbtype'])) {
|
||||
$choose = array();
|
||||
foreach ($drivers as $driver => $name) {
|
||||
list($dbtype, $dblibrary) = explode('/', $driver);
|
||||
$choose[$dbtype] = $dbtype;
|
||||
}
|
||||
$optionsstr = implode(', ', $choose);
|
||||
cli_heading(get_string('databasetypehead', 'install')." ($optionsstr)");
|
||||
$options['dbtype'] = cli_input(get_string('clitypevalue', 'admin'), '', $choose, true);
|
||||
}
|
||||
|
||||
$choose = array();
|
||||
foreach ($drivers as $driver => $name) {
|
||||
list($dbtype, $dblibrary) = explode('/', $driver);
|
||||
if ($dbtype === $options['dbtype']) {
|
||||
$choose[$dblibrary] = $dblibrary;
|
||||
}
|
||||
}
|
||||
if (!isset($options['dblibrary']) or !isset($choose[$options['dblibrary']])) {
|
||||
$optionsstr = implode(', ', $choose);
|
||||
cli_heading('Database library'." ($optionsstr)"); // Note: no need to localise unless we add real PDO drivers.
|
||||
$options['dblibrary'] = cli_input(get_string('clitypevalue', 'admin'), '', $choose, true);
|
||||
}
|
||||
|
||||
if (!isset($options['dbhost'])) {
|
||||
cli_heading(get_string('databasehost', 'install'));
|
||||
$options['dbhost'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if (!isset($options['dbname'])) {
|
||||
cli_heading(get_string('databasename', 'install'));
|
||||
$options['dbname'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if (!isset($options['dbuser'])) {
|
||||
cli_heading(get_string('databaseuser', 'install'));
|
||||
$options['dbuser'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if (!isset($options['dbpass'])) {
|
||||
cli_heading(get_string('databasepass', 'install'));
|
||||
$options['dbpass'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if (!isset($options['prefix'])) {
|
||||
cli_heading(get_string('dbprefix', 'install'));
|
||||
$options['prefix'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if (!isset($options['dbport'])) {
|
||||
cli_heading(get_string('dbport', 'install'));
|
||||
$options['dbport'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
|
||||
if ($CFG->ostype !== 'WINDOWS') {
|
||||
if (!isset($options['dbsocket'])) {
|
||||
cli_heading(get_string('databasesocket', 'install'));
|
||||
$options['dbsocket'] = cli_input(get_string('clitypevalue', 'admin'));
|
||||
}
|
||||
}
|
||||
|
||||
$a = (object)array('dbtypefrom' => $CFG->dbtype, 'dbtype' => $options['dbtype'],
|
||||
'dbname' => $options['dbname'], 'dbhost' => $options['dbhost']);
|
||||
cli_heading(get_string('transferringdbto', 'tool_dbtransfer', $a));
|
||||
|
||||
// Try target DB connection.
|
||||
$problem = '';
|
||||
|
||||
$targetdb = moodle_database::get_driver_instance($options['dbtype'], $options['dblibrary']);
|
||||
$dboptions = array();
|
||||
if ($options['dbport']) {
|
||||
$dboptions['dbport'] = $options['dbport'];
|
||||
}
|
||||
if ($options['dbsocket']) {
|
||||
$dboptions['dbsocket'] = $options['dbsocket'];
|
||||
}
|
||||
try {
|
||||
$targetdb->connect($options['dbhost'], $options['dbuser'], $options['dbpass'], $options['dbname'],
|
||||
$options['prefix'], $dboptions);
|
||||
if ($targetdb->get_tables()) {
|
||||
$problem .= get_string('targetdatabasenotempty', 'tool_dbtransfer');
|
||||
}
|
||||
} catch (moodle_exception $e) {
|
||||
$problem .= $e->debuginfo."\n\n";
|
||||
$problem .= get_string('notargetconectexception', 'tool_dbtransfer');
|
||||
}
|
||||
|
||||
if ($problem !== '') {
|
||||
echo $problem."\n\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$feedback = new text_progress_trace();
|
||||
tool_dbtransfer_transfer_database($DB, $targetdb, $feedback);
|
||||
$feedback->finished();
|
||||
|
||||
cli_heading(get_string('success'));
|
||||
exit(0);
|
||||
@@ -17,28 +17,19 @@
|
||||
/**
|
||||
* Transfer form
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @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;
|
||||
|
||||
require_once($CFG->libdir.'/formslib.php');
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Definition of db export settings form.
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class database_export_form extends moodleform {
|
||||
/**
|
||||
* Define the export form.
|
||||
*/
|
||||
public function definition() {
|
||||
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'database', get_string('dbexport', 'tool_dbtransfer'));
|
||||
|
||||
@@ -17,84 +17,55 @@
|
||||
/**
|
||||
* Transfer form
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @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;
|
||||
|
||||
require_once($CFG->libdir.'/formslib.php');
|
||||
require_once(__DIR__.'/locallib.php');
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Definition of db transfer settings form.
|
||||
*
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class database_transfer_form extends moodleform {
|
||||
|
||||
/**
|
||||
* Define transfer form.
|
||||
*/
|
||||
protected function definition() {
|
||||
global $CFG;
|
||||
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'database', get_string('targetdatabase', 'tool_dbtransfer'));
|
||||
$mform->addElement('header', 'database', get_string('dbtransfer', 'tool_dbtransfer'));
|
||||
|
||||
$drivers = tool_dbtransfer_get_drivers();
|
||||
$drivers = array_reverse($drivers, true);
|
||||
$drivers[''] = get_string('choosedots');
|
||||
$drivers = array_reverse($drivers, true);
|
||||
|
||||
$mform->addElement('select', 'driver', get_string('dbtype', 'install'), $drivers);
|
||||
$mform->addElement('text', 'dbhost', get_string('databasehost', 'install'));
|
||||
$mform->addElement('text', 'dbname', get_string('databasename', 'install'));
|
||||
$mform->addElement('text', 'dbuser', get_string('databaseuser', 'install'));
|
||||
$mform->addElement('passwordunmask', 'dbpass', get_string('databasepass', 'install'));
|
||||
$mform->addElement('text', 'prefix', get_string('dbprefix', 'install'));
|
||||
$mform->addElement('text', 'dbport', get_string('dbport', 'install'));
|
||||
if ($CFG->ostype !== 'WINDOWS') {
|
||||
$mform->addElement('text', 'dbsocket', get_string('databasesocket', 'install'));
|
||||
} else {
|
||||
$mform->addElement('hidden', 'dbsocket');
|
||||
$supported = array (
|
||||
'mysqli/native',
|
||||
'pgsql/native',
|
||||
'mssql/native',
|
||||
'oci/native',
|
||||
'sqlite3/pdo',
|
||||
);
|
||||
$drivers = array();
|
||||
foreach($supported as $driver) {
|
||||
list($dbtype, $dblibrary) = explode('/', $driver);
|
||||
$targetdb = moodle_database::get_driver_instance($dbtype, $dblibrary);
|
||||
if ($targetdb->driver_installed() !== true) {
|
||||
continue;
|
||||
}
|
||||
$drivers[$driver] = $driver;
|
||||
}
|
||||
|
||||
$mform->addRule('driver', get_string('required'), 'required', null);
|
||||
$mform->addElement('select', 'driver', get_string('dbtype', 'install'), $drivers);
|
||||
$mform->addElement('text', 'dbhost', get_string('dbhost', 'install'));
|
||||
$mform->addElement('text', 'dbname', get_string('database', 'install'));
|
||||
$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);
|
||||
$mform->addRule('dbuser', get_string('required'), 'required', null);
|
||||
$mform->addRule('dbpass', get_string('required'), 'required', null);
|
||||
if (!isset($drivers['mysqli/native'])) {
|
||||
$mform->addRule('prefix', get_string('required'), 'required', null);
|
||||
}
|
||||
|
||||
$mform->addElement('header', 'database', get_string('options', 'tool_dbtransfer'));
|
||||
|
||||
$mform->addElement('advcheckbox', 'enablemaintenance', get_string('enablemaintenance', 'tool_dbtransfer'));
|
||||
$mform->addHelpButton('enablemaintenance', 'enablemaintenance', 'tool_dbtransfer');
|
||||
$mform->addRule('prefix', get_string('required'), 'required', null);
|
||||
|
||||
$this->add_action_buttons(false, get_string('transferdata', 'tool_dbtransfer'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate prefix is present for non-mysql drivers.
|
||||
* @param array $data
|
||||
* @param array $files
|
||||
* @return array
|
||||
*/
|
||||
public function validation($data, $files) {
|
||||
$errors = parent::validation($data, $files);
|
||||
if ($data['driver'] !== 'mysqli/native') {
|
||||
// This is a bloody hack, let's pretend we do not need to look at db family...
|
||||
if ($data['prefix'] === '') {
|
||||
$errors['prefix'] = get_string('required');
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
/**
|
||||
* Export
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2008 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
@@ -31,15 +32,15 @@ require_once('database_export_form.php');
|
||||
require_login();
|
||||
admin_externalpage_setup('tooldbexport');
|
||||
|
||||
// Create form.
|
||||
//create form
|
||||
$form = new database_export_form();
|
||||
|
||||
if ($data = $form->get_data()) {
|
||||
tool_dbtransfer_export_xml_database($data->description, $DB);
|
||||
dbtransfer_export_xml_database($data->description, $DB);
|
||||
die;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
// TODO: add some more info here.
|
||||
// TODO: add some more info here
|
||||
$form->display();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
/**
|
||||
* Transfer tool
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2008 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
@@ -31,9 +32,8 @@ require_once('database_transfer_form.php');
|
||||
require_login();
|
||||
admin_externalpage_setup('tooldbtransfer');
|
||||
|
||||
// Create the form.
|
||||
// Create the form
|
||||
$form = new database_transfer_form();
|
||||
$problem = '';
|
||||
|
||||
// If we have valid input.
|
||||
if ($data = $form->get_data()) {
|
||||
@@ -47,63 +47,33 @@ if ($data = $form->get_data()) {
|
||||
if ($data->dbsocket) {
|
||||
$dboptions['dbsocket'] = $data->dbsocket;
|
||||
}
|
||||
try {
|
||||
$targetdb->connect($data->dbhost, $data->dbuser, $data->dbpass, $data->dbname, $data->prefix, $dboptions);
|
||||
if ($targetdb->get_tables()) {
|
||||
$problem .= get_string('targetdatabasenotempty', 'tool_dbtransfer');
|
||||
}
|
||||
} catch (moodle_exception $e) {
|
||||
$problem .= get_string('notargetconectexception', 'tool_dbtransfer').'<br />'.$e->debuginfo;
|
||||
if (!$targetdb->connect($data->dbhost, $data->dbuser, $data->dbpass, $data->dbname, $data->prefix, $dboptions)) {
|
||||
throw new dbtransfer_exception('notargetconectexception', null, "$CFG->wwwroot/$CFG->admin/tool/dbtransfer/");
|
||||
}
|
||||
if ($targetdb->get_tables()) {
|
||||
throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/tool/dbtransfer/");
|
||||
}
|
||||
|
||||
if ($problem === '') {
|
||||
// Scroll down to the bottom when finished.
|
||||
$PAGE->requires->js_init_code("window.scrollTo(0, 5000000);");
|
||||
// Start output.
|
||||
echo $OUTPUT->header();
|
||||
$data->dbtype = $dbtype;
|
||||
echo $OUTPUT->heading(get_string('transferringdbto', 'tool_dbtransfer', $data));
|
||||
|
||||
// Enable CLI maintenance mode if requested.
|
||||
if ($data->enablemaintenance) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
tool_dbtransfer_create_maintenance_file();
|
||||
}
|
||||
// Do the transfer.
|
||||
$feedback = new html_list_progress_trace();
|
||||
dbtransfer_transfer_database($DB, $targetdb, $feedback);
|
||||
$feedback->finished();
|
||||
|
||||
// Start output.
|
||||
echo $OUTPUT->header();
|
||||
$data->dbtype = $dbtype;
|
||||
$data->dbtypefrom = $CFG->dbtype;
|
||||
echo $OUTPUT->heading(get_string('transferringdbto', 'tool_dbtransfer', $data));
|
||||
|
||||
// Do the transfer.
|
||||
$CFG->tool_dbransfer_migration_running = true;
|
||||
try {
|
||||
$feedback = new html_list_progress_trace();
|
||||
tool_dbtransfer_transfer_database($DB, $targetdb, $feedback);
|
||||
$feedback->finished();
|
||||
} catch (Exception $e) {
|
||||
if ($data->enablemaintenance) {
|
||||
tool_dbtransfer_maintenance_callback();
|
||||
}
|
||||
unset($CFG->tool_dbransfer_migration_running);
|
||||
throw $e;
|
||||
}
|
||||
unset($CFG->tool_dbransfer_migration_running);
|
||||
|
||||
// Finish up.
|
||||
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button("$CFG->wwwroot/$CFG->admin/");
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
// 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', 'tool_dbtransfer'));
|
||||
|
||||
$info = format_text(get_string('transferdbintro', 'tool_dbtransfer'), FORMAT_MARKDOWN);
|
||||
echo $OUTPUT->box($info);
|
||||
|
||||
echo '<p>', get_string('transferdbintro', 'tool_dbtransfer'), "</p>\n\n";
|
||||
$form->display();
|
||||
if ($problem !== '') {
|
||||
echo $OUTPUT->box($problem, 'generalbox error');
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -15,29 +15,21 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_generator', language 'en'.
|
||||
* Strings for component 'tool_generator', language 'en', branch 'MOODLE_22_STABLE'
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2011 Petr Skoda {@link http://skodak.org/}
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2011 Petr Skoda
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['clidriverlist'] = 'Available database drivers for migration';
|
||||
$string['cliheading'] = 'Database migration - make sure nobody is accessing the server during migration!';
|
||||
$string['climigrationnotice'] = 'Database migration in progress, please wait until the migration completes and server administrator updates configuration and deletes the $CFG->dataroot/climaintenance.html file.';
|
||||
$string['convertinglogdisplay'] = 'Converting log display actions';
|
||||
$string['dbexport'] = 'Database export';
|
||||
$string['dbtransfer'] = 'Database migration';
|
||||
$string['enablemaintenance'] = 'Enable maintenance mode';
|
||||
$string['enablemaintenance_help'] = 'This option enables maintanance mode during and after the database migration, it prevents access of all users until the migration is completed. Please note that administrator has to manually delete $CFG->dataroot/climaintenance.html file after updating config.php settings to resume normal operation.';
|
||||
$string['dbexport'] = 'Database transfer';
|
||||
$string['dbtransfer'] = 'Database export';
|
||||
$string['exportdata'] = 'Export data';
|
||||
$string['notargetconectexception'] = 'Can not connect target database, sorry.';
|
||||
$string['options'] = 'Options';
|
||||
$string['pluginname'] = 'Database transfer';
|
||||
$string['targetdatabase'] = 'Target database';
|
||||
$string['targetdatabasenotempty'] = 'Target database must not contain any tables with given prefix!';
|
||||
$string['transferdata'] = 'Transfer data';
|
||||
$string['transferdbintro'] = 'This script will transfer the entire contents of this database to another database server. It is often used for migration of data to different database type.';
|
||||
$string['transferdbintro'] = 'This script will transfer the entire contents of this database to another database server.';
|
||||
$string['transferdbtoserver'] = 'Transfer this Moodle database to another server';
|
||||
$string['transferringdbto'] = 'Transferring this {$a->dbtypefrom} database to {$a->dbtype} database "{$a->dbname}" on "{$a->dbhost}"';
|
||||
$string['transferringdbto'] = 'Transferring this database to {$a->dbtype} database {$a->dbname} on {$a->dbhost}';
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
/**
|
||||
* Export db content to file.
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @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
|
||||
*/
|
||||
|
||||
@@ -43,16 +44,11 @@ TODO:
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/dtllib.php');
|
||||
|
||||
/**
|
||||
* Initiate database export.
|
||||
* @param string $description
|
||||
* @param moodle_database $mdb
|
||||
* @return does not return, calls die()
|
||||
*/
|
||||
function tool_dbtransfer_export_xml_database($description, $mdb) {
|
||||
|
||||
function dbtransfer_export_xml_database($description, $mdb) {
|
||||
@set_time_limit(0);
|
||||
|
||||
session_get_instance()->write_close(); // Release session.
|
||||
session_get_instance()->write_close(); // release session
|
||||
|
||||
header('Content-Type: application/xhtml+xml; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename=database.xml');
|
||||
@@ -65,145 +61,16 @@ function tool_dbtransfer_export_xml_database($description, $mdb) {
|
||||
$var = new file_xml_database_exporter('php://output', $mdb);
|
||||
$var->export_database($description);
|
||||
|
||||
// No more output.
|
||||
// no more output
|
||||
die;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate database transfer.
|
||||
* @param moodle_database $sourcedb
|
||||
* @param moodle_database $targetdb
|
||||
* @param progress_trace $feedback
|
||||
* @return void
|
||||
*/
|
||||
function tool_dbtransfer_transfer_database(moodle_database $sourcedb, moodle_database $targetdb, progress_trace $feedback = null) {
|
||||
|
||||
function dbtransfer_transfer_database($sourcedb, $targetdb, $feedback = null) {
|
||||
@set_time_limit(0);
|
||||
|
||||
session_get_instance()->write_close(); // Release session.
|
||||
session_get_instance()->write_close(); // release session
|
||||
|
||||
$var = new database_mover($sourcedb, $targetdb, true, $feedback);
|
||||
$var->export_database(null);
|
||||
|
||||
tool_dbtransfer_rebuild_target_log_actions($targetdb, $feedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Very hacky function for rebuilding of log actions in target database.
|
||||
* @param moodle_database $target
|
||||
* @param progress_trace $feedback
|
||||
* @return void
|
||||
* @throws Exception on conversion error
|
||||
*/
|
||||
function tool_dbtransfer_rebuild_target_log_actions(moodle_database $target, progress_trace $feedback = null) {
|
||||
global $DB, $CFG;
|
||||
require_once("$CFG->libdir/upgradelib.php");
|
||||
|
||||
$feedback->output(get_string('convertinglogdisplay', 'tool_dbtransfer'));
|
||||
|
||||
$olddb = $DB;
|
||||
$DB = $target;
|
||||
try {
|
||||
$DB->delete_records('log_display', array('component'=>'moodle'));
|
||||
log_update_descriptions('moodle');
|
||||
$plugintypes = get_plugin_types();
|
||||
foreach ($plugintypes as $type => $location) {
|
||||
$plugs = get_plugin_list($type);
|
||||
foreach ($plugs as $plug => $fullplug) {
|
||||
$component = $type.'_'.$plug;
|
||||
$DB->delete_records('log_display', array('component'=>$component));
|
||||
log_update_descriptions($component);
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$DB = $olddb;
|
||||
throw $e;
|
||||
}
|
||||
$DB = $olddb;
|
||||
$feedback->output(get_string('done', 'core_dbtransfer', null), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of fully working database drivers present in system.
|
||||
* @return array
|
||||
*/
|
||||
function tool_dbtransfer_get_drivers() {
|
||||
global $CFG;
|
||||
|
||||
$files = new RegexIterator(new DirectoryIterator("$CFG->libdir/dml"), '|^.*_moodle_database\.php$|');
|
||||
$drivers = array();
|
||||
|
||||
foreach ($files as $file) {
|
||||
$matches = null;
|
||||
preg_match('|^([a-z0-9]+)_([a-z]+)_moodle_database\.php$|', $file->getFilename(), $matches);
|
||||
if (!$matches) {
|
||||
continue;
|
||||
}
|
||||
$dbtype = $matches[1];
|
||||
$dblibrary = $matches[2];
|
||||
|
||||
if ($dbtype === 'sqlite3') {
|
||||
// Blacklist unfinished drivers.
|
||||
continue;
|
||||
}
|
||||
|
||||
$targetdb = moodle_database::get_driver_instance($dbtype, $dblibrary, false);
|
||||
if ($targetdb->driver_installed() !== true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$driver = $dbtype.'/'.$dblibrary;
|
||||
|
||||
$drivers[$driver] = $targetdb->get_name();
|
||||
};
|
||||
|
||||
return $drivers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create CLI maintenance file to prevent all access.
|
||||
*/
|
||||
function tool_dbtransfer_create_maintenance_file() {
|
||||
global $CFG;
|
||||
|
||||
register_shutdown_function('tool_dbtransfer_maintenance_callback');
|
||||
|
||||
$options = new stdClass();
|
||||
$options->trusted = false;
|
||||
$options->noclean = false;
|
||||
$options->smiley = false;
|
||||
$options->filter = false;
|
||||
$options->para = true;
|
||||
$options->newlines = false;
|
||||
|
||||
$message = format_text(get_string('climigrationnotice', 'tool_dbtransfer'), FORMAT_MARKDOWN, $options);
|
||||
$message = bootstrap_renderer::early_error_content($message, '', '', array());
|
||||
$html = <<<OET
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><header/>
|
||||
<body>$message</body>
|
||||
</html>
|
||||
OET;
|
||||
|
||||
file_put_contents("$CFG->dataroot/climaintenance.html", $html);
|
||||
@chmod("$CFG->dataroot/climaintenance.html", $CFG->filepermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback is responsible for unsetting maintenance mode
|
||||
* if the migration is interrupted.
|
||||
*/
|
||||
function tool_dbtransfer_maintenance_callback() {
|
||||
global $CFG;
|
||||
|
||||
if (empty($CFG->tool_dbransfer_migration_running)) {
|
||||
// Migration was finished properly - keep the maintenance file in place.
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_exists("$CFG->dataroot/climaintenance.html")) {
|
||||
// Failed migration, revert to normal site operation.
|
||||
unlink("$CFG->dataroot/climaintenance.html");
|
||||
error_log('tool_dbtransfer: Interrupted database migration detected, switching off CLI maintenance mode.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,19 +15,18 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Add hidden links db transfer tool
|
||||
* Link to InnoDB conversion tool
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2011 Petr Skoda {@link http://skodak.org/}
|
||||
* @package tool
|
||||
* @subpackage dbtransfer
|
||||
* @copyright 2011 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('experimental', new admin_externalpage('tooldbtransfer', get_string('dbtransfer', 'tool_dbtransfer'),
|
||||
$CFG->wwwroot.'/'.$CFG->admin.'/tool/dbtransfer/index.php', 'moodle/site:config', false));
|
||||
// DB export/import is not ready yet - keep it hidden for now.
|
||||
$ADMIN->add('experimental', new admin_externalpage('tooldbexport', get_string('dbexport', 'tool_dbtransfer'),
|
||||
$CFG->wwwroot.'/'.$CFG->admin.'/tool/dbtransfer/dbexport.php', 'moodle/site:config', true));
|
||||
}
|
||||
// DB transfer related pages
|
||||
$ADMIN->add('experimental', new admin_externalpage('tooldbtransfer', get_string('dbtransfer', 'tool_dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/tool/dbtransfer/index.php', 'moodle/site:config', true));
|
||||
$ADMIN->add('experimental', new admin_externalpage('tooldbexport', get_string('dbexport', 'tool_dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/tool/dbtransfer/dbexport.php', 'moodle/site:config', true));
|
||||
}
|
||||
@@ -17,13 +17,14 @@
|
||||
/**
|
||||
* Version details.
|
||||
*
|
||||
* @package tool_dbtransfer
|
||||
* @copyright 2008 Petr Skoda {@link http://skodak.org/}
|
||||
* @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();
|
||||
|
||||
$plugin->version = 2012062200; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -348,7 +348,7 @@ class generator {
|
||||
$base_course->summary = 'Blah Blah';
|
||||
$base_course->format = 'weeks';
|
||||
$base_course->numsections = '10';
|
||||
$base_course->startdate = time();
|
||||
$base_course->startdate = mktime();
|
||||
$base_course->id = '0';
|
||||
|
||||
$courses_count = 0;
|
||||
@@ -461,7 +461,7 @@ class generator {
|
||||
case 'assignment':
|
||||
$module->intro = $description;
|
||||
$module->assignmenttype = $this->get_module_type('assignment');
|
||||
$module->timedue = time() + 89487321;
|
||||
$module->timedue = mktime() + 89487321;
|
||||
$module->grade = rand(50,100);
|
||||
break;
|
||||
case 'chat':
|
||||
@@ -505,8 +505,8 @@ class generator {
|
||||
break;
|
||||
case 'lesson':
|
||||
$module->lessondefault = 1;
|
||||
$module->available = time();
|
||||
$module->deadline = time() + 719891987;
|
||||
$module->available = mktime();
|
||||
$module->deadline = mktime() + 719891987;
|
||||
$module->grade = 100;
|
||||
break;
|
||||
case 'quiz':
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_generator'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
width: 60%;
|
||||
margin: auto;
|
||||
padding: 1em;
|
||||
border: 1px solid black;
|
||||
border: 1px black solid;
|
||||
-moz-border-radius: 6px;
|
||||
}
|
||||
.path-admin-tool-health dl.healthissues {
|
||||
@@ -35,15 +35,15 @@
|
||||
.path-admin-tool-health dl.healthissues dd {
|
||||
margin: 0px;
|
||||
padding: 1em;
|
||||
border: 1px solid black;
|
||||
border: 1px black solid;
|
||||
}
|
||||
.path-admin-tool-health dl.healthissues dt {
|
||||
font-weight: bold;
|
||||
border-bottom: 0;
|
||||
border-bottom: none;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
.path-admin-tool-health dl.healthissues dd {
|
||||
border-top: 0;
|
||||
border-top: none;
|
||||
padding-top: 0.5em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_health'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
|
||||
|
||||
@@ -42,40 +42,29 @@ if ($DB->get_dbfamily() != 'mysql') {
|
||||
notice('This function is for MySQL databases only!', new moodle_url('/admin/'));
|
||||
}
|
||||
|
||||
$prefix = str_replace('_', '\\_', $DB->get_prefix()).'%';
|
||||
$sql = "SHOW TABLE STATUS WHERE Name LIKE ? AND Engine <> 'InnoDB'";
|
||||
$rs = $DB->get_recordset_sql($sql, array($prefix));
|
||||
if (!$rs->valid()) {
|
||||
$rs->close();
|
||||
echo $OUTPUT->box('<p>All tables are already using InnoDB database engine.</p>');
|
||||
echo $OUTPUT->continue_button('/admin/');
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
if (data_submitted() and $confirm and confirm_sesskey()) {
|
||||
|
||||
echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
foreach ($rs as $table) {
|
||||
if ($tables = $DB->get_tables()) {
|
||||
$DB->set_debug(true);
|
||||
$fulltable = $table->name;
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE $fulltable ENGINE=INNODB");
|
||||
} catch (moodle_exception $e) {
|
||||
echo $OUTPUT->notification(s($e->getMessage()).'<br />'.s($e->debuginfo));
|
||||
foreach ($tables as $table) {
|
||||
$fulltable = $DB->get_prefix().$table;
|
||||
try {
|
||||
$DB->change_database_structure("ALTER TABLE $fulltable ENGINE=INNODB");
|
||||
} catch (moodle_exception $e) {
|
||||
echo $OUTPUT->notification(s($e->getMessage()).'<br />'.s($e->debuginfo));
|
||||
}
|
||||
}
|
||||
$DB->set_debug(false);
|
||||
}
|
||||
$rs->close();
|
||||
echo $OUTPUT->notification('... done.', 'notifysuccess');
|
||||
echo $OUTPUT->continue_button(new moodle_url('/admin/'));
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
} else {
|
||||
$rs->close();
|
||||
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
|
||||
$formcontinue = new single_button(new moodle_url('/admin/tool/innodb/index.php', $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button(new moodle_url('/admin/'), get_string('no'), 'get');
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -287,7 +287,7 @@ $url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => DELETI
|
||||
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', 'tool_langimport'), '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()));
|
||||
@@ -315,7 +315,7 @@ if (!empty($options)) {
|
||||
$url = new moodle_url('/admin/tool/langimport/index.php', array('mode' => INSTALLATION_OF_SELECTED_LANG));
|
||||
echo html_writer::start_tag('form', array('id' => 'installform', 'action' => $url->out(), 'method' => 'post'));
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::label(get_string('availablelangs','install'), 'menupack');
|
||||
echo html_writer::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()));
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_multilangupgrade'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
|
||||
@@ -1,66 +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/>.
|
||||
|
||||
/**
|
||||
* All in one init script - PHP version.
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
die; // no access from web!
|
||||
}
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
|
||||
echo "Initialising Moodle PHPUnit test environment...\n";
|
||||
|
||||
$output = null;
|
||||
exec('php --version', $output, $code);
|
||||
if ($code != 0) {
|
||||
phpunit_bootstrap_error(1, 'Can not execute \'php\' binary.');
|
||||
}
|
||||
|
||||
chdir(__DIR__);
|
||||
$output = null;
|
||||
exec("php util.php --diag", $output, $code);
|
||||
if ($code == 0) {
|
||||
// everything is ready
|
||||
|
||||
} else if ($code == PHPUNIT_EXITCODE_INSTALL) {
|
||||
passthru("php util.php --install", $code);
|
||||
if ($code != 0) {
|
||||
exit($code);
|
||||
}
|
||||
|
||||
} else if ($code == PHPUNIT_EXITCODE_REINSTALL) {
|
||||
passthru("php util.php --drop", $code);
|
||||
passthru("php util.php --install", $code);
|
||||
if ($code != 0) {
|
||||
exit($code);
|
||||
}
|
||||
|
||||
} else {
|
||||
echo implode("\n", $output)."\n";
|
||||
exit($code);
|
||||
}
|
||||
|
||||
passthru("php util.php --buildconfig", $code);
|
||||
|
||||
exit(0);
|
||||
@@ -1,160 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* PHPUnit related utilities.
|
||||
*
|
||||
* Exit codes: {@see phpunit_bootstrap_error()}
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
die; // no access from web!
|
||||
}
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'drop' => false,
|
||||
'install' => false,
|
||||
'buildconfig' => false,
|
||||
'buildcomponentconfigs' => false,
|
||||
'diag' => false,
|
||||
'phpunitdir' => false,
|
||||
'run' => false,
|
||||
'help' => false,
|
||||
),
|
||||
array(
|
||||
'h' => 'help'
|
||||
)
|
||||
);
|
||||
|
||||
if ($options['phpunitdir']) {
|
||||
// nasty skodak's hack for testing of future PHPUnit versions - intentionally not documented
|
||||
if (!file_exists($options['phpunitdir'])) {
|
||||
cli_error('Invalid custom PHPUnit lib location');
|
||||
}
|
||||
$files = scandir($options['phpunitdir']);
|
||||
foreach ($files as $file) {
|
||||
$path = $options['phpunitdir'].'/'.$file;
|
||||
if (!is_dir($path) or strpos($file, '.') === 0) {
|
||||
continue;
|
||||
}
|
||||
ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'));
|
||||
}
|
||||
unset($files);
|
||||
unset($file);
|
||||
}
|
||||
|
||||
// verify PHPUnit libs are loaded
|
||||
if (!include_once('PHPUnit/Autoload.php')) {
|
||||
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
|
||||
}
|
||||
|
||||
if ($options['run']) {
|
||||
unset($options);
|
||||
unset($unrecognized);
|
||||
|
||||
foreach ($_SERVER['argv'] as $k=>$v) {
|
||||
if (strpos($v, '--run') === 0 or strpos($v, '--phpunitdir') === 0) {
|
||||
unset($_SERVER['argv'][$k]);
|
||||
$_SERVER['argc'] = $_SERVER['argc'] - 1;
|
||||
}
|
||||
}
|
||||
$_SERVER['argv'] = array_values($_SERVER['argv']);
|
||||
PHPUnit_TextUI_Command::main();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
define('PHPUNIT_UTIL', true);
|
||||
|
||||
require(__DIR__ . '/../../../../lib/phpunit/bootstrap.php');
|
||||
|
||||
// from now on this is a regular moodle CLI_SCRIPT
|
||||
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/upgradelib.php');
|
||||
require_once($CFG->libdir.'/clilib.php');
|
||||
require_once($CFG->libdir.'/pluginlib.php');
|
||||
require_once($CFG->libdir.'/installlib.php');
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
$diag = $options['diag'];
|
||||
$drop = $options['drop'];
|
||||
$install = $options['install'];
|
||||
$buildconfig = $options['buildconfig'];
|
||||
$buildcomponentconfigs = $options['buildcomponentconfigs'];
|
||||
|
||||
if ($options['help'] or (!$drop and !$install and !$buildconfig and !$buildcomponentconfigs and !$diag)) {
|
||||
$help = "Various PHPUnit utility functions
|
||||
|
||||
Options:
|
||||
--drop Drop database and dataroot
|
||||
--install Install database
|
||||
--diag Diagnose installation and return error code only
|
||||
--run Execute PHPUnit tests (alternative for standard phpunit binary)
|
||||
--buildconfig Build /phpunit.xml from /phpunit.xml.dist that runs all tests
|
||||
--buildcomponentconfigs
|
||||
Build distributed phpunit.xml files for each component
|
||||
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$ php ".phpunit_bootstrap_cli_argument_path('/admin/tool/phpunit/cli/util.php')." --install
|
||||
";
|
||||
echo $help;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($diag) {
|
||||
list($errorcode, $message) = phpunit_util::testing_ready_problem();
|
||||
if ($errorcode) {
|
||||
phpunit_bootstrap_error($errorcode, $message);
|
||||
}
|
||||
exit(0);
|
||||
|
||||
} else if ($buildconfig) {
|
||||
if (phpunit_util::build_config_file()) {
|
||||
exit(0);
|
||||
} else {
|
||||
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGWARNING, 'Can not create main /phpunit.xml configuration file, verify dirroot permissions');
|
||||
}
|
||||
|
||||
} else if ($buildcomponentconfigs) {
|
||||
phpunit_util::build_component_config_files();
|
||||
exit(0);
|
||||
|
||||
} else if ($drop) {
|
||||
// make sure tests do not run in parallel
|
||||
phpunit_util::acquire_test_lock();
|
||||
phpunit_util::drop_site(true);
|
||||
// note: we must stop here because $CFG is messed up and we can not reinstall, sorry
|
||||
exit(0);
|
||||
|
||||
} else if ($install) {
|
||||
phpunit_util::install_site();
|
||||
exit(0);
|
||||
}
|
||||
@@ -1,38 +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/>.
|
||||
|
||||
/**
|
||||
* PHPUnit info
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toolphpunit');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_phpunit'));
|
||||
echo $OUTPUT->box_start();
|
||||
|
||||
$info = file_get_contents("$CFG->libdir/phpunit/readme.md");
|
||||
echo markdown_to_html($info);
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'tool_phpunit'
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['pluginname'] = 'PHPUnit tests';
|
||||
@@ -1,32 +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/>.
|
||||
|
||||
/**
|
||||
* PHPunit integration
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('development', new admin_externalpage('toolphpunit', get_string('pluginname', 'tool_phpunit'), "$CFG->wwwroot/$CFG->admin/tool/phpunit/index.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('toolphpunitwebrunner', get_string('pluginname', 'tool_phpunit'), "$CFG->wwwroot/$CFG->admin/tool/phpunit/webrunner.php",
|
||||
'moodle/site:config', true));
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Plugin version info
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->component = 'tool_phpunit'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -1,192 +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/>.
|
||||
|
||||
/**
|
||||
* PHPUnit shell execution wrapper
|
||||
*
|
||||
* @package tool_phpunit
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require(dirname(__FILE__) . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$testpath = optional_param('testpath', '', PARAM_PATH);
|
||||
$testclass = optional_param('testclass', '', PARAM_ALPHANUMEXT);
|
||||
$execute = optional_param('execute', 0, PARAM_BOOL);
|
||||
|
||||
navigation_node::override_active_url(new moodle_url('/admin/tool/phpunit/index.php'));
|
||||
admin_externalpage_setup('toolphpunitwebrunner');
|
||||
|
||||
if (!debugging('', DEBUG_DEVELOPER)) {
|
||||
error('Not available on production sites, sorry.');
|
||||
}
|
||||
|
||||
set_time_limit(60*30);
|
||||
|
||||
$oldcwd = getcwd();
|
||||
$code = 0;
|
||||
|
||||
if (!isset($CFG->phpunit_dataroot) or !isset($CFG->phpunit_prefix)) {
|
||||
tool_phpunit_problem('Missing $CFG->phpunit_dataroot or $CFG->phpunit_prefix, can not execute tests.');
|
||||
}
|
||||
if (!file_exists($CFG->phpunit_dataroot)) {
|
||||
mkdir($CFG->phpunit_dataroot, 02777, true);
|
||||
}
|
||||
if (!is_writable($CFG->phpunit_dataroot)) {
|
||||
tool_phpunit_problem('$CFG->phpunit_dataroot in not writable, can not execute tests.');
|
||||
}
|
||||
$output = null;
|
||||
exec('php --version', $output, $code);
|
||||
if ($code != 0) {
|
||||
tool_phpunit_problem('Can not execute \'php\' binary.');
|
||||
}
|
||||
|
||||
if ($execute) {
|
||||
require_sesskey();
|
||||
|
||||
chdir($CFG->dirroot);
|
||||
$output = null;
|
||||
exec("php $CFG->admin/tool/phpunit/cli/util.php --diag", $output, $code);
|
||||
if ($code == 0) {
|
||||
// everything is ready
|
||||
|
||||
} else if ($code == PHPUNIT_EXITCODE_INSTALL) {
|
||||
tool_phpunit_header();
|
||||
echo $OUTPUT->box_start('generalbox');
|
||||
echo '<pre>';
|
||||
echo "Initialising test database:\n\n";
|
||||
chdir($CFG->dirroot);
|
||||
ignore_user_abort(true);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --install", $code);
|
||||
chdir($oldcwd);
|
||||
echo '</pre>';
|
||||
echo $OUTPUT->box_end();
|
||||
if ($code != 0) {
|
||||
tool_phpunit_problem('Can not initialize database');
|
||||
}
|
||||
$CFG->debug = 0; // no pesky redirect warning, we really want to redirect
|
||||
redirect(new moodle_url($PAGE->url, array('execute'=>1, 'tespath'=>$testpath, 'testclass'=>$testclass, 'sesskey'=>sesskey())), 'Reloading page');
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
} else if ($code == PHPUNIT_EXITCODE_REINSTALL) {
|
||||
tool_phpunit_header();
|
||||
echo $OUTPUT->box_start('generalbox');
|
||||
echo '<pre>';
|
||||
echo "Reinitialising test database:\n\n";
|
||||
chdir($CFG->dirroot);
|
||||
ignore_user_abort(true);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --drop", $code);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --install", $code);
|
||||
chdir($oldcwd);
|
||||
echo '</pre>';
|
||||
echo $OUTPUT->box_end();
|
||||
if ($code != 0) {
|
||||
tool_phpunit_problem('Can not initialize database');
|
||||
}
|
||||
$CFG->debug = 0; // no pesky redirect warning, we really want to redirect
|
||||
redirect(new moodle_url($PAGE->url, array('execute'=>1, 'tespath'=>$testpath, 'testclass'=>$testclass, 'sesskey'=>sesskey())), 'Reloading page');
|
||||
die();
|
||||
|
||||
} else {
|
||||
tool_phpunit_header();
|
||||
echo $OUTPUT->box_start('generalbox');
|
||||
echo '<pre>';
|
||||
echo "Error: $code\n\n";
|
||||
echo implode("\n", $output);
|
||||
echo '</pre>';
|
||||
echo $OUTPUT->box_end();
|
||||
tool_phpunit_problem('Can not execute tests');
|
||||
die();
|
||||
}
|
||||
|
||||
tool_phpunit_header();
|
||||
echo $OUTPUT->box_start('generalbox');
|
||||
echo '<pre>';
|
||||
|
||||
// use the dataroot file
|
||||
$configdir = "$CFG->phpunit_dataroot/phpunit/webrunner.xml";
|
||||
if (!file_exists($configdir)) {
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --buildconfig", $code);
|
||||
if ($code != 0) {
|
||||
tool_phpunit_problem('Can not create configuration file');
|
||||
}
|
||||
}
|
||||
$configdir = escapeshellarg($configdir);
|
||||
// no cleanup of path - this is tricky because we can not use escapeshellarg and friends for escaping,
|
||||
// this is from admin user so PARAM_PATH must be enough
|
||||
chdir($CFG->dirroot);
|
||||
passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $testclass $testpath", $code);
|
||||
chdir($oldcwd);
|
||||
|
||||
echo '</pre>';
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
} else {
|
||||
tool_phpunit_header();
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
|
||||
echo '<form method="get" action="webrunner.php">';
|
||||
echo '<fieldset class="invisiblefieldset">';
|
||||
echo '<label for="testpath">Test one file</label> ';
|
||||
echo '<input type="text" id="testpath" name="testpath" value="'.s($testpath).'" size="50" /> (all test cases from webrunner.xml if empty)';
|
||||
echo '</p>';
|
||||
echo '<label for="testclass">Class name</label> ';
|
||||
echo '<input type="text" id="testclass" name="testclass" value="'.s($testclass).'" size="50" /> (first class in file if empty)';
|
||||
echo '</p>';
|
||||
echo '<input type="submit" value="Run" />';
|
||||
echo '<input type="hidden" name="execute" value="1" />';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
|
||||
|
||||
|
||||
//========================================
|
||||
|
||||
/**
|
||||
* Print headers and experimental warning
|
||||
* @return void
|
||||
*/
|
||||
function tool_phpunit_header() {
|
||||
global $OUTPUT;
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('pluginname', 'tool_phpunit'));
|
||||
echo $OUTPUT->box('EXPERIMENTAL: it is recommended to execute PHPUnit tests and init scripts only from command line.', array('generalbox'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when PHPUnit can not execute.
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function tool_phpunit_problem($message) {
|
||||
global $PAGE;
|
||||
if (!$PAGE->headerprinted) {
|
||||
tool_phpunit_header();
|
||||
}
|
||||
notice($message, new moodle_url('/admin/tool/phpunit/'));
|
||||
}
|
||||
@@ -142,7 +142,7 @@ 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/tool/profiling/index.php';
|
||||
|
||||
// Check if we are listing all or some URL ones
|
||||
$sqlconditions = '';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012061700; // Requires this Moodle version
|
||||
$plugin->version = 2011092500; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011092100; // Requires this Moodle version
|
||||
$plugin->component = 'tool_profiling'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -28,4 +28,11 @@ defined('MOODLE_INTERNAL') || die;
|
||||
function xmldb_tool_qeupgradehelper_install() {
|
||||
global $CFG;
|
||||
|
||||
// this is a hack - this plugin used to live in local/qeupgradehelper,
|
||||
// we want to remove the orphaned version info and capability
|
||||
// unless there is a local plugin type with the same name
|
||||
|
||||
if (!file_exists("$CFG->dirroot/local/qeupgradehelper")) {
|
||||
unset_all_config_for_plugin('local_qeupgradehelper');
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user