Compare commits
632 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfb1f6f225 | |||
| 0c9dff5458 | |||
| ab63c43a03 | |||
| cb69d2584a | |||
| c512e94e7c | |||
| 103efbc271 | |||
| a28da5d9b8 | |||
| 0b059029ac | |||
| e13f286026 | |||
| 0053adbc38 | |||
| 33c2fe2414 | |||
| 5668eb3c94 | |||
| cbb31c9a55 | |||
| 46eec6e46b | |||
| 93e9ea9989 | |||
| b3daaada49 | |||
| 4d3273387a | |||
| 1d26931b32 | |||
| 8a407e29d6 | |||
| 49025ce156 | |||
| 87fe3c030d | |||
| 6b068d6643 | |||
| e54450752b | |||
| 1639a2c9de | |||
| d61b05d7c8 | |||
| 01dd8c9b07 | |||
| 2a9af190b5 | |||
| 955980b238 | |||
| 32bf9aac97 | |||
| e97b667744 | |||
| a7b8726121 | |||
| 6158a4aed5 | |||
| bf46548670 | |||
| c9d6862b99 | |||
| 14ac8b4e39 | |||
| a1a63ea0a0 | |||
| 60b1ed1303 | |||
| 0c39b19942 | |||
| 1efcb6eb24 | |||
| 8c40b4ea9d | |||
| b7e018969b | |||
| ba3f753cf7 | |||
| 2fa4b2c6e0 | |||
| 33ba00557f | |||
| e3a2abd60f | |||
| b09baf94b9 | |||
| 406f11ff77 | |||
| e40ed81577 | |||
| 696adcdc71 | |||
| d90030f1c7 | |||
| 52f9e3ee56 | |||
| dc21606e4f | |||
| 8946805511 | |||
| c7fbbf73e3 | |||
| ac7efafb83 | |||
| 0bd4649a36 | |||
| 9d940d6096 | |||
| deaaa6f62f | |||
| 574fcfba8a | |||
| 3b40fbf61d | |||
| 591b34218c | |||
| 890066d6dc | |||
| ca0ae78e00 | |||
| 53459511a9 | |||
| b0f20bc995 | |||
| 4e805e91c7 | |||
| e6f5bd2633 | |||
| 3e794304dc | |||
| 75c6461ac1 | |||
| 0fbadb557b | |||
| 146b7ac600 | |||
| d14e5a71c0 | |||
| 4ad011d041 | |||
| 34c99fb91f | |||
| 3b7cb72535 | |||
| 13892dbcf2 | |||
| f7128b89bf | |||
| 1453ae5bf3 | |||
| 7f44175aed | |||
| 5c6c90e3c8 | |||
| 9c829ef34a | |||
| 34950b3d64 | |||
| 7093fdd806 | |||
| 6fac8f7f04 | |||
| bae87ddc80 | |||
| 7d7e562296 | |||
| 8f1b34c69e | |||
| 7c7412b74e | |||
| ab0ab933be | |||
| 2e22e64954 | |||
| 11c826cb47 | |||
| 30075232af | |||
| a7cc54ab1b | |||
| 782820ceaf | |||
| 07a01b746c | |||
| e1263ce41d | |||
| 933cf2e115 | |||
| e49fea7d9b | |||
| b61c5fa26b | |||
| 5ac84901f0 | |||
| 54d50fdb8d | |||
| c64089e155 | |||
| 12a3a0bc61 | |||
| 3ed2c641f4 | |||
| 37e91e0731 | |||
| 9205de2fd8 | |||
| 2a24377350 | |||
| 6c974b2d65 | |||
| dabaa04e29 | |||
| 1f42fb1443 | |||
| 278f612b40 | |||
| a6989dc3ea | |||
| 29c1067b68 | |||
| 1e6fd4f6d2 | |||
| 23a3569569 | |||
| 270b9df833 | |||
| 041a234f6a | |||
| 6a69966c18 | |||
| ef3f003a76 | |||
| 40f1fe9893 | |||
| 25e3fc90ae | |||
| 4278ea3617 | |||
| 0ae3b07d83 | |||
| fb7bc97d3e | |||
| b431d0717e | |||
| a0d9283306 | |||
| 347a5af6a2 | |||
| 9a48481915 | |||
| 3c885787c9 | |||
| 9aca16cc0f | |||
| 526c2d601c | |||
| 05e6fefd56 | |||
| 6896e438c1 | |||
| 2a5953c545 | |||
| e6e5a4d219 | |||
| f69decef93 | |||
| 395e4069e1 | |||
| acb4fe8ac2 | |||
| eee49d735c | |||
| e93213e2e0 | |||
| 3b36eaac60 | |||
| e89bf76523 | |||
| f352dcddba | |||
| 12a90d7af0 | |||
| 5a0ac061b2 | |||
| a4982907f8 | |||
| 7439256bbd | |||
| 4c34df5e5c | |||
| 0e847049b5 | |||
| cb4193da9f | |||
| 79b123d1be | |||
| 6575ae513f | |||
| 62d0c271b9 | |||
| b5dc3a57f7 | |||
| 6c0bdc4d58 | |||
| b93c5e3ed9 | |||
| f5c44fd053 | |||
| 9d95db7ecd | |||
| 146e1cd674 | |||
| 59fef8ff26 | |||
| 7c1b3e2523 | |||
| ba66ee7523 | |||
| 5a1922cd24 | |||
| 8934bcdc59 | |||
| be044b6473 | |||
| 9c11280dc9 | |||
| 180a9220e9 | |||
| 7c3ff6f6a6 | |||
| 4d0eabf19e | |||
| 9980628209 | |||
| 59fdbc53b2 | |||
| e32da64ee4 | |||
| 624e1d1197 | |||
| 0cdd8fe9d4 | |||
| 6b02b455a4 | |||
| 8ade0c35bd | |||
| 0248eee129 | |||
| 29d1e1ff76 | |||
| 61cbbebadc | |||
| c274d5eef9 | |||
| 280f513434 | |||
| 6ebf0d9c1e | |||
| fec9977741 | |||
| 589591b8c7 | |||
| a8c99982fb | |||
| 9c931ad074 | |||
| 0ae2507ea7 | |||
| 44e094d1ec | |||
| b98bc17196 | |||
| e625e18bfc | |||
| b85c0bee53 | |||
| 7192907607 | |||
| f196602737 | |||
| 895e1baad6 | |||
| ad65910119 | |||
| dfa6ca9813 | |||
| 30ebefd416 | |||
| 15b3a4398a | |||
| 3fd3efac7b | |||
| 0e19f8ed3b | |||
| 26bc714f1f | |||
| ab1623b87b | |||
| 96004c8bbc | |||
| 20f39d0f98 | |||
| ce98dd3191 | |||
| acfcf342d5 | |||
| 8e223e56cb | |||
| 425475981c | |||
| c993fe8d88 | |||
| e6ee93d1a3 | |||
| 479f5b6e6d | |||
| fbef42576b | |||
| a84f961376 | |||
| 8b857b293d | |||
| 49ea1f622b | |||
| 19fad758a1 | |||
| e3ad8a5d2c | |||
| 6a992d7d86 | |||
| efc8baaaa2 | |||
| 24d215d340 | |||
| fee4404aba | |||
| 152ae1ffdd | |||
| 385cddf634 | |||
| b5a0e3befb | |||
| 8725c4401b | |||
| d6347b056d | |||
| 8c27cc9534 | |||
| 0ceb918703 | |||
| 5227c9c305 | |||
| f3fc480228 | |||
| 066fc70ece | |||
| 8ee045c026 | |||
| 35314e2f91 | |||
| 6f2e7ccb54 | |||
| e4592b226d | |||
| e5b945e956 | |||
| 79d7cda9e5 | |||
| e1c5528fff | |||
| b640d7ea28 | |||
| bf0aa894bd | |||
| d59c0d7094 | |||
| edd08683b9 | |||
| f890a6a9f9 | |||
| 2c9280ffa6 | |||
| f0a7956c1b | |||
| eafdf083a9 | |||
| 9de4152eff | |||
| 01d8f54dbd | |||
| 81c8cccf6c | |||
| 6330424fae | |||
| 3135254d8f | |||
| f7f7cf7760 | |||
| 37881d2f20 | |||
| 521225275b | |||
| 80b7e5deb6 | |||
| 774530f8b4 | |||
| f2b9840585 | |||
| a9d6e98211 | |||
| 2773783da2 | |||
| 3fec0aa045 | |||
| 0f36ae6350 | |||
| 82695f7730 | |||
| 6c31598afe | |||
| b7696aa0b6 | |||
| 1d5c83082f | |||
| ce18cd39e6 | |||
| b969895cb6 | |||
| f2bd07e54d | |||
| 265033d8e0 | |||
| 7aaece91a3 | |||
| 6b17edba39 | |||
| d12b949a2c | |||
| 2b046f832b | |||
| ba42721ca4 | |||
| c9faf6e3b5 | |||
| edbada7c4f | |||
| 1cf1a1737c | |||
| bf3bd818bf | |||
| ecf1f30591 | |||
| aab4251842 | |||
| e015e5da34 | |||
| ad50eae794 | |||
| 11fa569bd8 | |||
| 6b158f58b6 | |||
| e4cdd9f2cb | |||
| 21f869131d | |||
| da255ad81a | |||
| 38e02370de | |||
| d66083c260 | |||
| 2b3dbc7ee9 | |||
| 23a6a67140 | |||
| 30b9d52d78 | |||
| 08f68a7d2f | |||
| 53cd3c286e | |||
| ab8c8a8f92 | |||
| d1bed0abc3 | |||
| 1b82a6fb65 | |||
| 235ec73c0f | |||
| c978929e36 | |||
| bf99ef166f | |||
| 992d263ac5 | |||
| 03d17744ea | |||
| d86ad06b6e | |||
| 62c2b3d818 | |||
| 341ad08669 | |||
| 1be0790e01 | |||
| c4669ce618 | |||
| e3071745bb | |||
| 78602c3fab | |||
| 3d9b36e015 | |||
| 025ca6f7d3 | |||
| 5b8bfd14a8 | |||
| b3ddb0951f | |||
| 47ae6d3fc9 | |||
| d46929e4e3 | |||
| 70a5dda65a | |||
| cbfb767fb5 | |||
| d16d4761d4 | |||
| 3e8532dadc | |||
| d128e2844b | |||
| bad69d25cc | |||
| 9cbc51937a | |||
| 5a83ba350d | |||
| 3339623dc0 | |||
| bfea3bf351 | |||
| fdd57e090e | |||
| e262ca4250 | |||
| 4befe7f551 | |||
| 853d6d008f | |||
| 248eecdf15 | |||
| 3fd59e3674 | |||
| 1367a13c88 | |||
| a8f5d3814d | |||
| a9e4129829 | |||
| f47b2e4a24 | |||
| e8a8691a10 | |||
| f2ce3d0239 | |||
| d5b5becc18 | |||
| e451aa73d2 | |||
| ee73e0f489 | |||
| f9442b3eba | |||
| 02017cb9f3 | |||
| 306b782436 | |||
| 4f7ec41692 | |||
| 4274f4d003 | |||
| 18da8c03e0 | |||
| 9787d3a9b5 | |||
| a70978a2bd | |||
| 61f0581a02 | |||
| 4f6f0026e0 | |||
| 279fe97bd2 | |||
| e16c434140 | |||
| 4c8582b8c0 | |||
| 1cd1eb53e5 | |||
| ceefaa8f3e | |||
| b277186a4e | |||
| d258956c4a | |||
| c4bc6e9022 | |||
| 8d6e613d1f | |||
| d557253610 | |||
| a6e0e0bf9a | |||
| a04cf7d76e | |||
| 0be66059a2 | |||
| 6dc38156a2 | |||
| 15b3f43326 | |||
| 5559703a23 | |||
| 51e28ed8d7 | |||
| faba398d17 | |||
| f767e4b066 | |||
| 864a95aab3 | |||
| 2407b73f18 | |||
| c8be58152e | |||
| 17a826bf54 | |||
| 67ba0081ba | |||
| a9c7672efa | |||
| f415f6f84b | |||
| 91b1c5c22e | |||
| b53ec9de13 | |||
| 8c89ce5f65 | |||
| d0d121acb7 | |||
| 10c3c372b9 | |||
| b06c8fdd9c | |||
| 62e1fab324 | |||
| 8c26d6db93 | |||
| 4a1cf2aa17 | |||
| 91a307c918 | |||
| 656216af37 | |||
| 9151d6994a | |||
| d3eb32a44e | |||
| 00f581ca28 | |||
| a407d10f1e | |||
| d44a43190a | |||
| 01fc1376f5 | |||
| c36c0ccc1e | |||
| d270f6c22d | |||
| cecd632a8a | |||
| 991eb4f6d0 | |||
| 83c45d6304 | |||
| 4e2c620700 | |||
| 7df065ce28 | |||
| e4ce1be4b5 | |||
| e2398ac290 | |||
| e0b2c13e04 | |||
| 55c4569bda | |||
| cdd2e30a37 | |||
| bd404c8e90 | |||
| 02fa7996c8 | |||
| f4b03cf8e2 | |||
| f5916ab5af | |||
| 8362d3b35f | |||
| f06b2de39e | |||
| 45ef5c8e73 | |||
| e09d4fcb8c | |||
| a884d3a618 | |||
| 78a00990b6 | |||
| 61560ab45a | |||
| cc6b32b227 | |||
| ffc1f310af | |||
| f910245bfd | |||
| 407a7bd6a9 | |||
| 2f0b51b9f4 | |||
| 9ed6d76f12 | |||
| c5833d278c | |||
| fb6f1a4d79 | |||
| 43e26415eb | |||
| aff7cb703a | |||
| 827dd36f48 | |||
| 4496dcc631 | |||
| 1bffd70569 | |||
| 8f8933231c | |||
| 550f7760a8 | |||
| d60c0e9650 | |||
| 6d4386a6db | |||
| b562dfba48 | |||
| 71daa4a6d6 | |||
| 0766ae0049 | |||
| c11496e22d | |||
| ac78fb7625 | |||
| 4f012c5e58 | |||
| 5467e70128 | |||
| d2cdddff77 | |||
| 2645ca05d8 | |||
| 1ef6a07c09 | |||
| a8ce9071c2 | |||
| 7f13fc063c | |||
| 2ecbeeda93 | |||
| 371e7264d1 | |||
| 04c1d5a342 | |||
| faaa97b415 | |||
| 32d5bad1e1 | |||
| a3a630251b | |||
| 8b3818d97b | |||
| d06a987343 | |||
| 49e4881bff | |||
| 1c61cadaaf | |||
| 5d07f6e84f | |||
| bd465e3917 | |||
| 6d4d29137c | |||
| 221309802a | |||
| bc7088d881 | |||
| 2bfd174b06 | |||
| 6b8e97b017 | |||
| a284ccfdba | |||
| b5f0654fd2 | |||
| f187922695 | |||
| 0f8f88e7f0 | |||
| 73e4647509 | |||
| a028dd0ff1 | |||
| 9956462ee4 | |||
| 34ab1dd7b1 | |||
| e412ca95b4 | |||
| f3493f8a78 | |||
| 395354cfe0 | |||
| 9b112d78bc | |||
| 086a156564 | |||
| d5cb1a4096 | |||
| 4fd7c545cc | |||
| 60bbf98971 | |||
| 7697512a90 | |||
| 1950fefc99 | |||
| ab6a0f497b | |||
| de165bab23 | |||
| 10a75e713b | |||
| 6bff753746 | |||
| 74329146af | |||
| 237897b968 | |||
| 8c39dfb9ba | |||
| 54e95b2d33 | |||
| e1f24eb46e | |||
| 6d84d37b91 | |||
| eead9917a5 | |||
| daa3fe0ab6 | |||
| 7b18f18a1e | |||
| 7dc9febe19 | |||
| 5a930d13fd | |||
| 735280b159 | |||
| 0295ae4ee7 | |||
| db46eddf41 | |||
| db6d764fe2 | |||
| f3872e7b42 | |||
| e65f54f289 | |||
| c5575c63b8 | |||
| d935a6fd68 | |||
| dde080fb66 | |||
| 1e1d19d477 | |||
| 2acaf9cfee | |||
| 55cab152a4 | |||
| 57264882c7 | |||
| b244e7da9e | |||
| 414568e144 | |||
| d122b47456 | |||
| 1b00f61d87 | |||
| 7062b887db | |||
| 71919db800 | |||
| 5f0341a76b | |||
| 1d439b59e4 | |||
| 22d38f8b2e | |||
| b37dc152c2 | |||
| 370cb335b1 | |||
| c5a5eed7f9 | |||
| 74d4c9e631 | |||
| e3d0ad1683 | |||
| 3b9ed3037f | |||
| c5bc14690f | |||
| 782a1b4633 | |||
| 7fa1f180d6 | |||
| 3900516886 | |||
| d2621a28f5 | |||
| 92238a4408 | |||
| dd7946d997 | |||
| d1d4c85edc | |||
| 89001dfb54 | |||
| 039399e66f | |||
| 28f6aa743f | |||
| f3d73474fe | |||
| 98f282f680 | |||
| 970f23ad5c | |||
| 909c277796 | |||
| f9a85712d5 | |||
| 8dd5f4f086 | |||
| 601071fb10 | |||
| b4e47dbb93 | |||
| bae9b4c866 | |||
| 64fed39c7c | |||
| c43fe7f71e | |||
| 8ed9c72991 | |||
| 9559ed75c3 | |||
| 8f93c4084f | |||
| b8bf75156f | |||
| 07b3331b59 | |||
| 8e5440c9fc | |||
| 32bdbf913b | |||
| d875f8605e | |||
| a6e1cc12c8 | |||
| 3b4f791ba0 | |||
| 35cc173d46 | |||
| 53b1a1ecb2 | |||
| 9facd25c14 | |||
| 3a9cbdc72a | |||
| 10964239be | |||
| cfaf6a18b9 | |||
| f0cbaa1c19 | |||
| 64346429fe | |||
| 2f861c915b | |||
| 30bdc936fd | |||
| 3b79304ba5 | |||
| afc54475a8 | |||
| 14e497c06e | |||
| 4818668672 | |||
| 4db36990ee | |||
| 62a22d5b9a | |||
| ba15c14fee | |||
| ee7a9058a0 | |||
| 0089ebaaa9 | |||
| 04ec524d74 | |||
| b7367b9638 | |||
| 0686d3dc4c | |||
| b252a84543 | |||
| 7f2d81c7b6 | |||
| ab6c91d42a | |||
| b95d2cc35e | |||
| 63c4c85eff | |||
| 8b662ca83f | |||
| ccbf68066b | |||
| 4340e2faac | |||
| 1db9d1e7ec | |||
| 22f55d840c | |||
| 2b9782fdd0 | |||
| 0f43c24385 | |||
| b818dfc2d7 | |||
| 686723f4fa | |||
| 5f48905520 | |||
| 86e2c59128 | |||
| 94ff6cf6fb | |||
| f50e16d07e | |||
| 1c3d93d3ca | |||
| a8a779115c | |||
| 4eca916b5f | |||
| 694c861e81 | |||
| fa7298ed7f | |||
| 03cc152087 | |||
| 6c27894dd2 | |||
| 057d68fc2e | |||
| 1aac11d74d | |||
| 2532c36ea3 | |||
| 6bf9b6a996 | |||
| 9405709c55 | |||
| 94e2c182fa | |||
| b216fc392f | |||
| cb69b471bd | |||
| d184770c60 | |||
| 8eb614d4bb | |||
| 47ad6d600d | |||
| b9b2d11960 | |||
| 5da3e35ed3 | |||
| e08b39e0b4 | |||
| 3e0f93136f | |||
| a29aca57ee | |||
| 2fcb88838f | |||
| 879c7655f2 | |||
| 1d9a7b68f7 | |||
| 4df3274355 | |||
| 88c5506d1b | |||
| e8cfd996f0 | |||
| 395f285f91 | |||
| b8b00afaf3 | |||
| 79d375eeba | |||
| b04ba37864 | |||
| a30912967c | |||
| 1ca2bdc0c8 | |||
| 7f649757b5 | |||
| 6a5e3c1d9d |
+2
-1
@@ -28,7 +28,8 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
admin_externalpage_setup('pluginsoverview');
|
||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->plugin_management_page(plugin_manager::instance());
|
||||
|
||||
+1
-1
@@ -374,7 +374,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
|
||||
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
|
||||
'Copyright © 1999 onwards, Martin Dougiamas<br />'.
|
||||
'and <a href="http://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
|
||||
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
|
||||
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ $return = true;
|
||||
if (!empty($edit) || !empty($new)) {
|
||||
if (!empty($edit)) {
|
||||
$instance = repository::get_instance($edit);
|
||||
if ($instance->instance->contextid != $context->id) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
$instancetype = repository::get_type_by_id($instance->options['typeid']);
|
||||
$classname = 'repository_' . $instancetype->get_typename();
|
||||
$configs = $instance->get_instance_option_names();
|
||||
@@ -103,10 +106,12 @@ if (!empty($edit) || !empty($new)) {
|
||||
$return = true;
|
||||
} else if (!empty($delete)) {
|
||||
$instance = repository::get_instance($delete);
|
||||
//if you try to delete an instance set as readonly, display an error message
|
||||
if ($instance->readonly) {
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
}
|
||||
// If you try to delete an instance set as readonly, display an error message.
|
||||
throw new repository_exception('readonlyinstance', 'repository');
|
||||
} else if ($instance->instance->contextid != $context->id) {
|
||||
throw new repository_exception('nopermissiontoaccess', 'repository');
|
||||
}
|
||||
if ($sure) {
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', '', $baseurl);
|
||||
|
||||
@@ -35,10 +35,11 @@ if ($hassiteconfig
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', get_string('showgrades'), get_string('coursehelpshowgrades'), 1,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', get_string('showreports'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||
|
||||
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
||||
if (isset($CFG->maxbytes)) {
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
|
||||
} else {
|
||||
$choices = get_max_upload_sizes();
|
||||
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', get_string('maximumupload'), get_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ if ($hassiteconfig
|
||||
'institution' => get_string('institution'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', get_string('enablegravatar', 'admin'), get_string('enablegravatar_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('gravatardefaulturl', get_string('gravatardefaulturl', 'admin'), get_string('gravatardefaulturl_help', 'admin'), 'mm'));
|
||||
}
|
||||
|
||||
$ADMIN->add('roles', $temp);
|
||||
|
||||
@@ -488,7 +488,7 @@ class tool_customlang_translator implements renderable {
|
||||
list($insql, $inparams) = $DB->get_in_or_equal($filter->component, SQL_PARAMS_NAMED);
|
||||
|
||||
$csql = "SELECT COUNT(*)";
|
||||
$fsql = "SELECT s.id, s.*, c.name AS component";
|
||||
$fsql = "SELECT s.*, c.name AS component";
|
||||
$sql = " FROM {tool_customlang_components} c
|
||||
JOIN {tool_customlang} s ON s.componentid = c.id
|
||||
WHERE s.lang = :lang
|
||||
|
||||
@@ -67,3 +67,7 @@
|
||||
#page-admin-tool-customlang-index .continuebutton {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.path-admin-tool-customlang #translator .standard.master.cell.c2 {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,11 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
$userserrors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($user->username !== clean_param($user->username, PARAM_USERNAME)) {
|
||||
$upt->track('status', get_string('invalidusername', 'error', 'username'), 'error');
|
||||
$upt->track('username', $errorstr, 'error');
|
||||
$userserrors++;
|
||||
}
|
||||
if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
$upt->track('id', $existinguser->id, 'normal', false);
|
||||
}
|
||||
|
||||
@@ -112,10 +112,13 @@ $string['checkindexes'] = 'Check indexes';
|
||||
$string['check_indexes'] = 'Look for missing DB indexes';
|
||||
$string['checkoraclesemantics'] = 'Check semantics';
|
||||
$string['check_oracle_semantics'] = 'Look for incorrect length semantics';
|
||||
$string['duplicateindexname'] = 'Duplicate index name';
|
||||
$string['incorrectfieldname'] = 'Incorrect name';
|
||||
$string['index'] = 'Index';
|
||||
$string['indexes'] = 'Indexes';
|
||||
$string['indexnameempty'] = 'Index name is empty';
|
||||
$string['integerincorrectlength'] = 'Incorrect length for integer field';
|
||||
$string['incorrectindexname'] = 'Incorrect index name';
|
||||
$string['incorrectkeyname'] = 'Incorrect key name';
|
||||
$string['incorrecttablename'] = 'Incorrect table name';
|
||||
$string['key'] = 'Key';
|
||||
|
||||
@@ -81,7 +81,7 @@ function user_download_ods($fields) {
|
||||
|
||||
$worksheet = array();
|
||||
|
||||
$worksheet[0] =& $workbook->add_worksheet('');
|
||||
$worksheet[0] = $workbook->add_worksheet('');
|
||||
$col = 0;
|
||||
foreach ($fields as $fieldname) {
|
||||
$worksheet[0]->write(0, $col, $fieldname);
|
||||
@@ -119,7 +119,7 @@ function user_download_xls($fields) {
|
||||
|
||||
$worksheet = array();
|
||||
|
||||
$worksheet[0] =& $workbook->add_worksheet('');
|
||||
$worksheet[0] = $workbook->add_worksheet('');
|
||||
$col = 0;
|
||||
foreach ($fields as $fieldname) {
|
||||
$worksheet[0]->write(0, $col, $fieldname);
|
||||
|
||||
@@ -97,7 +97,7 @@ $usersmissingcaps = $webservicemanager->get_missing_capabilities_by_users($allow
|
||||
|
||||
//add the missing capabilities to the allowed users object to be displayed by renderer
|
||||
foreach ($allowedusers as &$alloweduser) {
|
||||
if (!is_siteadmin($alloweduser->id) and key_exists($alloweduser->id, $usersmissingcaps)) {
|
||||
if (!is_siteadmin($alloweduser->id) and array_key_exists($alloweduser->id, $usersmissingcaps)) {
|
||||
$alloweduser->missingcapabilities = implode(', ', $usersmissingcaps[$alloweduser->id]);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-7
@@ -65,7 +65,7 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
$authdb->Close();
|
||||
// user exists externally
|
||||
// check username/password internally
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id, 'auth'=>$this->authtype))) {
|
||||
return validate_internal_user_password($user, $password);
|
||||
}
|
||||
} else {
|
||||
@@ -191,8 +191,16 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
* @return bool True on success
|
||||
*/
|
||||
function user_update_password($user, $newpassword) {
|
||||
global $DB;
|
||||
|
||||
if ($this->is_internal()) {
|
||||
return update_internal_user_password($user, $newpassword);
|
||||
$puser = $DB->get_record('user', array('id'=>$user->id), '*', MUST_EXIST);
|
||||
if (update_internal_user_password($puser, $newpassword)) {
|
||||
$user->password = $puser->password;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// we should have never been called!
|
||||
return false;
|
||||
@@ -346,7 +354,7 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
if ($verbose) {
|
||||
mtrace(get_string('auth_dbuserstoadd','auth_db',count($add_users)));
|
||||
}
|
||||
$transaction = $DB->start_delegated_transaction();
|
||||
// Do not use transactions around this foreach, we want to skip problematic users, not revert everything.
|
||||
foreach($add_users as $user) {
|
||||
$username = $user;
|
||||
$user = $this->get_userinfo_asobj($user);
|
||||
@@ -372,9 +380,16 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
} else {
|
||||
$user->timecreated = time();
|
||||
$user->timemodified = $user->timecreated;
|
||||
$id = $DB->insert_record ('user', $user); // it is truly a new user
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)));
|
||||
try {
|
||||
$id = $DB->insert_record('user', $user); // it is truly a new user
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)));
|
||||
}
|
||||
} catch (moodle_exception $e) {
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertusererror', 'auth_db', $user->username));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// if relevant, tag for password generation
|
||||
if ($this->is_internal()) {
|
||||
@@ -383,7 +398,6 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
}
|
||||
}
|
||||
}
|
||||
$transaction->allow_commit();
|
||||
unset($add_users); // free mem
|
||||
}
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -691,7 +691,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
/// User removal
|
||||
// Find users in DB that aren't in ldap -- to be removed!
|
||||
// this is still not as scalable (but how often do we mass delete?)
|
||||
if ($this->config->removeuser !== AUTH_REMOVEUSER_KEEP) {
|
||||
if ($this->config->removeuser != AUTH_REMOVEUSER_KEEP) {
|
||||
$sql = 'SELECT u.*
|
||||
FROM {user} u
|
||||
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = e.mnethostid)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
// Check whether Shibboleth is configured properly
|
||||
if (empty($pluginconfig->user_attribute)) {
|
||||
print_error('shib_not_set_up_error', 'auth');
|
||||
print_error('shib_not_set_up_error', 'auth_shibboleth');
|
||||
}
|
||||
|
||||
/// If we can find the Shibboleth attribute, save it in session and return to main login page
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
/// Check if the user has actually submitted login data to us
|
||||
|
||||
if ($shibbolethauth->user_login($frm->username, $frm->password)) {
|
||||
if ($shibbolethauth->user_login($frm->username, $frm->password)
|
||||
&& $user = authenticate_user_login($frm->username, $frm->password)) {
|
||||
|
||||
$user = authenticate_user_login($frm->username, $frm->password);
|
||||
enrol_check_plugins($user);
|
||||
session_set_user($user);
|
||||
|
||||
@@ -83,16 +83,17 @@
|
||||
}
|
||||
|
||||
else {
|
||||
// For some weird reason the Shibboleth user couldn't be authenticated
|
||||
// The Shibboleth user couldn't be mapped to a valid Moodle user
|
||||
print_error('shib_invalid_account_error', 'auth_shibboleth');
|
||||
}
|
||||
}
|
||||
|
||||
// If we can find any (user independent) Shibboleth attributes but no user
|
||||
// attributes we probably didn't receive any user attributes
|
||||
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID']) || !empty($_SERVER['Shib-Application-ID'])) {
|
||||
print_error('shib_no_attributes_error', 'auth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
|
||||
print_error('shib_no_attributes_error', 'auth_shibboleth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
|
||||
} else {
|
||||
print_error('shib_not_set_up_error', 'auth');
|
||||
print_error('shib_not_set_up_error', 'auth_shibboleth');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ $string['auth_shib_no_organizations_warning'] = 'If you want to use the integrat
|
||||
$string['auth_shib_only'] = 'Shibboleth only';
|
||||
$string['auth_shib_only_description'] = 'Check this option if a Shibboleth authentication shall be enforced';
|
||||
$string['auth_shib_username_description'] = 'Name of the webserver Shibboleth environment variable that shall be used as Moodle username';
|
||||
$string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.';
|
||||
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
|
||||
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
|
||||
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ $PAGE->navbar->add($backup->get_stage_name());
|
||||
$renderer = $PAGE->get_renderer('core','backup');
|
||||
echo $OUTPUT->header();
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display();
|
||||
|
||||
@@ -33,7 +33,7 @@ $currentcontext = required_param('currentcontext', PARAM_INT);
|
||||
// file parameters
|
||||
$component = optional_param('component', null, PARAM_COMPONENT);
|
||||
$filearea = optional_param('filearea', null, PARAM_AREA);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_URL);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($currentcontext);
|
||||
$filecontext = get_context_instance_by_id($contextid);
|
||||
|
||||
@@ -640,7 +640,10 @@ class moodle1_converter extends base_converter {
|
||||
return $files;
|
||||
}
|
||||
foreach ($matches[2] as $match) {
|
||||
$files[] = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
|
||||
$file = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
|
||||
if ($file === clean_param($file, PARAM_PATH)) {
|
||||
$files[] = rawurldecode($file);
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique($files);
|
||||
@@ -657,9 +660,16 @@ class moodle1_converter extends base_converter {
|
||||
public static function rewrite_filephp_usage($text, array $files) {
|
||||
|
||||
foreach ($files as $file) {
|
||||
// Expect URLs properly encoded by default.
|
||||
$parts = explode('/', $file);
|
||||
$encoded = implode('/', array_map('rawurlencode', $parts));
|
||||
$fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $encoded);
|
||||
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
|
||||
$text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
|
||||
// Add support for URLs without any encoding.
|
||||
$fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $file);
|
||||
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$file.'?forcedownload=1', $text);
|
||||
$text = str_replace($fileref, '@@PLUGINFILE@@'.$file, $text);
|
||||
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
|
||||
$text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
|
||||
}
|
||||
|
||||
return $text;
|
||||
@@ -1205,6 +1215,10 @@ class moodle1_file_manager implements loggable {
|
||||
|
||||
$sourcefullpath = $this->basepath.'/'.$sourcepath;
|
||||
|
||||
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
|
||||
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
|
||||
}
|
||||
|
||||
if (!is_readable($sourcefullpath)) {
|
||||
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
|
||||
}
|
||||
@@ -1264,6 +1278,11 @@ class moodle1_file_manager implements loggable {
|
||||
*/
|
||||
public function migrate_directory($rootpath, $relpath='/') {
|
||||
|
||||
// Check the trailing slash in the $rootpath
|
||||
if (substr($rootpath, -1) === '/') {
|
||||
$rootpath = substr($rootpath, 0, strlen($rootpath) - 1);
|
||||
}
|
||||
|
||||
if (!file_exists($this->basepath.'/'.$rootpath.$relpath)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -253,13 +253,15 @@ class moodle1_converter_test extends UnitTestCase {
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertIsA($fileids, 'array');
|
||||
$this->assertEqual(0, count($fileids));
|
||||
// try to migrate a non-existing directory
|
||||
$returned = $fileman->migrate_directory('not/existing/directory');
|
||||
$this->assertIsA($returned, 'array');
|
||||
$this->assertEqual(0, count($returned));
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertIsA($fileids, 'array');
|
||||
$this->assertEqual(0, count($fileids));
|
||||
// try to migrate an invalid file
|
||||
$fileman->itemid = 1;
|
||||
$thrown = false;
|
||||
try {
|
||||
$fileman->migrate_file('/../../../../../../../../../../../../../../etc/passwd');
|
||||
} catch (moodle1_convert_exception $e) {
|
||||
$thrown = true;
|
||||
}
|
||||
$this->assertTrue($thrown);
|
||||
// migrate a single file
|
||||
$fileman->itemid = 4;
|
||||
$fileman->migrate_file('moddata/unittest/4/icon.gif');
|
||||
@@ -291,6 +293,63 @@ class moodle1_converter_test extends UnitTestCase {
|
||||
$converter->drop_stash_storage();
|
||||
}
|
||||
|
||||
public function test_migrate_directory() {
|
||||
// Set-up the file manager.
|
||||
$converter = convert_factory::get_converter('moodle1', $this->tempdir);
|
||||
$converter->create_stash_storage();
|
||||
$contextid = $converter->get_contextid(CONTEXT_MODULE, 32);
|
||||
$fileman = $converter->get_file_manager($contextid, 'mod_unittest', 'testarea');
|
||||
// This fileman has not converted anything yet.
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertIsA($fileids, 'array');
|
||||
$this->assertEqual(0, count($fileids));
|
||||
// Try to migrate a non-existing directory.
|
||||
$returned = $fileman->migrate_directory('not/existing/directory');
|
||||
$this->assertIsA($returned, 'array');
|
||||
$this->assertEqual(0, count($returned));
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertIsA($fileids, 'array');
|
||||
$this->assertEqual(0, count($fileids));
|
||||
// Try to migrate whole course_files.
|
||||
$returned = $fileman->migrate_directory('course_files');
|
||||
$this->assertIsA($returned, 'array');
|
||||
$this->assertEqual(4, count($returned)); // Two files, two directories.
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertIsA($fileids, 'array');
|
||||
$this->assertEqual(4, count($fileids));
|
||||
$this->assertTrue(is_file($converter->get_workdir_path().'/files/4e/4ea114b0558f53e3af8dd9afc0e0810a95c2a724'));
|
||||
// Check the file records.
|
||||
$files = array();
|
||||
$filerecordids = $converter->get_stash_itemids('files');
|
||||
foreach ($filerecordids as $filerecordid) {
|
||||
$filerecord = $converter->get_stash('files', $filerecordid);
|
||||
$files[$filerecord['filepath'].$filerecord['filename']] = $filerecord;
|
||||
}
|
||||
$this->assertIsA($files['/.'], 'array');
|
||||
$this->assertIsA($files['/file1.gif'], 'array');
|
||||
$this->assertIsA($files['/sub1/.'], 'array');
|
||||
$this->assertIsA($files['/sub1/file2.gif'], 'array');
|
||||
$this->assertEqual(sha1(''), $files['/.']['contenthash']);
|
||||
$this->assertEqual(sha1(''), $files['/sub1/.']['contenthash']);
|
||||
$this->assertEqual('4ea114b0558f53e3af8dd9afc0e0810a95c2a724', $files['/file1.gif']['contenthash']);
|
||||
$this->assertEqual('4ea114b0558f53e3af8dd9afc0e0810a95c2a724', $files['/sub1/file2.gif']['contenthash']);
|
||||
$converter->drop_stash_storage();
|
||||
}
|
||||
|
||||
public function test_migrate_directory_with_trailing_slash() {
|
||||
// Set-up the file manager.
|
||||
$converter = convert_factory::get_converter('moodle1', $this->tempdir);
|
||||
$converter->create_stash_storage();
|
||||
$contextid = $converter->get_contextid(CONTEXT_MODULE, 32);
|
||||
$fileman = $converter->get_file_manager($contextid, 'mod_unittest', 'testarea');
|
||||
// Try to migrate a subdirectory passed with the trailing slash.
|
||||
// This may display a debugging message which is expected.
|
||||
$returned = $fileman->migrate_directory('course_files/sub1/');
|
||||
$this->assertIsA($returned, 'array');
|
||||
$this->assertEqual(2, count($returned)); // One file, one directory.
|
||||
$converter->drop_stash_storage();
|
||||
}
|
||||
|
||||
public function test_convert_path() {
|
||||
$path = new convert_path('foo_bar', '/ROOT/THINGS/FOO/BAR');
|
||||
$this->assertEqual('foo_bar', $path->get_name());
|
||||
@@ -421,6 +480,8 @@ class moodle1_converter_test extends UnitTestCase {
|
||||
|
||||
$text = 'This is a text containing links to file.php
|
||||
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif" /><a href="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif$@FORCEDOWNLOAD@$">download image</a><br />
|
||||
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
|
||||
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
|
||||
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />';
|
||||
|
||||
$files = moodle1_converter::find_referenced_files($text);
|
||||
@@ -429,12 +490,41 @@ as it is parsed from the backup file. <br /><br /><img border="0" width="110" vs
|
||||
$this->assertTrue(in_array('/pics/news.gif', $files));
|
||||
$this->assertTrue(in_array('/MANUAL.DOC', $files));
|
||||
|
||||
$text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'), $files);
|
||||
$text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'));
|
||||
$this->assertEqual($text, 'This is a text containing links to file.php
|
||||
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">download image</a><br />
|
||||
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
|
||||
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
|
||||
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />');
|
||||
}
|
||||
|
||||
public function test_referenced_files_urlencoded() {
|
||||
|
||||
$text = 'This is a text containing links to file.php
|
||||
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif" /><a href="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif$@FORCEDOWNLOAD@$">no space</a><br />
|
||||
<br /><a href=\'$@FILEPHP@$$@SLASH@$pics$@SLASH@$news%20with%20spaces.gif$@FORCEDOWNLOAD@$\'>with urlencoded spaces</a><br />
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (none encoded)</a>
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>';
|
||||
|
||||
$files = moodle1_converter::find_referenced_files($text);
|
||||
$this->assertIsA($files, 'array');
|
||||
$this->assertEqual(3, count($files));
|
||||
$this->assertTrue(in_array('/pics/news.gif', $files));
|
||||
$this->assertTrue(in_array('/pics/news with spaces.gif', $files));
|
||||
$this->assertTrue(in_array('/illegal pics+movies/romeo+juliet.avi', $files));
|
||||
|
||||
$text = moodle1_converter::rewrite_filephp_usage($text, $files);
|
||||
$this->assertEqual('This is a text containing links to file.php
|
||||
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">no space</a><br />
|
||||
<br /><a href=\'@@PLUGINFILE@@/pics/news%20with%20spaces.gif?forcedownload=1\'>with urlencoded spaces</a><br />
|
||||
<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
|
||||
<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (none encoded)</a>
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
|
||||
<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>', $text);
|
||||
}
|
||||
|
||||
public function test_question_bank_conversion() {
|
||||
global $CFG;
|
||||
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ $PAGE->navbar->add($backup->get_stage_name());
|
||||
// Display the current stage
|
||||
echo $OUTPUT->header();
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display();
|
||||
|
||||
@@ -857,7 +857,7 @@ class backup_gradebook_structure_step extends backup_structure_step {
|
||||
$grade_category = new backup_nested_element('grade_category', array('id'), array(
|
||||
//'courseid',
|
||||
'parent', 'depth', 'path', 'fullname', 'aggregation', 'keephigh',
|
||||
'dropload', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats',
|
||||
'droplow', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats',
|
||||
'timecreated', 'timemodified', 'hidden'));
|
||||
|
||||
$letters = new backup_nested_element('grade_letters');
|
||||
|
||||
@@ -149,6 +149,22 @@ abstract class restore_qtype_plugin extends restore_plugin {
|
||||
AND ' . $DB->sql_compare_text('answer', 255) . ' = ' . $DB->sql_compare_text('?', 255);
|
||||
$params = array($newquestionid, $data->answertext);
|
||||
$newitemid = $DB->get_field_sql($sql, $params);
|
||||
|
||||
// Not able to find the answer, let's try cleaning the answertext
|
||||
// of all the question answers in DB as slower fallback. MDL-30018.
|
||||
if (!$newitemid) {
|
||||
$params = array('question' => $newquestionid);
|
||||
$answers = $DB->get_records('question_answers', $params, '', 'id, answer');
|
||||
foreach ($answers as $answer) {
|
||||
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
|
||||
$clean = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $answer->answer); // Clean CTRL chars.
|
||||
$clean = preg_replace("/\r\n|\r/", "\n", $clean); // Normalize line ending.
|
||||
if ($clean === $data->answertext) {
|
||||
$newitemid = $data->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we haven't found the newitemid, something has gone really wrong, question in DB
|
||||
// is missing answers, exception
|
||||
if (!$newitemid) {
|
||||
|
||||
@@ -189,6 +189,15 @@ class restore_gradebook_structure_step extends restore_structure_step {
|
||||
$data->id = $newitemid = $existinggradeitem->id;
|
||||
$DB->update_record('grade_items', $data);
|
||||
}
|
||||
} else if ($data->itemtype == 'manual') {
|
||||
// Manual items aren't assigned to a cm, so don't go duplicating them in the target if one exists.
|
||||
$gi = array(
|
||||
'itemtype' => $data->itemtype,
|
||||
'courseid' => $data->courseid,
|
||||
'itemname' => $data->itemname,
|
||||
'categoryid' => $data->categoryid,
|
||||
);
|
||||
$newitemid = $DB->get_field('grade_items', 'id', $gi);
|
||||
}
|
||||
|
||||
if (empty($newitemid)) {
|
||||
@@ -287,8 +296,13 @@ class restore_gradebook_structure_step extends restore_structure_step {
|
||||
|
||||
$data->courseid = $this->get_courseid();
|
||||
|
||||
$newitemid = $DB->insert_record('grade_settings', $data);
|
||||
//$this->set_mapping('grade_setting', $oldid, $newitemid);
|
||||
if (!$DB->record_exists('grade_settings', array('courseid' => $data->courseid, 'name' => $data->name))) {
|
||||
$newitemid = $DB->insert_record('grade_settings', $data);
|
||||
} else {
|
||||
$newitemid = $data->id;
|
||||
}
|
||||
|
||||
$this->set_mapping('grade_setting', $oldid, $newitemid);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2765,9 +2779,6 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$data->penalty = 1;
|
||||
}
|
||||
|
||||
$data->timecreated = $this->apply_date_offset($data->timecreated);
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
$userid = $this->get_mappingid('user', $data->createdby);
|
||||
$data->createdby = $userid ? $userid : $this->task->get_userid();
|
||||
|
||||
@@ -2821,6 +2832,22 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
AND ' . $DB->sql_compare_text('hint', 255) . ' = ' . $DB->sql_compare_text('?', 255);
|
||||
$params = array($newquestionid, $data->hint);
|
||||
$newitemid = $DB->get_field_sql($sql, $params);
|
||||
|
||||
// Not able to find the hint, let's try cleaning the hint text
|
||||
// of all the question's hints in DB as slower fallback. MDL-33863.
|
||||
if (!$newitemid) {
|
||||
$potentialhints = $DB->get_records('question_hints',
|
||||
array('questionid' => $newquestionid), '', 'id, hint');
|
||||
foreach ($potentialhints as $potentialhint) {
|
||||
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
|
||||
$cleanhint = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $potentialhint->hint); // Clean CTRL chars.
|
||||
$cleanhint = preg_replace("/\r\n|\r/", "\n", $cleanhint); // Normalize line ending.
|
||||
if ($cleanhint === $data->hint) {
|
||||
$newitemid = $data->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we haven't found the newitemid, something has gone really wrong, question in DB
|
||||
// is missing hints, exception
|
||||
if (!$newitemid) {
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ $PAGE->navbar->add($restore->get_stage_name());
|
||||
$renderer = $PAGE->get_renderer('core','backup');
|
||||
echo $OUTPUT->header();
|
||||
if (!$restore->is_independent() && $restore->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($restore->get_progress_bar());
|
||||
echo $restore->display($renderer);
|
||||
|
||||
@@ -1302,7 +1302,8 @@ abstract class restore_dbops {
|
||||
}
|
||||
$currentfullname = $fullname.$suffixfull;
|
||||
$currentshortname = substr($shortname, 0, 100 - strlen($suffixshort)).$suffixshort; // < 100cc
|
||||
$coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?', array($currentfullname, $courseid));
|
||||
$coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?',
|
||||
array($currentfullname, $courseid), '*', IGNORE_MULTIPLE);
|
||||
$courseshort = $DB->get_record_select('course', 'shortname = ? AND id != ?', array($currentshortname, $courseid));
|
||||
$counter++;
|
||||
} while ($coursefull || $courseshort);
|
||||
|
||||
@@ -75,7 +75,7 @@ class file_logger extends base_logger {
|
||||
if (substr($this->fullpath, -5) !== '.html') {
|
||||
$content = $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
|
||||
} else {
|
||||
$content = $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
$content = $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
if (false === fwrite($this->fhandle, $content)) {
|
||||
throw new base_logger_exception('error_writing_file', $this->fullpath);
|
||||
|
||||
@@ -38,7 +38,7 @@ class output_indented_logger extends base_logger {
|
||||
if (defined('STDOUT')) {
|
||||
echo $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
|
||||
} else {
|
||||
echo $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
echo $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
flush();
|
||||
return true;
|
||||
|
||||
@@ -37,7 +37,7 @@ class output_text_logger extends base_logger {
|
||||
if (defined('STDOUT')) {
|
||||
echo $prefix . $message . PHP_EOL;
|
||||
} else {
|
||||
echo $prefix . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
echo $prefix . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
flush();
|
||||
return true;
|
||||
|
||||
@@ -69,7 +69,7 @@ class block_community extends block_list {
|
||||
}
|
||||
|
||||
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'),
|
||||
'class' => 'icon', 'alt' => get_string('addcourse', 'block_community')));
|
||||
'class' => 'icon', 'alt' => ""));
|
||||
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
|
||||
array('add' => true, 'courseid' => $this->page->course->id));
|
||||
$searchlink = html_writer::tag('a', $icon . ' ' . get_string('addcourse', 'block_community'),
|
||||
|
||||
@@ -140,7 +140,7 @@ class community_hub_search_form extends moodleform {
|
||||
$options = array();
|
||||
$firsthub = false;
|
||||
foreach ($hubs as $hub) {
|
||||
if (key_exists('id', $hub)) {
|
||||
if (array_key_exists('id', $hub)) {
|
||||
$params = array('hubid' => $hub['id'],
|
||||
'filetype' => HUB_HUBSCREENSHOT_FILE_TYPE);
|
||||
$imgurl = new moodle_url(HUB_HUBDIRECTORYURL .
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
background-color:#F6F6F6;
|
||||
border:1px solid #CCCCCC;
|
||||
overflow: auto;
|
||||
padding: 7px 6px;
|
||||
}
|
||||
|
||||
#page-blocks-community-communitycourse .moodle-dialogue-base .moodle-dialogue-bd {
|
||||
@@ -222,5 +223,5 @@
|
||||
|
||||
#page-blocks-community-communitycourse .moodle-dialogue-base .closebutton {
|
||||
margin-top:4px;
|
||||
width:30px;
|
||||
margin-right:4px;
|
||||
}
|
||||
+20
-20
@@ -9,8 +9,8 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
Y.extend(COMMENTS, Y.Base, {
|
||||
|
||||
event:null,
|
||||
overlayevent:null,
|
||||
overlays: [], //all the comment boxes
|
||||
panelevent:null,
|
||||
panels: [], //all the comment boxes
|
||||
|
||||
initializer : function(params) {
|
||||
|
||||
@@ -18,18 +18,18 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
for (var i=0;i<this.get('commentids').length;i++)
|
||||
{
|
||||
var commentid = this.get('commentids')[i];
|
||||
this.overlays[commentid] = new M.core.dialogue({
|
||||
headerContent:Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML'),
|
||||
this.panels[commentid] = new M.core.dialogue({
|
||||
headerContent:Y.Node.create('<h1>')
|
||||
.append(Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML')),
|
||||
bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
lightbox : false,
|
||||
zIndex:100,
|
||||
height: '350px'
|
||||
zIndex:100
|
||||
});
|
||||
|
||||
this.overlays[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
this.overlays[commentid].render();
|
||||
this.overlays[commentid].hide();
|
||||
this.panels[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
this.panels[commentid].render();
|
||||
this.panels[commentid].hide();
|
||||
|
||||
Y.one('#comments-'+commentid).on('click', this.show, this, commentid);
|
||||
}
|
||||
@@ -38,34 +38,34 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
|
||||
show : function (e, commentid) {
|
||||
|
||||
//hide all overlays
|
||||
//hide all panels
|
||||
for (var i=0;i<this.get('commentids').length;i++)
|
||||
{
|
||||
this.hide(e, this.get('commentids')[i]);
|
||||
}
|
||||
|
||||
this.overlays[commentid].show(); //show the overlay
|
||||
this.panels[commentid].show(); //show the panel
|
||||
|
||||
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
|
||||
e.halt(); // we are going to attach a new 'hide panel' event to the body,
|
||||
// because javascript always propagate event to parent tag,
|
||||
// we need to tell Yahoo to stop to call the event on parent tag
|
||||
// otherwise the hide event will be call right away.
|
||||
|
||||
//we add a new event on the body in order to hide the overlay for the next click
|
||||
//we add a new event on the body in order to hide the panel for the next click
|
||||
this.event = Y.one(document.body).on('click', this.hide, this, commentid);
|
||||
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
|
||||
this.overlayevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
|
||||
//we add a new event on the panel in order to hide the panel for the next click (touch device)
|
||||
this.panelevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
|
||||
},
|
||||
|
||||
hide : function (e, commentid) {
|
||||
this.overlays[commentid].hide(); //hide the overlay
|
||||
this.panels[commentid].hide(); //hide the panel
|
||||
if (this.event != null) {
|
||||
this.event.detach(); //we need to detach the body hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
if (this.overlayevent != null) {
|
||||
this.overlayevent.detach(); //we need to detach the overlay hide event
|
||||
if (this.panelevent != null) {
|
||||
this.panelevent.detach(); //we need to detach the panel hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
@@ -85,5 +85,5 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
}
|
||||
|
||||
}, '@VERSION@', {
|
||||
requires:['base','overlay', 'moodle-enrol-notification']
|
||||
});
|
||||
requires:['base', 'moodle-enrol-notification']
|
||||
});
|
||||
|
||||
+38
-38
@@ -11,8 +11,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
event:null,
|
||||
previousevent:null,
|
||||
nextevent:null,
|
||||
overlayevent:null,
|
||||
overlay:null, //all the comment boxes
|
||||
panelevent:null,
|
||||
panel:null, //all the images boxes
|
||||
imageidnumbers: [],
|
||||
imageloadingevent: null,
|
||||
loadingimage: null,
|
||||
@@ -26,15 +26,15 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
+'</div>');
|
||||
objBody.append(this.loadingimage);
|
||||
|
||||
/// create the div for overlay
|
||||
/// create the div for panel
|
||||
var objBody = Y.one(document.body);
|
||||
var overlaytitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(overlaytitle);
|
||||
var overlay = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(overlay);
|
||||
var paneltitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(paneltitle);
|
||||
var panel = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(panel);
|
||||
|
||||
/// create the overlay
|
||||
this.overlay = new M.core.dialogue({
|
||||
/// create the panel
|
||||
this.panel = new M.core.dialogue({
|
||||
headerContent:Y.one('#imagetitleoverlay').get('innerHTML'),
|
||||
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
@@ -42,8 +42,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
zIndex:100
|
||||
});
|
||||
|
||||
this.overlay.render();
|
||||
this.overlay.hide();
|
||||
this.panel.render();
|
||||
this.panel.hide();
|
||||
|
||||
//attach a show event on the image divs (<tag id='image-X'>)
|
||||
for (var i=0;i<this.get('imageids').length;i++)
|
||||
@@ -85,31 +85,31 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
var maxheight = windowheight - 150;
|
||||
|
||||
//load the title + link to next image
|
||||
var overlaytitle = Y.one('#imagetitleoverlay');
|
||||
var paneltitle = Y.one('#imagetitleoverlay');
|
||||
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
|
||||
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";
|
||||
|
||||
/// need to load the images in the overlay
|
||||
var overlay = Y.one('#imageoverlay');
|
||||
overlay.setContent('');
|
||||
/// need to load the images in the panel
|
||||
var panel = Y.one('#imageoverlay');
|
||||
panel.setContent('');
|
||||
|
||||
|
||||
overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
|
||||
panel.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
|
||||
+ '" style="max-height:' + maxheight + 'px;"></div>'));
|
||||
this.overlay.destroy();
|
||||
this.overlay = new M.core.dialogue({
|
||||
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
|
||||
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
|
||||
this.panel.destroy();
|
||||
this.panel = new M.core.dialogue({
|
||||
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"><h1> Image '
|
||||
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </h1></div>' + nextimagelink,
|
||||
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
lightbox : false,
|
||||
zIndex:100
|
||||
});
|
||||
this.overlay.render();
|
||||
this.overlay.hide(); //show the overlay
|
||||
this.overlay.set("centered", true);
|
||||
this.panel.render();
|
||||
this.panel.hide(); //show the panel
|
||||
this.panel.set("centered", true);
|
||||
|
||||
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
|
||||
e.halt(); // we are going to attach a new 'hide panel' event to the body,
|
||||
// because javascript always propagate event to parent tag,
|
||||
// we need to tell Yahoo to stop to call the event on parent tag
|
||||
// otherwise the hide event will be call right away.
|
||||
@@ -123,14 +123,14 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
var screenshot = new Image();
|
||||
screenshot.src = url;
|
||||
|
||||
var overlaywidth = windowwidth - 100;
|
||||
if(overlaywidth > screenshot.width) {
|
||||
overlaywidth = screenshot.width;
|
||||
var panelwidth = windowwidth - 100;
|
||||
if(panelwidth > screenshot.width) {
|
||||
panelwidth = screenshot.width;
|
||||
}
|
||||
|
||||
this.overlay.set('width', overlaywidth);
|
||||
this.overlay.set("centered", true);
|
||||
this.overlay.show();
|
||||
this.panel.set('width', panelwidth);
|
||||
this.panel.set("centered", true);
|
||||
this.panel.show();
|
||||
|
||||
}, this, url);
|
||||
|
||||
@@ -147,12 +147,12 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
Y.one('#nextarrow').on('click', this.show, this, imageid, nextnumber);
|
||||
Y.one('#imagenumber').on('click', this.show, this, imageid, nextnumber);
|
||||
|
||||
//we add a new event on the body in order to hide the overlay for the next click
|
||||
//we add a new event on the body in order to hide the panel for the next click
|
||||
this.event = Y.one(document.body).on('click', this.hide, this);
|
||||
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
|
||||
this.overlayevent = Y.one("#imageoverlay").on('click', this.hide, this);
|
||||
//we add a new event on the panel in order to hide the panel for the next click (touch device)
|
||||
this.panelevent = Y.one("#imageoverlay").on('click', this.hide, this);
|
||||
|
||||
this.overlay.on('visibleChange',function(e){
|
||||
this.panel.on('visibleChange',function(e){
|
||||
if(e.newVal == 0){
|
||||
this.get('maskNode').remove()
|
||||
}
|
||||
@@ -167,14 +167,14 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
//hide the loading image
|
||||
Y.one('#hubloadingimage').setStyle('display', 'none');
|
||||
|
||||
this.overlay.hide(); //hide the overlay
|
||||
this.panel.hide(); //hide the panel
|
||||
if (this.event != null) {
|
||||
this.event.detach(); //we need to detach the body hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
if (this.overlayevent != null) {
|
||||
this.overlayevent.detach(); //we need to detach the overlay hide event
|
||||
if (this.panelevent != null) {
|
||||
this.panelevent.detach(); //we need to detach the panel hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
@@ -195,5 +195,5 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
}
|
||||
|
||||
}, '@VERSION@', {
|
||||
requires:['base','node','overlay', 'moodle-enrol-notification']
|
||||
requires:['base','node', 'moodle-enrol-notification']
|
||||
});
|
||||
|
||||
@@ -51,8 +51,10 @@ class block_completionstatus extends block_base {
|
||||
// Create empty content
|
||||
$this->content = new stdClass();
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
// Can edit settings?
|
||||
$can_edit = has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id));
|
||||
$can_edit = has_capability('moodle/course:update', $context);
|
||||
|
||||
// Get course completion data
|
||||
$info = new completion_info($course);
|
||||
@@ -83,148 +85,145 @@ class block_completionstatus extends block_base {
|
||||
}
|
||||
|
||||
// Check this user is enroled
|
||||
if (!$info->is_tracked_user($USER->id)) {
|
||||
// If not enrolled, but are can view the report:
|
||||
if (has_capability('report/completion:view', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
$report = new moodle_url('/report/completion/index.php', array('course' => $course->id));
|
||||
$this->content->text = '<a href="'.$report->out().'">'.get_string('viewcoursereport', 'completion').'</a>';
|
||||
return $this->content;
|
||||
if ($info->is_tracked_user($USER->id)) {
|
||||
|
||||
// Generate markup for criteria statuses
|
||||
$shtml = '';
|
||||
|
||||
// For aggregating activity completion
|
||||
$activities = array();
|
||||
$activities_complete = 0;
|
||||
|
||||
// For aggregating course prerequisites
|
||||
$prerequisites = array();
|
||||
$prerequisites_complete = 0;
|
||||
|
||||
// Flag to set if current completion data is inconsistent with
|
||||
// what is stored in the database
|
||||
$pending_update = false;
|
||||
|
||||
// Loop through course criteria
|
||||
foreach ($completions as $completion) {
|
||||
|
||||
$criteria = $completion->get_criteria();
|
||||
$complete = $completion->is_complete();
|
||||
|
||||
if (!$pending_update && $criteria->is_pending($completion)) {
|
||||
$pending_update = true;
|
||||
}
|
||||
|
||||
// Activities are a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
|
||||
$activities[$criteria->moduleinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$activities_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prerequisites are also a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_COURSE) {
|
||||
$prerequisites[$criteria->courseinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$prerequisites_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= $criteria->get_title();
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$shtml .= $completion->get_status();
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Otherwise, show error
|
||||
// Aggregate activities
|
||||
if (!empty($activities)) {
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= get_string('activitiescompleted', 'completion');
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $activities_complete;
|
||||
$a->second = count($activities);
|
||||
$shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Aggregate prerequisites
|
||||
if (!empty($prerequisites)) {
|
||||
|
||||
$phtml = '<tr><td>';
|
||||
$phtml .= get_string('prerequisitescompleted', 'completion');
|
||||
$phtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $prerequisites_complete;
|
||||
$a->second = count($prerequisites);
|
||||
$phtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$phtml .= '</td></tr>';
|
||||
|
||||
$shtml = $phtml . $shtml;
|
||||
}
|
||||
|
||||
// Display completion status
|
||||
$this->content->text = '<table width="100%" style="font-size: 90%;"><tbody>';
|
||||
$this->content->text .= '<tr><td colspan="2"><b>'.get_string('status').':</b> ';
|
||||
|
||||
// Is course complete?
|
||||
$coursecomplete = $info->is_course_complete($USER->id);
|
||||
|
||||
// Load course completion
|
||||
$params = array(
|
||||
'userid' => $USER->id,
|
||||
'course' => $course->id
|
||||
);
|
||||
$ccompletion = new completion_completion($params);
|
||||
|
||||
// Has this user completed any criteria?
|
||||
$criteriacomplete = $info->count_course_user_data($USER->id);
|
||||
|
||||
if ($pending_update) {
|
||||
$this->content->text .= '<i>'.get_string('pending', 'completion').'</i>';
|
||||
} else if ($coursecomplete) {
|
||||
$this->content->text .= get_string('complete');
|
||||
} else if (!$criteriacomplete && !$ccompletion->timestarted) {
|
||||
$this->content->text .= '<i>'.get_string('notyetstarted', 'completion').'</i>';
|
||||
} else {
|
||||
$this->content->text .= '<i>'.get_string('inprogress','completion').'</i>';
|
||||
}
|
||||
|
||||
$this->content->text .= '</td></tr>';
|
||||
$this->content->text .= '<tr><td colspan="2">';
|
||||
|
||||
// Get overall aggregation method
|
||||
$overall = $info->get_aggregation_method();
|
||||
|
||||
if ($overall == COMPLETION_AGGREGATION_ALL) {
|
||||
$this->content->text .= get_string('criteriarequiredall', 'completion');
|
||||
} else {
|
||||
$this->content->text .= get_string('criteriarequiredany', 'completion');
|
||||
}
|
||||
|
||||
$this->content->text .= ':</td></tr>';
|
||||
$this->content->text .= '<tr><td><b>'.get_string('requiredcriteria', 'completion').'</b></td><td style="text-align: right"><b>'.get_string('status').'</b></td></tr>';
|
||||
$this->content->text .= $shtml.'</tbody></table>';
|
||||
|
||||
// Display link to detailed view
|
||||
$details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id));
|
||||
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
|
||||
} else {
|
||||
// If user is not enrolled, show error
|
||||
$this->content->text = get_string('notenroled', 'completion');
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
// Generate markup for criteria statuses
|
||||
$shtml = '';
|
||||
|
||||
// For aggregating activity completion
|
||||
$activities = array();
|
||||
$activities_complete = 0;
|
||||
|
||||
// For aggregating course prerequisites
|
||||
$prerequisites = array();
|
||||
$prerequisites_complete = 0;
|
||||
|
||||
// Flag to set if current completion data is inconsistent with
|
||||
// what is stored in the database
|
||||
$pending_update = false;
|
||||
|
||||
// Loop through course criteria
|
||||
foreach ($completions as $completion) {
|
||||
|
||||
$criteria = $completion->get_criteria();
|
||||
$complete = $completion->is_complete();
|
||||
|
||||
if (!$pending_update && $criteria->is_pending($completion)) {
|
||||
$pending_update = true;
|
||||
}
|
||||
|
||||
// Activities are a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
|
||||
$activities[$criteria->moduleinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$activities_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prerequisites are also a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_COURSE) {
|
||||
$prerequisites[$criteria->courseinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$prerequisites_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= $criteria->get_title();
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$shtml .= $completion->get_status();
|
||||
$shtml .= '</td></tr>';
|
||||
if (has_capability('report/completion:view', $context)) {
|
||||
$report = new moodle_url('/report/completion/index.php', array('course' => $course->id));
|
||||
$this->content->footer .= '<br /><a href="'.$report->out().'">'.get_string('viewcoursereport', 'completion').'</a>';
|
||||
}
|
||||
|
||||
// Aggregate activities
|
||||
if (!empty($activities)) {
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= get_string('activitiescompleted', 'completion');
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $activities_complete;
|
||||
$a->second = count($activities);
|
||||
$shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Aggregate prerequisites
|
||||
if (!empty($prerequisites)) {
|
||||
|
||||
$phtml = '<tr><td>';
|
||||
$phtml .= get_string('prerequisitescompleted', 'completion');
|
||||
$phtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $prerequisites_complete;
|
||||
$a->second = count($prerequisites);
|
||||
$phtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$phtml .= '</td></tr>';
|
||||
|
||||
$shtml = $phtml . $shtml;
|
||||
}
|
||||
|
||||
// Display completion status
|
||||
$this->content->text = '<table width="100%" style="font-size: 90%;"><tbody>';
|
||||
$this->content->text .= '<tr><td colspan="2"><b>'.get_string('status').':</b> ';
|
||||
|
||||
// Is course complete?
|
||||
$coursecomplete = $info->is_course_complete($USER->id);
|
||||
|
||||
// Load course completion
|
||||
$params = array(
|
||||
'userid' => $USER->id,
|
||||
'course' => $course->id
|
||||
);
|
||||
$ccompletion = new completion_completion($params);
|
||||
|
||||
// Has this user completed any criteria?
|
||||
$criteriacomplete = $info->count_course_user_data($USER->id);
|
||||
|
||||
if ($pending_update) {
|
||||
$this->content->text .= '<i>'.get_string('pending', 'completion').'</i>';
|
||||
} else if ($coursecomplete) {
|
||||
$this->content->text .= get_string('complete');
|
||||
} else if (!$criteriacomplete && !$ccompletion->timestarted) {
|
||||
$this->content->text .= '<i>'.get_string('notyetstarted', 'completion').'</i>';
|
||||
} else {
|
||||
$this->content->text .= '<i>'.get_string('inprogress','completion').'</i>';
|
||||
}
|
||||
|
||||
$this->content->text .= '</td></tr>';
|
||||
$this->content->text .= '<tr><td colspan="2">';
|
||||
|
||||
// Get overall aggregation method
|
||||
$overall = $info->get_aggregation_method();
|
||||
|
||||
if ($overall == COMPLETION_AGGREGATION_ALL) {
|
||||
$this->content->text .= get_string('criteriarequiredall', 'completion');
|
||||
} else {
|
||||
$this->content->text .= get_string('criteriarequiredany', 'completion');
|
||||
}
|
||||
|
||||
$this->content->text .= ':</td></tr>';
|
||||
$this->content->text .= '<tr><td><b>'.get_string('requiredcriteria', 'completion').'</b></td><td style="text-align: right"><b>'.get_string('status').'</b></td></tr>';
|
||||
$this->content->text .= $shtml.'</tbody></table>';
|
||||
|
||||
// Display link to detailed view
|
||||
$details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id));
|
||||
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-5
@@ -164,7 +164,7 @@ M.core_dock.init = function(Y) {
|
||||
var dock = Y.one('#dock');
|
||||
if (!dock) {
|
||||
// Start the construction of the dock
|
||||
dock = Y.Node.create('<div id="dock" class="'+css.dock+' '+css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation+'"></div>')
|
||||
dock = Y.Node.create('<div id="dock" role="menubar" class="'+css.dock+' '+css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+css.buttonscontainer+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+css.dockeditemcontainer+'"></div>')));
|
||||
this.nodes.body.append(dock);
|
||||
@@ -505,7 +505,7 @@ M.core_dock.fixTitleOrientation = function(item, title, text) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Y.UA.ie > 7) {
|
||||
if (Y.UA.ie == 8) {
|
||||
// IE8 can flip the text via CSS but not handle SVG
|
||||
title.setContent(text);
|
||||
title.setAttribute('style', 'writing-mode: tb-rl; filter: flipV flipH;display:inline;');
|
||||
@@ -863,6 +863,12 @@ M.core_dock.genericblock.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable the skip anchor when docking
|
||||
var skipanchor = node.previous();
|
||||
if (skipanchor.hasClass('skip-block')) {
|
||||
skipanchor.hide();
|
||||
}
|
||||
|
||||
var blockclass = (function(classes){
|
||||
var r = /(^|\s)(block_[a-zA-Z0-9_]+)(\s|$)/;
|
||||
var m = r.exec(classes);
|
||||
@@ -910,7 +916,7 @@ M.core_dock.genericblock.prototype = {
|
||||
}, this);
|
||||
// Add a close icon
|
||||
// Must set the image src seperatly of we get an error with XML strict headers
|
||||
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="" style="width:11px;height:11px;cursor:pointer;" /></span>');
|
||||
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" style="width:11px;height:11px;cursor:pointer;"/></span>');
|
||||
closeicon.one('img').setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
|
||||
closeicon.on('forceclose|click', this.hide, this);
|
||||
closeicon.on('dock:actionkey',this.hide, this, {actions:{enter:true,toggle:true}});
|
||||
@@ -937,6 +943,12 @@ M.core_dock.genericblock.prototype = {
|
||||
return_to_block : function(dockitem) {
|
||||
var placeholder = this.Y.one('#content_placeholder_'+this.id);
|
||||
|
||||
// Enable the skip anchor when going back to block mode
|
||||
var skipanchor = placeholder.previous();
|
||||
if (skipanchor.hasClass('skip-block')) {
|
||||
skipanchor.show();
|
||||
}
|
||||
|
||||
if (this.cachedcontentnode.one('.header')) {
|
||||
this.cachedcontentnode.one('.header').insert(dockitem.contents, 'after');
|
||||
} else {
|
||||
@@ -946,7 +958,7 @@ M.core_dock.genericblock.prototype = {
|
||||
placeholder.replace(this.Y.Node.getDOMNode(this.cachedcontentnode));
|
||||
this.cachedcontentnode = this.Y.one('#'+this.cachedcontentnode.get('id'));
|
||||
|
||||
var commands = this.cachedcontentnode.one('.title .commands');
|
||||
var commands = dockitem.commands;
|
||||
if (commands) {
|
||||
commands.all('.hidepanelicon').remove();
|
||||
commands.all('.moveto').remove();
|
||||
@@ -1024,7 +1036,7 @@ M.core_dock.item.prototype = {
|
||||
var Y = this.Y;
|
||||
var css = M.core_dock.css;
|
||||
|
||||
this.nodes.docktitle = Y.Node.create('<div id="dock_item_'+this.id+'_title" class="'+css.dockedtitle+'"></div>');
|
||||
this.nodes.docktitle = Y.Node.create('<div id="dock_item_'+this.id+'_title" role="menu" aria-haspopup="true" class="'+css.dockedtitle+'"></div>');
|
||||
this.nodes.docktitle.append(this.title);
|
||||
this.nodes.dockitem = Y.Node.create('<div id="dock_item_'+this.id+'" class="'+css.dockeditem+'" tabindex="0"></div>');
|
||||
this.nodes.dockitem.on('dock:actionkey', this.toggle, this);
|
||||
@@ -1053,6 +1065,8 @@ M.core_dock.item.prototype = {
|
||||
this.active = true;
|
||||
// Add active item class first up
|
||||
this.nodes.docktitle.addClass(css.activeitem);
|
||||
// Set aria-exapanded property to true.
|
||||
this.nodes.docktitle.set('aria-expanded', "true");
|
||||
this.fire('dockeditem:showcomplete');
|
||||
M.core_dock.resize();
|
||||
return true;
|
||||
@@ -1069,6 +1083,8 @@ M.core_dock.item.prototype = {
|
||||
this.nodes.docktitle.removeClass(css.activeitem);
|
||||
// Hide the panel
|
||||
M.core_dock.getPanel().hide();
|
||||
// Set aria-exapanded property to false
|
||||
this.nodes.docktitle.set('aria-expanded', "false");
|
||||
this.fire('dockeditem:hidecomplete');
|
||||
},
|
||||
/**
|
||||
|
||||
+19
-3
@@ -24,13 +24,29 @@
|
||||
*/
|
||||
|
||||
function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $args, $forcedownload) {
|
||||
global $SCRIPT;
|
||||
global $DB, $CFG;
|
||||
|
||||
if ($context->contextlevel != CONTEXT_BLOCK) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
require_course_login($course);
|
||||
// If block is in course context, then check if user has capability to access course.
|
||||
if ($context->get_course_context(false)) {
|
||||
require_course_login($course);
|
||||
} else if ($CFG->forcelogin) {
|
||||
require_login();
|
||||
} else {
|
||||
// Get parent context and see if user have proper permission.
|
||||
$parentcontext = $context->get_parent_context();
|
||||
if ($parentcontext->contextlevel === CONTEXT_COURSECAT) {
|
||||
// Check if category is visible and user can view this category.
|
||||
$category = $DB->get_record('course_categories', array('id' => $parentcontext->instanceid), '*', MUST_EXIST);
|
||||
if (!$category->visible) {
|
||||
require_capability('moodle/category:viewhiddencategories', $parentcontext);
|
||||
}
|
||||
}
|
||||
// At this point there is no way to check SYSTEM or USER context, so ignoring it.
|
||||
}
|
||||
|
||||
if ($filearea !== 'content') {
|
||||
send_file_not_found();
|
||||
@@ -79,4 +95,4 @@ function block_html_global_db_replace($search, $replace) {
|
||||
}
|
||||
}
|
||||
$instances->close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,18 +74,20 @@ class block_navigation_renderer extends plugin_renderer_base {
|
||||
|
||||
// this applies to the li item which contains all child lists too
|
||||
$liclasses = array($item->get_css_type(), 'depth_'.$depth);
|
||||
$liexpandable = array();
|
||||
if ($item->has_children() && (!$item->forceopen || $item->collapse)) {
|
||||
$liclasses[] = 'collapsed';
|
||||
}
|
||||
if ($isbranch) {
|
||||
$liclasses[] = 'contains_branch';
|
||||
$liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
|
||||
} else if ($hasicon) {
|
||||
$liclasses[] = 'item_with_icon';
|
||||
}
|
||||
if ($item->isactive === true) {
|
||||
$liclasses[] = 'current_branch';
|
||||
}
|
||||
$liattr = array('class'=>join(' ',$liclasses));
|
||||
$liattr = array('class' => join(' ',$liclasses)) + $liexpandable;
|
||||
// class attribute on the div item which only contains the item content
|
||||
$divclasses = array('tree_item');
|
||||
if ($isbranch) {
|
||||
|
||||
@@ -162,16 +162,20 @@ TREE.prototype = {
|
||||
switch (e.action) {
|
||||
case 'expand' :
|
||||
target.removeClass('collapsed');
|
||||
target.set('aria-expanded', true);
|
||||
break;
|
||||
case 'collapse' :
|
||||
target.addClass('collapsed');
|
||||
target.set('aria-expanded', false);
|
||||
break;
|
||||
default :
|
||||
target.toggleClass('collapsed');
|
||||
target.set('aria-expanded', !target.hasClass('collapsed'));
|
||||
}
|
||||
e.halt();
|
||||
} else {
|
||||
target.toggleClass('collapsed');
|
||||
target.set('aria-expanded', !target.hasClass('collapsed'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +184,7 @@ TREE.prototype = {
|
||||
target.siblings('li').each(function(){
|
||||
if (this.get('id') !== target.get('id') && !this.hasClass('collapsed')) {
|
||||
this.addClass('collapsed');
|
||||
this.set('aria-expanded', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -287,6 +292,7 @@ BRANCH.prototype = {
|
||||
}
|
||||
if (isbranch) {
|
||||
branchli.addClass('collapsed').addClass('contains_branch');
|
||||
branchli.set('aria-expanded', false);
|
||||
branchp.addClass('branch');
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ class block_online_users extends block_base {
|
||||
if (isset($CFG->block_online_users_timetosee)) {
|
||||
$timetoshowusers = $CFG->block_online_users_timetosee * 60;
|
||||
}
|
||||
$timefrom = 100 * floor((time()-$timetoshowusers) / 100); // Round to nearest 100 seconds for better query cache
|
||||
$now = time();
|
||||
$timefrom = 100 * floor(($now - $timetoshowusers) / 100); // Round to nearest 100 seconds for better query cache
|
||||
|
||||
//Calculate if we are in separate groups
|
||||
$isseparategroups = ($this->page->course->groupmode == SEPARATEGROUPS
|
||||
@@ -53,18 +54,23 @@ class block_online_users extends block_base {
|
||||
}
|
||||
|
||||
$userfields = user_picture::fields('u', array('username'));
|
||||
|
||||
$params['now'] = $now;
|
||||
$params['timefrom'] = $timefrom;
|
||||
if ($this->page->course->id == SITEID or $this->page->context->contextlevel < CONTEXT_COURSE) { // Site-level
|
||||
$sql = "SELECT $userfields, MAX(u.lastaccess) AS lastaccess
|
||||
FROM {user} u $groupmembers
|
||||
WHERE u.lastaccess > $timefrom
|
||||
WHERE u.lastaccess > :timefrom
|
||||
AND u.lastaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect
|
||||
GROUP BY $userfields
|
||||
ORDER BY lastaccess DESC ";
|
||||
|
||||
$csql = "SELECT COUNT(u.id)
|
||||
FROM {user} u $groupmembers
|
||||
WHERE u.lastaccess > $timefrom
|
||||
WHERE u.lastaccess > :timefrom
|
||||
AND u.lastaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect";
|
||||
|
||||
} else {
|
||||
@@ -77,9 +83,11 @@ class block_online_users extends block_base {
|
||||
$sql = "SELECT $userfields, MAX(ul.timeaccess) AS lastaccess
|
||||
FROM {user_lastaccess} ul $groupmembers, {user} u
|
||||
JOIN ($esqljoin) euj ON euj.id = u.id
|
||||
WHERE ul.timeaccess > $timefrom
|
||||
WHERE ul.timeaccess > :timefrom
|
||||
AND u.id = ul.userid
|
||||
AND ul.courseid = :courseid
|
||||
AND ul.timeaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect
|
||||
GROUP BY $userfields
|
||||
ORDER BY lastaccess DESC";
|
||||
@@ -87,9 +95,11 @@ class block_online_users extends block_base {
|
||||
$csql = "SELECT COUNT(u.id)
|
||||
FROM {user_lastaccess} ul $groupmembers, {user} u
|
||||
JOIN ($esqljoin) euj ON euj.id = u.id
|
||||
WHERE ul.timeaccess > $timefrom
|
||||
WHERE ul.timeaccess > :timefrom
|
||||
AND u.id = ul.userid
|
||||
AND ul.courseid = :courseid
|
||||
AND ul.timeaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect";
|
||||
|
||||
$params['courseid'] = $this->page->course->id;
|
||||
@@ -138,15 +148,16 @@ class block_online_users extends block_base {
|
||||
}
|
||||
foreach ($users as $user) {
|
||||
$this->content->text .= '<li class="listentry">';
|
||||
$timeago = format_time(time() - $user->lastaccess); //bruno to calculate correctly on frontpage
|
||||
$timeago = format_time($now - $user->lastaccess); //bruno to calculate correctly on frontpage
|
||||
|
||||
if (isguestuser($user)) {
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false));
|
||||
$this->content->text .= get_string('guestuser').'</div>';
|
||||
|
||||
} else {
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->page->course->id.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
|
||||
$this->content->text .= '<div class="user">';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->page->course->id.'" title="'.$timeago.'">';
|
||||
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
|
||||
}
|
||||
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
|
||||
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />';
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
|
||||
$r = html_writer::start_tag('li');
|
||||
$r.= html_writer::start_tag('div',array('class'=>'link'));
|
||||
$r.= html_writer::link(clean_param($link,PARAM_URL), s($title), array('onclick'=>'this.target="_blank"'));
|
||||
$r.= html_writer::link($link, s($title), array('onclick'=>'this.target="_blank"'));
|
||||
$r.= html_writer::end_tag('div');
|
||||
|
||||
if($this->config->display_description && !empty($description)){
|
||||
|
||||
@@ -27,6 +27,7 @@ class block_search_forums extends block_base {
|
||||
|
||||
$this->content->text = '<div class="searchform">';
|
||||
$this->content->text .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline"><fieldset class="invisiblefieldset">';
|
||||
$this->content->text .= '<legend class="accesshide">'.$strsearch.'</legend>';
|
||||
$this->content->text .= '<input name="id" type="hidden" value="'.$this->page->course->id.'" />'; // course
|
||||
$this->content->text .= '<label class="accesshide" for="searchform_search">'.$strsearch.'</label>'.
|
||||
'<input id="searchform_search" name="search" type="text" size="16" />';
|
||||
|
||||
@@ -40,18 +40,20 @@ class block_settings_renderer extends plugin_renderer_base {
|
||||
|
||||
// this applies to the li item which contains all child lists too
|
||||
$liclasses = array($item->get_css_type());
|
||||
$liexpandable = array();
|
||||
if (!$item->forceopen || (!$item->forceopen && $item->collapse) || ($item->children->count()==0 && $item->nodetype==navigation_node::NODETYPE_BRANCH)) {
|
||||
$liclasses[] = 'collapsed';
|
||||
}
|
||||
if ($isbranch) {
|
||||
$liclasses[] = 'contains_branch';
|
||||
$liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
|
||||
} else if ($hasicon) {
|
||||
$liclasses[] = 'item_with_icon';
|
||||
}
|
||||
if ($item->isactive === true) {
|
||||
$liclasses[] = 'current_branch';
|
||||
}
|
||||
$liattr = array('class'=>join(' ',$liclasses));
|
||||
$liattr = array('class' => join(' ',$liclasses)) + $liexpandable;
|
||||
// class attribute on the div item which only contains the item content
|
||||
$divclasses = array('tree_item');
|
||||
if ($isbranch) {
|
||||
|
||||
@@ -82,6 +82,7 @@ $string['pluginname'] = 'Tags';
|
||||
$string['select'] = 'Select...';
|
||||
$string['showcoursetags'] = 'Show course tags';
|
||||
$string['showcoursetagsdef'] = 'Display the course tagging features in the tags block, allowing students to tag courses.';
|
||||
$string['suggestedtagthisunit'] = 'Suggested tag to this course:';
|
||||
$string['tags'] = 'tags';
|
||||
$string['tagthisunit'] = 'Tag this course:';
|
||||
$string['tagunits'] = 'to tag your favourite courses';
|
||||
|
||||
@@ -104,11 +104,23 @@ function blog_rss_get_params($filters) {
|
||||
function blog_rss_get_feed($context, $args) {
|
||||
global $CFG, $SITE, $DB;
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
debugging('Blogging disabled on this site, RSS feeds are not available');
|
||||
return null;
|
||||
}
|
||||
|
||||
if (empty($CFG->enablerssfeeds)) {
|
||||
debugging('Sorry, RSS feeds are disabled on this site');
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
|
||||
if (isguestuser()) {
|
||||
debugging(get_string('nopermissiontoshow','error'));
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
if (!has_capability('moodle/blog:view', $sitecontext)) {
|
||||
return null;
|
||||
|
||||
+9
-5
@@ -1931,24 +1931,22 @@ class calendar_event {
|
||||
if ($usingeditor) {
|
||||
switch ($this->properties->eventtype) {
|
||||
case 'user':
|
||||
$this->editorcontext = $this->properties->context;
|
||||
$this->properties->courseid = 0;
|
||||
$this->properties->course = 0;
|
||||
$this->properties->groupid = 0;
|
||||
$this->properties->userid = $USER->id;
|
||||
break;
|
||||
case 'site':
|
||||
$this->editorcontext = $this->properties->context;
|
||||
$this->properties->courseid = SITEID;
|
||||
$this->properties->course = SITEID;
|
||||
$this->properties->groupid = 0;
|
||||
$this->properties->userid = $USER->id;
|
||||
break;
|
||||
case 'course':
|
||||
$this->editorcontext = $this->properties->context;
|
||||
$this->properties->groupid = 0;
|
||||
$this->properties->userid = $USER->id;
|
||||
break;
|
||||
case 'group':
|
||||
$this->editorcontext = $this->properties->context;
|
||||
$this->properties->userid = $USER->id;
|
||||
break;
|
||||
default:
|
||||
@@ -1958,6 +1956,13 @@ class calendar_event {
|
||||
break;
|
||||
}
|
||||
|
||||
// If we are actually using the editor, we recalculate the context because some default values
|
||||
// were set when calculate_context() was called from the constructor.
|
||||
if ($usingeditor) {
|
||||
$this->properties->context = $this->calculate_context($this->properties);
|
||||
$this->editorcontext = $this->properties->context;
|
||||
}
|
||||
|
||||
$editor = $this->properties->description;
|
||||
$this->properties->format = $this->properties->description['format'];
|
||||
$this->properties->description = $this->properties->description['text'];
|
||||
@@ -1976,7 +1981,6 @@ class calendar_event {
|
||||
$this->editoroptions,
|
||||
$editor['text'],
|
||||
$this->editoroptions['forcehttps']);
|
||||
|
||||
$DB->set_field('event', 'description', $this->properties->description, array('id'=>$this->properties->id));
|
||||
}
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
// Paddding (the first week may have blank days in the beginning)
|
||||
for($i = $display->minwday; $i < $startwday; ++$i) {
|
||||
$cell = new html_table_cell(' ');
|
||||
$cell->attributes = array('class'=>'nottoday');
|
||||
$cell->attributes = array('class'=>'nottoday dayblank');
|
||||
$row->cells[] = $cell;
|
||||
}
|
||||
|
||||
@@ -519,10 +519,10 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
}
|
||||
|
||||
// Special visual fx for today
|
||||
if($display->thismonth && $calendar->day == $calendar->day) {
|
||||
$cellclasses[] = 'today';
|
||||
if ($display->thismonth && $calendar->day == $date['mday']) {
|
||||
$cellclasses[] = 'day today';
|
||||
} else {
|
||||
$cellclasses[] = 'nottoday';
|
||||
$cellclasses[] = 'day nottoday';
|
||||
}
|
||||
$cell->attributes = array('class'=>join(' ',$cellclasses));
|
||||
|
||||
@@ -553,7 +553,7 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
// Paddding (the last week may have blank days at the end)
|
||||
for($i = $dayweek; $i <= $display->maxwday; ++$i) {
|
||||
$cell = new html_table_cell(' ');
|
||||
$cell->attributes = array('class'=>'nottoday');
|
||||
$cell->attributes = array('class'=>'nottoday dayblank');
|
||||
$row->cells[] = $cell;
|
||||
}
|
||||
$table->data[] = $row;
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
this.publish('hideevent');
|
||||
td.on('mouseenter', this.startShow, this);
|
||||
td.on('mouseleave', this.startHide, this);
|
||||
td.on('focus', this.startShow, this);
|
||||
td.on('blur', this.startHide, this);
|
||||
return true;
|
||||
},
|
||||
initPanel : function() {
|
||||
|
||||
+2
-2
@@ -70,8 +70,8 @@ echo $OUTPUT->heading(get_string('assignto', 'cohort', format_string($cohort->na
|
||||
echo $OUTPUT->notification(get_string('removeuserwarning', 'core_cohort'));
|
||||
|
||||
// Get the user_selector we will need.
|
||||
$potentialuserselector = new cohort_candidate_selector('addselect', array('cohortid'=>$cohort->id));
|
||||
$existinguserselector = new cohort_existing_selector('removeselect', array('cohortid'=>$cohort->id));
|
||||
$potentialuserselector = new cohort_candidate_selector('addselect', array('cohortid'=>$cohort->id, 'accesscontext'=>$context));
|
||||
$existinguserselector = new cohort_existing_selector('removeselect', array('cohortid'=>$cohort->id, 'accesscontext'=>$context));
|
||||
|
||||
// Process incoming user assignments to the cohort
|
||||
|
||||
|
||||
+2
-2
@@ -126,7 +126,7 @@ function cohort_delete_category($category) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove cohort member
|
||||
* Add cohort member
|
||||
* @param int $cohortid
|
||||
* @param int $userid
|
||||
* @return void
|
||||
@@ -143,7 +143,7 @@ function cohort_add_member($cohortid, $userid) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add cohort member
|
||||
* Remove cohort member
|
||||
* @param int $cohortid
|
||||
* @param int $userid
|
||||
* @return void
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
val = val.replace('___name___', list[i].fullname);
|
||||
}
|
||||
if (list[i]['delete']||newcmt) {
|
||||
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img alt="" src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
}
|
||||
val = val.replace('___time___', list[i].time);
|
||||
val = val.replace('___picture___', list[i].avatar);
|
||||
|
||||
@@ -34,7 +34,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
|
||||
$area = optional_param('area', '', PARAM_AREA);
|
||||
$content = optional_param('content', '', PARAM_RAW);
|
||||
$itemid = optional_param('itemid', '', PARAM_INT);
|
||||
$returnurl = optional_param('returnurl', '/', PARAM_URL);
|
||||
$returnurl = optional_param('returnurl', '/', PARAM_LOCALURL);
|
||||
$component = optional_param('component', '', PARAM_COMPONENT);
|
||||
|
||||
// Currently this script can only add comments
|
||||
|
||||
@@ -89,7 +89,7 @@ class comment_manager {
|
||||
*/
|
||||
private function setup_course($courseid) {
|
||||
global $PAGE, $DB;
|
||||
if (!empty($this->course)) {
|
||||
if (!empty($this->course) && $this->course->id == $courseid) {
|
||||
// already set, stop
|
||||
return;
|
||||
}
|
||||
|
||||
+14
-2
@@ -27,10 +27,10 @@
|
||||
|
||||
require_once("../config.php");
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
require_once($CFG->libdir.'/textlib.class.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Category id
|
||||
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
||||
$perpage = optional_param('perpage', $CFG->coursesperpage, PARAM_INT); // how many per page
|
||||
$categoryedit = optional_param('categoryedit', -1, PARAM_BOOL);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$show = optional_param('show', 0, PARAM_INT);
|
||||
@@ -40,6 +40,16 @@ $moveto = optional_param('moveto', 0, PARAM_INT);
|
||||
$resort = optional_param('resort', 0, PARAM_BOOL);
|
||||
$sesskey = optional_param('sesskey', '', PARAM_RAW);
|
||||
|
||||
// MDL-27824 - This is a temporary fix until we have the proper
|
||||
// way to check/initialize $CFG value.
|
||||
// @todo MDL-35138 remove this temporary solution
|
||||
if (!empty($CFG->coursesperpage)) {
|
||||
$defaultperpage = $CFG->coursesperpage;
|
||||
} else {
|
||||
$defaultperpage = 20;
|
||||
}
|
||||
$perpage = optional_param('perpage', $defaultperpage, PARAM_INT); // how many per page
|
||||
|
||||
if (empty($id)) {
|
||||
print_error("unknowcategory");
|
||||
}
|
||||
@@ -75,7 +85,8 @@ $sesskeyprovided = !empty($sesskey) && confirm_sesskey($sesskey);
|
||||
// Process any category actions.
|
||||
if ($canmanage && $resort && $sesskeyprovided) {
|
||||
// Resort the category if requested
|
||||
if ($courses = get_courses($category->id, "fullname ASC", 'c.id,c.fullname,c.sortorder')) {
|
||||
if ($courses = get_courses($category->id, '', 'c.id,c.fullname,c.sortorder')) {
|
||||
collatorlib::asort_objects_by_property($courses, 'fullname');
|
||||
$i = 1;
|
||||
foreach ($courses as $course) {
|
||||
$DB->set_field('course', 'sortorder', $category->sortorder+$i, array('id'=>$course->id));
|
||||
@@ -180,6 +191,7 @@ if ($editingon && can_edit_in_category()) {
|
||||
// Integrate into the admin tree only if the user can edit categories at the top level,
|
||||
// otherwise the admin block does not appear to this user, and you get an error.
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
navigation_node::override_active_url(new moodle_url('/course/category.php', array('id' => $id)));
|
||||
admin_externalpage_setup('coursemgmt', '', $urlparams, $CFG->wwwroot . '/course/category.php');
|
||||
$PAGE->set_context($context); // Ensure that we are actually showing blocks etc for the cat context
|
||||
|
||||
|
||||
+5
-3
@@ -32,7 +32,11 @@ $categoryid = optional_param('category', 0, PARAM_INT); // course category - can
|
||||
$returnto = optional_param('returnto', 0, PARAM_ALPHANUM); // generic navigation return page switch
|
||||
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_url('/course/edit.php');
|
||||
$pageparams = array('id'=>$id);
|
||||
if (empty($id)) {
|
||||
$pageparams = array('category'=>$categoryid);
|
||||
}
|
||||
$PAGE->set_url('/course/edit.php', $pageparams);
|
||||
|
||||
// basic access control checks
|
||||
if ($id) { // editing course
|
||||
@@ -46,7 +50,6 @@ if ($id) { // editing course
|
||||
$category = $DB->get_record('course_categories', array('id'=>$course->category), '*', MUST_EXIST);
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('moodle/course:update', $coursecontext);
|
||||
$PAGE->url->param('id',$id);
|
||||
|
||||
} else if ($categoryid) { // creating new course in this category
|
||||
$course = null;
|
||||
@@ -54,7 +57,6 @@ if ($id) { // editing course
|
||||
$category = $DB->get_record('course_categories', array('id'=>$categoryid), '*', MUST_EXIST);
|
||||
$catcontext = get_context_instance(CONTEXT_COURSECAT, $category->id);
|
||||
require_capability('moodle/course:create', $catcontext);
|
||||
$PAGE->url->param('category',$categoryid);
|
||||
$PAGE->set_context($catcontext);
|
||||
|
||||
} else {
|
||||
|
||||
+10
-2
@@ -120,7 +120,11 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('format', 'format');
|
||||
$mform->setDefault('format', $courseconfig->format);
|
||||
|
||||
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
|
||||
$max = $courseconfig->maxsections;
|
||||
if (!isset($max) || !is_numeric($max)) {
|
||||
$max = 52;
|
||||
}
|
||||
for ($i = 0; $i <= $max; $i++) {
|
||||
$sectionmenu[$i] = "$i";
|
||||
}
|
||||
$mform->addElement('select', 'numsections', get_string('numberweeks'), $sectionmenu);
|
||||
@@ -150,7 +154,11 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('showreports', 'showreports');
|
||||
$mform->setDefault('showreports', $courseconfig->showreports);
|
||||
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
// Handle non-existing $course->maxbytes on course creation.
|
||||
$coursemaxbytes = !isset($course->maxbytes) ? null : $course->maxbytes;
|
||||
|
||||
// Let's prepare the maxbytes popup.
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $coursemaxbytes);
|
||||
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
||||
$mform->addHelpButton('maxbytes', 'maximumupload');
|
||||
$mform->setDefault('maxbytes', $courseconfig->maxbytes);
|
||||
|
||||
@@ -198,7 +198,7 @@ class core_course_external extends external_api {
|
||||
array(
|
||||
'id' => new external_value(PARAM_INT, 'activity id'),
|
||||
'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL),
|
||||
'name' => new external_value(PARAM_TEXT, 'activity module name'),
|
||||
'name' => new external_value(PARAM_RAW, 'activity module name'),
|
||||
'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL),
|
||||
'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL),
|
||||
'modicon' => new external_value(PARAM_URL, 'activity icon url'),
|
||||
@@ -267,7 +267,7 @@ class core_course_external extends external_api {
|
||||
array('options' => $options));
|
||||
|
||||
//retrieve courses
|
||||
if (!key_exists('ids', $params['options'])
|
||||
if (!array_key_exists('ids', $params['options'])
|
||||
or empty($params['options']['ids'])) {
|
||||
$courses = $DB->get_records('course');
|
||||
} else {
|
||||
@@ -504,13 +504,13 @@ class core_course_external extends external_api {
|
||||
require_capability('moodle/course:create', $context);
|
||||
|
||||
// Make sure lang is valid
|
||||
if (key_exists('lang', $course) and empty($availablelangs[$course['lang']])) {
|
||||
if (array_key_exists('lang', $course) and empty($availablelangs[$course['lang']])) {
|
||||
throw new moodle_exception(
|
||||
get_string('errorinvalidparam', 'webservice', 'lang'));
|
||||
}
|
||||
|
||||
// Make sure theme is valid
|
||||
if (key_exists('forcetheme', $course)) {
|
||||
if (array_key_exists('forcetheme', $course)) {
|
||||
if (!empty($CFG->allowcoursethemes)) {
|
||||
if (empty($availablethemes[$course['forcetheme']])) {
|
||||
throw new moodle_exception(
|
||||
@@ -530,10 +530,10 @@ class core_course_external extends external_api {
|
||||
//set default value for completion
|
||||
$courseconfig = get_config('moodlecourse');
|
||||
if (completion_info::is_enabled_for_site()) {
|
||||
if (!key_exists('enablecompletion', $course)) {
|
||||
if (!array_key_exists('enablecompletion', $course)) {
|
||||
$course['enablecompletion'] = $courseconfig->enablecompletion;
|
||||
}
|
||||
if (!key_exists('completionstartonenrol', $course)) {
|
||||
if (!array_key_exists('completionstartonenrol', $course)) {
|
||||
$course['completionstartonenrol'] = $courseconfig->completionstartonenrol;
|
||||
}
|
||||
} else {
|
||||
|
||||
+26
-24
@@ -583,7 +583,7 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -653,7 +653,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
|
||||
// Creating worksheets
|
||||
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
|
||||
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
|
||||
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber]->set_column(1, 1, 30);
|
||||
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
|
||||
userdate(time(), $strftimedatetime));
|
||||
@@ -682,7 +682,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -766,7 +766,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
|
||||
// Creating worksheets
|
||||
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
|
||||
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
|
||||
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber]->set_column(1, 1, 30);
|
||||
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
|
||||
userdate(time(), $strftimedatetime));
|
||||
@@ -795,7 +795,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -1591,6 +1591,11 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
if ($accessiblebutdim) {
|
||||
$linkclasses .= ' dimmed';
|
||||
$textclasses .= ' dimmed_text';
|
||||
// If mod is visible and is dimmed because of condition then handle it nicely with JS.
|
||||
if ($mod->visible) {
|
||||
$linkclasses .= ' conditionalhidden';
|
||||
$textclasses .= ' conditionalhidden';
|
||||
}
|
||||
$accesstext = '<span class="accesshide">'.
|
||||
get_string('hiddenfromstudents').': </span>';
|
||||
} else {
|
||||
@@ -1617,8 +1622,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// Display link itself
|
||||
echo '<a ' . $linkcss . $mod->extra . $onclick .
|
||||
' href="' . $url . '"><img src="' . $mod->get_icon_url() .
|
||||
'" class="activityicon" alt="' .
|
||||
$modulename . '" /> ' .
|
||||
'" class="activityicon" alt="' . $modulename . '" /> ' .
|
||||
$accesstext . '<span class="instancename">' .
|
||||
$instancename . $altname . '</span></a>';
|
||||
|
||||
@@ -1655,9 +1659,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// Display greyed-out text of link
|
||||
echo '<div ' . $textcss . $mod->extra .
|
||||
' >' . '<img src="' . $mod->get_icon_url() .
|
||||
'" class="activityicon" alt="' .
|
||||
$modulename .
|
||||
'" /> <span>'. $instancename . $altname .
|
||||
'" class="activityicon" alt="" /> <span>'. $instancename . $altname .
|
||||
'</span></div>';
|
||||
|
||||
// Do not display content after link when it is greyed out like this.
|
||||
@@ -3147,7 +3149,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($indent > 0) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '-1')),
|
||||
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveleft', 'title' => $str->moveleft)
|
||||
);
|
||||
@@ -3155,7 +3157,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($indent >= 0) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '1')),
|
||||
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveright', 'title' => $str->moveright)
|
||||
);
|
||||
@@ -3167,20 +3169,20 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($moveselect) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('copy' => $mod->id)),
|
||||
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_move', 'title' => $str->move)
|
||||
);
|
||||
} else {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '-1')),
|
||||
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveup', 'title' => $str->moveup)
|
||||
);
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '1')),
|
||||
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_movedown', 'title' => $str->movedown)
|
||||
);
|
||||
@@ -3191,7 +3193,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($hasmanageactivities) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('update' => $mod->id)),
|
||||
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_update', 'title' => $str->update)
|
||||
);
|
||||
@@ -3201,7 +3203,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if (has_all_capabilities($dupecaps, $coursecontext) && plugin_supports('mod', $mod->modname, FEATURE_BACKUP_MOODLE2)) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('duplicate' => $mod->id)),
|
||||
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_duplicate', 'title' => $str->duplicate)
|
||||
);
|
||||
@@ -3211,7 +3213,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($hasmanageactivities) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('delete' => $mod->id)),
|
||||
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_delete', 'title' => $str->delete)
|
||||
);
|
||||
@@ -3222,14 +3224,14 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($mod->visible) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('hide' => $mod->id)),
|
||||
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_hide', 'title' => $str->hide)
|
||||
);
|
||||
} else {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('show' => $mod->id)),
|
||||
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_show', 'title' => $str->show)
|
||||
);
|
||||
@@ -3260,7 +3262,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($mod->groupmodelink) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'groupmode' => $groupmode)),
|
||||
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => $groupclass, 'title' => $grouptitle)
|
||||
);
|
||||
@@ -3273,7 +3275,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if (has_capability('moodle/role:assign', $modcontext)){
|
||||
$actions[] = new action_link(
|
||||
new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $modcontext->id)),
|
||||
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_assign', 'title' => $str->assign)
|
||||
);
|
||||
@@ -3948,7 +3950,7 @@ function average_number_of_participants() {
|
||||
WHERE ue.enrolid = e.id
|
||||
AND e.courseid <> :siteid
|
||||
AND c.id = e.courseid
|
||||
AND c.visible = 1) as total';
|
||||
AND c.visible = 1) total';
|
||||
$params = array('siteid' => $SITE->id);
|
||||
$enrolmenttotal = $DB->count_records_sql($sql, $params);
|
||||
|
||||
@@ -3981,7 +3983,7 @@ function average_number_of_courses_modules() {
|
||||
WHERE c.id = cm.course
|
||||
AND c.id <> :siteid
|
||||
AND cm.visible = 1
|
||||
AND c.visible = 1) as total';
|
||||
AND c.visible = 1) total';
|
||||
$params = array('siteid' => $SITE->id);
|
||||
$moduletotal = $DB->count_records_sql($sql, $params);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ if ($backup->get_stage() !== backup_ui::STAGE_COMPLETE) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('publishcourseon', 'hub', !empty($hubname)?$hubname:$huburl), 3, 'main');
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced', 'backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display();
|
||||
|
||||
@@ -99,6 +99,9 @@ class recent_form extends moodleform {
|
||||
|
||||
$mform->addElement('select', 'user', get_string('participants'), $options);
|
||||
$mform->setAdvanced('user');
|
||||
} else {
|
||||
// Default to no user.
|
||||
$mform->addElement('hidden', 'user', 0);
|
||||
}
|
||||
|
||||
$options = array(''=>get_string('allactivities'));
|
||||
|
||||
+2
-1
@@ -143,8 +143,9 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
}
|
||||
|
||||
if ($course->summary) {
|
||||
$url = new moodle_url('/course/info.php', array('id' => $course->id));
|
||||
$image = html_writer::empty_tag('img', array('src'=>$this->output->pix_url('i/info'), 'alt'=>$this->strings->summary));
|
||||
$content .= html_writer::link(new moodle_url('/course/info.php', array('id'=>$course->id)), $image, array('title'=>$this->strings->summary));
|
||||
$content .= $this->action_link($url, $image, new popup_action('click', $url, 'courseinfo'), array('title' => $this->strings->summary));
|
||||
}
|
||||
$content .= html_writer::end_tag('div');
|
||||
$content .= html_writer::end_tag('div');
|
||||
|
||||
@@ -35,7 +35,7 @@ require_once($CFG->dirroot.'/course/lib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$switchrole = optional_param('switchrole',-1, PARAM_INT);
|
||||
$returnurl = optional_param('returnurl', false, PARAM_URL);
|
||||
$returnurl = optional_param('returnurl', false, PARAM_LOCALURL);
|
||||
|
||||
$PAGE->set_url('/course/switchrole.php', array('id'=>$id));
|
||||
|
||||
@@ -86,4 +86,4 @@ if ($returnurl === false) {
|
||||
$returnurl = new moodle_url('/course/view.php', array('id' => $course->id));
|
||||
}
|
||||
|
||||
redirect($returnurl);
|
||||
redirect($returnurl);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
$move = optional_param('move', 0, PARAM_INT);
|
||||
$marker = optional_param('marker',-1 , PARAM_INT);
|
||||
$switchrole = optional_param('switchrole',-1, PARAM_INT);
|
||||
$return = optional_param('return', 0, PARAM_LOCALURL);
|
||||
|
||||
if (empty($id) && empty($name) && empty($idnumber)) {
|
||||
print_error('unspecifycourseid', 'error');
|
||||
@@ -110,6 +111,8 @@
|
||||
// Redirect to site root if Editing is toggled on frontpage
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot .'/?redirect=0');
|
||||
} else if (!empty($return)) {
|
||||
redirect($CFG->wwwroot . $return);
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
@@ -122,6 +125,8 @@
|
||||
// Redirect to site root if Editing is toggled on frontpage
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot .'/?redirect=0');
|
||||
} else if (!empty($return)) {
|
||||
redirect($CFG->wwwroot . $return);
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
+6
-2
@@ -54,9 +54,9 @@ echo $OUTPUT->header(); // send headers
|
||||
|
||||
$manager = new course_enrolment_manager($PAGE, $course);
|
||||
|
||||
$outcome = new stdClass;
|
||||
$outcome = new stdClass();
|
||||
$outcome->success = true;
|
||||
$outcome->response = new stdClass;
|
||||
$outcome->response = new stdClass();
|
||||
$outcome->error = '';
|
||||
|
||||
switch ($action) {
|
||||
@@ -99,6 +99,10 @@ switch ($action) {
|
||||
$user->fullname = fullname($user);
|
||||
unset($user->id);
|
||||
}
|
||||
// Chrome will display users in the order of the array keys, so we need
|
||||
// to ensure that the results ordered array keys. Fortunately, the JavaScript
|
||||
// does not care what the array keys are. It uses user.id where necessary.
|
||||
$outcome->response['users'] = array_values($outcome->response['users']);
|
||||
$outcome->success = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -415,8 +415,8 @@ function authorize_print_order($orderid)
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->upto = $upto;
|
||||
$extrahtml = get_string('howmuch', 'enrol_authorize') .
|
||||
' <input type="text" size="5" name="amount" value="'.$amount.'" /> ' .
|
||||
$extrahtml = '<label for="amount">'.get_string('howmuch', 'enrol_authorize').'</label> ' .
|
||||
'<input id="amount" type="text" size="5" name="amount" value="'.$amount.'" /> ' .
|
||||
get_string('canbecredit', 'enrol_authorize', $a) . '<br />';
|
||||
$table->data[] = array("<b>$strs->confirm:</b>",
|
||||
authorize_print_action_button($orderid, ORDER_REFUND, 0, true, $authstrs->unenrolstudent, $strs->no, $extrahtml));
|
||||
|
||||
@@ -446,9 +446,8 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
}
|
||||
$rs->Close();
|
||||
} else {
|
||||
mtrace('Error while communicating with external enrolment database');
|
||||
$extdb->Close();
|
||||
return;
|
||||
mtrace(" error: skipping course '$course->mapping' - could not match with external database");
|
||||
continue;
|
||||
}
|
||||
unset($user_mapping);
|
||||
|
||||
@@ -593,7 +592,7 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
if ($idnumber) {
|
||||
$sqlfields[] = $idnumber;
|
||||
}
|
||||
$sql = $this->db_get_sql($table, array(), $sqlfields);
|
||||
$sql = $this->db_get_sql($table, array(), $sqlfields, true);
|
||||
$createcourses = array();
|
||||
if ($rs = $extdb->Execute($sql)) {
|
||||
if (!$rs->EOF) {
|
||||
|
||||
@@ -371,7 +371,7 @@ class core_role_external extends external_api {
|
||||
// throw an exception if user is not able to assign the role in this context
|
||||
$roles = get_assignable_roles($context, ROLENAME_SHORT);
|
||||
|
||||
if (!key_exists($assignment['roleid'], $roles)) {
|
||||
if (!array_key_exists($assignment['roleid'], $roles)) {
|
||||
throw new invalid_parameter_exception('Can not assign roleid='.$assignment['roleid'].' in contextid='.$assignment['contextid']);
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ class core_role_external extends external_api {
|
||||
|
||||
// throw an exception if user is not able to unassign the role in this context
|
||||
$roles = get_assignable_roles($context, ROLENAME_SHORT);
|
||||
if (!key_exists($unassignment['roleid'], $roles)) {
|
||||
if (!array_key_exists($unassignment['roleid'], $roles)) {
|
||||
throw new invalid_parameter_exception('Can not unassign roleid='.$unassignment['roleid'].' in contextid='.$unassignment['contextid']);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
if(! @unlink($filename)) {
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->component = 'course';
|
||||
$eventdata->component = 'enrol_flatfile';
|
||||
$eventdata->name = 'flatfile_enrolment';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userto = get_admin();
|
||||
@@ -169,7 +169,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
// Send mail to admin
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->component = 'course';
|
||||
$eventdata->component = 'enrol_flatfile';
|
||||
$eventdata->name = 'flatfile_enrolment';
|
||||
$eventdata->userfrom = get_admin();
|
||||
$eventdata->userto = get_admin();
|
||||
@@ -280,7 +280,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->component = 'course';
|
||||
$eventdata->component = 'enrol_flatfile';
|
||||
$eventdata->name = 'flatfile_enrolment';
|
||||
$eventdata->userfrom = $teacher;
|
||||
$eventdata->userto = $user;
|
||||
@@ -303,7 +303,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
|
||||
$eventdata = new stdClass();
|
||||
$eventdata->modulename = 'moodle';
|
||||
$eventdata->component = 'course';
|
||||
$eventdata->component = 'enrol_flatfile';
|
||||
$eventdata->name = 'flatfile_enrolment';
|
||||
$eventdata->userfrom = $user;
|
||||
$eventdata->userto = $teacher;
|
||||
|
||||
@@ -93,6 +93,8 @@ $string['pluginname'] = 'LDAP enrolments';
|
||||
$string['pluginname_desc'] = '<p>You can use an LDAP server to control your enrolments. It is assumed your LDAP tree contains groups that map to the courses, and that each of those groups/courses will have membership entries to map to students.</p><p>It is assumed that courses are defined as groups in LDAP, with each group having multiple membership fields (<em>member</em> or <em>memberUid</em>) that contain a uniqueidentification of the user.</p><p>To use LDAP enrolment, your users <strong>must</strong> to have a valid idnumber field. The LDAP groups must have that idnumber in the member fields for a user to be enrolled in the course. This will usually work well if you are already using LDAP Authentication.</p><p>Enrolments will be updated when the user logs in. You can also run a script to keep enrolments in synch. Look in <em>enrol/ldap/cli/sync.php</em>.</p><p>This plugin can also be set to automatically create new courses when new groups appear in LDAP.</p>';
|
||||
$string['pluginnotenabled'] = 'Plugin not enabled!';
|
||||
$string['role_mapping'] = '<p>For each role that you want to assign from LDAP, you need to specify the list of contexts where the role courses\'s groups are located. Separate different contexts with \';\'.</p><p>You also need to specify the attribute your LDAP server uses to hold the members of a group. Usually \'member\' or \'memberUid\'</p>';
|
||||
$string['role_mapping_attribute'] = 'LDAP member attribute for {$a}';
|
||||
$string['role_mapping_context'] = 'LDAP contexts for {$a}';
|
||||
$string['role_mapping_key'] = 'Map roles from LDAP ';
|
||||
$string['roles'] = 'Role mapping';
|
||||
$string['server_settings'] = 'LDAP server settings';
|
||||
|
||||
@@ -151,7 +151,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
foreach ($data as $role) {
|
||||
$contextid = $this->get_id().'['.$role['id'].'][contexts]';
|
||||
$contextname = $this->get_full_name().'['.$role['id'].'][contexts]';
|
||||
$return .= '<div style="height: 2em;"><input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>';
|
||||
$return .= '<div style="height: 2em;"><label class="accesshide" for="'.$contextid.'">'.get_string('role_mapping_context', 'enrol_ldap', $role['name']).'</label>';
|
||||
$return .= '<input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
|
||||
@@ -160,7 +161,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
foreach ($data as $role) {
|
||||
$memberattrid = $this->get_id().'['.$role['id'].'][memberattribute]';
|
||||
$memberattrname = $this->get_full_name().'['.$role['id'].'][memberattribute]';
|
||||
$return .= '<div style="height: 2em;"><input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>';
|
||||
$return .= '<div style="height: 2em;"><label class="accesshide" for="'.$memberattrid.'">'.get_string('role_mapping_attribute', 'enrol_ldap', $role['name']).'</label>';
|
||||
$return .= '<input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '<div style="clear:both;"></div>';
|
||||
|
||||
+3
-1
@@ -770,13 +770,15 @@ class course_enrolment_manager {
|
||||
|
||||
$users = array();
|
||||
foreach ($userroles as $userrole) {
|
||||
$contextid = $userrole->contextid;
|
||||
unset($userrole->contextid); // This would collide with user avatar.
|
||||
if (!array_key_exists($userrole->id, $users)) {
|
||||
$users[$userrole->id] = $this->prepare_user_for_display($userrole, $extrafields, $now);
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->role = $roles[$userrole->roleid]->localname;
|
||||
$changeable = ($userrole->component == '');
|
||||
if ($userrole->contextid == $this->context->id) {
|
||||
if ($contextid == $this->context->id) {
|
||||
$roletext = get_string('rolefromthiscourse', 'enrol', $a);
|
||||
} else {
|
||||
$changeable = false;
|
||||
|
||||
@@ -53,9 +53,9 @@ echo $OUTPUT->header(); // send headers
|
||||
|
||||
$manager = new course_enrolment_manager($PAGE, $course);
|
||||
|
||||
$outcome = new stdClass;
|
||||
$outcome = new stdClass();
|
||||
$outcome->success = true;
|
||||
$outcome->response = new stdClass;
|
||||
$outcome->response = new stdClass();
|
||||
$outcome->error = '';
|
||||
|
||||
switch ($action) {
|
||||
@@ -79,6 +79,10 @@ switch ($action) {
|
||||
}
|
||||
$user->extrafields = implode(', ', $fieldvalues);
|
||||
}
|
||||
// Chrome will display users in the order of the array keys, so we need
|
||||
// to ensure that the results ordered array keys. Fortunately, the JavaScript
|
||||
// does not care what the array keys are. It uses user.id where necessary.
|
||||
$outcome->response['users'] = array_values($outcome->response['users']);
|
||||
$outcome->success = true;
|
||||
break;
|
||||
case 'enrol':
|
||||
@@ -135,4 +139,4 @@ switch ($action) {
|
||||
throw new enrol_ajax_exception('unknowajaxaction');
|
||||
}
|
||||
|
||||
echo json_encode($outcome);
|
||||
echo json_encode($outcome);
|
||||
|
||||
@@ -90,7 +90,7 @@ class enrol_manual_external extends external_api {
|
||||
|
||||
//throw an exception if user is not able to assign the role
|
||||
$roles = get_assignable_roles($context);
|
||||
if (!key_exists($enrolment['roleid'], $roles)) {
|
||||
if (!array_key_exists($enrolment['roleid'], $roles)) {
|
||||
$errorparams = new stdClass();
|
||||
$errorparams->roleid = $enrolment['roleid'];
|
||||
$errorparams->courseid = $enrolment['courseid'];
|
||||
|
||||
@@ -64,7 +64,7 @@ $PAGE->set_heading($course->fullname);
|
||||
navigation_node::override_active_url(new moodle_url('/enrol/users.php', array('id'=>$course->id)));
|
||||
|
||||
// Create the user selector objects.
|
||||
$options = array('enrolid' => $enrolid);
|
||||
$options = array('enrolid' => $enrolid, 'accesscontext' => $context);
|
||||
|
||||
$potentialuserselector = new enrol_manual_potential_participant('addselect', $options);
|
||||
$currentuserselector = new enrol_manual_current_participant('removeselect', $options);
|
||||
|
||||
+7
-4
@@ -141,6 +141,11 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
|
||||
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).once('click', function() {
|
||||
// We want to do this just once, the first time the controls are shown.
|
||||
this.populateStartDates();
|
||||
this.populateDuration();
|
||||
}, this);
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE);
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).toggleClass(CSS.HIDDEN);
|
||||
@@ -150,10 +155,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/expanded', 'moodle'));
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.populateAssignableRoles();
|
||||
this.populateStartDates();
|
||||
this.populateDuration();
|
||||
},
|
||||
populateAssignableRoles : function() {
|
||||
this.on('assignablerolesloaded', function(){
|
||||
@@ -192,9 +194,10 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
var select = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.DURATION+' select');
|
||||
var defaultvalue = this.get(UEP.DEFAULTDURATION);
|
||||
var index = 0, count = 0;
|
||||
var durationdays = M.util.get_string('durationdays', 'enrol', '{a}');
|
||||
for (var i = 1; i <= 365; i++) {
|
||||
count++;
|
||||
var option = create('<option value="'+i+'">'+M.util.get_string('durationdays', 'enrol', i)+'</option>');
|
||||
var option = create('<option value="'+i+'">'+durationdays.replace('{a}', i)+'</option>');
|
||||
if (i == defaultvalue) {
|
||||
index = count;
|
||||
}
|
||||
|
||||
@@ -90,13 +90,14 @@ if (! $plugin_instance = $DB->get_record("enrol", array("id"=>$data->instanceid,
|
||||
$plugin = enrol_get_plugin('paypal');
|
||||
|
||||
/// Open a connection back to PayPal to validate the data
|
||||
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';
|
||||
$c = new curl();
|
||||
$options = array(
|
||||
'returntransfer' => true,
|
||||
'httpheader' => array('application/x-www-form-urlencoded'),
|
||||
'httpheader' => array('application/x-www-form-urlencoded', "Host: $paypaladdr"),
|
||||
'timeout' => 30,
|
||||
'CURLOPT_HTTP_VERSION' => CURL_HTTP_VERSION_1_1,
|
||||
);
|
||||
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';
|
||||
$location = "https://$paypaladdr/cgi-bin/webscr";
|
||||
$result = $c->post($location, $req, $options);
|
||||
|
||||
@@ -171,7 +172,7 @@ if (strlen($result) > 0) {
|
||||
|
||||
}
|
||||
|
||||
if ($data->business != $plugin->get_config('paypalbusiness')) { // Check that the email is the one we want it to be
|
||||
if (textlib::strtolower($data->business) !== textlib::strtolower($plugin->get_config('paypalbusiness'))) { // Check that the email is the one we want it to be
|
||||
message_paypal_error_to_admin("Business email is {$data->business} (not ".
|
||||
$plugin->get_config('paypalbusiness').")", $data);
|
||||
die;
|
||||
|
||||
@@ -207,4 +207,23 @@ class enrol_paypal_plugin extends enrol_plugin {
|
||||
return $OUTPUT->box(ob_get_clean());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of the user enrolment actions
|
||||
*
|
||||
* @param course_enrolment_manager $manager
|
||||
* @param stdClass $ue A user enrolment object
|
||||
* @return array An array of user_enrolment_actions
|
||||
*/
|
||||
public function get_user_enrolment_actions(course_enrolment_manager $manager, $ue) {
|
||||
$actions = array();
|
||||
$context = $manager->get_context();
|
||||
$instance = $ue->enrolmentinstance;
|
||||
$params = $manager->get_moodlepage()->url->params();
|
||||
$params['ue'] = $ue->id;
|
||||
if ($this->allow_unenrol($instance) && has_capability("enrol/paypal:unenrol", $context)) {
|
||||
$url = new moodle_url('/enrol/unenroluser.php', $params);
|
||||
$actions[] = new user_enrolment_action(new pix_icon('t/delete', ''), get_string('unenrol', 'enrol'), $url, array('class'=>'unenrollink', 'rel'=>$ue->id));
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,11 @@ if (!$course = $DB->get_record("course", array("id"=>$id))) {
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id, MUST_EXIST);
|
||||
$PAGE->set_context($context);
|
||||
|
||||
require_login();
|
||||
|
||||
if ($SESSION->wantsurl) {
|
||||
if (!empty($SESSION->wantsurl)) {
|
||||
$destination = $SESSION->wantsurl;
|
||||
unset($SESSION->wantsurl);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ class course_enrolment_table extends html_table implements renderable {
|
||||
|
||||
$this->page = optional_param(self::PAGEVAR, 0, PARAM_INT);
|
||||
$this->perpage = optional_param(self::PERPAGEVAR, self::DEFAULTPERPAGE, PARAM_INT);
|
||||
$this->sort = optional_param(self::SORTVAR, self::DEFAULTSORT, PARAM_ALPHA);
|
||||
$this->sort = optional_param(self::SORTVAR, self::DEFAULTSORT, PARAM_ALPHANUM);
|
||||
$this->sortdirection = optional_param(self::SORTDIRECTIONVAR, self::DEFAULTSORTDIRECTION, PARAM_ALPHA);
|
||||
|
||||
$this->attributes = array('class'=>'userenrolment');
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
.moodle-dialogue-base .hidden,
|
||||
.moodle-dialogue-base .moodle-dialogue-hidden {display:none;}
|
||||
.moodle-dialogue-base .moodle-dialogue-lightbox {background-color:#AAA;position:absolute;top:0;left:0;width:100%;height:100%;}
|
||||
.moodle-dialogue-base .moodle-dialogue-lightbox {background-color:#AAA;}
|
||||
.moodle-dialogue-base .moodle-dialogue {background-color:#666;border:0 solid #666;border-right-width:3px;border-bottom-width:3px;}
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap {background-color:#FFF;margin-top:-3px;margin-left:-3px;border:1px solid #555;height:auto;}
|
||||
.moodle-dialogue-base .moodle-dialogue-hd {font-size:110%;color:inherit;font-weight:bold;text-align:left;padding:5px 6px;margin:0;border-bottom:1px solid #ccc;background-color:#f6f6f6;}
|
||||
.moodle-dialogue-base .closebutton {background-image:url(sprite.png);width:25px;height:15px;background-repeat:no-repeat;float:right;vertical-align:middle;display:inline-block;cursor:pointer;}
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd {font-size:110%;color:inherit;font-weight:bold;text-align:left;padding:5px 6px;margin:0;border-bottom:1px solid #ccc;background:#f6f6f6;}
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h1{font-size:100%;font-weight:bold;margin:0;padding:0;display:inline;}
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {padding: 5px;}
|
||||
.moodle-dialogue-base .closebutton {background-image:url(sprite.png);width:25px;height:15px;background-repeat:no-repeat;float:right;vertical-align:middle;display:inline-block;cursor:pointer;padding:0px;border-style:none;}
|
||||
.moodle-dialogue-base .moodle-dialogue-bd {padding:5px; overflow: auto;}
|
||||
.moodle-dialogue-base .moodle-dialogue-fd {}
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-content {background:#FFF;padding:0px;}
|
||||
.moodle-dialogue-base .moodle-dialogue-ft {}
|
||||
|
||||
.moodle-dialogue-confirm .confirmation-dialogue {text-align:center;}
|
||||
.moodle-dialogue-confirm .confirmation-message {margin:0.5em 1em;}
|
||||
|
||||
+38
-31
@@ -8,8 +8,6 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
ALERT_NAME = 'Moodle alert',
|
||||
C = Y.Node.create,
|
||||
BASE = 'notificationBase',
|
||||
LIGHTBOX = 'lightbox',
|
||||
NODELIGHTBOX = 'nodeLightbox',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
@@ -21,7 +19,7 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
HEADER : 'moodle-dialogue-hd',
|
||||
BODY : 'moodle-dialogue-bd',
|
||||
CONTENT : 'moodle-dialogue-content',
|
||||
FOOTER : 'moodle-dialogue-fd',
|
||||
FOOTER : 'moodle-dialogue-ft',
|
||||
HIDDEN : 'hidden',
|
||||
LIGHTBOX : 'moodle-dialogue-lightbox'
|
||||
};
|
||||
@@ -31,45 +29,51 @@ var DIALOGUE = function(config) {
|
||||
var id = 'moodle-dialogue-'+COUNT;
|
||||
config.notificationBase =
|
||||
C('<div class="'+CSS.BASE+'">')
|
||||
.append(C('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>'))
|
||||
.append(C('<div id="'+id+'" class="'+CSS.WRAP+'"></div>')
|
||||
.append(C('<div class="'+CSS.HEADER+' yui3-widget-hd"></div>'))
|
||||
.append(C('<div class="'+CSS.BODY+' yui3-widget-bd"></div>'))
|
||||
.append(C('<div class="'+CSS.CONTENT+' yui3-widget-ft"></div>')));
|
||||
.append(C('<div class="'+CSS.FOOTER+' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
config.srcNode = '#'+id;
|
||||
config.width = config.width || '400px';
|
||||
config.visible = config.visible || false;
|
||||
config.center = config.centered || true;
|
||||
config.centered = false;
|
||||
|
||||
// lightbox param to keep the stable versions API
|
||||
if (config.lightbox === true) {
|
||||
config.modal = true;
|
||||
}
|
||||
delete config.lightbox;
|
||||
|
||||
// closeButton param to keep the stable versions API
|
||||
if (config.closeButton === false) {
|
||||
config.buttons = null;
|
||||
} else {
|
||||
config.buttons = [
|
||||
{
|
||||
section: Y.WidgetStdMod.HEADER,
|
||||
value : '',
|
||||
classNames: 'closebutton',
|
||||
action: function (e) {
|
||||
e.preventDefault();
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
DIALOGUE.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(DIALOGUE, Y.Overlay, {
|
||||
Y.extend(DIALOGUE, Y.Panel, {
|
||||
initializer : function(config) {
|
||||
this.set(NODELIGHTBOX, this.get(BASE).one('.'+CSS.LIGHTBOX).setStyle('opacity', 0.5));
|
||||
this.after('visibleChange', this.visibilityChanged, this);
|
||||
this.after('headerContentChange', function(e){
|
||||
var h = (this.get('closeButton'))?this.get(BASE).one('.'+CSS.HEADER):false;
|
||||
if (h && !h.one('.closebutton')) {
|
||||
var c = C('<div class="closebutton"></div>');
|
||||
c.on('click', this.hide, this);
|
||||
h.append(c);
|
||||
}
|
||||
}, this);
|
||||
this.render();
|
||||
this.show();
|
||||
},
|
||||
visibilityChanged : function(e) {
|
||||
switch (e.attrName) {
|
||||
case 'visible':
|
||||
if (this.get(LIGHTBOX)) {
|
||||
var l = this.get(NODELIGHTBOX);
|
||||
if (!e.prevVal && e.newVal) {
|
||||
l.setStyle('height',l.get('docHeight')+'px').removeClass(CSS.HIDDEN);
|
||||
} else if (e.prevVal && !e.newVal) {
|
||||
l.addClass(CSS.HIDDEN);
|
||||
}
|
||||
}
|
||||
this.get('maskNode').addClass(CSS.LIGHTBOX);
|
||||
if (this.get('center') && !e.prevVal && e.newVal) {
|
||||
this.centerDialogue();
|
||||
}
|
||||
@@ -95,9 +99,6 @@ Y.extend(DIALOGUE, Y.Overlay, {
|
||||
ATTRS : {
|
||||
notificationBase : {
|
||||
|
||||
},
|
||||
nodeLightbox : {
|
||||
value : null
|
||||
},
|
||||
lightbox : {
|
||||
validator : Y.Lang.isBoolean,
|
||||
@@ -116,6 +117,9 @@ Y.extend(DIALOGUE, Y.Overlay, {
|
||||
|
||||
var ALERT = function(config) {
|
||||
config.closeButton = false;
|
||||
if (config.lightbox !== false) {
|
||||
config.lightbox = true;
|
||||
}
|
||||
ALERT.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(ALERT, DIALOGUE, {
|
||||
@@ -129,7 +133,7 @@ Y.extend(ALERT, DIALOGUE, {
|
||||
.append(yes));
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, this.get(TITLE), Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this);
|
||||
yes.on('click', this.submit, this);
|
||||
@@ -166,6 +170,9 @@ Y.extend(ALERT, DIALOGUE, {
|
||||
});
|
||||
|
||||
var CONFIRM = function(config) {
|
||||
if (config.lightbox !== false) {
|
||||
config.lightbox = true;
|
||||
}
|
||||
CONFIRM.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(CONFIRM, DIALOGUE, {
|
||||
@@ -184,7 +191,7 @@ Y.extend(CONFIRM, DIALOGUE, {
|
||||
.append(no));
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, this.get(TITLE), Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this, true);
|
||||
this._escKeypress = Y.on('key', this.submit, window, 'down:27', this, false);
|
||||
@@ -237,7 +244,7 @@ Y.extend(EXCEPTION, DIALOGUE, {
|
||||
_keypress : null,
|
||||
initializer : function(config) {
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, config.name, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
var content = C('<div class="moodle-exception"></div>')
|
||||
.append(C('<div class="moodle-exception-message">'+this.get('message')+'</div>'))
|
||||
.append(C('<div class="moodle-exception-param hidden param-filename"><label>File:</label> '+this.get('fileName')+'</div>'))
|
||||
@@ -308,7 +315,7 @@ Y.extend(AJAXEXCEPTION, DIALOGUE, {
|
||||
_keypress : null,
|
||||
initializer : function(config) {
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, config.name, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
var content = C('<div class="moodle-ajaxexception"></div>')
|
||||
.append(C('<div class="moodle-exception-message">'+this.get('error')+'</div>'))
|
||||
.append(C('<div class="moodle-exception-param hidden param-debuginfo"><label>URL:</label> '+this.get('reproductionlink')+'</div>'))
|
||||
@@ -372,4 +379,4 @@ M.core.confirm = CONFIRM;
|
||||
M.core.exception = EXCEPTION;
|
||||
M.core.ajaxException = AJAXEXCEPTION;
|
||||
|
||||
}, '@VERSION@', {requires:['base','node','overlay','event-key', 'moodle-enrol-notification-skin']});
|
||||
}, '@VERSION@', {requires:['base','node','panel','event-key', 'moodle-enrol-notification-skin']});
|
||||
|
||||
@@ -114,7 +114,7 @@ class edit_outcome_form extends moodleform {
|
||||
if (empty($courseid)) {
|
||||
$mform->hardFreeze('standard');
|
||||
|
||||
} else if (empty($outcome->courseid) and !has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
} else if (!has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
$mform->hardFreeze('standard');
|
||||
|
||||
} else if ($coursecount and empty($outcome->courseid)) {
|
||||
|
||||
@@ -41,7 +41,7 @@ require_capability('moodle/grade:manage', $context);
|
||||
|
||||
// default return url
|
||||
$gpr = new grade_plugin_return();
|
||||
$returnurl = $gpr->get_return_url($CFG->wwwroot.'/grade/report.php?id='.$course->id);
|
||||
$returnurl = $gpr->get_return_url($CFG->wwwroot.'/grade/report/index.php?id='.$course->id);
|
||||
|
||||
if (!$grade_item = grade_item::fetch(array('id'=>$id, 'courseid'=>$course->id))) {
|
||||
print_error('invaliditemid');
|
||||
|
||||
@@ -50,7 +50,7 @@ if (!has_capability('moodle/grade:manage', $context)) {
|
||||
|
||||
// default return url
|
||||
$gpr = new grade_plugin_return();
|
||||
$returnurl = $gpr->get_return_url($CFG->wwwroot.'/grade/report.php?id='.$course->id);
|
||||
$returnurl = $gpr->get_return_url($CFG->wwwroot.'/grade/report/index.php?id='.$course->id);
|
||||
|
||||
// security checks!
|
||||
if (!empty($id)) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class grade_export_ods extends grade_export {
|
||||
/// Sending HTTP headers
|
||||
$workbook->send($downloadfilename);
|
||||
/// Adding the worksheet
|
||||
$myxls =& $workbook->add_worksheet($strgrades);
|
||||
$myxls = $workbook->add_worksheet($strgrades);
|
||||
|
||||
/// Print names of all the fields
|
||||
$myxls->write_string(0,0,get_string("firstname"));
|
||||
|
||||
@@ -40,7 +40,7 @@ class grade_export_xls extends grade_export {
|
||||
/// Sending HTTP headers
|
||||
$workbook->send($downloadfilename);
|
||||
/// Adding the worksheet
|
||||
$myxls =& $workbook->add_worksheet($strgrades);
|
||||
$myxls = $workbook->add_worksheet($strgrades);
|
||||
|
||||
/// Print names of all the fields
|
||||
$myxls->write_string(0,0,get_string("firstname"));
|
||||
|
||||
+1
-1
@@ -1445,7 +1445,7 @@ class grade_structure {
|
||||
|
||||
$url->param('action', 'show');
|
||||
|
||||
$hideicon = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strshow, 'class'=>'iconsmall')));
|
||||
$hideicon = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strshow, 'class'=>'smallicon')));
|
||||
|
||||
} else {
|
||||
$url->param('action', 'hide');
|
||||
|
||||
@@ -214,7 +214,7 @@ border-color:#cecece;
|
||||
}
|
||||
|
||||
.path-grade-report-grader th {
|
||||
padding:2px 10px 0;
|
||||
padding:1px 10px;
|
||||
}
|
||||
|
||||
.path-grade-report-grader span.inclusion-links {
|
||||
@@ -377,6 +377,8 @@ float:left;
|
||||
clear:none;
|
||||
padding-top:20px;
|
||||
}
|
||||
.path-grade-report-grader.dir-rtl .left_scroller {float:right;}
|
||||
|
||||
|
||||
.path-grade-report-grader .right_scroller {
|
||||
width:auto;
|
||||
|
||||
@@ -350,17 +350,21 @@ abstract class grade_report {
|
||||
global $CFG, $DB;
|
||||
static $hiding_affected = null;//array of items in this course affected by hiding
|
||||
|
||||
//if we're dealing with multiple users we need to know when we've moved on to a new user
|
||||
// If we're dealing with multiple users we need to know when we've moved on to a new user.
|
||||
static $previous_userid = null;
|
||||
|
||||
// If we're dealing with multiple courses we need to know when we've moved on to a new course.
|
||||
static $previous_courseid = null;
|
||||
|
||||
if( $this->showtotalsifcontainhidden==GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN ) {
|
||||
return $finalgrade;
|
||||
}
|
||||
|
||||
//if we've moved on to another user don't return the previous user's affected grades
|
||||
if ($previous_userid!=$this->user->id) {
|
||||
// If we've moved on to another course or user, reload the grades.
|
||||
if ($previous_userid != $this->user->id || $previous_courseid != $courseid) {
|
||||
$hiding_affected = null;
|
||||
$previous_userid = $this->user->id;
|
||||
$previous_courseid = $courseid;
|
||||
}
|
||||
|
||||
if( !$hiding_affected ) {
|
||||
|
||||
+16
-10
@@ -339,23 +339,29 @@ class grade_report_user extends grade_report {
|
||||
$hidden = ' hidden';
|
||||
}
|
||||
|
||||
$hide = false;
|
||||
// If this is a hidden grade item, hide it completely from the user.
|
||||
if ($grade_grade->is_hidden() && !$this->canviewhidden && (
|
||||
$this->showhiddenitems == GRADE_REPORT_USER_HIDE_HIDDEN ||
|
||||
($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) {
|
||||
// return false;
|
||||
} else {
|
||||
// The grade object can be marked visible but still be hidden
|
||||
// if "enablegroupmembersonly" is on and its an activity assigned to a grouping the user is not in
|
||||
if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
|
||||
$instances = $this->gtree->modinfo->get_instances();
|
||||
if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
|
||||
$cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
|
||||
if (!$cm->uservisible) {
|
||||
return false;
|
||||
$hide = true;
|
||||
} else if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
|
||||
// The grade object can be marked visible but still be hidden if...
|
||||
// 1) "enablegroupmembersonly" is on and the activity is assigned to a grouping the user is not in.
|
||||
// 2) the student cannot see the activity due to conditional access and its set to be hidden entirely.
|
||||
$instances = $this->gtree->modinfo->get_instances_of($grade_object->itemmodule);
|
||||
if (!empty($instances[$grade_object->iteminstance])) {
|
||||
$cm = $instances[$grade_object->iteminstance];
|
||||
if (!$cm->uservisible) {
|
||||
// Further checks are required to determine whether the activity is entirely hidden or just greyed out.
|
||||
if ($cm->is_user_access_restricted_by_group() || $cm->is_user_access_restricted_by_conditional_access()) {
|
||||
$hide = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$hide) {
|
||||
/// Excluded Item
|
||||
if ($grade_grade->is_excluded()) {
|
||||
$fullname .= ' ['.get_string('excluded', 'grades').']';
|
||||
|
||||
+11
-10
@@ -205,17 +205,18 @@ function groups_update_group_icon($group, $data, $editform) {
|
||||
$context = get_context_instance(CONTEXT_COURSE, $group->courseid, MUST_EXIST);
|
||||
|
||||
//TODO: it would make sense to allow picture deleting too (skodak)
|
||||
|
||||
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
||||
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
||||
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
||||
$group->picture = 1;
|
||||
} else {
|
||||
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
||||
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
||||
$group->picture = 0;
|
||||
if (!empty($CFG->gdversion)) {
|
||||
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
||||
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
||||
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
||||
$group->picture = 1;
|
||||
} else {
|
||||
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
||||
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
||||
$group->picture = 0;
|
||||
}
|
||||
@unlink($iconfile);
|
||||
}
|
||||
@unlink($iconfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -193,17 +193,21 @@
|
||||
break;
|
||||
|
||||
case FRONTPAGECOURSELIST:
|
||||
$ncourses = $DB->count_records('course');
|
||||
if (isloggedin() and !$hassiteconfig and !isguestuser() and empty($CFG->disablemycourses)) {
|
||||
echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower(get_string('mycourses'))), array('href'=>'#skipmycourses', 'class'=>'skip-block'));
|
||||
echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
|
||||
print_my_moodle();
|
||||
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipmycourses'));
|
||||
} else if ((!$hassiteconfig and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
|
||||
} else if ((!$hassiteconfig and !isguestuser()) or ($ncourses <= FRONTPAGECOURSELIMIT)) {
|
||||
// admin should not see list of courses when there are too many of them
|
||||
echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));
|
||||
echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
|
||||
print_courses(0);
|
||||
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
|
||||
} else {
|
||||
echo html_writer::tag('div', get_string('therearecourses', '', $ncourses), array('class' => 'notifyproblem'));
|
||||
print_course_search('', false, 'short');
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -51,4 +51,5 @@ $string['pathssubdataroot'] = 'Тази директория е място, къ
|
||||
$string['pathssubdirroot'] = 'Пълен път до директорията на Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Пълен интернет адрес, на който ще се отваря Moodle. Не е възможно Moodle да се отваря чрез различни адреси. Ако Вашият сайт има няколко адреса трябва на всеки от другите адреси да направите пренасочване към този. Ако Вашият сайт се отваря както глобално от Интернет, така и от локална мрежа, настройте DNS, така че потребителите от локалната мрежа също да могат да ползват глобалния адрес. Ако адресът не е коректен, моля, променете адреса в браузъра си и започнете инсталирането с правилния адрес.';
|
||||
$string['phpextension'] = '{$a} разширение на PHP';
|
||||
$string['phpversionhelp'] = '<p>Moodle изисква версия на PHP най-малко 4.3.0 или 5.1.0 (5.0.x има значителен брой известни проблеми).</p> <p>Вие използвате в момента версия {$a}</p> <p>Трябва да обновите PHP или да се преместите на нов хост (сървър) с по-нова версия на PHP!<br /> (В случая с 5.0.x може да опитате да инсталирате по-старата версия 4.4.x)</p>';
|
||||
$string['wwwroot'] = 'Уеб адрес';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'English for kids';
|
||||
@@ -48,12 +48,12 @@ $string['environmenthead'] = 'Comprobando su entorno';
|
||||
$string['environmentsub2'] = 'Cada versión de Moodle tiene algún requisito mínimo de la versión de PHP y un número obligatorio de extensiones de PHP. Una comprobación del entorno completo se realiza antes de cada instalación y actualización. Por favor, póngase en contacto con el administrador del servidor si no sabe cómo instalar la nueva versión o habilitar las extensiones PHP.';
|
||||
$string['errorsinenvironment'] = '¡La comprobación del entorno falló!';
|
||||
$string['installation'] = 'Instalación';
|
||||
$string['langdownloaderror'] = 'El idioma "{$a}" no pudo ser instalado. El proceso de instalación continuará en inglés.';
|
||||
$string['langdownloaderror'] = 'El idioma "{$a}" no pudo ser instalado. El proceso de instalación continuará en Inglés.';
|
||||
$string['memorylimithelp'] = '<p>El límite de memoria PHP en su servidor es actualmente {$a}.</p>
|
||||
|
||||
<p>Esto puede ocasionar que Moodle tenga problemas de memoria más adelante, especialmente si usted tiene activados muchos módulos y/o muchos usuarios.</p>
|
||||
|
||||
<p>Recomendamos que configure PHP con el límite más alto posible, e.g. 40M.
|
||||
<p>Recomendamos que configure PHP con el límite más alto posible, por ejemplo: 40M.
|
||||
Hay varias formas de hacer esto:</p>
|
||||
<ol>
|
||||
<li>Si puede hacerlo, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
@@ -85,7 +85,7 @@ $string['phpversionhelp'] = '<p>Moodle requiere al menos una versión de PHP 4.3
|
||||
(En caso de 5.0.x podría también revertir a la versión 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete <strong>{$a->packname} {$a->packversion}</strong> en su computadora. !Enhorabuena!';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora principalmente:';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora, principalmente:';
|
||||
$string['welcomep40'] = 'El paquete también incluye <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas
|
||||
licencias. El programa <strong>{$a->installername}</strong> es
|
||||
|
||||
@@ -32,4 +32,4 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['parentlanguage'] = '';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Español - Mexico';
|
||||
$string['thislanguage'] = 'Español - México';
|
||||
|
||||
@@ -39,5 +39,5 @@ $string['clitypevaluedefault'] = 'sartu balorea, sakatu Enter-i berezko balorea
|
||||
$string['cliunknowoption'] = 'Aukera ezezagunak:{$a}
|
||||
Mesedez, erabili --laguntza aukera.';
|
||||
$string['cliyesnoprompt'] = 'idatzi b (bai esateko) edo e (ez esateko)';
|
||||
$string['environmentrequireinstall'] = 'derrigorrezkoa da instalatuta etagaituta izatea';
|
||||
$string['environmentrequireinstall'] = 'derrigorrezkoa da instalatuta eta gaituta izatea';
|
||||
$string['environmentrequireversion'] = '{$a->needed} bertsioa beharrezkoa da eta zu {$a->current} ari zara egikaritzen';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['missingrequiredfield'] = 'بعضی از فیلدهای ضروری خالی است';
|
||||
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
$string['admindirname'] = 'Ylläpitohakemisto';
|
||||
$string['availablelangs'] = 'Saatavilla olevat kielipaketit';
|
||||
$string['chooselanguagehead'] = 'Valitse kieli';
|
||||
$string['chooselanguagesub'] = 'Valitse kieli asennusohjelmaa varten. Tätä kieltä käytetään sivuston oletuskielenä. Voit valita muita kieliä käyttöösi myöhemmin.';
|
||||
$string['chooselanguagesub'] = 'Valitse kieli asennusohjelmaa varten. Tätä kieltä käytetään sivuston oletuskielenä, jonka voi vaihtaa tarpeen mukaan. Myöhemmin voit myös lisätä käyttöön muitakin kieliä.';
|
||||
$string['clialreadyconfigured'] = 'Tiedosto config.php on jo olemassa, käytä admin/cli/install_database.php -tiedostoa jos haluat asentaa tämän sivuston.';
|
||||
$string['clialreadyinstalled'] = 'Tiedosto config.php on jo olemassa, ole hyvä ja käytä admin/cli/upgrade.php:ta jos haluat päivittää sivustosi';
|
||||
$string['cliinstallheader'] = 'Moodlen {$a} komentoriviasennusohjelma';
|
||||
@@ -82,10 +82,7 @@ $string['pathsunsecuredataroot'] = 'Dataroot-sijainti on turvallinen';
|
||||
$string['pathswrongadmindir'] = 'Admin-hakemistoa ei ole';
|
||||
$string['phpextension'] = '{$a} PHP-lisäosa';
|
||||
$string['phpversion'] = 'PHP versio';
|
||||
$string['phpversionhelp'] = '<p>Moodle vaatii vähintään PHP version 4.3.0 tai 5.1.0 (5.0.x -versiossa on joitakin tunnettuja ongelmia).</p>
|
||||
<p>Käytät parhaillaan versiota {$a}</p>
|
||||
<p>Sinun täytyy päivittää PHP tai siirtää asennus palvelimelle jossa on uudempi PHP-versio!<br>
|
||||
(jos sinulla on versio 5.0.x, voit myös siirtyä versioon 4.4.x) </p>';
|
||||
$string['phpversionhelp'] = '<p>Moodle vaatii vähintään PHP-version 4.3.0 tai 5.1.0 (5.0.x sisältää monia tunnettuja ongelmia).</p> <p>Käytössäsi on versio {$a}</p> <p>Sinun pitää päivittää PHP tai siirtää palvelimelle jossa on uudempi PHP.<br /> (Jos käytössäsi on 5.0.x voit myös päivittää alaspäin 4.4.x -versioon)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Näet tämän sivun koska olet onnistuneesti asentanut ja käynnistänyt <strong>{$a->packname} {$a->packversion}</strong> paketin tietokoneellasi.
|
||||
Onnittelut!';
|
||||
|
||||
@@ -30,4 +30,5 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Føroyskt';
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['cannotcreatelangdir'] = 'Ní féidir eolaire teanga a chruthú';
|
||||
$string['cannotcreatetempdir'] = 'Ní féidir eolaire sealadach a chruthú';
|
||||
$string['cannotdownloadcomponents'] = 'Ní féidir na comhphairteanna a íoslódáil';
|
||||
$string['cannotdownloadzipfile'] = 'Ní féidir comhad ZIP a íoslódáil';
|
||||
$string['cannotfindcomponent'] = 'Ní féidir teacht ar chomhpháirt';
|
||||
$string['cannotsavemd5file'] = 'Ni féidir an comhad md5 a shábháil';
|
||||
$string['cannotsavezipfile'] = 'Ni féidir an comhad ZIP a shábháil';
|
||||
$string['cannotunzipfile'] = 'Ní féidir an comhad a dhízipeáil';
|
||||
$string['componentisuptodate'] = 'Tá an chomhpháirt suas chun dáta';
|
||||
$string['downloadedfilecheckfailed'] = 'Theip ar an seiceáil comhaid íoslódailte';
|
||||
$string['invalidmd5'] = 'Bhí "an athróg seiceála mícheart – triail arís é';
|
||||
$string['missingrequiredfield'] = 'Réimse riachtanach ar iarraidh';
|
||||
$string['remotedownloaderror'] = 'Theip ar íoslódail comhpháirte chuig do fhreastalaí, dearbhaigh seachshocruithe moltar iarmhíreanna , PHP cURL go hard.<br /"><br />Y Caithfidh tú an comhad <a href="""{$a->url}"">{$a->url}</a> a íoslódáil de láimh';
|
||||
$string['wrongdestpath'] = 'Cosán sprice mícheart';
|
||||
$string['wrongsourcebase'] = 'Foinse mícheart do bhunachar URL';
|
||||
$string['wrongzipfilename'] = 'Ainm mícherat comhaid ZIP';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user