Compare commits
1589 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 305fbe760a | |||
| 79ef66af49 | |||
| ce70f9d0f7 | |||
| 3021f92c8c | |||
| 0cdc8c2261 | |||
| db948187be | |||
| 16ce52bb7d | |||
| 90048d3cba | |||
| 8e12fdea29 | |||
| e0c7cb6ffa | |||
| 7351ed0134 | |||
| 683f0e73d4 | |||
| dc6451ce04 | |||
| c0c6e7966e | |||
| dcce217160 | |||
| 547695f20d | |||
| afb6a8aa24 | |||
| ca6141c264 | |||
| 56861454c1 | |||
| 54bf19763e | |||
| 383fc1fbae | |||
| c0cea70f0b | |||
| 4598cc934a | |||
| c47951f806 | |||
| eb8509c5c3 | |||
| 9db56e51d9 | |||
| b33cc65f3e | |||
| 06a3ab6c0b | |||
| 705b30e99e | |||
| 81bf2a1a1d | |||
| 92697b53ee | |||
| b16832db0d | |||
| 842a71a6ac | |||
| f2fdb7f73a | |||
| 662ddae6c2 | |||
| 1bcd3da0de | |||
| f90d6ddb6d | |||
| dbaad889e8 | |||
| 9d8d2ee619 | |||
| 4a9727aa23 | |||
| d8b0e1bc26 | |||
| 50dfe52884 | |||
| e2710cb374 | |||
| 78040342e0 | |||
| 041a4a7d94 | |||
| 8c4489c53b | |||
| 66f9505a53 | |||
| 1d5490dfed | |||
| 8579d40d59 | |||
| c185e558a6 | |||
| ca6495bb72 | |||
| cd7265af3a | |||
| 4769b04283 | |||
| 1693774015 | |||
| de856ec6a8 | |||
| c25e1814ce | |||
| 95718caae7 | |||
| 42ed5416a5 | |||
| bf9417002d | |||
| b8251ddc44 | |||
| 92e6515548 | |||
| 52f95b5431 | |||
| c6483eb217 | |||
| 19219f8c10 | |||
| b9fdddbabd | |||
| de9de3cc1b | |||
| 461499b836 | |||
| 803122e110 | |||
| 116714e8dc | |||
| 880b243c8d | |||
| 1d2b991046 | |||
| 260bbdbc09 | |||
| 713e6922e0 | |||
| 3721bbf279 | |||
| f2b9ab28e6 | |||
| 5464847212 | |||
| c45e903821 | |||
| 06314d7faf | |||
| 66424a611f | |||
| 65c02d62ae | |||
| a00d309b33 | |||
| 5f980afc0e | |||
| 0601dd6961 | |||
| 404cc924aa | |||
| c657426438 | |||
| f54292267b | |||
| dd613b60ec | |||
| f4bd9d38a6 | |||
| 62cfefdbee | |||
| 91190892f1 | |||
| f0ad78b829 | |||
| adb1616724 | |||
| 90e0da6f75 | |||
| c6fbd0c8bf | |||
| 68b0cae5bc | |||
| 72988ea0f4 | |||
| e9a8da9d76 | |||
| b030363b02 | |||
| 9f0e9e6296 | |||
| 1257e3b729 | |||
| 59f80a1b88 | |||
| 84acd5d794 | |||
| fc79f4ca61 | |||
| 61c520c03c | |||
| e0c06eddc3 | |||
| b917d504a3 | |||
| 217926aaa1 | |||
| 83d3858b16 | |||
| f4eaf5c7f0 | |||
| 6991ad41a3 | |||
| c9af9c7570 | |||
| df4870fb31 | |||
| c80ffce497 | |||
| 0646f76fb6 | |||
| 63472c089e | |||
| 2249f52fe2 | |||
| 984109868d | |||
| ecbe7b1154 | |||
| 13d01b3338 | |||
| 5e1fc324de | |||
| d9a92e8f41 | |||
| 2b4dff5697 | |||
| d9a3cd37fe | |||
| 1d823156f7 | |||
| 124bda4f28 | |||
| b7f81b199c | |||
| 6d94ae6827 | |||
| 034f40257e | |||
| f68fd67f0c | |||
| ebf57c7e94 | |||
| b6c9003756 | |||
| 0d1bd690cb | |||
| aa0bf8596a | |||
| 65345f200c | |||
| be87ace1b6 | |||
| f17cc9cfe8 | |||
| c2a3bd52d2 | |||
| cd9f44d8df | |||
| 0f63503db0 | |||
| 897329c247 | |||
| de50c77537 | |||
| 8ad93cebfa | |||
| 89c3d84eda | |||
| 63e5ddeb20 | |||
| acb0b565b1 | |||
| c93ff53c82 | |||
| 75bb216d66 | |||
| cdfa338430 | |||
| a911b4cb3e | |||
| 1850ab013c | |||
| 887e2c8535 | |||
| b98956fdd2 | |||
| 29515af1d8 | |||
| 52b6c9bc01 | |||
| 746a8b2838 | |||
| 1e93a653a4 | |||
| a41848a445 | |||
| 31ffef36ac | |||
| bac1415a0b | |||
| e78e39cdbb | |||
| 4e6fbf663c | |||
| d1e6d47f1a | |||
| 50eb136630 | |||
| 99778c82c7 | |||
| af7278a4ff | |||
| 57dd3c6909 | |||
| 8d7887cdb5 | |||
| 65d7459b6d | |||
| 6a27fc8b34 | |||
| 9331c1ec8c | |||
| 46d433f701 | |||
| 928a51ad3d | |||
| 882ef2f226 | |||
| 042ae10e1d | |||
| 20253ec57b | |||
| 092e389f4f | |||
| bc861f559d | |||
| c4b48436f9 | |||
| db181b6a14 | |||
| 5fd1ca61b8 | |||
| 33db7d7276 | |||
| dd428d8c06 | |||
| e2cc9b272e | |||
| 3824133b8e | |||
| c8471b85e1 | |||
| 55a83bd034 | |||
| 5d0c60f882 | |||
| 8b01dd9d0f | |||
| 2b75dbe9b1 | |||
| b71e34d890 | |||
| e313d1695b | |||
| 085adaf545 | |||
| 129abbb41b | |||
| 4819f2eadd | |||
| 3c96772120 | |||
| fbbb4cc708 | |||
| f674c132b3 | |||
| d09e2a36f2 | |||
| 5411ca9e40 | |||
| ed2b8be31a | |||
| c7fc98256a | |||
| d1ced7c144 | |||
| 4625a1b540 | |||
| 21bb3f9466 | |||
| 514da614c3 | |||
| 78e010e9df | |||
| 91d9449144 | |||
| 787132eabc | |||
| 8e6ec68cdf | |||
| 562129c91d | |||
| db5e62d250 | |||
| c5fc1191e0 | |||
| ef6ad52352 | |||
| 03ba959758 | |||
| 1605e8d8d2 | |||
| 865f537fea | |||
| cd2b730489 | |||
| bcaed19cc9 | |||
| 92f03977db | |||
| 7e3707635c | |||
| d855d780a3 | |||
| 0e55d4af36 | |||
| c9ab8472a6 | |||
| f4cfa2cbd6 | |||
| 35124c3c4f | |||
| 857e992ff7 | |||
| a66bb4213e | |||
| 5a3f6eb468 | |||
| 5bd7b691b6 | |||
| ce46ec1eaf | |||
| e5d6cd5461 | |||
| dcd5d0840b | |||
| d48f4d2f75 | |||
| 64258fa070 | |||
| 35f858e855 | |||
| 5bb8e807eb | |||
| 5606d3aa5c | |||
| adb9f1aa1a | |||
| 2c1dda9302 | |||
| 4902915edb | |||
| 8d83e44bc4 | |||
| 62c4db2a24 | |||
| 792d1ea2dd | |||
| a8cf5e9574 | |||
| c61f5f8730 | |||
| 4fb3cc5894 | |||
| 04c5f73665 | |||
| 0d1e39b466 | |||
| f67ac6697c | |||
| bfb54eeea3 | |||
| bb5bda8aa1 | |||
| 3d1e457e3e | |||
| 05ceae9bb2 | |||
| e57802961b | |||
| 605b539184 | |||
| c58c05ad4f | |||
| fcb203c11b | |||
| 11ba685a7b | |||
| 0f6113cba0 | |||
| b51ac4e290 | |||
| fee000ff4e | |||
| 0c9fb0c1cb | |||
| 3e11be405b | |||
| 319887f86e | |||
| b27eef0f7e | |||
| 6dbe8ddbd8 | |||
| cd358c666f | |||
| bb61c874bb | |||
| d78b67b2fc | |||
| c31149fa67 | |||
| 2f76ac6362 | |||
| 14fdcb4f13 | |||
| 2871fedb58 | |||
| 42446a0b6d | |||
| 7fcdb8275c | |||
| 1ac90bc28e | |||
| 8e1f3b11c7 | |||
| a71e869f34 | |||
| 3dc794a8f5 | |||
| 1765044c64 | |||
| 573e559c96 | |||
| 5724bb16eb | |||
| 843599ae86 | |||
| 5a6042c9be | |||
| e8cc54227e | |||
| b3e26da9d9 | |||
| de05ce07c2 | |||
| c163f86350 | |||
| d9df0e34fc | |||
| f97184b9c9 | |||
| f8e01f918b | |||
| 479f14a07b | |||
| 1eab78b30e | |||
| 2ce6285fb0 | |||
| 4e3a4dd55c | |||
| 278fc5d6dc | |||
| 4acfacdbf8 | |||
| f4d4fcaa41 | |||
| 418f8dd9a7 | |||
| 7e647445dd | |||
| 97bb109b55 | |||
| a6bc302e64 | |||
| 043a0d4c27 | |||
| 8dd8427aa2 | |||
| d5e59d8950 | |||
| f3248ac9f2 | |||
| 39a3a53069 | |||
| bf03cf12b7 | |||
| 7d127b53e3 | |||
| 734d880e35 | |||
| 2146aae7bf | |||
| 6e765a4ce5 | |||
| 7c4f93cd5f | |||
| 94492249ec | |||
| 1f90d92464 | |||
| 7d3704f293 | |||
| ce4126c7a9 | |||
| fd32dbfa1d | |||
| 48861429c7 | |||
| 6cf9033d8d | |||
| a6f5a72ef5 | |||
| 94b0258dc3 | |||
| f818719f11 | |||
| 194c653a11 | |||
| 3782723995 | |||
| 6ba42caef7 | |||
| 673ee48eb8 | |||
| 2d129fbea0 | |||
| b37bb96b0f | |||
| a6b4124840 | |||
| ad9fee8416 | |||
| 1357fde409 | |||
| c0ba02d066 | |||
| 93af314f78 | |||
| a1f173f774 | |||
| 3a48019ea3 | |||
| ed88a0b815 | |||
| 8d716acba5 | |||
| f4e4ac8c59 | |||
| 329920fa22 | |||
| d6a84028e5 | |||
| 22f754bae6 | |||
| ffeebe6088 | |||
| 0bfc4d763a | |||
| 4b641eaf82 | |||
| 47b43d0b4c | |||
| d28da62e34 | |||
| 9d3f3b5093 | |||
| e71b8ccbd1 | |||
| 9d669d60bd | |||
| 73db83bfaa | |||
| 900e37bec7 | |||
| 35f7fa3d36 | |||
| 5c85ac9572 | |||
| fee082d56c | |||
| 9622a33982 | |||
| 57f2278c69 | |||
| fca1061612 | |||
| 8075bd8d8a | |||
| 4553925614 | |||
| 373d42cf3a | |||
| 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 | |||
| 8df946ba30 | |||
| edb257109e | |||
| e89535552b | |||
| c08ea5202f | |||
| bd680d8a01 | |||
| 1ac84ccdfc | |||
| 661fc73a96 | |||
| 62c325eefe | |||
| e5a5ca2bcb | |||
| 595b68e2fd | |||
| 804feede10 | |||
| dc2c1b8974 | |||
| 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 | |||
| 31238c016e | |||
| 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,11 +25,3 @@ CVS
|
||||
/.project
|
||||
/.buildpath
|
||||
/.cache
|
||||
phpunit.xml
|
||||
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
|
||||
composer.phar
|
||||
composer.lock
|
||||
/vendor/
|
||||
/behat.yml
|
||||
*/yui/build/*/*-coverage.js
|
||||
/lib/yuilib/*/build/*/*-coverage.js
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"browser": true,
|
||||
"yui": true,
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"forin": false,
|
||||
"immed": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nomen": false,
|
||||
"onevar": false,
|
||||
"plusplus": false,
|
||||
"regexp": false,
|
||||
"strict": false,
|
||||
"trailing": true,
|
||||
"unused": true,
|
||||
"white": false,
|
||||
"asi": false,
|
||||
"boss": false,
|
||||
"debug": false,
|
||||
"eqnull": false,
|
||||
"es5": false,
|
||||
"esnext": false,
|
||||
"evil": false,
|
||||
"expr": false,
|
||||
"funcscope": false,
|
||||
"globalstrict": false,
|
||||
"iterator": false,
|
||||
"lastsemic": false,
|
||||
"laxbreak": true,
|
||||
"laxcomma": false,
|
||||
"loopfunc": false,
|
||||
"multistr": false,
|
||||
"onecase": false,
|
||||
"proto": false,
|
||||
"regexdash": false,
|
||||
"scripturl": false,
|
||||
"shadow": false,
|
||||
"smarttabs": false,
|
||||
"sub": false,
|
||||
"supernew": false,
|
||||
"maxerr": 500,
|
||||
"maxlen": 180,
|
||||
"passfail": false,
|
||||
"latedef": true
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"coverage": false,
|
||||
"lint": "config",
|
||||
"clean": true
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ a few minutes:
|
||||
1) Move the Moodle files into your web directory.
|
||||
|
||||
2) Create a single database for Moodle to store all
|
||||
its tables in (or choose an existing database).
|
||||
it's tables in (or choose an existing database).
|
||||
|
||||
3) Visit your Moodle site with a browser, you should
|
||||
be taken to the install.php script, which will lead
|
||||
|
||||
+2
-2
@@ -12,13 +12,13 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths'));
|
||||
|
||||
$PAGE->set_url($returnurl);
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$auth = optional_param('auth', '', PARAM_PLUGIN);
|
||||
|
||||
get_enabled_auth_plugins(true); // fix the list of enabled auths
|
||||
|
||||
+13
-24
@@ -30,9 +30,6 @@
|
||||
$strprotect = get_string('blockprotect', 'admin');
|
||||
$strunprotect = get_string('blockunprotect', 'admin');
|
||||
|
||||
// Purge all caches related to blocks administration.
|
||||
cache::make('core', 'plugininfo_block')->purge();
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if (!empty($hide) && confirm_sesskey()) {
|
||||
@@ -130,30 +127,16 @@
|
||||
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'delete', 'settings'));
|
||||
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strdelete, $strsettings));
|
||||
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
|
||||
$table->set_attribute('class', 'admintable blockstable generaltable');
|
||||
$table->set_attribute('id', 'compatibleblockstable');
|
||||
$table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
|
||||
$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;
|
||||
|
||||
@@ -168,6 +151,7 @@
|
||||
$incompatible[] = $block;
|
||||
continue;
|
||||
}
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
}
|
||||
|
||||
$delete = '<a href="blocks.php?delete='.$blockid.'&sesskey='.sesskey().'">'.$strdelete.'</a>';
|
||||
@@ -205,10 +189,10 @@
|
||||
$visible = '';
|
||||
} else if ($blocks[$blockid]->visible) {
|
||||
$visible = '<a href="blocks.php?hide='.$blockid.'&sesskey='.sesskey().'" title="'.$strhide.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
|
||||
} else {
|
||||
$visible = '<a href="blocks.php?show='.$blockid.'&sesskey='.sesskey().'" title="'.$strshow.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
|
||||
$class = ' class="dimmed_text"'; // Leading space required!
|
||||
}
|
||||
|
||||
@@ -223,10 +207,10 @@
|
||||
$undeletable = '';
|
||||
} else if (in_array($blockname, $undeletableblocktypes)) {
|
||||
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&sesskey='.sesskey().'" title="'.$strunprotect.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
|
||||
} else {
|
||||
$undeletable = '<a href="blocks.php?protect='.$blockid.'&sesskey='.sesskey().'" title="'.$strprotect.'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
|
||||
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
|
||||
}
|
||||
|
||||
$row = array(
|
||||
@@ -238,7 +222,12 @@
|
||||
$delete,
|
||||
$settings
|
||||
);
|
||||
$table->add_data($row);
|
||||
$tablerows[] = array(strip_tags($strblockname), $row); // first element will be used for sorting
|
||||
}
|
||||
|
||||
collatorlib::asort($tablerows);
|
||||
foreach ($tablerows as $row) {
|
||||
$table->add_data($row[1]);
|
||||
}
|
||||
|
||||
$table->print_html();
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file is used to display a categories sub categories, external pages, and settings.
|
||||
*
|
||||
* @since 2.3
|
||||
* @package admin
|
||||
* @copyright 2011 Sam Hemelryk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$category = required_param('category', PARAM_SAFEDIR);
|
||||
$return = optional_param('return','', PARAM_ALPHA);
|
||||
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
/// no guest autologin
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_url('/admin/category.php', array('category' => $category));
|
||||
$PAGE->set_pagetype('admin-setting-' . $category);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->navigation->clear_cache();
|
||||
|
||||
$adminroot = admin_get_root(); // need all settings
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
|
||||
if (empty($settingspage) or !($settingspage instanceof admin_category)) {
|
||||
print_error('categoryerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
|
||||
if (!($settingspage->check_access())) {
|
||||
print_error('accessdenied', 'admin');
|
||||
}
|
||||
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
|
||||
if (empty($adminroot->errors)) {
|
||||
switch ($return) {
|
||||
case 'site': redirect("$CFG->wwwroot/");
|
||||
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($category, true);
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
|
||||
$USER->editing = $adminediting;
|
||||
}
|
||||
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
$url = clone($PAGE->url);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
$caption = get_string('blockseditoff');
|
||||
$url->param('adminedit', 'off');
|
||||
} else {
|
||||
$caption = get_string('blocksediton');
|
||||
$url->param('adminedit', 'on');
|
||||
}
|
||||
$buttons = $OUTPUT->single_button($url, $caption, 'get');
|
||||
}
|
||||
|
||||
$savebutton = false;
|
||||
$outputhtml = '';
|
||||
foreach ($settingspage->children as $childpage) {
|
||||
if ($childpage->is_hidden()) {
|
||||
continue;
|
||||
}
|
||||
if ($childpage instanceof admin_externalpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_settingpage) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
|
||||
} else if ($childpage instanceof admin_category) {
|
||||
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (!empty($childpage->settings)) {
|
||||
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
|
||||
foreach ($childpage->settings as $setting) {
|
||||
if (empty($setting->nosave)) {
|
||||
$savebutton = true;
|
||||
}
|
||||
$fullname = $setting->get_full_name();
|
||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||
$data = $adminroot->errors[$fullname]->data;
|
||||
} else {
|
||||
$data = $setting->get_setting();
|
||||
}
|
||||
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
$outputhtml .= $setting->output_html($data);
|
||||
}
|
||||
$outputhtml .= html_writer::end_tag('fieldset');
|
||||
}
|
||||
}
|
||||
if ($savebutton) {
|
||||
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
$visiblepathtosection = array_reverse($settingspage->visiblepath);
|
||||
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
$PAGE->set_button($buttons);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($errormsg);
|
||||
} else if ($statusmsg !== '') {
|
||||
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
||||
}
|
||||
|
||||
$path = array_reverse($settingspage->visiblepath);
|
||||
if (is_array($path)) {
|
||||
$visiblename = join(' / ', $path);
|
||||
} else {
|
||||
$visiblename = $path;
|
||||
}
|
||||
echo $OUTPUT->heading(get_string('admincategory', 'admin', $visiblename), 2);
|
||||
|
||||
echo html_writer::start_tag('form', array('action' => '', 'method' => 'post', 'id' => 'adminsettings'));
|
||||
echo html_writer::start_tag('div');
|
||||
echo html_writer::input_hidden_params(new moodle_url($PAGE->url, array('sesskey' => sesskey(), 'return' => $return)));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::start_tag('fieldset');
|
||||
echo html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
echo $outputhtml;
|
||||
echo html_writer::end_tag('fieldset');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
@@ -1,91 +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 fixed incorrectly deleted users.
|
||||
*
|
||||
* @package core
|
||||
* @subpackage cli
|
||||
* @copyright 2013 Petr Skoda (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');
|
||||
|
||||
|
||||
// Now get cli options.
|
||||
list($options, $unrecognized) = cli_get_params(array('help'=>false),
|
||||
array('h'=>'help'));
|
||||
|
||||
if ($unrecognized) {
|
||||
$unrecognized = implode("\n ", $unrecognized);
|
||||
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
|
||||
}
|
||||
|
||||
if ($options['help']) {
|
||||
$help =
|
||||
"Fix incorrectly deleted users.
|
||||
|
||||
This scripts detects users that are marked as deleted instead
|
||||
of calling delete_user().
|
||||
|
||||
Deleted users do not have original username, idnumber or email,
|
||||
we must also delete all roles, enrolments, group memberships, etc.
|
||||
|
||||
Please note this script does not delete any public information
|
||||
such as forum posts.
|
||||
|
||||
Options:
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
|
||||
";
|
||||
|
||||
echo $help;
|
||||
die;
|
||||
}
|
||||
|
||||
cli_heading('Looking for sloppy user deletes');
|
||||
|
||||
// Look for sloppy deleted users where somebody only flipped the deleted flag.
|
||||
$sql = "SELECT *
|
||||
FROM {user}
|
||||
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs as $user) {
|
||||
echo "Redeleting user $user->id: $user->username ($user->email)\n";
|
||||
delete_user($user);
|
||||
}
|
||||
|
||||
cli_heading('Deleting all leftovers');
|
||||
|
||||
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
|
||||
|
||||
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
|
||||
|
||||
exit(0);
|
||||
+16
-14
@@ -127,14 +127,11 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau
|
||||
/** Used by library scripts to check they are being called by Moodle */
|
||||
define('MOODLE_INTERNAL', true);
|
||||
|
||||
// Disables all caching.
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
if (version_compare(phpversion(), "5.3.3") < 0) {
|
||||
if (version_compare(phpversion(), "5.3.2") < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
|
||||
fwrite(STDERR, "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -149,7 +146,6 @@ $CFG->httpswwwroot = $CFG->wwwroot;
|
||||
$CFG->docroot = 'http://docs.moodle.org';
|
||||
$CFG->running_installer = true;
|
||||
$CFG->early_install_lang = true;
|
||||
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
|
||||
|
||||
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
|
||||
$CFG->admin = array_pop($parts);
|
||||
@@ -168,7 +164,6 @@ require_once($CFG->libdir.'/moodlelib.php');
|
||||
require_once($CFG->libdir.'/deprecatedlib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
require_once($CFG->dirroot.'/cache/lib.php');
|
||||
|
||||
require($CFG->dirroot.'/version.php');
|
||||
$CFG->target_release = $release;
|
||||
@@ -245,8 +240,18 @@ echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
$languages = get_string_manager()->get_list_of_translations();
|
||||
// Do not put the langs into columns because it is not compatible with RTL.
|
||||
$langlist = implode("\n", $languages);
|
||||
// format the langs nicely - 3 per line
|
||||
$c = 0;
|
||||
$langlist = '';
|
||||
foreach ($languages as $key=>$lang) {
|
||||
$c++;
|
||||
$length = iconv_strlen($lang, 'UTF-8');
|
||||
$padded = $lang.str_repeat(' ', 38-$length);
|
||||
$langlist .= $padded;
|
||||
if ($c % 3 == 0) {
|
||||
$langlist .= "\n";
|
||||
}
|
||||
}
|
||||
$default = $CFG->lang;
|
||||
cli_heading(get_string('availablelangs', 'install'));
|
||||
echo $langlist."\n";
|
||||
@@ -420,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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -673,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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
// extra execution prevention - we can not just require config.php here
|
||||
if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
@@ -56,10 +55,10 @@ Example:
|
||||
";
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
if (version_compare(phpversion(), "5.3.3") < 0) {
|
||||
if (version_compare(phpversion(), "5.3.2") < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
|
||||
fwrite(STDERR, "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).\n");
|
||||
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -162,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'));
|
||||
}
|
||||
|
||||
|
||||
+10
-46
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +16,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Enable or disable maintenance mode.
|
||||
* Enable or disable maintenance mode
|
||||
*
|
||||
* @package core
|
||||
* @subpackage cli
|
||||
@@ -25,13 +26,12 @@
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once("$CFG->libdir/clilib.php");
|
||||
require_once("$CFG->libdir/adminlib.php");
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/clilib.php'); // cli only functions
|
||||
|
||||
|
||||
// Now get cli options.
|
||||
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'enablelater'=>0, 'enableold'=>false, 'disable'=>false, 'help'=>false),
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'disable'=>false, 'help'=>false),
|
||||
array('h'=>'help'));
|
||||
|
||||
if ($unrecognized) {
|
||||
@@ -45,14 +45,12 @@ if ($options['help']) {
|
||||
Current status displayed if not option specified.
|
||||
|
||||
Options:
|
||||
--enable Enable CLI maintenance mode
|
||||
--enablelater=MINUTES Number of minutes before entering CLI maintenance mode
|
||||
--enableold Enable legacy half-maintenance mode
|
||||
--enable Enable maintenance mode
|
||||
--disable Disable maintenance mode
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$ sudo -u www-data /usr/bin/php admin/cli/maintenance.php
|
||||
\$sudo -u www-data /usr/bin/php admin/cli/maintenance.php
|
||||
"; //TODO: localize - to be translated later when everything is finished
|
||||
|
||||
echo $help;
|
||||
@@ -61,52 +59,18 @@ Example:
|
||||
|
||||
cli_heading(get_string('sitemaintenancemode', 'admin')." ($CFG->wwwroot)");
|
||||
|
||||
if ($options['enablelater']) {
|
||||
if (file_exists("$CFG->dataroot/climaintenance.html")) {
|
||||
// Already enabled, sorry.
|
||||
echo get_string('clistatusenabled', 'admin')."\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
$time = time() + ($options['enablelater']*60);
|
||||
set_config('maintenance_later', $time);
|
||||
|
||||
echo get_string('clistatusenabledlater', 'admin', userdate($time))."\n";
|
||||
return 0;
|
||||
|
||||
} else if ($options['enable']) {
|
||||
if (file_exists("$CFG->dataroot/climaintenance.html")) {
|
||||
// The maintenance is already enabled, nothing to do.
|
||||
} else {
|
||||
enable_cli_maintenance_mode();
|
||||
}
|
||||
set_config('maintenance_enabled', 0);
|
||||
unset_config('maintenance_later');
|
||||
echo get_string('sitemaintenanceoncli', 'admin')."\n";
|
||||
exit(0);
|
||||
|
||||
} else if ($options['enableold']) {
|
||||
if ($options['enable']) {
|
||||
set_config('maintenance_enabled', 1);
|
||||
unset_config('maintenance_later');
|
||||
echo get_string('sitemaintenanceon', 'admin')."\n";
|
||||
exit(0);
|
||||
|
||||
} else if ($options['disable']) {
|
||||
set_config('maintenance_enabled', 0);
|
||||
unset_config('maintenance_later');
|
||||
if (file_exists("$CFG->dataroot/climaintenance.html")) {
|
||||
unlink("$CFG->dataroot/climaintenance.html");
|
||||
}
|
||||
echo get_string('sitemaintenanceoff', 'admin')."\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!empty($CFG->maintenance_enabled) or file_exists("$CFG->dataroot/climaintenance.html")) {
|
||||
if (!empty($CFG->maintenance_enabled)) {
|
||||
echo get_string('clistatusenabled', 'admin')."\n";
|
||||
|
||||
} else if (isset($CFG->maintenance_later)) {
|
||||
echo get_string('clistatusenabledlater', 'admin', userdate($CFG->maintenance_later))."\n";
|
||||
|
||||
} else {
|
||||
echo get_string('clistatusdisabled', 'admin')."\n";
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+6
-15
@@ -30,7 +30,6 @@
|
||||
*/
|
||||
|
||||
define('CLI_SCRIPT', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
require(dirname(dirname(dirname(__FILE__))).'/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
|
||||
@@ -83,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) {
|
||||
@@ -110,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'));
|
||||
}
|
||||
|
||||
@@ -135,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,22 +147,17 @@ if ($interactive) {
|
||||
}
|
||||
|
||||
if ($version > $CFG->version) {
|
||||
// We purge all of MUC's caches here.
|
||||
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
|
||||
// This ensures a real config object is loaded and the stores will be purged.
|
||||
// This is the only way we can purge custom caches such as memcache or APC.
|
||||
// Note: all other calls to caches will still used the disabled API.
|
||||
cache_helper::purge_all(true);
|
||||
upgrade_core($version, true);
|
||||
}
|
||||
set_config('release', $release);
|
||||
set_config('branch', $branch);
|
||||
|
||||
// unconditionally upgrade
|
||||
upgrade_noncore(true);
|
||||
|
||||
// log in as admin - we need doanything permission when applying defaults
|
||||
session_set_user(get_admin());
|
||||
$admins = get_admins();
|
||||
$admin = reset($admins);
|
||||
session_set_user($admin);
|
||||
|
||||
// apply all default settings, just in case do it twice to fill all defaults
|
||||
admin_apply_default_settings(NULL, false);
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Allows the admin to enable, disable and uninstall course formats
|
||||
*
|
||||
* @package core_admin
|
||||
* @copyright 2012 Marina Glancy
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/pluginlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$formatname = required_param('format', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
$PAGE->set_url('/admin/courseformats.php');
|
||||
$PAGE->set_context($syscontext);
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', $syscontext);
|
||||
require_sesskey();
|
||||
|
||||
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
|
||||
|
||||
$formatplugins = plugin_manager::instance()->get_plugins_of_type('format');
|
||||
$sortorder = array_flip(array_keys($formatplugins));
|
||||
|
||||
if (!isset($formatplugins[$formatname])) {
|
||||
print_error('courseformatnotfound', 'error', $return, $formatname);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'disable':
|
||||
if ($formatplugins[$formatname]->is_enabled()) {
|
||||
if (get_config('moodlecourse', 'format') === $formatname) {
|
||||
print_error('cannotdisableformat', 'error', $return);
|
||||
}
|
||||
set_config('disabled', 1, 'format_'. $formatname);
|
||||
}
|
||||
break;
|
||||
case 'enable':
|
||||
if (!$formatplugins[$formatname]->is_enabled()) {
|
||||
unset_config('disabled', 'format_'. $formatname);
|
||||
}
|
||||
break;
|
||||
case 'up':
|
||||
if ($sortorder[$formatname]) {
|
||||
$currentindex = $sortorder[$formatname];
|
||||
$seq = array_keys($formatplugins);
|
||||
$seq[$currentindex] = $seq[$currentindex-1];
|
||||
$seq[$currentindex-1] = $formatname;
|
||||
set_config('format_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
case 'down':
|
||||
if ($sortorder[$formatname] < count($sortorder)-1) {
|
||||
$currentindex = $sortorder[$formatname];
|
||||
$seq = array_keys($formatplugins);
|
||||
$seq[$currentindex] = $seq[$currentindex+1];
|
||||
$seq[$currentindex+1] = $formatname;
|
||||
set_config('format_plugins_sortorder', implode(',', $seq));
|
||||
}
|
||||
break;
|
||||
case 'uninstall':
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('courseformats', 'moodle'));
|
||||
|
||||
$coursecount = $DB->count_records('course', array('format' => $formatname));
|
||||
if ($coursecount) {
|
||||
// Check that default format is set. It will be used to convert courses
|
||||
// using this format
|
||||
$defaultformat = get_config('moodlecourse', 'format');
|
||||
$defaultformat = $formatplugins[get_config('moodlecourse', 'format')];
|
||||
if (!$defaultformat) {
|
||||
echo $OUTPUT->error_text(get_string('defaultformatnotset', 'admin'));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$format = $formatplugins[$formatname];
|
||||
$deleteurl = $format->get_uninstall_url();
|
||||
if (!$deleteurl) {
|
||||
// somebody was trying to cheat and type non-existing link
|
||||
echo $OUTPUT->error_text(get_string('cannotuninstall', 'admin', $format->displayname));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$confirm) {
|
||||
if ($coursecount) {
|
||||
$message = get_string('formatuninstallwithcourses', 'admin',
|
||||
(object)array('count' => $coursecount, 'format' => $format->displayname,
|
||||
'defaultformat' => $defaultformat->displayname));
|
||||
} else {
|
||||
$message = get_string('formatuninstallconfirm', 'admin', $format->displayname);
|
||||
}
|
||||
$deleteurl->param('confirm', 1);
|
||||
echo $OUTPUT->confirm($message, $deleteurl, $return);
|
||||
} else {
|
||||
$a = new stdClass();
|
||||
$a->plugin = $format->displayname;
|
||||
$a->directory = $format->rootdir;
|
||||
uninstall_plugin('format', $formatname);
|
||||
echo $OUTPUT->notification(get_string('formatuninstalled', 'admin', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($return);
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
redirect($return);
|
||||
@@ -81,9 +81,6 @@ if (check_browser_version('MSIE')) {
|
||||
@header('Content-Type: text/plain; charset=utf-8');
|
||||
}
|
||||
|
||||
// we do not want html markup in emulated CLI
|
||||
@ini_set('html_errors', 'off');
|
||||
|
||||
// execute the cron
|
||||
cron_run();
|
||||
|
||||
|
||||
+4
-50
@@ -8,18 +8,14 @@ require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$editor = required_param('editor', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/editors.php', array('action'=>$action, 'editor'=>$editor));
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$editor = optional_param('editor', '', PARAM_PLUGIN);
|
||||
|
||||
// get currently installed and enabled auth plugins
|
||||
$available_editors = editors_get_available();
|
||||
if (!empty($editor) and empty($available_editors[$editor])) {
|
||||
@@ -82,48 +78,6 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'uninstall':
|
||||
if ($editor === 'textarea') {
|
||||
redirect($returnurl);
|
||||
}
|
||||
if (get_string_manager()->string_exists('pluginname', 'editor_'.$editor)) {
|
||||
$strplugin = get_string('pluginname', 'editor_'.$editor);
|
||||
} else {
|
||||
$strplugin = $editor;
|
||||
}
|
||||
|
||||
$PAGE->set_title($strplugin);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->heading(get_string('editors', 'core_editor'));
|
||||
|
||||
$deleteurl = new moodle_url('/admin/editors.php', array('action'=>'uninstall', 'editor'=>$editor, 'sesskey'=>sesskey(), 'confirm'=>1));
|
||||
|
||||
echo $OUTPUT->confirm(get_string('editordeleteconfirm', 'core_editor', $strplugin),
|
||||
$deleteurl, $returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
// Remove from enabled list.
|
||||
$key = array_search($editor, $active_editors);
|
||||
unset($active_editors[$key]);
|
||||
set_config('texteditors', implode(',', $active_editors));
|
||||
|
||||
// Delete everything!!
|
||||
uninstall_plugin('editor', $editor);
|
||||
|
||||
$a = new stdClass();
|
||||
$a->name = $strplugin;
|
||||
$a->directory = "$CFG->dirroot/lib/editor/$editor";
|
||||
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+9
-46
@@ -23,21 +23,18 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHANUMEXT);
|
||||
$action = required_param('action', PARAM_ACTION);
|
||||
$enrol = required_param('enrol', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
$migrate = optional_param('migrate', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('/admin/enrol.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
require_sesskey();
|
||||
|
||||
$enabled = enrol_get_plugins(true);
|
||||
@@ -97,58 +94,24 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'uninstall':
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
|
||||
|
||||
if (get_string_manager()->string_exists('pluginname', 'enrol_'.$enrol)) {
|
||||
$strplugin = get_string('pluginname', 'enrol_'.$enrol);
|
||||
} else {
|
||||
$strplugin = $enrol;
|
||||
}
|
||||
|
||||
$PAGE->set_title($strplugin);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
|
||||
|
||||
$deleteurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1, 'migrate'=>0));
|
||||
$migrateurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1, 'migrate'=>1));
|
||||
|
||||
$migrate = new single_button($migrateurl, get_string('uninstallmigrate', 'enrol'));
|
||||
$delete = new single_button($deleteurl, get_string('uninstalldelete', 'enrol'));
|
||||
$cancel = new single_button($return, get_string('cancel'), 'get');
|
||||
|
||||
$buttons = $OUTPUT->render($delete) . $OUTPUT->render($cancel);
|
||||
if ($enrol !== 'manual') {
|
||||
$buttons = $OUTPUT->render($migrate) . $buttons;
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
echo html_writer::tag('p', markdown_to_html(get_string('uninstallconfirm', 'enrol', $strplugin)));
|
||||
echo html_writer::tag('div', $buttons, array('class' => 'buttons'));
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
$uurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1));
|
||||
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'enrol', $strplugin), $uurl, $return);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
// This may take a long time.
|
||||
set_time_limit(0);
|
||||
|
||||
// Disable plugin to prevent concurrent cron execution.
|
||||
unset($enabled[$enrol]);
|
||||
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
|
||||
|
||||
if ($migrate) {
|
||||
echo $OUTPUT->heading(get_string('uninstallmigrating', 'enrol', 'enrol_'.$enrol));
|
||||
|
||||
require_once("$CFG->dirroot/enrol/manual/locallib.php");
|
||||
enrol_manual_migrate_plugin_enrolments($enrol);
|
||||
|
||||
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
|
||||
}
|
||||
|
||||
// Delete everything!!
|
||||
} else { // Delete everything!!
|
||||
uninstall_plugin('enrol', $enrol);
|
||||
$syscontext->mark_dirty(); // Resets all enrol caches.
|
||||
$syscontext->mark_dirty(); // resets all enrol caches
|
||||
|
||||
$a = new stdClass();
|
||||
$a->plugin = $strplugin;
|
||||
|
||||
@@ -33,7 +33,7 @@ require_once($CFG->libdir.'/environmentlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
// Parameters
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$version = optional_param('version', '', PARAM_FILE); //
|
||||
|
||||
$extraurlparams = array();
|
||||
|
||||
+16
-484
@@ -227,7 +227,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -237,7 +237,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -277,12 +277,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -344,7 +344,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -354,7 +354,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -394,12 +394,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -454,7 +454,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -464,7 +464,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -504,12 +504,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -561,15 +561,10 @@
|
||||
</DATABASE>
|
||||
<PHP version="5.3.2" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -579,7 +574,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
<ON_CHECK message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -619,12 +614,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
<ON_CHECK message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -660,467 +655,4 @@
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.4" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
<VENDOR name="sqlite" version="2.0" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.2" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="gdrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="40M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="safe_mode" value="0" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingsafemode" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.5" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
<VENDOR name="sqlite" version="2.0" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.3" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</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.6" 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="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.3" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="optional">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="64M" 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.7" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="5.5.31" />
|
||||
<VENDOR name="mysql" version="5.5.31" />
|
||||
<VENDOR name="postgres" version="9.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="96M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="opcache.enable" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opcacherecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+42
-26
@@ -34,19 +34,16 @@
|
||||
require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$filterpath = optional_param('filterpath', '', PARAM_SAFEDIR);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$filterpath = optional_param('filterpath', '', PARAM_PATH);
|
||||
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/filters.php";
|
||||
admin_externalpage_setup('managefilters');
|
||||
|
||||
// Purge all caches related to filter administration.
|
||||
cache::make('core', 'plugininfo_filter')->purge();
|
||||
|
||||
$filters = filter_get_global_states();
|
||||
|
||||
// In case any new filters have been installed, but not put in the table yet.
|
||||
@@ -71,7 +68,7 @@
|
||||
switch ($action) {
|
||||
|
||||
case 'setstate':
|
||||
if ($newstate = optional_param('newstate', '', PARAM_INT)) {
|
||||
if ($newstate = optional_param('newstate', '', PARAM_INTEGER)) {
|
||||
filter_set_global_state($filterpath, $newstate);
|
||||
if ($newstate == TEXTFILTER_DISABLED) {
|
||||
filter_set_applies_to_strings($filterpath, false);
|
||||
@@ -87,22 +84,39 @@
|
||||
|
||||
case 'down':
|
||||
if (isset($filters[$filterpath])) {
|
||||
filter_set_global_state($filterpath, $filters[$filterpath]->active, 1);
|
||||
$oldpos = $filters[$filterpath]->sortorder;
|
||||
if ($oldpos <= count($filters)) {
|
||||
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos + 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'up':
|
||||
if (isset($filters[$filterpath])) {
|
||||
$oldpos = $filters[$filterpath]->sortorder;
|
||||
filter_set_global_state($filterpath, $filters[$filterpath]->active, -1);
|
||||
if ($oldpos >= 1) {
|
||||
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos - 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if (!empty($filternames[$filterpath])) {
|
||||
$filtername = $filternames[$filterpath];
|
||||
} else {
|
||||
$filtername = $filterpath;
|
||||
}
|
||||
|
||||
if (substr($filterpath, 0, 4) == 'mod/') {
|
||||
$mod = basename($filterpath);
|
||||
$a = new stdClass;
|
||||
$a->filter = $filtername;
|
||||
$a->module = get_string('modulename', $mod);
|
||||
print_error('cannotdeletemodfilter', 'admin', $returnurl, $a);
|
||||
}
|
||||
|
||||
// If not yet confirmed, display a confirmation message.
|
||||
if (!optional_param('confirm', '', PARAM_BOOL)) {
|
||||
$filtername = filter_get_name($filterpath);
|
||||
|
||||
$title = get_string('deletefilterareyousure', 'admin', $filtername);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
@@ -115,7 +129,7 @@
|
||||
}
|
||||
|
||||
// Do the deletion.
|
||||
$title = get_string('deletingfilter', 'admin', $filterpath);
|
||||
$title = get_string('deletingfilter', 'admin', $filtername);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
@@ -123,8 +137,8 @@
|
||||
filter_delete_all_for_filter($filterpath);
|
||||
|
||||
$a = new stdClass;
|
||||
$a->filter = $filterpath;
|
||||
$a->directory = "$CFG->dirroot/filter/$filterpath";
|
||||
$a->filter = $filtername;
|
||||
$a->directory = $filterpath;
|
||||
echo $OUTPUT->box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice');
|
||||
echo $OUTPUT->continue_button($returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
@@ -171,9 +185,8 @@
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
|
||||
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
|
||||
$table->colclasses = array ('leftalign', 'leftalign', 'centeralign', 'leftalign', 'leftalign', 'leftalign');
|
||||
$table->attributes['class'] = 'admintable generaltable';
|
||||
$table->id = 'filterssetting';
|
||||
$table->align = array('left', 'left', 'center', 'left', 'left');
|
||||
$table->width = '100%';
|
||||
$table->data = array();
|
||||
|
||||
$lastactive = null;
|
||||
@@ -228,21 +241,20 @@ 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' . $filter);
|
||||
$select->set_label(get_string('isactive', 'filters'), array('class' => 'accesshide'));
|
||||
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
|
||||
$row[] = $OUTPUT->render($select);
|
||||
|
||||
// Re-order
|
||||
$updown = '';
|
||||
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
|
||||
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
|
||||
if ($filterinfo->active != TEXTFILTER_DISABLED) {
|
||||
if (!$isfirstrow) {
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
|
||||
} else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
if (!$islastactive) {
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
|
||||
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
|
||||
} else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
@@ -250,20 +262,24 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
|
||||
$row[] = $updown;
|
||||
|
||||
// Apply to strings.
|
||||
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . $filter);
|
||||
$select->set_label(get_string('applyto', 'filters'), array('class' => 'accesshide'));
|
||||
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
|
||||
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
|
||||
$row[] = $OUTPUT->render($select);
|
||||
|
||||
// Settings link, if required
|
||||
if (filter_has_global_settings($filter)) {
|
||||
$row[] = '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=filtersetting' . $filter . '">' . get_string('settings') . '</a>';
|
||||
$row[] = '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=filtersetting' .
|
||||
str_replace('/', '',$filter) . '">' . get_string('settings') . '</a>';
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
|
||||
// Delete
|
||||
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
|
||||
if (substr($filter, 0, 4) != 'mod/') {
|
||||
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
|
||||
} else {
|
||||
$row[] = '';
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ while(!feof($fd)) {
|
||||
$a->date = userdate($log->time);
|
||||
|
||||
$a->action = $action;
|
||||
$a->course = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
|
||||
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||
$a->user = fullname($user);
|
||||
|
||||
notify_user($user,$subject,$a);
|
||||
@@ -86,7 +86,7 @@ function notify_admins($user,$subject,$a) {
|
||||
foreach ($admins as $admin) {
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userfrom = $admin;
|
||||
$eventdata->userto = $admin;
|
||||
$eventdata->subject = $subject;
|
||||
$eventdata->fullmessage = $body;
|
||||
@@ -107,7 +107,7 @@ function notify_admins_unknown($file,$a) {
|
||||
foreach ($admins as $admin) {
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userfrom = $admin;
|
||||
$eventdata->userto = $admin;
|
||||
$eventdata->subject = $subject;
|
||||
$eventdata->fullmessage = $body;
|
||||
|
||||
+38
-236
@@ -30,10 +30,10 @@ if (!file_exists('../config.php')) {
|
||||
}
|
||||
|
||||
// Check that PHP is of a sufficient version as soon as possible
|
||||
if (version_compare(phpversion(), '5.3.3') < 0) {
|
||||
if (version_compare(phpversion(), '5.3.2') < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
|
||||
echo "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).<br />";
|
||||
echo "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).<br />";
|
||||
echo "Please upgrade your server software or install older Moodle version.";
|
||||
die();
|
||||
}
|
||||
@@ -44,23 +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);
|
||||
|
||||
if ((isset($_GET['cache']) and $_GET['cache'] === '0')
|
||||
or (isset($_POST['cache']) and $_POST['cache'] === '0')
|
||||
or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
|
||||
// Prevent caching at all cost when visiting this page directly,
|
||||
// we redirect to self once we known no upgrades are necessary.
|
||||
// Note: $_GET and $_POST are used here intentionally because our param cleaning is not loaded yet.
|
||||
// Note2: the sesskey is present in all block editing hacks, we can not redirect there, so enable caching.
|
||||
define('CACHE_DISABLE_ALL', 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);
|
||||
@@ -68,35 +62,14 @@ $confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
|
||||
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
|
||||
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
|
||||
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
|
||||
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
|
||||
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW);
|
||||
$cache = optional_param('cache', 0, PARAM_BOOL);
|
||||
|
||||
// Set up PAGE.
|
||||
$url = new moodle_url('/admin/index.php');
|
||||
$url->param('cache', $cache);
|
||||
$PAGE->set_url($url);
|
||||
unset($url);
|
||||
|
||||
// Are we returning from an add-on installation request at moodle.org/plugins?
|
||||
if ($newaddonreq and !$cache and empty($CFG->disableonclickaddoninstall)) {
|
||||
$target = new moodle_url('/admin/tool/installaddon/index.php', array(
|
||||
'installaddonrequest' => $newaddonreq,
|
||||
'confirm' => 0));
|
||||
if (!isloggedin() or isguestuser()) {
|
||||
// Login and go the the add-on tool page.
|
||||
$SESSION->wantsurl = $target->out();
|
||||
redirect(get_login_url());
|
||||
}
|
||||
redirect($target);
|
||||
}
|
||||
// Check some PHP server settings
|
||||
|
||||
$PAGE->set_url('/admin/index.php');
|
||||
$PAGE->set_pagelayout('admin'); // Set a default pagelayout
|
||||
|
||||
$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
|
||||
|
||||
// Check some PHP server settings
|
||||
|
||||
if (ini_get_bool('session.auto_start')) {
|
||||
print_error('phpvaroff', 'debug', '', (object)array('name'=>'session.auto_start', 'link'=>$documentationlink));
|
||||
}
|
||||
@@ -120,20 +93,25 @@ if (!isset($CFG->release)) {
|
||||
if (!isset($CFG->version)) {
|
||||
$CFG->version = '';
|
||||
}
|
||||
if (!isset($CFG->branch)) {
|
||||
$CFG->branch = '';
|
||||
}
|
||||
|
||||
$version = null;
|
||||
$release = null;
|
||||
$branch = null;
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if (!$version or !$release) {
|
||||
print_error('withoutversion', 'debug'); // without version, stop
|
||||
}
|
||||
|
||||
if (!isset($maturity)) {
|
||||
// Fallback for now. Should probably be removed in the future.
|
||||
$maturity = MATURITY_STABLE;
|
||||
}
|
||||
|
||||
// Turn off xmlstrictheaders during upgrade.
|
||||
$origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
|
||||
$CFG->xmlstrictheaders = false;
|
||||
|
||||
if (!core_tables_exist()) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
@@ -173,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');
|
||||
@@ -215,62 +179,28 @@ if (!core_tables_exist()) {
|
||||
// and upgrade if possible.
|
||||
|
||||
$stradministration = get_string('administration');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
if (empty($CFG->version)) {
|
||||
print_error('missingconfigversion', 'debug');
|
||||
}
|
||||
|
||||
// Detect config cache inconsistency, this happens when you switch branches on dev servers.
|
||||
if ($cache) {
|
||||
if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))) {
|
||||
purge_all_caches();
|
||||
redirect(new moodle_url('/admin/index.php'), 'Config cache inconsistency detected, resetting caches...');
|
||||
}
|
||||
}
|
||||
|
||||
if ($version > $CFG->version) { // upgrade
|
||||
|
||||
// Warning about upgrading a test site.
|
||||
$testsite = false;
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$testsite = 'behat';
|
||||
}
|
||||
|
||||
// We purge all of MUC's caches here.
|
||||
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
|
||||
// This ensures a real config object is loaded and the stores will be purged.
|
||||
// This is the only way we can purge custom caches such as memcache or APC.
|
||||
// Note: all other calls to caches will still used the disabled API.
|
||||
cache_helper::purge_all(true);
|
||||
// We then purge the regular caches.
|
||||
purge_all_caches();
|
||||
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
echo $output->upgrade_stale_php_files_page();
|
||||
die();
|
||||
}
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$a = new stdClass();
|
||||
$a->oldversion = "$CFG->release (".sprintf('%.2f', $CFG->version).")";
|
||||
$a->newversion = "$release (".sprintf('%.2f', $version).")";
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_heading($strdatabasechecking);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_confirm_page($a->newversion, $maturity);
|
||||
die();
|
||||
|
||||
} else if (empty($confirmrelease)){
|
||||
@@ -283,6 +213,7 @@ if ($version > $CFG->version) { // upgrade
|
||||
$PAGE->set_heading($strcurrentrelease);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
|
||||
die();
|
||||
|
||||
@@ -294,47 +225,14 @@ 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));
|
||||
|
||||
if ($fetchupdates) {
|
||||
$updateschecker = available_update_checker::instance();
|
||||
if ($updateschecker->enabled()) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
$updateschecker->fetch();
|
||||
}
|
||||
redirect($reloadurl);
|
||||
}
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($reloadurl, $reloadurl);
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
// No sesskey support guaranteed here, because sessions might not work yet.
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins, $reloadurl,
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)),
|
||||
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
|
||||
die();
|
||||
|
||||
} else {
|
||||
// Always verify plugin dependencies!
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1, 'cache' => 0));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
|
||||
// Launch main upgrade.
|
||||
// Launch main upgrade
|
||||
upgrade_core($version, true);
|
||||
}
|
||||
} else if ($version < $CFG->version) {
|
||||
@@ -347,17 +245,9 @@ 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
|
||||
|
||||
/** @var core_admin_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
if (!$confirmplugins) {
|
||||
$strplugincheck = get_string('plugincheck');
|
||||
|
||||
@@ -368,45 +258,12 @@ if (moodle_needs_upgrading()) {
|
||||
$PAGE->set_heading($strplugincheck);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
if ($fetchupdates) {
|
||||
$updateschecker = available_update_checker::instance();
|
||||
if ($updateschecker->enabled()) {
|
||||
require_sesskey();
|
||||
$updateschecker->fetch();
|
||||
}
|
||||
redirect($reloadurl);
|
||||
}
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$deployer->initialize($PAGE->url, $PAGE->url);
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
require_sesskey();
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
// Show plugins info.
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
|
||||
$version, $showallplugins,
|
||||
new moodle_url($PAGE->url),
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), $version, $showallplugins,
|
||||
new moodle_url('/admin/index.php'),
|
||||
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
|
||||
die();
|
||||
}
|
||||
|
||||
// Always verify plugin dependencies!
|
||||
$failed = array();
|
||||
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
$reloadurl = new moodle_url('/admin/index.php', array('cache' => 0));
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
|
||||
die();
|
||||
}
|
||||
unset($failed);
|
||||
}
|
||||
// install/upgrade all plugins and other parts
|
||||
upgrade_noncore(true);
|
||||
@@ -440,13 +297,8 @@ if (during_initial_install()) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup SESSION to make sure other code does not complain in the future.
|
||||
unset($SESSION->has_timed_out);
|
||||
unset($SESSION->wantsurl);
|
||||
|
||||
// at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
|
||||
$adminids = explode(',', $CFG->siteadmins);
|
||||
$adminuser = get_complete_user_data('id', reset($adminids));
|
||||
$adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins)));
|
||||
|
||||
if ($adminuser->password === 'adminsetuppending') {
|
||||
// prevent installation hijacking
|
||||
@@ -467,31 +319,13 @@ if (during_initial_install()) {
|
||||
upgrade_finished('upgradesettings.php');
|
||||
}
|
||||
|
||||
if (has_capability('moodle/site:config', context_system::instance())) {
|
||||
if ($fetchupdates) {
|
||||
$updateschecker = available_update_checker::instance();
|
||||
if ($updateschecker->enabled()) {
|
||||
require_sesskey();
|
||||
$updateschecker->fetch();
|
||||
}
|
||||
redirect(new moodle_url('/admin/index.php', array('cache' => 0)));
|
||||
}
|
||||
}
|
||||
|
||||
// Now we can be sure everything was upgraded and caches work fine,
|
||||
// redirect if necessary to make sure caching is enabled.
|
||||
if (!$cache and !optional_param('sesskey', '', PARAM_RAW)) {
|
||||
redirect(new moodle_url($PAGE->url, array('cache' => 1)));
|
||||
}
|
||||
// Turn xmlstrictheaders back on now.
|
||||
$CFG->xmlstrictheaders = $origxmlstrictheaders;
|
||||
unset($origxmlstrictheaders);
|
||||
|
||||
// Check for valid admin user - no guest autologin
|
||||
require_login(0, false);
|
||||
if (isguestuser()) {
|
||||
// Login as real user!
|
||||
$SESSION->wantsurl = (string)new moodle_url('/admin/index.php');
|
||||
redirect(get_login_url());
|
||||
}
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
// check that site is properly customized
|
||||
@@ -529,39 +363,7 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
|
||||
$dbproblems = $DB->diagnose();
|
||||
$maintenancemode = !empty($CFG->maintenance_enabled);
|
||||
|
||||
// Available updates for Moodle core
|
||||
$updateschecker = available_update_checker::instance();
|
||||
$availableupdates = array();
|
||||
$availableupdates['core'] = $updateschecker->get_update_info('core',
|
||||
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
|
||||
|
||||
// Available updates for contributed plugins
|
||||
$pluginman = plugin_manager::instance();
|
||||
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
|
||||
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
|
||||
if (!empty($plugininfo->availableupdates)) {
|
||||
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
|
||||
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
|
||||
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
|
||||
$availableupdates[$plugintype.'_'.$pluginname] = array();
|
||||
}
|
||||
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The timestamp of the most recent check for available updates
|
||||
$availableupdatesfetch = $updateschecker->get_last_timefetched();
|
||||
|
||||
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
|
||||
//check if the site is registered on Moodle.org
|
||||
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
|
||||
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
|
||||
$registered);
|
||||
$cronoverdue, $dbproblems, $maintenancemode);
|
||||
|
||||
@@ -35,5 +35,16 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
|
||||
'admin-*' => get_string('page-admin-x', 'pagetype'),
|
||||
$pagetype => get_string('page-admin-current', 'pagetype')
|
||||
);
|
||||
// Add the missing * (any page) option for them. MDL-30340
|
||||
// TODO: These pages are really 'pagetype-varying' - MDL-30564 -
|
||||
// and some day we should stop behaving that way, so proper pagetypes
|
||||
// can be specified for it (like course-category-* or so).
|
||||
// Luckly... the option we are introducing '*' is independent
|
||||
// of that varying behavior, so will work.
|
||||
if ($pagetype == 'admin-course-category') {
|
||||
$array += array(
|
||||
'*' => get_string('page-x', 'pagetype')
|
||||
);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/licenselib.php');
|
||||
|
||||
require_login();
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
|
||||
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$license = optional_param('license', '', PARAM_SAFEDIR);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -77,7 +77,7 @@ $table->define_columns(array('name', 'version', 'delete'));
|
||||
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
|
||||
$table->define_baseurl($PAGE->url);
|
||||
$table->set_attribute('id', 'localplugins');
|
||||
$table->set_attribute('class', 'admintable generaltable');
|
||||
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
|
||||
$table->setup();
|
||||
|
||||
$plugins = array();
|
||||
|
||||
+5
-33
@@ -29,15 +29,11 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
admin_externalpage_setup('managemessageoutputs');
|
||||
|
||||
// Require site configuration capability
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
// Get the submitted params
|
||||
$disable = optional_param('disable', 0, PARAM_INT);
|
||||
$enable = optional_param('enable', 0, PARAM_INT);
|
||||
$uninstall = optional_param('uninstall', 0, PARAM_INT);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
$headingtitle = get_string('managemessageoutputs', 'message');
|
||||
|
||||
if (!empty($disable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
||||
@@ -46,43 +42,19 @@ if (!empty($disable) && confirm_sesskey()) {
|
||||
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
||||
}
|
||||
|
||||
if (!empty($enable) && confirm_sesskey()) {
|
||||
if (!empty($enable) && confirm_sesskey() ) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
||||
}
|
||||
|
||||
if (!empty($uninstall) && confirm_sesskey()) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$uninstall))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
|
||||
$processorname = get_string('pluginname', 'message_'.$processor->name);
|
||||
|
||||
if (!$confirm) {
|
||||
echo $OUTPUT->confirm(get_string('processordeleteconfirm', 'message', $processorname), 'message.php?uninstall='.$processor->id.'&confirm=1', 'message.php');
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
message_processor_uninstall($processor->name);
|
||||
$a = new stdClass();
|
||||
$a->processor = $processorname;
|
||||
$a->directory = $CFG->dirroot.'/message/output/'.$processor->name;
|
||||
notice(get_string('processordeletefiles', 'message', $a), 'message.php');
|
||||
}
|
||||
}
|
||||
|
||||
if ($disable || $enable || $uninstall) {
|
||||
if ($disable || $enable) {
|
||||
$url = new moodle_url('message.php');
|
||||
redirect($url);
|
||||
}
|
||||
// Page settings
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
// Grab the renderer
|
||||
$renderer = $PAGE->get_renderer('core', 'message');
|
||||
@@ -93,6 +65,6 @@ $messageoutputs = $renderer->manage_messageoutputs($processors);
|
||||
|
||||
// Display the page
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($headingtitle);
|
||||
echo $OUTPUT->heading(get_string('managemessageoutputs', 'message'));
|
||||
echo $messageoutputs;
|
||||
echo $OUTPUT->footer();
|
||||
@@ -16,11 +16,13 @@ require_login();
|
||||
|
||||
admin_externalpage_setup('ssoaccesscontrol');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!extension_loaded('openssl')) {
|
||||
print_error('requiresopenssl', 'mnet');
|
||||
}
|
||||
|
||||
$sitecontext = context_system::instance();
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$sesskey = sesskey();
|
||||
$formerror = array();
|
||||
|
||||
@@ -63,11 +65,9 @@ if (!empty($action) and confirm_sesskey()) {
|
||||
|
||||
if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) {
|
||||
if ($accessctrl == 'allow') {
|
||||
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('user' => $idrec->username,
|
||||
'host' => $mnethosts[$idrec->mnet_host_id])));
|
||||
} else if ($accessctrl == 'deny') {
|
||||
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user' => $idrec->username,
|
||||
'host' => $mnethosts[$idrec->mnet_host_id])));
|
||||
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('uset'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
|
||||
} elseif ($accessctrl == 'deny') {
|
||||
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -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') {
|
||||
@@ -118,8 +118,6 @@ if ($form = data_submitted() and confirm_sesskey()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Explain
|
||||
echo $OUTPUT->box(get_string('ssoacldescr','mnet'));
|
||||
// Are the needed bits enabled?
|
||||
@@ -205,18 +203,17 @@ echo get_string('username') . ":\n";
|
||||
if (!empty($formerror['username'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::label(get_string('username'), 'menuusername', false, array('class' => 'accesshide'));
|
||||
echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
|
||||
echo '<input type="text" name="username" size="20" maxlength="100" />';
|
||||
|
||||
// choose a remote host
|
||||
echo " " . html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id') . ":\n";
|
||||
echo " " . get_string('remotehost', 'mnet') . ":\n";
|
||||
if (!empty($formerror['mnet_host_id'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
echo html_writer::select($mnethosts, 'mnet_host_id');
|
||||
|
||||
// choose an access level
|
||||
echo " " . html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl') . ":\n";
|
||||
echo " " . get_string('accesslevel', 'mnet') . ":\n";
|
||||
if (!empty($formerror['accessctrl'])) {
|
||||
echo '<span class="error"> * </span>';
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ $hostid = required_param('hostid', PARAM_INT);
|
||||
|
||||
require_login();
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
$mnet = get_mnet_environment();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
require_login();
|
||||
admin_externalpage_setup('net');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
echo $OUTPUT->header();
|
||||
?>
|
||||
<form method="post" action="index.php">
|
||||
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
|
||||
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
|
||||
<tr>
|
||||
<td class="generalboxcontent">
|
||||
<table cellpadding="9" cellspacing="0" >
|
||||
@@ -106,7 +106,7 @@
|
||||
</table>
|
||||
</form>
|
||||
<form method="post" action="index.php">
|
||||
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
|
||||
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
|
||||
<tr>
|
||||
<td class="generalboxcontent">
|
||||
<table cellpadding="9" cellspacing="0" >
|
||||
|
||||
@@ -78,13 +78,9 @@ class mnet_review_host_form extends moodleform {
|
||||
$mnet_peer = $this->_customdata['peer'];
|
||||
|
||||
$mform->addElement('hidden', 'last_connect_time');
|
||||
$mform->setType('last_connect_time', PARAM_INT);
|
||||
$mform->addElement('hidden', 'id');
|
||||
$mform->setType('id', PARAM_INT);
|
||||
$mform->addElement('hidden', 'applicationid');
|
||||
$mform->setType('applicationid', PARAM_INT);
|
||||
$mform->addElement('hidden', 'oldpublickey');
|
||||
$mform->setType('oldpublickey', PARAM_PEM);
|
||||
|
||||
$mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50));
|
||||
$mform->setType('name', PARAM_NOTAGS);
|
||||
@@ -145,14 +141,13 @@ 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');
|
||||
$mform->setType('deleted', PARAM_BOOL);
|
||||
}
|
||||
|
||||
// finished with static stuff, print save button
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/mnet/lib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
|
||||
require_once($CFG->dirroot.'/admin/mnet/peer_forms.php');
|
||||
|
||||
require_login();
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
|
||||
|
||||
/// Initialize variables.
|
||||
|
||||
@@ -34,7 +34,7 @@ $hostid = required_param('hostid', PARAM_INT);
|
||||
$mnet_peer = new mnet_peer();
|
||||
$mnet_peer->set_id($hostid);
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
|
||||
admin_externalpage_setup('mnetpeers');
|
||||
|
||||
@@ -50,8 +50,6 @@ class mnet_profile_form extends moodleform {
|
||||
}
|
||||
|
||||
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
|
||||
$mform->setType('hostid', PARAM_INT);
|
||||
|
||||
$fields = mnet_profile_field_options();
|
||||
|
||||
// Fields to import ----------------------------------------------------
|
||||
|
||||
@@ -33,7 +33,7 @@ $mnet = get_mnet_environment();
|
||||
require_login();
|
||||
admin_externalpage_setup('mnetpeers');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
$hostid = required_param('hostid', PARAM_INT);
|
||||
|
||||
@@ -39,7 +39,6 @@ class mnet_services_form extends moodleform {
|
||||
$myservices = mnet_get_service_info($mnet_peer);
|
||||
|
||||
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
|
||||
$mform->setType('hostid', PARAM_INT);
|
||||
|
||||
$count = 0;
|
||||
foreach ($myservices as $name => $versions) {
|
||||
@@ -56,8 +55,6 @@ class mnet_services_form extends moodleform {
|
||||
$mform->addElement('html', '<h3>' . get_string($name.'_name', $langmodule , $mnet_peer->name) . '</h3>' . get_string($name.'_description', $langmodule, $mnet_peer->name));
|
||||
|
||||
$mform->addElement('hidden', 'exists[' . $version['serviceid'] . ']', 1);
|
||||
// Temporary fix until MDL-38885 gets integrated.
|
||||
$mform->setType('exists', PARAM_BOOL);
|
||||
|
||||
$pubstr = get_string('publish','mnet');
|
||||
if (!empty($version['hostsubscribes'])) {
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
require_login();
|
||||
admin_externalpage_setup('mnettestclient');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
error_reporting(DEBUG_ALL);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
require_login();
|
||||
admin_externalpage_setup('trustedhosts');
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
|
||||
+2
-5
@@ -29,9 +29,6 @@
|
||||
$stractivitymodule = get_string("activitymodule");
|
||||
$strshowmodulecourse = get_string('showmodulecourse');
|
||||
|
||||
// Purge all caches related to activity modules administration.
|
||||
cache::make('core', 'plugininfo_mod')->purge();
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if (!empty($hide) and confirm_sesskey()) {
|
||||
@@ -164,11 +161,11 @@
|
||||
$class = '';
|
||||
} else if ($module->visible) {
|
||||
$visible = "<a href=\"modules.php?hide=$module->name&sesskey=".sesskey()."\" title=\"$strhide\">".
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
|
||||
"<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
|
||||
$class = '';
|
||||
} else {
|
||||
$visible = "<a href=\"modules.php?show=$module->name&sesskey=".sesskey()."\" title=\"$strshow\">".
|
||||
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
|
||||
"<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
|
||||
$class = ' class="dimmed_text"';
|
||||
}
|
||||
if ($module->name == "forum") {
|
||||
|
||||
+3
-11
@@ -49,7 +49,7 @@ function online_assignment_cleanup($output=false) {
|
||||
/// cycle through each course
|
||||
foreach ($courses as $course) {
|
||||
context_instance_preload($course);
|
||||
$context = context_course::instance($course->id);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
if (empty($course->fullname)) {
|
||||
$fullname = get_string('course').': '.$course->id;
|
||||
@@ -59,19 +59,11 @@ function online_assignment_cleanup($output=false) {
|
||||
if ($output) echo $OUTPUT->heading($fullname);
|
||||
|
||||
/// retrieve a list of sections beyond what is currently being shown
|
||||
$courseformatoptions = course_get_format($course)->get_format_options();
|
||||
if (!isset($courseformatoptions['numsections'])) {
|
||||
// Course format does not use numsections
|
||||
if ($output) {
|
||||
echo 'No extra sections<br />';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$sql = "SELECT *
|
||||
FROM {course_sections}
|
||||
WHERE course=? AND section>?
|
||||
ORDER BY section ASC";
|
||||
$params = array($course->id, $courseformatoptions['numsections']);
|
||||
$params = array($course->id, $course->numsections);
|
||||
if (!($xsections = $DB->get_records_sql($sql, $params))) {
|
||||
if ($output) echo 'No extra sections<br />';
|
||||
continue;
|
||||
@@ -102,7 +94,7 @@ function online_assignment_cleanup($output=false) {
|
||||
/// the journal update erroneously stored it in course_sections->section
|
||||
$newsection = $xsection->section;
|
||||
/// double check the new section
|
||||
if ($newsection > $courseformatoptions['numsections']) {
|
||||
if ($newsection > $course->numsections) {
|
||||
/// get the record for section 0 for this course
|
||||
if (!($zerosection = $DB->get_record('course_sections', array('course'=>$course->id, 'section'=>'0')))) {
|
||||
continue;
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* An oauth2 redirection endpoint which can be used for an application:
|
||||
* http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
|
||||
*
|
||||
* This is used because some oauth servers will not allow a redirect urls
|
||||
* with get params (like repository callback) and that needs to be called
|
||||
* using the state param.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2012 Dan Poltawski
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
|
||||
// The authorization code generated by the authorization server.
|
||||
$code = required_param('code', PARAM_RAW);
|
||||
// The state parameter we've given (used in moodle as a redirect url).
|
||||
$state = required_param('state', PARAM_LOCALURL);
|
||||
|
||||
$redirecturl = new moodle_url($state);
|
||||
$params = $redirecturl->params();
|
||||
|
||||
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
|
||||
$redirecturl->param('oauth2code', $code);
|
||||
redirect($redirecturl);
|
||||
} else {
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Provides an overview of installed plagiarism plugins
|
||||
*
|
||||
* Displays the list of found plagiarism plugins, their version (if found) and
|
||||
* a link to delete the plagiarism plugin.
|
||||
*
|
||||
* @see http://docs.moodle.org/dev/Plagiarism_API
|
||||
* @package admin
|
||||
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
admin_externalpage_setup('manageplagiarismplugins');
|
||||
|
||||
$delete = optional_param('delete', '', PARAM_PLUGIN);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
if (!empty($delete) and confirm_sesskey()) { // If data submitted, then process and store.
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('manageplagiarism', 'plagiarism'));
|
||||
|
||||
if (!$confirm) {
|
||||
if (get_string_manager()->string_exists('pluginname', 'plagiarism_' . $delete)) {
|
||||
$strpluginname = get_string('pluginname', 'plagiarism_' . $delete);
|
||||
} else {
|
||||
$strpluginname = $delete;
|
||||
}
|
||||
echo $OUTPUT->confirm(get_string('plagiarismplugindeleteconfirm', 'plagiarism', $strpluginname),
|
||||
new moodle_url($PAGE->url, array('delete' => $delete, 'confirm' => 1)),
|
||||
$PAGE->url);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
} else {
|
||||
uninstall_plugin('plagiarism', $delete);
|
||||
$a = new stdclass();
|
||||
$a->name = $delete;
|
||||
$pluginlocation = get_plugin_types();
|
||||
$a->directory = $pluginlocation['plagiarism'] . '/' . $delete;
|
||||
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($PAGE->url);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Print the table of all installed plagiarism plugins.
|
||||
|
||||
$txt = get_strings(array('settings', 'name', 'version', 'delete'));
|
||||
|
||||
$plagiarismplugins = get_plugin_list('plagiarism');
|
||||
if (empty($plagiarismplugins)) {
|
||||
echo $OUTPUT->notification(get_string('nopluginsinstalled', 'plagiarism'));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
|
||||
echo $OUTPUT->box_start('generalbox authsui');
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array($txt->name, $txt->version, $txt->delete, $txt->settings);
|
||||
$table->colclasses = array('mdl-left', 'mdl-align', 'mdl-align', 'mdl-align');
|
||||
$table->data = array();
|
||||
$table->attributes['class'] = 'manageplagiarismtable generaltable';
|
||||
|
||||
// Iterate through auth plugins and add to the display table.
|
||||
$authcount = count($plagiarismplugins);
|
||||
foreach ($plagiarismplugins as $plugin => $dir) {
|
||||
if (file_exists($dir.'/settings.php')) {
|
||||
$displayname = "<span>".get_string($plugin, 'plagiarism_'.$plugin)."</span>";
|
||||
// Settings link.
|
||||
$url = new moodle_url("/plagiarism/$plugin/settings.php");
|
||||
$settings = html_writer::link($url, $txt->settings);
|
||||
// Get version.
|
||||
$version = get_config('plagiarism_' . $plugin);
|
||||
if (!empty($version->version)) {
|
||||
$version = $version->version;
|
||||
} else {
|
||||
$version = '?';
|
||||
}
|
||||
// Delete link.
|
||||
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
|
||||
$delete = html_writer::link($delete, get_string('delete'));
|
||||
$table->data[] = array($displayname, $version, $delete, $settings);
|
||||
}
|
||||
}
|
||||
echo html_writer::table($table);
|
||||
echo get_string('configplagiarismplugins', 'plagiarism');
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
+2
-132
@@ -18,15 +18,6 @@
|
||||
/**
|
||||
* UI for general plugins management
|
||||
*
|
||||
* Supported HTTP parameters:
|
||||
*
|
||||
* ?fetchremote=1 - check for available updates
|
||||
* ?updatesonly=1 - display plugins with available update only
|
||||
* ?contribonly=1 - display non-standard add-ons only
|
||||
* ?uninstall=foo_bar - uninstall the given plugin
|
||||
* ?delete=foo_bar - delete the plugin folder (it must not be installed)
|
||||
* &confirm=1 - confirm the uninstall or delete action
|
||||
*
|
||||
* @package core
|
||||
* @subpackage admin
|
||||
* @copyright 2011 David Mudrak <david@moodle.com>
|
||||
@@ -36,129 +27,8 @@
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
|
||||
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL);
|
||||
$contribonly = optional_param('contribonly', false, PARAM_BOOL);
|
||||
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT);
|
||||
$delete = optional_param('delete', '', PARAM_COMPONENT);
|
||||
$confirmed = optional_param('confirm', false, PARAM_BOOL);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
|
||||
if ($uninstall) {
|
||||
require_sesskey();
|
||||
$pluginfo = $pluginman->get_plugin_info($uninstall);
|
||||
|
||||
// Make sure we know the plugin.
|
||||
if (is_null($pluginfo)) {
|
||||
throw new moodle_exception('err_uninstalling_unknown_plugin', 'core_plugin', '', array('plugin' => $uninstall),
|
||||
'plugin_manager::get_plugin_info() returned null for the plugin to be uninstalled');
|
||||
}
|
||||
|
||||
$pluginname = $pluginman->plugin_name($pluginfo->component);
|
||||
$PAGE->set_title($pluginname);
|
||||
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
|
||||
|
||||
if (!$pluginman->can_uninstall_plugin($pluginfo->component)) {
|
||||
throw new moodle_exception('err_cannot_uninstall_plugin', 'core_plugin', '',
|
||||
array('plugin' => $pluginfo->component),
|
||||
'plugin_manager::can_uninstall_plugin() returned false');
|
||||
}
|
||||
|
||||
if (!$confirmed) {
|
||||
$continueurl = new moodle_url($PAGE->url, array('uninstall' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1));
|
||||
echo $output->plugin_uninstall_confirm_page($pluginman, $pluginfo, $continueurl);
|
||||
exit();
|
||||
|
||||
} else {
|
||||
$progress = new progress_trace_buffer(new text_progress_trace(), false);
|
||||
$pluginman->uninstall_plugin($pluginfo->component, $progress);
|
||||
$progress->finished();
|
||||
|
||||
if ($pluginman->is_plugin_folder_removable($pluginfo->component)) {
|
||||
$continueurl = new moodle_url($PAGE->url, array('delete' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1));
|
||||
echo $output->plugin_uninstall_results_removable_page($pluginman, $pluginfo, $progress, $continueurl);
|
||||
exit();
|
||||
|
||||
} else {
|
||||
echo $output->plugin_uninstall_results_page($pluginman, $pluginfo, $progress);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete and $confirmed) {
|
||||
require_sesskey();
|
||||
$pluginfo = $pluginman->get_plugin_info($delete);
|
||||
|
||||
// Make sure we know the plugin.
|
||||
if (is_null($pluginfo)) {
|
||||
throw new moodle_exception('err_removing_unknown_plugin', 'core_plugin', '', array('plugin' => $delete),
|
||||
'plugin_manager::get_plugin_info() returned null for the plugin to be deleted');
|
||||
}
|
||||
|
||||
$pluginname = $pluginman->plugin_name($pluginfo->component);
|
||||
$PAGE->set_title($pluginname);
|
||||
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
|
||||
|
||||
// Make sure it is not installed.
|
||||
if (!is_null($pluginfo->versiondb)) {
|
||||
throw new moodle_exception('err_removing_installed_plugin', 'core_plugin', '',
|
||||
array('plugin' => $pluginfo->component, 'versiondb' => $pluginfo->versiondb),
|
||||
'plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
|
||||
}
|
||||
|
||||
// Make sure the folder is removable.
|
||||
if (!$pluginman->is_plugin_folder_removable($pluginfo->component)) {
|
||||
throw new moodle_exception('err_removing_unremovable_folder', 'core_plugin', '',
|
||||
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir),
|
||||
'plugin root folder is not removable as expected');
|
||||
}
|
||||
|
||||
// Make sure the folder is within Moodle installation tree.
|
||||
if (strpos($pluginfo->rootdir, $CFG->dirroot) !== 0) {
|
||||
throw new moodle_exception('err_unexpected_plugin_rootdir', 'core_plugin', '',
|
||||
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir, 'dirroot' => $CFG->dirroot),
|
||||
'plugin root folder not in the moodle dirroot');
|
||||
}
|
||||
|
||||
// So long, and thanks for all the bugs.
|
||||
fulldelete($pluginfo->rootdir);
|
||||
cache::make('core', 'pluginlist')->purge();
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
$checker = available_update_checker::instance();
|
||||
|
||||
// Filtering options.
|
||||
$options = array(
|
||||
'updatesonly' => $updatesonly,
|
||||
'contribonly' => $contribonly,
|
||||
);
|
||||
|
||||
if ($fetchremote) {
|
||||
require_sesskey();
|
||||
$checker->fetch();
|
||||
redirect(new moodle_url($PAGE->url, $options));
|
||||
}
|
||||
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
|
||||
$deployer->initialize($myurl, new moodle_url('/admin'));
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
echo $output->upgrade_plugin_confirm_deploy_page($deployer, $deploydata);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo $output->plugin_management_page($pluginman, $checker, $options);
|
||||
echo $output->plugin_management_page(plugin_manager::instance());
|
||||
|
||||
+2
-7
@@ -5,7 +5,7 @@ require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->libdir . '/portfolio/forms.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$portfolio = optional_param('pf', '', PARAM_ALPHANUMEXT);
|
||||
$portfolio = optional_param('pf', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
@@ -35,7 +35,7 @@ if ($action == 'newon') {
|
||||
|
||||
admin_externalpage_setup($pagename);
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/portfolio.php?sesskey=" . sesskey();
|
||||
@@ -43,9 +43,6 @@ $configstr = get_string('manageportfolios', 'portfolio');
|
||||
|
||||
$return = true; // direct back to the main page
|
||||
|
||||
// Purge all caches related to portfolio administration.
|
||||
cache::make('core', 'plugininfo_portfolio')->purge();
|
||||
|
||||
/**
|
||||
* Helper function that generates a moodle_url object
|
||||
* relevant to the portfolio
|
||||
@@ -200,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)) {
|
||||
@@ -222,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), '');
|
||||
}
|
||||
}
|
||||
|
||||
+30
-30
@@ -27,37 +27,37 @@ require_once('../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
|
||||
// If we have got here as a confirmed aciton, do it.
|
||||
if ($confirm && isloggedin() && confirm_sesskey()) {
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
// Valid request. Purge, and redirect the user back to where they came from.
|
||||
purge_all_caches();
|
||||
|
||||
if ($returnurl) {
|
||||
$returnurl = $CFG->wwwroot . $returnurl;
|
||||
} else {
|
||||
$returnurl = new moodle_url('/admin/purgecaches.php');
|
||||
}
|
||||
redirect($returnurl, get_string('purgecachesfinished', 'admin'));
|
||||
}
|
||||
|
||||
// Otherwise, show a button to actually purge the caches.
|
||||
admin_externalpage_setup('purgecaches');
|
||||
|
||||
$actionurl = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
|
||||
if ($returnurl) {
|
||||
$actionurl->param('returnurl', $returnurl);
|
||||
require_login();
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
if ($confirm) {
|
||||
require_sesskey();
|
||||
|
||||
// Valid request. Purge, and redisplay the form so it is easy to purge again
|
||||
// in the near future.
|
||||
purge_all_caches();
|
||||
redirect(new moodle_url('/admin/purgecaches.php'), get_string('purgecachesfinished', 'admin'));
|
||||
|
||||
} else {
|
||||
// Show a confirm form.
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
|
||||
|
||||
$url = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
|
||||
$button = new single_button($url, get_string('purgecaches','admin'), 'post');
|
||||
|
||||
// Cancel button takes them back to the page the were on, if possible,
|
||||
// otherwise to the site home page.
|
||||
$return = new moodle_url('/');
|
||||
if (isset($_SERVER['HTTP_REFERER']) and !empty($_SERVER['HTTP_REFERER'])) {
|
||||
if ($_SERVER['HTTP_REFERER'] !== "$CFG->wwwroot/$CFG->admin/purgecaches.php") {
|
||||
$return = $_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->confirm(get_string('purgecachesconfirm', 'admin'), $button, $return);
|
||||
echo $OUTPUT->footer();
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
|
||||
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
echo html_writer::tag('p', get_string('purgecachesconfirm', 'admin'));
|
||||
echo $OUTPUT->single_button($actionurl, get_string('purgecaches', 'admin'), 'post');
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -33,7 +33,7 @@ require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/question:config', $systemcontext);
|
||||
|
||||
admin_externalpage_setup('manageqbehaviours');
|
||||
@@ -258,7 +258,7 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
|
||||
$rowclass = 'dimmed_text';
|
||||
}
|
||||
} else {
|
||||
$icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
|
||||
$icons = $OUTPUT->spacer() . ' ';
|
||||
}
|
||||
|
||||
// Move icons.
|
||||
@@ -284,10 +284,10 @@ echo $OUTPUT->footer();
|
||||
|
||||
function question_behaviour_enable_disable_icons($behaviour, $enabled) {
|
||||
if ($enabled) {
|
||||
return question_behaviour_icon_html('disable', $behaviour, 't/hide',
|
||||
return question_behaviour_icon_html('disable', $behaviour, 'i/hide',
|
||||
get_string('enabled', 'question'), get_string('disable'));
|
||||
} else {
|
||||
return question_behaviour_icon_html('enable', $behaviour, 't/show',
|
||||
return question_behaviour_icon_html('enable', $behaviour, 'i/show',
|
||||
get_string('disabled', 'question'), get_string('enable'));
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ function question_behaviour_icon_html($action, $behaviour, $icon, $alt, $tip) {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
|
||||
array($action => $behaviour, 'sesskey' => sesskey())),
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => $tip));
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
|
||||
null, array('title' => $tip)) . ' ';
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -33,7 +33,7 @@ require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
// Check permissions.
|
||||
require_login();
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/question:config', $systemcontext);
|
||||
$canviewreports = has_capability('report/questioninstances:view', $systemcontext);
|
||||
|
||||
@@ -195,7 +195,7 @@ $table->define_headers(array(get_string('questiontype', 'question'), get_string(
|
||||
get_string('version'), get_string('requires', 'admin'), get_string('availableq', 'question'),
|
||||
get_string('delete'), get_string('settings')));
|
||||
$table->set_attribute('id', 'qtypes');
|
||||
$table->set_attribute('class', 'admintable generaltable');
|
||||
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
|
||||
$table->setup();
|
||||
|
||||
// Add a row for each question type.
|
||||
@@ -257,7 +257,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
|
||||
$rowclass = 'dimmed_text';
|
||||
}
|
||||
} else {
|
||||
$icons = $OUTPUT->spacer();
|
||||
$icons = $OUTPUT->spacer() . ' ';
|
||||
}
|
||||
|
||||
// Move icons.
|
||||
@@ -294,10 +294,10 @@ echo $OUTPUT->footer();
|
||||
|
||||
function question_types_enable_disable_icons($qtypename, $createable) {
|
||||
if ($createable) {
|
||||
return question_type_icon_html('disable', $qtypename, 't/hide',
|
||||
return question_type_icon_html('disable', $qtypename, 'i/hide',
|
||||
get_string('enabled', 'question'), get_string('disable'));
|
||||
} else {
|
||||
return question_type_icon_html('enable', $qtypename, 't/show',
|
||||
return question_type_icon_html('enable', $qtypename, 'i/show',
|
||||
get_string('disabled', 'question'), get_string('enable'));
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ function question_type_icon_html($action, $qtypename, $icon, $alt, $tip) {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
|
||||
array($action => $qtypename, 'sesskey' => sesskey())),
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
|
||||
null, array('title' => $tip));
|
||||
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
|
||||
null, array('title' => $tip)) . ' ';
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ $hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
$error = optional_param('error', '', PARAM_ALPHANUM);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
if (!empty($error) and $error == 'urlalreadyexist') {
|
||||
throw new moodle_exception('urlalreadyregistered', 'hub',
|
||||
|
||||
@@ -49,10 +49,8 @@ class site_unregistration_form extends moodleform {
|
||||
$unregisterlabel = get_string('unregister', 'hub');
|
||||
$mform->addElement('checkbox', 'unpublishalladvertisedcourses', '',
|
||||
' ' . get_string('unpublishalladvertisedcourses', 'hub'));
|
||||
$mform->setType('unpublishalladvertisedcourses', PARAM_INT);
|
||||
$mform->addElement('checkbox', 'unpublishalluploadedcourses', '',
|
||||
' ' . get_string('unpublishalluploadedcourses', 'hub'));
|
||||
$mform->setType('unpublishalluploadedcourses', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'confirm', 1);
|
||||
$mform->setType('confirm', PARAM_INT);
|
||||
@@ -84,6 +82,7 @@ class site_clean_registration_data_form extends moodleform {
|
||||
$unregisterlabel = get_string('forceunregister', 'hub');
|
||||
$mform->addElement('static', '', get_string('warning', 'hub'), get_string('forceunregisterconfirmation', 'hub', $hubname));
|
||||
|
||||
|
||||
$mform->addElement('hidden', 'confirm', 1);
|
||||
$mform->setType('confirm', PARAM_INT);
|
||||
$mform->addElement('hidden', 'unregistration', 1);
|
||||
@@ -150,7 +149,6 @@ class hub_selector_form extends moodleform {
|
||||
if (!empty($hubs)) {
|
||||
$mform->addElement('select', 'publichub', get_string('publichub', 'hub'),
|
||||
$options, array("size" => 15));
|
||||
$mform->setType('publichub', PARAM_URL);
|
||||
}
|
||||
|
||||
$mform->addElement('static', 'or', '', get_string('orenterprivatehub', 'hub'));
|
||||
@@ -158,10 +156,8 @@ class hub_selector_form extends moodleform {
|
||||
//Private hub
|
||||
$mform->addElement('text', 'unlistedurl', get_string('privatehuburl', 'hub'),
|
||||
array('class' => 'registration_textfield'));
|
||||
$mform->setType('unlistedurl', PARAM_URL);
|
||||
$mform->addElement('text', 'password', get_string('password'),
|
||||
array('class' => 'registration_textfield'));
|
||||
$mform->setType('password', PARAM_RAW);
|
||||
|
||||
$this->add_action_buttons(false, get_string('selecthub', 'hub'));
|
||||
}
|
||||
@@ -175,8 +171,11 @@ class hub_selector_form extends moodleform {
|
||||
|
||||
$unlistedurl = $this->_form->_submitValues['unlistedurl'];
|
||||
|
||||
if (empty($unlistedurl)) {
|
||||
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
|
||||
if (!empty($unlistedurl)) {
|
||||
$unlistedurltotest = clean_param($unlistedurl, PARAM_URL);
|
||||
if (empty($unlistedurltotest)) {
|
||||
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
@@ -204,7 +203,7 @@ class site_registration_form extends moodleform {
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
$sitename = get_config('hub', 'site_name_' . $cleanhuburl);
|
||||
if ($sitename === false) {
|
||||
$sitename = format_string($site->fullname, true, array('context' => context_course::instance(SITEID)));
|
||||
$sitename = format_string($site->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
|
||||
}
|
||||
$sitedescription = get_config('hub', 'site_description_' . $cleanhuburl);
|
||||
if ($sitedescription === false) {
|
||||
@@ -237,18 +236,13 @@ 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);
|
||||
$postsnumber = get_config('hub', 'site_postsnumber_' . $cleanhuburl);
|
||||
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
|
||||
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
|
||||
$badgesnumber = get_config('hub', 'site_badges_' . $cleanhuburl);
|
||||
$issuedbadgesnumber = get_config('hub', 'site_issuedbadges_' . $cleanhuburl);
|
||||
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
|
||||
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
|
||||
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
|
||||
|
||||
//hidden parameters
|
||||
$mform->addElement('hidden', 'huburl', $huburl);
|
||||
@@ -275,7 +269,6 @@ class site_registration_form extends moodleform {
|
||||
$options[HUB_SITELINKPUBLISHED] = $registrationmanager->get_site_privacy_string(HUB_SITELINKPUBLISHED);
|
||||
$mform->addElement('select', 'privacy', get_string('siteprivacy', 'hub'), $options);
|
||||
$mform->setDefault('privacy', $privacy);
|
||||
$mform->setType('privacy', PARAM_ALPHA);
|
||||
$mform->addHelpButton('privacy', 'privacy', 'hub');
|
||||
unset($options);
|
||||
|
||||
@@ -286,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'),
|
||||
@@ -294,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);
|
||||
@@ -309,13 +315,11 @@ class site_registration_form extends moodleform {
|
||||
$countries = get_string_manager()->get_list_of_countries();
|
||||
$mform->addElement('select', 'countrycode', get_string('sitecountry', 'hub'), $countries);
|
||||
$mform->setDefault('countrycode', $country);
|
||||
$mform->setType('countrycode', PARAM_ALPHANUMEXT);
|
||||
$mform->addHelpButton('countrycode', 'sitecountry', 'hub');
|
||||
|
||||
$mform->addElement('text', 'geolocation', get_string('sitegeolocation', 'hub'),
|
||||
array('class' => 'registration_textfield'));
|
||||
$mform->setDefault('geolocation', $geolocation);
|
||||
$mform->setType('geolocation', PARAM_RAW);
|
||||
$mform->addHelpButton('geolocation', 'sitegeolocation', 'hub');
|
||||
|
||||
$mform->addElement('text', 'contactname', get_string('siteadmin', 'hub'),
|
||||
@@ -333,7 +337,7 @@ class site_registration_form extends moodleform {
|
||||
$mform->addElement('text', 'contactemail', get_string('siteemail', 'hub'),
|
||||
array('class' => 'registration_textfield'));
|
||||
$mform->addRule('contactemail', $strrequired, 'required', null, 'client');
|
||||
$mform->setType('contactemail', PARAM_EMAIL);
|
||||
$mform->setType('contactemail', PARAM_TEXT);
|
||||
$mform->setDefault('contactemail', $contactemail);
|
||||
$mform->addHelpButton('contactemail', 'siteemail', 'hub');
|
||||
|
||||
@@ -342,7 +346,6 @@ class site_registration_form extends moodleform {
|
||||
$options[1] = get_string("registrationcontactyes");
|
||||
$mform->addElement('select', 'contactable', get_string('siteregistrationcontact', 'hub'), $options);
|
||||
$mform->setDefault('contactable', $contactable);
|
||||
$mform->setType('contactable', PARAM_INT);
|
||||
$mform->addHelpButton('contactable', 'siteregistrationcontact', 'hub');
|
||||
unset($options);
|
||||
|
||||
@@ -351,27 +354,12 @@ class site_registration_form extends moodleform {
|
||||
$options[1] = get_string("registrationyes");
|
||||
$mform->addElement('select', 'emailalert', get_string('siteregistrationemail', 'hub'), $options);
|
||||
$mform->setDefault('emailalert', $emailalert);
|
||||
$mform->setType('emailalert', PARAM_INT);
|
||||
$mform->addHelpButton('emailalert', 'siteregistrationemail', 'hub');
|
||||
unset($options);
|
||||
|
||||
//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));
|
||||
@@ -382,111 +370,80 @@ class site_registration_form extends moodleform {
|
||||
require_once($CFG->dirroot . "/course/lib.php");
|
||||
$participantnumberaverage = number_format(average_number_of_participants(), 2);
|
||||
$modulenumberaverage = number_format(average_number_of_courses_modules(), 2);
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
|
||||
$issuedbadges = $DB->count_records('badge_issued');
|
||||
|
||||
if (HUB_MOODLEORGHUBURL != $huburl) {
|
||||
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
$mform->setDefault('courses', $coursesnumber != -1);
|
||||
$mform->setType('courses', PARAM_INT);
|
||||
$mform->setDefault('courses', true);
|
||||
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
|
||||
|
||||
$mform->addElement('checkbox', 'users', '',
|
||||
" " . get_string('usersnumber', 'hub', $usercount));
|
||||
$mform->setDefault('users', $usersnumber != -1);
|
||||
$mform->setType('users', PARAM_INT);
|
||||
$mform->setDefault('users', true);
|
||||
|
||||
$mform->addElement('checkbox', 'roleassignments', '',
|
||||
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
|
||||
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
|
||||
$mform->setType('roleassignments', PARAM_INT);
|
||||
$mform->setDefault('roleassignments', true);
|
||||
|
||||
$mform->addElement('checkbox', 'posts', '',
|
||||
" " . get_string('postsnumber', 'hub', $postcount));
|
||||
$mform->setDefault('posts', $postsnumber != -1);
|
||||
$mform->setType('posts', PARAM_INT);
|
||||
$mform->setDefault('posts', true);
|
||||
|
||||
$mform->addElement('checkbox', 'questions', '',
|
||||
" " . get_string('questionsnumber', 'hub', $questioncount));
|
||||
$mform->setDefault('questions', $questionsnumber != -1);
|
||||
$mform->setType('questions', PARAM_INT);
|
||||
$mform->setDefault('questions', true);
|
||||
|
||||
$mform->addElement('checkbox', 'resources', '',
|
||||
" " . get_string('resourcesnumber', 'hub', $resourcecount));
|
||||
$mform->setDefault('resources', $resourcesnumber != -1);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
|
||||
$mform->addElement('checkbox', 'badges', '',
|
||||
" " . get_string('badgesnumber', 'hub', $badges));
|
||||
$mform->setDefault('badges', $badgesnumber != -1);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
|
||||
$mform->addElement('checkbox', 'issuedbadges', '',
|
||||
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
|
||||
$mform->setDefault('issuedbadges', $issuedbadgesnumber != -1);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
$mform->setDefault('resources', true);
|
||||
|
||||
$mform->addElement('checkbox', 'participantnumberaverage', '',
|
||||
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
|
||||
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
|
||||
$mform->setType('participantnumberaverage', PARAM_FLOAT);
|
||||
$mform->setDefault('participantnumberaverage', true);
|
||||
|
||||
$mform->addElement('checkbox', 'modulenumberaverage', '',
|
||||
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
|
||||
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
|
||||
$mform->setType('modulenumberaverage', PARAM_FLOAT);
|
||||
$mform->setDefault('modulenumberaverage', true);
|
||||
} else {
|
||||
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
$mform->addElement('hidden', 'courses', 1);
|
||||
$mform->setType('courses', PARAM_INT);
|
||||
$mform->addElement('hidden', 'courses', true);
|
||||
$mform->setType('courses', PARAM_FLOAT);
|
||||
$mform->addHelpButton('courseslabel', 'sendfollowinginfo', 'hub');
|
||||
|
||||
$mform->addElement('static', 'userslabel', '',
|
||||
" " . get_string('usersnumber', 'hub', $usercount));
|
||||
$mform->addElement('hidden', 'users', 1);
|
||||
$mform->setType('users', PARAM_INT);
|
||||
$mform->addElement('hidden', 'users', true);
|
||||
$mform->setType('users', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'roleassignmentslabel', '',
|
||||
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
|
||||
$mform->addElement('hidden', 'roleassignments', 1);
|
||||
$mform->setType('roleassignments', PARAM_INT);
|
||||
$mform->addElement('hidden', 'roleassignments', true);
|
||||
$mform->setType('roleassignments', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'postslabel', '',
|
||||
" " . get_string('postsnumber', 'hub', $postcount));
|
||||
$mform->addElement('hidden', 'posts', 1);
|
||||
$mform->setType('posts', PARAM_INT);
|
||||
$mform->addElement('hidden', 'posts', true);
|
||||
$mform->setType('posts', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'questionslabel', '',
|
||||
" " . get_string('questionsnumber', 'hub', $questioncount));
|
||||
$mform->addElement('hidden', 'questions', 1);
|
||||
$mform->setType('questions', PARAM_INT);
|
||||
$mform->addElement('hidden', 'questions', true);
|
||||
$mform->setType('questions', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'resourceslabel', '',
|
||||
" " . get_string('resourcesnumber', 'hub', $resourcecount));
|
||||
$mform->addElement('hidden', 'resources', 1);
|
||||
$mform->setType('resources', PARAM_INT);
|
||||
|
||||
$mform->addElement('static', 'badgeslabel', '',
|
||||
" " . get_string('badgesnumber', 'hub', $badges));
|
||||
$mform->addElement('hidden', 'badges', 1);
|
||||
$mform->setType('badges', PARAM_INT);
|
||||
|
||||
$mform->addElement('static', 'issuedbadgeslabel', '',
|
||||
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
|
||||
$mform->addElement('hidden', 'issuedbadges', true);
|
||||
$mform->setType('issuedbadges', PARAM_INT);
|
||||
$mform->addElement('hidden', 'resources', true);
|
||||
$mform->setType('resources', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'participantnumberaveragelabel', '',
|
||||
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
|
||||
$mform->addElement('hidden', 'participantnumberaverage', 1);
|
||||
$mform->addElement('hidden', 'participantnumberaverage', true);
|
||||
$mform->setType('participantnumberaverage', PARAM_FLOAT);
|
||||
|
||||
$mform->addElement('static', 'modulenumberaveragelabel', '',
|
||||
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
|
||||
$mform->addElement('hidden', 'modulenumberaverage', 1);
|
||||
$mform->addElement('hidden', 'modulenumberaverage', true);
|
||||
$mform->setType('modulenumberaverage', PARAM_FLOAT);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -247,20 +247,6 @@ class registration_manager {
|
||||
$resourcecount = $DB->count_records('resource');
|
||||
}
|
||||
$siteinfo['resources'] = $resourcecount;
|
||||
// Badge statistics.
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
if (get_config('hub', 'site_badges_' . $cleanhuburl) == -1) {
|
||||
$badges = -1;
|
||||
} else {
|
||||
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
|
||||
}
|
||||
$siteinfo['badges'] = $badges;
|
||||
if (get_config('hub', 'site_issuedbadges_' . $cleanhuburl) == -1) {
|
||||
$issuedbadges = -1;
|
||||
} else {
|
||||
$issuedbadges = $DB->count_records('badge_issued');
|
||||
}
|
||||
$siteinfo['issuedbadges'] = $issuedbadges;
|
||||
//TODO
|
||||
require_once($CFG->dirroot . "/course/lib.php");
|
||||
if (get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl) == -1) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
|
||||
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
|
||||
*
|
||||
* This page displays the site registration form for Moodle.org/MOOCH or for a different hub.
|
||||
* This page displays the site registration form.
|
||||
* It handles redirection to the hub to continue the registration workflow process.
|
||||
* It also handles update operation by web service.
|
||||
*/
|
||||
@@ -39,17 +39,15 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
||||
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
|
||||
if ($huburl == HUB_MOODLEORGHUBURL) { // register to Moodle.org
|
||||
admin_externalpage_setup('registrationmoodleorg');
|
||||
} else { //register to a hub
|
||||
admin_externalpage_setup('registrationhub');
|
||||
}
|
||||
|
||||
$password = optional_param('password', '', PARAM_TEXT);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
if (!confirm_sesskey()) {
|
||||
throw new moodle_exception('missingparameter');
|
||||
}
|
||||
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
@@ -62,18 +60,7 @@ $siteregistrationform = new site_registration_form('',
|
||||
$fromform = $siteregistrationform->get_data();
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) {
|
||||
|
||||
// Set to -1 all optional data marked as "don't send" by the admin.
|
||||
// The function get_site_info() will not calculate the optional data if config is set to -1.
|
||||
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
|
||||
'badges', 'issuedbadges', 'modulenumberaverage', 'participantnumberaverage');
|
||||
foreach ($inputnames as $inputname) {
|
||||
if (empty($fromform->{$inputname})) {
|
||||
$fromform->{$inputname} = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Save the settings.
|
||||
//save the settings
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
|
||||
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
|
||||
@@ -95,8 +82,6 @@ if (!empty($fromform) and confirm_sesskey()) {
|
||||
set_config('site_postsnumber_' . $cleanhuburl, $fromform->posts, 'hub');
|
||||
set_config('site_questionsnumber_' . $cleanhuburl, $fromform->questions, 'hub');
|
||||
set_config('site_resourcesnumber_' . $cleanhuburl, $fromform->resources, 'hub');
|
||||
set_config('site_badges_' . $cleanhuburl, $fromform->badges, 'hub');
|
||||
set_config('site_issuedbadges_' . $cleanhuburl, $fromform->issuedbadges, 'hub');
|
||||
set_config('site_modulenumberaverage_' . $cleanhuburl, $fromform->modulenumberaverage, 'hub');
|
||||
set_config('site_participantnumberaverage_' . $cleanhuburl, $fromform->participantnumberaverage, 'hub');
|
||||
}
|
||||
@@ -126,21 +111,6 @@ if ($update and confirm_sesskey()) {
|
||||
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
|
||||
|
||||
// Retrieve the optional info (specially course number, user number, module number average...).
|
||||
$siteinfo = $registrationmanager->get_site_info($huburl);
|
||||
$fromform->courses = $siteinfo['courses'];
|
||||
$fromform->users = $siteinfo['users'];
|
||||
$fromform->enrolments = $siteinfo['enrolments'];
|
||||
$fromform->posts = $siteinfo['posts'];
|
||||
$fromform->questions = $siteinfo['questions'];
|
||||
$fromform->resources = $siteinfo['resources'];
|
||||
$fromform->badges = $siteinfo['badges'];
|
||||
$fromform->issuedbadges = $siteinfo['issuedbadges'];
|
||||
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
|
||||
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
|
||||
$fromform->street = $siteinfo['street'];
|
||||
|
||||
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
|
||||
|
||||
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
|
||||
@@ -175,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, get_string('moodleorghubname', 'admin'));
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
|
||||
$items = array(get_string('registermoodleorgli1', 'admin'),
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
|
||||
get_string('registermoodleorgli3', 'admin', $moochurl));
|
||||
$moodleorgregmsg .= html_writer::alist($items);
|
||||
return $moodleorgregmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a box message confirming a site registration (add or update)
|
||||
* @param string $confirmationmessage
|
||||
@@ -59,6 +42,57 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return $this->output->box($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the page to register on Moodle.org or on a specific hub
|
||||
*/
|
||||
public function registrationselector($updatemoodleorg = false) {
|
||||
global $CFG;
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('moodleorg', 'hub'), get_string('specifichub', 'hub'));
|
||||
$table->size = array('50%', '50%');
|
||||
//$table->attributes['class'] = 'registerindextable';
|
||||
//Moodle.org information cell
|
||||
$moodleorgcell = get_string('moodleorgregistrationdetail', 'hub');
|
||||
$moodleorgcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$moodleorgcell = html_writer::tag('div', $moodleorgcell, array('class' => 'justifytext'));
|
||||
|
||||
//Specific hub information cell
|
||||
$specifichubcell = get_string('specifichubregistrationdetail', 'hub');
|
||||
$specifichubcell .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
|
||||
$specifichubcell = html_writer::tag('div', $specifichubcell, array('class' => 'justifytext'));
|
||||
|
||||
//add information cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
//Moodle.org button cell
|
||||
$registeronmoodleorgurl = new moodle_url("/" . $CFG->admin . "/registration/register.php",
|
||||
array('sesskey' => sesskey(), 'huburl' => HUB_MOODLEORGHUBURL
|
||||
, 'hubname' => 'Moodle.org'));
|
||||
$registeronmoodleorgbutton = new single_button($registeronmoodleorgurl,
|
||||
$updatemoodleorg ? get_string('updatesite', 'hub', 'Moodle.org') : get_string('registeronmoodleorg', 'hub'));
|
||||
$registeronmoodleorgbutton->class = 'centeredbutton';
|
||||
$registeronmoodleorgbuttonhtml = $this->output->render($registeronmoodleorgbutton);
|
||||
$moodleorgcell = $registeronmoodleorgbuttonhtml;
|
||||
|
||||
//Specific hub button cell
|
||||
$registeronspecifichuburl = new moodle_url("/" . $CFG->admin . "/registration/hubselector.php",
|
||||
array('sesskey' => sesskey()));
|
||||
$registeronspecifichubbutton = new single_button($registeronspecifichuburl,
|
||||
get_string('registeronspecifichub', 'hub'));
|
||||
$registeronspecifichubbutton->class = 'centeredbutton';
|
||||
$registeronspecifichubbuttonhtml = $this->output->render($registeronspecifichubbutton);
|
||||
$specifichubcell = $registeronspecifichubbuttonhtml;
|
||||
|
||||
//add button cells
|
||||
$cells = array($moodleorgcell, $specifichubcell);
|
||||
$row = new html_table_row($cells);
|
||||
$table->data[] = $row;
|
||||
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the listing of registered on hub
|
||||
*/
|
||||
@@ -92,4 +126,4 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ $url = optional_param('url', '', PARAM_URL);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
$token = optional_param('token', '', PARAM_TEXT);
|
||||
|
||||
admin_externalpage_setup('registrationhubs');
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
//check that we are waiting a confirmation from this hub, and check that the token is correct
|
||||
$registrationmanager = new registration_manager();
|
||||
|
||||
+78
-666
File diff suppressed because it is too large
Load Diff
+23
-80
@@ -1,27 +1,12 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
|
||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
$repository = optional_param('repos', '', PARAM_FORMAT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
|
||||
$display = true; // fall through to normal display
|
||||
|
||||
@@ -47,7 +32,7 @@ if ($action == 'newon') {
|
||||
$visible = false;
|
||||
}
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup($pagename);
|
||||
|
||||
$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
|
||||
@@ -57,13 +42,6 @@ $configstr = get_string('manage', 'repository');
|
||||
|
||||
$return = true;
|
||||
|
||||
if (!empty($action)) {
|
||||
require_sesskey();
|
||||
}
|
||||
|
||||
// Purge all caches related to repositories administration.
|
||||
cache::make('core', 'plugininfo_repository')->purge();
|
||||
|
||||
/**
|
||||
* Helper function that generates a moodle_url object
|
||||
* relevant to the repository
|
||||
@@ -143,10 +121,8 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
$success = $repositorytype->update_options($settings);
|
||||
} else {
|
||||
$type = new repository_type($plugin, (array)$fromform, $visible);
|
||||
$type->create();
|
||||
$success = true;
|
||||
if (!$repoid = $type->create()) {
|
||||
$success = false;
|
||||
}
|
||||
$data = data_submitted();
|
||||
}
|
||||
if ($success) {
|
||||
@@ -176,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') {
|
||||
@@ -209,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);
|
||||
@@ -218,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') {
|
||||
@@ -286,20 +234,17 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Table to list plug-ins
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
|
||||
|
||||
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
|
||||
$table->id = 'repositoriessetting';
|
||||
$table->align = array('left', 'center', 'center', 'center', 'center');
|
||||
$table->data = array();
|
||||
$table->attributes['class'] = 'admintable generaltable';
|
||||
|
||||
// Get list of used plug-ins
|
||||
$repositorytypes = repository::get_types();
|
||||
// Array to store plugins being used
|
||||
$alreadyplugins = array();
|
||||
if (!empty($repositorytypes)) {
|
||||
$totalrepositorytypes = count($repositorytypes);
|
||||
$instances = repository::get_types();
|
||||
if (!empty($instances)) {
|
||||
// Array to store plugins being used
|
||||
$alreadyplugins = array();
|
||||
$totalinstances = count($instances);
|
||||
$updowncount = 1;
|
||||
foreach ($repositorytypes as $i) {
|
||||
foreach ($instances as $i) {
|
||||
$settings = '';
|
||||
$typename = $i->get_typename();
|
||||
// Display edit link only if you can config the type or if it has multiple instances (e.g. has instance config)
|
||||
@@ -310,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));
|
||||
@@ -322,10 +267,9 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
$userinstances = array();
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
$repocontext = context::instance_by_id($instance->instance->contextid);
|
||||
if ($repocontext->contextlevel == CONTEXT_COURSE) {
|
||||
if ($instance->context->contextlevel == CONTEXT_COURSE) {
|
||||
$courseinstances[] = $instance;
|
||||
} else if ($repocontext->contextlevel == CONTEXT_USER) {
|
||||
} else if ($instance->context->contextlevel == CONTEXT_USER) {
|
||||
$userinstances[] = $instance;
|
||||
}
|
||||
}
|
||||
@@ -361,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
|
||||
@@ -373,7 +317,7 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
else {
|
||||
$updown .= $spacer;
|
||||
}
|
||||
if ($updowncount < $totalrepositorytypes) {
|
||||
if ($updowncount < $totalinstances) {
|
||||
$updown .= "<a href=\"$sesskeyurl&action=movedown&repos=".$typename."\">";
|
||||
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" /></a>";
|
||||
}
|
||||
@@ -398,7 +342,6 @@ if (($action == 'edit') || ($action == 'new')) {
|
||||
// Check that it has not already been listed
|
||||
if (!in_array($plugin, $alreadyplugins)) {
|
||||
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
|
||||
$select->set_label(get_string('action'), array('class' => 'accesshide'));
|
||||
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,18 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
// id of repository
|
||||
$edit = optional_param('edit', 0, PARAM_INT);
|
||||
$new = optional_param('new', '', PARAM_PLUGIN);
|
||||
$new = optional_param('new', '', PARAM_FORMAT);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$delete = optional_param('delete', 0, PARAM_INT);
|
||||
$sure = optional_param('sure', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_PLUGIN);
|
||||
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
|
||||
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$pagename = 'repositorycontroller';
|
||||
|
||||
@@ -41,20 +24,16 @@ if ($edit){
|
||||
$pagename = 'repositoryinstancenew';
|
||||
}
|
||||
|
||||
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstance.php'));
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
|
||||
|
||||
$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
|
||||
'sesskey'=>sesskey(),
|
||||
'action'=>'edit',
|
||||
));
|
||||
admin_externalpage_setup($pagename);
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey();
|
||||
$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos=';
|
||||
if ($new) {
|
||||
$parenturl->param('repos', $new);
|
||||
} else {
|
||||
$parenturl->param('repos', $type);
|
||||
$baseurl .= $new;
|
||||
}
|
||||
else {
|
||||
$baseurl .= $type;
|
||||
}
|
||||
|
||||
$return = true;
|
||||
@@ -62,9 +41,6 @@ $return = true;
|
||||
if (!empty($edit) || !empty($new)) {
|
||||
if (!empty($edit)) {
|
||||
$instance = repository::get_instance($edit);
|
||||
if (!$instance->can_be_edited_by_user()) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
$instancetype = repository::get_type_by_id($instance->options['typeid']);
|
||||
$classname = 'repository_' . $instancetype->get_typename();
|
||||
$configs = $instance->get_instance_option_names();
|
||||
@@ -72,7 +48,7 @@ if (!empty($edit) || !empty($new)) {
|
||||
$typeid = $instance->options['typeid'];
|
||||
} else {
|
||||
$plugin = $new;
|
||||
$typeid = null;
|
||||
$typeid = $new;
|
||||
$instance = null;
|
||||
}
|
||||
|
||||
@@ -81,9 +57,12 @@ if (!empty($edit) || !empty($new)) {
|
||||
// end setup, begin output
|
||||
|
||||
if ($mform->is_cancelled()){
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
exit;
|
||||
} else if ($fromform = $mform->get_data()){
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($edit) {
|
||||
$settings = array();
|
||||
$settings['name'] = $fromform->name;
|
||||
@@ -98,13 +77,13 @@ if (!empty($edit) || !empty($new)) {
|
||||
}
|
||||
$success = $instance->set_option($settings);
|
||||
} else {
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform);
|
||||
$success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform);
|
||||
$data = data_submitted();
|
||||
}
|
||||
if ($success) {
|
||||
redirect($parenturl);
|
||||
redirect($baseurl);
|
||||
} else {
|
||||
print_error('instancenotsaved', 'repository', $parenturl);
|
||||
print_error('instancenotsaved', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -116,50 +95,38 @@ if (!empty($edit) || !empty($new)) {
|
||||
$return = false;
|
||||
}
|
||||
} else if (!empty($hide)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
$instance = repository::get_type_by_typename($hide);
|
||||
$instance->hide();
|
||||
$return = true;
|
||||
} else if (!empty($delete)) {
|
||||
$instance = repository::get_instance($delete);
|
||||
//if you try to delete an instance set as readonly, display an error message
|
||||
if ($instance->readonly) {
|
||||
// If you try to delete an instance set as readonly, display an error message.
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
} else if (!$instance->can_be_edited_by_user()) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
}
|
||||
if ($sure) {
|
||||
if ($instance->delete($downloadcontents)) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
}
|
||||
if ($instance->delete()) {
|
||||
$deletedstr = get_string('instancedeleted', 'repository');
|
||||
redirect($parenturl, $deletedstr, 3);
|
||||
redirect($baseurl, $deletedstr, 3);
|
||||
} else {
|
||||
print_error('instancenotdeleted', 'repository', $parenturl);
|
||||
print_error('instancenotdeleted', 'repository', $baseurl);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box_start('generalbox', 'notice');
|
||||
$continueurl = new moodle_url($baseurl, array(
|
||||
'type' => $type,
|
||||
'delete' => $delete,
|
||||
'sure' => 'yes',
|
||||
));
|
||||
$continueanddownloadurl = new moodle_url($continueurl, array(
|
||||
'downloadcontents' => 1
|
||||
));
|
||||
$message = get_string('confirmdelete', 'repository', $instance->name);
|
||||
echo html_writer::tag('p', $message);
|
||||
|
||||
echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository'));
|
||||
echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
|
||||
echo $OUTPUT->single_button($parenturl, get_string('cancel'));
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
|
||||
$return = false;
|
||||
}
|
||||
|
||||
if (!empty($return)) {
|
||||
redirect($parenturl);
|
||||
|
||||
redirect($baseurl);
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -28,7 +28,7 @@ require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
|
||||
|
||||
$mode = required_param('mode', PARAM_ALPHANUMEXT);
|
||||
$mode = required_param('mode', PARAM_ACTION);
|
||||
$classformode = array(
|
||||
'assign' => 'role_allow_assign_page',
|
||||
'override' => 'role_allow_override_page',
|
||||
@@ -41,7 +41,7 @@ if (!isset($classformode[$mode])) {
|
||||
$baseurl = new moodle_url('/admin/roles/allow.php', array('mode'=>$mode));
|
||||
admin_externalpage_setup('defineroles', '', array(), $baseurl);
|
||||
|
||||
$syscontext = context_system::instance();
|
||||
$syscontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/role:manage', $syscontext);
|
||||
|
||||
$controller = new $classformode[$mode]();
|
||||
|
||||
@@ -189,7 +189,7 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
<form id="assignform" method="post" action="<?php echo $assignurl ?>"><div>
|
||||
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
|
||||
|
||||
<table id="assigningrole" summary="" class="admintable roleassigntable generaltable" cellspacing="0">
|
||||
<table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
|
||||
<tr>
|
||||
<td id="existingcell">
|
||||
<p><label for="removeselect"><?php print_string('extusers', 'role'); ?></label></p>
|
||||
@@ -259,7 +259,7 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
foreach ($assignableroles as $roleid => $notused) {
|
||||
$roleusers = '';
|
||||
if (0 < $assigncounts[$roleid] && $assigncounts[$roleid] <= MAX_USERS_TO_LIST_PER_ROLE) {
|
||||
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname');
|
||||
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.lastname, u.firstname');
|
||||
if (!empty($roleusers)) {
|
||||
$strroleusers = array();
|
||||
foreach ($roleusers as $user) {
|
||||
@@ -278,13 +278,15 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
|
||||
|
||||
// Print overview table
|
||||
$table = new html_table();
|
||||
$table->id = 'assignrole';
|
||||
$table->tablealign = 'center';
|
||||
$table->width = '60%';
|
||||
$table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'role'));
|
||||
$table->colclasses = array('leftalign role', 'leftalign', 'centeralign userrole');
|
||||
$table->attributes['class'] = 'admintable generaltable';
|
||||
$table->wrap = array('nowrap', '', 'nowrap');
|
||||
$table->align = array('left', 'left', 'center');
|
||||
if ($showroleholders) {
|
||||
$table->headspan = array(1, 1, 2);
|
||||
$table->colclasses[] = 'leftalign roleholder';
|
||||
$table->wrap[] = 'nowrap';
|
||||
$table->align[] = 'left';
|
||||
}
|
||||
|
||||
foreach ($assignableroles as $roleid => $rolename) {
|
||||
|
||||
+15
-35
@@ -59,11 +59,16 @@ $courseid = $course->id;
|
||||
$contextname = print_context_name($context);
|
||||
|
||||
// Get the user_selector we will need.
|
||||
// Teachers within a course just get to see the same list of enrolled users.
|
||||
// Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('accesscontext' => $context);
|
||||
$userselector = new role_check_users_selector('reportuser', $options);
|
||||
$userselector->set_rows(20);
|
||||
// Teachers within a course just get to see the same list of people they can
|
||||
// assign roles to. Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('context' => $context, 'roleid' => 0);
|
||||
if (has_capability('moodle/role:manage', $context)) {
|
||||
$userselector = new potential_assignees_course_and_above('reportuser', $options);
|
||||
} else {
|
||||
$userselector = roles_get_potential_user_selector($context, 'reportuser', $options);
|
||||
}
|
||||
$userselector->set_multiselect(false);
|
||||
$userselector->set_rows(10);
|
||||
|
||||
// Work out an appropriate page title.
|
||||
$title = get_string('checkpermissionsin', 'role', $contextname);
|
||||
@@ -99,45 +104,20 @@ switch ($context->contextlevel) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the list of the reported-on user's role assignments - must be after
|
||||
// the page setup code above, or the language might be wrong.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
$roleassignments = get_user_roles_with_special($context, $reportuser->id);
|
||||
$rolenames = role_get_names($context);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
// These are needed early because of tabs.php
|
||||
$assignableroles = get_assignable_roles($context, ROLENAME_BOTH);
|
||||
$overridableroles = get_overridable_roles($context, ROLENAME_BOTH);
|
||||
|
||||
// Print heading.
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
// If a user has been chosen, show all the permissions for this user.
|
||||
$reportuser = $userselector->get_selected_user();
|
||||
if (!is_null($reportuser)) {
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
|
||||
|
||||
if (!empty($roleassignments)) {
|
||||
echo $OUTPUT->heading(get_string('rolesforuser', 'role', fullname($reportuser)), 3);
|
||||
echo html_writer::start_tag('ul');
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
foreach ($roleassignments as $ra) {
|
||||
$racontext = context::instance_by_id($ra->contextid);
|
||||
$link = html_writer::link($racontext->get_url(), $racontext->get_context_name());
|
||||
|
||||
$rolename = $rolenames[$ra->roleid]->localname;
|
||||
if (has_capability('moodle/role:manage', $systemcontext)) {
|
||||
$rolename = html_writer::link(new moodle_url('/admin/roles/define.php',
|
||||
array('action' => 'view', 'roleid' => $ra->roleid)), $rolename);
|
||||
}
|
||||
|
||||
echo html_writer::tag('li', get_string('roleincontext', 'role',
|
||||
array('role' => $rolename, 'context' => $link)));
|
||||
}
|
||||
echo html_writer::end_tag('ul');
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading(get_string('permissionsforuser', 'role', fullname($reportuser)), 3);
|
||||
|
||||
$table = new check_capability_table($context, $reportuser, $contextname);
|
||||
$table->display();
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
throw new moodle_exception('invalidaccess');
|
||||
}
|
||||
if ($action != 'add') {
|
||||
$roleid = required_param('roleid', PARAM_INT);
|
||||
$roleid = required_param('roleid', PARAM_INTEGER);
|
||||
} else {
|
||||
$roleid = 0;
|
||||
}
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
/// Check access permissions.
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_login();
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
admin_externalpage_setup('defineroles', '', array('action' => $action, 'roleid' => $roleid), $defineurl);
|
||||
|
||||
+67
-308
@@ -256,14 +256,19 @@ class permissions_table extends capability_table_base {
|
||||
* @param string $contextname print_context_name($context) - to save recomputing.
|
||||
*/
|
||||
public function __construct($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles) {
|
||||
global $DB;
|
||||
|
||||
parent::__construct($context, 'permissions');
|
||||
$this->contextname = $contextname;
|
||||
$this->allowoverrides = $allowoverrides;
|
||||
$this->allowsafeoverrides = $allowsafeoverrides;
|
||||
$this->overridableroles = $overridableroles;
|
||||
|
||||
$roles = get_all_roles($context);
|
||||
$this->roles = role_fix_names(array_reverse($roles, true), $context, ROLENAME_ALIAS, true);
|
||||
$roles = $DB->get_records('role', null, 'sortorder DESC');
|
||||
foreach ($roles as $roleid=>$role) {
|
||||
$roles[$roleid] = $role->name;
|
||||
}
|
||||
$this->roles = role_fix_names($roles, $context);
|
||||
|
||||
}
|
||||
|
||||
@@ -588,13 +593,25 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
global $DB;
|
||||
$this->errors = array();
|
||||
|
||||
// Role name.
|
||||
$name = optional_param('name', null, PARAM_MULTILANG);
|
||||
if (!is_null($name)) {
|
||||
$this->role->name = $name;
|
||||
if (html_is_blank($this->role->name)) {
|
||||
$this->errors['name'] = get_string('errorbadrolename', 'role');
|
||||
}
|
||||
}
|
||||
if ($DB->record_exists_select('role', 'name = ? and id <> ?', array($this->role->name, $this->roleid))) {
|
||||
$this->errors['name'] = get_string('errorexistsrolename', 'role');
|
||||
}
|
||||
|
||||
// Role short name. We clean this in a special way. We want to end up
|
||||
// with only lowercase safe ASCII characters.
|
||||
$shortname = optional_param('shortname', null, PARAM_RAW);
|
||||
if (!is_null($shortname)) {
|
||||
$this->role->shortname = $shortname;
|
||||
$this->role->shortname = textlib::specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = textlib::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
$this->role->shortname = textlib_get_instance()->specialtoascii($this->role->shortname);
|
||||
$this->role->shortname = moodle_strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
if (empty($this->role->shortname)) {
|
||||
$this->errors['shortname'] = get_string('errorbadroleshortname', 'role');
|
||||
}
|
||||
@@ -603,20 +620,6 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
$this->errors['shortname'] = get_string('errorexistsroleshortname', 'role');
|
||||
}
|
||||
|
||||
// Role name.
|
||||
$name = optional_param('name', null, PARAM_TEXT);
|
||||
if (!is_null($name)) {
|
||||
$this->role->name = $name;
|
||||
// Hack: short names of standard roles are equal to archetypes, empty name means localised via lang packs.
|
||||
$archetypes = get_role_archetypes();
|
||||
if (!isset($archetypes[$shortname]) and html_is_blank($this->role->name)) {
|
||||
$this->errors['name'] = get_string('errorbadrolename', 'role');
|
||||
}
|
||||
}
|
||||
if ($this->role->name !== '' and $DB->record_exists_select('role', 'name = ? and id <> ?', array($this->role->name, $this->roleid))) {
|
||||
$this->errors['name'] = get_string('errorexistsrolename', 'role');
|
||||
}
|
||||
|
||||
// Description.
|
||||
$description = optional_param('description', null, PARAM_RAW);
|
||||
if (!is_null($description)) {
|
||||
@@ -661,7 +664,7 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
public function make_copy() {
|
||||
$this->roleid = 0;
|
||||
unset($this->role->id);
|
||||
$this->role->name = role_get_name($this->role, null, ROLENAME_ORIGINAL) . ' ' . get_string('copyasnoun');
|
||||
$this->role->name .= ' ' . get_string('copyasnoun');
|
||||
$this->role->shortname .= 'copy';
|
||||
}
|
||||
|
||||
@@ -738,56 +741,6 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of roles of the allowed type.
|
||||
*
|
||||
* @param string $type Must be one of: assign, switch, or override.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_allow_roles_list($type) {
|
||||
global $DB;
|
||||
|
||||
if ($type !== 'assign' and $type !== 'switch' and $type !== 'override') {
|
||||
debugging('Invalid role allowed type specified', DEBUG_DEVELOPER);
|
||||
return array();
|
||||
}
|
||||
|
||||
if (empty($this->roleid)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$sql = "SELECT r.*
|
||||
FROM {role} r
|
||||
JOIN {role_allow_{$type}} a ON a.allow{$type} = r.id
|
||||
WHERE a.roleid = :roleid
|
||||
ORDER BY r.sortorder ASC";
|
||||
return $DB->get_records_sql($sql, array('roleid'=>$this->roleid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of roles with the allowed type.
|
||||
*
|
||||
* @param string $type Must be one of: assign, switch, or override.
|
||||
* @return array Am array of role names with the allowed type
|
||||
*/
|
||||
protected function get_allow_role_control($type) {
|
||||
if ($roles = $this->get_allow_roles_list($type)) {
|
||||
$roles = role_fix_names($roles, null, ROLENAME_ORIGINAL, true);
|
||||
return implode(', ', $roles);
|
||||
} else {
|
||||
return get_string('none');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about the risks associated with a role.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_role_risks_info() {
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function print_field($name, $caption, $field) {
|
||||
global $OUTPUT;
|
||||
// Attempt to generate HTML like formslib.
|
||||
@@ -826,17 +779,11 @@ class define_role_table_advanced extends capability_table_with_risks {
|
||||
global $OUTPUT;
|
||||
// Extra fields at the top of the page.
|
||||
echo '<div class="topfields clearfix">';
|
||||
$this->print_field('shortname', get_string('roleshortname', 'role').' '.$OUTPUT->help_icon('roleshortname', 'role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('name', get_string('customrolename', 'role').' '.$OUTPUT->help_icon('customrolename', 'role'), $this->get_name_field('name'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'role').' '.$OUTPUT->help_icon('customroledescription', 'role'), $this->get_description_field('description'));
|
||||
$this->print_field('name', get_string('rolefullname', 'role'), $this->get_name_field('name'));
|
||||
$this->print_field('shortname', get_string('roleshortname', 'role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('edit-description', get_string('description'), $this->get_description_field('description'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'role').' '.$OUTPUT->help_icon('archetype', 'role'), $this->get_archetype_field('archetype'));
|
||||
$this->print_field('', get_string('maybeassignedin', 'role'), $this->get_assignable_levels_control());
|
||||
$this->print_field('', get_string('allowassign', 'role'), $this->get_allow_role_control('assign'));
|
||||
$this->print_field('', get_string('allowoverride', 'role'), $this->get_allow_role_control('override'));
|
||||
$this->print_field('', get_string('allowswitch', 'role'), $this->get_allow_role_control('switch'));
|
||||
if ($risks = $this->get_role_risks_info()) {
|
||||
$this->print_field('', get_string('rolerisks', 'role'), $risks);
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
$this->print_show_hide_advanced_button();
|
||||
@@ -915,7 +862,7 @@ class view_role_definition_table extends define_role_table_advanced {
|
||||
}
|
||||
|
||||
protected function get_name_field($id) {
|
||||
return role_get_name($this->role);
|
||||
return strip_tags(format_string($this->role->name));
|
||||
}
|
||||
|
||||
protected function get_shortname_field($id) {
|
||||
@@ -923,7 +870,7 @@ class view_role_definition_table extends define_role_table_advanced {
|
||||
}
|
||||
|
||||
protected function get_description_field($id) {
|
||||
return role_get_description($this->role);
|
||||
return format_text($this->role->description, FORMAT_HTML);
|
||||
}
|
||||
|
||||
protected function get_archetype_field($id) {
|
||||
@@ -938,57 +885,6 @@ class view_role_definition_table extends define_role_table_advanced {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML risk icons.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_role_risks_info() {
|
||||
global $OUTPUT;
|
||||
|
||||
if (empty($this->roleid)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$risks = array();
|
||||
$allrisks = get_all_risks();
|
||||
foreach ($this->capabilities as $capability) {
|
||||
$perm = $this->permissions[$capability->name];
|
||||
if ($perm != CAP_ALLOW) {
|
||||
continue;
|
||||
}
|
||||
foreach ($allrisks as $type=>$risk) {
|
||||
if ($risk & (int)$capability->riskbitmask) {
|
||||
$risks[$type] = $risk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$risksurl = new moodle_url(get_docs_url(s(get_string('risks', 'role'))));
|
||||
foreach ($risks as $type=>$risk) {
|
||||
$pixicon = new pix_icon('/i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
|
||||
$risks[$type] = $OUTPUT->action_icon($risksurl, $pixicon, new popup_action('click', $risksurl));
|
||||
}
|
||||
|
||||
return implode(' ', $risks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the row should be skipped.
|
||||
*
|
||||
* @param string $capability
|
||||
* @return bool
|
||||
*/
|
||||
protected function skip_row($capability) {
|
||||
$perm = $this->permissions[$capability->name];
|
||||
if ($perm == CAP_INHERIT) {
|
||||
// Do not print empty rows in role overview, admins need to know quickly what is allowed and prohibited,
|
||||
// if they want to see the list of all capabilities they can go to edit role page.
|
||||
return true;
|
||||
}
|
||||
parent::skip_row($capability);
|
||||
}
|
||||
|
||||
protected function add_permission_cells($capability) {
|
||||
$perm = $this->permissions[$capability->name];
|
||||
$permname = $this->allpermissions[$perm];
|
||||
@@ -1040,7 +936,7 @@ class override_permissions_table_advanced extends capability_table_with_risks {
|
||||
global $DB;
|
||||
|
||||
/// Get the capabilities from the parent context, so that can be shown in the interface.
|
||||
$parentcontext = context::instance_by_id(get_parent_contextid($this->context));
|
||||
$parentcontext = get_context_instance_by_id(get_parent_contextid($this->context));
|
||||
$this->parentpermissions = role_context_capabilities($this->roleid, $parentcontext);
|
||||
}
|
||||
|
||||
@@ -1089,6 +985,8 @@ class override_permissions_table_advanced extends capability_table_with_risks {
|
||||
* Base class to avoid duplicating code.
|
||||
*/
|
||||
abstract class role_assign_user_selector_base extends user_selector_base {
|
||||
const MAX_USERS_PER_PAGE = 100;
|
||||
|
||||
protected $roleid;
|
||||
protected $context;
|
||||
|
||||
@@ -1101,7 +999,7 @@ abstract class role_assign_user_selector_base extends user_selector_base {
|
||||
if (isset($options['context'])) {
|
||||
$this->context = $options['context'];
|
||||
} else {
|
||||
$this->context = context::instance_by_id($options['contextid']);
|
||||
$this->context = get_context_instance_by_id($options['contextid']);
|
||||
}
|
||||
$options['accesscontext'] = $this->context;
|
||||
parent::__construct($name, $options);
|
||||
@@ -1144,26 +1042,27 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
$countfields = 'SELECT COUNT(u.id)';
|
||||
|
||||
$sql = " FROM {user} u
|
||||
LEFT JOIN {role_assignments} ra ON (ra.userid = u.id AND ra.roleid = :roleid AND ra.contextid = :contextid)
|
||||
WHERE u.id IN ($enrolsql)
|
||||
$wherecondition
|
||||
AND ra.id IS NULL";
|
||||
WHERE u.id IN ($enrolsql) $wherecondition
|
||||
AND u.id NOT IN (
|
||||
SELECT r.userid
|
||||
FROM {role_assignments} r
|
||||
WHERE r.contextid = :contextid
|
||||
AND r.roleid = :roleid)";
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$params['contextid'] = $this->context->id;
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
// Check to see if there are too many to show sensibly.
|
||||
if (!$this->is_validating()) {
|
||||
$potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
if ($potentialmemberscount > $this->maxusersperpage) {
|
||||
if ($potentialmemberscount > role_assign_user_selector_base::MAX_USERS_PER_PAGE) {
|
||||
return $this->too_many_results($search, $potentialmemberscount);
|
||||
}
|
||||
}
|
||||
|
||||
// If not, show them.
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1179,132 +1078,6 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the selection of users in the check permissions page.
|
||||
*
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
*/
|
||||
class role_check_users_selector extends user_selector_base {
|
||||
/** @var bool limit listing of users to enrolled only */
|
||||
var $onlyenrolled;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name the control name/id for use in the HTML.
|
||||
* @param array $options other options needed to construct this selector.
|
||||
* You must be able to clone a userselector by doing new get_class($us)($us->get_name(), $us->get_options());
|
||||
*/
|
||||
public function __construct($name, $options) {
|
||||
if (!isset($options['multiselect'])) {
|
||||
$options['multiselect'] = false;
|
||||
}
|
||||
parent::__construct($name, $options);
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
if ($coursecontext and $coursecontext->id != SITEID and !has_capability('moodle/role:manage', $coursecontext)) {
|
||||
// Prevent normal teachers from looking up all users.
|
||||
$this->onlyenrolled = true;
|
||||
} else {
|
||||
$this->onlyenrolled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
global $DB;
|
||||
|
||||
list($wherecondition, $params) = $this->search_sql($search, 'u');
|
||||
|
||||
$fields = 'SELECT ' . $this->required_fields_sql('u');
|
||||
$countfields = 'SELECT COUNT(1)';
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
|
||||
if ($coursecontext and $coursecontext != SITEID) {
|
||||
$sql1 = " FROM {user} u
|
||||
JOIN {user_enrolments} ue ON (ue.userid = u.id)
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
|
||||
WHERE $wherecondition";
|
||||
$params['courseid1'] = $coursecontext->instanceid;
|
||||
|
||||
if ($this->onlyenrolled) {
|
||||
$sql2 = null;
|
||||
} else {
|
||||
$sql2 = " FROM {user} u
|
||||
LEFT JOIN ({user_enrolments} ue
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid2)) ON (ue.userid = u.id)
|
||||
WHERE $wherecondition
|
||||
AND ue.id IS NULL";
|
||||
$params['courseid2'] = $coursecontext->instanceid;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($this->onlyenrolled) {
|
||||
// Bad luck, current user may not view only enrolled users.
|
||||
return array();
|
||||
}
|
||||
$sql1 = null;
|
||||
$sql2 = " FROM {user} u
|
||||
WHERE $wherecondition";
|
||||
}
|
||||
|
||||
$params['contextid'] = $this->accesscontext->id;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
$result = array();
|
||||
|
||||
if ($search) {
|
||||
$groupname1 = get_string('enrolledusersmatching', 'enrol', $search);
|
||||
$groupname2 = get_string('potusersmatching', 'role', $search);
|
||||
} else {
|
||||
$groupname1 = get_string('enrolledusers', 'enrol');
|
||||
$groupname2 = get_string('potusers', 'role');
|
||||
}
|
||||
|
||||
if ($sql1) {
|
||||
$enrolleduserscount = $DB->count_records_sql($countfields . $sql1, $params);
|
||||
if (!$this->is_validating() and $enrolleduserscount > $this->maxusersperpage) {
|
||||
$result[$groupname1] = array();
|
||||
$toomany = $this->too_many_results($search, $enrolleduserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
|
||||
} else {
|
||||
$enrolledusers = $DB->get_records_sql($fields . $sql1 . $order, array_merge($params, $sortparams));
|
||||
if ($enrolledusers) {
|
||||
$result[$groupname1] = $enrolledusers;
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$result[''] = array();
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$otheruserscount = $DB->count_records_sql($countfields . $sql2, $params);
|
||||
if (!$this->is_validating() and $otheruserscount > $this->maxusersperpage) {
|
||||
$result[$groupname2] = array();
|
||||
$toomany = $this->too_many_results($search, $otheruserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
} else {
|
||||
$otherusers = $DB->get_records_sql($fields . $sql2 . $order, array_merge($params, $sortparams));
|
||||
if ($otherusers) {
|
||||
$result[$groupname2] = $otherusers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function get_options() {
|
||||
global $CFG;
|
||||
$options = parent::get_options();
|
||||
$options['file'] = $CFG->admin . '/roles/lib.php';
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the list of potential users on the assign roles page,
|
||||
* when we are assigning in a context at or above the course level. In this case we
|
||||
@@ -1326,21 +1099,19 @@ class potential_assignees_course_and_above extends role_assign_user_selector_bas
|
||||
FROM {role_assignments} r
|
||||
WHERE r.contextid = :contextid
|
||||
AND r.roleid = :roleid)";
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$params['contextid'] = $this->context->id;
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
if (!$this->is_validating()) {
|
||||
$potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
if ($potentialmemberscount > $this->maxusersperpage) {
|
||||
if ($potentialmemberscount > role_assign_user_selector_base::MAX_USERS_PER_PAGE) {
|
||||
return $this->too_many_results($search, $potentialmemberscount);
|
||||
}
|
||||
}
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1374,9 +1145,6 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
$params = array_merge($params, $ctxparams);
|
||||
$params['roleid'] = $this->roleid;
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
|
||||
$params = array_merge($params, $sortparams);
|
||||
|
||||
$sql = "SELECT ra.id as raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component
|
||||
FROM {role_assignments} ra
|
||||
JOIN {user} u ON u.id = ra.userid
|
||||
@@ -1385,7 +1153,7 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
$wherecondition AND
|
||||
ctx.id $ctxcondition AND
|
||||
ra.roleid = :roleid
|
||||
ORDER BY ctx.depth DESC, ra.component, $sort";
|
||||
ORDER BY ctx.depth DESC, ra.component, u.lastname, u.firstname";
|
||||
$contextusers = $DB->get_records_sql($sql, $params);
|
||||
|
||||
// No users at all.
|
||||
@@ -1467,7 +1235,7 @@ class existing_role_holders extends role_assign_user_selector_base {
|
||||
}
|
||||
|
||||
protected function parent_con_group_name($search, $contextid) {
|
||||
$context = context::instance_by_id($contextid);
|
||||
$context = get_context_instance_by_id($contextid);
|
||||
$contextname = print_context_name($context, true, true);
|
||||
if ($search) {
|
||||
$a = new stdClass;
|
||||
@@ -1505,7 +1273,8 @@ abstract class role_allow_role_page {
|
||||
*/
|
||||
protected function load_required_roles() {
|
||||
/// Get all roles
|
||||
$this->roles = role_fix_names(get_all_roles(), context_system::instance(), ROLENAME_ORIGINAL);
|
||||
$this->roles = get_all_roles();
|
||||
role_fix_names($this->roles, get_context_instance(CONTEXT_SYSTEM), ROLENAME_ORIGINAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1714,7 +1483,7 @@ class role_allow_switch_page extends role_allow_role_page {
|
||||
function roles_get_potential_user_selector($context, $name, $options) {
|
||||
$blockinsidecourse = false;
|
||||
if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
$parentcontext = context::instance_by_id(get_parent_contextid($context));
|
||||
$parentcontext = get_context_instance_by_id(get_parent_contextid($context));
|
||||
$blockinsidecourse = in_array($parentcontext->contextlevel, array(CONTEXT_MODULE, CONTEXT_COURSE));
|
||||
}
|
||||
|
||||
@@ -1732,14 +1501,10 @@ class admins_potential_selector extends user_selector_base {
|
||||
* @param string $name control name
|
||||
* @param array $options should have two elements with keys groupid and courseid.
|
||||
*/
|
||||
public function __construct($name = null, $options = array()) {
|
||||
global $CFG;
|
||||
if (is_null($name)) {
|
||||
$name = 'addselect';
|
||||
}
|
||||
$options['multiselect'] = false;
|
||||
$options['exclude'] = explode(',', $CFG->siteadmins);
|
||||
parent::__construct($name, $options);
|
||||
public function __construct() {
|
||||
global $CFG, $USER;
|
||||
$admins = explode(',', $CFG->siteadmins);
|
||||
parent::__construct('addselect', array('multiselect'=>false, 'exclude'=>$admins));
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
@@ -1751,21 +1516,18 @@ class admins_potential_selector extends user_selector_base {
|
||||
|
||||
$sql = " FROM {user}
|
||||
WHERE $wherecondition AND mnethostid = :localmnet";
|
||||
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
$params['localmnet'] = $CFG->mnet_localhost_id; // it could be dangerous to make remote users admins and also this could lead to other problems
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
|
||||
// Check to see if there are too many to show sensibly.
|
||||
if (!$this->is_validating()) {
|
||||
$potentialcount = $DB->count_records_sql($countfields . $sql, $params);
|
||||
if ($potentialcount > $this->maxusersperpage) {
|
||||
if ($potentialcount > 100) {
|
||||
return $this->too_many_results($search, $potentialcount);
|
||||
}
|
||||
}
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
if (empty($availableusers)) {
|
||||
return array();
|
||||
@@ -1793,12 +1555,9 @@ class admins_existing_selector extends user_selector_base {
|
||||
* @param string $name control name
|
||||
* @param array $options should have two elements with keys groupid and courseid.
|
||||
*/
|
||||
public function __construct($name = null, $options = array()) {
|
||||
if (is_null($name)) {
|
||||
$name = 'removeselect';
|
||||
}
|
||||
$options['multiselect'] = false;
|
||||
parent::__construct($name, $options);
|
||||
public function __construct() {
|
||||
global $CFG, $USER;
|
||||
parent::__construct('removeselect', array('multiselect'=>false));
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
@@ -1815,10 +1574,7 @@ class admins_existing_selector extends user_selector_base {
|
||||
}
|
||||
$sql = " FROM {user}
|
||||
WHERE $wherecondition";
|
||||
|
||||
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
|
||||
$params = array_merge($params, $sortparams);
|
||||
$order = ' ORDER BY ' . $sort;
|
||||
$order = ' ORDER BY lastname ASC, firstname ASC';
|
||||
|
||||
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
|
||||
|
||||
@@ -1827,10 +1583,13 @@ class admins_existing_selector extends user_selector_base {
|
||||
}
|
||||
|
||||
$mainadmin = array();
|
||||
$mainadminuser = get_admin();
|
||||
if ($mainadminuser && isset($availableusers[$mainadminuser->id])) {
|
||||
$mainadmin = array($mainadminuser->id => $availableusers[$mainadminuser->id]);
|
||||
unset($availableusers[$mainadminuser->id]);
|
||||
$adminids = explode(',', $CFG->siteadmins);
|
||||
foreach ($adminids as $id) {
|
||||
if (isset($availableusers[$id])) {
|
||||
$mainadmin = array($id=>$availableusers[$id]);
|
||||
unset($availableusers[$id]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
@@ -47,13 +47,14 @@
|
||||
$defineurl = $CFG->wwwroot . '/' . $CFG->admin . '/roles/define.php';
|
||||
|
||||
/// Check access permissions.
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_login();
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
admin_externalpage_setup('defineroles');
|
||||
|
||||
/// Get some basic data we are going to need.
|
||||
$roles = role_fix_names(get_all_roles(), $systemcontext, ROLENAME_ORIGINAL);
|
||||
$roles = get_all_roles();
|
||||
role_fix_names($roles, $systemcontext, ROLENAME_ORIGINAL);
|
||||
|
||||
$undeletableroles = array();
|
||||
$undeletableroles[$CFG->notloggedinroleid] = 1;
|
||||
@@ -186,9 +187,10 @@
|
||||
|
||||
/// Initialise table.
|
||||
$table = new html_table();
|
||||
$table->colclasses = array('leftalign', 'leftalign', 'leftalign', 'leftalign');
|
||||
$table->id = 'roles';
|
||||
$table->attributes['class'] = 'admintable generaltable';
|
||||
$table->tablealign = 'center';
|
||||
$table->align = array('left', 'left', 'left', 'left');
|
||||
$table->wrap = array('nowrap', '', 'nowrap','nowrap');
|
||||
$table->width = '90%';
|
||||
$table->head = array(
|
||||
get_string('role') . ' ' . $OUTPUT->help_icon('roles', 'role'),
|
||||
get_string('description'),
|
||||
@@ -212,7 +214,7 @@
|
||||
/// Basic data.
|
||||
$row = array(
|
||||
'<a href="' . $defineurl . '?action=view&roleid=' . $role->id . '">' . $role->localname . '</a>',
|
||||
role_get_description($role),
|
||||
format_text($role->description, FORMAT_HTML),
|
||||
s($role->shortname),
|
||||
'',
|
||||
);
|
||||
|
||||
@@ -33,6 +33,7 @@ $toprow[] = new tabobject('manage', new moodle_url('/admin/roles/manage.php'), g
|
||||
$toprow[] = new tabobject('assign', new moodle_url('/admin/roles/allow.php', array('mode'=>'assign')), get_string('allowassign', 'role'));
|
||||
$toprow[] = new tabobject('override', new moodle_url('/admin/roles/allow.php', array('mode'=>'override')), get_string('allowoverride', 'role'));
|
||||
$toprow[] = new tabobject('switch', new moodle_url('/admin/roles/allow.php', array('mode'=>'switch')), get_string('allowswitch', 'role'));
|
||||
$tabs = array($toprow);
|
||||
|
||||
echo $OUTPUT->tabtree($toprow, $currenttab);
|
||||
print_tabs($tabs, $currenttab);
|
||||
|
||||
|
||||
+17
-15
@@ -36,9 +36,9 @@ $courseid = required_param('courseid', PARAM_INT);
|
||||
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
|
||||
|
||||
$usercontext = context_user::instance($user->id);
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$systemcontext = context_system::instance();
|
||||
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$baseurl = new moodle_url('/admin/roles/usersroles.php', array('userid'=>$userid, 'courseid'=>$courseid));
|
||||
|
||||
@@ -68,11 +68,14 @@ if ($course->id != $SITE->id || $userid != $USER->id) {
|
||||
/// Now get the role assignments for this user.
|
||||
$sql = "SELECT
|
||||
ra.id, ra.userid, ra.contextid, ra.roleid, ra.component, ra.itemid,
|
||||
c.path
|
||||
c.path,
|
||||
r.name AS rolename,
|
||||
COALESCE(rn.name, r.name) AS localname
|
||||
FROM
|
||||
{role_assignments} ra
|
||||
JOIN {context} c ON ra.contextid = c.id
|
||||
JOIN {role} r ON ra.roleid = r.id
|
||||
LEFT JOIN {role_names} rn ON rn.roleid = ra.roleid AND rn.contextid = ra.contextid
|
||||
WHERE
|
||||
ra.userid = ?
|
||||
"./*AND ra.active = 1*/"
|
||||
@@ -80,8 +83,6 @@ $sql = "SELECT
|
||||
contextlevel DESC, contextid ASC, r.sortorder ASC";
|
||||
$roleassignments = $DB->get_records_sql($sql, array($user->id));
|
||||
|
||||
$allroles = role_fix_names(get_all_roles());
|
||||
|
||||
/// In order to display a nice tree of contexts, we need to get all the
|
||||
/// ancestors of all the contexts in the query we just did.
|
||||
$requiredcontexts = array();
|
||||
@@ -141,14 +142,14 @@ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
|
||||
if (!$roleassignments) {
|
||||
echo '<p>', get_string('noroleassignments', 'role'), '</p>';
|
||||
} else {
|
||||
print_report_tree($systemcontext->id, $contexts, $systemcontext, $fullname, $allroles);
|
||||
print_report_tree($systemcontext->id, $contexts, $systemcontext, $fullname);
|
||||
}
|
||||
|
||||
/// End of page.
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $allroles) {
|
||||
function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// Only compute lang strings, etc once.
|
||||
@@ -165,18 +166,19 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
$context = context::instance_by_id($contextid);
|
||||
|
||||
// Print the context name.
|
||||
echo $OUTPUT->heading(html_writer::link($context->get_url(), $context->get_context_name()),
|
||||
4, 'contextname');
|
||||
echo $OUTPUT->heading($context->get_context_name(), 4, 'contextname');
|
||||
|
||||
// If there are any role assignments here, print them.
|
||||
foreach ($contexts[$contextid]->roleassignments as $ra) {
|
||||
$role = $allroles[$ra->roleid];
|
||||
|
||||
$value = $ra->contextid . ',' . $ra->roleid;
|
||||
$inputid = 'unassign' . $value;
|
||||
|
||||
echo '<p>';
|
||||
echo $role->localname;
|
||||
if ($ra->rolename == $ra->localname) {
|
||||
echo strip_tags(format_string($ra->localname));
|
||||
} else {
|
||||
echo strip_tags(format_string($ra->localname . ' (' . $ra->rolename . ')'));
|
||||
}
|
||||
if (has_capability('moodle/role:assign', $context)) {
|
||||
$raurl = $assignurl . '?contextid=' . $ra->contextid . '&roleid=' .
|
||||
$ra->roleid . '&removeselect[]=' . $ra->userid;
|
||||
@@ -187,7 +189,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->fullname = $fullname;
|
||||
$a->contextlevel = $context->get_level_name();
|
||||
$a->contextlevel = get_contextlevel_name($context->contextlevel);
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM) {
|
||||
$strgoto = get_string('gotoassignsystemroles', 'role');
|
||||
$strcheck = get_string('checksystempermissionsfor', 'role', $a);
|
||||
@@ -208,7 +210,7 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
|
||||
echo '<ul>';
|
||||
foreach ($contexts[$contextid]->children as $childcontextid) {
|
||||
echo '<li>';
|
||||
print_report_tree($childcontextid, $contexts, $systemcontext, $fullname, $allroles);
|
||||
print_report_tree($childcontextid, $contexts, $systemcontext, $fullname);
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
|
||||
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
|
||||
|
||||
|
||||
+5
-9
@@ -9,7 +9,7 @@ $adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
/// no guest autologin
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
$PAGE->set_url('/admin/settings.php', array('section' => $section));
|
||||
$PAGE->set_pagetype('admin-setting-' . $section);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
@@ -32,6 +32,7 @@ if (!($settingspage->check_access())) {
|
||||
|
||||
$statusmsg = '';
|
||||
$errormsg = '';
|
||||
$focus = '';
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
@@ -46,6 +47,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
$focus = $firsterror->id;
|
||||
}
|
||||
$adminroot = admin_get_root(true); //reload tree
|
||||
$settingspage = $adminroot->locate($section, true);
|
||||
@@ -131,12 +133,6 @@ if (empty($SITE->fullname)) {
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$PAGE->requires->yui_module('moodle-core-formchangechecker',
|
||||
'M.core_formchangechecker.init',
|
||||
array(array(
|
||||
'formid' => 'adminsettings'
|
||||
))
|
||||
);
|
||||
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
|
||||
+83
-155
@@ -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,193 +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));
|
||||
|
||||
// Calendar custom export settings.
|
||||
$days = array(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),
|
||||
5 => new lang_string('numdays', '', 5));
|
||||
$temp->add(new admin_setting_configcheckbox('calendar_customexport', new lang_string('configcalendarcustomexport', 'admin'), new lang_string('helpcalendarcustomexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('calendar_exportlookahead', new lang_string('configexportlookahead','admin'), new lang_string('helpexportlookahead', 'admin'), 365, $days));
|
||||
$temp->add(new admin_setting_configselect('calendar_exportlookback', new lang_string('configexportlookback','admin'), new lang_string('helpexportlookback', 'admin'), 5, $days));
|
||||
$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_configcheckbox('calendar_showicalsource', new lang_string('configshowicalsource', 'admin'), new lang_string('helpshowicalsource','admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,$options));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60)));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// blog
|
||||
$temp = new admin_settingpage('blog', new lang_string('blog','blog'), 'moodle/site:config', empty($CFG->enableblogs));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => new lang_string('personalblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => new lang_string('numhours', '', 12),
|
||||
86400 => new lang_string('numhours', '', 24),
|
||||
172800 => new lang_string('numdays', '', 2),
|
||||
604800 => new lang_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
|
||||
$temp = new admin_settingpage('blog', get_string('blog','blog'));
|
||||
$temp->add(new admin_setting_configcheckbox('useblogassociations', get_string('useblogassociations', 'blog'), get_string('configuseblogassociations','blog'), 1));
|
||||
$temp->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'), get_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => get_string('worldblogs','blog'),
|
||||
BLOG_SITE_LEVEL => get_string('siteblogs','blog'),
|
||||
BLOG_USER_LEVEL => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
$temp->add(new admin_setting_configcheckbox('useexternalblogs', get_string('useexternalblogs', 'blog'), get_string('configuseexternalblogs','blog'), 1));
|
||||
$temp->add(new admin_setting_configselect('externalblogcrontime', get_string('externalblogcrontime', 'blog'), get_string('configexternalblogcrontime', 'blog'), 86400,
|
||||
array(43200 => get_string('numhours', '', 12),
|
||||
86400 => get_string('numhours', '', 24),
|
||||
172800 => get_string('numdays', '', 2),
|
||||
604800 => get_string('numdays', '', 7))));
|
||||
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogusecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('blogshowcommentscount', get_string('showcommentscount', 'admin'), get_string('configshowcommentscount', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// Navigation settings
|
||||
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
|
||||
$temp = new admin_settingpage('navigation', get_string('navigation'));
|
||||
$choices = array(
|
||||
HOMEPAGE_SITE => new lang_string('site'),
|
||||
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
|
||||
HOMEPAGE_SITE => get_string('site'),
|
||||
HOMEPAGE_MY => get_string('mymoodle', 'admin'),
|
||||
HOMEPAGE_USER => get_string('userpreference', 'admin')
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('allowguestmymoodle', new lang_string('allowguestmymoodle', 'admin'), new lang_string('configallowguestmymoodle', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfullcoursenames', new lang_string('navshowfullcoursenames', 'admin'), new lang_string('navshowfullcoursenames_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
|
||||
$sortoptions = array(
|
||||
'sortorder' => new lang_string('sort_sortorder', 'admin'),
|
||||
'fullname' => new lang_string('sort_fullname', 'admin'),
|
||||
'shortname' => new lang_string('sort_shortname', 'admin'),
|
||||
'idnumber' => new lang_string('sort_idnumber', 'admin'),
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('navsortmycoursessort', new lang_string('navsortmycoursessort', 'admin'), new lang_string('navsortmycoursessort_help', 'admin'), 'sortorder', $sortoptions));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('defaulthomepage', get_string('defaulthomepage', 'admin'), get_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',get_string('navcourselimit','admin'),get_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('navlinkcoursesections', get_string('navlinkcoursesections', 'admin'), get_string('navlinkcoursesections_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', get_string('usesitenameforsitepages', 'admin'), get_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', get_string('navadduserpostslinks', 'admin'), get_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// "htmlsettings" settingpage
|
||||
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
|
||||
$temp->add(new admin_setting_emoticons());
|
||||
$ADMIN->add('appearance', $temp);
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
|
||||
$ADMIN->add('appearance', new admin_externalpage('resetemoticons', get_string('emoticonsreset', 'admin'),
|
||||
new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
|
||||
|
||||
|
||||
// The "media" subpage.
|
||||
$temp = new admin_settingpage('mediasettings', get_string('mediasettings', 'core_media'));
|
||||
|
||||
$temp->add(new admin_setting_heading('mediaformats', get_string('mediaformats', 'core_media'),
|
||||
format_text(get_string('mediaformats_desc', 'core_media'), FORMAT_MARKDOWN)));
|
||||
|
||||
// External services.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_youtube',
|
||||
get_string('siteyoutube', 'core_media'), get_string('siteyoutube_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_vimeo',
|
||||
get_string('sitevimeo', 'core_media'), get_string('sitevimeo_desc', 'core_media'), 0));
|
||||
|
||||
// Options which require Flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_mp3',
|
||||
get_string('mp3audio', 'core_media'), get_string('mp3audio_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_flv',
|
||||
get_string('flashvideo', 'core_media'), get_string('flashvideo_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_swf',
|
||||
get_string('flashanimation', 'core_media'), get_string('flashanimation_desc', 'core_media'), 1));
|
||||
|
||||
// HTML 5 media.
|
||||
// Audio now enabled by default so that it can provide a fallback for mp3 on devices without flash.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5audio',
|
||||
get_string('html5audio', 'core_media'), get_string('html5audio_desc', 'core_media'), 1));
|
||||
// Video now enabled by default so it can provide mp4 support.
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_html5video',
|
||||
get_string('html5video', 'core_media'), get_string('html5video_desc', 'core_media'), 1));
|
||||
|
||||
// Legacy players.
|
||||
$temp->add(new admin_setting_heading('legacymediaformats',
|
||||
get_string('legacyheading', 'core_media'), get_string('legacyheading_desc', 'core_media')));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_qt',
|
||||
get_string('legacyquicktime', 'core_media'), get_string('legacyquicktime_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_wmp',
|
||||
get_string('legacywmp', 'core_media'), get_string('legacywmp_desc', 'core_media'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('core_media_enable_rm',
|
||||
get_string('legacyreal', 'core_media'), get_string('legacyreal_desc', 'core_media'), 1));
|
||||
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
|
||||
// "documentation" settingpage
|
||||
$temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
|
||||
$temp = new admin_settingpage('documentation', get_string('moodledocs'));
|
||||
$temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
|
||||
$temp->add(new admin_setting_configcheckbox('doctonewwindow', get_string('doctonewwindow', 'admin'), get_string('configdoctonewwindow', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$temp = new admin_externalpage('mypage', get_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$temp = new admin_externalpage('profilepage', get_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
|
||||
$temp = new admin_settingpage('coursecontact', new lang_string('courses'));
|
||||
$temp = new admin_settingpage('coursecontact', get_string('courses'));
|
||||
$temp->add(new admin_setting_special_coursecontact());
|
||||
$temp->add(new admin_setting_configcheckbox('courselistshortnames',
|
||||
new lang_string('courselistshortnames', 'admin'),
|
||||
new lang_string('courselistshortnames_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', new lang_string('coursesperpage', 'admin'), new lang_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('courseswithsummarieslimit', new lang_string('courseswithsummarieslimit', 'admin'), new lang_string('configcourseswithsummarieslimit', 'admin'), 10, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('courseoverviewfileslimit', new lang_string('courseoverviewfileslimit'),
|
||||
new lang_string('configcourseoverviewfileslimit', 'admin'), 1, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('courseoverviewfilesext', new lang_string('courseoverviewfilesext'),
|
||||
new lang_string('configcourseoverviewfilesext', 'admin'), '.jpg,.gif,.png'));
|
||||
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
|
||||
|
||||
@@ -1,94 +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 defines settingpages and externalpages under the "badges" section
|
||||
*
|
||||
* @package core
|
||||
* @subpackage badges
|
||||
* @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @author Yuliya Bozhko <yuliya.bozhko@totaralms.com>
|
||||
*/
|
||||
|
||||
global $SITE;
|
||||
|
||||
if (($hassiteconfig || has_any_capability(array(
|
||||
'moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:manageglobalsettings',
|
||||
'moodle/badges:awardbadge',
|
||||
'moodle/badges:configurecriteria',
|
||||
'moodle/badges:configuremessages',
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'), $systemcontext))) {
|
||||
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
|
||||
$globalsettings = new admin_settingpage('badgesettings', new lang_string('badgesettings', 'badges'),
|
||||
array('moodle/badges:manageglobalsettings'), empty($CFG->enablebadges));
|
||||
|
||||
$globalsettings->add(new admin_setting_configtext('badges_defaultissuername',
|
||||
new lang_string('defaultissuername', 'badges'),
|
||||
new lang_string('defaultissuername_desc', 'badges'),
|
||||
$SITE->fullname ? $SITE->fullname : $SITE->shortname, PARAM_TEXT));
|
||||
|
||||
$globalsettings->add(new admin_setting_configtext('badges_defaultissuercontact',
|
||||
new lang_string('defaultissuercontact', 'badges'),
|
||||
new lang_string('defaultissuercontact_desc', 'badges'),
|
||||
get_config('moodle','supportemail'), PARAM_EMAIL));
|
||||
|
||||
$globalsettings->add(new admin_setting_configtext('badges_badgesalt',
|
||||
new lang_string('badgesalt', 'badges'),
|
||||
new lang_string('badgesalt_desc', 'badges'),
|
||||
'badges' . $SITE->timecreated, PARAM_ALPHANUM));
|
||||
|
||||
$globalsettings->add(new admin_setting_configcheckbox('badges_allowexternalbackpack',
|
||||
new lang_string('allowexternalbackpack', 'badges'),
|
||||
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
|
||||
|
||||
$globalsettings->add(new admin_setting_configcheckbox('badges_allowcoursebadges',
|
||||
new lang_string('allowcoursebadges', 'badges'),
|
||||
new lang_string('allowcoursebadges_desc', 'badges'), 1));
|
||||
|
||||
$ADMIN->add('badges', $globalsettings);
|
||||
|
||||
$ADMIN->add('badges',
|
||||
new admin_externalpage('managebadges',
|
||||
new lang_string('managebadges', 'badges'),
|
||||
new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)),
|
||||
array(
|
||||
'moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:awardbadge',
|
||||
'moodle/badges:configurecriteria',
|
||||
'moodle/badges:configuremessages',
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'
|
||||
),
|
||||
empty($CFG->enablebadges)
|
||||
)
|
||||
);
|
||||
|
||||
$ADMIN->add('badges',
|
||||
new admin_externalpage('newbadge',
|
||||
new lang_string('newbadge', 'badges'),
|
||||
new moodle_url('/badges/newbadge.php', array('type' => BADGE_TYPE_SITE)),
|
||||
array('moodle/badges:createbadge'), empty($CFG->enablebadges)
|
||||
)
|
||||
);
|
||||
}
|
||||
+111
-173
@@ -8,188 +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/manage.php',
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
|
||||
array('moodle/category:manage', 'moodle/course:create')));
|
||||
|
||||
// Course Default Settings Page.
|
||||
// NOTE: these settings must be applied after all other settings because they depend on them.
|
||||
|
||||
|
||||
// Main course settings.
|
||||
$temp = new admin_settingpage('coursesettings', new lang_string('coursesettings'));
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hide');
|
||||
$choices['1'] = new lang_string('show');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), new lang_string('visible_help'),
|
||||
1, $choices));
|
||||
|
||||
|
||||
// Course format.
|
||||
$temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), ''));
|
||||
|
||||
$courseformats = get_sorted_course_formats(true);
|
||||
/// 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', get_string('coursesettings'));
|
||||
$courseformats = get_plugin_list('format');
|
||||
$formcourseformats = array();
|
||||
foreach ($courseformats as $courseformat) {
|
||||
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
||||
foreach ($courseformats as $courseformat => $courseformatdir) {
|
||||
$formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat");
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
|
||||
'weeks',$formcourseformats));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', get_string('format'), get_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
|
||||
new lang_string('maxnumberweeks_desc'), 52));
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', get_string('maxnumberweeks'), get_string('maxnumberweeks_desc'), 52));
|
||||
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
|
||||
new lang_string('coursehelpnumberweeks'), 10));
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', get_string('numberweeks'), get_string('coursehelpnumberweeks'), 10));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
||||
$choices['1'] = new lang_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'),
|
||||
new lang_string('coursehelphiddensections'), 0, $choices));
|
||||
|
||||
$choices = 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));
|
||||
|
||||
|
||||
// Appearance.
|
||||
$temp->add(new admin_setting_heading('appearancehdr', new lang_string('appearance'), ''));
|
||||
|
||||
$languages = array();
|
||||
$languages[''] = new lang_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));
|
||||
|
||||
$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'))));
|
||||
|
||||
|
||||
// Files and uploads.
|
||||
$temp->add(new admin_setting_heading('filesanduploadshdr', new lang_string('filesanduploads'), ''));
|
||||
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', 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));
|
||||
}
|
||||
|
||||
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
||||
if (isset($CFG->maxbytes)) {
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
|
||||
} else {
|
||||
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'),
|
||||
new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
|
||||
// Completion tracking.
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('completion','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion', 'completion'),
|
||||
new lang_string('enablecompletion_help', 'completion'), 0, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
|
||||
|
||||
// Groups.
|
||||
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
||||
$temp->add(new admin_setting_heading('groups', get_string('groups', 'group'), ''));
|
||||
$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[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('availability', get_string('availability'), ''));
|
||||
$choices = array();
|
||||
$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('language', get_string('language'), ''));
|
||||
$languages=array();
|
||||
$languages[''] = get_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', get_string('forcelanguage'), '',key($languages),$languages));
|
||||
|
||||
$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', get_string('completionstartonenrol','completion'), get_string('completionstartonenrolhelp', 'completion'), 0));
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
|
||||
// "courserequests" settingpage.
|
||||
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', new lang_string('enablecourserequests', 'admin'), new lang_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', new lang_string('defaultrequestcategory', 'admin'), new lang_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('requestcategoryselection', new lang_string('requestcategoryselection', 'admin'), new lang_string('configrequestcategoryselection', 'admin'), 0));
|
||||
$temp->add(new admin_setting_users_with_capability('courserequestnotify', new lang_string('courserequestnotify', 'admin'), new lang_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
|
||||
/// "courserequests" settingpage
|
||||
$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_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
|
||||
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_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)));
|
||||
$ADMIN->add('backups', $temp);
|
||||
|
||||
// Create a page for general import configuration and defaults.
|
||||
$temp = new admin_settingpage('importgeneralsettings', new lang_string('importgeneralsettings', 'backup'), 'moodle/backup:backupcourse');
|
||||
$temp->add(new admin_setting_configtext('backup/import_general_maxresults', new lang_string('importgeneralmaxresults', 'backup'), new lang_string('importgeneralmaxresults_desc', 'backup'), 10));
|
||||
$temp->add(new admin_setting_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',
|
||||
@@ -202,44 +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_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
|
||||
$temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
|
||||
0 => new lang_string('never'),
|
||||
1 => new lang_string('numdays', '', 1),
|
||||
2 => new lang_string('numdays', '', 2),
|
||||
3 => new lang_string('numdays', '', 3),
|
||||
5 => new lang_string('numdays', '', 5),
|
||||
7 => new lang_string('numdays', '', 7),
|
||||
10 => new lang_string('numdays', '', 10),
|
||||
14 => new lang_string('numdays', '', 14),
|
||||
20 => new lang_string('numdays', '', 20),
|
||||
30 => new lang_string('numdays', '', 30),
|
||||
60 => new lang_string('numdays', '', 60),
|
||||
90 => new lang_string('numdays', '', 90),
|
||||
120 => new lang_string('numdays', '', 120),
|
||||
180 => new lang_string('numdays', '', 180),
|
||||
365 => new lang_string('numdays', '', 365)
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));
|
||||
$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_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','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,70 +5,61 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// Experimental settings page
|
||||
$ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
|
||||
$ADMIN->add('development', new admin_category('experimental', get_string('experimental','admin')));
|
||||
|
||||
$temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
|
||||
$temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
|
||||
//TODO: Re-enable cc-import once re-implemented in 2.0.x
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
|
||||
// The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
|
||||
$enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0);
|
||||
$enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
|
||||
$temp->add($enablecssoptimiser);
|
||||
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', get_string('enablesafebrowserintegration', 'admin'), get_string('configenablesafebrowserintegration', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', get_string('enablegroupmembersonly', 'admin'), get_string('configenablegroupmembersonly', 'admin'), 0));
|
||||
|
||||
$ADMIN->add('experimental', $temp);
|
||||
|
||||
// "debugging" settingpage
|
||||
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
|
||||
$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
|
||||
$temp->add(new admin_setting_special_debug());
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
|
||||
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7'));
|
||||
$temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('debugstringids_desc', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugvalidators', get_string('debugvalidators', 'admin'), get_string('configdebugvalidators', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('debugpageinfo', get_string('debugpageinfo', 'admin'), get_string('configdebugpageinfo', 'admin'), 0));
|
||||
$ADMIN->add('development', $temp);
|
||||
|
||||
// "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
|
||||
if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
|
||||
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
|
||||
$temp = new admin_settingpage('profiling', get_string('profiling', 'admin'));
|
||||
// Main profiling switch
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingenabled', get_string('profilingenabled', 'admin'), get_string('profilingenabled_help', 'admin'), false));
|
||||
// List of URLs that will be automatically profiled
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingincluded', get_string('profilingincluded', 'admin'), get_string('profilingincluded_help', 'admin'), ''));
|
||||
// List of URLs that won't be profiled ever
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configtextarea('profilingexcluded', get_string('profilingexcluded', 'admin'), get_string('profilingexcluded_help', 'admin'), ''));
|
||||
// Allow random profiling each XX requests
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('profilingautofrec', get_string('profilingautofrec', 'admin'), get_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
|
||||
// Allow PROFILEME/DONTPROFILEME GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowme', get_string('profilingallowme', 'admin'), get_string('profilingallowme_help', 'admin'), false));
|
||||
// Allow PROFILEALL/PROFILEALLSTOP GPC
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
|
||||
$temp->add(new admin_setting_configcheckbox('profilingallowall', get_string('profilingallowall', 'admin'), get_string('profilingallowall_help', 'admin'), false));
|
||||
// TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
|
||||
// TODO: Allow to skip call_user functions (ignored_functions array)
|
||||
// Specify the life time (in minutes) of profiling runs
|
||||
$temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
|
||||
0 => new lang_string('neverdeleteruns', 'admin'),
|
||||
30*24*60 => new lang_string('numdays', '', 30),
|
||||
15*24*60 => new lang_string('numdays', '', 15),
|
||||
7*24*60 => new lang_string('numdays', '', 7),
|
||||
4*24*60 => new lang_string('numdays', '', 4),
|
||||
2*24*60 => new lang_string('numdays', '', 2),
|
||||
24*60 => new lang_string('numhours', '', 24),
|
||||
16*80 => new lang_string('numhours', '', 16),
|
||||
8*60 => new lang_string('numhours', '', 8),
|
||||
4*60 => new lang_string('numhours', '', 4),
|
||||
2*60 => new lang_string('numhours', '', 2),
|
||||
60 => new lang_string('numminutes', '', 60),
|
||||
30 => new lang_string('numminutes', '', 30),
|
||||
15 => new lang_string('numminutes', '', 15))));
|
||||
// Define the prefix to be added to imported profiling runs.
|
||||
$temp->add(new admin_setting_configtext('profilingimportprefix',
|
||||
new lang_string('profilingimportprefix', 'admin'),
|
||||
new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
|
||||
$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);
|
||||
@@ -76,12 +67,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
|
||||
// Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('testclient', get_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
|
||||
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('mnettestclient', get_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
|
||||
}
|
||||
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
$ADMIN->add('development', new admin_externalpage('purgecaches', get_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
|
||||
} // end of speedup
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// This file defines everything related to frontpage
|
||||
|
||||
if (!during_initial_install()) { //do not use during installation
|
||||
$frontpagecontext = context_course::instance(SITEID);
|
||||
$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
|
||||
|
||||
if ($hassiteconfig or has_any_capability(array(
|
||||
'moodle/course:update',
|
||||
@@ -20,24 +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'), 2, $options));
|
||||
$temp->add(new admin_setting_configselect('maxcategorydepth', get_string('configsitemaxcategorydepth','admin'), get_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
|
||||
|
||||
$temp->add(new admin_setting_configtext('frontpagecourselimit', new lang_string('configfrontpagecourselimit','admin'), new lang_string('configfrontpagecourselimithelp','admin'), 200, PARAM_INT));
|
||||
|
||||
$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',
|
||||
@@ -49,15 +47,16 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10')));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', new lang_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('commentsperpage', get_string('commentsperpage', 'admin'), '', 15, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
|
||||
|
||||
// front page default role
|
||||
$options = array(0=>new lang_string('none')); // roles to choose from
|
||||
$options = array(0=>get_string('none')); // roles to choose from
|
||||
$defaultfrontpageroleid = 0;
|
||||
$roles = role_fix_names(get_all_roles(), null, ROLENAME_ORIGINALANDSHORT);
|
||||
foreach ($roles as $role) {
|
||||
foreach (get_all_roles() as $role) {
|
||||
if (empty($role->archetype) or $role->archetype === 'guest' or $role->archetype === 'frontpage' or $role->archetype === 'student') {
|
||||
$options[$role->id] = $role->localname;
|
||||
$options[$role->id] = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
|
||||
if ($role->archetype === 'frontpage') {
|
||||
$defaultfrontpageroleid = $role->id;
|
||||
}
|
||||
@@ -67,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',
|
||||
@@ -88,10 +87,10 @@ if (!during_initial_install()) { //do not use during installation
|
||||
'moodle/question:viewall',
|
||||
'moodle/question:movemine',
|
||||
'moodle/question:moveall');
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', new lang_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('frontpagequestions', get_string('frontpagequestions', 'admin'), $CFG->wwwroot.'/question/edit.php?courseid='.SITEID, $questioncapabilities, false, $frontpagecontext));
|
||||
|
||||
if (!empty($SITE->legacyfiles) and $SITE->legacyfiles === 2) {
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', new lang_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
$ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitelegacyfiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+84
-90
@@ -6,21 +6,21 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
or has_capability('moodle/grade:manageletters', $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
require_once $CFG->libdir.'/grade/constants.php';
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => new lang_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => new lang_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => new lang_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => new lang_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => new lang_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => new lang_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => new lang_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => new lang_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => new lang_string('percentagereal', 'grades')
|
||||
$display_types = array(GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'),
|
||||
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades')
|
||||
);
|
||||
asort($display_types);
|
||||
|
||||
// General settings
|
||||
|
||||
$temp = new admin_settingpage('gradessettings', new lang_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradessettings', get_string('generalsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
|
||||
// new CFG variable for gradebook (what roles to display)
|
||||
@@ -30,39 +30,33 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
$temp->add(new admin_setting_grade_profilereport());
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', new lang_string('aggregationposition', 'grades'),
|
||||
new lang_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => new lang_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => new lang_string('positionlast', 'grades'))));
|
||||
$temp->add(new admin_setting_configselect('grade_aggregationposition', get_string('aggregationposition', 'grades'),
|
||||
get_string('aggregationposition_help', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST,
|
||||
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'),
|
||||
GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', new lang_string('includescalesinaggregation', 'grades'), new lang_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', get_string('includescalesinaggregation', 'grades'), get_string('includescalesinaggregation_help', 'grades'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', new lang_string('hiddenasdate', 'grades'), new lang_string('hiddenasdate_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('hiddenasdate_help', 'grades'), 0));
|
||||
|
||||
// enable publishing in exports/imports
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', new lang_string('gradepublishing', 'grades'), new lang_string('gradepublishing_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('gradepublishing_help', 'grades'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', new lang_string('gradeexportdisplaytype', 'grades'),
|
||||
new lang_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_export_displaytype', get_string('gradeexportdisplaytype', 'grades'),
|
||||
get_string('gradeexportdisplaytype_desc', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', new lang_string('gradeexportdecimalpoints', 'grades'),
|
||||
new lang_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_export_decimalpoints', get_string('gradeexportdecimalpoints', 'grades'),
|
||||
get_string('gradeexportdecimalpoints_desc', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', new lang_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => new lang_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => new lang_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => new lang_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_userprofilefields', new lang_string('gradeexportuserprofilefields', 'grades'), new lang_string('gradeexportuserprofilefields_desc', 'grades'), 'firstname,lastname,idnumber,institution,department,email', PARAM_TEXT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('grade_export_customprofilefields', new lang_string('gradeexportcustomprofilefields', 'grades'), new lang_string('gradeexportcustomprofilefields_desc', 'grades'), '', PARAM_TEXT));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('recovergradesdefault', new lang_string('recovergradesdefault', 'grades'), new lang_string('recovergradesdefault_help', 'grades'), 0));
|
||||
$temp->add(new admin_setting_configselect('grade_navmethod', get_string('navmethod', 'grades'), null, 0,
|
||||
array(GRADE_NAVMETHOD_DROPDOWN => get_string('dropdown', 'grades'),
|
||||
GRADE_NAVMETHOD_TABS => get_string('tabs', 'grades'),
|
||||
GRADE_NAVMETHOD_COMBO => get_string('combo', 'grades'))));
|
||||
|
||||
$temp->add(new admin_setting_special_gradeexport());
|
||||
|
||||
@@ -71,68 +65,68 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
/// Grade category settings
|
||||
$temp = new admin_settingpage('gradecategorysettings', new lang_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', new lang_string('hideforcedsettings', 'grades'), new lang_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
$temp->add(new admin_setting_configcheckbox('grade_hideforcedsettings', get_string('hideforcedsettings', 'grades'), get_string('hideforcedsettings_help', 'grades'), '1'));
|
||||
|
||||
$strnoforce = new lang_string('noforce', 'grades');
|
||||
$strnoforce = get_string('noforce', 'grades');
|
||||
|
||||
// Aggregation type
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>new lang_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>new lang_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>new lang_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>new lang_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>new lang_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>new lang_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>new lang_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>new lang_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>new lang_string('aggregatesum', 'grades'));
|
||||
$options = array(GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN =>get_string('aggregateweightedmean', 'grades'),
|
||||
GRADE_AGGREGATE_WEIGHTED_MEAN2 =>get_string('aggregateweightedmean2', 'grades'),
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>get_string('aggregateextracreditmean', 'grades'),
|
||||
GRADE_AGGREGATE_MEDIAN =>get_string('aggregatemedian', 'grades'),
|
||||
GRADE_AGGREGATE_MIN =>get_string('aggregatemin', 'grades'),
|
||||
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
|
||||
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
|
||||
GRADE_AGGREGATE_SUM =>get_string('aggregatesum', 'grades'));
|
||||
|
||||
$defaultvisible = array(GRADE_AGGREGATE_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN2,
|
||||
GRADE_AGGREGATE_EXTRACREDIT_MEAN, GRADE_AGGREGATE_MEDIAN, GRADE_AGGREGATE_MIN,
|
||||
GRADE_AGGREGATE_MAX, GRADE_AGGREGATE_MODE, GRADE_AGGREGATE_SUM);
|
||||
|
||||
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', new lang_string('aggregation', 'grades'), new lang_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregation_help', 'grades'), $defaults, $options));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', new lang_string('aggregationsvisible', 'grades'),
|
||||
new lang_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', get_string('aggregationsvisible', 'grades'),
|
||||
get_string('aggregationsvisiblehelp', 'grades'), $defaultvisible, $options));
|
||||
|
||||
$options = array(0 => new lang_string('no'), 1 => new lang_string('yes'));
|
||||
$options = array(0 => get_string('no'), 1 => get_string('yes'));
|
||||
|
||||
$defaults = array('value'=>1, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', new lang_string('aggregateonlygraded', 'grades'),
|
||||
new lang_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
|
||||
get_string('aggregateonlygraded_help', 'grades'), $defaults, $options));
|
||||
$defaults = array('value'=>0, 'forced'=>false, 'adv'=>true);
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', new lang_string('aggregateoutcomes', 'grades'),
|
||||
new lang_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', new lang_string('aggregatesubcats', 'grades'),
|
||||
new lang_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
|
||||
get_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'),
|
||||
get_string('aggregatesubcats_help', 'grades'), $defaults, $options));
|
||||
|
||||
$options = array(0 => new lang_string('none'));
|
||||
$options = array(0 => get_string('none'));
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
|
||||
$defaults['value'] = 0;
|
||||
$defaults['forced'] = true;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', new lang_string('keephigh', 'grades'),
|
||||
new lang_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_keephigh', get_string('keephigh', 'grades'),
|
||||
get_string('keephigh_help', 'grades'), $defaults, $options));
|
||||
$defaults['forced'] = false;
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', new lang_string('droplow', 'grades'),
|
||||
new lang_string('droplow_help', 'grades'), $defaults, $options));
|
||||
$temp->add(new admin_setting_gradecat_combo('grade_droplow', get_string('droplow', 'grades'),
|
||||
get_string('droplow_help', 'grades'), $defaults, $options));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Grade item settings
|
||||
$temp = new admin_settingpage('gradeitemsettings', new lang_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
$temp = new admin_settingpage('gradeitemsettings', get_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
|
||||
if ($ADMIN->fulltree) {
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', new lang_string('gradedisplaytype', 'grades'),
|
||||
new lang_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
$temp->add(new admin_setting_configselect('grade_displaytype', get_string('gradedisplaytype', 'grades'),
|
||||
get_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types));
|
||||
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', new lang_string('decimalpoints', 'grades'),
|
||||
new lang_string('decimalpoints_help', 'grades'), 2,
|
||||
$temp->add(new admin_setting_configselect('grade_decimalpoints', get_string('decimalpoints', 'grades'),
|
||||
get_string('decimalpoints_help', 'grades'), 2,
|
||||
array( '0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
@@ -140,48 +134,48 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
'4' => '4',
|
||||
'5' => '5')));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', new lang_string('gradeitemadvanced', 'grades'), new lang_string('gradeitemadvanced_help', 'grades'),
|
||||
$temp->add(new admin_setting_configmultiselect('grade_item_advanced', get_string('gradeitemadvanced', 'grades'), get_string('gradeitemadvanced_help', 'grades'),
|
||||
array('iteminfo', 'idnumber', 'gradepass', 'plusfactor', 'multfactor', 'display', 'decimals', 'hiddenuntil', 'locktime'),
|
||||
array('iteminfo' => new lang_string('iteminfo', 'grades'),
|
||||
'idnumber' => new lang_string('idnumbermod'),
|
||||
'gradetype' => new lang_string('gradetype', 'grades'),
|
||||
'scaleid' => new lang_string('scale'),
|
||||
'grademin' => new lang_string('grademin', 'grades'),
|
||||
'grademax' => new lang_string('grademax', 'grades'),
|
||||
'gradepass' => new lang_string('gradepass', 'grades'),
|
||||
'plusfactor' => new lang_string('plusfactor', 'grades'),
|
||||
'multfactor' => new lang_string('multfactor', 'grades'),
|
||||
'display' => new lang_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => new lang_string('decimalpoints', 'grades'),
|
||||
'hidden' => new lang_string('hidden', 'grades'),
|
||||
'hiddenuntil' => new lang_string('hiddenuntil', 'grades'),
|
||||
'locked' => new lang_string('locked', 'grades'),
|
||||
'locktime' => new lang_string('locktime', 'grades'),
|
||||
'aggregationcoef' => new lang_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => new lang_string('parentcategory', 'grades'))));
|
||||
array('iteminfo' => get_string('iteminfo', 'grades'),
|
||||
'idnumber' => get_string('idnumbermod'),
|
||||
'gradetype' => get_string('gradetype', 'grades'),
|
||||
'scaleid' => get_string('scale'),
|
||||
'grademin' => get_string('grademin', 'grades'),
|
||||
'grademax' => get_string('grademax', 'grades'),
|
||||
'gradepass' => get_string('gradepass', 'grades'),
|
||||
'plusfactor' => get_string('plusfactor', 'grades'),
|
||||
'multfactor' => get_string('multfactor', 'grades'),
|
||||
'display' => get_string('gradedisplaytype', 'grades'),
|
||||
'decimals' => get_string('decimalpoints', 'grades'),
|
||||
'hidden' => get_string('hidden', 'grades'),
|
||||
'hiddenuntil' => get_string('hiddenuntil', 'grades'),
|
||||
'locked' => get_string('locked', 'grades'),
|
||||
'locktime' => get_string('locktime', 'grades'),
|
||||
'aggregationcoef' => get_string('aggregationcoef', 'grades'),
|
||||
'parentcategory' => get_string('parentcategory', 'grades'))));
|
||||
}
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
/// Scales and outcomes
|
||||
|
||||
$scales = new admin_externalpage('scales', new lang_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $scales);
|
||||
if (!empty($CFG->enableoutcomes)) {
|
||||
$outcomes = new admin_externalpage('outcomes', new lang_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
||||
$ADMIN->add('grades', $outcomes);
|
||||
}
|
||||
$letters = new admin_externalpage('letters', new lang_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/index.php', 'moodle/grade:manageletters');
|
||||
$ADMIN->add('grades', $letters);
|
||||
|
||||
// The plugins must implement a settings.php file that adds their admin settings to the $settings object
|
||||
|
||||
// Reports
|
||||
$ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradereports', get_string('reportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, new lang_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, get_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradereports', $settings);
|
||||
@@ -190,12 +184,12 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
}
|
||||
|
||||
// Imports
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', get_string('importsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeimport') as $plugin => $plugindir) {
|
||||
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, new lang_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, get_string('pluginname', 'gradeimport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeimports', $settings);
|
||||
@@ -205,11 +199,11 @@ if (has_capability('moodle/grade:manage', $systemcontext)
|
||||
|
||||
|
||||
// Exports
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', get_string('exportsettings', 'grades')));
|
||||
foreach (get_plugin_list('gradeexport') as $plugin => $plugindir) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, new lang_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, get_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
|
||||
include($plugindir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('gradeexports', $settings);
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
if ($hassiteconfig) {
|
||||
|
||||
// "languageandlocation" settingpage
|
||||
$temp = new admin_settingpage('langsettings', new lang_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'), new lang_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'), new lang_string('configlangmenu', 'admin'), 1));
|
||||
$temp = new admin_settingpage('langsettings', get_string('languagesettings', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('autolang', get_string('autolang', 'admin'), get_string('configautolang', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configselect('lang', get_string('lang', 'admin'), get_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
||||
$temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', 'admin'), get_string('configlangmenu', 'admin'), 1));
|
||||
$temp->add(new admin_setting_langlist());
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'), new lang_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'), new lang_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'), new lang_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'), new lang_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
$temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('langcache_desc', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('langstringcache', get_string('langstringcache', 'admin'), get_string('configlangstringcache', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE));
|
||||
$temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
||||
|
||||
$ADMIN->add('language', $temp);
|
||||
|
||||
|
||||
+11
-11
@@ -3,20 +3,20 @@
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
// "locations" settingpage
|
||||
$temp = new admin_settingpage('locationsettings', new lang_string('locationsettings', 'admin'));
|
||||
$temp = new admin_settingpage('locationsettings', get_string('locationsettings', 'admin'));
|
||||
$options = get_list_of_timezones();
|
||||
$options[99] = new lang_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', new lang_string('timezone','admin'), new lang_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = new lang_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', new lang_string('forcetimezone', 'admin'), new lang_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', new lang_string('country', 'admin'), new lang_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', new lang_string('defaultcity', 'admin'), new lang_string('defaultcity_help', 'admin'), ''));
|
||||
$options[99] = get_string('serverlocaltime');
|
||||
$temp->add(new admin_setting_configselect('timezone', get_string('timezone','admin'), get_string('configtimezone', 'admin'), 99, $options));
|
||||
$options[99] = get_string('timezonenotforced', 'admin');
|
||||
$temp->add(new admin_setting_configselect('forcetimezone', get_string('forcetimezone', 'admin'), get_string('helpforcetimezone', 'admin'), 99, $options));
|
||||
$temp->add(new admin_settings_country_select('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('defaultcity', get_string('defaultcity', 'admin'), get_string('defaultcity_help', 'admin'), ''));
|
||||
|
||||
$temp->add(new admin_setting_heading('iplookup', new lang_string('iplookup', 'admin'), new lang_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', new lang_string('geoipfile', 'admin'), new lang_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey3', new lang_string('googlemapkey3', 'admin'), new lang_string('googlemapkey3_help', 'admin'), '', PARAM_RAW, 60));
|
||||
$temp->add(new admin_setting_heading('iplookup', get_string('iplookup', 'admin'), get_string('iplookupinfo', 'admin')));
|
||||
$temp->add(new admin_setting_configfile('geoipfile', get_string('geoipfile', 'admin'), get_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
|
||||
$temp->add(new admin_setting_configtext('googlemapkey', get_string('googlemapkey', 'admin'), get_string('configgooglemapkey', 'admin', $CFG->wwwroot), ''));
|
||||
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', new lang_string('allcountrycodes', 'admin'), new lang_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
$temp->add(new admin_setting_configtext('allcountrycodes', get_string('allcountrycodes', 'admin'), get_string('configallcountrycodes', 'admin'), '', '/^(?:\w+(?:,\w+)*)?$/'));
|
||||
|
||||
$ADMIN->add('location', $temp);
|
||||
|
||||
|
||||
+11
-11
@@ -4,18 +4,18 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', new lang_string('settings', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('net', get_string('settings', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/index.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', new lang_string('managemnetpeers', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetpeers', get_string('managemnetpeers', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/peers.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', new lang_string('mnetpeers', 'mnet')));
|
||||
$ADMIN->add('mnet', new admin_category('mnetpeercat', get_string('mnetpeers', 'mnet')));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
require_once($CFG->dirroot.'/mnet/lib.php');
|
||||
@@ -23,39 +23,39 @@ if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off')
|
||||
$hosts = mnet_get_hosts();
|
||||
foreach ($hosts as $host) {
|
||||
if ($host->id == $CFG->mnet_all_hosts_id) {
|
||||
$host->name = new lang_string('allhosts', 'core_mnet');
|
||||
$host->name = get_string('allhosts', 'core_mnet');
|
||||
}
|
||||
$ADMIN->add('mnetpeercat',
|
||||
new admin_externalpage(
|
||||
'mnetpeer' . $host->id,
|
||||
$host->name,
|
||||
$CFG->wwwroot . '/'.$CFG->admin.'/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
$CFG->wwwroot . '/admin/mnet/peers.php?step=update&hostid=' . $host->id,
|
||||
'moodle/site:config'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', new lang_string('ssoaccesscontrol', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', get_string('ssoaccesscontrol', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/access_control.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', new lang_string('clientname', 'mnetservice_enrol'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('mnetenrol', get_string('clientname', 'mnetservice_enrol'),
|
||||
"$CFG->wwwroot/mnet/service/enrol/index.php",
|
||||
'moodle/site:config'));
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', new lang_string('trustedhosts', 'mnet'),
|
||||
$ADMIN->add('mnet', new admin_externalpage('trustedhosts', get_string('trustedhosts', 'mnet'),
|
||||
"$CFG->wwwroot/$CFG->admin/mnet/trustedhosts.php",
|
||||
'moodle/site:config'));
|
||||
|
||||
if (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode !== 'off') {
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', new lang_string('profilefields', 'mnet'),
|
||||
$profilefields = new admin_settingpage('mnetprofilefields', get_string('profilefields', 'mnet'),
|
||||
'moodle/site:config');
|
||||
$ADMIN->add('mnet', $profilefields);
|
||||
|
||||
$fields = mnet_profile_field_options();
|
||||
$forced = implode(', ', $fields['forced']);
|
||||
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', new lang_string('profileexportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', new lang_string('profileimportfields', 'mnet'), new lang_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileexportfields', get_string('profileexportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
$profilefields->add(new admin_setting_configmultiselect('mnetprofileimportfields', get_string('profileimportfields', 'mnet'), get_string('profilefielddesc', 'mnet', $forced), $fields['legacy'], $fields['optional']));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+274
-241
@@ -5,144 +5,212 @@
|
||||
*/
|
||||
|
||||
if ($hassiteconfig) {
|
||||
require_once("$CFG->libdir/pluginlib.php");
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
|
||||
$ADMIN->add('modules', new admin_page_pluginsoverview());
|
||||
|
||||
// activity modules
|
||||
$ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
|
||||
$ADMIN->add('modules', new admin_category('modsettings', get_string('activitymodules')));
|
||||
$ADMIN->add('modsettings', new admin_page_managemods());
|
||||
foreach ($allplugins['mod'] as $module) {
|
||||
$module->load_settings($ADMIN, 'modsettings', $hassiteconfig);
|
||||
$modules = $DB->get_records('modules', array(), "name ASC");
|
||||
foreach ($modules as $module) {
|
||||
$modulename = $module->name;
|
||||
if (!file_exists("$CFG->dirroot/mod/$modulename/lib.php")) {
|
||||
continue;
|
||||
}
|
||||
$strmodulename = get_string('modulename', 'mod_'.$modulename);
|
||||
if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) {
|
||||
// do not show disabled modules in tree, keep only settings link on manage page
|
||||
$settings = new admin_settingpage('modsetting'.$modulename, $strmodulename, 'moodle/site:config', !$module->visible);
|
||||
include($CFG->dirroot.'/mod/'.$modulename.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('modsettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// hidden script for converting journals to online assignments (or something like that) linked from elsewhere
|
||||
$ADMIN->add('modsettings', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
|
||||
|
||||
// course formats
|
||||
$ADMIN->add('modules', new admin_category('formatsettings', new lang_string('courseformats')));
|
||||
$temp = new admin_settingpage('manageformats', new lang_string('manageformats', 'core_admin'));
|
||||
$temp->add(new admin_setting_manageformats());
|
||||
$ADMIN->add('formatsettings', $temp);
|
||||
foreach ($allplugins['format'] as $format) {
|
||||
$format->load_settings($ADMIN, 'formatsettings', $hassiteconfig);
|
||||
}
|
||||
|
||||
// blocks
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
|
||||
$ADMIN->add('modules', new admin_category('blocksettings', get_string('blocks')));
|
||||
$ADMIN->add('blocksettings', new admin_page_manageblocks());
|
||||
foreach ($allplugins['block'] as $block) {
|
||||
$block->load_settings($ADMIN, 'blocksettings', $hassiteconfig);
|
||||
$blocks = $DB->get_records('block', array(), "name ASC");
|
||||
foreach ($blocks as $block) {
|
||||
$blockname = $block->name;
|
||||
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
|
||||
continue;
|
||||
}
|
||||
$strblockname = get_string('pluginname', 'block_'.$blockname);
|
||||
if (file_exists($CFG->dirroot.'/blocks/'.$blockname.'/settings.php')) {
|
||||
$settings = new admin_settingpage('blocksetting'.$blockname, $strblockname, 'moodle/site:config', !$block->visible);
|
||||
include($CFG->dirroot.'/blocks/'.$blockname.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('blocksettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// message outputs
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', new lang_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('modules', new admin_category('messageoutputs', get_string('messageoutputs', 'message')));
|
||||
$ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
|
||||
$ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
|
||||
foreach ($allplugins['message'] as $processor) {
|
||||
$processor->load_settings($ADMIN, 'messageoutputs', $hassiteconfig);
|
||||
require_once($CFG->dirroot.'/message/lib.php');
|
||||
$processors = get_message_processors();
|
||||
foreach ($processors as $processor) {
|
||||
$processorname = $processor->name;
|
||||
if (!$processor->available) {
|
||||
continue;
|
||||
}
|
||||
if ($processor->hassettings) {
|
||||
$strprocessorname = get_string('pluginname', 'message_'.$processorname);
|
||||
$settings = new admin_settingpage('messagesetting'.$processorname, $strprocessorname, 'moodle/site:config', !$processor->enabled);
|
||||
include($CFG->dirroot.'/message/output/'.$processor->name.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('messageoutputs', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// authentication plugins
|
||||
$ADMIN->add('modules', new admin_category('authsettings', new lang_string('authentication', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('authsettings', get_string('authentication', 'admin')));
|
||||
|
||||
$temp = new admin_settingpage('manageauths', new lang_string('authsettings', 'admin'));
|
||||
$temp = new admin_settingpage('manageauths', get_string('authsettings', 'admin'));
|
||||
$temp->add(new admin_setting_manageauths());
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', new lang_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_heading('manageauthscommonheading', get_string('commonsettings', 'admin'), ''));
|
||||
$temp->add(new admin_setting_special_registerauth());
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', new lang_string('authpreventaccountcreation', 'admin'), new lang_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
|
||||
new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
|
||||
new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
|
||||
new lang_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
|
||||
new lang_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'), new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'), new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', get_string('authpreventaccountcreation', 'admin'), get_string('authpreventaccountcreation_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', get_string('loginpageautofocus', 'admin'), get_string('loginpageautofocus_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configselect('guestloginbutton', get_string('guestloginbutton', 'auth'),
|
||||
get_string('showguestlogin', 'auth'), '1', array('0'=>get_string('hide'), '1'=>get_string('show'))));
|
||||
$temp->add(new admin_setting_configtext('alternateloginurl', get_string('alternateloginurl', 'auth'),
|
||||
get_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
|
||||
$temp->add(new admin_setting_configtext('forgottenpasswordurl', get_string('forgottenpasswordurl', 'auth'),
|
||||
get_string('forgottenpassword', 'auth'), ''));
|
||||
$temp->add(new admin_setting_confightmleditor('auth_instructions', get_string('instructions', 'auth'),
|
||||
get_string('authinstructions', 'auth'), ''));
|
||||
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configcheckbox('verifychangedemail', get_string('verifychangedemail', 'admin'), get_string('configverifychangedemail', 'admin'), 1));
|
||||
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
|
||||
$ADMIN->add('authsettings', $temp);
|
||||
|
||||
foreach ($allplugins['auth'] as $auth) {
|
||||
$auth->load_settings($ADMIN, 'authsettings', $hassiteconfig);
|
||||
|
||||
$auths = get_plugin_list('auth');
|
||||
$authsenabled = get_enabled_auth_plugins();
|
||||
foreach ($auths as $authname => $authdir) {
|
||||
$strauthname = get_string('pluginname', "auth_{$authname}");
|
||||
// do not show disabled auths in tree, keep only settings link on manage page
|
||||
$enabled = in_array($authname, $authsenabled);
|
||||
if (file_exists($authdir.'/settings.php')) {
|
||||
// TODO: finish implementation of common settings - locking, etc.
|
||||
$settings = new admin_settingpage('authsetting'.$authname, $strauthname, 'moodle/site:config', !$enabled);
|
||||
include($authdir.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('authsettings', $settings);
|
||||
}
|
||||
|
||||
} else {
|
||||
$ADMIN->add('authsettings', new admin_externalpage('authsetting'.$authname, $strauthname, "$CFG->wwwroot/$CFG->admin/auth_config.php?auth=$authname", 'moodle/site:config', !$enabled));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Enrolment plugins
|
||||
$ADMIN->add('modules', new admin_category('enrolments', new lang_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', new lang_string('manageenrols', 'enrol'));
|
||||
$ADMIN->add('modules', new admin_category('enrolments', get_string('enrolments', 'enrol')));
|
||||
$temp = new admin_settingpage('manageenrols', get_string('manageenrols', 'enrol'));
|
||||
$temp->add(new admin_setting_manageenrols());
|
||||
$ADMIN->add('enrolments', $temp);
|
||||
foreach($allplugins['enrol'] as $enrol) {
|
||||
$enrol->load_settings($ADMIN, 'enrolments', $hassiteconfig);
|
||||
if (empty($CFG->enrol_plugins_enabled)) {
|
||||
$enabled = array();
|
||||
} else {
|
||||
$enabled = explode(',', $CFG->enrol_plugins_enabled);
|
||||
}
|
||||
$enrols = get_plugin_list('enrol');
|
||||
$ADMIN->add('enrolments', $temp);
|
||||
foreach($enrols as $enrol=>$enrolpath) {
|
||||
if (!file_exists("$enrolpath/settings.php")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('enrolsettings'.$enrol, get_string('pluginname', 'enrol_'.$enrol), 'moodle/site:config', !in_array($enrol, $enabled));
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include("$enrolpath/settings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('enrolments', $settings);
|
||||
}
|
||||
|
||||
}
|
||||
unset($enabled);
|
||||
unset($enrols);
|
||||
|
||||
|
||||
/// Editor plugins
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
|
||||
$ADMIN->add('modules', new admin_category('editorsettings', get_string('editors', 'editor')));
|
||||
$temp = new admin_settingpage('manageeditors', get_string('editorsettings', 'editor'));
|
||||
$temp->add(new admin_setting_manageeditors());
|
||||
$htmleditors = editors_get_available();
|
||||
$ADMIN->add('editorsettings', $temp);
|
||||
foreach ($allplugins['editor'] as $editor) {
|
||||
$editor->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
|
||||
|
||||
$editors_available = editors_get_available();
|
||||
foreach ($editors_available as $editor=>$editorstr) {
|
||||
if (file_exists($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php')) {
|
||||
$settings = new admin_settingpage('editorsettings'.$editor, get_string('pluginname', 'editor_'.$editor), 'moodle/site:config');
|
||||
// settings.php may create a subcategory or unset the settings completely
|
||||
include($CFG->dirroot . '/lib/editor/'.$editor.'/settings.php');
|
||||
if ($settings) {
|
||||
$ADMIN->add('editorsettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// License types
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', new lang_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', new lang_string('managelicenses', 'admin'));
|
||||
$ADMIN->add('modules', new admin_category('licensesettings', get_string('licenses')));
|
||||
$temp = new admin_settingpage('managelicenses', get_string('managelicenses', 'admin'));
|
||||
|
||||
require_once($CFG->libdir . '/licenselib.php');
|
||||
$licenses = array();
|
||||
$array = explode(',', $CFG->licenses);
|
||||
foreach ($array as $value) {
|
||||
$licenses[$value] = new lang_string($value, 'license');
|
||||
$licenses[$value] = get_string($value, 'license');
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', new lang_string('configsitedefaultlicense','admin'), new lang_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_configselect('sitedefaultlicense', get_string('configsitedefaultlicense','admin'), get_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
|
||||
$temp->add(new admin_setting_managelicenses());
|
||||
$ADMIN->add('licensesettings', $temp);
|
||||
|
||||
/// Filter plugins
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', new lang_string('managefilters')));
|
||||
$ADMIN->add('modules', new admin_category('filtersettings', get_string('managefilters')));
|
||||
|
||||
$ADMIN->add('filtersettings', new admin_page_managefilters());
|
||||
|
||||
// "filtersettings" settingpage
|
||||
$temp = new admin_settingpage('commonfiltersettings', new lang_string('commonfiltersettings', 'admin'));
|
||||
$temp = new admin_settingpage('commonfiltersettings', get_string('commonfiltersettings', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
$cachetimes = array(
|
||||
604800 => new lang_string('numdays','',7),
|
||||
86400 => new lang_string('numdays','',1),
|
||||
43200 => new lang_string('numhours','',12),
|
||||
10800 => new lang_string('numhours','',3),
|
||||
7200 => new lang_string('numhours','',2),
|
||||
3600 => new lang_string('numhours','',1),
|
||||
2700 => new lang_string('numminutes','',45),
|
||||
1800 => new lang_string('numminutes','',30),
|
||||
900 => new lang_string('numminutes','',15),
|
||||
600 => new lang_string('numminutes','',10),
|
||||
540 => new lang_string('numminutes','',9),
|
||||
480 => new lang_string('numminutes','',8),
|
||||
420 => new lang_string('numminutes','',7),
|
||||
360 => new lang_string('numminutes','',6),
|
||||
300 => new lang_string('numminutes','',5),
|
||||
240 => new lang_string('numminutes','',4),
|
||||
180 => new lang_string('numminutes','',3),
|
||||
120 => new lang_string('numminutes','',2),
|
||||
60 => new lang_string('numminutes','',1),
|
||||
30 => new lang_string('numseconds','',30),
|
||||
0 => new lang_string('no')
|
||||
604800 => get_string('numdays','',7),
|
||||
86400 => get_string('numdays','',1),
|
||||
43200 => get_string('numhours','',12),
|
||||
10800 => get_string('numhours','',3),
|
||||
7200 => get_string('numhours','',2),
|
||||
3600 => get_string('numhours','',1),
|
||||
2700 => get_string('numminutes','',45),
|
||||
1800 => get_string('numminutes','',30),
|
||||
900 => get_string('numminutes','',15),
|
||||
600 => get_string('numminutes','',10),
|
||||
540 => get_string('numminutes','',9),
|
||||
480 => get_string('numminutes','',8),
|
||||
420 => get_string('numminutes','',7),
|
||||
360 => get_string('numminutes','',6),
|
||||
300 => get_string('numminutes','',5),
|
||||
240 => get_string('numminutes','',4),
|
||||
180 => get_string('numminutes','',3),
|
||||
120 => get_string('numminutes','',2),
|
||||
60 => get_string('numminutes','',1),
|
||||
30 => get_string('numseconds','',30),
|
||||
0 => get_string('no')
|
||||
);
|
||||
$items = array();
|
||||
$items[] = new admin_setting_configselect('cachetext', new lang_string('cachetext', 'admin'), new lang_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', new lang_string('filteruploadedfiles', 'admin'), new lang_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
$items[] = new admin_setting_configselect('cachetext', get_string('cachetext', 'admin'), get_string('configcachetext', 'admin'), 60, $cachetimes);
|
||||
$items[] = new admin_setting_configselect('filteruploadedfiles', get_string('filteruploadedfiles', 'admin'), get_string('configfilteruploadedfiles', 'admin'), 0,
|
||||
array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly')));
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', get_string('filtermatchoneperpage', 'admin'), get_string('configfiltermatchoneperpage', 'admin'), 0);
|
||||
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', get_string('filtermatchonepertext', 'admin'), get_string('configfiltermatchonepertext', 'admin'), 0);
|
||||
foreach ($items as $item) {
|
||||
$item->set_updatedcallback('reset_text_filters_cache');
|
||||
$temp->add($item);
|
||||
@@ -150,15 +218,24 @@ if ($hassiteconfig) {
|
||||
}
|
||||
$ADMIN->add('filtersettings', $temp);
|
||||
|
||||
foreach ($allplugins['filter'] as $filter) {
|
||||
$filter->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
|
||||
$activefilters = filter_get_globally_enabled();
|
||||
$filternames = filter_get_all_installed();
|
||||
foreach ($filternames as $filterpath => $strfiltername) {
|
||||
if (file_exists("$CFG->dirroot/$filterpath/filtersettings.php")) {
|
||||
$settings = new admin_settingpage('filtersetting'.str_replace('/', '', $filterpath),
|
||||
$strfiltername, 'moodle/site:config', !isset($activefilters[$filterpath]));
|
||||
include("$CFG->dirroot/$filterpath/filtersettings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('filtersettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//== Portfolio settings ==
|
||||
require_once($CFG->libdir. '/portfoliolib.php');
|
||||
$catname = new lang_string('portfolios', 'portfolio');
|
||||
$manage = new lang_string('manageportfolios', 'portfolio');
|
||||
$catname = get_string('portfolios', 'portfolio');
|
||||
$manage = get_string('manageportfolios', 'portfolio');
|
||||
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
||||
|
||||
$ADMIN->add('modules', new admin_category('portfoliosettings', $catname, empty($CFG->enableportfolios)));
|
||||
@@ -168,37 +245,37 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('manageportfolioscommon', new lang_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', new lang_string('commonsettingsdesc', 'portfolio')));
|
||||
$temp = new admin_settingpage('manageportfolioscommon', get_string('commonportfoliosettings', 'portfolio'));
|
||||
$temp->add(new admin_setting_heading('manageportfolioscommon', '', get_string('commonsettingsdesc', 'portfolio')));
|
||||
$fileinfo = portfolio_filesize_info(); // make sure this is defined in one place since its used inside portfolio too to detect insane settings
|
||||
$fileoptions = $fileinfo['options'];
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_moderate_filesize_threshold',
|
||||
new lang_string('moderatefilesizethreshold', 'portfolio'),
|
||||
new lang_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
get_string('moderatefilesizethreshold', 'portfolio'),
|
||||
get_string('moderatefilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['moderate'], $fileoptions));
|
||||
$temp->add(new admin_setting_configselect(
|
||||
'portfolio_high_filesize_threshold',
|
||||
new lang_string('highfilesizethreshold', 'portfolio'),
|
||||
new lang_string('highfilesizethresholddesc', 'portfolio'),
|
||||
get_string('highfilesizethreshold', 'portfolio'),
|
||||
get_string('highfilesizethresholddesc', 'portfolio'),
|
||||
$fileinfo['high'], $fileoptions));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_moderate_db_threshold',
|
||||
new lang_string('moderatedbsizethreshold', 'portfolio'),
|
||||
new lang_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
20, PARAM_INT, 3));
|
||||
get_string('moderatedbsizethreshold', 'portfolio'),
|
||||
get_string('moderatedbsizethresholddesc', 'portfolio'),
|
||||
20, PARAM_INTEGER, 3));
|
||||
|
||||
$temp->add(new admin_setting_configtext(
|
||||
'portfolio_high_db_threshold',
|
||||
new lang_string('highdbsizethreshold', 'portfolio'),
|
||||
new lang_string('highdbsizethresholddesc', 'portfolio'),
|
||||
50, PARAM_INT, 3));
|
||||
get_string('highdbsizethreshold', 'portfolio'),
|
||||
get_string('highdbsizethresholddesc', 'portfolio'),
|
||||
50, PARAM_INTEGER, 3));
|
||||
|
||||
$ADMIN->add('portfoliosettings', $temp);
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', new lang_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true));
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', new lang_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true));
|
||||
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', new lang_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true));
|
||||
$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');
|
||||
@@ -210,14 +287,16 @@ if ($hassiteconfig) {
|
||||
$portfolio->get('name'),
|
||||
$url . '?action=edit&pf=' . $portfolio->get('id'),
|
||||
'moodle/site:config'
|
||||
)
|
||||
),
|
||||
$portfolio->get('name'),
|
||||
$url . '?action=edit&pf=' . $portfolio->get('id')
|
||||
);
|
||||
}
|
||||
|
||||
// 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));
|
||||
|
||||
@@ -226,161 +305,133 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
|
||||
// Add common settings page
|
||||
$temp = new admin_settingpage('managerepositoriescommon', new lang_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', new lang_string('cacheexpire', 'repository'), new lang_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', new lang_string('allowexternallinks', 'repository'), new lang_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', new lang_string('legacyfilesinnewcourses', 'admin'), new lang_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$temp = new admin_settingpage('managerepositoriescommon', get_string('commonrepositorysettings', 'repository'));
|
||||
$temp->add(new admin_setting_configtext('repositorycacheexpire', get_string('cacheexpire', 'repository'), get_string('configcacheexpire', 'repository'), 120));
|
||||
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', get_string('allowexternallinks', 'repository'), get_string('configallowexternallinks', 'repository'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', get_string('legacyfilesinnewcourses', 'admin'), get_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
||||
$ADMIN->add('repositorysettings', $temp);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
|
||||
new lang_string('addplugin', 'repository'), $url, 'moodle/site:config', true));
|
||||
get_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete',
|
||||
new lang_string('deleterepository', 'repository'), $url, 'moodle/site:config', true));
|
||||
get_string('deleterepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller',
|
||||
new lang_string('manage', 'repository'), $url, 'moodle/site:config', true));
|
||||
get_string('manage', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew',
|
||||
new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true));
|
||||
get_string('createrepository', 'repository'), $url, 'moodle/site:config', true),
|
||||
'', $url);
|
||||
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
|
||||
new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true));
|
||||
foreach ($allplugins['repository'] as $repositorytype) {
|
||||
$repositorytype->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
|
||||
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)) {
|
||||
$ADMIN->add('repositorysettings',
|
||||
new admin_externalpage('repositorysettings'.$repositorytype->get_typename(),
|
||||
$repositorytype->get_readablename(),
|
||||
$url . '?action=edit&repos=' . $repositorytype->get_typename()),
|
||||
'moodle/site:config');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Web services
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
|
||||
// Mobile
|
||||
$temp = new admin_settingpage('mobile', new lang_string('mobile','admin'), 'moodle/site:config', false);
|
||||
$enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
|
||||
new lang_string('enablemobilewebservice', 'admin'),
|
||||
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'), new lang_string('configmobilecssurl','admin'), '', PARAM_URL));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
|
||||
/// overview page
|
||||
$temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
|
||||
$temp = new admin_settingpage('webservicesoverview', get_string('webservicesoverview', 'webservice'));
|
||||
$temp->add(new admin_setting_webservicesoverview());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
//API documentation
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', get_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
|
||||
/// manage service
|
||||
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
|
||||
new lang_string('enablemobilewebservice', 'admin'),
|
||||
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
|
||||
$temp = new admin_settingpage('externalservices', get_string('externalservices', 'webservice'));
|
||||
$enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
|
||||
$enablemobiledoclink = html_writer::link($enablemobiledocurl, get_string('documentation'));
|
||||
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice', get_string('enablemobilewebservice', 'admin'), get_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', get_string('information', 'webservice'), get_string('servicehelpexplanation', 'webservice')));
|
||||
$temp->add(new admin_setting_manageexternalservices());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', new lang_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', new lang_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', new lang_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', get_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
|
||||
/// manage protocol page link
|
||||
$temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
|
||||
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebserviceprotocols());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
|
||||
// We cannot use $OUTPUT this early, doing so means that we lose the ability
|
||||
// to set the page layout on all admin pages.
|
||||
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
|
||||
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
|
||||
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
|
||||
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$wsdoclink = html_writer::tag('a', get_string('supplyinfo'),array('href'=>$url));
|
||||
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', get_string('enablewsdocumentation',
|
||||
'admin'), get_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
/// links to protocol pages
|
||||
foreach ($allplugins['webservice'] as $webservice) {
|
||||
$webservice->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
|
||||
$webservices_available = get_plugin_list('webservice');
|
||||
$active_webservices = empty($CFG->webserviceprotocols) ? array() : explode(',', $CFG->webserviceprotocols);
|
||||
foreach ($webservices_available as $webservice => $location) {
|
||||
if (file_exists("$location/settings.php")) {
|
||||
$name = get_string('pluginname', 'webservice_'.$webservice);
|
||||
$settings = new admin_settingpage('webservicesetting'.$webservice, $name, 'moodle/site:config', !in_array($webservice, $active_webservices) or empty($CFG->enablewebservices));
|
||||
include("$location/settings.php");
|
||||
if ($settings) {
|
||||
$ADMIN->add('webservicesettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// manage token page link
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice'));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', get_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', get_string('managetokens', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebservicetokens());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
}
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
}
|
||||
|
||||
// Question type settings
|
||||
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
||||
if (!$hassiteconfig) {
|
||||
require_once("$CFG->libdir/pluginlib.php");
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
}
|
||||
|
||||
// Question behaviour settings.
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', get_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
|
||||
|
||||
// Question type settings.
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
|
||||
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
|
||||
|
||||
// Question preview defaults.
|
||||
$settings = new admin_settingpage('qdefaultsetting',
|
||||
get_string('questionpreviewdefaults', 'question'),
|
||||
'moodle/question:config');
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
|
||||
$settings->add(new admin_setting_heading('qdefaultsetting_preview_options',
|
||||
'', get_string('questionpreviewdefaults_desc', 'question')));
|
||||
|
||||
// These keys are question_display_options::HIDDEN and VISIBLE.
|
||||
$hiddenofvisible = array(
|
||||
0 => get_string('notshown', 'question'),
|
||||
1 => get_string('shown', 'question'),
|
||||
);
|
||||
|
||||
$settings->add(new admin_setting_question_behaviour('question_preview/behaviour',
|
||||
get_string('howquestionsbehave', 'question'), '',
|
||||
'deferredfeedback'));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/correctness',
|
||||
get_string('whethercorrect', 'question'), '', 1, $hiddenofvisible));
|
||||
|
||||
// These keys are question_display_options::HIDDEN, MARK_ONLY and MARK_AND_MAX.
|
||||
$marksoptions = array(
|
||||
0 => get_string('notshown', 'question'),
|
||||
1 => get_string('showmaxmarkonly', 'question'),
|
||||
2 => get_string('showmarkandmax', 'question'),
|
||||
);
|
||||
$settings->add(new admin_setting_configselect('question_preview/marks',
|
||||
get_string('marks', 'question'), '', 1, $marksoptions));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/markdp',
|
||||
get_string('decimalplacesingrades', 'question'), '', 2, array(0, 1, 2, 3, 4, 5, 6, 7)));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/feedback',
|
||||
get_string('specificfeedback', 'question'), '', 1, $hiddenofvisible));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/generalfeedback',
|
||||
get_string('generalfeedback', 'question'), '', 1, $hiddenofvisible));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/rightanswer',
|
||||
get_string('rightanswer', 'question'), '', 1, $hiddenofvisible));
|
||||
|
||||
$settings->add(new admin_setting_configselect('question_preview/history',
|
||||
get_string('responsehistory', 'question'), '', 0, $hiddenofvisible));
|
||||
|
||||
// Settings for particular question types.
|
||||
foreach ($allplugins['qtype'] as $qtype) {
|
||||
$qtype->load_settings($ADMIN, 'qtypesettings', $hassiteconfig);
|
||||
$qtypes = get_plugin_list('qtype');
|
||||
foreach ($qtypes as $qtype => $path) {
|
||||
$settingsfile = $path . '/settings.php';
|
||||
if (file_exists($settingsfile)) {
|
||||
$settings = new admin_settingpage('qtypesetting' . $qtype,
|
||||
get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
|
||||
include($settingsfile);
|
||||
if ($settings) {
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Plagiarism plugin settings
|
||||
if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', new lang_string('plagiarism', 'plagiarism')));
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('manageplagiarismplugins', new lang_string('manageplagiarism', 'plagiarism'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/plagiarism.php'));
|
||||
|
||||
foreach ($allplugins['plagiarism'] as $plugin) {
|
||||
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
|
||||
$ADMIN->add('modules', new admin_category('plagiarism', get_string('plagiarism', 'plagiarism')));
|
||||
$temp = new admin_settingpage('plagiarismsettings', get_string('plagiarismsettings', 'plagiarism'));
|
||||
$temp->add(new admin_setting_manageplagiarism());
|
||||
$ADMIN->add('plagiarism', $temp);
|
||||
foreach (get_plugin_list('plagiarism') as $plugin => $plugindir) {
|
||||
if (file_exists($plugindir.'/settings.php')) {
|
||||
$ADMIN->add('plagiarism', new admin_externalpage('plagiarism'.$plugin, get_string($plugin, 'plagiarism_'.$plugin), "$CFG->wwwroot/plagiarism/$plugin/settings.php", 'moodle/site:config'));
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', get_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
|
||||
// Course reports settings
|
||||
if ($hassiteconfig) {
|
||||
@@ -389,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) {
|
||||
@@ -398,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);
|
||||
}
|
||||
@@ -412,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);
|
||||
@@ -428,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'));
|
||||
}
|
||||
|
||||
@@ -441,31 +492,13 @@ foreach (get_plugin_list('tool') as $plugin => $plugindir) {
|
||||
}
|
||||
}
|
||||
|
||||
// Now add the Cache plugins
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('cache', new lang_string('caching', 'cache')));
|
||||
$ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
|
||||
$ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
|
||||
$ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
|
||||
foreach (get_plugin_list('cachestore') as $plugin => $path) {
|
||||
$settingspath = $path.'/settings.php';
|
||||
if (file_exists($settingspath)) {
|
||||
$settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config');
|
||||
include($settingspath);
|
||||
$ADMIN->add('cachestores', $settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Add all local plugins - must be always last!
|
||||
if ($hassiteconfig) {
|
||||
$ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', new lang_string('localpluginsmanage'),
|
||||
$ADMIN->add('modules', new admin_category('localplugins', get_string('localplugins')));
|
||||
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', get_string('localpluginsmanage'),
|
||||
$CFG->wwwroot . '/' . $CFG->admin . '/localplugins.php'));
|
||||
}
|
||||
|
||||
// extend settings for each local plugin. Note that their settings may be in any part of the
|
||||
// settings tree and may be visible not only for administrators. We can not use $allplugins here
|
||||
foreach (get_plugin_list('local') as $plugin => $plugindir) {
|
||||
$settings_path = "$plugindir/settings.php";
|
||||
if (file_exists($settings_path)) {
|
||||
|
||||
+84
-79
@@ -3,109 +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')));
|
||||
|
||||
$maxbytes = 0;
|
||||
if (!empty($CFG->maxbytes)) {
|
||||
$maxbytes = $CFG->maxbytes;
|
||||
}
|
||||
$max_upload_choices = get_max_upload_sizes(0, 0, 0, $maxbytes);
|
||||
$max_upload_choices = get_max_upload_sizes();
|
||||
// maxbytes set to 0 will allow the maximum server limit for uploads
|
||||
$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'), ''));
|
||||
|
||||
$options = array(0=>get_string('no'), 3=>3, 5=>5, 7=>7, 10=>10, 20=>20, 30=>30, 50=>50, 100=>100);
|
||||
$temp->add(new admin_setting_configselect('lockoutthreshold', new lang_string('lockoutthreshold', 'admin'), new lang_string('lockoutthreshold_desc', 'admin'), 0, $options));
|
||||
$temp->add(new admin_setting_configduration('lockoutwindow', new lang_string('lockoutwindow', 'admin'), new lang_string('lockoutwindow_desc', 'admin'), 60*30));
|
||||
$temp->add(new admin_setting_configduration('lockoutduration', new lang_string('lockoutduration', 'admin'), new lang_string('lockoutduration_desc', 'admin'), 60*30));
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
@@ -114,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
|
||||
|
||||
+148
-145
@@ -6,17 +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_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;
|
||||
@@ -27,156 +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_configselect('extramemorylimit', new lang_string('extramemorylimit', 'admin'),
|
||||
new lang_string('configextramemorylimit', 'admin'), '512M',
|
||||
$temp->add(new admin_setting_configtext('numcoursesincombo', get_string('numcoursesincombo', 'admin'), get_string('numcoursesincombo_help', 'admin'), 500));
|
||||
|
||||
$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',
|
||||
@@ -184,38 +188,37 @@ $temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('e
|
||||
'512M' => '512M',
|
||||
'1024M' => '1024M'
|
||||
)));
|
||||
$temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'),
|
||||
new lang_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'),
|
||||
new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
$temp->add(new admin_setting_configtext('curlcache', get_string('curlcache', 'admin'),
|
||||
get_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
||||
|
||||
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', get_string('curltimeoutkbitrate', 'admin'),
|
||||
get_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
||||
/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
|
||||
$temp->add(new admin_setting_special_selectsetup('cachetype', get_string('cachetype', 'admin'),
|
||||
get_string('configcachetype', 'admin'), '',
|
||||
array( '' => get_string('none'),
|
||||
'internal' => 'internal',
|
||||
'memcached' => 'memcached',
|
||||
'eaccelerator' => 'eaccelerator')));
|
||||
// NOTE: $CFG->rcache is forced to bool in lib/setup.php
|
||||
$temp->add(new admin_setting_special_selectsetup('rcache', get_string('rcache', 'admin'),
|
||||
get_string('configrcache', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
|
||||
get_string('configrcachettl', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
|
||||
get_string('configintcachemax', 'admin'), 10));
|
||||
$temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
|
||||
get_string('configmemcachedhosts', 'admin'), ''));
|
||||
$temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
|
||||
get_string('configmemcachedpconn', 'admin'), 0,
|
||||
array( '0' => get_string('no'),
|
||||
'1' => get_string('yes'))));
|
||||
*/
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
// "update notifications" settingpage
|
||||
if (empty($CFG->disableupdatenotifications)) {
|
||||
$temp = new admin_settingpage('updatenotifications', new lang_string('updatenotifications', 'core_admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('updateautocheck', new lang_string('updateautocheck', 'core_admin'),
|
||||
new lang_string('updateautocheck_desc', 'core_admin'), 1));
|
||||
if (empty($CFG->disableupdateautodeploy)) {
|
||||
$temp->add(new admin_setting_configcheckbox('updateautodeploy', new lang_string('updateautodeploy', 'core_admin'),
|
||||
new lang_string('updateautodeploy_desc', 'core_admin'), 0));
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('updateminmaturity', new lang_string('updateminmaturity', 'core_admin'),
|
||||
new lang_string('updateminmaturity_desc', 'core_admin'), MATURITY_STABLE,
|
||||
array(
|
||||
MATURITY_ALPHA => new lang_string('maturity'.MATURITY_ALPHA, 'core_admin'),
|
||||
MATURITY_BETA => new lang_string('maturity'.MATURITY_BETA, 'core_admin'),
|
||||
MATURITY_RC => new lang_string('maturity'.MATURITY_RC, 'core_admin'),
|
||||
MATURITY_STABLE => new lang_string('maturity'.MATURITY_STABLE, 'core_admin'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('updatenotifybuilds', new lang_string('updatenotifybuilds', 'core_admin'),
|
||||
new lang_string('updatenotifybuilds_desc', 'core_admin'), 0));
|
||||
$ADMIN->add('server', $temp);
|
||||
}
|
||||
$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
@@ -2,45 +2,45 @@
|
||||
|
||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', new lang_string('enableoutcomes', 'grades'), new lang_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('enableoutcomes_help', 'grades'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', new lang_string('usetags','admin'),new lang_string('configusetags', 'admin'), '1'));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('usetags', get_string('usetags','admin'),get_string('configusetags', 'admin'), '1'));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', new lang_string('enablenotes', 'notes'), new lang_string('configenablenotes', 'notes'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablenotes', get_string('enablenotes', 'notes'), get_string('configenablenotes', 'notes'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', new lang_string('enabled', 'portfolio'), new lang_string('enableddesc', 'portfolio'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableportfolios', get_string('enabled', 'portfolio'), get_string('enableddesc', 'portfolio'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', new lang_string('enablewebservices', 'admin'), new lang_string('configenablewebservices', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablewebservices', get_string('enablewebservices', 'admin'), get_string('configenablewebservices', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', new lang_string('messaging', 'admin'), new lang_string('configmessaging','admin'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaging', get_string('messaging', 'admin'), get_string('configmessaging','admin'), 1));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', new lang_string('messaginghidereadnotifications', 'admin'), new lang_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messaginghidereadnotifications', get_string('messaginghidereadnotifications', 'admin'), get_string('configmessaginghidereadnotifications','admin'), 0));
|
||||
|
||||
$options = array(DAYSECS=>new lang_string('secondstotime86400'), WEEKSECS=>new lang_string('secondstotime604800'), 2620800=>new lang_string('nummonths', 'moodle', 1), 15724800=>new lang_string('nummonths', 'moodle', 6),0=>new lang_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', new lang_string('messagingdeletereadnotificationsdelay', 'admin'), new lang_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
$options = array(DAYSECS=>get_string('secondstotime86400'), WEEKSECS=>get_string('secondstotime604800'), 2620800=>get_string('nummonths', 'moodle', 1), 15724800=>get_string('nummonths', 'moodle', 6),0=>get_string('never'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('messagingdeletereadnotificationsdelay', get_string('messagingdeletereadnotificationsdelay', 'admin'), get_string('configmessagingdeletereadnotificationsdelay', 'admin'), 604800, $options));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('messagingallowemailoverride', new lang_string('messagingallowemailoverride', 'admin'), new lang_string('configmessagingallowemailoverride','admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', get_string('enablestats', 'admin'), get_string('configenablestats', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablestats', new lang_string('enablestats', 'admin'), new lang_string('configenablestats', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablerssfeeds', new lang_string('enablerssfeeds', 'admin'), new lang_string('configenablerssfeeds', 'admin'), 0));
|
||||
$optionalsubsystems->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'),
|
||||
get_string('configbloglevel', 'admin'), 4, array(5 => get_string('worldblogs','blog'),
|
||||
4 => get_string('siteblogs','blog'),
|
||||
1 => get_string('personalblogs','blog'),
|
||||
0 => get_string('disableblogs','blog'))));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableblogs', new lang_string('enableblogs', 'admin'), new lang_string('configenableblogs', 'admin'), 1));
|
||||
|
||||
$options = array('off'=>new lang_string('off', 'mnet'), 'strict'=>new lang_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', new lang_string('net', 'mnet'), new lang_string('configmnet', 'mnet'), 'off', $options));
|
||||
$options = array('off'=>get_string('off', 'mnet'), 'strict'=>get_string('on', 'mnet'));
|
||||
$optionalsubsystems->add(new admin_setting_configselect('mnet_dispatcher_mode', get_string('net', 'mnet'), get_string('configmnet', 'mnet'), 'off', $options));
|
||||
|
||||
// Conditional activities: completion and availability
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablecompletion',
|
||||
new lang_string('enablecompletion','completion'),
|
||||
new lang_string('configenablecompletion','completion'), 0));
|
||||
get_string('enablecompletion','completion'),
|
||||
get_string('configenablecompletion','completion'), 0));
|
||||
$optionalsubsystems->add($checkbox = new admin_setting_configcheckbox('enableavailability',
|
||||
new lang_string('enableavailability','condition'),
|
||||
new lang_string('configenableavailability','condition'), 0));
|
||||
get_string('enableavailability','condition'),
|
||||
get_string('configenableavailability','condition'), 0));
|
||||
$checkbox->set_affects_modinfo(true);
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', new lang_string('enableplagiarism','plagiarism'), new lang_string('configenableplagiarism','plagiarism'), 0));
|
||||
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enablebadges', new lang_string('enablebadges', 'badges'), new lang_string('configenablebadges', 'badges'), 1));
|
||||
$optionalsubsystems->add(new admin_setting_configcheckbox('enableplagiarism', get_string('enableplagiarism','plagiarism'), get_string('configenableplagiarism','plagiarism'), 0));
|
||||
}
|
||||
|
||||
+25
-26
@@ -5,45 +5,44 @@
|
||||
// since they need to exist *before* settingpages and externalpages
|
||||
// are added to them.
|
||||
|
||||
$systemcontext = context_system::instance();
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$hassiteconfig = has_capability('moodle/site:config', $systemcontext);
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
|
||||
$ADMIN->add('root', new admin_externalpage('registrationindex', get_string('registration','admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
||||
$ADMIN->add('root', new admin_externalpage('registration', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/index.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationselector', get_string('registeron','hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/hubselector.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('siteregistrationconfirmed',
|
||||
new lang_string('registrationconfirmed', 'hub'),
|
||||
get_string('registrationconfirmed', 'hub'),
|
||||
$CFG->wwwroot."/".$CFG->admin."/registration/confirmregistration.php", 'moodle/site:config', true));
|
||||
// hidden upgrade script
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', new lang_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', new lang_string('advancedfeatures', 'admin'));
|
||||
$optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('advancedfeatures', 'admin'));
|
||||
$ADMIN->add('root', $optionalsubsystems);
|
||||
}
|
||||
|
||||
$ADMIN->add('root', new admin_category('users', new lang_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', new lang_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', new lang_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('badges', new lang_string('badges'), empty($CFG->enablebadges)));
|
||||
$ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', new lang_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', new lang_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', new lang_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', new lang_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', new lang_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', new lang_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', new lang_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', new lang_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', new lang_string('development', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
|
||||
$ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
|
||||
$ADMIN->add('root', new admin_category('grades', get_string('grades')));
|
||||
$ADMIN->add('root', new admin_category('location', get_string('location','admin')));
|
||||
$ADMIN->add('root', new admin_category('language', get_string('language')));
|
||||
$ADMIN->add('root', new admin_category('modules', get_string('plugins', 'admin')));
|
||||
$ADMIN->add('root', new admin_category('security', get_string('security','admin')));
|
||||
$ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
|
||||
$ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
|
||||
$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
|
||||
$ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
|
||||
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
|
||||
$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
|
||||
|
||||
// hidden unsupported category
|
||||
$ADMIN->add('root', new admin_category('unsupported', new lang_string('unsupported', 'admin'), true));
|
||||
$ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
|
||||
|
||||
// hidden search script
|
||||
$ADMIN->add('root', new admin_externalpage('search', new lang_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
|
||||
|
||||
+54
-57
@@ -2,8 +2,8 @@
|
||||
|
||||
// This file defines settingpages and externalpages under the "users" category
|
||||
|
||||
$ADMIN->add('users', new admin_category('accounts', new lang_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', new lang_string('permissions', 'role')));
|
||||
$ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
|
||||
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
|
||||
|
||||
if ($hassiteconfig
|
||||
or has_capability('moodle/user:create', $systemcontext)
|
||||
@@ -21,20 +21,20 @@ if ($hassiteconfig
|
||||
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
|
||||
}
|
||||
// stuff under the "accounts" subcategory
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', new lang_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', new lang_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', new lang_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', new lang_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', new lang_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
|
||||
$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
|
||||
$ADMIN->add('accounts', new admin_externalpage('cohorts', get_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
|
||||
|
||||
|
||||
// stuff under the "roles" subcategory
|
||||
|
||||
// "userpolicies" settingpage
|
||||
$temp = new admin_settingpage('userpolicies', new lang_string('userpolicies', 'admin'));
|
||||
$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
|
||||
if ($ADMIN->fulltree) {
|
||||
if (!during_initial_install()) {
|
||||
$context = context_system::instance();
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$otherroles = array();
|
||||
$guestroles = array();
|
||||
@@ -45,9 +45,8 @@ if ($hassiteconfig
|
||||
$defaultuserid = null;
|
||||
$defaultguestid = null;
|
||||
|
||||
$roles = role_fix_names(get_all_roles(), null, ROLENAME_ORIGINALANDSHORT);
|
||||
foreach ($roles as $role) {
|
||||
$rolename = $role->localname;
|
||||
foreach (get_all_roles() as $role) {
|
||||
$rolename = strip_tags(format_string($role->name)) . ' ('. $role->shortname . ')';
|
||||
switch ($role->archetype) {
|
||||
case 'manager':
|
||||
$creatornewroles[$role->id] = $rolename;
|
||||
@@ -81,28 +80,28 @@ if ($hassiteconfig
|
||||
}
|
||||
|
||||
if (empty($guestroles)) {
|
||||
$guestroles[0] = new lang_string('none');
|
||||
$guestroles[0] = get_string('none');
|
||||
$defaultguestid = 0;
|
||||
}
|
||||
|
||||
if (empty($userroles)) {
|
||||
$userroles[0] = new lang_string('none');
|
||||
$userroles[0] = get_string('none');
|
||||
$defaultuserid = 0;
|
||||
}
|
||||
|
||||
$restorersnewrole = $creatornewroles;
|
||||
$restorersnewrole[0] = new lang_string('none');
|
||||
$restorersnewrole[0] = get_string('none');
|
||||
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', new lang_string('notloggedinroleid', 'admin'),
|
||||
new lang_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', new lang_string('guestroleid', 'admin'),
|
||||
new lang_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', new lang_string('defaultuserroleid', 'admin'),
|
||||
new lang_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', new lang_string('creatornewroleid', 'admin'),
|
||||
new lang_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', new lang_string('restorernewroleid', 'admin'),
|
||||
new lang_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
|
||||
get_string('confignotloggedinroleid', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
|
||||
get_string('guestroleid_help', 'admin'), $defaultguestid, ($guestroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
|
||||
get_string('configdefaultuserroleid', 'admin'), $defaultuserid, ($userroles + $otherroles)));
|
||||
$temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
|
||||
get_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
|
||||
$temp->add(new admin_setting_configselect('restorernewroleid', get_string('restorernewroleid', 'admin'),
|
||||
get_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
|
||||
|
||||
// release memory
|
||||
unset($otherroles);
|
||||
@@ -112,24 +111,24 @@ if ($hassiteconfig
|
||||
unset($restorersnewrole);
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', new lang_string('autologinguests', 'admin'), new lang_string('configautologinguests', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', new lang_string('hiddenuserfields', 'admin'),
|
||||
new lang_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => new lang_string('description'),
|
||||
'city' => new lang_string('city'),
|
||||
'country' => new lang_string('country'),
|
||||
'webpage' => new lang_string('webpage'),
|
||||
'icqnumber' => new lang_string('icqnumber'),
|
||||
'skypeid' => new lang_string('skypeid'),
|
||||
'yahooid' => new lang_string('yahooid'),
|
||||
'aimid' => new lang_string('aimid'),
|
||||
'msnid' => new lang_string('msnid'),
|
||||
'firstaccess' => new lang_string('firstaccess'),
|
||||
'lastaccess' => new lang_string('lastaccess'),
|
||||
'mycourses' => new lang_string('mycourses'),
|
||||
'groups' => new lang_string('groups'),
|
||||
'suspended' => new lang_string('suspended', 'auth'),
|
||||
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
|
||||
get_string('confighiddenuserfields', 'admin'), array(),
|
||||
array('description' => get_string('description'),
|
||||
'city' => get_string('city'),
|
||||
'country' => get_string('country'),
|
||||
'webpage' => get_string('webpage'),
|
||||
'icqnumber' => get_string('icqnumber'),
|
||||
'skypeid' => get_string('skypeid'),
|
||||
'yahooid' => get_string('yahooid'),
|
||||
'aimid' => get_string('aimid'),
|
||||
'msnid' => get_string('msnid'),
|
||||
'firstaccess' => get_string('firstaccess'),
|
||||
'lastaccess' => get_string('lastaccess'),
|
||||
'mycourses' => get_string('mycourses'),
|
||||
'groups' => get_string('groups'),
|
||||
'suspended' => get_string('suspended', 'auth'),
|
||||
)));
|
||||
|
||||
// Select fields to display as part of user identity (only to those
|
||||
@@ -141,27 +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_configtext('maxusersperpage', new lang_string('maxusersperpage','admin'), new lang_string('configmaxusersperpage','admin'), 100, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', new lang_string('enablegravatar', 'admin'), new lang_string('enablegravatar_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('gravatardefaulturl', new lang_string('gravatardefaulturl', 'admin'), new lang_string('gravatardefaulturl_help', 'admin'), 'mm'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', get_string('enablegravatar', 'admin'), get_string('enablegravatar_help', 'admin'), 0));
|
||||
}
|
||||
|
||||
$ADMIN->add('roles', $temp);
|
||||
|
||||
if (is_siteadmin()) {
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', new lang_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
$ADMIN->add('roles', new admin_externalpage('admins', get_string('siteadministrators', 'role'), "$CFG->wwwroot/$CFG->admin/roles/admins.php"));
|
||||
}
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', new lang_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', new lang_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', new lang_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));
|
||||
$ADMIN->add('roles', new admin_externalpage('checkpermissions', get_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
|
||||
|
||||
} // end of speedup
|
||||
|
||||
@@ -1,127 +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/>.
|
||||
|
||||
/**
|
||||
* Steps definitions related with administration.
|
||||
*
|
||||
* @package core
|
||||
* @category test
|
||||
* @copyright 2013 David Monllaó
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
|
||||
|
||||
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
|
||||
require_once(__DIR__ . '/../../../lib/behat/behat_field_manager.php');
|
||||
|
||||
use Behat\Gherkin\Node\TableNode as TableNode,
|
||||
Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
|
||||
|
||||
/**
|
||||
* Site administration level steps definitions.
|
||||
*
|
||||
* @package core
|
||||
* @category test
|
||||
* @copyright 2013 David Monllaó
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class behat_admin extends behat_base {
|
||||
|
||||
/**
|
||||
* Sets the specified site settings. A table with | Setting label | value | is expected.
|
||||
*
|
||||
* @Given /^I set the following administration settings values:$/
|
||||
* @param TableNode $table
|
||||
*/
|
||||
public function i_set_the_following_administration_settings_values(TableNode $table) {
|
||||
|
||||
if (!$data = $table->getRowsHash()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($data as $label => $value) {
|
||||
|
||||
// We expect admin block to be visible, otherwise go to homepage.
|
||||
if (!$this->getSession()->getPage()->find('css', '.block_settings')) {
|
||||
$this->getSession()->visit($this->locate_path('/'));
|
||||
$this->wait(self::TIMEOUT, '(document.readyState === "complete")');
|
||||
}
|
||||
|
||||
// Search by label.
|
||||
$searchbox = $this->find_field(get_string('searchinsettings', 'admin'));
|
||||
$searchbox->setValue($label);
|
||||
$submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]');
|
||||
$submitsearch->press();
|
||||
|
||||
$this->wait(self::TIMEOUT, '(document.readyState === "complete")');
|
||||
|
||||
// Admin settings does not use the same DOM structure than other moodle forms
|
||||
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
|
||||
$exception = new ElementNotFoundException($this->getSession(), '"' . $label . '" administration setting ');
|
||||
|
||||
// The argument should be converted to an xpath literal.
|
||||
$label = $this->getSession()->getSelectorsHandler()->xpathLiteral($label);
|
||||
|
||||
// Single element settings.
|
||||
try {
|
||||
$fieldxpath = "//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]" .
|
||||
"[@id=//label[contains(normalize-space(.), $label)]/@for]";
|
||||
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
|
||||
|
||||
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
|
||||
"/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div");
|
||||
|
||||
} catch (ElementNotFoundException $e) {
|
||||
|
||||
// Multi element settings, interacting only the first one.
|
||||
$fieldxpath = "//descendant::label[.= $label]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
|
||||
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
|
||||
$fieldnode = $this->find('xpath', $fieldxpath);
|
||||
|
||||
// It is the same one that contains the type.
|
||||
$formfieldtypenode = $fieldnode;
|
||||
}
|
||||
|
||||
// Getting the class which contains the field type.
|
||||
$classes = explode(' ', $formfieldtypenode->getAttribute('class'));
|
||||
foreach ($classes as $class) {
|
||||
if (substr($class, 0, 5) == 'form-') {
|
||||
$type = substr($class, 5);
|
||||
}
|
||||
}
|
||||
|
||||
// Instantiating the appropiate field type.
|
||||
$field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession());
|
||||
$field->set_value($value);
|
||||
|
||||
$this->find_button(get_string('savechanges'))->press();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits with the provided params if we are running a JS session.
|
||||
*
|
||||
* @param int $timeout
|
||||
* @param string $javascript
|
||||
* @return void
|
||||
*/
|
||||
protected function wait($timeout, $javascript = false) {
|
||||
if ($this->running_javascript()) {
|
||||
$this->getSession()->wait($timeout, $javascript);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
@core @core_admin
|
||||
Feature: Display extended course names
|
||||
In order to display more info about the courses
|
||||
As an admin
|
||||
I need to display courses short names along with courses full names
|
||||
|
||||
Background:
|
||||
Given the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Course fullname | C_shortname | 0 |
|
||||
And I log in as "admin"
|
||||
|
||||
Scenario: Courses list without extended course names (default value)
|
||||
Then I should see "Course fullname"
|
||||
And I should not see "C_shortname Course fullname"
|
||||
|
||||
Scenario: Courses list with extended course names
|
||||
Given I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
|
||||
And I check "Display extended course names"
|
||||
When I press "Save changes"
|
||||
And I am on homepage
|
||||
Then I should see "C_shortname Course fullname"
|
||||
@@ -1,69 +0,0 @@
|
||||
@core @core_admin
|
||||
Feature: An administrator can filter user accounts by role, cohort and other profile fields
|
||||
In order to find the user accounts I am looking for
|
||||
As an admin
|
||||
I need to filter the users account list using different filter
|
||||
|
||||
Background:
|
||||
Given the following "users" exists:
|
||||
| username | firstname | lastname | email | auth | confirmed |
|
||||
| user1 | User | One | one@asd.com | manual | 0 |
|
||||
| user2 | User | Two | one@asd.com | ldap | 1 |
|
||||
| user3 | User | Three | one@asd.com | manual | 1 |
|
||||
| user4 | User | Four | one@asd.com | ldap | 0 |
|
||||
And the following "cohorts" exists:
|
||||
| name | idnumber |
|
||||
| Cohort 1 | CH1 |
|
||||
And the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exists:
|
||||
| user | course | role |
|
||||
| user1 | C1 | student |
|
||||
| user2 | C1 | student |
|
||||
| user3 | C1 | student |
|
||||
And I log in as "admin"
|
||||
And I add "user2" user to "CH1" cohort
|
||||
And I add "user3" user to "CH1" cohort
|
||||
And I follow "Browse list of users"
|
||||
|
||||
@javascript
|
||||
Scenario: Filter user accounts by role and cohort
|
||||
When I fill the moodle form with:
|
||||
| courserole_rl | Student |
|
||||
| courserole_ct | any category |
|
||||
| courserole | C1 |
|
||||
And I press "Add filter"
|
||||
Then I should see "User One"
|
||||
And I should see "User Two"
|
||||
And I should see "User Three"
|
||||
And I should not see "User Four"
|
||||
And I fill the moodle form with:
|
||||
| cohort | CH1 |
|
||||
And I press "Add filter"
|
||||
And I should not see "User One"
|
||||
And I should see "User Two"
|
||||
And I should see "User Three"
|
||||
And I should not see "User Four"
|
||||
And I press "Remove all filters"
|
||||
And I should see "User One"
|
||||
And I should see "User Two"
|
||||
And I should see "User Three"
|
||||
And I should see "User Four"
|
||||
|
||||
@javascript
|
||||
Scenario: Filter user accounts by confirm and authentication method
|
||||
When I fill the moodle form with:
|
||||
| Confirmed | No |
|
||||
And I press "Add filter"
|
||||
Then I should see "User One"
|
||||
And I should not see "User Two"
|
||||
And I should not see "User Three"
|
||||
And I should see "User Four"
|
||||
And I fill the moodle form with:
|
||||
| Authentication | manual |
|
||||
And I press "Add filter"
|
||||
And I should see "User One"
|
||||
And I should not see "User Two"
|
||||
And I should not see "User Three"
|
||||
And I should not see "User Four"
|
||||
@@ -1,46 +0,0 @@
|
||||
@core @core_admin @_only_local
|
||||
Feature: Upload users
|
||||
In order to add users to the system
|
||||
As an admin
|
||||
I need to upload files containing the users data
|
||||
|
||||
@javascript
|
||||
Scenario: Upload users enrolling them on courses and groups
|
||||
Given the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Maths | math102 | 0 |
|
||||
And the following "groups" exists:
|
||||
| name | course | idnumber |
|
||||
| Section 1 | math102 | S1 |
|
||||
| Section 3 | math102 | S3 |
|
||||
And I log in as "admin"
|
||||
And I collapse "Front page settings" node
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Upload users"
|
||||
When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filepicker
|
||||
And I press "Upload users"
|
||||
Then I should see "Upload users preview"
|
||||
And I should see "Tom"
|
||||
And I should see "Jones"
|
||||
And I should see "verysecret"
|
||||
And I should see "jonest@someplace.edu"
|
||||
And I should see "Reznor"
|
||||
And I should see "course1"
|
||||
And I should see "math102"
|
||||
And I should see "group1"
|
||||
And I should see "Section 1"
|
||||
And I press "Upload users"
|
||||
And I press "Continue"
|
||||
And I follow "Browse list of users"
|
||||
And I should see "Tom Jones"
|
||||
And I should see "Trent Reznor"
|
||||
And I should see "reznor@someplace.edu"
|
||||
And I am on homepage
|
||||
And I follow "Maths"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I select "Section 1 (1)" from "groups"
|
||||
And I wait "4" seconds
|
||||
And the "members" select box should contain "Tom Jones"
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$strtimezone = get_string("timezone");
|
||||
$strsavechanges = get_string("savechanges");
|
||||
@@ -44,7 +44,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,72 +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();
|
||||
|
||||
// This 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);
|
||||
// Release session.
|
||||
session_get_instance()->write_close();
|
||||
|
||||
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;
|
||||
$params = array('current'=>$current, 'total'=>$total);
|
||||
echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', $params), 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');
|
||||
|
||||
// This calls require_login and checks moodle/site:config.
|
||||
admin_externalpage_setup('assignmentupgrade');
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
|
||||
|
||||
$actions = array();
|
||||
|
||||
$header = get_string('pluginname', 'tool_assignmentupgrade');
|
||||
$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
|
||||
|
||||
echo $renderer->index_page($header, $actions);
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for the assignment upgrade tool
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['areyousure'] = 'Are you sure?';
|
||||
$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
|
||||
$string['assignmentid'] = 'Assignment ID';
|
||||
$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
|
||||
$string['assignmentsperpage'] = 'Assignments per page';
|
||||
$string['assignmenttype'] = 'Assignment type';
|
||||
$string['backtoindex'] = 'Back to index';
|
||||
$string['batchoperations'] = 'Batch operations';
|
||||
$string['batchupgrade'] = 'Upgrade multiple assignments';
|
||||
$string['confirmbatchupgrade'] = 'Confirm batch upgrade assignments';
|
||||
$string['conversioncomplete'] = 'Assignment converted';
|
||||
$string['conversionfailed'] = 'The assignment conversion was not successful. The log from the upgrade was: <br />{$a}';
|
||||
$string['listnotupgraded'] = 'List assignments that have not been upgraded';
|
||||
$string['listnotupgraded_desc'] = 'You can upgrade individual assignments from here';
|
||||
$string['noassignmentsselected'] = 'No assignments selected';
|
||||
$string['noassignmentstoupgrade'] = 'There are no assignments that require upgrading';
|
||||
$string['notsupported'] = '';
|
||||
$string['notupgradedintro'] = 'This page lists the assignments created with an older version of Moodle that have not been upgraded to the new assignment module in Moodle 2.3. Not all assignments can be upgraded - if they were created with a custom assignment subtype, then that subtype will need to be upgraded to the new assignment plugin format in order to complete the upgrade.';
|
||||
$string['notupgradedtitle'] = 'Assignments not upgraded';
|
||||
$string['pluginname'] = 'Assignment upgrade helper';
|
||||
$string['select'] = 'Select';
|
||||
$string['submissions'] = 'Submissions';
|
||||
$string['supported'] = 'Upgrade';
|
||||
$string['updatetable'] = 'Update table';
|
||||
$string['unknown'] = 'Unknown';
|
||||
$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
|
||||
$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
|
||||
$string['upgradeassignmentfailed'] = 'Result: Upgrade failed. The log from the upgrade was: <br/><div class="tool_assignmentupgrade_upgradelog">{$a->log}</div>';
|
||||
$string['upgradable'] = 'Upgradable';
|
||||
$string['upgradeselected'] = 'Upgrade selected assignments';
|
||||
$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
|
||||
$string['upgradeall'] = 'Upgrade all assignments';
|
||||
$string['upgradeallconfirm'] = 'Upgrade all assignments?';
|
||||
$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
|
||||
$string['upgradesingle'] = 'Upgrade single assignment';
|
||||
$string['viewcourse'] = 'View the course with the converted assignment';
|
||||
@@ -1,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/>.
|
||||
|
||||
/**
|
||||
* 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');
|
||||
|
||||
// This 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,234 +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
|
||||
*/
|
||||
public function __construct($data) {
|
||||
if (isset($data->upgradeselected)) {
|
||||
$this->continuemessage = get_string('upgradeselectedcount',
|
||||
'tool_assignmentupgrade',
|
||||
count(explode(',', $data->selectedassignments)));
|
||||
$urlparams = array('upgradeselected'=>'1',
|
||||
'confirm'=>'1',
|
||||
'sesskey'=>sesskey(),
|
||||
'selected'=>$data->selectedassignments);
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', $urlparams);
|
||||
} 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');
|
||||
$urlparams = array('upgradeall'=>'1', 'confirm'=>'1', 'sesskey'=>sesskey());
|
||||
$this->continueurl = new moodle_url('/admin/tool/assignmentupgrade/batchupgrade.php', $urlparams);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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,70 +0,0 @@
|
||||
M.tool_assignmentupgrade = {
|
||||
init_upgrade_table: function(Y) {
|
||||
|
||||
Y.use('node', function(Y) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
node.on('change', function(e) {
|
||||
rowelement = e.currentTarget.get('parentNode').get('parentNode');
|
||||
if (e.currentTarget.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
if (node.get('checked')) {
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
} else {
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var selectall = Y.one('th.c0 input');
|
||||
selectall.on('change', function(e) {
|
||||
if (e.currentTarget.get('checked')) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', true);
|
||||
rowelement.setAttribute('class', 'selectedrow');
|
||||
});
|
||||
} else {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
checkboxes.each(function(node) {
|
||||
rowelement = node.get('parentNode').get('parentNode');
|
||||
node.set('checked', false);
|
||||
rowelement.setAttribute('class', 'unselectedrow');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var upgradeselectedbutton = Y.one('#id_upgradeselected');
|
||||
upgradeselectedbutton.on('click', function(e) {
|
||||
checkboxes = Y.all('td.c0 input');
|
||||
var selectedassignments = [];
|
||||
checkboxes.each(function(node) {
|
||||
if (node.get('checked')) {
|
||||
selectedassignments[selectedassignments.length] = node.get('value');
|
||||
}
|
||||
});
|
||||
|
||||
operation = Y.one('#id_operation');
|
||||
assignmentsinput = Y.one('input.selectedassignments');
|
||||
assignmentsinput.set('value', selectedassignments.join(','));
|
||||
if (selectedassignments.length == 0) {
|
||||
alert(M.str.tool_assignmentupgrade.noassignmentsselected);
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
var perpage = Y.one('#id_perpage');
|
||||
perpage.on('change', function(e) {
|
||||
window.onbeforeunload = null;
|
||||
Y.one('.tool_assignmentupgrade_paginationform form').submit();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,57 +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.');
|
||||
|
||||
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
|
||||
*/
|
||||
public 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,249 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Defines the renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Renderer for the assignment upgrade helper plugin.
|
||||
*
|
||||
* @package tool_assignmentupgrade
|
||||
* @copyright 2012 NetSpot
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class tool_assignmentupgrade_renderer extends plugin_renderer_base {
|
||||
|
||||
/**
|
||||
* Render the index page.
|
||||
* @param string $detected information about what sort of site was detected.
|
||||
* @param array $actions list of actions to show on this page.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function index_page($detected, array $actions) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('pluginname', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box($detected);
|
||||
$output .= html_writer::start_tag('ul');
|
||||
foreach ($actions as $action) {
|
||||
$output .= html_writer::tag('li',
|
||||
html_writer::link($action->url, $action->name) . ' - ' .
|
||||
$action->description);
|
||||
}
|
||||
$output .= html_writer::end_tag('ul');
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a page that is just a simple message.
|
||||
* @param string $message the message to display.
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function simple_message_page($message) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading($message);
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch operation page
|
||||
* @param stdClass $data Submitted form data with list of assignments to upgrade
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function confirm_batch_operation_page(stdClass $data) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
|
||||
$output .= $this->heading(get_string('confirmbatchupgrade', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_confirmbatch');
|
||||
|
||||
$output .= $this->render(new tool_assignmentupgrade_batchoperationconfirm($data));
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the confirm batch continue / cancel links
|
||||
* @param tool_assignmentupgrade_batchoperationconfirm $confirm Wrapper class to determine the continue message and url
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function render_tool_assignmentupgrade_batchoperationconfirm(tool_assignmentupgrade_batchoperationconfirm $confirm) {
|
||||
$output = '';
|
||||
|
||||
if ($confirm->continueurl) {
|
||||
$output .= $this->output->confirm($confirm->continuemessage,
|
||||
$confirm->continueurl,
|
||||
tool_assignmentupgrade_url('listnotupgraded'));
|
||||
} else {
|
||||
$output .= $this->output->box($confirm->continuemessage);
|
||||
$output .= $this->output->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the list of assignments that still need to be upgraded page.
|
||||
* @param tool_assignmentupgrade_assignments_table $assignments of data about assignments.
|
||||
* @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade
|
||||
* @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments,
|
||||
tool_assignmentupgrade_batchoperations_form $batchform,
|
||||
tool_assignmentupgrade_pagination_form $paginationform) {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array());
|
||||
$this->page->requires->string_for_js('noassignmentsselected', 'tool_assignmentupgrade');
|
||||
|
||||
$output .= $this->heading(get_string('notupgradedtitle', 'tool_assignmentupgrade'));
|
||||
$output .= $this->box(get_string('notupgradedintro', 'tool_assignmentupgrade'));
|
||||
$output .= $this->output->spacer(array(), true);
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_upgradetable');
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_paginationform');
|
||||
$output .= $this->moodleform($paginationform);
|
||||
$output .= $this->container_end();
|
||||
|
||||
$output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true);
|
||||
$output .= $this->container_end();
|
||||
|
||||
if ($assignments->anyupgradableassignments) {
|
||||
$output .= $this->container_start('tool_assignmentupgrade_batchform');
|
||||
$output .= $this->moodleform($batchform);
|
||||
$output .= $this->container_end();
|
||||
}
|
||||
|
||||
$output .= $this->back_to_index();
|
||||
$output .= $this->footer();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the result of an assignment conversion
|
||||
* @param stdClass $assignmentsummary data about the assignment to upgrade.
|
||||
* @param bool $success Set to true if the outcome of the conversion was a success
|
||||
* @param string $log The log from the conversion
|
||||
* @return string html to output.
|
||||
*/
|
||||
public function convert_assignment_result($assignmentsummary, $success, $log) {
|
||||
$output = '';
|
||||
|
||||
$output .= $this->container_start('tool_assignmentupgrade_result');
|
||||
$output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary));
|
||||
if (!$success) {
|
||||
$output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log));
|
||||
} else {
|
||||
$output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
|
||||
$url = new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid));
|
||||
$output .= $this->container(html_writer::link($url, 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,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/>.
|
||||
|
||||
/**
|
||||
* 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,54 +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.');
|
||||
|
||||
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.
|
||||
*/
|
||||
public 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->setType('selectedassignments', PARAM_SEQUENCE);
|
||||
|
||||
$mform->addElement('submit', 'upgradeselected', get_string('upgradeselected', 'tool_assignmentupgrade'));
|
||||
$mform->addElement('submit', 'upgradeall', get_string('upgradeall', 'tool_assignmentupgrade'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,182 +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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public function get_rows_per_page() {
|
||||
return $this->perpage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a link to the assignment instance
|
||||
*
|
||||
* @param stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
public function col_name(stdClass $row) {
|
||||
$url = new moodle_url('/mod/assignment/view.php', array('a' => $row->id));
|
||||
return html_writer::link($url, $row->name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format a link to the upgrade single tool
|
||||
*
|
||||
* @param stdClass $row (contains cached result from previous upgradable check)
|
||||
* @return string
|
||||
*/
|
||||
public function col_upgradable(stdClass $row) {
|
||||
if ($row->upgradable) {
|
||||
$urlparams = array('id' => $row->id, 'sesskey' => sesskey());
|
||||
$url = new moodle_url('/admin/tool/assignmentupgrade/upgradesingleconfirm.php', $urlparams);
|
||||
return html_writer::link($url, 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
|
||||
*/
|
||||
public 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 '';
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user