Compare commits

...

452 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 0fbe41f4cd Moodle release 3.2rc2 2016-11-22 16:22:21 +01:00
Dan Poltawski e122972d3f Merge branch 'MDL-56938-master-fix1' of http://github.com/damyon/moodle 2016-11-22 10:26:52 +00:00
Damyon Wiese 57bfb7c30a MDL-56938 filter_media: Responsive size fallback player
Apply responsive sizing to any video element in a media filter div.

This applys to the HTML5 video player and the fall back player if
video.js fails to load.
2016-11-22 17:04:55 +08:00
John Okely 529e944a8c MDL-56782 custommenu add multilang example 2016-11-22 15:12:55 +08:00
Andrew Nicols 8d294e729f Merge branch 'MDL-57035-master' of git://github.com/FMCorz/moodle 2016-11-22 12:02:45 +08:00
David Monllao 82f9746962 Merge branch 'MDL-56782-master' of git://github.com/damyon/moodle 2016-11-22 11:46:13 +08:00
Frederic Massart cbca970ab7 MDL-57035 repository_skydrive: Compability with converged type apps
http://go.microsoft.com/fwlink/p/?LinkID=615760
2016-11-22 11:46:05 +08:00
Andrew Nicols 282f0437f1 Merge branch 'wip-mdl-56898-fixup' of https://github.com/rajeshtaneja/moodle 2016-11-22 11:33:25 +08:00
Andrew Nicols 873a7e1e86 Merge branch 'MDL-56683-master' of git://github.com/damyon/moodle 2016-11-22 11:27:28 +08:00
Andrew Nicols 38a8590ed0 Merge branch 'wip-mdl-56994' of https://github.com/rajeshtaneja/moodle 2016-11-22 11:22:30 +08:00
Rajesh Taneja 45e862c4bd MDL-56898 behat: Wait for pending JS after setting password 2016-11-22 11:20:30 +08:00
Andrew Nicols d51d8ca2af Merge branch 'MDL-55838-master' of git://github.com/damyon/moodle 2016-11-22 11:17:33 +08:00
Rajesh Taneja f4565e7147 MDL-56994 behat: Fixed activity selector to find proper li
Previous to this patch, only 1 activity was
expected and if there are more than 1 activities
then it will fail. Improved step to find the
correct activity node by name
2016-11-22 11:02:52 +08:00
Damyon Wiese 52a51514f6 MDL-56683 theme_boost: Popovers on dynamic content 2016-11-22 10:28:25 +08:00
David Monllao 42cf4a3470 Merge branch 'MDL-57023-master' of git://github.com/andrewnicols/moodle 2016-11-22 10:23:21 +08:00
Damyon Wiese 5d03ab36b5 MDL-55838 theme_boost: Fix secure layout
It was out of date with the columns2 layout and had links outside it's content.
2016-11-22 10:22:17 +08:00
Andrew Nicols 727145bf1c MDL-56407 message: Additional unit test for unblocked user 2016-11-22 09:45:52 +08:00
Andrew Nicols d10ca75b8c Merge branch 'MDL-56407-master-2' of git://github.com/junpataleta/moodle 2016-11-22 09:06:09 +08:00
Andrew Nicols aacdf8e280 MDL-57023 tool_usertours: Ensure that the tour key is unique
The tour key was already unique, but this change makes it unique to the
current user too.
2016-11-22 09:05:31 +08:00
Andrew Nicols aabebc7516 MDL-57023 tool_usertours: Update to v0.9.10
This new version of the library brings with it storage of the current
step number in the browser session storage.

This allows the page to reload whilst viewing a tour and have the tour
continue.
2016-11-22 09:05:31 +08:00
David Monllao 5009bcd9b4 Merge branch 'MDL-56986-master-fix' of https://github.com/lameze/moodle 2016-11-22 09:04:26 +08:00
Andrew Nicols 4b2790c580 Merge branch 'MDL-56809-master' of git://github.com/ankitagarwal/moodle 2016-11-22 08:49:18 +08:00
Simey Lameze 5e43ccd3b9 MDL-56986 block_course_summary: remove edit icon scenario from behat 2016-11-22 08:39:35 +08:00
Andrew Nicols 783ef76bfc Merge branch 'MDL-56716-master' of git://github.com/damyon/moodle 2016-11-22 08:10:11 +08:00
Dan Poltawski 4b631c2d87 Merge branch 'wip-mdl-56898-fix2' of https://github.com/rajeshtaneja/moodle 2016-11-21 15:07:49 +00:00
Damyon Wiese 7e81bd114e MDL-56782 custommenu - update docs
We don't support sub-menus in all themes (boost) so we want to update
the docs and example.
2016-11-21 21:17:43 +08:00
Dan Poltawski 9446cb507c Merge branch 'MDL-56318-master' of git://github.com/damyon/moodle 2016-11-21 09:55:09 +00:00
Damyon Wiese 21a5c3c447 MDL-56318 assign: Polish for assign grading in boost
These styles mostly remove the responsiveness from the grading form.
2016-11-21 16:59:39 +08:00
David Monllao 9557be1542 Merge branch 'MDL-57063-master' of git://github.com/FMCorz/moodle 2016-11-21 16:53:44 +08:00
Dan Poltawski 05551a935a Merge branch 'MDL-56849-master' of git://github.com/damyon/moodle 2016-11-21 08:36:27 +00:00
Dan Poltawski f7d76254fd Merge branch 'MDL-56994-master-2' of git://github.com/junpataleta/moodle 2016-11-21 07:30:58 +00:00
Damyon Wiese 28f2458448 MDL-56849 mod_wiki: Update styles for boost
Make sure all form field have bootstrap styles. Use bootstrap tables on
tables. Remove custom styling. Prefer left-aligned text.
2016-11-21 15:19:16 +08:00
Damyon Wiese e283c6ca33 MDL-56716 boost: Fix styling for review options
The checkbox form template was changed, so this custom rule needs
updating.
2016-11-21 15:08:41 +08:00
Rajesh Taneja 26fef01b6b MDL-56898 behat: Go to a non html page to avoid any unwanted ajax calls
After scenario is finished, go to README.txt, so
there is no JS/AJAX calls pending and site is ready
for reset before next scenario
2016-11-21 14:16:49 +08:00
Rajesh Taneja d9a9a87835 MDL-56898 behat: Ensure the page is stable before executing 2016-11-21 14:16:48 +08:00
David Monllao e0ba33697f Merge branch 'MDL-56938-master' of git://github.com/damyon/moodle 2016-11-21 14:09:43 +08:00
Ankit Agarwal f318b74b49 MDL-56809 boost: Don't escape html in single select options 2016-11-21 11:38:51 +05:30
Ankit Agarwal 63531fff79 MDL-56809 boost: Add template context info 2016-11-21 11:38:51 +05:30
Andrew Nicols 51e8968635 Merge branch 'MDL-56612_master' of git://github.com/dmonllao/moodle 2016-11-21 13:40:00 +08:00
Andrew Nicols e67c14053e Merge branch 'MDL-56974-master' of git://github.com/jleyva/moodle 2016-11-21 13:21:27 +08:00
David Monllao 30f023b1b3 Merge branch 'MDL-56975-master' of git://github.com/jleyva/moodle 2016-11-21 13:15:40 +08:00
Damyon Wiese fce0f1c235 MDL-56938 messages: Images and videos display badly in messaging
Make sure they get minimum and maximum width so they don't overflow and
don't appear tiny.
2016-11-21 13:01:36 +08:00
David Monllao 57c01bca0e MDL-56612 navigation: Remove redundant load_courses_enrolled call 2016-11-21 12:42:09 +08:00
David Monllao 7d432be4e9 Merge branch 'MDL-57017-master' of git://github.com/andrewnicols/moodle 2016-11-21 12:40:26 +08:00
Andrew Nicols 2380daba7b Merge branch 'MDL-57054-master' of git://github.com/jleyva/moodle 2016-11-21 12:38:05 +08:00
David Monllao 2f5208ea1b Merge branch 'MDL-57049-master' of https://github.com/snake/moodle 2016-11-21 11:49:59 +08:00
Andrew Nicols 1e9487092d Merge branch 'MDL-56877' of https://github.com/eSrem/moodle 2016-11-21 11:08:01 +08:00
Frederic Massart 3d3fb328b4 MDL-57063 backup: Do not try to set default value on locked setting
We cannot set a default value on settings which are 'config' or
'permission' locked or an exception will be thrown from
base_setting::set_value.
2016-11-21 11:03:41 +08:00
Andrew Nicols 23bb1871b3 Merge branch 'MDL-55275' of https://github.com/tobiasreischmann/moodle 2016-11-21 11:01:40 +08:00
Andrew Nicols 896718ef79 Merge branch 'MDL-56943-master' of git://github.com/danpoltawski/moodle 2016-11-21 10:54:09 +08:00
David Monllao dfe7cbe4cf Merge branch 'MDL-57036_master' of git://github.com/markn86/moodle 2016-11-21 10:51:29 +08:00
Jun Pataleta 25bfa25190 MDL-56994 mod_forum: Auto-create news forum if course format supports it 2016-11-21 10:05:05 +08:00
Jun Pataleta e47d61e198 MDL-56994 course: Show News field only if course format supports news 2016-11-21 10:05:01 +08:00
Jun Pataleta 87799e9fba MDL-56994 course: New method to check if format supports news forum 2016-11-21 09:50:55 +08:00
David Monllao 30cfed3731 Merge branch 'MDL-57052-master' of git://github.com/jleyva/moodle 2016-11-21 09:47:51 +08:00
David Monllao 406f1eb76d Merge branch 'MDL-57051-master' of git://github.com/jleyva/moodle 2016-11-21 09:45:44 +08:00
Rajesh Taneja 7f24e5e654 MDL-56898 behat: Click on logout link in footer, it's faster 2016-11-21 09:25:35 +08:00
Rajesh Taneja 65eb39c0b4 MDL-56898 behat: Increase autosavefrequency for behat tests
We don't need editor to autosave, as this cause
unwanted ajax request
2016-11-21 09:25:35 +08:00
Rajesh Taneja 1bce723292 MDL-56898 behat: Try data reset if it fails because of pending process 2016-11-21 09:25:35 +08:00
David Monllao f48cc821db Merge branch 'MDL-56972-master' of https://github.com/snake/moodle 2016-11-21 09:05:40 +08:00
Jake Dallimore 0a5cafcbe9 MDL-57049 libraries: update jqueryui version in requirejs path 2016-11-21 08:57:53 +08:00
Andrew Nicols 5084343b3f Merge branch 'MDL-42977-master' of git://github.com/lameze/moodle 2016-11-21 08:52:42 +08:00
David Monllao a4abacc9a6 Merge branch 'MDL-56986-master' of git://github.com/lameze/moodle 2016-11-21 08:51:47 +08:00
David Monllao ff687b9c15 Merge branch 'MDL-56843-master' of git://github.com/lameze/moodle 2016-11-21 08:48:22 +08:00
Andrew Nicols b0db945b11 Merge branch 'MDL-57002-master' of git://github.com/FMCorz/moodle 2016-11-21 08:21:31 +08:00
Juan Leyva d0da94cdf4 MDL-56974 auth_email: Incorrect param type for redirect in sign_up WS 2016-11-19 18:21:56 +00:00
Juan Leyva 02bb0c0637 MDL-56975 tool_mobile: Fix page set_url 2016-11-19 18:15:59 +00:00
Juan Leyva 8abfb7b1bb MDL-57054 mod_quiz: check_updates_since not returning questionids 2016-11-19 17:44:48 +00:00
Juan Leyva 0840b3e687 MDL-57052 course: Missing required file in check_module_updates_since 2016-11-19 17:27:01 +00:00
Juan Leyva 6706c1cb12 MDL-57051 course: Do not return directories in check_module_updates 2016-11-19 16:54:31 +00:00
Dan Poltawski 835f1f9add Merge branch 'MDL-57038-master' of git://github.com/FMCorz/moodle 2016-11-18 14:41:56 +00:00
Dan Poltawski b3fd942b52 Merge branch 'MDL-56693_master' of git://github.com/dmonllao/moodle 2016-11-18 14:25:20 +00:00
Dan Poltawski cd4a6b8b0b Moodle release 3.2rc1 2016-11-18 10:06:20 +00:00
Dan Poltawski 644444829a Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2016-11-18 10:06:18 +00:00
Dan Poltawski ff308ab4fb Merge branch 'MDL-56959-master-fixup' of https://github.com/FMCorz/moodle 2016-11-18 07:53:31 +00:00
Frederic Massart 755b013fdf MDL-56959 output: Prevent notice when csstreepostprocess is undefined 2016-11-18 15:47:32 +08:00
EizEddin AlKatrib af28ceb945 MDL-42977 course: Fixed the default behaviour of the Collapse/Expand all link 2016-11-18 14:24:42 +08:00
Frederic Massart 538ce414a5 MDL-57002 repository_webdav: Use default temporary file name
The WebDAV library does not like when there are UTF-8 characters
in the temporary file name. It changes the path but does not return
it, so the file ends up being saved somewhere unknown. As we do not
need the file name at all, we let repository::prepare_file()
generate one.
2016-11-18 12:47:59 +08:00
David Monllao f2e599d51c MDL-56693 boost: Highlight config.php settings in admin UI 2016-11-18 12:22:59 +08:00
Jake Dallimore fe9864f488 MDL-56972 backup: fix question category stamp duplicates during restore
To kerb future stamp duplication, MDL-54864 added a unique index to the
question_categories table (stamp, contextid) and added an upgrade step
to fix existing duplicate stamps. It missed the case where a course with
duplicate stamps in the same context is directly restored into moodle
3.1, causing index clashes. This issue provides a fix for that.
2016-11-18 11:15:02 +08:00
Mark Nelson f4c39cb983 MDL-57036 core_message: always show profile picture on messaging UI 2016-11-18 11:13:36 +08:00
Frederic Massart 3d66b5a100 MDL-57038 theme_bootstrapbase: Fix expand icon with RTL auto-flipped 2016-11-18 11:05:10 +08:00
Andrew Nicols cb3f67364d Merge branch 'MDL-56463_master-fix2' of git://github.com/dmonllao/moodle 2016-11-18 11:02:19 +08:00
Simey Lameze b95a05a536 MDL-56843 theme_boost: remove top margin from repository search div 2016-11-18 09:47:30 +08:00
Simey Lameze 2da36b3750 MDL-56986 block_course_summary: remove unnecessary small cog icon 2016-11-18 09:18:46 +08:00
David Monllao aab30ea828 Merge branch 'MDL-55869_m32v1' of https://github.com/sbourget/moodle 2016-11-18 09:16:06 +08:00
David Monllao 74c21d51d0 Merge branch 'MDL-55566_m32v1' of https://github.com/sbourget/moodle 2016-11-18 09:05:13 +08:00
David Monllao b14a04e0a4 MDL-56463 tool_mobile: Set object properties always in same order
There are differences in http://php.net/manual/en/function.list.php
between PHP 5 and in PHP 7. They neither recommend to rely on the new order
as it may change again in future.
2016-11-18 08:50:08 +08:00
Andrew Nicols 8a668f75a8 Merge branch 'MDL-56989-master' of git://github.com/danpoltawski/moodle 2016-11-18 07:55:42 +08:00
Andrew Nicols 3e5a1d8029 Merge branch 'MDL-57004-master' of git://github.com/ankitagarwal/moodle 2016-11-18 07:27:15 +08:00
Dan Poltawski 099a2aee68 Merge branch 'MDL-56959-master' of git://github.com/FMCorz/moodle 2016-11-17 18:01:58 +00:00
AMOS bot a7c01b5876 Automatically generated installer lang files 2016-11-18 00:06:34 +08:00
David Monllao e23e6c2f64 Merge branch 'MDL-56826-master-fix1' of git://github.com/damyon/moodle 2016-11-17 20:25:31 +08:00
David Monllao f209d76b0d Merge branch 'MDL-57015' of git://github.com/stronk7/moodle 2016-11-17 20:23:20 +08:00
Dan Poltawski abdffed5fc Merge branch 'wip-MDL-56869-master' of https://github.com/marinaglancy/moodle 2016-11-17 11:32:49 +00:00
Ankit Agarwal 40e24fda5b MDL-57004: boost: Show action menu on section pages 2016-11-17 16:31:50 +05:30
Dan Poltawski 486fac73f2 Merge branch 'MDL-56467_master' of git://github.com/markn86/moodle 2016-11-17 10:15:51 +00:00
Virgil Ashruf 5ceb68d169 MDL-56877 autogroup form: no limit on cohorts 2016-11-17 10:46:53 +01:00
Dan Poltawski a0c3ab0b30 Merge branch 'MDL-56767-master-fix' of https://github.com/lameze/moodle 2016-11-17 08:51:18 +00:00
Damyon Wiese 009c57d730 MDL-56826 question: Add bootstrap styles to question preview 2016-11-17 16:14:34 +08:00
David Monllao 820a43510f Merge branch 'MDL-56763-master' of git://github.com/lameze/moodle 2016-11-17 16:10:01 +08:00
Frederic Massart 493ef66ecd MDL-56959 theme: Inherit the parent CSS tree post processor 2016-11-17 15:18:29 +08:00
Frederic Massart 41b973bcbb MDL-56959 theme: SCSS file is inherited from parent
Also added support for the SCSS property to be a Closure
and return content rather than simply being the name of a file.
2016-11-17 15:18:29 +08:00
David Monllao 237af2ba61 Merge branch 'MDL-56734-master' of git://github.com/lameze/moodle 2016-11-17 15:10:52 +08:00
Andrew Nicols 79f15159da Merge branch 'wip-MDL-57007-master' of git://github.com/marinaglancy/moodle 2016-11-17 14:36:02 +08:00
Andrew Nicols 2f0cd733be Merge branch 'MDL-56822-master' of git://github.com/cameron1729/moodle 2016-11-17 14:33:39 +08:00
David Monllao 4006e187f3 MDL-56826 version: Increase version after history rewrite 2016-11-17 14:25:52 +08:00
David Monllao 98f43f1b08 Merge branch 'MDL-56826-master' of git://github.com/damyon/moodle 2016-11-17 14:24:59 +08:00
Damyon Wiese 12d6dfc1ce MDL-56826 questions: Add styling for boost theme
Changes include:
* question: Add bootstrap classes to buttons and selects so they look consistent.

