Compare commits
367 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd4a6b8b0b | |||
| 644444829a | |||
| ff308ab4fb | |||
| 755b013fdf | |||
| cb3f67364d | |||
| aab30ea828 | |||
| 74c21d51d0 | |||
| b14a04e0a4 | |||
| 8a668f75a8 | |||
| 3e5a1d8029 | |||
| 099a2aee68 | |||
| a7c01b5876 | |||
| e23e6c2f64 | |||
| f209d76b0d | |||
| abdffed5fc | |||
| 40e24fda5b | |||
| 486fac73f2 | |||
| a0c3ab0b30 | |||
| 009c57d730 | |||
| 820a43510f | |||
| 493ef66ecd | |||
| 41b973bcbb | |||
| 237af2ba61 | |||
| 79f15159da | |||
| 2f0cd733be | |||
| 4006e187f3 | |||
| 98f43f1b08 | |||
| 12d6dfc1ce | |||
| 25ca6f1638 | |||
| 7508e218d2 | |||
| 3d15dfc9d2 | |||
| c35ef2e9a0 | |||
| 96abc5f1cd | |||
| d78207b6c3 | |||
| d41b1ba49e | |||
| e938ea398c | |||
| 29dfbb422f | |||
| 9ecf0674ff | |||
| b5b7af96bb | |||
| 76acac80eb | |||
| a428cf4ac8 | |||
| 0915860e51 | |||
| b62bebbf1c | |||
| 75166d0627 | |||
| 6dc3a5b699 | |||
| 50e16a67ab | |||
| 7336ba40d5 | |||
| a813b0c3dc | |||
| 920d7ffadd | |||
| 84c8c00959 | |||
| d48c0a1d9a | |||
| 7b0057b895 | |||
| 9574320a36 | |||
| 6670d28fbc | |||
| 7489d697be | |||
| 310808b778 | |||
| e2fe3bc081 | |||
| 6eb6c5fd6d | |||
| 6182ec8901 | |||
| 16732d0631 | |||
| 7d3a7bbd1f | |||
| 3b195bfb81 | |||
| e3cb80f10c | |||
| 904fcbee8b | |||
| 6321934c73 | |||
| 751122dbc0 | |||
| c1e74a0937 | |||
| f882aed3b3 | |||
| e7b9ea226c | |||
| 1bf9d6ac92 | |||
| 35b48c7aed | |||
| 706e012fd6 | |||
| 660b51e013 | |||
| d76dd4d064 | |||
| 6dc4c68e4e | |||
| 4125ce046b | |||
| 7da7c1e24a | |||
| 3eb9cc2f6e | |||
| 393eccb077 | |||
| d3d0248afc | |||
| 8151761378 | |||
| faadaedb17 | |||
| 0064cb1193 | |||
| a435242491 | |||
| 70d2c9fcf8 | |||
| 12ebaf1c6b | |||
| 8712a50ec2 | |||
| 97279f8d5d | |||
| 90677673da | |||
| af5765b3fb | |||
| ffd7798c96 | |||
| fb1469d84f | |||
| 583278f070 | |||
| 901c0ea7de | |||
| 8898725385 | |||
| cee482ca4e | |||
| 7a9309f32e | |||
| 4642a8c593 | |||
| 4682f17c49 | |||
| 44002b183c | |||
| 4b371f9769 | |||
| e466786f78 | |||
| 6aefea74a4 | |||
| 4ea8f814a0 | |||
| 1c70e86b5e | |||
| 900a2c554e | |||
| ade30c673c | |||
| 930570b410 | |||
| 6027eaebc5 | |||
| 78b281b24d | |||
| 1efacd2b35 | |||
| e44bd69aaa | |||
| dad0b3bfeb | |||
| d030347bce | |||
| d25f96b766 | |||
| b4d6669dd0 | |||
| 90d00d0eae | |||
| efe57105d6 | |||
| 7f6accd448 | |||
| 0d02bb964b | |||
| 5cfaecac47 | |||
| 396edc0a5e | |||
| 998432c2c9 | |||
| 2f3ae73ab0 | |||
| 04fbba050d | |||
| 1e9f38a487 | |||
| 813afc6797 | |||
| c1584e154c | |||
| ebba556af7 | |||
| 7afc76fbd6 | |||
| 92ba7648fe | |||
| 2d45ac279d | |||
| 1cc10f3f67 | |||
| 0fef835188 | |||
| 7a677348e4 | |||
| 2589802489 | |||
| 5a9a2c61b9 | |||
| 39e7d46d89 | |||
| 2fd423721f | |||
| 4f1ba09334 | |||
| 642bbbdd10 | |||
| 4678592332 | |||
| 6dad38deed | |||
| d82aa0a2d9 | |||
| dc48cc0a79 | |||
| fcd412470a | |||
| d9a1d6834c | |||
| 5e5ce443fd | |||
| 946281d282 | |||
| ae9bbd9847 | |||
| f10ae4676d | |||
| f25185d7b0 | |||
| b09db258e5 | |||
| 857a0ab60e | |||
| d7978641dc | |||
| 6f0efcc891 | |||
| d163d37593 | |||
| de7e277e1f | |||
| 852264ad23 | |||
| 3745973281 | |||
| 3a14f060d1 | |||
| 204413187e | |||
| 4b96878ab6 | |||
| 181b5922ce | |||
| 493ec714fd | |||
| 729132fa6a | |||
| f6dabb3194 | |||
| cead8a8138 | |||
| 8bcc2cbd8a | |||
| 20f576629b | |||
| 585ba846da | |||
| 55e54953a4 | |||
| 8d857d0ecc | |||
| 0b96b9c5c2 | |||
| 449e15f092 | |||
| 2dcb3746b0 | |||
| 4af34676f7 | |||
| e7bba8ce4d | |||
| dd24216a3b | |||
| ed81eab309 | |||
| 95bfa52549 | |||
| ea70612b00 | |||
| 51d9431e48 | |||
| cf199b4448 | |||
| 0ffe8d2f0c | |||
| d017e3fb48 | |||
| 337b723b07 | |||
| 6b8c8f4bc2 | |||
| f93bdccab7 | |||
| f34df17977 | |||
| 04165cd446 | |||
| 125bd58ff9 | |||
| 1093b461f6 | |||
| f31e1e8b25 | |||
| 2f3f8e45da | |||
| f619064b9b | |||
| cfade93cb8 | |||
| fd887df697 | |||
| fe3db0ca08 | |||
| 87264a2022 | |||
| 622c84f630 | |||
| 27a5b91f45 | |||
| 8f3a295c6e | |||
| 9444636cb8 | |||
| 49ae3661d3 | |||
| cf2bc26911 | |||
| c1ae9079db | |||
| 7dbc501811 | |||
| 7135bbb188 | |||
| bf5dcc8abb | |||
| eaf45bce09 | |||
| 7d41ccf0fb | |||
| 0f76052836 | |||
| f2405a5f5c | |||
| a7bebd0638 | |||
| 7b02521c39 | |||
| c2e123355d | |||
| 974573b4ea | |||
| 6b6a2ec439 | |||
| f31d0fff2e | |||
| 4827eaa744 | |||
| 5222cb1ce8 | |||
| b5f3e90e1c | |||
| b1f3de5793 | |||
| 0b8e0c374f | |||
| e9eec33560 | |||
| 9fa6d4e04e | |||
| 058edbafc8 | |||
| ea10a0319b | |||
| fe86e2f034 | |||
| 259d3742f9 | |||
| 56fb91bc38 | |||
| 51f3693cdb | |||
| 9c56f904d2 | |||
| 3ecf492a75 | |||
| 6b7b3e59f2 | |||
| 06cca0158c | |||
| 7becb39f63 | |||
| a044ff57a1 | |||
| f46fab0ea1 | |||
| e57c0f41ad | |||
| f65db49765 | |||
| dbd8cadb5c | |||
| 51c6d25b3b | |||
| 6063f62e7d | |||
| a3ead7172b | |||
| e3cc23ae86 | |||
| 213fc325ad | |||
| f41218d9fd | |||
| 48ea715da0 | |||
| c220e6d8c7 | |||
| a4b0cfa3f7 | |||
| d5d6eda93c | |||
| 158ab03e12 | |||
| 55f171a1d6 | |||
| f670b39e69 | |||
| b0f00b3166 | |||
| d6a25bc49a | |||
| 445aa472b9 | |||
| 2e1c739a28 | |||
| 560a43f24c | |||
| 930ce60550 | |||
| 398be7c897 | |||
| e85fda95c6 | |||
| 1572a39251 | |||
| 1e17258b66 | |||
| face152176 | |||
| cf0b9432d8 | |||
| 42778e124e | |||
| fd9eb89022 | |||
| f43155b65a | |||
| da55f3582b | |||
| 1954b9d5c9 | |||
| 6fe0b5bd9b | |||
| e7bda18de6 | |||
| 69ba7bf659 | |||
| b86c685075 | |||
| a6fa0d9c97 | |||
| 16076f1e3d | |||
| 8b3a8fa707 | |||
| 096a418d01 | |||
| f2330472f0 | |||
| 3302e8bfa5 | |||
| 002ea88630 | |||
| 700ef87691 | |||
| 3b77723701 | |||
| 5473943cac | |||
| af49935a53 | |||
| eea9f10900 | |||
| 763f7b05ae | |||
| 96eba6b982 | |||
| ff1fc4d9f4 | |||
| 426bb5ae0f | |||
| b8af6c1ef0 | |||
| 743f9c8c42 | |||
| a6f85967e0 | |||
| 9d75a519f3 | |||
| d456bd42c3 | |||
| 6406431537 | |||
| 757aef2334 | |||
| 2c212753fe | |||
| bc2aaef4fa | |||
| 224789b79c | |||
| 678555b499 | |||
| 793fe29014 | |||
| 82f5802a94 | |||
| a2567336df | |||
| 4cc6477198 | |||
| b8396c335a | |||
| eacf30e61f | |||
| 55a3911408 | |||
| 4e2ae9caee | |||
| 33788800ec | |||
| 3f066469af | |||
| f2dab83445 | |||
| 38b74ef717 | |||
| d514d25e0a | |||
| f87084f8f1 | |||
| 26ca972e9e | |||
| ba4173384d | |||
| bd955bfea7 | |||
| 6e986b2919 | |||
| 0c499e0a5c | |||
| 7ecf7511f8 | |||
| 16f9660cfe | |||
| c02778ac30 | |||
| 50302c404a | |||
| cfa4b26231 | |||
| cff1f90adf | |||
| 64a5bc94e9 | |||
| 43bdbbf682 | |||
| 3ae54e045a | |||
| 6c5ee657a7 | |||
| 0cbfb7ff2a | |||
| 3bf46ee717 | |||
| 3a2f9a2ea4 | |||
| 231e2ec99a | |||
| e20c8ddc80 | |||
| 674c4f6891 | |||
| 93f4f3494a | |||
| 6a6f2e1ca6 | |||
| 9d92a3a6ba | |||
| db8514bcff | |||
| 20ab51fdbc | |||
| 605bab84ce | |||
| f6d9efefaa | |||
| 067268942c | |||
| d138d6e2ac | |||
| 9280f62e38 | |||
| 3d979f9676 | |||
| 592c691c8f | |||
| c448ab3f44 | |||
| 0c6c86643e | |||
| f928c24dcc | |||
| 55af4309f7 | |||
| f8b56ac904 | |||
| abcd53444b | |||
| 3c7387722d | |||
| bd305a3973 | |||
| c10bfee49f | |||
| a053229f0f | |||
| 88e709ae43 | |||
| 8385163bab | |||
| a620c573bc | |||
| c5176b2968 | |||
| 97223bb356 | |||
| 9ff8cdd971 |
+1
-1
@@ -120,7 +120,7 @@ foreach ($settingspage->children as $childpage) {
|
||||
}
|
||||
if ($savebutton) {
|
||||
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::empty_tag('input', array('class' => 'btn btn-primary form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
|
||||
$outputhtml .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
|
||||
@@ -1145,6 +1145,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="2.8" requires="2.2">
|
||||
@@ -1418,6 +1423,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.0" requires="2.2">
|
||||
@@ -1434,6 +1444,7 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -1556,6 +1567,11 @@
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.1" requires="2.7">
|
||||
@@ -1572,6 +1588,7 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
@@ -1701,6 +1718,11 @@
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.2" requires="2.7">
|
||||
@@ -1851,6 +1873,11 @@
|
||||
<ON_CHECK message="tlswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -315,6 +315,11 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
||||
$testsite = 'behat';
|
||||
}
|
||||
|
||||
if (isset($CFG->themerev)) {
|
||||
// Store the themerev to restore after purging caches.
|
||||
$themerev = $CFG->themerev;
|
||||
}
|
||||
|
||||
// We purge all of MUC's caches here.
|
||||
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
|
||||
// This ensures a real config object is loaded and the stores will be purged.
|
||||
@@ -324,6 +329,11 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
||||
// We then purge the regular caches.
|
||||
purge_all_caches();
|
||||
|
||||
if (isset($themerev)) {
|
||||
// Restore the themerev
|
||||
set_config('themerev', $themerev);
|
||||
}
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ if (!empty($disable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
||||
\core_message\api::update_processor_status($processor, 0); // Disable output.
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ if (!empty($enable) && confirm_sesskey()) {
|
||||
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
||||
print_error('outputdoesnotexist', 'message');
|
||||
}
|
||||
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
||||
\core_message\api::update_processor_status($processor, 1); // Enable output.
|
||||
core_plugin_manager::reset_caches();
|
||||
}
|
||||
|
||||
|
||||
@@ -133,9 +133,12 @@ echo $OUTPUT->header();
|
||||
</td>
|
||||
<td id="buttonscell">
|
||||
<p class="arrow_button">
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
|
||||
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>" title="<?php print_string('mainadminset', 'core_role'); ?>" />
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>"
|
||||
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>"
|
||||
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/><br />
|
||||
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>"
|
||||
title="<?php print_string('mainadminset', 'core_role'); ?>" class="btn btn-secondary"/>
|
||||
</p>
|
||||
</td>
|
||||
<td id="potentialcell">
|
||||
|
||||
@@ -80,7 +80,8 @@ echo $OUTPUT->box($controller->get_intro_text());
|
||||
echo '<form action="' . $baseurl . '" method="post">';
|
||||
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
|
||||
echo html_writer::table($table);
|
||||
echo '<div class="buttons"><input type="submit" name="submit" value="'.get_string('savechanges').'"/>';
|
||||
echo '<div class="buttons">';
|
||||
echo '<input type="submit" class="btn btn-primary" name="submit" value="' . get_string('savechanges') . '"/>';
|
||||
echo '</div></form>';
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -201,11 +201,13 @@ if ($roleid) {
|
||||
</td>
|
||||
<td id="buttonscell">
|
||||
<div id="addcontrols">
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
|
||||
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().' '.get_string('add'); ?>"
|
||||
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
|
||||
</div>
|
||||
|
||||
<div id="removecontrols">
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
|
||||
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').' '.$OUTPUT->rarrow(); ?>"
|
||||
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/>
|
||||
</div>
|
||||
</td>
|
||||
<td id="potentialcell">
|
||||
|
||||
@@ -172,7 +172,8 @@ echo $OUTPUT->heading('<label for="reportuser">' . $selectheading . '</label>',
|
||||
$userselector->display();
|
||||
|
||||
// Submit button and the end of the form.
|
||||
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" /></p>';
|
||||
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" ' .
|
||||
'class="btn btn-primary"/></p>';
|
||||
echo '</form>';
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
|
||||
@@ -471,15 +471,17 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
}
|
||||
|
||||
protected function get_name_field($id) {
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '" />';
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '"' .
|
||||
' class="form-control"/>';
|
||||
}
|
||||
|
||||
protected function get_shortname_field($id) {
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '" />';
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '"' .
|
||||
' class="form-control"/>';
|
||||
}
|
||||
|
||||
protected function get_description_field($id) {
|
||||
return '<textarea class="form-textarea" id="'. s($id) .'" name="description" rows="10" cols="50">' .
|
||||
return '<textarea class="form-textarea form-control" id="'. s($id) .'" name="description" rows="10" cols="50">' .
|
||||
htmlspecialchars($this->role->description) .
|
||||
'</textarea>';
|
||||
}
|
||||
@@ -490,7 +492,8 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
foreach (get_role_archetypes() as $type) {
|
||||
$options[$type] = get_string('archetype'.$type, 'role');
|
||||
}
|
||||
return html_writer::select($options, 'archetype', $this->role->archetype, false);
|
||||
return html_writer::select($options, 'archetype', $this->role->archetype, false,
|
||||
array('class' => 'custom-select'));
|
||||
}
|
||||
|
||||
protected function get_assignable_levels_control() {
|
||||
@@ -563,7 +566,8 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($this->roleid == 0) {
|
||||
$options[-1] = get_string('thisnewrole', 'core_role');
|
||||
}
|
||||
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple'=>'multiple', 'size'=>10));
|
||||
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
|
||||
'size' => 10, 'class' => 'form-control'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -575,11 +579,19 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function print_field($name, $caption, $field) {
|
||||
/**
|
||||
* Print labels, fields and help icon on role administration page.
|
||||
*
|
||||
* @param string $name The field name.
|
||||
* @param string $caption The field caption.
|
||||
* @param string $field The field type.
|
||||
* @param null|string $helpicon The help icon content.
|
||||
*/
|
||||
protected function print_field($name, $caption, $field, $helpicon = null) {
|
||||
global $OUTPUT;
|
||||
// Attempt to generate HTML like formslib.
|
||||
echo '<div class="fitem">';
|
||||
echo '<div class="fitemtitle">';
|
||||
echo '<div class="fitem row form-group">';
|
||||
echo '<div class="fitemtitle col-md-3">';
|
||||
if ($name) {
|
||||
echo '<label for="' . $name . '">';
|
||||
}
|
||||
@@ -587,13 +599,16 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($name) {
|
||||
echo "</label>\n";
|
||||
}
|
||||
if ($helpicon) {
|
||||
echo '<span class="pull-xs-right text-nowrap">'.$helpicon.'</span>';
|
||||
}
|
||||
echo '</div>';
|
||||
if (isset($this->errors[$name])) {
|
||||
$extraclass = ' error';
|
||||
} else {
|
||||
$extraclass = '';
|
||||
}
|
||||
echo '<div class="felement' . $extraclass . '">';
|
||||
echo '<div class="felement col-md-9 form-inline' . $extraclass . '">';
|
||||
echo $field;
|
||||
if (isset($this->errors[$name])) {
|
||||
echo $OUTPUT->error_text($this->errors[$name]);
|
||||
@@ -605,7 +620,8 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
protected function print_show_hide_advanced_button() {
|
||||
echo '<p class="definenotice">' . get_string('highlightedcellsshowdefault', 'core_role') . ' </p>';
|
||||
echo '<div class="advancedbutton">';
|
||||
echo '<input type="submit" name="toggleadvanced" value="' . get_string('hideadvanced', 'form') . '" />';
|
||||
echo '<input type="submit" class="btn btn-secondary" name="toggleadvanced" value="' .
|
||||
get_string('hideadvanced', 'form') . '" />';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -613,11 +629,14 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
global $OUTPUT;
|
||||
// Extra fields at the top of the page.
|
||||
echo '<div class="topfields clearfix">';
|
||||
$this->print_field('shortname', get_string('roleshortname', 'core_role').' '.$OUTPUT->help_icon('roleshortname', 'core_role'), $this->get_shortname_field('shortname'));
|
||||
$this->print_field('name', get_string('customrolename', 'core_role').' '.$OUTPUT->help_icon('customrolename', 'core_role'), $this->get_name_field('name'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'core_role').' '.$OUTPUT->help_icon('customroledescription', 'core_role'),
|
||||
$this->get_description_field('description'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'core_role').' '.$OUTPUT->help_icon('archetype', 'core_role'), $this->get_archetype_field('archetype'));
|
||||
$this->print_field('shortname', get_string('roleshortname', 'core_role'),
|
||||
$this->get_shortname_field('shortname'), $OUTPUT->help_icon('roleshortname', 'core_role'));
|
||||
$this->print_field('name', get_string('customrolename', 'core_role'), $this->get_name_field('name'),
|
||||
$OUTPUT->help_icon('customrolename', 'core_role'));
|
||||
$this->print_field('edit-description', get_string('customroledescription', 'core_role'),
|
||||
$this->get_description_field('description'), $OUTPUT->help_icon('customroledescription', 'core_role'));
|
||||
$this->print_field('menuarchetype', get_string('archetype', 'core_role'), $this->get_archetype_field('archetype'),
|
||||
$OUTPUT->help_icon('archetype', 'core_role'));
|
||||
$this->print_field('', get_string('maybeassignedin', 'core_role'), $this->get_assignable_levels_control());
|
||||
$this->print_field('menuallowassign', get_string('allowassign', 'core_role'), $this->get_allow_role_control('assign'));
|
||||
$this->print_field('menuallowoverride', get_string('allowoverride', 'core_role'), $this->get_allow_role_control('override'));
|
||||
|
||||
@@ -37,7 +37,8 @@ class core_role_define_role_table_basic extends core_role_define_role_table_adva
|
||||
|
||||
protected function print_show_hide_advanced_button() {
|
||||
echo '<div class="advancedbutton">';
|
||||
echo '<input type="submit" name="toggleadvanced" value="' . get_string('showadvanced', 'form') . '" />';
|
||||
echo '<input type="submit" class="btn btn-secondary" name="toggleadvanced"
|
||||
value="' . get_string('showadvanced', 'form') . '" />';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ if ($action === 'view') {
|
||||
echo '<div class="mform">';
|
||||
} else {
|
||||
?>
|
||||
<form id="rolesform" class="mform" action="<?php p($baseurl->out(false)); ?>" method="post"><div>
|
||||
<form id="rolesform" class="mform fcontainer" action="<?php p($baseurl->out(false)); ?>" method="post"><div>
|
||||
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
|
||||
<input type="hidden" name="return" value="<?php p($return); ?>" />
|
||||
<input type="hidden" name="resettype" value="none" />
|
||||
|
||||
@@ -45,17 +45,20 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
|
||||
this.table = Y.one('#'+this.tableid);
|
||||
|
||||
// Create a div to hold the search UI.
|
||||
this.div = Y.Node.create('<div class="capabilitysearchui"></div>').setStyles({
|
||||
this.div = Y.Node.create('<div class="capabilitysearchui form-inline"></div>').setStyles({
|
||||
width : this.table.get('offsetWidth'),
|
||||
marginLeft : 'auto',
|
||||
marginRight : 'auto'
|
||||
});
|
||||
// Create the capability search input.
|
||||
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
|
||||
this.input = Y.Node.create('<input class="form-control m-x-1" type="text"' +
|
||||
' id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
|
||||
// Create a label for the search input.
|
||||
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.util.get_string('filter', 'moodle')+' </label>');
|
||||
this.label = Y.Node.create('<label for="' + this.input.get('id') + '">' +
|
||||
M.util.get_string('filter', 'moodle') + ' </label>');
|
||||
// Create a clear button to clear the input.
|
||||
this.button = Y.Node.create('<input type="button" value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
|
||||
this.button = Y.Node.create('<input type="button" class="btn btn-primary"' +
|
||||
' value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
|
||||
|
||||
// Tie it all together
|
||||
this.div.append(this.label).append(this.input).append(this.button);
|
||||
|
||||
@@ -177,8 +177,10 @@ if (!empty($capabilities)) {
|
||||
}
|
||||
|
||||
echo html_writer::start_tag('div', array('class'=>'submit_buttons'));
|
||||
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges')));
|
||||
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel')));
|
||||
$attrs = array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges'), 'class'=>'btn btn-primary');
|
||||
echo html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel'), 'class' => 'btn btn-secondary');
|
||||
echo html_writer::empty_tag('input', $attrs);
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
@@ -181,7 +181,7 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
$temp->add(new admin_setting_configselect('navsortmycoursessort', new lang_string('navsortmycoursessort', 'admin'), new lang_string('navsortmycoursessort_help', 'admin'), 'sortorder', $sortoptions));
|
||||
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('linkcoursesections', new lang_string('linkcoursesections', 'admin'), new lang_string('linkcoursesections_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
|
||||
@@ -236,8 +236,11 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
$temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// link to tag management interface
|
||||
$ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $CFG->wwwroot.'/tag/manage.php', 'moodle/tag:manage'));
|
||||
// Link to tag management interface.
|
||||
$url = new moodle_url('/tag/manage.php');
|
||||
$hidden = empty($CFG->usetags);
|
||||
$page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden);
|
||||
$ADMIN->add('appearance', $page);
|
||||
|
||||
$temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
|
||||
$temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
|
||||
|
||||
@@ -118,8 +118,15 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', new lang_string('loginpasswordautocomplete', 'admin'), new lang_string('loginpasswordautocomplete_help', 'admin'), 0));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
// Settings elements used by the \core\files\curl_security_helper class.
|
||||
$temp->add(new admin_setting_configmixedhostiplist('curlsecurityblockedhosts',
|
||||
new lang_string('curlsecurityblockedhosts', 'admin'),
|
||||
new lang_string('curlsecurityblockedhostssyntax', 'admin'), ""));
|
||||
$temp->add(new admin_setting_configportlist('curlsecurityallowedport',
|
||||
new lang_string('curlsecurityallowedport', 'admin'),
|
||||
new lang_string('curlsecurityallowedportsyntax', 'admin'), ""));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
// "notifications" settingpage
|
||||
$temp = new admin_settingpage('notifications', new lang_string('notifications', 'admin'));
|
||||
|
||||
@@ -26,7 +26,6 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
die(); // No access from web!
|
||||
}
|
||||
|
||||
define('BEHAT_UTIL', true);
|
||||
define('CLI_SCRIPT', true);
|
||||
define('ABORT_AFTER_CONFIG', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
@@ -31,9 +31,8 @@ Feature: Transform steps arguments
|
||||
And I press "Update profile"
|
||||
And I click on "Edit profile" "link" in the "region-main" "region"
|
||||
Then I should not see "NASTYSTRING"
|
||||
# BEHAT Transformation regression - See MDL-56397
|
||||
#And the field "Surname" matches value "$NASTYSTRING1"
|
||||
#And the field "City/town" matches value "$NASTYSTRING3"
|
||||
And the field "Surname" matches value "$NASTYSTRING1"
|
||||
And the field "City/town" matches value "$NASTYSTRING3"
|
||||
|
||||
Scenario: Use double quotes
|
||||
When I set the following fields to these values:
|
||||
@@ -57,5 +56,4 @@ Feature: Transform steps arguments
|
||||
And I should see "My Firstname"
|
||||
And I should see "My Surname"
|
||||
And the field "First name" matches value "My Firstname $NASTYSTRING1"
|
||||
# BEHAT Transformation regression - See MDL-56397
|
||||
#And the field "Surname" matches value "My Surname $NASTYSTRING2"
|
||||
And the field "Surname" matches value "My Surname $NASTYSTRING2"
|
||||
|
||||
@@ -184,6 +184,8 @@ class controller {
|
||||
|
||||
if ($updated) {
|
||||
$this->info[] = get_string('langupdatecomplete', 'tool_langimport');
|
||||
// The strings have been changed so we need to purge their cache to ensure users see the changes.
|
||||
get_string_manager()->reset_caches();
|
||||
} else {
|
||||
$this->info[] = get_string('nolangupdateneeded', 'tool_langimport');
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -794,6 +794,7 @@ define(['jquery'], function($) {
|
||||
this.allItems.addClass('tool-lp-menu-item');
|
||||
this.rootMenus.addClass('tool-lp-root-menu');
|
||||
this.subMenus.addClass('tool-lp-sub-menu');
|
||||
this.subMenuItems.addClass('dropdown-item');
|
||||
};
|
||||
|
||||
return /** @alias module:tool_lp/menubar */ {
|
||||
|
||||
@@ -50,7 +50,8 @@ class cohort_summary_exporter extends \core_competency\external\exporter {
|
||||
),
|
||||
'idnumber' => array(
|
||||
'type' => PARAM_RAW, // ID numbers are plain text.
|
||||
'default' => ''
|
||||
'default' => '',
|
||||
'null' => NULL_ALLOWED
|
||||
),
|
||||
'visible' => array(
|
||||
'type' => PARAM_BOOL,
|
||||
|
||||
@@ -91,7 +91,7 @@ class framework_autocomplete extends MoodleQuickForm_autocomplete {
|
||||
$ids = array();
|
||||
|
||||
foreach ($values as $onevalue) {
|
||||
if ((!$this->optionExists($onevalue)) &&
|
||||
if (!empty($onevalue) && (!$this->optionExists($onevalue)) &&
|
||||
($onevalue !== '_qf__force_multiselect_submission')) {
|
||||
array_push($ids, $onevalue);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,12 @@ class manage_competency_frameworks_page implements renderable, templatable {
|
||||
'get'
|
||||
);
|
||||
$this->navigation[] = $addpage;
|
||||
$competenciesrepository = new single_button(
|
||||
new moodle_url('https://moodle.net/competencies'),
|
||||
get_string('competencyframeworksrepository', 'tool_lp'),
|
||||
'get'
|
||||
);
|
||||
$this->navigation[] = $competenciesrepository;
|
||||
}
|
||||
|
||||
$this->competencyframeworks = api::list_frameworks('shortname', 'ASC', 0, 0, $this->pagecontext);
|
||||
|
||||
@@ -61,6 +61,7 @@ $string['competencyframeworkcreated'] = 'Competency framework created.';
|
||||
$string['competencyframeworkname'] = 'Name';
|
||||
$string['competencyframeworkroot'] = 'No parent (top-level competency)';
|
||||
$string['competencyframeworks'] = 'Competency frameworks';
|
||||
$string['competencyframeworksrepository'] = 'Competency frameworks repository';
|
||||
$string['competencyframeworkupdated'] = 'Competency framework updated.';
|
||||
$string['competencyoutcome_complete'] = 'Mark as complete';
|
||||
$string['competencyoutcome_evidence'] = 'Attach an evidence';
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{{#hascompetencies}}
|
||||
<span>
|
||||
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
|
||||
<select id="competency-nav-{{uniqid}}">
|
||||
<select class="custom-select" id="competency-nav-{{uniqid}}">
|
||||
{{#competencies}}
|
||||
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} {{idnumber}}</option>
|
||||
{{/competencies}}
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<div data-region="coursecompetency-ruleoutcome">
|
||||
<label>
|
||||
{{#str}}uponcoursecompletion, tool_lp{{/str}}
|
||||
<select data-field="ruleoutcome" data-id="{{coursecompetency.id}}">
|
||||
<select data-field="ruleoutcome" data-id="{{coursecompetency.id}}" class="custom-select">
|
||||
{{#ruleoutcomeoptions}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{text}}</option>
|
||||
{{/ruleoutcomeoptions}}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<ul title="{{#str}}edit{{/str}}" class="competencyactionsmenu">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
<li class="dropdown-item">
|
||||
<a href="#" data-action="edit">
|
||||
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
<li class="dropdown-item">
|
||||
<a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{id}}&pagecontextid={{pagecontextid}}">
|
||||
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<ul class="templateactions">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
<li class="dropdown-item">
|
||||
<a href="{{pluginbaseurl}}/edittemplate.php?id={{id}}&pagecontextid={{pagecontextid}}&return=templates">
|
||||
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<ul title="{{#str}}edit{{/str}}" class="user-competency-actions">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
{{#usercompetency.isrequestreviewallowed}}
|
||||
<li class="dropdown-item">
|
||||
<a href="#" data-action="request-review">{{#pix}}t/edit, core{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<ul title="{{#str}}edit{{/str}}" class="planactions">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
<li class="{{^canbeedited}} disabled {{/canbeedited}} dropdown-item">
|
||||
<a href="{{#canbeedited}}
|
||||
{{pluginbaseurl}}/editplan.php?id={{id}}&userid={{userid}}&return=plans
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
{{#hasusers}}
|
||||
<span>
|
||||
<label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
|
||||
<select id="user-nav-{{uniqid}}">
|
||||
<select id="user-nav-{{uniqid}}" class="custom-select">
|
||||
{{#users}}
|
||||
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{fullname}}</option>
|
||||
{{/users}}
|
||||
@@ -52,7 +52,7 @@
|
||||
{{#hascompetencies}}
|
||||
<span>
|
||||
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
|
||||
<select id="competency-nav-{{uniqid}}">
|
||||
<select id="competency-nav-{{uniqid}}" class="custom-select">
|
||||
{{#competencies}}
|
||||
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} {{idnumber}}</option>
|
||||
{{/competencies}}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<ul title="{{#str}}edit{{/str}}" class="user-evidence-actions">
|
||||
<li>
|
||||
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
||||
<ul class="dropdown-menu">
|
||||
<ul class="dropdown dropdown-menu">
|
||||
<li class="dropdown-item">
|
||||
<a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&userid={{userid}}&return=list">
|
||||
{{#pix}}t/edit{{/pix}} {{#str}}editthisuserevidence, tool_lp{{/str}}
|
||||
|
||||
@@ -52,6 +52,7 @@ class import extends moodleform {
|
||||
$mform = $this->_form;
|
||||
$element = $mform->createElement('filepicker', 'importfile', get_string('importfile', 'tool_lpimportcsv'));
|
||||
$mform->addElement($element);
|
||||
$mform->addHelpButton('importfile', 'importfile', 'tool_lpimportcsv');
|
||||
$mform->addRule('importfile', null, 'required');
|
||||
$mform->addElement('hidden', 'confirm', 0);
|
||||
$mform->setType('confirm', PARAM_BOOL);
|
||||
@@ -65,12 +66,10 @@ class import extends moodleform {
|
||||
} else {
|
||||
$mform->setDefault('delimiter_name', 'comma');
|
||||
}
|
||||
$mform->addHelpButton('delimiter_name', 'csvdelimiter', 'tool_lpimportcsv');
|
||||
|
||||
$choices = core_text::get_encodings();
|
||||
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_lpimportcsv'), $choices);
|
||||
$mform->setDefault('encoding', 'UTF-8');
|
||||
$mform->addHelpButton('encoding', 'encoding', 'tool_lpimportcsv');
|
||||
|
||||
$this->add_action_buttons(false, get_string('import', 'tool_lpimportcsv'));
|
||||
}
|
||||
|
||||
@@ -27,16 +27,16 @@ $string['competencyscaledescription'] = 'Competency scale created by import';
|
||||
$string['confirmcolumnmappings'] = 'Confirm the column mappings';
|
||||
$string['confirm'] = 'Confirm';
|
||||
$string['csvdelimiter'] = 'CSV delimiter';
|
||||
$string['csvdelimiter_help'] = 'The CSV delimiter is normally a comma.';
|
||||
$string['description'] = 'Description';
|
||||
$string['descriptionformat'] = 'Description format';
|
||||
$string['encoding'] = 'Encoding';
|
||||
$string['encoding_help'] = 'The CSV file encoding is usually UTF-8.';
|
||||
$string['export'] = 'Export';
|
||||
$string['exportid'] = 'Exported ID (optional)';
|
||||
$string['exportnavlink'] = 'Export competency framework';
|
||||
$string['idnumber'] = 'ID number';
|
||||
$string['importfile'] = 'CSV framework description file';
|
||||
$string['importfile_help'] = 'A competency framework may be imported via text file. The format of the file can be determined by creating a new competency framework on the site and then exporting it.';
|
||||
$string['importfile_link'] = 'admin/tool/lpimportcsv';
|
||||
$string['import'] = 'Import';
|
||||
$string['invalidimportfile'] = 'File format is invalid.';
|
||||
$string['isframework'] = 'Is framework';
|
||||
|
||||
@@ -396,12 +396,8 @@ class tool_lpmigrate_framework_processor_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
public function test_permission_exception() {
|
||||
global $DB;
|
||||
if ($DB->get_dbfamily() === 'postgres' or $DB->get_dbfamily() === 'mssql') {
|
||||
$this->markTestSkipped('The processor is having issues with the transaction initialised in '
|
||||
. 'advanced_testcase::runBare().');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->preventResetByRollback(); // Test uses transactions, so we cannot use them for speedy reset.
|
||||
|
||||
$dg = $this->getDataGenerator();
|
||||
$u = $dg->create_user();
|
||||
|
||||
@@ -31,7 +31,7 @@ use moodle_url;
|
||||
use moodle_exception;
|
||||
|
||||
/**
|
||||
* API exposed by tool_mobile
|
||||
* API exposed by tool_mobile, to be used mostly by external functions.
|
||||
*
|
||||
* @copyright 2016 Juan Leyva
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
@@ -106,6 +106,8 @@ class api {
|
||||
// We need this to make work the format text functions.
|
||||
$PAGE->set_context($context);
|
||||
|
||||
list($authinstructions, $notusedformat) = external_format_text($CFG->auth_instructions, FORMAT_MOODLE, $context->id);
|
||||
list($maintenancemessage, $notusedformat) = external_format_text($CFG->maintenance_message, FORMAT_MOODLE, $context->id);
|
||||
$settings = array(
|
||||
'wwwroot' => $CFG->wwwroot,
|
||||
'httpswwwroot' => $CFG->httpswwwroot,
|
||||
@@ -115,12 +117,12 @@ class api {
|
||||
'authloginviaemail' => $CFG->authloginviaemail,
|
||||
'registerauth' => $CFG->registerauth,
|
||||
'forgottenpasswordurl' => $CFG->forgottenpasswordurl,
|
||||
'authinstructions' => format_text($CFG->auth_instructions),
|
||||
'authinstructions' => $authinstructions,
|
||||
'authnoneenabled' => (int) is_enabled_auth('none'),
|
||||
'enablewebservices' => $CFG->enablewebservices,
|
||||
'enablemobilewebservice' => $CFG->enablemobilewebservice,
|
||||
'maintenanceenabled' => $CFG->maintenance_enabled,
|
||||
'maintenancemessage' => format_text($CFG->maintenance_message),
|
||||
'maintenancemessage' => $maintenancemessage,
|
||||
);
|
||||
|
||||
$typeoflogin = get_config('tool_mobile', 'typeoflogin');
|
||||
@@ -162,9 +164,15 @@ class api {
|
||||
if (empty($section) or $section == 'frontpagesettings') {
|
||||
require_once($CFG->dirroot . '/course/format/lib.php');
|
||||
// First settings that anyone can deduce.
|
||||
$settings->fullname = $SITE->fullname;
|
||||
$settings->shortname = $SITE->shortname;
|
||||
$settings->summary = $SITE->summary;
|
||||
$settings->fullname = external_format_string($SITE->fullname, $context->id);
|
||||
$settings->shortname = external_format_string($SITE->shortname, $context->id);
|
||||
|
||||
// Return to a var instead of directly to $settings object because of differences between
|
||||
// list() in php5 and php7. {@link http://php.net/manual/en/function.list.php}
|
||||
$formattedsummary = external_format_text($SITE->summary, $SITE->summaryformat,
|
||||
$context->id);
|
||||
$settings->summary = $formattedsummary[0];
|
||||
$settings->summaryformat = $formattedsummary[1];
|
||||
$settings->frontpage = $CFG->frontpage;
|
||||
$settings->frontpageloggedin = $CFG->frontpageloggedin;
|
||||
$settings->maxcategorydepth = $CFG->maxcategorydepth;
|
||||
|
||||
@@ -246,15 +246,9 @@ class external extends external_api {
|
||||
// We must toletare these two exceptions: forcepasswordchangenotice and usernotfullysetup.
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
if ($e instanceof moodle_exception) {
|
||||
if (($e->errorcode != 'usernotfullysetup') and
|
||||
($e->errorcode != 'forcepasswordchangenotice')) {
|
||||
|
||||
// In case we receive a different exception, throw it.
|
||||
throw $e;
|
||||
}
|
||||
} else {
|
||||
} catch (moodle_exception $e) {
|
||||
if ($e->errorcode != 'usernotfullysetup' && $e->errorcode != 'forcepasswordchangenotice') {
|
||||
// In case we receive a different exception, throw it.
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['autologinkeygenerationlockout'] = 'Auto-login key generation is locked out, too much requests in an hour.';
|
||||
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed to site admins';
|
||||
$string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked because of too many requests within an hour.';
|
||||
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.';
|
||||
$string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
|
||||
$string['configmobilecssurl'] = 'A CSS file to customise your mobile app interface.';
|
||||
$string['enablesmartappbanners'] = 'Enable Smart App Banners';
|
||||
$string['enablesmartappbanners_desc'] = 'This will display a banner promoting the Moodle Mobile app when visiting the site in Mobile Safari.';
|
||||
$string['forcedurlscheme'] = 'If you want to allow only your custom branded app to be opened via a browser window, then specify its URL scheme here; otherwise leave the field empty.';
|
||||
@@ -36,6 +37,11 @@ $string['iosappid_desc'] = 'This setting may be left as default unless you have
|
||||
$string['loginintheapp'] = 'Via the app';
|
||||
$string['logininthebrowser'] = 'Via a browser window (for SSO plugins)';
|
||||
$string['loginintheembeddedbrowser'] = 'Via an embedded browser (for SSO plugins)';
|
||||
$string['mobileapp'] = 'Mobile app';
|
||||
$string['mobileappearance'] = 'Mobile appearance';
|
||||
$string['mobileauthentication'] = 'Mobile authentication';
|
||||
$string['mobilecssurl'] = 'CSS';
|
||||
$string['mobilesettings'] = 'Mobile settings';
|
||||
$string['pluginname'] = 'Moodle Mobile tools';
|
||||
$string['smartappbanners'] = 'Smart App Banners (iOS only)';
|
||||
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';
|
||||
|
||||
@@ -31,6 +31,7 @@ require_once($CFG->libdir . '/externallib.php');
|
||||
$serviceshortname = required_param('service', PARAM_ALPHANUMEXT);
|
||||
$passport = required_param('passport', PARAM_RAW); // Passport send from the app to validate the response URL.
|
||||
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_NOTAGS); // The URL scheme the app supports.
|
||||
$confirmed = optional_param('confirmed', false, PARAM_BOOL); // If we are being redirected after user confirmation.
|
||||
|
||||
// Check web services enabled.
|
||||
if (!$CFG->enablewebservices) {
|
||||
@@ -39,7 +40,8 @@ if (!$CFG->enablewebservices) {
|
||||
|
||||
// Check if the plugin is properly configured.
|
||||
$typeoflogin = get_config('tool_mobile', 'typeoflogin');
|
||||
if ($typeoflogin != tool_mobile\api::LOGIN_VIA_BROWSER and
|
||||
if (empty($SESSION->justloggedin) and
|
||||
$typeoflogin != tool_mobile\api::LOGIN_VIA_BROWSER and
|
||||
$typeoflogin != tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER) {
|
||||
throw new moodle_exception('pluginnotenabledorconfigured', 'tool_mobile');
|
||||
}
|
||||
@@ -61,8 +63,8 @@ $token = external_generate_token_for_current_user($service);
|
||||
$privatetoken = $token->privatetoken;
|
||||
external_log_token_request($token);
|
||||
|
||||
// Invalidate the private token if external_generate_token_for_current_user did not create a new token.
|
||||
if ($token->timecreated < $timenow) {
|
||||
// Don't return the private token if the user didn't just log in and a new token wasn't created.
|
||||
if (empty($SESSION->justloggedin) and $token->timecreated < $timenow) {
|
||||
$privatetoken = null;
|
||||
}
|
||||
|
||||
@@ -87,11 +89,24 @@ if (!empty($forcedurlscheme)) {
|
||||
$location = "$urlscheme://token=$apptoken";
|
||||
|
||||
// For iOS 10 onwards, we have to simulate a user click.
|
||||
if (core_useragent::is_ios()) {
|
||||
$PAGE->set_context(null);
|
||||
// If we come from the confirmation page, we should display a nicer page.
|
||||
$isios = core_useragent::is_ios();
|
||||
if ($confirmed or $isios) {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_heading($COURSE->fullname);
|
||||
$PAGE->set_url('/local/mobile/launch.php', array('service' => $serviceshortname, 'passport' => $passport, 'urlscheme' => $urlscheme));
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if ($confirmed) {
|
||||
$confirmedstr = get_string('confirmed');
|
||||
$PAGE->navbar->add($confirmedstr);
|
||||
$PAGE->set_title($confirmedstr);
|
||||
echo $OUTPUT->notification($confirmedstr, \core\output\notification::NOTIFY_SUCCESS);
|
||||
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
|
||||
echo $OUTPUT->single_button(new moodle_url('/course/'), get_string('courses'));
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
$notice = get_string('clickheretolaunchtheapp', 'tool_mobile');
|
||||
echo html_writer::link($location, $notice, array('id' => 'launchapp'));
|
||||
echo html_writer::script(
|
||||
|
||||
@@ -28,7 +28,9 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
if ($hassiteconfig) {
|
||||
|
||||
$temp = new admin_settingpage('mobile', new lang_string('mobile', 'admin'), 'moodle/site:config', false);
|
||||
$ADMIN->add('root', new admin_category('mobileapp', new lang_string('mobileapp', 'tool_mobile')), 'development');
|
||||
|
||||
$temp = new admin_settingpage('mobilesettings', new lang_string('mobilesettings', 'tool_mobile'), 'moodle/site:config', false);
|
||||
|
||||
// We should wait to the installation to finish since we depend on some configuration values that are set once
|
||||
// the admin user profile is configured.
|
||||
@@ -41,32 +43,43 @@ if ($hassiteconfig) {
|
||||
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), $default));
|
||||
}
|
||||
|
||||
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'),
|
||||
new lang_string('configmobilecssurl', 'admin'), '', PARAM_URL));
|
||||
$ADMIN->add('mobileapp', $temp);
|
||||
|
||||
// Type of login.
|
||||
$options = array(
|
||||
tool_mobile\api::LOGIN_VIA_APP => new lang_string('loginintheapp', 'tool_mobile'),
|
||||
tool_mobile\api::LOGIN_VIA_BROWSER => new lang_string('logininthebrowser', 'tool_mobile'),
|
||||
tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER => new lang_string('loginintheembeddedbrowser', 'tool_mobile'),
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('tool_mobile/typeoflogin',
|
||||
new lang_string('typeoflogin', 'tool_mobile'),
|
||||
new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options));
|
||||
// Show only mobile settings if the mobile service is enabled.
|
||||
if (!empty($CFG->enablemobilewebservice)) {
|
||||
// Type of login.
|
||||
$temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile'));
|
||||
$options = array(
|
||||
tool_mobile\api::LOGIN_VIA_APP => new lang_string('loginintheapp', 'tool_mobile'),
|
||||
tool_mobile\api::LOGIN_VIA_BROWSER => new lang_string('logininthebrowser', 'tool_mobile'),
|
||||
tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER => new lang_string('loginintheembeddedbrowser', 'tool_mobile'),
|
||||
);
|
||||
$temp->add(new admin_setting_configselect('tool_mobile/typeoflogin',
|
||||
new lang_string('typeoflogin', 'tool_mobile'),
|
||||
new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options));
|
||||
|
||||
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
|
||||
new lang_string('forcedurlscheme_key', 'tool_mobile'),
|
||||
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
|
||||
new lang_string('forcedurlscheme_key', 'tool_mobile'),
|
||||
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
|
||||
|
||||
$temp->add(new admin_setting_heading('tool_mobile/smartappbanners',
|
||||
new lang_string('smartappbanners', 'tool_mobile'), ''));
|
||||
$ADMIN->add('mobileapp', $temp);
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('tool_mobile/enablesmartappbanners',
|
||||
new lang_string('enablesmartappbanners', 'tool_mobile'),
|
||||
new lang_string('enablesmartappbanners_desc', 'tool_mobile'), 0));
|
||||
// Appearance related settings.
|
||||
$temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile'));
|
||||
|
||||
$temp->add(new admin_setting_configtext('tool_mobile/iosappid', new lang_string('iosappid', 'tool_mobile'),
|
||||
new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM));
|
||||
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'tool_mobile'),
|
||||
new lang_string('configmobilecssurl', 'tool_mobile'), '', PARAM_URL));
|
||||
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$temp->add(new admin_setting_heading('tool_mobile/smartappbanners',
|
||||
new lang_string('smartappbanners', 'tool_mobile'), ''));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('tool_mobile/enablesmartappbanners',
|
||||
new lang_string('enablesmartappbanners', 'tool_mobile'),
|
||||
new lang_string('enablesmartappbanners_desc', 'tool_mobile'), 0));
|
||||
|
||||
$temp->add(new admin_setting_configtext('tool_mobile/iosappid', new lang_string('iosappid', 'tool_mobile'),
|
||||
new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM));
|
||||
|
||||
$ADMIN->add('mobileapp', $temp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
// Test default values.
|
||||
$context = context_system::instance();
|
||||
list($authinstructions, $notusedformat) = external_format_text($CFG->auth_instructions, FORMAT_MOODLE, $context->id);
|
||||
list($maintenancemessage, $notusedformat) = external_format_text($CFG->maintenance_message, FORMAT_MOODLE, $context->id);
|
||||
|
||||
$expected = array(
|
||||
'wwwroot' => $CFG->wwwroot,
|
||||
'httpswwwroot' => $CFG->httpswwwroot,
|
||||
@@ -73,12 +76,12 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
'authloginviaemail' => $CFG->authloginviaemail,
|
||||
'registerauth' => $CFG->registerauth,
|
||||
'forgottenpasswordurl' => $CFG->forgottenpasswordurl,
|
||||
'authinstructions' => format_text($CFG->auth_instructions),
|
||||
'authinstructions' => $authinstructions,
|
||||
'authnoneenabled' => (int) is_enabled_auth('none'),
|
||||
'enablewebservices' => $CFG->enablewebservices,
|
||||
'enablemobilewebservice' => $CFG->enablemobilewebservice,
|
||||
'maintenanceenabled' => $CFG->maintenance_enabled,
|
||||
'maintenancemessage' => format_text($CFG->maintenance_message),
|
||||
'maintenancemessage' => $maintenancemessage,
|
||||
'typeoflogin' => api::LOGIN_VIA_APP,
|
||||
'warnings' => array()
|
||||
);
|
||||
@@ -92,8 +95,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
set_config('logo', 'mock.png', 'core_admin');
|
||||
set_config('logocompact', 'mock.png', 'core_admin');
|
||||
|
||||
list($authinstructions, $notusedformat) = external_format_text($authinstructions, FORMAT_MOODLE, $context->id);
|
||||
$expected['registerauth'] = 'email';
|
||||
$expected['authinstructions'] = format_text($authinstructions);
|
||||
$expected['authinstructions'] = $authinstructions;
|
||||
$expected['typeoflogin'] = api::LOGIN_VIA_BROWSER;
|
||||
$expected['launchurl'] = "$CFG->wwwroot/$CFG->admin/tool/mobile/launch.php";
|
||||
|
||||
@@ -120,12 +124,16 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
$result = external::get_config();
|
||||
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
|
||||
|
||||
// SITE summary is null in phpunit which gets transformed to an empty string by format_text.
|
||||
list($sitesummary, $unused) = external_format_text($SITE->summary, $SITE->summaryformat, context_system::instance()->id);
|
||||
|
||||
// Test default values.
|
||||
$context = context_system::instance();
|
||||
$expected = array(
|
||||
array('name' => 'fullname', 'value' => $SITE->fullname),
|
||||
array('name' => 'shortname', 'value' => $SITE->shortname),
|
||||
array('name' => 'summary', 'value' => $SITE->summary),
|
||||
array('name' => 'summary', 'value' => $sitesummary),
|
||||
array('name' => 'summaryformat', 'value' => FORMAT_HTML),
|
||||
array('name' => 'frontpage', 'value' => $CFG->frontpage),
|
||||
array('name' => 'frontpageloggedin', 'value' => $CFG->frontpageloggedin),
|
||||
array('name' => 'maxcategorydepth', 'value' => $CFG->maxcategorydepth),
|
||||
@@ -141,9 +149,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
// Change a value and retrieve filtering by section.
|
||||
set_config('commentsperpage', 1);
|
||||
$expected[9]['value'] = 1;
|
||||
unset($expected[10]);
|
||||
$expected[10]['value'] = 1;
|
||||
unset($expected[11]);
|
||||
unset($expected[12]);
|
||||
|
||||
$result = external::get_config('frontpagesettings');
|
||||
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
|
||||
@@ -174,6 +182,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
$CFG->enablemobilewebservice = 1;
|
||||
$_GET['wstoken'] = $token->token; // Mock parameters.
|
||||
|
||||
// Even if we force the password change for the current user we should be able to retrieve the key.
|
||||
set_user_preference('auth_forcepasswordchange', 1, $user->id);
|
||||
|
||||
$this->setCurrentTimeStart();
|
||||
$result = external::get_autologin_key($token->privatetoken);
|
||||
$result = external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot . '/admin/tool/monitor/lib.php');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/monitor/lib.php');
|
||||
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1586
-1300
File diff suppressed because it is too large
Load Diff
@@ -521,6 +521,10 @@ Tour.prototype.normalizeStepConfig = function (stepConfig) {
|
||||
attachPoint: 'after'
|
||||
}, stepConfig);
|
||||
|
||||
if (stepConfig.attachTo) {
|
||||
stepConfig.attachTo = $(stepConfig.attachTo).first();
|
||||
}
|
||||
|
||||
return stepConfig;
|
||||
};
|
||||
|
||||
@@ -612,7 +616,7 @@ Tour.prototype.processStepListeners = function (stepConfig) {
|
||||
args: ['click', $.proxy(function (e) {
|
||||
if ($(e.target).parents('[data-flexitour="container"]').length === 0) {
|
||||
// Ignore clicks when they are in the flexitour.
|
||||
window.setTimeout($.proxy(this.next, this), 100);
|
||||
window.setTimeout($.proxy(this.next, this), 500);
|
||||
}
|
||||
}, this)]
|
||||
});
|
||||
@@ -739,10 +743,10 @@ Tour.prototype.addStepToPage = function (stepConfig) {
|
||||
this.positionBackdrop(stepConfig);
|
||||
|
||||
if (stepConfig.attachPoint === 'append') {
|
||||
$(stepConfig.attachTo).append(currentStepNode);
|
||||
stepConfig.attachTo.append(currentStepNode);
|
||||
this.currentStepNode = currentStepNode;
|
||||
} else {
|
||||
this.currentStepNode = currentStepNode.insertAfter($(stepConfig.attachTo));
|
||||
this.currentStepNode = currentStepNode.insertAfter(stepConfig.attachTo);
|
||||
}
|
||||
|
||||
// Ensure that the step node is positioned.
|
||||
@@ -754,15 +758,15 @@ Tour.prototype.addStepToPage = function (stepConfig) {
|
||||
|
||||
animationTarget.animate({
|
||||
scrollTop: this.calculateScrollTop(stepConfig)
|
||||
}).promise().then($.proxy(function () {
|
||||
}).promise().then(function () {
|
||||
this.positionStep(stepConfig);
|
||||
this.revealStep(stepConfig);
|
||||
}, this));
|
||||
}.bind(this));
|
||||
} else if (stepConfig.orphan) {
|
||||
stepConfig.isOrphan = true;
|
||||
|
||||
// This will be appended to the body instead.
|
||||
stepConfig.attachTo = 'body';
|
||||
stepConfig.attachTo = $('body').first();
|
||||
stepConfig.attachPoint = 'append';
|
||||
|
||||
// Add the backdrop.
|
||||
@@ -772,17 +776,26 @@ Tour.prototype.addStepToPage = function (stepConfig) {
|
||||
currentStepNode.addClass('orphan');
|
||||
|
||||
// It lives in the body.
|
||||
$(stepConfig.attachTo).append(currentStepNode);
|
||||
stepConfig.attachTo.append(currentStepNode);
|
||||
this.currentStepNode = currentStepNode;
|
||||
|
||||
this.currentStepNode.offset(this.calculateStepPositionInPage());
|
||||
this.currentStepNode.css('position', 'fixed');
|
||||
|
||||
this.currentStepPopper = new Popper($('body'), this.currentStepNode[0], {
|
||||
removeOnDestroy: true,
|
||||
placement: stepConfig.placement + '-start',
|
||||
arrowElement: '[data-role="arrow"]',
|
||||
// Empty the modifiers. We've already placed the step and don't want it moved.
|
||||
modifiers: []
|
||||
modifiers: {
|
||||
hide: {
|
||||
enabled: false
|
||||
},
|
||||
applyStyle: {
|
||||
onLoad: null,
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.revealStep(stepConfig);
|
||||
@@ -802,7 +815,7 @@ Tour.prototype.revealStep = function (stepConfig) {
|
||||
window.setTimeout($.proxy(function () {
|
||||
// After a brief delay, focus again.
|
||||
// There seems to be an issue with Jaws where it only reads the dialogue title initially.
|
||||
// This second focus causes it to read the full dialogue.
|
||||
// This second focus helps it to read the full dialogue.
|
||||
if (this.currentStepNode) {
|
||||
this.currentStepNode.focus();
|
||||
}
|
||||
@@ -1120,15 +1133,13 @@ Tour.prototype.calculateScrollTop = function (stepConfig) {
|
||||
Tour.prototype.calculateStepPositionInPage = function () {
|
||||
var viewportHeight = $(window).height();
|
||||
var stepHeight = this.currentStepNode.height();
|
||||
var scrollTop = $(window).scrollTop();
|
||||
|
||||
var viewportWidth = $(window).width();
|
||||
var stepWidth = this.currentStepNode.width();
|
||||
var scrollLeft = $(window).scrollLeft();
|
||||
|
||||
return {
|
||||
top: Math.ceil(scrollTop + (viewportHeight - stepHeight) / 2),
|
||||
left: Math.ceil(scrollLeft + (viewportWidth - stepWidth) / 2)
|
||||
top: Math.ceil((viewportHeight - stepHeight) / 2),
|
||||
left: Math.ceil((viewportWidth - stepWidth) / 2)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1166,18 +1177,29 @@ Tour.prototype.positionStep = function (stepConfig) {
|
||||
}
|
||||
|
||||
var target = this.getStepTarget(stepConfig);
|
||||
var config = {
|
||||
placement: stepConfig.placement + '-start',
|
||||
removeOnDestroy: true,
|
||||
modifiers: {
|
||||
flip: {
|
||||
behaviour: flipBehavior
|
||||
},
|
||||
arrow: {
|
||||
element: '[data-role="arrow"]'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var boundaryElement = target.closest('section');
|
||||
if (boundaryElement.length) {
|
||||
config.boundariesElement = boundaryElement[0];
|
||||
}
|
||||
|
||||
var background = $('[data-flexitour="step-background"]');
|
||||
if (background.length) {
|
||||
target = background;
|
||||
}
|
||||
|
||||
this.currentStepPopper = new Popper(target, content[0], {
|
||||
placement: stepConfig.placement + '-start',
|
||||
removeOnDestroy: true,
|
||||
flipBehavior: flipBehavior,
|
||||
arrowElement: '[data-role="arrow"]',
|
||||
modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', this.centerPopper, 'arrow', 'flip', 'applyStyle']
|
||||
});
|
||||
this.currentStepPopper = new Popper(target, content[0], config);
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -1196,9 +1218,9 @@ Tour.prototype.positionBackdrop = function (stepConfig) {
|
||||
|
||||
if (stepConfig.zIndex) {
|
||||
if (stepConfig.attachPoint === 'append') {
|
||||
$(stepConfig.attachTo).append(backdrop);
|
||||
stepConfig.attachTo.append(backdrop);
|
||||
} else {
|
||||
backdrop.insertAfter($(stepConfig.attachTo));
|
||||
backdrop.insertAfter(stepConfig.attachTo);
|
||||
}
|
||||
} else {
|
||||
$('body').append(backdrop);
|
||||
@@ -1259,10 +1281,10 @@ Tour.prototype.positionBackdrop = function (stepConfig) {
|
||||
|
||||
if (stepConfig.zIndex) {
|
||||
if (stepConfig.attachPoint === 'append') {
|
||||
$(stepConfig.attachTo).append(background);
|
||||
stepConfig.attachTo.append(background);
|
||||
} else {
|
||||
fader.insertAfter($(stepConfig.attachTo));
|
||||
background.insertAfter($(stepConfig.attachTo));
|
||||
fader.insertAfter(stepConfig.attachTo);
|
||||
background.insertAfter(stepConfig.attachTo);
|
||||
}
|
||||
} else {
|
||||
$('body').append(fader);
|
||||
@@ -1363,25 +1385,14 @@ Tour.prototype.calculatePosition = function (elem) {
|
||||
return null;
|
||||
};
|
||||
|
||||
Tour.prototype.centerPopper = function (data) {
|
||||
if (!this.isModifierRequired(Tour.prototype.centerPopper, this.modifiers.keepTogether)) {
|
||||
console.warn('WARNING: keepTogether modifier is required by centerPopper modifier in order to work, be sure to include it before arrow!');
|
||||
return data;
|
||||
}
|
||||
|
||||
var placement = data.placement.split('-')[0];
|
||||
var reference = data.offsets.reference;
|
||||
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
||||
|
||||
var len = isVertical ? 'height' : 'width';
|
||||
var side = isVertical ? 'top' : 'left';
|
||||
|
||||
data.offsets.popper[side] += Math.max(reference[len] / 2 - data.offsets.popper[len] / 2, 0);
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
Tour.prototype.accessibilityShow = function (stepConfig) {
|
||||
/**
|
||||
* Perform accessibility changes for step shown.
|
||||
*
|
||||
* This will add aria-hidden="true" to all siblings and parent siblings.
|
||||
*
|
||||
* @method accessibilityShow
|
||||
*/
|
||||
Tour.prototype.accessibilityShow = function () {
|
||||
var stateHolder = 'data-has-hidden';
|
||||
var attrName = 'aria-hidden';
|
||||
var hideFunction = function hideFunction(child) {
|
||||
@@ -1409,6 +1420,13 @@ Tour.prototype.accessibilityShow = function (stepConfig) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Perform accessibility changes for step hidden.
|
||||
*
|
||||
* This will remove any newly added aria-hidden="true".
|
||||
*
|
||||
* @method accessibilityHide
|
||||
*/
|
||||
Tour.prototype.accessibilityHide = function () {
|
||||
var stateHolder = 'data-has-hidden';
|
||||
var attrName = 'aria-hidden';
|
||||
|
||||
@@ -241,9 +241,7 @@ class manager {
|
||||
'title' => get_string('importtour', 'tool_usertours'),
|
||||
],
|
||||
(object) [
|
||||
'link' => new \moodle_url('https://moodle.net/mod/data/view.php', [
|
||||
'id' => 17,
|
||||
]),
|
||||
'link' => new \moodle_url('https://moodle.net/tours'),
|
||||
'linkproperties' => [
|
||||
'target' => '_blank',
|
||||
],
|
||||
|
||||
@@ -28,8 +28,8 @@ $string['appliesto'] = 'Applies to';
|
||||
$string['below'] = 'Below';
|
||||
$string['block'] = 'Block';
|
||||
$string['block_named'] = 'Block named \'{$a}\'';
|
||||
$string['cachedef_stepdata'] = 'List of User Tour steps';
|
||||
$string['cachedef_tourdata'] = 'List of enabled User Tours information which are fetched on every page';
|
||||
$string['cachedef_stepdata'] = 'List of user tour steps';
|
||||
$string['cachedef_tourdata'] = 'List of enabled user tours information which is fetched on every page';
|
||||
$string['description'] = 'Description';
|
||||
$string['confirmstepremovalquestion'] = 'Are you sure that you wish to remove this step?';
|
||||
$string['confirmstepremovaltitle'] = 'Confirm step removal';
|
||||
@@ -37,16 +37,9 @@ $string['confirmtourremovalquestion'] = 'Are you sure that you wish to remove th
|
||||
$string['confirmtourremovaltitle'] = 'Confirm tour removal';
|
||||
$string['content'] = 'Content';
|
||||
$string['content_heading'] = 'Content';
|
||||
$string['content_help'] = 'This is the content of the step.
|
||||
You can enter a content in the following formats:
|
||||
<dl>
|
||||
<dt>Plain text</dt>
|
||||
<dd>A plain text description</dd>
|
||||
<dt>Moodle MultiLang</dt>
|
||||
<dd>A string which makes use of the Moodle MultiLang format</dd>
|
||||
<dt>Moodle Translated string</dt>
|
||||
<dd>A value found in a standard Moodle language file in the format identifier,component</dd>
|
||||
</dl>';
|
||||
$string['content_help'] = 'Content describing the step may be added as plain text, enclosed in multilang tags (for use with the multi-language content filter) if required.
|
||||
|
||||
Alternatively, a language string ID may be entered in the format identifier,component (with no brackets or space after the comma).';
|
||||
$string['cssselector'] = 'CSS selector';
|
||||
$string['defaultvalue'] = 'Default ({$a})';
|
||||
$string['delay'] = 'Delay before showing the step';
|
||||
@@ -92,35 +85,24 @@ $string['pluginname'] = 'User tours';
|
||||
$string['resettouronpage'] = 'Reset user tour on this page';
|
||||
$string['right'] = 'Right';
|
||||
$string['select_block'] = 'Select a block';
|
||||
$string['targettype_help'] = 'Every step is associated with a part of the page which you must choose. To make this easier there are several types of target for different types of page content.
|
||||
<dl>
|
||||
<dt>Block</dt>
|
||||
<dd>Display the step next to the first matching block of the type on the page.</dd>
|
||||
<dt>Selector</dt>
|
||||
<dd>CSS Selectors are a powerful way which allow you to select different parts of the page based on metadata built into the page.</dd>
|
||||
<dt>Display in middle of the page</dt>
|
||||
<dd>Instead of associating the step with a specific part of the page you can have it displayed in the middle of the page.</dd>
|
||||
</dl>';
|
||||
$string['targettype_help'] = 'Each step is associated with a part of the page - the target. Target types are:
|
||||
|
||||
* Block - for displaying a step next to a specified block
|
||||
* CSS selector - for accurately defining the target area using CSS
|
||||
* Display in middle of page - for a step which does not need to be associated with a specific part of the page';
|
||||
$string['selector_defaulttitle'] = 'Enter a descriptive title';
|
||||
$string['selectordisplayname'] = 'A CSS selector matching \'{$a}\'';
|
||||
$string['skip'] = 'Skip';
|
||||
$string['target'] = 'Target';
|
||||
$string['target_heading'] = 'Step Target';
|
||||
$string['target_heading'] = 'Step target';
|
||||
$string['target_block'] = 'Block';
|
||||
$string['target_selector'] = 'Selector';
|
||||
$string['target_unattached'] = 'Display in middle of page';
|
||||
$string['targettype'] = 'Target type';
|
||||
$string['title'] = 'Title';
|
||||
$string['title_help'] = 'This is the title shown at the top of the step.
|
||||
You can enter a title in the following formats:
|
||||
<dl>
|
||||
<dt>Plain text</dt>
|
||||
<dd>A plain text description</dd>
|
||||
<dt>Moodle MultiLang</dt>
|
||||
<dd>A string which makes use of the Moodle MultiLang format</dd>
|
||||
<dt>Moodle Translated string</dt>
|
||||
<dd>A value found in a standard Moodle language file in the format identifier,component</dd>
|
||||
</dl>';
|
||||
$string['title_help'] = 'The title of a step may be added as plain text, enclosed in multilang tags (for use with the multi-language content filter) if required.
|
||||
|
||||
Alternatively, a language string ID may be entered in the format identifier,component (with no brackets or space after the comma).';
|
||||
$string['tourconfig'] = 'Tour configuration file to import';
|
||||
$string['tourlist_explanation'] = 'You can create as many tours as you like and enable them for different parts of Moodle. Only one tour can be created per page.';
|
||||
$string['tours'] = 'Tours';
|
||||
@@ -136,11 +118,9 @@ Note: Backdrops are not compatible with some parts of the page such as the navig
|
||||
';
|
||||
$string['reflex'] = 'Proceed on click';
|
||||
$string['reflex_help'] = 'Proceed to the next step when the target is clicked on.';
|
||||
$string['placement_help'] = 'You can place a step either above, below, to the left of, or to the right of the target.
|
||||
$string['placement_help'] = 'A step may be placed above, below, left or right of the target. Above or below is recommended, as these adjust better for mobile display.
|
||||
|
||||
The best options are above, or below as these adjust better for mobile display.
|
||||
|
||||
If the step does not fit into the page at at the placement you choose, it will be automatically be moved to give the best viewing experience. ';
|
||||
If the step does not fit on a particular page in the specified place, it will be automatically placed elsewhere.';
|
||||
$string['delay_help'] = 'You can optionally choose to add a delay before the step is displayed.
|
||||
|
||||
This delay is in milliseconds.';
|
||||
@@ -149,21 +129,7 @@ $string['sharedtourslink'] = 'Tour repository';
|
||||
$string['usertours'] = 'User tours';
|
||||
$string['usertours:managetours'] = 'Create, edit, and remove user tours';
|
||||
$string['target_selector_targetvalue'] = 'CSS selectors';
|
||||
$string['target_selector_targetvalue_help'] = 'You can use a "CSS Selector" to target almost any element on the page.
|
||||
|
||||
CSS Selectors are very powerful and you can easily find parts of the page by building up the selector gradually.
|
||||
|
||||
Mozilla provide some [very good
|
||||
documentation](https://developer.mozilla.org/en/docs/Web/Guide/CSS/Getting_started/Selectors)
|
||||
for selectors which may help you to build your selectors.
|
||||
|
||||
You will also find your browser\'s developer tools to be extremely useful in creating these selectors:
|
||||
|
||||
* [Google Chrome](https://developer.chrome.com/devtools#dom-and-styles)
|
||||
* [Mozilla Firefox](https://developer.mozilla.org/en-US/docs/Tools/DOM_Property_Viewer)
|
||||
* [Microsoft Edge](https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/f12-devtools-guide/)
|
||||
* [Apple Safari](https://developer.apple.com/library/iad/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/ResourcesandtheDOM/ResourcesandtheDOM.html#//apple_ref/doc/uid/TP40007874-CH3-SW1)
|
||||
';
|
||||
$string['target_selector_targetvalue_help'] = 'A CSS selector can be used to target almost any element on the page. The appropriate selector can be easily found using the developer tools for your web browser.';
|
||||
$string['viewtour_info'] = 'This is the \'{$a->tourname}\' tour. It applies to the path \'{$a->path}\'.';
|
||||
$string['viewtour_edit'] = 'You can <a href="{$a->editlink}">edit the tour defaults</a> and <a href="{$a->resetlink}">force the tour to be displayed</a> to all users again.';
|
||||
$string['tour_resetforall'] = 'The state of the tour has been reset. It will be displayed to all users again.';
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
<location>amd/src/tour.js</location>
|
||||
<name>Flexitour</name>
|
||||
<license>GPLv3</license>
|
||||
<version>0.9.7</version>
|
||||
<version>0.9.9</version>
|
||||
<licenseversion>3</licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
<location>amd/src/popper.js</location>
|
||||
<name>Popper.js</name>
|
||||
<license>MIT</license>
|
||||
<version>v0.6.4</version>
|
||||
<version>v1.0.0-alpha.3</version>
|
||||
<licenseversion></licenseversion>
|
||||
</library>
|
||||
</libraries>
|
||||
|
||||
@@ -67,7 +67,7 @@ echo '<fieldset>';
|
||||
echo '<div class="clearer"><!-- --></div>';
|
||||
echo $newsettingshtml;
|
||||
echo '</fieldset>';
|
||||
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
||||
echo '<div class="form-buttons"><input class="form-submit btn btn-primary" type="submit" value="'.get_string('savechanges','admin').'" /></div>';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
|
||||
+20
-2
@@ -95,6 +95,24 @@ class auth_plugin_email extends auth_plugin_base {
|
||||
* @param boolean $notify print notice with link and terminate
|
||||
*/
|
||||
function user_signup($user, $notify=true) {
|
||||
// Standard signup, without custom confirmatinurl.
|
||||
return $this->user_signup_with_confirmation($user, $notify);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign up a new user ready for confirmation.
|
||||
*
|
||||
* Password is passed in plaintext.
|
||||
* A custom confirmationurl could be used.
|
||||
*
|
||||
* @param object $user new user object
|
||||
* @param boolean $notify print notice with link and terminate
|
||||
* @param string $confirmationurl user confirmation URL
|
||||
* @return boolean true if everything well ok and $notify is set to true
|
||||
* @throws moodle_exception
|
||||
* @since Moodle 3.2
|
||||
*/
|
||||
public function user_signup_with_confirmation($user, $notify=true, $confirmationurl = null) {
|
||||
global $CFG, $DB;
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
require_once($CFG->dirroot.'/user/lib.php');
|
||||
@@ -115,8 +133,8 @@ class auth_plugin_email extends auth_plugin_base {
|
||||
// Trigger event.
|
||||
\core\event\user_created::create_from_userid($user->id)->trigger();
|
||||
|
||||
if (! send_confirmation_email($user)) {
|
||||
print_error('auth_emailnoemail','auth_email');
|
||||
if (! send_confirmation_email($user, $confirmationurl)) {
|
||||
print_error('auth_emailnoemail', 'auth_email');
|
||||
}
|
||||
|
||||
if ($notify) {
|
||||
|
||||
@@ -202,7 +202,8 @@ class auth_email_external extends external_api {
|
||||
'value' => new external_value(PARAM_RAW, 'Custom field value, can be an encoded json if required')
|
||||
)
|
||||
), 'User custom fields (also known as user profile fields)', VALUE_DEFAULT, array()
|
||||
)
|
||||
),
|
||||
'redirect' => new external_value(PARAM_URL, 'Redirect the user to this url after confirmation.', VALUE_DEFAULT, ''),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -220,13 +221,15 @@ class auth_email_external extends external_api {
|
||||
* @param string $recaptchachallengehash recaptcha challenge hash
|
||||
* @param string $recaptcharesponse recaptcha response
|
||||
* @param array $customprofilefields user custom fields (also known as user profile fields)
|
||||
* @param string $redirect Url to redirect the user after confirmation
|
||||
* @return array settings and possible warnings
|
||||
* @since Moodle 3.2
|
||||
* @throws moodle_exception
|
||||
* @throws invalid_parameter_exception
|
||||
*/
|
||||
public static function signup_user($username, $password, $firstname, $lastname, $email, $city = '', $country = '',
|
||||
$recaptchachallengehash = '', $recaptcharesponse = '', $customprofilefields = array()) {
|
||||
$recaptchachallengehash = '', $recaptcharesponse = '', $customprofilefields = array(),
|
||||
$redirect = '') {
|
||||
global $CFG, $PAGE;
|
||||
|
||||
$warnings = array();
|
||||
@@ -243,6 +246,7 @@ class auth_email_external extends external_api {
|
||||
'recaptchachallengehash' => $recaptchachallengehash,
|
||||
'recaptcharesponse' => $recaptcharesponse,
|
||||
'customprofilefields' => $customprofilefields,
|
||||
'redirect' => $redirect,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -324,7 +328,16 @@ class auth_email_external extends external_api {
|
||||
$user = signup_setup_new_user((object) $data);
|
||||
|
||||
$authplugin = get_auth_plugin('email');
|
||||
$authplugin->user_signup($user, false);
|
||||
|
||||
// Check if we should redirect the user once the user is confirmed.
|
||||
$confirmationurl = null;
|
||||
if (!empty($params['redirect'])) {
|
||||
// Pass via moodle_url to fix thinks like admin links.
|
||||
$redirect = new moodle_url($params['redirect']);
|
||||
|
||||
$confirmationurl = new moodle_url('/login/confirm.php', array('redirect' => $redirect->out()));
|
||||
}
|
||||
$authplugin->user_signup_with_confirmation($user, false, $confirmationurl);
|
||||
|
||||
$result = array(
|
||||
'success' => true,
|
||||
|
||||
@@ -7,6 +7,8 @@ information provided here is intended especially for developers.
|
||||
This can be used to modify the user object before any authentication errors are raised.
|
||||
* The block_login now displays the loginpage_idp_list() links as well as main login page.
|
||||
* The authentication plugin auth_radius has been moved to https://github.com/moodlehq/moodle-auth_radius
|
||||
* New auth_email::user_signup_with_confirmation() method has a new optional parameter $confirmationurl to provide a different
|
||||
confirmation URL.
|
||||
|
||||
=== 3.0 ===
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class tree_node {
|
||||
|
||||
/** @var int Counter to be used in {@link tree_node::unique_sql_parameter()}. */
|
||||
protected static $uniquesqlparametercounter = 1;
|
||||
|
||||
/**
|
||||
* Determines whether this particular item is currently available
|
||||
* according to the availability criteria.
|
||||
@@ -242,10 +246,11 @@ abstract class tree_node {
|
||||
* @return SQL code for the parameter, e.g. ':pr1234'
|
||||
*/
|
||||
protected static function unique_sql_parameter(array &$params, $value) {
|
||||
static $count = 1;
|
||||
|
||||
// Note we intentionally do not use self:: here.
|
||||
$count = tree_node::$uniquesqlparametercounter++;
|
||||
$unique = 'usp' . $count;
|
||||
$params[$unique] = $value;
|
||||
$count++;
|
||||
return ':' . $unique;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ Feature: Confirm that conditions on completion no longer cause a bug
|
||||
And I set the field "Activity or resource" to "Page1"
|
||||
And I press "Add restriction..."
|
||||
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
|
||||
And I set the field with xpath "//div[@class='availability-item'][preceding-sibling::div]//select[@name='cm']" to "Page2"
|
||||
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
|
||||
And I press "Save and return to course"
|
||||
And I should see "Not available unless:" in the ".activity.glossary" "css_element"
|
||||
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
|
||||
|
||||
+6
-4
@@ -25,9 +25,10 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
var html = '<span class="col-form-label p-r-1"> ' + M.util.get_string('title', 'availability_completion') + '</span>' +
|
||||
' <span class="availability-group form-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<select class="custom-select" name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
@@ -36,13 +37,14 @@ M.availability_completion.form.getNode = function(json) {
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' +
|
||||
M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
' </span><select class="custom-select" ' +
|
||||
'name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.cm !== undefined &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n=M.util.get_string("title","availability_completion")+' <span class="availability-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create("<span>"+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n='<span class="col-form-label p-r-1"> '+M.util.get_string("title","availability_completion")+"</span>"+' <span class="availability-group form-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select class="custom-select" name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select class="custom-select" '+'name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create('<span class="form-inline">'+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+6
-4
@@ -25,9 +25,10 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
var html = '<span class="col-form-label p-r-1"> ' + M.util.get_string('title', 'availability_completion') + '</span>' +
|
||||
' <span class="availability-group form-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<select class="custom-select" name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
@@ -36,13 +37,14 @@ M.availability_completion.form.getNode = function(json) {
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' +
|
||||
M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
' </span><select class="custom-select" ' +
|
||||
'name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.cm !== undefined &&
|
||||
|
||||
@@ -23,9 +23,10 @@ M.availability_completion.form.initInner = function(cms) {
|
||||
|
||||
M.availability_completion.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = M.util.get_string('title', 'availability_completion') + ' <span class="availability-group"><label>' +
|
||||
var html = '<span class="col-form-label p-r-1"> ' + M.util.get_string('title', 'availability_completion') + '</span>' +
|
||||
' <span class="availability-group form-group"><label>' +
|
||||
'<span class="accesshide">' + M.util.get_string('label_cm', 'availability_completion') + ' </span>' +
|
||||
'<select name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<select class="custom-select" name="cm" title="' + M.util.get_string('label_cm', 'availability_completion') + '">' +
|
||||
'<option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.cms.length; i++) {
|
||||
var cm = this.cms[i];
|
||||
@@ -34,13 +35,14 @@ M.availability_completion.form.getNode = function(json) {
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' +
|
||||
M.util.get_string('label_completion', 'availability_completion') +
|
||||
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
' </span><select class="custom-select" ' +
|
||||
'name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
|
||||
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
|
||||
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +
|
||||
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
|
||||
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
|
||||
'</select></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.cm !== undefined &&
|
||||
|
||||
@@ -151,7 +151,7 @@ class frontend extends \core_availability\frontend {
|
||||
// NOTE: The fields need to have these weird names in order that they
|
||||
// match the standard Moodle form control, otherwise the date selector
|
||||
// won't find them.
|
||||
$html .= \html_writer::start_tag('select', array('name' => 'x[' . $field . ']'));
|
||||
$html .= \html_writer::start_tag('select', array('name' => 'x[' . $field . ']', 'class' => 'custom-select'));
|
||||
foreach ($options as $key => $value) {
|
||||
$params = array('value' => $key);
|
||||
if ($current[$field] == $key) {
|
||||
|
||||
+3
-2
@@ -29,9 +29,10 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
var html = '<span class="col-form-label p-r-1">' +
|
||||
M.util.get_string('direction_before', 'availability_date') + '</span> <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<select name="direction" class="custom-select">' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n=M.util.get_string("direction_before","availability_date")+' <span class="availability-group">'+'<label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+" </span>"+'<select name="direction">'+'<option value=">=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="<">'+M.util.get_string("direction_until","availability_date")+"</option>"+"</select></label></span> "+this.html,r=e.Node.create("<span>"+n+"</span>");if(t.t!==undefined){r.setData("time",t.t),r.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var i=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(i,{on:{success:function(t,n){var i=e.JSON.parse(n.responseText);for(var s in i){var o=r.one("select[name=x\\["+s+"\\]]");o.set("value",""+i[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})}else r.setData("time",this.defaultTime);t.d!==undefined&&r.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var s=e.one(".availability-field");s.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),s.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(r.one("a[href=#]")){M.form.dateselector.init_single_date_selector(r);var o=r.one("select[name=x\\[year\\]]"),u=o.set;o.set=function(e,t){u.call(o,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(r)},0)}}return r},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n='<span class="col-form-label p-r-1">'+M.util.get_string("direction_before","availability_date")+'</span> <span class="availability-group">'+'<label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+" </span>"+'<select name="direction" class="custom-select">'+'<option value=">=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="<">'+M.util.get_string("direction_until","availability_date")+"</option>"+"</select></label></span> "+this.html,r=e.Node.create("<span>"+n+"</span>");if(t.t!==undefined){r.setData("time",t.t),r.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var i=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(i,{on:{success:function(t,n){var i=e.JSON.parse(n.responseText);for(var s in i){var o=r.one("select[name=x\\["+s+"\\]]");o.set("value",""+i[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})}else r.setData("time",this.defaultTime);t.d!==undefined&&r.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var s=e.one(".availability-field");s.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),s.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(r.one("a[href=#]")){M.form.dateselector.init_single_date_selector(r);var o=r.one("select[name=x\\[year\\]]"),u=o.set;o.set=function(e,t){u.call(o,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(r)},0)}}return r},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
|
||||
|
||||
availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form.js
Vendored
+3
-2
@@ -29,9 +29,10 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
var html = '<span class="col-form-label p-r-1">' +
|
||||
M.util.get_string('direction_before', 'availability_date') + '</span> <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<select name="direction" class="custom-select">' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
|
||||
+3
-2
@@ -27,9 +27,10 @@ M.availability_date.form.initInner = function(html, defaultTime) {
|
||||
};
|
||||
|
||||
M.availability_date.form.getNode = function(json) {
|
||||
var html = M.util.get_string('direction_before', 'availability_date') + ' <span class="availability-group">' +
|
||||
var html = '<span class="col-form-label p-r-1">' +
|
||||
M.util.get_string('direction_before', 'availability_date') + '</span> <span class="availability-group">' +
|
||||
'<label><span class="accesshide">' + M.util.get_string('direction_label', 'availability_date') + ' </span>' +
|
||||
'<select name="direction">' +
|
||||
'<select name="direction" class="custom-select">' +
|
||||
'<option value=">=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
|
||||
'<option value="<">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
|
||||
'</select></label></span> ' + this.html;
|
||||
|
||||
+13
-10
@@ -37,24 +37,27 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var html = '<label class="form-group"><span class="p-r-1">' + M.util.get_string('title', 'availability_grade') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
html += '</select></span></label> <br><span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="min"/>' +
|
||||
M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</span><input type="text" class="form-control m-x-1" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span><br>' +
|
||||
'<span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="max"/>' +
|
||||
M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
'</span><input type="text" class="form-control m-x-1" name="maxval" title="' +
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<div class="d-inline-block form-inline">' + html + '</div>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n="<label>"+M.util.get_string("title","availability_grade")+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.grades.length;r++){var i=this.grades[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>';var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(s.one("input[name=min]").set("checked",!0),s.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(s.one("input[name=max]").set("checked",!0),s.one("input[name=maxval]").set("value",t.max));var o=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};s.all("input[type=checkbox]").each(o);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var u=e.one(".availability-field");u.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),u.delegate("click",function(){o(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),u.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return s},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n='<label class="form-group"><span class="p-r-1">'+M.util.get_string("title","availability_grade")+"</span> "+'<span class="availability-group">'+'<select name="id" class="custom-select"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.grades.length;r++){var i=this.grades[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></span></label> <br><span class="availability-group form-group"><label><input type="checkbox" class="form-check-input m-x-1" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" class="form-control m-x-1" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span><br>'+'<span class="availability-group form-group">'+'<label><input type="checkbox" class="form-check-input m-x-1" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" class="form-control m-x-1" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>';var s=e.Node.create('<div class="d-inline-block form-inline">'+n+"</div>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(s.one("input[name=min]").set("checked",!0),s.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(s.one("input[name=max]").set("checked",!0),s.one("input[name=maxval]").set("value",t.max));var o=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};s.all("input[type=checkbox]").each(o);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var u=e.one(".availability-field");u.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),u.delegate("click",function(){o(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),u.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return s},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+13
-10
@@ -37,24 +37,27 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var html = '<label class="form-group"><span class="p-r-1">' + M.util.get_string('title', 'availability_grade') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
html += '</select></span></label> <br><span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="min"/>' +
|
||||
M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</span><input type="text" class="form-control m-x-1" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span><br>' +
|
||||
'<span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="max"/>' +
|
||||
M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
'</span><input type="text" class="form-control m-x-1" name="maxval" title="' +
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<div class="d-inline-block form-inline">' + html + '</div>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+13
-10
@@ -35,24 +35,27 @@ M.availability_grade.form.getNode = function(json) {
|
||||
this.nodesSoFar++;
|
||||
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grade') + ' <span class="availability-group">' +
|
||||
'<select name="id"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var html = '<label class="form-group"><span class="p-r-1">' + M.util.get_string('title', 'availability_grade') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select"><option value="0">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.grades.length; i++) {
|
||||
var grade = this.grades[i];
|
||||
// String has already been escaped using format_string.
|
||||
html += '<option value="' + grade.id + '">' + grade.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label> <span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="min"/>' + M.util.get_string('option_min', 'availability_grade') +
|
||||
html += '</select></span></label> <br><span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="min"/>' +
|
||||
M.util.get_string('option_min', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_min', 'availability_grade') +
|
||||
'</span><input type="text" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span>' +
|
||||
'<span class="availability-group">' +
|
||||
'<label><input type="checkbox" name="max"/>' + M.util.get_string('option_max', 'availability_grade') +
|
||||
'</span><input type="text" class="form-control m-x-1" name="minval" title="' +
|
||||
M.util.get_string('label_min', 'availability_grade') + '"/></label>%</span><br>' +
|
||||
'<span class="availability-group form-group">' +
|
||||
'<label><input type="checkbox" class="form-check-input m-x-1" name="max"/>' +
|
||||
M.util.get_string('option_max', 'availability_grade') +
|
||||
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
|
||||
'</span><input type="text" name="maxval" title="' +
|
||||
'</span><input type="text" class="form-control m-x-1" name="maxval" title="' +
|
||||
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<div class="d-inline-block form-inline">' + html + '</div>');
|
||||
|
||||
// Set initial values.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+4
-3
@@ -33,8 +33,9 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_group') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
@@ -43,7 +44,7 @@ M.availability_group.form.getNode = function(json) {
|
||||
html += '<option value="' + group.id + '">' + group.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values (leave default 'choose' if creating afresh).
|
||||
if (json.creating === undefined) {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_group")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>"+'<option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(var r=0;r<this.groups.length;r++){var i=this.groups[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.creating===undefined&&(t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")?s.one("select[name=id]").set("value",""+t.id):t.id===undefined&&s.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return s},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n='<label><span class="p-r-1">'+M.util.get_string("title","availability_group")+"</span> "+'<span class="availability-group">'+'<select name="id" class="custom-select">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>"+'<option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(var r=0;r<this.groups.length;r++){var i=this.groups[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create('<span class="form-inline">'+n+"</span>");t.creating===undefined&&(t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")?s.one("select[name=id]").set("value",""+t.id):t.id===undefined&&s.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return s},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+4
-3
@@ -33,8 +33,9 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_group') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
@@ -43,7 +44,7 @@ M.availability_group.form.getNode = function(json) {
|
||||
html += '<option value="' + group.id + '">' + group.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values (leave default 'choose' if creating afresh).
|
||||
if (json.creating === undefined) {
|
||||
|
||||
+4
-3
@@ -31,8 +31,9 @@ M.availability_group.form.initInner = function(groups) {
|
||||
|
||||
M.availability_group.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_group') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_group') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>' +
|
||||
'<option value="any">' + M.util.get_string('anygroup', 'availability_group') + '</option>';
|
||||
for (var i = 0; i < this.groups.length; i++) {
|
||||
@@ -41,7 +42,7 @@ M.availability_group.form.getNode = function(json) {
|
||||
html += '<option value="' + group.id + '">' + group.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values (leave default 'choose' if creating afresh).
|
||||
if (json.creating === undefined) {
|
||||
|
||||
+4
-3
@@ -33,8 +33,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_grouping') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
@@ -42,7 +43,7 @@ M.availability_grouping.form.getNode = function(json) {
|
||||
html += '<option value="' + grouping.id + '">' + grouping.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial value if specified.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_grouping")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.groupings.length;r++){var i=this.groupings[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return s},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n='<label><span class="p-r-1">'+M.util.get_string("title","availability_grouping")+"</span> "+'<span class="availability-group">'+'<select name="id" class="custom-select">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.groupings.length;r++){var i=this.groupings[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create('<span class="form-inline">'+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return s},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+4
-3
@@ -33,8 +33,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_grouping') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
@@ -42,7 +43,7 @@ M.availability_grouping.form.getNode = function(json) {
|
||||
html += '<option value="' + grouping.id + '">' + grouping.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial value if specified.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+4
-3
@@ -31,8 +31,9 @@ M.availability_grouping.form.initInner = function(groupings) {
|
||||
|
||||
M.availability_grouping.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<label>' + M.util.get_string('title', 'availability_grouping') + ' <span class="availability-group">' +
|
||||
'<select name="id">' +
|
||||
var html = '<label><span class="p-r-1">' + M.util.get_string('title', 'availability_grouping') + '</span> ' +
|
||||
'<span class="availability-group">' +
|
||||
'<select name="id" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
for (var i = 0; i < this.groupings.length; i++) {
|
||||
var grouping = this.groupings[i];
|
||||
@@ -40,7 +41,7 @@ M.availability_grouping.form.getNode = function(json) {
|
||||
html += '<option value="' + grouping.id + '">' + grouping.name + '</option>';
|
||||
}
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial value if specified.
|
||||
if (json.id !== undefined &&
|
||||
|
||||
+7
-5
@@ -35,8 +35,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
var html = '<span class="availability-group"><label><span class="p-r-1">' +
|
||||
M.util.get_string('conditiontitle', 'availability_profile') + '</span> ' +
|
||||
'<select name="field" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
@@ -50,7 +51,8 @@ M.availability_profile.form.getNode = function(json) {
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '"' +
|
||||
' class="custom-select">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
@@ -58,9 +60,9 @@ M.availability_profile.form.getNode = function(json) {
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
'</span><input name="value" type="text" class="form-control" style="width: 10em" title="' +
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
if (json.sf !== undefined &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n='<span class="availability-group"><label>'+M.util.get_string("conditiontitle","availability_profile")+" "+'<select name="field">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",r;for(var i=0;i<this.standardFields.length;i++)r=this.standardFields[i],n+='<option value="sf_'+r.field+'">'+r.display+"</option>";for(i=0;i<this.customFields.length;i++)r=this.customFields[i],n+='<option value="cf_'+r.field+'">'+r.display+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'">';var s=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(i=0;i<s.length;i++)n+='<option value="'+s[i]+'">'+M.util.get_string("op_"+s[i],"availability_profile")+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>';var o=e.Node.create("<span>"+n+"</span>");t.sf!==undefined&&o.one("select[name=field] > option[value=sf_"+t.sf+"]")?o.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&o.one("select[name=field] > option[value=cf_"+t.cf+"]")&&o.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&o.one("select[name=op] > option[value="+t.op+"]")&&(o.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&o.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&o.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var u=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},a=e.one(".availability-field");a.delegate("change",function(){u(this)},".availability_profile select"),a.delegate("change",function(){u(this)},".availability_profile input[name=value]")}return o},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n='<span class="availability-group"><label><span class="p-r-1">'+M.util.get_string("conditiontitle","availability_profile")+"</span> "+'<select name="field" class="custom-select">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",r;for(var i=0;i<this.standardFields.length;i++)r=this.standardFields[i],n+='<option value="sf_'+r.field+'">'+r.display+"</option>";for(i=0;i<this.customFields.length;i++)r=this.customFields[i],n+='<option value="cf_'+r.field+'">'+r.display+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'"'+' class="custom-select">';var s=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(i=0;i<s.length;i++)n+='<option value="'+s[i]+'">'+M.util.get_string("op_"+s[i],"availability_profile")+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" class="form-control" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>';var o=e.Node.create('<span class="form-inline">'+n+"</span>");t.sf!==undefined&&o.one("select[name=field] > option[value=sf_"+t.sf+"]")?o.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&o.one("select[name=field] > option[value=cf_"+t.cf+"]")&&o.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&o.one("select[name=op] > option[value="+t.op+"]")&&(o.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&o.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&o.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var u=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},a=e.one(".availability-field");a.delegate("change",function(){u(this)},".availability_profile select"),a.delegate("change",function(){u(this)},".availability_profile input[name=value]")}return o},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
|
||||
|
||||
+7
-5
@@ -35,8 +35,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
var html = '<span class="availability-group"><label><span class="p-r-1">' +
|
||||
M.util.get_string('conditiontitle', 'availability_profile') + '</span> ' +
|
||||
'<select name="field" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
@@ -50,7 +51,8 @@ M.availability_profile.form.getNode = function(json) {
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '"' +
|
||||
' class="custom-select">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
@@ -58,9 +60,9 @@ M.availability_profile.form.getNode = function(json) {
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
'</span><input name="value" type="text" class="form-control" style="width: 10em" title="' +
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
if (json.sf !== undefined &&
|
||||
|
||||
+7
-5
@@ -33,8 +33,9 @@ M.availability_profile.form.initInner = function(standardFields, customFields) {
|
||||
|
||||
M.availability_profile.form.getNode = function(json) {
|
||||
// Create HTML structure.
|
||||
var html = '<span class="availability-group"><label>' + M.util.get_string('conditiontitle', 'availability_profile') + ' ' +
|
||||
'<select name="field">' +
|
||||
var html = '<span class="availability-group"><label><span class="p-r-1">' +
|
||||
M.util.get_string('conditiontitle', 'availability_profile') + '</span> ' +
|
||||
'<select name="field" class="custom-select">' +
|
||||
'<option value="choose">' + M.util.get_string('choosedots', 'moodle') + '</option>';
|
||||
var fieldInfo;
|
||||
for (var i = 0; i < this.standardFields.length; i++) {
|
||||
@@ -48,7 +49,8 @@ M.availability_profile.form.getNode = function(json) {
|
||||
html += '<option value="cf_' + fieldInfo.field + '">' + fieldInfo.display + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_operator', 'availability_profile') +
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '">';
|
||||
' </span><select name="op" title="' + M.util.get_string('label_operator', 'availability_profile') + '"' +
|
||||
' class="custom-select">';
|
||||
var operators = ['isequalto', 'contains', 'doesnotcontain', 'startswith', 'endswith',
|
||||
'isempty', 'isnotempty'];
|
||||
for (i = 0; i < operators.length; i++) {
|
||||
@@ -56,9 +58,9 @@ M.availability_profile.form.getNode = function(json) {
|
||||
M.util.get_string('op_' + operators[i], 'availability_profile') + '</option>';
|
||||
}
|
||||
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_value', 'availability_profile') +
|
||||
'</span><input name="value" type="text" style="width: 10em" title="' +
|
||||
'</span><input name="value" type="text" class="form-control" style="width: 10em" title="' +
|
||||
M.util.get_string('label_value', 'availability_profile') + '"/></label></span>';
|
||||
var node = Y.Node.create('<span>' + html + '</span>');
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
// Set initial values if specified.
|
||||
if (json.sf !== undefined &&
|
||||
|
||||
@@ -675,6 +675,63 @@ class tree_testcase extends \advanced_testcase {
|
||||
json_encode(tree::get_root_json(array($child, $child), tree::OP_AND, array(true, false))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the behaviour of the counter in unique_sql_parameter().
|
||||
*
|
||||
* There was a problem with static counters used to implement a sequence of
|
||||
* parameter placeholders (MDL-53481). As always with static variables, it
|
||||
* is a bit tricky to unit test the behaviour reliably as it depends on the
|
||||
* actual tests executed and also their order.
|
||||
*
|
||||
* To minimise risk of false expected behaviour, this test method should be
|
||||
* first one where {@link core_availability\tree::get_user_list_sql()} is
|
||||
* used. We also use higher number of condition instances to increase the
|
||||
* risk of the counter collision, should there remain a problem.
|
||||
*/
|
||||
public function test_unique_sql_parameter_behaviour() {
|
||||
global $DB;
|
||||
$this->resetAfterTest();
|
||||
$generator = $this->getDataGenerator();
|
||||
|
||||
// Create a test course with multiple groupings and groups and a student in each of them.
|
||||
$course = $generator->create_course();
|
||||
$user = $generator->create_user();
|
||||
$studentroleid = $DB->get_field('role', 'id', array('shortname' => 'student'));
|
||||
$generator->enrol_user($user->id, $course->id, $studentroleid);
|
||||
// The total number of groupings and groups must not be greater than 61.
|
||||
// There is a limit in MySQL on the max number of joined tables.
|
||||
$groups = [];
|
||||
for ($i = 0; $i < 25; $i++) {
|
||||
$group = $generator->create_group(array('courseid' => $course->id));
|
||||
groups_add_member($group, $user);
|
||||
$groups[] = $group;
|
||||
}
|
||||
$groupings = [];
|
||||
for ($i = 0; $i < 25; $i++) {
|
||||
$groupings[] = $generator->create_grouping(array('courseid' => $course->id));
|
||||
}
|
||||
foreach ($groupings as $grouping) {
|
||||
foreach ($groups as $group) {
|
||||
groups_assign_grouping($grouping->id, $group->id);
|
||||
}
|
||||
}
|
||||
$info = new \core_availability\mock_info($course);
|
||||
|
||||
// Make a huge tree with 'AND' of all groups and groupings conditions.
|
||||
$conditions = [];
|
||||
foreach ($groups as $group) {
|
||||
$conditions[] = \availability_group\condition::get_json($group->id);
|
||||
}
|
||||
foreach ($groupings as $groupingid) {
|
||||
$conditions[] = \availability_grouping\condition::get_json($grouping->id);
|
||||
}
|
||||
shuffle($conditions);
|
||||
$tree = new tree(tree::get_root_json($conditions));
|
||||
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
|
||||
// This must not throw exception.
|
||||
$DB->fix_sql_params($sql, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests get_user_list_sql.
|
||||
*/
|
||||
|
||||
Vendored
+22
-18
@@ -358,21 +358,25 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
'<div class="availability-header"><span class="p-l-1">' +
|
||||
M.util.get_string('listheader_sign_before', 'availability') + '</span>' +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
' </span><select class="availability-neg custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
'<select class="availability-op custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
'<div class="availability-none"><span class="p-x-1">' + M.util.get_string('none', 'moodle') + '</span></div>' +
|
||||
'<div class="clearfix m-t-1"></div>' +
|
||||
'<div class="availability-button"></div></div><div class="clearfix"></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
}
|
||||
@@ -406,12 +410,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
noneNode.appendChild(deleteIcon.span);
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
noneNode.appendChild(Y.Node.create('<span class="m-t-1 label label-warning">' +
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default m-t-1">' +
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() {
|
||||
this.clickAdd();
|
||||
@@ -667,7 +671,7 @@ M.core_availability.List.prototype.deleteDescendant = function(descendant) {
|
||||
*/
|
||||
M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<ul class="list-unstyled container-fluid"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
@@ -683,25 +687,25 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
continue;
|
||||
}
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
// Extra entry for lists.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
@@ -897,7 +901,7 @@ M.core_availability.Item = function(json, root) {
|
||||
this.pluginNode.addClass('availability_' + json.type);
|
||||
}
|
||||
|
||||
this.node = Y.Node.create('<div class="availability-item"><h3 class="accesshide"></h3></div>');
|
||||
this.node = Y.Node.create('<div class="availability-item d-inline-block"><h3 class="accesshide"></h3></div>');
|
||||
|
||||
// Add eye icon if required. This icon is added for root items, but may be
|
||||
// hidden depending on the selected list operator.
|
||||
@@ -920,7 +924,7 @@ M.core_availability.Item = function(json, root) {
|
||||
|
||||
// Add the invalid marker (empty).
|
||||
this.node.appendChild(document.createTextNode(' '));
|
||||
this.node.appendChild(Y.Node.create('<span class="label label-warning"/>'));
|
||||
this.node.appendChild(Y.Node.create('<span class="m-t-1 label label-warning"/>'));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1048,7 +1052,7 @@ M.core_availability.Item.prototype.pluginNode = null;
|
||||
*/
|
||||
M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.individual = individual;
|
||||
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
|
||||
this.span = Y.Node.create('<a class="availability-eye col-form-label" href="#" role="button">');
|
||||
var icon = Y.Node.create('<img />');
|
||||
this.span.appendChild(icon);
|
||||
|
||||
@@ -1128,7 +1132,7 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
* @param {M.core_availability.Item|M.core_availability.List} toDelete Thing to delete
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
this.span = Y.Node.create('<a class="d-inline-block col-form-label availability-delete p-x-1" href="#" title="' +
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+22
-18
@@ -358,21 +358,25 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
'<div class="availability-header"><span class="p-l-1">' +
|
||||
M.util.get_string('listheader_sign_before', 'availability') + '</span>' +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
' </span><select class="availability-neg custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
'<select class="availability-op custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
'<div class="availability-none"><span class="p-x-1">' + M.util.get_string('none', 'moodle') + '</span></div>' +
|
||||
'<div class="clearfix m-t-1"></div>' +
|
||||
'<div class="availability-button"></div></div><div class="clearfix"></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
}
|
||||
@@ -406,12 +410,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
noneNode.appendChild(deleteIcon.span);
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
noneNode.appendChild(Y.Node.create('<span class="m-t-1 label label-warning">' +
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default m-t-1">' +
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() {
|
||||
this.clickAdd();
|
||||
@@ -667,7 +671,7 @@ M.core_availability.List.prototype.deleteDescendant = function(descendant) {
|
||||
*/
|
||||
M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<ul class="list-unstyled container-fluid"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
@@ -683,25 +687,25 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
continue;
|
||||
}
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
// Extra entry for lists.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
@@ -897,7 +901,7 @@ M.core_availability.Item = function(json, root) {
|
||||
this.pluginNode.addClass('availability_' + json.type);
|
||||
}
|
||||
|
||||
this.node = Y.Node.create('<div class="availability-item"><h3 class="accesshide"></h3></div>');
|
||||
this.node = Y.Node.create('<div class="availability-item d-inline-block"><h3 class="accesshide"></h3></div>');
|
||||
|
||||
// Add eye icon if required. This icon is added for root items, but may be
|
||||
// hidden depending on the selected list operator.
|
||||
@@ -920,7 +924,7 @@ M.core_availability.Item = function(json, root) {
|
||||
|
||||
// Add the invalid marker (empty).
|
||||
this.node.appendChild(document.createTextNode(' '));
|
||||
this.node.appendChild(Y.Node.create('<span class="label label-warning"/>'));
|
||||
this.node.appendChild(Y.Node.create('<span class="m-t-1 label label-warning"/>'));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1048,7 +1052,7 @@ M.core_availability.Item.prototype.pluginNode = null;
|
||||
*/
|
||||
M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.individual = individual;
|
||||
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
|
||||
this.span = Y.Node.create('<a class="availability-eye col-form-label" href="#" role="button">');
|
||||
var icon = Y.Node.create('<img />');
|
||||
this.span.appendChild(icon);
|
||||
|
||||
@@ -1128,7 +1132,7 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
* @param {M.core_availability.Item|M.core_availability.List} toDelete Thing to delete
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
this.span = Y.Node.create('<a class="d-inline-block col-form-label availability-delete p-x-1" href="#" title="' +
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
|
||||
Vendored
+22
-18
@@ -356,21 +356,25 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
// Create DIV structure (without kids).
|
||||
this.node = Y.Node.create('<div class="availability-list"><h3 class="accesshide"></h3>' +
|
||||
'<div class="availability-inner">' +
|
||||
'<div class="availability-header">' + M.util.get_string('listheader_sign_before', 'availability') +
|
||||
'<div class="availability-header"><span class="p-l-1">' +
|
||||
M.util.get_string('listheader_sign_before', 'availability') + '</span>' +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_sign', 'availability') +
|
||||
' </span><select class="availability-neg" title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
' </span><select class="availability-neg custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_sign', 'availability') + '">' +
|
||||
'<option value="">' + M.util.get_string('listheader_sign_pos', 'availability') + '</option>' +
|
||||
'<option value="!">' + M.util.get_string('listheader_sign_neg', 'availability') + '</option></select></label> ' +
|
||||
'<span class="availability-single">' + M.util.get_string('listheader_single', 'availability') + '</span>' +
|
||||
'<span class="availability-multi">' + M.util.get_string('listheader_multi_before', 'availability') +
|
||||
' <label><span class="accesshide">' + M.util.get_string('label_multi', 'availability') + ' </span>' +
|
||||
'<select class="availability-op" title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
'<select class="availability-op custom-select m-x-1"' +
|
||||
' title="' + M.util.get_string('label_multi', 'availability') + '"><option value="&">' +
|
||||
M.util.get_string('listheader_multi_and', 'availability') + '</option>' +
|
||||
'<option value="|">' + M.util.get_string('listheader_multi_or', 'availability') + '</option></select></label> ' +
|
||||
M.util.get_string('listheader_multi_after', 'availability') + '</span></div>' +
|
||||
'<div class="availability-children"></div>' +
|
||||
'<div class="availability-none">' + M.util.get_string('none', 'moodle') + '</div>' +
|
||||
'<div class="availability-button"></div></div></div>');
|
||||
'<div class="availability-none"><span class="p-x-1">' + M.util.get_string('none', 'moodle') + '</span></div>' +
|
||||
'<div class="clearfix m-t-1"></div>' +
|
||||
'<div class="availability-button"></div></div><div class="clearfix"></div></div>');
|
||||
if (!root) {
|
||||
this.node.addClass('availability-childlist');
|
||||
}
|
||||
@@ -404,12 +408,12 @@ M.core_availability.List = function(json, root, parentRoot) {
|
||||
noneNode.appendChild(deleteIcon.span);
|
||||
|
||||
// Also if it's not the root, none is actually invalid, so add a label.
|
||||
noneNode.appendChild(Y.Node.create('<span class="label label-warning">' +
|
||||
noneNode.appendChild(Y.Node.create('<span class="m-t-1 label label-warning">' +
|
||||
M.util.get_string('invalid', 'availability') + '</span>'));
|
||||
}
|
||||
|
||||
// Create the button and add it.
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
|
||||
var button = Y.Node.create('<button type="button" class="btn btn-default m-t-1">' +
|
||||
M.util.get_string('addrestriction', 'availability') + '</button>');
|
||||
button.on("click", function() {
|
||||
this.clickAdd();
|
||||
@@ -665,7 +669,7 @@ M.core_availability.List.prototype.deleteDescendant = function(descendant) {
|
||||
*/
|
||||
M.core_availability.List.prototype.clickAdd = function() {
|
||||
var content = Y.Node.create('<div>' +
|
||||
'<ul class="list-unstyled"></ul>' +
|
||||
'<ul class="list-unstyled container-fluid"></ul>' +
|
||||
'<div class="availability-buttons mdl-align">' +
|
||||
'<button type="button" class="btn btn-default">' + M.util.get_string('cancel', 'moodle') +
|
||||
'</button></div></div>');
|
||||
@@ -681,25 +685,25 @@ M.core_availability.List.prototype.clickAdd = function() {
|
||||
continue;
|
||||
}
|
||||
// Add entry for plugin.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_' + type;
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('title', 'availability_' + type) + '</button>');
|
||||
button.on('click', this.getAddHandler(type, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('description', 'availability_' + type) + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
// Extra entry for lists.
|
||||
li = Y.Node.create('<li class="clearfix"></li>');
|
||||
li = Y.Node.create('<li class="clearfix row"></li>');
|
||||
id = 'availability_addrestriction_list_';
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default"' +
|
||||
button = Y.Node.create('<button type="button" class="btn btn-default col-xs-6"' +
|
||||
'id="' + id + '">' + M.util.get_string('condition_group', 'availability') + '</button>');
|
||||
button.on('click', this.getAddHandler(null, dialogRef), this);
|
||||
li.appendChild(button);
|
||||
label = Y.Node.create('<label for="' + id + '">' +
|
||||
label = Y.Node.create('<label for="' + id + '" class="col-xs-6">' +
|
||||
M.util.get_string('condition_group_info', 'availability') + '</label>');
|
||||
li.appendChild(label);
|
||||
ul.appendChild(li);
|
||||
@@ -895,7 +899,7 @@ M.core_availability.Item = function(json, root) {
|
||||
this.pluginNode.addClass('availability_' + json.type);
|
||||
}
|
||||
|
||||
this.node = Y.Node.create('<div class="availability-item"><h3 class="accesshide"></h3></div>');
|
||||
this.node = Y.Node.create('<div class="availability-item d-inline-block"><h3 class="accesshide"></h3></div>');
|
||||
|
||||
// Add eye icon if required. This icon is added for root items, but may be
|
||||
// hidden depending on the selected list operator.
|
||||
@@ -918,7 +922,7 @@ M.core_availability.Item = function(json, root) {
|
||||
|
||||
// Add the invalid marker (empty).
|
||||
this.node.appendChild(document.createTextNode(' '));
|
||||
this.node.appendChild(Y.Node.create('<span class="label label-warning"/>'));
|
||||
this.node.appendChild(Y.Node.create('<span class="m-t-1 label label-warning"/>'));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1046,7 +1050,7 @@ M.core_availability.Item.prototype.pluginNode = null;
|
||||
*/
|
||||
M.core_availability.EyeIcon = function(individual, shown) {
|
||||
this.individual = individual;
|
||||
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
|
||||
this.span = Y.Node.create('<a class="availability-eye col-form-label" href="#" role="button">');
|
||||
var icon = Y.Node.create('<img />');
|
||||
this.span.appendChild(icon);
|
||||
|
||||
@@ -1126,7 +1130,7 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
|
||||
* @param {M.core_availability.Item|M.core_availability.List} toDelete Thing to delete
|
||||
*/
|
||||
M.core_availability.DeleteIcon = function(toDelete) {
|
||||
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
|
||||
this.span = Y.Node.create('<a class="d-inline-block col-form-label availability-delete p-x-1" href="#" title="' +
|
||||
M.util.get_string('delete', 'moodle') + '" role="button">');
|
||||
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
|
||||
'" alt="' + M.util.get_string('delete', 'moodle') + '" />');
|
||||
|
||||
+69
-16
@@ -290,7 +290,8 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$html .= $selectacategoryhtml;
|
||||
}
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
|
||||
$attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', $attrs));
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::end_tag('form');
|
||||
}
|
||||
@@ -306,7 +307,8 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
backup::TARGET_CURRENT_ADDING, array('checked' => 'checked'));
|
||||
$html .= $this->backup_detail_input(get_string('restoretocurrentcoursedeleting', 'backup'), 'radio', 'target',
|
||||
backup::TARGET_CURRENT_DELETING);
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
|
||||
$attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', $attrs));
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::end_tag('form');
|
||||
}
|
||||
@@ -340,7 +342,8 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$html .= $selectacoursehtml;
|
||||
}
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
|
||||
$attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', $attrs));
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::end_tag('form');
|
||||
}
|
||||
@@ -371,7 +374,8 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$html .= html_writer::start_tag('div', array('class' => 'ics-existing-course backup-section'));
|
||||
$html .= $this->output->heading(get_string('importdatafrom'), 2, array('class' => 'header'));
|
||||
$html .= $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
|
||||
$attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
|
||||
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', $attrs));
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::end_tag('form');
|
||||
$html .= html_writer::end_tag('div');
|
||||
@@ -470,9 +474,11 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
public function substage_buttons($haserrors) {
|
||||
$output = html_writer::start_tag('div', array('continuebutton'));
|
||||
if (!$haserrors) {
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue')));
|
||||
$attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
}
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'cancel', 'value' => get_string('cancel')));
|
||||
$attrs = array('type' => 'submit', 'name' => 'cancel', 'value' => get_string('cancel'), 'class' => 'btn btn-secondary');
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$output .= html_writer::end_tag('div');
|
||||
return $output;
|
||||
}
|
||||
@@ -601,7 +607,7 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
public function render_restore_course_search(restore_course_search $component) {
|
||||
$url = $component->get_url();
|
||||
|
||||
$output = html_writer::start_tag('div', array('class' => 'restore-course-search'));
|
||||
$output = html_writer::start_tag('div', array('class' => 'restore-course-search form-inline m-b-1'));
|
||||
$output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
|
||||
|
||||
$table = new html_table();
|
||||
@@ -641,8 +647,20 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'rcs-search'));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
|
||||
$attrs = array(
|
||||
'type' => 'text',
|
||||
'name' => restore_course_search::$VAR_SEARCH,
|
||||
'value' => $component->get_search(),
|
||||
'class' => 'form-control'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array(
|
||||
'type' => 'submit',
|
||||
'name' => 'searchcourses',
|
||||
'value' => get_string('search'),
|
||||
'class' => 'btn btn-secondary'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::end_tag('div');
|
||||
@@ -663,8 +681,20 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$output .= $this->output->notification(get_string('nomatchingcourses', 'backup'));
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'ics-search'));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
|
||||
$attrs = array(
|
||||
'type' => 'text',
|
||||
'name' => restore_course_search::$VAR_SEARCH,
|
||||
'value' => $component->get_search(),
|
||||
'class' => 'form-control'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array(
|
||||
'type' => 'submit',
|
||||
'name' => 'searchcourses',
|
||||
'value' => get_string('search'),
|
||||
'class' => 'btn btn-secondary'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::end_tag('div');
|
||||
@@ -709,8 +739,19 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'ics-search'));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
|
||||
$attrs = array(
|
||||
'type' => 'text',
|
||||
'name' => restore_course_search::$VAR_SEARCH,
|
||||
'value' => $component->get_search(),
|
||||
'class' => 'form-control');
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array(
|
||||
'type' => 'submit',
|
||||
'name' => 'searchcourses',
|
||||
'value' => get_string('search'),
|
||||
'class' => 'btn btn-secondary'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::end_tag('div');
|
||||
@@ -726,7 +767,7 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
public function render_restore_category_search(restore_category_search $component) {
|
||||
$url = $component->get_url();
|
||||
|
||||
$output = html_writer::start_tag('div', array('class' => 'restore-course-search'));
|
||||
$output = html_writer::start_tag('div', array('class' => 'restore-course-search form-inline m-b-1'));
|
||||
$output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
|
||||
|
||||
$table = new html_table();
|
||||
@@ -767,8 +808,20 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'rcs-search'));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_category_search::$VAR_SEARCH, 'value' => $component->get_search()));
|
||||
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
|
||||
$attrs = array(
|
||||
'type' => 'text',
|
||||
'name' => restore_category_search::$VAR_SEARCH,
|
||||
'value' => $component->get_search(),
|
||||
'class' => 'form-control'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$attrs = array(
|
||||
'type' => 'submit',
|
||||
'name' => 'searchcourses',
|
||||
'value' => get_string('search'),
|
||||
'class' => 'btn btn-secondary'
|
||||
);
|
||||
$output .= html_writer::empty_tag('input', $attrs);
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
@@ -216,7 +216,7 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Selecting the specified course (we can not call behat_forms::select_radio here as is in another behat subcontext).
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::div[@class='restore-course-search']" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::tr[contains(., $existingcourse)]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
@@ -247,7 +247,7 @@ class behat_backup extends behat_base {
|
||||
|
||||
// The first category in the list.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::div[@class='restore-course-search']" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
|
||||
|
||||
@@ -78,20 +78,26 @@ class block_login extends block_base {
|
||||
|
||||
$this->content->text .= "\n".'<form class="loginform" id="login" method="post" action="'.get_login_url().'" '.$autocomplete.'>';
|
||||
|
||||
$this->content->text .= '<div class="c1 fld username"><label for="login_username">'.$strusername.'</label>';
|
||||
$this->content->text .= '<input type="text" name="username" id="login_username" value="'.s($username).'" /></div>';
|
||||
$this->content->text .= '<div class="form-group"><label for="login_username">'.$strusername.'</label>';
|
||||
$this->content->text .= '<input type="text" name="username" id="login_username" class="form-control" value="'.s($username).'" /></div>';
|
||||
|
||||
$this->content->text .= '<div class="c1 fld password"><label for="login_password">'.get_string('password').'</label>';
|
||||
$this->content->text .= '<div class="form-group"><label for="login_password">'.get_string('password').'</label>';
|
||||
|
||||
$this->content->text .= '<input type="password" name="password" id="login_password" value="" '.$autocomplete.' /></div>';
|
||||
$this->content->text .= '<input type="password" name="password" id="login_password" class="form-control" value="" '.$autocomplete.' /></div>';
|
||||
|
||||
if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) {
|
||||
$checked = $username ? 'checked="checked"' : '';
|
||||
$this->content->text .= '<div class="c1 rememberusername"><input type="checkbox" name="rememberusername" id="rememberusername" value="1" '.$checked.'/>';
|
||||
$this->content->text .= ' <label for="rememberusername">'.get_string('rememberusername', 'admin').'</label></div>';
|
||||
$this->content->text .= '<div class="form-check">';
|
||||
$this->content->text .= '<label class="form-check-label">';
|
||||
$this->content->text .= '<input type="checkbox" name="rememberusername" id="rememberusername"
|
||||
class="form-check-input" value="1" '.$checked.'/> ';
|
||||
$this->content->text .= get_string('rememberusername', 'admin').'</label>';
|
||||
$this->content->text .= '</div>';
|
||||
}
|
||||
|
||||
$this->content->text .= '<div class="c1 btn"><input type="submit" value="'.get_string('login').'" /></div>';
|
||||
$this->content->text .= '<div class="form-group">';
|
||||
$this->content->text .= '<input type="submit" class="btn btn-primary btn-block" value="'.get_string('login').'" />';
|
||||
$this->content->text .= '</div>';
|
||||
|
||||
$this->content->text .= "</form>\n";
|
||||
|
||||
|
||||
+2
-2
@@ -211,7 +211,7 @@ function blog_rss_get_feed($context, $args) {
|
||||
if ($blogentries) {
|
||||
$items = array();
|
||||
foreach ($blogentries as $blogentry) {
|
||||
$item = null;
|
||||
$item = new stdClass();
|
||||
$item->author = fullname($DB->get_record('user', array('id' => $blogentry->userid))); // TODO: this is slow.
|
||||
$item->title = $blogentry->subject;
|
||||
$item->pubdate = $blogentry->lastmodified;
|
||||
@@ -234,7 +234,7 @@ function blog_rss_get_feed($context, $args) {
|
||||
|
||||
switch ($type) {
|
||||
case 'user':
|
||||
$info = fullname($DB->get_record('user', array('id' => $id), 'firstname,lastname'));
|
||||
$info = fullname($DB->get_record('user', array('id' => $id), get_all_user_name_fields(true)));
|
||||
break;
|
||||
case 'course':
|
||||
$info = $DB->get_field('course', 'fullname', array('id' => $id));
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ $string['prefix_help'] = 'This prefix is used for all key names on the Redis ser
|
||||
* If you only have one Moodle instance using this server, you can leave this value default.
|
||||
* Due to key length restrictions, a maximum of 5 characters is permitted.';
|
||||
$string['prefixinvalid'] = 'Invalid prefix. You can only use a-z A-Z 0-9-_.';
|
||||
$string['test_server'] = 'Test Server';
|
||||
$string['test_server'] = 'Test server';
|
||||
$string['test_server_desc'] = 'Redis server to use for testing.';
|
||||
$string['server'] = 'Server';
|
||||
$string['server_help'] = 'This sets the hostname or IP address of the Redis server to use.';
|
||||
@@ -51,7 +51,7 @@ class core_calendar_export_form extends moodleform {
|
||||
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventsrelatedtogroups', 'calendar'), 'groups');
|
||||
$export[] = $mform->createElement('radio', 'exportevents', '', get_string('eventspersonal', 'calendar'), 'user');
|
||||
|
||||
$mform->addGroup($export, 'events', get_string('export', 'calendar'), '<br/>');
|
||||
$mform->addGroup($export, 'events', get_string('eventstoexport', 'calendar'), '<br/>');
|
||||
$mform->addGroupRule('events', get_string('required'), 'required');
|
||||
$mform->setDefault('events', 'all');
|
||||
|
||||
@@ -79,7 +79,7 @@ class core_calendar_export_form extends moodleform {
|
||||
$range[] = $mform->createElement('radio', 'timeperiod', '', get_string('customexport', 'calendar', $a), 'custom');
|
||||
}
|
||||
|
||||
$mform->addGroup($range, 'period', get_string('for', 'calendar'), '<br/>');
|
||||
$mform->addGroup($range, 'period', get_string('timeperiod', 'calendar'), '<br/>');
|
||||
$mform->addGroupRule('period', get_string('required'), 'required');
|
||||
$mform->setDefault('period', 'recentupcoming');
|
||||
|
||||
@@ -88,4 +88,4 @@ class core_calendar_export_form extends moodleform {
|
||||
$buttons[] = $mform->createElement('submit', 'export', get_string('exportbutton', 'calendar'));
|
||||
$mform->addGroup($buttons);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "5.5.*",
|
||||
"phpunit/dbUnit": "1.4.*",
|
||||
"moodlehq/behat-extension": "3.32.3"
|
||||
"moodlehq/behat-extension": "3.32.4"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+83
-83
@@ -4,22 +4,22 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "ec5f1e9d8b8134cf6a4490ba5dfe0082",
|
||||
"content-hash": "583f9a915721de799118a396dc81f177",
|
||||
"hash": "6042e8e9600da0881e3f63b2e79ad742",
|
||||
"content-hash": "59c508468d7f10d1a16b4d24228e7eab",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "behat/behat",
|
||||
"version": "v3.2.1",
|
||||
"version": "v3.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Behat/Behat.git",
|
||||
"reference": "df7d9225e9ee37fdaa54273e3e0aecf2515bbe76"
|
||||
"reference": "30aa3836825416f28581ee55fcfe6a5b0cdeeb85"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Behat/Behat/zipball/df7d9225e9ee37fdaa54273e3e0aecf2515bbe76",
|
||||
"reference": "df7d9225e9ee37fdaa54273e3e0aecf2515bbe76",
|
||||
"url": "https://api.github.com/repos/Behat/Behat/zipball/30aa3836825416f28581ee55fcfe6a5b0cdeeb85",
|
||||
"reference": "30aa3836825416f28581ee55fcfe6a5b0cdeeb85",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -87,20 +87,20 @@
|
||||
"symfony",
|
||||
"testing"
|
||||
],
|
||||
"time": "2016-09-25 09:40:39"
|
||||
"time": "2016-11-05 17:13:53"
|
||||
},
|
||||
{
|
||||
"name": "behat/gherkin",
|
||||
"version": "v4.4.4",
|
||||
"version": "v4.4.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Behat/Gherkin.git",
|
||||
"reference": "cf8cc94647101e02a33d690245896d83d880aea1"
|
||||
"reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/cf8cc94647101e02a33d690245896d83d880aea1",
|
||||
"reference": "cf8cc94647101e02a33d690245896d83d880aea1",
|
||||
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
|
||||
"reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -146,7 +146,7 @@
|
||||
"gherkin",
|
||||
"parser"
|
||||
],
|
||||
"time": "2016-09-18 12:16:14"
|
||||
"time": "2016-10-30 11:50:56"
|
||||
},
|
||||
{
|
||||
"name": "behat/mink",
|
||||
@@ -582,16 +582,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.2.1",
|
||||
"version": "6.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "3f808fba627f2c5b69e2501217bf31af349c1427"
|
||||
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427",
|
||||
"reference": "3f808fba627f2c5b69e2501217bf31af349c1427",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
|
||||
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -640,7 +640,7 @@
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2016-07-15 17:22:37"
|
||||
"time": "2016-10-08 15:01:37"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@@ -811,16 +811,16 @@
|
||||
},
|
||||
{
|
||||
"name": "moodlehq/behat-extension",
|
||||
"version": "v3.32.3",
|
||||
"version": "v3.32.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/moodlehq/moodle-behat-extension.git",
|
||||
"reference": "8296916088e62f7cdf67b34abeebd419b301caff"
|
||||
"reference": "d363b92f62770acdd8cd878810777f3a61eada4d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/8296916088e62f7cdf67b34abeebd419b301caff",
|
||||
"reference": "8296916088e62f7cdf67b34abeebd419b301caff",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/d363b92f62770acdd8cd878810777f3a61eada4d",
|
||||
"reference": "d363b92f62770acdd8cd878810777f3a61eada4d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -856,20 +856,20 @@
|
||||
"Behat",
|
||||
"moodle"
|
||||
],
|
||||
"time": "2016-10-03 03:33:07"
|
||||
"time": "2016-11-10 23:36:48"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.5.4",
|
||||
"version": "1.5.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f"
|
||||
"reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
|
||||
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108",
|
||||
"reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -898,7 +898,7 @@
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"time": "2016-09-16 13:37:59"
|
||||
"time": "2016-10-31 17:19:45"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
@@ -1169,16 +1169,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "4.0.1",
|
||||
"version": "4.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3"
|
||||
"reference": "6cba06ff75a1a63a71033e1a01b89056f3af1e8d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3",
|
||||
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6cba06ff75a1a63a71033e1a01b89056f3af1e8d",
|
||||
"reference": "6cba06ff75a1a63a71033e1a01b89056f3af1e8d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1228,7 +1228,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2016-07-26 14:39:29"
|
||||
"time": "2016-11-01 05:06:24"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -1496,16 +1496,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "3.3.1",
|
||||
"version": "3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "03500345483e1e17b52e2e4d34a89c9408ab2902"
|
||||
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/03500345483e1e17b52e2e4d34a89c9408ab2902",
|
||||
"reference": "03500345483e1e17b52e2e4d34a89c9408ab2902",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
|
||||
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1551,7 +1551,7 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2016-10-04 11:03:26"
|
||||
"time": "2016-10-09 07:01:45"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
@@ -1605,16 +1605,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "5277094ed527a1c4477177d102fe4c53551953e0"
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/5277094ed527a1c4477177d102fe4c53551953e0",
|
||||
"reference": "5277094ed527a1c4477177d102fe4c53551953e0",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1648,7 +1648,7 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-09-19 16:02:08"
|
||||
"time": "2016-10-10 12:19:37"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
@@ -2165,7 +2165,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
@@ -2222,7 +2222,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/class-loader",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/class-loader.git",
|
||||
@@ -2278,7 +2278,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/config.git",
|
||||
@@ -2331,16 +2331,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0"
|
||||
"reference": "c99da1119ae61e15de0e4829196b9fba6f73d065"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/6cb0872fb57b38b3b09ff213c21ed693956b9eb0",
|
||||
"reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065",
|
||||
"reference": "c99da1119ae61e15de0e4829196b9fba6f73d065",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2388,11 +2388,11 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-09-28 00:11:12"
|
||||
"time": "2016-10-06 01:44:51"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
@@ -2445,7 +2445,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
@@ -2502,16 +2502,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/dependency-injection",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dependency-injection.git",
|
||||
"reference": "8fa4be9a36f41e49b0c3969678c41c81ed463816"
|
||||
"reference": "c578891216090069cd6d2e573402e13e39b3ad5c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8fa4be9a36f41e49b0c3969678c41c81ed463816",
|
||||
"reference": "8fa4be9a36f41e49b0c3969678c41c81ed463816",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c578891216090069cd6d2e573402e13e39b3ad5c",
|
||||
"reference": "c578891216090069cd6d2e573402e13e39b3ad5c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2558,20 +2558,20 @@
|
||||
],
|
||||
"description": "Symfony DependencyInjection Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-09-24 15:56:48"
|
||||
"time": "2016-10-24 15:52:44"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "bb7395e8b1db3654de82b9f35d019958276de4d7"
|
||||
"reference": "59eee3c76eb89f21857798620ebdad7a05ad14f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/bb7395e8b1db3654de82b9f35d019958276de4d7",
|
||||
"reference": "bb7395e8b1db3654de82b9f35d019958276de4d7",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/59eee3c76eb89f21857798620ebdad7a05ad14f4",
|
||||
"reference": "59eee3c76eb89f21857798620ebdad7a05ad14f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2614,20 +2614,20 @@
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-08-05 08:37:39"
|
||||
"time": "2016-10-18 15:46:07"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5"
|
||||
"reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
|
||||
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/28b0832b2553ffb80cabef6a7a812ff1e670c0bc",
|
||||
"reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2674,20 +2674,20 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-07-19 10:45:57"
|
||||
"time": "2016-10-13 06:28:43"
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "682fd8fdb3135fdf05fc496a01579ccf6c85c0e5"
|
||||
"reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/682fd8fdb3135fdf05fc496a01579ccf6c85c0e5",
|
||||
"reference": "682fd8fdb3135fdf05fc496a01579ccf6c85c0e5",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/0565b61bf098cb4dc09f4f103f033138ae4f42c6",
|
||||
"reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2723,7 +2723,7 @@
|
||||
],
|
||||
"description": "Symfony Filesystem Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-09-14 00:18:46"
|
||||
"time": "2016-10-18 04:30:12"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
@@ -2786,7 +2786,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v2.8.12",
|
||||
"version": "v2.8.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
@@ -2835,16 +2835,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "93013a18d272e59dab8e67f583155b78c68947eb"
|
||||
"reference": "ff1285087397d2f64041b35e591f3025881c90cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/93013a18d272e59dab8e67f583155b78c68947eb",
|
||||
"reference": "93013a18d272e59dab8e67f583155b78c68947eb",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/ff1285087397d2f64041b35e591f3025881c90cd",
|
||||
"reference": "ff1285087397d2f64041b35e591f3025881c90cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2895,20 +2895,20 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-09-06 11:02:40"
|
||||
"time": "2016-10-18 04:30:12"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v3.1.5",
|
||||
"version": "v3.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3"
|
||||
"reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3",
|
||||
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27",
|
||||
"reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2944,7 +2944,7 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-09-25 08:27:07"
|
||||
"time": "2016-10-24 18:41:13"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
|
||||
@@ -160,6 +160,7 @@ class core_course_external extends external_api {
|
||||
//retrieve sections
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$sections = $modinfo->get_section_info_all();
|
||||
$coursenumsections = course_get_format($course)->get_course()->numsections;
|
||||
|
||||
//for each sections (first displayed to last displayed)
|
||||
$modinfosections = $modinfo->get_sections();
|
||||
@@ -201,6 +202,7 @@ class core_course_external extends external_api {
|
||||
external_format_text($section->summary, $section->summaryformat,
|
||||
$context->id, 'course', 'section', $section->id, $options);
|
||||
$sectionvalues['section'] = $section->section;
|
||||
$sectionvalues['hiddenbynumsections'] = $section->section > $coursenumsections ? 1 : 0;
|
||||
$sectioncontents = array();
|
||||
|
||||
//for each module of the section
|
||||
@@ -329,6 +331,8 @@ class core_course_external extends external_api {
|
||||
'summary' => new external_value(PARAM_RAW, 'Section description'),
|
||||
'summaryformat' => new external_format_value('summary'),
|
||||
'section' => new external_value(PARAM_INT, 'Section number inside the course', VALUE_OPTIONAL),
|
||||
'hiddenbynumsections' => new external_value(PARAM_INT, 'Whether is a section hidden in the course format',
|
||||
VALUE_OPTIONAL),
|
||||
'modules' => new external_multiple_structure(
|
||||
new external_single_structure(
|
||||
array(
|
||||
|
||||
@@ -2337,6 +2337,7 @@ function create_course($data, $editoroptions = NULL) {
|
||||
'other' => array('shortname' => $course->shortname,
|
||||
'fullname' => $course->fullname)
|
||||
));
|
||||
|
||||
$event->trigger();
|
||||
|
||||
// Setup the blocks
|
||||
@@ -3606,6 +3607,7 @@ function course_get_tagged_course_modules($tag, $exclusivemode = false, $fromcon
|
||||
JOIN {course} c ON cm.course = c.id
|
||||
JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :coursemodulecontextlevel
|
||||
WHERE tt.itemtype = :itemtype AND tt.tagid = :tagid AND tt.component = :component
|
||||
AND cm.deletioninprogress = 0
|
||||
AND c.id %COURSEFILTER% AND cm.id %ITEMFILTER%";
|
||||
|
||||
$params = array('itemtype' => 'course_modules', 'tagid' => $tag->id, 'component' => 'core',
|
||||
|
||||
@@ -348,3 +348,20 @@ Feature: Test category management actions
|
||||
| Category ID number | CAT1 |
|
||||
When I press "Create category"
|
||||
Then I should see "ID number is already used for another category"
|
||||
|
||||
Scenario: Test that is possible to remove an idnumber from a course category
|
||||
Given the following "categories" exist:
|
||||
| name | category | idnumber |
|
||||
| Cat 1 | 0 | CAT1 |
|
||||
| Cat 2 | 0 ||
|
||||
And I log in as "admin"
|
||||
And I go to the courses management page
|
||||
And I should see "CAT1" in the "#category-listing" "css_element"
|
||||
When I click on "edit" action for "Cat 1" in management category listing
|
||||
And I set the following fields to these values:
|
||||
| Category name | Category 1 (edited) |
|
||||
| Category ID number ||
|
||||
And I press "Save changes"
|
||||
# Redirect
|
||||
Then I should see "Category 1 (edited)" in the "#category-listing" "css_element"
|
||||
And I should not see "CAT1" in the "#course-listing" "css_element"
|
||||
|
||||
@@ -4,6 +4,7 @@ information provided here is intended especially for developers.
|
||||
=== 3.2 ===
|
||||
|
||||
* External function core_course_external::get_course_contents now returns the section's number in the course (new section field).
|
||||
* External function core_course_external::get_course_contents now returns if a section is hidden in the course format.
|
||||
* External functions that were returning file information now return the following file fields:
|
||||
filename, filepath, mimetype, filesize, timemodified and fileurl.
|
||||
Those fields are now marked as VALUE_OPTIONAL for backwards compatibility.
|
||||
|
||||
@@ -37,12 +37,7 @@ Structure of the user enroller panel
|
||||
|
||||
.user-enroller-panel {
|
||||
width: 400px;
|
||||
background-color: #666;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
border: 1px solid #666;
|
||||
border-width: 0 5px 5px 0;
|
||||
}
|
||||
|
||||
.user-enroller-panel.hidden {
|
||||
@@ -50,57 +45,22 @@ Structure of the user enroller panel
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-wrap {
|
||||
margin-top: -5px;
|
||||
margin-left: -5px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #999;
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-header {
|
||||
background-color: #eee;
|
||||
padding: 1px;
|
||||
.user-enroller-panel .uep-search-results .user .count {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-header h2 {
|
||||
margin: 3px 1em 0.5em 1em;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-header .close {
|
||||
width: 25px;
|
||||
height: 15px;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 1em;
|
||||
cursor: pointer;
|
||||
background: url("sprite.png") no-repeat scroll 0 0 transparent;
|
||||
.user-enroller-panel .uep-search-results .cohort .count {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-content {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border-top: 1px solid #999;
|
||||
border-bottom: 1px solid #999;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-content .uep-controls {
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
background-color: #ddd;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-content .uep-controls label {
|
||||
display: inline;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-content .uep-controls .uep-enrolment-option input {
|
||||
vertical-align: middle;
|
||||
margin-left: 1em;
|
||||
box-sizing: border-box;
|
||||
max-height: 1000px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-ajax-content {
|
||||
@@ -108,39 +68,6 @@ Structure of the user enroller panel
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .totalusers {
|
||||
background-color: #eee;
|
||||
padding: 5px;
|
||||
border-bottom: 1px solid #bbb;
|
||||
font-size: 7pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 9pt;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user.odd {
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #eee;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user .count {
|
||||
width: 20px;
|
||||
float: left;
|
||||
font-size: 7pt;
|
||||
line-height: 41px;
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #eee;
|
||||
text-align: right;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user .picture {
|
||||
width: 45px;
|
||||
float: left;
|
||||
@@ -148,14 +75,13 @@ Structure of the user enroller panel
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user .details {
|
||||
width: 250px;
|
||||
width: 180px;
|
||||
float: left;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user .options {
|
||||
padding-right: 7px;
|
||||
font-size: 8pt;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
@@ -165,56 +91,21 @@ Structure of the user enroller panel
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .user.enrolled .count {
|
||||
width: 40px;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .uep-more-results {
|
||||
background-color: #eee;
|
||||
padding: 5px;
|
||||
border-top: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .totalcohorts {
|
||||
background-color: #eee;
|
||||
padding: 5px;
|
||||
border-bottom: 1px solid #bbb;
|
||||
font-size: 7pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 9pt;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort .count {
|
||||
width: 20px;
|
||||
float: left;
|
||||
font-size: 7pt;
|
||||
line-height: 27px;
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #eee;
|
||||
text-align: right;
|
||||
padding: 2px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort .details {
|
||||
width: 250px;
|
||||
width: 180px;
|
||||
float: left;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort .options {
|
||||
padding-right: 7px;
|
||||
font-size: 8pt;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort .options .enrol {
|
||||
margin: 3px;
|
||||
float: right;
|
||||
@@ -223,16 +114,15 @@ Structure of the user enroller panel
|
||||
|
||||
.user-enroller-panel .uep-search-results .cohort.enrolled .count {
|
||||
width: 40px;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-loading-lightbox {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ddd;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
min-width: 50px;
|
||||
min-height: 50px;
|
||||
}
|
||||
@@ -245,12 +135,11 @@ Structure of the user enroller panel
|
||||
margin: auto;
|
||||
vertical-align: middle;
|
||||
margin-top: 125px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-footer {
|
||||
padding: 3px;
|
||||
background-color: #ddd;
|
||||
text-align: center;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search {
|
||||
@@ -263,7 +152,6 @@ Structure of the user enroller panel
|
||||
|
||||
.user-enroller-panel .uep-search input {
|
||||
width: 50%;
|
||||
margin: 0 0 10px 5px;
|
||||
}
|
||||
|
||||
.user-enroller-panel .uep-search input.uep-search-btn {
|
||||
@@ -285,8 +173,8 @@ Structure of the user enroller panel
|
||||
}
|
||||
|
||||
.user-enroller-panel .collapsiblearea {
|
||||
border: 1px solid #bbb;
|
||||
background-color: #f6f6f6;
|
||||
border: 1px solid #ddd;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.user-enroller-panel .collapsiblearea.hidden {
|
||||
|
||||
+22
-22
@@ -32,7 +32,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
/** CSS classes for nodes in structure **/
|
||||
var CSS = {
|
||||
PANEL : 'user-enroller-panel',
|
||||
WRAP : 'uep-wrap',
|
||||
WRAP : 'uep-wrap modal-dialog',
|
||||
HEADER : 'uep-header',
|
||||
CONTENT : 'uep-content',
|
||||
AJAXCONTENT : 'uep-ajax-content',
|
||||
@@ -90,33 +90,33 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
if (this.get(UEP.DISABLEGRADEHISTORY) != true) {
|
||||
recovergrades = create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.RECOVERGRADES+'"></div>')
|
||||
.append(create('<label class="'+CSS.RECOVERGRADESTITLE+'" for="'+CSS.RECOVERGRADES+'">'+M.util.get_string('recovergrades', 'enrol')+'</label>'))
|
||||
.append(create('<input type="checkbox" id="'+CSS.RECOVERGRADES+'" name="'+CSS.RECOVERGRADES+'"'+ this.get(UEP.RECOVERGRADESDEFAULT) +' />'))
|
||||
.append(create('<input type="checkbox" class="m-x-1" id="'+CSS.RECOVERGRADES+'" name="'+CSS.RECOVERGRADES+'"'+ this.get(UEP.RECOVERGRADESDEFAULT) +' />'))
|
||||
}
|
||||
|
||||
this.set(UEP.BASE, create('<div class="'+CSS.PANEL+' '+CSS.HIDDEN+'"></div>')
|
||||
.append(create('<div class="'+CSS.WRAP+'"></div>')
|
||||
.append(create('<div class="'+CSS.HEADER+' header"></div>')
|
||||
.append(create('<div class="'+CSS.CLOSE+'"></div>'))
|
||||
.append(create('<h2>'+M.util.get_string('enrolusers', 'enrol')+'</h2>')))
|
||||
.append(create('<div class="'+CSS.CONTENT+'"></div>')
|
||||
.append(create('<div class="'+CSS.SEARCHCONTROLS+'"></div>')
|
||||
.append(create('<div class="'+CSS.WRAP+' modal show modal-dialog modal-content"></div>')
|
||||
.append(create('<div class="'+CSS.HEADER+' header modal-header"></div>')
|
||||
.append(create('<div class="'+CSS.CLOSE+'">×</div>'))
|
||||
.append(create('<h2 class="modal-title">'+M.util.get_string('enrolusers', 'enrol')+'</h2>')))
|
||||
.append(create('<div class="'+CSS.CONTENT+' modal-body"></div>')
|
||||
.append(create('<div class="'+CSS.SEARCHCONTROLS+' form-inline"></div>')
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'"><label for="id_enrol_manual_assignable_roles">'+M.util.get_string('assignroles', 'role')+'</label></div>')
|
||||
.append(create('<select id="id_enrol_manual_assignable_roles"><option value="">'+M.util.get_string('none', 'enrol')+'</option></select>'))
|
||||
.append(create('<select id="id_enrol_manual_assignable_roles" class="custom-select"><option value="">'+M.util.get_string('none', 'enrol')+'</option></select>'))
|
||||
)
|
||||
.append(create('<div class="'+CSS.ENTITYSELECTOR+'"></div>'))
|
||||
.append(create('<div class="'+CSS.ENTITYSELECTOR+' m-y-1"></div>'))
|
||||
.append(create('<div class="'+CSS.SEARCHOPTIONS+'"></div>')
|
||||
.append(create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.util.get_string('enrolmentoptions', 'enrol')+'</div>'))
|
||||
.append(create('<div class="'+CSS.COLLAPSIBLEAREA+' '+CSS.HIDDEN+'"></div>')
|
||||
.append(recovergrades)
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.STARTDATE+'">'+M.util.get_string('startingfrom', 'moodle')+'</div>')
|
||||
.append(create('<select></select>')))
|
||||
.append(create('<select class="custom-select"></select>')))
|
||||
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.DURATION+'">'+M.util.get_string('enrolperiod', 'enrol')+'</div>')
|
||||
.append(create('<select><option value="0" selected="selected">'+M.util.get_string('unlimitedduration', 'enrol')+'</option></select>')))
|
||||
.append(create('<select class="custom-select"><option value="0" selected="selected">'+M.util.get_string('unlimitedduration', 'enrol')+'</option></select>')))
|
||||
)
|
||||
)
|
||||
.append(create('<div class="'+CSS.SEARCH+'"><label for="enrolusersearch" class="accesshide">'+M.util.get_string('usersearch', 'enrol')+'</label></div>')
|
||||
.append(create('<input type="text" id="enrolusersearch" value="" />'))
|
||||
.append(create('<input type="button" id="searchbtn" class="'+CSS.SEARCHBTN+'" value="'+M.util.get_string('usersearch', 'enrol')+'" />'))
|
||||
.append(create('<input class="form-control" type="text" id="enrolusersearch" value="" />'))
|
||||
.append(create('<input type="button" id="searchbtn" class="'+CSS.SEARCHBTN+' btn btn-secondary m-l-1" value="'+M.util.get_string('usersearch', 'enrol')+'" />'))
|
||||
)
|
||||
)
|
||||
.append(create('<div class="'+CSS.AJAXCONTENT+'"></div>'))
|
||||
@@ -124,9 +124,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.append(create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
|
||||
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
|
||||
.setStyle('opacity', 0.5)))
|
||||
.append(create('<div class="'+CSS.FOOTER+'"></div>')
|
||||
.append(create('<div class="'+CSS.FOOTER+' modal-footer"></div>')
|
||||
.append(create('<div class="'+CSS.CLOSEBTN+'"></div>')
|
||||
.append(create('<input type="button" value="'+M.util.get_string('finishenrollingusers', 'enrol')+'" />'))
|
||||
.append(create('<input type="button" class="btn btn-primary" value="'+M.util.get_string('finishenrollingusers', 'enrol')+'" />'))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -151,9 +151,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
|
||||
if (this.get(UEP.COHORTSAVAILABLE)) {
|
||||
this.get(UEP.BASE).one('.'+CSS.ENTITYSELECTOR)
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_users" name="enrol_manual_entity" value="users" checked="checked"/>'))
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_users" name="enrol_manual_entity" value="users" class="m-r-1" checked="checked"/>'))
|
||||
.append(create('<label for="id_enrol_manual_entity_users">'+ M.util.get_string('browseusers', 'enrol_manual')+'</label>'))
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_cohorts" name="enrol_manual_entity" value="cohorts"/>'))
|
||||
.append(create('<input type="radio" id="id_enrol_manual_entity_cohorts" name="enrol_manual_entity" class="m-x-1" value="cohorts"/>'))
|
||||
.append(create('<label for="id_enrol_manual_entity_cohorts">'+M.util.get_string('browsecohorts', 'enrol_manual')+'</label>'));
|
||||
this.get(UEP.BASE).one('#id_enrol_manual_entity_cohorts').on('change', this.search, this);
|
||||
this.get(UEP.BASE).one('#id_enrol_manual_entity_users').on('change', this.search, this);
|
||||
@@ -397,7 +397,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
}
|
||||
var users;
|
||||
if (!args.append) {
|
||||
users = create('<div class="'+CSS.USERS+'"></div>');
|
||||
users = create('<div class="'+CSS.USERS+' list-group"></div>');
|
||||
} else {
|
||||
users = this.get(UEP.BASE).one('.'+CSS.SEARCHRESULTS+' .'+CSS.USERS);
|
||||
}
|
||||
@@ -405,7 +405,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
for (var i in result.response.users) {
|
||||
count++;
|
||||
var user = result.response.users[i];
|
||||
users.append(create('<div class="'+CSS.USER+' clearfix" rel="'+user.id+'"></div>')
|
||||
users.append(create('<div class="'+CSS.USER+' clearfix list-group-item list-group-item-action" rel="'+user.id+'"></div>')
|
||||
.addClass((count%2)?CSS.ODD:CSS.EVEN)
|
||||
.append(create('<div class="'+CSS.COUNT+'">'+count+'</div>'))
|
||||
.append(create('<div class="'+CSS.PICTURE+'"></div>')
|
||||
@@ -414,7 +414,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.append(create('<div class="'+CSS.FULLNAME+'">'+user.fullname+'</div>'))
|
||||
.append(create('<div class="'+CSS.EXTRAFIELDS+'">'+user.extrafields+'</div>')))
|
||||
.append(create('<div class="'+CSS.OPTIONS+'"></div>')
|
||||
.append(create('<input type="button" class="'+CSS.ENROL+'" value="'+M.util.get_string('enrol', 'enrol')+'" />')))
|
||||
.append(create('<input type="button" class="'+CSS.ENROL+' btn btn-secondary" value="'+M.util.get_string('enrol', 'enrol')+'" />')))
|
||||
);
|
||||
}
|
||||
this.set(UEP.USERCOUNT, count);
|
||||
@@ -464,7 +464,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
.append(create('<div class="'+CSS.DETAILS+'"></div>')
|
||||
.append(create('<div class="'+CSS.COHORTNAME+'">'+cohort.name+'</div>')))
|
||||
.append(create('<div class="'+CSS.OPTIONS+'"></div>')
|
||||
.append(create('<input type="button" class="' + CSS.ENROL + '" value="' + M.util.get_string('enrolxusers', 'enrol', cohort.cnt) + '" />')))
|
||||
.append(create('<input type="button" class="' + CSS.ENROL + ' btn btn-secondary" value="' + M.util.get_string('enrolxusers', 'enrol', cohort.cnt) + '" />')))
|
||||
);
|
||||
}
|
||||
this.set(UEP.COHORTCOUNT, count);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user