Compare commits
529 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff63a3ad58 | |||
| ce44bf4441 | |||
| 53118fe1ea | |||
| 60c7fc96b2 | |||
| 3d9514b363 | |||
| 79d86ffcdb | |||
| c4d19c8789 | |||
| b99ee21bfc | |||
| bc7fdb4279 | |||
| 282183647b | |||
| edd4257a1a | |||
| a46405df3a | |||
| 9bc298d287 | |||
| 74b266a332 | |||
| eabdc81c40 | |||
| 6211ff4c12 | |||
| 8a73556f8d | |||
| 3bcff38015 | |||
| d8e550e4ac | |||
| 845cfc3389 | |||
| 62d543748d | |||
| a5b62b8f31 | |||
| 9b025da732 | |||
| da427d1e51 | |||
| f87d5a71ef | |||
| 48fb811b4c | |||
| e4224a5ae1 | |||
| c4851e8085 | |||
| 04678efd11 | |||
| 84fad57f1c | |||
| 3a8714c3c6 | |||
| cb2829dea3 | |||
| 77283f1812 | |||
| c43e6006e7 | |||
| 2dab9d1943 | |||
| 485ddbd611 | |||
| aafded3f42 | |||
| e3ac126161 | |||
| 89fbf2e874 | |||
| b733b0ac71 | |||
| a7e956b403 | |||
| 44999a9ed2 | |||
| f7c197eddb | |||
| f9e009a744 | |||
| 18f6238b88 | |||
| 906ad7d27a | |||
| df79fff95b | |||
| a82535f068 | |||
| 917cea604c | |||
| 4aaac325f2 | |||
| 0d79d96566 | |||
| 561bd396c1 | |||
| c4b521116f | |||
| 152dbe5d52 | |||
| 37ceb6cbed | |||
| 1139dff6ef | |||
| d402e05ba7 | |||
| 87ea3f04df | |||
| 35ce18a8b1 | |||
| 391f8b395a | |||
| f1c3b5b3b3 | |||
| b5b882df60 | |||
| 93efeb5352 | |||
| 881d1d8aed | |||
| 9740e053f2 | |||
| b27daf9e73 | |||
| d0d6d5fc72 | |||
| 5aa4e27404 | |||
| 046c9872a6 | |||
| edf170c341 | |||
| ee8c1abcea | |||
| 3fd76b3de5 | |||
| 6f7eeb3775 | |||
| 3b6796e0f4 | |||
| 59d01f93cd | |||
| aa7d8ef61f | |||
| c64d22325e | |||
| 33abc6e173 | |||
| 272dfda3cf | |||
| e61d57b5c1 | |||
| 1d6d520a5a | |||
| 41db2a5afc | |||
| 3b5513528e | |||
| 33407de5b6 | |||
| efd2f83e4a | |||
| b9697365a1 | |||
| 6b0ada1e6e | |||
| c2ef0e4982 | |||
| 35776aab75 | |||
| 9416bcf43d | |||
| 80311cabde | |||
| 418a22905c | |||
| ff203527e7 | |||
| c777ad2785 | |||
| 502821bbcc | |||
| 238d0ca1cd | |||
| 8516492cc4 | |||
| 1754dc2cb6 | |||
| 9b5de362cf | |||
| 8be3d5ab03 | |||
| db16ec2753 | |||
| 691b9c81cb | |||
| 8434e7de85 | |||
| cd2ae155de | |||
| d5fd21b6ef | |||
| 98197952cc | |||
| 8648334966 | |||
| 2878842742 | |||
| 00c7657edf | |||
| 44da3c50fe | |||
| ea67a0679d | |||
| 75441ef5b2 | |||
| 3a15a7519c | |||
| d2d17341e8 | |||
| 09725180cf | |||
| c8ee9dde60 | |||
| e2694e9dd6 | |||
| b1c5155cbc | |||
| 1025a9123f | |||
| 4e15f69cb1 | |||
| c034e59bee | |||
| dd5e3ac222 | |||
| db05d59534 | |||
| dde33d64a2 | |||
| 6ab522802f | |||
| 9081825ea3 | |||
| 777354509d | |||
| 456352585a | |||
| 335636f55d | |||
| 98268916ff | |||
| ac2b4fb66a | |||
| e191c71d55 | |||
| 9d53135aaf | |||
| 48a8f1c7a0 | |||
| 760cab0695 | |||
| 16ab3642e7 | |||
| 1ffbad6404 | |||
| 4740c0a64f | |||
| 672bea4cfe | |||
| c35fa27c89 | |||
| d50d615d7f | |||
| 0c09da65ce | |||
| 6244126d6d | |||
| 52d2556ee5 | |||
| 86606ad75d | |||
| 25ba0f4839 | |||
| a83497790f | |||
| 5004ad85b7 | |||
| caa0e70577 | |||
| 6e763244ed | |||
| 46ba9fded8 | |||
| 59d9b1b99d | |||
| 2558abe170 | |||
| 60e1dfd078 | |||
| 226398e7d0 | |||
| 0f46bd4550 | |||
| 4981d12420 | |||
| 4f977aea5e | |||
| 82525f5963 | |||
| 887d6e175e | |||
| 6738413b33 | |||
| 92e9c3d09f | |||
| 8d800a1b8e | |||
| b66c3031f6 | |||
| a4848f6ef7 | |||
| ad7d20c380 | |||
| 7358b1742f | |||
| cc3f17d86d | |||
| 0e8aa5027e | |||
| 84b3cbab33 | |||
| f2c33d0b69 | |||
| 696527c0fe | |||
| 2c484717e1 | |||
| 0cb1a22cba | |||
| 437637a11d | |||
| 5ba6db698d | |||
| ca93b3af4e | |||
| 1778232f45 | |||
| c5c735f00e | |||
| d01c6b269b | |||
| 86b1d0eb5f | |||
| 5553d3d60f | |||
| aedc642091 | |||
| e72606c83f | |||
| ad87b3a2cc | |||
| e22cff45ab | |||
| 18f9ad377f | |||
| add569ebe0 | |||
| 50cef6aa36 | |||
| 976a9da987 | |||
| 34983250b1 | |||
| ae48ff8a17 | |||
| 8715a53d90 | |||
| 5364f9c7cd | |||
| f5ba035015 | |||
| 5cb3d27681 | |||
| 57ca2e4375 | |||
| 2689298c8f | |||
| af861e14dc | |||
| 859d840627 | |||
| 8b1cb823de | |||
| 3e0e4917d8 | |||
| 7516f96676 | |||
| 2ed34366f6 | |||
| 85b1e97857 | |||
| aae3d3445e | |||
| 92bff8685c | |||
| c116bd70a0 | |||
| e4feb70b66 | |||
| 785bc3bca9 | |||
| e7afca9468 | |||
| 768a2ceafd | |||
| 2741c017cb | |||
| cafabb5fd0 | |||
| cd2a0bf715 | |||
| fff33fd66d | |||
| 30939d2a9a | |||
| 8c2eca7d16 | |||
| f605b97aa4 | |||
| b855945836 | |||
| f062a78344 | |||
| 67728fe717 | |||
| 77957668cc | |||
| e9c9610f8b | |||
| 6f0f18a4d4 | |||
| 26d2edcc82 | |||
| f31ee1292a | |||
| 2104c9fdc3 | |||
| 7c6d4ed0a7 | |||
| 33b59af020 | |||
| eccf42746c | |||
| 562dbe408e | |||
| 035997329a | |||
| 4abc5a1a2c | |||
| db8e84ae1a | |||
| 077fde5dc5 | |||
| 8cfc92afdd | |||
| 5747c6bccd | |||
| 5c3cb55b5d | |||
| d1085311c9 | |||
| 5e6f2cda64 | |||
| e6b958d4db | |||
| 90c6925bdb | |||
| 0a1c7a188a | |||
| 13815377b5 | |||
| ea29e3141a | |||
| 1c409bfe80 | |||
| 113f51d7c9 | |||
| 36c7b8665f | |||
| aaed6d7800 | |||
| 1e5b1d6dad | |||
| a8d7f5cf15 | |||
| c67ed6adfe | |||
| 9289c14e0c | |||
| 1c1455f29a | |||
| 9228a5d347 | |||
| fc0f1c3cbc | |||
| db1052ce5c | |||
| 0a7db801f3 | |||
| 1a2b345232 | |||
| 80f497ea40 | |||
| bbb553e077 | |||
| 08363c5c80 | |||
| 845cc02904 | |||
| 5735b5a2ac | |||
| 8c4fcc0e1a | |||
| d9cada0a9d | |||
| d0154d2996 | |||
| 05ab3435c0 | |||
| 09e49e5c6e | |||
| 8aaf7adccb | |||
| e1361139d9 | |||
| 373d3178e4 | |||
| bda487868e | |||
| 2cbbf5d829 | |||
| 54dd6ee750 | |||
| ba804c9ea9 | |||
| 577777cf03 | |||
| 500ade05cb | |||
| 30c9794aec | |||
| 4891199f10 | |||
| 50b252cdde | |||
| 50e8e4d00b | |||
| aa63be7f5f | |||
| 4df574f9e5 | |||
| b843f7aee2 | |||
| 198178ff2a | |||
| 35e19e2acd | |||
| 50675bf549 | |||
| 7ad8f46848 | |||
| 410d0dc243 | |||
| af277cc994 | |||
| 194e79536e | |||
| d0bb10027b | |||
| 2ade1b52f9 | |||
| 24d9d1811f | |||
| 88852071b5 | |||
| d695785710 | |||
| 2d04a1fe31 | |||
| 6b7cd710cd | |||
| 0222cd9545 | |||
| 10839ace75 | |||
| b865c07b69 | |||
| 60b6b6280b | |||
| d3187c299a | |||
| daa3c5ff1b | |||
| 7765e94f5e | |||
| 14a695f607 | |||
| 31fabbdbaa | |||
| add494f1af | |||
| 860c7e82bd | |||
| 28c9348405 | |||
| 40d651bbbb | |||
| 022a3555d1 | |||
| f0f2014316 | |||
| ad1a52e07c | |||
| d205afe662 | |||
| 9273bd1abb | |||
| 11d19d4cfb | |||
| 786b831653 | |||
| 40755f9584 | |||
| 12f9c36df8 | |||
| 66652c60c0 | |||
| 20a1f8a9c5 | |||
| 2a8690dab5 | |||
| 68164ad218 | |||
| 249d073058 | |||
| 3147b59c8a | |||
| 0a99c77ede | |||
| 25878bcd22 | |||
| 3f676aa5bd | |||
| 41a5203c2a | |||
| 583c0cf67f | |||
| f0f3338000 | |||
| 678e90a080 | |||
| 1172c2bd2f | |||
| 792a3c4ea9 | |||
| 4c6962068a | |||
| 2d39f72b59 | |||
| 790ad23dd6 | |||
| 00d62e135d | |||
| 700bbb5fb9 | |||
| ff61f14c04 | |||
| 125759ddf4 | |||
| df87119b5a | |||
| a2b837e5be | |||
| 2bb3259fc3 | |||
| 6b69bf463a | |||
| 8a7cc012fd | |||
| fd0758da1b | |||
| 675c2b8543 | |||
| 7e0deaf3fd | |||
| fede879cf2 | |||
| a1db00dd1a | |||
| bb6b275906 | |||
| b666bddae2 | |||
| e1a809b36f | |||
| 1e112f8801 | |||
| 3e8d7ca16e | |||
| daccc92d9e | |||
| 3c6510c106 | |||
| 91cb7bdab5 | |||
| 2b7024847d | |||
| e36ab38642 | |||
| cffbc80ac7 | |||
| 3f6970bf92 | |||
| 65c8ccc02e | |||
| a573a5157e | |||
| e4db46b4d9 | |||
| 99cd723af5 | |||
| 94167a2dee | |||
| 7cdb725081 | |||
| 05daea0f6d | |||
| 6b15d50a60 | |||
| aa57854075 | |||
| 7ae2136b3f | |||
| 7be6c09db5 | |||
| 58f8b73f26 | |||
| 7ab5b064a6 | |||
| 2974030611 | |||
| a7783bf260 | |||
| 093825d81e | |||
| 7116aca6af | |||
| ed7e6a7356 | |||
| c366bea3cf | |||
| 33672ace5f | |||
| 5fc1b61a88 | |||
| 2ed38452aa | |||
| ed78617491 | |||
| 9b65e5841e | |||
| b04027c0cf | |||
| e6084683c8 | |||
| 119b5fdc8b | |||
| b437a680d2 | |||
| 631aedabb4 | |||
| 88fbc9a7ef | |||
| 3f22e75663 | |||
| 9ac00a5394 | |||
| 45a6d31c4f | |||
| ce86eb4d08 | |||
| 85aa469960 | |||
| 6d3249780b | |||
| 97b53d6c05 | |||
| bb67dc33e1 | |||
| ec5c45c4ed | |||
| 58ee763bfb | |||
| 05165a7f60 | |||
| 0671db29ce | |||
| c59d51b67d | |||
| b050380df1 | |||
| 0f5c4b8397 | |||
| a0a02f4e0d | |||
| 1530136c20 | |||
| 07a145dcfc | |||
| 947d7759bb | |||
| 4edc94cbf3 | |||
| 83fbe988f0 | |||
| 7a054265dc | |||
| b7f0b0b12b | |||
| 614ac18b11 | |||
| 8673ce8201 | |||
| 7056f36f3c | |||
| bde7deec36 | |||
| 29a33233fc | |||
| fd7255ace0 | |||
| 8e977618f8 | |||
| befd59097b | |||
| e4c9460c0b | |||
| 28ac357f86 | |||
| 1077bf7086 | |||
| fe5a985c0e | |||
| 250b340003 | |||
| e7f72fb5d6 | |||
| 32efb09e62 | |||
| b5b8aac98a | |||
| 6b3177344d | |||
| b92083421c | |||
| 77393dec21 | |||
| 9844498b0a | |||
| c21f901559 | |||
| a698454089 | |||
| b3557ac52d | |||
| fa501712c7 | |||
| b4271570c6 | |||
| 77ef5e06f9 | |||
| cdf30c74d8 | |||
| 5df0a6b47e | |||
| bd390545b1 | |||
| b06143c5c2 | |||
| 7737d24b92 | |||
| 561cbb8967 | |||
| bdd6847fc2 | |||
| 102d0bd05b | |||
| 6b43759eff | |||
| 6588886965 | |||
| e0c567c3be | |||
| d5e317882d | |||
| ceed31ad6b | |||
| 6ab9c3e2ad | |||
| bbd89d7b10 | |||
| 08153276ac | |||
| d27a76c3e3 | |||
| 6d661aa2f1 | |||
| 1ab628b72e | |||
| c84b70456a | |||
| 11a3dd0c0e | |||
| a59f0f25cd | |||
| 35eb1a0f0c | |||
| 7189c6102f | |||
| 2e4678332a | |||
| cb3a1e355b | |||
| cfe32be822 | |||
| 654338074e | |||
| c0eee4898a | |||
| 3a3120e206 | |||
| f34cb5797c | |||
| 8146d3f12d | |||
| 74fae5244c | |||
| 1595c976dd | |||
| 5a05aa9633 | |||
| babf5f522e | |||
| 919105e5d1 | |||
| cc17d246e4 | |||
| ab88177b5e | |||
| f58585807c | |||
| 817fcbb549 | |||
| 5371fa1928 | |||
| 6c990952c9 | |||
| 1b1c35541a | |||
| 360769aa0f | |||
| 49d9947914 | |||
| 4ad7bc830e | |||
| 799de15145 | |||
| f4dfb810c8 | |||
| c8cac02c99 | |||
| 879c31c1ba | |||
| 9111b11b7b | |||
| 8722439751 | |||
| bafffec181 | |||
| 9cd1f8ffe6 | |||
| cd029574b6 | |||
| 14d15f125e | |||
| 2afda054e8 | |||
| 5c0c094f3c | |||
| 689a3bcd17 | |||
| d37de5e0df | |||
| a08d03a2c0 | |||
| a2d928b143 | |||
| 2904faa0eb | |||
| bd916ad1ee | |||
| e81507f6b6 | |||
| 800abd6faf | |||
| bb7f95f830 | |||
| 41b997b1ff | |||
| 6d89ac64ab | |||
| f4671476ff | |||
| fa3a1652bf | |||
| a66863c357 | |||
| 4d48a65159 | |||
| e765d3c396 | |||
| 2f9ac3fe1e | |||
| b91833db8a | |||
| 70c2ec0ba2 | |||
| 2f2242efa2 | |||
| 43b135e598 | |||
| e0b818cde0 | |||
| d6d63941d7 | |||
| 130dd42130 | |||
| 35870a76db |
+2
-12
@@ -240,18 +240,8 @@ echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
$languages = get_string_manager()->get_list_of_translations();
|
||||
// format the langs nicely - 3 per line
|
||||
$c = 0;
|
||||
$langlist = '';
|
||||
foreach ($languages as $key=>$lang) {
|
||||
$c++;
|
||||
$length = iconv_strlen($lang, 'UTF-8');
|
||||
$padded = $lang.str_repeat(' ', 38-$length);
|
||||
$langlist .= $padded;
|
||||
if ($c % 3 == 0) {
|
||||
$langlist .= "\n";
|
||||
}
|
||||
}
|
||||
// Do not put the langs into columns because it is not compatible with RTL.
|
||||
$langlist = implode("\n", $languages);
|
||||
$default = $CFG->lang;
|
||||
cli_heading(get_string('availablelangs', 'install'));
|
||||
echo $langlist."\n";
|
||||
|
||||
+1
-1
@@ -470,7 +470,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
|
||||
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
|
||||
'Copyright © 1999 onwards, Martin Dougiamas<br />'.
|
||||
'and <a href="http://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
|
||||
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
|
||||
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
+5
-10
@@ -59,16 +59,11 @@ $courseid = $course->id;
|
||||
$contextname = print_context_name($context);
|
||||
|
||||
// Get the user_selector we will need.
|
||||
// Teachers within a course just get to see the same list of people they can
|
||||
// assign roles to. Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('context' => $context, 'roleid' => 0);
|
||||
if (has_capability('moodle/role:manage', $context)) {
|
||||
$userselector = new potential_assignees_course_and_above('reportuser', $options);
|
||||
} else {
|
||||
$userselector = roles_get_potential_user_selector($context, 'reportuser', $options);
|
||||
}
|
||||
$userselector->set_multiselect(false);
|
||||
$userselector->set_rows(10);
|
||||
// Teachers within a course just get to see the same list of enrolled users.
|
||||
// Admins (people with moodle/role:manage) can run this report for any user.
|
||||
$options = array('accesscontext' => $context);
|
||||
$userselector = new role_check_users_selector('reportuser', $options);
|
||||
$userselector->set_rows(20);
|
||||
|
||||
// Work out an appropriate page title.
|
||||
$title = get_string('checkpermissionsin', 'role', $contextname);
|
||||
|
||||
@@ -1076,6 +1076,134 @@ class potential_assignees_below_course extends role_assign_user_selector_base {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the selection of users in the check permissions page.
|
||||
*
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
*/
|
||||
class role_check_users_selector extends user_selector_base {
|
||||
const MAX_ENROLLED_PER_PAGE = 100;
|
||||
const MAX_POTENTIAL_PER_PAGE = 100;
|
||||
|
||||
/** @var bool limit listing of users to enrolled only */
|
||||
var $onlyenrolled;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name the control name/id for use in the HTML.
|
||||
* @param array $options other options needed to construct this selector.
|
||||
* You must be able to clone a userselector by doing new get_class($us)($us->get_name(), $us->get_options());
|
||||
*/
|
||||
public function __construct($name, $options) {
|
||||
if (!isset($options['multiselect'])) {
|
||||
$options['multiselect'] = false;
|
||||
}
|
||||
parent::__construct($name, $options);
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
if ($coursecontext and $coursecontext->id != SITEID and !has_capability('moodle/role:manage', $coursecontext)) {
|
||||
// Prevent normal teachers from looking up all users.
|
||||
$this->onlyenrolled = true;
|
||||
} else {
|
||||
$this->onlyenrolled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function find_users($search) {
|
||||
global $DB;
|
||||
|
||||
list($wherecondition, $params) = $this->search_sql($search, 'u');
|
||||
|
||||
$fields = 'SELECT ' . $this->required_fields_sql('u');
|
||||
$countfields = 'SELECT COUNT(1)';
|
||||
|
||||
$coursecontext = $this->accesscontext->get_course_context(false);
|
||||
|
||||
if ($coursecontext and $coursecontext != SITEID) {
|
||||
$sql1 = " FROM {user} u
|
||||
JOIN {user_enrolments} ue ON (ue.userid = u.id)
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
|
||||
WHERE $wherecondition";
|
||||
$params['courseid1'] = $coursecontext->instanceid;
|
||||
|
||||
if ($this->onlyenrolled) {
|
||||
$sql2 = null;
|
||||
} else {
|
||||
$sql2 = " FROM {user} u
|
||||
LEFT JOIN ({user_enrolments} ue
|
||||
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid2)) ON (ue.userid = u.id)
|
||||
WHERE $wherecondition
|
||||
AND ue.id IS NULL";
|
||||
$params['courseid2'] = $coursecontext->instanceid;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($this->onlyenrolled) {
|
||||
// Bad luck, current user may not view only enrolled users.
|
||||
return array();
|
||||
}
|
||||
$sql1 = null;
|
||||
$sql2 = " FROM {user} u
|
||||
WHERE $wherecondition";
|
||||
}
|
||||
|
||||
$order = " ORDER BY lastname ASC, firstname ASC";
|
||||
|
||||
$params['contextid'] = $this->accesscontext->id;
|
||||
|
||||
$result = array();
|
||||
|
||||
if ($search) {
|
||||
$groupname1 = get_string('enrolledusersmatching', 'enrol', $search);
|
||||
$groupname2 = get_string('potusersmatching', 'role', $search);
|
||||
} else {
|
||||
$groupname1 = get_string('enrolledusers', 'enrol');
|
||||
$groupname2 = get_string('potusers', 'role');
|
||||
}
|
||||
|
||||
if ($sql1) {
|
||||
$enrolleduserscount = $DB->count_records_sql($countfields . $sql1, $params);
|
||||
if (!$this->is_validating() and $enrolleduserscount > $this::MAX_ENROLLED_PER_PAGE) {
|
||||
$result[$groupname1] = array();
|
||||
$toomany = $this->too_many_results($search, $enrolleduserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
|
||||
} else {
|
||||
$enrolledusers = $DB->get_records_sql($fields . $sql1 . $order, $params);
|
||||
if ($enrolledusers) {
|
||||
$result[$groupname1] = $enrolledusers;
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$result[''] = array();
|
||||
}
|
||||
}
|
||||
if ($sql2) {
|
||||
$otheruserscount = $DB->count_records_sql($countfields . $sql2, $params);
|
||||
if (!$this->is_validating() and $otheruserscount > $this::MAX_POTENTIAL_PER_PAGE) {
|
||||
$result[$groupname2] = array();
|
||||
$toomany = $this->too_many_results($search, $otheruserscount);
|
||||
$result[implode(' - ', array_keys($toomany))] = array();
|
||||
} else {
|
||||
$otherusers = $DB->get_records_sql($fields . $sql2 . $order, $params);
|
||||
if ($otherusers) {
|
||||
$result[$groupname2] = $otherusers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function get_options() {
|
||||
global $CFG;
|
||||
$options = parent::get_options();
|
||||
$options['file'] = $CFG->admin . '/roles/lib.php';
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User selector subclass for the list of potential users on the assign roles page,
|
||||
* when we are assigning in a context at or above the course level. In this case we
|
||||
|
||||
@@ -35,10 +35,11 @@ if ($hassiteconfig
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'), new lang_string('coursehelpshowgrades'), 1,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
|
||||
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
||||
if (isset($CFG->maxbytes)) {
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
|
||||
} else {
|
||||
$choices = get_max_upload_sizes();
|
||||
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'), new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ if ($hassiteconfig
|
||||
'institution' => new lang_string('institution'),
|
||||
)));
|
||||
$temp->add(new admin_setting_configcheckbox('enablegravatar', new lang_string('enablegravatar', 'admin'), new lang_string('enablegravatar_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('gravatardefaulturl', new lang_string('gravatardefaulturl', 'admin'), new lang_string('gravatardefaulturl_help', 'admin'), 'mm'));
|
||||
}
|
||||
|
||||
$ADMIN->add('roles', $temp);
|
||||
|
||||
@@ -488,7 +488,7 @@ class tool_customlang_translator implements renderable {
|
||||
list($insql, $inparams) = $DB->get_in_or_equal($filter->component, SQL_PARAMS_NAMED);
|
||||
|
||||
$csql = "SELECT COUNT(*)";
|
||||
$fsql = "SELECT s.id, s.*, c.name AS component";
|
||||
$fsql = "SELECT s.*, c.name AS component";
|
||||
$sql = " FROM {tool_customlang_components} c
|
||||
JOIN {tool_customlang} s ON s.componentid = c.id
|
||||
WHERE s.lang = :lang
|
||||
|
||||
@@ -67,3 +67,7 @@
|
||||
#page-admin-tool-customlang-index .continuebutton {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.path-admin-tool-customlang #translator .standard.master.cell.c2 {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@@ -111,10 +111,13 @@ $string['checkindexes'] = 'Check indexes';
|
||||
$string['check_indexes'] = 'Look for missing DB indexes';
|
||||
$string['checkoraclesemantics'] = 'Check semantics';
|
||||
$string['check_oracle_semantics'] = 'Look for incorrect length semantics';
|
||||
$string['duplicateindexname'] = 'Duplicate index name';
|
||||
$string['incorrectfieldname'] = 'Incorrect name';
|
||||
$string['index'] = 'Index';
|
||||
$string['indexes'] = 'Indexes';
|
||||
$string['indexnameempty'] = 'Index name is empty';
|
||||
$string['integerincorrectlength'] = 'Incorrect length for integer field';
|
||||
$string['incorrectindexname'] = 'Incorrect index name';
|
||||
$string['incorrectkeyname'] = 'Incorrect key name';
|
||||
$string['incorrecttablename'] = 'Incorrect table name';
|
||||
$string['key'] = 'Key';
|
||||
|
||||
@@ -97,7 +97,7 @@ $usersmissingcaps = $webservicemanager->get_missing_capabilities_by_users($allow
|
||||
|
||||
//add the missing capabilities to the allowed users object to be displayed by renderer
|
||||
foreach ($allowedusers as &$alloweduser) {
|
||||
if (!is_siteadmin($alloweduser->id) and key_exists($alloweduser->id, $usersmissingcaps)) {
|
||||
if (!is_siteadmin($alloweduser->id) and array_key_exists($alloweduser->id, $usersmissingcaps)) {
|
||||
$alloweduser->missingcapabilities = implode(', ', $usersmissingcaps[$alloweduser->id]);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-7
@@ -65,7 +65,7 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
$authdb->Close();
|
||||
// user exists externally
|
||||
// check username/password internally
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id, 'auth'=>$this->authtype))) {
|
||||
return validate_internal_user_password($user, $password);
|
||||
}
|
||||
} else {
|
||||
@@ -191,8 +191,16 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
* @return bool True on success
|
||||
*/
|
||||
function user_update_password($user, $newpassword) {
|
||||
global $DB;
|
||||
|
||||
if ($this->is_internal()) {
|
||||
return update_internal_user_password($user, $newpassword);
|
||||
$puser = $DB->get_record('user', array('id'=>$user->id), '*', MUST_EXIST);
|
||||
if (update_internal_user_password($puser, $newpassword)) {
|
||||
$user->password = $puser->password;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// we should have never been called!
|
||||
return false;
|
||||
@@ -346,7 +354,7 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
if ($verbose) {
|
||||
mtrace(get_string('auth_dbuserstoadd','auth_db',count($add_users)));
|
||||
}
|
||||
$transaction = $DB->start_delegated_transaction();
|
||||
// Do not use transactions around this foreach, we want to skip problematic users, not revert everything.
|
||||
foreach($add_users as $user) {
|
||||
$username = $user;
|
||||
$user = $this->get_userinfo_asobj($user);
|
||||
@@ -372,9 +380,16 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
} else {
|
||||
$user->timecreated = time();
|
||||
$user->timemodified = $user->timecreated;
|
||||
$id = $DB->insert_record ('user', $user); // it is truly a new user
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)));
|
||||
try {
|
||||
$id = $DB->insert_record('user', $user); // it is truly a new user
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)));
|
||||
}
|
||||
} catch (moodle_exception $e) {
|
||||
if ($verbose) {
|
||||
mtrace("\t".get_string('auth_dbinsertusererror', 'auth_db', $user->username));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// if relevant, tag for password generation
|
||||
if ($this->is_internal()) {
|
||||
@@ -383,7 +398,6 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
}
|
||||
}
|
||||
}
|
||||
$transaction->allow_commit();
|
||||
unset($add_users); // free mem
|
||||
}
|
||||
return 0;
|
||||
|
||||
+21
-16
@@ -378,23 +378,28 @@ class auth_plugin_mnet extends auth_plugin_base {
|
||||
$extra = $DB->get_records_sql($sql);
|
||||
|
||||
$keys = array_keys($courses);
|
||||
$defaultrole = reset(get_archetype_roles('student'));
|
||||
//$defaultrole = get_default_course_role($ccache[$shortname]); //TODO: rewrite this completely, there is no default course role any more!!!
|
||||
foreach ($keys AS $id) {
|
||||
if ($courses[$id]->visible == 0) {
|
||||
unset($courses[$id]);
|
||||
continue;
|
||||
}
|
||||
$courses[$id]->cat_id = $courses[$id]->category;
|
||||
$courses[$id]->defaultroleid = $defaultrole->id;
|
||||
unset($courses[$id]->category);
|
||||
unset($courses[$id]->visible);
|
||||
$studentroles = get_archetype_roles('student');
|
||||
if (!empty($studentroles)) {
|
||||
$defaultrole = reset($studentroles);
|
||||
//$defaultrole = get_default_course_role($ccache[$shortname]); //TODO: rewrite this completely, there is no default course role any more!!!
|
||||
foreach ($keys AS $id) {
|
||||
if ($courses[$id]->visible == 0) {
|
||||
unset($courses[$id]);
|
||||
continue;
|
||||
}
|
||||
$courses[$id]->cat_id = $courses[$id]->category;
|
||||
$courses[$id]->defaultroleid = $defaultrole->id;
|
||||
unset($courses[$id]->category);
|
||||
unset($courses[$id]->visible);
|
||||
|
||||
$courses[$id]->cat_name = $extra[$id]->cat_name;
|
||||
$courses[$id]->cat_description = $extra[$id]->cat_description;
|
||||
$courses[$id]->defaultrolename = $defaultrole->name;
|
||||
// coerce to array
|
||||
$courses[$id] = (array)$courses[$id];
|
||||
$courses[$id]->cat_name = $extra[$id]->cat_name;
|
||||
$courses[$id]->cat_description = $extra[$id]->cat_description;
|
||||
$courses[$id]->defaultrolename = $defaultrole->name;
|
||||
// coerce to array
|
||||
$courses[$id] = (array)$courses[$id];
|
||||
}
|
||||
} else {
|
||||
throw new moodle_exception('unknownrole', 'error', '', 'student');
|
||||
}
|
||||
} else {
|
||||
// if the array is empty, send it anyway
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
// Check whether Shibboleth is configured properly
|
||||
if (empty($pluginconfig->user_attribute)) {
|
||||
print_error('shib_not_set_up_error', 'auth');
|
||||
print_error('shib_not_set_up_error', 'auth_shibboleth');
|
||||
}
|
||||
|
||||
/// If we can find the Shibboleth attribute, save it in session and return to main login page
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
/// Check if the user has actually submitted login data to us
|
||||
|
||||
if ($shibbolethauth->user_login($frm->username, $frm->password)) {
|
||||
if ($shibbolethauth->user_login($frm->username, $frm->password)
|
||||
&& $user = authenticate_user_login($frm->username, $frm->password)) {
|
||||
|
||||
$user = authenticate_user_login($frm->username, $frm->password);
|
||||
enrol_check_plugins($user);
|
||||
session_set_user($user);
|
||||
|
||||
@@ -84,16 +84,17 @@
|
||||
}
|
||||
|
||||
else {
|
||||
// For some weird reason the Shibboleth user couldn't be authenticated
|
||||
// The Shibboleth user couldn't be mapped to a valid Moodle user
|
||||
print_error('shib_invalid_account_error', 'auth_shibboleth');
|
||||
}
|
||||
}
|
||||
|
||||
// If we can find any (user independent) Shibboleth attributes but no user
|
||||
// attributes we probably didn't receive any user attributes
|
||||
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID']) || !empty($_SERVER['Shib-Application-ID'])) {
|
||||
print_error('shib_no_attributes_error', 'auth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
|
||||
print_error('shib_no_attributes_error', 'auth_shibboleth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
|
||||
} else {
|
||||
print_error('shib_not_set_up_error', 'auth');
|
||||
print_error('shib_not_set_up_error', 'auth_shibboleth');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ $string['auth_shib_no_organizations_warning'] = 'If you want to use the integrat
|
||||
$string['auth_shib_only'] = 'Shibboleth only';
|
||||
$string['auth_shib_only_description'] = 'Check this option if a Shibboleth authentication shall be enforced';
|
||||
$string['auth_shib_username_description'] = 'Name of the webserver Shibboleth environment variable that shall be used as Moodle username';
|
||||
$string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.';
|
||||
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
|
||||
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
|
||||
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
|
||||
|
||||
@@ -154,6 +154,22 @@ abstract class restore_qtype_plugin extends restore_plugin {
|
||||
AND ' . $DB->sql_compare_text('answer', 255) . ' = ' . $DB->sql_compare_text('?', 255);
|
||||
$params = array($newquestionid, $data->answertext);
|
||||
$newitemid = $DB->get_field_sql($sql, $params);
|
||||
|
||||
// Not able to find the answer, let's try cleaning the answertext
|
||||
// of all the question answers in DB as slower fallback. MDL-30018.
|
||||
if (!$newitemid) {
|
||||
$params = array('question' => $newquestionid);
|
||||
$answers = $DB->get_records('question_answers', $params, '', 'id, answer');
|
||||
foreach ($answers as $answer) {
|
||||
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
|
||||
$clean = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $answer->answer); // Clean CTRL chars.
|
||||
$clean = preg_replace("/\r\n|\r/", "\n", $clean); // Normalize line ending.
|
||||
if ($clean === $data->answertext) {
|
||||
$newitemid = $data->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we haven't found the newitemid, something has gone really wrong, question in DB
|
||||
// is missing answers, exception
|
||||
if (!$newitemid) {
|
||||
|
||||
@@ -1505,7 +1505,8 @@ abstract class restore_dbops {
|
||||
}
|
||||
$currentfullname = $fullname.$suffixfull;
|
||||
$currentshortname = substr($shortname, 0, 100 - strlen($suffixshort)).$suffixshort; // < 100cc
|
||||
$coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?', array($currentfullname, $courseid));
|
||||
$coursefull = $DB->get_record_select('course', 'fullname = ? AND id != ?',
|
||||
array($currentfullname, $courseid), '*', IGNORE_MULTIPLE);
|
||||
$courseshort = $DB->get_record_select('course', 'shortname = ? AND id != ?', array($currentshortname, $courseid));
|
||||
$counter++;
|
||||
} while ($coursefull || $courseshort);
|
||||
|
||||
@@ -281,9 +281,13 @@ class backup_cron_helper_testcase extends advanced_testcase {
|
||||
$this->assertEquals(date('w-15:00', strtotime('tomorrow')), date('w-H:i', $next));
|
||||
|
||||
// Let's have a Belgian beer! (UTC+1 / UTC+2 DST).
|
||||
// Warning: Some of these tests will fail if executed "around"
|
||||
// 'Europe/Brussels' DST changes (last Sunday in March and
|
||||
// last Sunday in October right now - 2012). Once Moodle
|
||||
// moves to PHP TZ support this could be fixed properly.
|
||||
date_default_timezone_set('Europe/Brussels');
|
||||
$now = strtotime('18:00:00');
|
||||
$dst = date('I');
|
||||
$dst = date('I', $now);
|
||||
|
||||
$timezone = -10.0; // 7am for the user.
|
||||
$next = backup_cron_automated_helper::calculate_next_automated_backup($timezone, $now);
|
||||
@@ -321,9 +325,13 @@ class backup_cron_helper_testcase extends advanced_testcase {
|
||||
$this->assertEquals($expected, date('w-H:i', $next));
|
||||
|
||||
// The big apple! (UTC-5 / UTC-4 DST).
|
||||
// Warning: Some of these tests will fail if executed "around"
|
||||
// 'America/New_York' DST changes (2nd Sunday in March and
|
||||
// 1st Sunday in November right now - 2012). Once Moodle
|
||||
// moves to PHP TZ support this could be fixed properly.
|
||||
date_default_timezone_set('America/New_York');
|
||||
$now = strtotime('18:00:00');
|
||||
$dst = date('I');
|
||||
$dst = date('I', $now);
|
||||
|
||||
$timezone = -10.0; // 1pm for the user.
|
||||
$next = backup_cron_automated_helper::calculate_next_automated_backup($timezone, $now);
|
||||
@@ -365,9 +373,14 @@ class backup_cron_helper_testcase extends advanced_testcase {
|
||||
set_config('backup_auto_hour', '20', 'backup');
|
||||
set_config('backup_auto_minute', '00', 'backup');
|
||||
|
||||
// Note: These tests should not fail because they are "unnafected"
|
||||
// by DST changes, as far as execution always happens on Monday and
|
||||
// Saturday and those week days are not, right now, the ones rulez
|
||||
// to peform the DST changes (Sunday is). This may change if rules
|
||||
// are modified in the future.
|
||||
date_default_timezone_set('Europe/Brussels');
|
||||
$now = strtotime('next Monday 18:00:00');
|
||||
$dst = date('I');
|
||||
$dst = date('I', $now);
|
||||
|
||||
$timezone = -12.0; // 1pm for the user.
|
||||
$next = backup_cron_automated_helper::calculate_next_automated_backup($timezone, $now);
|
||||
@@ -404,9 +417,14 @@ class backup_cron_helper_testcase extends advanced_testcase {
|
||||
set_config('backup_auto_hour', '02', 'backup');
|
||||
set_config('backup_auto_minute', '00', 'backup');
|
||||
|
||||
// Note: These tests should not fail because they are "unnafected"
|
||||
// by DST changes, as far as execution always happens on Monday and
|
||||
// Saturday and those week days are not, right now, the ones rulez
|
||||
// to peform the DST changes (Sunday is). This may change if rules
|
||||
// are modified in the future.
|
||||
date_default_timezone_set('America/New_York');
|
||||
$now = strtotime('next Monday 04:00:00');
|
||||
$dst = date('I');
|
||||
$dst = date('I', $now);
|
||||
|
||||
$timezone = -12.0; // 8pm for the user.
|
||||
$next = backup_cron_automated_helper::calculate_next_automated_backup($timezone, $now);
|
||||
|
||||
@@ -140,7 +140,7 @@ class community_hub_search_form extends moodleform {
|
||||
$options = array();
|
||||
$firsthub = false;
|
||||
foreach ($hubs as $hub) {
|
||||
if (key_exists('id', $hub)) {
|
||||
if (array_key_exists('id', $hub)) {
|
||||
$params = array('hubid' => $hub['id'],
|
||||
'filetype' => HUB_HUBSCREENSHOT_FILE_TYPE);
|
||||
$imgurl = new moodle_url(HUB_HUBDIRECTORYURL .
|
||||
|
||||
+2
-3
@@ -23,8 +23,7 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
lightbox : false,
|
||||
zIndex:100,
|
||||
height: '350px'
|
||||
zIndex:100
|
||||
});
|
||||
|
||||
this.overlays[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
@@ -86,4 +85,4 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
|
||||
}, '@VERSION@', {
|
||||
requires:['base','overlay', 'moodle-enrol-notification']
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,8 +51,10 @@ class block_completionstatus extends block_base {
|
||||
// Create empty content
|
||||
$this->content = new stdClass();
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
// Can edit settings?
|
||||
$can_edit = has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id));
|
||||
$can_edit = has_capability('moodle/course:update', $context);
|
||||
|
||||
// Get course completion data
|
||||
$info = new completion_info($course);
|
||||
@@ -83,148 +85,145 @@ class block_completionstatus extends block_base {
|
||||
}
|
||||
|
||||
// Check this user is enroled
|
||||
if (!$info->is_tracked_user($USER->id)) {
|
||||
// If not enrolled, but are can view the report:
|
||||
if (has_capability('report/completion:view', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
$report = new moodle_url('/report/completion/index.php', array('course' => $course->id));
|
||||
$this->content->text = '<a href="'.$report->out().'">'.get_string('viewcoursereport', 'completion').'</a>';
|
||||
return $this->content;
|
||||
if ($info->is_tracked_user($USER->id)) {
|
||||
|
||||
// Generate markup for criteria statuses
|
||||
$shtml = '';
|
||||
|
||||
// For aggregating activity completion
|
||||
$activities = array();
|
||||
$activities_complete = 0;
|
||||
|
||||
// For aggregating course prerequisites
|
||||
$prerequisites = array();
|
||||
$prerequisites_complete = 0;
|
||||
|
||||
// Flag to set if current completion data is inconsistent with
|
||||
// what is stored in the database
|
||||
$pending_update = false;
|
||||
|
||||
// Loop through course criteria
|
||||
foreach ($completions as $completion) {
|
||||
|
||||
$criteria = $completion->get_criteria();
|
||||
$complete = $completion->is_complete();
|
||||
|
||||
if (!$pending_update && $criteria->is_pending($completion)) {
|
||||
$pending_update = true;
|
||||
}
|
||||
|
||||
// Activities are a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
|
||||
$activities[$criteria->moduleinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$activities_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prerequisites are also a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_COURSE) {
|
||||
$prerequisites[$criteria->courseinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$prerequisites_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= $criteria->get_title();
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$shtml .= $completion->get_status();
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Otherwise, show error
|
||||
// Aggregate activities
|
||||
if (!empty($activities)) {
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= get_string('activitiescompleted', 'completion');
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $activities_complete;
|
||||
$a->second = count($activities);
|
||||
$shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Aggregate prerequisites
|
||||
if (!empty($prerequisites)) {
|
||||
|
||||
$phtml = '<tr><td>';
|
||||
$phtml .= get_string('prerequisitescompleted', 'completion');
|
||||
$phtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $prerequisites_complete;
|
||||
$a->second = count($prerequisites);
|
||||
$phtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$phtml .= '</td></tr>';
|
||||
|
||||
$shtml = $phtml . $shtml;
|
||||
}
|
||||
|
||||
// Display completion status
|
||||
$this->content->text = '<table width="100%" style="font-size: 90%;"><tbody>';
|
||||
$this->content->text .= '<tr><td colspan="2"><b>'.get_string('status').':</b> ';
|
||||
|
||||
// Is course complete?
|
||||
$coursecomplete = $info->is_course_complete($USER->id);
|
||||
|
||||
// Load course completion
|
||||
$params = array(
|
||||
'userid' => $USER->id,
|
||||
'course' => $course->id
|
||||
);
|
||||
$ccompletion = new completion_completion($params);
|
||||
|
||||
// Has this user completed any criteria?
|
||||
$criteriacomplete = $info->count_course_user_data($USER->id);
|
||||
|
||||
if ($pending_update) {
|
||||
$this->content->text .= '<i>'.get_string('pending', 'completion').'</i>';
|
||||
} else if ($coursecomplete) {
|
||||
$this->content->text .= get_string('complete');
|
||||
} else if (!$criteriacomplete && !$ccompletion->timestarted) {
|
||||
$this->content->text .= '<i>'.get_string('notyetstarted', 'completion').'</i>';
|
||||
} else {
|
||||
$this->content->text .= '<i>'.get_string('inprogress','completion').'</i>';
|
||||
}
|
||||
|
||||
$this->content->text .= '</td></tr>';
|
||||
$this->content->text .= '<tr><td colspan="2">';
|
||||
|
||||
// Get overall aggregation method
|
||||
$overall = $info->get_aggregation_method();
|
||||
|
||||
if ($overall == COMPLETION_AGGREGATION_ALL) {
|
||||
$this->content->text .= get_string('criteriarequiredall', 'completion');
|
||||
} else {
|
||||
$this->content->text .= get_string('criteriarequiredany', 'completion');
|
||||
}
|
||||
|
||||
$this->content->text .= ':</td></tr>';
|
||||
$this->content->text .= '<tr><td><b>'.get_string('requiredcriteria', 'completion').'</b></td><td style="text-align: right"><b>'.get_string('status').'</b></td></tr>';
|
||||
$this->content->text .= $shtml.'</tbody></table>';
|
||||
|
||||
// Display link to detailed view
|
||||
$details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id));
|
||||
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
|
||||
} else {
|
||||
// If user is not enrolled, show error
|
||||
$this->content->text = get_string('notenroled', 'completion');
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
// Generate markup for criteria statuses
|
||||
$shtml = '';
|
||||
|
||||
// For aggregating activity completion
|
||||
$activities = array();
|
||||
$activities_complete = 0;
|
||||
|
||||
// For aggregating course prerequisites
|
||||
$prerequisites = array();
|
||||
$prerequisites_complete = 0;
|
||||
|
||||
// Flag to set if current completion data is inconsistent with
|
||||
// what is stored in the database
|
||||
$pending_update = false;
|
||||
|
||||
// Loop through course criteria
|
||||
foreach ($completions as $completion) {
|
||||
|
||||
$criteria = $completion->get_criteria();
|
||||
$complete = $completion->is_complete();
|
||||
|
||||
if (!$pending_update && $criteria->is_pending($completion)) {
|
||||
$pending_update = true;
|
||||
}
|
||||
|
||||
// Activities are a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
|
||||
$activities[$criteria->moduleinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$activities_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prerequisites are also a special case, so cache them and leave them till last
|
||||
if ($criteria->criteriatype == COMPLETION_CRITERIA_TYPE_COURSE) {
|
||||
$prerequisites[$criteria->courseinstance] = $complete;
|
||||
|
||||
if ($complete) {
|
||||
$prerequisites_complete++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= $criteria->get_title();
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$shtml .= $completion->get_status();
|
||||
$shtml .= '</td></tr>';
|
||||
if (has_capability('report/completion:view', $context)) {
|
||||
$report = new moodle_url('/report/completion/index.php', array('course' => $course->id));
|
||||
$this->content->footer .= '<br /><a href="'.$report->out().'">'.get_string('viewcoursereport', 'completion').'</a>';
|
||||
}
|
||||
|
||||
// Aggregate activities
|
||||
if (!empty($activities)) {
|
||||
|
||||
$shtml .= '<tr><td>';
|
||||
$shtml .= get_string('activitiescompleted', 'completion');
|
||||
$shtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $activities_complete;
|
||||
$a->second = count($activities);
|
||||
$shtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$shtml .= '</td></tr>';
|
||||
}
|
||||
|
||||
// Aggregate prerequisites
|
||||
if (!empty($prerequisites)) {
|
||||
|
||||
$phtml = '<tr><td>';
|
||||
$phtml .= get_string('prerequisitescompleted', 'completion');
|
||||
$phtml .= '</td><td style="text-align: right">';
|
||||
$a = new stdClass();
|
||||
$a->first = $prerequisites_complete;
|
||||
$a->second = count($prerequisites);
|
||||
$phtml .= get_string('firstofsecond', 'block_completionstatus', $a);
|
||||
$phtml .= '</td></tr>';
|
||||
|
||||
$shtml = $phtml . $shtml;
|
||||
}
|
||||
|
||||
// Display completion status
|
||||
$this->content->text = '<table width="100%" style="font-size: 90%;"><tbody>';
|
||||
$this->content->text .= '<tr><td colspan="2"><b>'.get_string('status').':</b> ';
|
||||
|
||||
// Is course complete?
|
||||
$coursecomplete = $info->is_course_complete($USER->id);
|
||||
|
||||
// Load course completion
|
||||
$params = array(
|
||||
'userid' => $USER->id,
|
||||
'course' => $course->id
|
||||
);
|
||||
$ccompletion = new completion_completion($params);
|
||||
|
||||
// Has this user completed any criteria?
|
||||
$criteriacomplete = $info->count_course_user_data($USER->id);
|
||||
|
||||
if ($pending_update) {
|
||||
$this->content->text .= '<i>'.get_string('pending', 'completion').'</i>';
|
||||
} else if ($coursecomplete) {
|
||||
$this->content->text .= get_string('complete');
|
||||
} else if (!$criteriacomplete && !$ccompletion->timestarted) {
|
||||
$this->content->text .= '<i>'.get_string('notyetstarted', 'completion').'</i>';
|
||||
} else {
|
||||
$this->content->text .= '<i>'.get_string('inprogress','completion').'</i>';
|
||||
}
|
||||
|
||||
$this->content->text .= '</td></tr>';
|
||||
$this->content->text .= '<tr><td colspan="2">';
|
||||
|
||||
// Get overall aggregation method
|
||||
$overall = $info->get_aggregation_method();
|
||||
|
||||
if ($overall == COMPLETION_AGGREGATION_ALL) {
|
||||
$this->content->text .= get_string('criteriarequiredall', 'completion');
|
||||
} else {
|
||||
$this->content->text .= get_string('criteriarequiredany', 'completion');
|
||||
}
|
||||
|
||||
$this->content->text .= ':</td></tr>';
|
||||
$this->content->text .= '<tr><td><b>'.get_string('requiredcriteria', 'completion').'</b></td><td style="text-align: right"><b>'.get_string('status').'</b></td></tr>';
|
||||
$this->content->text .= $shtml.'</tbody></table>';
|
||||
|
||||
// Display link to detailed view
|
||||
$details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id));
|
||||
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
}
|
||||
|
||||
+20
-4
@@ -164,7 +164,7 @@ M.core_dock.init = function(Y) {
|
||||
var dock = Y.one('#dock');
|
||||
if (!dock) {
|
||||
// Start the construction of the dock
|
||||
dock = Y.Node.create('<div id="dock" class="'+css.dock+' '+css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation+'"></div>')
|
||||
dock = Y.Node.create('<div id="dock" role="menubar" class="'+css.dock+' '+css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+css.buttonscontainer+'"></div>')
|
||||
.append(Y.Node.create('<div class="'+css.dockeditemcontainer+'"></div>')));
|
||||
this.nodes.body.append(dock);
|
||||
@@ -505,7 +505,7 @@ M.core_dock.fixTitleOrientation = function(item, title, text) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Y.UA.ie > 7) {
|
||||
if (Y.UA.ie == 8) {
|
||||
// IE8 can flip the text via CSS but not handle SVG
|
||||
title.setContent(text);
|
||||
title.setAttribute('style', 'writing-mode: tb-rl; filter: flipV flipH;display:inline;');
|
||||
@@ -863,6 +863,12 @@ M.core_dock.genericblock.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable the skip anchor when docking
|
||||
var skipanchor = node.previous();
|
||||
if (skipanchor.hasClass('skip-block')) {
|
||||
skipanchor.hide();
|
||||
}
|
||||
|
||||
var blockclass = (function(classes){
|
||||
var r = /(^|\s)(block_[a-zA-Z0-9_]+)(\s|$)/;
|
||||
var m = r.exec(classes);
|
||||
@@ -937,6 +943,12 @@ M.core_dock.genericblock.prototype = {
|
||||
return_to_block : function(dockitem) {
|
||||
var placeholder = this.Y.one('#content_placeholder_'+this.id);
|
||||
|
||||
// Enable the skip anchor when going back to block mode
|
||||
var skipanchor = placeholder.previous();
|
||||
if (skipanchor.hasClass('skip-block')) {
|
||||
skipanchor.show();
|
||||
}
|
||||
|
||||
if (this.cachedcontentnode.one('.header')) {
|
||||
this.cachedcontentnode.one('.header').insert(dockitem.contents, 'after');
|
||||
} else {
|
||||
@@ -946,7 +958,7 @@ M.core_dock.genericblock.prototype = {
|
||||
placeholder.replace(this.Y.Node.getDOMNode(this.cachedcontentnode));
|
||||
this.cachedcontentnode = this.Y.one('#'+this.cachedcontentnode.get('id'));
|
||||
|
||||
var commands = this.cachedcontentnode.one('.title .commands');
|
||||
var commands = dockitem.commands;
|
||||
if (commands) {
|
||||
commands.all('.hidepanelicon').remove();
|
||||
commands.all('.moveto').remove();
|
||||
@@ -1024,7 +1036,7 @@ M.core_dock.item.prototype = {
|
||||
var Y = this.Y;
|
||||
var css = M.core_dock.css;
|
||||
|
||||
this.nodes.docktitle = Y.Node.create('<div id="dock_item_'+this.id+'_title" class="'+css.dockedtitle+'"></div>');
|
||||
this.nodes.docktitle = Y.Node.create('<div id="dock_item_'+this.id+'_title" role="menu" aria-haspopup="true" class="'+css.dockedtitle+'"></div>');
|
||||
this.nodes.docktitle.append(this.title);
|
||||
this.nodes.dockitem = Y.Node.create('<div id="dock_item_'+this.id+'" class="'+css.dockeditem+'" tabindex="0"></div>');
|
||||
this.nodes.dockitem.on('dock:actionkey', this.toggle, this);
|
||||
@@ -1053,6 +1065,8 @@ M.core_dock.item.prototype = {
|
||||
this.active = true;
|
||||
// Add active item class first up
|
||||
this.nodes.docktitle.addClass(css.activeitem);
|
||||
// Set aria-exapanded property to true.
|
||||
this.nodes.docktitle.set('aria-expanded', "true");
|
||||
this.fire('dockeditem:showcomplete');
|
||||
M.core_dock.resize();
|
||||
return true;
|
||||
@@ -1069,6 +1083,8 @@ M.core_dock.item.prototype = {
|
||||
this.nodes.docktitle.removeClass(css.activeitem);
|
||||
// Hide the panel
|
||||
M.core_dock.getPanel().hide();
|
||||
// Set aria-exapanded property to false
|
||||
this.nodes.docktitle.set('aria-expanded', "false");
|
||||
this.fire('dockeditem:hidecomplete');
|
||||
},
|
||||
/**
|
||||
|
||||
+19
-2
@@ -30,15 +30,32 @@
|
||||
* @param bool $forcedownload whether or not force download
|
||||
* @param array $options additional options affecting the file serving
|
||||
* @return bool
|
||||
* @todo MDL-36050 improve capability check on stick blocks, so we can check user capability before sending images.
|
||||
*/
|
||||
function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $args, $forcedownload, array $options=array()) {
|
||||
global $SCRIPT;
|
||||
global $DB, $CFG;
|
||||
|
||||
if ($context->contextlevel != CONTEXT_BLOCK) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
require_course_login($course);
|
||||
// If block is in course context, then check if user has capability to access course.
|
||||
if ($context->get_course_context(false)) {
|
||||
require_course_login($course);
|
||||
} else if ($CFG->forcelogin) {
|
||||
require_login();
|
||||
} else {
|
||||
// Get parent context and see if user have proper permission.
|
||||
$parentcontext = $context->get_parent_context();
|
||||
if ($parentcontext->contextlevel === CONTEXT_COURSECAT) {
|
||||
// Check if category is visible and user can view this category.
|
||||
$category = $DB->get_record('course_categories', array('id' => $parentcontext->instanceid), '*', MUST_EXIST);
|
||||
if (!$category->visible) {
|
||||
require_capability('moodle/category:viewhiddencategories', $parentcontext);
|
||||
}
|
||||
}
|
||||
// At this point there is no way to check SYSTEM or USER context, so ignoring it.
|
||||
}
|
||||
|
||||
if ($filearea !== 'content') {
|
||||
send_file_not_found();
|
||||
|
||||
@@ -121,18 +121,20 @@ class block_navigation_renderer extends plugin_renderer_base {
|
||||
|
||||
// this applies to the li item which contains all child lists too
|
||||
$liclasses = array($item->get_css_type(), 'depth_'.$depth);
|
||||
$liexpandable = array();
|
||||
if ($item->has_children() && (!$item->forceopen || $item->collapse)) {
|
||||
$liclasses[] = 'collapsed';
|
||||
}
|
||||
if ($isbranch) {
|
||||
$liclasses[] = 'contains_branch';
|
||||
$liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
|
||||
} else if ($hasicon) {
|
||||
$liclasses[] = 'item_with_icon';
|
||||
}
|
||||
if ($item->isactive === true) {
|
||||
$liclasses[] = 'current_branch';
|
||||
}
|
||||
$liattr = array('class'=>join(' ',$liclasses));
|
||||
$liattr = array('class' => join(' ',$liclasses)) + $liexpandable;
|
||||
// class attribute on the div item which only contains the item content
|
||||
$divclasses = array('tree_item');
|
||||
if ($isbranch) {
|
||||
|
||||
@@ -162,16 +162,20 @@ TREE.prototype = {
|
||||
switch (e.action) {
|
||||
case 'expand' :
|
||||
target.removeClass('collapsed');
|
||||
target.set('aria-expanded', true);
|
||||
break;
|
||||
case 'collapse' :
|
||||
target.addClass('collapsed');
|
||||
target.set('aria-expanded', false);
|
||||
break;
|
||||
default :
|
||||
target.toggleClass('collapsed');
|
||||
target.set('aria-expanded', !target.hasClass('collapsed'));
|
||||
}
|
||||
e.halt();
|
||||
} else {
|
||||
target.toggleClass('collapsed');
|
||||
target.set('aria-expanded', !target.hasClass('collapsed'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +184,7 @@ TREE.prototype = {
|
||||
target.siblings('li').each(function(){
|
||||
if (this.get('id') !== target.get('id') && !this.hasClass('collapsed')) {
|
||||
this.addClass('collapsed');
|
||||
this.set('aria-expanded', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -287,6 +292,7 @@ BRANCH.prototype = {
|
||||
}
|
||||
if (isbranch) {
|
||||
branchli.addClass('collapsed').addClass('contains_branch');
|
||||
branchli.set('aria-expanded', false);
|
||||
branchp.addClass('branch');
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ class block_online_users extends block_base {
|
||||
if (isset($CFG->block_online_users_timetosee)) {
|
||||
$timetoshowusers = $CFG->block_online_users_timetosee * 60;
|
||||
}
|
||||
$timefrom = 100 * floor((time()-$timetoshowusers) / 100); // Round to nearest 100 seconds for better query cache
|
||||
$now = time();
|
||||
$timefrom = 100 * floor(($now - $timetoshowusers) / 100); // Round to nearest 100 seconds for better query cache
|
||||
|
||||
//Calculate if we are in separate groups
|
||||
$isseparategroups = ($this->page->course->groupmode == SEPARATEGROUPS
|
||||
@@ -53,18 +54,23 @@ class block_online_users extends block_base {
|
||||
}
|
||||
|
||||
$userfields = user_picture::fields('u', array('username'));
|
||||
|
||||
$params['now'] = $now;
|
||||
$params['timefrom'] = $timefrom;
|
||||
if ($this->page->course->id == SITEID or $this->page->context->contextlevel < CONTEXT_COURSE) { // Site-level
|
||||
$sql = "SELECT $userfields, MAX(u.lastaccess) AS lastaccess
|
||||
FROM {user} u $groupmembers
|
||||
WHERE u.lastaccess > $timefrom
|
||||
WHERE u.lastaccess > :timefrom
|
||||
AND u.lastaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect
|
||||
GROUP BY $userfields
|
||||
ORDER BY lastaccess DESC ";
|
||||
|
||||
$csql = "SELECT COUNT(u.id)
|
||||
FROM {user} u $groupmembers
|
||||
WHERE u.lastaccess > $timefrom
|
||||
WHERE u.lastaccess > :timefrom
|
||||
AND u.lastaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect";
|
||||
|
||||
} else {
|
||||
@@ -77,9 +83,11 @@ class block_online_users extends block_base {
|
||||
$sql = "SELECT $userfields, MAX(ul.timeaccess) AS lastaccess
|
||||
FROM {user_lastaccess} ul $groupmembers, {user} u
|
||||
JOIN ($esqljoin) euj ON euj.id = u.id
|
||||
WHERE ul.timeaccess > $timefrom
|
||||
WHERE ul.timeaccess > :timefrom
|
||||
AND u.id = ul.userid
|
||||
AND ul.courseid = :courseid
|
||||
AND ul.timeaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect
|
||||
GROUP BY $userfields
|
||||
ORDER BY lastaccess DESC";
|
||||
@@ -87,9 +95,11 @@ class block_online_users extends block_base {
|
||||
$csql = "SELECT COUNT(u.id)
|
||||
FROM {user_lastaccess} ul $groupmembers, {user} u
|
||||
JOIN ($esqljoin) euj ON euj.id = u.id
|
||||
WHERE ul.timeaccess > $timefrom
|
||||
WHERE ul.timeaccess > :timefrom
|
||||
AND u.id = ul.userid
|
||||
AND ul.courseid = :courseid
|
||||
AND ul.timeaccess <= :now
|
||||
AND u.deleted = 0
|
||||
$groupselect";
|
||||
|
||||
$params['courseid'] = $this->page->course->id;
|
||||
@@ -138,7 +148,7 @@ class block_online_users extends block_base {
|
||||
}
|
||||
foreach ($users as $user) {
|
||||
$this->content->text .= '<li class="listentry">';
|
||||
$timeago = format_time(time() - $user->lastaccess); //bruno to calculate correctly on frontpage
|
||||
$timeago = format_time($now - $user->lastaccess); //bruno to calculate correctly on frontpage
|
||||
|
||||
if (isguestuser($user)) {
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
|
||||
$r = html_writer::start_tag('li');
|
||||
$r.= html_writer::start_tag('div',array('class'=>'link'));
|
||||
$r.= html_writer::link(clean_param($link,PARAM_URL), s($title), array('onclick'=>'this.target="_blank"'));
|
||||
$r.= html_writer::link($link, s($title), array('onclick'=>'this.target="_blank"'));
|
||||
$r.= html_writer::end_tag('div');
|
||||
|
||||
if($this->config->display_description && !empty($description)){
|
||||
|
||||
@@ -27,6 +27,7 @@ class block_search_forums extends block_base {
|
||||
|
||||
$this->content->text = '<div class="searchform">';
|
||||
$this->content->text .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline"><fieldset class="invisiblefieldset">';
|
||||
$this->content->text .= '<legend class="accesshide">'.$strsearch.'</legend>';
|
||||
$this->content->text .= '<input name="id" type="hidden" value="'.$this->page->course->id.'" />'; // course
|
||||
$this->content->text .= '<label class="accesshide" for="searchform_search">'.$strsearch.'</label>'.
|
||||
'<input id="searchform_search" name="search" type="text" size="16" />';
|
||||
|
||||
@@ -40,18 +40,20 @@ class block_settings_renderer extends plugin_renderer_base {
|
||||
|
||||
// this applies to the li item which contains all child lists too
|
||||
$liclasses = array($item->get_css_type());
|
||||
$liexpandable = array();
|
||||
if (!$item->forceopen || (!$item->forceopen && $item->collapse) || ($item->children->count()==0 && $item->nodetype==navigation_node::NODETYPE_BRANCH)) {
|
||||
$liclasses[] = 'collapsed';
|
||||
}
|
||||
if ($isbranch) {
|
||||
$liclasses[] = 'contains_branch';
|
||||
$liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
|
||||
} else if ($hasicon) {
|
||||
$liclasses[] = 'item_with_icon';
|
||||
}
|
||||
if ($item->isactive === true) {
|
||||
$liclasses[] = 'current_branch';
|
||||
}
|
||||
$liattr = array('class'=>join(' ',$liclasses));
|
||||
$liattr = array('class' => join(' ',$liclasses)) + $liexpandable;
|
||||
// class attribute on the div item which only contains the item content
|
||||
$divclasses = array('tree_item');
|
||||
if ($isbranch) {
|
||||
|
||||
@@ -82,6 +82,7 @@ $string['pluginname'] = 'Tags';
|
||||
$string['select'] = 'Select...';
|
||||
$string['showcoursetags'] = 'Show course tags';
|
||||
$string['showcoursetagsdef'] = 'Display the course tagging features in the tags block, allowing students to tag courses.';
|
||||
$string['suggestedtagthisunit'] = 'Suggested tag to this course:';
|
||||
$string['tags'] = 'tags';
|
||||
$string['tagthisunit'] = 'Tag this course:';
|
||||
$string['tagunits'] = 'to tag your favourite courses';
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
this.publish('hideevent');
|
||||
td.on('mouseenter', this.startShow, this);
|
||||
td.on('mouseleave', this.startHide, this);
|
||||
td.on('focus', this.startShow, this);
|
||||
td.on('blur', this.startHide, this);
|
||||
return true;
|
||||
},
|
||||
initPanel : function() {
|
||||
|
||||
+2
-2
@@ -126,7 +126,7 @@ function cohort_delete_category($category) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove cohort member
|
||||
* Add cohort member
|
||||
* @param int $cohortid
|
||||
* @param int $userid
|
||||
* @return void
|
||||
@@ -143,7 +143,7 @@ function cohort_add_member($cohortid, $userid) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add cohort member
|
||||
* Remove cohort member
|
||||
* @param int $cohortid
|
||||
* @param int $userid
|
||||
* @return void
|
||||
|
||||
+13
-7
@@ -309,16 +309,16 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
CommentHelper.confirmoverlay.set('xy', [e.pageX-width-5, e.pageY]);
|
||||
CommentHelper.confirmoverlay.set('visible', true);
|
||||
Y.one('#canceldelete-'+scope.client_id).on('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
scope.cancel_delete();
|
||||
});
|
||||
Y.Event.purgeElement('#confirmdelete-'+scope.client_id, false, 'click');
|
||||
Y.one('#confirmdelete-'+scope.client_id).on('click', function(e) {
|
||||
e.preventDefault();
|
||||
if (commentid[1]) {
|
||||
scope.dodelete(commentid[1]);
|
||||
}
|
||||
});
|
||||
e.preventDefault();
|
||||
if (commentid[1]) {
|
||||
scope.dodelete(commentid[1]);
|
||||
}
|
||||
});
|
||||
}, scope, node);
|
||||
}
|
||||
);
|
||||
@@ -361,7 +361,13 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
} else {
|
||||
// hide
|
||||
container.setStyle('display', 'none');
|
||||
img.set('src', M.util.image_url('t/collapsed', 'core'));
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
img.set('src', M.util.image_url(collapsedimage, 'core'));
|
||||
if (ta) {
|
||||
ta.set('value','');
|
||||
}
|
||||
|
||||
+7
-1
@@ -422,8 +422,14 @@ class comment {
|
||||
if ($this->displaytotalcount) {
|
||||
$countstring = '('.$this->count().')';
|
||||
}
|
||||
$collapsedimage= 't/collapsed';
|
||||
if (right_to_left()) {
|
||||
$collapsedimage= 't/collapsed_rtl';
|
||||
} else {
|
||||
$collapsedimage= 't/collapsed';
|
||||
}
|
||||
$html .= html_writer::start_tag('a', array('class' => 'comment-link', 'id' => 'comment-link-'.$this->cid, 'href' => '#'));
|
||||
$html .= html_writer::empty_tag('img', array('id' => 'comment-img-'.$this->cid, 'src' => $OUTPUT->pix_url('t/collapsed'), 'alt' => $this->linktext, 'title' => $this->linktext));
|
||||
$html .= html_writer::empty_tag('img', array('id' => 'comment-img-'.$this->cid, 'src' => $OUTPUT->pix_url($collapsedimage), 'alt' => $this->linktext, 'title' => $this->linktext));
|
||||
$html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid));
|
||||
$html .= html_writer::end_tag('a');
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class comment_manager {
|
||||
*/
|
||||
private function setup_course($courseid) {
|
||||
global $PAGE, $DB;
|
||||
if (!empty($this->course)) {
|
||||
if (!empty($this->course) && $this->course->id == $courseid) {
|
||||
// already set, stop
|
||||
return;
|
||||
}
|
||||
|
||||
+13
-2
@@ -27,10 +27,10 @@
|
||||
|
||||
require_once("../config.php");
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
require_once($CFG->libdir.'/textlib.class.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Category id
|
||||
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
||||
$perpage = optional_param('perpage', $CFG->coursesperpage, PARAM_INT); // how many per page
|
||||
$categoryedit = optional_param('categoryedit', -1, PARAM_BOOL);
|
||||
$hide = optional_param('hide', 0, PARAM_INT);
|
||||
$show = optional_param('show', 0, PARAM_INT);
|
||||
@@ -40,6 +40,16 @@ $moveto = optional_param('moveto', 0, PARAM_INT);
|
||||
$resort = optional_param('resort', 0, PARAM_BOOL);
|
||||
$sesskey = optional_param('sesskey', '', PARAM_RAW);
|
||||
|
||||
// MDL-27824 - This is a temporary fix until we have the proper
|
||||
// way to check/initialize $CFG value.
|
||||
// @todo MDL-35138 remove this temporary solution
|
||||
if (!empty($CFG->coursesperpage)) {
|
||||
$defaultperpage = $CFG->coursesperpage;
|
||||
} else {
|
||||
$defaultperpage = 20;
|
||||
}
|
||||
$perpage = optional_param('perpage', $defaultperpage, PARAM_INT); // how many per page
|
||||
|
||||
if (empty($id)) {
|
||||
print_error("unknowcategory");
|
||||
}
|
||||
@@ -75,7 +85,8 @@ $sesskeyprovided = !empty($sesskey) && confirm_sesskey($sesskey);
|
||||
// Process any category actions.
|
||||
if ($canmanage && $resort && $sesskeyprovided) {
|
||||
// Resort the category if requested
|
||||
if ($courses = get_courses($category->id, "fullname ASC", 'c.id,c.fullname,c.sortorder')) {
|
||||
if ($courses = get_courses($category->id, '', 'c.id,c.fullname,c.sortorder')) {
|
||||
collatorlib::asort_objects_by_property($courses, 'fullname', collatorlib::SORT_NATURAL);
|
||||
$i = 1;
|
||||
foreach ($courses as $course) {
|
||||
$DB->set_field('course', 'sortorder', $category->sortorder+$i, array('id'=>$course->id));
|
||||
|
||||
@@ -445,6 +445,7 @@ M.course_dndupload = {
|
||||
a: document.createElement('a'),
|
||||
icon: document.createElement('img'),
|
||||
namespan: document.createElement('span'),
|
||||
groupingspan: document.createElement('span'),
|
||||
progressouter: document.createElement('span'),
|
||||
progress: document.createElement('span')
|
||||
};
|
||||
@@ -469,6 +470,9 @@ M.course_dndupload = {
|
||||
|
||||
resel.div.appendChild(document.createTextNode(' '));
|
||||
|
||||
resel.groupingspan.className = 'groupinglabel';
|
||||
resel.div.appendChild(resel.groupingspan);
|
||||
|
||||
resel.progressouter.className = 'dndupload-progress-outer';
|
||||
resel.progress.className = 'dndupload-progress-inner';
|
||||
resel.progress.innerHTML = ' ';
|
||||
@@ -724,6 +728,13 @@ M.course_dndupload = {
|
||||
resel.icon.src = result.icon;
|
||||
resel.a.href = result.link;
|
||||
resel.namespan.innerHTML = result.name;
|
||||
|
||||
if (result.groupingname) {
|
||||
resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
|
||||
} else {
|
||||
resel.div.removeChild(resel.groupingspan);
|
||||
}
|
||||
|
||||
resel.div.removeChild(resel.progressouter);
|
||||
resel.li.id = result.elementid;
|
||||
resel.div.innerHTML += result.commands;
|
||||
@@ -904,6 +915,13 @@ M.course_dndupload = {
|
||||
resel.icon.src = result.icon;
|
||||
resel.a.href = result.link;
|
||||
resel.namespan.innerHTML = result.name;
|
||||
|
||||
if (result.groupingname) {
|
||||
resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
|
||||
} else {
|
||||
resel.div.removeChild(resel.groupingspan);
|
||||
}
|
||||
|
||||
resel.div.removeChild(resel.progressouter);
|
||||
resel.li.id = result.elementid;
|
||||
resel.div.innerHTML += result.commands;
|
||||
|
||||
@@ -667,6 +667,12 @@ class dndupload_ajax_processor {
|
||||
$resp->commands = make_editing_buttons($mod, true, true, 0, $mod->sectionnum);
|
||||
$resp->onclick = $mod->get_on_click();
|
||||
|
||||
// if using groupings, then display grouping name
|
||||
if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', $this->context)) {
|
||||
$groupings = groups_get_all_groupings($this->course->id);
|
||||
$resp->groupingname = format_string($groupings[$mod->groupingid]->name);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo json_encode($resp);
|
||||
die();
|
||||
|
||||
@@ -156,7 +156,11 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('showreports', 'showreports');
|
||||
$mform->setDefault('showreports', $courseconfig->showreports);
|
||||
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||
// Handle non-existing $course->maxbytes on course creation.
|
||||
$coursemaxbytes = !isset($course->maxbytes) ? null : $course->maxbytes;
|
||||
|
||||
// Let's prepare the maxbytes popup.
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $coursemaxbytes);
|
||||
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
||||
$mform->addHelpButton('maxbytes', 'maximumupload');
|
||||
$mform->setDefault('maxbytes', $courseconfig->maxbytes);
|
||||
|
||||
@@ -78,7 +78,7 @@ if ($mform->is_cancelled()){
|
||||
if (!empty($CFG->enableavailability)) {
|
||||
$section->availablefrom = $data->availablefrom;
|
||||
$section->availableuntil = $data->availableuntil;
|
||||
if (!empty($data->groupingid)) {
|
||||
if (isset($data->groupingid)) {
|
||||
$section->groupingid = $data->groupingid;
|
||||
}
|
||||
$section->showavailability = $data->showavailability;
|
||||
|
||||
@@ -285,7 +285,7 @@ class core_course_external extends external_api {
|
||||
array('options' => $options));
|
||||
|
||||
//retrieve courses
|
||||
if (!key_exists('ids', $params['options'])
|
||||
if (!array_key_exists('ids', $params['options'])
|
||||
or empty($params['options']['ids'])) {
|
||||
$courses = $DB->get_records('course');
|
||||
} else {
|
||||
@@ -523,12 +523,12 @@ class core_course_external extends external_api {
|
||||
require_capability('moodle/course:create', $context);
|
||||
|
||||
// Make sure lang is valid
|
||||
if (key_exists('lang', $course) and empty($availablelangs[$course['lang']])) {
|
||||
if (array_key_exists('lang', $course) and empty($availablelangs[$course['lang']])) {
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'lang');
|
||||
}
|
||||
|
||||
// Make sure theme is valid
|
||||
if (key_exists('forcetheme', $course)) {
|
||||
if (array_key_exists('forcetheme', $course)) {
|
||||
if (!empty($CFG->allowcoursethemes)) {
|
||||
if (empty($availablethemes[$course['forcetheme']])) {
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'forcetheme');
|
||||
@@ -547,10 +547,10 @@ class core_course_external extends external_api {
|
||||
//set default value for completion
|
||||
$courseconfig = get_config('moodlecourse');
|
||||
if (completion_info::is_enabled_for_site()) {
|
||||
if (!key_exists('enablecompletion', $course)) {
|
||||
if (!array_key_exists('enablecompletion', $course)) {
|
||||
$course['enablecompletion'] = $courseconfig->enablecompletion;
|
||||
}
|
||||
if (!key_exists('completionstartonenrol', $course)) {
|
||||
if (!array_key_exists('completionstartonenrol', $course)) {
|
||||
$course['completionstartonenrol'] = $courseconfig->completionstartonenrol;
|
||||
}
|
||||
} else {
|
||||
|
||||
+15
-13
@@ -65,8 +65,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
*/
|
||||
public function section_title($section, $course) {
|
||||
$title = get_section_name($course, $section);
|
||||
if ($section->section != 0 && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
|
||||
$title = html_writer::link(course_get_url($course, $section->section), $title);
|
||||
$url = course_get_url($course, $section->section, array('navigation' => true));
|
||||
if ($url) {
|
||||
$title = html_writer::link($url, $title);
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
@@ -125,7 +126,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
* @param int $sectionreturn The section to return to after an action
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function section_header($section, $course, $onsectionpage, $sectionreturn=0) {
|
||||
protected function section_header($section, $course, $onsectionpage, $sectionreturn=null) {
|
||||
global $PAGE;
|
||||
|
||||
$o = '';
|
||||
@@ -168,7 +169,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
|
||||
$url = new moodle_url('/course/editsection.php', array('id'=>$section->id, 'sr'=>$sectionreturn));
|
||||
$o.= html_writer::link($url,
|
||||
html_writer::empty_tag('img', array('src' => $this->output->pix_url('t/edit'), 'class' => 'iconsmall edit')),
|
||||
html_writer::empty_tag('img', array('src' => $this->output->pix_url('t/edit'),
|
||||
'class' => 'iconsmall edit', 'alt' => get_string('edit'))),
|
||||
array('title' => get_string('editsummary')));
|
||||
}
|
||||
$o.= html_writer::end_tag('div');
|
||||
@@ -413,7 +415,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
* @param int $sectionno The section number in the coruse which is being dsiplayed
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function course_activity_clipboard($course, $sectionno = 0) {
|
||||
protected function course_activity_clipboard($course, $sectionno = null) {
|
||||
global $USER;
|
||||
|
||||
$o = '';
|
||||
@@ -642,7 +644,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
echo $this->output->heading($this->page_title(), 2, 'accesshide');
|
||||
|
||||
// Copy activity clipboard..
|
||||
echo $this->course_activity_clipboard($course);
|
||||
echo $this->course_activity_clipboard($course, 0);
|
||||
|
||||
// Now the list of sections..
|
||||
echo $this->start_section_list();
|
||||
@@ -651,10 +653,10 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$thissection = $sections[0];
|
||||
unset($sections[0]);
|
||||
if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) {
|
||||
echo $this->section_header($thissection, $course, false);
|
||||
print_section($course, $thissection, $mods, $modnamesused, true);
|
||||
echo $this->section_header($thissection, $course, false, 0);
|
||||
print_section($course, $thissection, $mods, $modnamesused, true, "100%", false, 0);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, 0, $modnames);
|
||||
print_section_add_menus($course, 0, $modnames, false, false, 0);
|
||||
}
|
||||
echo $this->section_footer();
|
||||
}
|
||||
@@ -693,11 +695,11 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
// Display section summary only.
|
||||
echo $this->section_summary($thissection, $course, $mods);
|
||||
} else {
|
||||
echo $this->section_header($thissection, $course, false);
|
||||
echo $this->section_header($thissection, $course, false, 0);
|
||||
if ($thissection->uservisible) {
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
print_section($course, $thissection, $mods, $modnamesused, true, "100%", false, 0);
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $section, $modnames);
|
||||
print_section_add_menus($course, $section, $modnames, false, false, 0);
|
||||
}
|
||||
}
|
||||
echo $this->section_footer();
|
||||
@@ -714,7 +716,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
continue;
|
||||
}
|
||||
echo $this->stealth_section_header($section);
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
print_section($course, $thissection, $mods, $modnamesused, true, "100%", false, $displaysection);
|
||||
echo $this->stealth_section_footer();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ M.course.format.get_config = function() {
|
||||
M.course.format.swap_sections = function(Y, node1, node2) {
|
||||
var CSS = {
|
||||
COURSECONTENT : 'course-content',
|
||||
SECTIONADDMENUS : 'section_add_menus',
|
||||
SECTIONADDMENUS : 'section_add_menus'
|
||||
};
|
||||
|
||||
var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y));
|
||||
|
||||
+68
-38
@@ -531,7 +531,7 @@ function print_mnet_log($hostid, $course, $user=0, $date=0, $order="l.time ASC",
|
||||
|
||||
function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$modid, $modaction, $groupid) {
|
||||
global $DB;
|
||||
global $DB, $CFG;
|
||||
|
||||
$text = get_string('course')."\t".get_string('time')."\t".get_string('ip_address')."\t".
|
||||
get_string('fullnameuser')."\t".get_string('action')."\t".get_string('info');
|
||||
@@ -600,6 +600,8 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$firstField = format_string($courses[$log->course], true, array('context' => $coursecontext));
|
||||
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', $coursecontext));
|
||||
$row = array($firstField, userdate($log->time, $strftimedatetime), $log->ip, $fullname, $log->module.' '.$log->action, $log->info);
|
||||
$actionurl = $CFG->wwwroot. make_log_url($log->module,$log->url);
|
||||
$row = array($firstField, userdate($log->time, $strftimedatetime), $log->ip, $fullname, $log->module.' '.$log->action.' ('.$actionurl.')', $log->info);
|
||||
$text = implode("\t", $row);
|
||||
echo $text." \n";
|
||||
}
|
||||
@@ -710,7 +712,8 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$myxls->write($row, 2, $log->ip, '');
|
||||
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', $coursecontext));
|
||||
$myxls->write($row, 3, $fullname, '');
|
||||
$myxls->write($row, 4, $log->module.' '.$log->action, '');
|
||||
$actionurl = $CFG->wwwroot. make_log_url($log->module,$log->url);
|
||||
$myxls->write($row, 4, $log->module.' '.$log->action.' ('.$actionurl.')', '');
|
||||
$myxls->write($row, 5, $log->info, '');
|
||||
|
||||
$row++;
|
||||
@@ -823,7 +826,8 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$myxls->write_string($row, 2, $log->ip);
|
||||
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', $coursecontext));
|
||||
$myxls->write_string($row, 3, $fullname);
|
||||
$myxls->write_string($row, 4, $log->module.' '.$log->action);
|
||||
$actionurl = $CFG->wwwroot. make_log_url($log->module,$log->url);
|
||||
$myxls->write_string($row, 4, $log->module.' '.$log->action.' ('.$actionurl.')');
|
||||
$myxls->write_string($row, 5, $log->info);
|
||||
|
||||
$row++;
|
||||
@@ -1384,7 +1388,7 @@ function get_print_section_cm_text(cm_info $cm, $course) {
|
||||
* @param int $sectionreturn The section to return to
|
||||
* @return void
|
||||
*/
|
||||
function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false, $sectionreturn=0) {
|
||||
function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false, $sectionreturn=null) {
|
||||
global $CFG, $USER, $DB, $PAGE, $OUTPUT;
|
||||
|
||||
static $initialised;
|
||||
@@ -1544,8 +1548,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
$linkclasses = '';
|
||||
$textclasses = '';
|
||||
if ($accessiblebutdim) {
|
||||
$linkclasses .= ' dimmed';
|
||||
$textclasses .= ' dimmed_text';
|
||||
$linkclasses .= ' dimmed conditionalhidden';
|
||||
$textclasses .= ' dimmed_text conditionalhidden';
|
||||
$accesstext = '<span class="accesshide">'.
|
||||
get_string('hiddenfromstudents').': </span>';
|
||||
} else {
|
||||
@@ -1572,8 +1576,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// Display link itself
|
||||
echo '<a ' . $linkcss . $mod->extra . $onclick .
|
||||
' href="' . $url . '"><img src="' . $mod->get_icon_url() .
|
||||
'" class="activityicon" alt="' .
|
||||
$modulename . '" /> ' .
|
||||
'" class="activityicon" alt="' . $modulename . '" /> ' .
|
||||
$accesstext . '<span class="instancename">' .
|
||||
$instancename . $altname . '</span></a>';
|
||||
|
||||
@@ -1608,9 +1611,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// Display greyed-out text of link
|
||||
echo '<div ' . $textcss . $mod->extra .
|
||||
' >' . '<img src="' . $mod->get_icon_url() .
|
||||
'" class="activityicon" alt="' .
|
||||
$modulename .
|
||||
'" /> <span>'. $instancename . $altname .
|
||||
'" class="activityicon" alt="" /> <span>'. $instancename . $altname .
|
||||
'</span></div>';
|
||||
|
||||
// Do not display content after link when it is greyed out like this.
|
||||
@@ -1730,11 +1731,15 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
// see the activity itself, or for staff)
|
||||
if (!$mod->uservisible) {
|
||||
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
|
||||
} else if ($canviewhidden && !empty($CFG->enableavailability) && $mod->visible) {
|
||||
} else if ($canviewhidden && !empty($CFG->enableavailability)) {
|
||||
$visibilityclass = '';
|
||||
if (!$mod->visible) {
|
||||
$visibilityclass = 'accesshide';
|
||||
}
|
||||
$ci = new condition_info($mod);
|
||||
$fullinfo = $ci->get_full_information();
|
||||
if($fullinfo) {
|
||||
echo '<div class="availabilityinfo">'.get_string($mod->showavailability
|
||||
echo '<div class="availabilityinfo '.$visibilityclass.'">'.get_string($mod->showavailability
|
||||
? 'userrestriction_visible'
|
||||
: 'userrestriction_hidden','condition',
|
||||
$fullinfo).'</div>';
|
||||
@@ -1765,14 +1770,14 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
* Prints the menus to add activities and resources.
|
||||
*
|
||||
* @param stdClass $course The course
|
||||
* @param stdClass $section The section
|
||||
* @param int $section relative section number (field course_sections.section)
|
||||
* @param array $modnames An array containing the list of modules and their names
|
||||
* @param bool $vertical Vertical orientation
|
||||
* @param bool $return Return the menus or send them to output
|
||||
* @param int $sectionreturn The section to link back to
|
||||
* @return void|string depending on $return
|
||||
*/
|
||||
function print_section_add_menus($course, $section, $modnames, $vertical=false, $return=false, $sectionreturn=0) {
|
||||
function print_section_add_menus($course, $section, $modnames, $vertical=false, $return=false, $sectionreturn=null) {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// check to see if user can add menus
|
||||
@@ -1781,7 +1786,7 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
|
||||
}
|
||||
|
||||
// Retrieve all modules with associated metadata
|
||||
$modules = get_module_metadata($course, $modnames);
|
||||
$modules = get_module_metadata($course, $modnames, $sectionreturn);
|
||||
|
||||
// We'll sort resources and activities into two lists
|
||||
$resources = array();
|
||||
@@ -1871,8 +1876,9 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
|
||||
$output = html_writer::tag('div', $output, array('class' => 'hiddenifjs addresourcedropdown'));
|
||||
$modchooser = html_writer::tag('div', $modchooser, array('class' => 'visibleifjs addresourcemodchooser'));
|
||||
} else {
|
||||
$output = html_writer::tag('div', $output, array('class' => 'visibleifjs addresourcedropdown'));
|
||||
$modchooser = html_writer::tag('div', $modchooser, array('class' => 'hiddenifjs addresourcemodchooser'));
|
||||
// If the module chooser is disabled, we need to ensure that the dropdowns are shown even if javascript is disabled
|
||||
$output = html_writer::tag('div', $output, array('class' => 'show addresourcedropdown'));
|
||||
$modchooser = html_writer::tag('div', $modchooser, array('class' => 'hide addresourcemodchooser'));
|
||||
}
|
||||
$output = $modchooser . $output;
|
||||
}
|
||||
@@ -1894,7 +1900,7 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
|
||||
* @return array A list of stdClass objects containing metadata about each
|
||||
* module
|
||||
*/
|
||||
function get_module_metadata($course, $modnames, $sectionreturn = 0) {
|
||||
function get_module_metadata($course, $modnames, $sectionreturn = null) {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// get_module_metadata will be called once per section on the page and courses may show
|
||||
@@ -1969,7 +1975,7 @@ function get_module_metadata($course, $modnames, $sectionreturn = 0) {
|
||||
if ($sm->string_exists('modulename_link', $modname)) { // Link to further info in Moodle docs
|
||||
$link = get_string('modulename_link', $modname);
|
||||
$linktext = get_string('morehelp');
|
||||
$module->help .= html_writer::tag('div', $OUTPUT->doc_link($link, $linktext), array('class' => 'helpdoclink'));
|
||||
$module->help .= html_writer::tag('div', $OUTPUT->doc_link($link, $linktext, true), array('class' => 'helpdoclink'));
|
||||
}
|
||||
}
|
||||
$module->archetype = plugin_supports('mod', $modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
|
||||
@@ -3153,7 +3159,7 @@ function moveto_module($mod, $section, $beforemod=NULL) {
|
||||
* @param int $section The section to link back to
|
||||
* @return string XHTML for the editing buttons
|
||||
*/
|
||||
function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $moveselect = true, $indent=-1, $section=-1) {
|
||||
function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $moveselect = true, $indent=-1, $section=null) {
|
||||
global $CFG, $OUTPUT, $COURSE;
|
||||
|
||||
static $str;
|
||||
@@ -3195,7 +3201,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
|
||||
$baseurl = new moodle_url('/course/mod.php', array('sesskey' => sesskey()));
|
||||
|
||||
if ($section >= 0) {
|
||||
if ($section !== null) {
|
||||
$baseurl->param('sr', $section);
|
||||
}
|
||||
$actions = array();
|
||||
@@ -3204,7 +3210,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($mod->modname !== 'label' && $hasmanageactivities && course_ajax_enabled($COURSE)) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('update' => $mod->id)),
|
||||
new pix_icon('t/editstring', $str->edittitle, 'moodle', array('class' => 'iconsmall visibleifjs')),
|
||||
new pix_icon('t/editstring', $str->edittitle, 'moodle', array('class' => 'iconsmall visibleifjs', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_title', 'title' => $str->edittitle)
|
||||
);
|
||||
@@ -3223,7 +3229,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($indent > 0) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '-1')),
|
||||
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveleft', 'title' => $str->moveleft)
|
||||
);
|
||||
@@ -3231,7 +3237,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($indent >= 0) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '1')),
|
||||
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveright', 'title' => $str->moveright)
|
||||
);
|
||||
@@ -3243,20 +3249,20 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($moveselect) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('copy' => $mod->id)),
|
||||
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_move', 'title' => $str->move)
|
||||
);
|
||||
} else {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '-1')),
|
||||
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_moveup', 'title' => $str->moveup)
|
||||
);
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '1')),
|
||||
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_movedown', 'title' => $str->movedown)
|
||||
);
|
||||
@@ -3267,7 +3273,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($hasmanageactivities) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('update' => $mod->id)),
|
||||
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_update', 'title' => $str->update)
|
||||
);
|
||||
@@ -3277,7 +3283,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if (has_all_capabilities($dupecaps, $coursecontext) && plugin_supports('mod', $mod->modname, FEATURE_BACKUP_MOODLE2)) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('duplicate' => $mod->id)),
|
||||
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_duplicate', 'title' => $str->duplicate)
|
||||
);
|
||||
@@ -3287,7 +3293,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($hasmanageactivities) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('delete' => $mod->id)),
|
||||
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_delete', 'title' => $str->delete)
|
||||
);
|
||||
@@ -3298,14 +3304,14 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($mod->visible) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('hide' => $mod->id)),
|
||||
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_hide', 'title' => $str->hide)
|
||||
);
|
||||
} else {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('show' => $mod->id)),
|
||||
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_show', 'title' => $str->show)
|
||||
);
|
||||
@@ -3336,7 +3342,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if ($mod->groupmodelink) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('id' => $mod->id, 'groupmode' => $groupmode)),
|
||||
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => $groupclass, 'title' => $grouptitle)
|
||||
);
|
||||
@@ -3349,7 +3355,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
if (has_capability('moodle/role:assign', $modcontext)){
|
||||
$actions[] = new action_link(
|
||||
new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $modcontext->id)),
|
||||
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall')),
|
||||
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
null,
|
||||
array('class' => 'editing_assign', 'title' => $str->assign)
|
||||
);
|
||||
@@ -4589,15 +4595,39 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
|
||||
*
|
||||
* @param stdClass $course The course to get the section name for
|
||||
* @param int $sectionno The section number to return a link to
|
||||
* if omitted the course view page is returned
|
||||
* @param array $options options for view URL. At the moment core uses:
|
||||
* 'navigation' (bool) if true and section has no separate page, the function returns null
|
||||
* 'sr' (int) used by multipage formats to specify to which section to return
|
||||
* @return moodle_url The url of course
|
||||
*/
|
||||
function course_get_url($course, $sectionno = null) {
|
||||
function course_get_url($course, $sectionno = null, $options = array()) {
|
||||
if ($course->id == SITEID) {
|
||||
return new moodle_url('/');
|
||||
}
|
||||
$url = new moodle_url('/course/view.php', array('id' => $course->id));
|
||||
|
||||
if (!is_null($sectionno)) {
|
||||
if ($course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
|
||||
$sr = null;
|
||||
if (array_key_exists('sr', $options)) {
|
||||
$sr = $options['sr'];
|
||||
}
|
||||
if ($sectionno !== null) {
|
||||
if ($sr !== null) {
|
||||
if ($sr) {
|
||||
$usercoursedisplay = COURSE_DISPLAY_MULTIPAGE;
|
||||
$sectionno = $sr;
|
||||
} else {
|
||||
$usercoursedisplay = COURSE_DISPLAY_SINGLEPAGE;
|
||||
}
|
||||
} else {
|
||||
$usercoursedisplay = $course->coursedisplay;
|
||||
}
|
||||
if ($sectionno != 0 && $usercoursedisplay == COURSE_DISPLAY_MULTIPAGE) {
|
||||
$url->param('section', $sectionno);
|
||||
} else {
|
||||
if (!empty($options['navigation'])) {
|
||||
return null;
|
||||
}
|
||||
$url->set_anchor('section-'.$sectionno);
|
||||
}
|
||||
}
|
||||
|
||||
+14
-34
@@ -26,7 +26,7 @@
|
||||
require("../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
$sectionreturn = optional_param('sr', 0, PARAM_INT);
|
||||
$sectionreturn = optional_param('sr', null, PARAM_INT);
|
||||
$add = optional_param('add', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_ALPHA);
|
||||
$indent = optional_param('indent', 0, PARAM_INT);
|
||||
@@ -50,9 +50,7 @@ foreach (compact('indent','update','hide','show','copy','moveto','movetosection'
|
||||
$url->param($key, $value);
|
||||
}
|
||||
}
|
||||
if ($sectionreturn) {
|
||||
$url->param('sr', $sectionreturn);
|
||||
}
|
||||
$url->param('sr', $sectionreturn);
|
||||
if ($add !== '') {
|
||||
$url->param('add', $add);
|
||||
}
|
||||
@@ -109,7 +107,7 @@ if (!empty($add)) {
|
||||
get_string('continue'),
|
||||
'post'),
|
||||
new single_button(
|
||||
course_get_url($course, $sectionreturn),
|
||||
course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)),
|
||||
get_string('cancel'),
|
||||
'get')
|
||||
);
|
||||
@@ -126,7 +124,7 @@ if (!empty($add)) {
|
||||
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('moodle/course:manageactivities', $modcontext);
|
||||
|
||||
$return = course_get_url($course, $sectionreturn);
|
||||
$return = course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn));
|
||||
|
||||
if (!$confirm or !confirm_sesskey()) {
|
||||
$fullmodulename = get_string('modulename', $cm->modname);
|
||||
@@ -234,11 +232,7 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
|
||||
rebuild_course_cache($section->course);
|
||||
|
||||
if (SITEID == $section->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
}
|
||||
redirect(course_get_url($course, $section->section, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if (!empty($indent) and confirm_sesskey()) {
|
||||
$id = required_param('id', PARAM_INT);
|
||||
@@ -261,11 +255,7 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
|
||||
rebuild_course_cache($cm->course);
|
||||
|
||||
if (SITEID == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
}
|
||||
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if (!empty($hide) and confirm_sesskey()) {
|
||||
$cm = get_coursemodule_from_id('', $hide, 0, true, MUST_EXIST);
|
||||
@@ -280,11 +270,7 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
|
||||
rebuild_course_cache($cm->course);
|
||||
|
||||
if (SITEID == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
}
|
||||
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if (!empty($show) and confirm_sesskey()) {
|
||||
$cm = get_coursemodule_from_id('', $show, 0, true, MUST_EXIST);
|
||||
@@ -304,11 +290,7 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
rebuild_course_cache($cm->course);
|
||||
}
|
||||
|
||||
if (SITEID == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
}
|
||||
redirect(course_get_url($course, $section->section, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if ($groupmode > -1 and confirm_sesskey()) {
|
||||
$id = required_param('id', PARAM_INT);
|
||||
@@ -325,11 +307,7 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
|
||||
rebuild_course_cache($cm->course);
|
||||
|
||||
if (SITEID == $cm->course) {
|
||||
redirect($CFG->wwwroot);
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
}
|
||||
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if (!empty($copy) and confirm_sesskey()) { // value = course module
|
||||
$cm = get_coursemodule_from_id('', $copy, 0, true, MUST_EXIST);
|
||||
@@ -347,18 +325,20 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
|
||||
$USER->activitycopyname = $cm->name;
|
||||
$USER->activitycopysectionreturn = $sectionreturn;
|
||||
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
redirect(course_get_url($course, $section->section, array('sr' => $sectionreturn)));
|
||||
|
||||
} else if (!empty($cancelcopy) and confirm_sesskey()) { // value = course module
|
||||
|
||||
$courseid = $USER->activitycopycourse;
|
||||
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
|
||||
|
||||
$cm = get_coursemodule_from_id('', $USER->activitycopy, 0, true, IGNORE_MISSING);
|
||||
$sectionreturn = $USER->activitycopysectionreturn;
|
||||
unset($USER->activitycopy);
|
||||
unset($USER->activitycopycourse);
|
||||
unset($USER->activitycopyname);
|
||||
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
unset($USER->activitycopysectionreturn);
|
||||
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
|
||||
} else {
|
||||
print_error('unknowaction');
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
$cmid = required_param('cmid', PARAM_INT);
|
||||
$courseid = required_param('course', PARAM_INT);
|
||||
$sectionreturn = optional_param('sr', 0, PARAM_INT);
|
||||
$sectionreturn = optional_param('sr', null, PARAM_INT);
|
||||
|
||||
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
|
||||
$cm = get_coursemodule_from_id('', $cmid, $course->id, true, MUST_EXIST);
|
||||
@@ -61,8 +61,8 @@ $a->modtype = get_string('modulename', $cm->modname);
|
||||
$a->modname = format_string($cm->name);
|
||||
|
||||
if (!plugin_supports('mod', $cm->modname, FEATURE_BACKUP_MOODLE2)) {
|
||||
$url = new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id));
|
||||
print_error('duplicatenosupport', 'core', $url, $a);
|
||||
$url = course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn));
|
||||
print_error('duplicatenosupport', 'error', $url, $a);
|
||||
}
|
||||
|
||||
// backup the activity
|
||||
@@ -91,7 +91,8 @@ if (!$rc->execute_precheck()) {
|
||||
|
||||
echo $output->header();
|
||||
echo $output->precheck_notices($precheckresults);
|
||||
echo $output->continue_button(new moodle_url('/course/view.php', array('id' => $course->id)));
|
||||
$url = course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn));
|
||||
echo $output->continue_button($url);
|
||||
echo $output->footer();
|
||||
die();
|
||||
}
|
||||
@@ -133,18 +134,18 @@ if ($newcmid) {
|
||||
echo $output->confirm(
|
||||
get_string('duplicatesuccess', 'core', $a),
|
||||
new single_button(
|
||||
new moodle_url('/course/modedit.php', array('update' => $newcmid)),
|
||||
new moodle_url('/course/modedit.php', array('update' => $newcmid, 'sr' => $sectionreturn)),
|
||||
get_string('duplicatecontedit'),
|
||||
'get'),
|
||||
new single_button(
|
||||
course_get_url($course, $sectionreturn),
|
||||
course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)),
|
||||
get_string('duplicatecontcourse'),
|
||||
'get')
|
||||
);
|
||||
|
||||
} else {
|
||||
echo $output->notification(get_string('duplicatesuccess', 'core', $a), 'notifysuccess');
|
||||
echo $output->continue_button(course_get_url($course, $sectionreturn));
|
||||
echo $output->continue_button(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
|
||||
}
|
||||
|
||||
echo $output->footer();
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ $add = optional_param('add', '', PARAM_ALPHA); // module name
|
||||
$update = optional_param('update', 0, PARAM_INT);
|
||||
$return = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true
|
||||
$type = optional_param('type', '', PARAM_ALPHANUM); //TODO: hopefully will be removed in 2.0
|
||||
$sectionreturn = optional_param('sr', 0, PARAM_INT);
|
||||
$sectionreturn = optional_param('sr', null, PARAM_INT);
|
||||
|
||||
$url = new moodle_url('/course/modedit.php');
|
||||
$url->param('sr', $sectionreturn);
|
||||
@@ -264,7 +264,7 @@ if ($mform->is_cancelled()) {
|
||||
if ($return && !empty($cm->id)) {
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id");
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
redirect(course_get_url($course, $cw->section, array('sr' => $sectionreturn)));
|
||||
}
|
||||
} else if ($fromform = $mform->get_data()) {
|
||||
if (empty($fromform->coursemodule)) {
|
||||
@@ -633,7 +633,7 @@ if ($mform->is_cancelled()) {
|
||||
redirect($gradingman->get_management_url($returnurl));
|
||||
}
|
||||
} else {
|
||||
redirect(course_get_url($course, $sectionreturn));
|
||||
redirect(course_get_url($course, $cw->section, array('sr' => $sectionreturn)));
|
||||
}
|
||||
exit;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class courselib_testcase extends advanced_testcase {
|
||||
$course = $this->getDataGenerator()->create_course(array('numsections'=>10), array('createsections'=>true));
|
||||
$oldsections = array();
|
||||
$sections = array();
|
||||
foreach ($DB->get_records('course_sections', array('course'=>$course->id)) as $section) {
|
||||
foreach ($DB->get_records('course_sections', array('course'=>$course->id), 'id') as $section) {
|
||||
$oldsections[$section->section] = $section->id;
|
||||
$sections[$section->id] = $section->section;
|
||||
}
|
||||
|
||||
@@ -165,20 +165,28 @@ class core_course_external_testcase extends externallib_advanced_testcase {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$generatedcats = array();
|
||||
$category1data['idnumber'] = 'idnumbercat1';
|
||||
$category1data['name'] = 'Category 1 for PHPunit test';
|
||||
$category1data['description'] = 'Category 1 description';
|
||||
$category1data['descriptionformat'] = FORMAT_MOODLE;
|
||||
$category1 = self::getDataGenerator()->create_category($category1data);
|
||||
$generatedcats[$category1->id] = $category1;
|
||||
$category2 = self::getDataGenerator()->create_category(
|
||||
array('parent' => $category1->id));
|
||||
$generatedcats[$category2->id] = $category2;
|
||||
$category6 = self::getDataGenerator()->create_category(
|
||||
array('parent' => $category1->id, 'visible' => 0));
|
||||
$generatedcats[$category6->id] = $category6;
|
||||
$category3 = self::getDataGenerator()->create_category();
|
||||
$generatedcats[$category3->id] = $category3;
|
||||
$category4 = self::getDataGenerator()->create_category(
|
||||
array('parent' => $category3->id));
|
||||
$generatedcats[$category4->id] = $category4;
|
||||
$category5 = self::getDataGenerator()->create_category(
|
||||
array('parent' => $category4->id));
|
||||
$generatedcats[$category5->id] = $category5;
|
||||
|
||||
// Set the required capabilities by the external function.
|
||||
$context = context_system::instance();
|
||||
@@ -193,11 +201,13 @@ class core_course_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals(2, count($categories));
|
||||
|
||||
// Check the return values
|
||||
$this->assertEquals($categories[0]['id'], $category1->id);
|
||||
$this->assertEquals($categories[0]['idnumber'], $category1->idnumber);
|
||||
$this->assertEquals($categories[0]['name'], $category1->name);
|
||||
$this->assertEquals($categories[0]['description'], $category1->description);
|
||||
$this->assertEquals($categories[0]['descriptionformat'], FORMAT_HTML);
|
||||
foreach ($categories as $category) {
|
||||
$generatedcat = $generatedcats[$category['id']];
|
||||
$this->assertEquals($category['idnumber'], $generatedcat->idnumber);
|
||||
$this->assertEquals($category['name'], $generatedcat->name);
|
||||
$this->assertEquals($category['description'], $generatedcat->description);
|
||||
$this->assertEquals($category['descriptionformat'], FORMAT_HTML);
|
||||
}
|
||||
|
||||
// Check different params.
|
||||
$categories = core_course_external::get_categories(array(
|
||||
@@ -440,13 +450,17 @@ class core_course_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
$generatedcourses = array();
|
||||
$coursedata['idnumber'] = 'idnumbercourse1';
|
||||
$coursedata['fullname'] = 'Course 1 for PHPunit test';
|
||||
$coursedata['summary'] = 'Course 1 description';
|
||||
$coursedata['summaryformat'] = FORMAT_MOODLE;
|
||||
$course1 = self::getDataGenerator()->create_course($coursedata);
|
||||
$generatedcourses[$course1->id] = $course1;
|
||||
$course2 = self::getDataGenerator()->create_course();
|
||||
$generatedcourses[$course2->id] = $course2;
|
||||
$course3 = self::getDataGenerator()->create_course();
|
||||
$generatedcourses[$course3->id] = $course3;
|
||||
|
||||
// Set the required capabilities by the external function.
|
||||
$context = context_system::instance();
|
||||
@@ -464,33 +478,33 @@ class core_course_external_testcase extends externallib_advanced_testcase {
|
||||
// Check we retrieve the good total number of categories.
|
||||
$this->assertEquals(2, count($courses));
|
||||
|
||||
// Check the return values for course 1
|
||||
$dbcourse = $DB->get_record('course', array('id' => $course1->id));
|
||||
$this->assertEquals($courses[0]['id'], $dbcourse->id);
|
||||
$this->assertEquals($courses[0]['idnumber'], $coursedata['idnumber']);
|
||||
$this->assertEquals($courses[0]['fullname'], $coursedata['fullname']);
|
||||
$this->assertEquals($courses[0]['summary'], $coursedata['summary']);
|
||||
$this->assertEquals($courses[0]['summaryformat'], FORMAT_HTML);
|
||||
$this->assertEquals($courses[0]['shortname'], $dbcourse->shortname);
|
||||
$this->assertEquals($courses[0]['categoryid'], $dbcourse->category);
|
||||
$this->assertEquals($courses[0]['format'], $dbcourse->format);
|
||||
$this->assertEquals($courses[0]['showgrades'], $dbcourse->showgrades);
|
||||
$this->assertEquals($courses[0]['newsitems'], $dbcourse->newsitems);
|
||||
$this->assertEquals($courses[0]['startdate'], $dbcourse->startdate);
|
||||
$this->assertEquals($courses[0]['numsections'], $dbcourse->numsections);
|
||||
$this->assertEquals($courses[0]['maxbytes'], $dbcourse->maxbytes);
|
||||
$this->assertEquals($courses[0]['showreports'], $dbcourse->showreports);
|
||||
$this->assertEquals($courses[0]['visible'], $dbcourse->visible);
|
||||
$this->assertEquals($courses[0]['hiddensections'], $dbcourse->hiddensections);
|
||||
$this->assertEquals($courses[0]['groupmode'], $dbcourse->groupmode);
|
||||
$this->assertEquals($courses[0]['groupmodeforce'], $dbcourse->groupmodeforce);
|
||||
$this->assertEquals($courses[0]['defaultgroupingid'], $dbcourse->defaultgroupingid);
|
||||
$this->assertEquals($courses[0]['completionnotify'], $dbcourse->completionnotify);
|
||||
$this->assertEquals($courses[0]['lang'], $dbcourse->lang);
|
||||
$this->assertEquals($courses[0]['forcetheme'], $dbcourse->theme);
|
||||
$this->assertEquals($courses[0]['completionstartonenrol'], $dbcourse->completionstartonenrol);
|
||||
$this->assertEquals($courses[0]['enablecompletion'], $dbcourse->enablecompletion);
|
||||
$this->assertEquals($courses[0]['completionstartonenrol'], $dbcourse->completionstartonenrol);
|
||||
foreach ($courses as $course) {
|
||||
$dbcourse = $generatedcourses[$course['id']];
|
||||
$this->assertEquals($course['idnumber'], $dbcourse->idnumber);
|
||||
$this->assertEquals($course['fullname'], $dbcourse->fullname);
|
||||
$this->assertEquals($course['summary'], $dbcourse->summary);
|
||||
$this->assertEquals($course['summaryformat'], FORMAT_HTML);
|
||||
$this->assertEquals($course['shortname'], $dbcourse->shortname);
|
||||
$this->assertEquals($course['categoryid'], $dbcourse->category);
|
||||
$this->assertEquals($course['format'], $dbcourse->format);
|
||||
$this->assertEquals($course['showgrades'], $dbcourse->showgrades);
|
||||
$this->assertEquals($course['newsitems'], $dbcourse->newsitems);
|
||||
$this->assertEquals($course['startdate'], $dbcourse->startdate);
|
||||
$this->assertEquals($course['numsections'], $dbcourse->numsections);
|
||||
$this->assertEquals($course['maxbytes'], $dbcourse->maxbytes);
|
||||
$this->assertEquals($course['showreports'], $dbcourse->showreports);
|
||||
$this->assertEquals($course['visible'], $dbcourse->visible);
|
||||
$this->assertEquals($course['hiddensections'], $dbcourse->hiddensections);
|
||||
$this->assertEquals($course['groupmode'], $dbcourse->groupmode);
|
||||
$this->assertEquals($course['groupmodeforce'], $dbcourse->groupmodeforce);
|
||||
$this->assertEquals($course['defaultgroupingid'], $dbcourse->defaultgroupingid);
|
||||
$this->assertEquals($course['completionnotify'], $dbcourse->completionnotify);
|
||||
$this->assertEquals($course['lang'], $dbcourse->lang);
|
||||
$this->assertEquals($course['forcetheme'], $dbcourse->theme);
|
||||
$this->assertEquals($course['completionstartonenrol'], $dbcourse->completionstartonenrol);
|
||||
$this->assertEquals($course['enablecompletion'], $dbcourse->enablecompletion);
|
||||
$this->assertEquals($course['completionstartonenrol'], $dbcourse->completionstartonenrol);
|
||||
}
|
||||
|
||||
// Get all courses in the DB
|
||||
$courses = core_course_external::get_courses(array());
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
$marker = optional_param('marker',-1 , PARAM_INT);
|
||||
$switchrole = optional_param('switchrole',-1, PARAM_INT);
|
||||
$modchooser = optional_param('modchooser', -1, PARAM_BOOL);
|
||||
$return = optional_param('return', 0, PARAM_LOCALURL);
|
||||
|
||||
$params = array();
|
||||
if (!empty($name)) {
|
||||
@@ -139,6 +140,8 @@
|
||||
// Redirect to site root if Editing is toggled on frontpage
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot .'/?redirect=0');
|
||||
} else if (!empty($return)) {
|
||||
redirect($CFG->wwwroot . $return);
|
||||
} else {
|
||||
$url = new moodle_url($PAGE->url, array('notifyeditingon' => 1));
|
||||
redirect($url);
|
||||
@@ -152,6 +155,8 @@
|
||||
// Redirect to site root if Editing is toggled on frontpage
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot .'/?redirect=0');
|
||||
} else if (!empty($return)) {
|
||||
redirect($CFG->wwwroot . $return);
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
Vendored
+45
-34
@@ -41,6 +41,26 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
if (this.sectionlistselector) {
|
||||
this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+this.sectionlistselector;
|
||||
this.setup_for_section(this.sectionlistselector);
|
||||
|
||||
// Make each li element in the lists of sections draggable
|
||||
var nodeselector = this.sectionlistselector.slice(CSS.COURSECONTENT.length+2);
|
||||
var del = new Y.DD.Delegate({
|
||||
container: '.'+CSS.COURSECONTENT,
|
||||
nodes: nodeselector,
|
||||
target: true,
|
||||
handles: ['.'+CSS.LEFT],
|
||||
dragConfig: {groups: this.groups}
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDProxy, {
|
||||
// Don't move the node at the end of the drag
|
||||
moveOnEnd: false
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDConstrained, {
|
||||
// Keep it inside the .course-content
|
||||
constrain: '#'+CSS.PAGECONTENT,
|
||||
stickY: true
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDWinScroll);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -76,22 +96,6 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
if (movedown) {
|
||||
movedown.remove();
|
||||
}
|
||||
|
||||
// Make each li element in the lists of sections draggable
|
||||
var dd = new Y.DD.Drag({
|
||||
node: sectionnode,
|
||||
// Make each li a Drop target too
|
||||
groups: this.groups,
|
||||
target: true,
|
||||
handles: ['.'+CSS.LEFT]
|
||||
}).plug(Y.Plugin.DDProxy, {
|
||||
// Don't move the node at the end of the drag
|
||||
moveOnEnd: false
|
||||
}).plug(Y.Plugin.DDConstrained, {
|
||||
// Keep it inside the .course-content
|
||||
constrain: '#'+CSS.PAGECONTENT,
|
||||
stickY: true
|
||||
}).plug(Y.Plugin.DDWinScroll);
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
@@ -244,12 +248,33 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
this.groups = ['resource'];
|
||||
this.samenodeclass = CSS.ACTIVITY;
|
||||
this.parentnodeclass = CSS.SECTION;
|
||||
this.resourcedraghandle = this.get_drag_handle(M.str.moodle.move, CSS.EDITINGMOVE, CSS.ICONCLASS);
|
||||
|
||||
// Go through all sections
|
||||
var sectionlistselector = M.course.format.get_section_selector(Y);
|
||||
if (sectionlistselector) {
|
||||
sectionlistselector = '.'+CSS.COURSECONTENT+' '+sectionlistselector;
|
||||
this.setup_for_section(sectionlistselector);
|
||||
|
||||
// Initialise drag & drop for all resources/activities
|
||||
var nodeselector = sectionlistselector.slice(CSS.COURSECONTENT.length+2)+' li.'+CSS.ACTIVITY;
|
||||
var del = new Y.DD.Delegate({
|
||||
container: '.'+CSS.COURSECONTENT,
|
||||
nodes: nodeselector,
|
||||
target: true,
|
||||
handles: ['.' + CSS.EDITINGMOVE],
|
||||
dragConfig: {groups: this.groups}
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDProxy, {
|
||||
// Don't move the node at the end of the drag
|
||||
moveOnEnd: false
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDConstrained, {
|
||||
// Keep it inside the .course-content
|
||||
constrain: '#'+CSS.PAGECONTENT
|
||||
});
|
||||
del.dd.plug(Y.Plugin.DDWinScroll);
|
||||
|
||||
M.course.coursebase.register_module(this);
|
||||
M.course.dragres = this;
|
||||
}
|
||||
@@ -270,14 +295,14 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
resources.addClass(CSS.SECTION);
|
||||
sectionnode.one('.'+CSS.CONTENT+' div.'+CSS.SUMMARY).insert(resources, 'after');
|
||||
}
|
||||
|
||||
// Define each ul as droptarget, so that item could be moved to empty list
|
||||
// Define empty ul as droptarget, so that item could be moved to empty list
|
||||
var tar = new Y.DD.Drop({
|
||||
node: resources,
|
||||
groups: this.groups,
|
||||
padding: '20 0 20 0'
|
||||
});
|
||||
// Go through each li element and make them draggable
|
||||
|
||||
// Initialise each resource/activity in this section
|
||||
this.setup_for_resource('#'+sectionnode.get('id')+' li.'+CSS.ACTIVITY);
|
||||
}, this);
|
||||
},
|
||||
@@ -292,21 +317,7 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
// Replace move icons
|
||||
var move = resourcesnode.one('a.'+CSS.EDITINGMOVE);
|
||||
if (move) {
|
||||
move.replace(this.get_drag_handle(M.str.moodle.move, CSS.EDITINGMOVE, CSS.ICONCLASS));
|
||||
// Make each li element in the lists of sections draggable
|
||||
var dd = new Y.DD.Drag({
|
||||
node: resourcesnode,
|
||||
groups: this.groups,
|
||||
// Make each li a Drop target too
|
||||
target: true,
|
||||
handles: ['.' + CSS.EDITINGMOVE]
|
||||
}).plug(Y.Plugin.DDProxy, {
|
||||
// Don't move the node at the end of the drag
|
||||
moveOnEnd: false
|
||||
}).plug(Y.Plugin.DDConstrained, {
|
||||
// Keep it inside the .course-content
|
||||
constrain: '#'+CSS.PAGECONTENT
|
||||
}).plug(Y.Plugin.DDWinScroll);
|
||||
move.replace(this.resourcedraghandle.cloneNode(true));
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
Vendored
-32
@@ -28,44 +28,12 @@ YUI.add('moodle-course-modchooser', function(Y) {
|
||||
};
|
||||
this.setup_chooser_dialogue(dialogue, header, params);
|
||||
|
||||
this.jumplink = this.container.one('#jump');
|
||||
|
||||
// Initialize existing sections and register for dynamically created sections
|
||||
this.setup_for_section();
|
||||
M.course.coursebase.register_module(this);
|
||||
|
||||
// Catch the page toggle
|
||||
Y.all('.block_settings #settingsnav .type_course .modchoosertoggle a').on('click', this.toggle_mod_chooser, this);
|
||||
|
||||
// Ensure that help links are opened in an appropriate popup
|
||||
this.container.all('div.helpdoclink a').on('click', function(e) {
|
||||
var anchor = e.target.ancestor('a', true);
|
||||
|
||||
var args = {
|
||||
'name' : 'popup',
|
||||
'url' : anchor.getAttribute('href'),
|
||||
'option' : ''
|
||||
};
|
||||
var options = [
|
||||
'height=600',
|
||||
'width=800',
|
||||
'top=0',
|
||||
'left=0',
|
||||
'menubar=0',
|
||||
'location=0',
|
||||
'scrollbars',
|
||||
'resizable',
|
||||
'toolbar',
|
||||
'status',
|
||||
'directories=0',
|
||||
'fullscreen=0',
|
||||
'dependent'
|
||||
]
|
||||
args.options = options.join(',');
|
||||
|
||||
// Note: openpopup is provided by lib/javascript-static.js
|
||||
openpopup(e, args);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Update any section areas within the scope of the specified
|
||||
|
||||
Vendored
+60
-66
@@ -33,7 +33,11 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
SECTIONIDPREFIX : 'section-',
|
||||
SECTIONLI : 'li.section',
|
||||
SHOW : 'a.editing_show',
|
||||
SHOWHIDE : 'a.editing_showhide'
|
||||
SHOWHIDE : 'a.editing_showhide',
|
||||
CONDITIONALHIDDEN : 'conditionalhidden',
|
||||
AVAILABILITYINFODIV : 'div.availabilityinfo',
|
||||
SHOWCLASS : 'editing_show',
|
||||
ACCESSHIDECLASS : 'accesshide'
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -49,32 +53,9 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
|
||||
Y.extend(TOOLBOX, Y.Base, {
|
||||
/**
|
||||
* Replace the button click at the selector with the specified
|
||||
* callback
|
||||
*
|
||||
* @param toolboxtarget The selector of the working area
|
||||
* @param selector The 'button' to replace
|
||||
* @param callback The callback to apply
|
||||
* @param cursor An optional cursor style to apply
|
||||
* Toggle the visibility and availability for the specified
|
||||
* resource show/hide button
|
||||
*/
|
||||
replace_button : function(toolboxtarget, selector, callback, cursor) {
|
||||
if (!cursor) {
|
||||
// Set the default cursor type to pointer to match the
|
||||
// anchor
|
||||
cursor = 'pointer';
|
||||
}
|
||||
var button = Y.one(toolboxtarget).all(selector)
|
||||
.setStyle('cursor', cursor);
|
||||
|
||||
// on isn't chainable and will return an event
|
||||
button.on('click', callback, this);
|
||||
|
||||
return button;
|
||||
},
|
||||
/**
|
||||
* Toggle the visibility and availability for the specified
|
||||
* resource show/hide button
|
||||
*/
|
||||
toggle_hide_resource_ui : function(button) {
|
||||
var element = button.ancestor(CSS.ACTIVITYLI);
|
||||
var hideicon = button.one('img');
|
||||
@@ -91,27 +72,35 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
|
||||
var status = '';
|
||||
var value;
|
||||
if (dimarea.hasClass(toggle_class)) {
|
||||
if (button.hasClass(CSS.SHOWCLASS)) {
|
||||
status = 'hide';
|
||||
value = 1;
|
||||
} else {
|
||||
status = 'show';
|
||||
value = 0;
|
||||
}
|
||||
|
||||
// Change the UI
|
||||
dimarea.toggleClass(toggle_class);
|
||||
// We need to toggle dimming on the description too
|
||||
element.all(CSS.CONTENTAFTERLINK).toggleClass(CSS.DIMMEDTEXT);
|
||||
// Update button info.
|
||||
var newstring = M.util.get_string(status, 'moodle');
|
||||
hideicon.setAttrs({
|
||||
'alt' : newstring,
|
||||
'title' : newstring,
|
||||
'src' : M.util.image_url('t/' + status)
|
||||
});
|
||||
button.set('title', newstring);
|
||||
button.set('className', 'editing_'+status);
|
||||
|
||||
// If activity is conditionally hidden, then don't toggle.
|
||||
if (!dimarea.hasClass(CSS.CONDITIONALHIDDEN)) {
|
||||
// Change the UI.
|
||||
dimarea.toggleClass(toggle_class);
|
||||
// We need to toggle dimming on the description too.
|
||||
element.all(CSS.CONTENTAFTERLINK).toggleClass(CSS.DIMMEDTEXT);
|
||||
}
|
||||
// Toggle availablity info for conditional activities.
|
||||
var availabilityinfo = element.one(CSS.AVAILABILITYINFODIV);
|
||||
|
||||
if (availabilityinfo) {
|
||||
availabilityinfo.toggleClass(CSS.ACCESSHIDECLASS);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
/**
|
||||
@@ -241,6 +230,17 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
initializer : function(config) {
|
||||
this.setup_for_resource();
|
||||
M.course.coursebase.register_module(this);
|
||||
|
||||
var prefix = CSS.ACTIVITYLI + ' ' + CSS.COMMANDSPAN + ' ';
|
||||
Y.delegate('click', this.edit_resource_title, CSS.PAGECONTENT, prefix + CSS.EDITTITLE, this);
|
||||
Y.delegate('click', this.move_left, CSS.PAGECONTENT, prefix + CSS.MOVELEFT, this);
|
||||
Y.delegate('click', this.move_right, CSS.PAGECONTENT, prefix + CSS.MOVERIGHT, this);
|
||||
Y.delegate('click', this.delete_resource, CSS.PAGECONTENT, prefix + CSS.DELETE, this);
|
||||
Y.delegate('click', this.toggle_hide_resource, CSS.PAGECONTENT, prefix + CSS.HIDE, this);
|
||||
Y.delegate('click', this.toggle_hide_resource, CSS.PAGECONTENT, prefix + CSS.SHOW, this);
|
||||
Y.delegate('click', this.toggle_groupmode, CSS.PAGECONTENT, prefix + CSS.GROUPSNONE, this);
|
||||
Y.delegate('click', this.toggle_groupmode, CSS.PAGECONTENT, prefix + CSS.GROUPSSEPARATE, this);
|
||||
Y.delegate('click', this.toggle_groupmode, CSS.PAGECONTENT, prefix + CSS.GROUPSVISIBLE, this);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -252,27 +252,16 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
*/
|
||||
setup_for_resource : function(baseselector) {
|
||||
if (!baseselector) {
|
||||
var baseselector = CSS.PAGECONTENT + ' ' + CSS.ACTIVITYLI;;
|
||||
var baseselector = CSS.PAGECONTENT + ' ' + CSS.ACTIVITYLI;
|
||||
}
|
||||
|
||||
Y.all(baseselector).each(this._setup_for_resource, this);
|
||||
},
|
||||
_setup_for_resource : function(toolboxtarget) {
|
||||
// Edit Title
|
||||
this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.EDITTITLE, this.edit_resource_title);
|
||||
|
||||
// Move left and right
|
||||
this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.MOVELEFT, this.move_left);
|
||||
this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.MOVERIGHT, this.move_right);
|
||||
|
||||
// Delete
|
||||
this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.DELETE, this.delete_resource);
|
||||
|
||||
// Show/Hide
|
||||
var showhide = this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.HIDE, this.toggle_hide_resource);
|
||||
var shown = this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.SHOW, this.toggle_hide_resource);
|
||||
|
||||
showhide = showhide.concat(shown);
|
||||
toolboxtarget = Y.one(toolboxtarget);
|
||||
// "Disable" show/hide icons (change cursor to not look clickable) if section is hidden
|
||||
var showhide = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.HIDE);
|
||||
showhide.concat(toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.SHOW));
|
||||
showhide.each(function(node) {
|
||||
var section = node.ancestor(CSS.SECTIONLI);
|
||||
if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) {
|
||||
@@ -280,15 +269,15 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
}
|
||||
});
|
||||
|
||||
// Change Group Mode
|
||||
// Set groupmode attribute for use by this.toggle_groupmode()
|
||||
var groups;
|
||||
groups = this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.GROUPSNONE, this.toggle_groupmode);
|
||||
groups = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.GROUPSNONE);
|
||||
groups.setAttribute('groupmode', this.GROUPS_NONE);
|
||||
|
||||
groups = this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.GROUPSSEPARATE, this.toggle_groupmode);
|
||||
groups = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.GROUPSSEPARATE);
|
||||
groups.setAttribute('groupmode', this.GROUPS_SEPARATE);
|
||||
|
||||
groups = this.replace_button(toolboxtarget, CSS.COMMANDSPAN + ' ' + CSS.GROUPSVISIBLE, this.toggle_groupmode);
|
||||
groups = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.GROUPSVISIBLE);
|
||||
groups.setAttribute('groupmode', this.GROUPS_VISIBLE);
|
||||
},
|
||||
move_left : function(e) {
|
||||
@@ -405,6 +394,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
};
|
||||
var spinner = M.util.add_spinner(Y, element.one(CSS.SPINNERCOMMANDSPAN));
|
||||
this.send_request(data, spinner);
|
||||
return false; // Need to return false to stop the delegate for the new state firing
|
||||
},
|
||||
toggle_groupmode : function(e) {
|
||||
// Prevent the default button action
|
||||
@@ -446,7 +436,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
// Change the UI
|
||||
icon.setAttrs({
|
||||
'alt' : newtitle,
|
||||
'title' : newtitle,
|
||||
'src' : iconsrc
|
||||
});
|
||||
button.setAttribute('title', newtitle);
|
||||
@@ -460,6 +449,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
};
|
||||
var spinner = M.util.add_spinner(Y, element.one(CSS.SPINNERCOMMANDSPAN));
|
||||
this.send_request(data, spinner);
|
||||
return false; // Need to return false to stop the delegate for the new state firing
|
||||
},
|
||||
/**
|
||||
* Add the moveleft button
|
||||
@@ -469,11 +459,16 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
*/
|
||||
add_moveleft : function(target) {
|
||||
var left_string = M.util.get_string('moveleft', 'moodle');
|
||||
var moveimage = 't/left'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
moveimage = 't/right';
|
||||
} else {
|
||||
moveimage = 't/left';
|
||||
}
|
||||
var newicon = Y.Node.create('<img />')
|
||||
.addClass(CSS.GENERICICONCLASS)
|
||||
.setAttrs({
|
||||
'src' : M.util.image_url('t/left', 'moodle'),
|
||||
'title' : left_string,
|
||||
'src' : M.util.image_url(moveimage, 'moodle'),
|
||||
'alt' : left_string
|
||||
});
|
||||
var moveright = target.one(CSS.MOVERIGHT);
|
||||
@@ -632,6 +627,11 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
initializer : function(config) {
|
||||
this.setup_for_section();
|
||||
M.course.coursebase.register_module(this);
|
||||
|
||||
// Section Highlighting
|
||||
Y.delegate('click', this.toggle_highlight, CSS.PAGECONTENT, CSS.SECTIONLI + ' ' + CSS.HIGHLIGHT, this);
|
||||
// Section Visibility
|
||||
Y.delegate('click', this.toggle_hide_section, CSS.PAGECONTENT, CSS.SECTIONLI + ' ' + CSS.SHOWHIDE, this);
|
||||
},
|
||||
/**
|
||||
* Update any section areas within the scope of the specified
|
||||
@@ -641,18 +641,15 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
* @return void
|
||||
*/
|
||||
setup_for_section : function(baseselector) {
|
||||
if (!baseselector) {
|
||||
// Left here for potential future use - not currently needed due to YUI delegation in initializer()
|
||||
/*if (!baseselector) {
|
||||
var baseselector = CSS.PAGECONTENT;
|
||||
}
|
||||
|
||||
Y.all(baseselector).each(this._setup_for_section, this);
|
||||
Y.all(baseselector).each(this._setup_for_section, this);*/
|
||||
},
|
||||
_setup_for_section : function(toolboxtarget) {
|
||||
// Section Highlighting
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.HIGHLIGHT, this.toggle_highlight);
|
||||
|
||||
// Section Visibility
|
||||
this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.SHOWHIDE, this.toggle_hide_section);
|
||||
// Left here for potential future use - not currently needed due to YUI delegation in initializer()
|
||||
},
|
||||
toggle_hide_section : function(e) {
|
||||
// Prevent the default button action
|
||||
@@ -682,7 +679,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
var newstring = M.util.get_string(status + 'fromothers', 'format_' + this.get('format'));
|
||||
hideicon.setAttrs({
|
||||
'alt' : newstring,
|
||||
'title' : newstring,
|
||||
'src' : M.util.image_url('i/' + status)
|
||||
});
|
||||
button.set('title', newstring);
|
||||
@@ -740,7 +736,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
.set('title', old_string);
|
||||
Y.one(CSS.PAGECONTENT)
|
||||
.all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT + ' img')
|
||||
.set('title', old_string)
|
||||
.set('alt', old_string)
|
||||
.set('src', M.util.image_url('i/marker'));
|
||||
|
||||
@@ -756,7 +751,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
button
|
||||
.set('title', new_string);
|
||||
buttonicon
|
||||
.set('title', new_string)
|
||||
.set('alt', new_string)
|
||||
.set('src', M.util.image_url('i/marked'));
|
||||
}
|
||||
|
||||
+6
-2
@@ -54,9 +54,9 @@ echo $OUTPUT->header(); // send headers
|
||||
|
||||
$manager = new course_enrolment_manager($PAGE, $course);
|
||||
|
||||
$outcome = new stdClass;
|
||||
$outcome = new stdClass();
|
||||
$outcome->success = true;
|
||||
$outcome->response = new stdClass;
|
||||
$outcome->response = new stdClass();
|
||||
$outcome->error = '';
|
||||
|
||||
switch ($action) {
|
||||
@@ -99,6 +99,10 @@ switch ($action) {
|
||||
$user->fullname = fullname($user);
|
||||
unset($user->id);
|
||||
}
|
||||
// Chrome will display users in the order of the array keys, so we need
|
||||
// to ensure that the results ordered array keys. Fortunately, the JavaScript
|
||||
// does not care what the array keys are. It uses user.id where necessary.
|
||||
$outcome->response['users'] = array_values($outcome->response['users']);
|
||||
$outcome->success = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -415,8 +415,8 @@ function authorize_print_order($orderid)
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->upto = $upto;
|
||||
$extrahtml = get_string('howmuch', 'enrol_authorize') .
|
||||
' <input type="text" size="5" name="amount" value="'.$amount.'" /> ' .
|
||||
$extrahtml = '<label for="amount">'.get_string('howmuch', 'enrol_authorize').'</label> ' .
|
||||
'<input id="amount" type="text" size="5" name="amount" value="'.$amount.'" /> ' .
|
||||
get_string('canbecredit', 'enrol_authorize', $a) . '<br />';
|
||||
$table->data[] = array("<b>$strs->confirm:</b>",
|
||||
authorize_print_action_button($orderid, ORDER_REFUND, 0, true, $authstrs->unenrolstudent, $strs->no, $extrahtml));
|
||||
|
||||
@@ -51,8 +51,8 @@ class enrol_cohort_handler {
|
||||
$sql = "SELECT e.*, r.id as roleexists
|
||||
FROM {enrol} e
|
||||
LEFT JOIN {role} r ON (r.id = e.roleid)
|
||||
WHERE customint1 = :cohortid AND enrol = 'cohort'
|
||||
ORDER BY id ASC";
|
||||
WHERE e.customint1 = :cohortid AND e.enrol = 'cohort'
|
||||
ORDER BY e.id ASC";
|
||||
if (!$instances = $DB->get_records_sql($sql, array('cohortid'=>$ca->cohortid))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -481,9 +481,8 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
}
|
||||
$rs->Close();
|
||||
} else {
|
||||
mtrace('Error while communicating with external enrolment database');
|
||||
$extdb->Close();
|
||||
return;
|
||||
mtrace(" error: skipping course '$course->mapping' - could not match with external database");
|
||||
continue;
|
||||
}
|
||||
unset($user_mapping);
|
||||
|
||||
@@ -630,7 +629,7 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
if ($idnumber) {
|
||||
$sqlfields[] = $idnumber;
|
||||
}
|
||||
$sql = $this->db_get_sql($table, array(), $sqlfields);
|
||||
$sql = $this->db_get_sql($table, array(), $sqlfields, true);
|
||||
$createcourses = array();
|
||||
if ($rs = $extdb->Execute($sql)) {
|
||||
if (!$rs->EOF) {
|
||||
|
||||
@@ -388,7 +388,7 @@ class core_role_external extends external_api {
|
||||
// throw an exception if user is not able to assign the role in this context
|
||||
$roles = get_assignable_roles($context, ROLENAME_SHORT);
|
||||
|
||||
if (!key_exists($assignment['roleid'], $roles)) {
|
||||
if (!array_key_exists($assignment['roleid'], $roles)) {
|
||||
throw new invalid_parameter_exception('Can not assign roleid='.$assignment['roleid'].' in contextid='.$assignment['contextid']);
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ class core_role_external extends external_api {
|
||||
|
||||
// throw an exception if user is not able to unassign the role in this context
|
||||
$roles = get_assignable_roles($context, ROLENAME_SHORT);
|
||||
if (!key_exists($unassignment['roleid'], $roles)) {
|
||||
if (!array_key_exists($unassignment['roleid'], $roles)) {
|
||||
throw new invalid_parameter_exception('Can not unassign roleid='.$unassignment['roleid'].' in contextid='.$unassignment['contextid']);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ $string['pluginname'] = 'LDAP enrolments';
|
||||
$string['pluginname_desc'] = '<p>You can use an LDAP server to control your enrolments. It is assumed your LDAP tree contains groups that map to the courses, and that each of those groups/courses will have membership entries to map to students.</p><p>It is assumed that courses are defined as groups in LDAP, with each group having multiple membership fields (<em>member</em> or <em>memberUid</em>) that contain a uniqueidentification of the user.</p><p>To use LDAP enrolment, your users <strong>must</strong> to have a valid idnumber field. The LDAP groups must have that idnumber in the member fields for a user to be enrolled in the course. This will usually work well if you are already using LDAP Authentication.</p><p>Enrolments will be updated when the user logs in. You can also run a script to keep enrolments in synch. Look in <em>enrol/ldap/cli/sync.php</em>.</p><p>This plugin can also be set to automatically create new courses when new groups appear in LDAP.</p>';
|
||||
$string['pluginnotenabled'] = 'Plugin not enabled!';
|
||||
$string['role_mapping'] = '<p>For each role that you want to assign from LDAP, you need to specify the list of contexts where the role courses\'s groups are located. Separate different contexts with \';\'.</p><p>You also need to specify the attribute your LDAP server uses to hold the members of a group. Usually \'member\' or \'memberUid\'</p>';
|
||||
$string['role_mapping_attribute'] = 'LDAP member attribute for {$a}';
|
||||
$string['role_mapping_context'] = 'LDAP contexts for {$a}';
|
||||
$string['role_mapping_key'] = 'Map roles from LDAP ';
|
||||
$string['roles'] = 'Role mapping';
|
||||
$string['server_settings'] = 'LDAP server settings';
|
||||
|
||||
@@ -151,7 +151,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
foreach ($data as $role) {
|
||||
$contextid = $this->get_id().'['.$role['id'].'][contexts]';
|
||||
$contextname = $this->get_full_name().'['.$role['id'].'][contexts]';
|
||||
$return .= '<div style="height: 2em;"><input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>';
|
||||
$return .= '<div style="height: 2em;"><label class="accesshide" for="'.$contextid.'">'.get_string('role_mapping_context', 'enrol_ldap', $role['name']).'</label>';
|
||||
$return .= '<input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
|
||||
@@ -160,7 +161,8 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
foreach ($data as $role) {
|
||||
$memberattrid = $this->get_id().'['.$role['id'].'][memberattribute]';
|
||||
$memberattrname = $this->get_full_name().'['.$role['id'].'][memberattribute]';
|
||||
$return .= '<div style="height: 2em;"><input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>';
|
||||
$return .= '<div style="height: 2em;"><label class="accesshide" for="'.$memberattrid.'">'.get_string('role_mapping_attribute', 'enrol_ldap', $role['name']).'</label>';
|
||||
$return .= '<input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '<div style="clear:both;"></div>';
|
||||
|
||||
+3
-1
@@ -766,13 +766,15 @@ class course_enrolment_manager {
|
||||
|
||||
$users = array();
|
||||
foreach ($userroles as $userrole) {
|
||||
$contextid = $userrole->contextid;
|
||||
unset($userrole->contextid); // This would collide with user avatar.
|
||||
if (!array_key_exists($userrole->id, $users)) {
|
||||
$users[$userrole->id] = $this->prepare_user_for_display($userrole, $extrafields, $now);
|
||||
}
|
||||
$a = new stdClass;
|
||||
$a->role = $roles[$userrole->roleid]->localname;
|
||||
$changeable = ($userrole->component == '');
|
||||
if ($userrole->contextid == $this->context->id) {
|
||||
if ($contextid == $this->context->id) {
|
||||
$roletext = get_string('rolefromthiscourse', 'enrol', $a);
|
||||
} else {
|
||||
$changeable = false;
|
||||
|
||||
@@ -53,9 +53,9 @@ echo $OUTPUT->header(); // send headers
|
||||
|
||||
$manager = new course_enrolment_manager($PAGE, $course);
|
||||
|
||||
$outcome = new stdClass;
|
||||
$outcome = new stdClass();
|
||||
$outcome->success = true;
|
||||
$outcome->response = new stdClass;
|
||||
$outcome->response = new stdClass();
|
||||
$outcome->error = '';
|
||||
|
||||
switch ($action) {
|
||||
@@ -79,6 +79,10 @@ switch ($action) {
|
||||
}
|
||||
$user->extrafields = implode(', ', $fieldvalues);
|
||||
}
|
||||
// Chrome will display users in the order of the array keys, so we need
|
||||
// to ensure that the results ordered array keys. Fortunately, the JavaScript
|
||||
// does not care what the array keys are. It uses user.id where necessary.
|
||||
$outcome->response['users'] = array_values($outcome->response['users']);
|
||||
$outcome->success = true;
|
||||
break;
|
||||
case 'enrol':
|
||||
@@ -135,4 +139,4 @@ switch ($action) {
|
||||
throw new enrol_ajax_exception('unknowajaxaction');
|
||||
}
|
||||
|
||||
echo json_encode($outcome);
|
||||
echo json_encode($outcome);
|
||||
|
||||
@@ -101,7 +101,7 @@ class enrol_manual_external extends external_api {
|
||||
|
||||
//throw an exception if user is not able to assign the role
|
||||
$roles = get_assignable_roles($context);
|
||||
if (!key_exists($enrolment['roleid'], $roles)) {
|
||||
if (!array_key_exists($enrolment['roleid'], $roles)) {
|
||||
$errorparams = new stdClass();
|
||||
$errorparams->roleid = $enrolment['roleid'];
|
||||
$errorparams->courseid = $enrolment['courseid'];
|
||||
|
||||
@@ -64,7 +64,7 @@ $PAGE->set_heading($course->fullname);
|
||||
navigation_node::override_active_url(new moodle_url('/enrol/users.php', array('id'=>$course->id)));
|
||||
|
||||
// Create the user selector objects.
|
||||
$options = array('enrolid' => $enrolid);
|
||||
$options = array('enrolid' => $enrolid, 'accesscontext' => $context);
|
||||
|
||||
$potentialuserselector = new enrol_manual_potential_participant('addselect', $options);
|
||||
$currentuserselector = new enrol_manual_current_participant('removeselect', $options);
|
||||
|
||||
+9
-2
@@ -141,12 +141,19 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
base.dd.addHandle('.'+CSS.HEADER+' h2');
|
||||
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
|
||||
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url(collapsedimage, 'moodle'));
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE);
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).toggleClass(CSS.HIDDEN);
|
||||
if (this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).hasClass(CSS.HIDDEN)) {
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url(collapsedimage, 'moodle'));
|
||||
} else {
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/expanded', 'moodle'));
|
||||
}
|
||||
|
||||
@@ -35,10 +35,11 @@ if (!$course = $DB->get_record("course", array("id"=>$id))) {
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id, MUST_EXIST);
|
||||
$PAGE->set_context($context);
|
||||
|
||||
require_login();
|
||||
|
||||
if ($SESSION->wantsurl) {
|
||||
if (!empty($SESSION->wantsurl)) {
|
||||
$destination = $SESSION->wantsurl;
|
||||
unset($SESSION->wantsurl);
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
.moodle-dialogue-base .moodle-dialogue-hd {font-size:110%;color:inherit;font-weight:bold;text-align:left;padding:5px 6px;margin:0;border-bottom:1px solid #ccc;background-color:#f6f6f6;}
|
||||
.moodle-dialogue-base .closebutton {background-image:url(sprite.png);width:25px;height:15px;background-repeat:no-repeat;float:right;vertical-align:middle;display:inline-block;cursor:pointer;}
|
||||
.moodle-dialogue-base .moodle-dialogue-bd {padding:5px; overflow: auto;}
|
||||
.moodle-dialogue-base .moodle-dialogue-fd {}
|
||||
.moodle-dialogue-base .moodle-dialogue-ft {}
|
||||
|
||||
.moodle-dialogue-confirm .confirmation-dialogue {text-align:center;}
|
||||
.moodle-dialogue-confirm .confirmation-message {margin:0.5em 1em;}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
HEADER : 'moodle-dialogue-hd',
|
||||
BODY : 'moodle-dialogue-bd',
|
||||
CONTENT : 'moodle-dialogue-content',
|
||||
FOOTER : 'moodle-dialogue-fd',
|
||||
FOOTER : 'moodle-dialogue-ft',
|
||||
HIDDEN : 'hidden',
|
||||
LIGHTBOX : 'moodle-dialogue-lightbox'
|
||||
};
|
||||
@@ -35,7 +35,7 @@ var DIALOGUE = function(config) {
|
||||
.append(C('<div id="'+id+'" class="'+CSS.WRAP+'"></div>')
|
||||
.append(C('<div class="'+CSS.HEADER+' yui3-widget-hd"></div>'))
|
||||
.append(C('<div class="'+CSS.BODY+' yui3-widget-bd"></div>'))
|
||||
.append(C('<div class="'+CSS.CONTENT+' yui3-widget-ft"></div>')));
|
||||
.append(C('<div class="'+CSS.FOOTER+' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
config.srcNode = '#'+id;
|
||||
config.width = config.width || '400px';
|
||||
|
||||
@@ -526,6 +526,7 @@ class core_files_renderer extends plugin_renderer_base {
|
||||
<div class="{!}fp-tb-logout"><img src="'.$this->pix_url('a/logout').'" /><a href="#"></a></div>
|
||||
<div class="{!}fp-tb-manage"><a href="#"><img src="'.$this->pix_url('a/setting').'" /> '.get_string('manageurl', 'repository').'</a></div>
|
||||
<div class="{!}fp-tb-help"><a href="#"><img src="'.$this->pix_url('a/help').'" /> '.get_string('help').'</a></div>
|
||||
<div class="{!}fp-tb-message"></div>
|
||||
</div>
|
||||
<div class="{!}fp-viewbar">
|
||||
<a class="{!}fp-vb-icons" href="#"></a>
|
||||
|
||||
@@ -872,10 +872,8 @@ class gradingform_guide_instance extends gradingform_instance {
|
||||
$html .= html_writer::tag('div', get_string('restoredfromdraft', 'gradingform_guide'),
|
||||
array('class' => 'gradingform_guide-restored'));
|
||||
}
|
||||
if (!empty($options['showdescriptionteacher'])) {
|
||||
$html .= html_writer::tag('div', $this->get_controller()->get_formatted_description(),
|
||||
array('class' => 'gradingform_guide-description'));
|
||||
}
|
||||
$html .= html_writer::tag('div', $this->get_controller()->get_formatted_description(),
|
||||
array('class' => 'gradingform_guide-description'));
|
||||
$html .= $this->get_controller()->get_renderer($page)->display_guide($criteria, $comments, $options, $mode,
|
||||
$gradingformelement->getName(), $value, $this->validationerrors);
|
||||
return $html;
|
||||
|
||||
@@ -49,8 +49,6 @@ $PAGE->set_heading($title);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
if (!empty($options['showdescriptionstudent'])) {
|
||||
echo $OUTPUT->box($controller->get_formatted_description(), 'gradingform_guide-description');
|
||||
}
|
||||
echo $OUTPUT->box($controller->get_formatted_description(), 'gradingform_guide-description');
|
||||
echo $controller->render_preview($PAGE);
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+1
-1
@@ -1503,7 +1503,7 @@ class grade_structure {
|
||||
|
||||
$url->param('action', 'show');
|
||||
|
||||
$hideicon = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strshow, 'class'=>'iconsmall')));
|
||||
$hideicon = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strshow, 'class'=>'smallicon')));
|
||||
|
||||
} else {
|
||||
$url->param('action', 'hide');
|
||||
|
||||
@@ -225,7 +225,7 @@ class grade_report_grader extends grade_report {
|
||||
$changedgrades = true;
|
||||
|
||||
} else if ($datatype === 'feedback') {
|
||||
if ($oldvalue->feedback === $postedvalue) {
|
||||
if (($oldvalue->feedback === $postedvalue) or ($oldvalue->feedback === NULL and empty($postedvalue))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
+16
-10
@@ -341,23 +341,29 @@ class grade_report_user extends grade_report {
|
||||
$hidden = ' hidden';
|
||||
}
|
||||
|
||||
$hide = false;
|
||||
// If this is a hidden grade item, hide it completely from the user.
|
||||
if ($grade_grade->is_hidden() && !$this->canviewhidden && (
|
||||
$this->showhiddenitems == GRADE_REPORT_USER_HIDE_HIDDEN ||
|
||||
($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) {
|
||||
// return false;
|
||||
} else {
|
||||
// The grade object can be marked visible but still be hidden
|
||||
// if "enablegroupmembersonly" is on and its an activity assigned to a grouping the user is not in
|
||||
if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
|
||||
$instances = $this->gtree->modinfo->get_instances();
|
||||
if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
|
||||
$cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
|
||||
if (!$cm->uservisible) {
|
||||
return false;
|
||||
$hide = true;
|
||||
} else if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
|
||||
// The grade object can be marked visible but still be hidden if...
|
||||
// 1) "enablegroupmembersonly" is on and the activity is assigned to a grouping the user is not in.
|
||||
// 2) the student cannot see the activity due to conditional access and its set to be hidden entirely.
|
||||
$instances = $this->gtree->modinfo->get_instances_of($grade_object->itemmodule);
|
||||
if (!empty($instances[$grade_object->iteminstance])) {
|
||||
$cm = $instances[$grade_object->iteminstance];
|
||||
if (!$cm->uservisible) {
|
||||
// Further checks are required to determine whether the activity is entirely hidden or just greyed out.
|
||||
if ($cm->is_user_access_restricted_by_group() || $cm->is_user_access_restricted_by_conditional_access()) {
|
||||
$hide = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$hide) {
|
||||
/// Excluded Item
|
||||
if ($grade_grade->is_excluded()) {
|
||||
$fullname .= ' ['.get_string('excluded', 'grades').']';
|
||||
|
||||
+11
-10
@@ -239,17 +239,18 @@ function groups_update_group_icon($group, $data, $editform) {
|
||||
$context = get_context_instance(CONTEXT_COURSE, $group->courseid, MUST_EXIST);
|
||||
|
||||
//TODO: it would make sense to allow picture deleting too (skodak)
|
||||
|
||||
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
||||
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
||||
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
||||
$group->picture = 1;
|
||||
} else {
|
||||
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
||||
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
||||
$group->picture = 0;
|
||||
if (!empty($CFG->gdversion)) {
|
||||
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
||||
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
||||
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
||||
$group->picture = 1;
|
||||
} else {
|
||||
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
||||
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
||||
$group->picture = 0;
|
||||
}
|
||||
@unlink($iconfile);
|
||||
}
|
||||
@unlink($iconfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,17 +204,21 @@
|
||||
break;
|
||||
|
||||
case FRONTPAGECOURSELIST:
|
||||
$ncourses = $DB->count_records('course');
|
||||
if (isloggedin() and !$hassiteconfig and !isguestuser() and empty($CFG->disablemycourses)) {
|
||||
echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('mycourses'))), array('href'=>'#skipmycourses', 'class'=>'skip-block'));
|
||||
echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
|
||||
print_my_moodle();
|
||||
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipmycourses'));
|
||||
} else if ((!$hassiteconfig and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
|
||||
} else if ((!$hassiteconfig and !isguestuser()) or ($ncourses <= FRONTPAGECOURSELIMIT)) {
|
||||
// admin should not see list of courses when there are too many of them
|
||||
echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));
|
||||
echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
|
||||
print_courses(0);
|
||||
echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
|
||||
} else {
|
||||
echo html_writer::tag('div', get_string('therearecourses', '', $ncourses), array('class' => 'notifyproblem'));
|
||||
print_course_search('', false, 'short');
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+2
-4
@@ -56,10 +56,8 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau
|
||||
@error_reporting(E_ALL);
|
||||
@ini_set('display_errors', '1');
|
||||
|
||||
// Check that PHP is of a sufficient version
|
||||
// PHP 5.2.0 is intentionally checked here even though a higher version is required by the environment
|
||||
// check. This is not a typo - see MDL-18112
|
||||
if (version_compare(phpversion(), "5.2.0") < 0) {
|
||||
// Check that PHP is of a sufficient version.
|
||||
if (version_compare(phpversion(), '5.3.2') < 0) {
|
||||
$phpversion = phpversion();
|
||||
// do NOT localise - lang strings would not work here and we CAN not move it after installib
|
||||
echo "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).<br />";
|
||||
|
||||
@@ -51,4 +51,5 @@ $string['pathssubdataroot'] = 'Тази директория е място, къ
|
||||
$string['pathssubdirroot'] = 'Пълен път до директорията на Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Пълен интернет адрес, на който ще се отваря Moodle. Не е възможно Moodle да се отваря чрез различни адреси. Ако Вашият сайт има няколко адреса трябва на всеки от другите адреси да направите пренасочване към този. Ако Вашият сайт се отваря както глобално от Интернет, така и от локална мрежа, настройте DNS, така че потребителите от локалната мрежа също да могат да ползват глобалния адрес. Ако адресът не е коректен, моля, променете адреса в браузъра си и започнете инсталирането с правилния адрес.';
|
||||
$string['phpextension'] = '{$a} разширение на PHP';
|
||||
$string['phpversionhelp'] = '<p>Moodle изисква версия на PHP най-малко 4.3.0 или 5.1.0 (5.0.x има значителен брой известни проблеми).</p> <p>Вие използвате в момента версия {$a}</p> <p>Трябва да обновите PHP или да се преместите на нов хост (сървър) с по-нова версия на PHP!<br /> (В случая с 5.0.x може да опитате да инсталирате по-старата версия 4.4.x)</p>';
|
||||
$string['wwwroot'] = 'Уеб адрес';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'English (fixes)';
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'English for kids';
|
||||
@@ -41,6 +41,7 @@ $string['databasehost'] = 'Servidor de la base de datos';
|
||||
$string['databasename'] = 'Nombre de la base de datos';
|
||||
$string['databasetypehead'] = 'Seleccione el controlador de la base de datos';
|
||||
$string['dataroot'] = 'Directorio de Datos';
|
||||
$string['datarootpermission'] = 'Permisos directorios de datos';
|
||||
$string['dbprefix'] = 'Prefijo de tablas';
|
||||
$string['dirroot'] = 'Directorio Moodle';
|
||||
$string['environmenthead'] = 'Comprobando su entorno';
|
||||
|
||||
@@ -85,7 +85,7 @@ $string['phpversionhelp'] = '<p>Moodle requiere al menos una versión de PHP 4.3
|
||||
(En caso de 5.0.x podría también revertir a la versión 4.4.x)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete <strong>{$a->packname} {$a->packversion}</strong> en su computadora. !Enhorabuena!';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora principalmente:';
|
||||
$string['welcomep30'] = 'Esta versión de <strong>{$a->installername}</strong> incluye las aplicaciones necesarias para que <strong>Moodle</strong> funcione en su computadora, principalmente:';
|
||||
$string['welcomep40'] = 'El paquete también incluye <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas
|
||||
licencias. El programa <strong>{$a->installername}</strong> es
|
||||
|
||||
@@ -39,5 +39,5 @@ $string['clitypevaluedefault'] = 'sartu balorea, sakatu Enter-i berezko balorea
|
||||
$string['cliunknowoption'] = 'Aukera ezezagunak:{$a}
|
||||
Mesedez, erabili --laguntza aukera.';
|
||||
$string['cliyesnoprompt'] = 'idatzi b (bai esateko) edo e (ez esateko)';
|
||||
$string['environmentrequireinstall'] = 'derrigorrezkoa da instalatuta etagaituta izatea';
|
||||
$string['environmentrequireinstall'] = 'derrigorrezkoa da instalatuta eta gaituta izatea';
|
||||
$string['environmentrequireversion'] = '{$a->needed} bertsioa beharrezkoa da eta zu {$a->current} ari zara egikaritzen';
|
||||
|
||||
@@ -38,5 +38,5 @@ $string['clitypevalue'] = 'syötä arvo';
|
||||
$string['clitypevaluedefault'] = 'syötä arvo, paina Enteriä käyttääksesi oletusarvoa ({$a})';
|
||||
$string['cliunknowoption'] = 'Tunnistamaton valinta: {$a} Ole hyvä ja käytä --help -valintaa.';
|
||||
$string['cliyesnoprompt'] = 'syötä y (kyllä) tai n (ei)';
|
||||
$string['environmentrequireinstall'] = 'vaaditaan asennettavaksi/käyttöönotettavaksi';
|
||||
$string['environmentrequireinstall'] = 'pitää olla asennettuna ja käytössä';
|
||||
$string['environmentrequireversion'] = 'versio {$a->needed} vaaditaan ja käytössä on versio {$a->current}';
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['cannotcreatelangdir'] = 'Kielihakemistoa ei voitu luoda';
|
||||
$string['cannotcreatelangdir'] = 'Kielihakemistoa ei voida luoda';
|
||||
$string['cannotcreatetempdir'] = 'Temp-hakemistoa ei voitu luoda';
|
||||
$string['cannotdownloadcomponents'] = 'Komponentteja ei voitu ladata';
|
||||
$string['cannotdownloadzipfile'] = 'ZIP-tiedostoa ei voitu ladata';
|
||||
$string['cannotfindcomponent'] = 'Komponenttia ei löytynyt';
|
||||
$string['cannotsavemd5file'] = 'MD5-tiedostoa ei voitu tallentaa';
|
||||
$string['cannotsavezipfile'] = 'Zip-tiedosta ei voitu tallentaa';
|
||||
$string['cannotsavezipfile'] = 'Zip-tiedostoa ei voitu tallentaa';
|
||||
$string['cannotunzipfile'] = 'Zip-tiedostoa ei voitu purkaa';
|
||||
$string['componentisuptodate'] = 'Komponentti on ajan tasalla';
|
||||
$string['downloadedfilecheckfailed'] = 'Ladatun tiedoston tarkistus epäonnistui';
|
||||
$string['invalidmd5'] = 'Virheellinen MD5';
|
||||
$string['missingrequiredfield'] = 'JOitakin vaadituista kentistä puuttuu';
|
||||
$string['invalidmd5'] = 'Tarkistusmuuttuja oli väärin - yritä uudelleen';
|
||||
$string['missingrequiredfield'] = 'Joitakin vaadituista kentistä puuttuu';
|
||||
$string['remotedownloaderror'] = 'Komponentin lataaminen palvelimelle epäonnistui, ole hyvä ja varmista välityspalvelimen asetukset, PHP cURL -laajennus on suositeltu.<br /><br />Sinun täytyy ladata <a href="{$a->url}">{$a->url}</a> -tiedosto manuaalisesti, kopioi se kohteeseen "{$a->dest}" serverilläsi ja pura se sinne.';
|
||||
$string['wrongdestpath'] = 'Virheellinen kohdekansio';
|
||||
$string['wrongsourcebase'] = 'Väärä lähteen web-osoitteen kanta';
|
||||
|
||||
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
$string['admindirname'] = 'Ylläpitohakemisto';
|
||||
$string['availablelangs'] = 'Saatavilla olevat kielipaketit';
|
||||
$string['chooselanguagehead'] = 'Valitse kieli';
|
||||
$string['chooselanguagesub'] = 'Valitse kieli asennusohjelmaa varten. Voit valita muita kieliä käyttöösi myöhemmin.';
|
||||
$string['chooselanguagesub'] = 'Valitse kieli asennusohjelmaa varten. Tätä kieltä käytetään sivuston oletuskielenä, jonka voi vaihtaa tarpeen mukaan. Myöhemmin voit myös lisätä käyttöön muitakin kieliä.';
|
||||
$string['clialreadyconfigured'] = 'Tiedosto config.php on jo olemassa, käytä admin/cli/install_database.php -tiedostoa jos haluat asentaa tämän sivuston.';
|
||||
$string['clialreadyinstalled'] = 'Tiedosto config.php on jo olemassa, ole hyvä ja käytä admin/cli/upgrade.php:ta jos haluat päivittää sivustosi';
|
||||
$string['cliinstallheader'] = 'Moodlen {$a} komentoriviasennusohjelma';
|
||||
@@ -43,7 +43,7 @@ $string['databasetypehead'] = 'Valitse tietokannan ajuri';
|
||||
$string['dataroot'] = 'Datahakemisto';
|
||||
$string['datarootpermission'] = 'Datahakemistojen oikeudet';
|
||||
$string['dbprefix'] = 'Taulukon etumerkki';
|
||||
$string['dirroot'] = 'Moodle hakemisto';
|
||||
$string['dirroot'] = 'Moodle-hakemisto';
|
||||
$string['environmenthead'] = 'Ympäristön tarkistus';
|
||||
$string['environmentsub2'] = 'Jokaisessa Moodle-julkaisussa on joitakin vähimmäisvaatimuksia PHP-versiolta sekä joitakin pakollisia PHP-lisäosia.
|
||||
Ennen jokaista asennusta ja päivitystä suoritetaan täysi ympäristön tarkistus. Ole hyvä ja ota yhteyttä palvelimen ylläpitoon jos et tiedä kuinka asentaa uutta versiota tai PHP-lisäosia.';
|
||||
@@ -54,14 +54,14 @@ $string['memorylimithelp'] = '<p>PHP muistiraja palvelimellesi on tällä hetkel
|
||||
|
||||
<p>Tämä saattaa aiheuttaa Moodlelle muistiongelmia myöhemmin, varsinkin jos sinulla on paljon mahdollisia moduuleita ja/tai paljon käyttäjiä.</p>
|
||||
|
||||
<p>Suosittelemme, että valitset asetuksiksi PHP:n korkeimmalla mahdollisella raja-arvolla, esimerkiksi 16M.
|
||||
<p>Suosittelemme, että valitset asetuksiksi PHP:n korkeimmalla mahdollisella raja-arvolla, esimerkiksi 40M.
|
||||
On olemassa monia tapoja joilla voit yrittää tehdä tämän:</p>
|
||||
<ol>
|
||||
<li>Jos pystyt, uudelleenkäännä PHP <i>--enable-memory-limit</i>. :llä.
|
||||
Tämä sallii Moodlen asettaa muistirajan itse.</li>
|
||||
<li>Jos sinulla on pääsy php.ini tiedostoosi, voit muuttaa <b>memory_limit</b> asetuksen siellä johonkin kuten 16M. Jos sinulla ei ole pääsyoikeutta, voit kenties pyytää ylläpitäjää tekemään tämän puolestasi.</li>
|
||||
<li>Jos sinulla on pääsy php.ini tiedostoosi, voit muuttaa <b>memory_limit</b> asetuksen siellä johonkin kuten 40M. Jos sinulla ei ole pääsyoikeutta, voit kenties pyytää ylläpitäjää tekemään tämän puolestasi.</li>
|
||||
<li>Joillain PHP palvelimilla voit luoda a .htaccess tiedoston Moodle hakemistossa, sisältäen tämän rivin:
|
||||
<p><blockquote>php_value memory_limit 16M</blockquote></p>
|
||||
<p><blockquote>php_value memory_limit 40M</blockquote></p>
|
||||
<p>Kuitenkin, joillain palvelimilla tämä estää <b>kaikkia</b> PHP sivuja toimimasta (näet virheet, kun katsot sivuja), joten sinun täytyy poistaa .htaccess tiedosto.</p></li>
|
||||
</ol>';
|
||||
$string['paths'] = 'Polut';
|
||||
@@ -82,9 +82,7 @@ $string['pathsunsecuredataroot'] = 'Dataroot-sijainti on turvallinen';
|
||||
$string['pathswrongadmindir'] = 'Admin-hakemistoa ei ole';
|
||||
$string['phpextension'] = '{$a} PHP-lisäosa';
|
||||
$string['phpversion'] = 'PHP versio';
|
||||
$string['phpversionhelp'] = '<p>Moodle vaatii vähintään PHP version 4.1.0.</p>
|
||||
<p>Käytät parhaillaan versiota {$a}</p>
|
||||
<p>Sinun täytyy päivittää PHP tai siirtää isäntä uudemman PHP version kanssa!</p>';
|
||||
$string['phpversionhelp'] = '<p>Moodle vaatii vähintään PHP-version 4.3.0 tai 5.1.0 (5.0.x sisältää monia tunnettuja ongelmia).</p> <p>Käytössäsi on versio {$a}</p> <p>Sinun pitää päivittää PHP tai siirtää palvelimelle jossa on uudempi PHP.<br /> (Jos käytössäsi on 5.0.x voit myös päivittää alaspäin 4.4.x -versioon)</p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Näet tämän sivun koska olet onnistuneesti asentanut ja käynnistänyt <strong>{$a->packname} {$a->packversion}</strong> paketin tietokoneellasi.
|
||||
Onnittelut!';
|
||||
|
||||
@@ -30,4 +30,5 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['thislanguage'] = 'Faroese';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Føroyskt';
|
||||
|
||||
@@ -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['language'] = 'Tungumál';
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Automatically generated strings for Moodle installer
|
||||
*
|
||||
* Do not edit this file manually! It contains just a subset of strings
|
||||
* needed during the very first steps of installation. This file was
|
||||
* generated automatically by export-installer.php (which is part of AMOS
|
||||
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
|
||||
* list of strings defined in /install/stringnames.txt.
|
||||
*
|
||||
* @package installer
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['cannotcreatelangdir'] = 'Ní féidir eolaire teanga a chruthú';
|
||||
$string['cannotcreatetempdir'] = 'Ní féidir eolaire sealadach a chruthú';
|
||||
$string['cannotdownloadcomponents'] = 'Ní féidir na comhphairteanna a íoslódáil';
|
||||
$string['cannotdownloadzipfile'] = 'Ní féidir comhad ZIP a íoslódáil';
|
||||
$string['cannotfindcomponent'] = 'Ní féidir teacht ar chomhpháirt';
|
||||
$string['cannotsavemd5file'] = 'Ni féidir an comhad md5 a shábháil';
|
||||
$string['cannotsavezipfile'] = 'Ni féidir an comhad ZIP a shábháil';
|
||||
$string['cannotunzipfile'] = 'Ní féidir an comhad a dhízipeáil';
|
||||
$string['componentisuptodate'] = 'Tá an chomhpháirt suas chun dáta';
|
||||
$string['downloadedfilecheckfailed'] = 'Theip ar an seiceáil comhaid íoslódailte';
|
||||
$string['invalidmd5'] = 'Bhí "an athróg seiceála mícheart – triail arís é';
|
||||
$string['missingrequiredfield'] = 'Réimse riachtanach ar iarraidh';
|
||||
$string['remotedownloaderror'] = 'Theip ar íoslódail comhpháirte chuig do fhreastalaí, dearbhaigh seachshocruithe moltar iarmhíreanna , PHP cURL go hard.<br /"><br />Y Caithfidh tú an comhad <a href="""{$a->url}"">{$a->url}</a> a íoslódáil de láimh';
|
||||
$string['wrongdestpath'] = 'Cosán sprice mícheart';
|
||||
$string['wrongsourcebase'] = 'Foinse mícheart do bhunachar URL';
|
||||
$string['wrongzipfilename'] = 'Ainm mícherat comhaid ZIP';
|
||||
@@ -33,13 +33,13 @@ defined('MOODLE_INTERNAL') || die();
|
||||
$string['cannotcreatelangdir'] = 'לא ניתן ליצור סיפריית שפה.';
|
||||
$string['cannotcreatetempdir'] = 'לא ניתן ליצור סיפרייה זמנית.';
|
||||
$string['cannotdownloadcomponents'] = 'לא ניתן להוריד רכיבים.';
|
||||
$string['cannotdownloadzipfile'] = 'לא ניתן להוריד קובץ ZIP.';
|
||||
$string['cannotdownloadzipfile'] = 'לא ניתן להוריד קובץ 7Zip';
|
||||
$string['cannotfindcomponent'] = 'הרכיב לא נמצא.';
|
||||
$string['cannotsavemd5file'] = 'לא ניתן לשמור קובץ md5.';
|
||||
$string['cannotsavezipfile'] = 'לא ניתן לשמור קובץ ZIP.';
|
||||
$string['cannotunzipfile'] = 'לא ניתן לפתוח את קובץ ה-ZIP.';
|
||||
$string['componentisuptodate'] = 'הרכיב מעודכן.';
|
||||
$string['downloadedfilecheckfailed'] = 'נכשלה בדיקת הקובץ המורד.';
|
||||
$string['downloadedfilecheckfailed'] = 'הקובץ אשר ירד נמצא שגוי';
|
||||
$string['invalidmd5'] = 'md5 לא חוקי';
|
||||
$string['missingrequiredfield'] = 'חסר שדה נדרש כלשהו';
|
||||
$string['remotedownloaderror'] = 'הורדת הרכיב לשרת שלך כשלה, אנא וודא את הגדרות ה-proxy שלך. תוספת PHP cURL מומלצת מאוד להתקנה.
|
||||
|
||||
@@ -101,11 +101,9 @@ $string['welcomep40'] = 'החבילה כוללת בנוסף
|
||||
$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע"י הרשיונות המתאימים להם. החבילה
|
||||
<strong>{$a->installername}</strong>
|
||||
השלמה היא
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html"> קוד פתוח
|
||||
</a>
|
||||
והיא מבוזרת תחת רישיון
|
||||
<a>
|
||||
href="http://www.gnu.org/copyleft/gpl.html">GPL</a>';
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">קוד פתוח</a>
|
||||
והיא מופצת תחת רשיון
|
||||
<a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>';
|
||||
$string['welcomep60'] = 'העמודים הבאים יובילו אותך בצורה פשוטה דרך כמה צעדים לעיצוב הגדרות <strong>Moodle</strong> במחשבך.
|
||||
תוכל לאשר את הגדרות ברירת המחדל או, באפשרותך, לשנותם לפי צרכיך.';
|
||||
$string['welcomep70'] = 'הקש על לחצן ה"המשך" למטה כדי להמשיך עם הגדרת ה-<strong>Moodle</strong>';
|
||||
|
||||
@@ -30,5 +30,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['parentlanguage'] = '';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = 'Italiano';
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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['parentlanguage'] = 'ja';
|
||||
$string['thisdirection'] = 'ltr';
|
||||
$string['thislanguage'] = '日本語 小学生';
|
||||
@@ -87,7 +87,7 @@ $string['welcomep20'] = '당신의 컴퓨터에 <strong>{$a->packname} {$a->pack
|
||||
$string['welcomep30'] = '<strong>{$a->installername}</strong> 판본은 <strong>무들</strong>이 동작하는 환경을 생성하기 위한 어플리케이션을 포함하고 있습니다.';
|
||||
$string['welcomep40'] = '이 패키지는 <strong>무들 {$a->moodlerelease} ({$a->moodleversion})</strong> 을 포함하고 있습니다.';
|
||||
$string['welcomep50'] = '이 패키지에 있는 모든 어플리케이션을 사용하는 것은 각각의 라이센스에의해 지배받습니다. 완전한<strong>{$a->installername}</strong> 패키지는
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">공개 소스이며 </a> <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> 라이선스에 의해 배포됩니다.';
|
||||
<a href="http://www.opensource.org/docs/definition_plain.html">공개 소스</a>이며 <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> 라이선스에 의해 배포됩니다.';
|
||||
$string['welcomep60'] = '다음 페이지들은 컴퓨터에 <strong>무들</strong>을 설치하고 설정하는 길라잡이 역할을 할 것입니다. 기본 설정을 선택하거나 목적에 맞게 선택적으로 수정할 수 있습니다.';
|
||||
$string['welcomep70'] = '<strong>무들</strong> 설정을 계속하기 위해서는 "다음" 버튼을 클릭하세요.';
|
||||
$string['wwwroot'] = '웹 주소';
|
||||
|
||||
@@ -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'] = 't';
|
||||
$string['cliansweryes'] = 'y';
|
||||
$string['cliincorrectvalueerror'] = 'Ralat, nilai tidak betul "{$a->value}" untuk "{$a->option}"';
|
||||
$string['cliincorrectvalueretry'] = 'Nilai yang salah, sila cuba lagi';
|
||||
$string['clitypevalue'] = 'taip nilai';
|
||||
$string['clitypevaluedefault'] = 'taip nilai, tekan Enter untuk gunakan nilai lalai ({$a})';
|
||||
$string['cliunknowoption'] = 'Pilihan yang tidak diketahui:
|
||||
{$a}
|
||||
Sila gunakan pilihan --help';
|
||||
$string['cliyesnoprompt'] = 'tapi y (ya) atau t (tidak)';
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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'] = 'Direktori admin';
|
||||
$string['availablelangs'] = 'Senarai bahasa yang tersedia';
|
||||
$string['chooselanguagehead'] = 'Pilih bahasa';
|
||||
$string['chooselanguagesub'] = 'Sila pilih bahasa untuk pemasangan. Bahasa ini juga akan digunakan sebagai bahasa lalai untuk laman, ia boleh diubah kemudian.';
|
||||
$string['clialreadyinstalled'] = 'config.php fail sudah wujud, sila gunakan admin/cli/upgrade.php jika anda mahu menaik taraf laman web anda.';
|
||||
$string['cliinstallheader'] = 'Baris arahan pemasangan program Moodle {$a}';
|
||||
$string['databasehost'] = 'Hos pangkalan data';
|
||||
$string['databasename'] = 'Nama pangkalan data';
|
||||
$string['databasetypehead'] = 'Pilih pemacu pangkalan data';
|
||||
$string['dataroot'] = 'Direktori data';
|
||||
$string['dbprefix'] = 'Awalan jadual';
|
||||
$string['dirroot'] = 'Direktori Moodle';
|
||||
$string['environmenthead'] = 'Memeriksa persekitaran anda ...';
|
||||
$string['environmentsub2'] = 'Setiap pelepasan Moodle mempunyai keperluan minimum versi PHP dan beberapa sambungan mandatori PHP. Persekitaran penuh disemak sebelum setiap pemasangan dan naik taraf. Sila hubungi pentadbir pelayan jika anda tidak tahu bagaimana untuk memasang versi baru atau membolehkan sambungan PHP.';
|
||||
$string['errorsinenvironment'] = 'Semakan persekitaran gagal!';
|
||||
$string['installation'] = 'Pemasangan';
|
||||
$string['langdownloaderror'] = 'Malangnya bahasa "{$a}" tidak boleh dimuat turun. Proses pemasangan akan diteruskan dalam bahasa Bahasa Inggeris.';
|
||||
$string['memorylimithelp'] = '<p> Had memori PHP untuk pelayan anda ditetapkan kepada {$a}. </p>
|
||||
|
||||
<p> Hal ini akan menyebabkan Moodle untuk mendapat masalah memori di kemudian hari, terutama jika anda mempunyai banyak modul yang diaktifkan dan/atau ramai pengguna. </p>
|
||||
|
||||
<p> Kami menyarankan anda mengkonfigurasikan PHP dengan had yang lebih tinggi jika memungkinkan, seperti 40M. Ada beberapa cara untuk melakukan hal ini yang anda boleh cuba: </p>
|
||||
<ol>
|
||||
<li> Jika anda mampu, kompil semula PHP dengan <i>--enable-memory-limit.</i> Hal ini akan membolehkan Moodle untuk menetapkan batas memori itu sendiri. </li>
|
||||
<li> Jika anda mempunyai akses ke fail php.ini, anda boleh menukar setting <b>memory_limit</b> di sana untuk sesuatu seperti 40M. Jika anda tidak mempunyai akses anda mungkin boleh meminta pentadbir anda untuk melakukan ini untuk anda. </li>
|
||||
<li> Pada beberapa server PHP anda boleh mencipta baris fail .htaccess di direktori Moodle mengandungi ini: <blockquote><div> php_value memory_limit 40M </div></blockquote><p> Namun, pada beberapa server ini akan mencegah <b>semua</b> laman PHP dari berjalan (anda akan melihat ralat ketika anda melihat halaman), sehingga anda hapuskan file .htaccess. </p></li></ol>';
|
||||
$string['paths'] = 'Laluan';
|
||||
$string['pathserrcreatedataroot'] = 'Direktori data ({$a->dataroot}) tidak boleh diwujudkan oleh pemasang.';
|
||||
$string['pathshead'] = 'Sahkan laluan';
|
||||
$string['pathsrodataroot'] = 'Direktori dataroot tidak dapat ditulis.';
|
||||
$string['pathsroparentdataroot'] = 'Direktori induk ({$a->parent}) tidak boleh tulis. Direktori data ({$a->dataroot}) tidak boleh diwujudkan oleh pemasang.';
|
||||
$string['pathssubadmindir'] = 'Beberapa webhos menggunakan /admin sebagai URL khas untuk anda akses panel kawalan atau sesuatu yang lain. Malangnya, ini bertentangan dengan lokasi standard untuk halaman pentadbiran Moodle. Anda boleh memperbaiki ini dengan menamakan semula direktori admin dalam pemasangan anda, dan meletakkan nama baru di sini. Sebagai contoh: <br /> <br /> <b> moodleadmin </ b> <br /> <br />
|
||||
Ini akan memulihkan pautan admin dalam Moodle.';
|
||||
$string['pathssubdataroot'] = 'Anda perlukan lokasi di mana Moodle boleh menyimpan fail yang dimuat naik. Direktori ini sepatutnya boleh dibaca DAN BOLEH DITULIS oleh pengguna web server (biasanya \'nobody\' atau \'apache\'), tetapi ia mestilah tidak boleh diakses secara langsung melalui laman web. Pemasang akan cuba untuk mewujudkannya jika belum ada.';
|
||||
$string['pathssubdirroot'] = 'Direktori laluan penuh untuk pemasangan Moodle.';
|
||||
$string['pathssubwwwroot'] = 'Alamat penuh web di mana Moodle akan dicapai. Adalah tidak mungkin untuk mengakses Moodle menggunakan pelbagai alamat. Jika laman anda mempunyai beberapa alamat awam, anda mesti menubuhkan pelencongan kekal kepada semua mereka kecuali yang satu ini. Jika laman web anda boleh diakses kedua-duanya dari Intranet dan Internet menggunakan alamat awam di sini dan menubuhkan DNS supaya pengguna Intranet boleh menggunakan alamat awam juga. Jika alamat itu tidak betul, sila ubah URL di pelayar anda untuk memulakan semula pemasangan dengan nilai yang berbeza.';
|
||||
$string['pathsunsecuredataroot'] = 'Lokasi dataroot tidak selamat';
|
||||
$string['pathswrongadmindir'] = 'Direktori admin tidak wujud';
|
||||
$string['phpextension'] = 'Sambungan PHP {$a}';
|
||||
$string['phpversion'] = 'Versi PHP';
|
||||
$string['phpversionhelp'] = '<p> Moodle memerlukan versi PHP minimal 4.3.0 atau 5.1.0 (5.0.x memiliki sejumlah masalah yang diketahui). </p>
|
||||
<p> Anda sedang menjalankan versi {$a} </p>
|
||||
<p> Anda harus upgrade PHP atau berpindah ke host dengan versi terbaru PHP! <br /> (Dalam kes 5.0.x Anda juga boleh turun taraf ke versi 4.4.x) </p>';
|
||||
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
|
||||
$string['welcomep20'] = 'Anda melihat halaman ini kerana anda telah berjaya memasang dan melancarkan pakej <strong>{$a->packname} {$a->packversion}</strong> di komputer anda. Tahniah!';
|
||||
$string['welcomep30'] = 'Keluaran ini <strong>{$a->installername}</strong> termasuk aplikasi untuk mencipta sebuah persekitaran di mana <strong>Moodle</strong> akan beroperasi, iaitu:';
|
||||
$string['welcomep40'] = 'Pakej ini juga termasuk <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong>.';
|
||||
$string['welcomep50'] = 'Penggunaan semua aplikasi di dalam pakej ini dikawal oleh lesen masing-masing. Pakej lengkap <strong>{$a->installername}</strong> adalah <a href="http://www.opensource.org/docs/definition_plain.html">sumber terbuka</a> dan diedarkan di bawah lesen <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>.';
|
||||
$string['welcomep60'] = 'Laman-laman berikut akan membawa anda melalui beberapa langkah-langkah mudah diikuti untuk mengkonfigurasi dan menetapkan <strong>Moodle</strong> pada komputer anda. Anda mungkin menerima tetapan lalai atau, dengan pilihan, meminda untuk disesuaikan dengan keperluan anda.';
|
||||
$string['welcomep70'] = 'Klik butang "Seterusnya" di bawah untuk meneruskan penubuhan <strong>Moodle</strong>.';
|
||||
$string['wwwroot'] = 'Alamat Web';
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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['language'] = 'Bahasa';
|
||||
$string['next'] = 'Seterusnya';
|
||||
$string['previous'] = 'Sebelum';
|
||||
$string['reload'] = 'Muat semula';
|
||||
@@ -42,7 +42,7 @@ $string['componentisuptodate'] = 'Komponenten er oppdatert';
|
||||
$string['downloadedfilecheckfailed'] = 'Sjekk av nedlastet fil mislykkes.';
|
||||
$string['invalidmd5'] = 'Ugyldig md5, prøv igjen';
|
||||
$string['missingrequiredfield'] = 'Noen påkrevde felt mangler';
|
||||
$string['remotedownloaderror'] = 'Mislykkes i å laste ned komponenten til din server, vennligst sjekk proxy-innstillingene. PHP cURL tillegget er sterkt anbefalt. <br /><br />Du må laste ned <a href="{$a->url}">{$a->url}</a> filen manuelt, kopiere den til "{$a->dest}" på serveren din og pakke den ut der.';
|
||||
$string['remotedownloaderror'] = 'Mislykkes i å laste ned komponenten til din server, vennligst sjekk proxy-innstillingene. PHP cURL-tillegget er sterkt anbefalt. <br /><br />Du må laste ned <a href="{$a->url}">{$a->url}</a> filen manuelt, kopiere den til "{$a->dest}" på serveren din og pakke den ut der.';
|
||||
$string['wrongdestpath'] = 'Gal målmappe';
|
||||
$string['wrongsourcebase'] = 'Feil kilde URL base';
|
||||
$string['wrongzipfilename'] = 'Galt ZIP-filnavn.';
|
||||
|
||||
@@ -34,12 +34,14 @@ $string['admindirname'] = 'Adminmappe';
|
||||
$string['availablelangs'] = 'Tilgjengelige språkpakker';
|
||||
$string['chooselanguagehead'] = 'Velg et språk';
|
||||
$string['chooselanguagesub'] = 'Velg språk (bare for INSTALLASJONEN). Du vil kunne velge språk for nettsted og bruker på et skjermbilde senere.';
|
||||
$string['clialreadyinstalled'] = 'Filen config.php eksisterer allerede, vær vennlig å bruk admin/cli/upgrade.php hvis du vil oppgradere nettstedet ditt.';
|
||||
$string['clialreadyconfigured'] = 'Filen config.php finnes allerede. Vennligst bruk admin/cli/install_database.php hvis du vil installere denne portalen.';
|
||||
$string['clialreadyinstalled'] = 'Filen config.php eksisterer allerede. Vennligst bruk admin/cli/upgrade.php hvis du vil oppgradere denne portalen.';
|
||||
$string['cliinstallheader'] = 'Moodle {$a} kommandolinje installasjonsprogram';
|
||||
$string['databasehost'] = 'Databasevert';
|
||||
$string['databasename'] = 'Databasenavn';
|
||||
$string['databasetypehead'] = 'Velg databasedriver';
|
||||
$string['dataroot'] = 'Dataområde';
|
||||
$string['datarootpermission'] = 'Tillatelse for datakatalog';
|
||||
$string['dbprefix'] = 'Tabellprefix';
|
||||
$string['dirroot'] = 'Moodles filområde';
|
||||
$string['environmenthead'] = 'Sjekker "omgivelsene" dine...';
|
||||
@@ -70,17 +72,16 @@ $string['pathssubwwwroot'] = 'Full webadresse til der hvor Moodle skal vises. De
|
||||
Dersom adressen ikke er korrekt, vennligst endre URL i nettleseren slik at at installasjonen restartes med andre verdier.';
|
||||
$string['pathsunsecuredataroot'] = 'Dataroot plassering er ikke sikker';
|
||||
$string['pathswrongadmindir'] = 'Adminkatalog finnes ikke';
|
||||
$string['phpextension'] = '{$a} PHP etternavn';
|
||||
$string['phpextension'] = '{$a} PHP-tillegg';
|
||||
$string['phpversion'] = 'PHP versjon';
|
||||
$string['phpversionhelp'] = '<p>Moodle trenger en PHP versjon minst 4.3.0 eller 5.1.0 (5.0.x har rekke kjente problem).</p>
|
||||
<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 <strong>{$a->packname} {$a->packversion}</strong>pakke på datamaskinen din. Gratulerer!';
|
||||
$string['welcomep20'] = 'Du ser denne siden fordi du nå med hell har installert og kjørt <strong>{$a->packname} {$a->packversion}</strong>pakken på datamaskinen din. Gratulerer!';
|
||||
$string['welcomep30'] = 'Denne versjonen av <strong>{$a->installername}</strong> inkluderer 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['welcomep50'] = 'Bruken av alle applikasjoner i denne pakken er styrt 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 standardinnstillingene, eller, hvis du vil, justere dem etter egne behov.';
|
||||
$string['welcomep70'] = 'Klikk på "Neste" knappen under for å fortsette med <strong>Moodle</strong>-installasjonen';
|
||||
$string['wwwroot'] = 'Web addresse';
|
||||
|
||||
@@ -32,13 +32,11 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['clianswerno'] = 'n';
|
||||
$string['cliansweryes'] = 's';
|
||||
$string['cliincorrectvalueerror'] = 'Erro. Valor "{$a->value}" incorreto para "{$a->option}"';
|
||||
$string['cliincorrectvalueerror'] = 'Erro: o valor "{$a->value}" não é permitido para a opção "{$a->option}"';
|
||||
$string['cliincorrectvalueretry'] = 'Valor incorreto, por favor tente novamente';
|
||||
$string['clitypevalue'] = 'valor do tipo';
|
||||
$string['clitypevaluedefault'] = 'valor do tipo, pressione a tecla Enter para usar o valor predefinido ({$a})';
|
||||
$string['cliunknowoption'] = 'Opções desconhecidas:
|
||||
{$a}
|
||||
Por favor use a opção --help';
|
||||
$string['cliunknowoption'] = 'Opções desconhecidas: {$a} Por favor use a opção --help';
|
||||
$string['cliyesnoprompt'] = 'digite s (para sim) ou n (para não)';
|
||||
$string['environmentrequireinstall'] = 'deve estar instalada e ativa';
|
||||
$string['environmentrequireversion'] = 'é requerida a versão {$a->needed} e está a correr a versão {$a->current}';
|
||||
|
||||
@@ -40,9 +40,9 @@ $string['cannotsavezipfile'] = 'Não é possível gravar o ficheiro ZIP';
|
||||
$string['cannotunzipfile'] = 'Não é possível descompactar o ficheiro ZIP';
|
||||
$string['componentisuptodate'] = 'O componente está atualizado.';
|
||||
$string['downloadedfilecheckfailed'] = 'A verificação do ficheiro descarregado falhou.';
|
||||
$string['invalidmd5'] = 'md5 inválido';
|
||||
$string['invalidmd5'] = 'A variável de verificação está errada - tente novamente.';
|
||||
$string['missingrequiredfield'] = 'Um dos campos obrigatórios está em falta';
|
||||
$string['remotedownloaderror'] = 'O download do componente para o servidor falhou. Verifique as configurações do proxy. A instalação da extensão cURL do PHP é muito recomendada.<br /><br />Terá que descarregar o ficheiro <a href="{$a->url}">{$a->url}</a> manualmente, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo.';
|
||||
$string['remotedownloaderror'] = 'A descarga do componente para o servidor falhou. Verifique as configurações do proxy. A instalação da extensão cURL do PHP é muito recomendada.<br /><br />Terá que descarregar o ficheiro <a href="{$a->url}">{$a->url}</a> manualmente, copiá-lo para a pasta "{$a->dest}" no seu servidor e descompactá-lo.';
|
||||
$string['wrongdestpath'] = 'Caminho de destino errado.';
|
||||
$string['wrongsourcebase'] = 'Base do URL de origem errada';
|
||||
$string['wrongzipfilename'] = 'Nome de ficheiro ZIP errado.';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user