* mod_quiz: Add bootstrap styles to report form elements

* question: Add bootstrap classes to question form elements

* And remove the success/fail styles from boost because they conflict badly
with the quiz plugin styles (making unreadable text).

* quiz: nav block buttons had black background

* quiz: Add bootstrap styles to quiz navigation buttons

* qtype_ddmarker: Remove bullets from list

Edit form coordinates preview had list bullets for each coordinate.

* boost: Prevent menu scrolling on quiz edit

* mod_quiz: Add bootstrap styles to edit quiz fields

Pagination and max grades forms.

* quiz: Undo some custom styles on review options

These checkboxes were laid out in a fake grid with no responsiveness
that conflicts with the bootstrap form-inline templates. Reset the
custom style to bootstrap default.

* quiz: Fix unit tests for boost changes

* qtype_ddwtos: Accurate positioning of drop targets

* questions: Make the review page responsive

* question: bootstrap 4 compatibility

.alert in bs4 contains no colours by default, you need to mix it with
one of the context classes to get some change in colours, borders etc.
2016-11-17 14:20:52 +08:00
Simey Lameze 25ca6f1638 MDL-56763 theme_boost: ignore boostrap popover rtl scss
Because Bootstrap Javascript does is not expecting to be flipped, it breaks the popover on RTL languages.
We already swap the directions on the help icon template so popover scss rules can be ignored.
2016-11-17 14:19:49 +08:00
Simey Lameze 7508e218d2 MDL-56767 theme_boost: change remember username checkbox to bs4 style 2016-11-17 13:36:21 +08:00
Andrew Nicols 3d15dfc9d2 Merge branch 'MDL-56221' of https://github.com/bostelm/moodle 2016-11-17 13:31:33 +08:00
David Monllao c35ef2e9a0 Merge branch 'MDL-56463_master-fix' of git://github.com/dmonllao/moodle 2016-11-17 13:27:21 +08:00
David Monllao 96abc5f1cd MDL-56763 tool_mobile: Unit test fix
Checking external_format_text return instead of just using SITE->summary
2016-11-17 13:25:54 +08:00
Simey Lameze d78207b6c3 MDL-56734 tool_lp: add competency frameworks repo button 2016-11-17 13:15:56 +08:00
David Monllao d41b1ba49e Merge branch 'MDL-56463-master' of git://github.com/jleyva/moodle 2016-11-17 13:10:23 +08:00
Marina Glancy e938ea398c MDL-57007 behat: assume all capabilities during installation 2016-11-17 13:07:09 +08:00
David Monllao 29dfbb422f Merge branch 'MDL-56842-master' of git://github.com/danpoltawski/moodle 2016-11-17 12:28:34 +08:00
David Monllao 9ecf0674ff Merge branch 'MDL-56870-master-v2' of https://github.com/snake/moodle 2016-11-17 12:18:26 +08:00
Cameron Ball b5b7af96bb MDL-56822 messaging: Hide notification icons on site policy screen
If we have the nofications and messaging popovers displaying on the
policy confirmation screen we hit an exception since the webservices
won't work if the policy hasn't been agreed to.

