Compare commits
387 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e038687c55 | |||
| fd6e84c5be | |||
| 98f8613822 | |||
| 573534c441 | |||
| 82a69ceaa0 | |||
| d6d685fd71 | |||
| ec2d67fd80 | |||
| e09afa5184 | |||
| a32772051f | |||
| aa6d532b45 | |||
| 5c635f6c62 | |||
| b97e174acf | |||
| eb2080240a | |||
| d5420db934 | |||
| d39925c792 | |||
| 7f92387c85 | |||
| da4bd770f2 | |||
| 9d02febe9b | |||
| feeb14b941 | |||
| 8d7f911c96 | |||
| 17a5b5a094 | |||
| 93c5c3b02c | |||
| 3f999f8120 | |||
| 5f5ff2b680 | |||
| 1d79b726d7 | |||
| fd469033fa | |||
| 54a3ce69e9 | |||
| ec00601863 | |||
| 781383a946 | |||
| ce4af8c4fe | |||
| a6b0fc1c93 | |||
| eff38644cf | |||
| cf0d08f661 | |||
| 4b280ca679 | |||
| b5e41dac94 | |||
| 0572012ef3 | |||
| 1a77c6c263 | |||
| 54061d7cbf | |||
| 217eeccb26 | |||
| b6f8473cdb | |||
| 5fde58a593 | |||
| b15eea6009 | |||
| 1df3b0ae24 | |||
| 20c171f284 | |||
| 5899b85fd6 | |||
| 06340a114f | |||
| 7b178abfbb | |||
| 501afed36a | |||
| ac9d18dfa4 | |||
| 242ef4590f | |||
| 31dda933e6 | |||
| 9479d76a14 | |||
| 8d0835e64b | |||
| fc7f2b1a2f | |||
| b73f62ef9b | |||
| 0ddf951c15 | |||
| f23877abfb | |||
| a20eeda845 | |||
| 0426c0dfac | |||
| 56463941a8 | |||
| fb1cb65868 | |||
| ef2a243345 | |||
| d927075f0c | |||
| 0f491109ca | |||
| 319fc5cb74 | |||
| d8da3c0f5b | |||
| 2ec2d00dc8 | |||
| c1288cd726 | |||
| 43ded6701d | |||
| bffe667ae0 | |||
| ccd8763ce2 | |||
| 4d69adc760 | |||
| 0f60e9fe53 | |||
| f1c2a058ad | |||
| 442406d3ec | |||
| eb244d3b87 | |||
| 0dc15de222 | |||
| 7b6ed67e0a | |||
| 35b10e19af | |||
| d8d636dfe4 | |||
| be9d851c07 | |||
| eecd7b4412 | |||
| 609d262c17 | |||
| 5a682ca6f9 | |||
| 858131c09c | |||
| 75156589fd | |||
| 41b2eb8400 | |||
| da7b1ecb12 | |||
| 34877d21af | |||
| fb0698f344 | |||
| dd9b396af4 | |||
| a1ffe7e235 | |||
| e2bceb5018 | |||
| 6476ff5a7c | |||
| 00f0d5c97f | |||
| e4f7ad5d55 | |||
| 9ffffa5ec7 | |||
| 7de740be35 | |||
| 7e1c6bf8b4 | |||
| 38fdbcf001 | |||
| b3c1e4b131 | |||
| c0f02f7c89 | |||
| 70351389f7 | |||
| 7017ce1a30 | |||
| 923f470056 | |||
| 3fb4ce7d58 | |||
| 49b18efa4e | |||
| 6f9d4498d2 | |||
| d9ea44e5a3 | |||
| 8927b51d23 | |||
| 58498bde56 | |||
| f530a1f868 | |||
| 0f987021a3 | |||
| 3e7b95b431 | |||
| 77474a85a1 | |||
| 2d57c26b8b | |||
| 6b32bf8520 | |||
| 5831c40c5c | |||
| 9a3d0206da | |||
| 0b8cda3b9e | |||
| 261aae298b | |||
| 3aba4326d4 | |||
| 442e59e785 | |||
| f368e4a731 | |||
| c6be1389b7 | |||
| ff1e26aba4 | |||
| 9c65b19cb5 | |||
| 7dc22c4ef1 | |||
| ce024436be | |||
| fdeb0d80ed | |||
| 414095a014 | |||
| ee02d17466 | |||
| ca61ed1bbe | |||
| 709c441e89 | |||
| 7b443f87dd | |||
| 2a4eeac067 | |||
| 5559857f9e | |||
| c8fbd8b0c3 | |||
| 37eadb417b | |||
| 9723842bc0 | |||
| 2c2544877d | |||
| d902ffe847 | |||
| d4aca421df | |||
| 79ed1fe6c6 | |||
| 22687af45a | |||
| d75a987e36 | |||
| e1267ba041 | |||
| 3fd370acde | |||
| 499c16040d | |||
| fb1b6c4fbc | |||
| b920c4096c | |||
| 6f69ef749e | |||
| d9a277684f | |||
| 0c60dae522 | |||
| 98ccd4fa20 | |||
| 501dd08c6b | |||
| 3054e59f40 | |||
| 8154dd8350 | |||
| d7b2888810 | |||
| aec4f1e956 | |||
| 6318a38885 | |||
| 1a038ed7d9 | |||
| 312ad653e9 | |||
| 73433c0995 | |||
| 2e0b7de1b1 | |||
| 7fcffb98bb | |||
| 3b44cab37b | |||
| d298661993 | |||
| 76bb36da6f | |||
| 0d80c1cc7a | |||
| 8803e9c7e1 | |||
| c32c6c1c24 | |||
| f8e976e56a | |||
| ccbe8ca79e | |||
| ea4841fbef | |||
| bb244cb482 | |||
| ea99087d08 | |||
| efc0be399e | |||
| 464ab7894b | |||
| 461ccadab0 | |||
| 20d52c6b9c | |||
| d203a50c02 | |||
| 1e803a3e45 | |||
| dd79ab10b3 | |||
| ef9c4b6ef5 | |||
| 7af74e7f19 | |||
| 1f02e1548f | |||
| 5ac9166740 | |||
| 25105b650a | |||
| 6bf520165b | |||
| 6e0b5a725d | |||
| ce520e0470 | |||
| 7a5f3762d0 | |||
| a68e6026ca | |||
| 6c5a661606 | |||
| 42cff3b54a | |||
| aa17028b35 | |||
| 870f78b0fd | |||
| d4a997b7d7 | |||
| 7ec3994f78 | |||
| 5c58c88545 | |||
| 4d06b6a841 | |||
| 50a9a7d498 | |||
| d20826dc4c | |||
| 3220058b14 | |||
| 931eff3b84 | |||
| 112c8e8812 | |||
| 871a4102dc | |||
| caf6774576 | |||
| 1b68e51133 | |||
| 0d9a2ce8e0 | |||
| 3133c8e4ac | |||
| 1fbe4f46ba | |||
| 4e7aef7651 | |||
| 5bad124045 | |||
| eda9f7bd43 | |||
| 3a44f70e62 | |||
| a1ec118378 | |||
| 166102e9b3 | |||
| 1802cb2536 | |||
| 58404f0ab4 | |||
| 720b0f5eb0 | |||
| 892c4e1bc6 | |||
| 883050603c | |||
| 6b9fc96f8e | |||
| dec2c2086f | |||
| 927416c2f3 | |||
| 69778612db | |||
| dea31c3040 | |||
| 989a8abc44 | |||
| cfbdf4d2a0 | |||
| a95fb6895d | |||
| 239fb7ac41 | |||
| 0816f853fa | |||
| f6a2e02702 | |||
| d11c78a127 | |||
| a387569134 | |||
| de6e4874ef | |||
| eecfff557d | |||
| 8874028e9e | |||
| cfd41befd5 | |||
| 5c0877079c | |||
| b795853f5b | |||
| 0ab296bd10 | |||
| 99a66861b7 | |||
| 0852e56af6 | |||
| 3a509e1a6a | |||
| 4ea004cf9e | |||
| 11799954dc | |||
| ddc9ca757d | |||
| 18c3001eb4 | |||
| 9e8c6c7bff | |||
| 5364ee6b09 | |||
| 7ecf4f1360 | |||
| 1e659c865a | |||
| 704e2ecaaa | |||
| bd11908373 | |||
| 76593ae5e6 | |||
| 3519df7631 | |||
| 079a76bb37 | |||
| 362add0f4f | |||
| 3a5cb521c9 | |||
| b7f0af199d | |||
| 20a98af525 | |||
| 5ac884c9a3 | |||
| 70a9bf863b | |||
| 819ad10fa3 | |||
| 9c14f808ed | |||
| b2c04be9c5 | |||
| ecfa79b801 | |||
| 0c61dbecf7 | |||
| f034c23b0a | |||
| 536780c5de | |||
| f246415143 | |||
| e8803d5293 | |||
| 56054396c4 | |||
| 1936dbe341 | |||
| fe33d24cab | |||
| 994bc95e2a | |||
| bbf86cd4f3 | |||
| 843093789d | |||
| 821c60617e | |||
| 673ff9d82e | |||
| 59c5f4cd35 | |||
| 0fe975bbf2 | |||
| 25ce2cfbeb | |||
| 85c361d3ea | |||
| 48bf094142 | |||
| cacbbb46ce | |||
| 11ba99ea72 | |||
| 914624d51d | |||
| ba97fbe855 | |||
| fe33e80077 | |||
| 06b3c7e961 | |||
| a9cb8b73c8 | |||
| d0732e589f | |||
| 0e91ef2d66 | |||
| 6299d9a1a7 | |||
| a5a3618c66 | |||
| db5cbad673 | |||
| 33c1b04c2a | |||
| b055a241b8 | |||
| eb6f546b1b | |||
| 9fcdee8692 | |||
| 864a5cfd2f | |||
| d2db86448e | |||
| 417d004cad | |||
| 3adedb6f00 | |||
| 65f302ac4d | |||
| 9992ee729e | |||
| d9e93de2eb | |||
| 7a257bb0f7 | |||
| 37b6904b8c | |||
| 519c20adb8 | |||
| b9ef2c9607 | |||
| 4b5c4e2637 | |||
| 6d1e592c2a | |||
| 526bcd44cd | |||
| 6ef445a515 | |||
| 50701d1e89 | |||
| 3bb4d9b400 | |||
| 9df92fcacb | |||
| 3ab41b9779 | |||
| 6c402aa73d | |||
| 6e2f8aa9f1 | |||
| 81c8a28c72 | |||
| fb3ff98014 | |||
| bf07f4e212 | |||
| 7588627b8b | |||
| 9427beaf77 | |||
| 6407ca6927 | |||
| 8bcca79594 | |||
| e285f93242 | |||
| d4aac84fbe | |||
| 7765766512 | |||
| 87342f4cfb | |||
| e4095955ed | |||
| 5efd762f7a | |||
| 581e9db8e0 | |||
| 745a0dc660 | |||
| dc122b32b3 | |||
| 82f27d5bbd | |||
| bc353318b2 | |||
| 4b6963eb6d | |||
| 60d7878a3a | |||
| f0f28e3c3b | |||
| 8cdc6bfc4f | |||
| 15d001fc28 | |||
| 59faf92e1f | |||
| 332e3c0153 | |||
| 708c1b7fc8 | |||
| 38b7d50139 | |||
| f6a52da112 | |||
| d4ce77f624 | |||
| 834a0c1a55 | |||
| f402d3225f | |||
| 0cb081f51f | |||
| 00e2eb15a6 | |||
| 147400d846 | |||
| 54aabc8200 | |||
| 92ce0a63cb | |||
| 6bc755274a | |||
| 573571d727 | |||
| 1e9f48c9bc | |||
| 0713cc584d | |||
| ee40219d6a | |||
| 2ff2d96916 | |||
| d1fa204c0f | |||
| 7b62eec877 | |||
| ddd11cbf0b | |||
| ffbc0d6f2f | |||
| 16442e5cfd | |||
| 3d8c5cb044 | |||
| fe9f42de4d | |||
| 5c18a83649 | |||
| b7295e8e5d | |||
| e8c660394d | |||
| a1ba9e89d9 | |||
| fc427a8cbc | |||
| d4677b4059 | |||
| 0e79c3ee74 | |||
| f1820fdd6a | |||
| 967bfb4334 | |||
| bc8e5bce36 | |||
| 4ee9853a78 | |||
| b3af55b363 | |||
| cc59085352 |
+136
-20
@@ -227,7 +227,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -237,7 +237,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="curlrequired" />
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -277,12 +277,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="splrequired" />
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -344,7 +344,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -354,7 +354,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="curlrequired" />
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -394,12 +394,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="splrequired" />
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -454,7 +454,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -464,7 +464,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="curlrequired" />
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -504,12 +504,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="splrequired" />
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -569,7 +569,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -579,7 +579,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="curlrequired" />
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -619,12 +619,12 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="splrequired" />
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
@@ -685,7 +685,7 @@
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrequired" />
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
@@ -695,7 +695,7 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="curlrequired" />
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
@@ -735,12 +735,128 @@
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="simplexmlrequired" />
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="splrequired" />
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="40M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="safe_mode" value="0" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingsafemode" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.5" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="5.1.33" />
|
||||
<VENDOR name="postgres" version="8.3" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
<VENDOR name="sqlite" version="2.0" />
|
||||
</DATABASE>
|
||||
<PHP version="5.3.3" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
|
||||
@@ -244,6 +244,8 @@ class site_registration_form extends moodleform {
|
||||
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
|
||||
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
|
||||
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
|
||||
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
|
||||
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
|
||||
|
||||
//hidden parameters
|
||||
$mform->addElement('hidden', 'huburl', $huburl);
|
||||
@@ -376,36 +378,36 @@ class site_registration_form extends moodleform {
|
||||
if (HUB_MOODLEORGHUBURL != $huburl) {
|
||||
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
$mform->setDefault('courses', true);
|
||||
$mform->setDefault('courses', $coursesnumber != -1);
|
||||
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
|
||||
|
||||
$mform->addElement('checkbox', 'users', '',
|
||||
" " . get_string('usersnumber', 'hub', $usercount));
|
||||
$mform->setDefault('users', true);
|
||||
$mform->setDefault('users', $usersnumber != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'roleassignments', '',
|
||||
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
|
||||
$mform->setDefault('roleassignments', true);
|
||||
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'posts', '',
|
||||
" " . get_string('postsnumber', 'hub', $postcount));
|
||||
$mform->setDefault('posts', true);
|
||||
$mform->setDefault('posts', $postsnumber != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'questions', '',
|
||||
" " . get_string('questionsnumber', 'hub', $questioncount));
|
||||
$mform->setDefault('questions', true);
|
||||
$mform->setDefault('questions', $questionsnumber != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'resources', '',
|
||||
" " . get_string('resourcesnumber', 'hub', $resourcecount));
|
||||
$mform->setDefault('resources', true);
|
||||
$mform->setDefault('resources', $resourcesnumber != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'participantnumberaverage', '',
|
||||
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
|
||||
$mform->setDefault('participantnumberaverage', true);
|
||||
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
|
||||
|
||||
$mform->addElement('checkbox', 'modulenumberaverage', '',
|
||||
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
|
||||
$mform->setDefault('modulenumberaverage', true);
|
||||
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
|
||||
} else {
|
||||
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
|
||||
" " . get_string('coursesnumber', 'hub', $coursecount));
|
||||
|
||||
@@ -62,7 +62,18 @@ $siteregistrationform = new site_registration_form('',
|
||||
$fromform = $siteregistrationform->get_data();
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) {
|
||||
//save the settings
|
||||
|
||||
// Set to -1 all optional data marked as "don't send" by the admin.
|
||||
// The function get_site_info() will not calculate the optional data if config is set to -1.
|
||||
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
|
||||
'modulenumberaverage', 'participantnumberaverage');
|
||||
foreach ($inputnames as $inputname) {
|
||||
if (empty($fromform->{$inputname})) {
|
||||
$fromform->{$inputname} = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Save the settings.
|
||||
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
|
||||
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
|
||||
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
|
||||
@@ -113,6 +124,19 @@ if ($update and confirm_sesskey()) {
|
||||
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
|
||||
|
||||
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
|
||||
|
||||
// Retrieve the optional info (specially course number, user number, module number average...).
|
||||
$siteinfo = $registrationmanager->get_site_info($huburl);
|
||||
$fromform->courses = $siteinfo['courses'];
|
||||
$fromform->users = $siteinfo['users'];
|
||||
$fromform->enrolments = $siteinfo['enrolments'];
|
||||
$fromform->posts = $siteinfo['posts'];
|
||||
$fromform->questions = $siteinfo['questions'];
|
||||
$fromform->resources = $siteinfo['resources'];
|
||||
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
|
||||
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
|
||||
$fromform->street = $siteinfo['street'];
|
||||
|
||||
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
|
||||
|
||||
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
|
||||
|
||||
@@ -38,7 +38,7 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
public function moodleorg_registration_message() {
|
||||
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
|
||||
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
|
||||
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'MOOCH');
|
||||
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'Moodle.net');
|
||||
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
|
||||
$items = array(get_string('registermoodleorgli1', 'admin'),
|
||||
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
|
||||
@@ -92,4 +92,4 @@ class core_register_renderer extends plugin_renderer_base {
|
||||
return html_writer::table($table);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,14 +47,16 @@ list($options, $unrecognized) = cli_get_params(
|
||||
)
|
||||
);
|
||||
|
||||
if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
|
||||
if (file_exists(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php')) {
|
||||
// Composer packages present.
|
||||
require_once(__DIR__.'/../../../../vendor/autoload.php');
|
||||
}
|
||||
require_once(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php');
|
||||
|
||||
// Verify PHPUnit libs can be loaded.
|
||||
if (!include_once('PHPUnit/Autoload.php')) {
|
||||
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
|
||||
} else {
|
||||
// Verify PHPUnit PEAR libs can be loaded.
|
||||
if (!include('PHPUnit/Autoload.php')) {
|
||||
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
|
||||
}
|
||||
}
|
||||
|
||||
if ($options['run']) {
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
//
|
||||
// hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS
|
||||
//
|
||||
if (!isset($_SERVER['REQUEST_URI'])) {
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
|
||||
if (isset($_SERVER['QUERY_STRING'])) {
|
||||
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -105,7 +105,7 @@ class auth_plugin_radius extends auth_plugin_base {
|
||||
}
|
||||
|
||||
$result = $rauth->send();
|
||||
if (PEAR::isError($result)) {
|
||||
if ($rauth->isError($result)) {
|
||||
printf("Radius send failed: %s<br/>\n", $result->getMessage());
|
||||
exit;
|
||||
} else if ($result === true) {
|
||||
|
||||
@@ -1820,6 +1820,10 @@ class backup_questions_structure_step extends backup_structure_step {
|
||||
$qhint = new backup_nested_element('question_hint', array('id'), array(
|
||||
'hint', 'hintformat', 'shownumcorrect', 'clearwrong', 'options'));
|
||||
|
||||
$tags = new backup_nested_element('tags');
|
||||
|
||||
$tag = new backup_nested_element('tag', array('id'), array('name', 'rawname'));
|
||||
|
||||
// Build the tree
|
||||
|
||||
$qcategories->add_child($qcategory);
|
||||
@@ -1828,6 +1832,9 @@ class backup_questions_structure_step extends backup_structure_step {
|
||||
$question->add_child($qhints);
|
||||
$qhints->add_child($qhint);
|
||||
|
||||
$question->add_child($tags);
|
||||
$tags->add_child($tag);
|
||||
|
||||
// Define the sources
|
||||
|
||||
$qcategory->set_source_sql("
|
||||
@@ -1847,6 +1854,12 @@ class backup_questions_structure_step extends backup_structure_step {
|
||||
ORDER BY id',
|
||||
array('questionid' => backup::VAR_PARENTID));
|
||||
|
||||
$tag->set_source_sql("SELECT t.id, t.name, t.rawname
|
||||
FROM {tag} t
|
||||
JOIN {tag_instance} ti ON ti.tagid = t.id
|
||||
WHERE ti.itemid = ?
|
||||
AND ti.itemtype = 'question'", array(backup::VAR_PARENTID));
|
||||
|
||||
// don't need to annotate ids nor files
|
||||
// (already done by {@link backup_annotate_all_question_files}
|
||||
|
||||
|
||||
@@ -71,6 +71,8 @@ class restore_course_task extends restore_task {
|
||||
$this->add_step(new restore_course_structure_step('course_info', 'course.xml'));
|
||||
}
|
||||
|
||||
$this->add_step(new restore_course_legacy_files_step('legacy_files'));
|
||||
|
||||
// Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
|
||||
if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
|
||||
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
|
||||
|
||||
@@ -150,6 +150,11 @@ class restore_gradebook_structure_step extends restore_structure_step {
|
||||
if ($data->itemtype=='manual') {
|
||||
// manual grade items store category id in categoryid
|
||||
$data->categoryid = $this->get_mappingid('grade_category', $data->categoryid, NULL);
|
||||
// if mapping failed put in course's grade category
|
||||
if (NULL == $data->categoryid) {
|
||||
$coursecat = grade_category::fetch_course_category($this->get_courseid());
|
||||
$data->categoryid = $coursecat->id;
|
||||
}
|
||||
} else if ($data->itemtype=='course') {
|
||||
// course grade item stores their category id in iteminstance
|
||||
$coursecat = grade_category::fetch_course_category($this->get_courseid());
|
||||
@@ -1274,7 +1279,7 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
// Otherwise, when you restore to an existing course, it will mess up
|
||||
// existing section availability entries.
|
||||
if (!$this->get_mappingid('course_sections_availability', $data->id, false)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update source cmid / grade id to new value.
|
||||
@@ -1287,7 +1292,12 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
$data->gradeitemid = null;
|
||||
}
|
||||
|
||||
$DB->update_record('course_sections_availability', $data);
|
||||
// Delete the record if the condition wasn't found, otherwise update it.
|
||||
if ($data->sourcecmid === null && $data->gradeitemid === null) {
|
||||
$DB->delete_records('course_sections_availability', array('id' => $data->id));
|
||||
} else {
|
||||
$DB->update_record('course_sections_availability', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1453,7 +1463,6 @@ class restore_course_structure_step extends restore_structure_step {
|
||||
|
||||
// Add course related files, without itemid to match
|
||||
$this->add_related_files('course', 'summary', null);
|
||||
$this->add_related_files('course', 'legacy', null);
|
||||
|
||||
// Deal with legacy allowed modules.
|
||||
if ($this->legacyrestrictmodules) {
|
||||
@@ -1480,6 +1489,29 @@ class restore_course_structure_step extends restore_structure_step {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execution step that will migrate legacy files if present.
|
||||
*/
|
||||
class restore_course_legacy_files_step extends restore_execution_step {
|
||||
public function define_execution() {
|
||||
global $DB;
|
||||
|
||||
// Do a check for legacy files and skip if there are none.
|
||||
$sql = 'SELECT count(*)
|
||||
FROM {backup_files_temp}
|
||||
WHERE backupid = ?
|
||||
AND contextid = ?
|
||||
AND component = ?
|
||||
AND filearea = ?';
|
||||
$params = array($this->get_restoreid(), $this->task->get_old_contextid(), 'course', 'legacy');
|
||||
|
||||
if ($DB->count_records_sql($sql, $params)) {
|
||||
$DB->set_field('course', 'legacyfiles', 2, array('id' => $this->get_courseid()));
|
||||
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'course',
|
||||
'legacy', $this->task->get_old_contextid(), $this->task->get_userid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Structure step that will read the roles.xml file (at course/activity/block levels)
|
||||
@@ -3008,13 +3040,15 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$hint = new restore_path_element('question_hint',
|
||||
'/question_categories/question_category/questions/question/question_hints/question_hint');
|
||||
|
||||
$tag = new restore_path_element('tag','/question_categories/question_category/questions/question/tags/tag');
|
||||
|
||||
// Apply for 'qtype' plugins optional paths at question level
|
||||
$this->add_plugin_structure('qtype', $question);
|
||||
|
||||
// Apply for 'local' plugins optional paths at question level
|
||||
$this->add_plugin_structure('local', $question);
|
||||
|
||||
return array($category, $question, $hint);
|
||||
return array($category, $question, $hint, $tag);
|
||||
}
|
||||
|
||||
protected function process_question_category($data) {
|
||||
@@ -3161,6 +3195,29 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$this->set_mapping('question_hint', $oldid, $newitemid);
|
||||
}
|
||||
|
||||
protected function process_tag($data) {
|
||||
global $CFG, $DB;
|
||||
|
||||
$data = (object)$data;
|
||||
$newquestion = $this->get_new_parentid('question');
|
||||
|
||||
if (!empty($CFG->usetags)) { // if enabled in server
|
||||
// TODO: This is highly inneficient. Each time we add one tag
|
||||
// we fetch all the existing because tag_set() deletes them
|
||||
// so everything must be reinserted on each call
|
||||
$tags = array();
|
||||
$existingtags = tag_get_tags('question', $newquestion);
|
||||
// Re-add all the existitng tags
|
||||
foreach ($existingtags as $existingtag) {
|
||||
$tags[] = $existingtag->rawname;
|
||||
}
|
||||
// Add the one being restored
|
||||
$tags[] = $data->rawname;
|
||||
// Send all the tags back to the question
|
||||
tag_set('question', $newquestion, $tags);
|
||||
}
|
||||
}
|
||||
|
||||
protected function after_execute() {
|
||||
global $DB;
|
||||
|
||||
|
||||
@@ -821,7 +821,7 @@ abstract class restore_dbops {
|
||||
* @return array of result object
|
||||
*/
|
||||
public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) {
|
||||
global $DB;
|
||||
global $DB, $CFG;
|
||||
|
||||
$results = array();
|
||||
|
||||
@@ -916,6 +916,12 @@ abstract class restore_dbops {
|
||||
|
||||
// create the file in the filepool if it does not exist yet
|
||||
if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
|
||||
|
||||
// If no license found, use default.
|
||||
if ($file->license == null){
|
||||
$file->license = $CFG->sitedefaultlicense;
|
||||
}
|
||||
|
||||
$file_record = array(
|
||||
'contextid' => $newcontextid,
|
||||
'component' => $component,
|
||||
|
||||
@@ -521,6 +521,15 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$url = $component->get_url();
|
||||
|
||||
$output = html_writer::start_tag('div', array('class' => 'restore-course-search'));
|
||||
|
||||
$countstr = '';
|
||||
if ($component->has_more_results()) {
|
||||
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
|
||||
} else {
|
||||
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
|
||||
}
|
||||
|
||||
$output .= html_writer::tag('div', $countstr, array('class'=>'rcs-totalresults'));
|
||||
$output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
|
||||
|
||||
$table = new html_table();
|
||||
@@ -590,8 +599,14 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output .= html_writer::tag('div', get_string('totalcoursesearchresults', 'backup', $component->get_count()), array('class'=>'ics-totalresults'));
|
||||
$countstr = '';
|
||||
if ($component->has_more_results()) {
|
||||
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
|
||||
} else {
|
||||
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
|
||||
}
|
||||
|
||||
$output .= html_writer::tag('div', $countstr, array('class'=>'ics-totalresults'));
|
||||
$output .= html_writer::start_tag('div', array('class' => 'ics-results'));
|
||||
|
||||
$table = new html_table();
|
||||
@@ -610,6 +625,14 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
);
|
||||
$table->data[] = $row;
|
||||
}
|
||||
if ($component->has_more_results()) {
|
||||
$cell = new html_table_cell(get_string('moreresults', 'backup'));
|
||||
$cell->colspan = 3;
|
||||
$cell->attributes['class'] = 'notifyproblem';
|
||||
$row = new html_table_row(array($cell));
|
||||
$row->attributes['class'] = 'rcs-course';
|
||||
$table->data[] = $row;
|
||||
}
|
||||
$output .= html_writer::table($table);
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ abstract class restore_search_base implements renderable {
|
||||
* @var array
|
||||
*/
|
||||
private $requiredcapabilities = array();
|
||||
/**
|
||||
* Indicates if we have more than maxresults found.
|
||||
* @var boolean
|
||||
*/
|
||||
private $hasmoreresults = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -177,7 +182,7 @@ abstract class restore_search_base implements renderable {
|
||||
foreach ($this->requiredcapabilities as $cap) {
|
||||
$requiredcaps[] = $cap['capability'];
|
||||
}
|
||||
// Iterate while we have records and haven't reached MAXRESULTS
|
||||
// Iterate while we have records and haven't reached $this->maxresults.
|
||||
while ($totalcourses > $offs and $this->totalcount < self::$MAXRESULTS) {
|
||||
$resultset = $DB->get_records_sql($sql, $params, $offs, $blocksz);
|
||||
foreach ($resultset as $result) {
|
||||
@@ -189,11 +194,14 @@ abstract class restore_search_base implements renderable {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->results[$result->id] = $result;
|
||||
$this->totalcount++;
|
||||
if ($this->totalcount >= self::$MAXRESULTS) {
|
||||
// Check if we are over the limit.
|
||||
if ($this->totalcount+1 > self::$MAXRESULTS) {
|
||||
$this->hasmoreresults = true;
|
||||
break;
|
||||
}
|
||||
// If not, then continue.
|
||||
$this->totalcount++;
|
||||
$this->results[$result->id] = $result;
|
||||
}
|
||||
$offs += $blocksz;
|
||||
}
|
||||
@@ -202,7 +210,10 @@ abstract class restore_search_base implements renderable {
|
||||
}
|
||||
|
||||
final public function has_more_results() {
|
||||
return $this->get_count() >= self::$MAXRESULTS;
|
||||
if ($this->results === null) {
|
||||
$this->search();
|
||||
}
|
||||
return $this->hasmoreresults;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -216,9 +216,9 @@ if (empty($completions)) {
|
||||
echo '(<i>';
|
||||
|
||||
if ($agg == COMPLETION_AGGREGATION_ALL) {
|
||||
echo strtolower(get_string('aggregateall', 'completion'));
|
||||
echo strtolower(get_string('all', 'completion'));
|
||||
} else {
|
||||
echo strtolower(get_string('aggregateany', 'completion'));
|
||||
echo strtolower(get_string('any', 'completion'));
|
||||
}
|
||||
|
||||
echo '</i> '.strtolower(get_string('required')).')';
|
||||
|
||||
@@ -104,7 +104,8 @@ class block_course_overview_renderer extends plugin_renderer_base {
|
||||
$html .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
$attributes = array('title' => s($course->fullname));
|
||||
// No need to pass title through s() here as it will be done automatically by html_writer.
|
||||
$attributes = array('title' => $course->fullname);
|
||||
if ($course->id > 0) {
|
||||
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
|
||||
$coursefullname = format_string($course->fullname, true, $course->id);
|
||||
|
||||
@@ -28,7 +28,7 @@ $string['askaddentry'] = 'When users can add entries to the glossary, show a lin
|
||||
$string['askinvisible'] = 'When users cannot edit or view the glossary, show this text (without link)';
|
||||
$string['askviewglossary'] = 'When users can view the glossary but not add entries, show a link with this text';
|
||||
$string['glossary_random:addinstance'] = 'Add a new random glossary entry block';
|
||||
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to the My Moodle page';
|
||||
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to My home';
|
||||
$string['intro'] = 'Make sure you have at least one glossary with at least one entry added to this course. Then you can adjust the following settings';
|
||||
$string['invisible'] = '(to be continued)';
|
||||
$string['lastmodified'] = 'Last modified entry';
|
||||
|
||||
@@ -27,6 +27,6 @@ $string['configtitle'] = 'Block title';
|
||||
$string['configtitleblankhides'] = 'Block title (no title if blank)';
|
||||
$string['leaveblanktohide'] = 'leave blank to hide the title';
|
||||
$string['mentees:addinstance'] = 'Add a new mentees block';
|
||||
$string['mentees:myaddinstance'] = 'Add a new mentees block to the My Moodle page';
|
||||
$string['mentees:myaddinstance'] = 'Add a new mentees block to My home';
|
||||
$string['newmenteesblock'] = '(new Mentees block)';
|
||||
$string['pluginname'] = 'Mentees';
|
||||
|
||||
+7
-2
@@ -348,10 +348,15 @@ BRANCH.prototype = {
|
||||
}
|
||||
|
||||
if (!link) {
|
||||
var branchspan = Y.Node.create('<span></span>');
|
||||
if (branchicon) {
|
||||
branchp.appendChild(branchicon);
|
||||
branchspan.appendChild(branchicon);
|
||||
}
|
||||
branchp.append(this.get('name'));
|
||||
branchspan.append(this.get('name'));
|
||||
if (this.get('hidden')) {
|
||||
branchspan.addClass('dimmed_text');
|
||||
}
|
||||
branchp.appendChild(branchspan);
|
||||
} else {
|
||||
var branchlink = Y.Node.create('<a title="'+this.get('title')+'" href="'+link+'"></a>');
|
||||
if (branchicon) {
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
*/
|
||||
|
||||
$string['news_items:addinstance'] = 'Add a new latest news block';
|
||||
$string['news_items:myaddinstance'] = 'Add a new latest news block to the My Moodle page';
|
||||
$string['news_items:myaddinstance'] = 'Add a new latest news block to My home';
|
||||
$string['pluginname'] = 'Latest news';
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
$string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.';
|
||||
$string['online_users:addinstance'] = 'Add a new online users block';
|
||||
$string['online_users:myaddinstance'] = 'Add a new online users block to the My Moodle page';
|
||||
$string['online_users:myaddinstance'] = 'Add a new online users block to My home';
|
||||
$string['online_users:viewlist'] = 'View list of online users';
|
||||
$string['periodnminutes'] = 'last {$a} minutes';
|
||||
$string['pluginname'] = 'Online users';
|
||||
|
||||
+1
-7
@@ -183,13 +183,7 @@ if (!empty($userid)) {
|
||||
print_error('donothaveblog', 'blog');
|
||||
}
|
||||
} else {
|
||||
$personalcontext = context_user::instance($userid);
|
||||
|
||||
if (!has_capability('moodle/blog:view', $sitecontext) && !has_capability('moodle/user:readuserblogs', $personalcontext)) {
|
||||
print_error('cannotviewuserblog', 'blog');
|
||||
}
|
||||
|
||||
if (!blog_user_can_view_user_entry($userid)) {
|
||||
if (!has_capability('moodle/blog:view', $sitecontext) || !blog_user_can_view_user_entry($userid)) {
|
||||
print_error('cannotviewcourseblog', 'blog');
|
||||
}
|
||||
|
||||
|
||||
+38
-15
@@ -65,35 +65,36 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
|
||||
global $CFG, $USER, $DB;
|
||||
|
||||
if (empty($CFG->enableblogs)) {
|
||||
return false; // blog system disabled
|
||||
return false; // Blog system disabled.
|
||||
}
|
||||
|
||||
if (isloggedin() && $USER->id == $targetuserid) {
|
||||
return true; // can view own entries in any case
|
||||
return true; // Can view own entries in any case.
|
||||
}
|
||||
|
||||
$sitecontext = context_system::instance();
|
||||
if (has_capability('moodle/blog:manageentries', $sitecontext)) {
|
||||
return true; // can manage all entries
|
||||
return true; // Can manage all entries.
|
||||
}
|
||||
|
||||
// coming for 1 entry, make sure it's not a draft
|
||||
// If blog is in draft state, then make sure user have proper capability.
|
||||
if ($blogentry && $blogentry->publishstate == 'draft' && !has_capability('moodle/blog:viewdrafts', $sitecontext)) {
|
||||
return false; // can not view draft of others
|
||||
return false; // Can not view draft of others.
|
||||
}
|
||||
|
||||
// coming for 0 entry, make sure user is logged in, if not a public blog
|
||||
// If blog entry is not public, make sure user is logged in.
|
||||
if ($blogentry && $blogentry->publishstate != 'public' && !isloggedin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If blogentry is not passed or all above checks pass, then check capability based on system config.
|
||||
switch ($CFG->bloglevel) {
|
||||
case BLOG_GLOBAL_LEVEL:
|
||||
return true;
|
||||
break;
|
||||
|
||||
case BLOG_SITE_LEVEL:
|
||||
if (isloggedin()) { // not logged in viewers forbidden
|
||||
if (isloggedin()) { // Not logged in viewers forbidden.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -101,6 +102,7 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
|
||||
|
||||
case BLOG_USER_LEVEL:
|
||||
default:
|
||||
// If user is viewing other user blog, then user should have user:readuserblogs capability.
|
||||
$personalcontext = context_user::instance($targetuserid);
|
||||
return has_capability('moodle/user:readuserblogs', $personalcontext);
|
||||
break;
|
||||
@@ -1000,6 +1002,8 @@ function blog_get_associated_count($courseid, $cmid=null) {
|
||||
* may have switch to turn on/off comments option, this callback will
|
||||
* affect UI display, not like pluginname_comment_validate only throw
|
||||
* exceptions.
|
||||
* blog_comment_validate will be called before viewing/adding/deleting
|
||||
* comment, so don't repeat checks.
|
||||
* Capability check has been done in comment->check_permissions(), we
|
||||
* don't need to do it again here.
|
||||
*
|
||||
@@ -1016,7 +1020,17 @@ function blog_get_associated_count($courseid, $cmid=null) {
|
||||
* @return array
|
||||
*/
|
||||
function blog_comment_permissions($comment_param) {
|
||||
return array('post'=>true, 'view'=>true);
|
||||
global $DB;
|
||||
|
||||
// If blog is public and current user is guest, then don't let him post comments.
|
||||
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), 'publishstate', MUST_EXIST);
|
||||
|
||||
if ($blogentry->publishstate != 'public') {
|
||||
if (!isloggedin() || isguestuser()) {
|
||||
return array('post' => false, 'view' => true);
|
||||
}
|
||||
}
|
||||
return array('post' => true, 'view' => true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1035,16 +1049,21 @@ function blog_comment_permissions($comment_param) {
|
||||
* @return boolean
|
||||
*/
|
||||
function blog_comment_validate($comment_param) {
|
||||
global $DB;
|
||||
// validate comment itemid
|
||||
if (!$entry = $DB->get_record('post', array('id'=>$comment_param->itemid))) {
|
||||
throw new comment_exception('invalidcommentitemid');
|
||||
global $CFG, $DB, $USER;
|
||||
|
||||
// Check if blogs are enabled user can comment.
|
||||
if (empty($CFG->enableblogs) || empty($CFG->blogusecomments)) {
|
||||
throw new comment_exception('nopermissiontocomment');
|
||||
}
|
||||
// validate comment area
|
||||
|
||||
// Validate comment area.
|
||||
if ($comment_param->commentarea != 'format_blog') {
|
||||
throw new comment_exception('invalidcommentarea');
|
||||
}
|
||||
// validation for comment deletion
|
||||
|
||||
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), '*', MUST_EXIST);
|
||||
|
||||
// Validation for comment deletion.
|
||||
if (!empty($comment_param->commentid)) {
|
||||
if ($record = $DB->get_record('comments', array('id'=>$comment_param->commentid))) {
|
||||
if ($record->commentarea != 'format_blog') {
|
||||
@@ -1060,7 +1079,11 @@ function blog_comment_validate($comment_param) {
|
||||
throw new comment_exception('invalidcommentid');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
// Validate if user has blog view permission.
|
||||
$sitecontext = context_system::instance();
|
||||
return has_capability('moodle/blog:view', $sitecontext) &&
|
||||
blog_user_can_view_user_entry($blogentry->userid, $blogentry);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+3
-1
@@ -18,6 +18,7 @@ A definition:
|
||||
'requiremultipleidentifiers' => false, // Optional
|
||||
'requirelockingread' => false, // Optional
|
||||
'requirelockingwrite' => false, // Optional
|
||||
'requiresearchable' => false, // Optional
|
||||
'maxsize' => null, // Optional
|
||||
'overrideclass' => null, // Optional
|
||||
'overrideclassfile' => null, // Optional
|
||||
@@ -135,6 +136,7 @@ The following optional settings can also be defined:
|
||||
* requiremultipleidentifiers - If set to true then only stores that support multiple identifiers will be used.
|
||||
* requirelockingread - If set to true a lock will be acquired for reading. Don't use this setting unless you have a REALLY good reason to.
|
||||
* requirelockingwrite - If set to true a lock will be acquired before writing to the cache. Avoid this unless necessary.
|
||||
* requiresearchable - If set to true only stores that support key searching will be used for this definition. Its not recommended to use this unless absolutely unavoidable.
|
||||
* maxsize - This gives a cache an indication about the maximum items it should store. Cache stores don't have to use this, it is up to them to decide if its required.
|
||||
* overrideclass - If provided this class will be used for the loader. It must extend one of the core loader classes (based upon mode).
|
||||
* overrideclassfile - Included if required when using the overrideclass param.
|
||||
@@ -225,4 +227,4 @@ Cache information can be invalidated in two ways.
|
||||
The first method is designed to be used when you have a single known definition you want to invalidate entries within.
|
||||
The second method is a lot more intensive for the system. There are defined invalidation events that definitions can "subscribe" to (through the definitions invalidationevents option).
|
||||
When you invalidate by event the cache API finds all of the definitions that subscribe to the event, it then loads the stores for each of those definitions and purges the keys from each store.
|
||||
This is obviously a recursive, and therefore, intense process.
|
||||
This is obviously a recursive, and therefore, intense process.
|
||||
Vendored
+1
-1
@@ -100,7 +100,7 @@ if (!empty($action) && confirm_sesskey()) {
|
||||
|
||||
if (!array_key_exists($store, $stores)) {
|
||||
$notifysuccess = false;
|
||||
$notification = get_string('invalidstore');
|
||||
$notification = get_string('invalidstore', 'cache');
|
||||
} else if ($stores[$store]['mappings'] > 0) {
|
||||
$notifysuccess = false;
|
||||
$notification = get_string('deletestorehasmappings', 'cache');
|
||||
|
||||
Vendored
+26
-1
@@ -183,6 +183,13 @@ class cache_definition {
|
||||
*/
|
||||
protected $requirelockingwrite = false;
|
||||
|
||||
/**
|
||||
* Gets set to true if this definition requires searchable stores.
|
||||
* @since 2.4.4
|
||||
* @var bool
|
||||
*/
|
||||
protected $requiresearchable = false;
|
||||
|
||||
/**
|
||||
* Sets the maximum number of items that can exist in the cache.
|
||||
* Please note this isn't a hard limit, and doesn't need to be enforced by the caches. They can choose to do so optionally.
|
||||
@@ -307,6 +314,7 @@ class cache_definition {
|
||||
$requiremultipleidentifiers = false;
|
||||
$requirelockingread = false;
|
||||
$requirelockingwrite = false;
|
||||
$requiresearchable = ($mode === cache_store::MODE_SESSION) ? true : false;
|
||||
$maxsize = null;
|
||||
$overrideclass = null;
|
||||
$overrideclassfile = null;
|
||||
@@ -342,6 +350,10 @@ class cache_definition {
|
||||
}
|
||||
$requirelocking = $requirelockingwrite || $requirelockingread;
|
||||
|
||||
if (array_key_exists('requiresearchable', $definition)) {
|
||||
$requiresearchable = (bool)$definition['requiresearchable'];
|
||||
}
|
||||
|
||||
if (array_key_exists('maxsize', $definition)) {
|
||||
$maxsize = (int)$definition['maxsize'];
|
||||
}
|
||||
@@ -433,6 +445,7 @@ class cache_definition {
|
||||
$cachedefinition->requirelocking = $requirelocking;
|
||||
$cachedefinition->requirelockingread = $requirelockingread;
|
||||
$cachedefinition->requirelockingwrite = $requirelockingwrite;
|
||||
$cachedefinition->requiresearchable = $requiresearchable;
|
||||
$cachedefinition->maxsize = $maxsize;
|
||||
$cachedefinition->overrideclass = $overrideclass;
|
||||
$cachedefinition->overrideclassfile = $overrideclassfile;
|
||||
@@ -633,6 +646,15 @@ class cache_definition {
|
||||
return $this->requirelockingwrite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this definition requires a searchable cache.
|
||||
* @since 2.4.4
|
||||
* @return bool
|
||||
*/
|
||||
public function require_searchable() {
|
||||
return $this->requiresearchable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this definition has an associated data source.
|
||||
* @return bool
|
||||
@@ -686,6 +708,9 @@ class cache_definition {
|
||||
if ($this->require_multiple_identifiers()) {
|
||||
$requires += cache_store::SUPPORTS_MULTIPLE_IDENTIFIERS;
|
||||
}
|
||||
if ($this->require_searchable()) {
|
||||
$requires += cache_store::IS_SEARCHABLE;
|
||||
}
|
||||
return $requires;
|
||||
}
|
||||
|
||||
@@ -694,7 +719,7 @@ class cache_definition {
|
||||
* @return bool
|
||||
*/
|
||||
public function should_be_persistent() {
|
||||
return $this->persistent;
|
||||
return $this->persistent || $this->mode === cache_store::MODE_SESSION;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+14
-7
@@ -103,7 +103,7 @@ class cache_factory {
|
||||
* An array of lock plugins.
|
||||
* @var array
|
||||
*/
|
||||
protected $lockplugins = null;
|
||||
protected $lockplugins = array();
|
||||
|
||||
/**
|
||||
* The current state of the cache API.
|
||||
@@ -155,7 +155,7 @@ class cache_factory {
|
||||
$factory->stores = array();
|
||||
$factory->configs = array();
|
||||
$factory->definitions = array();
|
||||
$factory->lockplugins = null; // MUST be null in order to force its regeneration.
|
||||
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
|
||||
// Reset the state to uninitialised.
|
||||
$factory->state = self::STATE_UNINITIALISED;
|
||||
}
|
||||
@@ -207,9 +207,7 @@ class cache_factory {
|
||||
if (array_key_exists($key, $this->cachesfromparams)) {
|
||||
return $this->cachesfromparams[$key];
|
||||
}
|
||||
// Get the class. Note this is a late static binding so we need to use get_called_class.
|
||||
$definition = cache_definition::load_adhoc($mode, $component, $area, $options);
|
||||
$config = $this->create_config_instance();
|
||||
$definition->set_identifiers($identifiers);
|
||||
$cache = $this->create_cache($definition, $identifiers);
|
||||
if ($definition->should_be_persistent()) {
|
||||
@@ -406,7 +404,7 @@ class cache_factory {
|
||||
$definition = $instance->get_definition_by_id($id);
|
||||
if (!$definition) {
|
||||
throw new coding_exception('The requested cache definition does not exist.'. $id, $id);
|
||||
} else {
|
||||
} else if (!$this->is_disabled()) {
|
||||
debugging('Cache definitions reparsed causing cache reset in order to locate definition.
|
||||
You should bump the version number to ensure definitions are reprocessed.', DEBUG_DEVELOPER);
|
||||
}
|
||||
@@ -442,6 +440,7 @@ class cache_factory {
|
||||
* @return cache_lock_interface
|
||||
*/
|
||||
public function create_lock_instance(array $config) {
|
||||
global $CFG;
|
||||
if (!array_key_exists('name', $config) || !array_key_exists('type', $config)) {
|
||||
throw new coding_exception('Invalid cache lock instance provided');
|
||||
}
|
||||
@@ -450,8 +449,16 @@ class cache_factory {
|
||||
unset($config['name']);
|
||||
unset($config['type']);
|
||||
|
||||
if ($this->lockplugins === null) {
|
||||
$this->lockplugins = get_plugin_list_with_class('cachelock', '', 'lib.php');
|
||||
if (!isset($this->lockplugins[$type])) {
|
||||
$pluginname = substr($type, 10);
|
||||
$file = $CFG->dirroot."/cache/locks/{$pluginname}/lib.php";
|
||||
if (file_exists($file) && is_readable($file)) {
|
||||
require_once($file);
|
||||
}
|
||||
if (!class_exists($type)) {
|
||||
throw new coding_exception('Invalid lock plugin requested.');
|
||||
}
|
||||
$this->lockplugins[$type] = $type;
|
||||
}
|
||||
if (!array_key_exists($type, $this->lockplugins)) {
|
||||
throw new coding_exception('Invalid cache lock type.');
|
||||
|
||||
Vendored
+65
-7
@@ -192,8 +192,7 @@ class cache_helper {
|
||||
if (in_array($pluginname, $ignored)) {
|
||||
continue;
|
||||
}
|
||||
$pluginname = clean_param($pluginname, PARAM_PLUGIN);
|
||||
if (empty($pluginname)) {
|
||||
if (!is_valid_plugin_name($pluginname)) {
|
||||
// Better ignore plugins with problematic names here.
|
||||
continue;
|
||||
}
|
||||
@@ -244,10 +243,9 @@ class cache_helper {
|
||||
if ($definition->invalidates_on_event($event)) {
|
||||
// OK at this point we know that the definition has information to invalidate on the event.
|
||||
// There are two routes, either its an application cache in which case we can invalidate it now.
|
||||
// or it is a session cache in which case we need to set something to the "Event invalidation" definition.
|
||||
// No need to deal with request caches, we don't want to change data half way through a request.
|
||||
if ($definition->get_mode() === cache_store::MODE_APPLICATION) {
|
||||
$cache = $factory->create_cache($definition);
|
||||
// or it is a persistent cache that also needs to be invalidated now.
|
||||
if ($definition->get_mode() === cache_store::MODE_APPLICATION || $definition->should_be_persistent()) {
|
||||
$cache = $factory->create_cache_from_definition($definition->get_component(), $definition->get_area());
|
||||
$cache->delete_many($keys);
|
||||
}
|
||||
|
||||
@@ -548,7 +546,7 @@ class cache_helper {
|
||||
// If the site identifier is still null then config isn't aware of it yet.
|
||||
// We'll see if the CFG is loaded, and if not we will just use unknown.
|
||||
// It's very important here that we don't use get_config. We don't want an endless cache loop!
|
||||
if (isset($CFG->siteidentifier)) {
|
||||
if (!empty($CFG->siteidentifier)) {
|
||||
self::$siteidentifier = self::update_site_identifier($CFG->siteidentifier);
|
||||
} else {
|
||||
// It's not being recorded in MUC's config and the config data hasn't been loaded yet.
|
||||
@@ -568,4 +566,64 @@ class cache_helper {
|
||||
global $CFG;
|
||||
return (string)$CFG->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs cron routines for MUC.
|
||||
*/
|
||||
public static function cron() {
|
||||
self::clean_old_session_data(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans old session data from cache stores used for session based definitions.
|
||||
*
|
||||
* @param bool $output If set to true output will be given.
|
||||
*/
|
||||
public static function clean_old_session_data($output = false) {
|
||||
global $CFG;
|
||||
if ($output) {
|
||||
mtrace('Cleaning up stale session data from cache stores.');
|
||||
}
|
||||
$factory = cache_factory::instance();
|
||||
$config = $factory->create_config_instance();
|
||||
$definitions = $config->get_definitions();
|
||||
$purgetime = time() - $CFG->sessiontimeout;
|
||||
foreach ($definitions as $definitionarray) {
|
||||
// We are only interested in session caches.
|
||||
if (!($definitionarray['mode'] & cache_store::MODE_SESSION)) {
|
||||
continue;
|
||||
}
|
||||
$definition = $factory->create_definition($definitionarray['component'], $definitionarray['area']);
|
||||
$stores = $config->get_stores_for_definition($definition);
|
||||
// Turn them into store instances.
|
||||
$stores = self::initialise_cachestore_instances($stores, $definition);
|
||||
// Initialise all of the stores used for that definition.
|
||||
foreach ($stores as $store) {
|
||||
// If the store doesn't support searching we can skip it.
|
||||
if (!($store instanceof cache_is_searchable)) {
|
||||
debugging('Cache stores used for session definitions should ideally be searchable.', DEBUG_DEVELOPER);
|
||||
continue;
|
||||
}
|
||||
// Get all of the keys.
|
||||
$keys = $store->find_by_prefix(cache_session::KEY_PREFIX);
|
||||
$todelete = array();
|
||||
foreach ($store->get_many($keys) as $key => $value) {
|
||||
if (strpos($key, cache_session::KEY_PREFIX) !== 0 || !is_array($value) || !isset($value['lastaccess'])) {
|
||||
continue;
|
||||
}
|
||||
if ((int)$value['lastaccess'] < $purgetime || true) {
|
||||
$todelete[] = $key;
|
||||
}
|
||||
}
|
||||
if (count($todelete)) {
|
||||
$outcome = (int)$store->delete_many($todelete);
|
||||
if ($output) {
|
||||
$strdef = s($definition->get_id());
|
||||
$strstore = s($store->my_name());
|
||||
mtrace("- Removed {$outcome} old {$strdef} sessions from the '{$strstore}' cache store.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+24
@@ -338,6 +338,30 @@ interface cache_is_key_aware {
|
||||
public function has_all(array $keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache store feature: keys are searchable.
|
||||
*
|
||||
* Cache stores can choose to implement this interface.
|
||||
* In order for a store to be usable as a session cache it must implement this interface.
|
||||
*
|
||||
* @since 2.4.4
|
||||
*/
|
||||
interface cache_is_searchable {
|
||||
/**
|
||||
* Finds all of the keys being used by the cache store.
|
||||
*
|
||||
* @return array.
|
||||
*/
|
||||
public function find_all();
|
||||
|
||||
/**
|
||||
* Finds all of the keys whose keys start with the given prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*/
|
||||
public function find_by_prefix($prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache store feature: configurable.
|
||||
*
|
||||
|
||||
Vendored
+487
-8
@@ -141,7 +141,7 @@ class cache implements cache_loader {
|
||||
* and having it here helps speed up processing.
|
||||
* @var strubg
|
||||
*/
|
||||
private $storetype = 'unknown';
|
||||
protected $storetype = 'unknown';
|
||||
|
||||
/**
|
||||
* Gets set to true if we want to collect performance information about the cache API.
|
||||
@@ -365,6 +365,7 @@ class cache implements cache_loader {
|
||||
*/
|
||||
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
|
||||
|
||||
$keysparsed = array();
|
||||
$parsedkeys = array();
|
||||
$resultpersist = array();
|
||||
$resultstore = array();
|
||||
@@ -374,6 +375,7 @@ class cache implements cache_loader {
|
||||
$isusingpersist = $this->is_using_persist_cache();
|
||||
foreach ($keys as $key) {
|
||||
$pkey = $this->parse_key($key);
|
||||
$keysparsed[$key] = $pkey;
|
||||
$parsedkeys[$pkey] = $key;
|
||||
$keystofind[$pkey] = $key;
|
||||
if ($isusingpersist) {
|
||||
@@ -426,9 +428,11 @@ class cache implements cache_loader {
|
||||
$resultmissing = $this->datasource->load_many_for_cache($missingkeys);
|
||||
}
|
||||
foreach ($resultmissing as $key => $value) {
|
||||
$result[$key] = $value;
|
||||
$pkey = ($usingloader) ? $key : $keysparsed[$key];
|
||||
$realkey = ($usingloader) ? $parsedkeys[$key] : $key;
|
||||
$result[$pkey] = $value;
|
||||
if ($value !== false) {
|
||||
$this->set($parsedkeys[$key], $value);
|
||||
$this->set($realkey, $value);
|
||||
}
|
||||
}
|
||||
unset($resultmissing);
|
||||
@@ -748,7 +752,7 @@ class cache implements cache_loader {
|
||||
public function delete($key, $recurse = true) {
|
||||
$parsedkey = $this->parse_key($key);
|
||||
$this->delete_from_persist_cache($parsedkey);
|
||||
if ($recurse && !empty($this->loader)) {
|
||||
if ($recurse && $this->loader !== false) {
|
||||
// Delete from the bottom of the stack first.
|
||||
$this->loader->delete($key, $recurse);
|
||||
}
|
||||
@@ -770,7 +774,7 @@ class cache implements cache_loader {
|
||||
$this->delete_from_persist_cache($parsedkey);
|
||||
}
|
||||
}
|
||||
if ($recurse && !empty($this->loader)) {
|
||||
if ($recurse && $this->loader !== false) {
|
||||
// Delete from the bottom of the stack first.
|
||||
$this->loader->delete_many($keys, $recurse);
|
||||
}
|
||||
@@ -848,6 +852,26 @@ class cache implements cache_loader {
|
||||
return $this->store;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the loader associated with this instance.
|
||||
*
|
||||
* @since 2.4.4
|
||||
* @return cache_loader|false
|
||||
*/
|
||||
protected function get_loader() {
|
||||
return $this->loader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data source associated with this cache.
|
||||
*
|
||||
* @since 2.4.4
|
||||
* @return cache_data_source|false
|
||||
*/
|
||||
protected function get_datasource() {
|
||||
return $this->datasource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the store supports key awareness.
|
||||
*
|
||||
@@ -1396,6 +1420,18 @@ class cache_application extends cache implements cache_loader_with_locking {
|
||||
*
|
||||
* This class is used for session caches returned by the cache::make methods.
|
||||
*
|
||||
* It differs from the application loader in a couple of noteable ways:
|
||||
* 1. Sessions are always expected to be persistent.
|
||||
* Because of this we don't ever use the persist cache and instead a session array
|
||||
* containing all of the data is maintained by this object.
|
||||
* 2. Session data for a loader instance (store + definition) is consolidate into a
|
||||
* single array for storage within the store.
|
||||
* Along with this we embed a lastaccessed time with the data. This way we can
|
||||
* check sessions for a last access time.
|
||||
* 3. Session stores are required to support key searching and must
|
||||
* implement cache_is_searchable. This ensures stores used for the cache can be
|
||||
* targetted for garbage collection of session data.
|
||||
*
|
||||
* This cache class should never be interacted with directly. Instead you should always use the cache::make methods.
|
||||
* It is technically possible to call those methods through this class however there is no guarantee that you will get an
|
||||
* instance of this class back again.
|
||||
@@ -1421,6 +1457,24 @@ class cache_session extends cache {
|
||||
* @var int
|
||||
*/
|
||||
protected $currentuserid = null;
|
||||
|
||||
/**
|
||||
* The session id we are currently using.
|
||||
* @var array
|
||||
*/
|
||||
protected $sessionid = null;
|
||||
|
||||
/**
|
||||
* The session data for the above session id.
|
||||
* @var array
|
||||
*/
|
||||
protected $session = null;
|
||||
|
||||
/**
|
||||
* Constant used to prefix keys.
|
||||
*/
|
||||
const KEY_PREFIX = 'sess_';
|
||||
|
||||
/**
|
||||
* Override the cache::construct method.
|
||||
*
|
||||
@@ -1494,12 +1548,16 @@ class cache_session extends cache {
|
||||
* This function is called for every operation that uses keys. For this reason we use this function to also check
|
||||
* that the current user is the same as the user who last used this cache.
|
||||
*
|
||||
* On top of that if prepends the string 'sess_' to the start of all keys. The _ ensures things are easily identifiable.
|
||||
*
|
||||
* @param string|int $key As passed to get|set|delete etc.
|
||||
* @return string|array String unless the store supports multi-identifiers in which case an array if returned.
|
||||
*/
|
||||
protected function parse_key($key) {
|
||||
$this->check_tracked_user();
|
||||
return parent::parse_key($key);
|
||||
if ($key === 'lastaccess') {
|
||||
$key = '__lastaccess__';
|
||||
}
|
||||
return 'sess_'.parent::parse_key($key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1514,11 +1572,13 @@ class cache_session extends cache {
|
||||
$new = 0;
|
||||
}
|
||||
if ($new !== self::$loadeduserid) {
|
||||
// The current user doesn't match the tracker userid for this request.
|
||||
// The current user doesn't match the tracked userid for this request.
|
||||
if (!is_null(self::$loadeduserid)) {
|
||||
// Purge the data we have for the old user.
|
||||
// This way we don't bloat the session.
|
||||
$this->purge();
|
||||
// Update the session id just in case!
|
||||
$this->sessionid = session_id();
|
||||
}
|
||||
self::$loadeduserid = $new;
|
||||
$this->currentuserid = $new;
|
||||
@@ -1526,8 +1586,427 @@ class cache_session extends cache {
|
||||
// The current user matches the loaded user but not the user last used by this cache.
|
||||
$this->purge();
|
||||
$this->currentuserid = $new;
|
||||
// Update the session id just in case!
|
||||
$this->sessionid = session_id();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the session data.
|
||||
*
|
||||
* @param bool $force If true the session data will be loaded from the store again.
|
||||
* @return array An array of session data.
|
||||
*/
|
||||
protected function get_session_data($force = false) {
|
||||
if ($this->sessionid === null) {
|
||||
$this->sessionid = session_id();
|
||||
}
|
||||
if (is_array($this->session) && !$force) {
|
||||
return $this->session;
|
||||
}
|
||||
$session = parent::get($this->sessionid);
|
||||
if ($session === false) {
|
||||
$session = array();
|
||||
}
|
||||
// We have to write here to ensure that the lastaccess time is recorded.
|
||||
// And also in order to ensure the session entry exists as when we save it on __destruct
|
||||
// $CFG is likely to have already been destroyed.
|
||||
$this->save_session($session);
|
||||
return $this->session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the session data.
|
||||
*
|
||||
* This function also updates the last access time.
|
||||
*
|
||||
* @param array $session
|
||||
* @return bool
|
||||
*/
|
||||
protected function save_session(array $session) {
|
||||
$session['lastaccess'] = time();
|
||||
$this->session = $session;
|
||||
return parent::set($this->sessionid, $this->session);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value for the given key from the cache.
|
||||
*
|
||||
* @param string|int $key The key for the data being requested.
|
||||
* It can be any structure although using a scalar string or int is recommended in the interests of performance.
|
||||
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
|
||||
* @param int $strictness One of IGNORE_MISSING | MUST_EXIST
|
||||
* @return mixed|false The data from the cache or false if the key did not exist within the cache.
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
public function get($key, $strictness = IGNORE_MISSING) {
|
||||
// Check the tracked user.
|
||||
$this->check_tracked_user();
|
||||
// 2. Parse the key.
|
||||
$parsedkey = $this->parse_key($key);
|
||||
// 3. Get it from the store.
|
||||
$result = false;
|
||||
$session = $this->get_session_data();
|
||||
if (array_key_exists($parsedkey, $session)) {
|
||||
$result = $session[$parsedkey];
|
||||
if ($result instanceof cache_ttl_wrapper) {
|
||||
if ($result->has_expired()) {
|
||||
$this->get_store()->delete($parsedkey);
|
||||
$result = false;
|
||||
} else {
|
||||
$result = $result->data;
|
||||
}
|
||||
}
|
||||
if ($result instanceof cache_cached_object) {
|
||||
$result = $result->restore_object();
|
||||
}
|
||||
}
|
||||
// 4. Load if from the loader/datasource if we don't already have it.
|
||||
$setaftervalidation = false;
|
||||
if ($result === false) {
|
||||
if ($this->perfdebug) {
|
||||
cache_helper::record_cache_miss('**static session**', $this->get_definition()->get_id());
|
||||
}
|
||||
if ($this->get_loader() !== false) {
|
||||
// We must pass the original (unparsed) key to the next loader in the chain.
|
||||
// The next loader will parse the key as it sees fit. It may be parsed differently
|
||||
// depending upon the capabilities of the store associated with the loader.
|
||||
$result = $this->get_loader()->get($key);
|
||||
} else if ($this->get_datasource() !== false) {
|
||||
$result = $this->get_datasource()->load_for_cache($key);
|
||||
}
|
||||
$setaftervalidation = ($result !== false);
|
||||
} else if ($this->perfdebug) {
|
||||
cache_helper::record_cache_hit('**static session**', $this->get_definition()->get_id());
|
||||
}
|
||||
// 5. Validate strictness.
|
||||
if ($strictness === MUST_EXIST && $result === false) {
|
||||
throw new moodle_exception('Requested key did not exist in any cache stores and could not be loaded.');
|
||||
}
|
||||
// 6. Set it to the store if we got it from the loader/datasource.
|
||||
if ($setaftervalidation) {
|
||||
$this->set($key, $result);
|
||||
}
|
||||
// 7. Make sure we don't pass back anything that could be a reference.
|
||||
// We don't want people modifying the data in the cache.
|
||||
if (!is_scalar($result)) {
|
||||
// If data is an object it will be a reference.
|
||||
// If data is an array if may contain references.
|
||||
// We want to break references so that the cache cannot be modified outside of itself.
|
||||
// Call the function to unreference it (in the best way possible).
|
||||
$result = $this->unref($result);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a key => value pair to the cache.
|
||||
*
|
||||
* <code>
|
||||
* // This code will add four entries to the cache, one for each url.
|
||||
* $cache->set('main', 'http://moodle.org');
|
||||
* $cache->set('docs', 'http://docs.moodle.org');
|
||||
* $cache->set('tracker', 'http://tracker.moodle.org');
|
||||
* $cache->set('qa', 'http://qa.moodle.net');
|
||||
* </code>
|
||||
*
|
||||
* @param string|int $key The key for the data being requested.
|
||||
* It can be any structure although using a scalar string or int is recommended in the interests of performance.
|
||||
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
|
||||
* @param mixed $data The data to set against the key.
|
||||
* @return bool True on success, false otherwise.
|
||||
*/
|
||||
public function set($key, $data) {
|
||||
$this->check_tracked_user();
|
||||
if ($this->perfdebug) {
|
||||
cache_helper::record_cache_set('**static session**', $this->get_definition()->get_id());
|
||||
}
|
||||
if (is_object($data) && $data instanceof cacheable_object) {
|
||||
$data = new cache_cached_object($data);
|
||||
} else if (!is_scalar($data)) {
|
||||
// If data is an object it will be a reference.
|
||||
// If data is an array if may contain references.
|
||||
// We want to break references so that the cache cannot be modified outside of itself.
|
||||
// Call the function to unreference it (in the best way possible).
|
||||
$data = $this->unref($data);
|
||||
}
|
||||
// We dont' support native TTL here as we consolidate data for sessions.
|
||||
if ($this->has_a_ttl()) {
|
||||
$data = new cache_ttl_wrapper($data, $this->get_definition()->get_ttl());
|
||||
}
|
||||
$session = $this->get_session_data();
|
||||
$session[$this->parse_key($key)] = $data;
|
||||
return $this->save_session($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given key from the cache.
|
||||
*
|
||||
* @param string|int $key The key to delete.
|
||||
* @param bool $recurse When set to true the key will also be deleted from all stacked cache loaders and their stores.
|
||||
* This happens by default and ensure that all the caches are consistent. It is NOT recommended to change this.
|
||||
* @return bool True of success, false otherwise.
|
||||
*/
|
||||
public function delete($key, $recurse = true) {
|
||||
$this->check_tracked_user();
|
||||
$parsedkey = $this->parse_key($key);
|
||||
if ($recurse && $this->get_loader() !== false) {
|
||||
// Delete from the bottom of the stack first.
|
||||
$this->get_loader()->delete($key, $recurse);
|
||||
}
|
||||
$session = $this->get_session_data();
|
||||
unset($session[$parsedkey]);
|
||||
return $this->save_session($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an array of values for an array of keys.
|
||||
*
|
||||
* Using this function comes with potential performance implications.
|
||||
* Not all cache stores will support get_many/set_many operations and in order to replicate this functionality will call
|
||||
* the equivalent singular method for each item provided.
|
||||
* This should not deter you from using this function as there is a performance benefit in situations where the cache store
|
||||
* does support it, but you should be aware of this fact.
|
||||
*
|
||||
* @param array $keys The keys of the data being requested.
|
||||
* Each key can be any structure although using a scalar string or int is recommended in the interests of performance.
|
||||
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
|
||||
* @param int $strictness One of IGNORE_MISSING or MUST_EXIST.
|
||||
* @return array An array of key value pairs for the items that could be retrieved from the cache.
|
||||
* If MUST_EXIST was used and not all keys existed within the cache then an exception will be thrown.
|
||||
* Otherwise any key that did not exist will have a data value of false within the results.
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
|
||||
$this->check_tracked_user();
|
||||
$return = array();
|
||||
foreach ($keys as $key) {
|
||||
$return[$key] = $this->get($key, $strictness);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all of the given keys from the cache.
|
||||
*
|
||||
* @param array $keys The key to delete.
|
||||
* @param bool $recurse When set to true the key will also be deleted from all stacked cache loaders and their stores.
|
||||
* This happens by default and ensure that all the caches are consistent. It is NOT recommended to change this.
|
||||
* @return int The number of items successfully deleted.
|
||||
*/
|
||||
public function delete_many(array $keys, $recurse = true) {
|
||||
$this->check_tracked_user();
|
||||
$parsedkeys = array_map(array($this, 'parse_key'), $keys);
|
||||
if ($recurse && $this->get_loader() !== false) {
|
||||
// Delete from the bottom of the stack first.
|
||||
$this->get_loader()->delete_many($keys, $recurse);
|
||||
}
|
||||
$session = $this->get_session_data();
|
||||
foreach ($parsedkeys as $parsedkey) {
|
||||
unset($session[$parsedkey]);
|
||||
}
|
||||
$this->save_session($session);
|
||||
return count($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends several key => value pairs to the cache.
|
||||
*
|
||||
* Using this function comes with potential performance implications.
|
||||
* Not all cache stores will support get_many/set_many operations and in order to replicate this functionality will call
|
||||
* the equivalent singular method for each item provided.
|
||||
* This should not deter you from using this function as there is a performance benefit in situations where the cache store
|
||||
* does support it, but you should be aware of this fact.
|
||||
*
|
||||
* <code>
|
||||
* // This code will add four entries to the cache, one for each url.
|
||||
* $cache->set_many(array(
|
||||
* 'main' => 'http://moodle.org',
|
||||
* 'docs' => 'http://docs.moodle.org',
|
||||
* 'tracker' => 'http://tracker.moodle.org',
|
||||
* 'qa' => ''http://qa.moodle.net'
|
||||
* ));
|
||||
* </code>
|
||||
*
|
||||
* @param array $keyvaluearray An array of key => value pairs to send to the cache.
|
||||
* @return int The number of items successfully set. It is up to the developer to check this matches the number of items.
|
||||
* ... if they care that is.
|
||||
*/
|
||||
public function set_many(array $keyvaluearray) {
|
||||
$this->check_tracked_user();
|
||||
$session = $this->get_session_data();
|
||||
$simulatettl = $this->has_a_ttl();
|
||||
foreach ($keyvaluearray as $key => $value) {
|
||||
if (is_object($value) && $value instanceof cacheable_object) {
|
||||
$value = new cache_cached_object($value);
|
||||
} else if (!is_scalar($value)) {
|
||||
// If data is an object it will be a reference.
|
||||
// If data is an array if may contain references.
|
||||
// We want to break references so that the cache cannot be modified outside of itself.
|
||||
// Call the function to unreference it (in the best way possible).
|
||||
$value = $this->unref($value);
|
||||
}
|
||||
if ($simulatettl) {
|
||||
$value = new cache_ttl_wrapper($value, $this->get_definition()->get_ttl());
|
||||
}
|
||||
$parsedkey = $this->parse_key($key);
|
||||
$session[$parsedkey] = $value;
|
||||
}
|
||||
if ($this->perfdebug) {
|
||||
cache_helper::record_cache_set($this->storetype, $this->get_definition()->get_id());
|
||||
}
|
||||
$this->save_session($session);
|
||||
return count($keyvaluearray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Purges the cache store, and loader if there is one.
|
||||
*
|
||||
* @return bool True on success, false otherwise
|
||||
*/
|
||||
public function purge() {
|
||||
// 1. Purge the session object.
|
||||
$this->session = array();
|
||||
// 2. Delete the record for this users session from the store.
|
||||
$this->get_store()->delete($this->sessionid);
|
||||
// 3. Optionally purge any stacked loaders in the same way.
|
||||
if ($this->get_loader()) {
|
||||
$this->get_loader()->delete($this->sessionid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test is a cache has a key.
|
||||
*
|
||||
* The use of the has methods is strongly discouraged. In a high load environment the cache may well change between the
|
||||
* test and any subsequent action (get, set, delete etc).
|
||||
* Instead it is recommended to write your code in such a way they it performs the following steps:
|
||||
* <ol>
|
||||
* <li>Attempt to retrieve the information.</li>
|
||||
* <li>Generate the information.</li>
|
||||
* <li>Attempt to set the information</li>
|
||||
* </ol>
|
||||
*
|
||||
* Its also worth mentioning that not all stores support key tests.
|
||||
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
|
||||
* Just one more reason you should not use these methods unless you have a very good reason to do so.
|
||||
*
|
||||
* @param string|int $key
|
||||
* @param bool $tryloadifpossible If set to true, the cache doesn't contain the key, and there is another cache loader or
|
||||
* data source then the code will try load the key value from the next item in the chain.
|
||||
* @return bool True if the cache has the requested key, false otherwise.
|
||||
*/
|
||||
public function has($key, $tryloadifpossible = false) {
|
||||
$this->check_tracked_user();
|
||||
$parsedkey = $this->parse_key($key);
|
||||
$session = $this->get_session_data();
|
||||
$has = false;
|
||||
if ($this->has_a_ttl()) {
|
||||
// The data has a TTL and the store doesn't support it natively.
|
||||
// We must fetch the data and expect a ttl wrapper.
|
||||
if (array_key_exists($parsedkey, $session)) {
|
||||
$data = $session[$parsedkey];
|
||||
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
|
||||
}
|
||||
} else {
|
||||
$has = array_key_exists($parsedkey, $session);
|
||||
}
|
||||
if (!$has && $tryloadifpossible) {
|
||||
if ($this->get_loader() !== false) {
|
||||
$result = $this->get_loader()->get($key);
|
||||
} else if ($this->get_datasource() !== null) {
|
||||
$result = $this->get_datasource()->load_for_cache($key);
|
||||
}
|
||||
$has = ($result !== null);
|
||||
if ($has) {
|
||||
$this->set($key, $result);
|
||||
}
|
||||
}
|
||||
return $has;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test is a cache has all of the given keys.
|
||||
*
|
||||
* It is strongly recommended to avoid the use of this function if not absolutely required.
|
||||
* In a high load environment the cache may well change between the test and any subsequent action (get, set, delete etc).
|
||||
*
|
||||
* Its also worth mentioning that not all stores support key tests.
|
||||
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
|
||||
* Just one more reason you should not use these methods unless you have a very good reason to do so.
|
||||
*
|
||||
* @param array $keys
|
||||
* @return bool True if the cache has all of the given keys, false otherwise.
|
||||
*/
|
||||
public function has_all(array $keys) {
|
||||
$this->check_tracked_user();
|
||||
$session = $this->get_session_data();
|
||||
foreach ($keys as $key) {
|
||||
$has = false;
|
||||
$parsedkey = $this->parse_key($key);
|
||||
if ($this->has_a_ttl()) {
|
||||
// The data has a TTL and the store doesn't support it natively.
|
||||
// We must fetch the data and expect a ttl wrapper.
|
||||
if (array_key_exists($parsedkey, $session)) {
|
||||
$data = $session[$parsedkey];
|
||||
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
|
||||
}
|
||||
} else {
|
||||
$has = array_key_exists($parsedkey, $session);
|
||||
}
|
||||
if (!$has) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if a cache has at least one of the given keys.
|
||||
*
|
||||
* It is strongly recommended to avoid the use of this function if not absolutely required.
|
||||
* In a high load environment the cache may well change between the test and any subsequent action (get, set, delete etc).
|
||||
*
|
||||
* Its also worth mentioning that not all stores support key tests.
|
||||
* For stores that don't support key tests this functionality is mimicked by using the equivalent get method.
|
||||
* Just one more reason you should not use these methods unless you have a very good reason to do so.
|
||||
*
|
||||
* @param array $keys
|
||||
* @return bool True if the cache has at least one of the given keys
|
||||
*/
|
||||
public function has_any(array $keys) {
|
||||
$this->check_tracked_user();
|
||||
$session = $this->get_session_data();
|
||||
foreach ($keys as $key) {
|
||||
$has = false;
|
||||
$parsedkey = $this->parse_key($key);
|
||||
if ($this->has_a_ttl()) {
|
||||
// The data has a TTL and the store doesn't support it natively.
|
||||
// We must fetch the data and expect a ttl wrapper.
|
||||
if (array_key_exists($parsedkey, $session)) {
|
||||
$data = $session[$parsedkey];
|
||||
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
|
||||
}
|
||||
} else {
|
||||
$has = array_key_exists($parsedkey, $session);
|
||||
}
|
||||
if ($has) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The session loader never uses the persist cache.
|
||||
* Instead it stores things in the static $session variable. Shared between all session loaders.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function is_using_persist_cache() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+14
@@ -110,6 +110,11 @@ abstract class cache_store implements cache_store_interface {
|
||||
*/
|
||||
const SUPPORTS_NATIVE_TTL = 4;
|
||||
|
||||
/**
|
||||
* The cache is searchable by key.
|
||||
*/
|
||||
const IS_SEARCHABLE = 8;
|
||||
|
||||
// Constants for the modes of a cache store
|
||||
|
||||
/**
|
||||
@@ -307,6 +312,15 @@ abstract class cache_store implements cache_store_interface {
|
||||
return $this::get_supported_features() & self::SUPPORTS_NATIVE_TTL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the store instance is searchable.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_searchable() {
|
||||
return in_array('cache_is_searchable', class_implements($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of this store instance ready to be initialised.
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -197,7 +197,7 @@ class cache_mode_mappings_form extends moodleform {
|
||||
);
|
||||
foreach ($stores as $storename => $store) {
|
||||
foreach ($store['modes'] as $mode => $enabled) {
|
||||
if ($enabled) {
|
||||
if ($enabled && ($mode !== cache_store::MODE_SESSION || $store['supports']['searchable'])) {
|
||||
if (empty($store['default'])) {
|
||||
$options[$mode][$storename] = $store['name'];
|
||||
} else {
|
||||
@@ -214,4 +214,4 @@ class cache_mode_mappings_form extends moodleform {
|
||||
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+54
-32
@@ -330,42 +330,11 @@ class cache_config_writer extends cache_config {
|
||||
* Returns a configuration array if it could not be saved. This is a bad situation. Check your error logs.
|
||||
*/
|
||||
public static function create_default_configuration() {
|
||||
global $CFG;
|
||||
|
||||
// HACK ALERT.
|
||||
// We probably need to come up with a better way to create the default stores, or at least ensure 100% that the
|
||||
// default store plugins are protected from deletion.
|
||||
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
|
||||
require_once($CFG->dirroot.'/cache/stores/session/lib.php');
|
||||
require_once($CFG->dirroot.'/cache/stores/static/lib.php');
|
||||
|
||||
$writer = new self;
|
||||
$writer->configstores = array(
|
||||
'default_application' => array(
|
||||
'name' => 'default_application',
|
||||
'plugin' => 'file',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_file::get_supported_features(),
|
||||
'modes' => cache_store::MODE_APPLICATION,
|
||||
'default' => true,
|
||||
),
|
||||
'default_session' => array(
|
||||
'name' => 'default_session',
|
||||
'plugin' => 'session',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_session::get_supported_features(),
|
||||
'modes' => cache_store::MODE_SESSION,
|
||||
'default' => true,
|
||||
),
|
||||
'default_request' => array(
|
||||
'name' => 'default_request',
|
||||
'plugin' => 'static',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_static::get_supported_features(),
|
||||
'modes' => cache_store::MODE_REQUEST,
|
||||
'default' => true,
|
||||
)
|
||||
);
|
||||
$writer->configstores = self::get_default_stores();
|
||||
$writer->configdefinitions = self::locate_definitions();
|
||||
$writer->configmodemappings = array(
|
||||
array(
|
||||
@@ -404,6 +373,58 @@ class cache_config_writer extends cache_config {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of default stores for use.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function get_default_stores() {
|
||||
global $CFG;
|
||||
|
||||
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
|
||||
require_once($CFG->dirroot.'/cache/stores/session/lib.php');
|
||||
require_once($CFG->dirroot.'/cache/stores/static/lib.php');
|
||||
|
||||
return array(
|
||||
'default_application' => array(
|
||||
'name' => 'default_application',
|
||||
'plugin' => 'file',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_file::get_supported_features(),
|
||||
'modes' => cachestore_file::get_supported_modes(),
|
||||
'default' => true,
|
||||
),
|
||||
'default_session' => array(
|
||||
'name' => 'default_session',
|
||||
'plugin' => 'session',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_session::get_supported_features(),
|
||||
'modes' => cachestore_session::get_supported_modes(),
|
||||
'default' => true,
|
||||
),
|
||||
'default_request' => array(
|
||||
'name' => 'default_request',
|
||||
'plugin' => 'static',
|
||||
'configuration' => array(),
|
||||
'features' => cachestore_static::get_supported_features(),
|
||||
'modes' => cachestore_static::get_supported_modes(),
|
||||
'default' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the default stores within the MUC config file.
|
||||
*/
|
||||
public static function update_default_config_stores() {
|
||||
$factory = cache_factory::instance();
|
||||
$factory->updating_started();
|
||||
$config = $factory->create_config_instance(true);
|
||||
$config->configstores = array_merge($config->configstores, self::get_default_stores());
|
||||
$config->config_save();
|
||||
$factory->updating_finished();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the definition in the configuration from those found in the cache files.
|
||||
*
|
||||
@@ -581,6 +602,7 @@ abstract class cache_administration_helper extends cache_helper {
|
||||
'nativettl' => $store->supports_native_ttl(),
|
||||
'nativelocking' => ($store instanceof cache_is_lockable),
|
||||
'keyawareness' => ($store instanceof cache_is_key_aware),
|
||||
'searchable' => ($store instanceof cache_is_searchable)
|
||||
)
|
||||
);
|
||||
if (empty($details['default'])) {
|
||||
|
||||
Vendored
+57
-6
@@ -37,7 +37,7 @@
|
||||
* @copyright 2012 Sam Hemelryk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class cachestore_file extends cache_store implements cache_is_key_aware, cache_is_configurable {
|
||||
class cachestore_file extends cache_store implements cache_is_key_aware, cache_is_configurable, cache_is_searchable {
|
||||
|
||||
/**
|
||||
* The name of the store.
|
||||
@@ -190,10 +190,22 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
|
||||
*/
|
||||
public static function get_supported_features(array $configuration = array()) {
|
||||
$supported = self::SUPPORTS_DATA_GUARANTEE +
|
||||
self::SUPPORTS_NATIVE_TTL;
|
||||
self::SUPPORTS_NATIVE_TTL +
|
||||
self::IS_SEARCHABLE;
|
||||
return $supported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as this store does not support multiple identifiers.
|
||||
* (This optional function is a performance optimisation; it must be
|
||||
* consistent with the value from get_supported_features.)
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the supported modes as a combined int.
|
||||
*
|
||||
@@ -257,13 +269,15 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
|
||||
|
||||
/**
|
||||
* Gets a pattern suitable for use with glob to find all keys in the cache.
|
||||
*
|
||||
* @param string $prefix A prefix to use.
|
||||
* @return string The pattern.
|
||||
*/
|
||||
protected function glob_keys_pattern() {
|
||||
protected function glob_keys_pattern($prefix = '') {
|
||||
if ($this->singledirectory) {
|
||||
return $this->path . '/*.cache';
|
||||
return $this->path . '/'.$prefix.'*.cache';
|
||||
} else {
|
||||
return $this->path . '/*/*.cache';
|
||||
return $this->path . '/*/'.$prefix.'*.cache';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +379,6 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
|
||||
public function delete($key) {
|
||||
$filename = $key.'.cache';
|
||||
$file = $this->file_path_for_key($key);
|
||||
|
||||
if (@unlink($file)) {
|
||||
unset($this->keys[$filename]);
|
||||
return true;
|
||||
@@ -687,4 +700,42 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
|
||||
public function my_name() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all of the keys being used by this cache store instance.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function find_all() {
|
||||
$this->ensure_path_exists();
|
||||
$files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
|
||||
$return = array();
|
||||
if ($files === false) {
|
||||
return $return;
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
$return[] = substr(basename($file), 0, -6);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all of the keys whose keys start with the given prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*/
|
||||
public function find_by_prefix($prefix) {
|
||||
$this->ensure_path_exists();
|
||||
$prefix = preg_replace('#(\*|\?|\[)#', '[$1]', $prefix);
|
||||
$files = glob($this->glob_keys_pattern($prefix), GLOB_MARK | GLOB_NOSORT);
|
||||
$return = array();
|
||||
if ($files === false) {
|
||||
return $return;
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
// Trim off ".cache" from the end.
|
||||
$return[] = substr(basename($file), 0, -6);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -46,5 +46,11 @@ class cachestore_memcache_addinstance_form extends cachestore_addinstance_form {
|
||||
$form->addHelpButton('servers', 'servers', 'cachestore_memcache');
|
||||
$form->addRule('servers', get_string('required'), 'required');
|
||||
$form->setType('servers', PARAM_RAW);
|
||||
|
||||
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcache'),
|
||||
array('maxlength' => 5, 'size' => 5));
|
||||
$form->addHelpButton('prefix', 'prefix', 'cachestore_memcache');
|
||||
$form->setType('prefix', PARAM_ALPHAEXT);
|
||||
$form->setDefault('prefix', 'mdl_');
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,10 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['pluginname'] = 'Memcache';
|
||||
$string['prefix'] = 'Key prefix';
|
||||
$string['prefix_help'] = 'This prefix is used for all key names on the memcache server.
|
||||
* If you only have one Moodle instance using this server, you can leave this value default.
|
||||
* Due to key length restrictions, a maximum of 5 characters is permitted.';
|
||||
$string['servers'] = 'Servers';
|
||||
$string['servers_help'] = 'This sets the servers that should be utilised by this memcache adapter.
|
||||
Servers should be defined one per line and consist of a server address and optionally a port and weight.
|
||||
|
||||
Vendored
+36
-1
@@ -51,6 +51,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
*/
|
||||
protected $connection;
|
||||
|
||||
/**
|
||||
* Key prefix for this memcache.
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix;
|
||||
|
||||
/**
|
||||
* An array of servers to use in the connection args.
|
||||
* @var array
|
||||
@@ -81,6 +87,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
*/
|
||||
protected $definition;
|
||||
|
||||
/**
|
||||
* Default prefix for key names.
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_PREFIX = 'mdl_';
|
||||
|
||||
/**
|
||||
* Constructs the store instance.
|
||||
*
|
||||
@@ -111,6 +123,11 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
}
|
||||
$this->servers[] = $server;
|
||||
}
|
||||
if (empty($configuration['prefix'])) {
|
||||
$this->prefix = self::DEFAULT_PREFIX;
|
||||
} else {
|
||||
$this->prefix = $configuration['prefix'];
|
||||
}
|
||||
|
||||
$this->connection = new Memcache;
|
||||
foreach ($this->servers as $server) {
|
||||
@@ -181,6 +198,17 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
return self::SUPPORTS_NATIVE_TTL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as this store does not support multiple identifiers.
|
||||
* (This optional function is a performance optimisation; it must be
|
||||
* consistent with the value from get_supported_features.)
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the supported modes as a combined int.
|
||||
*
|
||||
@@ -201,7 +229,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
if (strlen($key) > 245) {
|
||||
$key = '_sha1_'.sha1($key);
|
||||
}
|
||||
$key = 'mdl_'.$key;
|
||||
$key = $this->prefix . $key;
|
||||
return $key;
|
||||
}
|
||||
|
||||
@@ -327,6 +355,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
}
|
||||
return array(
|
||||
'servers' => $servers,
|
||||
'prefix' => $data->prefix,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -345,6 +374,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
}
|
||||
$data['servers'] = join("\n", $servers);
|
||||
}
|
||||
if (!empty($config['prefix'])) {
|
||||
$data['prefix'] = $config['prefix'];
|
||||
} else {
|
||||
$data['prefix'] = self::DEFAULT_PREFIX;
|
||||
}
|
||||
|
||||
$editform->set_data($data);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -26,6 +26,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2012112900; // The current module version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current module version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version.
|
||||
$plugin->component = 'cachestore_memcache'; // Full name of the plugin.
|
||||
$plugin->component = 'cachestore_memcache'; // Full name of the plugin.
|
||||
|
||||
Vendored
+11
@@ -205,6 +205,17 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
|
||||
return self::SUPPORTS_NATIVE_TTL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as this store does not support multiple identifiers.
|
||||
* (This optional function is a performance optimisation; it must be
|
||||
* consistent with the value from get_supported_features.)
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the supported modes as a combined int.
|
||||
*
|
||||
|
||||
Vendored
+38
-2
@@ -90,7 +90,7 @@ abstract class session_data_store extends cache_store {
|
||||
* @copyright 2012 Sam Hemelryk
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class cachestore_session extends session_data_store implements cache_is_key_aware {
|
||||
class cachestore_session extends session_data_store implements cache_is_key_aware, cache_is_searchable {
|
||||
|
||||
/**
|
||||
* The name of the store
|
||||
@@ -137,7 +137,19 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
|
||||
*/
|
||||
public static function get_supported_features(array $configuration = array()) {
|
||||
return self::SUPPORTS_DATA_GUARANTEE +
|
||||
self::SUPPORTS_NATIVE_TTL;
|
||||
self::SUPPORTS_NATIVE_TTL +
|
||||
self::IS_SEARCHABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as this store does not support multiple identifiers.
|
||||
* (This optional function is a performance optimisation; it must be
|
||||
* consistent with the value from get_supported_features.)
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -400,4 +412,28 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
|
||||
public function my_name() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all of the keys being stored in the cache store instance.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function find_all() {
|
||||
return array_keys($this->store);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all of the keys whose keys start with the given prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*/
|
||||
public function find_by_prefix($prefix) {
|
||||
$return = array();
|
||||
foreach ($this->find_all() as $key) {
|
||||
if (strpos($key, $prefix) === 0) {
|
||||
$return[] = $key;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -136,6 +136,17 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
|
||||
self::SUPPORTS_NATIVE_TTL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as this store does not support multiple identifiers.
|
||||
* (This optional function is a performance optimisation; it must be
|
||||
* consistent with the value from get_supported_features.)
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public function supports_multiple_identifiers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the supported modes as a combined int.
|
||||
*
|
||||
|
||||
Vendored
+382
-2
@@ -126,6 +126,18 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'phpunit', 'applicationtest');
|
||||
$this->assertInstanceOf('cache_application', $cache);
|
||||
$this->run_on_cache($cache);
|
||||
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/test_default_application_cache', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'test_default_application_cache',
|
||||
'persistent' => true,
|
||||
'persistentmaxsize' => 1
|
||||
));
|
||||
$cache = cache::make('phpunit', 'test_default_application_cache');
|
||||
$this->assertInstanceOf('cache_application', $cache);
|
||||
$this->run_on_cache($cache);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,6 +250,18 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertTrue($cache->delete('key1'));
|
||||
$this->assertTrue($cache->delete('key2'));
|
||||
|
||||
$cache->set_many(array(
|
||||
'key1' => array(1, 2, 3),
|
||||
'key2' => array(3, 2, 1),
|
||||
));
|
||||
$this->assertInternalType('array', $cache->get('key1'));
|
||||
$this->assertInternalType('array', $cache->get('key2'));
|
||||
$this->assertCount(3, $cache->get('key1'));
|
||||
$this->assertCount(3, $cache->get('key2'));
|
||||
$this->assertInternalType('array', $cache->get_many(array('key1', 'key2')));
|
||||
$this->assertCount(2, $cache->get_many(array('key1', 'key2')));
|
||||
$this->assertEquals(2, $cache->delete_many(array('key1', 'key2')));
|
||||
|
||||
// Test delete many.
|
||||
$this->assertTrue($cache->set('key1', 'data1'));
|
||||
$this->assertTrue($cache->set('key2', 'data2'));
|
||||
@@ -316,6 +340,27 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertEquals('value', $var2->key);
|
||||
|
||||
$this->assertTrue($cache->delete('obj'));
|
||||
|
||||
// Test strictness exceptions.
|
||||
try {
|
||||
$cache->get('exception', MUST_EXIST);
|
||||
$this->fail('Exception expected from cache::get using MUST_EXIST');
|
||||
} catch (Exception $e) {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
try {
|
||||
$cache->get_many(array('exception1', 'exception2'), MUST_EXIST);
|
||||
$this->fail('Exception expected from cache::get_many using MUST_EXIST');
|
||||
} catch (Exception $e) {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
$cache->set('test', 'test');
|
||||
try {
|
||||
$cache->get_many(array('test', 'exception'), MUST_EXIST);
|
||||
$this->fail('Exception expected from cache::get_many using MUST_EXIST');
|
||||
} catch (Exception $e) {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,13 +383,25 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertTrue($cache->purge());
|
||||
// It won't be there yet.
|
||||
$this->assertFalse($cache->has('Test'));
|
||||
|
||||
// It should load it ;).
|
||||
$this->assertTrue($cache->has('Test', true));
|
||||
|
||||
// Purge it to be sure.
|
||||
$this->assertTrue($cache->purge());
|
||||
$this->assertEquals('Test has no value really.', $cache->get('Test'));
|
||||
|
||||
// Test multiple values.
|
||||
$this->assertTrue($cache->purge());
|
||||
$this->assertTrue($cache->set('b', 'B'));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertEquals('a has no value really.', $result['a']);
|
||||
$this->assertEquals('B', $result['b']);
|
||||
$this->assertEquals('c has no value really.', $result['c']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,7 +473,10 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertEquals('test data 2', $cache->get('2'));
|
||||
}
|
||||
|
||||
public function test_definition_ttl() {
|
||||
/**
|
||||
* Test a negative TTL on an application cache.
|
||||
*/
|
||||
public function test_application_ttl_negative() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
@@ -437,6 +497,127 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertFalse($cache->has('Test'));
|
||||
// Double check by trying to get it.
|
||||
$this->assertFalse($cache->get('Test'));
|
||||
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertFalse($result['a']);
|
||||
$this->assertFalse($result['b']);
|
||||
$this->assertFalse($result['c']);
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertArrayHasKey('e', $result);
|
||||
$this->assertFalse($result['a']);
|
||||
$this->assertFalse($result['c']);
|
||||
$this->assertFalse($result['e']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a positive TTL on an application cache.
|
||||
*/
|
||||
public function test_application_ttl_positive() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'ttltest',
|
||||
'ttl' => 86400 // Set to a day in the future to be extra sure.
|
||||
));
|
||||
$cache = cache::make('phpunit', 'ttltest');
|
||||
$this->assertInstanceOf('cache_application', $cache);
|
||||
|
||||
// Purge it to be sure.
|
||||
$this->assertTrue($cache->purge());
|
||||
// It won't be there yet.
|
||||
$this->assertFalse($cache->has('Test'));
|
||||
// Set it now.
|
||||
$this->assertTrue($cache->set('Test', 'Test'));
|
||||
// Check its there.
|
||||
$this->assertTrue($cache->has('Test'));
|
||||
// Double check by trying to get it.
|
||||
$this->assertEquals('Test', $cache->get('Test'));
|
||||
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertEquals('A', $result['a']);
|
||||
$this->assertEquals('B', $result['b']);
|
||||
$this->assertEquals('C', $result['c']);
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertArrayHasKey('e', $result);
|
||||
$this->assertEquals('A', $result['a']);
|
||||
$this->assertEquals('C', $result['c']);
|
||||
$this->assertEquals(false, $result['e']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a negative TTL on an session cache.
|
||||
*/
|
||||
public function test_session_ttl_positive() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/ttltest', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'ttltest',
|
||||
'ttl' => 86400 // Set to a day in the future to be extra sure.
|
||||
));
|
||||
$cache = cache::make('phpunit', 'ttltest');
|
||||
$this->assertInstanceOf('cache_session', $cache);
|
||||
|
||||
// Purge it to be sure.
|
||||
$this->assertTrue($cache->purge());
|
||||
// It won't be there yet.
|
||||
$this->assertFalse($cache->has('Test'));
|
||||
// Set it now.
|
||||
$this->assertTrue($cache->set('Test', 'Test'));
|
||||
// Check its there.
|
||||
$this->assertTrue($cache->has('Test'));
|
||||
// Double check by trying to get it.
|
||||
$this->assertEquals('Test', $cache->get('Test'));
|
||||
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertEquals('A', $result['a']);
|
||||
$this->assertEquals('B', $result['b']);
|
||||
$this->assertEquals('C', $result['c']);
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertArrayHasKey('e', $result);
|
||||
$this->assertEquals('A', $result['a']);
|
||||
$this->assertEquals('C', $result['c']);
|
||||
$this->assertEquals(false, $result['e']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,6 +684,42 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertFalse($cache->get('testkey2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests session cache event invalidation
|
||||
*/
|
||||
public function test_session_event_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance->phpunit_add_definition('phpunit/test_session_event_invalidation', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'test_session_event_invalidation',
|
||||
'invalidationevents' => array(
|
||||
'crazyevent'
|
||||
)
|
||||
));
|
||||
$cache = cache::make('phpunit', 'test_session_event_invalidation');
|
||||
$this->assertInstanceOf('cache_session', $cache);
|
||||
|
||||
$this->assertTrue($cache->set('testkey1', 'test data 1'));
|
||||
$this->assertEquals('test data 1', $cache->get('testkey1'));
|
||||
$this->assertTrue($cache->set('testkey2', 'test data 2'));
|
||||
$this->assertEquals('test data 2', $cache->get('testkey2'));
|
||||
|
||||
// Test invalidating a single entry.
|
||||
cache_helper::invalidate_by_event('crazyevent', array('testkey1'));
|
||||
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
$this->assertEquals('test data 2', $cache->get('testkey2'));
|
||||
|
||||
$this->assertTrue($cache->set('testkey1', 'test data 1'));
|
||||
|
||||
// Test invalidating both entries.
|
||||
cache_helper::invalidate_by_event('crazyevent', array('testkey1', 'testkey2'));
|
||||
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
$this->assertFalse($cache->get('testkey2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests application cache definition invalidation
|
||||
*/
|
||||
@@ -539,6 +756,45 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertFalse($cache->get('testkey2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests session cache definition invalidation
|
||||
*/
|
||||
public function test_session_definition_invalidation() {
|
||||
$instance = cache_config_phpunittest::instance();
|
||||
$instance->phpunit_add_definition('phpunit/test_session_definition_invalidation', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'test_session_definition_invalidation'
|
||||
));
|
||||
$cache = cache::make('phpunit', 'test_session_definition_invalidation');
|
||||
$this->assertInstanceOf('cache_session', $cache);
|
||||
$this->assertTrue($cache->set('testkey1', 'test data 1'));
|
||||
$this->assertEquals('test data 1', $cache->get('testkey1'));
|
||||
$this->assertTrue($cache->set('testkey2', 'test data 2'));
|
||||
$this->assertEquals('test data 2', $cache->get('testkey2'));
|
||||
|
||||
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(), 'testkey1');
|
||||
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
$this->assertEquals('test data 2', $cache->get('testkey2'));
|
||||
|
||||
$this->assertTrue($cache->set('testkey1', 'test data 1'));
|
||||
|
||||
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(),
|
||||
array('testkey1'));
|
||||
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
$this->assertEquals('test data 2', $cache->get('testkey2'));
|
||||
|
||||
$this->assertTrue($cache->set('testkey1', 'test data 1'));
|
||||
|
||||
cache_helper::invalidate_by_definition('phpunit', 'test_session_definition_invalidation', array(),
|
||||
array('testkey1', 'testkey2'));
|
||||
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
$this->assertFalse($cache->get('testkey2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests application cache event invalidation over a distributed setup.
|
||||
*/
|
||||
@@ -848,6 +1104,34 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertFalse($cache->get('test'));
|
||||
$this->assertTrue($cache->set('test', 'test'));
|
||||
$this->assertEquals('test', $cache->get('test'));
|
||||
$this->assertTrue($cache->delete('test'));
|
||||
$this->assertFalse($cache->get('test'));
|
||||
$this->assertTrue($cache->set('test', 'test'));
|
||||
$this->assertTrue($cache->purge());
|
||||
$this->assertFalse($cache->get('test'));
|
||||
|
||||
// Test the many commands.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertEquals('A', $result['a']);
|
||||
$this->assertEquals('B', $result['b']);
|
||||
$this->assertEquals('C', $result['c']);
|
||||
$this->assertEquals($result, $cache->get_many(array('a', 'b', 'c')));
|
||||
$this->assertEquals(2, $cache->delete_many(array('a', 'c')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
$this->assertFalse($result['a']);
|
||||
$this->assertEquals('B', $result['b']);
|
||||
$this->assertFalse($result['c']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -878,6 +1162,76 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertEquals(false, $cache->get('var'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test switching users with session caches.
|
||||
*/
|
||||
public function test_session_cache_switch_user_application_mapping() {
|
||||
$this->resetAfterTest(true);
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_file_store('testfilestore');
|
||||
$instance->phpunit_add_definition('phpunit/testappsession', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'testappsession'
|
||||
));
|
||||
$instance->phpunit_add_definition_mapping('phpunit/testappsession', 'testfilestore', 3);
|
||||
$cache = cache::make('phpunit', 'testappsession');
|
||||
$user1 = $this->getDataGenerator()->create_user();
|
||||
$user2 = $this->getDataGenerator()->create_user();
|
||||
|
||||
// Log in as the first user.
|
||||
$this->setUser($user1);
|
||||
$sesskey1 = sesskey();
|
||||
|
||||
// Set a basic value in the cache.
|
||||
$cache->set('var', 1);
|
||||
$this->assertTrue($cache->has('var'));
|
||||
$this->assertEquals(1, $cache->get('var'));
|
||||
|
||||
// Change to the second user.
|
||||
$this->setUser($user2);
|
||||
$sesskey2 = sesskey();
|
||||
|
||||
// Make sure the cache doesn't give us the data for the last user.
|
||||
$this->assertNotEquals($sesskey1, $sesskey2);
|
||||
$this->assertFalse($cache->has('var'));
|
||||
$this->assertEquals(false, $cache->get('var'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test two session caches being used at once to confirm collisions don't occur.
|
||||
*/
|
||||
public function test_dual_session_caches() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/testsess1', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'testsess1'
|
||||
));
|
||||
$instance->phpunit_add_definition('phpunit/testsess2', array(
|
||||
'mode' => cache_store::MODE_SESSION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'testsess2'
|
||||
));
|
||||
$cache1 = cache::make('phpunit', 'testsess1');
|
||||
$cache2 = cache::make('phpunit', 'testsess2');
|
||||
|
||||
$this->assertFalse($cache1->has('test'));
|
||||
$this->assertFalse($cache2->has('test'));
|
||||
|
||||
$this->assertTrue($cache1->set('test', '1'));
|
||||
|
||||
$this->assertTrue($cache1->has('test'));
|
||||
$this->assertFalse($cache2->has('test'));
|
||||
|
||||
$this->assertTrue($cache2->set('test', '2'));
|
||||
|
||||
$this->assertEquals(1, $cache1->get('test'));
|
||||
$this->assertEquals(2, $cache2->get('test'));
|
||||
|
||||
$this->assertTrue($cache1->delete('test'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test multiple session caches when switching user.
|
||||
*/
|
||||
@@ -908,4 +1262,30 @@ class cache_phpunit_tests extends advanced_testcase {
|
||||
$this->assertEquals(false, $cache1->get('var'));
|
||||
$this->assertEquals(false, $cache2->get('var'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test application locking.
|
||||
*/
|
||||
public function test_application_locking() {
|
||||
$instance = cache_config_phpunittest::instance(true);
|
||||
$instance->phpunit_add_definition('phpunit/test_application_locking', array(
|
||||
'mode' => cache_store::MODE_APPLICATION,
|
||||
'component' => 'phpunit',
|
||||
'area' => 'test_application_locking',
|
||||
'persistent' => true,
|
||||
'persistentmaxsize' => 1,
|
||||
'requirelockingread' => true,
|
||||
'requirelockingwrite' => true
|
||||
));
|
||||
$cache = cache::make('phpunit', 'test_application_locking');
|
||||
$this->assertInstanceOf('cache_application', $cache);
|
||||
|
||||
$this->assertTrue($cache->set('a', 'A'));
|
||||
$this->assertTrue($cache->set('b', 'B'));
|
||||
$this->assertTrue($cache->set('c', 'C'));
|
||||
$this->assertEquals('A', $cache->get('a'));
|
||||
$this->assertEquals(array('b' => 'B', 'c' => 'C'), $cache->get_many(array('b', 'c')));
|
||||
$this->assertTrue($cache->delete('a'));
|
||||
$this->assertFalse($cache->has('a'));
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class cache_config_phpunittest extends cache_config_writer {
|
||||
|
||||
/**
|
||||
* Adds a definition to the stack
|
||||
* @param string $area
|
||||
|
||||
+3
-2
@@ -528,8 +528,9 @@ class comment {
|
||||
$c->timecreated = $u->ctimecreated;
|
||||
$c->strftimeformat = get_string('strftimerecent', 'langconfig');
|
||||
$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
|
||||
$c->profileurl = $url->out(false);
|
||||
$c->profileurl = $url->out(true);
|
||||
$c->fullname = fullname($u);
|
||||
$c->time = userdate($c->timecreated, $c->strftimeformat);
|
||||
$c->content = format_text($c->content, $c->format, $formatoptions);
|
||||
$c->avatar = $OUTPUT->user_picture($u, array('size'=>18));
|
||||
|
||||
@@ -808,7 +809,7 @@ class comment {
|
||||
$replacements[] = $cmt->avatar;
|
||||
$replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname);
|
||||
$replacements[] = $cmt->content;
|
||||
$replacements[] = userdate($cmt->timecreated, $cmt->strftimeformat);
|
||||
$replacements[] = $cmt->time;
|
||||
|
||||
// use html template to format a single comment.
|
||||
return str_replace($patterns, $replacements, $this->template);
|
||||
|
||||
@@ -59,7 +59,7 @@ class completion_criteria_role extends completion_criteria {
|
||||
*/
|
||||
public function config_form_display(&$mform, $data = null) {
|
||||
|
||||
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $data->name);
|
||||
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $this->get_title($data));
|
||||
|
||||
if ($this->id) {
|
||||
$mform->setDefault('criteria_role['.$data->id.']', 1);
|
||||
@@ -122,8 +122,8 @@ class completion_criteria_role extends completion_criteria {
|
||||
*/
|
||||
public function get_title() {
|
||||
global $DB;
|
||||
$role = $DB->get_field('role', 'name', array('id' => $this->role));
|
||||
return $role;
|
||||
$role = $DB->get_record('role', array('id' => $this->role));
|
||||
return role_get_name($role, context_course::instance($this->course));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,8 +132,7 @@ class completion_criteria_role extends completion_criteria {
|
||||
* @return string
|
||||
*/
|
||||
public function get_title_detailed() {
|
||||
global $DB;
|
||||
return $DB->get_field('role', 'name', array('id' => $this->role));
|
||||
return $this->get_title();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,6 +61,12 @@ $context = $PAGE->context;
|
||||
// And the object has been loaded for us no need for another DB call
|
||||
$category = $PAGE->category;
|
||||
|
||||
// This needs to match caps checked in can_edit_in_category below.
|
||||
$PAGE->set_other_editing_capability(array(
|
||||
'moodle/category:manage',
|
||||
'moodle/course:create'
|
||||
));
|
||||
|
||||
$canedit = can_edit_in_category($category->id);
|
||||
if ($canedit) {
|
||||
if ($categoryedit !== -1) {
|
||||
|
||||
@@ -51,7 +51,7 @@ function dndupload_add_to_course($course, $modnames) {
|
||||
// Add the javascript to the page.
|
||||
$jsmodule = array(
|
||||
'name' => 'coursedndupload',
|
||||
'fullpath' => new moodle_url('/course/dndupload.js'),
|
||||
'fullpath' => '/course/dndupload.js',
|
||||
'strings' => array(
|
||||
array('addfilehere', 'moodle'),
|
||||
array('dndworkingfiletextlink', 'moodle'),
|
||||
|
||||
@@ -54,6 +54,7 @@ class editsection_form extends moodleform {
|
||||
|
||||
$mform = $this->_form;
|
||||
$course = $this->_customdata['course'];
|
||||
$context = context_course::instance($course->id);
|
||||
|
||||
if (!empty($CFG->enableavailability)) {
|
||||
$mform->addElement('header', '', get_string('availabilityconditions', 'condition'));
|
||||
@@ -65,7 +66,6 @@ class editsection_form extends moodleform {
|
||||
$options[0] = get_string('none');
|
||||
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id))) {
|
||||
foreach ($groupings as $grouping) {
|
||||
$context = context_course::instance($course->id);
|
||||
$options[$grouping->id] = format_string(
|
||||
$grouping->name, true, array('context' => $context));
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class editsection_form extends moodleform {
|
||||
|
||||
// Conditions based on user fields
|
||||
$operators = condition_info::get_condition_user_field_operators();
|
||||
$useroptions = condition_info::get_condition_user_fields();
|
||||
$useroptions = condition_info::get_condition_user_fields(array('context' => $context));
|
||||
asort($useroptions);
|
||||
|
||||
$useroptions = array(0 => $strcondnone) + $useroptions;
|
||||
|
||||
+58
-53
@@ -108,6 +108,7 @@ class core_course_external extends external_api {
|
||||
$sections = $modinfo->get_section_info_all();
|
||||
|
||||
//for each sections (first displayed to last displayed)
|
||||
$modinfosections = $modinfo->get_sections();
|
||||
foreach ($sections as $key => $section) {
|
||||
|
||||
if (!$section->uservisible) {
|
||||
@@ -125,62 +126,66 @@ class core_course_external extends external_api {
|
||||
$sectioncontents = array();
|
||||
|
||||
//for each module of the section
|
||||
foreach ($modinfo->sections[$section->section] as $cmid) { //matching /course/lib.php:print_section() logic
|
||||
$cm = $modinfo->cms[$cmid];
|
||||
if (!empty($modinfosections[$section->section])) {
|
||||
foreach ($modinfosections[$section->section] as $cmid) {
|
||||
$cm = $modinfo->cms[$cmid];
|
||||
|
||||
// stop here if the module is not visible to the user
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$module = array();
|
||||
|
||||
//common info (for people being able to see the module or availability dates)
|
||||
$module['id'] = $cm->id;
|
||||
$module['name'] = format_string($cm->name, true);
|
||||
$module['modname'] = $cm->modname;
|
||||
$module['modplural'] = $cm->modplural;
|
||||
$module['modicon'] = $cm->get_icon_url()->out(false);
|
||||
$module['indent'] = $cm->indent;
|
||||
|
||||
$modcontext = context_module::instance($cm->id);
|
||||
|
||||
if (!empty($cm->showdescription)) {
|
||||
$module['description'] = $cm->get_content();
|
||||
}
|
||||
|
||||
//url of the module
|
||||
$url = $cm->get_url();
|
||||
if ($url) { //labels don't have url
|
||||
$module['url'] = $cm->get_url()->out();
|
||||
}
|
||||
|
||||
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
|
||||
context_module::instance($cm->id));
|
||||
//user that can view hidden module should know about the visibility
|
||||
$module['visible'] = $cm->visible;
|
||||
|
||||
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
|
||||
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
|
||||
$module['availablefrom'] = $cm->availablefrom;
|
||||
$module['availableuntil'] = $cm->availableuntil;
|
||||
}
|
||||
|
||||
$baseurl = 'webservice/pluginfile.php';
|
||||
|
||||
//call $modulename_export_contents
|
||||
//(each module callback take care about checking the capabilities)
|
||||
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
|
||||
$getcontentfunction = $cm->modname.'_export_contents';
|
||||
if (function_exists($getcontentfunction)) {
|
||||
if ($contents = $getcontentfunction($cm, $baseurl)) {
|
||||
$module['contents'] = $contents;
|
||||
// stop here if the module is not visible to the user
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$module = array();
|
||||
|
||||
//common info (for people being able to see the module or availability dates)
|
||||
$module['id'] = $cm->id;
|
||||
$module['name'] = format_string($cm->name, true);
|
||||
$module['modname'] = $cm->modname;
|
||||
$module['modplural'] = $cm->modplural;
|
||||
$module['modicon'] = $cm->get_icon_url()->out(false);
|
||||
$module['indent'] = $cm->indent;
|
||||
|
||||
$modcontext = context_module::instance($cm->id);
|
||||
|
||||
if (!empty($cm->showdescription) or $cm->modname == 'label') {
|
||||
// We want to use the external format. However from reading get_formatted_content(), get_content() format is always FORMAT_HTML.
|
||||
list($module['description'], $descriptionformat) = external_format_text($cm->get_content(),
|
||||
FORMAT_HTML, $modcontext->id, $cm->modname, 'intro', $cm->id);
|
||||
}
|
||||
|
||||
//url of the module
|
||||
$url = $cm->get_url();
|
||||
if ($url) { //labels don't have url
|
||||
$module['url'] = $cm->get_url()->out();
|
||||
}
|
||||
|
||||
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
|
||||
context_module::instance($cm->id));
|
||||
//user that can view hidden module should know about the visibility
|
||||
$module['visible'] = $cm->visible;
|
||||
|
||||
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
|
||||
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
|
||||
$module['availablefrom'] = $cm->availablefrom;
|
||||
$module['availableuntil'] = $cm->availableuntil;
|
||||
}
|
||||
|
||||
$baseurl = 'webservice/pluginfile.php';
|
||||
|
||||
//call $modulename_export_contents
|
||||
//(each module callback take care about checking the capabilities)
|
||||
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
|
||||
$getcontentfunction = $cm->modname.'_export_contents';
|
||||
if (function_exists($getcontentfunction)) {
|
||||
if ($contents = $getcontentfunction($cm, $baseurl)) {
|
||||
$module['contents'] = $contents;
|
||||
}
|
||||
}
|
||||
|
||||
//assign result to $sectioncontents
|
||||
$sectioncontents[] = $module;
|
||||
|
||||
}
|
||||
|
||||
//assign result to $sectioncontents
|
||||
$sectioncontents[] = $module;
|
||||
|
||||
}
|
||||
$sectionvalues['modules'] = $sectioncontents;
|
||||
|
||||
|
||||
+15
-9
@@ -72,6 +72,8 @@ abstract class format_base {
|
||||
protected $formatoptions = array();
|
||||
/** @var array cached instances */
|
||||
private static $instances = array();
|
||||
/** @var array plugin name => class name. */
|
||||
private static $classesforformat = array('site' => 'site');
|
||||
|
||||
/**
|
||||
* Creates a new instance of class
|
||||
@@ -94,24 +96,28 @@ abstract class format_base {
|
||||
* @return string
|
||||
*/
|
||||
protected static final function get_format_or_default($format) {
|
||||
if ($format === 'site') {
|
||||
return $format;
|
||||
if (array_key_exists($format, self::$classesforformat)) {
|
||||
return self::$classesforformat[$format];
|
||||
}
|
||||
|
||||
$plugins = get_sorted_course_formats();
|
||||
if (in_array($format, $plugins)) {
|
||||
return $format;
|
||||
foreach ($plugins as $plugin) {
|
||||
self::$classesforformat[$plugin] = $plugin;
|
||||
}
|
||||
|
||||
if (array_key_exists($format, self::$classesforformat)) {
|
||||
return self::$classesforformat[$format];
|
||||
}
|
||||
|
||||
// Else return default format
|
||||
$defaultformat = get_config('moodlecourse', 'format');
|
||||
if (!in_array($defaultformat, $plugins)) {
|
||||
// when default format is not set correctly, use the first available format
|
||||
$defaultformat = reset($plugins);
|
||||
}
|
||||
static $warningprinted = array();
|
||||
if (empty($warningprinted[$format])) {
|
||||
debugging('Format plugin format_'.$format.' is not found. Using default format_'.$defaultformat, DEBUG_DEVELOPER);
|
||||
$warningprinted[$format] = true;
|
||||
}
|
||||
debugging('Format plugin format_'.$format.' is not found. Using default format_'.$defaultformat, DEBUG_DEVELOPER);
|
||||
|
||||
self::$classesforformat[$format] = $defaultformat;
|
||||
return $defaultformat;
|
||||
}
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
* @param array $mods (argument not used)
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
private function section_activity_summary($section, $course, $mods) {
|
||||
protected function section_activity_summary($section, $course, $mods) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
if (empty($modinfo->sections[$section->section])) {
|
||||
return '';
|
||||
|
||||
@@ -7,4 +7,3 @@
|
||||
.course-content ul.topics li.section .right {width:40px;text-align:center;padding: 6px 0;}
|
||||
.course-content ul.topics li.section .right img.icon { padding: 0 0 4px 0;}
|
||||
.course-content ul.topics li.section .left .section-handle img.icon { padding:0; vertical-align: baseline; }
|
||||
.jumpmenu {text-align:center;}
|
||||
|
||||
@@ -7,4 +7,3 @@
|
||||
.course-content ul.weeks li.section .right {width:40px;text-align:center;padding: 6px 0;}
|
||||
.course-content ul.weeks li.section .right img.icon { padding: 0 0 4px 0;}
|
||||
.course-content ul.weeks li.section .left .section-handle img.icon { padding:0; vertical-align: baseline; }
|
||||
.jumpmenu {text-align:center;}
|
||||
@@ -44,6 +44,12 @@ $PAGE->set_url('/course/index.php');
|
||||
$PAGE->set_context($systemcontext);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
|
||||
// This needs to match caps checked in can_edit_in_category below.
|
||||
$PAGE->set_other_editing_capability(array(
|
||||
'moodle/category:manage',
|
||||
'moodle/course:create'
|
||||
));
|
||||
|
||||
if (can_edit_in_category()) {
|
||||
if ($categoryedit !== -1) {
|
||||
$USER->editing = $categoryedit;
|
||||
|
||||
+19
-15
@@ -1674,13 +1674,15 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
'type' => 'hidden', 'name' => 'completionstate',
|
||||
'value' => $newstate));
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
|
||||
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle,
|
||||
'aria-live' => 'polite'));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('form');
|
||||
} else {
|
||||
// In auto mode, or when editing, the icon is just an image
|
||||
echo "<span class='autocompletion'>";
|
||||
echo "<img src='$imgsrc' alt='$imgalt' title='$imgalt' /></span>";
|
||||
// In auto mode, or when editing, the icon is just an image.
|
||||
echo html_writer::tag('span', html_writer::empty_tag('img', array(
|
||||
'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgalt)),
|
||||
array('class' => 'autocompletion'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3163,17 +3165,19 @@ function moveto_module($mod, $section, $beforemod=NULL) {
|
||||
}
|
||||
|
||||
// if moving to a hidden section then hide module
|
||||
if (!$section->visible && $mod->visible) {
|
||||
// Set this in the object because it is sent as a response to ajax calls.
|
||||
$mod->visible = 0;
|
||||
set_coursemodule_visible($mod->id, 0);
|
||||
// Set visibleold to 1 so module will be visible when section is made visible.
|
||||
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $mod->id));
|
||||
}
|
||||
if ($section->visible && !$mod->visible) {
|
||||
set_coursemodule_visible($mod->id, $mod->visibleold);
|
||||
// Set this in the object because it is sent as a response to ajax calls.
|
||||
$mod->visible = $mod->visibleold;
|
||||
if ($mod->section != $section->id) {
|
||||
if (!$section->visible && $mod->visible) {
|
||||
// Set this in the object because it is sent as a response to ajax calls.
|
||||
$mod->visible = 0;
|
||||
set_coursemodule_visible($mod->id, 0);
|
||||
// Set visibleold to 1 so module will be visible when section is made visible.
|
||||
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $mod->id));
|
||||
}
|
||||
if ($section->visible && !$mod->visible) {
|
||||
set_coursemodule_visible($mod->id, $mod->visibleold);
|
||||
// Set this in the object because it is sent as a response to ajax calls.
|
||||
$mod->visible = $mod->visibleold;
|
||||
}
|
||||
}
|
||||
|
||||
/// Add the module into the new section
|
||||
|
||||
+10
-7
@@ -4,13 +4,22 @@
|
||||
require_once('../config.php');
|
||||
require_once('lib.php');
|
||||
|
||||
$id = optional_param('id', SITEID, PARAM_INT); // course id
|
||||
$id = optional_param('id', SITEID, PARAM_INT); // course id
|
||||
$redirect = optional_param('redirect', 0, PARAM_BOOL);
|
||||
|
||||
$url = new moodle_url('/course/loginas.php', array('id'=>$id));
|
||||
$PAGE->set_url($url);
|
||||
|
||||
/// Reset user back to their real self if needed, for security reasons you need to log out and log in again
|
||||
if (session_is_loggedinas()) {
|
||||
require_sesskey();
|
||||
require_logout();
|
||||
|
||||
// We can not set wanted URL here because the session is closed.
|
||||
redirect(new moodle_url($url, array('redirect'=>1)));
|
||||
}
|
||||
|
||||
if ($redirect) {
|
||||
if ($id and $id != SITEID) {
|
||||
$SESSION->wantsurl = "$CFG->wwwroot/course/view.php?id=".$id;
|
||||
} else {
|
||||
@@ -25,12 +34,6 @@ if (session_is_loggedinas()) {
|
||||
|
||||
$userid = required_param('user', PARAM_INT); // login as this user
|
||||
|
||||
$url = new moodle_url('/course/loginas.php', array('user'=>$userid, 'sesskey'=>sesskey()));
|
||||
if ($id !== SITEID) {
|
||||
$url->param('id', $id);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
require_sesskey();
|
||||
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
||||
|
||||
+2
-2
@@ -336,7 +336,7 @@ if ($mform->is_cancelled()) {
|
||||
$cm->groupmembersonly = $fromform->groupmembersonly;
|
||||
|
||||
$completion = new completion_info($course);
|
||||
if ($completion->is_enabled()) {
|
||||
if ($completion->is_enabled() && !empty($fromform->completionunlocked)) {
|
||||
// Update completion settings
|
||||
$cm->completion = $fromform->completion;
|
||||
$cm->completiongradeitemnumber = $fromform->completiongradeitemnumber;
|
||||
@@ -413,6 +413,7 @@ if ($mform->is_cancelled()) {
|
||||
$newcm->module = $fromform->module;
|
||||
$newcm->instance = 0; // not known yet, will be updated later (this is similar to restore code)
|
||||
$newcm->visible = $fromform->visible;
|
||||
$newcm->visibleold = $fromform->visible;
|
||||
$newcm->groupmode = $fromform->groupmode;
|
||||
$newcm->groupingid = $fromform->groupingid;
|
||||
$newcm->groupmembersonly = $fromform->groupmembersonly;
|
||||
@@ -480,7 +481,6 @@ if ($mform->is_cancelled()) {
|
||||
// make sure visibility is set correctly (in particular in calendar)
|
||||
// note: allow them to set it even without moodle/course:activityvisibility
|
||||
set_coursemodule_visible($fromform->coursemodule, $fromform->visible);
|
||||
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $fromform->coursemodule));
|
||||
|
||||
if (isset($fromform->cmidnumber)) { //label
|
||||
// set cm idnumber - uniqueness is already verified by form validation
|
||||
|
||||
@@ -312,8 +312,11 @@ abstract class moodleform_mod extends moodleform {
|
||||
}
|
||||
|
||||
// Completion: Don't let them choose automatic completion without turning
|
||||
// on some conditions
|
||||
if (array_key_exists('completion', $data) && $data['completion']==COMPLETION_TRACKING_AUTOMATIC) {
|
||||
// on some conditions. Ignore this check when completion settings are
|
||||
// locked, as the options are then disabled.
|
||||
if (array_key_exists('completion', $data) &&
|
||||
$data['completion'] == COMPLETION_TRACKING_AUTOMATIC &&
|
||||
!empty($data['completionunlocked'])) {
|
||||
if (empty($data['completionview']) && empty($data['completionusegrade']) &&
|
||||
!$this->completion_rule_enabled($data)) {
|
||||
$errors['completion'] = get_string('badautocompletion', 'completion');
|
||||
@@ -564,7 +567,8 @@ abstract class moodleform_mod extends moodleform {
|
||||
|
||||
// Conditions based on user fields
|
||||
$operators = condition_info::get_condition_user_field_operators();
|
||||
$useroptions = condition_info::get_condition_user_fields();
|
||||
$useroptions = condition_info::get_condition_user_fields(
|
||||
array('context' => $this->context));
|
||||
asort($useroptions);
|
||||
|
||||
$useroptions = array(0 => $strnone) + $useroptions;
|
||||
|
||||
@@ -118,6 +118,7 @@ if (has_capability('moodle/course:publish', context_course::instance($id))) {
|
||||
$hubcourseid = optional_param('hubcourseid', 0, PARAM_INT);
|
||||
$publicationid = optional_param('publicationid', 0, PARAM_INT);
|
||||
$timepublished = optional_param('timepublished', 0, PARAM_INT);
|
||||
$publication = new stdClass();
|
||||
$publication->courseshortname = $course->shortname;
|
||||
$publication->courseid = $course->id;
|
||||
$publication->hubname = $hubname;
|
||||
|
||||
+23
-6
@@ -30,6 +30,7 @@ require_once('recent_form.php');
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$PAGE->set_url('/course/recent.php', array('id'=>$id));
|
||||
$PAGE->set_pagelayout('report');
|
||||
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error("That's an invalid course id");
|
||||
@@ -274,21 +275,37 @@ echo $OUTPUT->footer();
|
||||
|
||||
function compare_activities_by_time_desc($a, $b) {
|
||||
// make sure the activities actually have a timestamp property
|
||||
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
|
||||
return 0;
|
||||
}
|
||||
if ($a->timestamp == $b->timestamp)
|
||||
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
|
||||
return 0;
|
||||
}
|
||||
// We treat instances without timestamp as if they have a timestamp of 0.
|
||||
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
|
||||
return 1;
|
||||
}
|
||||
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
|
||||
return -1;
|
||||
}
|
||||
if ($a->timestamp == $b->timestamp) {
|
||||
return 0;
|
||||
}
|
||||
return ($a->timestamp > $b->timestamp) ? -1 : 1;
|
||||
}
|
||||
|
||||
function compare_activities_by_time_asc($a, $b) {
|
||||
// make sure the activities actually have a timestamp property
|
||||
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
|
||||
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
|
||||
return 0;
|
||||
}
|
||||
if ($a->timestamp == $b->timestamp)
|
||||
// We treat instances without timestamp as if they have a timestamp of 0.
|
||||
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
|
||||
return -1;
|
||||
}
|
||||
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
|
||||
return 1;
|
||||
}
|
||||
if ($a->timestamp == $b->timestamp) {
|
||||
return 0;
|
||||
}
|
||||
return ($a->timestamp < $b->timestamp) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -236,18 +236,14 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
|
||||
|
||||
// Activities
|
||||
$activities = array_filter($modules, function($mod) {
|
||||
return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);
|
||||
});
|
||||
$activities = array_filter($modules, create_function('$mod', 'return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);'));
|
||||
if (count($activities)) {
|
||||
$formcontent .= $this->course_modchooser_title('activities');
|
||||
$formcontent .= $this->course_modchooser_module_types($activities);
|
||||
}
|
||||
|
||||
// Resources
|
||||
$resources = array_filter($modules, function($mod) {
|
||||
return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);
|
||||
});
|
||||
$resources = array_filter($modules, create_function('$mod', 'return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);'));
|
||||
if (count($resources)) {
|
||||
$formcontent .= $this->course_modchooser_title('resources');
|
||||
$formcontent .= $this->course_modchooser_module_types($resources);
|
||||
|
||||
@@ -535,4 +535,137 @@ class courselib_testcase extends advanced_testcase {
|
||||
$pagetypelist = course_page_type_list($pagetype, null, null);
|
||||
$this->assertEquals($pagetypelist, $testpagetypelist1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests moving a module between hidden/visible sections and
|
||||
* verifies that the course/module visiblity seettings are
|
||||
* retained.
|
||||
*/
|
||||
public function test_moveto_module_between_hidden_sections() {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$course = $this->getDataGenerator()->create_course(array('numsections' => 4), array('createsections' => true));
|
||||
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
|
||||
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
|
||||
$quiz= $this->getDataGenerator()->create_module('quiz', array('course' => $course->id));
|
||||
|
||||
// Set the page as hidden
|
||||
set_coursemodule_visible($page->cmid, 0);
|
||||
|
||||
// Set sections 3 as hidden.
|
||||
set_section_visible($course->id, 3, 0);
|
||||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
$hiddensection = $modinfo->get_section_info(3);
|
||||
// New section is definitely not visible:
|
||||
$this->assertEquals($hiddensection->visible, 0);
|
||||
|
||||
$forumcm = $modinfo->cms[$forum->cmid];
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
|
||||
// Move the forum and the page to a hidden section.
|
||||
moveto_module($forumcm, $hiddensection);
|
||||
moveto_module($pagecm, $hiddensection);
|
||||
|
||||
// Reset modinfo cache.
|
||||
get_fast_modinfo(0, 0, true);
|
||||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
// Verify that forum and page have been moved to the hidden section and quiz has not.
|
||||
$this->assertContains($forum->cmid, $modinfo->sections[3]);
|
||||
$this->assertContains($page->cmid, $modinfo->sections[3]);
|
||||
$this->assertNotContains($quiz->cmid, $modinfo->sections[3]);
|
||||
|
||||
// Verify that forum has been made invisible.
|
||||
$forumcm = $modinfo->cms[$forum->cmid];
|
||||
$this->assertEquals($forumcm->visible, 0);
|
||||
// Verify that old state has been retained.
|
||||
$this->assertEquals($forumcm->visibleold, 1);
|
||||
|
||||
// Verify that page has stayed invisible.
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
$this->assertEquals($pagecm->visible, 0);
|
||||
// Verify that old state has been retained.
|
||||
$this->assertEquals($pagecm->visibleold, 0);
|
||||
|
||||
// Verify that quiz has been unaffected.
|
||||
$quizcm = $modinfo->cms[$quiz->cmid];
|
||||
$this->assertEquals($quizcm->visible, 1);
|
||||
|
||||
// Move forum and page back to visible section.
|
||||
$visiblesection = $modinfo->get_section_info(2);
|
||||
moveto_module($forumcm, $visiblesection);
|
||||
moveto_module($pagecm, $visiblesection);
|
||||
|
||||
// Reset modinfo cache.
|
||||
get_fast_modinfo(0, 0, true);
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
// Verify that forum has been made visible.
|
||||
$forumcm = $modinfo->cms[$forum->cmid];
|
||||
$this->assertEquals($forumcm->visible, 1);
|
||||
|
||||
// Verify that page has stayed invisible.
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
$this->assertEquals($pagecm->visible, 0);
|
||||
|
||||
// Move the page in the same section (this is what mod duplicate does_
|
||||
moveto_module($pagecm, $visiblesection, $forumcm);
|
||||
|
||||
// Reset modinfo cache.
|
||||
get_fast_modinfo(0, 0, true);
|
||||
|
||||
// Verify that the the page is still hidden
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
$this->assertEquals($pagecm->visible, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests moving a module around in the same section. moveto_module()
|
||||
* is called this way in modduplicate.
|
||||
*/
|
||||
public function test_moveto_module_in_same_section() {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$course = $this->getDataGenerator()->create_course(array('numsections' => 3), array('createsections' => true));
|
||||
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
|
||||
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
|
||||
|
||||
// Simulate inconsistent visible/visibleold values (MDL-38713).
|
||||
$cm = $DB->get_record('course_modules', array('id' => $page->cmid), '*', MUST_EXIST);
|
||||
$cm->visible = 0;
|
||||
$cm->visibleold = 1;
|
||||
$DB->update_record('course_modules', $cm);
|
||||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$forumcm = $modinfo->cms[$forum->cmid];
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
|
||||
// Verify that page is hidden.
|
||||
$this->assertEquals($pagecm->visible, 0);
|
||||
|
||||
// Verify section 0 is where all mods added.
|
||||
$section = $modinfo->get_section_info(0);
|
||||
$this->assertEquals($section->id, $forumcm->section);
|
||||
$this->assertEquals($section->id, $pagecm->section);
|
||||
|
||||
|
||||
// Move the forum and the page to a hidden section.
|
||||
moveto_module($pagecm, $section, $forumcm);
|
||||
|
||||
// Reset modinfo cache.
|
||||
get_fast_modinfo(0, 0, true);
|
||||
|
||||
// Verify that the the page is still hidden
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$pagecm = $modinfo->cms[$page->cmid];
|
||||
$this->assertEquals($pagecm->visible, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,28 +572,54 @@ class core_course_external_testcase extends externallib_advanced_testcase {
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$course = self::getDataGenerator()->create_course();
|
||||
$forum = $this->getDataGenerator()->create_module('forum', array('course'=>$course->id));
|
||||
$forumdescription = 'This is the forum description';
|
||||
$forum = $this->getDataGenerator()->create_module('forum',
|
||||
array('course'=>$course->id, 'intro' => $forumdescription),
|
||||
array('showdescription' => true));
|
||||
$forumcm = get_coursemodule_from_id('forum', $forum->cmid);
|
||||
$forumcontext = context_module::instance($forum->cmid);
|
||||
$data = $this->getDataGenerator()->create_module('data', array('assessed'=>1, 'scale'=>100, 'course'=>$course->id));
|
||||
$datacontext = context_module::instance($data->cmid);
|
||||
$datacm = get_coursemodule_from_instance('page', $data->id);
|
||||
$page = $this->getDataGenerator()->create_module('page', array('course'=>$course->id));
|
||||
$pagecontext = context_module::instance($page->cmid);
|
||||
$pagecm = get_coursemodule_from_instance('page', $page->id);
|
||||
$labeldescription = 'This is a very long label to test if more than 50 characters are returned.
|
||||
So bla bla bla bla <b>bold bold bold</b> bla bla bla bla.';
|
||||
$label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
|
||||
'intro' => $labeldescription));
|
||||
$labelcm = get_coursemodule_from_instance('label', $label->id);
|
||||
|
||||
// Set the required capabilities by the external function.
|
||||
$context = context_course::instance($course->id);
|
||||
$roleid = $this->assignUserCapability('moodle/course:view', $context->id);
|
||||
$this->assignUserCapability('moodle/course:update', $context->id, $roleid);
|
||||
|
||||
$courses = core_course_external::get_course_contents($course->id, array());
|
||||
$sections = core_course_external::get_course_contents($course->id, array());
|
||||
|
||||
// We need to execute the return values cleaning process to simulate the web service server.
|
||||
$courses = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $courses);
|
||||
$sections = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $sections);
|
||||
|
||||
// Check that the course has the 3 created modules
|
||||
$this->assertEquals(3, count($courses[0]['modules']));
|
||||
// Check that forum and label descriptions are correctly returned.
|
||||
$firstsection = array_pop($sections);
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$testexecuted = 0;
|
||||
foreach($firstsection['modules'] as $module) {
|
||||
if ($module['id'] == $forumcm->id and $module['modname'] == 'forum') {
|
||||
$cm = $modinfo->cms[$forumcm->id];
|
||||
$formattedtext = format_text($cm->get_content(), FORMAT_HTML,
|
||||
array('noclean' => true, 'para' => false, 'filter' => false));
|
||||
$this->assertEquals($formattedtext, $module['description']);
|
||||
$testexecuted = $testexecuted + 1;
|
||||
} else if ($module['id'] == $labelcm->id and $module['modname'] == 'label') {
|
||||
$cm = $modinfo->cms[$labelcm->id];
|
||||
$formattedtext = format_text($cm->get_content(), FORMAT_HTML,
|
||||
array('noclean' => true, 'para' => false, 'filter' => false));
|
||||
$this->assertEquals($formattedtext, $module['description']);
|
||||
$testexecuted = $testexecuted + 1;
|
||||
}
|
||||
}
|
||||
$this->assertEquals(2, $testexecuted);
|
||||
|
||||
// Check that the only return section has the 4 created modules
|
||||
$this->assertEquals(4, count($firstsection['modules']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+4
-1
@@ -509,7 +509,9 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
.setAttrs({
|
||||
'name' : 'title',
|
||||
'value' : titletext,
|
||||
'autocomplete' : 'off'
|
||||
'autocomplete' : 'off',
|
||||
'aria-describedby' : 'id_editinstructions',
|
||||
'maxLength' : '255'
|
||||
})
|
||||
.addClass('titleeditor');
|
||||
var editform = Y.Node.create('<form />')
|
||||
@@ -517,6 +519,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
.setAttribute('action', '#');
|
||||
var editinstructions = Y.Node.create('<span />')
|
||||
.addClass('editinstructions')
|
||||
.setAttrs({'id' : 'id_editinstructions'})
|
||||
.set('innerHTML', M.util.get_string('edittitleinstructions', 'moodle'));
|
||||
var activityicon = element.one('img.activityicon').cloneNode();
|
||||
|
||||
|
||||
+8
-1
@@ -96,9 +96,16 @@ switch ($action) {
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
$outcome->response = $manager->search_other_users($search, $searchanywhere, $page);
|
||||
$extrafields = get_extra_user_fields($context);
|
||||
$useroptions = array();
|
||||
// User is not enrolled, either link to site profile or do not link at all.
|
||||
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
|
||||
$useroptions['courseid'] = SITEID;
|
||||
} else {
|
||||
$useroptions['link'] = false;
|
||||
}
|
||||
foreach ($outcome->response['users'] as &$user) {
|
||||
$user->userId = $user->id;
|
||||
$user->picture = $OUTPUT->user_picture($user);
|
||||
$user->picture = $OUTPUT->user_picture($user, $useroptions);
|
||||
$user->fullname = fullname($user);
|
||||
$fieldvalues = array();
|
||||
foreach ($extrafields as $field) {
|
||||
|
||||
@@ -316,7 +316,7 @@ class core_enrol_external extends external_api {
|
||||
}
|
||||
|
||||
list($enrolledsqlselect, $enrolledparams) = get_enrolled_sql($context);
|
||||
$enrolledsql = "SELECT COUNT(*) FROM ($enrolledsqlselect) AS enrolleduserids";
|
||||
$enrolledsql = "SELECT COUNT('x') FROM ($enrolledsqlselect) enrolleduserids";
|
||||
$enrolledusercount = $DB->count_records_sql($enrolledsql, $enrolledparams);
|
||||
|
||||
$result[] = array('id'=>$course->id, 'shortname'=>$course->shortname, 'fullname'=>$course->fullname, 'idnumber'=>$course->idnumber,'visible'=>$course->visible, 'enrolledusercount'=>$enrolledusercount);
|
||||
|
||||
@@ -71,8 +71,15 @@ switch ($action) {
|
||||
$perpage = optional_param('perpage', 25, PARAM_INT); // This value is hard-coded to 25 in quickenrolment.js
|
||||
$outcome->response = $manager->get_potential_users($enrolid, $search, $searchanywhere, $page, $perpage, $addedenrollment);
|
||||
$extrafields = get_extra_user_fields($context);
|
||||
$useroptions = array();
|
||||
// User is not enrolled yet, either link to site profile or do not link at all.
|
||||
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
|
||||
$useroptions['courseid'] = SITEID;
|
||||
} else {
|
||||
$useroptions['link'] = false;
|
||||
}
|
||||
foreach ($outcome->response['users'] as &$user) {
|
||||
$user->picture = $OUTPUT->user_picture($user);
|
||||
$user->picture = $OUTPUT->user_picture($user, $useroptions);
|
||||
$user->fullname = fullname($user);
|
||||
$fieldvalues = array();
|
||||
foreach ($extrafields as $field) {
|
||||
|
||||
@@ -420,3 +420,13 @@ class grade_export_update_buffer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that there is a valid set of grades to export.
|
||||
* @param $courseid int The course being exported
|
||||
*/
|
||||
function export_verify_grades($courseid) {
|
||||
$regraderesult = grade_regrade_final_grades($courseid);
|
||||
if (is_array($regraderesult)) {
|
||||
throw new moodle_exception('gradecantregrade', 'error', '', implode(', ', array_unique($regraderesult)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/ods:view', $context);
|
||||
|
||||
print_grade_page_head($COURSE->id, 'export', 'ods', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods'));
|
||||
export_verify_grades($COURSE->id);
|
||||
|
||||
if (!empty($CFG->gradepublishing)) {
|
||||
$CFG->gradepublishing = has_capability('gradeexport/ods:publish', $context);
|
||||
|
||||
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/txt:view', $context);
|
||||
|
||||
print_grade_page_head($COURSE->id, 'export', 'txt', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt'));
|
||||
export_verify_grades($COURSE->id);
|
||||
|
||||
if (!empty($CFG->gradepublishing)) {
|
||||
$CFG->gradepublishing = has_capability('gradeexport/txt:publish', $context);
|
||||
|
||||
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/xls:view', $context);
|
||||
|
||||
print_grade_page_head($COURSE->id, 'export', 'xls', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls'));
|
||||
export_verify_grades($COURSE->id);
|
||||
|
||||
if (!empty($CFG->gradepublishing)) {
|
||||
$CFG->gradepublishing = has_capability('gradeexport/xls:publish', $context);
|
||||
|
||||
@@ -34,6 +34,7 @@ require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/xml:view', $context);
|
||||
|
||||
print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml'));
|
||||
export_verify_grades($COURSE->id);
|
||||
|
||||
if (!empty($CFG->gradepublishing)) {
|
||||
$CFG->gradepublishing = has_capability('gradeexport/xml:publish', $context);
|
||||
|
||||
@@ -36,7 +36,7 @@ $string['criterionmovedown'] = 'Move down';
|
||||
$string['criterionmoveup'] = 'Move up';
|
||||
$string['definerubric'] = 'Define rubric';
|
||||
$string['description'] = 'Description';
|
||||
$string['enableremarks'] = 'Allow grader to add text remarks for each criteria';
|
||||
$string['enableremarks'] = 'Allow grader to add text remarks for each criterion';
|
||||
$string['err_mintwolevels'] = 'Each criterion must have at least two levels';
|
||||
$string['err_nocriteria'] = 'Rubric must contain at least one criterion';
|
||||
$string['err_nodefinition'] = 'Level definition can not be empty';
|
||||
|
||||
+4
-3
@@ -22,7 +22,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once $CFG->libdir.'/gradelib.php';
|
||||
require_once($CFG->libdir . '/gradelib.php');
|
||||
require_once($CFG->dirroot . '/grade/export/lib.php');
|
||||
|
||||
/**
|
||||
* This class iterates over all users that are graded in a course.
|
||||
@@ -128,7 +129,7 @@ class graded_users_iterator {
|
||||
|
||||
$this->close();
|
||||
|
||||
grade_regrade_final_grades($this->course->id);
|
||||
export_verify_grades($this->course->id);
|
||||
$course_item = grade_item::fetch_course_item($this->course->id);
|
||||
if ($course_item->needsupdate) {
|
||||
// can not calculate all final grades - sorry
|
||||
@@ -2461,7 +2462,7 @@ abstract class grade_helper {
|
||||
return self::$managesetting;
|
||||
}
|
||||
$context = context_course::instance($courseid);
|
||||
if (has_capability('moodle/course:update', $context)) {
|
||||
if (has_capability('moodle/grade:manage', $context)) {
|
||||
self::$managesetting = new grade_plugin_info('coursesettings', new moodle_url('/grade/edit/settings/index.php', array('id'=>$courseid)), get_string('course'));
|
||||
} else {
|
||||
self::$managesetting = false;
|
||||
|
||||
@@ -358,7 +358,12 @@ abstract class grade_report {
|
||||
// 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 ) {
|
||||
if (!is_array($this->showtotalsifcontainhidden)) {
|
||||
debugging('showtotalsifcontainhidden should be an array', DEBUG_DEVELOPER);
|
||||
$this->showtotalsifcontainhidden = array($courseid => $this->showtotalsifcontainhidden);
|
||||
}
|
||||
|
||||
if ($this->showtotalsifcontainhidden[$courseid] == GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN) {
|
||||
return $finalgrade;
|
||||
}
|
||||
|
||||
@@ -396,7 +401,7 @@ abstract class grade_report {
|
||||
|
||||
//if the item definitely depends on a hidden item
|
||||
if (array_key_exists($course_item->id, $hiding_affected['altered'])) {
|
||||
if( !$this->showtotalsifcontainhidden ) {
|
||||
if( !$this->showtotalsifcontainhidden[$courseid] ) {
|
||||
//hide the grade
|
||||
$finalgrade = null;
|
||||
}
|
||||
@@ -406,7 +411,7 @@ abstract class grade_report {
|
||||
}
|
||||
} else if (!empty($hiding_affected['unknown'][$course_item->id])) {
|
||||
//not sure whether or not this item depends on a hidden item
|
||||
if( !$this->showtotalsifcontainhidden ) {
|
||||
if( !$this->showtotalsifcontainhidden[$courseid] ) {
|
||||
//hide the grade
|
||||
$finalgrade = null;
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ class grade_report_overview extends grade_report {
|
||||
global $CFG, $COURSE, $DB;
|
||||
parent::__construct($COURSE->id, $gpr, $context);
|
||||
|
||||
$this->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
|
||||
|
||||
// Get the user (for full name).
|
||||
$this->user = $DB->get_record('user', array('id' => $userid));
|
||||
|
||||
@@ -81,12 +79,17 @@ class grade_report_overview extends grade_report {
|
||||
|
||||
$this->showrank = array();
|
||||
$this->showrank['any'] = false;
|
||||
|
||||
$this->showtotalsifcontainhidden = array();
|
||||
|
||||
if ($this->courses) {
|
||||
foreach ($this->courses as $course) {
|
||||
$this->showrank[$course->id] = grade_get_setting($course->id, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank));
|
||||
if ($this->showrank[$course->id]) {
|
||||
$this->showrank['any'] = true;
|
||||
}
|
||||
|
||||
$this->showtotalsifcontainhidden[$course->id] = grade_get_setting($course->id, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
This files describes API changes in /grade/report/*,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
|
||||
=== 2.3.5, 2.4.2 ===
|
||||
* class_grade_report::showtotalsifcontainhidden has been switched from a single integer value to an array.
|
||||
The array keys are course IDs while the array values are the value of the course setting "report_overview_showtotalsifcontainhidden".
|
||||
@@ -165,7 +165,7 @@ class grade_report_user extends grade_report {
|
||||
$this->showrank = grade_get_setting($this->courseid, 'report_user_showrank', $CFG->grade_report_user_showrank);
|
||||
$this->showpercentage = grade_get_setting($this->courseid, 'report_user_showpercentage', $CFG->grade_report_user_showpercentage);
|
||||
$this->showhiddenitems = grade_get_setting($this->courseid, 'report_user_showhiddenitems', $CFG->grade_report_user_showhiddenitems);
|
||||
$this->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden);
|
||||
$this->showtotalsifcontainhidden = array($this->courseid => grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden));
|
||||
|
||||
$this->showgrade = grade_get_setting($this->courseid, 'report_user_showgrade', !empty($CFG->grade_report_user_showgrade));
|
||||
$this->showrange = grade_get_setting($this->courseid, 'report_user_showrange', !empty($CFG->grade_report_user_showrange));
|
||||
|
||||
@@ -120,15 +120,15 @@ class gradereportlib_testcase extends advanced_testcase {
|
||||
$report = new grade_report_test($course->id, $gpr, $coursecontext, $student);
|
||||
|
||||
// Should return the supplied student total grade regardless of hiding.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals($datagrade + $forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
|
||||
// Should blank the student total as course grade depends on a hidden item.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
|
||||
// Should return the course total minus the hidden database activity grade.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals($forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
|
||||
// Note: we cannot simply hide modules and call $report->blank_hidden_total() again.
|
||||
@@ -182,16 +182,16 @@ class gradereportlib_testcase extends advanced_testcase {
|
||||
$report = new grade_report_test($course->id, $gpr, $coursecontext, $student);
|
||||
|
||||
// Should return the supplied student total grade regardless of hiding.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals($datagrade + $forumgrade, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
|
||||
// Should blank the student total as course grade depends on a hidden item.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
|
||||
// Should return the course total minus the hidden activity grades.
|
||||
// They are both hidden so should return null.
|
||||
$report->showtotalsifcontainhidden = GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN;
|
||||
$report->showtotalsifcontainhidden = array($course->id => GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN);
|
||||
$this->assertEquals(null, $report->blank_hidden_total($course->id, $coursegradeitem, $datagrade + $forumgrade));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ $string['datarootpermission'] = 'Zugriffsrechte zum Datenverzeichnis';
|
||||
$string['dbprefix'] = 'Tabellen-Prefix';
|
||||
$string['dirroot'] = 'Moodle-Verzeichnis';
|
||||
$string['environmenthead'] = 'Installationsvoraussetzungen werden geprüft ...';
|
||||
$string['environmentsub2'] = 'Jede Moodle-Version hat Mindestvoraussetzungen für der PHP-Version und für verbindliche PHP-Extensions. Vor einer Installation oder einer Aktualisierung wird eine vollständige Prüfung durchgeführt. Bitte fragen Sie den Server-Administrator, wenn Sie mit der Installation einer neuen Version oder mit der Aktivierung von PHP-Extensions nicht weiterkommen.';
|
||||
$string['environmentsub2'] = 'Jede Version hat Mindestvoraussetzungen für der PHP-Version und für verbindliche PHP-Extensions. Vor einer Installation oder einer Aktualisierung wird eine vollständige Prüfung durchgeführt. Bitte fragen Sie den Administrator des Servers, wenn Sie mit der Installation einer neuen Version oder mit der Aktivierung von PHP-Extensions nicht weiterkommen.';
|
||||
$string['errorsinenvironment'] = 'Fehler bei der Prüfung der Systemvoraussetzungen!';
|
||||
$string['installation'] = 'Installation';
|
||||
$string['langdownloaderror'] = 'Leider konnte das Sprachpaket \'{$a}\' nicht heruntergeladen werden. Die Installation wird in englischer Sprache fortgesetzt.';
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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['clianswerno'] = 'n';
|
||||
$string['cliansweryes'] = 'y';
|
||||
$string['cliincorrectvalueerror'] = 'ནོར་བ། "{$a->option}"དོན་ལུ་ འཛོལ་འཛོལ་བའི་གནས་ཚད "{$a->value}"';
|
||||
$string['cliincorrectvalueretry'] = 'འཛོལ་འཛོལ་བའི་གནད་ཚད་ནང་འདུག སླར་རྩོལ།';
|
||||
$string['clitypevalue'] = 'གནས་ཚད་དབྱེ་བ།';
|
||||
$string['clitypevaluedefault'] = 'གནས་ཚད་དབྱེ་བ། Enter ཨེབ་སྟེ་སྔོན་སྒྲིག་གི་ཨང་({$a})';
|
||||
$string['cliunknowoption'] = 'ངོས་འཛིན་འབད་མ་ཚུགས་པའི་གདམ་ཁ་འདུག: {$a} གྲོགས་རམ་གྱི་གདམ་ཁ་འདི་ལག་ལེན་འཐབ་ད།';
|
||||
$string['cliyesnoprompt'] = 'y ཟེར་འབྲི་བ་ཅིན་ཨིནཟེརཝ་དང་ n ཟེར་འབྲི་བ་ཅིན་མིན་)';
|
||||
$string['environmentrequireinstall'] = 'གཞི་བཙུགས་འབད་དི་ལྕོགས་ཅན་བཟོ་དགོ།';
|
||||
$string['environmentrequireversion'] = 'ཐོན་རིམ་ {$a->needed}དགོས་མཁོ་ཡོདཔ་ལས་ ཁྱོད་ཀྱི་ {$a->current}གཡོག་བཀོལ་བའི་བསྒང་ཡོད།';
|
||||
@@ -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'] = 'སྐད་ཡིག་སྣོད་ཐོ་ གསར་བསྐྲུན་འབད་མི་བཏུབ།';
|
||||
$string['cannotcreatetempdir'] = 'གནས་སྐབས་ཀྱི་སྣོད་ཐོ་ གསར་བསྐྲུན་འབད་མི་བཏུབ།';
|
||||
$string['cannotdownloadcomponents'] = 'ཆ་ཤས་ཚུ་ཕབ་ལེན་འབད་མི་བཏུབ།';
|
||||
$string['cannotdownloadzipfile'] = 'ZIP ཡིག་སྣོད་ཕབ་ལེན་འབད་མི་བཏུབ།';
|
||||
$string['cannotfindcomponent'] = 'ཆ་ཤས་མི་ཐོབ།';
|
||||
$string['cannotsavemd5file'] = 'md5 ཡིག་སྣོད་ སྲུངས་མི་བཏུབ།';
|
||||
$string['cannotsavezipfile'] = 'ZIP ཡིག་སྣོད་ སྲུངས་མི་བཏུབ།';
|
||||
$string['cannotunzipfile'] = 'ཡིག་སྣོད་ unzip འབད་མི་བཏུབ།';
|
||||
$string['componentisuptodate'] = 'ཆ་ཤས་འདི་ དུས་མཐུན་སྦེ་ཡོད།';
|
||||
$string['downloadedfilecheckfailed'] = 'ཕབ་ལེན་འབད་ཡོད་པའི་ཡིག་སྣོད་ཞིབ་དཔྱད་འཐུས་ཤོར་བྱུང་ཡོདཔ།';
|
||||
$string['invalidmd5'] = 'check འགྱུར་ཅནའདི་ཕྱི་འགྱུར་ཨིན་མས་ - ལོག་འབད་གནང་།';
|
||||
$string['missingrequiredfield'] = 'དགོ་པའི་ས་སྒོ་འདི་མིན་འདུག';
|
||||
$string['remotedownloaderror'] = 'ཁྱོད་ཀྱི་server ་ལུ་ཆ་ཤས་ཕབ་ལེན་འབདཝ་ད་འཛོལ་བ་བྱུང་ཡོདཔ་ལས་ པོརོག་སི་སྒྲིག་སྟངས་ཚུ་བདེན་སྦྱོར་འབད་དགོ་པའི་ཁར་ PHP cURLརྒྱ་བསྐྱེད་འདི་འོས་སྦྱོར་འབད་ཡོདཔ་ཨིན། <br /><br />ཁྱོད་ཀྱིས་ ལག་ཐོག་ལས་ <a href="{$a->url}">{$a->url}</a>་ཕབ་ལེན་འབད་ཞིནམ་ལས་ ཁྱོད་རའི་སར་བར་ "{$a->dest}" ནང་འདྲ་བཤུས་བརྐྱབ་ཞིནམ་ལས་ དེ་ཁར་ཛིབ་འབད་བཤོལ།';
|
||||
$string['wrongdestpath'] = 'བཞག་སྣོད་རྒྱུ་ལམ་འཛོལ་བ།';
|
||||
$string['wrongsourcebase'] = 'འབྱུང་ས་URLགཞི་རྟེན་འཛོལ་བ།';
|
||||
$string['wrongzipfilename'] = 'ZIP་ཡིག་སྣོད་མིང་འཛོལ་བ།';
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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['admindirname'] = 'བདག་སྐྱོང་ སྣོད་ཐོ་';
|
||||
$string['availablelangs'] = 'ཐོབ་ཡོད་པའི་སྐད་ཡིག་ཚུ་གྱི་ཐོ་བཀོད།';
|
||||
$string['chooselanguagehead'] = 'སྐད་ཡིག་ སེལ་འཐུ་འབད།';
|
||||
$string['chooselanguagesub'] = 'གཞི་བཙུགས་ཀྱི་དོན་ལུ་རྐྱངམ་ཅིག་ སྐད་ཡིག་གཅིག་སེལ་འཐུ་འབད། ཁྱོད་ཀྱིས་ ས་ཁོངས་དང་ ལག་ལེན་པའི་སྐད་ཡིག་ཚུ་ ཤུལ་མམ་གྱི་ གསལ་གཞི་ནང་ སེལ་འཐུ་འབད་ཚུགས།';
|
||||
$string['clialreadyconfigured'] = 'ཡིག་སྣོད་config.php་འདི་ཧེ་མ་ལས་འདུག།ཁྱོད་ཨ་ནཱི་ས་ཁོངས་གཞི་བཙུགས་འབད་བ་ཅིན་admin/cli/install_database.php་དེ་ལག་ལོན་འཐབ་གནང།';
|
||||
$string['clialreadyinstalled'] = 'ཡིག་སྣོད་config.php་འདི་ཧེ་མ་ལས་འདུག།ཁྱོད་ཨ་ནཱི་ས་ཁོངས་ཡར་བསྐྱེད་འབད་བ་ཅིན་admin/cli/upgrade.php་དེ་ལག་ལོན་འཐབ་གནང།';
|
||||
$string['cliinstallheader'] = 'Moodle {$a} command line installation program';
|
||||
$string['databasehost'] = 'གནས་སྡུད་གཞི་རྟེན་host';
|
||||
$string['databasename'] = 'གནས་སྡུད་གཞི་རྟེན་ མིང་།';
|
||||
$string['databasetypehead'] = 'Choose database driver';
|
||||
$string['dataroot'] = 'གནས་སྡུད་ སྣོད་ཐོ་';
|
||||
$string['datarootpermission'] = 'Data directories permission';
|
||||
$string['dbprefix'] = 'Tables prefix';
|
||||
$string['dirroot'] = 'Moodle སྣོད་ཐོ།';
|
||||
$string['environmenthead'] = 'ཁྱོད་རའི་ མཐའ་འཁོར་ཞིབ་དཔྱད་འབད་དོ་་་';
|
||||
$string['environmentsub2'] = 'Moodleའཛིན་གྲོལ་རེ་རེ་གྱི་PHP་འཛིན་གྲོལ་དག་པ་ཅིག་དང་PHP extensionsངེས་མཁོ་དགོཔ་ཨིན།གཞི་བཙུགས་དང་ཡར་བསྐྱེད་་མ་བཟོ་བའི་ཧེ་མFull environmentཞིབ་དཔྱད་འབད་འོང་།';
|
||||
$string['errorsinenvironment'] = 'Environment check failed!';
|
||||
$string['installation'] = 'གཞི་བཙུགས།';
|
||||
$string['langdownloaderror'] = 'སྐད་ཡིག་ "{$a}"འདི་ གཞི་བཙུགས་འབད་དེ་མིན་ནུག། གཞི་བཙུགས་འདི་ ཨིན་སྐད་ནང་ འཕྲོ་མཐུད་དེ་འབད་ནི་ཨིན།';
|
||||
$string['memorylimithelp'] = '<p>ད་ལྟོ་ཁྱོད་ཀྱི་སར་བར་གྱི་དོན་ལུ་ PHP དྲན་ཚད་དེ་ $a ལུ་གཞི་སྒྲིག་འབད་དེ་འདུག།</p> <p> འདི་གིས་ཤུལ་ལས་ མུ་ཌལ་ལུ་ དྲན་ཚད་ཀྱི་དཀའ་ངལ་ཚུ་འབྱུང་བཅུག་འོང་ཝ། འདི་གི་ནང་ལས་ཡང་ ཁྱོད་ཀྱི་མུ་ཌལ་དང་ལག་ལེན་པ་ལོ་ཤ་ལྕོགས་ཅན་བཟོ་ཡོད་པ་ཅིན་ དཀའ་ངལ་འབྱུང་འོང་།</p> <p> ཁྱོད་ཀྱིས་ 40M བཟུམ་གྱི་ PHP དྲན་ཚད་ མང་སུ་ཡོད་མི་ རིམ་སྒྲིག་འབད་བ་ཅིན་ ལེགས་ཤོམ་འོང་། འདི་འབད་ནི་གི་དོན་ལུ་ ཐབས་ཤེས་ ལེ་ཤ་ཡོད་:</p> <ol> <li> ཁྱོད་ཀྱིས་ <i>--enable-memory-limit</i> དང་གཅིག་ཁར་ PHP ལོག་ཕྱོགས་སྒྲིག་འབད་ཚུགས་པ་ཅིན་ འདི་གི་ས་ མུ་ཌལ་གི་དྲན་ཚད་ཁོ་ར་གིས་སྦེ་ གཞི་སྒྲིག་འབད་ཚུགས།</li> <li>ཁྱོད་རའི་ php.ini ཡིག་སྣོད་ནང་འཛུལ་སྤྱོད་འབད་ཚུགས་པ་ཅིན་ ཁྱོད་ཀྱི་ <b>memory_limit</b>སྒྲིག་སྟངས་འདི་ 40M བཟུམ་གཅིག་ལུ་ བསྒྱུར་བཅོས་འབད་ཚུགས། ག་དེམ་ཅིག་སྦེ་འཛུལ་སྤྱོད་འབད་མ་ཚུགས་པ་ཅིན་ ཁྱོད་རའི་བདག་སྐྱོང་པ་ལུ་ འབད་བཅུག། <li> PHP སར་བར་ ལ་ལོ་གཅིག་ནང་ འོག་གི་གྲལ་ཐིག་ཚུ་ཡོད་མི་ མུ་ཌལ་སྣོད་ཐོ་ནང་ཁྱོད་ཀྱིས་ .htaccess ཡིག་སྣོད་གསར་བསྐྲུན་འབད་ཚུགས། <blockquote><div>php_value memory_limit 40M</div></blockquote> <p> དེ་འབདཝ་ད་ལུ་ སར་བར་ལ་ལོ་གཅིག་ནང་ འདི་གིས་ <b>all</b> PHP ཤོག་ལེབ་ཚུ་ གཡོག་བཀོལ་ནི་ལུ་སྔོན་བཀག་འབདཝ་ཨིན། (ཤོག་ལེབ་ཚུ་ནང་བལྟ་བའི་སྐབས་ འཛོལ་བ་ཚུ་མཐོང་འོང་) དེ་འབདཝ་ལས་ .htaccess ཡིག་སྣོད་་རྩ་བསྐྲད་གཏང་དགོ།</p></li> </ol>';
|
||||
$string['paths'] = 'Paths';
|
||||
$string['pathserrcreatedataroot'] = 'Data directory ({$a->dataroot}) cannot be created by the installer.';
|
||||
$string['pathshead'] = 'Confirm paths';
|
||||
$string['pathsrodataroot'] = 'Dataroot directory is not writable.';
|
||||
$string['pathsroparentdataroot'] = 'Parent directory ({$a->parent}) is not writeable. Data directory ({$a->dataroot}) cannot be created by the installer.';
|
||||
$string['pathssubadmindir'] = 'webhostsདག་པ་ཅིག་ /admin ལག་ལེན་འཐབ་འབད་དམིགས་བསལ་ URL འདི་control panel or somethingའཛུལ་སྤྱོད་འབདཝ་ཨིན། ཁ་རྗེ་མེད་པར་ Moodleབདག་སྐྱོང་ཤོག་ལེབ་ཚུ་གྱི་ཚད་ལྡན་གནས་ཁོངས་གཅིག་ཁར་མི་མཐུན་ཨིན། ཁྱོད་ཀྱི་དཀའ་ངལ་དེ་ བདག་སྐྱོང་ཀྱི་སྣོད་ཐོ་ གཞི་བཙུགས་འབད་བའི་གང་བསྐྱར་མིང་བཏགས་སྦེ་སེལ་ཚུགས། དཔེར་ན: <em>moodleadmin</em>. འདི་གྱི་Moodle ནང་ན་བདག་སྐྱོང་འབྲེལ་ལམ་ཚུ་གྱི་དཀའ་ངལ་་སེལ་ཚུགས་ཨིན།';
|
||||
$string['pathssubdataroot'] = 'སྐྱེལ་བཙུགས་ཚར་མི་ཡིག་སྣོད་ཚུ་Moodleགྱི་སྲུངས་བཞག་ནི་གྱི་དོན་ལུ་ས་གནས་དགོ།ཨ་ནི་སྣོད་ཐོ(ས་གནས་)དི་web serverལག་ལེན་པ་(usually \'nobody\' or \'apache\')གྱི་readable AND WRITEABLE དགོ འདི་འབདཝ་ད་ web ལས་འཛུལ་སྤྱོད་ཐད་ཀར་འབད་ནི་མེད་འོང་།་The installer will try to create it if doesn\'t exist.';
|
||||
$string['pathssubdirroot'] = 'Moodle installation ལུ་སྣོད་ཐོ་གི་འགྲུལ་ལམ་ག་ར་བྱིན་།';
|
||||
$string['pathssubwwwroot'] = 'Moodleའཛུལ་སྤྱོད་འབད་ནི་དོན་ལུ་Web གྱི་ཁ་བྱང་ག་ར་བྱིན་དགོ། སྣ་མང་ཁ་བྱང་ཚུ་གྱི་Moodleའཛུལ་སྤྱོད་འབད་མི་ཚུགས། ག་དེམ་ཅིག་འབད་ཁྱོད་ཀྱི་སྣ་མང་མི་མང་གི་ཁ་བྱང་ཚུ་ཡོད་པ་ཅིན་ འདི་མ་གཏོགས་གཞན་ག་ར་གུ་རྟག་བརྟན་སླར་ལོག་གཏང་ནི་དོན་ལུ་གཞི་སྒྲིག་འབད་དགོ། Intranet and Internet་གཉིས་ལས་ཁྱོད་ཀྱི་ས་ཁོངས་དེ་འཛུལ་སྤྱོད་འབད་བ་ཅིན་ མི་མང་གི་ཁ་བྱང་ལག་ལེན་འཐབ་དི་འབདཝ་ལས་Intranetལག་ལེན་པ་ཚུ་གྱི་ཡང་མི་མང་གི་ཁ་བྱང་ལག་ལེན་འཐབ་ཚུགས།
|
||||
ག་དེམ་ཅིག་འབད་ཁྱོད་ཀྱི་ཁ་བྱང་ངེས་བདེན་མེན་བ་ཅིན་ཁྱོད་ཀྱི་browserནང་ན་URL་དེ་བསྒྱུར་བཅོས་འབད་སྦེ་ ལོག་installation with a different value.འགོ་བཙུགས།';
|
||||
$string['pathsunsecuredataroot'] = 'Dataroot location is not secure';
|
||||
$string['pathswrongadmindir'] = 'Admin directory does not exist';
|
||||
$string['phpextension'] = '{$a} PHP extension';
|
||||
$string['phpversion'] = 'PHP ཐོན་རིམ།';
|
||||
$string['phpversionhelp'] = '<p>Moodle་ལུ་ ཐོན་རིམ་འདི་ ཉུང་མཐའ་ལུ་ 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['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'ཁྱོད་རའི་ གློག་རིག་ནང་ <strong>{$a->packname} {$a->packversion}</strong> package འདི་ མཐའ་འཁྱོལཅན་སྦེ་ གཞི་བཙུགས་དང་ གསར་བཙུགས་འབད་ཡོདཔ་ལས་བརྟེན་ ཁྱོད་ཀྱིས་འ་ནི་ ཤོག་ལེབ་འདི་བལྟ་ཚུགསཔ་ཨིན། བཀྲིས་བདེ་ལེགས་!';
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong> གསར་བཏོན་འབད་མི་ནང་ <strong>Moodle</strong> བཀོལ་སྤྱོད་འབད་བཏུབ་མི་ མཐའ་འཁོར་གསར་བསྐྲུན་འབད་མི་གློག་རིམ་ཚུ་ཡང་ཚུདཔ་ཨིན།';
|
||||
$string['welcomep40'] = 'ཐུམ་སྒྲིལ་འདི་ནང་ལུ་ <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong> ཡང་ ཚུདཔ་ཨིན།';
|
||||
$string['welcomep50'] = 'ཐུམ་སྒྲིལ་འདི་ནང་ལུ་ གློག་རིམ་ཆ་མཉམ་གྱི་ལག་ལེན་ཚུ་ ཁོང་རའི་ ཆོག་ཐམ་ལུ་ དབང་ཚད་ཡོདཔ་ཨིན། <strong>{$a->installername}</strong> ཐུམ་སྒྲིལ་ཆ་ཚང་འདི་ <a href="http://www.opensource.org/docs/definition_plain.html">open source</a> ཨིནམ་དང་ <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> ཆོག་ཐམ་དང་འཁྲིལ་ཏེ་ བགོ་བཀྲམ་འབད་འབདཝ་ཨིན།';
|
||||
$string['welcomep60'] = 'འོག་གི་ཤོག་ལེབ་ཚུ་གིས་ ཁྱོད་རའི་གློག་རིག་ནང<strong>Moodle</strong> རིམ་སྒྲིག་འབད་ནིའི་ ཐབས་ལམ་ འཇམ་ཏོང་ཏོ་ཚུ་སྟོན་འོང་། སྔོན་སྒྲིག་ སྒྲིག་སྟངས་ཚུ་ དང་ལེན་འབད་ ཡང་ན་ ཁྱོད་རའི་དགོས་མཁོ་དང་བསྟུན་ཏེ་ འདི་ཚུ་ བསྒྱུར་བཅོས་འབད།';
|
||||
$string['welcomep70'] = '<strong>Moodle</strong> གཞི་སྒྲིག་ འཕྲོ་མཐུད་དེ་འབད་ནིའི་དོན་ལུ་ "Next" ཨེབ་རྟ་གུ་ ཨེབ་གཏང་འབད།';
|
||||
$string['wwwroot'] = 'Web ཁ་བྱང་ཚུ་';
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'རྫོང་ཁ';
|
||||
@@ -41,7 +41,7 @@ $string['databasehost'] = 'Serveur de base de données';
|
||||
$string['databasename'] = 'Nom de la base de données';
|
||||
$string['databasetypehead'] = 'Sélectionner un pilote de base de données';
|
||||
$string['dataroot'] = 'Dossier de données';
|
||||
$string['datarootpermission'] = 'Permissions du dossier de données';
|
||||
$string['datarootpermission'] = 'Droits d\'accès au dossier de données';
|
||||
$string['dbprefix'] = 'Préfixe des tables';
|
||||
$string['dirroot'] = 'Dossier Moodle';
|
||||
$string['environmenthead'] = 'Vérification de l\'environnement...';
|
||||
|
||||
@@ -30,5 +30,15 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['environmentrequireinstall'] = 'é solicitada para ser instalada/activada.';
|
||||
$string['environmentrequireversion'] = 'Solicítase a versión {$a->needed} e está a executar a {$a->current}';
|
||||
$string['clianswerno'] = 'n';
|
||||
$string['cliansweryes'] = 's';
|
||||
$string['cliincorrectvalueerror'] = 'Erro, o valor «{$a->value}» é incorrecto para «{$a->option}»';
|
||||
$string['cliincorrectvalueretry'] = 'Valor incorrecto. Ténteo outra vez.';
|
||||
$string['clitypevalue'] = 'valor do tipo';
|
||||
$string['clitypevaluedefault'] = 'valor do tipo, prema Intro para empregar o valor predeterminado ({$a})';
|
||||
$string['cliunknowoption'] = 'Opcións non recoñecidas:
|
||||
{$a}
|
||||
Use a opción --help.';
|
||||
$string['cliyesnoprompt'] = 'escriba s (si) ou n (non)';
|
||||
$string['environmentrequireinstall'] = 'debe ser instalado e activado';
|
||||
$string['environmentrequireversion'] = 'requírese a versión {$a->needed} e está a executar a {$a->current}';
|
||||
|
||||
+10
-10
@@ -30,16 +30,16 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['cannotcreatelangdir'] = 'Non pode crear directorio de idioma';
|
||||
$string['cannotcreatetempdir'] = 'Non pode crear directorio de tempo';
|
||||
$string['cannotdownloadcomponents'] = 'Non pode descargar compoñentes.';
|
||||
$string['cannotdownloadzipfile'] = 'Non pode descargar ficheiros ZIP.';
|
||||
$string['cannotfindcomponent'] = 'Non pode encontrar compoñentes';
|
||||
$string['cannotsavemd5file'] = 'Non pode gardar o ficheiro md5.';
|
||||
$string['cannotsavezipfile'] = 'Non pode gardar un ficheiro ZIP.';
|
||||
$string['cannotunzipfile'] = 'Non pode descomprimir o ficheiro.';
|
||||
$string['componentisuptodate'] = 'O compoñente está actualizado.';
|
||||
$string['downloadedfilecheckfailed'] = 'Fallou a verificación do ficheiro descargado.';
|
||||
$string['cannotcreatelangdir'] = 'Non se pode crear o directorio de idioma';
|
||||
$string['cannotcreatetempdir'] = 'Non se pode crear un directorio temporal';
|
||||
$string['cannotdownloadcomponents'] = 'Non foi posíbel descargar compoñentes';
|
||||
$string['cannotdownloadzipfile'] = 'Non foi posíbel descargar o ficheiro ZIP';
|
||||
$string['cannotfindcomponent'] = 'Non foi posíbel atopar o compoñente';
|
||||
$string['cannotsavemd5file'] = 'Non é posíbel gardar o ficheiro md5';
|
||||
$string['cannotsavezipfile'] = 'Non é posíbel gardar o ficheiro ZIP';
|
||||
$string['cannotunzipfile'] = 'Non é posíbel descomprimir o ficheiro';
|
||||
$string['componentisuptodate'] = 'O compoñente está actualizado';
|
||||
$string['downloadedfilecheckfailed'] = 'A comprobación do ficheiro descargado non foi satisfactoria';
|
||||
$string['invalidmd5'] = 'md5 non válido';
|
||||
$string['missingrequiredfield'] = 'Falta algún campo obrigatorio';
|
||||
$string['wrongdestpath'] = 'Camiño de destino errado.';
|
||||
|
||||
+68
-28
@@ -30,41 +30,81 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['admindirname'] = 'Directorio de administración';
|
||||
$string['availablelangs'] = 'Paquetes de idioma dispoñibles';
|
||||
$string['chooselanguagehead'] = 'Escolla idioma';
|
||||
$string['chooselanguagesub'] = 'Escolla un idioma SÓ para a instalación. Poderá escoller o idioma do sitio e o idioma de usuario en próximas pantallas.';
|
||||
$string['admindirname'] = 'Directorio Admin';
|
||||
$string['availablelangs'] = 'Lista de idiomas dispoñíbeis';
|
||||
$string['chooselanguagehead'] = 'Escolla un idioma';
|
||||
$string['chooselanguagesub'] = 'Escolla un idioma para o proceso de instalación. Este idioma empregarase tamén como idioma predeterminado do sitio, se ben pode cambiarse máis adiante.';
|
||||
$string['clialreadyconfigured'] = 'Xa existe o ficheiro config.php. Empregue admin/cli/install_database.php se quere actualizar o seu sitio web.';
|
||||
$string['clialreadyinstalled'] = 'Xa existe o ficheiro config.php. Empregue admin/cli/upgrade.php se quere actualizar o seu sitio web.';
|
||||
$string['cliinstallheader'] = 'Programa de instalación de Moodle en liña de ordes {$a}';
|
||||
$string['databasehost'] = 'Enderezo/máquina da base de datos';
|
||||
$string['databasename'] = 'Nome de base de datos';
|
||||
$string['databasetypehead'] = 'Escolla o controlador da base de datos';
|
||||
$string['dataroot'] = 'Directorio de datos';
|
||||
$string['datarootpermission'] = 'Permisos dos directorios de datos';
|
||||
$string['dbprefix'] = 'Prefixo das táboas';
|
||||
$string['dirroot'] = 'Directorio Moodle';
|
||||
$string['environmenthead'] = 'Verificando o seu ámbito ...';
|
||||
$string['dirroot'] = 'Directorio de Moodle';
|
||||
$string['environmenthead'] = 'Comprobando o seu entorno ...';
|
||||
$string['environmentsub2'] = 'Cada versión de Moodle ten algún requisito mínimo da versión de PHP e un número obrigatorio de extensións de PHP.
|
||||
Antes de cada instalación ou actualización faise unha comprobación completa do entorno . Póñase en contacto co administrador do servidor se non sabe como instalar a nova versión ou activar as extensións PHP.';
|
||||
$string['errorsinenvironment'] = 'A comprobación do entorno no foi satisfactoria!';
|
||||
$string['installation'] = 'Instalación';
|
||||
$string['langdownloaderror'] = 'Desafortunadamente o idioma "{$a}" non foi instalado. O proceso de instalación continuará en inglés.';
|
||||
$string['memorylimithelp'] = '<p>O límite de memoria para PHP do seu servidor está actualmente establecido en {$a}.</p>
|
||||
$string['langdownloaderror'] = 'Non foi posíbel descargar o idioma «{$a}». O proceso de instalación continuará en inglés.';
|
||||
$string['memorylimithelp'] = '<p>O límite de memoria PHP no seu servidor está estabelecido en {$a}.</p>
|
||||
|
||||
<p>Isto fará que Moodle teña problemas de memoria máis tarde, especialmente se ten un número de módulos significativo e/ou un gran número de usuarios.</p>
|
||||
<p>Isto pode facer que Moodle teña problemas de memoria máis adiante, especialmente
|
||||
se vostede ten activados un feixe de módulos e/ou unha gran cantidade de usuarios.</p>
|
||||
|
||||
<p>Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M.
|
||||
Existen varias formas que pode tentar para facer esta modificación:</p>
|
||||
<p>Recomendámoslle que configure PHP co límite máis alto posíbel, p.ex. 40M.
|
||||
Hai varias maneiras de facer isto que vostede pode probar:</p>
|
||||
<ol>
|
||||
<li>Se pode, recompile PHP con <i>--enable-memory-limit</i>.
|
||||
Iso permitirá que o propio Moodle modifique o límite de memoria.</li>
|
||||
<li>Se ten acceso ao seu ficheiro php.ini pode modificar o valor de <b>memory_limit</b> para algo semellante a 16M. Se non ten acceso a ese ficheiro tal vez poida pedir ao administrador do sistema que o faga.</li>
|
||||
<li>Nalgúns servidores PHP servers pode crear un ficheiro .htaccess no directorio Moodle coa liña seguinte:
|
||||
<p><blockquote>php_value memory_limit 16M</blockquote></p>
|
||||
<p>Porén, nalgúns servidores provocará que <b>non funcione ningunha</b>páxina en PHP (verá erros cando tente visualizar as páxinas) polo que terá que eliminar o ficheiro .htaccess.</p></li>
|
||||
<li>Se vostede e quen de facelo, volva compilar PHP con <i>--enable-memory-limit</i>.
|
||||
Isto fai que sexa Moodle quen estabeleza o límite de memoria.</li>
|
||||
<li>Se vostede ten acceso ao ficheiro php.ini, pode cambiar o <b>memory_limit</b>
|
||||
estabelecéndoo en, digamos, 40M. Se vostede non ten acceso, podería
|
||||
solicitarlle ao administrador que o faga por vostede.</li>
|
||||
<li>Nalgúns servidores PHP, pode crear un ficheiro .htaccess no directorio Moodle
|
||||
que conteña a seguinte liña:
|
||||
<blockquote><div>php_value memory_limit 40M</div></blockquote>
|
||||
<p>Porén, nalgúns servidores isto impide que traballen <b>todas</b> as páxinas PHP
|
||||
(poderá ver os erros cando se miran as páxinas) de modo que terá que eliminar o ficheiro .htaccess.</p></li>
|
||||
</ol>';
|
||||
$string['paths'] = 'Rutas';
|
||||
$string['pathserrcreatedataroot'] = 'O directorio de datos ({$a->dataroot}) non puido ser creado polo instalador.';
|
||||
$string['pathshead'] = 'Confirme as rutas';
|
||||
$string['pathsrodataroot'] = 'O directorio dataroot non ten permisos de escritura.';
|
||||
$string['pathsroparentdataroot'] = 'O directorio principal ({$a->parent}) non ten permisos de escritura. O instalador non pode crear o directorio de datos ({$a->dataroot}).';
|
||||
$string['pathssubadmindir'] = 'Moi poucos enderezos web empregan /admin como URL especial para
|
||||
permitirlle acceder a un panel de control ou semellante. Desafortunadamente, isto entra en conflito coa localización estándar das páxinas de administración de Moodle. Vostede pode corrixir isto
|
||||
renomeando o directorio admin na súa instalación, e poñendo aquí ese novo nome. Por exemplo: <em>moodleadmin</em>. Iso corrixirá as ligazóns admin en Moodle.';
|
||||
$string['pathssubdataroot'] = 'Necesitase un lugar no que Moodle poida gardar os ficheiros enviados. Este directorio debe ser lexíbel E ESCRIBÍBEL polo usuario do servidor web
|
||||
(normalmente «nobody», «apache», «www-data»), mais non debería ser accesíbel directamente desde o web. Se non existe o instalador tentará crealo.';
|
||||
$string['pathssubdirroot'] = 'Ruta completa do directorio de instalación de Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Enderezo web completo para acceder a Moodle.
|
||||
Non é posíbel acceder a Moodle empregando enderezos múltiplos.
|
||||
Se o seu sitio ten varios enderezos públicos debe configurar encamiñamentos permanentes en todos eles, agás neste.
|
||||
Se o seu sitio web é accesíbel tanto desde unha Intranet como desde Internet, escriba aquí o enderezo público e configure o DNS para que os usuarios da Intranet poidan empregar tamén o enderezo público.
|
||||
Se o enderezo non é correcto, cambie o URL no seu navegador para reiniciar a instalación cun valor diferente.';
|
||||
$string['pathsunsecuredataroot'] = 'A localización de dataroot non é segura';
|
||||
$string['pathswrongadmindir'] = 'Non existe o directorio Admin';
|
||||
$string['phpextension'] = 'Extensión PHP {$a}';
|
||||
$string['phpversion'] = 'Versión PHP';
|
||||
$string['phpversionhelp'] = '<p>Moodle require unha versión de PHP de 4.3.0 como mínimo ou 5.1.0 (5.0.x ten problemas coñecidos).</p>
|
||||
<p>Actualmente está a executar a versión {$a}</p>
|
||||
<p>Debe actualizar o PHP ou migrar a outro servidor cunha versión máis nova de PHP!<br/>
|
||||
(No caso de ter unha versión 5.0.x pode retornar para unha versión 4.4.x)</p>';
|
||||
$string['phpversionhelp'] = '<p>Moodle require polo menos unha das versións de PHP 4.3.0 ou 5.1.0 ( as versións 5.0.x teñen unha serie de problemas coñecidos).</p>
|
||||
<p>Neste momento está executandose a versión {$a}</p>
|
||||
<p>Debe actualizar PHP ou trasladarse a outro servidor cunha versión máis recente de PHP!<br />
|
||||
(NO caso de 5.0.x podería tamén reverter cara a versión 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Está a ver esta páxina porque conseguiu instalar e iniciar o paquete <strong>{$a->packname} {$a->packversion}</strong> no seu computador. Parabéns!';
|
||||
$string['welcomep30'] = 'Esta versión do <strong>{$a->installername}</strong> inclúe as aplicacións
|
||||
para crear o ámbito en que <strong>Moodle</strong> pode funcionar, nomeadamente:';
|
||||
$string['welcomep40'] = 'O paquete tamén inclúe <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'A utilización de todas as aplicacións deste paquete réxese polas respectivas licenzas. O paquete <strong>{$a->installername}</strong> completo é <a href="http://www.opensource.org/docs/definition_plain.html"> código aberto</a> distribuído nos termos da licenza <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'As páxinas seguintes irán conducilo por algúns pasos fáciles de seguir para configurar o <strong>Moodle</strong> no computador. Pode aceptar a configuración por defecto ou, opcionalmente, utilizar outras máis adecuadas ás súas necesidades.';
|
||||
$string['welcomep70'] = 'Prema o botón "Seguinte" debaixo para continuar coa configuración de <strong>Moodle</strong>.';
|
||||
$string['welcomep20'] = 'Se esta a ver esta páxina é porque puido instalar satisfactoriamente e
|
||||
executar o paquete <strong>{$a->packname} {$a->packversion}</strong> no seu computador. Parabéns!';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> inclúe os aplicativos
|
||||
para crear un entorno no que <strong>Moodle</strong> funcione, nomeadamente:';
|
||||
$string['welcomep40'] = 'O paquete inclúe tamen <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'O uso de todos os aplicativos do paquete está rexido polas súas respectivas
|
||||
licenzas. O paquete completo <strong>{$a->installername}</strong> é
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">código aberto</a> e distribúese
|
||||
baixo a licenza <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'As páxinas seguintes guiarano a través de algúns sinxelos pasos para configurar
|
||||
e axustar <strong>Moodle</strong> no seu computador. Pode empregar os axustes predeterminados
|
||||
ou, opcionalmente, modificalos para que se axusten ás súas necesidades.';
|
||||
$string['welcomep70'] = 'Prema no botón «Seguinte» para continuar coa configuración de <strong>Moodle</strong>.';
|
||||
$string['wwwroot'] = 'Enderezo web';
|
||||
|
||||
@@ -30,6 +30,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['parentlanguage'] = 'pt';
|
||||
$string['parentlanguage'] = '';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Galego';
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['language'] = 'שפת ממשק';
|
||||
$string['next'] = 'הלאה';
|
||||
$string['next'] = 'הבא';
|
||||
$string['previous'] = 'קודם';
|
||||
$string['reload'] = 'טען מחדש';
|
||||
|
||||
@@ -31,4 +31,4 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['parentlanguage'] = 'he';
|
||||
$string['thislanguage'] = 'Hebrew kids';
|
||||
$string['thislanguage'] = 'עברית בתי־ספר';
|
||||
|
||||
@@ -41,8 +41,8 @@ $string['cannotunzipfile'] = 'Nije moguće otpakirati datoteku';
|
||||
$string['componentisuptodate'] = 'Komponenta je dostupna u svojoj najnovijoj inačici.';
|
||||
$string['downloadedfilecheckfailed'] = 'Došlo je do pogreške pri provjeri preuzete datoteke';
|
||||
$string['invalidmd5'] = 'Neispravna md5 datoteka';
|
||||
$string['missingrequiredfield'] = 'Nedostaje neko obavezno polje';
|
||||
$string['remotedownloaderror'] = 'Nije uspjelo preuzimanje komponente na poslužitelj, provjerite postavke proxyja. Preporuča se uporaba PHP cURL dodatka.<br /><br />Ručno preuzmite datoteku s <a href="{$a->url}">{$a->url}</a> iskopirajte ju u "{$a->dest}" na poslužitelj i raspakirajte.';
|
||||
$string['missingrequiredfield'] = 'Nedostaje neko obvezno polje';
|
||||
$string['remotedownloaderror'] = 'Nije uspjelo preuzimanje komponente na poslužitelj, provjerite postavke proxyja. Preporuča se uporaba PHP cURL dodatka.<br /><br />Ručno preuzmite datoteku s <a href="{$a->url}">{$a->url}</a> iskopirajte ju u "{$a->dest}" na poslužitelju i raspakirajte.';
|
||||
$string['wrongdestpath'] = 'Pogrešna odredišna putanja.';
|
||||
$string['wrongsourcebase'] = 'Pogrešna baza izvornog URL-a';
|
||||
$string['wrongzipfilename'] = 'Pogrešno ime ZIP datoteke';
|
||||
|
||||
@@ -45,14 +45,14 @@ $string['datarootpermission'] = 'Ovlasti nad mapom s podacima';
|
||||
$string['dbprefix'] = 'Prefiks tablice';
|
||||
$string['dirroot'] = 'Moodle mapa';
|
||||
$string['environmenthead'] = 'Provjera okruženja vašeg poslužitelja ...';
|
||||
$string['environmentsub2'] = 'Svaka inačica Moodle-a ima minimalne zahtjeve po pitanju odgovarajuće PHP inačice i nekoliko obaveznih PHP ekstenzija.
|
||||
$string['environmentsub2'] = 'Svaka inačica Moodle-a ima minimalne zahtjeve po pitanju odgovarajuće PHP inačice i nekoliko obveznih PHP ekstenzija.
|
||||
Puna provjera okruženja se obavlja prije svake instalacije ili nadogradnje postojeće inačice. Ako ne znate kako instalirati novu inačicu ili omogućiti PHP ekstenzije, kontaktirajte administratora vašeg poslužitelja.';
|
||||
$string['errorsinenvironment'] = 'Pogreške u okruženju poslužitelja!';
|
||||
$string['installation'] = 'Instalacija';
|
||||
$string['langdownloaderror'] = 'Nažalost, jezik "{$a}" nije instaliran. Proces instalacije će biti nastavljen na engleskom jeziku.';
|
||||
$string['memorylimithelp'] = '<p>PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.</p>
|
||||
|
||||
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.</p>
|
||||
<p>Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj omogućenih modula i/ili veći broj korisnika.</p>
|
||||
|
||||
<p>Preporučujemo da konfigurirate PHP s većim ograničenjem ako je moguće, recimo 40M. Postoji nekoliko načina na koje to možete napraviti:</p>
|
||||
<ol>
|
||||
@@ -67,7 +67,7 @@ $string['pathsrodataroot'] = 'Nije moguće zapisivanje u podatkovnu (dataroot) m
|
||||
$string['pathsroparentdataroot'] = 'Nije moguće zapisivati podatke u nadređenu mapu ({$a->parent}). Instalacijska skripta ne može stvoriti mapu za podatke ({$a->dataroot}).';
|
||||
$string['pathssubadmindir'] = 'Manji broj webhosting tvrtki koristi /admin kao posebni URL za Vaš pristup upravljanju vašim hosting paketom. Nažalost, to rezultira konfliktom sa standardnom lokacijom za Moodle administratorsku stranicu. Navedenu lokaciju unutar Moodle sustava možete preimenovati. Na primjer: <br /> <br /><em>moodleadmin</em><br /> <br />
|
||||
Ovo će promijeniti administratorsku poveznicu na Moodle sustavu u novu vrijednost.';
|
||||
$string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti upload datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.';
|
||||
$string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti prenešene datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.';
|
||||
$string['pathssubdirroot'] = 'Puna putanja (PATH) do Moodle instalacije.';
|
||||
$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu.
|
||||
Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara.
|
||||
@@ -78,7 +78,7 @@ $string['pathsunsecuredataroot'] = 'Podatkovna (dataroot) mapa nije sigurna';
|
||||
$string['pathswrongadmindir'] = 'Admin mapa ne postoji';
|
||||
$string['phpextension'] = 'PHP ekstenzija {$a}';
|
||||
$string['phpversion'] = 'PHP inačica';
|
||||
$string['phpversionhelp'] = '<p>Moodle zahtijeva najmanje PHP inačicu 4.3.0 ili 5.1.0 (5.0.x funkcionira uz brojne uočene probleme).</p> <p>Trenutno imate inačicu {$a}</p> <p>Morate nadograditi PHP ili premestiti Moodle instalaciju na web poslužitelj s novijom verzijom PHP-a!</br> (U slučaju inačice 5.0.x bilo bi najbolje da je vratite na inačicu 4.4.x)</p>';
|
||||
$string['phpversionhelp'] = '<p>Moodle zahtijeva najmanje PHP inačicu 4.3.0 ili 5.1.0 (5.0.x funkcionira uz brojne uočene probleme).</p> <p>Trenutno imate inačicu {$a}</p> <p>Morate nadograditi PHP ili premestiti Moodle instalaciju na web poslužitelj s novijom inačicom PHP-a!</br> (U slučaju inačice 5.0.x bilo bi najbolje da je vratite na inačicu 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Prikazana vam je ova stranica jer ste uspješno instalirali i pokrenuli <strong>{$a->packname} {$a->packversion}</strong> paket na svom poslužitelju. Čestitamo!';
|
||||
$string['welcomep30'] = 'Ova inačica <strong>{$a->installername}</strong> uključuje aplikacije za stvaranje okruženja u kojem će sustav <strong>Moodle</strong> uspješno funkcionirati, konkretno:';
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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['clitypevalue'] = 'tipo reikšmė';
|
||||
$string['clitypevaluedefault'] = 'tipo reikšmė, paspauskite „Enter“, jei norite naudoti numatytąją reikšmę ({$a})';
|
||||
$string['cliunknowoption'] = 'Neatpažintos parinktys: {$a} naudokite --žinyno parinktį.';
|
||||
$string['environmentrequireinstall'] = 'turi būti įdiegta ir įjungta';
|
||||
$string['environmentrequireversion'] = 'būtina naudoti versiją {$a->needed}, o jūs naudojate {$a->current}';
|
||||
@@ -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'] = 'Negalima sukurti kalbos katalogo';
|
||||
$string['cannotcreatetempdir'] = 'Negalima sukurti laikinojo katalogo';
|
||||
$string['cannotdownloadcomponents'] = 'Negalima atsisiųsti komponentų';
|
||||
$string['cannotdownloadzipfile'] = 'Negalima atsisiųsti ZIP failo';
|
||||
$string['cannotfindcomponent'] = 'Nepavyko rasti komponento';
|
||||
$string['cannotsavemd5file'] = 'Negalima įrašyti md5 failo';
|
||||
$string['cannotsavezipfile'] = 'Negalima įrašyti ZIP failo';
|
||||
$string['cannotunzipfile'] = 'Negalima išskleisti failo';
|
||||
$string['componentisuptodate'] = 'Komponentas atnaujintas';
|
||||
$string['downloadedfilecheckfailed'] = 'Nepavyko patikrinti atsisiųsto failo';
|
||||
$string['invalidmd5'] = 'Kintamojo patikra nepavyko – bandykite dar kartą';
|
||||
$string['missingrequiredfield'] = 'Trūksta būtino lauko';
|
||||
$string['remotedownloaderror'] = 'Nepavyko į serverį atsisiųsti komponento, patikrinkite tarpinio serverio parametrus, labai rekomenduojama naudoti PHP cURL plėtinį.<br /><br />Turite rankiniu būdu atsisiųsti <a href="{$a->url}">{$a->url}</a> failą, nukopijuoti jį į {$a->dest} serveryje ir ten jį išskleisti.';
|
||||
$string['wrongdestpath'] = 'Neteisingas paskirties kelias';
|
||||
$string['wrongsourcebase'] = 'Neteisingas šaltinio URL pagrindas';
|
||||
$string['wrongzipfilename'] = 'Neteisingas ZIP failo vardas';
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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['admindirname'] = 'Administratoriaus katalogas';
|
||||
$string['chooselanguagesub'] = 'Pasirinkite diegimo kalbą. Ši kalba bus naudojama ir kaip numatytoji svetainės kalba, nors vėliau ją bus galima pakeisti.';
|
||||
$string['clialreadyconfigured'] = 'Failas config.php jau yra, prašau naudoti admin/cli/install_database.php jei norite įrašyti šią svetainę.';
|
||||
$string['clialreadyinstalled'] = 'Failas config.php jau yra. Jei norite atnaujinti svetainę, naudokite admin/cli/upgrade.php.';
|
||||
$string['cliinstallheader'] = '„Moodle“ {$a} komandų eilutės diegimo programa';
|
||||
$string['databasehost'] = 'Duomenų bazės pagrindinis kompiuteris';
|
||||
$string['dataroot'] = 'Duomenų katalogas';
|
||||
$string['datarootpermission'] = 'Duomenų katalogo leidimai';
|
||||
$string['dbprefix'] = 'Lentelių priešvardis';
|
||||
$string['dirroot'] = '„Moodle“ katalogas';
|
||||
$string['environmenthead'] = 'Tikrinama aplinka...';
|
||||
$string['environmentsub2'] = 'Kiekvienas „Moodle“ leidimas turi minimalius PHP versijos ir privalomų PHP plėtinių skaičiaus reikalavimus. Prieš kiekvieną diegimą ir versijos naujinimą, išsamiai tikrinama aplinka. Jei nežinote, kaip įdiegti naują versiją arba įjungti PHP plėtinius, kreipkitės į serverio administratorių.';
|
||||
$string['errorsinenvironment'] = 'Aplinkos patikra nepavyko!';
|
||||
$string['installation'] = 'Diegimas';
|
||||
$string['langdownloaderror'] = 'Deja, {$a} kalbos atsisiųsti nepavyko. Diegimo procesas bus tęsiamas anglų kalba.';
|
||||
$string['memorylimithelp'] = '<p>Serverio PHP atminties limitas dabar nustatytas kaip {$a}.</p> <p>Vėliau dėl to „Moodle“ gali iškilti atminties problemų, ypač jei įjungta daug modulių ir (arba) yra daug vartotojų.</p> <p>Rekomenduojame sukonfigūruoti didesnį PHP limitą, jei galima, pvz., 40M. Galite pabandyti tai atlikti keliais būdais:</p> <ol> <li>Jei galite, pakartotinai sukompiliuokite PHP naudodami <i>--enable-memory-limit</i>. Taip „Moodle“ pati galės nustatyti atminties limitą.</li> <li>Jei turite prieigą prie php.ini failo, galite pakeisti <b>memory_limit</b> parametro reikšmę į 40M ar pan. Jei prieigos neturite, galite paprašyti, kad tai padarytų administratorius.</li> <li>Kai kuriuose PHP serveriuose „Moodle“ kataloge galite sukurti .htaccess failą, kuriame būtų ši eilutė : <blockquote><div>php_value memory_limit 40M</div></blockquote> <p>Tačiau kai kuriuose serveriuose dėl to neveiks <b>visi</b> PHP puslapiai (peržiūrėdami puslapius matysite klaidą), todėl the .htaccess failą teks pašalinti.</p></li> </ol>';
|
||||
$string['pathserrcreatedataroot'] = 'Diegimo programa negali sukurti duomenų katalogo ({$a->dataroot}).';
|
||||
$string['pathshead'] = 'Patvirtinti kelius';
|
||||
$string['pathsrodataroot'] = 'Į šakninį duomenų katalogą negalima įrašyti.';
|
||||
$string['pathsroparentdataroot'] = 'Į pirminį katalogą ({$a->parent}) negalima įrašyti. Diegimo programa negali sukurti katalogo ({$a->dataroot}).';
|
||||
$string['pathssubadmindir'] = 'Labai mažai žiniatinklio pagrindinių kompiuterių naudoja /admin kaip specialų URL, kad galėtumėte pasiekti valdymo skydą ar pan. Deja, dėl to kyla konfliktas su „Moodle“ administratoriaus puslapių standartine vieta. Tai galite ištaisyti, jei diegdami pervardysite administratoriaus katalogą ir tą naują pavadinimą įdėsite čia. Pavyzdžiui, <em>moodleadmin</em>. Taip bus ištaisyti administratoriaus saitai „Moodle“.';
|
||||
$string['pathssubdataroot'] = 'Reikalinga vieta, kur „Moodle“ galėtų saugoti įkeltus failus. Iš šio katalogo turi galėti skaityti IR Į JĮ ĮRAŠYTI žiniatinklio serverio vartotojas (paprastai „nobody“ arba „apache“), bet jis neturi būti tiesiogiai pasiekiamas per žiniatinklį. Diegimo programa bandys jį sukurti, jei jo dar nėra.';
|
||||
$string['pathssubdirroot'] = 'Visas „Moodle“ diegimo katalogo kelias.';
|
||||
$string['pathssubwwwroot'] = 'Visas žiniatinklio adresas, kur bus galima pasiekti „Moodle“. „Moodle“ negalima pasiekti naudojant kelis adresus. Jei jūsų svetainė turi kelis viešuosius adresus, turite nustatyti nuolatinį peradresavimą iš jų visų, išskyrus šį vieną. Jei svetainę galima pasiekti tiek iš intraneto, tiek iš interneto, čia naudokite viešąjį adresą ir nustatykite DNS, kad intraneto vartotojai taip pat galėtų naudoti viešąjį adresą. Jei adresas klaidingas, naršyklėje pakeiskite URL, kad pakartotinai paleidus diegti būtų naudojama kita reikšmė.';
|
||||
$string['pathsunsecuredataroot'] = 'Šakninio duomenų katalogo kelias nesaugus';
|
||||
$string['pathswrongadmindir'] = 'Nėra administratoriaus katalogo';
|
||||
$string['phpversionhelp'] = '<p>„Moodle“ reikalauja, kad PHP versija būtų bent 4.3.0 arba 5.1.0 (5.0.x versijoje yra daug problemų).</p> <p>Dabar naudojate versiją {$a}</p> <p>Turite atnaujinti PHP versiją arba perkelti į pagrindinį kompiuterį, kuriame veikia naujesnė PHP versija!<br /> (Jei naudojate 5.0.x versiją, taip pat galite paleisti senesnę 4.4.x versiją)</p>';
|
||||
$string['welcomep20'] = 'Matote šį puslapį, nes į kompiuterį sėkmingai įdiegėte ir paleidote <strong>{$a->packname} {$a->packversion}</strong> paketą. Sveikiname!';
|
||||
$string['welcomep30'] = 'Šiame <strong>{$a->installername}</strong> leidime yra taikomosios programos, skirtos aplinkai, kurioje veiks <strong>Moodle</strong>, sukurti:';
|
||||
$string['welcomep40'] = 'Pakete taip pat yra <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Visoms šio paketo taikomosioms programoms taikomos atitinkamos licencijos. Visas <strong>{$a->installername}</strong> paketas yra <a href="http://www.opensource.org/docs/definition_plain.html">atvirojo kodo</a> ir platinamas pagal <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> licenciją.';
|
||||
$string['welcomep60'] = 'Šiuose puslapiuose bus pateikta keletas paprastų veiksmų, kad būtų galima sukonfigūruoti ir nustatyti <strong>Moodle</strong> kompiuteryje. Galite priimti numatytuosius parametrus arba pasirinktinai juos pakeisti, kad atitiktų jūsų poreikius.';
|
||||
$string['welcomep70'] = 'Norėdami tęsti <strong>Moodle</strong> sąranką, spustelėkite žemiau esantį mygtuką Kitas.';
|
||||
$string['wwwroot'] = 'Žiniatinklio adresas';
|
||||
@@ -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['next'] = 'Pirmyn';
|
||||
@@ -78,11 +78,11 @@ $string['phpversionhelp'] = '<p>Moodle trenger en PHP versjon minst 4.3.0 eller
|
||||
<Du kjører nå versjon {$a}</p>
|
||||
<p>Du må oppgradere PHP eller flytte til en server med en nyere versjon av PHP!<br /> (I forhold til 5.0.x kan du også nedgradere til versjon 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Du ser denne siden fordi du nå med hell har installert og kjørt pakken <strong>{$a->packname} {$a->packversion}</strong> på datamaskinen din. Gratulerer!';
|
||||
$string['welcomep20'] = 'Du ser denne siden fordi du nå har fullført installeringen og kjøringen av pakken <strong>{$a->packname} {$a->packversion}</strong> på datamaskinen din. Gratulerer!';
|
||||
$string['welcomep30'] = 'Denne versjonen av <strong>{$a->installername}</strong> inneholder programmer for å lage et miljø som <strong>Moodle</strong> jobber i, nemlig:';
|
||||
$string['welcomep40'] = 'Denne pakken inkluderer også <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Bruken av alle applikasjoner i denne pakken er administrert av egne lisenser. Hele <strong>{$a->installername}</strong>-pakken er <a href="http://www.opensource.org/docs/definition_plain.html">
|
||||
åpen kildekode</a> og er distribuert under <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>-lisensen.';
|
||||
$string['welcomep60'] = 'De følgende sidene vil vise deg gjennom noen enkle steg for å konfigurere og sette opp <strong>Moodle</strong> på datamaskinen din. Du kan akseptere standard innstillinger, eller, hvis du vil, justere dem etter egne behov.';
|
||||
$string['welcomep60'] = 'De følgende sidene vil vise deg gjennom noen enkle steg for å konfigurere og sette opp <strong>Moodle</strong> på datamaskinen din. Du kan godta standardinnstillingene, eller justere dem etter egne behov hvis du vil.';
|
||||
$string['welcomep70'] = 'Klikk på "Neste" knappen under for å fortsette med <strong>Moodle</strong>-installasjonen';
|
||||
$string['wwwroot'] = 'Web addresse';
|
||||
|
||||
@@ -33,11 +33,15 @@ defined('MOODLE_INTERNAL') || die();
|
||||
$string['admindirname'] = 'Katalog admin';
|
||||
$string['availablelangs'] = 'Dostępne paczki językowe';
|
||||
$string['chooselanguagehead'] = 'Wybierz język';
|
||||
$string['chooselanguagesub'] = 'Proszę wybrać język TYLKO do instalacji. Stronę i języki dla użytkowników będzie można wybrać na następnym ekranie.';
|
||||
$string['clialreadyinstalled'] = 'Plik config.php już istnieje, użyj admin/cli/upgrade.php jeśli chcesz uaktualnić witrynę.';
|
||||
$string['chooselanguagesub'] = 'Proszę wybrać język do instalacji. Ten język będą również użyty jako domyślny język witryny, przy czym może być później zmieniony.';
|
||||
$string['clialreadyconfigured'] = 'Plik config.php już istnieje, użyj admin/cli/install_database.php jeśli chcesz zainstalować tę witrynę.';
|
||||
$string['clialreadyinstalled'] = 'Plik config.php już istnieje, użyj admin/cli/upgrade.php, jeśli chcesz uaktualnić witrynę.';
|
||||
$string['cliinstallheader'] = 'Program instalacyjny Moodle {$a} z linii poleceń';
|
||||
$string['databasehost'] = 'Host bazy danych';
|
||||
$string['databasename'] = 'Nazwa bazy danych';
|
||||
$string['dataroot'] = 'Katalog z danymi';
|
||||
$string['databasetypehead'] = 'Wybierz sterownik bazy danych';
|
||||
$string['dataroot'] = 'Katalog danych';
|
||||
$string['datarootpermission'] = 'Prawa katalogów danych';
|
||||
$string['dbprefix'] = 'Prefiks tabel';
|
||||
$string['dirroot'] = 'Katalog Moodle';
|
||||
$string['environmenthead'] = 'Sprawdzam środowisko (ustawienia) ...';
|
||||
@@ -64,10 +68,13 @@ $string['pathserrcreatedataroot'] = 'Katalog danych ({$a->dataroot}) nie może z
|
||||
$string['pathshead'] = 'Potwierdź ścieżki';
|
||||
$string['pathsrodataroot'] = 'Główny katalog danych nie ma uprawnień do zapisu. ';
|
||||
$string['pathsroparentdataroot'] = 'Nadrzędny katalog ({$a->parent}) jest tylko do odczytu. Katalog danych ({$a->dataroot}) nie może zostać utworzony przez instalator. ';
|
||||
$string['pathssubadmindir'] = 'Nieliczne portale używają URL /admin jako specjalnego adresu panelu sterowania. Niestety jest to sprzeczne ze standardowej lokalizacją folderu stron administratora Moodle. Można to naprawić poprzez zmianę nazwy katalogu administratora w instalacji i podanie tej nazwy tu, np.: <em>moodleadmin.</em> Linki administratora Moodle będą automatycznie poprawione.';
|
||||
$string['pathssubdataroot'] = 'Potrzebny jest obszar, gdzie Moodle może zapisywać ładowane do niego pliki. Katalog ten powinien mieć prawo do odczyt i ZAPISU przez użytkownika serwera WWW (zwykle "nobody" lub "apache"), ale może być być dostępny bezpośrednio przez sieć. Instalator spróbuje go utworzyć, jeśli nie istnieje.';
|
||||
$string['pathssubdirroot'] = 'Pełna ścieżka do katalogu z instalacją Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Pełny adres internetowy, pod którym Moodle będzie dostępny. Moodle nie może być dostępny przy użyciu wielu adresów. Jeśli twoja witryna ma kilka adresów publicznych, należy skonfigurować trwałe przekierowania z wszystkich z nich na jeden. Jeśli Twoja witryna jest dostępna zarówno z intranetu i Internetu, korzystaj z publicznego adresu i ustaw DNS tak, aby użytkownicy Intranetu korzystali też z adresu publicznego. Jeśli adres nie jest poprawny, należy ponownie uruchomić instalację z innym adresem.';
|
||||
$string['pathsunsecuredataroot'] = 'Lokalizacja głównego katalogu danych nie jest bezpieczna';
|
||||
$string['pathswrongadmindir'] = 'Katalog admin nie istnieje';
|
||||
$string['phpextension'] = '{$a} rozszerzenie PHP';
|
||||
$string['phpextension'] = 'rozszerzenie PHP {$a}';
|
||||
$string['phpversion'] = 'Wersja PHP';
|
||||
$string['phpversionhelp'] = '<p>Moodle wymaga wersji PHP co najmniej 4.3.0 lub 5.1.0 (5.0.x posiada kilka znanych problemów).</p>
|
||||
<p>Obecnie jest uruchomiona wersja {$a}</p>
|
||||
|
||||
@@ -34,6 +34,7 @@ $string['admindirname'] = 'Каталог администратора';
|
||||
$string['availablelangs'] = 'Доступные языковые пакеты';
|
||||
$string['chooselanguagehead'] = 'Выберите язык';
|
||||
$string['chooselanguagesub'] = 'Сейчас необходимо выбрать язык ТОЛЬКО для сообщений во время установки. Язык сайта и пользовательских интерфейсов можно будет указать далее в процессе установки.';
|
||||
$string['clialreadyconfigured'] = 'Файл config.php уже существует. Если Вы хотите установить этот сайт, используйте admin/cli/install_database.php.';
|
||||
$string['clialreadyinstalled'] = 'Файл config.php уже существует. Если Вы хотите обновить сайт, то используйте скрипт admin/cli/upgrade.php.';
|
||||
$string['cliinstallheader'] = 'Программа установки Moodle {$a} в режиме командной строки';
|
||||
$string['databasehost'] = 'Сервер баз данных';
|
||||
|
||||
@@ -45,8 +45,8 @@ $string['datarootpermission'] = 'Овлашћења над директориј
|
||||
$string['dbprefix'] = 'Префикс табеле';
|
||||
$string['dirroot'] = 'Moodle директоријум';
|
||||
$string['environmenthead'] = 'Проверавање Вашег окружења...';
|
||||
$string['environmentsub2'] = 'Свака верзија Moodlea има минимум захтева по питању одговарајуће PHP верзије и неколико обавезних PHP екстензија.
|
||||
Пуна провера окружења се врши пре сваке инсталације или ажурирања постојеће верзије. Уколико не знате како да инсталирате нову верзију или омогућите PHP ектензије контактирајте Вашег сервер администратора.';
|
||||
$string['environmentsub2'] = 'Свако издање Moodlea има минимум захтева по питању одговарајуће PHP верзије и неколико обавезних PHP екстензија.
|
||||
Комплетна провера окружења се врши пре сваке инсталације и надоградње постојеће верзије. Уколико не знате како да инсталирате нову верзију или омогућите PHP екстензије контактирајте свог администратора сервера.';
|
||||
$string['errorsinenvironment'] = 'Провера окружења није прошла!';
|
||||
$string['installation'] = 'Инсталација';
|
||||
$string['langdownloaderror'] = 'Нажалост, језик "{$a}" се не може преузети. Процес инсталације биће настављен на енглеском језику.';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user