Compare commits
1026 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81716d0d33 | |||
| 658bf42b26 | |||
| 3ee8f1715f | |||
| 2334e9083c | |||
| 4a6a574f2a | |||
| a205123f06 | |||
| a6ee2f5e7d | |||
| 8590fd913d | |||
| e7f72d1658 | |||
| 64eed73fa2 | |||
| 381ae36075 | |||
| 1bdeb2ca8e | |||
| 8af2a809fb | |||
| 5d224d17b6 | |||
| f001154b33 | |||
| bca7452938 | |||
| b366308091 | |||
| f38485140c | |||
| 258be26525 | |||
| 5f4c712ea8 | |||
| 6d9aa82c99 | |||
| 4c5686d97f | |||
| d688c342ad | |||
| 3f676beac0 | |||
| 978962c8bb | |||
| 87cc153beb | |||
| 7647e09126 | |||
| 0fcd21c3bc | |||
| b09069a4c7 | |||
| 576fd161a0 | |||
| 16cba4cf88 | |||
| fc55b4e900 | |||
| ab8c78b03a | |||
| ba6c4a8701 | |||
| 6337086aca | |||
| 111bfff48a | |||
| 31d7714a84 | |||
| 68225f50b4 | |||
| b9f0af5fb0 | |||
| 7fe2220fc0 | |||
| a26d994d2b | |||
| e7d1f700d9 | |||
| 9fc3e0ebef | |||
| cee7b95a10 | |||
| f933b27c32 | |||
| 16ba73512e | |||
| 84a8415baf | |||
| f6590fb484 | |||
| 3662bce5b4 | |||
| 1dd2451954 | |||
| 8d2accb64c | |||
| 02e44e7cf4 | |||
| 8df45f47bd | |||
| 399266ce40 | |||
| 03fa434bb3 | |||
| 644f6213f1 | |||
| 8fad496688 | |||
| c451c1f6bd | |||
| c8ddb345b9 | |||
| 05c7ec6f2b | |||
| f7a6049e57 | |||
| ff27a09eca | |||
| a166e72e43 | |||
| 4848d55a9e | |||
| 0be7c25ebe | |||
| 2f6c832d5c | |||
| a2c7397c42 | |||
| 4565e9cc0a | |||
| b1106eb5ba | |||
| 5f6604b578 | |||
| 018dcb996d | |||
| 131f438648 | |||
| bbc2e4226a | |||
| ab34a057ed | |||
| 092c819e68 | |||
| 20598e0da3 | |||
| 06e9af99e7 | |||
| df415fbf08 | |||
| 8bcabc74e2 | |||
| 57bcdda9f5 | |||
| d03e4db1b8 | |||
| 8a600d7d1d | |||
| 3926deafe1 | |||
| c4ad9158e3 | |||
| aa140aabfd | |||
| 0535cadae5 | |||
| a5eb9f335f | |||
| b391b14bda | |||
| 09026b19d9 | |||
| 893e0c5c0b | |||
| eefa6d6e06 | |||
| 3c382acc28 | |||
| bf442dc9d6 | |||
| 0c59a23c67 | |||
| 7a6112792c | |||
| 6a602d47e0 | |||
| 5881bb7e3c | |||
| 40343df7fd | |||
| 783da26290 | |||
| 73fafc3886 | |||
| 522f608d02 | |||
| 12c55f3cd4 | |||
| bb515027b5 | |||
| fe3b0f3a2f | |||
| 5c0567b4cd | |||
| 8fdd5ab2b3 | |||
| 7ba7461530 | |||
| 47e9035598 | |||
| 7134ebc80b | |||
| feffd1dffe | |||
| 0aa35815c4 | |||
| f897f346a3 | |||
| ac722cc42b | |||
| 219633ea2b | |||
| 5325f8b8cf | |||
| b39cadbfe7 | |||
| 020181047d | |||
| a3152e449d | |||
| 02997ce175 | |||
| 499c23e8fc | |||
| d8e2e28044 | |||
| 1cb2266ef7 | |||
| 40e5eb1b33 | |||
| 7f2a3e678e | |||
| 4b2b7a7110 | |||
| 6687be174a | |||
| f5ca7ebe1a | |||
| f698f3f394 | |||
| 6157b82c7b | |||
| 7c934d06ed | |||
| b088919164 | |||
| 849f614bd1 | |||
| dec96d4f2c | |||
| b2878fc5ae | |||
| ab48c1bb53 | |||
| ec3db5a310 | |||
| 31861ff29c | |||
| 7a1205eea9 | |||
| 70d9c95acf | |||
| 0e3e960a33 | |||
| d805c3462e | |||
| c3219da409 | |||
| c7ba7904cb | |||
| be23a53ca9 | |||
| 79da6d8717 | |||
| 931ade40e3 | |||
| f64fb7b192 | |||
| 353d033843 | |||
| 35d606e6fa | |||
| 11697b48ea | |||
| 60ffb53a7d | |||
| b5987b0f49 | |||
| b1f505771e | |||
| 91d7f813e5 | |||
| 304d7785ca | |||
| 7e092fdaed | |||
| 3f50cab58d | |||
| 8d5b052f35 | |||
| 844bad05a9 | |||
| ad03ae446e | |||
| 043b94f66d | |||
| b95c3ab896 | |||
| 779a4a8da4 | |||
| 54242af0d6 | |||
| e9564a5a80 | |||
| 240aca4b34 | |||
| 5d0f5a599b | |||
| 3ee236820a | |||
| 17ec8eb684 | |||
| 8c5b0c41bb | |||
| 730cb6bac3 | |||
| 6a6681294a | |||
| 96376e9a4f | |||
| 96112b5224 | |||
| f2deadb30c | |||
| 87d8623181 | |||
| 4c94c21b11 | |||
| fd2f02d4cd | |||
| 775f689b0f | |||
| c563a9a0d1 | |||
| cc7fa0dc05 | |||
| 729035fdaa | |||
| 76bf541df8 | |||
| 41a03b45f0 | |||
| d41947c6be | |||
| c525b27592 | |||
| 713386aadb | |||
| fd43f7d026 | |||
| 48cbf566bb | |||
| cd86c938b2 | |||
| ca2129424f | |||
| a4ad03f175 | |||
| 8b50d2a76e | |||
| 06cffaf0bb | |||
| bbf9b1624d | |||
| 2563c5ef7b | |||
| 6879123761 | |||
| eab79dc13d | |||
| 958facf055 | |||
| 14159d0960 | |||
| 07b586eaa3 | |||
| 7170501293 | |||
| 4d01ada343 | |||
| a6ccb416f1 | |||
| fcb12a1e0c | |||
| c39c66a5e8 | |||
| 785ae439eb | |||
| d348c53f1f | |||
| 880fd2146c | |||
| b9846a9b9e | |||
| 7641819df0 | |||
| 740aa005dc | |||
| c061b8d2a5 | |||
| 9ba291e88d | |||
| 67d5ab6dc1 | |||
| 05c1cfba93 | |||
| 71f64e123b | |||
| bf2919bf84 | |||
| 30739c3daf | |||
| bfe42924da | |||
| 67fb6d3aaf | |||
| 69ec0a8b1d | |||
| 5c219ea46d | |||
| 60a60432a1 | |||
| 3a4c2fd089 | |||
| 610603be4d | |||
| 7adf67875d | |||
| cf565fd7cf | |||
| 33de9f7bdc | |||
| 17df1ae4bd | |||
| 455d308f5d | |||
| ae384ef160 | |||
| 6bebcf8d72 | |||
| c6a0f9d5bf | |||
| e48feed988 | |||
| 3e54b808bc | |||
| 0817d5cac0 | |||
| ce729f49c8 | |||
| 0f192e2cd6 | |||
| 01a16f7e5e | |||
| 5aca97a20a | |||
| 476fd9c716 | |||
| 52376d940f | |||
| d288fa5255 | |||
| a53cef7e80 | |||
| d8eece23c9 | |||
| 46a244605d | |||
| e808d25f56 | |||
| ada728e24d | |||
| 5a74165523 | |||
| 9a2efc9fb0 | |||
| 76c1650d02 | |||
| b086c2b527 | |||
| edea91f37b | |||
| b13f7b84ec | |||
| ce3b1d1f7d | |||
| 4f446b2e36 | |||
| 21951923a5 | |||
| 16a0e6f05c | |||
| e9d3eca323 | |||
| 72a2547d05 | |||
| daec2fede2 | |||
| ae078a9809 | |||
| 0a9f61b55f | |||
| ac4f6d455f | |||
| fa6a30b75c | |||
| 4bcc7ebfd6 | |||
| 56a800aac5 | |||
| 6cdbd5d52a | |||
| 64900c048e | |||
| fe930cf3ca | |||
| a0deb5db60 | |||
| 6a7ce0c1ab | |||
| 170a9c4612 | |||
| 393c9b4ff4 | |||
| 3551966092 | |||
| f11d6df519 | |||
| af478c0b2b | |||
| 9025fec405 | |||
| 05b2871dfa | |||
| d06863d95f | |||
| df52003fb1 | |||
| 14014fb7e1 | |||
| 4784696533 | |||
| b294bc4b1d | |||
| 543009a54d | |||
| 667d2f2a86 | |||
| 23e3e468aa | |||
| d0ef834745 | |||
| 4f6ae69e0e | |||
| efead3b909 | |||
| 2f518143de | |||
| be912538fa | |||
| 232d36dffa | |||
| 215e628dcf | |||
| 32ad57746b | |||
| 54157606e0 | |||
| a3a4cd3ed6 | |||
| 537718f85a | |||
| 9d85990f62 | |||
| 6d3566f8d5 | |||
| 5867bfb50e | |||
| cfb9c52577 | |||
| 7e6b0b3b6e | |||
| 767141c19e | |||
| 92ce3481fc | |||
| de1a5345cb | |||
| d6be31eeed | |||
| 6afe855886 | |||
| 98a792faaf | |||
| bbc0d9abbf | |||
| 9f71c9e713 | |||
| 6c8e8b5ed4 | |||
| 3d9f0f81d6 | |||
| 9b09f7d0cd | |||
| 319b375ecc | |||
| 5c2ba38c45 | |||
| 5f94c13b6b | |||
| e825f27967 | |||
| a9c2c8fd8f | |||
| eb7ec77d68 | |||
| ac6e435422 | |||
| a414246dc9 | |||
| 729fbeee94 | |||
| 1f49a7b780 | |||
| 0915679c36 | |||
| 52b538621e | |||
| ea6e952d88 | |||
| 95f6c01b03 | |||
| e51de1e846 | |||
| ab74168b2d | |||
| d94dc588ab | |||
| d6513bbb0c | |||
| 0f4f911059 | |||
| e865ded4ba | |||
| 0cb29cc411 | |||
| 4f5dbd132c | |||
| f5fb84cee7 | |||
| 7aab220e4b | |||
| fdcdc04730 | |||
| 3b8bad6ff0 | |||
| 000969becd | |||
| 2fb7c49f17 | |||
| 1f33691c86 | |||
| 49543158f7 | |||
| 851a89ff1b | |||
| 813ec7ad65 | |||
| fce1ce13c8 | |||
| 266fbe1a8a | |||
| 5f350e8f6d | |||
| 01d799665d | |||
| b879effb4a | |||
| a918234e91 | |||
| 11a876e1b6 | |||
| 4105fe9dd2 | |||
| 581d7b4959 | |||
| bb19372c0f | |||
| 068be67d83 | |||
| 1e2fedeef0 | |||
| ea23100a02 | |||
| 2bc269fd7b | |||
| be4c89b86a | |||
| 674b30f5f7 | |||
| 39c4f15a40 | |||
| b0778a76c3 | |||
| a615cc7bb6 | |||
| 3868b9c666 | |||
| 465fd00e04 | |||
| 8a230a7d96 | |||
| 1215e52299 | |||
| d15cbab76f | |||
| 93d64ea469 | |||
| 1ea7c62794 | |||
| b37eb1bf00 | |||
| f50f74f6e4 | |||
| ff82802366 | |||
| 3bb49201b1 | |||
| 2fe2985a53 | |||
| 8140c67e45 | |||
| a6d71a2199 | |||
| c0ba103ca7 | |||
| cda45e5506 | |||
| 5ade559e8e | |||
| 4fc61176b9 | |||
| dfec7b013f | |||
| 592188b42c | |||
| ffb71387cb | |||
| 59345eb4ec | |||
| b2a47e2052 | |||
| 228b823898 | |||
| 59cd767a99 | |||
| 46772d8c60 | |||
| 7d99d6959e | |||
| 81ed361792 | |||
| 2627a658f8 | |||
| d342c76370 | |||
| d7c8a46bc5 | |||
| 9f0b8269ac | |||
| eb347b6b68 | |||
| 1b502431a8 | |||
| dfe5f88b3b | |||
| b4bee933da | |||
| afbe3de8cf | |||
| 04aa5b2de1 | |||
| c4c8f73c4a | |||
| 8cc242516e | |||
| 8980a4e8db | |||
| 24a39b1761 | |||
| 984a8bf349 | |||
| 107b010b43 | |||
| ea563f8f99 | |||
| 3565715c76 | |||
| 005103e0bc | |||
| 141097ff80 | |||
| d6545aefbc | |||
| c6bcd06aba | |||
| 02fee14e28 | |||
| 82e8e7f569 | |||
| 75da62deee | |||
| 519bd9342a | |||
| 61ae5d36ca | |||
| b1834f2dde | |||
| 6f40f198d2 | |||
| e6622eda6a | |||
| c45855e551 | |||
| 7db29e6783 | |||
| 10332943ca | |||
| d67257815d | |||
| c53987bbb8 | |||
| aa0959690c | |||
| 890a2cfeea | |||
| c5be7d8e8e | |||
| 737c4885be | |||
| 3fe1c56cdd | |||
| b3afe8244a | |||
| 52ff6a7f44 | |||
| d22d31c659 | |||
| edffca1558 | |||
| 28408ed2ac | |||
| d4ccfc2a2b | |||
| 5f5ea8cc4c | |||
| a36175db4c | |||
| 6db95aa730 | |||
| 3e9ca9fbc5 | |||
| bf32194357 | |||
| 3b777608ac | |||
| 3920667ee3 | |||
| ea914a66ae | |||
| d565341a2f | |||
| ea65b07cdd | |||
| 6b14fdcb1d | |||
| 482fa9f6c6 | |||
| ca16eaeb31 | |||
| f855f6062b | |||
| 5d0d5d5ac5 | |||
| 31d6331615 | |||
| dc95f4a11b | |||
| 9d6f5d42eb | |||
| 6d41991acc | |||
| 46956de552 | |||
| a273084d7a | |||
| 81f186b47a | |||
| df48be741a | |||
| 8de14dc72b | |||
| 28ba0d55cc | |||
| 8809fee944 | |||
| b86fc0e2a6 | |||
| 9655b654a5 | |||
| 6492992616 | |||
| 9a652ddb2b | |||
| f343161392 | |||
| b72c80db7e | |||
| 95abee03e6 | |||
| 028677d7b2 | |||
| 9d2dda0f85 | |||
| e313ef4476 | |||
| d14c1e0687 | |||
| dc0dc7d5dd | |||
| 2b83b7f98b | |||
| f0eec3b641 | |||
| e8a0fc9a4f | |||
| e9ececbb1e | |||
| 5352ceba67 | |||
| dc2590e587 | |||
| e13d05801c | |||
| 16aefd75fb | |||
| 667e2e0293 | |||
| 7716babeb2 | |||
| 6d21fd37f2 | |||
| 6901fa7955 | |||
| e209e0b09e | |||
| f5e82bc7f4 | |||
| 026bcf8ce1 | |||
| 7aaedff8de | |||
| 2656b1351f | |||
| 81a383ca7a | |||
| f8bccb148a | |||
| 540bab47d4 | |||
| 30f89d6833 | |||
| f9d5fd3b3c | |||
| f9ce68ee7f | |||
| c0605295bd | |||
| 85093cf4f9 | |||
| 0830bae4d7 | |||
| 1ba3960285 | |||
| 6459f225b8 | |||
| 1b5910c4a5 | |||
| a54b8dd3af | |||
| 667ab3252b | |||
| b1992e65cf | |||
| 10a95b432c | |||
| ad08fdc277 | |||
| 38e5dbf319 | |||
| ec2a28a607 | |||
| 278a229c25 | |||
| 3d89198946 | |||
| 78e0146055 | |||
| 6eb6cd8753 | |||
| fbca88e692 | |||
| 2953d5e865 | |||
| 86e6076b3b | |||
| c3357723de | |||
| 09368e3938 | |||
| a95ae47bdf | |||
| 50d673157b | |||
| 65eed52ded | |||
| d1db7bee92 | |||
| 39b5b3fa2a | |||
| e317d04919 | |||
| dff0db9ad5 | |||
| 746546a8f8 | |||
| b3cc742cf9 | |||
| c4c575979e | |||
| 3399a22c9f | |||
| 4dd0497164 | |||
| 826293c75b | |||
| 5a9126f75a | |||
| a2f1ef3067 | |||
| 266cc04fe7 | |||
| b328523cc1 | |||
| a5c411d4c2 | |||
| 583a7283e9 | |||
| fc613dff69 | |||
| 4d4267739c | |||
| a282d0ffda | |||
| 87b490dfc6 | |||
| 580f2fbc07 | |||
| 047d30d1eb | |||
| 1e22bc9c04 | |||
| e40488f80c | |||
| c37053ea2f | |||
| e6c136e1bf | |||
| 1dea7ebb04 | |||
| f99d236832 | |||
| dbe0be0059 | |||
| 3b0fb381ea | |||
| 61367e6417 | |||
| 719e7b04f8 | |||
| 5094d166b7 | |||
| dd8d521d91 | |||
| 81cdaada93 | |||
| 7cfb83477c | |||
| 638f95b1ff | |||
| 88478a664f | |||
| 67b0821af9 | |||
| e1c4617441 | |||
| 3395f2d67e | |||
| 41ab15fba5 | |||
| 1fc49f0019 | |||
| 2a40936834 | |||
| 13df5aeef3 | |||
| 7acaa63d09 | |||
| feffa4e695 | |||
| fec5a6a63f | |||
| cf055081ef | |||
| 00d26a208b | |||
| d4269e95c0 | |||
| 91162b4688 | |||
| a7eedb343c | |||
| f861185a4a | |||
| b7637a30d4 | |||
| c032b59db9 | |||
| 312447111c | |||
| 3af4a3653c | |||
| 847179dc91 | |||
| bc3df42048 | |||
| c7da6f7a8f | |||
| e6cf424727 | |||
| e05566015e | |||
| 3c7f99a447 | |||
| 7d6cac54f3 | |||
| 3ba2985594 | |||
| b369ff55fe | |||
| 718ad19f47 | |||
| 9dd0b37817 | |||
| 3269b238a7 | |||
| 6b708b9844 | |||
| 978704f095 | |||
| d2802df553 | |||
| 44a334d874 | |||
| d61bf02f18 | |||
| 4dddd64b5f | |||
| fe8bc4c9a5 | |||
| cefc7e817e | |||
| 2ab968e937 | |||
| 32dcc87484 | |||
| fc6a91994e | |||
| 02a7699f0d | |||
| 03aa0dfa10 | |||
| 9e0a08bd28 | |||
| c20b762a06 | |||
| 3c8a606d85 | |||
| 546be6dd89 | |||
| 96e301a7c9 | |||
| 9ddb00e600 | |||
| 29507631a9 | |||
| 801e1f0a3e | |||
| bf3bc898ac | |||
| a00283d6cd | |||
| c1d9daca3c | |||
| 7226ce02b1 | |||
| da63e99627 | |||
| 3abe21ab94 | |||
| e1122620b5 | |||
| 2408867e8c | |||
| 96192c4459 | |||
| 77cff58927 | |||
| eece3a331a | |||
| f24f17c5bb | |||
| 2386e97f89 | |||
| d6a6331129 | |||
| c9548d4a5d | |||
| de38e2621d | |||
| 1acfbce5b6 | |||
| 5a25f84d25 | |||
| 8b72b41bf9 | |||
| b610b4c2fd | |||
| dea49bdd6c | |||
| 99de5ed02b | |||
| cb77b5b67f | |||
| a625debc38 | |||
| 15c715211e | |||
| 980d545f4f | |||
| 9ecb1bd3a4 | |||
| c5b6666eaf | |||
| 63a77d2d39 | |||
| c76f49060f | |||
| 7c81b6e273 | |||
| 752e1c2b62 | |||
| 67b69ce15b | |||
| cdb0ca8315 | |||
| f475564878 | |||
| 0bf2925db8 | |||
| 5e776a02ad | |||
| c6eed09730 | |||
| 340191ded7 | |||
| 085e317dbf | |||
| be09831ac3 | |||
| dae73c05e9 | |||
| bc700e6559 | |||
| c05eca327c | |||
| da5fb074c3 | |||
| b1db099b7e | |||
| 44ce983d45 | |||
| 66a68c1739 | |||
| 1365bacde6 | |||
| 52c018a0b5 | |||
| 4b85b71712 | |||
| f5cbbecaf5 | |||
| 72e5815533 | |||
| 434802d5ce | |||
| 34d52ad7d2 | |||
| d62413e869 | |||
| 329f046798 | |||
| 29cbd93a45 | |||
| aa6fbca550 | |||
| 8daaf761c3 | |||
| 8f202463d5 | |||
| b4e3b12234 | |||
| e64984a0bb | |||
| 8ef3483b60 | |||
| f07e21dec4 | |||
| f561b68011 | |||
| 46d552b810 | |||
| e52c4f2231 | |||
| c4dfc485eb | |||
| ef49e5c301 | |||
| 8a205861e0 | |||
| 0305fe824d | |||
| ffb410df03 | |||
| b398d5ee2a | |||
| 73f131b7a6 | |||
| e4be3d5943 | |||
| 432d39026d | |||
| 54a67a5921 | |||
| 03fd6a965e | |||
| 0d0baabf2c | |||
| 2d0b30a028 | |||
| adaf39283c | |||
| 754786f1be | |||
| a3b0dbfa80 | |||
| 90707adb7f | |||
| b8a0fb13a3 | |||
| aa9f961b7d | |||
| bad357c414 | |||
| ea6003eb8a | |||
| b60aa549fc | |||
| b6f64be2a5 | |||
| 075a591656 | |||
| 0ece16e90c | |||
| 036d3c1f90 | |||
| 6eff984aee | |||
| 264d4e0b9a | |||
| 1495667946 | |||
| 8cc7286ccc | |||
| f5cdd4d133 | |||
| b2d0ca3b7c | |||
| 000cc405ba | |||
| e384fb7b73 | |||
| 49e16355c2 | |||
| c750592ac4 | |||
| 6a3461ad1c | |||
| 746665838a | |||
| f8430195d9 | |||
| ef4145f6ae | |||
| f2cc50f192 | |||
| 4c0e951049 | |||
| 0fdddefbaa | |||
| d4120c3d7c | |||
| 509139373e | |||
| 78e72ed16b | |||
| e6829515b0 | |||
| e582b65e30 | |||
| a2631c99d9 | |||
| 01cf7d2ebc | |||
| a4ef9df2d7 | |||
| 9d5b689c8a | |||
| b9287b2fba | |||
| d48f938420 | |||
| ddde5a8c82 | |||
| c0f728ba9e | |||
| 6908193151 | |||
| 617778f2d3 | |||
| 4c31e7cfba | |||
| d4be5253aa | |||
| 2d8cf6799a | |||
| c9082a8c2f | |||
| f82c2d428a | |||
| 2ea9027bc4 | |||
| 08b3606390 | |||
| 754b76fe65 | |||
| 3ac1dedc35 | |||
| 1e5a2bf584 | |||
| 8f6dcdbaa4 | |||
| 5c34d1e3a4 | |||
| 8fb2f0fa1e | |||
| ac234d0262 | |||
| fe32b83bbf | |||
| 76a359ba93 | |||
| 7563a073c3 | |||
| d106f1d9ae | |||
| 9a9a2907c2 | |||
| c605097983 | |||
| 25f3420857 | |||
| 5fcda72588 | |||
| e00f0f9f51 | |||
| 548daac7d9 | |||
| 19bbe230f6 | |||
| 66ea5000db | |||
| 706e019764 | |||
| 1b7f43a40a | |||
| 247612cfe7 | |||
| 049100796f | |||
| b1ca03e9cf | |||
| cdf198d345 | |||
| 70e5e91e9e | |||
| 7470fb3782 | |||
| d831f93c73 | |||
| 1862b9eb54 | |||
| 0d1a40f00a | |||
| 31ce4b538c | |||
| df103e8212 | |||
| c363d9d11f | |||
| 9314930280 | |||
| 43f2302fdf | |||
| c4eb7e254f | |||
| cd4b225bd0 | |||
| f84148d015 | |||
| d57d61e3a7 | |||
| b365072d7c | |||
| 687f38368e | |||
| 9eee5e0559 | |||
| 44ac5310a8 | |||
| 068e57cebc | |||
| b4b7572b9a | |||
| 14bdb2387a | |||
| 02986c8002 | |||
| 7169069bd5 | |||
| 45930f2db5 | |||
| 3e7542449b | |||
| 7a361c8b55 | |||
| 55271c3047 | |||
| 08c17336a7 | |||
| 4e94d2608b | |||
| ff20ee79f6 | |||
| d92a53d182 | |||
| c0f271aa5c | |||
| 12faa2684e | |||
| f8b8aa347b | |||
| 111f984300 | |||
| ab202116b9 | |||
| f02ca41cca | |||
| 06334957fa | |||
| 66d323459e | |||
| 7dd3b70b10 | |||
| 610b9de6f7 | |||
| d7466bdecb | |||
| 44996d00f9 | |||
| 38620c460b | |||
| 5b337cdf3b | |||
| 38972a40a4 | |||
| 8b2fc31ce0 | |||
| 2fdb54b819 | |||
| 0ca1825cab | |||
| ea81ca5f6d | |||
| 6c891932c0 | |||
| 9f9f92c6df | |||
| 1924074c76 | |||
| 38b68c5d6f | |||
| 86bce68fa8 | |||
| 95dbc030a8 | |||
| 2b051f1c8e | |||
| ee0e5d57e2 | |||
| 663f70777a | |||
| 8f8e4f01b0 | |||
| 652fd67246 | |||
| f9a14cc720 | |||
| 5f2c35db18 | |||
| 47623d4f8f | |||
| 5443a18b8f | |||
| 4c398dda96 | |||
| 79ba7581de | |||
| 5a4d292bca | |||
| c2a96d6b32 | |||
| e10ed4f09f | |||
| 14c7248d3c | |||
| a01b257195 | |||
| dc1dc6e973 | |||
| 035aa1848c | |||
| 734d2c9887 | |||
| 2f05b46ec9 | |||
| a59cbb7851 | |||
| 811c88b32f | |||
| 2a231ed650 | |||
| c4e78a1b60 | |||
| 68fefdbe14 | |||
| 49220fa70c | |||
| 4270bba267 | |||
| 01a660a583 | |||
| 3f3960656d | |||
| 434f33c00a | |||
| 402eb657a6 | |||
| 40f1246b14 | |||
| de2146b276 | |||
| 73f8658c36 | |||
| bcdfe14e02 | |||
| eaa50dbc83 | |||
| ac68f7ffc8 | |||
| acf0f21ab1 | |||
| ecc114ee3b | |||
| f879140423 | |||
| 08ffd31db1 | |||
| 49c4b1f779 | |||
| 498d403283 | |||
| 56a4ed732a | |||
| 33ff2cca85 | |||
| fced815cd7 | |||
| db11e52dec | |||
| b35e8568ff | |||
| 7750f58e0c | |||
| f2e19ba41d | |||
| d686bf500b | |||
| a09b86a693 | |||
| 0d3cbf4cca | |||
| 1b27d92ad4 | |||
| 89600ce15f | |||
| 34afe40fb5 | |||
| c74a276913 | |||
| a2da49f38b | |||
| 750ab759ed | |||
| b49d73511b | |||
| e79ddee2ad | |||
| 03f06a1412 | |||
| 9223049919 | |||
| 54d0590b47 | |||
| eb58acca4d | |||
| 7d8f674dea | |||
| f3e48e6ef0 | |||
| 66fef9f99f | |||
| 48d38fad63 | |||
| 878ece7eca | |||
| 04222f70a3 | |||
| 5ca400f257 | |||
| 071df54ffd | |||
| dd98f2e261 | |||
| 1042139455 | |||
| a42fcc51cb | |||
| 9f44d972c7 | |||
| 5c71840819 | |||
| 7ba3fb64c9 | |||
| cfe22ac921 | |||
| eca6a3b781 | |||
| 2d05c39303 | |||
| a43d392c69 | |||
| d60131c3c9 | |||
| f6e653e06a | |||
| bc43adf16d | |||
| b1e6dcb26c | |||
| ce9f2be2f9 | |||
| 86b32d51d9 | |||
| 7d2e5b6595 | |||
| 4e2767f8e0 | |||
| 17654e3845 | |||
| 63dddf351a | |||
| 2e6d42735f | |||
| 5a99c0de4d | |||
| de5aabd2d2 | |||
| 0f61744597 | |||
| 832ead4969 | |||
| 28e30091f0 | |||
| 25786a263a | |||
| caf7ccd44f | |||
| 2fafa4bf31 | |||
| a53f918172 | |||
| b9fcddd16d | |||
| 789a2500eb | |||
| 3e9b5d5a90 | |||
| 858156a995 | |||
| a38e24a544 | |||
| a5e3644bd2 | |||
| 0b949a6d0c | |||
| 1f3eb3191a | |||
| 4028fcb159 | |||
| 37208cd23a | |||
| dde4495df4 | |||
| dc8791f367 | |||
| 207190aa87 | |||
| c9d4e6da89 | |||
| 3db3acfb99 | |||
| 69ae05837c | |||
| ecb1e78aaf | |||
| a7e838796a | |||
| fe2874294c | |||
| 3c72e2f9c9 | |||
| e01b5c0e77 | |||
| b5fdd4c60a | |||
| 842b894b91 | |||
| 67c6f56f05 | |||
| 7fb92a3388 | |||
| 59e6addbc9 | |||
| 2e43b5d987 | |||
| 319aa49306 | |||
| 8f94fbcd4a | |||
| a9630e4f60 | |||
| ca791cb4a5 | |||
| cf194fc831 | |||
| fdf5a1e2fb | |||
| 41b95af210 | |||
| 536d3e22be | |||
| 722d4d1e14 | |||
| d57bc55729 | |||
| 83948780bc | |||
| 2e41586e07 | |||
| 7f43f576fc | |||
| 7684f1efcc | |||
| dcde9f020a | |||
| 9277dbd42d | |||
| 1c418003d7 | |||
| 7af6281f22 | |||
| 2c104c0152 | |||
| ac0ac75240 | |||
| c078c29bb2 | |||
| dfcfb72876 | |||
| a9a55d693e | |||
| ab387834ab | |||
| 9ae687afb0 | |||
| d98228e497 | |||
| 13770d0c36 | |||
| 11159c3c60 | |||
| 1063d08854 | |||
| bcb5c5095e | |||
| 94e3411897 | |||
| 03c17ddfec | |||
| 3fb5b92095 | |||
| 29f18614e2 | |||
| 6ed3da1da4 | |||
| 1685298e60 | |||
| 105afdcb2e | |||
| 353439a354 | |||
| 6b72b9a911 | |||
| 704ac9fe76 | |||
| bee00f48aa | |||
| 4738ab0d37 | |||
| f8c898243d | |||
| f978ad0acb | |||
| d96b410816 | |||
| 6c14c3948f | |||
| 61dcfc31e0 | |||
| 5af670da9a | |||
| 3db75c62fc | |||
| 39e018b338 | |||
| a6602862fb | |||
| c897eac5e4 | |||
| 1079c8a872 | |||
| 4e080c888a | |||
| cd8ecdb0b9 | |||
| af4542c29e | |||
| 7dba8c384f | |||
| 8375fe4f88 | |||
| 5cc1aff3db | |||
| ce78926df0 | |||
| 8af3e37948 | |||
| 5be03da1e8 | |||
| 0b963b9041 | |||
| 8d61f85e32 | |||
| df8dd5f479 |
+8
-7
@@ -3,16 +3,17 @@ README $Id$
|
||||
|
||||
If you are installing the first time, then you
|
||||
should read the installation guide which is
|
||||
stored in the doc subdirectory:
|
||||
|
||||
doc/install.html
|
||||
|
||||
You can also access the latest version (as well
|
||||
complete information about upgrading and using
|
||||
Moodle on the moodle.com web site:
|
||||
part of the Moodle documentation (along with
|
||||
information about upgrading etc):
|
||||
|
||||
http://moodle.com/doc/
|
||||
|
||||
There is a copy of all this documentation as part of
|
||||
this Moodle distribution. You can access your local
|
||||
copy of the installation guide here:
|
||||
|
||||
lang/en/docs/install.html
|
||||
|
||||
Once Moodle is installed on your machine, then
|
||||
you can also access a local copy of all this
|
||||
documentation (localised to your language) at:
|
||||
|
||||
+61
-61
@@ -1,15 +1,16 @@
|
||||
<?PHP // $Id$
|
||||
// Admin-only script to assign administrative rights to users
|
||||
// !!! based on ../course/teacher.php (cut and pasted, then mangled)
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
define("MAX_USERS_PER_PAGE", 30);
|
||||
|
||||
# sanity checks
|
||||
assert("!ereg('[^0-9]', \$_REQUEST['add'])");
|
||||
assert("!ereg('[^0-9]', \$_REQUEST['remove'])");
|
||||
optional_variable($add, "");
|
||||
optional_variable($remove, "");
|
||||
optional_variable($search, "");
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/admin/");
|
||||
redirect("$CFG->wwwroot/$CFG->admin/index.php");
|
||||
}
|
||||
|
||||
require_login();
|
||||
@@ -39,6 +40,7 @@
|
||||
"search",
|
||||
"searchagain",
|
||||
"toomanytoshow",
|
||||
"searchresults"
|
||||
);
|
||||
|
||||
foreach ($stringstoload as $stringtoload){
|
||||
@@ -46,16 +48,22 @@
|
||||
$$strstringtoload = get_string($stringtoload);
|
||||
}
|
||||
|
||||
print_header("$site->shortname: $course->shortname: $strassignadmins",
|
||||
if ($search) {
|
||||
$searchstring = $strsearchagain;
|
||||
} else {
|
||||
$searchstring = $strsearch;
|
||||
}
|
||||
|
||||
print_header("$site->shortname: $strassignadmins",
|
||||
"$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
<A HREF=\"{$_SERVER['PHP_SELF']}\">$strassignadmins</A>", "");
|
||||
"<a href=\"index.php\">$stradministration</a> ->
|
||||
<a href=\"{$_SERVER['PHP_SELF']}\">$strassignadmins</a>", "");
|
||||
|
||||
/// Get all existing admins
|
||||
$admins = get_admins();
|
||||
|
||||
/// Add an admin if one is specified
|
||||
if ($_REQUEST['add']) {
|
||||
if ($add) {
|
||||
$user = @get_record("user", "id", $_REQUEST['add']) or
|
||||
error("That account (id = {$_REQUEST['add']}) doesn't exist");
|
||||
|
||||
@@ -73,7 +81,7 @@
|
||||
}
|
||||
|
||||
/// Remove an admin if one is specified.
|
||||
if ($_REQUEST['remove']) {
|
||||
if ($remove) {
|
||||
|
||||
$user = @get_record("user", "id", $_REQUEST['remove']) or
|
||||
error("That account (id = {$_REQUEST['remove']}) doesn't exist");
|
||||
@@ -96,83 +104,75 @@
|
||||
|
||||
|
||||
/// Print the lists of existing and potential admins
|
||||
echo "<TABLE CELLPADDING=2 CELLSPACING=10 ALIGN=CENTER>";
|
||||
echo "<TR><TH WIDTH=50%>$strexistingadmins</TH><TH WIDTH=50%>$strpotentialadmins</TH></TR>";
|
||||
echo "<TR><TD WIDTH=50% NOWRAP VALIGN=TOP>";
|
||||
echo "<table cellpadding=2 cellspacing=10 align=center>";
|
||||
echo "<tr><th width=50%>$strexistingadmins</th><th width=50%>$strpotentialadmins</th></tr>";
|
||||
echo "<tr><td width=50% nowrap valign=top>";
|
||||
|
||||
/// First, show existing admins
|
||||
|
||||
if (! $admins) {
|
||||
echo "<P ALIGN=CENTER>$strnoexistingadmins</A>";
|
||||
echo "<p align=center>$strnoexistingadmins</a>";
|
||||
|
||||
$adminlist = "";
|
||||
|
||||
} else {
|
||||
$adminarray = array();
|
||||
|
||||
foreach ($admins as $admin) {
|
||||
echo "<P ALIGN=right>$admin->firstname $admin->lastname,
|
||||
$admin->email ";
|
||||
$adminarray[] = $admin->id;
|
||||
echo "<p align=right>$admin->firstname $admin->lastname,
|
||||
$admin->email ";
|
||||
if ($primaryadmin->id == $admin->id){
|
||||
print_spacer(10, 9, false);
|
||||
} else {
|
||||
echo "<A HREF=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
|
||||
TITLE=\"$strremoveadmin\"><IMG SRC=\"../pix/t/right.gif\"
|
||||
BORDER=0></A>";
|
||||
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
|
||||
title=\"$strremoveadmin\"><img src=\"../pix/t/right.gif\"
|
||||
border=0></A>";
|
||||
}
|
||||
echo "</P>";
|
||||
echo "</p>";
|
||||
}
|
||||
|
||||
$adminlist = implode(",",$adminarray);
|
||||
unset($adminarray);
|
||||
}
|
||||
|
||||
echo "<TD WIDTH=50% NOWRAP VALIGN=TOP>";
|
||||
echo "<td width=50% nowrap valign=top>";
|
||||
|
||||
/// Print list of potential admins
|
||||
|
||||
if ($search) {
|
||||
$users = get_users_search($search);
|
||||
} else {
|
||||
$users = get_users_confirmed();
|
||||
}
|
||||
$usercount = get_users(false, $search, true, $adminlist);
|
||||
|
||||
|
||||
if ($users) {
|
||||
foreach ($users as $user) { // Remove users who are already admins
|
||||
if ($admins) {
|
||||
foreach ($admins as $admin) {
|
||||
if ($admin->id == $user->id) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
$potential[] = $user;
|
||||
}
|
||||
}
|
||||
if ($usercount == 0) {
|
||||
echo "<p align=center>$strnopotentialadmins</p>";
|
||||
|
||||
if (! $potential) {
|
||||
echo "<P ALIGN=CENTER>$strnopotentialadmins</A>";
|
||||
if ($search) {
|
||||
echo "<FORM ACTION={$_SERVER['PHP_SELF']} METHOD=POST>";
|
||||
echo "<INPUT TYPE=text NAME=search SIZE=20>";
|
||||
echo "<INPUT TYPE=submit VALUE=\"$strsearchagain\">";
|
||||
echo "</FORM>";
|
||||
}
|
||||
} else if ($usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<p align=center>$strtoomanytoshow</p>";
|
||||
|
||||
} else {
|
||||
|
||||
if ($search) {
|
||||
echo "<P ALIGN=CENTER>($strsearchresults)</P>";
|
||||
echo "<p align=center>($strsearchresults : $search)</p>";
|
||||
}
|
||||
if (count($potential) <= 20) {
|
||||
foreach ($potential as $user) {
|
||||
echo "<P ALIGN=LEFT><A HREF=\"{$_SERVER['PHP_SELF']}?add=$user->id\"
|
||||
TITLE=\"$straddadmin\"><IMG SRC=\"../pix/t/left.gif\" BORDER=0></A> $user->firstname $user->lastname, $user->email";
|
||||
}
|
||||
} else {
|
||||
echo "<P ALIGN=CENTER>There are too many users to show.<BR>";
|
||||
echo "Enter a search word here.";
|
||||
echo "<FORM ACTION={$_SERVER['PHP_SELF']} METHOD=POST>";
|
||||
echo "<INPUT TYPE=text NAME=search SIZE=20>";
|
||||
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
|
||||
echo "</FORM>";
|
||||
|
||||
if (!$users = get_users(true, $search, true, $adminlist)) {
|
||||
error("Could not get users!");
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
|
||||
"title=\"$straddadmin\"><img src=\"../pix/t/left.gif\"".
|
||||
"border=0></a> $user->firstname $user->lastname, $user->email";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</TR></TABLE>";
|
||||
if ($search or $usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
|
||||
echo "<input type=text name=search size=20>";
|
||||
echo "<input type=submit value=\"$searchstring\">";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
echo "</tr></table>";
|
||||
|
||||
print_footer();
|
||||
|
||||
|
||||
+24
-10
@@ -2,7 +2,6 @@
|
||||
// config.php - allows admin to edit all configuration variables
|
||||
|
||||
include("../config.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!$site = get_site()) {
|
||||
@@ -54,7 +53,7 @@
|
||||
} else {
|
||||
$auth = $config->auth;
|
||||
}
|
||||
|
||||
require_once("$CFG->dirroot/auth/$auth/lib.php"); //just to make sure that current authentication functions are loaded
|
||||
if (! isset($config->guestloginbutton)) {
|
||||
$config->guestloginbutton = 1;
|
||||
}
|
||||
@@ -80,6 +79,9 @@
|
||||
$guestoptions[0] = get_string("hide");
|
||||
$guestoptions[1] = get_string("show");
|
||||
|
||||
$createoptions[0] = get_string("no");
|
||||
$createoptions[1] = get_string("yes");
|
||||
|
||||
$stradministration = get_string("administration");
|
||||
$strauthentication = get_string("authentication");
|
||||
$strauthenticationoptions = get_string("authenticationoptions","auth");
|
||||
@@ -89,7 +91,7 @@
|
||||
"<A HREF=\"index.php\">$stradministration</A> -> $strauthenticationoptions", "$focus");
|
||||
|
||||
echo "<CENTER><P><B>";
|
||||
echo "<form TARGET=\"_top\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
|
||||
echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
|
||||
print_string("chooseauthmethod","auth");
|
||||
|
||||
choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
|
||||
@@ -99,11 +101,11 @@
|
||||
print_simple_box_start("center", "100%", "$THEME->cellheading");
|
||||
print_heading($options[$auth]);
|
||||
|
||||
echo "<BLOCKQUOTE><CENTER><P>";
|
||||
print_simple_box_start("center", "60%", "$THEME->cellcontent");
|
||||
print_string("auth_$auth"."description", "auth");
|
||||
echo "</P></CENTER></BLOCKQUOTE>";
|
||||
print_simple_box_end();
|
||||
|
||||
echo "<HR>";
|
||||
echo "<hr>";
|
||||
|
||||
print_heading($strsettings);
|
||||
|
||||
@@ -117,7 +119,7 @@
|
||||
print_string("changepassword", "auth");
|
||||
echo ":</p></td>";
|
||||
echo "<td>";
|
||||
echo "<INPUT TYPE=\"text\" NAME=\"changepassword\" SIZE=40 VALUE=\"$config->changepassword\">";
|
||||
echo "<input type=\"text\" name=\"changepassword\" size=40 value=\"$config->changepassword\">";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
print_string("changepasswordhelp","auth");
|
||||
@@ -134,12 +136,24 @@
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
print_string("showguestlogin","auth");
|
||||
echo "</td></tr></table>";
|
||||
echo "</td></tr>";
|
||||
|
||||
if (function_exists('auth_user_create')){
|
||||
echo "<tr valign=\"top\">";
|
||||
echo "<td align=right nowrap><p>";
|
||||
print_string("auth_user_create", "auth");
|
||||
echo ":</p></td>";
|
||||
echo "<td>";
|
||||
choose_from_menu($createoptions, "auth_user_create", $config->auth_user_create, "");
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
print_string("auth_user_creation","auth");
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
||||
echo "<CENTER><P><INPUT TYPE=\"submit\" VALUE=\"";
|
||||
echo "</table><center><p><input type=\"submit\" value=\"";
|
||||
print_string("savechanges");
|
||||
echo "\"></P></CENTER></FORM>";
|
||||
echo "\"></p></center></form>";
|
||||
|
||||
print_simple_box_end();
|
||||
|
||||
|
||||
+260
-157
@@ -1,74 +1,100 @@
|
||||
<FORM METHOD="post" action="config.php" NAME="form">
|
||||
<form method="post" action="config.php" name="form">
|
||||
|
||||
<TABLE cellpadding=9 cellspacing=0 >
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>lang:</TD>
|
||||
<TD>
|
||||
<? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configlang") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>langdir:</TD>
|
||||
<TD>
|
||||
<? unset($options);
|
||||
<table cellpadding=9 cellspacing=0 >
|
||||
<tr valign=top>
|
||||
<td align=right><p>lang:</td>
|
||||
<td>
|
||||
<?php choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlang") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>langdir:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options["LTR"] = get_string("langltr");
|
||||
$options["RTL"] = get_string("langrtl");
|
||||
|
||||
choose_from_menu ($options, "langdir", $config->langdir, "", "", "");
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configlangdir") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>locale:</TD>
|
||||
<TD>
|
||||
<INPUT NAME=locale TYPE=text SIZE=10 VALUE="<?=$config->locale?>">
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configlocale") ?>
|
||||
</TD>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlangdir") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>langmenu:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("no");
|
||||
$options[1] = get_string("yes");
|
||||
|
||||
choose_from_menu ($options, "langmenu", $config->langmenu, "", "", "");
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlangmenu") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>langlist:</td>
|
||||
<td>
|
||||
<input name=langlist type=text size=40 value="<?php p($config->langlist) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlanglist") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>locale:</td>
|
||||
<td>
|
||||
<input name=locale type=text size=10 value="<?php p($config->locale) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlocale") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>country:</td>
|
||||
<td><?php choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configcountry") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>smtphosts:</td>
|
||||
<td>
|
||||
<input name=smtphosts type=text size=30 value="<?php p($config->smtphosts)?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configsmtphosts") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>smtpuser:</td>
|
||||
<td>
|
||||
<input name=smtpuser type=text size=10 value="<?php p($config->smtpuser)?>">
|
||||
</td>
|
||||
<td rowspan=2>
|
||||
<?php print_string("configsmtpuser") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>smtppass:</td>
|
||||
<td>
|
||||
<input name=smtppass type=text size=10 value="<?php p($config->smtppass)?>">
|
||||
</td>
|
||||
</TR>
|
||||
<tr valign=top>
|
||||
<td align=right><P>country:</td>
|
||||
<td><? choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
|
||||
</td>
|
||||
<TD>
|
||||
<? print_string("configcountry") ?>
|
||||
</TD>
|
||||
</tr>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>smtphosts:</TD>
|
||||
<TD>
|
||||
<INPUT NAME=smtphosts TYPE=text SIZE=30 VALUE="<?=$config->smtphosts?>">
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configsmtphosts") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>smtpuser:</TD>
|
||||
<TD>
|
||||
<INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
|
||||
</TD>
|
||||
<TD ROWSPAN=2>
|
||||
<? print_string("configsmtpuser") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>smtppass:</TD>
|
||||
<TD>
|
||||
<INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>gdversion:</TD>
|
||||
<TD>
|
||||
<? unset($options);
|
||||
<td align=right><p>gdversion:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("gdnot");
|
||||
$options[1] = get_string("gd1");
|
||||
$options[2] = get_string("gd2");
|
||||
@@ -77,28 +103,31 @@
|
||||
|
||||
choose_from_menu ($options, "gdversion", $installed, "", "", "");
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configgdversion") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>htmleditor:</TD>
|
||||
<TD>
|
||||
<? unset($options);
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configgdversion") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>htmleditor:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("allownot");
|
||||
$options[1] = get_string("allow");
|
||||
choose_from_menu ($options, "htmleditor", $config->htmleditor, "", "", "");
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("confightmleditor") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>maxeditingtime:</TD>
|
||||
<TD>
|
||||
<? $options[3600] = get_string("numminutes", "", 60);
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("confightmleditor") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>maxeditingtime:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[3600] = get_string("numminutes", "", 60);
|
||||
$options[2700] = get_string("numminutes", "", 45);
|
||||
$options[1800] = get_string("numminutes", "", 30);
|
||||
$options[900] = get_string("numminutes", "", 15);
|
||||
@@ -106,17 +135,18 @@
|
||||
$options[60] = get_string("numminutes", "", 1);
|
||||
|
||||
choose_from_menu ($options, "maxeditingtime", $config->maxeditingtime, "", "", "");
|
||||
unset($options);
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configmaxeditingtime") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>longtimenosee:</TD>
|
||||
<TD>
|
||||
<? $options[1000] = get_string("numdays", "", 1000);
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configmaxeditingtime") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>longtimenosee:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[1000] = get_string("numdays", "", 1000);
|
||||
$options[365] = get_string("numdays", "", 365);
|
||||
$options[180] = get_string("numdays", "", 180);
|
||||
$options[150] = get_string("numdays", "", 150);
|
||||
@@ -124,85 +154,158 @@
|
||||
$options[90] = get_string("numdays", "", 90);
|
||||
$options[60] = get_string("numdays", "", 60);
|
||||
$options[30] = get_string("numdays", "", 30);
|
||||
$options[21] = get_string("numdays", "", 21);
|
||||
$options[14] = get_string("numdays", "", 14);
|
||||
$options[7] = get_string("numdays", "", 7);
|
||||
|
||||
choose_from_menu ($options, "longtimenosee", $config->longtimenosee, "", "", "");
|
||||
unset($options);
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configlongtimenosee") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>zip:</TD>
|
||||
<TD>
|
||||
<INPUT name=zip TYPE=text SIZE=30 VALUE="<?=$config->zip?>">
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configzip") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>unzip:</TD>
|
||||
<TD>
|
||||
<INPUT name=unzip TYPE=text SIZE=30 VALUE="<?=$config->unzip?>">
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configunzip") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>slasharguments:</TD>
|
||||
<TD>
|
||||
<? $options[0] = "file.php?file=/pic.jpg";
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configlongtimenosee") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>loglifetime:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("neverdeletelogs");
|
||||
$options[1000] = get_string("numdays", "", 1000);
|
||||
$options[365] = get_string("numdays", "", 365);
|
||||
$options[180] = get_string("numdays", "", 180);
|
||||
$options[150] = get_string("numdays", "", 150);
|
||||
$options[120] = get_string("numdays", "", 120);
|
||||
$options[90] = get_string("numdays", "", 90);
|
||||
$options[60] = get_string("numdays", "", 60);
|
||||
$options[30] = get_string("numdays", "", 30);
|
||||
|
||||
choose_from_menu ($options, "loglifetime", $config->loglifetime, "", "", "");
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configloglifetime") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>sessiontimeout:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[14400] = get_string("numhours", "", 4);
|
||||
$options[10800] = get_string("numhours", "", 3);
|
||||
$options[7200] = get_string("numhours", "", 2);
|
||||
$options[5400] = get_string("numhours", "", "1.5");
|
||||
$options[3600] = get_string("numminutes", "", 60);
|
||||
$options[2700] = get_string("numminutes", "", 45);
|
||||
$options[1800] = get_string("numminutes", "", 30);
|
||||
$options[900] = get_string("numminutes", "", 15);
|
||||
$options[300] = get_string("numminutes", "", 5);
|
||||
|
||||
choose_from_menu ($options, "sessiontimeout", $config->sessiontimeout, "", "", "");
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configsessiontimeout") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>zip:</td>
|
||||
<td>
|
||||
<input name=zip type=text size=30 value="<?php p($config->zip) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configzip") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>unzip:</td>
|
||||
<td>
|
||||
<input name=unzip type=text size=30 value="<?php p($config->unzip) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configunzip") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>slasharguments:</td>
|
||||
<td>
|
||||
<?php unset($options);
|
||||
$options[0] = "file.php?file=/pic.jpg";
|
||||
$options[1] = "file.php/pic.jpg";
|
||||
|
||||
$installed = check_gd_version();
|
||||
|
||||
choose_from_menu ($options, "slasharguments", $config->slasharguments, "", "", "");
|
||||
unset($options);
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configslasharguments") ?>
|
||||
</TD>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configslasharguments") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>proxyhost:</td>
|
||||
<td>
|
||||
<input name=proxyhost type=text size=30 value="<?php p($config->proxyhost) ?>">
|
||||
</td>
|
||||
<td rowspan=2>
|
||||
<?php print_string("configproxyhost") ?>
|
||||
</td>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>proxyhost:</TD>
|
||||
<TD>
|
||||
<INPUT name=proxyhost TYPE=text SIZE=30 VALUE="<?=$config->proxyhost?>">
|
||||
</TD>
|
||||
<TD ROWSPAN=2>
|
||||
<? print_string("configproxyhost") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>proxyport:</TD>
|
||||
<TD>
|
||||
<INPUT name=proxyport TYPE=text SIZE=5 VALUE="<?=$config->proxyport?>">
|
||||
</TD>
|
||||
</TR>
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P>debug:</TD>
|
||||
<TD>
|
||||
<? $options[7] = get_string("no");
|
||||
<tr valign=top>
|
||||
<td align=right><p>proxyport:</td>
|
||||
<td>
|
||||
<input name=proxyport type=text size=5 value="<?php p($config->proxyport) ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>debug:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[7] = get_string("no");
|
||||
$options[15] = get_string("yes");
|
||||
|
||||
choose_from_menu ($options, "debug", $config->debug, "", "", "");
|
||||
unset($options);
|
||||
?>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("configdebug") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configdebug") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>framename:</td>
|
||||
<td>
|
||||
<?php
|
||||
if (empty($config->framename)) {
|
||||
$config->framename = "_top";
|
||||
}
|
||||
?>
|
||||
<input name=framename type=text size=15 value="<?php p($config->framename)?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configframename") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>secureforms:</td>
|
||||
<td>
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("no");
|
||||
$options[1] = get_string("yes");
|
||||
|
||||
choose_from_menu ($options, "secureforms", $config->secureforms, "", "", "");
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configsecureforms") ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD COLSPAN=3 ALIGN=CENTER>
|
||||
<INPUT TYPE="submit" VALUE="<? print_string("savechanges") ?>"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<tr>
|
||||
<td colspan=3 align=center>
|
||||
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</FORM>
|
||||
</form>
|
||||
|
||||
+12
-23
@@ -1,29 +1,9 @@
|
||||
<?PHP // $Id$
|
||||
// config.php - allows admin to edit all configuration variables
|
||||
|
||||
|
||||
if (isset($phpinfo)) { // For debugging purposes, protected by password
|
||||
if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") {
|
||||
phpinfo();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
require_once("../config.php");
|
||||
require_once("../lib/countries.php");
|
||||
|
||||
if (isset($config)) { // For debugging purposes, protected by password
|
||||
if (md5($config) == "caf9b6b99962bf5c2264824231d7a40c") {
|
||||
if ($site = get_site()) {
|
||||
print_heading("$site->fullname");
|
||||
}
|
||||
$TEMPCFG = $CFG;
|
||||
unset($TEMPCFG->dbuser);
|
||||
unset($TEMPCFG->dbpass);
|
||||
print_object($TEMPCFG);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($site = get_site()) { // If false then this is a new installation
|
||||
require_login();
|
||||
@@ -32,10 +12,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
/// This is to overcome the "insecure forms paradox"
|
||||
if (isset($secureforms) and $secureforms == 0) {
|
||||
$match = "nomatch";
|
||||
} else {
|
||||
$match = "";
|
||||
}
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if ($config = data_submitted()) {
|
||||
if ($config = data_submitted($match)) {
|
||||
|
||||
validate_form($config, $err);
|
||||
|
||||
@@ -86,13 +72,16 @@
|
||||
print_header();
|
||||
print_heading($strconfigvariables);
|
||||
print_simple_box(get_string("configintro"), "center");
|
||||
echo "<BR>";
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
include("config.html");
|
||||
print_simple_box_end();
|
||||
print_footer();
|
||||
|
||||
if ($site) {
|
||||
print_footer();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
Executable
+165
@@ -0,0 +1,165 @@
|
||||
<?PHP // $Id$
|
||||
// Admin only script to assign course creator rights to users
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
define("MAX_USERS_PER_PAGE", 30);
|
||||
|
||||
optional_variable($search, "");
|
||||
optional_variable($add, "");
|
||||
optional_variable($remove, "");
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/$CFG->admin/index.php");
|
||||
}
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("You must be an administrator to use this page.");
|
||||
}
|
||||
|
||||
$primaryadmin = get_admin();
|
||||
|
||||
/// If you want any administrator to have the ability to assign admin
|
||||
/// rights, then comment out the following if statement
|
||||
if ($primaryadmin->id != $USER->id) {
|
||||
error("You must be the primary administrator to use this page.");
|
||||
}
|
||||
|
||||
/// assign all of the configurable language strings
|
||||
$stringstoload = array (
|
||||
"assigncreators",
|
||||
"administration",
|
||||
"existingcreators",
|
||||
"noexistingcreators",
|
||||
"potentialcreators",
|
||||
"nopotentialcreators",
|
||||
"addcreator",
|
||||
"removecreator",
|
||||
"search",
|
||||
"searchagain",
|
||||
"toomanytoshow",
|
||||
);
|
||||
|
||||
foreach ($stringstoload as $stringtoload){
|
||||
$strstringtoload = "str" . $stringtoload;
|
||||
$$strstringtoload = get_string($stringtoload);
|
||||
}
|
||||
|
||||
if ($search) {
|
||||
$searchstring = $strsearchagain;
|
||||
} else {
|
||||
$searchstring = $strsearch;
|
||||
}
|
||||
|
||||
print_header("$site->shortname: $strassigncreators",
|
||||
"$site->fullname",
|
||||
"<a href=\"index.php\">$stradministration</a> ->
|
||||
<a href=\"{$_SERVER['PHP_SELF']}\">$strassigncreators</a>", "");
|
||||
|
||||
/// Get all existing creators
|
||||
$creators = get_creators();
|
||||
|
||||
/// Add an creator if one is specified
|
||||
if ($add) {
|
||||
$user = @get_record("user", "id", $add) or
|
||||
error("That account (id = $add) doesn't exist");
|
||||
|
||||
if ($creators) {
|
||||
foreach ($creators as $aa) {
|
||||
if ($aa->id == $user->id) {
|
||||
error("That user is already a creator .");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$creator->userid = $user->id;
|
||||
$creator->id = insert_record("user_coursecreators", $creator);
|
||||
$creators[] = $user;
|
||||
}
|
||||
|
||||
/// Remove an creator if one is specified.
|
||||
if ($remove) {
|
||||
$user = @get_record("user", "id", $remove) or
|
||||
error("That account (id = $remove) doesn't exist");
|
||||
|
||||
if ($creators) {
|
||||
foreach ($creators as $key => $aa) {
|
||||
if ($aa->id == $user->id) {
|
||||
delete_records("user_coursecreators","userid",$user->id);
|
||||
unset($creators[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Print the lists of existing and potential creators
|
||||
echo "<table cellpadding=2 cellspacing=10 align=center>";
|
||||
echo "<tr><th width=50%>$strexistingcreators</th><th width=50%>$strpotentialcreators</th></tr>";
|
||||
echo "<tr><td width=50% nowrap valign=top>";
|
||||
|
||||
/// First, show existing creators
|
||||
|
||||
if (! $creators) {
|
||||
echo "<p align=center>$strnoexistingcreators</a>";
|
||||
|
||||
$creatorlist = "";
|
||||
|
||||
} else {
|
||||
$creatorarray = array();
|
||||
foreach ($creators as $creator) {
|
||||
$creatorarray[] = $creator->id;
|
||||
echo "<p align=right>$creator->firstname $creator->lastname,
|
||||
$creator->email ";
|
||||
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$creator->id\"
|
||||
title=\"$strremovecreator\"><img src=\"../pix/t/right.gif\"
|
||||
border=0></a>";
|
||||
echo "</p>";
|
||||
}
|
||||
$creatorlist = implode(",",$creatorarray);
|
||||
unset($creatorarray);
|
||||
}
|
||||
|
||||
echo "<td width=50% nowrap valign=top>";
|
||||
|
||||
/// Print list of potential creators
|
||||
|
||||
$usercount = get_users(false, $search, true, $creatorlist);
|
||||
|
||||
if ($usercount == 0) {
|
||||
echo "<p align=center>$strnopotentialcreators</p>";
|
||||
|
||||
} else if ($usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<p align=center>$strtoomanytoshow</p>";
|
||||
|
||||
} else {
|
||||
|
||||
if ($search) {
|
||||
echo "<p align=center>($strsearchresults : $search)</p>";
|
||||
}
|
||||
|
||||
if (!$users = get_users(true, $search, true, $creatorlist)) {
|
||||
error("Could not get users!");
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
|
||||
"title=\"$straddcreator\"><img src=\"../pix/t/left.gif\"".
|
||||
"border=0></a> $user->firstname $user->lastname, $user->email";
|
||||
}
|
||||
}
|
||||
|
||||
if ($search or $usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
|
||||
echo "<input type=text name=search size=20>";
|
||||
echo "<input type=submit value=\"$searchstring\">";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
echo "</tr></table>";
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
+32
-13
@@ -1,25 +1,27 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
// This script looks through all the module directories for cron.php files
|
||||
// and runs them. These files can contain cleanup functions, email functions
|
||||
// or anything that needs to be run on a regular basis.
|
||||
//
|
||||
// This file is best run from cron on the host system (ie outside PHP).
|
||||
// The script can either be invoked via the web server or via a standalone
|
||||
// version of PHP compiled for CGI.
|
||||
//
|
||||
// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
|
||||
// or php /web/moodle/admin/cron.php
|
||||
/// This script looks through all the module directories for cron.php files
|
||||
/// and runs them. These files can contain cleanup functions, email functions
|
||||
/// or anything that needs to be run on a regular basis.
|
||||
///
|
||||
/// This file is best run from cron on the host system (ie outside PHP).
|
||||
/// The script can either be invoked via the web server or via a standalone
|
||||
/// version of PHP compiled for CGI.
|
||||
///
|
||||
/// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
|
||||
/// or php /web/moodle/admin/cron.php
|
||||
|
||||
$FULLME = "cron";
|
||||
|
||||
$starttime = microtime();
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
echo "<PRE>\n";
|
||||
|
||||
$timenow = time();
|
||||
|
||||
// Run all cron jobs for each module
|
||||
/// Run all cron jobs for each module
|
||||
|
||||
if ($mods = get_records_select("modules", "cron > 0 AND (($timenow - lastcron) > cron)")) {
|
||||
foreach ($mods as $mod) {
|
||||
@@ -39,7 +41,7 @@
|
||||
}
|
||||
|
||||
|
||||
// Unenrol users who haven't logged in for $CFG->longtimenosee
|
||||
/// Unenrol users who haven't logged in for $CFG->longtimenosee
|
||||
|
||||
if ($CFG->longtimenosee) { // value in days
|
||||
$longtime = $timenow - ($CFG->longtimenosee * 3600 * 24);
|
||||
@@ -53,7 +55,7 @@
|
||||
}
|
||||
|
||||
|
||||
// Delete users who haven't confirmed within seven days
|
||||
/// Delete users who haven't confirmed within seven days
|
||||
|
||||
$oneweek = $timenow - (7 * 24 * 3600);
|
||||
if ($users = get_users_unconfirmed($oneweek)) {
|
||||
@@ -64,6 +66,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Delete old queued mail that didn't get sent within 30 minutes
|
||||
|
||||
$oldmailtime = $timenow - 1800;
|
||||
delete_records_select("mail_queue", "timecreated < '$oldmailtime'");
|
||||
|
||||
|
||||
/// Delete old logs to save space (this might need a timer to slow it down...)
|
||||
|
||||
if (!empty($CFG->loglifetime)) { // value in days
|
||||
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
|
||||
delete_records_select("log", "time < '$loglifetime'");
|
||||
}
|
||||
|
||||
echo "Cron script completed correctly\n";
|
||||
|
||||
$difftime = microtime_diff($starttime, microtime());
|
||||
echo "Execution took ".$difftime." seconds\n";
|
||||
|
||||
?>
|
||||
|
||||
+136
-40
@@ -1,22 +1,90 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
/// Check that config.php exists
|
||||
if (!file_exists("../config.php")) {
|
||||
echo "<H2 align=center>You need to create a config.php.<BR>
|
||||
See the <A HREF=\"http://moodle.com/doc/?frame=install.html\">installation instructions</A>.</H2>";
|
||||
die;
|
||||
}
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
|
||||
/// Check that PHP is of a sufficient version
|
||||
|
||||
if ( ! check_php_version("4.1.0") ) {
|
||||
if (!check_php_version("4.1.0")) {
|
||||
$version = phpversion();
|
||||
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
|
||||
die;
|
||||
}
|
||||
|
||||
/// Check some PHP server settings
|
||||
|
||||
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
|
||||
|
||||
|
||||
if (ini_get_bool('session.auto_start')) {
|
||||
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
|
||||
}
|
||||
|
||||
if (ini_get_bool('magic_quotes_runtime')) {
|
||||
error("The PHP server variable 'magic_quotes_runtime' should be Off - $documentationlink");
|
||||
}
|
||||
|
||||
if (!ini_get_bool('magic_quotes_gpc')) {
|
||||
error("The PHP server variable 'magic_quotes_gpc' is not turned On - $documentationlink");
|
||||
}
|
||||
|
||||
if (!ini_get_bool('file_uploads')) {
|
||||
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
|
||||
}
|
||||
|
||||
if (!ini_get_bool('short_open_tag')) {
|
||||
error("The PHP server variable 'short_open_tag' is not turned On - $documentationlink");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Check that sessions are supported
|
||||
|
||||
if (!is_readable(ini_get('session.save_path')) and !ini_get_bool('safe_mode')) {
|
||||
$sessionpath = ini_get('session.save_path');
|
||||
notify("Warning: It appears your server does not support sessions (session.save_path = '$sessionpath')");
|
||||
}
|
||||
|
||||
|
||||
/// Check that config.php has been edited
|
||||
|
||||
if ($CFG->wwwroot == "http://example.com/moodle") {
|
||||
error("Moodle has not been configured yet. You need to to edit config.php first.");
|
||||
}
|
||||
|
||||
|
||||
/// Check settings in config.php
|
||||
|
||||
$dirroot = dirname(realpath("../config.php"));
|
||||
if ($dirroot != $CFG->dirroot) {
|
||||
error("Please fix your settings in config.php:
|
||||
<P>You have:
|
||||
<P>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
|
||||
<P>but it should be:
|
||||
<P>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
|
||||
"./");
|
||||
}
|
||||
|
||||
/// Set some necessary variables during set-up to avoid PHP warnings later on this page
|
||||
if (!isset($CFG->framename)) {
|
||||
$CFG->framename = "_top";
|
||||
}
|
||||
if (!isset($CFG->release)) {
|
||||
$CFG->release = "";
|
||||
}
|
||||
if (!isset($CFG->version)) {
|
||||
$CFG->version = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Check if the main tables have been installed yet or not.
|
||||
|
||||
if (! $tables = $db->Metatables() ) { // No tables yet at all.
|
||||
@@ -36,23 +104,23 @@
|
||||
}
|
||||
|
||||
if (! $maintables) {
|
||||
if (!$agreelicence) {
|
||||
if (empty($agreelicence)) {
|
||||
$strlicense = get_string("license");
|
||||
print_header($strlicense, $strlicense, $strlicense);
|
||||
print_heading("<A HREF=\"http://moodle.com\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
|
||||
print_header($strlicense, $strlicense, $strlicense, "", "", false, " ", " ");
|
||||
print_heading("<A HREF=\"http://moodle.org\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
|
||||
print_heading(get_string("copyrightnotice"));
|
||||
print_simple_box_start("CENTER");
|
||||
print_simple_box_start("center");
|
||||
echo text_to_html(get_string("gpl"));
|
||||
print_simple_box_end();
|
||||
echo "<BR>";
|
||||
echo "<br />";
|
||||
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
|
||||
"http://www.gnu.org/copyleft/gpl.html");
|
||||
"http://moodle.org/doc/?frame=licence.html");
|
||||
exit;
|
||||
}
|
||||
|
||||
$strdatabasesetup = get_string("databasesetup");
|
||||
$strdatabasesuccess = get_string("databasesuccess");
|
||||
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup);
|
||||
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, "", "", false, " ", " ");
|
||||
if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
|
||||
$db->debug = true;
|
||||
set_time_limit(0); // To allow slow databases to complete the long SQL
|
||||
@@ -82,7 +150,8 @@
|
||||
$a->newversion = $version;
|
||||
$strdatabasechecking = get_string("databasechecking", "", $a);
|
||||
$strdatabasesuccess = get_string("databasesuccess");
|
||||
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
|
||||
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking,
|
||||
"", "", false, " ", " ");
|
||||
print_heading($strdatabasechecking);
|
||||
$db->debug=true;
|
||||
if (main_upgrade($CFG->version)) {
|
||||
@@ -103,8 +172,9 @@
|
||||
}
|
||||
|
||||
} else {
|
||||
$strdatabaseupgrades = get_string("databaseupgrades");
|
||||
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
|
||||
$strcurrentversion = get_string("currentversion");
|
||||
print_header($strcurrentversion, $strcurrentversion, $strcurrentversion,
|
||||
"", "", false, " ", " ");
|
||||
|
||||
if (set_config("version", $version)) {
|
||||
print_heading("You are currently using Moodle version $version (Release $release)");
|
||||
@@ -124,8 +194,8 @@
|
||||
/// Updated human-readable release version if necessary
|
||||
|
||||
if ($release <> $CFG->release) { // Update the release version
|
||||
$strdatabaseupgrades = get_string("databaseupgrades");
|
||||
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
|
||||
$strcurrentrelease = get_string("currentrelease");
|
||||
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " ");
|
||||
print_heading($release);
|
||||
if (!set_config("release", $release)) {
|
||||
notify("ERROR: Could not update release version in database!!");
|
||||
@@ -155,8 +225,20 @@
|
||||
|
||||
unset($module);
|
||||
|
||||
include_once("$fullmod/version.php"); # defines $module with version etc
|
||||
include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
|
||||
if ( is_readable("$fullmod/version.php")) {
|
||||
include_once("$fullmod/version.php"); # defines $module with version etc
|
||||
} else {
|
||||
notify("Module $mod: $fullmod/version.php was not readable");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( is_readable("$fullmod/db/$CFG->dbtype.php")) {
|
||||
include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
|
||||
} else {
|
||||
notify("Module $mod: $fullmod/db/$CFG->dbtype.php was not readable");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($module)) {
|
||||
continue;
|
||||
@@ -194,7 +276,7 @@
|
||||
} else { // module not installed yet, so install it
|
||||
if (empty($updated_modules)) {
|
||||
$strmodulesetup = get_string("modulesetup");
|
||||
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup);
|
||||
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, "", "", false, " ", " ");
|
||||
}
|
||||
print_heading($module->name);
|
||||
$updated_modules = true;
|
||||
@@ -250,8 +332,8 @@
|
||||
}
|
||||
|
||||
/// Check for valid admin user
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
if (!iscreator()) {
|
||||
error("You need to be an admin user or teacher to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -259,31 +341,45 @@
|
||||
|
||||
$stradministration = get_string("administration");
|
||||
print_header("$site->shortname: $stradministration","$site->fullname: $stradministration", "$stradministration");
|
||||
|
||||
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
|
||||
$table->align = array ("CENTER", "CENTER", "CENTER");
|
||||
$table->data[0][0] = "<P><A HREF=\"config.php\">".get_string("configvariables")."</A></P>".
|
||||
"<P><A HREF=\"site.php\">".get_string("sitesettings")."</A></P>".
|
||||
"<P><A HREF=\"../course/log.php?id=$site->id\">".get_string("sitelogs")."</A></P>".
|
||||
"<P><A HREF=\"../theme/index.php\">".get_string("choosetheme")."</A></P>".
|
||||
"<P><A HREF=\"lang.php\">".get_string("checklanguage")."</A></P>";
|
||||
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
|
||||
$table->data[0][0] .= "<P><A HREF=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</A></P>";
|
||||
}
|
||||
$table->data[0][1] = "<P><A HREF=\"../course/edit.php\">".get_string("addnewcourse")."</A></P>".
|
||||
"<P><A HREF=\"../course/teacher.php\">".get_string("assignteachers")."</A></P>".
|
||||
"<P><A HREF=\"../course/delete.php\">".get_string("deletecourse")."</A></P>".
|
||||
"<P><A HREF=\"../course/categories.php\">".get_string("categories")."</A></P>";
|
||||
$table->data[0][2] = "<P><A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A></P>".
|
||||
"<P><A HREF=\"user.php\">".get_string("edituser")."</A></P>".
|
||||
"<P><A HREF=\"admin.php\">".get_string("assignadmins")."</A></P>".
|
||||
"<P><A HREF=\"auth.php\">".get_string("authentication")."</A></P>";
|
||||
|
||||
if (isadmin()) {
|
||||
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
|
||||
$table->align = array ("CENTER", "CENTER", "CENTER");
|
||||
$table->data[0][0] = "<p><a href=\"config.php\">".get_string("configvariables")."</a></p>".
|
||||
"<p><a href=\"site.php\">".get_string("sitesettings")."</a></p>".
|
||||
"<p><a href=\"../course/log.php?id=$site->id\">".get_string("sitelogs")."</a></p>".
|
||||
"<p><a href=\"../theme/index.php\">".get_string("choosetheme")."</a></p>".
|
||||
"<p><a href=\"lang.php\">".get_string("checklanguage")."</a></p>".
|
||||
"<p><a href=\"modules.php\">".get_string("managemodules")."</a></p>";
|
||||
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
|
||||
$table->data[0][0] .= "<p><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></p>";
|
||||
}
|
||||
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
|
||||
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
|
||||
"<p><a href=\"../course/delete.php\">".get_string("deletecourse")."</a></p>".
|
||||
"<p><a href=\"../course/categories.php\">".get_string("categories")."</a></p>";
|
||||
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
|
||||
$table->data[0][2] = "<p><a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a></p>";
|
||||
}
|
||||
$table->data[0][2] .= "<p><a href=\"user.php\">".get_string("edituser")."</a></p>".
|
||||
"<p><a href=\"admin.php\">".get_string("assignadmins")."</a></p>".
|
||||
"<p><a href=\"creators.php\">".get_string("assigncreators")."</a></p>".
|
||||
"<p><a href=\"auth.php\">".get_string("authentication")."</a></p>";
|
||||
} else { /// user is coursecreator
|
||||
$table->head = array (get_string("courses"));
|
||||
$table->align = array ("CENTER");
|
||||
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
|
||||
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>";
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
|
||||
echo "<BR><DIV align=center>";
|
||||
echo "<br><div align=center>";
|
||||
print_single_button("$CFG->wwwroot/doc", NULL, get_string("documentation"));
|
||||
echo "</DIV>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<br><div align=center>";
|
||||
print_single_button("register.php", NULL, get_string("registration"));
|
||||
echo "</div>";
|
||||
|
||||
print_heading("Moodle $CFG->release ($CFG->version)", "CENTER", 1);
|
||||
|
||||
|
||||
+28
-16
@@ -36,19 +36,19 @@
|
||||
break;
|
||||
}
|
||||
|
||||
if ($USER->lang) {
|
||||
$currentlang = $USER->lang;
|
||||
} else {
|
||||
$currentlang = $CFG->lang;
|
||||
}
|
||||
$currentlang = current_language();
|
||||
|
||||
print_header("$site->shortname: $title", "$site->fullname",
|
||||
"<A HREF=\"index.php\">$stradministration</A> -> $navigation");
|
||||
"<a href=\"index.php\">$stradministration</a> -> $navigation");
|
||||
|
||||
if (!$mode) {
|
||||
print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage"));
|
||||
print_heading("<A HREF=\"lang.php?mode=missing\">$strmissingstrings</A>");
|
||||
print_heading("<A HREF=\"lang.php?mode=compare\">$strcomparelanguage</A>");
|
||||
print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>");
|
||||
print_heading("<a href=\"lang.php?mode=compare\">$strcomparelanguage</a>");
|
||||
echo "<center><hr noshade size=1>";
|
||||
$options["lang"] = $currentlang;
|
||||
print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack"));
|
||||
echo "</center>";
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
|
||||
foreach ($stringfiles as $key => $file) {
|
||||
if ($file == "README" or $file == "help" or $file == "docs") {
|
||||
if ($file == "README" or $file == "help" or $file == "docs" or $file == "fonts") {
|
||||
unset($stringfiles[$key]);
|
||||
}
|
||||
}
|
||||
@@ -89,12 +89,13 @@
|
||||
if (!isset($string[$key]) or $string[$key] == "") {
|
||||
$value = htmlspecialchars($value);
|
||||
$value = str_replace("$"."a", "\\$"."a", $value);
|
||||
$value = str_replace("%%","%",$value);
|
||||
if ($first) {
|
||||
echo "</PRE><HR><P><B>".get_string("stringsnotset","","$langdir/$file")."</B></P><PRE>";
|
||||
$first = false;
|
||||
$somethingfound = true;
|
||||
}
|
||||
echo "$"."string[$key] = \"$value\";<BR>";
|
||||
echo "$"."string['$key'] = \"$value\";<BR>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,7 +148,7 @@
|
||||
echo "</CENTER>";
|
||||
|
||||
foreach ($stringfiles as $file) {
|
||||
|
||||
|
||||
print_heading("$file", "LEFT", 4);
|
||||
|
||||
if (!file_exists("$langdir/$file")) {
|
||||
@@ -180,14 +181,22 @@
|
||||
echo "<TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=3 BORDER=0>";
|
||||
foreach ($enstring as $key => $envalue) {
|
||||
$envalue = nl2br(htmlspecialchars($envalue));
|
||||
$envalue = str_replace("\$a","<B>\$a</B>", $envalue); // Make variables bold
|
||||
// TODO: It would be nice if all the $a->something variables were bold too
|
||||
$envalue = preg_replace('/(\$a\-\>[a-zA-Z0-9]*|\$a)/', '<b>$0</b>', $envalue); // Make variables bold.
|
||||
$envalue = str_replace("%%","%",$envalue);
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD WIDTH=20% BGCOLOR=\"$THEME->cellheading\" NOWRAP VALIGN=TOP>$key</TD>";
|
||||
echo "<TD WIDTH=40% BGCOLOR=\"$THEME->cellheading\" VALIGN=TOP>$envalue</TD>";
|
||||
|
||||
$value = str_replace("\\","",$string[$key]); // Delete all slashes
|
||||
$value = $string[$key];
|
||||
$value = str_replace("\r","",$value); // Bad character caused by Windows
|
||||
$value = str_replace("\n\n\n\n\n\n","\n",$value); // Collapse runs of blank lines
|
||||
$value = str_replace("\n\n\n\n\n","\n",$value);
|
||||
$value = str_replace("\n\n\n\n","\n",$value);
|
||||
$value = str_replace("\n\n\n","\n",$value);
|
||||
$value = str_replace("\n\n\n","\n",$value);
|
||||
$value = str_replace("\\","",$value); // Delete all slashes
|
||||
$value = str_replace("%%","%",$value);
|
||||
$value = htmlspecialchars($value);
|
||||
|
||||
$cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
|
||||
@@ -258,9 +267,12 @@ function lang_save_file($path, $file, $strings) {
|
||||
|
||||
foreach ($strings as $key => $value) {
|
||||
list($id, $stringname) = explode("-",$key);
|
||||
$value = str_replace("\\","",$value); // Delete all slashes
|
||||
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
|
||||
$value = str_replace("\\","",$value); // Delete all slashes
|
||||
}
|
||||
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
|
||||
$value = str_replace("\"", "\\\"", $value); // Add slashes for "
|
||||
$value = str_replace("\"", "\\\\\\\"", $value); // Add slashes for "
|
||||
$value = str_replace("%","%%",$value); // Escape % characters
|
||||
if ($id == "string" and $value != ""){
|
||||
fwrite($f,"\$string['$stringname'] = \"$value\";\n");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<?PHP // $Id$
|
||||
// Allows the admin to create, delete and rename course categories
|
||||
|
||||
require_once("../config.php");
|
||||
require_once("../course/lib.php");
|
||||
|
||||
optional_variable($disable);
|
||||
optional_variable($enable);
|
||||
optional_variable($delete);
|
||||
optional_variable($confirm);
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only administrators can use this page!");
|
||||
}
|
||||
|
||||
if (!$site = get_site()) {
|
||||
error("Site isn't defined!");
|
||||
}
|
||||
|
||||
|
||||
/// Print headings
|
||||
|
||||
$stradministration = get_string("administration");
|
||||
$strmanagemodules = get_string("managemodules");
|
||||
$strdelete = get_string("delete");
|
||||
$strhide = get_string("hide");
|
||||
$strshow = get_string("show");
|
||||
$stractivitymodule = get_string("activitymodule");
|
||||
|
||||
print_header("$site->shortname: $strmanagemodules", "$site->fullname",
|
||||
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strmanagemodules");
|
||||
|
||||
print_heading($strmanagemodules);
|
||||
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if (!empty($hide)) {
|
||||
if (!$module = get_record("modules", "name", $hide)) {
|
||||
error("Module doesn't exist!");
|
||||
}
|
||||
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
|
||||
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
|
||||
}
|
||||
|
||||
if (!empty($show)) {
|
||||
if (!$module = get_record("modules", "name", $show)) {
|
||||
error("Module doesn't exist!");
|
||||
}
|
||||
set_field("modules", "visible", "1", "id", $module->id); // Show main module
|
||||
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
|
||||
}
|
||||
|
||||
if (!empty($delete)) {
|
||||
|
||||
$strmodulename = get_string("modulename", "$delete");
|
||||
|
||||
if (empty($confirm)) {
|
||||
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
|
||||
"modules.php?delete=$delete&confirm=$delete",
|
||||
"modules.php");
|
||||
print_footer();
|
||||
exit;
|
||||
|
||||
} else { // Delete everything!!
|
||||
|
||||
if ($delete == "forum") {
|
||||
error("You can not delete the forum module!!");
|
||||
}
|
||||
|
||||
if (!$module = get_record("modules", "name", $delete)) {
|
||||
error("Module doesn't exist!");
|
||||
}
|
||||
|
||||
// OK, first delete all the relevant instances from all course sections
|
||||
if ($coursemods = get_records("course_modules", "module", $module->id)) {
|
||||
foreach ($coursemods as $coursemod) {
|
||||
if (! delete_mod_from_section($coursemod->id, $coursemod->section)) {
|
||||
notify("Could not delete the $strmodulename with id = $coursemod->id from section $coursemod->section");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now delete all the course module records
|
||||
if (!delete_records("course_modules", "module", $module->id)) {
|
||||
notify("Error occurred while deleting all $strmodulename records in course_modules table");
|
||||
}
|
||||
|
||||
// Then delete all the logs
|
||||
if (!delete_records("log", "module", $module->name)) {
|
||||
notify("Error occurred while deleting all $strmodulename records in log table");
|
||||
}
|
||||
|
||||
// And log_display information
|
||||
if (!delete_records("log_display", "module", $module->name)) {
|
||||
notify("Error occurred while deleting all $strmodulename records in log_display table");
|
||||
}
|
||||
|
||||
// And the module entry itself
|
||||
if (!delete_records("modules", "name", $module->name)) {
|
||||
notify("Error occurred while deleting the $strmodulename record from modules table");
|
||||
}
|
||||
|
||||
// Then the tables themselves
|
||||
|
||||
if ($tables = $db->Metatables()) {
|
||||
$prefix = $CFG->prefix.$module->name;
|
||||
foreach ($tables as $table) {
|
||||
if (strpos($table, $prefix) === 0) {
|
||||
if (!execute_sql("DROP TABLE $table", false)) {
|
||||
notify("ERROR: while trying to drop table $table");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rebuild_course_cache(); // Because things have changed
|
||||
|
||||
|
||||
$a->module = $strmodulename;
|
||||
$a->directory = "$CFG->dirroot/mod/$delete";
|
||||
notice(get_string("moduledeletefiles", "", $a), "modules.php");
|
||||
}
|
||||
}
|
||||
|
||||
/// Get and sort the existing modules
|
||||
|
||||
if (!$modules = get_records("modules")) {
|
||||
error("No modules found!!"); // Should never happen
|
||||
}
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$strmodulename = get_string("modulename", "$module->name");
|
||||
$modulebyname[$strmodulename] = $module;
|
||||
}
|
||||
ksort($modulebyname);
|
||||
|
||||
/// Print the table of all modules
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "../pix";
|
||||
$modpixpath = "../mod";
|
||||
} else {
|
||||
$pixpath = "../theme/$CFG->theme/pix";
|
||||
$modpixpath = "../theme/$CFG->theme/pix/mod";
|
||||
}
|
||||
|
||||
$table->head = array ($stractivitymodule, "$strhide/$strshow", $strdelete);
|
||||
$table->align = array ("LEFT", "CENTER", "CENTER");
|
||||
$table->wrap = array ("NOWRAP", "", "");
|
||||
$table->size = array ("100%", "10", "10");
|
||||
$table->width = "100";
|
||||
|
||||
foreach ($modulebyname as $modulename => $module) {
|
||||
|
||||
$icon = "<img src=\"$modpixpath/$module->name/icon.gif\" hspace=10 height=16 width=16 border=0>";
|
||||
|
||||
$delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
|
||||
|
||||
if ($module->visible) {
|
||||
$visible = "<a href=\"modules.php?hide=$module->name\" title=\"$strhide\">".
|
||||
"<img src=\"$pixpath/i/hide.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
|
||||
$class = "";
|
||||
} else {
|
||||
$visible = "<a href=\"modules.php?show=$module->name\" title=\"$strshow\">".
|
||||
"<img src=\"$pixpath/i/show.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
|
||||
$class = "class=\"dimmed_text\"";
|
||||
}
|
||||
if ($module->name == "forum") {
|
||||
$delete = "";
|
||||
$visible = "";
|
||||
$class = "";
|
||||
}
|
||||
$table->data[] = array ("<p $class>$icon $modulename</p>", $visible, $delete);
|
||||
}
|
||||
print_table($table);
|
||||
|
||||
echo "<br /><br />";
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?PHP // $Id$
|
||||
// phpinfo.php - shows phpinfo for the current server
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only the admin can use this page");
|
||||
}
|
||||
|
||||
$stradministration = get_string("administration");
|
||||
$site = get_site();
|
||||
|
||||
print_header("$site->shortname: phpinfo", "$site->fullname",
|
||||
"<a href=\"index.php\">$stradministration</a> -> phpinfo");
|
||||
|
||||
phpinfo();
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,138 @@
|
||||
<?PHP // $Id$
|
||||
// register.php - allows admin to register their site on moodle.org
|
||||
|
||||
include("../config.php");
|
||||
require_once("../lib/countries.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only the admin can use this page");
|
||||
}
|
||||
|
||||
if (!$site = get_site()) {
|
||||
redirect("index.php");
|
||||
}
|
||||
|
||||
if (!$admin = get_admin()) {
|
||||
error("No admins");
|
||||
}
|
||||
|
||||
if (!$admin->country and $CFG->country) {
|
||||
$admin->country = $CFG->country;
|
||||
}
|
||||
|
||||
if (!$admin->secret) { // secret field hasn't been set yet
|
||||
$admin->secret = random_string(15);
|
||||
|
||||
if (!set_field("user", "secret", $admin->secret, "id", $admin->id)) {
|
||||
error("Could not set admin's secret string!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Print headings
|
||||
|
||||
$stradministration = get_string("administration");
|
||||
$strregistration = get_string("registration");
|
||||
$strregistrationinfo = get_string("registrationinfo");
|
||||
|
||||
print_header("$site->shortname: $strregistration", "$site->fullname",
|
||||
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration");
|
||||
|
||||
print_heading($strmanagemodules);
|
||||
|
||||
print_simple_box($strregistrationinfo, "center", "70%");
|
||||
echo "<br />";
|
||||
|
||||
|
||||
/// Print the form
|
||||
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
|
||||
echo "<form name=\"form\" action=\"http://moodle.org/register/\" method=post>\n";
|
||||
echo "<table cellpadding=9 border=0>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>Moodle URL:</td>\n";
|
||||
echo "<td><p>$CFG->wwwroot</td>\n";
|
||||
echo "<!-- The following hidden variables are to help prevent fake entries being sent. -->\n";
|
||||
echo "<!-- Together they form a key. If any of these change between updates then the entry -->\n";
|
||||
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
|
||||
|
||||
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
|
||||
echo "<input type=\"hidden\" name=\"secret\" value=\"$admin->secret\">\n";
|
||||
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
|
||||
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("currentversion").":</td>\n";
|
||||
echo "<td><p>$CFG->release ($CFG->version)</td>\n";
|
||||
echo "<input type=\"hidden\" name=\"version\" value=\"$CFG->version\">\n";
|
||||
echo "<input type=\"hidden\" name=\"release\" value=\"$CFG->release\">\n";
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("fullsitename").":</td>\n";
|
||||
echo "<td><p><input size=50 type=\"text\" name=\"sitename\" value=\"$site->fullname\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("country").":</td>\n";
|
||||
echo "<td><p>";
|
||||
choose_from_menu ($COUNTRIES, "country", $admin->country, get_string("selectacountry")."...", "", "");
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p><a href=\"http://moodle.org/sites\" title=\"See the current list of sites\" target=_blank>".get_string("publicdirectory")."</a>:</td>\n";
|
||||
echo "<td><p>";
|
||||
$options[0] = get_string("publicdirectory0");
|
||||
$options[1] = get_string("publicdirectory1");
|
||||
$options[2] = get_string("publicdirectory2");
|
||||
choose_from_menu ($options, "public", "2", "", "", "");
|
||||
unset($options);
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td colspan=2><hr size=1 noshade>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("administrator").":</td>\n";
|
||||
echo "<td><p><input size=50 type=\"text\" name=\"adminname\" value=\"$admin->firstname $admin->lastname\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("email").":</td>\n";
|
||||
echo "<td><p><input size=50 type=\"text\" name=\"adminemail\" value=\"$admin->email\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right><p>".get_string("registrationemail")."</a>:</td>\n";
|
||||
echo "<td><p>\n";
|
||||
$options[0] = get_string("registrationno");
|
||||
$options[1] = get_string("registrationyes");
|
||||
choose_from_menu ($options, "mailme", "1", "", "", "");
|
||||
unset($options);
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr valign=top>\n";
|
||||
echo "<td align=right> </td>\n";
|
||||
echo "<td><p><input type=\"submit\" value=\"".get_string("registrationsend")."\"></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
||||
echo "</table>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
print_simple_box_end();
|
||||
|
||||
echo "<br />\n";
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
+23
-21
@@ -1,29 +1,31 @@
|
||||
<FORM METHOD="post" action="site.php" NAME="form">
|
||||
<TABLE cellpadding=9 cellspacing=0 >
|
||||
<form method="post" action="site.php" name="form">
|
||||
<table cellpadding=9 cellspacing=0 >
|
||||
<tr valign=top>
|
||||
<td align=right><P><? print_string("fullsitename") ?>:</td>
|
||||
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
|
||||
<? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
|
||||
<td align=right><P><?php print_string("fullsitename") ?>:</td>
|
||||
<td><input type="text" name="fullname" size=50 value="<?php p($form->fullname) ?>">
|
||||
<?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><P><? print_string("shortsitename") ?>:</td>
|
||||
<td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
|
||||
<? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
|
||||
<td align=right><P><?php print_string("shortsitename") ?>:</td>
|
||||
<td><input type="text" name="shortname" size=50 value="<?php p($form->shortname) ?>">
|
||||
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
|
||||
<? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
|
||||
<? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
|
||||
<td align=right><P><?php print_string("frontpagedescription") ?>:</P><br />
|
||||
<font size=1>
|
||||
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
|
||||
<?php helpbutton("html", get_string("helphtml"), "moodle", true, true) ?><br />
|
||||
</font>
|
||||
</td>
|
||||
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
|
||||
<? if (isset($err["summary"])) formerr($err["summary"]); ?>
|
||||
<td><textarea name=summary cols=50 rows=10 wrap=virtual><?php p($form->summary) ?></textarea>
|
||||
<?php if (isset($err["summary"])) formerr($err["summary"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><P><? print_string("frontpageformat") ?>:</td>
|
||||
<td><?
|
||||
<td align=right><P><?php print_string("frontpageformat") ?>:</td>
|
||||
<td><?php
|
||||
$newsitem = get_string("newsitem");
|
||||
$newsitems = get_string("newsitems");
|
||||
$options = array("0" => get_string("showlistofcourses"),
|
||||
@@ -43,10 +45,10 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
|
||||
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
|
||||
</tr>
|
||||
</TABLE>
|
||||
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
|
||||
<INPUT type="hidden" name="category" value="<?=$form->category ?>">
|
||||
<INPUT type="hidden" name="format" value="<?=$form->format ?>">
|
||||
</FORM>
|
||||
</table>
|
||||
<input type="hidden" name="id" value="<?php p($form->id) ?>">
|
||||
<input type="hidden" name="category" value="<?php p($form->category) ?>">
|
||||
<input type="hidden" name="format" value="<?php p($form->format) ?>">
|
||||
</form>
|
||||
|
||||
+24
-7
@@ -6,8 +6,8 @@
|
||||
if (!isadmin()) {
|
||||
error("You need to be admin to edit this page");
|
||||
}
|
||||
$site->format = "social"; // override
|
||||
}
|
||||
$site->format = "social"; // override
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
if ($form->id) {
|
||||
if (update_record("course", $form)) {
|
||||
redirect("index.php", get_string("changessaved"));
|
||||
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
|
||||
} else {
|
||||
error("Serious Error! Could not update the site record! (id = $form->id)");
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
if ($newid = insert_record("course", $form)) {
|
||||
$cat->name = get_string("miscellaneous");
|
||||
if (insert_record("course_categories", $cat)) {
|
||||
redirect("index.php", get_string("changessaved"), "1");
|
||||
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
|
||||
} else {
|
||||
error("Serious Error! Could not set up a default course category!");
|
||||
}
|
||||
@@ -50,10 +50,17 @@
|
||||
|
||||
if ($site and empty($form)) {
|
||||
$form = $site;
|
||||
$firsttime = false;
|
||||
} else {
|
||||
$form->fullname = "";
|
||||
$form->shortname = "";
|
||||
$form->summary = "";
|
||||
$form->newsitems = 0;
|
||||
$form->id = "";
|
||||
$form->category = 0;
|
||||
$form->format = "social";
|
||||
$form->newsitems = 0;
|
||||
$firsttime = true;
|
||||
}
|
||||
|
||||
if (empty($focus)) {
|
||||
@@ -63,14 +70,24 @@
|
||||
$stradmin = get_string("administration");
|
||||
$strsitesettings = get_string("sitesettings");
|
||||
|
||||
print_header("$site->shortname: $strsitesettings", "$site->fullname",
|
||||
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
|
||||
if ($firsttime) {
|
||||
print_header();
|
||||
print_heading($strsitesettings);
|
||||
print_simple_box(get_string("configintrosite"), "center");
|
||||
echo "<br />";
|
||||
} else {
|
||||
print_header("$site->shortname: $strsitesettings", "$site->fullname",
|
||||
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
|
||||
print_heading($strsitesettings);
|
||||
}
|
||||
|
||||
print_heading($strsitesettings);
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
include("site.html");
|
||||
print_simple_box_end();
|
||||
print_footer();
|
||||
|
||||
if (!$firsttime) {
|
||||
print_footer();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
<?PHP // $Id$
|
||||
// Admin-only script to assign teachers to courses
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
define("MAX_USERS_PER_PAGE", 30);
|
||||
|
||||
optional_variable($id); // course id
|
||||
optional_variable($add, "");
|
||||
optional_variable($remove, "");
|
||||
optional_variable($search, ""); // search string
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/$CFG->admin/index.php");
|
||||
}
|
||||
|
||||
require_login();
|
||||
|
||||
if (!iscreator()) {
|
||||
error("You must be an administrator or course creator to use this page.");
|
||||
}
|
||||
|
||||
$strassignteachers = get_string("assignteachers");
|
||||
$stradministration = get_string("administration");
|
||||
$strexistingteachers = get_string("existingteachers");
|
||||
$strnoexistingteachers = get_string("noexistingteachers");
|
||||
$strpotentialteachers = get_string("potentialteachers");
|
||||
$strnopotentialteachers = get_string("nopotentialteachers");
|
||||
$straddteacher = get_string("addteacher");
|
||||
$strremoveteacher = get_string("removeteacher");
|
||||
$strsearch = get_string("search");
|
||||
$strsearchresults = get_string("searchresults");
|
||||
$strsearchagain = get_string("searchagain");
|
||||
$strtoomanytoshow = get_string("toomanytoshow");
|
||||
|
||||
if ($search) {
|
||||
$searchstring = $strsearchagain;
|
||||
} else {
|
||||
$searchstring = $strsearch;
|
||||
}
|
||||
|
||||
|
||||
if (!$id) {
|
||||
print_header("$site->shortname: $strassignteachers", "$site->fullname",
|
||||
"<a href=\"index.php\">$stradministration</a> -> $strassignteachers");
|
||||
|
||||
$isadmin = isadmin(); /// cache value
|
||||
$courses = get_courses();
|
||||
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("center");
|
||||
|
||||
foreach ($courses as $course) {
|
||||
if ($isadmin or isteacher($course->id, $USER->id)){
|
||||
echo "<a href=\"teacher.php?id=$course->id\">$course->fullname ($course->shortname)</a><br>\n";
|
||||
$coursesfound = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
print_simple_box_end();
|
||||
|
||||
if ($coursesfound == FALSE) {
|
||||
print_heading(get_string("nocoursesyet"));
|
||||
print_continue("../$CFG->admin/index.php");
|
||||
}
|
||||
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect (can't find it)");
|
||||
}
|
||||
|
||||
|
||||
print_header("$site->shortname: $course->shortname: $strassignteachers",
|
||||
"$site->fullname",
|
||||
"<a href=\"index.php\">$stradministration</a> ->
|
||||
<a href=\"teacher.php\">$strassignteachers</a> -> $course->shortname", "");
|
||||
|
||||
print_heading("<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname ($course->shortname)</a>");
|
||||
|
||||
|
||||
/// Get all existing teachers for this course.
|
||||
$teachers = get_course_teachers($course->id);
|
||||
|
||||
/// Add a teacher if one is specified
|
||||
|
||||
if (!empty($add)) {
|
||||
if (!isteacher($course->id)){
|
||||
error("You must be an administrator or teacher to modify this course.");
|
||||
}
|
||||
|
||||
if (! $user = get_record("user", "id", $add)) {
|
||||
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
|
||||
}
|
||||
|
||||
if (!empty($teachers)) {
|
||||
foreach ($teachers as $tt) {
|
||||
if ($tt->id == $user->id) {
|
||||
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$teacher->userid = $user->id;
|
||||
$teacher->course = $course->id;
|
||||
if (!empty($teachers)) {
|
||||
$teacher->authority = 2;
|
||||
} else {
|
||||
$teacher->authority = 1; // First teacher is the main teacher
|
||||
}
|
||||
$teacher->id = insert_record("user_teachers", $teacher);
|
||||
if (empty($teacher->id)) {
|
||||
error("Could not add that teacher to this course!");
|
||||
}
|
||||
$teachers[] = $user;
|
||||
}
|
||||
|
||||
/// Remove a teacher if one is specified.
|
||||
|
||||
if (!empty($remove)) {
|
||||
|
||||
if (!isteacher($course->id)){
|
||||
error("You must be an administrator or teacher to modify this course.");
|
||||
}
|
||||
if (! $user = get_record("user", "id", $remove)) {
|
||||
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
|
||||
}
|
||||
if (!empty($teachers)) {
|
||||
foreach ($teachers as $key => $tt) {
|
||||
if ($tt->id == $user->id) {
|
||||
remove_teacher($user->id, $course->id);
|
||||
unset($teachers[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Print the lists of existing and potential teachers
|
||||
|
||||
echo "<table cellpadding=2 cellspacing=10 align=center>";
|
||||
echo "<tr><th width=50%>$strexistingteachers</th><th width=50%>$strpotentialteachers</th></tr>";
|
||||
echo "<tr><td width=50% nowrap valign=top>";
|
||||
|
||||
/// First, show existing teachers for this course
|
||||
|
||||
if (empty($teachers)) {
|
||||
echo "<p align=center>$strnoexistingteachers</a>";
|
||||
$teacherlist = "";
|
||||
|
||||
} else {
|
||||
$teacherarray = array();
|
||||
foreach ($teachers as $teacher) {
|
||||
$teacherarray[] = $teacher->id;
|
||||
echo "<p align=right>$teacher->firstname $teacher->lastname, $teacher->email <a href=\"teacher.php?id=$course->id&remove=$teacher->id\" title=\"$strremoveteacher\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
|
||||
}
|
||||
$teacherlist = implode(",",$teacherarray);
|
||||
unset($teacherarray);
|
||||
}
|
||||
|
||||
echo "<td width=50% nowrap valign=top>";
|
||||
|
||||
/// Print list of potential teachers
|
||||
|
||||
$usercount = get_users(false, $search, true, $teacherlist);
|
||||
|
||||
if ($usercount == 0) {
|
||||
echo "<p align=center>$strnopotentialteachers</p>";
|
||||
|
||||
} else if ($usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<p align=center>$strtoomanytoshow</p>";
|
||||
|
||||
} else {
|
||||
|
||||
if ($search) {
|
||||
echo "<p align=center>($strsearchresults : $search)</p>";
|
||||
}
|
||||
|
||||
if (!$users = get_users(true, $search, true, $teacherlist)) {
|
||||
error("Could not get users!");
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?id=$course->id&add=$user->id\"".
|
||||
"title=\"$straddteacher\"><img src=\"../pix/t/left.gif\"".
|
||||
"border=0></a> $user->firstname $user->lastname, $user->email";
|
||||
}
|
||||
}
|
||||
|
||||
if ($search or $usercount > MAX_USERS_PER_PAGE) {
|
||||
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
|
||||
echo "<input type=hidden name=id value=\"$course->id\">";
|
||||
echo "<input type=text name=search size=20>";
|
||||
echo "<input type=submit value=\"$searchstring\">";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
echo "</tr></table>";
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
+109
-78
@@ -12,10 +12,11 @@
|
||||
optional_variable($sort, "name");
|
||||
optional_variable($dir, "ASC");
|
||||
optional_variable($page, 0);
|
||||
optional_variable($search, "");
|
||||
|
||||
if (! record_exists("user_admins")) { // No admin user yet
|
||||
$user->firstname = "Admin";
|
||||
$user->lastname = "User";
|
||||
$user->firstname = get_string("admin");
|
||||
$user->lastname = get_string("user");
|
||||
$user->username = "admin";
|
||||
$user->password = md5("admin");
|
||||
$user->email = "root@localhost";
|
||||
@@ -54,9 +55,10 @@
|
||||
$USER->site = $CFG->wwwroot;
|
||||
$USER->admin = true;
|
||||
$USER->teacher["$site->id"] = true;
|
||||
save_session("USER");
|
||||
$USER->newadminuser = true;
|
||||
|
||||
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&course=$site->id");
|
||||
exit;
|
||||
|
||||
} else {
|
||||
if (! $site = get_site()) {
|
||||
@@ -95,6 +97,8 @@
|
||||
$stredit = get_string("edit");
|
||||
$strdelete = get_string("delete");
|
||||
$strdeletecheck = get_string("deletecheck");
|
||||
$strsearch = get_string("search");
|
||||
$strshowallusers = get_string("showallusers");
|
||||
|
||||
print_header("$site->shortname: $stredituser", $site->fullname,
|
||||
"<A HREF=\"index.php\">$stradministration</A> -> $stredituser");
|
||||
@@ -126,7 +130,6 @@
|
||||
|
||||
// Carry on with the user listing
|
||||
|
||||
$usercount = get_users_count();
|
||||
|
||||
$columns = array("name", "email", "city", "country", "lastaccess");
|
||||
|
||||
@@ -141,7 +144,7 @@
|
||||
if ($columnsort == $sort) {
|
||||
$$column = $string[$column];
|
||||
} else {
|
||||
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir\">".$string[$column]."</A>";
|
||||
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir&search=$search\">".$string[$column]."</A>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,89 +152,117 @@
|
||||
$sort = "firstname";
|
||||
}
|
||||
|
||||
if ($users = get_users_listing($sort, $dir, $page, $recordsperpage)) {
|
||||
if (!$users = get_users_listing($sort, $dir, $page, $recordsperpage, $search)) {
|
||||
if (!$users = get_users_listing($sort, $dir, 0, $recordsperpage)) {
|
||||
error("No users found!");
|
||||
} else {
|
||||
notify(get_string("nousersmatching", "", $search));
|
||||
$search = "";
|
||||
}
|
||||
}
|
||||
|
||||
$usercount = get_users(false);
|
||||
|
||||
if ($search) {
|
||||
$usersearchcount = get_users(false, $search);
|
||||
print_heading("$usersearchcount / $usercount ".get_string("users"));
|
||||
$usercount = $usersearchcount;
|
||||
} else {
|
||||
print_heading("$usercount ".get_string("users"));
|
||||
}
|
||||
|
||||
$a->start = $page;
|
||||
$a->end = $page + $recordsperpage;
|
||||
if ($a->end > $usercount) {
|
||||
$a->end = $usercount;
|
||||
}
|
||||
echo "<TABLE align=center cellpadding=10><TR>";
|
||||
echo "<TD>";
|
||||
if ($page) {
|
||||
$prevpage = $page - $recordsperpage;
|
||||
if ($prevpage < 0) {
|
||||
$prevpage = 0;
|
||||
}
|
||||
$options["dir"] = $dir;
|
||||
$options["page"] = 0;
|
||||
$options["sort"] = $sort;
|
||||
print_single_button("user.php", $options, " << ");
|
||||
echo "</TD><TD>";
|
||||
$options["page"] = $prevpage;
|
||||
print_single_button("user.php", $options, " < ");
|
||||
$a->start = $page;
|
||||
$a->end = $page + $recordsperpage;
|
||||
if ($a->end > $usercount) {
|
||||
$a->end = $usercount;
|
||||
}
|
||||
echo "<TABLE align=center cellpadding=10><TR>";
|
||||
echo "<TD>";
|
||||
if ($page) {
|
||||
$prevpage = $page - $recordsperpage;
|
||||
if ($prevpage < 0) {
|
||||
$prevpage = 0;
|
||||
}
|
||||
$options["dir"] = $dir;
|
||||
$options["page"] = 0;
|
||||
$options["sort"] = $sort;
|
||||
$options["search"] = $search;
|
||||
print_single_button("user.php", $options, " << ");
|
||||
echo "</TD><TD>";
|
||||
print_heading(get_string("displayingusers", "", $a));
|
||||
$options["page"] = $prevpage;
|
||||
print_single_button("user.php", $options, " < ");
|
||||
}
|
||||
echo "</TD><TD>";
|
||||
print_heading(get_string("displayingusers", "", $a));
|
||||
echo "</TD><TD>";
|
||||
$nextpage = $page + $recordsperpage;
|
||||
if ($nextpage < $usercount) {
|
||||
$options["dir"] = $dir;
|
||||
$options["page"] = $nextpage;
|
||||
$options["sort"] = $sort;
|
||||
$options["search"] = $search;
|
||||
print_single_button("user.php", $options, " > ");
|
||||
echo "</TD><TD>";
|
||||
$nextpage = $page + $recordsperpage;
|
||||
if ($nextpage < $usercount) {
|
||||
$options["dir"] = $dir;
|
||||
$options["page"] = $nextpage;
|
||||
$options["sort"] = $sort;
|
||||
print_single_button("user.php", $options, " > ");
|
||||
echo "</TD><TD>";
|
||||
$options["page"] = $usercount-$recordsperpage;
|
||||
print_single_button("user.php", $options, " >> ");
|
||||
}
|
||||
echo "</TD></TR></TABLE>";
|
||||
$options["page"] = $usercount-$recordsperpage;
|
||||
print_single_button("user.php", $options, " >> ");
|
||||
}
|
||||
echo "</TD></TR></TABLE>";
|
||||
|
||||
flush();
|
||||
flush();
|
||||
|
||||
foreach ($users as $key => $user) {
|
||||
foreach ($users as $key => $user) {
|
||||
if (!empty($user->country)) {
|
||||
$users[$key]->country = $COUNTRIES[$user->country];
|
||||
}
|
||||
if ($sort == "country") { // Need to resort by full country name, not code
|
||||
foreach ($users as $user) {
|
||||
$susers[$user->id] = $user->country;
|
||||
}
|
||||
asort($susers);
|
||||
foreach ($susers as $key => $value) {
|
||||
$nusers[] = $users[$key];
|
||||
}
|
||||
$users = $nusers;
|
||||
}
|
||||
|
||||
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
|
||||
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
|
||||
$table->width = "95%";
|
||||
foreach ($users as $user) {
|
||||
if ($user->id == $USER->id or $user->username == "changeme") {
|
||||
$deletebutton = "";
|
||||
} else {
|
||||
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
|
||||
}
|
||||
if ($user->lastaccess) {
|
||||
$strlastaccess = format_time(time() - $user->lastaccess);
|
||||
} else {
|
||||
$strlastaccess = get_string("never");
|
||||
}
|
||||
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
|
||||
"$user->email",
|
||||
"$user->city",
|
||||
"$user->country",
|
||||
$strlastaccess,
|
||||
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
|
||||
$deletebutton);
|
||||
}
|
||||
print_table($table);
|
||||
|
||||
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
|
||||
} else {
|
||||
error("No users found!");
|
||||
|
||||
}
|
||||
if ($sort == "country") { // Need to resort by full country name, not code
|
||||
foreach ($users as $user) {
|
||||
$susers[$user->id] = $user->country;
|
||||
}
|
||||
asort($susers);
|
||||
foreach ($susers as $key => $value) {
|
||||
$nusers[] = $users[$key];
|
||||
}
|
||||
$users = $nusers;
|
||||
}
|
||||
|
||||
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
|
||||
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
|
||||
$table->width = "95%";
|
||||
foreach ($users as $user) {
|
||||
if ($user->id == $USER->id or $user->username == "changeme") {
|
||||
$deletebutton = "";
|
||||
} else {
|
||||
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
|
||||
}
|
||||
if ($user->lastaccess) {
|
||||
$strlastaccess = format_time(time() - $user->lastaccess);
|
||||
} else {
|
||||
$strlastaccess = get_string("never");
|
||||
}
|
||||
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
|
||||
"$user->email",
|
||||
"$user->city",
|
||||
"$user->country",
|
||||
$strlastaccess,
|
||||
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
|
||||
$deletebutton);
|
||||
}
|
||||
|
||||
echo "<TABLE align=center cellpadding=10><TR><TD>";
|
||||
echo "<FORM ACTION=user.php METHOD=POST>";
|
||||
echo "<INPUT TYPE=text NAME=search VALUE=\"$search\" SIZE=20>";
|
||||
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
|
||||
if ($search) {
|
||||
echo "<INPUT type=\"button\" onClick=\"document.location='user.php';\" value=\"$strshowallusers\">";
|
||||
}
|
||||
echo "</FORM>";
|
||||
echo "</TD></TR></TABLE>";
|
||||
|
||||
print_table($table);
|
||||
|
||||
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
|
||||
|
||||
print_footer();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ none - no authentication at all .. very insecure!!
|
||||
- when user tries to access a course they
|
||||
are forced to set up their account details
|
||||
|
||||
manual - internal authentication only
|
||||
|
||||
- user logs in using username and password
|
||||
- no way for user to make their own account
|
||||
|
||||
|
||||
ldap - Uses an external LDAP server
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
LDAP-module README
|
||||
07.10.2002 Version 0.1, Petri Asikainen <paca@sci.fi>
|
||||
|
||||
Ldap-authetication module is work in progress.
|
||||
Please read comments from lib.php
|
||||
|
||||
@@ -82,7 +82,35 @@
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
|
||||
<TD ALIGN=RIGHT><P>ldap_memberattribute:</TD>
|
||||
<TD>
|
||||
<INPUT name=ldap_memberattribute TYPE=text SIZE=30 VALUE="<?=$config->ldap_memberattribute?>">
|
||||
<? if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
|
||||
</TD><TD>
|
||||
<? print_string("auth_ldap_memberattribute","auth") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
|
||||
<TD ALIGN=RIGHT><P>ldap_creators:</TD>
|
||||
<TD>
|
||||
<INPUT name=ldap_creators TYPE=text SIZE=30 VALUE="<?=$config->ldap_creators?>">
|
||||
<? if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
|
||||
</TD><TD>
|
||||
<? print_string("auth_ldap_creators","auth") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
|
||||
<TD ALIGN=RIGHT><P>ldap_create_context:</TD>
|
||||
<TD>
|
||||
<INPUT name=ldap_create_context TYPE=text SIZE=30 VALUE="<?=$config->ldap_create_context?>">
|
||||
<? if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
|
||||
</TD><TD>
|
||||
<? print_string("auth_ldap_create_context","auth") ?>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><P><? print_string("firstname") ?>:</TD>
|
||||
|
||||
+201
-54
@@ -1,12 +1,35 @@
|
||||
<?PHP // $Id$
|
||||
//CHANGELOG:
|
||||
//24.02.2003 Added support for coursecreators
|
||||
//20.02.2003 Added support for user creation
|
||||
//12.10.2002 Reformatted source for consistency
|
||||
//03.10.2002 First version to CVS
|
||||
//29.09.2002 Clean up and splitted code to functions v. 0.02
|
||||
//29.09.2002 LDAP authentication functions v. 0.01
|
||||
//Distributed under GPL (c)Petri Asikainen 2002
|
||||
//Distributed under GPL (c)Petri Asikainen 2002-2003
|
||||
|
||||
/* README!
|
||||
Module is quite complete and most functinality can be configured from
|
||||
configinterfave /admin/auth.php. Some of latest additions/features need to
|
||||
be configured by modifying source code.
|
||||
|
||||
If you plan to use user creation feature, look function auth_user_create
|
||||
and modify it for your needs.
|
||||
You have to change all hardcoded attribute values to fit your LDAP-server.
|
||||
User-creation makes posible that your current
|
||||
users can authenticate with existings usernames/password and new users can
|
||||
create own accounts to LDAP-directory. I'm using this feature and new users
|
||||
are created to LDAP different context, without rights to other system. When
|
||||
user-creation feature is set like that, there's no known security issues.
|
||||
I write ldap-module on Novell E-directory / Linux & Solaris ,
|
||||
so all default values are for it.
|
||||
|
||||
Any feedback is wellcome,
|
||||
|
||||
Petri Asikainen paca@sci.fi
|
||||
|
||||
|
||||
*/
|
||||
function auth_user_login ($username, $password) {
|
||||
/// Returns true if the username and password work
|
||||
/// and false if they don't
|
||||
@@ -20,7 +43,6 @@ function auth_user_login ($username, $password) {
|
||||
$ldap_connection = auth_ldap_connect();
|
||||
|
||||
if ($ldap_connection) {
|
||||
|
||||
$ldap_user_dn = auth_ldap_find_userdn($ldap_connection, $username);
|
||||
|
||||
//if ldap_user_dn is empty, user does not exist
|
||||
@@ -49,23 +71,14 @@ function auth_get_userinfo($username){
|
||||
global $CFG;
|
||||
|
||||
$config = (array)$CFG;
|
||||
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
|
||||
"department", "address", "city", "country", "description",
|
||||
"idnumber", "lang");
|
||||
|
||||
$moodleattributes = array();
|
||||
foreach ($fields as $field) {
|
||||
if ($config["auth_user_$field"]) {
|
||||
$moodleattributes[$field] = $config["auth_user_$field"];
|
||||
}
|
||||
}
|
||||
|
||||
$attrmap = auth_ldap_attributes();
|
||||
|
||||
$ldap_connection=auth_ldap_connect();
|
||||
|
||||
$result = array();
|
||||
$search_attribs = array();
|
||||
|
||||
foreach ($moodleattributes as $key=>$value) {
|
||||
foreach ($attrmap as $key=>$value) {
|
||||
array_push($search_attribs, $value);
|
||||
}
|
||||
|
||||
@@ -79,7 +92,7 @@ function auth_get_userinfo($username){
|
||||
|
||||
if ($user_info_result) {
|
||||
$user_entry = ldap_get_entries($ldap_connection, $user_info_result);
|
||||
foreach ($moodleattributes as $key=>$value){
|
||||
foreach ($attrmap as $key=>$value){
|
||||
if(isset($user_entry[0][$value][0])){
|
||||
$result[$key]=$user_entry[0][$value][0];
|
||||
}
|
||||
@@ -91,49 +104,113 @@ function auth_get_userinfo($username){
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function auth_get_userlist() {
|
||||
/// returns all users from ldap servers
|
||||
function auth_get_userlist () {
|
||||
global $CFG;
|
||||
|
||||
$fresult = array();
|
||||
$ldap_connection = auth_ldap_connect();
|
||||
|
||||
auth_ldap_bind($ldap_connection);
|
||||
|
||||
if (! isset($CFG->ldap_objectclass)) {
|
||||
$CFG->ldap_objectclass="objectClass=*";
|
||||
}
|
||||
|
||||
$contexts = explode(";",$CFG->ldap_contexts);
|
||||
|
||||
foreach ($contexts as $context) {
|
||||
|
||||
if ($CFG->ldap_search_sub) {
|
||||
//use ldap_search to find first user from subtree
|
||||
$ldap_result = ldap_search($ldap_connection, $context,
|
||||
"(".$CFG->ldap_objectclass.")",
|
||||
array($CFG->ldap_user_attribute));
|
||||
} else {
|
||||
//search only in this context
|
||||
$ldap_result = ldap_list($ldap_connection, $context,
|
||||
"(".$CFG->ldap_objectclass.")",
|
||||
array($CFG->ldap_user_attribute));
|
||||
}
|
||||
|
||||
$users = ldap_get_entries($ldap_connection, $ldap_result);
|
||||
|
||||
//add found users to list
|
||||
for ($i=0;$i<$users['count'];$i++) {
|
||||
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
|
||||
}
|
||||
}
|
||||
|
||||
return $fresult;
|
||||
return auth_ldap_get_userlist("($CFG->ldap_user_attribute=*)");
|
||||
}
|
||||
function auth_user_exists ($username) {
|
||||
global $CFG;
|
||||
//returns true if given usernname exist on ldap
|
||||
$users = auth_ldap_get_userlist("($CFG->ldap_user_attribute=$username)");
|
||||
return count($users);
|
||||
}
|
||||
|
||||
function auth_user_create ($userobject,$plainpass) {
|
||||
//create new user to ldap
|
||||
//use auth_user_exists to prevent dublicate usernames
|
||||
//return true if user is created, false on error
|
||||
global $CFG;
|
||||
$attrmap = auth_ldap_attributes();
|
||||
$ldapconnect = auth_ldap_connect();
|
||||
$ldapbind = auth_ldap_bind($ldapconnect);
|
||||
|
||||
$newuser = array();
|
||||
|
||||
foreach ($attrmap as $key=>$value){
|
||||
if(isset($userobject->$key) ){
|
||||
$newuser[$value]=utf8_encode($userobject->$key);
|
||||
}
|
||||
}
|
||||
|
||||
//Following sets all mandatory and other forced attribute values
|
||||
//this should be moved to config inteface ASAP
|
||||
$newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top");
|
||||
$newuser['uniqueId']= $userobject->username;
|
||||
$newuser['logindisabled']="TRUE";
|
||||
$newuser['userpassword']=$plainpass;
|
||||
unset($newuser[country]);
|
||||
|
||||
$uadd = ldap_add($ldapconnect, $CFG->ldap_user_attribute."=$userobject->username,".$CFG->ldap_create_context, $newuser);
|
||||
|
||||
ldap_close($ldapconnect);
|
||||
return $uadd;
|
||||
|
||||
}
|
||||
|
||||
function auth_user_activate ($username) {
|
||||
//activate new ldap-user after email-address is confirmed
|
||||
global $CFG;
|
||||
|
||||
$ldapconnect = auth_ldap_connect();
|
||||
$ldapbind = auth_ldap_bind($ldapconnect);
|
||||
|
||||
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
|
||||
|
||||
$newinfo['loginDisabled']="FALSE";
|
||||
|
||||
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
|
||||
ldap_close($ldapconnect);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function auth_user_disable ($username) {
|
||||
//activate new ldap-user after email-address is confirmed
|
||||
global $CFG;
|
||||
|
||||
$ldapconnect = auth_ldap_connect();
|
||||
$ldapbind = auth_ldap_bind($ldapconnect);
|
||||
|
||||
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
|
||||
$newinfo['loginDisabled']="TRUE";
|
||||
|
||||
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
|
||||
ldap_close($ldapconnect);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function auth_iscreator($username=0) {
|
||||
///if user is member of creator group return true
|
||||
global $CFG, $USER;
|
||||
|
||||
$ldapconnect = auth_ldap_connect();
|
||||
$ldapbind = auth_ldap_bind($ldapconnect);
|
||||
|
||||
if (! $username) {
|
||||
$username=$USER->username;
|
||||
}
|
||||
|
||||
if ((! $CFG->ldap_creators) OR (! $CFG->ldap_memberattribute)) {
|
||||
return false;
|
||||
} else {
|
||||
$groups = explode(";",$CFG->ldap_creators);
|
||||
}
|
||||
|
||||
|
||||
//build filter
|
||||
$filter = "(& ($CFG->ldap_user_attribute=$username)(|";
|
||||
foreach ($groups as $group){
|
||||
$filter .= "($CFG->ldap_memberattribute=$group)";
|
||||
}
|
||||
$filter .= "))";
|
||||
//search
|
||||
$result = auth_ldap_get_userlist($filter);
|
||||
|
||||
return count($result);
|
||||
|
||||
}
|
||||
|
||||
//PRIVATE FUNCTIONS starts
|
||||
//private functions are named as auth_ldap*
|
||||
|
||||
function auth_ldap_connect(){
|
||||
/// connects to ldap-server
|
||||
@@ -192,6 +269,10 @@ function auth_ldap_find_userdn ($ldap_connection, $username){
|
||||
|
||||
//get all contexts and look for first matching user
|
||||
$ldap_contexts = explode(";",$CFG->ldap_contexts);
|
||||
|
||||
if (!empty($CFG->ldap_create_context)){
|
||||
array_push($ldap_contexts, $CFG->ldap_create_context);
|
||||
}
|
||||
|
||||
foreach ($ldap_contexts as $context) {
|
||||
|
||||
@@ -217,4 +298,70 @@ function auth_ldap_find_userdn ($ldap_connection, $username){
|
||||
return $ldap_user_dn;
|
||||
}
|
||||
|
||||
function auth_ldap_attributes (){
|
||||
//returns array containg attribute mappings between Moodle and ldap
|
||||
global $CFG;
|
||||
|
||||
$config = (array)$CFG;
|
||||
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
|
||||
"department", "address", "city", "country", "description",
|
||||
"idnumber", "lang");
|
||||
|
||||
$moodleattributes = array();
|
||||
foreach ($fields as $field) {
|
||||
if ($config["auth_user_$field"]) {
|
||||
$moodleattributes[$field] = $config["auth_user_$field"];
|
||||
}
|
||||
}
|
||||
return $moodleattributes;
|
||||
}
|
||||
|
||||
function auth_ldap_get_userlist($filter="*") {
|
||||
/// returns all users from ldap servers
|
||||
global $CFG;
|
||||
|
||||
$fresult = array();
|
||||
$ldap_connection = auth_ldap_connect();
|
||||
|
||||
auth_ldap_bind($ldap_connection);
|
||||
|
||||
if (! isset($CFG->ldap_objectclass)) {
|
||||
$CFG->ldap_objectclass="objectClass=*";
|
||||
}
|
||||
|
||||
if ($filter=="*") {
|
||||
$filter = "(&(".$CFG->ldap_user_attribute."=*)(".$CFG->ldap_objectclass."))";
|
||||
}
|
||||
|
||||
$contexts = explode(";",$CFG->ldap_contexts);
|
||||
|
||||
if (!empty($CFG->ldap_create_context)){
|
||||
array_push($contexts, $CFG->ldap_create_context);
|
||||
}
|
||||
|
||||
foreach ($contexts as $context) {
|
||||
|
||||
if ($CFG->ldap_search_sub) {
|
||||
//use ldap_search to find first user from subtree
|
||||
$ldap_result = ldap_search($ldap_connection, $context,
|
||||
$filter,
|
||||
array($CFG->ldap_user_attribute));
|
||||
} else {
|
||||
//search only in this context
|
||||
$ldap_result = ldap_list($ldap_connection, $context,
|
||||
$filter,
|
||||
array($CFG->ldap_user_attribute));
|
||||
}
|
||||
|
||||
$users = ldap_get_entries($ldap_connection, $ldap_result);
|
||||
|
||||
//add found users to list
|
||||
for ($i=0;$i<$users['count'];$i++) {
|
||||
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
|
||||
}
|
||||
}
|
||||
|
||||
return $fresult;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<TR VALIGN=TOP>
|
||||
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
|
||||
<TD>
|
||||
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
|
||||
</TD>
|
||||
<TD>
|
||||
<? print_string("authinstructions","auth") ?>
|
||||
<? helpbutton("text", get_string("helptext")) ?>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?PHP // $Id$
|
||||
// manual method - Just does a simple check against the database
|
||||
|
||||
function auth_user_login ($username, $password) {
|
||||
// Returns false if the username doesn't exist yet
|
||||
// Returns true if the username and password work
|
||||
|
||||
if ($user = get_user_info_from_db("username", $username)) {
|
||||
return ($user->password == md5($password));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,33 @@
|
||||
README $Id$
|
||||
----------
|
||||
|
||||
This directory contains my try to create a backup/recover
|
||||
admin option to moodle. I don't know when and how it'll be
|
||||
finished, but I'going to try it, sure.
|
||||
|
||||
Some day, if this is fully functional, it could be integrated
|
||||
into the main Moodle distribution (ask uncle Martin). :-)
|
||||
|
||||
Code here may not be tested - so there are no guarantees as
|
||||
to the quality of the code in here, even if part of a stable
|
||||
Moodle release.
|
||||
|
||||
Please, for any comment about this option, do it in Moodle
|
||||
Developer Forum at:
|
||||
|
||||
http://moodle.org/mod/forum/view.php?id=55
|
||||
(searching an "backup" topic)
|
||||
|
||||
or you can put tour comments in Moodel Bugs at:
|
||||
|
||||
http://moodle.org/bugs/bug.php?op=show&bugid=84.
|
||||
|
||||
All comments will be welcome. TIA.
|
||||
|
||||
To see the general status of the utility, take a look to
|
||||
"STATUS.txt" in this directory.
|
||||
|
||||
And this is all, I start with it NOW.
|
||||
|
||||
Eloy (stronk7)
|
||||
29-04-2003
|
||||
@@ -0,0 +1,197 @@
|
||||
STATUS $Id$
|
||||
----------
|
||||
|
||||
This documment shows the current status of the backup/restore option.
|
||||
|
||||
Backup: WORKING. COMPLETED but only assignments, resources,
|
||||
choices and surveys.
|
||||
|
||||
Restore: WORKING. NOT COMPLETED. Only course, users, user_files and
|
||||
course_files. No logs, mods or final checks !!!!
|
||||
|
||||
|
||||
========== ========== ========== ========== ========== ==========
|
||||
|
||||
Now I show the specific detailed status of every item in the process:
|
||||
|
||||
Backup Details:
|
||||
===============
|
||||
- Backup FrontEnd............................................DONE
|
||||
- Check Security........................................DONE
|
||||
- Select Info to Backup.(from mods).....................DONE
|
||||
- Check (summary info)..................................DONE
|
||||
- Check mods.......................................DONE
|
||||
- Check logs.......................................DONE
|
||||
- Check users......................................DONE
|
||||
- Check User Files.................................DONE
|
||||
- Check Course Files...............................DONE
|
||||
- Launch Backup.........................................DONE
|
||||
- Show progress.........................................DONE
|
||||
- Determine Backup location.............................DONE
|
||||
- Delete old entries at backup startup..................DONE
|
||||
- From database....................................DONE
|
||||
- From filesystem..................................DONE
|
||||
- Backup Items:..............................................IN PROGRESS
|
||||
- Backup Info data......................................DONE
|
||||
- Course................................................IN PROGRESS
|
||||
- Course Summary Data................................DONE
|
||||
x course info.....................................DONE
|
||||
x sections info...................................DONE
|
||||
x mods info.......................................DONE
|
||||
- User Accounts Info.................................DONE
|
||||
x admins..........................................DONE
|
||||
- All..........................................DONE
|
||||
x course creators.................................DONE
|
||||
- All..........................................DONE
|
||||
x teachers........................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
x students........................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
- Logs...............................................DONE
|
||||
- Mods Info..........................................IN PROGRESS
|
||||
x assignments.....................................DONE
|
||||
+ course data..................................DONE
|
||||
+ user data....................................DONE
|
||||
+ files........................................DONE
|
||||
x choices.........................................DONE
|
||||
+ course data..................................DONE
|
||||
+ user data....................................DONE
|
||||
+ files.....(NOT EXISTS).......................DONE
|
||||
x forums..........................................IN PROGRESS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x journals........................................IN PROGRESS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x peer graded assignments.........................IN PROGRESS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x quizzes.........................................IN PROGRESS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x resources.......................................DONE
|
||||
+ course data..................................DONE
|
||||
+ user data....................................DONE
|
||||
+ files..(ARE COURSE FILES !!!)................DONE
|
||||
x surveys.........................................DONE
|
||||
+ course data..................................DONE
|
||||
+ user data....................................DONE
|
||||
+ files.....(NOT EXISTS).......................DONE
|
||||
x workshops.......................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x user files to temp..............................DONE
|
||||
x course files to temp............................DONE
|
||||
- Compress the backup (zip)..................................DONE. PROBLEMS PCLZIP/UNZIP
|
||||
- XML File................................................DONE. PROBLEMS PCLZIP/UNZIP
|
||||
- moddata files...........................................DONE. PROBLEMS PCLZIP/UNZIP
|
||||
- Course Files............................................DONE. PROBLEMS PCLZIP/UNZIP
|
||||
- User Files..............................................DONE. PROBLEMS PCLZIP/UNZIP
|
||||
- Copy finished file to browseable dir.......................DONE
|
||||
- Delete old entries at backup end...........................DONE
|
||||
- From database...........................................DONE
|
||||
- From filesystem.........................................DONE
|
||||
- Browse backup files........................................DONE
|
||||
- Download backup files......................................DONE
|
||||
- Delete backup files........................................DONE
|
||||
- Program automatic backups..................................NO EXISTS
|
||||
|
||||
Restore Details:
|
||||
===============
|
||||
- Delete old entries at restore start........................DONE
|
||||
- From database...........................................DONE
|
||||
- From filesystem.........................................DONE
|
||||
- Restore FrontEnd...........................................DONE
|
||||
- Check Security........................................DONE
|
||||
- Select File to Restore................................DONE
|
||||
- Uncompress the backup (unzip).........................DONE
|
||||
- XML File..........................................DONE
|
||||
- Course Files......................................DONE
|
||||
- User Files........................................DONE
|
||||
- Check file is a valid one.............................DONE
|
||||
- Load info from file...................................DONE
|
||||
- Load Backup Info......................................DONE
|
||||
- Load Course Header....................................DONE
|
||||
- Restore into feature..................................DONE
|
||||
- New course (restore)...............................DONE
|
||||
- Existing course (import)...........................DONE
|
||||
- Select Info to Restore (depending from backup)........DONE
|
||||
- Make decisions........................................DONE
|
||||
- About existing users...............................DONE
|
||||
- Launch Restore........................................DONE
|
||||
- Show progress.........................................DONE
|
||||
- Restore Items:.............................................IN PROGRESS
|
||||
- Course................................................DONE
|
||||
- Course Summary Data................................DONE
|
||||
- Course Table....................................DONE
|
||||
- Sections Table..................................DONE
|
||||
- Modules Table...................................DONE
|
||||
- User Accounts Info.................................DONE
|
||||
x teacheras. .....................................DONE
|
||||
- None .......................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
x students........................................DONE
|
||||
- None.........................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
x creators........................................DONE
|
||||
- None.........................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
x admins..........................................DONE
|
||||
- None.........................................DONE
|
||||
- Course.......................................DONE
|
||||
- All..........................................DONE
|
||||
- Mods Info..........................................NO EXISTS
|
||||
x assignments.....................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x choices.........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x forums..........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x journals........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x quizzes.........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x resources.......................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x surveys.........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
- User files from temp.......................................DONE
|
||||
- Course files from temp.....................................DONE
|
||||
- Log entries................................................NO EXISTS
|
||||
- Readjust instance in course_modules........................NO EXISTS
|
||||
- Readjust modinfo in course (serialize).....................NO EXISTS
|
||||
- Delete old entries at restore end. .......................NO EXISTS
|
||||
- From database...........................................NO EXISTS
|
||||
- From filesystem.........................................NO EXISTS
|
||||
- Upload backup files........................................DONE
|
||||
|
||||
========== ========== ========== =========== =========== =========== ===
|
||||
|
||||
This is all. It's no a little thing !!! :-)
|
||||
|
||||
Eloy (stronk7)
|
||||
29-04-2003
|
||||
@@ -0,0 +1,91 @@
|
||||
<?PHP //$Id$
|
||||
//This script is used to configure and execute the backup proccess.
|
||||
|
||||
//Define some globals for all the script
|
||||
|
||||
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
|
||||
//ALL RELATIVE FROM THE LOCATION OF THE backup.php SCRIPT !!!
|
||||
|
||||
$moodle_home = "../../..";
|
||||
$mods_home = "mod";
|
||||
|
||||
//END MUST CHANGE
|
||||
|
||||
//Units used
|
||||
require_once ("$moodle_home/config.php");
|
||||
require_once ("$moodle_home/version.php");
|
||||
require_once ("backup_version.php");
|
||||
require_once ("db/backup_$CFG->dbtype.php");
|
||||
require_once ("lib.php");
|
||||
require_once ("backuplib.php");
|
||||
|
||||
//Optional variables
|
||||
optional_variable($id); // course id
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Check backup_version
|
||||
upgrade_backup_db($backup_version,$backup_release,"backup.php");
|
||||
|
||||
//Get strings
|
||||
$strcoursebackup = get_string("coursebackup");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
//If no course has been selected or cancel button pressed
|
||||
if (!$id or $cancel) {
|
||||
print_header("$site->shortname: $strcoursebackup", $site->fullname,
|
||||
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcoursebackup");
|
||||
|
||||
if ($courses = get_courses()) {
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("CENTER");
|
||||
foreach ($courses as $course) {
|
||||
echo "<A HREF=\"backup.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
|
||||
}
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
print_heading(get_string("nocoursesyet"));
|
||||
print_continue("$moodle_home/$CFG->admin/index.php");
|
||||
}
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
//Get and check course
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect (can't find it)");
|
||||
}
|
||||
//Print header
|
||||
print_header("$site->shortname: $strcoursebackup", $site->fullname,
|
||||
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
|
||||
<A HREF=\"backup.php\">$strcoursebackup</A> -> $course->fullname ($course->shortname)");
|
||||
|
||||
//Print form
|
||||
print_heading("$strcoursebackup: $course->fullname ($course->shortname)");
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
//Call the form, depending the step we are
|
||||
if (!$launch) {
|
||||
include_once("backup_form.html");
|
||||
} else if ($launch == "check") {
|
||||
include_once("backup_check.html");
|
||||
} else if ($launch == "execute") {
|
||||
include_once("backup_execute.html");
|
||||
}
|
||||
print_simple_box_end();
|
||||
|
||||
//Print footer
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
<?PHP //$Id$
|
||||
//This page prints the backup todo list to see everything
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Checks for the required files/functions to backup every mod
|
||||
//And check if there is data about it
|
||||
$count = 0;
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modfile = "$mods_home/$modname/backuplib.php";
|
||||
$modbackup = $modname."_backup_mods";
|
||||
$modcheckbackup = $modname."_check_backup_mods";
|
||||
if (file_exists($modfile)) {
|
||||
include_once($modfile);
|
||||
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
|
||||
$var = "exists_".$modname;
|
||||
$$var = true;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//Check data
|
||||
//Check module info
|
||||
$var = "backup_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
//Check include user info
|
||||
$var = "backup_user_info_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check other parameters
|
||||
if (!isset($backup_users)) {
|
||||
$backup_users = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_logs)) {
|
||||
$backup_logs = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_user_files)) {
|
||||
$backup_user_files = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_course_files)) {
|
||||
$backup_course_files = 2;
|
||||
}
|
||||
|
||||
if ($count == 0) {
|
||||
notice("No backupable modules are installed!");
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
||||
<table cellpadding=5>
|
||||
<?
|
||||
|
||||
//Now print the Backup Name tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("name").":";
|
||||
echo "</B></td><td>";
|
||||
//Calculate the backup string
|
||||
$backup_name = strtolower(get_string("backup"));
|
||||
//If non-translated, use "backup"
|
||||
if (substr($backup_name,0,1) == "[") {
|
||||
$backup_name = "backup";
|
||||
}
|
||||
//Calculate the format string
|
||||
$backup_name_format = get_string("backupnameformat");
|
||||
//If non-translated, use "%Y%m%d-%H%M"
|
||||
if (substr($backup_name_format,0,1) == "[") {
|
||||
$backup_name_format = "%%Y%%m%%d-%%H%%M";
|
||||
}
|
||||
$backup_name .= "-".strtolower($course->shortname)."-".userdate(time(),$backup_name_format,99,false).".zip";
|
||||
echo $backup_name;
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_name\" value=\"".$backup_name."\">";
|
||||
echo "</td></tr>";
|
||||
|
||||
//Calculate the backup unique code to allow simultaneus backups (to define
|
||||
//the temp-directory name and records in backup temp tables
|
||||
$backup_unique_code = time();
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"".$backup_unique_code."\">";
|
||||
|
||||
//Line
|
||||
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
|
||||
|
||||
//Now print the To Do list
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\" align=\"center\"><P><B>";
|
||||
echo get_string("backupdetails").":";
|
||||
echo "</td></tr>";
|
||||
|
||||
//This is tha align to every ingo table
|
||||
$table->align = array ("LEFT","RIGHT");
|
||||
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modbackup = $modname."_backup_mods";
|
||||
//If exists the lib & function
|
||||
$var = "exists_".$modname;
|
||||
if ($$var) {
|
||||
//Add hidden fields
|
||||
$var = "backup_".$modname;
|
||||
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
|
||||
$var = "backup_user_info_".$modname;
|
||||
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
|
||||
$var = "backup_".$modname;
|
||||
//Only if selected
|
||||
if ($$var == 1) {
|
||||
//Print the full tr
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\"><P><B>";
|
||||
//Print the mod name
|
||||
echo "<li>".get_string("include")." ".get_string("modulenameplural",$modname)." ";
|
||||
//Now look for user-data status
|
||||
$backup_user_options[0] = get_string("withoutuserdata");
|
||||
$backup_user_options[1] = get_string("withuserdata");
|
||||
$var = "backup_user_info_".$modname;
|
||||
//Print the user info
|
||||
echo $backup_user_options[$$var]."<P>";
|
||||
//Call the check function to show more info
|
||||
$modcheckbackup = $modname."_check_backup_mods";
|
||||
$table->data = $modcheckbackup($id,$$var,$backup_unique_code);
|
||||
print_table($table);
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
//Line
|
||||
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
|
||||
|
||||
//Now print the Users tr
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\"><P><B>";
|
||||
$user_options[0] = get_string("includeallusers");
|
||||
$user_options[1] = get_string("includecourseusers");
|
||||
///$user_options[2] = get_string("includeneededusers");--->NOT IMPLEMENTED
|
||||
echo "<li>".$user_options[$backup_users]."<P>";
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_users\" value=\"".$backup_users."\">";
|
||||
//Print info
|
||||
$table->data = user_check_backup($id,$backup_unique_code,$backup_users);
|
||||
print_table($table);
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the Logs tr conditionally
|
||||
if ($backup_logs) {
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\"><P><B>";
|
||||
echo "<li>".get_string("includelogentries")."<P>";
|
||||
//Print info
|
||||
$table->data = log_check_backup($id);
|
||||
print_table($table);
|
||||
echo "</td></tr>";
|
||||
}
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_logs\" value=\"".$backup_logs."\">";
|
||||
|
||||
//Now print the User Files tr conditionally
|
||||
if ($backup_user_files) {
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\"><P><B>";
|
||||
echo "<li>".get_string("includeuserfiles")."<P>";
|
||||
//Print info
|
||||
$table->data = user_files_check_backup($id,$backup_unique_code);
|
||||
print_table($table);
|
||||
echo "</td></tr>";
|
||||
}
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_user_files\" value=\"".$backup_user_files."\">";
|
||||
|
||||
//Now print the Course Files tr conditionally
|
||||
if ($backup_course_files) {
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\"><P><B>";
|
||||
echo "<li>".get_string("includecoursefiles")."<P>";
|
||||
//Print info
|
||||
$table->data = course_files_check_backup($id,$backup_unique_code);
|
||||
print_table($table);
|
||||
echo "</td></tr>";
|
||||
}
|
||||
//Add as hidden name
|
||||
echo "<input type=\"hidden\" name=\"backup_course_files\" value=\"".$backup_course_files."\">";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<BR>
|
||||
<CENTER>
|
||||
<input type="hidden" name=id value="<? p($id) ?>">
|
||||
<input type="hidden" name=launch value="execute">
|
||||
<input type="submit" value="<? print_string("continue") ?>">
|
||||
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
||||
</CENTER>
|
||||
</FORM>
|
||||
@@ -0,0 +1,277 @@
|
||||
<?PHP //$Id$
|
||||
//This page prints the backup todo list to see everything
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Checks for the required files/functions to backup every mod
|
||||
//And check if there is data about it
|
||||
$count = 0;
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modfile = "$mods_home/$modname/backuplib.php";
|
||||
$modbackup = $modname."_backup_mods";
|
||||
$modcheckbackup = $modname."_check_backup_mods";
|
||||
if (file_exists($modfile)) {
|
||||
include_once($modfile);
|
||||
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
|
||||
$var = "exists_".$modname;
|
||||
$$var = true;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//Check data
|
||||
//Check module info
|
||||
$var = "backup_".$modname;
|
||||
if (!isset($$var)) {
|
||||
//Every undefined backup_XXXX isn't exported
|
||||
$$var = 0;
|
||||
}
|
||||
//Now stores all the mods preferences into an array into preferences
|
||||
$preferences->mods[$modname]->backup = $$var;
|
||||
|
||||
//Check include user info
|
||||
$var = "backup_user_info_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
//Now stores all the mods preferences into an array into preferences
|
||||
$preferences->mods[$modname]->userinfo = $$var;
|
||||
//And the name of the mod
|
||||
$preferences->mods[$modname]->name = $modname;
|
||||
}
|
||||
}
|
||||
|
||||
//Check other parameters
|
||||
if (!isset($backup_users)) {
|
||||
$backup_users = 1;
|
||||
}
|
||||
$preferences->backup_users = $backup_users;
|
||||
|
||||
if (!isset($backup_logs)) {
|
||||
$backup_logs = 1;
|
||||
}
|
||||
$preferences->backup_logs = $backup_logs;
|
||||
|
||||
if (!isset($backup_user_files)) {
|
||||
$backup_user_files = 1;
|
||||
}
|
||||
$preferences->backup_user_files = $backup_user_files;
|
||||
|
||||
if (!isset($backup_course_files)) {
|
||||
$backup_course_files = 2;
|
||||
}
|
||||
$preferences->backup_course_files = $backup_course_files;
|
||||
|
||||
if (!isset($id)) {
|
||||
error ("Course not specified");
|
||||
}
|
||||
$preferences->backup_course = $id;
|
||||
|
||||
if (!isset($backup_name)) {
|
||||
error ("Backup name not specified");
|
||||
}
|
||||
$preferences->backup_name = $backup_name;
|
||||
|
||||
if (!isset($backup_unique_code)) {
|
||||
error ("Backup unique code not specified");
|
||||
}
|
||||
$preferences->backup_unique_code = $backup_unique_code;
|
||||
|
||||
//Another Info
|
||||
$preferences->moodle_version = $version;
|
||||
$preferences->moodle_release = $release;
|
||||
$preferences->backup_version = $backup_version;
|
||||
$preferences->backup_release = $backup_release;
|
||||
|
||||
if ($count == 0) {
|
||||
notice("No backupable modules are installed!");
|
||||
}
|
||||
|
||||
//Start the main table
|
||||
echo "<table cellpadding=5>";
|
||||
|
||||
//Now print the Backup Name tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("name").":";
|
||||
echo "</B></td><td>";
|
||||
echo $backup_name;
|
||||
echo "</td></tr>";
|
||||
|
||||
//Start the main tr, where all the backup progress is done
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\">";
|
||||
|
||||
//Start the main ul
|
||||
echo "<ul>";
|
||||
|
||||
//Check for temp and backup and backup_unique_code directory
|
||||
//Create them as needed
|
||||
echo "<li>Creating temporary structures";
|
||||
$status = check_and_create_backup_dir($backup_unique_code);
|
||||
//Empty dir
|
||||
if ($status) {
|
||||
$status = clear_backup_dir($backup_unique_code);
|
||||
}
|
||||
|
||||
//Delete old_entries from backup tables
|
||||
echo "<li>Deteting old data";
|
||||
$status = backup_delete_old_data();
|
||||
if (!$status) {
|
||||
error ("An error has ocurred");
|
||||
}
|
||||
|
||||
//Create the moodle.xml file
|
||||
if ($status) {
|
||||
echo "<li>Creating xml file";
|
||||
//Begin a new list to xml contents
|
||||
echo "<ul>";
|
||||
echo "<li>Writing header";
|
||||
//Obtain the xml file (create and open) and print prolog information
|
||||
$backup_file = backup_open_xml($backup_unique_code);
|
||||
echo "<li>Writing general info";
|
||||
//Prints general info about backup to file
|
||||
if ($backup_file) {
|
||||
$status = backup_general_info($backup_file,$preferences);
|
||||
}
|
||||
echo "<li>Writing course data";
|
||||
|
||||
//Start new ul (for course)
|
||||
echo "<ul>";
|
||||
|
||||
echo "<li>Course info";
|
||||
//Prints course start (tag and general info)
|
||||
if ($status) {
|
||||
$status = backup_course_start($backup_file,$preferences);
|
||||
}
|
||||
echo "<li>Sections";
|
||||
//Section info
|
||||
if ($status) {
|
||||
$status = backup_course_sections($backup_file,$preferences);
|
||||
}
|
||||
|
||||
//End course contents (close ul)
|
||||
echo "</ul>";
|
||||
|
||||
echo "<li>Writing users info";
|
||||
//User info
|
||||
if ($status) {
|
||||
$status = backup_user_info($backup_file,$preferences);
|
||||
}
|
||||
|
||||
//Print logs if selected
|
||||
if ($status) {
|
||||
if ($preferences->backup_logs) {
|
||||
echo "<li>Writing logs info";
|
||||
$status = backup_log_info($backup_file,$preferences);
|
||||
}
|
||||
}
|
||||
|
||||
//Module info, this unique function makes all the work!!
|
||||
//db export and module fileis copy
|
||||
if ($status) {
|
||||
$mods_to_backup = false;
|
||||
//Check if we have any mod to backup
|
||||
foreach ($preferences->mods as $module) {
|
||||
if ($module->backup) {
|
||||
$mods_to_backup = true;
|
||||
}
|
||||
}
|
||||
//If we have to backup some module
|
||||
if ($mods_to_backup) {
|
||||
echo "<li>Writing modules info";
|
||||
//Start modules tag
|
||||
$status = backup_modules_start ($backup_file,$preferences);
|
||||
//Open ul for module list
|
||||
echo "<ul>";
|
||||
//Iterate over modules and call backupa
|
||||
foreach ($preferences->mods as $module) {
|
||||
if ($module->backup and $status) {
|
||||
echo "<li>".$module->name;
|
||||
$status = backup_module($backup_file,$preferences,$module->name);
|
||||
}
|
||||
}
|
||||
//Close ul for module list
|
||||
echo "</ul>";
|
||||
//Close modules tag
|
||||
$status = backup_modules_end ($backup_file,$preferences);
|
||||
}
|
||||
}
|
||||
|
||||
//Prints course end
|
||||
if ($status) {
|
||||
$status = backup_course_end($backup_file,$preferences);
|
||||
}
|
||||
//Close the xml file and xml data
|
||||
if ($backup_file) {
|
||||
backup_close_xml($backup_file);
|
||||
}
|
||||
|
||||
//End xml contents (close ul)
|
||||
echo "</ul>";
|
||||
}
|
||||
|
||||
//Now, if selected, copy user files
|
||||
if ($status) {
|
||||
if ($preferences->backup_user_files) {
|
||||
echo "<li>Copying user files";
|
||||
$status = backup_copy_user_files ($preferences);
|
||||
}
|
||||
}
|
||||
|
||||
//Now, if selected, copy course files
|
||||
if ($status) {
|
||||
if ($preferences->backup_course_files) {
|
||||
echo "<li>Copying course files";
|
||||
$status = backup_copy_course_files ($preferences);
|
||||
}
|
||||
}
|
||||
|
||||
//Now, zip all the backup directory contents
|
||||
if ($status) {
|
||||
echo "<li>Zipping backup";
|
||||
$status = backup_zip ($preferences,$moodle_home);
|
||||
}
|
||||
|
||||
//Now, copy the zip file to course directory
|
||||
if ($status) {
|
||||
echo "<li>Copying zip file";
|
||||
$status = copy_zip_to_course_dir ($preferences);
|
||||
}
|
||||
|
||||
//Now, clean temporary data (db and filesystem)
|
||||
if ($status) {
|
||||
echo "<li>Cleaning up temp data";
|
||||
$status = clean_temp_data ($preferences);
|
||||
}
|
||||
|
||||
if (!$status) {
|
||||
error ("An error has ocurred");
|
||||
}
|
||||
|
||||
//Ends th main ul
|
||||
echo "</ul>";
|
||||
|
||||
//End the main tr, where all the backup is done
|
||||
echo "</td></tr>";
|
||||
|
||||
//End the main table
|
||||
echo "</table>";
|
||||
|
||||
//Print final message
|
||||
print_simple_box(get_string("backupfinished"),"CENTER");
|
||||
print_continue($moodle_home."/files/index.php?id=".$preferences->backup_course."&wdir=/".get_string("backupdir"));
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?PHP //$Id$
|
||||
//This page prints the backup form to select everything
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Checks for the required files/functions to backup every mod
|
||||
//And check if there is data about it
|
||||
$count = 0;
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modfile = "$mods_home/$modname/backuplib.php";
|
||||
$modbackup = $modname."_backup_mods";
|
||||
$modcheckbackup = $modname."_check_backup_mods";
|
||||
if (file_exists($modfile)) {
|
||||
include_once($modfile);
|
||||
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
|
||||
$var = "exists_".$modname;
|
||||
$$var = true;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//Check data
|
||||
//Check module info
|
||||
$var = "backup_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
//Check include user info
|
||||
$var = "backup_user_info_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check other parameters
|
||||
if (!isset($backup_users)) {
|
||||
$backup_users = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_logs)) {
|
||||
$backup_logs = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_user_files)) {
|
||||
$backup_user_files = 1;
|
||||
}
|
||||
|
||||
if (!isset($backup_course_files)) {
|
||||
$backup_course_files = 1;
|
||||
}
|
||||
|
||||
if ($count == 0) {
|
||||
notice("No backupable modules are installed!");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
||||
<table cellpadding=5>
|
||||
<?
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modbackup = $modname."_backup_mods";
|
||||
//If exists the lib & function
|
||||
$var = "exists_".$modname;
|
||||
if ($$var) {
|
||||
//Print the full tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
|
||||
echo "</td><td>";
|
||||
$backup_options[0] = get_string("no");
|
||||
$backup_options[1] = get_string("yes");
|
||||
$var = "backup_".$modname;
|
||||
choose_from_menu($backup_options, $var, $$var, "");
|
||||
$backup_user_options[0] = get_string("withoutuserdata");
|
||||
$backup_user_options[1] = get_string("withuserdata");
|
||||
$var = "backup_user_info_".$modname;
|
||||
choose_from_menu($backup_user_options, $var, $$var, "");
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
//Line
|
||||
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
|
||||
|
||||
//Now print the Users tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("users").":";
|
||||
echo "</td><td>";
|
||||
$user_options[0] = get_string("all");
|
||||
$user_options[1] = get_string("course");
|
||||
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
|
||||
choose_from_menu($user_options, "backup_users", $backup_users, "");
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the Logs tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("logs").":";
|
||||
echo "</td><td>";
|
||||
$log_options[0] = get_string("no");
|
||||
$log_options[1] = get_string("yes");
|
||||
choose_from_menu($log_options, "backup_logs", $backup_logs, "");
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the User Files tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string ("userfiles").":";
|
||||
echo "</td><td>";
|
||||
$user_file_options[0] = get_string("no");
|
||||
$user_file_options[1] = get_string("yes");
|
||||
choose_from_menu($user_file_options, "backup_user_files", $backup_user_files, "");
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the Course Files tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string ("coursefiles").":";
|
||||
echo "</td><td>";
|
||||
$course_file_options[0] = get_string("no");
|
||||
$course_file_options[1] = get_string("yes");
|
||||
choose_from_menu($course_file_options, "backup_course_files", $backup_course_files, "");
|
||||
echo "</td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<BR>
|
||||
<CENTER>
|
||||
<input type="hidden" name=id value="<? p($id) ?>">
|
||||
<input type="hidden" name=launch value="check">
|
||||
<input type="submit" value="<? print_string("continue") ?>">
|
||||
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
||||
</CENTER>
|
||||
</FORM>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?PHP //$Id$
|
||||
// This file defines the current version of the
|
||||
// backup/restore code that is being used. This can be
|
||||
// compared against the values stored in the
|
||||
// database (backup_version) to determine whether upgrades should
|
||||
// be performed (see db/backup_*.php)
|
||||
|
||||
$backup_version = 2003052000; // The current version is a date (YYYYMMDDXX)
|
||||
|
||||
$backup_release = "0.2.1 alpha"; // User-friendly version number
|
||||
@@ -0,0 +1,883 @@
|
||||
<?PHP //$Id$
|
||||
//This file contains all the function needed in the backup utility
|
||||
//except the mod-related funtions that are into every backuplib.php inside
|
||||
//every mod directory
|
||||
|
||||
//Insert necessary category ids to backup_ids table
|
||||
function insert_category_ids ($course,$backup_unique_code) {
|
||||
global $CFG;
|
||||
$status = true;
|
||||
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
|
||||
(backup_code, table_name, old_id)
|
||||
SELECT DISTINCT '$backup_unique_code','quiz_categories',t.category
|
||||
FROM {$CFG->prefix}quiz_questions t,
|
||||
{$CFG->prefix}quiz_question_grades g,
|
||||
{$CFG->prefix}quiz q
|
||||
WHERE q.course = '$course' AND
|
||||
g.quiz = q.id AND
|
||||
g.question = t.id",false);
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Delete category ids from backup_ids table
|
||||
function delete_category_ids ($backup_unique_code) {
|
||||
global $CFG;
|
||||
$status = true;
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
|
||||
WHERE backup_code = '$backup_unique_code'",false);
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Calculate the number of users to backup and put their ids in backup_ids
|
||||
//Return an array of info (name,value)
|
||||
function user_check_backup($course,$backup_unique_code,$backup_users) {
|
||||
//$backup_users=0-->all
|
||||
// 1-->course
|
||||
// 2-->needed-->NOT IMPLEMEMTED
|
||||
|
||||
global $CFG;
|
||||
global $db;
|
||||
|
||||
$count_users = 0;
|
||||
|
||||
//Select all users from user
|
||||
$users = get_records ("user");
|
||||
//Iterate over users putting their roles
|
||||
foreach ($users as $user) {
|
||||
$user->info = "";
|
||||
//Is Admin in tables (not is_admin()) !!
|
||||
if (record_exists("user_admins","userid",$user->id)) {
|
||||
$user->info .= "admin";
|
||||
$user->role_admin = true;
|
||||
}
|
||||
//Is Course Creator in tables (not is_coursecreator()) !!
|
||||
if (record_exists("user_coursecreators","userid",$user->id)) {
|
||||
$user->info .= "coursecreator";
|
||||
$user->role_coursecreator = true;
|
||||
}
|
||||
//Is Teacher in tables (not is_teacher()) !!
|
||||
if (record_exists("user_teachers","course",$course,"userid",$user->id)) {
|
||||
$user->info .= "teacher";
|
||||
$user->role_teacher = true;
|
||||
}
|
||||
//Is Student in tables (not is_student()) !!
|
||||
if (record_exists("user_students","course",$course,"userid",$user->id)) {
|
||||
$user->info .= "student";
|
||||
$user->role_student = true;
|
||||
}
|
||||
//Now create the backup_id record
|
||||
$backupids_rec->backup_code = $backup_unique_code;
|
||||
$backupids_rec->table_name = "user";
|
||||
$backupids_rec->old_id = $user->id;
|
||||
$backupids_rec->info = $user->info;
|
||||
|
||||
//Insert the record id. backup_users decide it.
|
||||
//When all users
|
||||
if ($backup_users == 0) {
|
||||
$status = insert_record("backup_ids",$backupids_rec,false);
|
||||
$count_users++;
|
||||
//When course users
|
||||
} else if ($backup_users == 1) {
|
||||
//Only if user has any role
|
||||
if ($backupids_rec->info) {
|
||||
$status = insert_record("backup_ids",$backupids_rec,false);
|
||||
$count_users++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Prepare Info
|
||||
//Gets the user data
|
||||
$info[0][0] = get_string("users");
|
||||
$info[0][1] = $count_users;
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
//Calculate the number of log entries to backup
|
||||
//Return an array of info (name,value)
|
||||
function log_check_backup($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
//Execute the insert
|
||||
$status = execute_sql($sql_insert,false);
|
||||
|
||||
//Now execute the select
|
||||
$ids = get_records_sql("SELECT DISTINCT l.id,l.course
|
||||
FROM {$CFG->prefix}log l
|
||||
WHERE l.course = '$course'");
|
||||
//Gets the user data
|
||||
$info[0][0] = get_string("logs");
|
||||
if ($ids) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
//Calculate the number of user files to backup
|
||||
//Under $CFG->dataroot/users
|
||||
//and put them (their path) in backup_ids
|
||||
//Return an array of info (name,value)
|
||||
function user_files_check_backup($course,$backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$rootdir = $CFG->dataroot."/users";
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$coursedirs = get_directory_list($rootdir);
|
||||
foreach ($coursedirs as $dir) {
|
||||
//Extracts user id from file path
|
||||
$tok = strtok($dir,"/");
|
||||
if ($tok) {
|
||||
$userid = $tok;
|
||||
} else {
|
||||
$tok = "";
|
||||
}
|
||||
//Insert them into backup_files
|
||||
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
|
||||
(backup_code, file_type, path, old_id)
|
||||
VALUES
|
||||
('$backup_unique_code','user','$dir','$userid')",false);
|
||||
}
|
||||
}
|
||||
|
||||
//Now execute the select
|
||||
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
|
||||
FROM {$CFG->prefix}backup_files b
|
||||
WHERE backup_code = '$backup_unique_code' AND
|
||||
file_type = 'user'");
|
||||
//Gets the user data
|
||||
$info[0][0] = get_string("files");
|
||||
if ($ids) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
//Calculate the number of course files to backup
|
||||
//under $CFG->dataroot/$course, except $CFG->moddata, and get_string("backupdir)
|
||||
//and put them (their path) in backup_ids
|
||||
//Return an array of info (name,value)
|
||||
function course_files_check_backup($course,$backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$rootdir = $CFG->dataroot."/$course";
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$coursedirs = get_directory_list($rootdir,$CFG->moddata);
|
||||
$backupdir = get_string("backupdir");
|
||||
foreach ($coursedirs as $dir) {
|
||||
//Check it isn't backupdir
|
||||
if (strpos($dir,$backupdir)!==0) {
|
||||
//Insert them into backup_files
|
||||
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
|
||||
(backup_code, file_type, path)
|
||||
VALUES
|
||||
('$backup_unique_code','course','$dir')",false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Now execute the select
|
||||
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
|
||||
FROM {$CFG->prefix}backup_files b
|
||||
WHERE backup_code = '$backup_unique_code' AND
|
||||
file_type = 'course'");
|
||||
//Gets the user data
|
||||
$info[0][0] = get_string("files");
|
||||
if ($ids) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
//Function to check and create the needed moddata dir to
|
||||
//save all the mod backup files. We always name it moddata
|
||||
//to be able to restore it, but in restore we check for
|
||||
//$CFG->moddata !!
|
||||
function check_and_create_moddata_dir($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/moddata",true);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to check and create the "user_files" dir to
|
||||
//save all the user files we need from "users" dir
|
||||
function check_and_create_user_files_dir($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/user_files",true);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to check and create the "course_files" dir to
|
||||
//save all the course files we need from "CFG->datadir/course" dir
|
||||
function check_and_create_course_files_dir($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/course_files",true);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to create, open and write header of the xml file
|
||||
function backup_open_xml($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Open for writing
|
||||
|
||||
$file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
|
||||
$backup_file = fopen($file,"w");
|
||||
//Writes the header
|
||||
$status = fwrite ($backup_file,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
if ($status) {
|
||||
$status = fwrite ($backup_file,start_tag("MOODLE_BACKUP",0,true));
|
||||
}
|
||||
if ($status) {
|
||||
return $backup_file;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Close the file
|
||||
function backup_close_xml($backup_file) {
|
||||
$status = fwrite ($backup_file,end_tag("MOODLE_BACKUP",0,true));
|
||||
return fclose($backup_file);
|
||||
}
|
||||
|
||||
//Return the xml start tag
|
||||
function start_tag($tag,$level=0,$endline=false) {
|
||||
if ($endline) {
|
||||
$endchar = "\n";
|
||||
} else {
|
||||
$endchar = "";
|
||||
}
|
||||
return str_repeat(" ",$level*2)."<".strtoupper($tag).">".$endchar;
|
||||
}
|
||||
|
||||
//Return the xml end tag
|
||||
function end_tag($tag,$level=0,$endline=true) {
|
||||
if ($endline) {
|
||||
$endchar = "\n";
|
||||
} else {
|
||||
$endchar = "";
|
||||
}
|
||||
return str_repeat(" ",$level*2)."</".strtoupper($tag).">".$endchar;
|
||||
}
|
||||
|
||||
//Return the start tag, the contents and the end tag
|
||||
function full_tag($tag,$level=0,$endline=true,$content,$to_utf=true) {
|
||||
$st = start_tag($tag,$level,$endline);
|
||||
$co="";
|
||||
if ($to_utf) {
|
||||
$co = utf8_encode(htmlspecialchars($content));
|
||||
} else {
|
||||
$co = htmlspecialchars($content);
|
||||
}
|
||||
$et = end_tag($tag,0,true);
|
||||
return $st.$co.$et;
|
||||
}
|
||||
|
||||
//Prints General info about the course
|
||||
//name, moodle_version (internal and release), backup_version, date, info in file...
|
||||
function backup_general_info ($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
fwrite ($bf,start_tag("INFO",1,true));
|
||||
|
||||
//The name of the backup
|
||||
fwrite ($bf,full_tag("NAME",2,false,$preferences->backup_name));
|
||||
//The moodle_version
|
||||
fwrite ($bf,full_tag("MOODLE_VERSION",2,false,$preferences->moodle_version));
|
||||
fwrite ($bf,full_tag("MOODLE_RELEASE",2,false,$preferences->moodle_release));
|
||||
//The backup_version
|
||||
fwrite ($bf,full_tag("BACKUP_VERSION",2,false,$preferences->backup_version));
|
||||
fwrite ($bf,full_tag("BACKUP_RELEASE",2,false,$preferences->backup_release));
|
||||
//The date
|
||||
fwrite ($bf,full_tag("DATE",2,false,$preferences->backup_unique_code));
|
||||
//Te includes tag
|
||||
fwrite ($bf,start_tag("DETAILS",2,true));
|
||||
//Now, go to mod element of preferences to print its status
|
||||
foreach ($preferences->mods as $element) {
|
||||
//Calculate info
|
||||
$included = "false";
|
||||
$userinfo = "false";
|
||||
if ($element->backup) {
|
||||
$included = "true";
|
||||
if ($element->userinfo) {
|
||||
$userinfo = "true";
|
||||
}
|
||||
}
|
||||
//Prints the mod start
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$element->name));
|
||||
fwrite ($bf,full_tag("INCLUDED",4,false,$included));
|
||||
fwrite ($bf,full_tag("USERINFO",4,false,$userinfo));
|
||||
|
||||
//Print the end
|
||||
fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
//The user in backup
|
||||
if ($preferences->backup_users == 1) {
|
||||
fwrite ($bf,full_tag("USERS",3,false,"course"));
|
||||
} else {
|
||||
fwrite ($bf,full_tag("USERS",3,false,"all"));
|
||||
}
|
||||
//The logs in backup
|
||||
if ($preferences->backup_logs == 1) {
|
||||
fwrite ($bf,full_tag("LOGS",3,false,"true"));
|
||||
} else {
|
||||
fwrite ($bf,full_tag("LOGS",3,false,"false"));
|
||||
}
|
||||
//The user files
|
||||
if ($preferences->backup_user_files == 1) {
|
||||
fwrite ($bf,full_tag("USERFILES",3,false,"true"));
|
||||
} else {
|
||||
fwrite ($bf,full_tag("USERFILES",3,false,"false"));
|
||||
}
|
||||
//The course files
|
||||
if ($preferences->backup_course_files == 1) {
|
||||
fwrite ($bf,full_tag("COURSEFILES",3,false,"true"));
|
||||
} else {
|
||||
fwrite ($bf,full_tag("COURSEFILES",3,false,"false"));
|
||||
}
|
||||
|
||||
fwrite ($bf,end_tag("DETAILS",2,true));
|
||||
|
||||
|
||||
$status = fwrite ($bf,end_tag("INFO",1,true));
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Prints course's general info (table course)
|
||||
function backup_course_start ($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Course open tag
|
||||
fwrite ($bf,start_tag("COURSE",1,true));
|
||||
//Header open tag
|
||||
fwrite ($bf,start_tag("HEADER",2,true));
|
||||
|
||||
//Get info from course
|
||||
$course=false;
|
||||
if ($courses = get_records("course","id",$preferences->backup_course)) {
|
||||
$course = $courses[$preferences->backup_course];
|
||||
}
|
||||
if ($course) {
|
||||
//Prints course info
|
||||
fwrite ($bf,full_tag("ID",3,false,$course->id));
|
||||
//Obtain the category
|
||||
$category = false;
|
||||
if ($categories = get_records("course_categories","id","$course->category")) {
|
||||
$category = $categories[$course->category];
|
||||
}
|
||||
if ($category) {
|
||||
//Prints category info
|
||||
fwrite ($bf,start_tag("CATEGORY",3,true));
|
||||
fwrite ($bf,full_tag("ID",4,false,$course->category));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$category->name));
|
||||
fwrite ($bf,end_tag("CATEGORY",3,true));
|
||||
}
|
||||
//Continues with the course
|
||||
fwrite ($bf,full_tag("PASSWORD",3,false,$course->password));
|
||||
fwrite ($bf,full_tag("FULLNAME",3,false,$course->fullname));
|
||||
fwrite ($bf,full_tag("SHORTNAME",3,false,$course->shortname));
|
||||
fwrite ($bf,full_tag("SUMMARY",3,false,$course->summary));
|
||||
fwrite ($bf,full_tag("FORMAT",3,false,$course->format));
|
||||
fwrite ($bf,full_tag("NEWSITEMS",3,false,$course->newsitems));
|
||||
fwrite ($bf,full_tag("TEACHER",3,false,$course->teacher));
|
||||
fwrite ($bf,full_tag("TEACHERS",3,false,$course->teachers));
|
||||
fwrite ($bf,full_tag("STUDENT",3,false,$course->student));
|
||||
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
|
||||
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
|
||||
fwrite ($bf,full_tag("STARDATE",3,false,$course->stardate));
|
||||
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
|
||||
fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent));
|
||||
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
|
||||
fwrite ($bf,full_tag("TIMECREATED",3,false,$course->timecreated));
|
||||
$status = fwrite ($bf,full_tag("TIMEMODIFIED",3,false,$course->timemodified));
|
||||
//Print header end
|
||||
fwrite ($bf,end_tag("HEADER",2,true));
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Prints course's end tag
|
||||
function backup_course_end ($bf,$preferences) {
|
||||
|
||||
//Course end tag
|
||||
$status = fwrite ($bf,end_tag("COURSE",1,true));
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//Prints course's sections info (table course_sections)
|
||||
function backup_course_sections ($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
|
||||
//Get info from sections
|
||||
$section=false;
|
||||
if ($sections = get_records("course_sections","course",$preferences->backup_course,"section")) {
|
||||
//Section open tag
|
||||
fwrite ($bf,start_tag("SECTIONS",2,true));
|
||||
//Iterate over every section (ordered by section)
|
||||
foreach ($sections as $section) {
|
||||
//Begin Section
|
||||
fwrite ($bf,start_tag("SECTION",3,true));
|
||||
fwrite ($bf,full_tag("ID",4,false,$section->id));
|
||||
fwrite ($bf,full_tag("NUMBER",4,false,$section->section));
|
||||
fwrite ($bf,full_tag("SUMMARY",4,false,$section->summary));
|
||||
fwrite ($bf,full_tag("VISIBLE",4,false,$section->visible));
|
||||
//Now print the mods in section
|
||||
backup_course_modules ($bf,$preferences,$section);
|
||||
//End section
|
||||
fwrite ($bf,end_tag("SECTION",3,true));
|
||||
}
|
||||
//Section close tag
|
||||
$status = fwrite ($bf,end_tag("SECTIONS",2,true));
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//Prints course's modules info (table course_modules)
|
||||
//Only for selected mods in preferences
|
||||
function backup_course_modules ($bf,$preferences,$section) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$first_record = true;
|
||||
|
||||
//Now print the mods in section
|
||||
//Extracts mod id from sequence
|
||||
$tok = strtok($section->sequence,",");
|
||||
while ($tok) {
|
||||
//Get module's type
|
||||
$moduletype = get_module_type ($preferences->backup_course,$tok);
|
||||
//Check if we've selected to backup that type
|
||||
if ($moduletype and $preferences->mods[$moduletype]->backup) {
|
||||
$selected = true;
|
||||
} else {
|
||||
$selected = false;
|
||||
}
|
||||
|
||||
if ($selected) {
|
||||
//Gets course_module data from db
|
||||
$course_module = get_records ("course_modules","id",$tok);
|
||||
//If it's the first, pring MODS tag
|
||||
if ($first_record) {
|
||||
fwrite ($bf,start_tag("MODS",4,true));
|
||||
$first_record = false;
|
||||
}
|
||||
//Print mod info from course_modules
|
||||
fwrite ($bf,start_tag("MOD",5,true));
|
||||
//Save neccesary info to backup_ids
|
||||
fwrite ($bf,full_tag("ID",6,false,$tok));
|
||||
fwrite ($bf,full_tag("TYPE",6,false,$moduletype));
|
||||
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module[$tok]->instance));
|
||||
fwrite ($bf,full_tag("ADDED",6,false,$course_module[$tok]->added));
|
||||
fwrite ($bf,full_tag("DELETED",6,false,$course_module[$tok]->deleted));
|
||||
fwrite ($bf,full_tag("SCORE",6,false,$course_module[$tok]->score));
|
||||
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
|
||||
fwrite ($bf,end_tag("MOD",5,true));
|
||||
}
|
||||
//check for next
|
||||
$tok = strtok(",");
|
||||
}
|
||||
|
||||
//Si ha habido modulos, final de MODS
|
||||
if (!$first_record) {
|
||||
$status =fwrite ($bf,end_tag("MODS",4,true));
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Print users to xml
|
||||
//Only users previously calculated in backup_ids will output
|
||||
//
|
||||
function backup_user_info ($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$users = get_records_sql("SELECT u.old_id, u.table_name,u.info
|
||||
FROM {$CFG->prefix}backup_ids u
|
||||
WHERE u.backup_code = '$preferences->backup_unique_code' AND
|
||||
u.table_name = 'user'");
|
||||
|
||||
//If we have users to backup
|
||||
if ($users) {
|
||||
//Begin Users tag
|
||||
fwrite ($bf,start_tag("USERS",2,true));
|
||||
//With every user
|
||||
foreach ($users as $user) {
|
||||
//Get user data from table
|
||||
$user_data = get_record("user","id",$user->old_id);
|
||||
//Begin User tag
|
||||
fwrite ($bf,start_tag("USER",3,true));
|
||||
//Output all user data
|
||||
fwrite ($bf,full_tag("ID",4,false,$user_data->id));
|
||||
fwrite ($bf,full_tag("CONFIRMED",4,false,$user_data->confirmed));
|
||||
fwrite ($bf,full_tag("DELETED",4,false,$user_data->deleted));
|
||||
fwrite ($bf,full_tag("USERNAME",4,false,$user_data->username));
|
||||
fwrite ($bf,full_tag("PASSWORD",4,false,$user_data->password));
|
||||
fwrite ($bf,full_tag("IDNUMBER",4,false,$user_data->idnumber));
|
||||
fwrite ($bf,full_tag("FIRSTNAME",4,false,$user_data->firstname));
|
||||
fwrite ($bf,full_tag("LASTNAME",4,false,$user_data->lastname));
|
||||
fwrite ($bf,full_tag("EMAIL",4,false,$user_data->email));
|
||||
fwrite ($bf,full_tag("ICQ",4,false,$user_data->icq));
|
||||
fwrite ($bf,full_tag("PHONE1",4,false,$user_data->phone1));
|
||||
fwrite ($bf,full_tag("PHONE2",4,false,$user_data->phone2));
|
||||
fwrite ($bf,full_tag("INSTITUTION",4,false,$user_data->institution));
|
||||
fwrite ($bf,full_tag("DEPARTMENT",4,false,$user_data->department));
|
||||
fwrite ($bf,full_tag("ADDRESS",4,false,$user_data->address));
|
||||
fwrite ($bf,full_tag("CITY",4,false,$user_data->city));
|
||||
fwrite ($bf,full_tag("COUNTRY",4,false,$user_data->country));
|
||||
fwrite ($bf,full_tag("LANG",4,false,$user_data->lang));
|
||||
fwrite ($bf,full_tag("TIMEZONE",4,false,$user_data->timezone));
|
||||
fwrite ($bf,full_tag("FIRSTACCESS",4,false,$user_data->firstaccess));
|
||||
fwrite ($bf,full_tag("LASTACCESS",4,false,$user_data->lastaccess));
|
||||
fwrite ($bf,full_tag("LASTLOGIN",4,false,$user_data->lastlogin));
|
||||
fwrite ($bf,full_tag("CURRENTLOGIN",4,false,$user_data->currentlogin));
|
||||
fwrite ($bf,full_tag("LASTIP",4,false,$user_data->lastIP));
|
||||
fwrite ($bf,full_tag("SECRET",4,false,$user_data->secret));
|
||||
fwrite ($bf,full_tag("PICTURE",4,false,$user_data->picture));
|
||||
fwrite ($bf,full_tag("URL",4,false,$user_data->url));
|
||||
fwrite ($bf,full_tag("DESCRIPTION",4,false,$user_data->description));
|
||||
fwrite ($bf,full_tag("MAILFORMAT",4,false,$user_data->mailformat));
|
||||
fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
|
||||
fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
|
||||
fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user_data->timemodified));
|
||||
|
||||
//Output every user role (with its associated info)
|
||||
$user->isadmin = strpos($user->info,"admin");
|
||||
$user->iscoursecreator = strpos($user->info,"coursecreator");
|
||||
$user->isteacher = strpos($user->info,"teacher");
|
||||
$user->isstudent = strpos($user->info,"student");
|
||||
if ($user->isadmin!==false or
|
||||
$user->iscoursecreator!==false or
|
||||
$user->isteacher!==false or
|
||||
$user->isstudent!==false) {
|
||||
//Begin ROLES tag
|
||||
fwrite ($bf,start_tag("ROLES",4,true));
|
||||
//PRINT ROLE INFO
|
||||
//Admins
|
||||
if ($user->isadmin!==false) {
|
||||
//Print ROLE start
|
||||
fwrite ($bf,start_tag("ROLE",5,true));
|
||||
//Print Role info
|
||||
fwrite ($bf,full_tag("TYPE",6,false,"admin"));
|
||||
//Print ROLE end
|
||||
fwrite ($bf,end_tag("ROLE",5,true));
|
||||
}
|
||||
//CourseCreator
|
||||
if ($user->iscoursecreator!==false) {
|
||||
//Print ROLE start
|
||||
fwrite ($bf,start_tag("ROLE",5,true));
|
||||
//Print Role info
|
||||
fwrite ($bf,full_tag("TYPE",6,false,"coursecreator"));
|
||||
//Print ROLE end
|
||||
fwrite ($bf,end_tag("ROLE",5,true));
|
||||
}
|
||||
//Teacher
|
||||
if ($user->isteacher!==false) {
|
||||
//Print ROLE start
|
||||
fwrite ($bf,start_tag("ROLE",5,true));
|
||||
//Print Role info
|
||||
fwrite ($bf,full_tag("TYPE",6,false,"teacher"));
|
||||
//Get specific info for teachers
|
||||
$tea = get_record("user_teachers","userid",$user->old_id,"course",$preferences->backup_course);
|
||||
fwrite ($bf,full_tag("AUTHORITY",6,false,$tea->authority));
|
||||
fwrite ($bf,full_tag("TEA_ROLE",6,false,$tea->role));
|
||||
//Print ROLE end
|
||||
fwrite ($bf,end_tag("ROLE",5,true));
|
||||
}
|
||||
//Student
|
||||
if ($user->isstudent!==false) {
|
||||
//Print ROLE start
|
||||
fwrite ($bf,start_tag("ROLE",5,true));
|
||||
//Print Role info
|
||||
fwrite ($bf,full_tag("TYPE",6,false,"student"));
|
||||
//Get specific info for students
|
||||
$stu = get_record("user_students","userid",$user->old_id,"course",$preferences->backup_course);
|
||||
fwrite ($bf,full_tag("TIMESTART",6,false,$stu->timestart));
|
||||
fwrite ($bf,full_tag("TIMEEND",6,false,$stu->timeend));
|
||||
fwrite ($bf,full_tag("TIME",6,false,$stu->time));
|
||||
//Print ROLE end
|
||||
fwrite ($bf,end_tag("ROLE",5,true));
|
||||
}
|
||||
|
||||
|
||||
//End ROLES tag
|
||||
fwrite ($bf,end_tag("ROLES",4,true));
|
||||
}
|
||||
//End User tag
|
||||
fwrite ($bf,end_tag("USER",3,true));
|
||||
}
|
||||
//End Users tag
|
||||
fwrite ($bf,end_tag("USERS",2,true));
|
||||
} else {
|
||||
//There isn't users. Impossible !!
|
||||
$status = false;
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup log info (time ordered)
|
||||
function backup_log_info($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$logs = get_records ("log","course",$preferences->backup_course,"time");
|
||||
|
||||
//We have logs
|
||||
if ($logs) {
|
||||
//Pring logs header
|
||||
fwrite ($bf,start_tag("LOGS",2,true));
|
||||
//Iterate
|
||||
foreach ($logs as $log) {
|
||||
//See if it is a valid module to backup
|
||||
if ($log->module == "course" or
|
||||
$log->module == "user" or
|
||||
$preferences->mods[$log->module]->backup == 1) {
|
||||
//Begin log tag
|
||||
fwrite ($bf,start_tag("LOG",3,true));
|
||||
|
||||
//Output log tag
|
||||
fwrite ($bf,full_tag("ID",4,false,$log->id));
|
||||
fwrite ($bf,full_tag("TIME",4,false,$log->time));
|
||||
fwrite ($bf,full_tag("USERID",4,false,$log->userid));
|
||||
fwrite ($bf,full_tag("IP",4,false,$log->ip));
|
||||
fwrite ($bf,full_tag("MODULE",4,false,$log->module));
|
||||
fwrite ($bf,full_tag("ACTION",4,false,$log->action));
|
||||
fwrite ($bf,full_tag("URL",4,false,$log->url));
|
||||
fwrite ($bf,full_tag("INFO",4,false,$log->info));
|
||||
|
||||
//End log tag
|
||||
fwrite ($bf,end_tag("LOG",3,true));
|
||||
}
|
||||
}
|
||||
//End logs tag
|
||||
$status = fwrite ($bf,end_tag("LOGS",2,true));
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Start the modules tag
|
||||
function backup_modules_start ($bf,$preferences) {
|
||||
|
||||
return fwrite ($bf,start_tag("MODULES",2,true));
|
||||
}
|
||||
|
||||
//End the modules tag
|
||||
function backup_modules_end ($bf,$preferences) {
|
||||
|
||||
return fwrite ($bf,end_tag("MODULES",2,true));
|
||||
}
|
||||
|
||||
//This function makes all the necesary calls to every mod
|
||||
//to export itself and its files !!!
|
||||
function backup_module($bf,$preferences,$module) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//First, re-check if necessary functions exists
|
||||
$modbackup = $module."_backup_mods";
|
||||
if (function_exists($modbackup)) {
|
||||
//Call the function
|
||||
$status = $modbackup($bf,$preferences);
|
||||
} else {
|
||||
//Something was wrong. Function should exist.
|
||||
$status = false;
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//This function copies all the needed files under the "users" directory to the "user_files"
|
||||
//directory under temp/backup
|
||||
function backup_copy_user_files ($preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//First we check to "user_files" exists and create it as necessary
|
||||
//in temp/backup/$backup_code dir
|
||||
$status = check_and_create_user_files_dir($preferences->backup_unique_code);
|
||||
|
||||
//Now iterate over directories under "users" to check if that user must be
|
||||
//copied to backup
|
||||
|
||||
$rootdir = $CFG->dataroot."/users";
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$list = list_directories ($rootdir);
|
||||
if ($list) {
|
||||
//Iterate
|
||||
foreach ($list as $dir) {
|
||||
//Look for dir like username in backup_ids
|
||||
$data = get_record ("backup_ids","backup_code",$preferences->backup_unique_code,
|
||||
"table_name","user",
|
||||
"old_id",$dir);
|
||||
//If exists, copy it
|
||||
if ($data) {
|
||||
$status = backup_copy_file($rootdir."/".$dir,
|
||||
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/user_files/".$dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//This function copies all the course files under the course directory (except the moddata
|
||||
//directory to the "course_files" directory under temp/backup
|
||||
function backup_copy_course_files ($preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//First we check to "course_files" exists and create it as necessary
|
||||
//in temp/backup/$backup_code dir
|
||||
$status = check_and_create_course_files_dir($preferences->backup_unique_code);
|
||||
|
||||
//Now iterate over files and directories except $CFG->moddata and get_string("backupdir") to be
|
||||
//copied to backup
|
||||
|
||||
$rootdir = $CFG->dataroot."/".$preferences->backup_course;
|
||||
|
||||
$name_moddata = $CFG->moddata;
|
||||
$name_backupdata = get_string("backupdir");
|
||||
//Check if directory exists
|
||||
if (is_dir($rootdir)) {
|
||||
$list = list_directories_and_files ($rootdir);
|
||||
if ($list) {
|
||||
//Iterate
|
||||
foreach ($list as $dir) {
|
||||
if ($dir !== $name_moddata and $dir !== $name_backupdata) {
|
||||
$status = backup_copy_file($rootdir."/".$dir,
|
||||
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/course_files/".$dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//This function creates the zip file containing all the backup info
|
||||
//moodle.xml, moddata, user_files, course_files.
|
||||
//The zipped file is created in the backup directory and named with
|
||||
//the "oficial" name of the backup
|
||||
//It uses "pclzip" if available or system "zip" (unix only)
|
||||
function backup_zip ($preferences,$moodle_home) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Base dir where everything happens
|
||||
$basedir = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
|
||||
//Backup zip file name
|
||||
$name = $preferences->backup_name;
|
||||
//List base_dir files and directories
|
||||
$filelist = list_directories_and_files ($basedir);
|
||||
|
||||
if (empty($CFG->zip)) { // Use built-in php-based zip function
|
||||
$files = array();
|
||||
foreach ($filelist as $file) {
|
||||
//If directory, append "/"
|
||||
if (is_dir($basedir."/".$file)) {
|
||||
$file = $file."/";
|
||||
}
|
||||
//Include into array
|
||||
$files[] = $basedir."/".$file;
|
||||
}
|
||||
include_once($moodle_home."/lib/pclzip/pclzip.lib.php");
|
||||
$archive = new PclZip("$basedir/$name");
|
||||
if (($list = $archive->create($files,PCLZIP_OPT_REMOVE_PATH,$basedir)) == 0) {
|
||||
error($archive->errorInfo(true));
|
||||
$status = false;
|
||||
}
|
||||
} else { // Use external zip program
|
||||
$files = "";
|
||||
foreach ($filelist as $file) {
|
||||
$files .= basename($file);
|
||||
$files .= " ";
|
||||
}
|
||||
$command = "cd $basedir ; $CFG->zip -r $name $files";
|
||||
$status = Exec($command);
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//This function copies the final zip to the course dir
|
||||
function copy_zip_to_course_dir ($preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
//Backup zip file name
|
||||
$from_zip_file = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/".$preferences->backup_name;
|
||||
$to_zip_file = $CFG->dataroot."/".$preferences->backup_course."/".get_string("backupdir")."/".$preferences->backup_name;
|
||||
|
||||
//Check to directory
|
||||
$status = check_dir_exists(dirname($to_zip_file),true);
|
||||
|
||||
//Copy zip file
|
||||
if ($status) {
|
||||
$status = backup_copy_file ($from_zip_file,$to_zip_file);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?PHP //$Id$
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// backup/restore utility.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
function backup_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$result = true;
|
||||
|
||||
if ($oldversion < 2003050300 and $result) {
|
||||
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
|
||||
`backup_code` INT(12) UNSIGNED NOT NULL,
|
||||
`table_name` VARCHAR(30) NOT NULL,
|
||||
`old_id` INT(10) UNSIGNED NOT NULL,
|
||||
`new_id` INT(10) UNSIGNED,
|
||||
PRIMARY KEY (`backup_code`, `table_name`, `old_id`)
|
||||
)
|
||||
COMMENT = 'To store and convert ids in backup/restore'");
|
||||
}
|
||||
|
||||
if ($oldversion < 2003050301 and $result) {
|
||||
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
|
||||
ADD `info` VARCHAR(30)");
|
||||
}
|
||||
|
||||
if ($oldversion < 2003050400 and $result) {
|
||||
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
|
||||
MODIFY `info` VARCHAR(255)");
|
||||
}
|
||||
|
||||
if ($oldversion < 2003050401 and $result) {
|
||||
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_files` (
|
||||
`backup_code` INT( 10 ) UNSIGNED NOT NULL ,
|
||||
`file_type` VARCHAR( 10 ) NOT NULL ,
|
||||
`path` VARCHAR( 255 ) NOT NULL ,
|
||||
`old_id` INT( 10 ) UNSIGNED,
|
||||
`new_id` INT( 10 ) UNSIGNED,
|
||||
PRIMARY KEY ( `backup_code` , `file_type` , `path` )
|
||||
) COMMENT = 'To store and recode ids to user & course files.'");
|
||||
}
|
||||
|
||||
if ($oldversion < 2003052000 and $result) {
|
||||
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
|
||||
MODIFY `info` TEXT");
|
||||
}
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
+351
@@ -0,0 +1,351 @@
|
||||
<?PHP //$Id$
|
||||
//This file contains all the general function needed (file manipulation...)
|
||||
//not directly part of the backup/restore utility
|
||||
|
||||
//Delete old data in backup tables (if exists)
|
||||
//Two days seems to be apropiate
|
||||
function backup_delete_old_data() {
|
||||
|
||||
global $CFG;
|
||||
|
||||
//Change this if you want !!
|
||||
$days = 2;
|
||||
//End change this
|
||||
$seconds = $days * 24 * 60 * 60;
|
||||
$delete_from = time()-$seconds;
|
||||
//Now delete from tables
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
|
||||
WHERE backup_code < '$delete_from'",false);
|
||||
if ($status) {
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
|
||||
WHERE backup_code < '$delete_from'",false);
|
||||
}
|
||||
//Now, delete old directory (if exists)
|
||||
if ($status) {
|
||||
$status = backup_delete_old_dirs($delete_from);
|
||||
}
|
||||
return($status);
|
||||
}
|
||||
|
||||
//Function to delete dirs/files into temp/backup directory
|
||||
//older than $delete_from
|
||||
function backup_delete_old_dirs($delete_from) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
$list = get_directory_list($CFG->dataroot."/temp/backup", "", false);
|
||||
foreach ($list as $file) {
|
||||
$file_path = $CFG->dataroot."/temp/backup/".$file;
|
||||
$moddate = filemtime($file_path);
|
||||
if ($status and $moddate < $delete_from) {
|
||||
//If directory, recurse
|
||||
if (is_dir($file_path)) {
|
||||
$status = delete_dir_contents($file_path);
|
||||
//There is nothing, delete the directory itself
|
||||
if ($status) {
|
||||
$status = rmdir($file_path);
|
||||
}
|
||||
//If file
|
||||
} else {
|
||||
unlink("$file_path");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to check if a directory exists
|
||||
//and, optionally, create it
|
||||
function check_dir_exists($dir,$create=false) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
if(!is_dir($dir)) {
|
||||
if (!$create) {
|
||||
$status = false;
|
||||
} else {
|
||||
umask(0000);
|
||||
$status = mkdir ($dir,$CFG->directorypermissions);
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to check and create the needed dir to
|
||||
//save all the backup
|
||||
function check_and_create_backup_dir($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = check_dir_exists($CFG->dataroot."/temp",true);
|
||||
if ($status) {
|
||||
$status = check_dir_exists($CFG->dataroot."/temp/backup",true);
|
||||
}
|
||||
if ($status) {
|
||||
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code,true);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Function to delete all the directory contents recursively
|
||||
//Copied from admin/delete.php
|
||||
function delete_dir_contents ($rootdir) {
|
||||
|
||||
$dir = opendir($rootdir);
|
||||
|
||||
$status = true;
|
||||
|
||||
while ($file = readdir($dir)) {
|
||||
if ($file != "." and $file != "..") {
|
||||
$fullfile = "$rootdir/$file";
|
||||
if (filetype($fullfile) == "dir") {
|
||||
delete_dir_contents($fullfile);
|
||||
if (!rmdir($fullfile)) {
|
||||
$status = false;
|
||||
}
|
||||
} else {
|
||||
if (!unlink("$fullfile")) {
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//Function to clear (empty) the contents of the backup_dir
|
||||
//Copied from admin/delete.php
|
||||
function clear_backup_dir($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$rootdir = $CFG->dataroot."/temp/backup/".$backup_unique_code;
|
||||
|
||||
//Delete recursively
|
||||
$status = delete_dir_contents($rootdir);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Returns the module type of a course_module's id in a course
|
||||
function get_module_type ($courseid,$moduleid) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$results = get_records_sql ("SELECT cm.id, m.name
|
||||
FROM {$CFG->prefix}course_modules cm,
|
||||
{$CFG->prefix}modules m
|
||||
WHERE cm.course = '$courseid' AND
|
||||
cm.id = '$moduleid' AND
|
||||
m.id = cm.module");
|
||||
|
||||
if ($results) {
|
||||
$name = $results[$moduleid]->name;
|
||||
} else {
|
||||
$name = false;
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
//This function return the names of all directories under a give directory
|
||||
//Not recursive
|
||||
function list_directories ($rootdir) {
|
||||
|
||||
$dir = opendir($rootdir);
|
||||
while ($file=readdir($dir)) {
|
||||
if ($file=="." || $file=="..") {
|
||||
continue;
|
||||
}
|
||||
if (is_dir($rootdir."/".$file)) {
|
||||
$results[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
return $results;
|
||||
}
|
||||
|
||||
//This function return the names of all directories and files under a give directory
|
||||
//Not recursive
|
||||
function list_directories_and_files ($rootdir) {
|
||||
|
||||
$dir = opendir($rootdir);
|
||||
while ($file=readdir($dir)) {
|
||||
if ($file=="." || $file=="..") {
|
||||
continue;
|
||||
}
|
||||
$results[$file] = $file;
|
||||
}
|
||||
closedir($dir);
|
||||
return $results;
|
||||
}
|
||||
|
||||
//This function clean data from backup tables and
|
||||
//delete all temp files used
|
||||
function clean_temp_data ($preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//true->do it, false->don't do it. To debug if necessary.
|
||||
if (true) {
|
||||
//Now delete from tables
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
|
||||
WHERE backup_code = '$preferences->backup_unique_code'",false);
|
||||
if ($status) {
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
|
||||
WHERE backup_code = '$preferences->backup_unique_code'",false);
|
||||
}
|
||||
//Now, delete temp directory (if exists)
|
||||
$file_path = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
|
||||
if (is_dir($file_path)) {
|
||||
$status = delete_dir_contents($file_path);
|
||||
//There is nothing, delete the directory itself
|
||||
if ($status) {
|
||||
$status = rmdir($file_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//This functions are used to copy any file or directory ($from_file)
|
||||
//to a new file or directory ($to_file). It works recursively and
|
||||
//mantains file perms.
|
||||
//I've copied it from: http://www.php.net/manual/en/function.copy.php
|
||||
//Little modifications done
|
||||
|
||||
function backup_copy_file ($from_file,$to_file) {
|
||||
if (is_file($from_file)) {
|
||||
$perms=fileperms($from_file);
|
||||
return copy($from_file,$to_file) && chmod($to_file,$perms);
|
||||
}
|
||||
else if (is_dir($from_file)) {
|
||||
return backup_copy_dir($from_file,$to_file);
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function backup_copy_dir($from_file,$to_file) {
|
||||
if (!is_dir($to_file)) {
|
||||
mkdir($to_file);
|
||||
chmod("$to_file",0777);
|
||||
}
|
||||
$dir = opendir($from_file);
|
||||
while ($file=readdir($dir)) {
|
||||
if ($file=="." || $file=="..") {
|
||||
continue;
|
||||
}
|
||||
$status = backup_copy_file ("$from_file/$file","$to_file/$file");
|
||||
}
|
||||
closedir($dir);
|
||||
return $status;
|
||||
}
|
||||
///Ends copy file/dirs functions
|
||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
//This function upgrades, if necesary, the backup-restore tables
|
||||
//It's called from backup.php and restore.php
|
||||
function upgrade_backup_db($updgradeto,$backup_release,$continueto) {
|
||||
|
||||
global $CFG,$db;
|
||||
|
||||
//Check backup_version
|
||||
if ($CFG->backup_version) {
|
||||
if ($updgradeto > $CFG->backup_version) { // upgrade
|
||||
$a->oldversion = $CFG->backup_version;
|
||||
$a->newversion = $updgradeto;
|
||||
$strdatabasechecking = get_string("databasechecking", "", $a);
|
||||
$strdatabasesuccess = get_string("databasesuccess");
|
||||
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
|
||||
print_heading($strdatabasechecking);
|
||||
$db->debug=true;
|
||||
if (backup_upgrade($a->oldversion)) {
|
||||
$db->debug=false;
|
||||
if (set_config("backup_version", $a->newversion)) {
|
||||
notify($strdatabasesuccess, "green");
|
||||
notify("You are running Backup/Recovery version ".$backup_release,"black");
|
||||
print_continue($continueto);
|
||||
die;
|
||||
} else {
|
||||
notify("Upgrade failed! (Could not update version in config table)");
|
||||
die;
|
||||
}
|
||||
} else {
|
||||
$db->debug=false;
|
||||
notify("Upgrade failed! See backup_version.php");
|
||||
die;
|
||||
}
|
||||
} else if ($updgradeto < $CFG->backup_version) {
|
||||
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
|
||||
}
|
||||
//Not exists. Starting installation
|
||||
} else {
|
||||
$strdatabaseupgrades = get_string("databaseupgrades");
|
||||
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
|
||||
|
||||
if (set_config("backup_version", "2003010100")) {
|
||||
print_heading("You are currently going to install the needed structures to Backup/Recover");
|
||||
print_continue($continue_to);
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//This function is used to insert records in the backup_ids table
|
||||
function backup_putid ($backup_unique_code, $table, $old_id, $new_id, $info="") {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//First delete to avoid PK duplicates
|
||||
$status = backup_delid($backup_unique_code, $table, $old_id);
|
||||
|
||||
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
|
||||
(backup_code, table_name, old_id, new_id, info)
|
||||
VALUES
|
||||
($backup_unique_code, '$table', '$old_id', '$new_id', '$info')",false);
|
||||
return $status;
|
||||
}
|
||||
|
||||
//This function is used to delete recods from the backup_ids table
|
||||
function backup_delid ($backup_unique_code, $table, $old_id) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
|
||||
WHERE backup_code = $backup_unique_code AND
|
||||
table_name = '$table' AND
|
||||
old_id = '$old_id'",false);
|
||||
return $status;
|
||||
}
|
||||
|
||||
//This function is used to get a record from the backup_ids table
|
||||
function backup_getid ($backup_unique_code, $table, $old_id) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$status = get_record ("backup_ids","backup_code",$backup_unique_code,
|
||||
"table_name",$table,
|
||||
"old_id", $old_id);
|
||||
|
||||
return $status;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,171 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//assignment mods
|
||||
|
||||
//This is the "graphical" structure of the assignment mod:
|
||||
//
|
||||
// assignment
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// assignment_submisions
|
||||
// (UL,pk->id, fk->assignment,files)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
//This function executes all the backup procedure about this mod
|
||||
function assignment_backup_mods($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Iterate over assignment table
|
||||
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
|
||||
if ($assignments) {
|
||||
foreach ($assignments as $assignment) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print assignment data
|
||||
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
|
||||
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
|
||||
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
|
||||
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
|
||||
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
|
||||
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
|
||||
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
|
||||
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
|
||||
//if we've selected to backup users info, then execute backup_assignment_submisions
|
||||
if ($preferences->mods["assignment"]->userinfo) {
|
||||
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
|
||||
}
|
||||
//End mod
|
||||
$status =fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
//if we've selected to backup users info, then backup files too
|
||||
if ($preferences->mods["assignment"]->userinfo) {
|
||||
$status = backup_assignment_files($bf,$preferences);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup assignment_submissions contents (executed from assignment_backup_mods)
|
||||
function backup_assignment_submissions ($bf,$preferences,$assignment) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$assignment_submissions = get_records("assignment_submissions","assignment",$assignment,"id");
|
||||
//If there is submissions
|
||||
if ($assignment_submissions) {
|
||||
//Write start tag
|
||||
$status =fwrite ($bf,start_tag("SUBMISSIONS",4,true));
|
||||
//Iterate over each submission
|
||||
foreach ($assignment_submissions as $ass_sub) {
|
||||
//Start submission
|
||||
$status =fwrite ($bf,start_tag("SUBMISSION",5,true));
|
||||
//Print submission contents
|
||||
fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
|
||||
fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
|
||||
fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
|
||||
fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
|
||||
fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
|
||||
fwrite ($bf,full_tag("COMMENT",6,false,$ass_sub->comment));
|
||||
fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
|
||||
fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
|
||||
fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));
|
||||
//End submission
|
||||
$status =fwrite ($bf,end_tag("SUBMISSION",5,true));
|
||||
}
|
||||
//Write end tag
|
||||
$status =fwrite ($bf,end_tag("SUBMISSIONS",4,true));
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup assignment files because we've selected to backup user info
|
||||
//and files are user info's level
|
||||
function backup_assignment_files($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//First we check to moddata exists and create it as necessary
|
||||
//in temp/backup/$backup_code dir
|
||||
$status = check_and_create_moddata_dir($preferences->backup_unique_code);
|
||||
//Now copy the assignment dir
|
||||
if ($status) {
|
||||
$status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment",
|
||||
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/assignment");
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//Return an array of info (name,value)
|
||||
function assignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","assignment");
|
||||
if ($ids = assignment_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
$info[1][0] = get_string("submissions","assignment");
|
||||
if ($ids = assignment_submission_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of assignments id
|
||||
function assignment_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}assignment a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of assignment_submissions id
|
||||
function assignment_submission_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.assignment
|
||||
FROM {$CFG->prefix}assignment_submissions s,
|
||||
{$CFG->prefix}assignment a
|
||||
WHERE a.course = '$course' AND
|
||||
s.assignment = a.id");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//assignment mods
|
||||
|
||||
//This is the "graphical" structure of the assignment mod:
|
||||
//
|
||||
// assignment
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// assignment_submisions
|
||||
// (UL,pk->id, fk->assignment,files)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
//This function executes all the backup procedure about this mod
|
||||
function assignment_restore_mods($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Iterate over assignment table
|
||||
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
|
||||
if ($assignments) {
|
||||
foreach ($assignments as $assignment) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print assignment data
|
||||
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
|
||||
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
|
||||
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
|
||||
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
|
||||
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
|
||||
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
|
||||
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
|
||||
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
|
||||
//if we've selected to backup users info, then execute backup_assignment_submisions
|
||||
if ($preferences->mods["assignment"]->userinfo) {
|
||||
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
|
||||
}
|
||||
//End mod
|
||||
$status =fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
//if we've selected to backup users info, then backup files too
|
||||
if ($preferences->mods["assignment"]->userinfo) {
|
||||
$status = backup_assignment_files($bf,$preferences);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,141 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//choice mods
|
||||
|
||||
//This is the "graphical" structure of the choice mod:
|
||||
//
|
||||
// choice
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// choice_answers
|
||||
// (UL,pk->id, fk->choice)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function choice_backup_mods($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Iterate over choice table
|
||||
$choices = get_records ("choice","course",$preferences->backup_course,"id");
|
||||
if ($choices) {
|
||||
foreach ($choices as $choice) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print choice data
|
||||
fwrite ($bf,full_tag("ID",4,false,$choice->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
|
||||
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
|
||||
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
|
||||
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
|
||||
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
|
||||
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
|
||||
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
|
||||
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
|
||||
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
|
||||
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
|
||||
//if we've selected to backup users info, then execute backup_choice_answers
|
||||
if ($preferences->mods["choice"]->userinfo) {
|
||||
$status = backup_choice_answers($bf,$preferences,$choice->id);
|
||||
}
|
||||
//End mod
|
||||
$status =fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup choice_answers contents (executed from choice_backup_mods)
|
||||
function backup_choice_answers ($bf,$preferences,$choice) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$choice_answers = get_records("choice_answers","choice",$choice,"id");
|
||||
//If there is submissions
|
||||
if ($choice_answers) {
|
||||
//Write start tag
|
||||
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
|
||||
//Iterate over each answer
|
||||
foreach ($choice_answers as $cho_ans) {
|
||||
//Start answer
|
||||
$status =fwrite ($bf,start_tag("ANSWER",5,true));
|
||||
//Print submission contents
|
||||
fwrite ($bf,full_tag("ID",6,false,$cho_ans->id));
|
||||
fwrite ($bf,full_tag("USERID",6,false,$cho_ans->userid));
|
||||
fwrite ($bf,full_tag("CHOICE_ANSWER",6,false,$cho_ans->answer));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$cho_ans->timemodified));
|
||||
//End answer
|
||||
$status =fwrite ($bf,end_tag("ANSWER",5,true));
|
||||
}
|
||||
//Write end tag
|
||||
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function choice_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","choice");
|
||||
if ($ids = choice_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
$info[1][0] = get_string("responses","choice");
|
||||
if ($ids = choice_answer_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of choices id
|
||||
function choice_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}choice a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of choice_answers id
|
||||
function choice_answer_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.choice
|
||||
FROM {$CFG->prefix}choice_answers s,
|
||||
{$CFG->prefix}choice a
|
||||
WHERE a.course = '$course' AND
|
||||
s.choice = a.id");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//choice mods
|
||||
|
||||
//This is the "graphical" structure of the choice mod:
|
||||
//
|
||||
// choice
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// choice_answers
|
||||
// (UL,pk->id, fk->choice)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function choice_restore_mods($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Iterate over choice table
|
||||
$choices = get_records ("choice","course",$preferences->backup_course,"id");
|
||||
if ($choices) {
|
||||
foreach ($choices as $choice) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print choice data
|
||||
fwrite ($bf,full_tag("ID",4,false,$choice->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
|
||||
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
|
||||
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
|
||||
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
|
||||
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
|
||||
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
|
||||
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
|
||||
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
|
||||
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
|
||||
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
|
||||
//if we've selected to backup users info, then execute backup_choice_answers
|
||||
if ($preferences->mods["choice"]->userinfo) {
|
||||
$status = backup_choice_answers($bf,$preferences,$choice->id);
|
||||
}
|
||||
//End mod
|
||||
$status =fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//forum mods
|
||||
|
||||
//This is the "graphical" structure of the forum mod:
|
||||
//
|
||||
// forum
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// -----------------------------------
|
||||
// | |
|
||||
// subscriptions forum_discussions
|
||||
// (UL,pk->id, fk->forum) (UL,pk->id, fk->forum)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// forum_posts
|
||||
// (UL,pk->id,fk->discussion,nt->parent,files)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// forum_ratings
|
||||
// (UL,pk->id,fk->post)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function forum_backup_mods() {
|
||||
print "hola";
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function NO_forum_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","forum");
|
||||
if ($ids = forum_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
//Subscriptions
|
||||
$info[1][0] = get_string("subscriptions","forum");
|
||||
if ($ids = forum_subscription_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
//Discussions
|
||||
$info[2][0] = get_string("discussions","forum");
|
||||
if ($ids = forum_discussion_ids_by_course ($course)) {
|
||||
$info[2][1] = count($ids);
|
||||
} else {
|
||||
$info[2][1] = 0;
|
||||
}
|
||||
//Posts
|
||||
$info[3][0] = get_string("posts","forum");
|
||||
if ($ids = forum_post_ids_by_course ($course)) {
|
||||
$info[3][1] = count($ids);
|
||||
} else {
|
||||
$info[3][1] = 0;
|
||||
}
|
||||
//Ratings
|
||||
$info[4][0] = get_string("ratings","forum");
|
||||
if ($ids = forum_rating_ids_by_course ($course)) {
|
||||
$info[4][1] = count($ids);
|
||||
} else {
|
||||
$info[4][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of forums id
|
||||
function forum_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}forum a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of forum subscriptions id
|
||||
function forum_subscription_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.forum
|
||||
FROM {$CFG->prefix}forum_subscriptions s,
|
||||
{$CFG->prefix}forum a
|
||||
WHERE a.course = '$course' AND
|
||||
s.forum = a.id");
|
||||
}
|
||||
|
||||
//Returns an array of forum discussions id
|
||||
function forum_discussion_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.forum
|
||||
FROM {$CFG->prefix}forum_discussions s,
|
||||
{$CFG->prefix}forum a
|
||||
WHERE a.course = '$course' AND
|
||||
s.forum = a.id");
|
||||
}
|
||||
|
||||
//Returns an array of forum posts id
|
||||
function forum_post_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT p.id , p.discussion, s.forum
|
||||
FROM {$CFG->prefix}forum_posts p,
|
||||
{$CFG->prefix}forum_discussions s,
|
||||
{$CFG->prefix}forum a
|
||||
WHERE a.course = '$course' AND
|
||||
s.forum = a.id AND
|
||||
p.discussion = s.id");
|
||||
}
|
||||
|
||||
//Returns an array of ratings posts id
|
||||
function forum_rating_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT r.id, r.post, p.discussion, s.forum
|
||||
FROM {$CFG->prefix}forum_ratings r,
|
||||
{$CFG->prefix}forum_posts p,
|
||||
{$CFG->prefix}forum_discussions s,
|
||||
{$CFG->prefix}forum a
|
||||
WHERE a.course = '$course' AND
|
||||
s.forum = a.id AND
|
||||
p.discussion = s.id AND
|
||||
r.post = p.id");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//journal mods
|
||||
|
||||
//This is the "graphical" structure of the journal mod:
|
||||
//
|
||||
// journal
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// journal_entries
|
||||
// (UL,pk->id, fk->journal)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function journal_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
print "hola";
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function NO_journal_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","journal");
|
||||
if ($ids = journal_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
$info[1][0] = get_string("entries","journal");
|
||||
if ($ids = journal_entry_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of journals id
|
||||
function journal_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}journal a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of journal entries id
|
||||
function journal_entry_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.journal
|
||||
FROM {$CFG->prefix}journal_entries s,
|
||||
{$CFG->prefix}journal a
|
||||
WHERE a.course = '$course' AND
|
||||
s.journal = a.id");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//pgassignment mods
|
||||
|
||||
//This is the "graphical" structure of the pgassignment mod:
|
||||
//
|
||||
// pgassignment
|
||||
// (CL,pk->id)
|
||||
// |
|
||||
// -----------------------------------
|
||||
// | |
|
||||
// pgassignment_elements pgassignment_submissions
|
||||
// (CL,pk->id, fk->pgassignment) (UL,pk->id, fk->pgassignment,files)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// pgasignments_grades
|
||||
// (UL,pk->id,fk->submission)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function NO_pgassignment_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
print "hola";
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function pgassignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","pgassignment");
|
||||
if ($ids = pgassignment_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
//Elements
|
||||
$info[1][0] = get_string("elements","pgassignment");
|
||||
if ($ids = pgassignment_element_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
//Submissions
|
||||
$info[2][0] = get_string("submissions","pgassignment");
|
||||
if ($ids = pgassignment_submission_ids_by_course ($course)) {
|
||||
$info[2][1] = count($ids);
|
||||
} else {
|
||||
$info[2][1] = 0;
|
||||
}
|
||||
//Grades
|
||||
$info[3][0] = get_string("grades","pgassignment");
|
||||
if ($ids = pgassignment_grade_ids_by_course ($course)) {
|
||||
$info[3][1] = count($ids);
|
||||
} else {
|
||||
$info[3][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of pgassignments id
|
||||
function pgassignment_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}pgassignment a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of pgassignment elements id
|
||||
function pgassignment_element_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.pgassignment
|
||||
FROM {$CFG->prefix}pgassignment_elements s,
|
||||
{$CFG->prefix}pgassignment a
|
||||
WHERE a.course = '$course' AND
|
||||
s.pgassignment = a.id");
|
||||
}
|
||||
|
||||
//Returns an array of pgassignment submissions id
|
||||
function pgassignment_submission_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.pgassignment
|
||||
FROM {$CFG->prefix}pgassignment_submissions s,
|
||||
{$CFG->prefix}pgassignment a
|
||||
WHERE a.course = '$course' AND
|
||||
s.pgassignment = a.id");
|
||||
}
|
||||
|
||||
//Returns an array of pgassignment grades id
|
||||
function pgassignment_grade_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT g.id , g.submission, s.pgassignment
|
||||
FROM {$CFG->prefix}pgassignment_grades g,
|
||||
{$CFG->prefix}pgassignment_submissions s,
|
||||
{$CFG->prefix}pgassignment a
|
||||
WHERE a.course = '$course' AND
|
||||
s.pgassignment = a.id AND
|
||||
g.submission = s.id");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,148 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//quiz mods
|
||||
|
||||
//To see, put your terminal to 132cc
|
||||
|
||||
//This is the "graphical" structure of the quiz mod:
|
||||
//
|
||||
// quiz quiz_categories
|
||||
// (CL,pk->id) (CL,pk->id)
|
||||
// | |
|
||||
// ----------------------------------------------- |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// quiz_attemps quiz_grades quiz_question_grades |
|
||||
// (UL,pk->id, fk->quiz) (UL,pk->id,fk->quiz) (UL,pk->id,fk->quiz) |
|
||||
// | | |
|
||||
// | | |
|
||||
// | | |
|
||||
// quiz_responses | quiz_questions
|
||||
// (UL,pk->id, fk->attempt)----------------------------------------------------(CL,pk->id,fk->category,files)
|
||||
// |
|
||||
// |
|
||||
// |
|
||||
// ------------------------------------------------------------------------------------------------------
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | | quiz_randomsamatch
|
||||
// quiz_truefalse quiz_shortanswer quiz_multichoice |---------(CL,pl->id,fk->question)
|
||||
// (CL,pl->id,fk->question) (CL,pl->id,fk->question) (CL,pl->id,fk->question) |
|
||||
// . . . |
|
||||
// . . . |
|
||||
// . . . | quiz_match
|
||||
// .................................................... |---------(CL,pl->id,fk->question)
|
||||
// . | .
|
||||
// . | .
|
||||
// . | .
|
||||
// quiz_answers | quiz_match_sub
|
||||
// (CL,pk->id,fk->question)----------------------------|---------(CL,pl->id,fk->question)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
//THIS MOD BACKUP NEEDS TO USE THE mdl_backup_ids TABLE
|
||||
|
||||
function quiz_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
print "hola";
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function NO_quiz_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//Deletes data from mdl_backup_ids (categories section)
|
||||
delete_category_ids ($backup_unique_code);
|
||||
//Create date into mdl_backup_ids (categories section)
|
||||
insert_category_ids ($course,$backup_unique_code);
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","quiz");
|
||||
if ($ids = quiz_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
//Categories
|
||||
$info[1][0] = get_string("categories","quiz");
|
||||
if ($ids = quiz_category_ids_by_backup ($backup_unique_code)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
//Questions
|
||||
$info[2][0] = get_string("questions","quiz");
|
||||
if ($ids = quiz_question_ids_by_backup ($backup_unique_code)) {
|
||||
$info[2][1] = count($ids);
|
||||
} else {
|
||||
$info[2][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
//Grades
|
||||
$info[3][0] = get_string("grades","quiz");
|
||||
if ($ids = quiz_grade_ids_by_course ($course)) {
|
||||
$info[3][1] = count($ids);
|
||||
} else {
|
||||
$info[3][1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of quiz id
|
||||
function quiz_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}quiz a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of categories id
|
||||
function quiz_category_ids_by_backup ($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.old_id, a.backup_code
|
||||
FROM {$CFG->prefix}backup_ids a
|
||||
WHERE a.backup_code = '$backup_unique_code'");
|
||||
}
|
||||
|
||||
function quiz_question_ids_by_backup ($backup_unique_code) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT q.id, q.category
|
||||
FROM {$CFG->prefix}backup_ids a,
|
||||
{$CFG->prefix}quiz_questions q
|
||||
WHERE a.backup_code = '$backup_unique_code' and
|
||||
q.category = a.old_id");
|
||||
}
|
||||
|
||||
function quiz_grade_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT g.id, g.quiz
|
||||
FROM {$CFG->prefix}quiz a,
|
||||
{$CFG->prefix}quiz_grades g
|
||||
WHERE a.course = '$course' and
|
||||
g.quiz = a.id");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//resource mods
|
||||
|
||||
//This is the "graphical" structure of the resource mod:
|
||||
//
|
||||
// resource
|
||||
// (CL,pk->id,files)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
//This function executes all the backup procedure about this mod
|
||||
function resource_backup_mods($bf,$preferences) {
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
////Iterate over resource table
|
||||
$resources = get_records ("resource","course",$preferences->backup_course,"id");
|
||||
if ($resources) {
|
||||
foreach ($resources as $resource) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print assignment data
|
||||
fwrite ($bf,full_tag("ID",4,false,$resource->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
|
||||
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
|
||||
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
|
||||
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
|
||||
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
|
||||
//End mod
|
||||
$status = fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function resource_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","resource");
|
||||
if ($ids = resource_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of resources id
|
||||
function resource_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}resource a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//resource mods
|
||||
|
||||
//This is the "graphical" structure of the resource mod:
|
||||
//
|
||||
// resource
|
||||
// (CL,pk->id,files)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
//This function executes all the restore procedure about this mod
|
||||
function resource_restore_mods($bf,$preferences) {
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
////Iterate over resource table
|
||||
$resources = get_records ("resource","course",$preferences->backup_course,"id");
|
||||
if ($resources) {
|
||||
foreach ($resources as $resource) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print assignment data
|
||||
fwrite ($bf,full_tag("ID",4,false,$resource->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
|
||||
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
|
||||
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
|
||||
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
|
||||
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
|
||||
//End mod
|
||||
$status = fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?PHP //$Id$
|
||||
//This php script contains all the stuff to backup/restore
|
||||
//survey mods
|
||||
|
||||
//This is the "graphical" structure of the survey mod:
|
||||
// --------------------
|
||||
// survey | survey_questions |
|
||||
// (CL,pk->id) |(CL,pk->id,?????) |
|
||||
// | --------------------
|
||||
// |
|
||||
// -----------------------------------
|
||||
// | |
|
||||
// survey_analysis survey_answers
|
||||
// (UL,pk->id, fk->survey) (UL,pk->id, fk->survey)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files)
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
function survey_backup_mods($bf,$preferences) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
//Iterate over survey table
|
||||
$surveys = get_records ("survey","course",$preferences->backup_course,"id");
|
||||
if ($surveys) {
|
||||
foreach ($surveys as $survey) {
|
||||
//Start mod
|
||||
fwrite ($bf,start_tag("MOD",3,true));
|
||||
//Print choice data
|
||||
fwrite ($bf,full_tag("ID",4,false,$survey->id));
|
||||
fwrite ($bf,full_tag("MODTYPE",4,false,"survey"));
|
||||
fwrite ($bf,full_tag("TEMPLATE",4,false,$survey->template));
|
||||
fwrite ($bf,full_tag("DAYS",4,false,$survey->days));
|
||||
fwrite ($bf,full_tag("TIMECREATED",4,false,$survey->timecreated));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$survey->timemodified));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$survey->name));
|
||||
fwrite ($bf,full_tag("INTRO",4,false,$survey->intro));
|
||||
fwrite ($bf,full_tag("QUESTIONS",4,false,$survey->questions));
|
||||
|
||||
//if we've selected to backup users info, then execute backup_survey_answers and
|
||||
//backup_survey_analysis
|
||||
if ($preferences->mods["survey"]->userinfo) {
|
||||
$status = backup_survey_answers($bf,$preferences,$survey->id);
|
||||
$status = backup_survey_analysis($bf,$preferences,$survey->id);
|
||||
}
|
||||
//End mod
|
||||
$status =fwrite ($bf,end_tag("MOD",3,true));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup survey_answers contents (executed from survey_backup_mods)
|
||||
function backup_survey_answers ($bf,$preferences,$survey) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$survey_answers = get_records("survey_answers","survey",$survey,"id");
|
||||
//If there is answers
|
||||
if ($survey_answers) {
|
||||
//Write start tag
|
||||
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
|
||||
//Iterate over each answer
|
||||
foreach ($survey_answers as $sur_ans) {
|
||||
//Start answer
|
||||
$status =fwrite ($bf,start_tag("ANSWER",5,true));
|
||||
//Print survey_answers contents
|
||||
fwrite ($bf,full_tag("ID",6,false,$sur_ans->id));
|
||||
fwrite ($bf,full_tag("USERID",6,false,$sur_ans->userid));
|
||||
fwrite ($bf,full_tag("QUESTION",6,false,$sur_ans->question));
|
||||
fwrite ($bf,full_tag("TIME",6,false,$sur_ans->time));
|
||||
fwrite ($bf,full_tag("ANSWER1",6,false,$sur_ans->answer1));
|
||||
fwrite ($bf,full_tag("ANSWER2",6,false,$sur_ans->answer2));
|
||||
//End answer
|
||||
$status =fwrite ($bf,end_tag("ANSWER",5,true));
|
||||
}
|
||||
//Write end tag
|
||||
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
//Backup survey_analysis contents (executed from survey_backup_mods)
|
||||
function backup_survey_analysis ($bf,$preferences,$survey) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$status = true;
|
||||
|
||||
$survey_analysis = get_records("survey_analysis","survey",$survey,"id");
|
||||
//If there is analysis
|
||||
if ($survey_analysis) {
|
||||
//Write start tag
|
||||
$status =fwrite ($bf,start_tag("ANALYSIS",4,true));
|
||||
//Iterate over each analysis
|
||||
foreach ($survey_analysis as $sur_ana) {
|
||||
//Start answer
|
||||
$status =fwrite ($bf,start_tag("ANALYS",5,true));
|
||||
//Print survey_analysis contents
|
||||
fwrite ($bf,full_tag("ID",6,false,$sur_ana->id));
|
||||
fwrite ($bf,full_tag("USERID",6,false,$sur_ana->userid));
|
||||
fwrite ($bf,full_tag("NOTES",6,false,$sur_ana->notes));
|
||||
//End answer
|
||||
$status =fwrite ($bf,end_tag("ANALYS",5,true));
|
||||
}
|
||||
//Write end tag
|
||||
$status =fwrite ($bf,end_tag("ANALYSIS",4,true));
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
////Return an array of info (name,value)
|
||||
function survey_check_backup_mods($course,$user_data=false,$backup_unique_code) {
|
||||
//First the course data
|
||||
$info[0][0] = get_string("modulenameplural","survey");
|
||||
if ($ids = survey_ids ($course)) {
|
||||
$info[0][1] = count($ids);
|
||||
} else {
|
||||
$info[0][1] = 0;
|
||||
}
|
||||
|
||||
//Now, if requested, the user_data
|
||||
if ($user_data) {
|
||||
//Subscriptions
|
||||
$info[1][0] = get_string("answers","survey");
|
||||
if ($ids = survey_answer_ids_by_course ($course)) {
|
||||
$info[1][1] = count($ids);
|
||||
} else {
|
||||
$info[1][1] = 0;
|
||||
}
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
|
||||
|
||||
//Returns an array of surveys id
|
||||
function survey_ids ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT a.id, a.course
|
||||
FROM {$CFG->prefix}survey a
|
||||
WHERE a.course = '$course'");
|
||||
}
|
||||
|
||||
//Returns an array of survey answer id
|
||||
function survey_answer_ids_by_course ($course) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql ("SELECT s.id , s.survey
|
||||
FROM {$CFG->prefix}survey_answers s,
|
||||
{$CFG->prefix}forum a
|
||||
WHERE a.course = '$course' AND
|
||||
s.survey = a.id");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?PHP //$Id$
|
||||
//This script is used to configure and execute the restore proccess.
|
||||
|
||||
//Define some globals for all the script
|
||||
|
||||
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
|
||||
//ALL RELATIVE FROM THE LOCATION OF THE restore.php SCRIPT !!!
|
||||
|
||||
$moodle_home = "../../..";
|
||||
$mods_home = "mod";
|
||||
|
||||
//END MUST CHANGE
|
||||
|
||||
//Units used
|
||||
require_once ("$moodle_home/config.php");
|
||||
require_once ("$moodle_home/version.php");
|
||||
require_once ("backup_version.php");
|
||||
require_once ("db/backup_$CFG->dbtype.php");
|
||||
require_once ("lib.php");
|
||||
require_once ("restorelib.php");
|
||||
|
||||
//Optional
|
||||
optional_variable($file);
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Check backup_version
|
||||
upgrade_backup_db($backup_version,$backup_release,"restore.php");
|
||||
|
||||
//Get strings
|
||||
$strcourserestore = get_string("courserestore");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
//If no file has been selected from the FileManager, inform and end
|
||||
if (!$file) {
|
||||
print_header("$site->shortname: $strcourserestore", $site->fullname,
|
||||
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
|
||||
print_heading(get_string("nofilesselected"));
|
||||
print_continue("$moodle_home/$CFG->admin/index.php");
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
//If cancel has been selected, inform and end
|
||||
if ($cancel) {
|
||||
print_header("$site->shortname: $strcourserestore", $site->fullname,
|
||||
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
|
||||
print_heading(get_string("restorecancelled"));
|
||||
print_continue("$moodle_home/$CFG->admin/index.php");
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
//We are here, so me have a file.
|
||||
//Print header
|
||||
print_header("$site->shortname: $strcourserestore", $site->fullname,
|
||||
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
|
||||
$strcourserestore -> ".basename($file));
|
||||
//Print form
|
||||
print_heading("$strcourserestore: ".basename($file));
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
|
||||
//Call the form, depending the step we are
|
||||
if (!$launch) {
|
||||
include_once("restore_precheck.html");
|
||||
} else if ($launch == "form") {
|
||||
include_once("restore_form.html");
|
||||
} else if ($launch == "check") {
|
||||
include_once("restore_check.html");
|
||||
} else if ($launch == "execute") {
|
||||
include_once("restore_execute.html");
|
||||
}
|
||||
print_simple_box_end();
|
||||
|
||||
//Print footer
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
<?PHP //$Id$
|
||||
//This page receive all the restore_form data. Then, if existing course
|
||||
//has been selected, shows a list of courses to select one.
|
||||
//It cheks that the parammeter from restore_form are coherent.
|
||||
//It puts all the restore info in the session.
|
||||
//Finally, it calls restore_execute to do the hard work
|
||||
|
||||
//Get objects from session
|
||||
if ($SESSION) {
|
||||
$info = $SESSION->info;
|
||||
$course_header = $SESSION->course_header;
|
||||
$restore = $SESSION->restore;
|
||||
}
|
||||
|
||||
//If restore session info exists, but we are posting parameters
|
||||
//manually, this has prioriry
|
||||
if ($restore and isset($restore_restoreto)) {
|
||||
unset($restore);
|
||||
}
|
||||
|
||||
//Check required objects from session
|
||||
|
||||
//info
|
||||
require_variable($info);
|
||||
|
||||
//course_header
|
||||
require_variable($course_header);
|
||||
|
||||
//If the restore object doesn't exist, we are going
|
||||
//to check every variable individually and create it
|
||||
|
||||
if (!$restore) {
|
||||
//Check that we have all we need
|
||||
//backup_unique_code
|
||||
require_variable($backup_unique_code);
|
||||
//file
|
||||
require_variable($file);
|
||||
//Checks for the required restoremod parameters
|
||||
if ($allmods = get_records("modules")) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$var = "restore_".$modname;
|
||||
require_variable($$var);
|
||||
$var = "restore_user_info_".$modname;
|
||||
require_variable($$var);
|
||||
}
|
||||
}
|
||||
//restoreto
|
||||
require_variable($restore_restoreto);
|
||||
//restore_users
|
||||
require_variable($restore_users);
|
||||
//restore_logs
|
||||
require_variable($restore_logs);
|
||||
//restore_user_files
|
||||
require_variable($restore_user_files);
|
||||
//restore_course_files
|
||||
require_variable($restore_course_files);
|
||||
//restore_course_files
|
||||
require_variable($restore_course_files);
|
||||
|
||||
//Check we've selected a course
|
||||
if (!isset($course_id)) {
|
||||
$course_id = 0;
|
||||
}
|
||||
|
||||
//We are here, having all we need !!
|
||||
//Create the restore object and put it in the session
|
||||
$restore->backup_unique_code = $backup_unique_code;
|
||||
$restore->file = $file;
|
||||
if ($allmods = get_records("modules")) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$var = "restore_".$modname;
|
||||
$restore->mods[$modname]->restore=$$var;
|
||||
$var = "restore_user_info_".$modname;
|
||||
$restore->mods[$modname]->userinfo=$$var;
|
||||
}
|
||||
}
|
||||
$restore->restoreto=$restore_restoreto;
|
||||
$restore->users=$restore_users;
|
||||
$restore->logs=$restore_logs;
|
||||
$restore->user_files=$restore_user_files;
|
||||
$restore->course_files=$restore_course_files;
|
||||
$restore->course_id=$course_id;
|
||||
} else {
|
||||
//We have the object, so check if we have a new course_id
|
||||
//passed as parammeter
|
||||
if ($course_id) {
|
||||
$restore->course_id=$course_id;
|
||||
}
|
||||
}
|
||||
//We have the object with data, put it in the session
|
||||
$SESSION->restore = $restore;
|
||||
|
||||
//From here to the wnd of the script, only use the $restore object
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Depending the selected restoreto:
|
||||
// 0-Existing course: Select the destination course and launch the check again.
|
||||
// 1-New course: Create the restore object (checking everything) and launch the execute.
|
||||
|
||||
//Select course
|
||||
if (($restore->restoreto == 0) and ($restore->course_id == 0)) {
|
||||
if ($courses = get_courses()) {
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("CENTER");
|
||||
foreach ($courses as $course) {
|
||||
echo "<A HREF=\"restore.php?course_id=$course->id&launch=check&file=$file\">$course->fullname ($course->shortname)</A><BR>";
|
||||
}
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
print_heading(get_string("nocoursesyet"));
|
||||
print_continue("$moodle_home/$CFG->admin/index.php");
|
||||
}
|
||||
//Checks everything and execute restore
|
||||
} else if ((($restore->restoreto == 0) and ($restore->course_id != 0)) or ($restore->restoreto == 1)) {
|
||||
$show_continue_button = true;
|
||||
//Check if we've selected any mod's user info and restore->users
|
||||
//is set to none. Change it to course and inform.
|
||||
if ($restore->users == 2) {
|
||||
$changed = false;
|
||||
$mods = $restore->mods;
|
||||
foreach ($mods as $mod) {
|
||||
if ($mod->userinfo) {
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
if ($changed) {
|
||||
echo get_string ("noteuserschangednonetocourse");
|
||||
echo "<hr noshade size=\"1\">";
|
||||
$restore->users = 1;
|
||||
}
|
||||
}
|
||||
//Save the restore session object
|
||||
$SESSION->restore = $restore;
|
||||
if ($show_continue_button) {
|
||||
//Print the continue button to execute the restore NOW !!!!
|
||||
//All is prepared !!!
|
||||
echo "<CENTER>";
|
||||
echo get_string("presscontinuetolaunchrestore");
|
||||
echo "<br>";
|
||||
$hidden["launch"] = "execute";
|
||||
$hidden["file"] = $file;
|
||||
print_single_button("restore.php", $hidden, get_string("continue"),"post");
|
||||
echo "</CENTER>";
|
||||
} else {
|
||||
//Show error
|
||||
error ("Something was wrong checking restore preferences");
|
||||
}
|
||||
|
||||
//If we are here. Something must be wrong. Debug !!!
|
||||
} else {
|
||||
print_object($restore);
|
||||
print_object($info);
|
||||
print_object($course_header);
|
||||
error ("Something must be wrong");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,195 @@
|
||||
<?PHP //$Id$
|
||||
//This page receives the required info and executes the restore
|
||||
//with the parameters suplied. Whe finished, delete temporary
|
||||
//data from backup_tables and temp directory
|
||||
|
||||
//Get objects from session
|
||||
if ($SESSION) {
|
||||
$info = $SESSION->info;
|
||||
$course_header = $SESSION->course_header;
|
||||
$restore = $SESSION->restore;
|
||||
}
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Start the main table
|
||||
echo "<table cellpadding=5>";
|
||||
echo "<tr><td>";
|
||||
|
||||
//Start the main ul
|
||||
echo "<ul>";
|
||||
|
||||
//Init status
|
||||
$status = true;
|
||||
|
||||
//Localtion of the xml file
|
||||
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
|
||||
|
||||
//If we've selected to restore into new course
|
||||
//create it (course)
|
||||
//Saving conversion id variables into backup_tables
|
||||
if ($restore->restoreto ==1) {
|
||||
echo "<li>Creating new course";
|
||||
$status = restore_create_new_course($restore,&$course_header);
|
||||
//Print course fullname and shortname and category
|
||||
if ($status) {
|
||||
echo "<ul>";
|
||||
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")";
|
||||
echo "<li>".get_string("category").": ".$course_header->category->name;
|
||||
echo "</ul>";
|
||||
//Put the destination course_id
|
||||
$restore->course_id = $course_header->course_id;
|
||||
}
|
||||
} else {
|
||||
$course = get_record("course","id",$restore->course_id);
|
||||
if ($course) {
|
||||
echo "<li>Using existing course";
|
||||
echo "<ul>";
|
||||
echo "<li>From: ".$course_header->course_fullname." (".$course_header->course_shortname.")";
|
||||
echo "<li>To: ".$course->fullname." (".$course->shortname.")";
|
||||
echo "</ul>";
|
||||
}
|
||||
}
|
||||
|
||||
//Now create the course_sections and their associated course_modules
|
||||
if ($status) {
|
||||
if ($restore->restoreto == 1) {
|
||||
echo "<li>Creating sections";
|
||||
$status = restore_create_sections($restore,$xml_file);
|
||||
} else if ($restore->restoreto == 0) {
|
||||
echo "<li>Checking sections";
|
||||
$status = restore_create_sections($restore,$xml_file);
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Now create users as needed
|
||||
if ($status and ($restore->users == 0 or $restore->users == 1)) {
|
||||
echo "<li>Creating users";
|
||||
$status = restore_create_users($restore,$xml_file);
|
||||
//Now print info about the work done
|
||||
if ($status) {
|
||||
$recs = get_records_sql("select old_id, info from {$CFG->prefix}backup_ids
|
||||
where backup_code = '$restore->backup_unique_code' and
|
||||
table_name = 'user'");
|
||||
//We've records
|
||||
if ($recs) {
|
||||
$new_count = 0;
|
||||
$exists_count = 0;
|
||||
$student_count = 0;
|
||||
$teacher_count = 0;
|
||||
$coursecreator_count = 0;
|
||||
$admin_count = 0;
|
||||
$other_count = 0;
|
||||
//Iterate, filling counters
|
||||
foreach ($recs as $rec) {
|
||||
if (strpos($rec->info,"new") !== false) {
|
||||
$new_count++;
|
||||
}
|
||||
if (strpos($rec->info,"exists") !== false) {
|
||||
$exists_count++;
|
||||
}
|
||||
if (strpos($rec->info,"admin")) {
|
||||
$admin_count++;
|
||||
} else if (strpos($rec->info,"coursecreator")) {
|
||||
$coursecreator_count++;
|
||||
} else if (strpos($rec->info,"teacher")) {
|
||||
$teacher_count++;
|
||||
} else if (strpos($rec->info,"student")) {
|
||||
$student_count++;
|
||||
} else if ($rec->info == "new" or $rec->info == "exists") {
|
||||
$other_count++;
|
||||
}
|
||||
}
|
||||
//Now print information gathered
|
||||
echo " (new: ".$new_count.", existing: ".$exists_count.")";
|
||||
echo "<ul>";
|
||||
echo "<li>Students: ".$student_count;
|
||||
echo "<li>Teachers: ".$teacher_count;
|
||||
echo "<li>Course Creators: ".$coursecreator_count;
|
||||
echo "<li>Admins: ".$admin_count;
|
||||
echo "<li>Other: ".$other_count;
|
||||
echo "</ul>";
|
||||
} else {
|
||||
//Something is wrong. There is no users !!
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Now create user_files as needed
|
||||
if ($status and ($restore->user_files)) {
|
||||
echo "<li>Copying User Files";
|
||||
$status = restore_user_files($restore);
|
||||
//If all is ok (and we have a counter)
|
||||
if ($status and ($status !== true)) {
|
||||
//Inform about user dirs created from backup
|
||||
echo "<ul>";
|
||||
echo "<li>User Zones: ".$status;
|
||||
echo "</ul>";
|
||||
}
|
||||
}
|
||||
|
||||
//Now create course files as needed
|
||||
if ($status and ($restore->course_files)) {
|
||||
echo "<li>Copying Course Files";
|
||||
$status = restore_course_files($restore);
|
||||
//If all is ok (and we have a counter)
|
||||
if ($status and ($status !== true)) {
|
||||
//Inform about user dirs created from backup
|
||||
echo "<ul>";
|
||||
echo "<li>Main Files/Folders: ".$status;
|
||||
echo "</ul>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Now create log entries as needed
|
||||
if ($status and ($restore->logs)) {
|
||||
echo "<li>Creating Log Entries <b>(not implemented)</b>. Execute after everything...";
|
||||
}
|
||||
|
||||
//Now, if all is OK, adjust the instance field in course_modules !!
|
||||
|
||||
//Now if all is OK, update course modinfo field !!
|
||||
|
||||
//End the main ul
|
||||
echo "</ul>";
|
||||
|
||||
|
||||
//End the main table
|
||||
echo "</tr></td>";
|
||||
echo "</table>";
|
||||
|
||||
if (!$status) {
|
||||
error ("An error has ocurred");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,226 @@
|
||||
<?PHP //$Id$
|
||||
//This page prints the restore form to select everything yo want
|
||||
//to restore. Form is dinamically buid, depending of "info" object
|
||||
//that contains the backup contents and depending of every mod
|
||||
//capabilities.
|
||||
|
||||
//Get objects from session
|
||||
$info = $SESSION->info;
|
||||
$course_header = $SESSION->course_header;
|
||||
|
||||
//Check that we have all we need
|
||||
//backup_unique_code
|
||||
require_variable($backup_unique_code);
|
||||
//file
|
||||
require_variable($file);
|
||||
//info
|
||||
require_variable($info);
|
||||
//course_header
|
||||
require_variable($course_header);
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Checks for the required files/functions to restore every mod
|
||||
$count = 0;
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modfile = "$mods_home/$modname/restorelib.php";
|
||||
$modrestore = $modname."_restore_mods";
|
||||
if (file_exists($modfile)) {
|
||||
include_once($modfile);
|
||||
if (function_exists($modrestore)) {
|
||||
$var = "exists_".$modname;
|
||||
$$var = true;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//Check data
|
||||
//Check module info
|
||||
$var = "restore_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
//Check include user info
|
||||
$var = "restore_user_info_".$modname;
|
||||
if (!isset($$var)) {
|
||||
$$var = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check other parameters
|
||||
if (!isset($restore_users)) {
|
||||
$restore_users = 1;
|
||||
}
|
||||
|
||||
if (!isset($restore_logs)) {
|
||||
$restore_logs = 1;
|
||||
}
|
||||
|
||||
if (!isset($restore_user_files)) {
|
||||
$restore_user_files = 1;
|
||||
}
|
||||
|
||||
if (!isset($restore_course_files)) {
|
||||
$restore_course_files = 1;
|
||||
}
|
||||
|
||||
if (!isset($restore_restoreto)) {
|
||||
$restore_restoreto = 1;
|
||||
}
|
||||
|
||||
if ($count == 0) {
|
||||
notice("No restorable modules are installed!");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
||||
<table cellpadding=5>
|
||||
<?
|
||||
|
||||
//First, course destination
|
||||
//Print the full tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><b>";
|
||||
echo get_string("restoreto").":</b>";
|
||||
echo "</td><td>";
|
||||
$restore_restoreto_options[0] = get_string("existingcourse");
|
||||
$restore_restoreto_options[1] = get_string("newcourse");
|
||||
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
|
||||
echo "</td></tr>";
|
||||
//Line
|
||||
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
|
||||
//Now, check modules and info and show posibilities
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modrestore = $modname."_restore_mods";
|
||||
//If exists the lib & function
|
||||
$exist = "exists_".$modname;
|
||||
$restore_var = "restore_".$modname;
|
||||
$user_info_var = "restore_user_info_".$modname;
|
||||
if ($$exist) {
|
||||
//Now check that we have that module info in the backup file
|
||||
if ($info->mods[$modname]->backup == "true") {
|
||||
//Print the full tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
|
||||
echo "</td><td>";
|
||||
$restore_options[0] = get_string("no");
|
||||
$restore_options[1] = get_string("yes");
|
||||
choose_from_menu($restore_options, $restore_var, $$restore_var, "");
|
||||
//If backup contains user data, then show menu, else fix it to
|
||||
//without user data
|
||||
if ($info->mods[$modname]->userinfo == "true") {
|
||||
$restore_user_options[0] = get_string("withoutuserdata");
|
||||
$restore_user_options[1] = get_string("withuserdata");
|
||||
choose_from_menu($restore_user_options, $user_info_var, $$user_info_var, "");
|
||||
} else {
|
||||
//Module haven't userdata
|
||||
echo get_string("withoutuserdata");
|
||||
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
} else {
|
||||
//Module isn't restorable
|
||||
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
|
||||
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
|
||||
}
|
||||
} else {
|
||||
//Module isn't restorable
|
||||
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
|
||||
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
|
||||
}
|
||||
}
|
||||
//Line
|
||||
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
|
||||
|
||||
//Now print the Users tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("users").":";
|
||||
echo "</td><td>";
|
||||
//If all users are in the backup file
|
||||
if ($info->backup_users == "all") {
|
||||
$user_options[0] = get_string("all");
|
||||
}
|
||||
$user_options[1] = get_string("course");
|
||||
$user_options[2] = get_string("none");
|
||||
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
|
||||
choose_from_menu($user_options, "restore_users", $restore_users, "");
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the Logs tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string("logs").":";
|
||||
echo "</td><td>";
|
||||
//If logs are in the backup file, show menu, else fixed to no
|
||||
if ($info->backup_logs == "true") {
|
||||
$log_options[0] = get_string("no");
|
||||
$log_options[1] = get_string("yes");
|
||||
choose_from_menu($log_options, "restore_logs", $restore_logs, "");
|
||||
} else {
|
||||
echo get_string("no");
|
||||
echo "<input type=\"hidden\" name=\"restore_logs\" value=\"0\">";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the User Files tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string ("userfiles").":";
|
||||
echo "</td><td>";
|
||||
//If user files are in the backup file, show menu, else fixed to no
|
||||
if ($info->backup_user_files == "true") {
|
||||
$user_file_options[0] = get_string("no");
|
||||
$user_file_options[1] = get_string("yes");
|
||||
choose_from_menu($user_file_options, "restore_user_files", $restore_user_files, "");
|
||||
} else {
|
||||
echo get_string("no");
|
||||
echo "<input type=\"hidden\" name=\"restore_user_files\" value=\"0\">";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
|
||||
//Now print the Course Files tr
|
||||
echo "<tr>";
|
||||
echo "<td align=\"right\"><P><B>";
|
||||
echo get_string ("coursefiles").":";
|
||||
echo "</td><td>";
|
||||
//If course files are in the backup file, show menu, else fixed to no
|
||||
if ($info->backup_course_files == "true") {
|
||||
$course_file_options[0] = get_string("no");
|
||||
$course_file_options[1] = get_string("yes");
|
||||
choose_from_menu($course_file_options, "restore_course_files", $restore_course_files, "");
|
||||
} else {
|
||||
echo get_string("no");
|
||||
echo "<input type=\"hidden\" name=\"restore_course_files\" value=\"0\">";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"$backup_unique_code\">";
|
||||
echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<BR>
|
||||
<CENTER>
|
||||
<input type="hidden" name=id value="<? p($id) ?>">
|
||||
<input type="hidden" name=launch value="check">
|
||||
<input type="submit" value="<? print_string("continue") ?>">
|
||||
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
||||
</CENTER>
|
||||
</FORM>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?PHP // $Id$
|
||||
//This page copies th zip to the temp directory,
|
||||
//unzip it, check that it is a valid backup file
|
||||
//inform about its contents and fill all the necesary
|
||||
//variables to continue with the restore.
|
||||
|
||||
//Checks we have the file variable
|
||||
if (!isset($file)) {
|
||||
error ("File not specified");
|
||||
}
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
//Check admin
|
||||
if (!isadmin()) {
|
||||
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||
}
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Prepend dataroot to variable to have the absolute path
|
||||
$file = $CFG->dataroot."/".$file;
|
||||
|
||||
//Start the main table
|
||||
echo "<table cellpadding=5>";
|
||||
echo "<tr><td>";
|
||||
|
||||
//Start the mail ul
|
||||
echo "<ul>";
|
||||
|
||||
//Check the file exists
|
||||
if (!is_file($file)) {
|
||||
error ("File not exists ($file)");
|
||||
}
|
||||
|
||||
//Check the file name ends with .zip
|
||||
if (!substr($file,-4) == ".zip") {
|
||||
error ("File has an incorrect extension");
|
||||
}
|
||||
|
||||
//Now calculate the unique_code for this restore
|
||||
$backup_unique_code = time();
|
||||
|
||||
//Now check and create the backup dir (if it doesn't exist)
|
||||
$status = check_and_create_backup_dir($backup_unique_code);
|
||||
//Empty dir
|
||||
if ($status) {
|
||||
echo "<li>Creating temp dir";
|
||||
$status = clear_backup_dir($backup_unique_code);
|
||||
}
|
||||
|
||||
//Now delete old data and directories under dataroot/temp/backup
|
||||
if ($status) {
|
||||
echo "<li>Cleaning old data";
|
||||
$status = backup_delete_old_data();
|
||||
}
|
||||
|
||||
//Now copy he zip file to dataroot/temp/backup/backup_unique_code
|
||||
if ($status) {
|
||||
$status = backup_copy_file($file,$CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file));
|
||||
}
|
||||
|
||||
//Now unzip the file
|
||||
if ($status) {
|
||||
echo "<li>Retrieving backup file";
|
||||
$status = restore_unzip ($CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file),$moodle_home);
|
||||
}
|
||||
|
||||
//Now check for the moodle.xml file
|
||||
if ($status) {
|
||||
$xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
|
||||
echo "<li>Checking backup file";
|
||||
$status = restore_check_moodle_file ($xml_file);
|
||||
}
|
||||
|
||||
$info = "";
|
||||
$course_header = "";
|
||||
|
||||
//Now read the info tag (all)
|
||||
if ($status) {
|
||||
echo "<li>Reading info from file";
|
||||
//Reading info from file
|
||||
$info = restore_read_xml_info ($xml_file);
|
||||
//Reading course_header from file
|
||||
$course_header = restore_read_xml_course_header ($xml_file);
|
||||
}
|
||||
|
||||
//End the main ul
|
||||
echo "</ul>";
|
||||
|
||||
//End the main table
|
||||
echo "</tr></td>";
|
||||
echo "</table>";
|
||||
|
||||
//Now we print in other table, the backup and the course it contains info
|
||||
if ($info and $course_header and $status) {
|
||||
//First, the course info
|
||||
$status = restore_print_course_header($course_header);
|
||||
//Now, the backup info
|
||||
if ($status) {
|
||||
$status = restore_print_info($info);
|
||||
}
|
||||
}
|
||||
|
||||
//Save course header and info into php session
|
||||
if ($status) {
|
||||
$SESSION->info = $info;
|
||||
$SESSION->course_header = $course_header;
|
||||
}
|
||||
|
||||
//Finally, a little form to continue
|
||||
//with some hidden fields
|
||||
if ($status) {
|
||||
echo "<br><CENTER>";
|
||||
$hidden["backup_unique_code"] = $backup_unique_code;
|
||||
$hidden["launch"] = "form";
|
||||
$hidden["file"] = $file;
|
||||
print_single_button("restore.php", $hidden, get_string("continue"),"post");
|
||||
echo "</CENTER>";
|
||||
}
|
||||
|
||||
if (!$status) {
|
||||
error ("An error has ocurred");
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
+61
-26
@@ -28,6 +28,7 @@
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unset($CFG); // Ignore this line
|
||||
|
||||
//=========================================================================
|
||||
// 1. DATABASE SETUP
|
||||
@@ -38,68 +39,102 @@
|
||||
// //
|
||||
// mysql - the prefix is optional, but useful when installing //
|
||||
// into databases that already contain tables. //
|
||||
//
|
||||
// postgres7 - the prefix is REQUIRED, regardless of whether the //
|
||||
// database is empty of not. //
|
||||
// database already contains tables. //
|
||||
|
||||
$CFG->dbtype = "mysql"; // mysql or postgres7 (for now)
|
||||
$CFG->dbhost = "localhost"; // eg localhost or db.isp.com
|
||||
$CFG->dbname = "moodle"; // database name, eg moodle
|
||||
$CFG->dbuser = "username"; // your database username
|
||||
$CFG->dbpass = "password"; // your database password
|
||||
$CFG->dbtype = 'mysql'; // mysql or postgres7 (for now)
|
||||
$CFG->dbhost = 'localhost'; // eg localhost or db.isp.com
|
||||
$CFG->dbname = 'moodle'; // database name, eg moodle
|
||||
$CFG->dbuser = 'username'; // your database username
|
||||
$CFG->dbpass = 'password'; // your database password
|
||||
|
||||
$CFG->prefix = "mdl_"; // Prefix to use for all table names
|
||||
$CFG->dbpersist = true; // Use persistent database connection?
|
||||
// (should be 'true' for 99% of sites)
|
||||
|
||||
$CFG->prefix = 'mdl_'; // Prefix to use for all table names
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// 2. WEB SITE LOCATION
|
||||
//=========================================================================
|
||||
// Now you need to tell Moodle where it is located. Specify the full
|
||||
// web address where moodle has been installed (without trailing slash)
|
||||
// web address to where moodle has been installed. If your web site
|
||||
// is accessible via multiple URLs then choose the most natural one
|
||||
// that your students would use. Do not include a trailing slash.
|
||||
|
||||
$CFG->wwwroot = "http://example.com/moodle";
|
||||
$CFG->wwwroot = 'http://example.com/moodle';
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// 3. SERVER FILES LOCATION
|
||||
//=========================================================================
|
||||
// Next, specify the full OS directory path to this same location
|
||||
// For Windows this might be something like "C:\apache\htdocs\moodle"
|
||||
// Make sure the upper/lower case is correct. Some examples:
|
||||
//
|
||||
// $CFG->dirroot = 'C:\FoxServ\www\moodle'; // Windows
|
||||
// $CFG->dirroot = '/var/www/html/moodle'; // Redhat Linux
|
||||
|
||||
$CFG->dirroot = "/web/moodle";
|
||||
$CFG->dirroot = '/var/www/html/moodle';
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// 4. DATA FILES LOCATION
|
||||
//=========================================================================
|
||||
// Now you need a place where Moodle can save uploaded files. This
|
||||
// directory should be writeable by the web server user (usually 'nobody'
|
||||
// or 'apache'), but it should not be accessible directly via the web.
|
||||
// directory should be readable AND WRITEABLE by the web server user
|
||||
// (usually 'nobody' or 'apache'), but it should not be accessible
|
||||
// directly via the web.
|
||||
//
|
||||
// - On hosting systems you might need to make sure that your "group" has
|
||||
// no permissions at all, but that "others" have full permissions.
|
||||
// - On Windows systems you might specify something like "C:\moodledata"
|
||||
//
|
||||
// - On Windows systems you might specify something like 'C:\moodledata'
|
||||
|
||||
$CFG->dataroot = "/home/moodledata";
|
||||
$CFG->dataroot = '/home/moodledata';
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// 5. TROUBLESHOOTING (most people can just ignore this setting)
|
||||
// 5. DATA FILES PERMISSIONS
|
||||
//=========================================================================
|
||||
// A very small percentage of servers have a bug which causes HTTP_REFERER
|
||||
// not to work. The symptoms of this are that you fill out the configure
|
||||
// form during Moodle setup but when hit save you find yourself on the
|
||||
// same form, unable to progress. If this happens to you, come back here
|
||||
// and set the following to true. Otherwise this should always be false.
|
||||
// The following parameter sets the permissions of new directories
|
||||
// created by Moodle within the data directory. The format is in
|
||||
// octal format (as used by the Unix utility chmod, for example).
|
||||
// The default is usually OK, but you may want to change it to 0750
|
||||
// if you are concerned about world-access to the files (you will need
|
||||
// to make sure the web server process (eg Apache) can access the files.
|
||||
// NOTE: the prefixed 0 is important, and don't use quotes.
|
||||
|
||||
$CFG->buggy_referer = false;
|
||||
$CFG->directorypermissions = 0777;
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// 6. ALL DONE! To continue your setup, visit your Moodle web page.
|
||||
// 6. DIRECTORY LOCATION (most people can just ignore this setting)
|
||||
//=========================================================================
|
||||
// A very few webhosts use /admin as a special URL for you to access a
|
||||
// control panel or something. Unfortunately this conflicts with the
|
||||
// standard location for the Moodle admin pages. You can fix this by
|
||||
// renaming the admin directory in your installation, and putting that
|
||||
// new name here. eg "moodleadmin". This will fix admin links in Moodle.
|
||||
|
||||
$CFG->admin = 'admin';
|
||||
|
||||
|
||||
//=========================================================================
|
||||
// ALL DONE! To continue installation, visit your main page with a browser
|
||||
//=========================================================================
|
||||
|
||||
|
||||
$CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
|
||||
require_once("$CFG->libdir/setup.php"); // Do not change this
|
||||
if (! @include_once("$CFG->dirroot/lib/setup.php")) { // Do not edit
|
||||
if ($CFG->dirroot == dirname(__FILE__)) {
|
||||
echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>";
|
||||
echo "<p>Are you sure all your files have been uploaded?</p>";
|
||||
} else {
|
||||
echo "<p>Error detected in config.php</p>";
|
||||
echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";
|
||||
echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';</p>";
|
||||
}
|
||||
die;
|
||||
}
|
||||
|
||||
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
|
||||
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
|
||||
|
||||
+26
-8
@@ -4,6 +4,8 @@
|
||||
require_once("../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only administrators can use this course!");
|
||||
}
|
||||
@@ -25,7 +27,7 @@
|
||||
$stradd = get_string("add");
|
||||
|
||||
print_header("$site->shortname: $strcategories", "$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> -> $strcategories");
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strcategories");
|
||||
|
||||
print_heading($strcategories);
|
||||
|
||||
@@ -37,17 +39,33 @@
|
||||
|
||||
// Peel out all the data from variable names.
|
||||
foreach ($form as $key => $val) {
|
||||
if ($key == "new" and $val != "") {
|
||||
$cat->name = $val;
|
||||
if (!insert_record("course_categories", $cat)) {
|
||||
error("Could not insert the new category '$val'");
|
||||
} else {
|
||||
notify(get_string("categoryadded", "", $val));
|
||||
if ($key == "new") {
|
||||
if (!empty($val)) {
|
||||
if (get_records("course_categories", "name", $val)) {
|
||||
notify(get_string("categoryduplicate", "", $val));
|
||||
} else {
|
||||
$cat->name = $val;
|
||||
if (!insert_record("course_categories", $cat)) {
|
||||
error("Could not insert the new category '$val'");
|
||||
} else {
|
||||
notify(get_string("categoryadded", "", $val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$cat->id = substr($key,1);
|
||||
$cat->id = substr($key,1);
|
||||
$cat->name = $val;
|
||||
|
||||
if ($existingcats = get_records("course_categories", "name", $val)) {
|
||||
foreach($existingcats as $existingcat) {
|
||||
if ($existingcat->id != $cat->id) {
|
||||
notify(get_string("categoryduplicate", "", $val));
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!update_record("course_categories", $cat)) {
|
||||
error("Could not update the category '$val'");
|
||||
}
|
||||
|
||||
+6
-6
@@ -21,18 +21,18 @@
|
||||
|
||||
if (!$id) {
|
||||
print_header("$site->shortname: $strdeletecourse", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strdeletecourse");
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strdeletecourse");
|
||||
|
||||
if ($courses = get_courses()) {
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("CENTER");
|
||||
foreach ($courses as $course) {
|
||||
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname</A><BR>";
|
||||
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
|
||||
}
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
print_heading(get_string("nocoursesyet"));
|
||||
print_continue("$CFG->wwwroot/admin/");
|
||||
print_continue("../$CFG->admin/index.php");
|
||||
}
|
||||
print_footer();
|
||||
exit;
|
||||
@@ -46,10 +46,10 @@
|
||||
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
|
||||
$strdeletecoursecheck = get_string("deletecoursecheck");
|
||||
print_header("$site->shortname: $strdeletecheck", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
|
||||
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletecheck");
|
||||
|
||||
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname",
|
||||
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname ($course->shortname)",
|
||||
"delete.php?id=$course->id&delete=".md5($course->timemodified),
|
||||
"delete.php");
|
||||
exit;
|
||||
@@ -63,7 +63,7 @@
|
||||
$strdeletingcourse = get_string("deletingcourse", "", $course->shortname);
|
||||
|
||||
print_header("$site->shortname: $strdeletingcourse", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
|
||||
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletingcourse");
|
||||
|
||||
print_heading($strdeletingcourse);
|
||||
|
||||
+7
-7
@@ -2,14 +2,14 @@
|
||||
<table cellpadding=9 cellspacing=0 >
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("fullname") ?>:</td>
|
||||
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
|
||||
<td><input type="text" name="fullname" maxlength="254" size=50 value="<? p($form->fullname) ?>">
|
||||
<? helpbutton("coursefullname", get_string("fullname")) ?>
|
||||
<? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("shortname") ?>:</td>
|
||||
<td><input type="text" name="shortname" size=10 value="<? p($form->shortname) ?>">
|
||||
<td><input type="text" name="shortname" maxlength="15" size="10" value="<? p($form->shortname) ?>">
|
||||
<? helpbutton("courseshortname", get_string("shortname")) ?>
|
||||
<? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
|
||||
</td>
|
||||
@@ -105,28 +105,28 @@
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("wordforteacher") ?>:</td>
|
||||
<td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
|
||||
<td><input type="text" name="teacher" maxlength="100" size=25 value="<? p($form->teacher) ?>">
|
||||
(<? print_string("wordforteachereg") ?>)
|
||||
<? if (isset($err["teacher"])) formerr($err["teacher"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("wordforteachers") ?>:</td>
|
||||
<td><input type="text" name="teachers" size=25 value="<? p($form->teachers) ?>">
|
||||
<td><input type="text" name="teachers" maxlength="100" size=25 value="<? p($form->teachers) ?>">
|
||||
(<? print_string("wordforteacherseg") ?>)
|
||||
<? if (isset($err["teachers"])) formerr($err["teachers"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("wordforstudent") ?>:</td>
|
||||
<td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
|
||||
<td><input type="text" name="student" maxlength="100" size=25 value="<? p($form->student) ?>">
|
||||
(<? print_string("wordforstudenteg") ?>)
|
||||
<? if (isset($err["student"])) formerr($err["student"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("wordforstudents") ?>:</td>
|
||||
<td><input type="text" name="students" size=25 value="<? p($form->students) ?>">
|
||||
<td><input type="text" name="students" maxlength="100" size=25 value="<? p($form->students) ?>">
|
||||
(<? print_string("wordforstudentseg") ?>)
|
||||
<? if (isset($err["students"])) formerr($err["students"]); ?>
|
||||
</td>
|
||||
@@ -135,5 +135,5 @@
|
||||
<td></td>
|
||||
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
|
||||
</TABLE>
|
||||
<INPUT type="hidden" name="id" value="<?=$course->id ?>">
|
||||
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
|
||||
</FORM>
|
||||
|
||||
+54
-15
@@ -6,29 +6,32 @@
|
||||
|
||||
optional_variable($id, 0); // course id
|
||||
|
||||
require_login();
|
||||
|
||||
if ($id) {
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can edit the course!");
|
||||
}
|
||||
} else { // Admin is creating a new course
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only administrators can use this page");
|
||||
if (!iscreator()) {
|
||||
error("Only administrators and teachers can use this page");
|
||||
}
|
||||
|
||||
$course = NULL;
|
||||
}
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/admin/");
|
||||
redirect("$CFG->wwwroot/$CFG->admin/index.php");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if ($form = data_submitted()) {
|
||||
@@ -41,7 +44,7 @@
|
||||
|
||||
$form->timemodified = time();
|
||||
|
||||
if ($course) {
|
||||
if (!empty($course)) {
|
||||
if (update_record("course", $form)) {
|
||||
add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
|
||||
redirect("view.php?id=$course->id", get_string("changessaved"));
|
||||
@@ -51,14 +54,33 @@
|
||||
} else {
|
||||
$form->timecreated = time();
|
||||
|
||||
if ($newid = insert_record("course", $form)) { // Set up new course
|
||||
$section->course = $newid; // Create a default section.
|
||||
if ($newcourseid = insert_record("course", $form)) { // Set up new course
|
||||
$section = NULL;
|
||||
$section->course = $newcourseid; // Create a default section.
|
||||
$section->section = 0;
|
||||
$section->timemodified = time();
|
||||
$section->id = insert_record("course_sections", $section);
|
||||
|
||||
add_to_log($newid, "course", "new", "view.php?id=$newid", "");
|
||||
redirect("teacher.php?id=$newid", get_string("changessaved"));
|
||||
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "");
|
||||
|
||||
if (isadmin()) { // Redirect admin to add teachers
|
||||
redirect("../$CFG->admin/teacher.php?id=$newcourseid", get_string("changessaved"));
|
||||
|
||||
} else { // Add current teacher and send to course
|
||||
|
||||
$newteacher = NULL;
|
||||
$newteacher->userid = $USER->id;
|
||||
$newteacher->course = $newcourseid;
|
||||
$newteacher->authority = 1; // First teacher is the main teacher
|
||||
|
||||
if (!$newteacher->id = insert_record("user_teachers", $newteacher)) {
|
||||
error("Could not add you to this new course!");
|
||||
}
|
||||
|
||||
$USER->teacher[$newcourseid] = true;
|
||||
|
||||
redirect("view.php?id=$newcourseid", get_string("changessaved"));
|
||||
}
|
||||
|
||||
} else {
|
||||
error("Serious Error! Could not create the new course!");
|
||||
}
|
||||
@@ -75,7 +97,7 @@
|
||||
/// Otherwise fill and print the form.
|
||||
|
||||
if (empty($form)) {
|
||||
if ($course) {
|
||||
if (!empty($course)) {
|
||||
$form = $course;
|
||||
} else {
|
||||
$form->startdate = time() + 3600 * 24;
|
||||
@@ -87,10 +109,13 @@
|
||||
$form->students = get_string("defaultcoursestudents");
|
||||
$form->summary = get_string("defaultcoursesummary");
|
||||
$form->format = "weeks";
|
||||
$form->password = "";
|
||||
$form->guest = 0;
|
||||
$form->numsections = 10;
|
||||
$form->newsitems = 5;
|
||||
$form->showrecent = 1;
|
||||
$form->category = 1;
|
||||
$form->id = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,13 +135,13 @@
|
||||
$straddnewcourse = get_string("addnewcourse");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
if (isset($course)) {
|
||||
if (!empty($course)) {
|
||||
print_header($streditcoursesettings, "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
|
||||
-> $streditcoursesettings", $focus);
|
||||
} else {
|
||||
print_header("$site->shortname: $straddnewcourse", "$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A>
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A>
|
||||
-> $straddnewcourse", $focus);
|
||||
}
|
||||
|
||||
@@ -139,6 +164,20 @@ function validate_form($course, &$form, &$err) {
|
||||
if (empty($form->shortname))
|
||||
$err["shortname"] = get_string("missingshortname");
|
||||
|
||||
if ($foundcourses = get_records("course", "shortname", $form->shortname)) {
|
||||
if (!empty($course->id)) {
|
||||
unset($foundcourses[$course->id]);
|
||||
}
|
||||
if (!empty($foundcourses)) {
|
||||
foreach ($foundcourses as $foundcourse) {
|
||||
$foundcoursenames[] = $foundcourse->fullname;
|
||||
}
|
||||
$foundcoursenamestring = addslashes(implode(',', $foundcoursenames));
|
||||
|
||||
$err["shortname"] = get_string("shortnametaken", "", $foundcoursenamestring);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($form->summary))
|
||||
$err["summary"] = get_string("missingsummary");
|
||||
|
||||
|
||||
+26
-2
@@ -1,7 +1,26 @@
|
||||
<BLOCKQUOTE>
|
||||
<FORM name="form" method="post" action="editsection.php">
|
||||
<FORM name="theform" method="post" <?=$onsubmit ?> action="editsection.php">
|
||||
<TABLE BORDER=0 cellpadding=0 cellspacing=0>
|
||||
<TR>
|
||||
<TD align=top>
|
||||
<P><B><? print_string("summaryof", "", "$sectionname $form->section") ?></B></P>
|
||||
<TEXTAREA NAME=summary COLS=60 ROWS=4 WRAP=virtual><?=$form->summary ?></TEXTAREA>
|
||||
</TD>
|
||||
<TD align=top width=100>
|
||||
|
||||
</TD>
|
||||
<TD align=top>
|
||||
<FONT SIZE=-1>
|
||||
<? helpbutton("summaries", get_string("helpsummaries"), "moodle", true, true);
|
||||
if ($usehtmleditor) {
|
||||
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
|
||||
} else {
|
||||
helpbutton("text", get_string("helptext"), "moodle", true, true);
|
||||
}
|
||||
?>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR></TABLE>
|
||||
<? print_textarea($usehtmleditor, 4, 60, 595, 200, "summary", $form->summary); ?>
|
||||
<P>
|
||||
<INPUT type="hidden" name=id value="<?=$form->id ?>">
|
||||
<INPUT type="submit" value="<? print_string("savechanges") ?>">
|
||||
@@ -9,3 +28,8 @@
|
||||
</P>
|
||||
</FORM>
|
||||
</BLOCKQUOTE>
|
||||
<?
|
||||
if ($usehtmleditor) {
|
||||
print_richedit_javascript("theform", "summary", "no");
|
||||
}
|
||||
?>
|
||||
|
||||
+11
-3
@@ -6,6 +6,8 @@
|
||||
|
||||
require_variable($id); // Week ID
|
||||
|
||||
require_login();
|
||||
|
||||
if (! $section = get_record("course_sections", "id", $id)) {
|
||||
error("Course section is incorrect");
|
||||
}
|
||||
@@ -14,8 +16,6 @@
|
||||
error("Could not find the course!");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can edit this!");
|
||||
}
|
||||
@@ -43,10 +43,18 @@
|
||||
$form = $section;
|
||||
}
|
||||
|
||||
if ($usehtmleditor = can_use_richtext_editor()) {
|
||||
$onsubmit = "onsubmit=\"copyrichtext(theform.summary);\"";
|
||||
} else {
|
||||
$onsubmit = "";
|
||||
}
|
||||
|
||||
$sectionname = get_string("name$course->format");
|
||||
$stredit = get_string("edit", "", " $sectionname $section->section");
|
||||
|
||||
print_header($stredit, $stredit, "", "form.summary");
|
||||
print_header("$course->shortname: $stredit", "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
|
||||
-> $stredit", "form.summary");
|
||||
|
||||
include("editsection.html");
|
||||
|
||||
|
||||
+4
-6
@@ -4,9 +4,10 @@
|
||||
require_once("../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
require_login();
|
||||
require_variable($id);
|
||||
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id) ) {
|
||||
error("That's an invalid course id");
|
||||
}
|
||||
@@ -18,7 +19,8 @@
|
||||
if (isguest()) {
|
||||
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$REMOTE_ADDR, $REMOTE_HOST");
|
||||
|
||||
} else {
|
||||
} else if (!record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
|
||||
|
||||
if (! enrol_student($USER->id, $course->id)) {
|
||||
error("An error occurred while trying to enrol you.");
|
||||
}
|
||||
@@ -38,12 +40,10 @@
|
||||
}
|
||||
|
||||
$USER->student["$id"] = true;
|
||||
save_session("USER");
|
||||
|
||||
if ($SESSION->wantsurl) {
|
||||
$destination = $SESSION->wantsurl;
|
||||
unset($SESSION->wantsurl);
|
||||
save_session("SESSION");
|
||||
} else {
|
||||
$destination = "$CFG->wwwroot/course/view.php?id=$id";
|
||||
}
|
||||
@@ -72,12 +72,10 @@
|
||||
}
|
||||
|
||||
$USER->student["$id"] = true;
|
||||
save_session("USER");
|
||||
|
||||
if ($SESSION->wantsurl) {
|
||||
$destination = $SESSION->wantsurl;
|
||||
unset($SESSION->wantsurl);
|
||||
save_session("SESSION");
|
||||
} else {
|
||||
$destination = "$CFG->wwwroot/course/view.php?id=$id";
|
||||
}
|
||||
|
||||
+29
-27
@@ -40,35 +40,37 @@
|
||||
$sectionmods = explode(",", $section->sequence);
|
||||
foreach ($sectionmods as $sectionmod) {
|
||||
$mod = $mods[$sectionmod];
|
||||
$instance = get_record("$mod->modname", "id", "$mod->instance");
|
||||
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
|
||||
if (file_exists($libfile)) {
|
||||
require_once($libfile);
|
||||
$gradefunction = $mod->modname."_grades";
|
||||
if (function_exists($gradefunction)) { // Skip modules without grade function
|
||||
if ($modgrades = $gradefunction($mod->instance)) {
|
||||
if ($mod->visible) {
|
||||
$instance = get_record("$mod->modname", "id", "$mod->instance");
|
||||
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
|
||||
if (file_exists($libfile)) {
|
||||
require_once($libfile);
|
||||
$gradefunction = $mod->modname."_grades";
|
||||
if (function_exists($gradefunction)) { // Skip modules without grade function
|
||||
if ($modgrades = $gradefunction($mod->instance)) {
|
||||
|
||||
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
|
||||
" TITLE=\"$mod->modfullname\">".
|
||||
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
|
||||
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
|
||||
$columnhtml[] = "$image ".
|
||||
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
||||
"$instance->name".
|
||||
"</A>";
|
||||
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
|
||||
" TITLE=\"$mod->modfullname\">".
|
||||
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
|
||||
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
|
||||
$columnhtml[] = "$image ".
|
||||
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
||||
"$instance->name".
|
||||
"</A>";
|
||||
|
||||
if (empty($modgrades->grades[$USER->id])) {
|
||||
$grades[] = "";
|
||||
} else {
|
||||
$grades[] = $modgrades->grades[$USER->id];
|
||||
$totalgrade += (float)$modgrades->grades[$USER->id];
|
||||
}
|
||||
|
||||
if (empty($modgrades->grades[$USER->id])) {
|
||||
$grades[] = "";
|
||||
} else {
|
||||
$grades[] = $modgrades->grades[$USER->id];
|
||||
$totalgrade += (float)$modgrades->grades[$USER->id];
|
||||
}
|
||||
|
||||
if (empty($modgrades->maxgrade)) {
|
||||
$maxgrades[] = "";
|
||||
} else {
|
||||
$maxgrades[] = $modgrades->maxgrade;
|
||||
$totalmaxgrade += $modgrades->maxgrade;
|
||||
if (empty($modgrades->maxgrade)) {
|
||||
$maxgrades[] = "";
|
||||
} else {
|
||||
$maxgrades[] = $modgrades->maxgrade;
|
||||
$totalmaxgrade += $modgrades->maxgrade;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+45
-18
@@ -8,12 +8,12 @@
|
||||
require_variable($id); // course id
|
||||
optional_variable($download, ""); // to download data
|
||||
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can use this page!");
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/// Get a list of all students
|
||||
|
||||
if (!$students = get_course_students($course->id)) {
|
||||
if (!$students = get_course_students($course->id, "u.lastname ASC")) {
|
||||
print_header("$course->shortname: $strgrades", "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
|
||||
-> $strgrades");
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
foreach ($students as $student) {
|
||||
$grades[$student->id] = array(); // Collect all grades in this array
|
||||
$gradeshtml[$student->id] = array(); // Collect all grades html formatted in this array
|
||||
$totals[$student->id] = array(); // Collect all totals in this array
|
||||
}
|
||||
$columns = array(); // Accumulate column names in this array.
|
||||
@@ -64,26 +65,52 @@
|
||||
if (function_exists($gradefunction)) { // Skip modules without grade function
|
||||
if ($modgrades = $gradefunction($mod->instance)) {
|
||||
|
||||
if ($modgrades->maxgrade) {
|
||||
$maxgrade = "<BR>$strmax: $modgrades->maxgrade";
|
||||
if (!empty($modgrades->maxgrade)) {
|
||||
if ($mod->visible) {
|
||||
$maxgrade = "$strmax: $modgrades->maxgrade";
|
||||
$maxgradehtml = "<BR>$strmax: $modgrades->maxgrade";
|
||||
} else {
|
||||
$maxgrade = "$strmax: $modgrades->maxgrade";
|
||||
$maxgradehtml = "<BR><FONT class=\"dimmed_text\">$strmax: $modgrades->maxgrade</FONT>";
|
||||
}
|
||||
} else {
|
||||
$maxgrade = "";
|
||||
$maxgradehtml = "";
|
||||
}
|
||||
|
||||
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
|
||||
" TITLE=\"$mod->modfullname\">".
|
||||
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
|
||||
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
|
||||
$columnhtml[] = "$image ".
|
||||
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
||||
"$instance->name".
|
||||
"</A>$maxgrade";
|
||||
$columns[] = "$mod->modfullname: $instance->name - $modgrades->maxgrade";
|
||||
if ($mod->visible) {
|
||||
$columnhtml[] = "$image ".
|
||||
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
||||
"$instance->name".
|
||||
"</A>$maxgradehtml";
|
||||
} else {
|
||||
$columnhtml[] = "$image ".
|
||||
"<A CLASS=\"dimmed\" HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
||||
"$instance->name".
|
||||
"</A>$maxgradehtml";
|
||||
}
|
||||
$columns[] = "$mod->modfullname: $instance->name - $maxgrade";
|
||||
|
||||
foreach ($students as $student) {
|
||||
$grades[$student->id][] = $modgrades->grades[$student->id]; // may be empty, that's ok
|
||||
if ($modgrades->maxgrade) {
|
||||
$totals[$student->id] = (float)($totals[$student->id]) + (float)($modgrades->grades[$student->id]);
|
||||
if (!empty($modgrades->grades[$student->id])) {
|
||||
$grades[$student->id][] = $currentstudentgrade = $modgrades->grades[$student->id];
|
||||
if ($mod->visible) {
|
||||
$gradeshtml[$student->id][] = $modgrades->grades[$student->id];
|
||||
} else {
|
||||
$gradeshtml[$student->id][] = "<FONT class=\"dimmed_text\">".
|
||||
$modgrades->grades[$student->id].
|
||||
"</FONT>";
|
||||
}
|
||||
} else {
|
||||
$grades[$student->id][] = $currentstudentgrade = "";
|
||||
$gradeshtml[$student->id][] = "";
|
||||
}
|
||||
if (!empty($modgrades->maxgrade)) {
|
||||
$totals[$student->id] = (float)($totals[$student->id]) + (float)($currentstudentgrade);
|
||||
} else {
|
||||
$totals[$student->id] = (float)($totals[$student->id]) + 0;
|
||||
}
|
||||
@@ -175,9 +202,9 @@
|
||||
|
||||
print_heading($strgrades);
|
||||
|
||||
$table->head = array_merge(array ("", get_string("name")), $columnhtml, get_string("total"));
|
||||
$table->head = array_merge(array ("", get_string("firstname"), get_string("lastname")), $columnhtml, get_string("total"));
|
||||
$table->width = array(35, "");
|
||||
$table->align = array("LEFT", "LEFT");
|
||||
$table->align = array("LEFT", "RIGHT", "LEFT");
|
||||
foreach ($columns as $column) {
|
||||
$table->width[] = "";
|
||||
$table->align[] = "CENTER";
|
||||
@@ -185,10 +212,10 @@
|
||||
$table->width[] = "";
|
||||
$table->align[] = "CENTER";
|
||||
|
||||
foreach ($grades as $studentid => $studentgrades) {
|
||||
$student = $students[$studentid];
|
||||
foreach ($students as $key => $student) {
|
||||
$studentgrades = $gradeshtml[$student->id];
|
||||
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
|
||||
$name = array ("$picture", "<A TITLE=\"$stractivityreport\" HREF=\"user.php?id=$course->id&user=$student->id\">$student->firstname $student->lastname</A>");
|
||||
$name = array ("$picture", "$student->firstname", "$student->lastname");
|
||||
$total = array ($totals[$student->id]);
|
||||
|
||||
$table->data[] = array_merge($name, $studentgrades, $total);
|
||||
|
||||
+372
-184
@@ -2,13 +2,18 @@
|
||||
// Library of useful functions
|
||||
|
||||
|
||||
$COURSE_MAX_LOG_DISPLAY = 150; // days
|
||||
if (defined('COURSE_MAX_LOG_DISPLAY')) { // Being included again - should never happen!!
|
||||
return;
|
||||
}
|
||||
|
||||
$COURSE_MAX_LOGS_PER_PAGE = 1000; // records
|
||||
define('COURSE_MAX_LOG_DISPLAY', 150); // days
|
||||
|
||||
$COURSE_TEACHER_COLOR = "#990000"; // To hilight certain items that are teacher-only
|
||||
define('COURSE_MAX_LOGS_PER_PAGE', 1000); // records
|
||||
|
||||
define('COURSE_LIVELOG_REFRESH', 60); // Seconds
|
||||
|
||||
define('COURSE_MAX_RECENT_PERIOD', 604800); // A week, in seconds
|
||||
|
||||
$COURSE_LIVELOG_REFRESH = 60; // Seconds
|
||||
|
||||
|
||||
function print_log_selector_form($course, $selecteduser=0, $selecteddate="today") {
|
||||
@@ -42,6 +47,10 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
|
||||
asort($courses);
|
||||
}
|
||||
|
||||
|
||||
$strftimedate = get_string("strftimedate");
|
||||
$strftimedaydate = get_string("strftimedaydate");
|
||||
|
||||
asort($users);
|
||||
|
||||
// Get all the possible dates
|
||||
@@ -54,7 +63,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
|
||||
$timemidnight = $today = usergetmidnight($timenow);
|
||||
|
||||
// Put today up the top of the list
|
||||
$dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, "%d %B %Y") );
|
||||
$dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );
|
||||
|
||||
if (! $course->startdate) {
|
||||
$course->startdate = $course->timecreated;
|
||||
@@ -64,7 +73,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
|
||||
while ($timemidnight > $course->startdate and $numdates < 365) {
|
||||
$timemidnight = $timemidnight - 86400;
|
||||
$timenow = $timenow - 86400;
|
||||
$dates["$timemidnight"] = userdate($timenow, "%A, %d %B %Y");
|
||||
$dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
|
||||
$numdates++;
|
||||
}
|
||||
|
||||
@@ -109,7 +118,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
|
||||
// It is assumed that $date is the GMT time of midnight for that day,
|
||||
// and so the next 86400 seconds worth of logs are printed.
|
||||
|
||||
global $CFG, $COURSE_MAX_LOGS_PER_PAGE;
|
||||
global $CFG;
|
||||
|
||||
if ($course->category) {
|
||||
$selector = "WHERE l.course='$course->id' AND l.userid = u.id";
|
||||
@@ -132,6 +141,8 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
|
||||
$selector .= " AND l.time > '$date' AND l.time < '$enddate'";
|
||||
}
|
||||
|
||||
$order = $order." LIMIT ".COURSE_MAX_LOGS_PER_PAGE; // To keep it manageable
|
||||
|
||||
if (!$logs = get_logs($selector, $order)) {
|
||||
notify("No logs found!");
|
||||
print_footer($course);
|
||||
@@ -141,50 +152,45 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
|
||||
$count=0;
|
||||
$tt = getdate(time());
|
||||
$today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]);
|
||||
if (($totalcountlogs = count($logs)) > $COURSE_MAX_LOGS_PER_PAGE) {
|
||||
$totalcountlogs = "$COURSE_MAX_LOGS_PER_PAGE/$totalcountlogs";
|
||||
if (($totalcountlogs = count($logs)) == COURSE_MAX_LOGS_PER_PAGE) {
|
||||
$totalcountlogs = "$totalcountlogs (+)";
|
||||
}
|
||||
|
||||
echo "<P ALIGN=CENTER>";
|
||||
$strftimedatetime = get_string("strftimedatetime");
|
||||
|
||||
echo "<p align=center>";
|
||||
print_string("displayingrecords", "", $totalcountlogs);
|
||||
echo "</P>";
|
||||
echo "</p>";
|
||||
|
||||
$countlogs = 0;
|
||||
echo "<TABLE BORDER=0 ALIGN=center CELLPADDING=3 CELLSPACING=3>";
|
||||
echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
|
||||
foreach ($logs as $log) {
|
||||
|
||||
$countlogs++;
|
||||
|
||||
if ($countlogs > $COURSE_MAX_LOGS_PER_PAGE) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($ld = get_record("log_display", "module", "$log->module", "action", "$log->action")) {
|
||||
$log->info = get_field($ld->mtable, $ld->field, "id", $log->info);
|
||||
}
|
||||
|
||||
echo "<TR NOWRAP>";
|
||||
echo "<tr nowrap>";
|
||||
if (! $course->category) {
|
||||
echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"view.php?id=$log->course\">".$courses[$log->course]."</A></TD>";
|
||||
echo "<td nowrap><font size=2><a href=\"view.php?id=$log->course\">".$courses[$log->course]."</a></td>";
|
||||
}
|
||||
echo "<TD NOWRAP ALIGN=right><FONT SIZE=2>".userdate($log->time, "%A")."</TD>";
|
||||
echo "<TD NOWRAP><FONT SIZE=2>".userdate($log->time, "%d %B %Y, %I:%M %p")."</TD>";
|
||||
echo "<TD NOWRAP><FONT SIZE=2>";
|
||||
echo "<td nowrap align=right><font size=2>".userdate($log->time, "%a")."</td>";
|
||||
echo "<td nowrap><font size=2>".userdate($log->time, $strftimedatetime)."</td>";
|
||||
echo "<td nowrap><font size=2>";
|
||||
link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"../user/view.php?id=$log->userid&course=$log->course\"><B>$log->firstname $log->lastname</B></TD>";
|
||||
echo "<TD NOWRAP><FONT SIZE=2>";
|
||||
echo "</td>";
|
||||
echo "<td nowrap><font size=2><a href=\"../user/view.php?id=$log->userid&course=$log->course\"><b>$log->firstname $log->lastname</b></td>";
|
||||
echo "<td nowrap><font size=2>";
|
||||
link_to_popup_window( make_log_url($log->module,$log->url), "fromloglive","$log->module $log->action", 400, 600);
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP><FONT SIZE=2>$log->info</TD>";
|
||||
echo "</TR>";
|
||||
echo "</td>";
|
||||
echo "<td nowrap><font size=2>$log->info</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</TABLE>";
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
function print_all_courses($category="all", $style="full", $maxcount=999, $width=180) {
|
||||
global $CFG, $USER;
|
||||
global $CFG, $THEME, $USER;
|
||||
|
||||
if ($category == "all") {
|
||||
$courses = get_courses();
|
||||
@@ -206,16 +212,20 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width
|
||||
|
||||
if ($style == "minimal") {
|
||||
$count = 0;
|
||||
$icon = "<IMG SRC=\"pix/i/course.gif\" HEIGHT=16 WIDTH=16 ALT=\"".get_string("course")."\">";
|
||||
if (empty($THEME->custompix)) {
|
||||
$icon = "<img src=\"$CFG->wwwroot/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
|
||||
} else {
|
||||
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
|
||||
}
|
||||
if ($courses) {
|
||||
foreach ($courses as $course) {
|
||||
$moddata[]="<A TITLE=\"$course->shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
|
||||
$moddata[]="<a title=\"$course->shortname\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
|
||||
$modicon[]=$icon;
|
||||
if ($count++ >= $maxcount) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$fulllist = "<P><A HREF=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</A>...";
|
||||
$fulllist = "<p><a href=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</a>...";
|
||||
} else {
|
||||
$moddata = array();
|
||||
$modicon = array();
|
||||
@@ -226,23 +236,29 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width
|
||||
} else if ($courses) {
|
||||
foreach ($courses as $course) {
|
||||
print_course($course);
|
||||
echo "<BR>\n";
|
||||
echo "<br />\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "<P>".get_string("nocoursesyet")."</P>";
|
||||
echo "<p>".get_string("nocoursesyet")."</p>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function print_course($course) {
|
||||
|
||||
global $CFG;
|
||||
global $CFG, $THEME;
|
||||
|
||||
if (! $site = get_site()) {
|
||||
error("Could not find a site!");
|
||||
}
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "$CFG->wwwroot/pix";
|
||||
} else {
|
||||
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
|
||||
}
|
||||
|
||||
print_simple_box_start("CENTER", "100%");
|
||||
|
||||
echo "<TABLE WIDTH=100%>";
|
||||
@@ -265,12 +281,12 @@ function print_course($course) {
|
||||
if ($course->guest) {
|
||||
$strallowguests = get_string("allowguests");
|
||||
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A> ";
|
||||
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/user.gif\"></A> ";
|
||||
}
|
||||
if ($course->password) {
|
||||
$strrequireskey = get_string("requireskey");
|
||||
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
|
||||
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/key.gif\"></A>";
|
||||
}
|
||||
|
||||
|
||||
@@ -291,22 +307,24 @@ function print_recent_activity($course) {
|
||||
// This function trawls through the logs looking for
|
||||
// anything new since the user's last login
|
||||
|
||||
global $CFG, $USER, $COURSE_TEACHER_COLOR;
|
||||
global $CFG, $USER;
|
||||
|
||||
if (! $USER->lastlogin ) {
|
||||
echo "<P ALIGN=CENTER><FONT SIZE=1>";
|
||||
echo "<p align=center><font size=1>";
|
||||
print_string("welcometocourse", "", $course->shortname);
|
||||
echo "</FONT></P>";
|
||||
echo "</font></p>";
|
||||
return;
|
||||
} else {
|
||||
echo "<P ALIGN=CENTER><FONT SIZE=1>";
|
||||
echo "<p align=center><font size=1>";
|
||||
echo get_string("yourlastlogin").":<BR>";
|
||||
echo userdate($USER->lastlogin, "%A, %d %b %Y, %H:%M");
|
||||
echo "</FONT></P>";
|
||||
echo userdate($USER->lastlogin, get_string("strftimerecentfull"));
|
||||
echo "</font></p>";
|
||||
}
|
||||
|
||||
if (! $logs = get_records_select("log", "time > '$USER->lastlogin' AND course = '$course->id'", "time ASC")) {
|
||||
return;
|
||||
|
||||
$timestart = $USER->lastlogin;
|
||||
$timemaxrecent = time() - COURSE_MAX_RECENT_PERIOD;
|
||||
if ($timestart < $timemaxrecent) {
|
||||
$timestart = $timemaxrecent;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,8 +332,12 @@ function print_recent_activity($course) {
|
||||
|
||||
$heading = false;
|
||||
$content = false;
|
||||
foreach ($logs as $log) {
|
||||
if ($log->module == "course" and $log->action == "enrol") {
|
||||
|
||||
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND
|
||||
module = 'course' AND action = 'enrol'", "time ASC");
|
||||
|
||||
if ($logs) {
|
||||
foreach ($logs as $key => $log) {
|
||||
if (! $heading) {
|
||||
print_headline(get_string("newusers").":");
|
||||
$heading = true;
|
||||
@@ -323,23 +345,32 @@ function print_recent_activity($course) {
|
||||
}
|
||||
$user = get_record("user", "id", $log->info);
|
||||
if (isstudent($course->id, $user->id)) {
|
||||
echo "<P><FONT SIZE=1><A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A></FONT></P>";
|
||||
echo "<p><font size=1><a href=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</a></font></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Next, have there been any changes to the course structure?
|
||||
// Next, have there been any modifications to the course structure?
|
||||
|
||||
foreach ($logs as $log) {
|
||||
if ($log->module == "course") {
|
||||
if ($log->action == "add mod" or $log->action == "update mod" or $log->action == "delete mod") {
|
||||
$info = split(" ", $log->info);
|
||||
$modname = get_field($info[0], "name", "id", $info[1]);
|
||||
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND
|
||||
module = 'course' AND action LIKE '% mod'", "time ASC");
|
||||
|
||||
if ($logs) {
|
||||
foreach ($logs as $key => $log) {
|
||||
$info = split(" ", $log->info);
|
||||
$modname = get_field($info[0], "name", "id", $info[1]);
|
||||
//Create a temp valid module structure (course,id)
|
||||
$tempmod->course = $log->course;
|
||||
$tempmod->id = $info[1];
|
||||
//Obtain the visible property from the instance
|
||||
$modvisible = instance_is_visible($info[0],$tempmod);
|
||||
|
||||
//Only if the mod is visible
|
||||
if ($modvisible) {
|
||||
switch ($log->action) {
|
||||
case "add mod":
|
||||
$stradded = get_string("added", "moodle", get_string("modulename", $info[0]));
|
||||
$changelist["$log->info"] = array ("operation" => "add", "text" => "$stradded:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
|
||||
$stradded = get_string("added", "moodle", get_string("modulename", $info[0]));
|
||||
$changelist["$log->info"] = array ("operation" => "add", "text" => "$stradded:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
|
||||
break;
|
||||
case "update mod":
|
||||
$strupdated = get_string("updated", "moodle", get_string("modulename", $info[0]));
|
||||
@@ -348,7 +379,8 @@ function print_recent_activity($course) {
|
||||
}
|
||||
break;
|
||||
case "delete mod":
|
||||
if ($changelist["$log->info"]["operation"] == "add") {
|
||||
if (!empty($changelist["$log->info"]["operation"]) and
|
||||
$changelist["$log->info"]["operation"] == "add") {
|
||||
$changelist["$log->info"] = NULL;
|
||||
} else {
|
||||
$strdeleted = get_string("deletedactivity", "moodle", get_string("modulename", $info[0]));
|
||||
@@ -370,30 +402,30 @@ function print_recent_activity($course) {
|
||||
print_headline(get_string("courseupdates").":");
|
||||
$content = true;
|
||||
foreach ($changes as $changeinfo => $change) {
|
||||
echo "<P><FONT SIZE=1>".$change["text"]."</FONT></P>";
|
||||
echo "<p><font size=1>".$change["text"]."</font></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Now display new things from each module
|
||||
|
||||
$mods = get_list_of_plugins("mod");
|
||||
|
||||
foreach ($mods as $mod) {
|
||||
$isteacher = isteacher($course->id);
|
||||
|
||||
foreach ($mods as $mod) { // Each module gets it's own logs and prints them
|
||||
include_once("$CFG->dirroot/mod/$mod/lib.php");
|
||||
$print_recent_activity = $mod."_print_recent_activity";
|
||||
if (function_exists($print_recent_activity)) {
|
||||
$modcontent = $print_recent_activity($logs, isteacher($course->id));
|
||||
$modcontent = $print_recent_activity($course, $isteacher, $timestart);
|
||||
if ($modcontent) {
|
||||
$content = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $content) {
|
||||
echo "<FONT SIZE=2>".get_string("nothingnew")."</FONT>";
|
||||
echo "<font size=2>".get_string("nothingnew")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,6 +437,7 @@ function get_array_of_activities($courseid) {
|
||||
// mod - name of the module (eg forum)
|
||||
// section - the number of the section (eg week or topic)
|
||||
// name - the name of the instance
|
||||
// visible - is the instance visible or not
|
||||
|
||||
$mod = array();
|
||||
|
||||
@@ -414,13 +447,17 @@ function get_array_of_activities($courseid) {
|
||||
|
||||
if ($sections = get_records("course_sections", "course", $courseid, "section ASC")) {
|
||||
foreach ($sections as $section) {
|
||||
if ($section->sequence) {
|
||||
if (!empty($section->sequence)) {
|
||||
$sequence = explode(",", $section->sequence);
|
||||
foreach ($sequence as $seq) {
|
||||
if (empty($rawmods[$seq])) {
|
||||
continue;
|
||||
}
|
||||
$mod[$seq]->cm = $rawmods[$seq]->id;
|
||||
$mod[$seq]->mod = $rawmods[$seq]->modname;
|
||||
$mod[$seq]->section = $section->section;
|
||||
$mod[$seq]->name = urlencode(get_field($rawmods[$seq]->modname, "name", "id", $rawmods[$seq]->instance));
|
||||
$mod[$seq]->visible = $rawmods[$seq]->visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -441,8 +478,10 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
|
||||
|
||||
if ($allmods = get_records("modules")) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modnames[$mod->name] = get_string("modulename", "$mod->name");
|
||||
$modnamesplural[$mod->name] = get_string("modulenameplural", "$mod->name");
|
||||
if ($mod->visible) {
|
||||
$modnames[$mod->name] = get_string("modulename", "$mod->name");
|
||||
$modnamesplural[$mod->name] = get_string("modulenameplural", "$mod->name");
|
||||
}
|
||||
}
|
||||
asort($modnames);
|
||||
} else {
|
||||
@@ -453,9 +492,13 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
|
||||
foreach($rawmods as $mod) { // Index the mods
|
||||
$mods[$mod->id] = $mod;
|
||||
$mods[$mod->id]->modfullname = $modnames[$mod->modname];
|
||||
$modnamesused[$mod->modname] = $modnames[$mod->modname];
|
||||
if ($mod->visible or isteacher($courseid)) {
|
||||
$modnamesused[$mod->modname] = $modnames[$mod->modname];
|
||||
}
|
||||
}
|
||||
if ($modnamesused) {
|
||||
asort($modnamesused);
|
||||
}
|
||||
asort($modnamesused);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,9 +506,49 @@ function get_all_mods($courseid, &$mods, &$modnames, &$modnamesplural, &$modname
|
||||
function get_all_sections($courseid) {
|
||||
|
||||
return get_records("course_sections", "course", "$courseid", "section",
|
||||
"section, id, course, summary, sequence");
|
||||
"section, id, course, summary, sequence, visible");
|
||||
}
|
||||
|
||||
function course_set_display($courseid, $display=0) {
|
||||
global $USER;
|
||||
|
||||
if (empty($USER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($display == "all" or empty($display)) {
|
||||
$display = 0;
|
||||
}
|
||||
|
||||
if (record_exists("course_display", "userid", $USER->id, "course", $courseid)) {
|
||||
set_field("course_display", "display", $display, "userid", $USER->id, "course", $courseid);
|
||||
} else {
|
||||
$record->userid = $USER->id;
|
||||
$record->course = $courseid;
|
||||
$record->display = $display;
|
||||
if (!insert_record("course_display", $record)) {
|
||||
notify("Could not save your course display!");
|
||||
}
|
||||
}
|
||||
|
||||
return $USER->display[$courseid] = $display; // Note: = not ==
|
||||
}
|
||||
|
||||
function set_section_visible($courseid, $sectionnumber, $visibility) {
|
||||
/// For a given course section, markes it visible or hidden,
|
||||
/// and does the same for every activity in that section
|
||||
|
||||
if ($section = get_record("course_sections", "course", $courseid, "section", $sectionnumber)) {
|
||||
set_field("course_sections", "visible", "$visibility", "id", $section->id);
|
||||
if (!empty($section->sequence)) {
|
||||
$modules = explode(",", $section->sequence);
|
||||
foreach ($modules as $moduleid) {
|
||||
set_field("course_modules", "visible", "$visibility", "id", $moduleid);
|
||||
}
|
||||
}
|
||||
rebuild_course_cache($courseid);
|
||||
}
|
||||
}
|
||||
|
||||
function print_section_block($heading, $course, $section, $mods, $modnames, $modnamesused,
|
||||
$absolute=true, $width="100%", $isediting=false) {
|
||||
@@ -477,24 +560,31 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
|
||||
$modicon = array();
|
||||
$editbuttons = "";
|
||||
|
||||
if ($section->sequence) {
|
||||
if (!empty($section->sequence)) {
|
||||
|
||||
$sectionmods = explode(",", $section->sequence);
|
||||
|
||||
foreach ($sectionmods as $modnumber) {
|
||||
$mod = $mods[$modnumber];
|
||||
if ($isediting) {
|
||||
$editbuttons = make_editing_buttons($mod->id, $absolute);
|
||||
$editbuttons = make_editing_buttons($mod->id, $absolute, $mod->visible);
|
||||
}
|
||||
if ($mod->visible or isteacher($course->id)) {
|
||||
$instancename = urldecode($modinfo[$modnumber]->name);
|
||||
if ($mod->visible) {
|
||||
$link_css = "";
|
||||
} else {
|
||||
$link_css = " class=\"dimmed\" ";
|
||||
}
|
||||
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
|
||||
$moddata[] = "<a title=\"$mod->modfullname\" $link_css href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons";
|
||||
}
|
||||
$instancename = urldecode($modinfo[$modnumber]->name);
|
||||
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
|
||||
$moddata[] = "<a title=\"$mod->modfullname\" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a><BR>$editbuttons";
|
||||
}
|
||||
}
|
||||
if ($isediting) {
|
||||
$editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section->section&add=",
|
||||
$modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true);
|
||||
$editmenu = "<DIV ALIGN=right>$editmenu</DIV>";
|
||||
$editmenu = "<div align=right>$editmenu</div>";
|
||||
} else {
|
||||
$editmenu = "";
|
||||
}
|
||||
@@ -508,27 +598,61 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
|
||||
$modinfo = unserialize($course->modinfo);
|
||||
|
||||
echo "<TABLE WIDTH=\"$width\"><TR><TD>\n";
|
||||
if ($section->sequence) {
|
||||
echo "<table width=\"$width\"><tr><td>\n";
|
||||
if (!empty($section->sequence)) {
|
||||
|
||||
$sectionmods = explode(",", $section->sequence);
|
||||
|
||||
foreach ($sectionmods as $modnumber) {
|
||||
if (empty($mods[$modnumber])) {
|
||||
continue;
|
||||
}
|
||||
$mod = $mods[$modnumber];
|
||||
$instancename = urldecode($modinfo[$modnumber]->name);
|
||||
echo "<IMG SRC=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
|
||||
echo " <FONT SIZE=2><A TITLE=\"$mod->modfullname\"";
|
||||
echo " HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</A></FONT>";
|
||||
if ($mod->visible or isteacher($course->id)) {
|
||||
$instancename = urldecode($modinfo[$modnumber]->name);
|
||||
if ($mod->visible) {
|
||||
$link_css = "";
|
||||
} else {
|
||||
$link_css = " class=\"dimmed\" ";
|
||||
}
|
||||
echo "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" height=16 width=16 alt=\"$mod->modfullname\">";
|
||||
echo " <font size=2><a title=\"$mod->modfullname\" $link_css";
|
||||
echo " href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a></font>";
|
||||
}
|
||||
if (isediting($course->id)) {
|
||||
echo " ";
|
||||
echo make_editing_buttons($mod->id, $absolute);
|
||||
echo make_editing_buttons($mod->id, $absolute, $mod->visible);
|
||||
}
|
||||
if ($mod->visible or isteacher($course->id)) {
|
||||
echo "<br />\n";
|
||||
}
|
||||
echo "<BR>\n";
|
||||
}
|
||||
}
|
||||
echo "</TD></TR></TABLE><BR>\n\n";
|
||||
echo "</td></tr></table><br />\n\n";
|
||||
}
|
||||
|
||||
|
||||
function rebuild_course_cache($courseid=0) {
|
||||
// Rebuilds the cached list of course activities stored in the database
|
||||
// If a courseid is not specified, then all are rebuilt
|
||||
|
||||
if ($courseid) {
|
||||
$select = "id = '$courseid'";
|
||||
} else {
|
||||
$select = "";
|
||||
}
|
||||
|
||||
if ($courses = get_records_select("course", $select)) {
|
||||
foreach ($courses as $course) {
|
||||
$modinfo = serialize(get_array_of_activities($course->id));
|
||||
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
|
||||
notify("Could not cache module information for course '$course->fullname'!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function print_heading_block($heading, $width="100%", $class="headingblock") {
|
||||
global $THEME;
|
||||
|
||||
@@ -589,91 +713,120 @@ function print_side_block_start($heading="", $width=180, $class="sideblockmain")
|
||||
|
||||
function print_side_block_end() {
|
||||
echo "</td></tr>";
|
||||
echo "</table><br \>";
|
||||
echo "</table><br />";
|
||||
}
|
||||
|
||||
|
||||
function print_admin_links ($siteid, $width=180) {
|
||||
global $CFG;
|
||||
global $CFG, $THEME;
|
||||
|
||||
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/config.php\">".get_string("configvariables")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/site.php\">".get_string("sitesettings")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/theme/index.php\">".get_string("choosetheme")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/lang.php\">".get_string("checklanguage")."</A>";
|
||||
$modicon[]=$icon;
|
||||
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/$CFG->dbtype/frame.php\">".get_string("managedatabase")."</A>";
|
||||
$modicon[]=$icon;
|
||||
if (empty($THEME->custompix)) {
|
||||
$icon = "<img src=\"$CFG->wwwroot/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
|
||||
} else {
|
||||
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">".get_string("configvariables")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/site.php\">".get_string("sitesettings")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/theme/index.php\">".get_string("choosetheme")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/lang.php\">".get_string("checklanguage")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/modules.php\">".get_string("managemodules")."</a>";
|
||||
$modicon[]=$icon;
|
||||
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a>";
|
||||
$modicon[]=$icon;
|
||||
}
|
||||
$moddata[]="<hr>";
|
||||
$modicon[]="";
|
||||
}
|
||||
if (iscreator()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/edit.php\">".get_string("addnewcourse")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/teacher.php\">".get_string("assignteachers")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$fulladmin = "";
|
||||
}
|
||||
if (isadmin()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/categories.php\">".get_string("categories")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/delete.php\">".get_string("deletecourse")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<hr>";
|
||||
$modicon[]="";
|
||||
if($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".get_string("addnewuser")."</a>";
|
||||
$modicon[]=$icon;
|
||||
}
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/user.php\">".get_string("edituser")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/admin.php\">".get_string("assignadmins")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/creators.php\">".get_string("assigncreators")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/auth.php\">".get_string("authentication")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$fulladmin = "<p><a href=\"$CFG->wwwroot/$CFG->admin/\">".get_string("admin")."</a>...";
|
||||
}
|
||||
$moddata[]="<HR>";
|
||||
$modicon[]="";
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/edit.php\">".get_string("addnewcourse")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/categories.php\">".get_string("categories")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/teacher.php\">".get_string("assignteachers")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/delete.php\">".get_string("deletecourse")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<HR>";
|
||||
$modicon[]="";
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php?newuser=true\">".get_string("addnewuser")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php\">".get_string("edituser")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/admin.php\">".get_string("assignadmins")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/auth.php\">".get_string("authentication")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$fulladmin = "<P><A HREF=\"$CFG->wwwroot/admin/\">".get_string("admin")."</A>...";
|
||||
|
||||
print_side_block(get_string("administration"), "", $moddata, $modicon, $fulladmin, $width);
|
||||
|
||||
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1><BR>";
|
||||
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" width=\"$width\" height=1><br>";
|
||||
}
|
||||
|
||||
function print_course_admin_links($course, $width=180) {
|
||||
global $USER, $CFG;
|
||||
global $USER, $CFG, $THEME;
|
||||
|
||||
if (isguest()) {
|
||||
return true;
|
||||
}
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "$CFG->wwwroot/pix";
|
||||
$modpixpath = "$CFG->wwwroot/mod";
|
||||
} else {
|
||||
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
|
||||
$modpixpath = "$CFG->wwwroot/theme/$CFG->theme/pix/mod";
|
||||
}
|
||||
if (isteacher($course->id)) {
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$adminicon[]="<img src=\"$pixpath/i/edit.gif\" height=16 width=16 alt=\"\">";
|
||||
if (isediting($course->id)) {
|
||||
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
|
||||
$admindata[]="<a href=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</a>";
|
||||
} else {
|
||||
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
|
||||
$admindata[]="<a href=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</a>";
|
||||
}
|
||||
$admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"edit.php?id=$course->id\">".get_string("settings")."...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
|
||||
if (!$course->teachers) {
|
||||
$course->teachers = get_string("defaultcourseteachers");
|
||||
}
|
||||
$admindata[]="<A HREF=\"teachers.php?id=$course->id\">$course->teachers...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"teachers.php?id=$course->id\">$course->teachers...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
|
||||
|
||||
$admindata[]="<A HREF=\"grades.php?id=$course->id\">".get_string("grades")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"grades.php?id=$course->id\">".get_string("grades")."...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
|
||||
|
||||
$admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"log.php?id=$course->id\">".get_string("logs")."...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/log.gif\" height=16 width=16 alt=\"\">";
|
||||
|
||||
$admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\">";
|
||||
|
||||
$admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/resource/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</a>";
|
||||
$adminicon[]="<img src=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";
|
||||
|
||||
if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
|
||||
$admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</a>";
|
||||
$adminicon[]="<img src=\"$modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
|
||||
}
|
||||
} else {
|
||||
$admindata[]="<A HREF=\"grade.php?id=$course->id\">".get_string("grades")."...</A>";
|
||||
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
|
||||
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
|
||||
}
|
||||
|
||||
print_side_block(get_string("administration"), "", $admindata, $adminicon, "", $width);
|
||||
@@ -685,53 +838,59 @@ function print_course_categories($categories, $selected="none", $width=180) {
|
||||
$strallowguests = get_string("allowguests");
|
||||
$strrequireskey = get_string("requireskey");
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "$CFG->wwwroot/pix";
|
||||
} else {
|
||||
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
|
||||
}
|
||||
|
||||
if ($selected == "index") { // Print comprehensive index of categories with courses
|
||||
if ($courses = get_courses()) {
|
||||
if (isset($USER->id) and !isadmin()) {
|
||||
print_simple_box_start("CENTER", "100%", $THEME->cellheading);
|
||||
print_heading("<A HREF=\"course/index.php?category=my\">".get_string("mycourses")."</A>", "LEFT");
|
||||
print_heading("<a href=\"course/index.php?category=my\">".get_string("mycourses")."</a>", "left");
|
||||
$some = false;
|
||||
echo "<UL>";
|
||||
echo "<ul>";
|
||||
foreach ($courses as $key => $course) {
|
||||
if (isteacher($course->id) or isstudent($course->id)) {
|
||||
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
|
||||
echo "<BR>";
|
||||
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
|
||||
echo "<br />";
|
||||
$some = true;
|
||||
}
|
||||
}
|
||||
if (!$some) {
|
||||
print_string("nocoursesyet");
|
||||
}
|
||||
echo "</UL>";
|
||||
echo "</ul>";
|
||||
print_simple_box_end();
|
||||
print_spacer(8,1);
|
||||
}
|
||||
foreach ($categories as $category) {
|
||||
print_simple_box_start("CENTER", "100%");
|
||||
print_heading("<A HREF=\"course/index.php?category=$category->id\">$category->name</A>", "LEFT");
|
||||
print_heading("<a href=\"course/index.php?category=$category->id\">$category->name</a>", "left");
|
||||
$some = false;
|
||||
echo "<UL>";
|
||||
echo "<ul>";
|
||||
foreach ($courses as $key => $course) {
|
||||
if ($course->category == $category->id) {
|
||||
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
|
||||
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
|
||||
echo " ";
|
||||
unset($courses[$key]);
|
||||
if ($course->guest ) {
|
||||
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A>";
|
||||
echo "<a title=\"$strallowguests\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
|
||||
}
|
||||
if ($course->password) {
|
||||
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
|
||||
echo "<a title=\"$strrequireskey\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
|
||||
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
|
||||
}
|
||||
echo "<BR>";
|
||||
echo "<br />";
|
||||
$some = true;
|
||||
}
|
||||
}
|
||||
if (!$some) {
|
||||
print_string("nocoursesyet");
|
||||
}
|
||||
echo "</UL>";
|
||||
echo "</ul>";
|
||||
print_simple_box_end();
|
||||
print_spacer(8,1);
|
||||
}
|
||||
@@ -739,18 +898,20 @@ function print_course_categories($categories, $selected="none", $width=180) {
|
||||
|
||||
} else { // Print short list of categories only
|
||||
foreach ($categories as $cat) {
|
||||
$caticon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/course.gif\" HEIGHT=16 WIDTH=16>";
|
||||
$caticon[]="<img src=\"$pixpath/i/course.gif\" height=16 width=16>";
|
||||
if ($cat->id == $selected) {
|
||||
$catdata[]="$cat->name";
|
||||
} else {
|
||||
$catdata[]="<A HREF=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</A>";
|
||||
$catdata[]="<a href=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</a>";
|
||||
}
|
||||
}
|
||||
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</A>";
|
||||
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</a>";
|
||||
$caticon[] = "";
|
||||
if (isset($USER->id)) {
|
||||
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</A>";
|
||||
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</a>";
|
||||
$caticon[] = "";
|
||||
}
|
||||
print_side_block(get_string("categories"), "", $catdata, $caticon, $showall.$mine, $width);
|
||||
print_side_block(get_string("categories"), "", $catdata, $caticon, "", $width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,7 +941,7 @@ function add_mod_to_section($mod) {
|
||||
GLOBAL $db;
|
||||
|
||||
if ($section = get_record("course_sections", "course", "$mod->course", "section", "$mod->section")) {
|
||||
if ($section->sequence) {
|
||||
if (!empty($section->sequence)) {
|
||||
$newsequence = "$section->sequence,$mod->coursemodule";
|
||||
} else {
|
||||
$newsequence = "$mod->coursemodule";
|
||||
@@ -800,6 +961,14 @@ function add_mod_to_section($mod) {
|
||||
}
|
||||
}
|
||||
|
||||
function hide_course_module($mod) {
|
||||
return set_field("course_modules", "visible", 0, "id", $mod);
|
||||
}
|
||||
|
||||
function show_course_module($mod) {
|
||||
return set_field("course_modules", "visible", 1, "id", $mod);
|
||||
}
|
||||
|
||||
function delete_course_module($mod) {
|
||||
return set_field("course_modules", "deleted", 1, "id", $mod);
|
||||
}
|
||||
@@ -866,7 +1035,7 @@ function move_module($cm, $move) {
|
||||
error("Previous section ($prevsection->id) doesn't exist");
|
||||
}
|
||||
|
||||
if ($prevsection->sequence) {
|
||||
if (!empty($prevsection->sequence)) {
|
||||
$newsequence = "$prevsection->sequence,$cm->id";
|
||||
} else {
|
||||
$newsequence = "$cm->id";
|
||||
@@ -908,7 +1077,7 @@ function move_module($cm, $move) {
|
||||
if ($nextsection = get_record("course_sections", "course", "$thissection->course",
|
||||
"section", "$nextsectionnumber")) {
|
||||
|
||||
if ($nextsection->sequence) {
|
||||
if (!empty($nextsection->sequence)) {
|
||||
$newsequence = "$cm->id,$nextsection->sequence";
|
||||
} else {
|
||||
$newsequence = "$cm->id";
|
||||
@@ -947,27 +1116,46 @@ function move_module($cm, $move) {
|
||||
}
|
||||
}
|
||||
|
||||
function make_editing_buttons($moduleid, $absolute=false) {
|
||||
global $CFG;
|
||||
function make_editing_buttons($moduleid, $absolute=false, $visible=true, $str=NULL) {
|
||||
global $CFG, $THEME;
|
||||
|
||||
$delete = get_string("delete");
|
||||
$moveup = get_string("moveup");
|
||||
$movedown = get_string("movedown");
|
||||
$update = get_string("update");
|
||||
if (empty($str)) {
|
||||
$str->delete = get_string("delete");
|
||||
$str->moveup = get_string("moveup");
|
||||
$str->movedown = get_string("movedown");
|
||||
$str->update = get_string("update");
|
||||
$str->hide = get_string("hide");
|
||||
$str->show = get_string("show");
|
||||
}
|
||||
|
||||
if ($absolute) {
|
||||
$path = "$CFG->wwwroot/course/";
|
||||
$path = "$CFG->wwwroot/course";
|
||||
} else {
|
||||
$path = "";
|
||||
$path = ".";
|
||||
}
|
||||
return "<A TITLE=\"$delete\" HREF=\"".$path."mod.php?delete=$moduleid\"><IMG
|
||||
SRC=".$path."../pix/t/delete.gif BORDER=0></A>
|
||||
<A TITLE=\"$moveup\" HREF=\"".$path."mod.php?id=$moduleid&move=-1\"><IMG
|
||||
SRC=".$path."../pix/t/up.gif BORDER=0></A>
|
||||
<A TITLE=\"$movedown\" HREF=\"".$path."mod.php?id=$moduleid&move=1\"><IMG
|
||||
SRC=".$path."../pix/t/down.gif BORDER=0></A>
|
||||
<A TITLE=\"$update\" HREF=\"".$path."mod.php?update=$moduleid\"><IMG
|
||||
SRC=".$path."../pix/t/edit.gif BORDER=0></A>";
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "$path/../pix";
|
||||
} else {
|
||||
$pixpath = "$path/../theme/$CFG->theme/pix";
|
||||
}
|
||||
|
||||
if ($visible) {
|
||||
$hideshow = " <a title=\"$str->hide\" href=\"$path/mod.php?hide=$moduleid\"><img
|
||||
src=\"$pixpath/t/hide.gif\" hspace=2 height=11 width=11 border=0></a>";
|
||||
} else {
|
||||
$hideshow = " <a title=\"$str->show\" href=\"$path/mod.php?show=$moduleid\"><img
|
||||
src=\"$pixpath/t/show.gif\" hspace=2 height=11 width=11 border=0></a>";
|
||||
}
|
||||
|
||||
return "<a title=\"$str->delete\" href=\"$path/mod.php?delete=$moduleid\"><img
|
||||
src=\"$pixpath/t/delete.gif\" height=11 width=11 border=0></a>
|
||||
<a title=\"$str->moveup\" href=\"$path/mod.php?id=$moduleid&move=-1\"><img
|
||||
src=\"$pixpath/t/up.gif\" height=11 width=11 border=0></a>
|
||||
<a title=\"$str->movedown\" href=\"$path/mod.php?id=$moduleid&move=1\"><img
|
||||
src=\"$pixpath/t/down.gif\" height=11 width=11 border=0></a>
|
||||
<a title=\"$str->update\" href=\"$path/mod.php?update=$moduleid\"><img
|
||||
src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a> $hideshow";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
optional_variable($user, 0); // User to display
|
||||
optional_variable($date, 0); // Date to display
|
||||
|
||||
require_login($id);
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id) ) {
|
||||
error("That's an invalid course id");
|
||||
@@ -40,7 +40,7 @@
|
||||
$userinfo = "$u->firstname $u->lastname";
|
||||
}
|
||||
if ($date) {
|
||||
$dateinfo = userdate($date, "%A, %d %B %Y");
|
||||
$dateinfo = userdate($date, get_string("strftimedaydate"));
|
||||
}
|
||||
|
||||
if ($course->category) {
|
||||
@@ -49,7 +49,7 @@
|
||||
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
|
||||
} else {
|
||||
print_header("$course->shortname: $strlogs", "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> ->
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
|
||||
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
|
||||
} else {
|
||||
print_header("$course->shortname: $strlogs", "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> -> $strlogs", "");
|
||||
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strlogs", "");
|
||||
}
|
||||
|
||||
print_heading(get_string("chooselogs").":");
|
||||
|
||||
+3
-3
@@ -34,9 +34,9 @@
|
||||
switch ($type) {
|
||||
case "usercourse.png":
|
||||
|
||||
$COURSE_MAX_LOG_DISPLAY = $COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
|
||||
if ($timenow - $course->startdate > $COURSE_MAX_LOG_DISPLAY) {
|
||||
$course->startdate = $timenow - $COURSE_MAX_LOG_DISPLAY;
|
||||
$maxseconds = COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
|
||||
if ($timenow - $course->startdate > $maxseconds) {
|
||||
$course->startdate = $timenow - $maxseconds;
|
||||
}
|
||||
$timestart = $coursestart = usergetmidnight($course->startdate);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
$USER = get_user_info_from_db("id", $USER->realuser);
|
||||
$USER->loggedin = true;
|
||||
$USER->site = $CFG->wwwroot;
|
||||
save_session("USER");
|
||||
redirect($_SERVER["HTTP_REFERER"]);
|
||||
exit;
|
||||
}
|
||||
@@ -42,7 +41,6 @@
|
||||
$USER->loggedin = true;
|
||||
$USER->site = $CFG->wwwroot;
|
||||
$USER->realuser = $teacher_id;
|
||||
save_session("USER");
|
||||
|
||||
set_moodle_cookie($USER->username);
|
||||
$student_name = "$USER->firstname $USER->lastname";
|
||||
|
||||
+5
-3
@@ -4,7 +4,9 @@
|
||||
require_once("../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
require_login($id);
|
||||
require_variable($id);
|
||||
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id) ) {
|
||||
error("That's an invalid course id");
|
||||
@@ -15,10 +17,10 @@
|
||||
}
|
||||
|
||||
$strlivelogs = get_string("livelogs");
|
||||
$strupdatesevery = get_string("updatesevery", "moodle", $COURSE_LIVELOG_REFRESH);
|
||||
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
|
||||
|
||||
print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "",
|
||||
"<META HTTP-EQUIV='Refresh' CONTENT='$COURSE_LIVELOG_REFRESH; URL=loglive.php?id=$id'>");
|
||||
"<META HTTP-EQUIV='Refresh' CONTENT='".COURSE_LIVELOG_REFRESH."; URL=loglive.php?id=$id'>");
|
||||
|
||||
$user=0;
|
||||
$date=time() - 3600;
|
||||
|
||||
+80
-22
@@ -5,11 +5,12 @@
|
||||
require("../config.php");
|
||||
require("lib.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (isset($cancel)) {
|
||||
if (!empty($SESSION->returnpage)) {
|
||||
$return = $SESSION->returnpage;
|
||||
unset($SESSION->returnpage);
|
||||
save_session("SESSION");
|
||||
redirect($return);
|
||||
} else {
|
||||
redirect("view.php?id=$mod->course");
|
||||
@@ -22,13 +23,10 @@
|
||||
if (isset($SESSION->modform)) { // Variables are stored in the session
|
||||
$mod = $SESSION->modform;
|
||||
unset($SESSION->modform);
|
||||
save_session("SESSION");
|
||||
} else {
|
||||
$mod = (object)$_POST;
|
||||
}
|
||||
|
||||
require_login($mod->course);
|
||||
|
||||
if (!isteacher($mod->course)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
@@ -48,7 +46,9 @@
|
||||
if (! $updateinstancefunction($mod)) {
|
||||
error("Could not update the $mod->modulename");
|
||||
}
|
||||
add_to_log($mod->course, "course", "update mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
|
||||
add_to_log($mod->course, "course", "update mod",
|
||||
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
|
||||
"$mod->modulename $mod->instance");
|
||||
break;
|
||||
|
||||
case "add":
|
||||
@@ -67,7 +67,9 @@
|
||||
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
|
||||
error("Could not update the course module with the correct section");
|
||||
}
|
||||
add_to_log($mod->course, "course", "add mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
|
||||
add_to_log($mod->course, "course", "add mod",
|
||||
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
|
||||
"$mod->modulename $mod->instance");
|
||||
break;
|
||||
case "delete":
|
||||
if (! $deleteinstancefunction($mod->instance)) {
|
||||
@@ -79,22 +81,20 @@
|
||||
if (! delete_mod_from_section($mod->coursemodule, "$mod->section")) {
|
||||
notify("Could not delete the $mod->modulename from that section");
|
||||
}
|
||||
add_to_log($mod->course, "course", "delete mod", "view.php?id=$mod->course", "$mod->modulename $mod->instance");
|
||||
add_to_log($mod->course, "course", "delete mod",
|
||||
"view.php?id=$mod->course",
|
||||
"$mod->modulename $mod->instance");
|
||||
break;
|
||||
default:
|
||||
error("No mode defined");
|
||||
|
||||
}
|
||||
|
||||
$modinfo = serialize(get_array_of_activities($mod->course));
|
||||
if (!set_field("course", "modinfo", $modinfo, "id", $mod->course)) {
|
||||
error("Could not cache module information!");
|
||||
}
|
||||
rebuild_course_cache($mod->course);
|
||||
|
||||
if (!empty($SESSION->returnpage)) {
|
||||
$return = $SESSION->returnpage;
|
||||
unset($SESSION->returnpage);
|
||||
save_session("SESSION");
|
||||
redirect($return);
|
||||
} else {
|
||||
redirect("view.php?id=$mod->course");
|
||||
@@ -110,15 +110,75 @@
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("This course module doesn't exist");
|
||||
}
|
||||
|
||||
if (!isteacher($cm->course)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
|
||||
move_module($cm, $move);
|
||||
|
||||
$modinfo = serialize(get_array_of_activities($cm->course));
|
||||
if (!set_field("course", "modinfo", $modinfo, "id", $cm->course)) {
|
||||
error("Could not cache module information!");
|
||||
rebuild_course_cache($cm->course);
|
||||
|
||||
$site = get_site();
|
||||
if ($site->id == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect("view.php?id=$cm->course");
|
||||
}
|
||||
exit;
|
||||
|
||||
} else if (isset($hide)) {
|
||||
|
||||
if (! $cm = get_record("course_modules", "id", $hide)) {
|
||||
error("This course module doesn't exist");
|
||||
}
|
||||
|
||||
redirect($_SERVER["HTTP_REFERER"]);
|
||||
if (!isteacher($cm->course)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
|
||||
hide_course_module($cm->id);
|
||||
|
||||
rebuild_course_cache($cm->course);
|
||||
|
||||
$site = get_site();
|
||||
if ($site->id == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect("view.php?id=$cm->course");
|
||||
}
|
||||
exit;
|
||||
|
||||
} else if (isset($show)) {
|
||||
|
||||
if (! $cm = get_record("course_modules", "id", $show)) {
|
||||
error("This course module doesn't exist");
|
||||
}
|
||||
|
||||
if (!isteacher($cm->course)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
|
||||
if (! $section = get_record("course_sections", "id", $cm->section)) {
|
||||
error("This module doesn't exist");
|
||||
}
|
||||
|
||||
if (! $module = get_record("modules", "id", $cm->module)) {
|
||||
error("This module doesn't exist");
|
||||
}
|
||||
|
||||
$site = get_site();
|
||||
|
||||
if ($module->visible and ($section->visible or ($site->id == $cm->course))) {
|
||||
show_course_module($cm->id);
|
||||
rebuild_course_cache($cm->course);
|
||||
}
|
||||
|
||||
if ($site->id == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect("view.php?id=$cm->course");
|
||||
}
|
||||
exit;
|
||||
|
||||
} else if (isset($delete)) { // value = course module
|
||||
@@ -131,8 +191,6 @@
|
||||
error("This course doesn't exist");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
@@ -178,6 +236,10 @@
|
||||
error("This course doesn't exist");
|
||||
}
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
|
||||
if (! $module = get_record("modules", "id", $cm->module)) {
|
||||
error("This module doesn't exist");
|
||||
}
|
||||
@@ -192,7 +254,6 @@
|
||||
|
||||
if (isset($return)) {
|
||||
$SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
|
||||
save_session("SESSION");
|
||||
}
|
||||
|
||||
$form->coursemodule = $cm->id;
|
||||
@@ -256,8 +317,6 @@
|
||||
error("No action was specfied");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("You can't modify this course!");
|
||||
}
|
||||
@@ -276,7 +335,6 @@
|
||||
}
|
||||
|
||||
unset($SESSION->modform); // Clear any old ones that may be hanging around.
|
||||
save_session("SESSION");
|
||||
|
||||
$modform = "../mod/$module->name/mod.html";
|
||||
|
||||
|
||||
+23
-19
@@ -1,4 +1,4 @@
|
||||
<? // $Id$
|
||||
<?php // $Id$
|
||||
// social.php - course format featuring social forum
|
||||
// included from view.php
|
||||
|
||||
@@ -8,20 +8,20 @@
|
||||
$leftwidth = 210;
|
||||
?>
|
||||
|
||||
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
|
||||
<TR>
|
||||
<TD WIDTH="<?=$leftwidth?>" VALIGN="TOP">
|
||||
<?
|
||||
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
|
||||
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
|
||||
<table width="100%" border="0" cellspacing="5" cellpadding="5">
|
||||
<tr>
|
||||
<td width="<?php echo $leftwidth?>" valign="top">
|
||||
<?php
|
||||
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
|
||||
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
|
||||
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".
|
||||
get_string("editmyprofile")."</A>";
|
||||
if ($USER->description) {
|
||||
$moddata[]= $editmyprofile;
|
||||
} else {
|
||||
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
|
||||
$moddata[]= $editmyprofile." <blink>*</blink>";
|
||||
}
|
||||
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
|
||||
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
|
||||
|
||||
|
||||
@@ -42,32 +42,36 @@
|
||||
|
||||
/// Print a form to search forums
|
||||
$searchform = forum_print_search_form($course, "", true);
|
||||
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
|
||||
$searchform = "<div align=\"center\">$searchform</div>";
|
||||
print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
|
||||
|
||||
/// Admin links and controls
|
||||
print_course_admin_links($course);
|
||||
|
||||
echo "</TD>";
|
||||
echo "</td>";
|
||||
|
||||
echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
|
||||
echo "<td width=\"*\" valign=\"top\">";
|
||||
if ($social = forum_get_course_forum($course->id, "social")) {
|
||||
if (forum_is_subscribed($USER->id, $social->id)) {
|
||||
$subtext = get_string("unsubscribe", "forum");
|
||||
} else {
|
||||
$subtext = get_string("subscribe", "forum");
|
||||
}
|
||||
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
|
||||
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".
|
||||
get_string("socialheadline").
|
||||
"</td><td align=right><font size=1>".
|
||||
"<a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td>".
|
||||
"</tr></table>";
|
||||
print_heading_block($headertext);
|
||||
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
|
||||
echo "<img alt=\"\" height=7 src=\"../pix/spacer.gif\"><br>";
|
||||
|
||||
forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
|
||||
forum_print_latest_discussions($social->id, 10, "plain", "", false);
|
||||
|
||||
} else {
|
||||
notify("Could not find or create a social forum here");
|
||||
}
|
||||
?>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
<?PHP // $Id$
|
||||
// Admin-only script to assign teachers to courses
|
||||
|
||||
require_once("../config.php");
|
||||
require_once("../user/lib.php");
|
||||
|
||||
optional_variable($id); // course id
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/admin/");
|
||||
}
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("You must be an administrator to use this page.");
|
||||
}
|
||||
|
||||
$strassignteachers = get_string("assignteachers");
|
||||
$stradministration = get_string("administration");
|
||||
$strexistingteachers = get_string("existingteachers");
|
||||
$strnoexistingteachers = get_string("noexistingteachers");
|
||||
$strpotentialteachers = get_string("potentialteachers");
|
||||
$strnopotentialteachers = get_string("nopotentialteachers");
|
||||
$straddteacher = get_string("addteacher");
|
||||
$strremoveteacher = get_string("removeteacher");
|
||||
$strsearch = get_string("search");
|
||||
$strsearchagain = get_string("searchagain");
|
||||
$strtoomanytoshow = get_string("toomanytoshow");
|
||||
|
||||
if (!$id) {
|
||||
print_header("$site->shortname: $strassignteachers", "$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strassignteachers");
|
||||
|
||||
if ($courses = get_courses()) {
|
||||
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("CENTER");
|
||||
foreach ($courses as $course) {
|
||||
echo "<A HREF=\"teacher.php?id=$course->id\">$course->fullname</A><BR>";
|
||||
}
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
print_heading(get_string("nocoursesyet"));
|
||||
print_continue("$CFG->wwwroot/admin/");
|
||||
}
|
||||
print_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect (can't find it)");
|
||||
}
|
||||
|
||||
|
||||
print_header("$site->shortname: $course->shortname: $strassignteachers",
|
||||
"$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
<A HREF=\"teacher.php\">$strassignteachers</A> ->
|
||||
$course->shortname", "");
|
||||
print_heading("<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>");
|
||||
|
||||
|
||||
/// Get all existing teachers for this course.
|
||||
$teachers = get_course_teachers($course->id);
|
||||
|
||||
/// Add a teacher if one is specified
|
||||
|
||||
if (!empty($add)) {
|
||||
if (! $user = get_record("user", "id", $add)) {
|
||||
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
|
||||
}
|
||||
|
||||
if (!empty($teachers)) {
|
||||
foreach ($teachers as $tt) {
|
||||
if ($tt->id == $user->id) {
|
||||
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$teacher->userid = $user->id;
|
||||
$teacher->course = $course->id;
|
||||
if (!empty($teachers)) {
|
||||
$teacher->authority = 2;
|
||||
} else {
|
||||
$teacher->authority = 1; // First teacher is the main teacher
|
||||
}
|
||||
$teacher->id = insert_record("user_teachers", $teacher);
|
||||
if (empty($teacher->id)) {
|
||||
error("Could not add that teacher to this course!");
|
||||
}
|
||||
$teachers[] = $user;
|
||||
}
|
||||
|
||||
/// Remove a teacher if one is specified.
|
||||
|
||||
if (!empty($remove)) {
|
||||
if (! $user = get_record("user", "id", $remove)) {
|
||||
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
|
||||
}
|
||||
if (!empty($teachers)) {
|
||||
foreach ($teachers as $key => $tt) {
|
||||
if ($tt->id == $user->id) {
|
||||
remove_teacher($user->id, $course->id);
|
||||
unset($teachers[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Print the lists of existing and potential teachers
|
||||
|
||||
echo "<TABLE CELLPADDING=2 CELLSPACING=10 ALIGN=CENTER>";
|
||||
echo "<TR><TH WIDTH=50%>$strexistingteachers</TH><TH WIDTH=50%>$strpotentialteachers</TH></TR>";
|
||||
echo "<TR><TD WIDTH=50% NOWRAP VALIGN=TOP>";
|
||||
|
||||
/// First, show existing teachers for this course
|
||||
|
||||
if (empty($teachers)) {
|
||||
echo "<P ALIGN=CENTER>$strnoexistingteachers</A>";
|
||||
|
||||
} else {
|
||||
foreach ($teachers as $teacher) {
|
||||
echo "<P ALIGN=right>$teacher->firstname $teacher->lastname, $teacher->email <A HREF=\"teacher.php?id=$course->id&remove=$teacher->id\" TITLE=\"$strremoveteacher\"><IMG SRC=\"../pix/t/right.gif\" BORDER=0></A></P>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<TD WIDTH=50% NOWRAP VALIGN=TOP>";
|
||||
|
||||
/// Print list of potential teachers
|
||||
|
||||
if (!empty($search)) {
|
||||
$users = get_users_search($search);
|
||||
|
||||
} else {
|
||||
$users = get_users_confirmed();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($users)) {
|
||||
foreach ($users as $user) { // Remove users who are already teachers
|
||||
if (!empty($teachers)) {
|
||||
foreach ($teachers as $teacher) {
|
||||
if ($teacher->id == $user->id) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
$potential[] = $user;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($potential)) {
|
||||
echo "<P ALIGN=CENTER>$strnopotentialteachers</A>";
|
||||
if ($search) {
|
||||
echo "<FORM ACTION=teacher.php METHOD=GET>";
|
||||
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
|
||||
echo "<INPUT TYPE=text NAME=search SIZE=20>";
|
||||
echo "<INPUT TYPE=submit VALUE=\"$strsearchagain\">";
|
||||
echo "</FORM>";
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!empty($search)) {
|
||||
echo "<P ALIGN=CENTER>($strsearchresults)</P>";
|
||||
}
|
||||
if (count($potential) <= 20) {
|
||||
foreach ($potential as $user) {
|
||||
echo "<P ALIGN=LEFT><A HREF=\"teacher.php?id=$course->id&add=$user->id\" TITLE=\"$straddteacher\"><IMG SRC=\"../pix/t/left.gif\" BORDER=0></A> $user->firstname $user->lastname, $user->email";
|
||||
}
|
||||
} else {
|
||||
echo "<P ALIGN=CENTER>There are too many users to show.<BR>";
|
||||
echo "Enter a search word here.";
|
||||
echo "<FORM ACTION=teacher.php METHOD=GET>";
|
||||
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
|
||||
echo "<INPUT TYPE=text NAME=search SIZE=20>";
|
||||
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
|
||||
echo "</FORM>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</TR></TABLE>";
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
+2
-2
@@ -6,12 +6,12 @@
|
||||
|
||||
require_variable($id); // course id
|
||||
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID was incorrect");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can edit the course!");
|
||||
}
|
||||
|
||||
+125
-85
@@ -9,12 +9,13 @@
|
||||
require_once("$CFG->dirroot/mod/forum/lib.php");
|
||||
|
||||
if (isset($topic)) {
|
||||
if ($topic == "all") {
|
||||
unset($USER->topic);
|
||||
$displaysection = course_set_display($course->id, $topic);
|
||||
} else {
|
||||
if (isset($USER->display[$course->id])) { // for admins, mostly
|
||||
$displaysection = $USER->display[$course->id];
|
||||
} else {
|
||||
$USER->topic = $topic;
|
||||
$displaysection = course_set_display($course->id, 0);
|
||||
}
|
||||
save_session("USER");
|
||||
}
|
||||
|
||||
if (isteacher($course->id) and isset($marker)) {
|
||||
@@ -31,25 +32,33 @@
|
||||
$streditsummary = get_string("editsummary");
|
||||
$stradd = get_string("add");
|
||||
$stractivities = get_string("activities");
|
||||
$strshowalltopics = get_string("showalltopics");
|
||||
if (isediting($course->id)) {
|
||||
$strstudents = moodle_strtolower($course->students);
|
||||
$strtopichide = get_string("topichide", "", $strstudents);
|
||||
$strtopicshow = get_string("topicshow", "", $strstudents);
|
||||
$strmarkthistopic = get_string("markthistopic");
|
||||
$strmarkedthistopic = get_string("markedthistopic");
|
||||
}
|
||||
|
||||
|
||||
/// Layout the whole page as three big columns.
|
||||
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
|
||||
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
|
||||
|
||||
/// The left column ...
|
||||
|
||||
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
|
||||
echo "<tr valign=top><td valign=top width=180>";
|
||||
|
||||
/// Links to people
|
||||
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
|
||||
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
|
||||
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
|
||||
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
|
||||
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
|
||||
if ($USER->description) {
|
||||
$moddata[]= $editmyprofile;
|
||||
} else {
|
||||
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
|
||||
$moddata[]= $editmyprofile." <blink>*</blink>";
|
||||
}
|
||||
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
|
||||
print_side_block(get_string("people"), "", $moddata, $modicon);
|
||||
|
||||
|
||||
@@ -58,22 +67,22 @@
|
||||
$modicon = array();
|
||||
if ($modnamesused) {
|
||||
foreach ($modnamesused as $modname => $modfullname) {
|
||||
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
|
||||
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
|
||||
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
|
||||
}
|
||||
}
|
||||
print_side_block($stractivities, "", $moddata, $modicon);
|
||||
|
||||
/// Print a form to search forums
|
||||
$searchform = forum_print_search_form($course, "", true);
|
||||
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
|
||||
$searchform = "<div align=\"center\">$searchform</div>";
|
||||
print_side_block(get_string("search","forum"), $searchform);
|
||||
|
||||
/// Admin links and controls
|
||||
print_course_admin_links($course);
|
||||
|
||||
/// Start main column
|
||||
echo "</TD><TD WIDTH=\"*\">";
|
||||
echo "</td><td width=\"*\">";
|
||||
|
||||
print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock");
|
||||
print_spacer(8, 1, true);
|
||||
@@ -82,36 +91,35 @@
|
||||
|
||||
/// Print Section 0
|
||||
|
||||
$topic = 0;
|
||||
$thistopic = $sections[$topic];
|
||||
$section = 0;
|
||||
$thissection = $sections[$section];
|
||||
|
||||
if ($thistopic->summary or $thistopic->sequence or isediting($course->id)) {
|
||||
echo "<TR>";
|
||||
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top WIDTH=20> </TD>";
|
||||
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" WIDTH=\"100%\">";
|
||||
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
|
||||
echo "<tr>";
|
||||
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20> </td>";
|
||||
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
|
||||
|
||||
if (isediting($course->id)) {
|
||||
$thistopic->summary .= " <A TITLE=\"$streditsummary\" ".
|
||||
"HREF=\"editsection.php?id=$thistopic->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
|
||||
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
|
||||
$thissection->summary .= " <a title=\"$streditsummary\" ".
|
||||
"href=\"editsection.php?id=$thissection->id\"><img src=\"$pixpath/t/edit.gif\" ".
|
||||
"height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
|
||||
}
|
||||
|
||||
echo text_to_html($thistopic->summary);
|
||||
echo text_to_html($thissection->summary);
|
||||
|
||||
print_section($course, $thistopic, $mods, $modnamesused);
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<DIV ALIGN=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$topic&add=",
|
||||
$modnames, "section$topic", "", "$stradd...", "mods", $stractivities);
|
||||
echo "</DIV>";
|
||||
echo "<div align=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
|
||||
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10> ";
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
|
||||
echo "</td>";
|
||||
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>";
|
||||
echo " </td></tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@@ -123,16 +131,31 @@
|
||||
|
||||
while ($section <= $course->numsections) {
|
||||
|
||||
if (isset($USER->topic)) { // Just display a single topic
|
||||
if ($USER->topic != $section) {
|
||||
$section++;
|
||||
continue;
|
||||
if (!empty($displaysection) and $displaysection != $section) {
|
||||
$section++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($sections[$section])) {
|
||||
$thissection = $sections[$section];
|
||||
|
||||
} else {
|
||||
unset($thissection);
|
||||
$thissection->course = $course->id; // Create a new section structure
|
||||
$thissection->section = $section;
|
||||
$thissection->summary = "";
|
||||
$thissection->visible = 1;
|
||||
if (!$thissection->id = insert_record("course_sections", $thissection)) {
|
||||
notify("Error inserting new topic!");
|
||||
}
|
||||
}
|
||||
|
||||
$currenttopic = ($course->marker == $section);
|
||||
|
||||
if ($currenttopic) {
|
||||
if (!$thissection->visible) {
|
||||
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"topicsoutlinesidehidden\"";
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthidden\"";
|
||||
} else if ($currenttopic) {
|
||||
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"topicsoutlinesidehighlight\"";
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthighlight\"";
|
||||
} else {
|
||||
@@ -140,70 +163,87 @@
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\"";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
|
||||
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$section</B></FONT></P>";
|
||||
echo "</TD>";
|
||||
echo "<tr>";
|
||||
echo "<td nowrap $colorsides valign=top width=20>";
|
||||
echo "<p align=center><font size=3><b>$section</b></font></p>";
|
||||
echo "</td>";
|
||||
|
||||
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
|
||||
echo "<td valign=top align=center $colormain width=\"100%\">";
|
||||
echo get_string("notavailable");
|
||||
echo "</td>";
|
||||
|
||||
echo "<TD VALIGN=top $colormain WIDTH=\"100%\">";
|
||||
} else {
|
||||
echo "<td valign=top $colormain width=\"100%\">";
|
||||
|
||||
if (! $thissection = $sections[$section]) {
|
||||
$thissection->course = $course->id; // Create a new section structure
|
||||
$thissection->section = $section;
|
||||
$thissection->summary = "";
|
||||
if (!$thissection->id = insert_record("course_sections", $thissection)) {
|
||||
notify("Error inserting new topic!");
|
||||
if (isediting($course->id)) {
|
||||
$thissection->summary .= " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
|
||||
"<img src=\"$pixpath/t/edit.gif\" border=0 height=11 width=11></a>";
|
||||
}
|
||||
|
||||
echo text_to_html($thissection->summary);
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<div align=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
|
||||
$modnames, "section$section", "", "$stradd...");
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<td nowrap $colorsides valign=top align=center width=10>";
|
||||
echo "<font size=1>";
|
||||
|
||||
if (isediting($course->id)) {
|
||||
$thissection->summary .= " <A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A>";
|
||||
}
|
||||
|
||||
echo text_to_html($thissection->summary);
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<DIV ALIGN=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
|
||||
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
|
||||
echo "</DIV>";
|
||||
}
|
||||
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
|
||||
echo "<FONT SIZE=1>";
|
||||
if (isset($USER->topic)) {
|
||||
$strshowalltopics = get_string("showalltopics");
|
||||
echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"$strshowalltopics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
|
||||
if ($displaysection == $section) { // Show the zoom boxes
|
||||
echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
|
||||
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
|
||||
} else {
|
||||
$strshowonlytopic = get_string("showonlytopic", "", $section);
|
||||
echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"$strshowonlytopic\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
|
||||
echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
|
||||
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
|
||||
}
|
||||
if (isediting($course->id) and $course->marker != $section) {
|
||||
$strmarkthistopic = get_string("markthistopic");
|
||||
echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"$strmarkthistopic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
|
||||
|
||||
if (isediting($course->id)) {
|
||||
if ($course->marker == $section) { // Show the "light globe" on/off
|
||||
echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
|
||||
"<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
} else {
|
||||
echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
|
||||
"<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
}
|
||||
|
||||
if ($thissection->visible) { // Show the hide/show eye
|
||||
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
|
||||
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
} else {
|
||||
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
|
||||
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
}
|
||||
|
||||
}
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
|
||||
$section++;
|
||||
}
|
||||
echo "</TABLE>";
|
||||
echo "</table>";
|
||||
|
||||
|
||||
if ($news or $course->showrecent) {
|
||||
echo "</TD><TD WIDTH=210>";
|
||||
echo "</td><td width=210>";
|
||||
|
||||
/// Print all the news items.
|
||||
|
||||
if ($news) {
|
||||
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
|
||||
echo "<FONT SIZE=\"-2\">";
|
||||
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
|
||||
echo "</FONT>";
|
||||
echo "<font size=\"-2\">";
|
||||
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
|
||||
echo "</font>";
|
||||
print_side_block_end();
|
||||
}
|
||||
|
||||
@@ -217,6 +257,6 @@
|
||||
print_spacer(1, 120, true);
|
||||
}
|
||||
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</td></tr></table>\n";
|
||||
|
||||
?>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
if ($user->id == $USER->id) {
|
||||
unset($USER->student["$id"]);
|
||||
save_session("USER");
|
||||
redirect("$CFG->wwwroot");
|
||||
}
|
||||
|
||||
|
||||
+16
-13
@@ -5,27 +5,26 @@
|
||||
require_once("../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
$modes = array("outline", "complete", "todaylogs", "alllogs");
|
||||
|
||||
require_variable($id); // course id
|
||||
require_variable($user); // user id
|
||||
optional_variable($mode, "outline");
|
||||
|
||||
$modes = array("outline", "complete", "todaylogs", "alllogs");
|
||||
require_login();
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course id is incorrect.");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
if (!isteacher($course->id)) {
|
||||
error("You are not allowed to look at this page");
|
||||
}
|
||||
|
||||
if (! $user = get_record("user", "id", $user)) {
|
||||
error("User ID is incorrect");
|
||||
}
|
||||
|
||||
if (!isteacher($course->id) and $user->id != $USER->id ) {
|
||||
error("You are not allowed to look at this page");
|
||||
}
|
||||
|
||||
|
||||
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
|
||||
|
||||
$stractivityreport = get_string("activityreport");
|
||||
@@ -49,17 +48,18 @@
|
||||
}
|
||||
print_heading("$user->firstname $user->lastname");
|
||||
|
||||
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
|
||||
echo "<TD>Reports: </TD>";
|
||||
echo "<table cellpadding=10 align=center><tr>";
|
||||
echo "<td>reports: </td>";
|
||||
|
||||
foreach ($modes as $listmode) {
|
||||
$strmode = get_string($listmode);
|
||||
if ($mode == $listmode) {
|
||||
echo "<TD><U>$strmode</U></TD>";
|
||||
echo "<td><u>$strmode</u></td>";
|
||||
} else {
|
||||
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
|
||||
echo "<td><a href=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</a></td>";
|
||||
}
|
||||
}
|
||||
echo "</TR></TABLE>";
|
||||
echo "</tr></table>";
|
||||
|
||||
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||
|
||||
@@ -107,6 +107,9 @@
|
||||
|
||||
$sectionmods = explode(",", $section->sequence);
|
||||
foreach ($sectionmods as $sectionmod) {
|
||||
if (empty($mods[$sectionmod])) {
|
||||
continue;
|
||||
}
|
||||
$mod = $mods[$sectionmod];
|
||||
$instance = get_record("$mod->modname", "id", "$mod->instance");
|
||||
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
|
||||
@@ -175,7 +178,7 @@ function print_outline_row($mod, $instance, $result) {
|
||||
echo "<TD> </TD>";
|
||||
if (isset($result->time)) {
|
||||
$timeago = format_time(time() - $result->time);
|
||||
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago ago)</TD>";
|
||||
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago)</TD>";
|
||||
}
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
+31
-20
@@ -22,54 +22,65 @@
|
||||
}
|
||||
}
|
||||
|
||||
require_login($id);
|
||||
require_login($course->id);
|
||||
|
||||
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
|
||||
|
||||
if (isset($edit)) {
|
||||
if (isteacher($course->id)) {
|
||||
if (isteacher($course->id)) {
|
||||
if (isset($edit)) {
|
||||
if ($edit == "on") {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == "off") {
|
||||
$USER->editing = false;
|
||||
}
|
||||
save_session("USER");
|
||||
}
|
||||
|
||||
if (isset($hide)) {
|
||||
set_section_visible($course->id, $hide, "0");
|
||||
}
|
||||
|
||||
if (isset($show)) {
|
||||
set_section_visible($course->id, $show, "1");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($help)) {
|
||||
if ($help == "on") {
|
||||
$USER->help = true;
|
||||
} else if ($help == "off") {
|
||||
$USER->help = false;
|
||||
}
|
||||
save_session("USER");
|
||||
}
|
||||
|
||||
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
save_session("SESSION");
|
||||
|
||||
if (! $course->category) { // This course is not a real course.
|
||||
redirect("$CFG->wwwroot/");
|
||||
}
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$pixpath = "../pix";
|
||||
$modpixpath = "../mod";
|
||||
} else {
|
||||
$pixpath = "../theme/$CFG->theme/pix";
|
||||
$modpixpath = "../theme/$CFG->theme/pix/mod";
|
||||
}
|
||||
|
||||
$courseword = get_string("course");
|
||||
|
||||
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
|
||||
|
||||
print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,
|
||||
update_course_icon($course->id));
|
||||
update_course_icon($course->id), $loggedinas);
|
||||
|
||||
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||
|
||||
if (! $sections = get_all_sections($course->id)) {
|
||||
$section->course = $course->id; // Create a default section.
|
||||
$section->section = 0;
|
||||
$section->id = insert_record("course_sections", $section);
|
||||
if (! $sections = get_all_sections($course->id) ) {
|
||||
if (! $sections = get_all_sections($course->id)) { // No sections found
|
||||
// Double-check to be extra sure
|
||||
if (! $section = get_record("course_sections", "course", $course->id, "section", 0)) {
|
||||
$section->course = $course->id; // Create a default section.
|
||||
$section->section = 0;
|
||||
$section->visible = 1;
|
||||
$section->id = insert_record("course_sections", $section);
|
||||
}
|
||||
if (! $sections = get_all_sections($course->id) ) { // Try again
|
||||
error("Error finding or creating section structures for this course");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch ($course->format) {
|
||||
case "weeks":
|
||||
include("weeks.php");
|
||||
|
||||
+137
-100
@@ -6,40 +6,47 @@
|
||||
|
||||
|
||||
if (isset($week)) {
|
||||
if ($week == "all") {
|
||||
unset($USER->section);
|
||||
$displaysection = course_set_display($course->id, $week);
|
||||
} else {
|
||||
if (isset($USER->display[$course->id])) {
|
||||
$displaysection = $USER->display[$course->id];
|
||||
} else {
|
||||
$USER->section = $week;
|
||||
$displaysection = course_set_display($course->id, 0);
|
||||
}
|
||||
save_session("USER");
|
||||
}
|
||||
|
||||
if ($course->newsitems) {
|
||||
$news = forum_get_course_forum($course->id, "news");
|
||||
}
|
||||
|
||||
$streditsummary = get_string("editsummary");
|
||||
$stradd = get_string("add");
|
||||
$stractivities = get_string("activities");
|
||||
$streditsummary = get_string("editsummary");
|
||||
$stradd = get_string("add");
|
||||
$stractivities = get_string("activities");
|
||||
$strshowallweeks = get_string("showallweeks");
|
||||
if (isediting($course->id)) {
|
||||
$strstudents = moodle_strtolower($course->students);
|
||||
$strweekhide = get_string("weekhide", "", $strstudents);
|
||||
$strweekshow = get_string("weekshow", "", $strstudents);
|
||||
}
|
||||
|
||||
|
||||
/// Layout the whole page as three big columns.
|
||||
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
|
||||
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
|
||||
|
||||
/// The left column ...
|
||||
|
||||
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
|
||||
echo "<tr valign=top><td valign=top width=180>";
|
||||
|
||||
/// Links to people
|
||||
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
|
||||
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
|
||||
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
|
||||
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
|
||||
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
|
||||
if ($USER->description) {
|
||||
$moddata[]= $editmyprofile;
|
||||
} else {
|
||||
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
|
||||
$moddata[]= $editmyprofile." <blink>*</blink>";
|
||||
}
|
||||
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
|
||||
print_side_block(get_string("people"), "", $moddata, $modicon);
|
||||
|
||||
|
||||
@@ -48,15 +55,15 @@
|
||||
$modicon = array();
|
||||
if ($modnamesused) {
|
||||
foreach ($modnamesused as $modname => $modfullname) {
|
||||
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
|
||||
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
|
||||
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
|
||||
}
|
||||
}
|
||||
print_side_block($stractivities, "", $moddata, $modicon);
|
||||
|
||||
/// Print a form to search forums
|
||||
$searchform = forum_print_search_form($course, "", true);
|
||||
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
|
||||
$searchform = "<div align=\"center\">$searchform</div>";
|
||||
print_side_block(get_string("search","forum"), $searchform);
|
||||
|
||||
|
||||
@@ -65,72 +72,87 @@
|
||||
|
||||
|
||||
/// Start main column
|
||||
echo "</TD><TD WIDTH=\"*\">";
|
||||
echo "</td><td width=\"*\">";
|
||||
print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
|
||||
print_spacer(8, 1, true);
|
||||
|
||||
echo "<table class=\"weeklyoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
|
||||
|
||||
/// Print Week 0 with general activities
|
||||
/// Print Section 0 with general activities
|
||||
|
||||
$week = 0;
|
||||
$thisweek = $sections[$week];
|
||||
$section = 0;
|
||||
$thissection = $sections[$section];
|
||||
|
||||
if ($thisweek->summary or $thisweek->sequence or isediting($course->id)) {
|
||||
echo "<TR>";
|
||||
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"weeklyoutlineside\" VALIGN=top WIDTH=20> </TD>";
|
||||
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" WIDTH=\"100%\">";
|
||||
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
|
||||
echo "<tr>";
|
||||
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top width=20> </td>";
|
||||
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">";
|
||||
|
||||
if (isediting($course->id)) {
|
||||
$thisweek->summary .= " <A TITLE=\"$streditsummary\" ".
|
||||
"HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
|
||||
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
|
||||
$thissection->summary .= " <a title=\"$streditsummary\" ".
|
||||
"href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$pixpath/t/edit.gif\" ".
|
||||
"border=0 alt=\"$streditsummary\"></a></p>";
|
||||
}
|
||||
|
||||
echo text_to_html($thisweek->summary);
|
||||
echo text_to_html($thissection->summary);
|
||||
|
||||
print_section($course, $thisweek, $mods, $modnamesused);
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<DIV ALIGN=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=",
|
||||
$modnames, "section$week", "", "$stradd...", "mods", $stractivities);
|
||||
echo "</DIV>";
|
||||
echo "<div align=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
|
||||
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"weeklyoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10>";
|
||||
echo " </TD>";
|
||||
echo "</TR>";
|
||||
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
|
||||
echo "</td>";
|
||||
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top align=center width=10>";
|
||||
echo " </td></tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
}
|
||||
|
||||
|
||||
/// Now all the weekly sections
|
||||
$timenow = time();
|
||||
$weekdate = $course->startdate; // this should be 0:00 Monday of that week
|
||||
$week = 1;
|
||||
$section = 1;
|
||||
$weekofseconds = 604800;
|
||||
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
|
||||
|
||||
$strftimedateshort = " ".get_string("strftimedateshort");
|
||||
|
||||
while ($weekdate < $course->enddate) {
|
||||
|
||||
$nextweekdate = $weekdate + ($weekofseconds);
|
||||
$weekday = userdate($weekdate, $strftimedateshort);
|
||||
$endweekday = userdate($weekdate+518400, $strftimedateshort);
|
||||
|
||||
if (isset($USER->section)) { // Just display a single week
|
||||
if ($USER->section != $week) {
|
||||
$week++;
|
||||
$weekdate = $nextweekdate;
|
||||
continue;
|
||||
if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
|
||||
$section++;
|
||||
$weekdate = $nextweekdate;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($sections[$section])) {
|
||||
$thissection = $sections[$section];
|
||||
|
||||
} else {
|
||||
unset($thissection);
|
||||
$thissection->course = $course->id; // Create a new week structure
|
||||
$thissection->section = $section;
|
||||
$thissection->summary = "";
|
||||
$thissection->visible = 1;
|
||||
if (!$thissection->id = insert_record("course_sections", $thissection)) {
|
||||
notify("Error inserting new week!");
|
||||
}
|
||||
}
|
||||
|
||||
$thisweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
|
||||
$currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
|
||||
|
||||
$weekday = userdate($weekdate, " %d %B");
|
||||
$endweekday = userdate($weekdate+518400, " %d %B");
|
||||
|
||||
if ($thisweek) {
|
||||
if (!$thissection->visible) {
|
||||
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"weeklyoutlinesidehidden\"";
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthidden\"";
|
||||
} else if ($currentweek) {
|
||||
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"weeklyoutlinesidehighlight\"";
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthighlight\"";
|
||||
} else {
|
||||
@@ -138,72 +160,87 @@
|
||||
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\"";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
|
||||
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$week</B></FONT></P>";
|
||||
echo "</TD>";
|
||||
echo "<tr>";
|
||||
echo "<td nowrap $colorsides valign=top width=20>";
|
||||
echo "<p align=center><font size=3><b>$section</b></font></p>";
|
||||
echo "</td>";
|
||||
|
||||
echo "<TD $colormain VALIGN=top WIDTH=\"100%\">";
|
||||
echo "<P><FONT SIZE=3 COLOR=\"$THEME->cellheading2\">$weekday - $endweekday</FONT></P>";
|
||||
echo "<td valign=top $colormain width=\"100%\">";
|
||||
|
||||
if (! $thisweek = $sections[$week]) {
|
||||
$thisweek->course = $course->id; // Create a new week structure
|
||||
$thisweek->section = $week;
|
||||
$thisweek->summary = "";
|
||||
if (!$thisweek->id = insert_record("course_sections", $thisweek)) {
|
||||
notify("Error inserting new week!");
|
||||
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
|
||||
echo "<p class=\"weeklydatetext\">$weekday - $endweekday ";
|
||||
echo "(".get_string("notavailable").")";
|
||||
echo "</p>";
|
||||
echo "</td>";
|
||||
|
||||
} else {
|
||||
|
||||
echo "<p class=\"weeklydatetext\">$weekday - $endweekday</p>";
|
||||
|
||||
if (isediting($course->id)) {
|
||||
$thissection->summary .= " <a title=\"$streditsummary\" href=\"editsection.php?id=$thissection->id\">".
|
||||
"<img src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a></p>";
|
||||
}
|
||||
|
||||
echo text_to_html($thissection->summary);
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<div align=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
|
||||
$modnames, "section$section", "", "$stradd...");
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<td nowrap $colorsides valign=top align=center width=10>";
|
||||
echo "<font size=1>";
|
||||
|
||||
if ($displaysection == $section) {
|
||||
echo "<a href=\"view.php?id=$course->id&week=all\" title=\"$strshowallweeks\">".
|
||||
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
|
||||
} else {
|
||||
$strshowonlyweek = get_string("showonlyweek", "", $section);
|
||||
echo "<a href=\"view.php?id=$course->id&week=$section\" title=\"$strshowonlyweek\">".
|
||||
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
|
||||
}
|
||||
|
||||
if (isediting($course->id)) {
|
||||
if ($thissection->visible) { // Show the hide/show eye
|
||||
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strweekhide\">".
|
||||
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
} else {
|
||||
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strweekshow\">".
|
||||
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
|
||||
}
|
||||
}
|
||||
|
||||
if (isediting($course->id)) {
|
||||
$thisweek->summary .= " <A TITLE=\"$streditsummary\" HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
|
||||
echo text_to_html($thisweek->summary);
|
||||
|
||||
print_section($course, $thisweek, $mods, $modnamesused);
|
||||
|
||||
if (isediting($course->id)) {
|
||||
echo "<DIV ALIGN=right>";
|
||||
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=",
|
||||
$modnames, "section$week", "", "$stradd...");
|
||||
echo "</DIV>";
|
||||
}
|
||||
|
||||
echo "</TD>";
|
||||
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
|
||||
echo "<FONT SIZE=1>";
|
||||
if (isset($USER->section)) {
|
||||
$strshowallweeks = get_string("showallweeks");
|
||||
echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"$strshowallweeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
|
||||
} else {
|
||||
$strshowonlyweek = get_string("showonlyweek", "", $week);
|
||||
echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"$strshowonlyweek\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
|
||||
}
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
|
||||
|
||||
$week++;
|
||||
$section++;
|
||||
$weekdate = $nextweekdate;
|
||||
}
|
||||
echo "</TABLE>";
|
||||
echo "</table>";
|
||||
|
||||
if ($news or $course->showrecent) {
|
||||
echo "</TD><TD WIDTH=210>";
|
||||
if (!empty($news) or !empty($course->showrecent)) {
|
||||
echo "</td><td width=210>";
|
||||
|
||||
// Print all the news items.
|
||||
|
||||
if ($news) {
|
||||
if (!empty($news)) {
|
||||
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
|
||||
echo "<FONT SIZE=\"-2\">";
|
||||
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
|
||||
echo "</FONT>";
|
||||
echo "<font size=\"-2\">";
|
||||
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
|
||||
echo "</font>";
|
||||
print_side_block_end();
|
||||
}
|
||||
|
||||
// Print all the recent activity
|
||||
if ($course->showrecent) {
|
||||
if (!empty($course->showrecent)) {
|
||||
print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
|
||||
print_recent_activity($course);
|
||||
print_side_block_end();
|
||||
@@ -212,6 +249,6 @@
|
||||
print_spacer(1, 120, true);
|
||||
}
|
||||
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</td></tr></table>\n";
|
||||
|
||||
?>
|
||||
|
||||
+1
-2
@@ -8,8 +8,7 @@
|
||||
optional_variable($lang, ""); // override current language
|
||||
|
||||
if (!empty($lang)) {
|
||||
$SESSION->doclang = $lang;
|
||||
save_session("SESSION");
|
||||
$SESSION->lang = $lang;
|
||||
}
|
||||
|
||||
if (!empty($sub)) {
|
||||
|
||||
+4
-5
@@ -2,15 +2,14 @@
|
||||
|
||||
require("../config.php");
|
||||
|
||||
if (!empty($SESSION->doclang)) {
|
||||
$currlang = $SESSION->doclang;
|
||||
if (empty($CFG->langmenu)) {
|
||||
$langmenu = "";
|
||||
} else {
|
||||
$currlang = current_language();
|
||||
$langs = get_list_of_languages();
|
||||
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
|
||||
}
|
||||
|
||||
$langs = get_list_of_languages();
|
||||
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
|
||||
|
||||
if (! $site = get_site()) {
|
||||
error("Site is misconfigured");
|
||||
}
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
$lifetime = 86400;
|
||||
|
||||
if (isset($file)) { // workaround for situations where / syntax doesn't work
|
||||
$PATH_INFO = $file;
|
||||
$pathinfo = $file;
|
||||
} else {
|
||||
$pathinfo = get_slash_arguments("file.php");
|
||||
}
|
||||
|
||||
if (!$PATH_INFO) {
|
||||
error("This script DEPENDS on PATH_INFO being available. Read the README.");
|
||||
if (!$pathinfo) {
|
||||
error("No file parameters!");
|
||||
}
|
||||
|
||||
if (! $args = get_slash_arguments()) {
|
||||
if (! $args = parse_slash_arguments($pathinfo)) {
|
||||
error("No valid arguments supplied");
|
||||
}
|
||||
|
||||
@@ -30,7 +32,7 @@
|
||||
|
||||
// it's OK to get here if no course was specified
|
||||
|
||||
$pathname = "$CFG->dataroot$PATH_INFO";
|
||||
$pathname = "$CFG->dataroot$pathinfo";
|
||||
$filename = $args[$numargs-1];
|
||||
|
||||
$mimetype = mimeinfo("type", $filename);
|
||||
@@ -47,7 +49,7 @@
|
||||
header("Content-type: $mimetype");
|
||||
readfile("$pathname");
|
||||
} else {
|
||||
error("Sorry, but the file you are looking for was not found", "course/view.php?id=$courseid");
|
||||
error("Sorry, but the file you are looking for was not found ($pathname)", "course/view.php?id=$courseid");
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
+144
-29
@@ -24,14 +24,6 @@
|
||||
error("Only teachers can edit files");
|
||||
}
|
||||
|
||||
if (!$CFG->zip) {
|
||||
$CFG->zip = "/usr/bin/zip";
|
||||
}
|
||||
|
||||
if (!$CFG->unzip) {
|
||||
$CFG->unzip = "/usr/bin/unzip";
|
||||
}
|
||||
|
||||
function html_footer() {
|
||||
global $course;
|
||||
echo "</td></tr></table></body></html>";
|
||||
@@ -105,6 +97,7 @@
|
||||
if ($userfile_name) {
|
||||
$newfile = "$basedir$wdir/$userfile_name";
|
||||
if (move_uploaded_file($userfile['tmp_name'], $newfile)) {
|
||||
chmod($newfile, 0666);
|
||||
$a = NULL;
|
||||
$a->file = "$userfile_name (".$userfile['type'].")";
|
||||
$a->directory = $wdir;
|
||||
@@ -184,7 +177,6 @@
|
||||
if ($count = setfilelist($_POST)) {
|
||||
$USER->fileop = $action;
|
||||
$USER->filesource = $wdir;
|
||||
save_session("USER");
|
||||
echo "<P align=center>$count files selected for moving. Now go to the destination and press \"Move files to here\".</P>";
|
||||
}
|
||||
displaydir($wdir);
|
||||
@@ -247,9 +239,9 @@
|
||||
if (!empty($name)) {
|
||||
html_header($course, $wdir);
|
||||
$name = clean_filename($name);
|
||||
if (file_exists($basedir.$wdir."/".$name)) {
|
||||
if (file_exists("$basedir$wdir/$name")) {
|
||||
echo "Error: $name already exists!";
|
||||
} else if (!mkdir($basedir.$wdir."/".$name, 0750)) {
|
||||
} else if (! make_upload_directory("$course->id/$wdir/$name")) {
|
||||
echo "Error: could not create $name";
|
||||
}
|
||||
displaydir($wdir);
|
||||
@@ -336,13 +328,25 @@
|
||||
if (!empty($name)) {
|
||||
html_header($course, $wdir);
|
||||
$name = clean_filename($name);
|
||||
$files = "";
|
||||
foreach ($USER->filelist as $file) {
|
||||
$files .= basename($file);
|
||||
$files .= " ";
|
||||
if (empty($CFG->zip)) { // Use built-in php-based zip function
|
||||
$files = array();
|
||||
foreach ($USER->filelist as $file) {
|
||||
$files[] = "$basedir/$wdir$file";
|
||||
}
|
||||
include_once('../lib/pclzip/pclzip.lib.php');
|
||||
$archive = new PclZip("$basedir/$wdir/$name");
|
||||
if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
|
||||
error($archive->errorInfo(true));
|
||||
}
|
||||
} else { // Use external zip program
|
||||
$files = "";
|
||||
foreach ($USER->filelist as $file) {
|
||||
$files .= basename($file);
|
||||
$files .= " ";
|
||||
}
|
||||
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
|
||||
Exec($command);
|
||||
}
|
||||
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
|
||||
Exec($command);
|
||||
clearfilelist();
|
||||
displaydir($wdir);
|
||||
|
||||
@@ -382,19 +386,59 @@
|
||||
case "unzip":
|
||||
html_header($course, $wdir);
|
||||
if (!empty($file)) {
|
||||
echo "<P ALIGN=CENTER>Unzipping $file:</P>";
|
||||
print_simple_box_start("center");
|
||||
echo "<PRE>";
|
||||
$strname = get_string("name");
|
||||
$strsize = get_string("size");
|
||||
$strmodified = get_string("modified");
|
||||
$strstatus = get_string("status");
|
||||
$strok = get_string("ok");
|
||||
$strunpacking = get_string("unpacking", "", $file);
|
||||
|
||||
echo "<P ALIGN=CENTER>$strunpacking:</P>";
|
||||
|
||||
$file = basename($file);
|
||||
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
|
||||
passthru($command);
|
||||
echo "</PRE>";
|
||||
print_simple_box_end();
|
||||
|
||||
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
|
||||
include_once('../lib/pclzip/pclzip.lib.php');
|
||||
$archive = new PclZip("$basedir/$wdir/$file");
|
||||
if (!$list = $archive->extract("$basedir/$wdir")) {
|
||||
error($archive->errorInfo(true));
|
||||
} else { // print some output
|
||||
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
|
||||
echo "<tr><th align=left>$strname</th>";
|
||||
echo "<th align=right>$strsize</th>";
|
||||
echo "<th align=right>$strmodified</th>";
|
||||
echo "<th align=right>$strstatus</th></tr>";
|
||||
foreach ($list as $item) {
|
||||
echo "<tr>";
|
||||
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
|
||||
print_cell("left", $item['filename']);
|
||||
if (! $item['folder']) {
|
||||
print_cell("right", display_size($item['size']));
|
||||
} else {
|
||||
echo "<td> </td>";
|
||||
}
|
||||
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
||||
print_cell("right", $filedate);
|
||||
print_cell("right", $item['status']);
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
} else { // Use external unzip program
|
||||
print_simple_box_start("center");
|
||||
echo "<PRE>";
|
||||
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
|
||||
passthru($command);
|
||||
echo "</PRE>";
|
||||
print_simple_box_end();
|
||||
}
|
||||
|
||||
echo "<CENTER><FORM ACTION=index.php METHOD=get>";
|
||||
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||
echo " <INPUT TYPE=submit VALUE=\"OK\">";
|
||||
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
||||
echo "</FORM>";
|
||||
echo "</CENTER>";
|
||||
} else {
|
||||
@@ -403,6 +447,73 @@
|
||||
html_footer();
|
||||
break;
|
||||
|
||||
case "listzip":
|
||||
html_header($course, $wdir);
|
||||
if (!empty($file)) {
|
||||
$strname = get_string("name");
|
||||
$strsize = get_string("size");
|
||||
$strmodified = get_string("modified");
|
||||
$strok = get_string("ok");
|
||||
$strlistfiles = get_string("listfiles", "", $file);
|
||||
|
||||
echo "<P ALIGN=CENTER>$strlistfiles:</P>";
|
||||
$file = basename($file);
|
||||
|
||||
include_once('../lib/pclzip/pclzip.lib.php');
|
||||
$archive = new PclZip("$basedir/$wdir/$file");
|
||||
if (!$list = $archive->listContent("$basedir/$wdir")) {
|
||||
notify($archive->errorInfo(true));
|
||||
|
||||
} else {
|
||||
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
|
||||
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>";
|
||||
foreach ($list as $item) {
|
||||
echo "<tr>";
|
||||
print_cell("left", $item['filename']);
|
||||
if (! $item['folder']) {
|
||||
print_cell("right", display_size($item['size']));
|
||||
} else {
|
||||
echo "<td> </td>";
|
||||
}
|
||||
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
||||
print_cell("right", $filedate);
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo "<br><center><form action=index.php method=get>";
|
||||
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
||||
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
||||
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
||||
echo "</FORM>";
|
||||
echo "</CENTER>";
|
||||
} else {
|
||||
displaydir($wdir);
|
||||
}
|
||||
html_footer();
|
||||
break;
|
||||
|
||||
case "restore":
|
||||
html_header($course, $wdir);
|
||||
if (!empty($file)) {
|
||||
echo "<P ALIGN=CENTER>".get_string("youaregoingtorestorefrom")."</P>";
|
||||
print_simple_box_start("center");
|
||||
echo $file;
|
||||
print_simple_box_end();
|
||||
echo "<BR>";
|
||||
//MODIFY RELATIVE PATH TO restore.php
|
||||
$restore_path = "../contrib/stronk7/backup/restore.php";
|
||||
//END MODIFY
|
||||
notice_yesno (get_string("areyousuretorestorethis"),
|
||||
$restore_path."?file=".$id.$wdir."/".$file,
|
||||
"index.php?id=$id&wdir=$wdir&action=cancel");
|
||||
} else {
|
||||
displaydir($wdir);
|
||||
}
|
||||
html_footer();
|
||||
break;
|
||||
|
||||
case "cancel";
|
||||
clearfilelist();
|
||||
|
||||
@@ -462,7 +573,6 @@ function setfilelist($VARS) {
|
||||
$USER->filelist[] = rawurldecode($val);
|
||||
}
|
||||
}
|
||||
save_session("USER");
|
||||
return $count;
|
||||
}
|
||||
|
||||
@@ -471,7 +581,6 @@ function clearfilelist() {
|
||||
|
||||
$USER->filelist = array ();
|
||||
$USER->fileop = "";
|
||||
save_session("USER");
|
||||
}
|
||||
|
||||
|
||||
@@ -543,6 +652,8 @@ function displaydir ($wdir) {
|
||||
$strrename = get_string("rename");
|
||||
$stredit = get_string("edit");
|
||||
$strunzip = get_string("unzip");
|
||||
$strlist = get_string("list");
|
||||
$strrestore= get_string("restore");
|
||||
|
||||
|
||||
echo "<FORM ACTION=\"index.php\" METHOD=post NAME=dirform>";
|
||||
@@ -623,7 +734,11 @@ function displaydir ($wdir) {
|
||||
if ($icon == "text.gif" || $icon == "html.gif") {
|
||||
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=edit\">$stredit</A>";
|
||||
} else if ($icon == "zip.gif") {
|
||||
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A>";
|
||||
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A> ";
|
||||
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</A> ";
|
||||
if (!empty($CFG->backup_version) && isadmin()) {
|
||||
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=restore\">$strrestore</A> ";
|
||||
}
|
||||
} else {
|
||||
$edittext = "";
|
||||
}
|
||||
@@ -654,7 +769,7 @@ function displaydir ($wdir) {
|
||||
|
||||
echo "</FORM>";
|
||||
echo "<TD ALIGN=center>";
|
||||
if (($USER->fileop == "move") && $USER->filesource <> $wdir) {
|
||||
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
|
||||
echo "<FORM ACTION=index.php METHOD=get>";
|
||||
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
||||
|
||||
+5
-3
@@ -4,6 +4,7 @@ function mimeinfo($element, $filename) {
|
||||
$mimeinfo = array (
|
||||
"xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
|
||||
"zip" => array ("type"=>"application/zip", "icon"=>"zip.gif"),
|
||||
"jpe" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
|
||||
"jpeg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
|
||||
"jpg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
|
||||
"gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
|
||||
@@ -16,18 +17,19 @@ function mimeinfo($element, $filename) {
|
||||
"wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
|
||||
"mp3" => array ("type"=>"audio/mp3", "icon"=>"audio.gif"),
|
||||
"au" => array ("type"=>"audio/au", "icon"=>"audio.gif"),
|
||||
"swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"image.gif"),
|
||||
"swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"flash.gif"),
|
||||
"pdf" => array ("type"=>"application/pdf", "icon"=>"pdf.gif"),
|
||||
"doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
|
||||
"ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
|
||||
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif")
|
||||
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
|
||||
"avi" => array ("type"=>"video/x-ms-wm", "icon"=>"avi.gif")
|
||||
);
|
||||
|
||||
if (eregi("\.([a-z0-9]+)$", $filename, $match)) {
|
||||
$result = $mimeinfo[strtolower($match[1])][$element];
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
if (!empty($result)) {
|
||||
return $result;
|
||||
} else {
|
||||
return $mimeinfo["xxx"][$element]; // By default
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 122 B |
Binary file not shown.
|
After Width: | Height: | Size: 583 B |
Binary file not shown.
|
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 159 B |
@@ -14,8 +14,8 @@
|
||||
|
||||
print_header();
|
||||
|
||||
if (ereg("\\.\\.", $file)) {
|
||||
error("Filenames can not contain \"..\"");
|
||||
if (detect_munged_arguments("$module/$file")) {
|
||||
error("Filenames contain illegal characters!");
|
||||
}
|
||||
|
||||
if ($file) {
|
||||
@@ -28,7 +28,7 @@
|
||||
if (file_exists("$filepath")) {
|
||||
require_once("$filepath"); // Chosen language
|
||||
|
||||
} else { // Fall back to English
|
||||
} else { // Fall back to English
|
||||
if ($module == "moodle") {
|
||||
$filepath = "$CFG->dirroot/lang/en/help/$file";
|
||||
} else {
|
||||
@@ -43,13 +43,13 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<P>";
|
||||
echo "<p>";
|
||||
echo $text;
|
||||
echo "</P>";
|
||||
echo "</p>";
|
||||
}
|
||||
|
||||
close_window_button();
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
if (moodle_needs_upgrading()) {
|
||||
redirect("$CFG->wwwroot/admin/index.php");
|
||||
}
|
||||
$headerbutton = update_course_icon($site->id);
|
||||
} else {
|
||||
if (isset($USER->id)) {
|
||||
$headerbutton = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</A></FONT>";
|
||||
} else {
|
||||
$headerbutton = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</A></FONT>";
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($USER->id)) {
|
||||
$loginstring = "<font size=2><a href=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</a></font>";
|
||||
} else {
|
||||
$loginstring = "<font size=1>".user_login_string($site)."</font>";
|
||||
}
|
||||
|
||||
if (empty($CFG->langmenu)) {
|
||||
$langmenu = "";
|
||||
} else {
|
||||
$currlang = current_language();
|
||||
$langs = get_list_of_languages();
|
||||
$langmenu = popup_form ("$CFG->wwwroot/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
|
||||
}
|
||||
|
||||
print_header("$site->fullname", "$site->fullname", "home", "",
|
||||
"<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
|
||||
true, "", $headerbutton);
|
||||
"<meta name=\"description\" content=\"".s(strip_tags($site->summary))."\">",
|
||||
true, "", "<div align=right>$loginstring$langmenu</div>");
|
||||
|
||||
$firstcolumn = false; // for now
|
||||
$side = 175;
|
||||
@@ -32,14 +40,14 @@
|
||||
?>
|
||||
|
||||
|
||||
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
|
||||
<TR>
|
||||
<table width="100%" border="0" cellspacing="5" cellpadding="5">
|
||||
<tr>
|
||||
<?PHP
|
||||
$sections = get_all_sections($site->id);
|
||||
|
||||
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
|
||||
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id) or isadmin()) {
|
||||
|
||||
echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>";
|
||||
echo "<td width=\"$side\" valign=top nowrap>";
|
||||
$firstcolumn=true;
|
||||
|
||||
if ($sections[0]->sequence or isediting($site->id)) {
|
||||
@@ -48,6 +56,11 @@
|
||||
$mods, $modnames, $modnamesused, true, $side, isediting($site->id));
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
echo "<div align=\"center\">".update_course_icon($site->id)."</div>";
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
if ($site->newsitems > 0 ) {
|
||||
$categories = get_categories();
|
||||
if (count($categories) > 1) {
|
||||
@@ -60,17 +73,18 @@
|
||||
print_spacer(1,$side);
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
if (iscreator()) {
|
||||
if (!$firstcolumn) {
|
||||
echo "<TD WIDTH=\"$side\" VALIGN=TOP NOWRAP>"; $firstcolumn=true;
|
||||
echo "<td width=\"$side\" valign=top nowrap>";
|
||||
$firstcolumn=true;
|
||||
}
|
||||
print_admin_links($site->id, $side);
|
||||
}
|
||||
|
||||
if ($firstcolumn) {
|
||||
echo "</TD>";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<TD WIDTH=70% VALIGN=TOP>";
|
||||
echo "<td width=\"70%\" valign=\"top\">";
|
||||
|
||||
if ($site->newsitems == 0 ) {
|
||||
print_heading_block(get_string("availablecourses"));
|
||||
@@ -89,17 +103,16 @@
|
||||
|
||||
if (isset($USER->id)) {
|
||||
$SESSION->fromdiscussion = "$CFG->wwwroot";
|
||||
save_session("SESSION");
|
||||
if (forum_is_subscribed($USER->id, $newsforum->id)) {
|
||||
$subtext = get_string("unsubscribe", "forum");
|
||||
} else {
|
||||
$subtext = get_string("subscribe", "forum");
|
||||
}
|
||||
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR>
|
||||
<TD>$newsforum->name</TD>
|
||||
<TD ALIGN=RIGHT><FONT SIZE=1>
|
||||
<A HREF=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</A>
|
||||
</TD></TR></TABLE>";
|
||||
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr>
|
||||
<td>$newsforum->name</td>
|
||||
<td align=right><font size=1>
|
||||
<a href=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</a>
|
||||
</td></tr></table>";
|
||||
} else {
|
||||
$headertext = $newsforum->name;
|
||||
}
|
||||
@@ -108,20 +121,20 @@
|
||||
forum_print_latest_discussions($newsforum->id, $site->newsitems);
|
||||
}
|
||||
|
||||
echo "</TD>";
|
||||
echo "<TD WIDTH=30% VALIGN=TOP>";
|
||||
echo "</td>";
|
||||
echo "<td width=30% valign=top>";
|
||||
|
||||
if (isediting($site->id)) {
|
||||
$site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
|
||||
$site->summary .= "<br><center><a href=\"admin/site.php\"><img src=\"pix/i/edit.gif\" border=0></a>";
|
||||
}
|
||||
|
||||
print_simple_box($site->summary, "", "100%", $THEME->cellcontent2, 5, "siteinfo");
|
||||
print_spacer(1,$side);
|
||||
echo "</TD>";
|
||||
echo "</td>";
|
||||
?>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?PHP print_footer("home"); // Please do not modify this line ?>
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
This directory contains language packages that define all
|
||||
the text to render Moodle in a particular language.
|
||||
|
||||
Each directory is named according to the standard 2-letter
|
||||
Each language is named according to the standard 2-letter
|
||||
language name, as defined in:
|
||||
|
||||
lib/languages.php
|
||||
|
||||
|
||||
Some languages have an added "locale" added to them.
|
||||
|
||||
@@ -401,6 +401,14 @@ $string['someerrorswerefound'] = "
|
||||
$string['someerrorswerefound'] = "بعض المعلومات فقدت أو غير صحيحة، لذا يرجى النظر تاليه للحصول على مزيد من التفاصيل.";
|
||||
$string['startdate'] = "تاريخ بدء المنهج الدراسي";
|
||||
$string['startsignup'] = "إنشاء اشتراك جديد";
|
||||
$string['status'] = "الحالة";
|
||||
$string['strftimedate'] = "%%d %%B %%Y";
|
||||
$string['strftimedateshort'] = "%%d %%B";
|
||||
$string['strftimedatetime'] = "%%d %%B %%Y, %%I:%%M %%p";
|
||||
$string['strftimedaydate'] = "%%A, %%d %%B %%Y";
|
||||
$string['strftimedaydatetime'] = "%%A, %%d %%B %%Y, %%I:%%M %%p";
|
||||
$string['strftimerecent'] = "%%d %%b, %%H:%%M";
|
||||
$string['strftimerecentfull'] = "%%a, %%d %%b %%Y, %%I:%%M %%p";
|
||||
$string['strftimetime'] = "%%I:%%M %%p";
|
||||
$string['stringsnotset'] = "لم يتم تعريف الإعدادات التالية في \$a";
|
||||
$string['studentnotallowed'] = "عفوا! لا يمكنك الدخول على هذه الحلقة الدراسية بصفة '\$a'";
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ $string['type'] = "
|
||||
$string['category'] = "ÊÕäíÝ";
|
||||
$string['viewallanswers'] = "ÚÑÖ \$a ÇáÇãÊÍÇäÇÊ ÇáãäÌÒÉ";
|
||||
$string['yourfinalgradeis'] = "ÊÕäíÝß ÇáäåÇÆí Úä åÐÇ ÇáÇãÊÍÇä åæ \$a";
|
||||
$string[answersingleno] = "íÓãÍ ÈÊÚÏÏ ÇáÃÓÆáÉ";
|
||||
$string[readytosend] = "ÃäÊ ÈÕÏÏ ÅÑÓÇá ÇÎÊÈÇÑß ÈÇáßÇãá ááÊÞííã. åá ÃäÊ ãÊÃßÏ æÊÑíÏ ÇáÇÓÊãÑÇÑ¿";
|
||||
$string['answersingleno'] = "íÓãÍ ÈÊÚÏÏ ÇáÃÓÆáÉ";
|
||||
$string['readytosend'] = "ÃäÊ ÈÕÏÏ ÅÑÓÇá ÇÎÊÈÇÑß ÈÇáßÇãá ááÊÞííã. åá ÃäÊ ãÊÃßÏ æÊÑíÏ ÇáÇÓÊãÑÇÑ¿";
|
||||
?>
|
||||
|
||||
|
||||
@@ -428,6 +428,14 @@ $string['someerrorswerefound'] = "Falta informaci
|
||||
$string['startdate'] = "Data d'inici del curs";
|
||||
$string['startsignup'] = "Comença creant-te un compte d'usuari nou!";
|
||||
$string['status'] = "Estatus";
|
||||
$string['strftimedate'] = "%%d %%B %%Y";
|
||||
$string['strftimedateshort'] = "%%d %%B";
|
||||
$string['strftimedatetime'] = "%%d %%B %%Y, %%H:%%M";
|
||||
$string['strftimedaydate'] = "%%A, %%d %%B %%Y";
|
||||
$string['strftimedaydatetime'] = "%%A, %%d %%B %%Y, %%H:%%M";
|
||||
$string['strftimerecent'] = "%%d %%b, %%H:%%M";
|
||||
$string['strftimerecentfull'] = "%%a, %%d %%b %%Y, %%H:%%M";
|
||||
$string['strftimetime'] = "%%H:%%M";
|
||||
$string['stringsnotset'] = "Les cadenes següents no estan definides en \$a";
|
||||
$string['studentnotallowed'] = "Ho lamentem, no pots entrar en aquest curs com a '\$a'";
|
||||
$string['success'] = "Èxit";
|
||||
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
From Søren Vinther Hansen <info@thenavigator.dk>
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
<?PHP // $Id$
|
||||
// assignment.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['allowresubmit'] = "Tillad gentagelser";
|
||||
$string['assignmentdetails'] = "Opgave detaljer";
|
||||
$string['assignmentname'] = "Opgave navn";
|
||||
$string['assignmenttype'] = "Opgave type";
|
||||
$string['description'] = "Beskrivelse";
|
||||
$string['duedate'] = "Afleveringsdato";
|
||||
$string['early'] = "\$a for tidlig";
|
||||
$string['failedupdatefeedback'] = "Mislykkedes at opdatere feedback på aflevering for bruger \$a";
|
||||
$string['feedback'] = "Feedback";
|
||||
$string['feedbackupdated'] = "Afleverings feedback opdateret for \$a ";
|
||||
$string['late'] = "\$a for sent";
|
||||
$string['maximumgrade'] = "Maximum karakterer";
|
||||
$string['maximumsize'] = "Maximum størrelse";
|
||||
$string['modulename'] = "Opgave";
|
||||
$string['modulenameplural'] = "Opgaver";
|
||||
$string['newsubmissions'] = "Opgaver afleveret";
|
||||
$string['notsubmittedyet'] = "Ikke afleveret endnu";
|
||||
$string['overwritewarning'] = "Advarsel: hvis du uploader igen, vil det erstatte den nuværende version";
|
||||
$string['saveallfeedback'] = "Gem alt mit feedback";
|
||||
$string['submissionfeedback'] = "Afleverings feedback";
|
||||
$string['submissions'] = "Afleveringer";
|
||||
$string['submitassignment'] = "Aflevér din opgave ved hjælp af denne formular";
|
||||
$string['submitted'] = "Afleveret";
|
||||
$string['typeoffline'] = "Offline aktivitet";
|
||||
$string['typeuploadsingle'] = "Upload en enkelt fil";
|
||||
$string['uploadbadname'] = "Dette filnavn indeholdt ugyldige tegn og kunne ikke uploades";
|
||||
$string['uploadedfiles'] = "uploaded filer";
|
||||
$string['uploaderror'] = "Fejl mens filen blev gemt på serveren";
|
||||
$string['uploadfailnoupdate'] = "Filen var OK uploaded, men din aflevering blev ikke opdateret";
|
||||
$string['uploadfiletoobig'] = "Beklager, men filen er for stor (grænse er \$a bytes)";
|
||||
$string['uploadnofilefound'] = "Ingen filer fundet, er du sikker på at du har valgt at uploade en ";
|
||||
$string['uploadnotregistered'] = "'\$a' blev uploaded OK, men afleveringen blev ikke registreret";
|
||||
$string['uploadsuccess'] = "Uploaded '\$a' korrekt";
|
||||
$string['viewfeedback'] = "Se opgave karakterer og feedback";
|
||||
$string['viewsubmissions'] = "Se \$a afleverede opgaver";
|
||||
$string['yoursubmission'] = "Din aflevering";
|
||||
|
||||
?>
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
<?PHP // $Id$
|
||||
// auth.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['auth_dbdescription'] = "Denne metode bruger en ekstern database for at kontrollere om et givet username og password er gyldigt. Hvis konto'en er ny, kan oplysninger fra andre felter også kopieres ind i Moodle.";
|
||||
$string['auth_dbextrafields'] = "Disse felter er optional. Du kan vælge at for-udfylde nogle Moodle bruger felter fra <B>den eksterne database</B>, som du har specificeret her.<P> Hvis du ikke skriver noget her, vil default værdierne blive brugt.<P> I alle tilfælde vil brugeren være i stand til at skrive i alle felterne, når de er logget ind.";
|
||||
$string['auth_dbfieldpass'] = "Navn på feltet der indeholder password";
|
||||
$string['auth_dbfielduser'] = "Navnet på feltet der indeholder usernames";
|
||||
$string['auth_dbhost'] = "Computeren der hoster database serveren.";
|
||||
$string['auth_dbname'] = "Navnet på databasen";
|
||||
$string['auth_dbpass'] = "Password der matcher ovennævnte username";
|
||||
$string['auth_dbpasstype'] = "Angiv hvilket format password feltet anvender. MD5 kryptering er anvendeligt når der connectes til almindelige web applikationer som PostNuke";
|
||||
$string['auth_dbtable'] = "Navnet på tabellen i databasen";
|
||||
$string['auth_dbtitle'] = "Brug en ekstern database";
|
||||
$string['auth_dbtype'] = "Database typen(Se <A HREF=../lib/adodb/readme.htm#drivers>ADOdb documentation</A> for detaljer)";
|
||||
$string['auth_dbuser'] = "Username med læserrettigheder til databasen";
|
||||
$string['auth_emaildescription'] = "Email bekræftigelse er default godkendelsesmetode. Når brugerne melder sig ind og vælger deres username og password, vil en bekræftigelses email blive sendt til brugerens emailaddresse. Denne email indeholder et sikkert link til en side, hvor brugeren kan bekræftige sine oplysninger. Fremtidige logins kontrolleres ved sammenligning af det username og password, som der er gemt i databasen.";
|
||||
$string['auth_emailtitle'] = "Email-baseret godkendelse";
|
||||
$string['auth_imapdescription'] = "Denne metode bruger en IMAP server for at kontrollere om usernam og password er gyldigt.";
|
||||
$string['auth_imaphost'] = "IMAP server addressen. Brug IP nummeret, ikke DNS navn.";
|
||||
$string['auth_imapport'] = "IMAP server port nummer. Sædvanligvis er det 143 eller 993.";
|
||||
$string['auth_imaptitle'] = "Brug en IMAP server";
|
||||
$string['auth_imaptype'] = "IMAP server typen. IMAP servere kan have forskellige typer godkendelser.";
|
||||
$string['auth_ldap_bind_dn'] = "Hvis du bruger bind-user til søgning, skal det angives her. Noget med 'cn=ldapuser,ou=public,o=org'";
|
||||
$string['auth_ldap_bind_pw'] = "Password for bind-user.";
|
||||
$string['auth_ldap_contexts'] = "Liste med indhold over brugere. deldifferent indhold med ';'. For example: 'ou=users,o=org; ou=others,o=org'";
|
||||
$string['auth_ldap_host_url'] = "Angiv LDAP host i URL-form f.eks. 'ldap://ldap.myorg.com/' eller 'ldaps://ldap.myorg.com/' ";
|
||||
$string['auth_ldap_search_sub'] = "Sæt værdi <> 0 hvis du vil søge efter brugere ud fra underemner.";
|
||||
$string['auth_ldap_update_userinfo'] = "Updater bruger information (fornavn, efternavn, addresse..) fra LDAP til Moodle. Se /auth/ldap/attr_mappings.php for information";
|
||||
$string['auth_ldap_user_attribute'] = "Attributten til navngivning/søgning af brugere. Sædvanligvis 'cn'.";
|
||||
$string['auth_ldapdescription'] = "Denne metode kræver godkendelse op mod en ekstern LDAP server.
|
||||
Hvis det givne username/password er gyldige opretter Moodle en ny bruger i databasen Dette modul kan læse bruger attributter fra en LDAP server og udfylde ønskede felter i Moodle
|
||||
For følgende logins bliver kun username og
|
||||
password kontrolleret.";
|
||||
$string['auth_ldapextrafields'] = "Disse felter er optional. Du kan vælge at udfylde Moodle felter på forhånd fra <B>LDAP felterne</B> som du angiver her. <P>Hvis du ikke skriver noget her, vil intet overføres fra LDAP og Moodle defaults'ene vil blive brugt i stedet.<P>I alle tilfælde vil brugeren være i stand ændre i felterne efter de har logget ind.";
|
||||
$string['auth_ldaptitle'] = "Brug en LDAP server";
|
||||
$string['auth_nntpdescription'] = "Denne metode bruger en NNTP server for at kontrollere om de givne username og password er gyldige.";
|
||||
$string['auth_nntphost'] = "NNTP server addressen. Brug IP nummeret, ikke DNS navn.";
|
||||
$string['auth_nntpport'] = "Server port (119 er den mest almindelige)";
|
||||
$string['auth_nntptitle'] = "Brug en NNTP server";
|
||||
$string['auth_nonedescription'] = "Brugerne kan oprette sig selv og lave gyldige konti med det samme, uden godkendelse op mod en ekstern server og uden bekræftigelse via e-mail. Vær forsigtig med at bruge denne mulighed - tænk administrationsproblemerne!";
|
||||
$string['auth_nonetitle'] = "No godkendelse";
|
||||
$string['auth_pop3description'] = "Denne metode bruger en POP3 server til at kontrollere om de givne username og password er gyldige";
|
||||
$string['auth_pop3host'] = "POP3 server addressen. Brug IP nummeret, ikke DNS navn.";
|
||||
$string['auth_pop3port'] = "Server port (110 er mest almindelig)";
|
||||
$string['auth_pop3title'] = "Brug en POP3 server";
|
||||
$string['auth_pop3type'] = "Server type. Hvis din server anvender certificate security, vælg pop3cert.";
|
||||
$string['authenticationoptions'] = "Godkendelses options";
|
||||
$string['authinstructions'] = "Her kan du komme med anvisninger til dine brugere om, hvordan de skal oprette username og password. Teksten du skriver her, vil blive vist på login siden. Hvis du ikke skriver noget her, vil der ikke vises noget på login siden.";
|
||||
$string['changepassword'] = "Lav password URL om";
|
||||
$string['changepasswordhelp'] = "Her kan du angive et sted, hvor dine brugere kan finde eller ændre deres username/password, hvis de har glemt det. Brugerne vil få vist en knap på login siden. Hvis du ikke skriver noget her, vil knappen ikke blive vist.";
|
||||
$string['chooseauthmethod'] = "Vælg en godkendelses metode";
|
||||
$string['guestloginbutton'] = "Gæste login knap";
|
||||
$string['instructions'] = "Instruktioner";
|
||||
$string['md5'] = "MD5 kryptering";
|
||||
$string['plaintext'] = "Alm. text";
|
||||
$string['showguestlogin'] = "Du kan vise eller gemme gæste login knappen på login-siden.";
|
||||
|
||||
?>
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
<?PHP // $Id$
|
||||
// choice.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['answered'] = "Besvaret";
|
||||
$string['choice'] = "Spørgsmål \$a";
|
||||
$string['choicename'] = "Spørgsmål navn";
|
||||
$string['choicetext'] = "Spørgsmål tekst";
|
||||
$string['modulename'] = "Spørgsmål";
|
||||
$string['modulenameplural'] = "Spørgsmål";
|
||||
$string['notanswered'] = "Ikke besvaret endnu";
|
||||
$string['publish'] = "Vis resultater";
|
||||
$string['publishanonymous'] = "Vis anonyme resultater uden at angive de studerendes navne";
|
||||
$string['publishnames'] = "Vis alle resultataer, med navne og spørgsmål";
|
||||
$string['publishnot'] = "Vis ikke resultaterne til de studerende";
|
||||
$string['responses'] = "Besvarelser";
|
||||
$string['responsesto'] = "Besvarelser til\$a";
|
||||
$string['savemychoice'] = "Gem mit spørgsmål";
|
||||
$string['viewallresponses'] = "Se \$a besvarelser";
|
||||
|
||||
?>
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
<?PHP // $Id$
|
||||
// forum.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['addanewdiscussion'] = "Tilføj et nyt emne";
|
||||
$string['allowchoice'] = "Tillad alle at vælge";
|
||||
$string['allowdiscussions'] = "Kan en \$a skrive i dette forum?";
|
||||
$string['allowratings'] = "Tillad ratings af indlæg?";
|
||||
$string['allowsdiscussions'] = "Dette forum tillader hver person at starte en diskussion.";
|
||||
$string['anyfile'] = "Alle filer";
|
||||
$string['attachment'] = "Vedhæftet fil";
|
||||
$string['bynameondate'] = "ved \$a->name - \$a->date";
|
||||
$string['couldnotadd'] = "Kunne ikke tilføje dit indlæg pga en ukendt fejl";
|
||||
$string['couldnotdeleteratings'] = "Beklager, kan ikke slettes da andre allerede har rated det.";
|
||||
$string['couldnotdeletereplies'] = "Beklager, kan ikke slettes, da andre allerede har svaret på det.";
|
||||
$string['couldnotupdate'] = "Kunne ikke opdatere dit indlæg pga en ukendt fejl.";
|
||||
$string['delete'] = "Slet";
|
||||
$string['deleteddiscussion'] = "Emnet er slettet";
|
||||
$string['deletedpost'] = "Indlægget er slettet";
|
||||
$string['deletesure'] = "Er du sikker på, at du vil slette dette indlæg?";
|
||||
$string['discussion'] = "Diskussion";
|
||||
$string['discussions'] = "Diskussioner";
|
||||
$string['discussionsstartedby'] = "Diskussioner startet af \$a";
|
||||
$string['discussthistopic'] = "Diskutér dette emne";
|
||||
$string['eachuserforum'] = "Hver person starter én diskussion";
|
||||
$string['edit'] = "Redigér";
|
||||
$string['editing'] = "Redigerer";
|
||||
$string['emptymessage'] = "Noget er galt med dit indlæg. Måske har du ikke skrevet noget eller er den vedhæftede fil for stor. Dine ændringer er IKKE blevet gemt.";
|
||||
$string['everyonecanchoose'] = "Alle kan vælge at blive meldt til";
|
||||
$string['everyoneissubscribed'] = "Alle er meldt til dette forum";
|
||||
$string['forcesubscribe'] = "Tilmeld alle";
|
||||
$string['forcesubscribeq'] = "Skal alle tilmeldes?";
|
||||
$string['forum'] = "Forum";
|
||||
$string['forumintro'] = "Forum intro";
|
||||
$string['forumname'] = "Forum navn";
|
||||
$string['forums'] = "Forum";
|
||||
$string['forumtype'] = "Forum type";
|
||||
$string['generalforum'] = "Standard forum til almindeligt brug";
|
||||
$string['generalforums'] = "Standard forums";
|
||||
$string['inforum'] = "i \$a";
|
||||
$string['intronews'] = "Nyheder og meddelelser";
|
||||
$string['introsocial'] = "Et åbent forum med det emne, som du har lyst til at få diskuteret.";
|
||||
$string['introteacher'] = "Et forum kun for lærer noter og diskussioner";
|
||||
$string['learningforums'] = "Forum til læring";
|
||||
$string['maxtimehaspassed'] = "Beklager, men tiden er gået (\$a) og du kan ikke redigere i indlægget mere! ";
|
||||
$string['message'] = "Meddelelse";
|
||||
$string['modeflatnewestfirst'] = "Viser svar i flad struktur med den nyeste først";
|
||||
$string['modeflatoldestfirst'] = "Viser svar i flad struktur med den ældste først";
|
||||
$string['modenested'] = "Viser svar i trinvis struktur";
|
||||
$string['modethreaded'] = "Viser svar i trådet struktur";
|
||||
$string['modulename'] = "Forum";
|
||||
$string['modulenameplural'] = "Forum";
|
||||
$string['more'] = "mere";
|
||||
$string['namenews'] = "Nyheds forum";
|
||||
$string['namesocial'] = "Social forum";
|
||||
$string['nameteacher'] = "Lærer forum";
|
||||
$string['newforumposts'] = "Nyt indlæg";
|
||||
$string['nodiscussions'] = "Der er endnu ingen emner i dette forum";
|
||||
$string['noguestpost'] = "Beklager, gæster kan ikke skrive indlæg.";
|
||||
$string['noposts'] = "Ingen indlæg";
|
||||
$string['nopostscontaining'] = "Ingen indlæg indeholdende '\$a' blev fundet";
|
||||
$string['nosubscribers'] = "Der er endnu ingen tilmeldte i dette forum";
|
||||
$string['nownotsubscribed'] = "\$a->name vil ikke modtage kopier af'\$a->forum' pr. email.";
|
||||
$string['nowsubscribed'] = "\$a->name vil modtage kopier af'\$a->forum' pr. email.";
|
||||
$string['numposts'] = "\$a indlæg";
|
||||
$string['olderdiscussions'] = "Tidligere diskussioner";
|
||||
$string['openmode0'] = "Ingen diskussioner, ingen svar";
|
||||
$string['openmode1'] = "Ingen diskussioner, men svar er tilladte";
|
||||
$string['openmode2'] = "Diskussioner og svar er tilladte";
|
||||
$string['parentofthispost'] = "Første indlæg";
|
||||
$string['postadded'] = "Dit indlæg er tilføjet.<P>Du har \$a til at redigere i det, hvis du vil ændre noget.";
|
||||
$string['postincontext'] = "Se dette indlægs indhold";
|
||||
$string['postmailinfo'] = "Dette er en kopi af en meddelelse fra \$a websted.
|
||||
For at give et svar via webstedet, klik på følgende link:";
|
||||
$string['postrating1'] = "Viser som regel INDIVIDUEL viden";
|
||||
$string['postrating2'] = "Hver individuel og sammenhængende";
|
||||
$string['postrating3'] = "Viser som regel sammenhængende viden";
|
||||
$string['postupdated'] = "Dit indlæg er opdateret";
|
||||
$string['processingpost'] = "Behandler indlæg \$a";
|
||||
$string['rate'] = "Rate";
|
||||
$string['ratings'] = "Ratings";
|
||||
$string['ratingssaved'] = "Ratings gemt";
|
||||
$string['re'] = "Ang:";
|
||||
$string['readtherest'] = "Læs resten af dette emne";
|
||||
$string['repliesmany'] = "\$a svar indtil videre";
|
||||
$string['repliesone'] = "\$a svar indtil videre";
|
||||
$string['reply'] = "Svar";
|
||||
$string['search'] = "Søg";
|
||||
$string['searchforums'] = "Søg i forum";
|
||||
$string['searchresults'] = "Søge resultater";
|
||||
$string['sendinratings'] = "Indsend mine sidste ratings";
|
||||
$string['showsubscribers'] = "Vis deltagere";
|
||||
$string['singleforum'] = "En simpel diskussion";
|
||||
$string['subject'] = "Emne";
|
||||
$string['subscribe'] = "Tilmeld dig dette forum";
|
||||
$string['subscribed'] = "Tilmeldt";
|
||||
$string['subscribers'] = "Tilmeldte";
|
||||
$string['subscribersto'] = "Tilmeldte til '\$a'";
|
||||
$string['unsubscribe'] = "Frameld dig dette forum";
|
||||
$string['youratedthis'] = "Du har rated dette";
|
||||
$string['yournewtopic'] = "Dit nye diskussionsemne";
|
||||
$string['yourreply'] = "Your svar";
|
||||
|
||||
?>
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
<?PHP // $Id$
|
||||
// journal.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['alwaysopen'] = "Altid åben";
|
||||
$string['blankentry'] = "Tomt indlæg";
|
||||
$string['daysavailable'] = "Dage til rådighed";
|
||||
$string['editingended'] = "Redigerings perioden er slut";
|
||||
$string['editingends'] = "Redigeringsperioden slutter";
|
||||
$string['feedbackupdated'] = "Feedback opdateret for \$a indlæg";
|
||||
$string['journalname'] = "Logbog navn";
|
||||
$string['journalquestion'] = "Logbog spørgsmål";
|
||||
$string['journalrating1'] = "Ikke tilfredsstillende";
|
||||
$string['journalrating2'] = "Tilfredsstillende";
|
||||
$string['journalrating3'] = "Fantastisk";
|
||||
$string['modulename'] = "Logbog";
|
||||
$string['modulenameplural'] = "Logbøger";
|
||||
$string['newjournalentries'] = "Nyt indlæg i logbog";
|
||||
$string['noentry'] = "Intet indlæg";
|
||||
$string['noratinggiven'] = "Bedømmelse ikke givet";
|
||||
$string['notopenuntil'] = "Denne logbog åbner ikke førend";
|
||||
$string['notstarted'] = "Du har ikke begyndt på denne logbog endnu";
|
||||
$string['overallrating'] = "Endelig bedømmelse";
|
||||
$string['rate'] = "Bedøm";
|
||||
$string['saveallfeedback'] = "Gem alle mine feedback";
|
||||
$string['startoredit'] = "Start eller rediger i min logbog";
|
||||
$string['viewallentries'] = "Se \$a indlæg i logbogen";
|
||||
|
||||
?>
|
||||
Executable
+517
@@ -0,0 +1,517 @@
|
||||
<?PHP // $Id$
|
||||
// moodle.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['action'] = "Hændelse";
|
||||
$string['activities'] = "Aktiviteter";
|
||||
$string['activity'] = "Aktivitet";
|
||||
$string['activityreport'] = "Aktivitets rapport";
|
||||
$string['add'] = "Tilføj";
|
||||
$string['addadmin'] = "Tilføj admin";
|
||||
$string['added'] = "Tilføjet \$a";
|
||||
$string['addinganew'] = "Tilføje en/et ny(t) \$a";
|
||||
$string['addinganewto'] = "Tilføje en/et ny(t)\$a->hvad til \$a->til";
|
||||
$string['addnewcourse'] = "Tilføj et nyt kursus";
|
||||
$string['addnewuser'] = "Tilføj en ny bruger";
|
||||
$string['address'] = "Addresse";
|
||||
$string['addteacher'] = "Tilføj lærer";
|
||||
$string['admin'] = "Admin";
|
||||
$string['administration'] = "Administration";
|
||||
$string['again'] = "igen";
|
||||
$string['all'] = "All";
|
||||
$string['alldays'] = "Alle dage";
|
||||
$string['allfieldsrequired'] = "Alle felter skal udfyldes";
|
||||
$string['alllogs'] = "Alle logs";
|
||||
$string['allow'] = "Tillad";
|
||||
$string['allowguests'] = "Dette kursus tillader gæster";
|
||||
$string['allownot'] = "Tillad ikke";
|
||||
$string['allparticipants'] = "Alle deltagere";
|
||||
$string['alphanumerical'] = "Kan kun indeholde bogstaver eller tal";
|
||||
$string['alreadyconfirmed'] = "Registrering er allerede bekræftet";
|
||||
$string['answer'] = "Svar";
|
||||
$string['assessment'] = "Opgave";
|
||||
$string['assignadmins'] = "Tilføj administratorer";
|
||||
$string['assignteachers'] = "Tilføj instruktører";
|
||||
$string['authentication'] = "Validering";
|
||||
$string['availablecourses'] = "Tilgængelige kurser";
|
||||
$string['cancel'] = "Slet";
|
||||
$string['categories'] = "Kursus kategorier";
|
||||
$string['category'] = "Kategori";
|
||||
$string['categoryadded'] = "Kategorien'\$a' blev tilføjet";
|
||||
$string['categorydeleted'] = "Kategorien'\$a' blev slettet";
|
||||
$string['changedpassword'] = "Ændret password";
|
||||
$string['changepassword'] = "Ændre password";
|
||||
$string['changessaved'] = "Ændringer gemt";
|
||||
$string['checklanguage'] = "Sprogindstillinger";
|
||||
$string['choose'] = "Vælg";
|
||||
$string['choosecourse'] = "Vælg et kursus";
|
||||
$string['chooselivelogs'] = "Eller vælg igangværende aktivitet";
|
||||
$string['chooselogs'] = "Vælg hvilke logs du vil se";
|
||||
$string['choosetheme'] = "Vælg tema";
|
||||
$string['chooseuser'] = "Vælg en bruger";
|
||||
$string['city'] = "By";
|
||||
$string['closewindow'] = "Luk dette vindue";
|
||||
$string['comparelanguage'] = "Sammenlign og redigér i sprog";
|
||||
$string['complete'] = "Færdiggør";
|
||||
$string['configcountry'] = "Hvis du vælger et land her, vil dette land blive valgt som default af nye brugere. For at tvinge brugere til at vælge land, skal du ikke vælge noget her.";
|
||||
$string['configdebug'] = "Hvis du sætter denne til, vil PHP's fejlmeldinger øges og der vil printes flere af dem. Dette er kun for udviklere.";
|
||||
$string['configerrorlevel'] = "Vælg mængden af PHP advarsler, som du vil have vist. Normal er som regel det bedste valg.";
|
||||
$string['configgdversion'] = "Indikerer hvilken version af GD, som er valgt. Versionen, der vises som default, er den, som er blevet autodetected. Du skal ikke ændre den, med mindre du ved, hvad du gør.";
|
||||
$string['confightmleditor'] = "Vælg om du vil tillade brug af den tilhørende HTML editor. Selv om du vælger \"tillad\", vil denne editor kun komme frem, hvis brugeren bruger en kompatibel browser (IE 5.5 eller senere versioner). Brugere kan også vælge ikke at bruge den.";
|
||||
$string['configintro'] = "På denne side kan du vælge et antal variabler til konfiguration, som få Moodle til at virke bedre på din server. Normalt vil default indstillingerne virke fint og du kan altid vende tilbage til denne side og ændre indstillingerne. ";
|
||||
$string['configlang'] = "Vælg et default sprog for hele sitet. Brugere kan override dette senere";
|
||||
$string['configlangdir'] = "De fleste sprog skrives fra venstre til højre, men nogle, som arabisk og hebræisk, skrives fra højre til venstre.";
|
||||
$string['configlocale'] = "Lokalindstillinger for dit site. Det vil have indflydelse på format og sprog med hensyn til datoer. Du skal have disse lokalindstillinger installeret på din operativ system (f.eks. en_US eller en_ES). Hvis du ikke ved, hvad du skal vælge, så lad feltet stå tomt.";
|
||||
$string['configlongtimenosee'] = "Hvis kursisterne ikke har været logget på i lang tid, så bliver de automatisk slettet fra kurset. Denne indstilling sætter tidsbegrænsningen.";
|
||||
$string['configmaxeditingtime'] = "Denne angiver hvor lang tid brugerne har til editere i deres indlæg i et forum, logbog etc. Normalt er 30 minutter en god værdi.";
|
||||
$string['configproxyhost'] = "Hvis denne<B>server</B> skal bruge en proxy computer (f.eks. en firewall) for at komme på Internettet, så skriv proxy hostnavn og port her.";
|
||||
$string['configslasharguments'] = "Filer (billeder, dokumenter etc.) tilføjes et script (anden option her), som gør at filen lettere hentes i webbrowsere, proxyservere etc. Uheldigvis tillader nogle PHP servere ikke denne metode, så hvis du har problemer med at få vist uploadede filer eller billeder (f.eks. billeder af brugerne), skal du vælge den første option.";
|
||||
$string['configsmtphosts'] = "Angiv fuld navn til en eller flere STMP servere som Moodle skal bruge til at sende mail (f.eks. mail.a.com, mail.b.com etc.) Hvis du intet angiver vil Moodle bruge PHP default metoden til at sende mail.";
|
||||
$string['configsmtpuser'] = "Hvis du har angivet en STMP server herover, og serveren kræver brugernavn og password, så indtast det her.";
|
||||
$string['configunzip'] = "Indikerer placeringen af dit unzip program (kun for Unix). Dette for at kunne unzippe filer til serveren.";
|
||||
$string['configvariables'] = "Instillinger af variabler";
|
||||
$string['configzip'] = "Indikerer placeringen af dit zip program ( kun for Unix). Dette for at kunne zippe filer på serveren.
|
||||
";
|
||||
$string['confirmed'] = "Registreringen er blevet bekræftet";
|
||||
$string['continue'] = "Fortsæt";
|
||||
$string['cookiesenabled'] = "Du skal slå cookies til i din browser";
|
||||
$string['copyrightnotice'] = "Copyright notice";
|
||||
$string['country'] = "Land";
|
||||
$string['course'] = "Kursus";
|
||||
$string['courseformats'] = "Kursus format";
|
||||
$string['courses'] = "Kurser";
|
||||
$string['courseupdates'] = "Kursus opdateringer";
|
||||
$string['createaccount'] = "Opret min nye konto";
|
||||
$string['createuserandpass'] = "Opret et nyt username og password";
|
||||
$string['createziparchive'] = "Opret zip arkiv";
|
||||
$string['currentlanguage'] = "Sprogvalg";
|
||||
$string['currentlocaltime'] = "Din lokal tid";
|
||||
$string['databasechecking'] = "Opgraderer Moodle database fra version\$a->oldversion til \$a->newversion...";
|
||||
$string['databasesetup'] = "Opsætning af database";
|
||||
$string['databasesuccess'] = "Databasen opgraderet og OK";
|
||||
$string['databaseupgrades'] = "Opgraderer database";
|
||||
$string['day'] = "dag";
|
||||
$string['days'] = "dage";
|
||||
$string['defaultcoursefullname'] = "Kursus 101";
|
||||
$string['defaultcourseshortname'] = "K101";
|
||||
$string['defaultcoursestudent'] = "Studerende";
|
||||
$string['defaultcoursestudents'] = "Studerende";
|
||||
$string['defaultcoursesummary'] = "Giv her en præcis og klar beskrivelse af dette kursus.";
|
||||
$string['defaultcourseteacher'] = "Lærer";
|
||||
$string['defaultcourseteachers'] = "Lærere";
|
||||
$string['delete'] = "Slet";
|
||||
$string['deletecheck'] = "Slet \$a ?";
|
||||
$string['deletecheckfull'] = "Er du helt sikker på at du vil slette \$a ?";
|
||||
$string['deletecompletely'] = "Slet alt";
|
||||
$string['deletecourse'] = "Slet et kursus";
|
||||
$string['deletecoursecheck'] = "Er du helt sikker på at du vil slette dette kursus og alt indhold?";
|
||||
$string['deleted'] = "Slettet";
|
||||
$string['deletedactivity'] = "Slettet \$a";
|
||||
$string['deletedcourse'] = "\$a er fuldstændigt slettet";
|
||||
$string['deletednot'] = "Kunne ikke slette \$a !";
|
||||
$string['deletingcourse'] = "Slette \$a";
|
||||
$string['department'] = "Afdeling";
|
||||
$string['description'] = "Beskrivelse";
|
||||
$string['displayingrecords'] = "Viser \$a registreinger";
|
||||
$string['displayingusers'] = "Viser brugere \$a->start til \$a->slut";
|
||||
$string['documentation'] = "Moodle Dokumentation";
|
||||
$string['downloadexcel'] = "Download i Excel format";
|
||||
$string['downloadtext'] = "Download i text format";
|
||||
$string['doyouagree'] = "Har du læst og forstået disse betingelser?";
|
||||
$string['edit'] = "Rediger \$a";
|
||||
$string['editcoursesettings'] = "Rediger kursusindstillinger";
|
||||
$string['editinga'] = "Redigerer en \$a";
|
||||
$string['editmyprofile'] = "Rediger profil";
|
||||
$string['editsummary'] = "Rediger tekst";
|
||||
$string['editthisactivity'] = "Rediger denne aktivitet";
|
||||
$string['edituser'] = "Rediger bruger konti";
|
||||
$string['email'] = "Email addresse";
|
||||
$string['emailconfirm'] = "Bekræft din konto";
|
||||
$string['emailconfirmation'] = "Hej \$a->firstname,
|
||||
|
||||
En ny konto er oprettet på'\$a->sitename'
|
||||
med din email addresse.
|
||||
|
||||
For at bekræfte din oprettelse gå til følgende web addresse:
|
||||
|
||||
\$a->link
|
||||
|
||||
I de fleste mail programmer kommer linket med blå skrift
|
||||
som du kan klikke på. Hvis det ikke virker,
|
||||
så kan du \"cut and paste\" addressen i addresse feltet i toppen af dit browservindue.
|
||||
|
||||
Cheers fra '\$a->sitename' administrator,
|
||||
\$a->admin";
|
||||
$string['emailconfirmsent'] = " <P>En email addresse skulle være sendt til din addresse <B>\$a</B>
|
||||
<P>Den indeholder anvisninger på, hvordan du kan blive registreret.
|
||||
<P>Hvis du stadig har problemer, så kontakt web administratoren.";
|
||||
$string['emaildisplay'] = "Vis Email ";
|
||||
$string['emaildisplaycourse'] = "Tillad kun andre kursusdeltagere at se min email addresse";
|
||||
$string['emaildisplayno'] = "Gem min rigtige email addresse fra alle";
|
||||
$string['emaildisplayyes'] = "Tillad alle at se min email addresse";
|
||||
$string['emailexists'] = "Denne email addresse er allerede registreret.";
|
||||
$string['emailformat'] = "Email format";
|
||||
$string['emailmustbereal'] = "OBS: Din email addresse skal udfyldes rigtigt";
|
||||
$string['enrolmentkey'] = "Kursus nøgle";
|
||||
$string['enrolmentkeyfrom'] = "Dette kursus kræver en kursusnøgle' - et en-gangs<BR>
|
||||
password som du skulle have fået fra \$a";
|
||||
$string['enrolmentkeyhint'] = "Forkert kursusnøgle - prøv igen<BR>
|
||||
(Her er et hint - det starter med '\$a')";
|
||||
$string['entercourse'] = "Klik for at komme ind på kurset";
|
||||
$string['enteremailaddress'] = "Indtast din email addresse for at re-sette dit
|
||||
password og du får et nyt password sendt med en email";
|
||||
$string['error'] = "Fejl";
|
||||
$string['errortoomanylogins'] = "Beklager, du har oversteget antallet af gange, hvor du kan prøve at logge ind. Restart din browser";
|
||||
$string['existingadmins'] = "Oprettede administratorer";
|
||||
$string['existingteachers'] = "Oprettede lærere";
|
||||
$string['feedback'] = "Feedback";
|
||||
$string['filemissing'] = "\$a mangler";
|
||||
$string['files'] = "Filer";
|
||||
$string['filloutallfields'] = "Udfyld venligst alle felter i denne formular";
|
||||
$string['firstname'] = "Fornavn(e)";
|
||||
$string['firsttime'] = "Er det dit første besøg?";
|
||||
$string['followingoptional'] = "Følgende er frivilligt at udfylde";
|
||||
$string['followingrequired'] = "Følgende SKAL udfyldes";
|
||||
$string['forgotten'] = "Har du glemt dit username og password?";
|
||||
$string['format'] = "Format";
|
||||
$string['formathtml'] = "HTML format";
|
||||
$string['formatsocial'] = "Social format";
|
||||
$string['formattext'] = "Moodle auto-format";
|
||||
$string['formattexttype'] = "Formattering";
|
||||
$string['formattopics'] = "Emne format";
|
||||
$string['formatweeks'] = "Uge format";
|
||||
$string['frontpagedescription'] = "Forside beskrivelse";
|
||||
$string['frontpageformat'] = "Forside format";
|
||||
$string['fulllistofcourses'] = "Alle kurser";
|
||||
$string['fullname'] = "Fulde navn";
|
||||
$string['fullprofile'] = "Fulde profil";
|
||||
$string['fullsitename'] = "Fulde site navn";
|
||||
$string['gd1'] = "GD 1.x er installeret";
|
||||
$string['gd2'] = "GD 2.x er installeret";
|
||||
$string['gdneed'] = "GD skal installeres for at kunne se denne graf";
|
||||
$string['gdnot'] = "GD er ikke installeret";
|
||||
$string['gpl'] = "Copyright (C) 2001-2002 Martin Dougiamas (http://dougiamas.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details:
|
||||
|
||||
http://www.gnu.org/copyleft/gpl.html";
|
||||
$string['grade'] = "Karakter";
|
||||
$string['grades'] = "Karakterer";
|
||||
$string['guestskey'] = "Tillad at gæster får nøglen";
|
||||
$string['guestsno'] = "Tillad ikke gæster";
|
||||
$string['guestsnotallowed'] = "Beklager, '\$a' tillader ikke gæsteadgang.";
|
||||
$string['guestsyes'] = "Tillad gæster uden nøgle";
|
||||
$string['guestuser'] = "Gæst";
|
||||
$string['guestuserinfo'] = "Denne bruger tillades kun læseadgang til nogle kurser.";
|
||||
$string['help'] = "Hjælp";
|
||||
$string['helphtml'] = "Hvordan skriver man html";
|
||||
$string['helppicture'] = "Hvordan uploader man et billede";
|
||||
$string['helpquestions'] = "Stil gode spørgsmål";
|
||||
$string['helpreading'] = "Læs omhyggeligt";
|
||||
$string['helprichtext'] = "Om Richtext editor";
|
||||
$string['helptext'] = "Hvordan skriver man tekst";
|
||||
$string['helpwriting'] = "Skriv omhyggeligt";
|
||||
$string['hide'] = "Gem";
|
||||
$string['hits'] = "Hits";
|
||||
$string['hitsoncourse'] = "Hits på \$a->coursename af \$a->username";
|
||||
$string['hitsoncoursetoday'] = "Dagens hits på \$a->coursename af \$a->username";
|
||||
$string['home'] = "Home";
|
||||
$string['hour'] = "time";
|
||||
$string['hours'] = "timer";
|
||||
$string['howtomakethemes'] = "Hvordan laver man nye temaer";
|
||||
$string['htmleditor'] = "Brug Richtext HTML editor (Kun IE, 5.5 eller senere)";
|
||||
$string['htmleditoravailable'] = "Richtext editor'en er tilgængelig";
|
||||
$string['htmleditordisabled'] = "Du har slået Richtext editor'en fra i din brugerprofil";
|
||||
$string['htmleditordisabledadmin'] = "Administratoren har slået Richtext editor'en fra på dette site";
|
||||
$string['htmleditordisabledbrowser'] = "Richtext editor'en kan ikke bruges, da du ikke bruger Internet Explorer 5.5 eller senere udgaver";
|
||||
$string['htmlformat'] = "Pretty HTML format";
|
||||
$string['icqnumber'] = "ICQ nummer";
|
||||
$string['idnumber'] = "ID nummer";
|
||||
$string['invalidemail'] = "Invalid email addresse";
|
||||
$string['invalidlogin'] = "Invalid login, prøv igen";
|
||||
$string['jumpto'] = "Gå til...";
|
||||
$string['langltr'] = "Sprog fra ventre mod højre";
|
||||
$string['langrtl'] = "Sprog fra højre mod venstre";
|
||||
$string['language'] = "Sprog";
|
||||
$string['languagegood'] = "Denne sprogpakke er up-to-date! :-)";
|
||||
$string['lastaccess'] = "Sidst set";
|
||||
$string['lastedited'] = "Sidst redigeret";
|
||||
$string['lastmodified'] = "Sidst ændret";
|
||||
$string['lastname'] = "Efternavn";
|
||||
$string['latestnews'] = "Sidste nyt";
|
||||
$string['leavetokeep'] = "For at beholde nuværende password: skriv ikke noget i dette felt";
|
||||
$string['license'] = "GPL License";
|
||||
$string['listofallpeople'] = "Liste over alle";
|
||||
$string['livelogs'] = "Live logs fra den sidste time";
|
||||
$string['locale'] = "da_DK";
|
||||
$string['location'] = "Sted";
|
||||
$string['loggedinas'] = "Du er logget ind som \$a ";
|
||||
$string['loggedinnot'] = "Du er ikke logget ind";
|
||||
$string['login'] = "Login";
|
||||
$string['loginas'] = "Login som";
|
||||
$string['loginguest'] = "Login som gæst";
|
||||
$string['loginsite'] = "Login til dette site";
|
||||
$string['loginsteps'] = "Hej! For at få fuld adgang til dette kursus skal du lige bruge lidt tid til at lave en ny konto.
|
||||
|
||||
Hvert enkelt kursus kan også have en "kursusnøgle", den skal du først bruge senere. Sådan gør du:
|
||||
<OL size=2>
|
||||
<LI>Udfyld <A HREF=\$a>Ny Konto</A> formularen med dine oplysninger.
|
||||
<LI>En email vil derefter blive sendt til din email addresse.
|
||||
<LI>Læs din email og klik på det medfølgende link.
|
||||
<LI>Din konto bliver bekræftet og du bliver logget ind.
|
||||
<LI>Vælg derefter det kursus, som du vil deltage i.
|
||||
<LI>Hvis du bliver bedt om en "kursusnøgle" - brug den, som du har fået tilsendt. Det vil "give dig adgang" til kurset. <LI>Du har nu fuld adgang til kurset og fra nu af behøver du kun at bruge username og password for at logge dig ind på kurset.
|
||||
</OL>";
|
||||
$string['loginstepsnone'] = "Hej!<P>For at få fuld adgang til kurset er du nødt til at lave dig en ny konto.<P>Det du skal gøre, er at lave dig et username og et password og indsætte det i formularen på denne side.<P>Hvis andre allerede har valgt dit username, er du nødt til at prøve igen med et andet.";
|
||||
$string['loginto'] = "Login til \$a";
|
||||
$string['loginusing'] = "Login her med username og password";
|
||||
$string['logout'] = "Log ud";
|
||||
$string['logs'] = "Logs";
|
||||
$string['mainmenu'] = "Hovedmenu";
|
||||
$string['makeafolder'] = "Lav en folder";
|
||||
$string['makeeditable'] = "Hvis du gør at '\$a' kan redigeres af web serveren (f.eks. apache) så kan du redigere file direkte fra denne side.";
|
||||
$string['managedatabase'] = "Database management";
|
||||
$string['markthistopic'] = "Marker dette emne som det igangværende";
|
||||
$string['maximumchars'] = "Maximum af \$a karakterer";
|
||||
$string['maximumgrade'] = "Maximum karakter";
|
||||
$string['maximumshort'] = "Max";
|
||||
$string['maxsize'] = "Max størrelse: \$a";
|
||||
$string['min'] = "min";
|
||||
$string['mins'] = "mins";
|
||||
$string['miscellaneous'] = "Andre";
|
||||
$string['missingcategory'] = "Du skal vælge en kategori";
|
||||
$string['missingcity'] = "Mangler by";
|
||||
$string['missingcountry'] = "Mangler land";
|
||||
$string['missingdescription'] = "Mangler beskrivelse";
|
||||
$string['missingemail'] = "Mangler email addresse";
|
||||
$string['missingfirstname'] = "Mangler fornavn";
|
||||
$string['missingfullname'] = "Mangler fulde navn";
|
||||
$string['missinglastname'] = "Mangler efternavn";
|
||||
$string['missingnewpassword'] = "Mangler nyt password";
|
||||
$string['missingpassword'] = "Mangler password";
|
||||
$string['missingshortname'] = "Mangler kort navn";
|
||||
$string['missingshortsitename'] = "Mangler kort site navn";
|
||||
$string['missingsitedescription'] = "Mangler site beskrivelse";
|
||||
$string['missingsitename'] = "Mangler site navn";
|
||||
$string['missingstrings'] = "Check for manglende strings";
|
||||
$string['missingstudent'] = "Du skal vælge noget";
|
||||
$string['missingsummary'] = "Mangler beskrivelse";
|
||||
$string['missingteacher'] = "Du skal vælge noget";
|
||||
$string['missingusername'] = "Mangler username";
|
||||
$string['modified'] = "Ændret";
|
||||
$string['modulesetup'] = "Sætter modul tabeller op";
|
||||
$string['modulesuccess'] = "\$a tabeller er sat op ";
|
||||
$string['mostrecently'] = "sidste";
|
||||
$string['movedown'] = "Flyt ned";
|
||||
$string['movefilestohere'] = "Flyt filer hertil";
|
||||
$string['movetoanotherfolder'] = "Flyt til en anden folder";
|
||||
$string['moveup'] = "Flyt op";
|
||||
$string['mustconfirm'] = "Du skal bekræfte din login";
|
||||
$string['mycourses'] = "Mine kurser";
|
||||
$string['name'] = "Navn";
|
||||
$string['namesocial'] = "sektion";
|
||||
$string['nametopics'] = "emne";
|
||||
$string['nameweeks'] = "uge";
|
||||
$string['never'] = "Aldrig";
|
||||
$string['new'] = "Ny";
|
||||
$string['newaccount'] = "Ny konto";
|
||||
$string['newpassword'] = "Nyt password";
|
||||
$string['newpasswordtext'] = "Hi \$a->firstname,
|
||||
|
||||
Dit password til '\$a->sitename' er ændret og du har fået et nyt midlertidigt password.
|
||||
|
||||
Dine login info er nu:
|
||||
username: \$a->username
|
||||
password: \$a->newpassword
|
||||
|
||||
Gå til denne side for at ændre dit password:
|
||||
\$a->link
|
||||
|
||||
I de fleste mailprogrammer kommer det op som et blåt link, som du kan klikke på. Hvis det ikke virker, kan du cut and paste addressen op i addressefeltet i toppen af din.
|
||||
|
||||
Cheers fra '\$a->sitename' administrator,
|
||||
\$a->signoff
|
||||
";
|
||||
$string['newpicture'] = "Nyt billede";
|
||||
$string['newsitem'] = "nyhed";
|
||||
$string['newsitems'] = "nyheder";
|
||||
$string['newsitemsnumber'] = "Vis nyheder";
|
||||
$string['newuser'] = "Ny bruger";
|
||||
$string['newusers'] = "Nye brugere";
|
||||
$string['no'] = "Nej";
|
||||
$string['nocoursesyet'] = "Ingen kurser i denne kategori";
|
||||
$string['noexistingadmins'] = "Ingen eksisterende administratorer. En alvorlig fejl og du burde ikke have sendt denne meddelelse.";
|
||||
$string['noexistingteachers'] = "Ingen eksisterende lærere";
|
||||
$string['nofilesyet'] = "Ingen filer er uploaded til dit kursus endnu";
|
||||
$string['nograde'] = "Ingen karakter";
|
||||
$string['noimagesyet'] = "Ingen billeder er uploaded til dit kursus endnu";
|
||||
$string['none'] = "Ingen";
|
||||
$string['nopotentialadmins'] = "In potentielle administratorer";
|
||||
$string['nopotentialteachers'] = "Ingen potentielle lærere";
|
||||
$string['normal'] = "Normal";
|
||||
$string['nostudentsyet'] = "Ingen studerende endnu";
|
||||
$string['nosuchemail'] = "email addresse eksisterer ikke";
|
||||
$string['noteachersyet'] = "Ingen lærere endnu";
|
||||
$string['notenrolled'] = "\$a er ikke deltager på dette kursus endnu.";
|
||||
$string['nothingnew'] = "Intet nyt siden din sidste login.";
|
||||
$string['nousersyet'] = "Ingen brugere endnu";
|
||||
$string['now'] = "nu";
|
||||
$string['numberweeks'] = "Antal af uger/emner";
|
||||
$string['numdays'] = "\$a dage";
|
||||
$string['numminutes'] = "\$a minutter";
|
||||
$string['numviews'] = "set \$a gange";
|
||||
$string['numweeks'] = "\$a uger";
|
||||
$string['numwords'] = "\$a ord";
|
||||
$string['numyears'] = "\$a år";
|
||||
$string['ok'] = "OK";
|
||||
$string['opentoguests'] = "Gæste adgang";
|
||||
$string['optional'] = "optional";
|
||||
$string['order'] = "Bestil";
|
||||
$string['outline'] = "Beskrivelse";
|
||||
$string['participants'] = "Deltagere";
|
||||
$string['password'] = "Password";
|
||||
$string['passwordchanged'] = "Password er ændret";
|
||||
$string['passwordrecovery'] = "Ja, hjælp mig med at logge ind";
|
||||
$string['passwordsdiffer'] = "Disse passwords matcher ikke";
|
||||
$string['passwordsent'] = "Password er sendt";
|
||||
$string['passwordsenttext'] = " <P>An email has been sent to your address at \$a->email.
|
||||
<P><B>Check din email for nyt password</B>
|
||||
<P>Det nye password er genereret automatisk, så du vil måske
|
||||
<A HREF=\$a->link>ændre det til noget, som du nemmere kan huske</A>.";
|
||||
$string['people'] = "Deltagere";
|
||||
$string['personalprofile'] = "Personlig profil";
|
||||
$string['phone'] = "Telefon nr.";
|
||||
$string['potentialadmins'] = "Potentielle administratorer";
|
||||
$string['potentialteachers'] = "Potentielle lærere";
|
||||
$string['preferredlanguage'] = "Valgte sprog";
|
||||
$string['preview'] = "Preview";
|
||||
$string['previeworchoose'] = "Preview eller vælg et tema";
|
||||
$string['question'] = "Spørgsmål";
|
||||
$string['readme'] = "README";
|
||||
$string['recentactivity'] = "Sidste aktivitet(er)";
|
||||
$string['removeadmin'] = "Fjern administrator";
|
||||
$string['removeteacher'] = "Fjern lærer";
|
||||
$string['rename'] = "Omdøb";
|
||||
$string['requireskey'] = "Dette kursus kræver en kursusnøgle";
|
||||
$string['resources'] = "Materiale";
|
||||
$string['returningtosite'] = "Har du besøgt os før?";
|
||||
$string['revert'] = "Vend tilbage";
|
||||
$string['role'] = "Rolle";
|
||||
$string['savechanges'] = "Gem ændringer";
|
||||
$string['search'] = "Søg";
|
||||
$string['searchagain'] = "Søg igen";
|
||||
$string['searchresults'] = "Søgeresultater";
|
||||
$string['sec'] = "sekunder";
|
||||
$string['secs'] = "sekunder";
|
||||
$string['section'] = "Sektion";
|
||||
$string['selectacountry'] = "Vælg et land";
|
||||
$string['senddetails'] = "Send mine oplysninger via email";
|
||||
$string['separateandconnected'] = "Separate and tilknyttede måder at vide";
|
||||
$string['serverlocaltime'] = "Server's lokal tid";
|
||||
$string['settings'] = "Indstillinger";
|
||||
$string['shortname'] = "Kort navn";
|
||||
$string['shortsitename'] = "Kort navn til dette site(f.eks. et enkelt ord)";
|
||||
$string['show'] = "Vis";
|
||||
$string['showallcourses'] = "Vis alle kurser";
|
||||
$string['showalltopics'] = "Vis alle emner";
|
||||
$string['showallweeks'] = "Vis alle uger";
|
||||
$string['showlistofcourses'] = "Vis en kursusliste";
|
||||
$string['showonlytopic'] = "Vis kun emne \$a";
|
||||
$string['showonlyweek'] = "Vis kun uge \$a";
|
||||
$string['showrecent'] = "Vis sidste aktivitet(er)";
|
||||
$string['showtheselogs'] = "Vis disse logs";
|
||||
$string['site'] = "Site";
|
||||
$string['sitelogs'] = "Site logs";
|
||||
$string['sitenews'] = "Site nyheder";
|
||||
$string['sites'] = "Sites";
|
||||
$string['sitesettings'] = "Site settings";
|
||||
$string['size'] = "Størrelse";
|
||||
$string['socialheadline'] = "Social forum - sidste emner";
|
||||
$string['someallowguest'] = "Nogle kurser tillader gæste adgang";
|
||||
$string['someerrorswerefound'] = "Nogle af oplysningerne manglede eller var forkerte. Se nedenfor for detaljer";
|
||||
$string['startdate'] = "Kursus start dato";
|
||||
$string['startsignup'] = "Start nu med at oprette en ny konto!";
|
||||
$string['status'] = "Status";
|
||||
$string['stringsnotset'] = "De følgende strings er ikke definerede i \$a";
|
||||
$string['studentnotallowed'] = "Beklager, du kan ikke deltage i dette kursus med '\$a'";
|
||||
$string['success'] = "Success";
|
||||
$string['summary'] = "Referat";
|
||||
$string['summaryof'] = "Referat af \$a";
|
||||
$string['supplyinfo'] = "Venligst udfyld oplysninger om dig";
|
||||
$string['teacheronly'] = "kun for \$a ";
|
||||
$string['textediting'] = "Når tekst redigeres";
|
||||
$string['texteditor'] = "Brug standard web formularer";
|
||||
$string['textformat'] = "ren text format";
|
||||
$string['thanks'] = "Tak";
|
||||
$string['theme'] = "Tema";
|
||||
$string['themesaved'] = "Gemt nyt tema";
|
||||
$string['thischarset'] = "iso-8859-1";
|
||||
$string['thislanguage'] = "Dansk";
|
||||
$string['timezone'] = "Tidszone";
|
||||
$string['today'] = "Idag";
|
||||
$string['todaylogs'] = "Dagens logs";
|
||||
$string['toomanytoshow'] = "Der er for mange brugere";
|
||||
$string['topic'] = "Emne";
|
||||
$string['topicoutline'] = "Beskrivelse af emne";
|
||||
$string['total'] = "Total";
|
||||
$string['turneditingoff'] = "Slå redigering fra";
|
||||
$string['turneditingon'] = "Rediger";
|
||||
$string['undecided'] = "Ubestemt";
|
||||
$string['unenrol'] = "Fjern";
|
||||
$string['unenrolme'] = "Fjern mig fra \$a";
|
||||
$string['unenrolsure'] = "Er du sikker på at du vil fjerne \$a fra dette kursus?";
|
||||
$string['unsafepassword'] = "Usikkert password - prøv et andet";
|
||||
$string['unusedaccounts'] = "Kontoer der ikke har været brugt i \$a dage, bliver automatisk fjernet";
|
||||
$string['unzip'] = "Unzip";
|
||||
$string['update'] = "Opdater";
|
||||
$string['updated'] = "Opdateret \$a";
|
||||
$string['updatemyprofile'] = "Opdater profil";
|
||||
$string['updatesevery'] = "Opdater hver \$a sekund";
|
||||
$string['updatethis'] = "Opdater dette \$a";
|
||||
$string['updatethiscourse'] = "Opdater dette kursus";
|
||||
$string['updatinga'] = "Opdaterer \$a";
|
||||
$string['updatingain'] = "Opdaterer \$a->hvad i \$a->i";
|
||||
$string['upload'] = "Upload";
|
||||
$string['uploadafile'] = "Upload en fil";
|
||||
$string['uploadedfileto'] = "Uploaded \$a->fil til \$a->bibliotek";
|
||||
$string['uploadnofilefound'] = "Ingen fil fundet- er du sikker på at du har uploaded én?";
|
||||
$string['uploadproblem'] = "En ukendt fejl opstod mens filen '\$a' blev uploaded (måske var den for stor?)";
|
||||
$string['uploadthisfile'] = "Upload denne fil";
|
||||
$string['userdeleted'] = "Denne bruger konto er slettet";
|
||||
$string['userdescription'] = "Beskrivelse";
|
||||
$string['username'] = "Username";
|
||||
$string['usernameexists'] = "Dette username eksisterer allerede, venligst vælg et andet";
|
||||
$string['userprofilefor'] = "Bruger profil for \$a";
|
||||
$string['users'] = "Brugere";
|
||||
$string['webpage'] = "Web side";
|
||||
$string['week'] = "Uge";
|
||||
$string['weeklyoutline'] = "Ugebeskrivelse";
|
||||
$string['welcometocourse'] = "Velkommen til \$a";
|
||||
$string['welcometocoursetext'] = "Velkommen til \$a->coursename!
|
||||
|
||||
En af de første ting du bør gøre, er at skrive i din brugerprofil i kurset, så vi kan læse lidt om, hvad du er for én:
|
||||
\$a->profileurl";
|
||||
$string['withchosenfiles'] = "Med valgte filer";
|
||||
$string['wordforstudent'] = "Dit ord for studerende";
|
||||
$string['wordforstudenteg'] = "f.eks. Studerende, Deltager, Kursist etc";
|
||||
$string['wordforstudents'] = "Dit ord for studerende";
|
||||
$string['wordforstudentseg'] = "f.eks. Studerende, Deltagere, Kursister etc";
|
||||
$string['wordforteacher'] = "Dit ord for lærer";
|
||||
$string['wordforteachereg'] = "f.eks. Lærer, Instruktør, Facilitator etc";
|
||||
$string['wordforteachers'] = "Dit ord for lærere";
|
||||
$string['wordforteacherseg'] = "f.eks. Lærere, Instruktører, Facilitators etc";
|
||||
$string['wrongpassword'] = "Ikke korrekt password til dette username";
|
||||
$string['yes'] = "Ja";
|
||||
$string['yourlastlogin'] = "Sidste login var";
|
||||
$string['yourself'] = "Dig";
|
||||
$string['yourteacher'] = "din \$a";
|
||||
|
||||
?>
|
||||
Executable
+108
@@ -0,0 +1,108 @@
|
||||
<?PHP // $Id$
|
||||
// quiz.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['addselectedtoquiz'] = "Tiføj det markerede til quizzen";
|
||||
$string['allowreview'] = "Tillad at se igen";
|
||||
$string['alreadysubmitted'] = "Du har sandsynligvis allerede sendt dette forsøg";
|
||||
$string['alwaysavailable'] = "Altid tilgængelig";
|
||||
$string['answer'] = "Svar";
|
||||
$string['answerhowmany'] = "Et eller flere svar?";
|
||||
$string['answersingleno'] = "Flere svar tilladt";
|
||||
$string['answersingleyes'] = "Kun et svar";
|
||||
$string['attempt'] = "Forsøg \$a";
|
||||
$string['attemptfirst'] = "Første forsøg";
|
||||
$string['attemptlast'] = "Sidste forsøg";
|
||||
$string['attemptquiznow'] = "Lav quizzen nu";
|
||||
$string['attempts'] = "Forsøg";
|
||||
$string['attemptsallowed'] = "Forsøg tilladt";
|
||||
$string['attemptsunlimited'] = "Ingen begrænsniger yi antal forsøg";
|
||||
$string['backtoquiz'] = "Tilbage til redigering i quiz";
|
||||
$string['bestgrade'] = "Bedste bedømmelse";
|
||||
$string['caseno'] = "Nej, ingen case sensitivity";
|
||||
$string['casesensitive'] = "Case sensitivity";
|
||||
$string['caseyes'] = "Ja, der er case sensitivity";
|
||||
$string['categories'] = "Kategorier";
|
||||
$string['category'] = "Kategori";
|
||||
$string['categoryinfo'] = "Info om kategori";
|
||||
$string['categorymove'] = "Kategorien '\$a->name' indeholder \$a->count spørgsmål. Vælg venligst at flytte dem til en anden kategori";
|
||||
$string['categorymoveto'] = "Flyt dem til denne kategori";
|
||||
$string['choice'] = "Choice";
|
||||
$string['choices'] = "Mulige choices";
|
||||
$string['correctanswer'] = "Korrekt svar";
|
||||
$string['correctanswers'] = "Korrekte svar";
|
||||
$string['createnewquestion'] = "Lav et nyt spørgsmål";
|
||||
$string['daysavailable'] = "Dage til rådighed";
|
||||
$string['default'] = "Default";
|
||||
$string['defaultinfo'] = "Default kategorien for spørgsmål.";
|
||||
$string['deletequestioncheck'] = "Er du helt sikker på at du vil slette '\$a'?";
|
||||
$string['editcategories'] = "Rediger kategorier";
|
||||
$string['editingmultichoice'] = "Redigerer et multiple choice spørgsmål";
|
||||
$string['editingquestion'] = "Redigerer et spørgsmål";
|
||||
$string['editingquiz'] = "Redigerer en quiz";
|
||||
$string['editingshortanswer'] = "Redigerer et \"kort svar\" spørgsmål";
|
||||
$string['editingtruefalse'] = "Redigerer et sandt/falsk spørgsmål";
|
||||
$string['false'] = "Falsk";
|
||||
$string['feedback'] = "Feedback";
|
||||
$string['filloutoneanswer'] = "Du skal give mindst et muligt svar. Blanke felter vil ikke blive bedømt.";
|
||||
$string['fillouttwochoices'] = "Du skal give mindst to svar. Blanke felter vil ikke blive bedømt.";
|
||||
$string['fractionsaddwrong'] = "De positive bedømmelser giver ikke sammenlagt 100%%
|
||||
<BR>I stedet giver de \$a%%
|
||||
<BR>Vil du vende tilbage og lave det om?";
|
||||
$string['fractionsnomax'] = "Et eller flere svar skal give 100%%, så det er <BR>få fuld bedømmelse for dette spørgsmål<BR>Vil du vende tilbage og lave det om?";
|
||||
$string['gradeaverage'] = "Gennemsnitlig bedømmelse";
|
||||
$string['gradehighest'] = "Højeste bedømmelse";
|
||||
$string['grademethod'] = "Bedømmelsesmetode";
|
||||
$string['guestsno'] = "Beklager, gæster kan ikke deltage i quizzen";
|
||||
$string['imagedisplay'] = "Billede";
|
||||
$string['introduction'] = "Introduktion";
|
||||
$string['marks'] = "Markeringer";
|
||||
$string['missingname'] = "Mangler navn på spørgsmål";
|
||||
$string['missingquestiontext'] = "Mangler tekst til spørgsmål";
|
||||
$string['modulename'] = "Quiz";
|
||||
$string['modulenameplural'] = "Quizzer";
|
||||
$string['multichoice'] = "Multiple Choice";
|
||||
$string['noanswers'] = "Der er ikke valgt et svar!";
|
||||
$string['noattempts'] = "Ingen har forsøgt sig med denn quiz";
|
||||
$string['nomoreattempts'] = "Der er ikke tilladt flere forsøg";
|
||||
$string['noquestions'] = "Der er ikke tilføjet spørgsmål endnu";
|
||||
$string['noreview'] = "Du kan ikke se quizzen igen";
|
||||
$string['noreviewuntil'] = "Du kan se quizzen igen indtil \$a";
|
||||
$string['publish'] = "Publicér";
|
||||
$string['question'] = "Spørgsmål";
|
||||
$string['questioninuse'] = "Spørgsmålet '\$a' er foreløbigt brugt:";
|
||||
$string['questionname'] = "NAvn på spørgsmål";
|
||||
$string['questions'] = "Spørgsmål";
|
||||
$string['quizavailable'] = "Quizzen er åben indtil: \$a";
|
||||
$string['quizclose'] = "Luk quizzen";
|
||||
$string['quizclosed'] = "Quizzen lukkede \$a";
|
||||
$string['quiznotavailable'] = "Quizzen er ikke tilgængelig før end: \$a";
|
||||
$string['quizopen'] = "Åbn quizzen";
|
||||
$string['random'] = "Tilfældig valg";
|
||||
$string['readytosend'] = "Du er ved at sende dine svar ind til bedømmelse. Er du sikker på at du vil fortsætte?";
|
||||
$string['regrade'] = "Bedøm alle forsøg om";
|
||||
$string['regradecomplete'] = "Alle forsøg er bedømt om";
|
||||
$string['regradecount'] = "\$a->changed ud af \$a->attempt bedømmelser blev ændret";
|
||||
$string['rename'] = "Omdøb";
|
||||
$string['report'] = "Rapporter";
|
||||
$string['save'] = "Gem";
|
||||
$string['savegrades'] = "Gem bedømmelser";
|
||||
$string['savemyanswers'] = "Gem mine svar";
|
||||
$string['savequiz'] = "Gem hele quizzen";
|
||||
$string['score'] = "High score";
|
||||
$string['select'] = "Vælg";
|
||||
$string['selectcategoryabove'] = "Vælg en kategori ovenfor";
|
||||
$string['shortanswer'] = "Kort Svar";
|
||||
$string['show'] = "Vis";
|
||||
$string['showcorrectanswer'] = "Skal korrekte svar vises i feedback?";
|
||||
$string['showfeedback'] = "Skal feedback vises efter besvarelserne?";
|
||||
$string['time'] = "Tid";
|
||||
$string['timecompleted'] = "Færdig";
|
||||
$string['timetaken'] = "Tidsforbrug";
|
||||
$string['true'] = "Sandt";
|
||||
$string['truefalse'] = "Sandt/Falsk";
|
||||
$string['type'] = "Type";
|
||||
$string['viewallanswers'] = "Se \$a færdige quizzer";
|
||||
$string['yourfinalgradeis'] = "Din endelige bedømmelse for denne quiz er \$a";
|
||||
|
||||
?>
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
<?PHP // $Id$
|
||||
// resource.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['addresource'] = "Tilføj materiale";
|
||||
$string['editingaresource'] = "Rediger i materialet";
|
||||
$string['example'] = "Eksempel";
|
||||
$string['examplereference'] = "Tobin, K. & Tippins, D (1993) Constructivism as a Referent for Teaching and Learning. In: K. Tobin (Ed) The Practice of Constructivism in Science Education, pp 3-21, Lawrence-Erlbaum, Hillsdale, NJ.";
|
||||
$string['exampleurl'] = "http://www.eksempel.com/enmappe/enfil.html";
|
||||
$string['filename'] = "Filnavn";
|
||||
$string['fulltext'] = "Fuld tekst";
|
||||
$string['htmlfragment'] = "HTML del";
|
||||
$string['modulename'] = "Materiale";
|
||||
$string['modulenameplural'] = "Materialer";
|
||||
$string['neverseen'] = "Ikke set endnu";
|
||||
$string['note'] = "Note";
|
||||
$string['notefile'] = "For at uploade filer til kurset(så de vises i denne liste) brug<A HREF=\$a >File Manager</A>.";
|
||||
$string['notypechosen'] = "Du skal vælge en type. Brug tilbage knappen og prøv igen";
|
||||
$string['resourcetype'] = "Materiale type";
|
||||
$string['resourcetype1'] = "Reference";
|
||||
$string['resourcetype2'] = "Web Sted";
|
||||
$string['resourcetype3'] = "Uploaded Fil";
|
||||
$string['resourcetype4'] = "Alm. tekst";
|
||||
$string['resourcetype5'] = "Web Link";
|
||||
$string['resourcetype6'] = "HTML tekst";
|
||||
$string['resourcetype7'] = "Program";
|
||||
|
||||
?>
|
||||
Executable
+196
@@ -0,0 +1,196 @@
|
||||
<?PHP // $Id$
|
||||
// survey.php - created with Moodle 1.0.8.1 (2003011200)
|
||||
|
||||
|
||||
$string['actual'] = "Aktuel";
|
||||
$string['actualclass'] = "Aktuel klasse";
|
||||
$string['actualstudent'] = "\$a aktuel";
|
||||
$string['allquestions'] = "Alle spørgsmål i nr. orden, alle studerende";
|
||||
$string['allscales'] = "Alle svar, alle studerende";
|
||||
$string['alreadysubmitted'] = "Du har allerede indgivet svar på denne evaluering";
|
||||
$string['analysisof'] = "Analyse af \$a";
|
||||
$string['attls1'] = "Når jeg bedømmer hvad andre siger, fokuserer jeg på kvaliteten af det siger og ikke på persone, der siger det.";
|
||||
$string['attls10'] = "Det er vigtigt for mig at forblive objektiv, når jeg analyserer noget.";
|
||||
$string['attls10short'] = "forblive objektiv";
|
||||
$string['attls11'] = "Jeg prøver at tænke med andre istedet for mod andre.";
|
||||
$string['attls11short'] = "tænk MED andre";
|
||||
$string['attls12'] = "Jeg vurderer argumenter ud fra bestemte kriterier.";
|
||||
$string['attls12short'] = "brug kriterier i evalueringer";
|
||||
$string['attls13'] = "Jeg prøver på at forstå andre meninger istedet for at vurdere på dem.";
|
||||
$string['attls13short'] = "prøv at forstå";
|
||||
$string['attls14'] = "Jeg fokuserer på svagheder i andres argumenter i stedet for at hjælpe dem ved at klargøre argumenterne.";
|
||||
$string['attls14short'] = "fokuserer på svagheder";
|
||||
$string['attls15'] = "Jeg sætter mig i andres sted, når jeg diskuterer kontroversielle emner med dem, for at forstå hvorfor de tænker, som de gør";
|
||||
$string['attls15short'] = "sætter mig i andres sted";
|
||||
$string['attls16'] = "Måden, jeg analyserer udsagn, kan sammenlignes med at 'slæbe folk for retten', fordi jeg overvejer alle facts. ";
|
||||
$string['attls16short'] = "slæbe for retten";
|
||||
$string['attls17'] = "Jeg værdsætter at bruge logik og fornuft, førend mine egne overvejelser, når jeg løser problemer.";
|
||||
$string['attls17short'] = "jeg værdsætter logik";
|
||||
$string['attls18'] = "Jeg kan opnå indsigt i meninger, som der er forskellige fra mine gennem indlevelse.";
|
||||
$string['attls18short'] = "indsigt gennem indlevelse";
|
||||
$string['attls19'] = "Når jeg møder mennesker med meninger fremmede for mig, gør jeg et forsøg på at nå ind til vedkommende, for at få et indblik i deres meninger ";
|
||||
$string['attls19short'] = "prøver at nå ind til";
|
||||
$string['attls1short'] = "fokuserer på kvaliteten i argumenterne";
|
||||
$string['attls2'] = "Jeg kan li' at spille 'djævelens advokat' - argumentere med det modsatte af andres meninger";
|
||||
$string['attls20'] = "Jeg bruger tid på at finde ud af, hvad der er galt. F.eks. så bruger jeg tid på at finde dårlig argumentation i ting jeg læser. ";
|
||||
$string['attls20short'] = "Hvad er der galt?";
|
||||
$string['attls2short'] = "spiller djævelens advokat";
|
||||
$string['attls3'] = "Jeg vil gerne vide, hvor folk kommer fra, hvad der har fået dem til at føle det, de gør.";
|
||||
$string['attls3short'] = "hvor folk kommer fra";
|
||||
$string['attls4'] = "Den vigtigste del af min uddannelse har været det at lære at forstå mennesker, som er forskellige fra mig.";
|
||||
$string['attls4short'] = "forstå forskellige mennesker";
|
||||
$string['attls5'] = "Jeg mener, at måden at finde sin egen identitet sker ved omgang med andre mennesker.";
|
||||
$string['attls5short'] = "omgang med andre";
|
||||
$string['attls6'] = "Jeg kan lide at høre meninger fra folk, som kommer med en baggrund forskellig fra min - det får mig til at se, hvordan ting kan ses fra flere sider.";
|
||||
$string['attls6short'] = "kan lide at høre meninger";
|
||||
$string['attls7'] = "Jeg kan styrke min egen position ved at argumentere med folk, som er uenige med mig.";
|
||||
$string['attls7short'] = "styrke ved argumentation";
|
||||
$string['attls8'] = "Jeg er altid interesseret i at vide, hvorfor folk tror og siger, hvad de gør";
|
||||
$string['attls8short'] = "vide hvad folk gør";
|
||||
$string['attls9'] = "Jeg oplever ofte, at jeg argumenterer med forfatterere til de bøger, jeg læser - prøver på en logisk måde at finde ud af, hvorfor de ikke har ret.";
|
||||
$string['attls9short'] = "argumenterer med forfattere";
|
||||
$string['attlsintro'] = "Meningen med denne evaluering er at finde ud af dine holdninger til det at tænke og lære.
|
||||
|
||||
Der er ikke rigtige og forkerte svar, Vi er interesserede i dine meninger. Dine svar vil blive behandlet fortroligt og vil ikke blive brugt i nogen bedømmelse af dig.";
|
||||
$string['attlsm1'] = "Holdninger til det at Tænke og Lære";
|
||||
$string['attlsm2'] = "Læring med andre";
|
||||
$string['attlsm3'] = "Individuel læring";
|
||||
$string['attlsmintro'] = "I diskussion...";
|
||||
$string['attlsname'] = "ATTLS (20 item version)";
|
||||
$string['clicktocontinue'] = "Klik her for at fortsætte";
|
||||
$string['clicktocontinuecheck'] = "Klik her for at markere og fortsæt";
|
||||
$string['colles1'] = "Min læring fokuserer på ting der interesserer mig.";
|
||||
$string['colles10'] = "Jeg beder andre studerende om at forklare deres ideer.";
|
||||
$string['colles10short'] = "jeg beder om forklaringer";
|
||||
$string['colles11'] = "andre studerende beder mig om at forklare mine ideer.";
|
||||
$string['colles11short'] = "jeg bliver bedt om forklaringer";
|
||||
$string['colles12'] = "andre studerende reagerer på mine ideer.";
|
||||
$string['colles12short'] = "studerende reagerer på mig";
|
||||
$string['colles13'] = "læreren stimulerer min tænkeproces.";
|
||||
$string['colles13short'] = "læreren stimulerer min tænkeproces";
|
||||
$string['colles14'] = "læreren får mig til at deltage aktivt.";
|
||||
$string['colles14short'] = "læreren aktiverer mig";
|
||||
$string['colles15'] = "læreren opfordrer til gode samtaler.";
|
||||
$string['colles15short'] = "tlæreren opfordrer til samtaler";
|
||||
$string['colles16'] = "læreren ansporer til kritisk selv refleksion.";
|
||||
$string['colles16short'] = "læreren ansporer til selv refleksion";
|
||||
$string['colles17'] = "andre studerende støtter min deltagelse.";
|
||||
$string['colles17short'] = "andre studerende støtter mig";
|
||||
$string['colles18'] = "andre studerende anderkender mine bidrag.";
|
||||
$string['colles18short'] = "andre studerende anderkender mig";
|
||||
$string['colles19'] = "andre studerende værdsætter mine bidrag.";
|
||||
$string['colles19short'] = "jeg er værdsat af andre studerende";
|
||||
$string['colles1short'] = "ffokus på interessante emner";
|
||||
$string['colles2'] = "Det, jeg lærer, har betydning for mine praktiske færdigheder.";
|
||||
$string['colles20'] = "andre studerende har indlevelse i at, at jeg forsøger at lære.";
|
||||
$string['colles20short'] = "indlevende studerende";
|
||||
$string['colles21'] = "Jeg forstår, hvad de andre studerende skriver.";
|
||||
$string['colles21short'] = "jeg forstår andre studerende";
|
||||
$string['colles22'] = "andre studerende forstår, hvad jeg skriver.";
|
||||
$string['colles22short'] = "studerende forstår mig";
|
||||
$string['colles23'] = "jeg forstår det, som læreren skriver.";
|
||||
$string['colles23short'] = "jeg forstår læreren";
|
||||
$string['colles24'] = "læreren forstår, hvad jeg skriver.";
|
||||
$string['colles24short'] = "læreren forstår mig";
|
||||
$string['colles2short'] = "vigtigt for mine færdigheder";
|
||||
$string['colles3'] = "Jeg lærer at forbedre mine praktiske færdigheder.";
|
||||
$string['colles3short'] = "forbedrer mine færdigheder";
|
||||
$string['colles4'] = "Det jeg lærer, hænger godt sammen med min virkelighed (den praktiske).";
|
||||
$string['colles4short'] = "har sammenhæng med virkeligheden";
|
||||
$string['colles5'] = "Jeg er kritisk over for min egen læring.";
|
||||
$string['colles5short'] = "Jeg er kritisk over for min egen læring";
|
||||
$string['colles6'] = "Jeg er kritisk over for mine egne ideer.";
|
||||
$string['colles6short'] = "Jeg er kritisk over for mig selv";
|
||||
$string['colles7'] = "Jeg er kritisk over for andre studerendes ideer.";
|
||||
$string['colles7short'] = "Jeg er kritisk overfor andre studerende";
|
||||
$string['colles8'] = "Jeg er kritisk overfor det, jeg læser.";
|
||||
$string['colles8short'] = "Jeg er kritisk over for det, jeg læser";
|
||||
$string['colles9'] = "Jeg forklarer mine ideer for andre studerende.";
|
||||
$string['colles9short'] = "Jeg forklarer mine ideer";
|
||||
$string['collesaintro'] = "Formålet med disse spørgsmål er, at vi gerne vil undersøge, hvor meget du har lært ved at følge dette online modul.
|
||||
|
||||
Hver af de 24 udsagne nedenfor giver dig mulighed for at komme med dine erfaringer med dette modul.
|
||||
|
||||
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
|
||||
|
||||
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
|
||||
|
||||
På forhånd tak.";
|
||||
$string['collesaname'] = "COLLES (Aktuelle)";
|
||||
$string['collesapintro'] = "Formålet med disse spørgsmål er, at vi gerne vil undersøge, hvor meget du har lært ved at følge dette online modul.
|
||||
|
||||
Hver af de 24 udsagn nedenfor vil få dig til at sammneligne <B>foretrukne</B> (ideelle) og <B>aktuelle</B> oplevelse i dette modul.
|
||||
|
||||
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
|
||||
|
||||
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
|
||||
|
||||
På forhånd tak.";
|
||||
$string['collesapname'] = "COLLES (Foretrukket og aktuelle)";
|
||||
$string['collesm1'] = "Relevans";
|
||||
$string['collesm1short'] = "Relevans";
|
||||
$string['collesm2'] = "Refleksion";
|
||||
$string['collesm2short'] = "Refleksion";
|
||||
$string['collesm3'] = "Interaktivitet";
|
||||
$string['collesm3short'] = "Interaktivitet";
|
||||
$string['collesm4'] = "Support fra læreren";
|
||||
$string['collesm4short'] = "Support fra læreren";
|
||||
$string['collesm5'] = "Support fra andre";
|
||||
$string['collesm5short'] = "Support fra andre";
|
||||
$string['collesm6'] = "Fortolkning";
|
||||
$string['collesm6short'] = "Fortolkning";
|
||||
$string['collesmintro'] = "I dette online modul...";
|
||||
$string['collespintro'] = "Formålet med denne undersøgelse er at finde ud af, hvad du mener om denne online læringsoplevelse.
|
||||
|
||||
Hver af de 24 sætninger nedenunder kan bruges til at angive din <B>foretrukne</B> (ideelle) oplevelse med dette modul.
|
||||
|
||||
Der er ingen 'rigtige' eller 'forkerte' svar; vi er interesserede i din mening. Dine svar vil blive behandlet fortroligt og , vil ikke have indflydelse på bedømmelsen af dig.
|
||||
|
||||
Dine omhyggelige besvarelser vil hjælpe os med at forbedre online undervisningen senere hen.
|
||||
|
||||
På forhånd tak.";
|
||||
$string['collespname'] = "COLLES (Foretrukket)";
|
||||
$string['done'] = "Færdig";
|
||||
$string['download'] = "Download";
|
||||
$string['downloadexcel'] = "Download data i Excel format";
|
||||
$string['downloadinfo'] = "Du kan downloade de rå data for denne undersøgelse så du kan sætte dem ind i Excel, SPSS eller et andet program.";
|
||||
$string['downloadtext'] = "Download en tekst fil";
|
||||
$string['editingasurvey'] = "Ændrer en undersøgelse";
|
||||
$string['helpsurveys'] = "Hjælp til de forskellige undersøgelser";
|
||||
$string['howlong'] = "Hvor lang tid har du været om at færdiggøre denne undersøgelse??";
|
||||
$string['howlongoptions'] = "under 1 min,1-2 min,2-3 min,3-4 min,4-5-min,5-10 min,mere end 10";
|
||||
$string['ifoundthat'] = "Jeg finder at";
|
||||
$string['introtext'] = "Introduktion til tekst";
|
||||
$string['ipreferthat'] = "Jeg foretrækker at";
|
||||
$string['modulename'] = "Undersøgelse";
|
||||
$string['modulenameplural'] = "Undersøgelser";
|
||||
$string['name'] = "Navn";
|
||||
$string['newsurveyresponses'] = "Nye svar på undersøgelsen";
|
||||
$string['nobodyyet'] = "Ingen har endnu svaret på undersøgelsen";
|
||||
$string['notdone'] = "Endnu ikke færdig";
|
||||
$string['notes'] = "Dine private kommentarer og noter";
|
||||
$string['othercomments'] = "Har du andre kommentarer?";
|
||||
$string['peoplecompleted'] = "\$a har foreløbigt svaret på undersøgelsen";
|
||||
$string['preferred'] = "Foretrukket";
|
||||
$string['preferredclass'] = "Foretrukket klasse";
|
||||
$string['preferredstudent'] = "\$a foretrukket";
|
||||
$string['question'] = "Spørgsmål";
|
||||
$string['questions'] = "Spørgsmål";
|
||||
$string['questionsnotanswered'] = "Nogle af multiple choice spørgsmålene er ikke besvaret.";
|
||||
$string['report'] = "Undersøgelse rapport";
|
||||
$string['savednotes'] = "Dine noter er gemt";
|
||||
$string['scaleagree5'] = "Meget uenig,Noget uenig,Ikke enig eller uenig,Næsten enig,Meget enig";
|
||||
$string['scales'] = "Vurderinger";
|
||||
$string['scaletimes5'] = "Næsten aldrig,Sjældent,Nogle gange,Ofte,Næsten altid";
|
||||
$string['seemoredetail'] = "Klik her for detaljer";
|
||||
$string['selectedquestions'] = "Udvalgte spørgsmål, alle studenterende";
|
||||
$string['summary'] = "Opsummering";
|
||||
$string['surveycompleted'] = "Du er færdig med undersøgelsen. Grafen nedenunder viser dine svar i forhold til klassens gennemsnit";
|
||||
$string['surveyname'] = "Undersøgelse navn";
|
||||
$string['surveysaved'] = "Undersøgelse gemt";
|
||||
$string['surveytype'] = "Undersøgelse type";
|
||||
$string['thanksforanswers'] = "Tak for dine besvarelser på undersøgelsen, \$a";
|
||||
$string['time'] = "Tid";
|
||||
$string['viewsurveyresponses'] = "Se \$a svar";
|
||||
|
||||
?>
|
||||
+24
-25
@@ -1,42 +1,41 @@
|
||||
<?PHP // $Id$
|
||||
// assignment.php - created with Moodle 1.0.8 dev (2002122301)
|
||||
|
||||
<?php
|
||||
|
||||
$string['allowresubmit'] = "Erneutes Einreichen erlauben";
|
||||
$string['assignmentdetails'] = "Aufgabendetails";
|
||||
$string['assignmentname'] = "Aufgabenname";
|
||||
$string['assignmenttype'] = "Aufgabentyp";
|
||||
$string['description'] = "Beschreibung ";
|
||||
$string['duedate'] = "Abgabefrist";
|
||||
$string['duedate'] = "Abgabedatum";
|
||||
$string['early'] = "\$a früh";
|
||||
$string['failedupdatefeedback'] = "Keine Aktualisierung der Eintragsmeldung für Benutzer \$a";
|
||||
$string['feedback'] = "Meldung";
|
||||
$string['feedbackupdated'] = "Eintragsmeldung aktualisiert für \$a Leute ";
|
||||
$string['failedupdatefeedback'] = "Keine Aktualisierung der Rückmeldung für Benutzer \$a";
|
||||
$string['feedback'] = "Rückmeldung";
|
||||
$string['feedbackupdated'] = "Rückmeldung aktualisiert für \$a Leute ";
|
||||
$string['late'] = "\$a spät ";
|
||||
$string['maximumgrade'] = "Höchster Grad ";
|
||||
$string['maximumgrade'] = "Höchste Bewertung ";
|
||||
$string['maximumsize'] = "Maximale Größe";
|
||||
$string['modulename'] = "Aufgabe";
|
||||
$string['modulenameplural'] = "Aufgaben";
|
||||
$string['newsubmissions'] = "Aufgaben eingetragen";
|
||||
$string['notsubmittedyet'] = "Noch nicht eingetragen";
|
||||
$string['newsubmissions'] = "Aufgaben eingereicht";
|
||||
$string['notsubmittedyet'] = "Noch nichts eingereicht";
|
||||
$string['overwritewarning'] = "Hinweis: erneutes Hochladen ERSETZT Ihren gegenwärtigen Eintrag ";
|
||||
$string['saveallfeedback'] = "Alle meine Meldungen speichern";
|
||||
$string['submissionfeedback'] = "Eintragsmeldung";
|
||||
$string['submissions'] = "Einträge";
|
||||
$string['submitassignment'] = "Tragen Sie Ihre Aufgabe ein unter Verwendung dieses Formulars";
|
||||
$string['submitted'] = "Eingetragen";
|
||||
$string['typeoffline'] = "Offlineaktivität ";
|
||||
$string['typeuploadsingle'] = "Laden Sie einzige Datei hoch, Wert zwischen 0 - 100 Punkten";
|
||||
$string['uploadbadname'] = "Dieser Dateiname enthält unzulässige Zeichen und kann nicht hochgeladen erden.";
|
||||
$string['saveallfeedback'] = "Alle meine Rückmeldungen speichern";
|
||||
$string['submissionfeedback'] = "Rückmeldung zu den eingereichten Aufgaben";
|
||||
$string['submissions'] = "Eingereichte Aufgaben";
|
||||
$string['submitassignment'] = "Tragen Sie Ihre Aufgabe unter Verwendung dieses Formulars ein";
|
||||
$string['submitted'] = "Eingereicht";
|
||||
$string['typeoffline'] = "Offline Aktivität ";
|
||||
$string['typeuploadsingle'] = "Eine einzige Datei hochladen";
|
||||
$string['uploadbadname'] = "Dieser Dateiname enthält unzulässige Zeichen und kann nicht hochgeladen werden.";
|
||||
$string['uploadedfiles'] = "hochgeladene Dateien";
|
||||
$string['uploaderror'] = "Beim Hochladen der Datei trat ein Fehler auf";
|
||||
$string['uploadfailnoupdate'] = "Die Datei wurde korrekt hochgeladen, aber Ihr Eintrag kann nicht aktualisiert werden!";
|
||||
$string['uploadfiletoobig'] = "Entschuldigung, aber diese Datei ist zu groß (Die Begrenzung ist \$a Bytes)";
|
||||
$string['uploadnofilefound'] = "Es wurke keine Datei gefunden . Sind Sie sicher, dass Sie eine für das Hochladen ausgewählt haben?";
|
||||
$string['uploadnotregistered'] = "'\$a' wurde korrekt hochgeladen, aber der Eintrag nicht registriert'";
|
||||
$string['uploadsuccess'] = "'\$a' wurde erfolgreich hochgeladen";
|
||||
$string['viewfeedback'] = "Aufgabengrad und Rückmeldung anzeigen ";
|
||||
$string['viewsubmissions'] = "Zeige \$a eingetragen Aufgaben ";
|
||||
$string['yoursubmission'] = "Ihre Eintrag";
|
||||
$string['uploadnofilefound'] = "Es wurde keine Datei gefunden. Sind Sie sicher, dass Sie eine für das Hochladen ausgewählt haben?";
|
||||
$string['uploadnotregistered'] = "\'\$a\' wurde korrekt hochgeladen, aber der Eintrag wurde nicht registriert!";
|
||||
$string['uploadsuccess'] = "\'\$a\' wurde erfolgreich hochgeladen";
|
||||
$string['viewfeedback'] = "Aufgabenbewertung und Rückmeldung anzeigen ";
|
||||
$string['viewsubmissions'] = "Zeige \$a eingereichte Aufgaben ";
|
||||
$string['yoursubmission'] = "Ihre eingereichten Aufgaben";
|
||||
|
||||
?>
|
||||
|
||||
?>
|
||||
+19
-10
@@ -3,17 +3,18 @@
|
||||
|
||||
|
||||
$string['auth_dbdescription'] = "This method uses an external database table to check whether a given username and password is valid. If the account is a new one, then information from other fields may also be copied across into Moodle.";
|
||||
$string['auth_dbextrafields'] = "These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <B>external database fields</B> that you specify here. <P>If you leave these blank, then defaults will be used.<P>In either case, the user will be able to edit all of these fields after they log in.";
|
||||
$string['auth_dbfieldpass'] = "Name of the field containing passwords";
|
||||
$string['auth_dbfielduser'] = "Name of the field containing usernames";
|
||||
$string['auth_dbhost'] = "The computer hosting the database server.";
|
||||
$string['auth_dbname'] = "Name of the database itself";
|
||||
$string['auth_dbpass'] = "Password matching the above username";
|
||||
$string['auth_dbextrafields'] = "Diese Felder sind optional. Sie können auswählen, einige Moodle Nutzer-Felder mit Informationen des <b>externen Datenbank-Feldes</b> vorauszufüllen, das Sie hier angeben.
|
||||
<p>Wenn Sie dieses leer lassen, dann werden Standardwerte benutzt.<P>Im anderen Fall wird der Nutzer befähigt, alle diese Felder nach der Anmeldung zu bearbeiten.";
|
||||
$string['auth_dbfieldpass'] = "Name des Feldes, das das Kennwort enthält";
|
||||
$string['auth_dbfielduser'] = "Name des Feldes, das den Nutzernamen enthält";
|
||||
$string['auth_dbhost'] = "Der Computer, der die Datenbank bereitstellt";
|
||||
$string['auth_dbname'] = "Name der Datenbank selbst";
|
||||
$string['auth_dbpass'] = "Das Passwort, das zum Nutzernamen gehört";
|
||||
$string['auth_dbpasstype'] = "Spezifizieren Sie das Format, das das Kennwortfeld benutzt. MD5-Verschlüsselung ist nützlich dafür, mit anderen üblichen Netzanwendungen Verbindung aufzunehmen wie z.B. PostNuke";
|
||||
$string['auth_dbtable'] = "Name of the table in the database";
|
||||
$string['auth_dbtitle'] = "Use an external database";
|
||||
$string['auth_dbtype'] = "The database type (See the <A HREF=../lib/adodb/readme.htm#drivers>ADOdb documentation</A> for details)";
|
||||
$string['auth_dbuser'] = "Username with read access to the database";
|
||||
$string['auth_dbtitle'] = "Eine externe Datenbank benutzen";
|
||||
$string['auth_dbtype'] = "Der Datenbank-Typ (Siehe <A HREF=../lib/adodb/readme.htm#drivers>ADOdb Anleitung</A> für Einzelheiten)";
|
||||
$string['auth_dbuser'] = "Nutzername mit Schreibzugriff auf die Datenbank";
|
||||
$string['auth_emaildescription'] = "Email confirmation is the default authentication method. When the user signs up, choosing their own new username and password, a confirmation email is sent to the user's email address. This email contains a secure link to a page where the user can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.";
|
||||
$string['auth_emailtitle'] = "Email-based authentication";
|
||||
$string['auth_imapdescription'] = "This method uses an IMAP server to check whether a given username and password is valid.";
|
||||
@@ -24,7 +25,10 @@ $string['auth_imaptype'] = "The IMAP server type. IMAP servers can have differe
|
||||
$string['auth_ldap_bind_dn'] = "If you want to use bind-user to search users, specify it here. Someting like 'cn=ldapuser,ou=public,o=org'";
|
||||
$string['auth_ldap_bind_pw'] = "Password for bind-user.";
|
||||
$string['auth_ldap_contexts'] = "List of contexts where users are located. Separate different contexts with ';'. For example: 'ou=users,o=org; ou=others,o=org'";
|
||||
$string['auth_ldap_host_url'] = "Specify LDAP host in URL-form like 'ldap://ldap.myorg.com/' or 'ldaps://ldap.myorg.com/' ";
|
||||
$string['auth_ldap_create_context'] = "Wenn Sie die Nutzer-Erstellung mit Email-Bestätigung aktivieren, geben Sie die Umgebung an, wo die Nutzer erstellt werden sollen. Diese Umgebung sollte sich von der anderere Nutzer unterscheiden, um Sicherheitsrisiken zu vermeiden. Sie brauchen diese Umgebung nicht zur ldap_context Variable hinzuzufügen, Moodle sucht in dieser Umgebung automatisch nach Nutzern ";
|
||||
$string['auth_ldap_creators'] = "Einen Liste von Gruppen, denen es erlaubt ist, neue Kurse zu erstellen. Trennen Sie mehrere Gruppen durch ';'. Normalerweise etwas wie 'cn=teachers,ou=staff, o=myorg'";
|
||||
$string['auth_ldap_host_url'] = "Geben Sie einen ldap Server in URL-form an wie 'ldap://ldap.myorg.de/' oder 'ldaps://ldap.myorg.de/' ";
|
||||
$string['auth_ldap_memberattribute'] = "Geben Sie die Mitgliedsoptionen an, wenn Nutzer zu einer Gruppe gehören. Normalereise 'member'";
|
||||
$string['auth_ldap_search_sub'] = "Put value <> 0 if you like to search users from subcontexts.";
|
||||
$string['auth_ldap_update_userinfo'] = "Update user information (firstname, lastname, address..) from LDAP to Moodle. Look at /auth/ldap/attr_mappings.php for mapping information";
|
||||
$string['auth_ldap_user_attribute'] = "The attribute used to name/search users. Usually 'cn'.";
|
||||
@@ -35,6 +39,8 @@ $string['auth_ldapdescription'] = "This method provides authentication against a
|
||||
password are checked.";
|
||||
$string['auth_ldapextrafields'] = "These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <B>LDAP fields</B> that you specify here. <P>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.<P>In either case, the user will be able to edit all of these fields after they log in.";
|
||||
$string['auth_ldaptitle'] = "Use an LDAP server";
|
||||
$string['auth_manualdescription'] = "Diese Methode verhindert, dass Nutzer Ihre eigenen Zugänge anlegen können. Jeder Zugang muss manuell vom Administrator selbst eingerichtet werden.";
|
||||
$string['auth_manualtitle'] = "Nur manuelle Zugänge";
|
||||
$string['auth_nntpdescription'] = "This method uses an NNTP server to check whether a given username and password is valid.";
|
||||
$string['auth_nntphost'] = "The NNTP server address. Use the IP number, not DNS name.";
|
||||
$string['auth_nntpport'] = "Server port (119 is the most common)";
|
||||
@@ -46,6 +52,9 @@ $string['auth_pop3host'] = "The POP3 server address. Use the IP number, not DNS
|
||||
$string['auth_pop3port'] = "Server port (110 is the most common)";
|
||||
$string['auth_pop3title'] = "Use a POP3 server";
|
||||
$string['auth_pop3type'] = "Server type. If your server uses certificate security, choose pop3cert.";
|
||||
$string['auth_user_create'] = "Nutzer-Erstellung aktivieren";
|
||||
$string['auth_user_creation'] = "Neue (anonyme) Nutzer können Nutzer-Accounts erstellen außerhalb der Autentisierungsquelle und per Email bestätigen. Sofern Sie dies aktivieren, achten Sie darauf, ebenso modulspezifische optionen für die Modulerstellung zu konfigurieren.";
|
||||
$string['auth_usernameexists'] = "Ausgewählter Nutzername existiert bereits. Bitte wählen Sie einen neuen.";
|
||||
$string['authenticationoptions'] = "Authentication options";
|
||||
$string['authinstructions'] = "Here you can provide instructions for your users, so they know which username and password they should be using. The text you enter here will appear on the login page. If you leave this blank then no instructions will be printed.";
|
||||
$string['changepassword'] = "Kennwort-URL ändern";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user