This patch simply stops them from showing if the site policy hasn't
been agreed to.
2016-11-17 12:10:52 +08:00
Andrew Nicols 76acac80eb Merge branch 'MDL-56978_iconv' of https://github.com/mrmark/moodle 2016-11-17 11:20:39 +08:00
Jake Dallimore a428cf4ac8 MDL-56870 lib: block access to deleted module in require_login 2016-11-17 10:57:13 +08:00
David Monllao 0915860e51 Merge branch 'MDL-52186-master' of git://github.com/junpataleta/moodle 2016-11-17 10:42:08 +08:00
Jun Pataleta b62bebbf1c MDL-52186 enrol_meta: Sync only active enrol_meta instances
Thanks to Peter Klinka for the solution!
2016-11-17 10:40:54 +08:00
David Monllao 75166d0627 Merge branch 'wip-mdl-56865' of https://github.com/rajeshtaneja/moodle 2016-11-17 10:35:38 +08:00
David Monllao 6dc3a5b699 Merge branch 'MDL-56915-master' of git://github.com/FMCorz/moodle 2016-11-17 10:32:00 +08:00
Andrew Nicols c6b4421524 MDL-57017 tool_usertours: Allow targetting of the frontpage 2016-11-17 10:23:00 +08:00
Andrew Nicols 50e16a67ab Merge branch 'MDL-56767-master' of git://github.com/danpoltawski/moodle 2016-11-17 10:07:35 +08:00
Eloy Lafuente (stronk7) 7336ba40d5 MDL-57015 tests: Use preventResetByRollback() if test uses transactions 2016-11-17 02:41:31 +01:00
David Monllao a813b0c3dc Merge branch 'MDL-56999-master' of git://github.com/damyon/moodle 2016-11-17 09:31:07 +08:00
Jun Pataleta 26dca05d02 MDL-56407 message: Indicate user is blocked in message area 2016-11-17 09:11:37 +08:00
Rajesh Taneja 920d7ffadd MDL-56865 behat: Don't set error handler for behat install 2016-11-17 08:56:54 +08:00
Andrew Nicols 84c8c00959 Merge branch 'wip-mdl-56603' of https://github.com/rajeshtaneja/moodle 2016-11-17 08:51:47 +08:00
Rajesh Taneja d48c0a1d9a MDL-56603 behat: Fixed search messages string to use id 2016-11-17 08:46:32 +08:00
Eloy Lafuente (stronk7) 7b0057b895 Merge branch 'MDL-56922-master' of git://github.com/danpoltawski/moodle 2016-11-17 01:38:24 +01:00
Henning Bostelmann 9574320a36 MDL-56221 mod_assign: Suppress unwanted grade notifications
* Quick grading: Properly recognize unchanged grades
* Individual grading: Amend JS that transfers checkbox state
2016-11-16 21:53:33 +00:00
Mark Nielsen 6670d28fbc MDL-56978 core: fix error handling in min_fix_utf8
Must completely suppress notice from iconv as Behat's
shutdown function uses error_get_last() which is
unable to detect if the error was suppressed or not.
2016-11-16 08:59:15 -08:00
Dan Poltawski a4e2d64571 MDL-56943 boost: correct ARIA roles
* role="navigation" can't go directly on a list
* role="banner" should only be done once and not on a link
2016-11-16 16:52:03 +00:00
AMOS bot 7489d697be Automatically generated installer lang files 2016-11-17 00:04:37 +08:00
Tobias Reischmann 1cca9a3479 MDL-55275 assign: Prevent exception under admin role assignment.
In group mode the submission status was displayed to admins.
This caused an exception when the admins were enrolled as teachers
in a course while being the only member of a group.
2016-11-16 16:55:22 +01:00
Dan Poltawski 310808b778 MDL-56989 boost: fix template lint issues
1) Add example context where missing
2) Don't use an uncessary function in JS
2016-11-16 14:56:29 +00:00
Juan Leyva e2fe3bc081 MDL-56463 tool_mobile: Apply text formatting to tool_mobile WS 2016-11-16 14:54:37 +00:00
Dan Poltawski 6eb6c5fd6d MDL-56989 boost: don't double-escape page titles 2016-11-16 14:41:03 +00:00
Dan Poltawski 6182ec8901 MDL-56842 boost: add example context to login template 2016-11-16 13:59:47 +00:00
Dan Poltawski 16732d0631 MDL-56842 boost: load required js on login page 2016-11-16 13:59:47 +00:00
Dan Poltawski 7d3a7bbd1f Merge branch 'MDL-33960-lti-scroll' of https://github.com/gabrielrosset/moodle 2016-11-16 13:03:38 +00:00
Dan Poltawski 3b195bfb81 MDL-56922 theme_boost: grey out activity icon when hidden
This was present in bootstrapbase and is I think an important visual
distinction.
2016-11-16 11:58:42 +00:00
David Monllao e3cb80f10c Merge branch 'wip-MDL-56847-master' of git://github.com/marinaglancy/moodle 2016-11-16 19:38:08 +08:00
Eloy Lafuente (stronk7) 904fcbee8b Merge branch 'MDL-55362_master' of git://github.com/Chocolate-lightning/moodle 2016-11-16 11:29:01 +01:00
Frederic Massart 6321934c73 MDL-56205 theme_boost: Adjust margin between icon and caret in dropdowns 2016-11-16 10:20:53 +00:00
Eloy Lafuente (stronk7) 751122dbc0 Merge branch 'MDL-56908-master' of git://github.com/danpoltawski/moodle 2016-11-16 11:18:15 +01:00
Dan Poltawski c1e74a0937 Merge branch 'MDL-56965-master' of git://github.com/ankitagarwal/moodle 2016-11-16 10:08:10 +00:00
Dan Poltawski f882aed3b3 Merge branch 'wip-MDL-56776-master' of git://github.com/marinaglancy/moodle 2016-11-16 09:46:10 +00:00
Eloy Lafuente (stronk7) e7b9ea226c Merge branch 'MDL-56911-master' of git://github.com/ankitagarwal/moodle 2016-11-16 10:33:09 +01:00
Dan Poltawski 1bf9d6ac92 Merge branch 'MDL-56889-master' of git://github.com/danpoltawski/moodle 2016-11-16 09:20:28 +00:00
Frederic Massart 35b48c7aed MDL-56915 webdav: Increase maximum expected header size 2016-11-16 17:19:19 +08:00
Dan Poltawski 706e012fd6 MDL-56889 boostrapbase: remove excessive stylelint-disables
From bs4-compat.less, replace with file level disable instead.
2016-11-16 08:50:14 +00:00
Simey Lameze 660b51e013 MDL-56889 bootstrapbase: create static bs4 compatible mixins 2016-11-16 08:50:08 +00:00
Marina Glancy d76dd4d064 MDL-56869 media_videojs: upgrade video.js to 5.12.6 2016-11-16 16:27:30 +08:00
Dan Poltawski 6dc4c68e4e MDL-56767 block_login: Use btn-block as suggested by Andrew 2016-11-16 08:09:14 +00:00
Marina Glancy 4125ce046b MDL-56776 calendar: display month above the dates
month is displayed in table caption which is by default in the bottom in BS4
2016-11-16 15:46:56 +08:00
Andrew Nicols 7da7c1e24a Merge branch 'wip-MDL-56603-master-v2' of git://github.com/abgreeve/moodle 2016-11-16 15:36:37 +08:00
Damyon Wiese 3eb9cc2f6e MDL-56999 boost: Maintenance layout needs padding 2016-11-16 15:18:27 +08:00
Mark Nelson 393eccb077 MDL-56467 message_airnotifier: fixed settings pop-up not displaying 2016-11-16 14:56:32 +08:00
Adrian Greeve d3d0248afc MDL-56603 message: Added see all link to message popup. 2016-11-16 14:51:17 +08:00
Adrian Greeve 8151761378 MDL-56603 messaging: Add a new message link to popup.
Added a link to create a new message from the message
popup menu.
2016-11-16 14:51:17 +08:00
Andrew Nicols faadaedb17 Merge branch 'wip-mdl-56710' of https://github.com/rajeshtaneja/moodle 2016-11-16 14:14:26 +08:00
Andrew Nicols 0064cb1193 Merge branch 'MDL-56967-master' of git://github.com/damyon/moodle 2016-11-16 14:05:07 +08:00
Andrew Nicols a435242491 Merge branch 'wip-mdl-56981' of https://github.com/rajeshtaneja/moodle 2016-11-16 14:00:40 +08:00
David Monllao 70d2c9fcf8 Merge branch 'MDL-56784-master' of git://github.com/cameron1729/moodle 2016-11-16 13:49:51 +08:00
David Monllao 12ebaf1c6b Merge branch 'MDL-56187-master' of git://github.com/damyon/moodle 2016-11-16 13:35:38 +08:00
Cameron Ball 8712a50ec2 MDL-56784 theme_boost: Fix escaped markup in filemanager_fileselect
The markup in the filemanager_fileselect template was being escaped,
causing a help icon not to display.

Additionally, the popover for the help icon was not display since
"loader.js" was not properly delegating the popover calls.
2016-11-16 13:10:51 +08:00
David Monllao 97279f8d5d Merge branch 'MDL-56139_master' of git://github.com/markn86/moodle 2016-11-16 11:51:18 +08:00
Andrew Nicols 90677673da Merge branch 'MDL-56958-master' of git://github.com/damyon/moodle 2016-11-16 11:07:20 +08:00
Mark Nelson af5765b3fb MDL-56139 core_message: removed unused constants 2016-11-16 10:22:52 +08:00
Mark Nelson ffd7798c96 MDL-56139 core: changes after peer review
- No longer use the Fibonacci sequence for delaying the timeout.
  It is too aggressive.
- The backoff_timer AMD module now expects the callback AND the
  backoff function to be passed to the constructor.
- Added ability to specify polling frequency in config.php.
- Added helper function to return the cache key.
- Reworded the parameters for clarity.
2016-11-16 10:22:52 +08:00
Ryan Wyllie fb1469d84f MDL-56139 message: ajax poll for new messages in message area 2016-11-16 10:22:33 +08:00
Andrew Nicols 583278f070 Merge branch 'MDL-56703-master' of git://github.com/damyon/moodle 2016-11-16 10:16:09 +08:00
Andrew Nicols 901c0ea7de Merge branch 'wip_MDL-48055_master_quiz_activity_report_grade_visibility' of https://github.com/POETGroup/moodle 2016-11-16 10:08:13 +08:00
David Monllao 8898725385 Merge branch 'MDL-56921_master' of https://github.com/nadavkav/moodle 2016-11-16 10:04:37 +08:00
Damyon Wiese cee482ca4e MDL-56703 boost: Fix mustache html warnings
Don't put div in a span
2016-11-16 10:01:19 +08:00
Damyon Wiese 7a9309f32e MDL-56703 boost: Escaping bug in flat nav and navbar
The items in the flat navigation were double escaped. Also added
context to template.
2016-11-16 10:01:11 +08:00
Andrew Nicols 4642a8c593 Merge branch 'MDL-56193-master' of git://github.com/damyon/moodle 2016-11-16 09:52:55 +08:00
Damyon Wiese 4682f17c49 MDL-56967 boost: Fix for layout problem with IE11 2016-11-16 09:36:38 +08:00
Mathew May 44002b183c MDL-55362 core: Fixed topic section default name empty h2 tag 2016-11-16 14:19:55 +13:00
Rajesh Taneja 4b371f9769 MDL-56710 editor: Fix box-sizing to context box
With BS4, box-sizing is border-box and this leads to
icon not shown properly. TinyMCE toolbar should use
box-sizing as context-box
2016-11-16 08:37:15 +08:00
David Monllao e466786f78 Merge branch 'master_MDL-56358' of git://github.com/danmarsden/moodle 2016-11-16 08:33:45 +08:00
Andrew Nicols 6aefea74a4 Merge branch 'MDL-55209' of https://github.com/NeillM/moodle 2016-11-16 08:24:39 +08:00
Rajesh Taneja 4ea8f814a0 MDL-56981 behat: Fixed xpath of radio button to contain class 2016-11-16 08:14:07 +08:00
David Monllao 1c70e86b5e Merge branch 'MDL-56942-master' of git://github.com/jleyva/moodle 2016-11-16 08:09:54 +08:00
David Monllao 900a2c554e Merge branch 'm32_MDL-56917_TLS_Env_Checks_Based_On_Caps_Not_Raw_Version' of https://github.com/scara/moodle 2016-11-16 05:31:55 +08:00
Matteo Scaramuccia ade30c673c MDL-56917 core_upgrade: Do not use the raw version to check cURL caps.
Some Linux distros can backport features due to security issues
while keeping the same (old) version. See e.g.:
- RHEL 7, https://rhn.redhat.com/errata/RHSA-2015-2159.html
- RHEL 6, https://rhn.redhat.com/errata/RHBA-2016-0842.html
- Remi PHP 7.0.x, https://github.com/remicollet/remirepo/commit/87954ef9ca41
2016-11-15 21:50:07 +01:00
Mike Churchward 930570b410 MDL-48055 q_u_outline, q_u_complete: added checks for grade visibility. 2016-11-15 12:35:38 -05:00
Dan Poltawski 6027eaebc5 Merge branch 'MDL-55848-master' of git://github.com/lameze/moodle 2016-11-15 16:33:26 +00:00
Dan Poltawski 78b281b24d Merge branch 'wip-mdl-56860' of git://github.com/rajeshtaneja/moodle 2016-11-15 16:29:59 +00:00
Dan Poltawski 1efacd2b35 MDL-56767 block_login: add bootstrap markup
Remove existing overrides forcing the markup off
2016-11-15 15:44:09 +00:00
Dan Poltawski e44bd69aaa MDL-56939 theme_boost: Link to MDL for future 2016-11-15 14:31:45 +00:00
Dan Poltawski dad0b3bfeb Merge branch 'MDL-56939-master' of git://github.com/damyon/moodle 2016-11-15 14:29:35 +00:00
gabrielrosset d030347bce MDL-33960 mod_lti: fix page scroll 2016-11-15 14:40:21 +01:00
Dan Poltawski d25f96b766 MDL-56908 upgrade: bootstrap styling for settings save button 2016-11-15 12:51:14 +00:00
Dan Poltawski b4d6669dd0 on-demand release 3.2beta+ 2016-11-15 11:02:52 +00:00
Dan Poltawski 90d00d0eae Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2016-11-15 11:02:51 +00:00
Dan Poltawski efe57105d6 Merge branch 'MDL-56903-master-enfix' of git://github.com/mudrd8mz/moodle 2016-11-15 10:42:36 +00:00
Helen Foster 7f6accd448 MDL-56903 lang: Merge English strings from the en_fix language pack 2016-11-15 11:19:48 +01:00
Ankit Agarwal 0d02bb964b MDL-56965 themes: Fix logo CSS for RTL 2016-11-15 15:20:36 +05:30
Jake Dallimore 5cfaecac47 MDL-56931 themes: restrict extra padding to edit mode only 2016-11-15 09:29:57 +00:00
David Monllao 396edc0a5e Merge branch 'MDL-56910-master' of git://github.com/danpoltawski/moodle 2016-11-15 09:07:42 +00:00
Damyon Wiese 998432c2c9 MDL-56724 mod_choice: Improve alignment and checkboxes on dates 2016-11-15 09:07:42 +00:00
David Monllao 2f3ae73ab0 Merge branch 'wip-MDL-56899-master' of git://github.com/marinaglancy/moodle 2016-11-15 09:07:41 +00:00
David Monllao 04fbba050d Merge branch 'MDL-56690-master' of git://github.com/damyon/moodle 2016-11-15 09:07:40 +00:00
Andrew Nicols 1e9f38a487 Merge branch 'MDL-56785-master-fix' of https://github.com/lameze/moodle 2016-11-15 09:07:40 +00:00
Damyon Wiese 813afc6797 MDL-56618 behat: Fix xpath for behat
We changed the output so the test needs to match
2016-11-15 09:07:39 +00:00
Simey Lameze c1584e154c MDL-56785 theme_boost: apply bs4 styles to search options checkboxes 2016-11-15 09:07:39 +00:00
Andrew Nicols ebba556af7 Merge branch 'MDL-56844-master' of git://github.com/damyon/moodle 2016-11-15 09:07:38 +00:00
Andrew Nicols 7afc76fbd6 Merge branch 'MDL-56952-master' of git://github.com/damyon/moodle 2016-11-15 09:07:37 +00:00
David Monllao 92ba7648fe Merge branch 'MDL-56905-master' of git://github.com/jleyva/moodle 2016-11-15 09:07:37 +00:00
Andrew Nicols 2d45ac279d Merge branch 'MDL-56823' of git://github.com/aolley/moodle 2016-11-15 09:07:36 +00:00
David Monllao 1cc10f3f67 Merge branch 'MDL-56895-master' of git://github.com/danpoltawski/moodle 2016-11-15 09:07:35 +00:00
David Monllao 0fef835188 Merge branch 'MDL-56739-master' of git://github.com/jleyva/moodle 2016-11-15 09:07:35 +00:00
Eloy Lafuente (stronk7) 7a677348e4 Merge branch 'MDL-56724-master' of git://github.com/damyon/moodle 2016-11-15 09:07:34 +00:00
Eloy Lafuente (stronk7) 2589802489 Merge branch 'MDL-56910-master' of git://github.com/danpoltawski/moodle 2016-11-15 09:07:33 +00:00
David Monllao 5a9a2c61b9 Merge branch 'MDL-56824-master' of git://github.com/damyon/moodle 2016-11-15 09:07:33 +00:00
David Monllao 39e7d46d89 Merge branch 'MDL-56834-master-fix1' of http://github.com/damyon/moodle 2016-11-15 09:07:32 +00:00
Andrew Nicols 2fd423721f Merge branch 'MDL-56846-master' of git://github.com/damyon/moodle 2016-11-15 09:07:31 +00:00
Dan Poltawski 4f1ba09334 Merge branch 'MDL-54871' of https://github.com/bostelm/moodle 2016-11-15 09:07:31 +00:00
Dan Poltawski 642bbbdd10 Merge branch 'MDL-54782_master' of git://github.com/markn86/moodle 2016-11-15 09:07:30 +00:00
Dan Poltawski 4678592332 Merge branch 'MDL-56426_master' of git://github.com/markn86/moodle 2016-11-15 09:07:29 +00:00
Dan Poltawski 6dad38deed Merge branch 'MDL-56913' of git://github.com/timhunt/moodle 2016-11-15 09:07:29 +00:00
Dan Poltawski d82aa0a2d9 MDL-56910 filepicker: fix eranously removed styles
No idea what happened to my testing of this change, but it was wrong.
2016-11-15 08:27:03 +00:00
Ankit Agarwal dc48cc0a79 MDL-56911 themes: Resolve settings before calling parser 2016-11-15 13:34:52 +05:30
Damyon Wiese fcd412470a MDL-56939 boost: Fix for bootstrap select reset
Bootstrap makes select form elements not using custom-select broken when
they have a size. The contents overflow the field.
2016-11-15 15:41:19 +08:00
Damyon Wiese d9a1d6834c MDL-56193 theme_boost: Make the enrol users modal wider 2016-11-15 15:12:19 +08:00
Marina Glancy 5e5ce443fd MDL-56847 tags: exclude modules that are being deleted
we don't check any access for admins for performance reasons, course modules
that are in the process of deletion should be filtered out on the early stage
2016-11-15 14:34:18 +08:00
Damyon Wiese 946281d282 MDL-56958 ajax: Prefer the general renderer 2016-11-15 12:44:59 +08:00
Damyon Wiese ae9bbd9847 MDL-56193 enrol_manual: Bootstrap styles for assign roles
Use a bootstrap popover for the assign roles form.
2016-11-15 11:29:49 +08:00
Damyon Wiese f10ae4676d MDL-56193 enrol: Modernise the enrol users popup
This just injects bootstrap classes into the old yui2 thing. It needs
rewriting.
2016-11-15 11:29:18 +08:00
Damyon Wiese f25185d7b0 MDL-56844 scorm: Review styles in boost theme
The main change is that in boost we get rid of the random centered text.
To compensate we use "container" which is fixed with with auto margins -
but the text is still left aligned.
2016-11-15 11:19:33 +08:00
David Monllao b09db258e5 Merge branch 'MDL-56905-master' of git://github.com/jleyva/moodle 2016-11-15 10:55:20 +08:00
Andrew Nicols 857a0ab60e Merge branch 'MDL-56952-master' of git://github.com/damyon/moodle 2016-11-15 10:18:01 +08:00
Andrew Nicols d7978641dc Merge branch 'MDL-56823' of git://github.com/aolley/moodle 2016-11-15 10:04:21 +08:00
David Monllao 6f0efcc891 Merge branch 'MDL-56895-master' of git://github.com/danpoltawski/moodle 2016-11-15 09:51:07 +08:00
David Monllao d163d37593 Merge branch 'MDL-56739-master' of git://github.com/jleyva/moodle 2016-11-15 09:40:17 +08:00
Eloy Lafuente (stronk7) de7e277e1f Merge branch 'MDL-56724-master' of git://github.com/damyon/moodle 2016-11-15 02:17:10 +01:00
Eloy Lafuente (stronk7) 852264ad23 Merge branch 'MDL-56910-master' of git://github.com/danpoltawski/moodle 2016-11-15 02:13:40 +01:00
Simey Lameze 3745973281 MDL-55848 assignfeedback_editpdf: remove problematic class_exists check
Due to a bug on opcache, this check had to be removed along the empty class to avoid
error on assignment grading interface.
2016-11-15 09:05:42 +08:00
David Monllao 3a14f060d1 Merge branch 'MDL-56824-master' of git://github.com/damyon/moodle 2016-11-15 09:03:52 +08:00
Damyon Wiese 204413187e MDL-56952 plugininfo: You can uninstall theme_base 2016-11-15 08:55:41 +08:00
David Monllao 4b96878ab6 Merge branch 'MDL-56834-master-fix1' of http://github.com/damyon/moodle 2016-11-15 08:52:34 +08:00
Andrew Nicols 181b5922ce Merge branch 'MDL-56846-master' of git://github.com/damyon/moodle 2016-11-15 08:05:54 +08:00
Dan Poltawski 493ec714fd Merge branch 'MDL-54871' of https://github.com/bostelm/moodle 2016-11-14 16:27:42 +00:00
Dan Poltawski 729132fa6a Merge branch 'MDL-54782_master' of git://github.com/markn86/moodle 2016-11-14 16:23:33 +00:00
Dan Poltawski f6dabb3194 MDL-56910 filepicker: give button BS styling 2016-11-14 15:46:49 +00:00
Dan Poltawski cead8a8138 Merge branch 'MDL-56426_master' of git://github.com/markn86/moodle 2016-11-14 14:03:10 +00:00
Dan Poltawski 8bcc2cbd8a Merge branch 'MDL-56913' of git://github.com/timhunt/moodle 2016-11-14 13:58:47 +00:00
Dan Poltawski 20f576629b Merge branch 'wip_MDL-48055_master_quiz_activity_report_grade_visibility' of https://github.com/POETGroup/moodle 2016-11-14 13:39:56 +00:00
Dan Poltawski 585ba846da Merge branch 'mdl-56831-master' of https://github.com/Dagefoerde/moodle 2016-11-14 13:21:35 +00:00
Dan Poltawski 55e54953a4 Merge branch 'MDL-56916-master-normalizedoc' of git://github.com/mudrd8mz/moodle 2016-11-14 13:09:48 +00:00
Dan Poltawski 8d857d0ecc Merge branch 'MDL-56839-master' of git://github.com/jleyva/moodle 2016-11-14 13:06:48 +00:00
Dan Poltawski 0b96b9c5c2 Merge branch 'MDL-56618-master' of git://github.com/damyon/moodle 2016-11-14 12:38:32 +00:00
Juan Leyva 449e15f092 MDL-56942 login: Add missing required lib in complete_user_login 2016-11-14 12:07:54 +00:00
Eloy Lafuente (stronk7) 2dcb3746b0 Merge branch 'MDL-56794-master' of git://github.com/damyon/moodle 2016-11-14 12:28:29 +01:00
Dan Poltawski 4af34676f7 MDL-56719 mod_chat: clarify 'course theme' change
Plus remove some pointless code.
2016-11-14 11:09:23 +00:00
Dan Poltawski e7bba8ce4d Merge branch 'MDL-56719-master' of git://github.com/damyon/moodle 2016-11-14 11:06:22 +00:00
Eloy Lafuente (stronk7) dd24216a3b Merge branch 'MDL-56880-m' of https://github.com/micaherne/moodle 2016-11-14 12:04:25 +01:00
Dan Poltawski ed81eab309 Merge branch 'MDL-56935-master' of git://github.com/junpataleta/moodle 2016-11-14 10:49:23 +00:00
Eloy Lafuente (stronk7) 95bfa52549 Merge branch 'MDL-56882-master' of git://github.com/crazyserver/moodle 2016-11-14 11:14:37 +01:00
Dan Poltawski ea70612b00 Merge branch 'MDL-56435-master' of git://github.com/damyon/moodle 2016-11-14 10:10:54 +00:00
Dan Poltawski 51d9431e48 Merge branch 'MDL-56931-master' of https://github.com/snake/moodle 2016-11-14 10:03:48 +00:00
Damyon Wiese cf199b4448 MDL-56834 boost: Be cautious about nodes in the navbar
Some pages (fresh install) don't have the navbar yet, so check for null.
2016-11-14 17:18:29 +08:00
Pau Ferrer Ocaña 0ffe8d2f0c MDL-56882 assign: Enable revert outcomes to No outcome 2016-11-14 09:56:35 +01:00
Dan Poltawski d017e3fb48 Merge branch 'MDL-56398-master' of git://github.com/lameze/moodle 2016-11-14 08:34:13 +00:00
David Monllao 337b723b07 Merge branch 'MDL-56803-master' of git://github.com/damyon/moodle 2016-11-14 16:25:43 +08:00
Dan Poltawski 6b8c8f4bc2 Merge branch 'MDL-56711-master' of git://github.com/damyon/moodle 2016-11-14 08:21:14 +00:00
Damyon Wiese f93bdccab7 MDL-56803 boost: hide region-main settings menu on 1 col layouts 2016-11-14 16:02:55 +08:00
Mark Nelson f34df17977 MDL-56426 core_message: prevent page jump when viewing notif. settings 2016-11-14 16:02:42 +08:00
Damyon Wiese 04165cd446 MDL-56803 glossary: More style fixes for glossary
Fix checkbox alignment for search on small screens, and put separation
between glossary items in a list.
2016-11-14 16:02:09 +08:00
Andrew Nicols 125bd58ff9 Merge branch 'MDL-56657-master' of git://github.com/damyon/moodle 2016-11-14 15:46:31 +08:00
Damyon Wiese 1093b461f6 MDL-56803 mod_glossary: Fix styles for boost theme 2016-11-14 15:43:58 +08:00
Marina Glancy f31e1e8b25 MDL-56899 filter: suppress dom parsing errors
Domdocument does not know about <video> and <audio> tags, also it's too strict for html style
solution from http://stackoverflow.com/questions/6090667/php-domdocument-errors-warnings-on-html5-tags
2016-11-14 15:16:09 +08:00
Damyon Wiese 2f3f8e45da MDL-56657 admin: Style all admin/role pages for boost 2016-11-14 15:11:15 +08:00
Damyon Wiese f619064b9b MDL-56719 boost: Style mod_chat for boost
I stayed away from big markup changes. This is a table layout so needs rewriting which is a big job.
2016-11-14 15:08:57 +08:00
Andrew Nicols cfade93cb8 Merge branch 'MDL-56785-master' of git://github.com/lameze/moodle 2016-11-14 15:06:40 +08:00
David Monllao fd887df697 Merge branch 'MDL-56888-master-workshop-leap2a' of git://github.com/mudrd8mz/moodle 2016-11-14 15:01:21 +08:00
Damyon Wiese fe3db0ca08 MDL-56618 theme_boost: Fix backup / restore pages (again)
I removed most of the layout styles and started again.
2016-11-14 15:00:46 +08:00
Andrew Nicols 87264a2022 Merge branch 'MDL-56845-master' of git://github.com/damyon/moodle 2016-11-14 14:44:07 +08:00
Andrew Nicols 622c84f630 Merge branch 'MDL-56853-master' of git://github.com/damyon/moodle 2016-11-14 14:36:45 +08:00
Simey Lameze 27a5b91f45 MDL-56398 core_message: make modals consistent across themes 2016-11-14 14:35:38 +08:00
Andrew Nicols 8f3a295c6e Merge branch 'MDL-56242-master' of git://github.com/damyon/moodle 2016-11-14 14:07:36 +08:00
David Monllao 9444636cb8 Merge branch 'MDL-56834-master' of git://github.com/damyon/moodle 2016-11-14 14:00:45 +08:00
Andrew Nicols 49ae3661d3 Merge branch 'MDL-56769-master' of git://github.com/damyon/moodle 2016-11-14 13:38:00 +08:00
Jun Pataleta cf2bc26911 MDL-56935 theme_boost: Fix double escaping of navbar items 2016-11-14 13:35:26 +08:00
Damyon Wiese c1ae9079db MDL-56187 theme_boost: Atto fields styling for validation errors 2016-11-14 13:13:46 +08:00
Mark Nelson 7dbc501811 MDL-54782 core_message: deprecated/removed strings from lang file 2016-11-14 12:09:46 +08:00
Jake Dallimore 7135bbb188 MDL-56931 themes: fix for module edit menu on course home
Increased bottom padding to allow space for the lower edit menus to be
displayed without a vertical scrollbar.
2016-11-14 11:52:00 +08:00
Damyon Wiese bf5dcc8abb MDL-56724 mod_choice: coding style fixes
For the lines affected by this patch.
2016-11-14 11:38:36 +08:00
Damyon Wiese eaf45bce09 MDL-56724 boost: Update mod_choice to use bootstrap classes for styles 2016-11-14 11:37:45 +08:00
Damyon Wiese 7d41ccf0fb MDL-56794 boost: Styling for forum module 2016-11-14 11:30:17 +08:00
Damyon Wiese 0f76052836 MDL-56824 mod_lesson: Style fixes for theme_boost 2016-11-14 11:20:55 +08:00
Damyon Wiese f2405a5f5c MDL-56242 theme_boost: Fix styling for confirm boxes (js and in page)
They should be left aligned with a header, content and footer (right aligned with the buttons).

There should be a primary continue button and a secondary cancel button.
2016-11-14 11:11:28 +08:00
Damyon Wiese a7bebd0638 MDL-56834 boost: Nav for participants page
On the participants page, hide the small cog and put a region main
settings menu with all the nodes from the "Users" branch in the settings
block.
2016-11-14 10:40:41 +08:00
Damyon Wiese 7b02521c39 MDL-56435 boost: Better styling for competencies in boost
Changes
    - add custom-select to all select fields
    - add btn btn-primary/secondary to all buttons
    - add list-inline to all lists with inline class
    - style dropdowns like a bootstrap menu
    - add col-md-6 to span6
2016-11-14 10:31:01 +08:00
Jan Dageförde c2e123355d MDL-56831 quiz: Declare YUI dependencies explicitly where needed 2016-11-13 23:07:00 +01:00
Nadav Kavalerchik 974573b4ea MDL-56921 Atto: Image alignment should not be RTLed in RTL mode. 2016-11-13 12:31:42 +02:00
David Mudrák 6b6a2ec439 MDL-56916 docs: Fix documentation of the normalize_component return 2016-11-12 10:45:29 +01:00
Tim Hunt f31d0fff2e MDL-56913 quiz: teachers should see a review link for a preview
So what they see is like what students see.
2016-11-11 16:51:54 +00:00
AMOS bot 4827eaa744 Automatically generated installer lang files 2016-11-12 00:28:50 +08:00
Juan Leyva 5222cb1ce8 MDL-56905 tool_mobile: Return private tokens just after log-in 2016-11-11 15:21:01 +00:00
Juan Leyva b5f3e90e1c MDL-56739 auth: Support launching the app upon user confirm 2016-11-11 15:06:36 +00:00
Dan Poltawski b1f3de5793 MDL-56895 porfolio: give buttons bootstrap styling 2016-11-11 12:39:35 +00:00
Dan Poltawski 0b8e0c374f on-demand release 3.2beta+ 2016-11-11 12:06:14 +00:00
Dan Poltawski e9eec33560 Merge branch 'MDL-56602-master-upgrade' of git://github.com/andrewnicols/moodle 2016-11-11 10:22:20 +00:00
Andrew Nicols 9fa6d4e04e Merge branch 'MDL-55121-master' of git://github.com/lameze/moodle 2016-11-11 15:12:50 +08:00
Damyon Wiese 058edbafc8 MDL-56711 theme_boost: Highlight sections at activity level
When looking at an activity, the current section for the course should be active in the flat navigation.
2016-11-11 14:27:56 +08:00
Andrew Nicols ea10a0319b MDL-56602 core: Lock themerev during upgrade
This also changes install to use a fixed themerev.
2016-11-11 14:15:00 +08:00
Andrew Nicols fe86e2f034 Merge branch 'wip-mdl-56189' of https://github.com/rajeshtaneja/moodle 2016-11-11 14:07:10 +08:00
Rajesh Taneja 259d3742f9 MDL-56189 behat: Fixed xpath to use contains class 2016-11-11 13:45:33 +08:00
Andrew Nicols 56fb91bc38 Merge branch 'MDL-55994' of https://github.com/bostelm/moodle 2016-11-11 13:29:57 +08:00
Simey Lameze 51f3693cdb MDL-55121 environment: check for unsuported php version 7.1 2016-11-11 12:37:07 +08:00
Andrew Nicols 9c56f904d2 Merge branch 'MDL-56768-master-fix1' of http://github.com/damyon/moodle 2016-11-11 12:15:55 +08:00
David Monllao 3ecf492a75 Merge branch 'MDL-56811-master' of git://github.com/damyon/moodle 2016-11-11 12:13:30 +08:00
Andrew Nicols 6b7b3e59f2 Merge branch 'MDL-56417_master' of https://github.com/dmonllao/moodle 2016-11-11 11:53:41 +08:00
Andrew Nicols 06cca0158c Merge branch 'MDL-56190-master-fix1' of http://github.com/damyon/moodle 2016-11-11 11:39:48 +08:00
Damyon Wiese 7becb39f63 MDL-56768 gradereport_grader: Fix point the user column floats
Need to account for body margin when calculating whether to float the
user column.
2016-11-11 11:34:48 +08:00
Andrew Nicols a044ff57a1 Merge branch 'MDL-52216_master' of https://github.com/eugeneventer/moodle-fixes 2016-11-11 11:21:26 +08:00
Damyon Wiese f46fab0ea1 MDL-56190 clean: Fix grade restriction styles
Grade restriction is now broken into 3 lines - but it needed custom
padding.
2016-11-11 11:04:18 +08:00
Rajesh Taneja e57c0f41ad MDL-56860 behat: Fixed moodle_list format and printer description 2016-11-11 07:47:34 +08:00
Adrian Greeve f65db49765 MDL-56363 mod_assign: Restrictions added for tutors.
If the grader does not have the accessallgroups capability,
or groups mode is set to separate groups and the user is not
a member of the group then no participants are shown.
2016-11-11 00:28:33 +01:00
Eugene Venter dbd8cadb5c MDL-52216 mod_lesson: prevent invalid view modes 2016-11-11 09:19:37 +13:00
Michael Aherne 51c6d25b3b MDL-56880 webservices: Fix documentation of get_enabled_plugins() 2016-11-10 16:18:06 +00:00
Dan Poltawski 6063f62e7d Merge branch 'MDL-56725-master' of git://github.com/damyon/moodle 2016-11-10 15:37:38 +00:00
Dan Poltawski a3ead7172b Merge branch 'MDL-55249_m32v1' of https://github.com/sbourget/moodle 2016-11-10 15:01:41 +00:00
Dan Poltawski e3cc23ae86 Merge branch 'MDL-56720-master' of git://github.com/junpataleta/moodle 2016-11-10 15:00:21 +00:00
Dan Poltawski 213fc325ad MDL-56652 roles: Add padding to capability filter 2016-11-10 14:44:17 +00:00
Dan Poltawski f41218d9fd Merge branch 'MDL-56652-master' of git://github.com/lameze/moodle 2016-11-10 14:37:00 +00:00
David Mudrák 48ea715da0 MDL-56888 workshop: Fix Leap2A export of the workshop submission
The whole story described in the tracker. Shortly, Mahara seems to have
a bug (or undocumented feature) that it expects the Leap2A content
wrapped in a single container.
2016-11-10 15:30:11 +01:00
Dan Poltawski c220e6d8c7 Merge branch 'MDL-56189-master' of git://github.com/damyon/moodle 2016-11-10 14:06:02 +00:00
Dan Poltawski a4b0cfa3f7 Merge branch 'MDL-56768-master' of git://github.com/damyon/moodle 2016-11-10 13:51:11 +00:00
Dan Poltawski d5d6eda93c Merge branch 'MDL-55777-master' of git://github.com/ankitagarwal/moodle 2016-11-10 13:46:10 +00:00
Dan Poltawski 158ab03e12 Merge branch 'MDL-56190-master' of git://github.com/damyon/moodle 2016-11-10 13:43:35 +00:00
Eloy Lafuente (stronk7) 55f171a1d6 Merge branch 'MDL-53481-master-uniqsqlparam' of git://github.com/mudrd8mz/moodle 2016-11-10 13:11:50 +01:00
Dan Poltawski f670b39e69 Merge branch 'MDL-56602-master-2' of git://github.com/andrewnicols/moodle 2016-11-10 11:26:14 +00:00
Juan Leyva b0f00b3166 MDL-56739 auth: Support new redirect parameter in confirmation 2016-11-10 09:35:21 +00:00
Juan Leyva d6a25bc49a MDL-56739 auth: Support custom confirmation URL 2016-11-10 09:35:21 +00:00
David Mudrák 445aa472b9 MDL-53481 availability: Fix unit test to not execute the huge query
Some DBs have troubles to execute such a huge query as generated in this
test. We do not actually need to execute it. All we need is to make sure
that the parameter placeholders are enumerated correctly. So it is what
this new test does.
2016-11-10 09:52:31 +01:00
Simey Lameze 2e1c739a28 MDL-56652 core_roles: Add BS4 styling to define roles form 2016-11-10 16:46:54 +08:00
Damyon Wiese 560a43f24c MDL-56190 availability: Styling on boost and clean
Update the HTML coming from the JS to include bootstrap classes.
Delete as many styles from boost scss as possible.
Regression test on clean and do final tweaks in less.
2016-11-10 16:30:00 +08:00
Damyon Wiese 930ce60550 MDL-56725 mod_data: better field alignment
Labels containing only accesshide text should have the accesshide class
on the label, not the content so the label does not push the content
down.
2016-11-10 16:25:48 +08:00
Damyon Wiese 398be7c897 MDL-56725 mod_data: coding style
Fixes from lines in the previous commit.
2016-11-10 16:21:01 +08:00
Damyon Wiese e85fda95c6 MDL-56725 mod_data: Style fixes for boost theme 2016-11-10 16:21:01 +08:00
Damyon Wiese 1572a39251 MDL-56768 boost: Special positioning for grader report
Grader report has custom overflow handling which does not cope with a
scrollable content region. So we need to make the content region flow
weirdly out to the right of the page, and push the blocks underneath -
even on really wide screens where it looks bad. We also needed to
upgrade the custom scroll code to handle the margin on the body
changing.
2016-11-10 16:17:49 +08:00
Juan Leyva 1e17258b66 MDL-56268 webservice: Format backtrace to avoid display private data 2016-11-10 16:15:31 +08:00
Simey Lameze face152176 MDL-51347 core_notes: check view notes capability by course context 2016-11-10 16:15:31 +08:00
Tim Hunt cf0b9432d8 MDL-53744 question file access: fix access checks 2016-11-10 16:15:31 +08:00
Juan Leyva 42778e124e MDL-56065 user: Fix update_users Web Service
Users won’t be updated if:
- They are admins and the user updating is not
- They are the guest user
- They are mnet users
- They are deleted users
2016-11-10 16:15:31 +08:00
Dan Poltawski fd9eb89022 Merge branch 'wip-MDL-56855-master' of https://github.com/marinaglancy/moodle 2016-11-10 08:14:42 +00:00
Damyon Wiese f43155b65a MDL-56189 theme_boost: Padding for modgrade form elements 2016-11-10 16:13:34 +08:00
Dan Poltawski da55f3582b Merge branch 'MDL-56705-master' of git://github.com/damyon/moodle 2016-11-10 08:03:37 +00:00
Simey Lameze 1954b9d5c9 MDL-56785 theme_boost: remove unnecessary styling 2016-11-10 15:48:30 +08:00
Damyon Wiese 6fe0b5bd9b MDL-56769 boost: Change last link in settings menu
Was: "Course/Frontpage administration"
Now: "More..."
2016-11-10 15:20:53 +08:00
Damyon Wiese e7bda18de6 MDL-56705 forms: Use [] for multiple values
Some "select" based form elements are not inheriting directly from
MoodleQuickForm_select - so did not have the adjustment to the form
field name that allows multiple values. I moved this fix to the
templateable trait so all the form fields get this fix.
2016-11-10 14:57:58 +08:00
Marina Glancy 69ba7bf659 MDL-56855 media_videojs: MPEG-2 is not supported 2016-11-10 14:46:47 +08:00
Nicholas Hoobin b86c685075 MDL-56417 session: Respect the return value of ignore_timeout_hook. 2016-11-10 14:24:24 +08:00
David Monllao a6fa0d9c97 Merge branch 'MDL-56766-master' of git://github.com/danpoltawski/moodle 2016-11-10 13:54:09 +08:00
Damyon Wiese 16076f1e3d MDL-56811 forum: Auto create the latest news forum
When a course is created or updated, create a news forum if the
newsitems setting is > 0.
2016-11-10 13:51:02 +08:00
David Monllao 8b3a8fa707 Merge branch 'wip-mdl-56397' of https://github.com/rajeshtaneja/moodle 2016-11-10 13:46:37 +08:00
David Monllao 096a418d01 Merge branch 'MDL-56715-master' of https://github.com/xow/moodle 2016-11-10 13:19:01 +08:00
Ankit Agarwal f2330472f0 MDL-55777 installation: Check libcurl version on install 2016-11-10 10:16:19 +05:30
Andrew Nicols 3302e8bfa5 Merge branch 'MDL-56820-master' of https://github.com/snake/moodle 2016-11-10 12:20:17 +08:00
Andrew Nicols 002ea88630 Merge branch 'MDL-54646-master' of git://github.com/junpataleta/moodle 2016-11-10 11:46:59 +08:00
Jake Dallimore 700ef87691 MDL-56820 themes: Fix user search drop down on grading page for boost
Fixes a problem where the drop down list is cut off by overflow.
2016-11-10 11:45:59 +08:00
Andrew Nicols 3b77723701 Merge branch 'MDL-56051-master' of git://github.com/damyon/moodle 2016-11-10 11:45:01 +08:00
David Monllao 5473943cac Merge branch 'MDL-56832-master' of git://github.com/danpoltawski/moodle 2016-11-10 11:43:51 +08:00
David Monllao af49935a53 Merge branch 'MDL-56753-master' of git://github.com/lameze/moodle 2016-11-10 11:38:24 +08:00
John Okely eea9f10900 MDL-56715 form: Allow password unmask fields to be cleared in FF49 2016-11-10 11:22:59 +08:00
Simey Lameze 763f7b05ae MDL-56753 mod_assign: behat tests for groups and grouping counting 2016-11-10 11:09:37 +08:00
Andrew Nicols 96eba6b982 Merge branch 'MDL-55883_m32v1' of https://github.com/sbourget/moodle 2016-11-10 11:06:11 +08:00
Tomasz Muras ff1fc4d9f4 MDL-54646 tags: Hide manage tags in menu if tags disabled. 2016-11-10 10:59:06 +08:00
Simey Lameze 426bb5ae0f MDL-56753 mod_assign: fix groups and submitted counting on grading summary
This also fixes a coding error that was displayed when a group was not part of
assignment grouping.
2016-11-10 10:58:29 +08:00
Andrew Nicols b8af6c1ef0 Merge branch 'MDL-56585-master' of git://github.com/danpoltawski/moodle 2016-11-10 09:53:28 +08:00
Andrew Nicols 743f9c8c42 Merge branch 'wip-mdl-56840' of https://github.com/rajeshtaneja/moodle 2016-11-10 09:38:26 +08:00
Andrew Nicols a6f85967e0 Merge branch 'MDL-56754-master' of git://github.com/jleyva/moodle 2016-11-10 08:29:04 +08:00
Andrew Nicols 9d75a519f3 MDL-56602 themes: Use version number as base themerev 2016-11-10 08:02:31 +08:00
Adam Olley d456bd42c3 MDL-56823 session: redis sessions don't honour $CFG->sessiontimeout
The redis session handler doesn't use the sessiontimeout config setting
to determine session lifetime.

It has a lock expiry, which is set to 7200 (or a config setting) that is
used to determine how long a lock is held onto, but that should be
distinct from the session timeout.
2016-11-10 10:30:04 +10:30
Juan Leyva 6406431537 MDL-56839 upgrade.txt: Fix incorrect information in lib/upgrade.txt 2016-11-09 21:00:33 +00:00
Dan Poltawski 757aef2334 MDL-56766 calendar: improve calendar export labels 2016-11-09 17:00:05 +00:00
Dan Poltawski 2c212753fe MDL-56585 tool_lpimportcsv: adjust help popups 2016-11-09 16:11:41 +00:00
Dan Poltawski bc2aaef4fa MDL-56832 theme_boost: Mention CSS in setting description 2016-11-09 14:50:07 +00:00
Dan Poltawski 224789b79c Merge branch 'MDL-56863-master' of git://github.com/jleyva/moodle 2016-11-09 14:38:26 +00:00
Juan Leyva 678555b499 MDL-56863 tool_mobile: Capture moodle_exception in get_autologin_key 2016-11-09 13:20:49 +00:00
Dan Poltawski 793fe29014 Merge branch 'MDL-48498-master-iv6-undefinedfix' of https://github.com/snake/moodle 2016-11-09 12:16:03 +00:00
Juan Leyva 82f5802a94 MDL-56754 course: Stealth sections should be handled
Right now this WS is returning all the sections without advising if is
a stealth section or not, this have some implications (in the mobile
app right now the stealth sections are displayed)
2016-11-09 09:38:46 +00:00
Andrew Nicols a2567336df Merge branch 'MDL-56755-m' of https://github.com/micaherne/moodle 2016-11-09 15:42:32 +08:00
Andrew Nicols 4cc6477198 Merge branch 'MDL-56790-master' of git://github.com/damyon/moodle 2016-11-09 15:40:16 +08:00
Damyon Wiese b8396c335a MDL-56662 boost: Don't mess with display, set min-height
Changing the display was messing with the layout of some things in the
file picker. Lets set the min-height instead which has less
side-effects.
2016-11-09 15:14:24 +08:00
Damyon Wiese eacf30e61f MDL-56051 blocks: Support drag and drop blocks in boost. 2016-11-09 14:42:18 +08:00
Andrew Nicols 55a3911408 Merge branch 'MDL-56726-master-cfgadmin' of git://github.com/mudrd8mz/moodle 2016-11-09 14:37:47 +08:00
David Monllao 4e2ae9caee Merge branch 'MDL-56596-master-fix' of git://github.com/andrewnicols/moodle 2016-11-09 14:35:41 +08:00
David Monllao 33788800ec Merge branch 'MDL-56133' of https://github.com/NeillM/moodle 2016-11-09 14:23:50 +08:00
David Monllao 3f066469af Merge branch 'wip-mdl-56630-fix2' of git://github.com/rajeshtaneja/moodle 2016-11-09 14:14:51 +08:00
Andrew Nicols f2dab83445 MDL-56596 tool_usertours: Update to tours v0.9.9 2016-11-09 14:10:31 +08:00
David Monllao 38b74ef717 Merge branch 'MDL-56662-master' of git://github.com/damyon/moodle 2016-11-09 13:58:01 +08:00
Rajesh Taneja d514d25e0a MDL-56630 behat: Click on link in specificed block/region 2016-11-09 13:56:49 +08:00
Damyon Wiese f87084f8f1 MDL-56662 theme_boost: Filepickers have 0 height
We need to set a display value on the file picker body so the inline height is ignored.
2016-11-09 13:55:45 +08:00
Rajesh Taneja 26ca972e9e MDL-56840 behat: Wait till pdf conversion progress is finished 2016-11-09 13:39:00 +08:00
Damyon Wiese ba4173384d MDL-56853 mod_folder: Review styles in boost
Remove random center-alignment and put buttons on a single line.
2016-11-09 13:35:08 +08:00
Rajesh Taneja bd955bfea7 MDL-56397 behat: updated composer.lock to use behat 3.2.2
Behat 3.2.2 fixes transformation issue
2016-11-09 13:31:22 +08:00
David Monllao 6e986b2919 Merge branch 'mdl-54852-master' of https://github.com/Dagefoerde/moodle 2016-11-09 13:07:26 +08:00
David Monllao 0c499e0a5c Merge branch 'MDL-53481-master-uniqsqlparam' of git://github.com/mudrd8mz/moodle 2016-11-09 12:49:17 +08:00
David Monllao 7ecf7511f8 Merge branch 'MDL-56694-master' of git://github.com/lameze/moodle 2016-11-09 12:24:17 +08:00
Andrew Nicols 16f9660cfe Merge branch 'MDL-56196-master' of git://github.com/damyon/moodle 2016-11-09 11:59:02 +08:00
Jake Dallimore c02778ac30 MDL-48498 admin: fix get_setting return for mixedhostiplist setting 2016-11-09 11:32:58 +08:00
Damyon Wiese 50302c404a MDL-56790 boost: Styling fixes for mod_feedback
Also fixed are problems with frozen select from elements showing raw
HTML. I checked the other form templates for similar problems and fixed
them all.
2016-11-09 11:29:58 +08:00
Andrew Nicols cfa4b26231 Merge branch 'MDL-56792-master-v2' of git://github.com/lameze/moodle 2016-11-09 11:27:57 +08:00
Simey Lameze cff1f90adf MDL-56792 core_charts: clean html content from title and labels
This commit add cleanData() and call it from all places that has labels or title
to guarantee that html content will not be printed on the chart.
2016-11-09 10:41:12 +08:00
Damyon Wiese 64a5bc94e9 MDL-56846 mod_survey: Fix styles in boost
Add bootstrap classes to form fields and remove random centered text.
2016-11-09 10:02:26 +08:00
Andrew Nicols 43bdbbf682 Merge branch 'MDL-56607-master' of git://github.com/jleyva/moodle 2016-11-09 09:39:48 +08:00
Damyon Wiese 3ae54e045a MDL-56845 admin: Change default for adminlinkcategories
Change the default for adminlinkcategories from false to true because it
helps navigate the site admin settings in boost.
2016-11-09 09:37:37 +08:00
Eloy Lafuente (stronk7) 6c5ee657a7 Merge branch 'MDL-56699-master' of git://github.com/damyon/moodle 2016-11-09 02:11:55 +01:00
David Monllao 0cbfb7ff2a Merge branch 'MDL-56409-master' of git://github.com/ankitagarwal/moodle 2016-11-09 08:36:36 +08:00
Stephen Bourget 3bf46ee717 MDL-55566 chat: Improve next scheduled chat message 2016-11-08 16:00:05 -05:00
Stephen Bourget 3a2f9a2ea4 MDL-55869 mod_chat: Only create calendar events when chat is published 2016-11-08 14:57:32 -05:00
Dan Poltawski 231e2ec99a Merge branch 'MDL-56555-master' of git://github.com/andrewnicols/moodle 2016-11-08 17:56:12 +00:00
Dan Poltawski e20c8ddc80 Merge branch 'MDL-48498-master-iv6' of https://github.com/snake/moodle 2016-11-08 17:51:17 +00:00
Dan Poltawski 674c4f6891 Merge branch 'MDL-56596-master' of git://github.com/andrewnicols/moodle 2016-11-08 13:43:54 +00:00
David Mudrák 93f4f3494a MDL-53481 availability: Fix uniqueness of SQL named param placeholders
Static variables do not behave the way you might expect when accessing
them through the classes inheritance. When accessing a method via self::
or static:: operators, even though the method is inherited, its variable
scope is not. So the method unique_sql_parameter() was using the scope
of the child class and each child class had its own sequence of usp1,
usp2, usp3, ... placeholders. This led to "Incorrect number of query
parameters" error when multiuple condition classes were contributing to
a single SQL query.

All credit should go to Adam Olley who debugged and described the
essence of the problem in the tracker.
2016-11-08 13:36:07 +01:00
Neill Magill 6a6f2e1ca6 MDL-56133 tool_langimport: Changes should be visible after import
Before this change if a language pack was updated by the
\tool_langimport\task\update_langpacks_task scheduled task, changes
would not be available to users until an admin manually cleared the
strings cache.

This change causes the cache to purged when a language pack it update,
this will cause it to rebuild so users will start seeing updates
automatically.
2016-11-08 10:56:56 +00:00
Juan Leyva 9d92a3a6ba MDL-56607 settings: Remove Mobile settings from WS overview 2016-11-08 09:52:16 +00:00
Michael Aherne db8514bcff MDL-56755 assign: Improve documentation of assign::get_grade_item() 2016-11-08 08:58:31 +00:00
Ankit Agarwal 20ab51fdbc MDL-56409 messages: Save one db query per page load 2016-11-08 12:50:30 +05:30
Jake Dallimore 605bab84ce MDL-48498 core_files: Add security helper to curl class
Allow injection of security_helper objects into curl, but default
to a core helper tied to http security settings values.
2016-11-08 15:11:15 +08:00
Jake Dallimore f6d9efefaa MDL-48498 core_files: curl_security_helper_base and implementation
Base class and core implementation providing a means to check URLs
against the curl security admin settings entries.
2016-11-08 15:11:15 +08:00
Jake Dallimore 067268942c MDL-48498 admin: new setting types for curl host/port restrictions
Two new classes in lib/adminlib. One providing validation for a
newline-delimited textarea supporting domain names, domain wildcards,
IPv4/IPv6 addresses and IPv4/IPv6 ranges. The second providing
validation for a newline-delimited textarea of port numbers.
2016-11-08 15:10:35 +08:00
Simey Lameze d138d6e2ac MDL-56694 theme_boost: center login button in filepicker 2016-11-08 15:01:03 +08:00
Damyon Wiese 9280f62e38 MDL-56196 mod_lti: Fix popups and secret form in boost 2016-11-08 14:27:26 +08:00
Frédéric Massart 3d979f9676 MDL-56196 mod_lti: Adapt templates for both Boost and Clean 2016-11-08 14:11:14 +08:00
Andrew Nicols 592c691c8f MDL-56555 tool_usertours: Update tool sharing link 2016-11-08 13:51:11 +08:00
Henning Bostelmann c448ab3f44 MDL-54871 mod_data: Remove text field when forced name present 2016-11-07 21:59:37 +00:00
Juan Leyva 0c6c86643e MDL-56607 settings: Move mobile settings to top-level
AMOS BEGIN
 MOV [mobilecssurl,core_admin],[mobilecssurl,tool_mobile]
 MOV [configmobilecssurl,core_admin],[configmobilecssurl,tool_mobile]
AMOS END

From Plugins / Web Services / Mobile to Appearance / Mobile
2016-11-07 09:53:29 +00:00
Jan Dageförde f928c24dcc MDL-54852 assignment: Suppress "leave page" warning after save
If the user navigates away from the grading page immediately
after saving the grading form, the browser warning can be
safely omitted, as there are no unsaved changes. This is achieved
by calling `reset_form_dirty_state()` of the core_formchangechecker
YUI module, which is responsible for the warning.
2016-11-07 10:35:06 +01:00
Ankit Agarwal 55af4309f7 MDL-56409 messages: Do not fetch notifications if they are disabled 2016-11-07 09:59:11 +05:30
Henning Bostelmann f8b56ac904 MDL-55994 blog: Resolve warning messages in RSS feed generation 2016-11-06 17:38:26 +00:00
David Mudrák abcd53444b MDL-56726 admin: Fix some hard-coded paths to the admin directory 2016-11-03 09:54:28 +01:00
Jun Pataleta 3c7387722d MDL-56720 tool_lp: Do not push empty values to IDs array 2016-11-03 14:09:40 +08:00
Neill Magill bd305a3973 MDL-55209 coursecat: Should be able to remove category idnumber
Users should be able to remove an idnumber from a category, before this
change when trying to delete an idnumber users would be told it already
existed.

This change also stops 0 from being allowed multiple times as an idnumber.
2016-11-02 09:50:34 +00:00
Neill Magill c10bfee49f MDL-55209 coursecat: Should be able to remove category idnumber test
A user should be able to remove an idnumber from a category, also 0
should not be allowed multiple times.
2016-11-02 09:50:30 +00:00
Damyon Wiese a053229f0f MDL-56690 theme_boost: Allow menus to scroll in the header
The header is fixed - so if menus in the header are longer than the page, you can't scroll
to the bottom of the menu. This sets max height on the menus to the viewport height - the navbar height and sets them to scroll
auto.
2016-11-02 15:48:49 +08:00
Damyon Wiese 88e709ae43 MDL-56699 boost: Don't break when activities use onclick in nav
Boost templates were not nicely rendering onclick handlers in the navbar.
2016-11-02 13:35:54 +08:00
Andrew Nicols 8385163bab MDL-56596 tool_usertours: Update to latest version of tours and popper
The updated release of the popper library addresses some issues where
boundaries were not resepected correctly.
2016-11-02 11:37:31 +08:00
Mike Churchward a620c573bc MDL-48055 q_u_outline, q_u_complete: added checks for grade visibility. 2016-11-01 14:14:51 -04:00
Stephen Bourget c5176b2968 MDL-55249 mod_feedback: Associate status with current activity
The status screen in mod_feedback simply checks to see if there are any
attempts in progress to return the user status.  This check should be
limited to only include instances of the current feedback activity not
any feedback activity on the site.
2016-10-30 16:01:20 -04:00
Dan Marsden 97223bb356 MDL-56358 tool_lp tool_cohortroles: allow null idnumber 2016-10-28 12:00:44 +13:00
Stephen Bourget 9ff8cdd971 MDL-55883 mod_lesson: Missing include in lesson_update_events 2016-10-26 21:22:01 -04:00
472 changed files with 28141 additions and 24370 deletions
+1 -1
View File
@@ -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');
}
+27
View File
@@ -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>
+10
View File
@@ -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
View File
@@ -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();
}
+6 -3
View File
@@ -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().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$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().'&nbsp;'.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').'&nbsp;'.$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">
+2 -1
View File
@@ -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();
+4 -2
View File
@@ -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().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.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').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>"
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/>
</div>
</td>
<td id="potentialcell">
+2 -1
View File
@@ -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').'&nbsp;'.$OUTPUT->help_icon('roleshortname', 'core_role'), $this->get_shortname_field('shortname'));
$this->print_field('name', get_string('customrolename', 'core_role').'&nbsp;'.$OUTPUT->help_icon('customrolename', 'core_role'), $this->get_name_field('name'));
$this->print_field('edit-description', get_string('customroledescription', 'core_role').'&nbsp;'.$OUTPUT->help_icon('customroledescription', 'core_role'),
$this->get_description_field('description'));
$this->print_field('menuarchetype', get_string('archetype', 'core_role').'&nbsp;'.$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>';
}
+1 -1
View File
@@ -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" />
+7 -4
View File
@@ -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);
+4 -2
View File
@@ -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');
+6 -3
View File
@@ -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')));
+8 -1
View File
@@ -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'));
-1
View File
@@ -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');
}
File diff suppressed because one or more lines are too long
+1
View File
@@ -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 */ {
+2 -1
View File
@@ -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);
+1
View File
@@ -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}}&amp;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}}&amp;pagecontextid={{pagecontextid}}&amp;return=templates">
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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}}&amp;userid={{userid}}&amp;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}}&amp;userid={{userid}}&amp;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();
+14 -6
View File
@@ -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;
+3 -9
View File
@@ -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;
}
}
+8 -2
View File
@@ -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.';
+22 -6
View File
@@ -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,25 @@ 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);
$PAGE->set_url('/local/mobile/launch.php', array('service' => $serviceshortname, 'passport' => $passport, 'urlscheme' => $urlscheme));
// 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);
$params = array('service' => $serviceshortname, 'passport' => $passport, 'urlscheme' => $urlscheme, 'confirmed' => $confirmed);
$PAGE->set_url("/$CFG->admin/tool/mobile/launch.php", $params);
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(
+36 -23
View File
@@ -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);
}
}
+17 -6
View File
@@ -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);
+1 -1
View File
@@ -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);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+104 -45
View File
@@ -37,6 +37,20 @@ function Tour(config) {
*/
Tour.prototype.tourName;
/**
* The name of the tour storage key.
*
* @property {String} storageKey
*/
Tour.prototype.storageKey;
/**
* The session storage object
*
* @property {Storage} storage
*/
Tour.prototype.storage;
/**
* The original configuration as passed into the constructor.
*
@@ -120,6 +134,14 @@ Tour.prototype.init = function (config) {
// Apply configuration.
this.configure.apply(this, arguments);
try {
this.storage = window.sessionStorage;
this.storageKey = 'tourstate_' + this.tourName;
} catch (e) {
this.storage = false;
this.storageKey = '';
}
return this;
};
@@ -280,6 +302,15 @@ Tour.prototype.getCurrentStepNumber = function () {
*/
Tour.prototype.setCurrentStepNumber = function (stepNumber) {
this.currentStepNumber = stepNumber;
if (this.storage) {
try {
this.storage.setItem(this.storageKey, stepNumber);
} catch (e) {
if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
this.storage.removeItem(this.storageKey);
}
}
}
};
/**
@@ -521,6 +552,10 @@ Tour.prototype.normalizeStepConfig = function (stepConfig) {
attachPoint: 'after'
}, stepConfig);
if (stepConfig.attachTo) {
stepConfig.attachTo = $(stepConfig.attachTo).first();
}
return stepConfig;
};
@@ -612,7 +647,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 +774,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 +789,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 +807,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 +846,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();
}
@@ -944,6 +988,16 @@ Tour.prototype.handleKeyDown = function (e) {
* @chainable
*/
Tour.prototype.startTour = function (startAt) {
if (this.storage && typeof startAt === 'undefined') {
var storageStartValue = this.storage.getItem(this.storageKey);
if (storageStartValue) {
var storageStartAt = parseInt(storageStartValue, 10);
if (storageStartAt <= this.steps.length) {
startAt = storageStartAt;
}
}
}
if (typeof startAt === 'undefined') {
startAt = this.getCurrentStepNumber();
}
@@ -1120,15 +1174,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 +1218,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 +1259,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 +1322,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 +1426,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 +1461,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';
+11 -4
View File
@@ -76,15 +76,22 @@ EOF;
/**
* Fetch all enabled tours matching the specified target.
*
* @param string $targetmatch The URL to match.
* @param moodle_url $targetmatch The URL to match.
*/
public static function get_matching_tourdata($targetmatch) {
public static function get_matching_tourdata(\moodle_url $targetmatch) {
$tours = self::get_enabled_tourdata();
return array_filter($tours, function($tour) use ($targetmatch) {
// Attempt to determine whether this is the front page.
// This is a special case because the frontpage uses a shortened page path making it difficult to detect exactly.
$isfrontpage = $targetmatch->compare(new \moodle_url('/'), URL_MATCH_BASE);
$target = $targetmatch->out_as_local_url();
return array_filter($tours, function($tour) use ($isfrontpage, $target) {
if ($isfrontpage && $tour->pathmatch === 'FRONTPAGE') {
return true;
}
$pattern = preg_quote($tour->pathmatch, '@');
$pattern = str_replace('%', '.*', $pattern);
return !!preg_match("@{$pattern}@", $targetmatch);
return !!preg_match("@{$pattern}@", $target);
});
}
+2 -4
View File
@@ -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',
],
@@ -561,7 +559,7 @@ class manager {
public static function get_matching_tours(\moodle_url $pageurl) {
global $PAGE;
$tours = cache::get_matching_tourdata($pageurl->out_as_local_url());
$tours = cache::get_matching_tourdata($pageurl);
foreach ($tours as $record) {
$tour = tour::load_from_record($record);
+3 -1
View File
@@ -608,6 +608,8 @@ class tour {
* This is used in the session cookie to determine whether the user has seen this tour before.
*/
public function get_tour_key() {
global $USER;
$tourtime = $this->get_config('majorupdatetime', null);
if ($tourtime === null) {
@@ -622,7 +624,7 @@ class tour {
$tourtime = max($tourtime, $userresetdate);
}
return sprintf('tool_usertours_%d_%s', $this->get_id(), $tourtime);
return sprintf('tool_usertours_%d_%d_%s', $USER->id, $this->get_id(), $tourtime);
}
/**
+21 -52
View File
@@ -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';
@@ -86,41 +79,33 @@ Some example values include:
* /my/% - to match the Dashboard
* /course/view.php?id=2 - to match a specific course
* /mod/forum/view.php% - to match the forum discussion list
* /user/profile.php% - to match the user profile page';
* /user/profile.php% - to match the user profile page
If you wish to display a tour on the Site Home page, you can use the value: "FRONTPAGE".
';
$string['placement'] = 'Placement';
$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 +121,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 +132,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.';
+19 -1
View File
@@ -150,6 +150,14 @@ class cache_testcase extends advanced_testcase {
'name' => 'my_glob_2',
'pathmatch' => '/my/%'
],
(object) [
'name' => 'frontpage_only',
'pathmatch' => 'FRONTPAGE'
],
(object) [
'name' => 'frontpage_match',
'pathmatch' => '/?%'
],
];
return [
@@ -163,6 +171,16 @@ class cache_testcase extends advanced_testcase {
'/my/view.php',
['my_exact_1', 'my_glob_1', 'my_glob_2'],
],
'Special constant FRONTPAGE must match front page only' => [
$tourconfigs,
'/',
['frontpage_only'],
],
'Standard frontpage URL matches both the special constant, and a correctly formed pathmatch' => [
$tourconfigs,
'/?redirect=0',
['frontpage_only', 'frontpage_match'],
],
];
}
@@ -181,7 +199,7 @@ class cache_testcase extends advanced_testcase {
$this->helper_create_step((object) ['tourid' => $tour->get_id()]);
}
$matches = \tool_usertours\cache::get_matching_tourdata((new moodle_url($targetmatch))->out_as_local_url());
$matches = \tool_usertours\cache::get_matching_tourdata(new moodle_url($targetmatch));
$this->assertCount(count($expected), $matches);
for ($i = 0; $i < count($matches); $i++) {
+6 -6
View File
@@ -729,7 +729,7 @@ class tour_testcase extends advanced_testcase {
$this->greaterThanOrEqual($time),
true,
null,
sprintf('tool_usertours_%d_%s', $id, $time),
sprintf('tool_usertours_\d_%d_%s', $id, $time),
],
'Initial tour time, no user pref' => [
@@ -738,7 +738,7 @@ class tour_testcase extends advanced_testcase {
null,
false,
null,
sprintf('tool_usertours_%d_%s', $id, $time),
sprintf('tool_usertours_\d_%d_%s', $id, $time),
],
'Initial tour time, with user reset lower' => [
$id,
@@ -746,7 +746,7 @@ class tour_testcase extends advanced_testcase {
null,
false,
$time - DAYSECS,
sprintf('tool_usertours_%d_%s', $id, $time),
sprintf('tool_usertours_\d_%d_%s', $id, $time),
],
'Initial tour time, with user reset higher' => [
$id,
@@ -754,7 +754,7 @@ class tour_testcase extends advanced_testcase {
null,
false,
$time + DAYSECS,
sprintf('tool_usertours_%d_%s', $id, $time + DAYSECS),
sprintf('tool_usertours_\d_%d_%s', $id, $time + DAYSECS),
],
];
}
@@ -823,8 +823,8 @@ class tour_testcase extends advanced_testcase {
set_user_preference(\tool_usertours\tour::TOUR_REQUESTED_BY_USER . $id, $userpref);
}
$this->assertEquals(
$expectation,
$this->assertRegExp(
'/' . $expectation . '/',
$tour->get_tour_key()
);
}
+2 -2
View File
@@ -4,14 +4,14 @@
<location>amd/src/tour.js</location>
<name>Flexitour</name>
<license>GPLv3</license>
<version>0.9.7</version>
<version>0.9.10</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>
+1 -1
View File
@@ -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
View File
@@ -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) {
+17 -3
View File
@@ -202,7 +202,9 @@ 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_LOCALURL, 'Redirect the user to this site url after confirmation.',
VALUE_DEFAULT, ''),
)
);
}
@@ -220,13 +222,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 Site 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 +247,7 @@ class auth_email_external extends external_api {
'recaptchachallengehash' => $recaptchachallengehash,
'recaptcharesponse' => $recaptcharesponse,
'customprofilefields' => $customprofilefields,
'redirect' => $redirect,
)
);
@@ -324,7 +329,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,
+2 -13
View File
@@ -61,18 +61,7 @@ class behat_auth extends behat_base {
* @Given /^I log out$/
*/
public function i_log_out() {
// There is no longer any need to worry about whether the navigation
// bar needs to be expanded; user_menu now lives outside the
// hamburger.
// However, the user menu *always* needs to be expanded. if running JS.
if ($this->running_javascript()) {
$xpath = "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]";
$this->execute('behat_general::i_click_on', array($xpath, "xpath_element"));
}
// No need to check for exceptions as it will checked after this step execution.
$this->execute('behat_general::click_link', get_string('logout'));
// Click on logout link in footer, as it's much faster.
$this->execute('behat_general::i_click_on_in_the', array(get_string('logout'), 'link', '#page-footer', "css_element"));
}
}
+2
View File
@@ -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 ===
+7 -2
View File
@@ -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"
@@ -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 @@
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"]});
@@ -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 &&
+6 -4
View File
@@ -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) {
@@ -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="&gt;=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
'<option value="&lt;">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
'</select></label></span> ' + this.html;
@@ -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="&gt;=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="&lt;">'+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="&gt;=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="&lt;">'+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"]});
@@ -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="&gt;=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
'<option value="&lt;">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
'</select></label></span> ' + this.html;
+3 -2
View File
@@ -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="&gt;=">' + M.util.get_string('direction_from', 'availability_date') + '</option>' +
'<option value="&lt;">' + M.util.get_string('direction_until', 'availability_date') + '</option>' +
'</select></label></span> ' + this.html;
@@ -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 @@
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"]});
@@ -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
View File
@@ -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 &&
@@ -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 @@
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"]});
@@ -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
View File
@@ -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) {
@@ -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 @@
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"]});
@@ -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
View File
@@ -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 &&
@@ -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 @@
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"]});
@@ -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
View File
@@ -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 &&
+57
View File
@@ -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.
*/
@@ -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') + '" />');
File diff suppressed because one or more lines are too long
@@ -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') + '" />');
+22 -18
View File
@@ -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') + '" />');
+8
View File
@@ -4331,6 +4331,14 @@ class restore_create_categories_and_questions extends restore_structure_step {
}
$data->contextid = $mapping->parentitemid;
// Before 3.1, the 'stamp' field could be erroneously duplicated.
// From 3.1 onwards, there's a unique index of (contextid, stamp).
// If we encounter a duplicate in an old restore file, just generate a new stamp.
// This is the same as what happens during an upgrade to 3.1+ anyway.
if ($DB->record_exists('question_categories', ['stamp' => $data->stamp, 'contextid' => $data->contextid])) {
$data->stamp = make_unique_id_code();
}
// Let's create the question_category and save mapping
$newitemid = $DB->insert_record('question_categories', $data);
$this->set_mapping('question_category', $oldid, $newitemid);
@@ -628,7 +628,9 @@ abstract class backup_controller_dbops extends backup_dbops {
$locked = $uselocks && (get_config('backup', $config.'_locked') == true);
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setting($settingname);
if ($setting->get_value() != $value || 1==1) {
// We can only update the setting if it isn't already locked by config or permission.
if ($setting->get_status() !== base_setting::LOCKED_BY_CONFIG
&& $setting->get_status() !== base_setting::LOCKED_BY_PERMISSION) {
$setting->set_value($value);
if ($locked) {
$setting->set_status(base_setting::LOCKED_BY_CONFIG);
+69 -16
View File
@@ -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');
+2 -2
View File
@@ -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();
@@ -65,14 +65,6 @@ class block_course_summary extends block_base {
$context = context_course::instance($this->page->course->id);
$this->page->course->summary = file_rewrite_pluginfile_urls($this->page->course->summary, 'pluginfile.php', $context->id, 'course', 'summary', NULL);
$this->content->text = format_text($this->page->course->summary, $this->page->course->summaryformat, $options);
if ($this->page->user_is_editing()) {
if($this->page->course->id == SITEID) {
$editpage = $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=frontpagesettings';
} else {
$editpage = $CFG->wwwroot.'/course/edit.php?id='.$this->page->course->id;
}
$this->content->text .= "<div class=\"editbutton\"><a href=\"$editpage\"><img src=\"" . $OUTPUT->pix_url('t/edit') . "\" alt=\"".get_string('edit')."\" /></a></div>";
}
$this->content->footer = '';
return $this->content;
@@ -29,15 +29,6 @@ Feature: Course summary block used in a course
And I should see "Course summary" in the "Course summary" "block"
And I should see "Proved the course summary block works!" in the "Course summary" "block"
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And I click on ".editbutton a" "css_element" in the "Course summary" "block"
Then I should see "Edit course settings" in the "h2" "css_element"
Scenario: Teacher can not see edit icon when edit mode is off
When I log in as "teacher1"
And I follow "Course 1"
@@ -22,15 +22,6 @@ Feature: Course summary block used on the frontpage
And I should not see "Course summary" in the "Course/site summary" "block"
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
When I log in as "admin"
And I am on site homepage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And I click on ".editbutton a" "css_element" in the "Course/site summary" "block"
Then I should see "Front page settings" in the "h2" "css_element"
Scenario: Admin can not see edit icon when edit mode is off
When I log in as "admin"
And I am on site homepage
+13 -7
View File
@@ -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
View File
@@ -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));

Some files were not shown because too many files have changed in this diff Show More