MDL-64506 theme: Update BSB references and upgrade texts
[moodle.git] / theme / upgrade.txt
CommitLineData
0f704140
PS
1This files describes API changes in /theme/* themes,
2information provided here is intended especially for theme designer.
edb7d5ad 3
e994dea0
AN
4=== 3.7 ===
5* The core/form_autocompelte_input template now has a `data-tags` attribute.
1baadc87
MM
6* Boost theme renderer overrides have now been migrated to core.
7* Renderers that were overridden by Boost are now in Bootstrapbase
8* Core templates in Boost have now moved into core
9* Templates that were overridden by boost are now located in Bootstrapbase
a5a6df54 10* Themes bootstrapbase, clean & more have now been removed.
e994dea0 11
a266ae30
TH
12=== 3.6 ===
13
fed67b67
BB
14* A new callback has been added to the theme layout files allowing plugins to inject their content
15 into the page. For Boost it was added as a mustache variable "{{{ output.standard_after_main_region_html }}}" in
16 templates/columns1.mustache and templates/columns2.mustache. In bootstrapbase it was added as a
17 function call "$OUTPUT->standard_after_main_region_html()" in layout/columns1.php, layout/columns2.php.
18 and layout/columns3.php. Child themes not inheriting these templates should add the function call
19 after the div containing the main content region. Please refer to the messaging drawer UI for an example of
20 making use of this new feature.
a266ae30
TH
21* The body tag has various browser-specific classes for those cases where some
22 browser-sniffing is unavoidable. This used not to recognised Microsoft Edge,
23 but now it does (class 'edge'). Also, both Safari and Chrome used to be
24 class 'safari', but now there are separate classes 'safari' and 'chrome'.
25 The body's class should change to match the browser:
26 - Google Chrome (Mac & Window): The body class should change from safari to chrome.
27 - Google Chrome (Android) : The body class should change from safari, android to chrome, android.
28 - Microsoft Edge: The body class should change from safari to edge.
29 - Mobile safari: The class ios should exist, safari class should be removed.
30* Remove class .safari styling from activity chooser dialog for theme boost and bootstrapbase.
216b8947
MG
31* The following functions and classes have been finally deprecated and can not be used anymore:
32 * css_is_colour()
33 * css_is_width()
34 * css_sort_by_count()
db03bff7 35 * core_course_renderer::add_modchoosertoggle()
216b8947 36 * class css_optimiser
a266ae30 37
46676b76
AB
38=== 3.4 ===
39
40* There was a mustache template login.mustache in /lib/templates/ rendering the login form
41 and a template with the same name in /theme/boost/templates/ rendering the pagelayout "login".
42 To prevent misunderstanding when overriding one of these templates in a Boost child theme,
43 the first one was renamed to loginform.mustache - see MDL-58970.
d7d2a72f
AB
44* The Boost flat navigation nodes now have several data-attributes which let plugin developers
45 access properties from the underlying navigation nodes in the browser - see MDL-59425.
d8cb4615
MN
46* Navigation between activities via a previous and next link was added to Boost, Clean and Bootstrapbase. This
47 is made possible by a new function core_renderer->activity_navigation().
4a8dfef0
JB
48* Theme designers may now place the Reset tour on this page link where required by adding an empty
49 container (e.g. <div class="tool_usertours-resettourcontainer"></div>) to their layouts.
46676b76 50
f745b812
DP
51=== 3.3 ===
52
53* As boost-based themes no longer use the moodle-core-popuphelp help popups, the javascript
54 setup for this module have been moved from core standard_head_html to the bootstrapbase
55 renderer. If your theme needs this javascript you will need to ensure the bootstrap renderer
56 is called, or require the JS yourself
57
2258b4dc
FM
58=== 3.2 ===
59
862816ee
FM
60* Removed themes: base, canvas
61 During the upgrade process the themes will be uninstalled and all their settings will be deleted.
62 If you wish to keep your theme and its settings, download it from moodle.org and put it back in
63 the theme/ directory BEFORE UPGRADING.
2ede86d7 64* Bootstrap 4 was added as part of a the new theme 'boost'.
862816ee
FM
65* Some backwards and forwards compatibility has been added for different bootstrap versions.
66 This is to allow the same markup to work in "clean" and "boost" themes a lot of the time.
67 It is also to allow user text with bootstrap classes to keep working in the new theme.
d3c35f93
FM
68* Using .dir-rtl for RTL styling is deprecated and should not be used any more. From now
69 the styles are automatically flipped when the language is right-to-left. However,
70 as this is not always perfect, you can define exceptions. Please refer to the documentation
71 of the tool RTLCSS-PHP for more information: https://github.com/moodlehq/rtlcss-php
862816ee
FM
72* Themes can now automatically compile SCSS on the fly. This works the same way as it
73 does compiling LESS on the fly, effecitvely adding $THEME->scss to your config. The
74 latter can either be the name a SCSS file (without extension) in your theme's scss/ folder,
75 or a Closure which will return the main SCSS content.
76* Two new callbacks allow themes to inject SCSS code before and after the content provided
77 by the SCSS file $THEME->scss. See $THEME->prescsscallback and $THEME->extrascsscallback.
78* A new callback can be defined to post process the CSS using an object representation
79 of the CSS tree ($THEME->csstreepostprocess). This gives a lot more flexibility than a
80 simple find and replace. Refer to 'boost' for an example, and to PHP-CSS-Parser.
81 (https://github.com/sabberworm/PHP-CSS-Parser) for the API.
82* A new core setting now enables admins to upload the logos of their site. Using the
83 following methods, themers can instantly support branding logos without the need
84 to implement specific theme settings:
85 * $OUTPUT->get_logo_url($maxwidth, $maxheight);
86 * $OUTPUT->get_compact_logo_url($maxwidth, $maxheight);
d3c35f93
FM
87* The class .dir-ltr should not be used any more. To force LTR styles use the directive
88 to remove the rule when the language is RTL. See RTLCSS-PHP for more information.
113efed5
FM
89* A new class .text-ltr may be used to force the direction to LTR. This is especially useful
90 for forms fields (numbers, emails, URLs must not be RTL'd), and for displaying code
91 snippets or configuration samples.
9d1402ab 92* A new theme config 'requiredblocks' allows a theme to define which blocks are deletable.
4f2378d9
FM
93* You may no longer override the following core_course_renderer methods.
94 See course/upgrade.txt for more information:
95 - course_modchooser_module_types
96 - course_modchooser_module
97 - course_modchooser_title
891750bc
FM
98* The question chooser now uses a renderable and a template, the following methods
99 have been deprecated in favour of core_question_bank_renderer::render_qbank_chooser().
100 - qbank_chooser
101 - qbank_chooser_types
102 - qbank_chooser_qtype
103 - qbank_chooser_title
d52ebf11
DP
104* The 'css optimiser' has been removed. Developers are encouraged to use tools such as stylelint
105 to help optimise their css. Some functions and classes in lib/csslib.php (which was not for public use)
106 have been deprecated:
107 - css_is_colour
108 - css_is_width
109 - css_sort_by_count
110 - class css_optimiser no longer does anything.
862816ee
FM
111* CLI svgtool.php has moved from theme/base/cli to admin/cli and paths should be relative to the new location.
112* mod_chat will now display the 'course theme' option for all themes (previously it was only displayed on
113 bootstrap2 based themes).
b11916d3
MG
114* Theme can choose how to display "Add a block" control in $THEME->addblockposition, default value is
115 BLOCK_ADDBLOCK_POSITION_DEFAULT that displays it as a fake block in editing mode.
2258b4dc 116
4040c8b3
DM
117=== 3.1 ===
118
119* A new search box for global search has been added to bootstrap and clean layout files, if
120 your theme is overwriting columns1.php, columns2.php or columns3.php you will need to add a
121 call to core_renderer::search_box to display it.
24346803
AN
122* Notification templates have been renamed to better suit types of alert
123 rather than uses. The following changes have been made:
124 * notification_problem.mustache => notification_error.mustache
125 * notification_message => notification_info
126 * notification_redirect => notification_warning
f59f89b4
MG
127* Method core_course_renderer::course_section_cm_name() is split into two methods, custom themes that override
128 this method must be modified or otherwise editing functionality may become broken. This method is now also used by
129 social activities block and site menu block to display activities names.
4040c8b3 130
c7b73854 131=== 3.0 ===
132
133* The renderer function core_availability_renderer::multiple_messages was changed to
134 render_core_availability_multiple_messages, requiring a parameter of the new
135 \core_availability\multiple_messages type.
5e9a937b
JO
136* Meta description is now included in standard_head_html for homepage in bootstrapbase.
137 If your theme includes a meta description directly in a layout for the frontpage,
138 you will need to remove it or override the standard_head_html instead.
45cd3f60
DM
139* Themes Clean and More have been updated to use a new navbar_button function, which shows the
140 hamburguer icon (responsive menu) or not depending on custom and language menus settings;
141 themes extending bootstrapbase and overriding its layouts can call replace their "a.btn-navbar"
142 node for a call to this function.
c47f3803 143* Themes Clean and More page header logo only displays on front page and login page.
c08b52aa
DM
144* A new function navbar_home has been added to theme_clean and theme_more to display the navigation bar link
145 to the site home. Two new settings have been added to control if the link should be a small logo image, text
146 or both. It defaults to the current behaviour, only a text link.
c7b73854 147
c58891f1
ME
148=== 2.9 ===
149
73b425be
ME
150* Themes Bootstrapbase, Clean and More have undergone some changes for RTL layouts see - MDL-48160.
151
c58891f1 152* Themes Clean amd More page header background logo, if loaded, no longer links to the home page.
c36c3d07
AG
153* Themes Clean and More have been updated to use the renderer full_header(). This renderer (when in a user context) displays a message button
154 and consequently the link to message users have been removed from various pages. It is recommended that theme developers use this
155 renderer to ensure that they do not suffer from a reduction in access to this feature.
156* $OUTPUT->context_header() has been introduced to produce headers similar to what full_header() creates. This renderer is used for creating
157 subsequent headers in a page. If provided with user information, this render will also display a message button like full_header().
c58891f1 158
c10fa5da 159=== 2.8 ===
c58891f1 160
a2633964
ME
161* Themes Base and Canvas layout/embedded.php has changed.
162 The div id="content" has been changed to id="page-content" - see MDL-47915.
c10fa5da
DW
163* All mod_assign CSS selectors have been qualified with ".path-mod-assign". This means any custom CSS
164 rules for mod_assign in a theme may need to be updated.
ebdcb292
SH
165* The following render methods were renamed, if you have overridden any of these you will need to update your renderer:
166 - report_log_renderer::render_report_log_renderable => report_log_renderer::render_report_log
167 - report_loglive_renderer::render_report_loglive_renderable => report_loglive_renderer::render_report_log
a2a4ad89 168* On calendar view screen the course selector and new event button have been swapped, custom CSS for .path-calendar might be affected.
2f6a0e5f
MN
169* The functions search_listing() and search_pagination() in the core_course_management_renderer class take the searched string
170 as an extra parameter - see MDL-46902.
f2b4b2ad 171* Themes with non-fixed headers must have the .navbar class in their navbar in order for floating headers in the grader report to work - see MDL-46658.
6d8eba1a
JC
172* To accomodate the new gradebook, use of overflow: hidden or overflow-x: hidden CSS rules on DOM elements containing the
173 #user-grades table, visible at [Course administration -> Grades] is not recommended. Please use overflow: auto or
174 overflow: scroll instead, as this will handle medium to large courses with multiple activities better (more information available at https://docs.moodle.org/dev/Theme_upgrade_notes ).
175* The new user menu can be added to themes by calling $OUTPUT->user_menu(); we recommend doing so in a backwards-compatible way (see https://docs.moodle.org/dev/Theme_upgrade_notes for more information).
c10fa5da 176
6b216432
AA
177=== 2.7 ===
178
31f28b6a
179* CSS related functions in theme class and csslib.php were refactored, addons that are
180 using this private API need to be updated
ba55be91 181* Please update your css to use 'tr:nth-of-type(odd/even)' instead of '.r0/.r1' to apply tr specific css for various tables.
98396c23
SH
182 These classes are deprecated now and will be removed in Moodle 2.9. This has done to better support styling tables that will be altered by JavaScript.
183 Here is an example to update your css:
184 Old code:
185 table.generaltable .r0 {background-color: #F0F0F0;}
186 table.generaltable .r1 {background-color: #F0F0F0;}
187 New code:
98396c23 188 table.generaltable > tbody > tr:nth-of-type(even) {background-color: #F0F0F0;}
ba55be91 189 table.generaltable > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
6b216432 190
7a2dabcb
FM
191Removed themes:
192* afterburner, anomaly, arialist, binarius, boxxie, brick, formal_white, formfactor, fusion, leatherbound,
193 magazine, nimble, nonzero, overlay, serenity, sky_high, splash, standard and standardold have been removed.
194 During the upgrade process the themes will be uninstalled and all their settings will be deleted.
195 If you wish to keep your theme and its settings, download it from moodle.org and put it back in
196 the theme/ directory BEFORE UPGRADING.
6b216432 197
71715870
JC
198Notes:
199* z-index on #dock has been adjusted from 11000 to 5000 to prevent overlapping issues with fullscreen TinyMCE in Base theme.
200
699e2fd0 201=== 2.6 ===
3b42864d 202
7c2efc11
JM
203Removed themes:
204* "My Mobile" theme has been removed (see MDL-40874).
205 During the upgrade process "My Mobile" theme will be uninstalled and all its settings will be deleted.
206 "My Mobile" theme and its extending themes will fallback to the mobile friendly "Clean" theme.
207 If you wish to keep "My Mobile" theme and its settings, BEFORE UPGRADING you can copy the files from the
208 unmaintained plugin into theme/mymobile.
209 The unmaintained plugin can be downloaded at https://moodle.org/plugins/pluginversion.php?id=4563
699e2fd0 210Notes:
faf6010b 211* There have been several changes made to the classes used on headings throughout Moodle.
212 This was done as per the Moodle HTML guidelines. h1 and h2 elements should have no classes, h3 and lower headings
213 may have descriptive classes only (any classes must properly describe the relation between the header and its content).
699e2fd0 214* The parameters value for the following functions have been modified: core_renderer::heading() and core_renderer::heading_with_help().
3b42864d 215 This means that headings using the default options will no longer have the class "main" which was the previous default.
d61c96b6 216* The file picker and activity chooser have been converted to use M.core.dialogue. This means the styles
3b42864d
RW
217 for these elements have changed in the base and bootstrapbase themes and you will need to copy the new styles
218 if you are not inheriting from either one of these themes.
b4c6b42e 219* For the themes based on bootstrapbase please also read theme/bootstrapbase/upgrade.txt
e5de4933
SH
220* A new component action_menu is now used to display editing icons for courses and blocks within a drop down. If you have a theme that doesn't
221 extend base, canvas, or clean then you will need to style for this new component within your theme.
166ac0a3
SH
222* The maintenance layout now has a special renderer that extends the core_renderer in order to prevent some methods from interacting
223 with the database. Please be aware that for the maintenance layout some methods now always return an empty string.
224 This has been done because it is important that during maintenance routines we don't show any links, interact with the database,
225 or interact with caches as doing so may lead to errors,
226 Please see the maintenance renderer notes below for details on the functions affected.
e5de4933
SH
227
228Renderer changes:
229* core_course_renderer::course_section_cm_edit_actions has two new optional arguments and now uses and action_menu component.
230* core_course_renderer::course_section_cm has been altered to call core_course_renderer::course_section_cm_edit_actions with the two new arguments.
231* core_renderer::block_controls has a new optional argument (the block id) and has been altered to use the new action_menu component.
232* core_renderer::block_header has been altered to give core_renderer::block_controls the new second argument, the block id.
233* core_renderer::action_link has a new argument, and optional icon that can be rendererd into the link.
234
faf6010b 235Selector changes:
236* Changes to the classes given to the header produced when rendering a single section within a course.
237 .section-navigation.header.headingblock => .section-navigation.navigationtitle
238* Changes to the classes used when producing the course information box that lists courses.
239 The name (h3|div} of both courses and categories used to have .name, for courses in the list this was changed to .coursename and for categories in the list this was changed to .categoryname.
240* Classes ".header and .headingblock" were removed from all front page content headings.
241* Classes ".headingblock .header .tag-header" were removed from the tag index page
242
166ac0a3
SH
243Maintenance renderer notes:
244When the maintenance layout is being used $OUTPUT will be an instance of core_renderer_maintenance.
245This renderer mimics the core_renderer except that the following functions always return an empty string.
cf9f5a17 246* core_renderer_maintenance::block
247* core_renderer_maintenance::blocks
248* core_renderer_maintenance::blocks_for_regions
249* core_renderer_maintenance::course_header
250* core_renderer_maintenance::course_footer
251* core_renderer_maintenance::course_content_header
252* core_renderer_maintenance::course_content_footer
253* core_renderer_maintenance::custom_menu
254* core_renderer_maintenance::file_picker
255* core_renderer_maintenance::htmllize_file_tree
256* core_renderer_maintenance::lang_menu
257* core_renderer_maintenance::login_info
258* core_renderer_maintenance::user_picture
166ac0a3
SH
259
260If you have overridden methods of the core_renderer in your theme and want those changes to be shown during times of maintenance you
261will also need to override the core_renderer_maintenance and copy your customisations from the core_renderer to that.
262
90160639 263=== 2.5.1 ===
d3e5a21e
SH
264
265Notes:
266* Block drag and drop functionality has been improved so that it works regardless of what block regions you use
267 or how many block regions you have. In order to benefit from this improvement you must convert your calls from
268 $OUTPUT->blocks_for_region() to $OUTPUT->blocks.
269
270Optional changes:
271* Theme config can nominate block regions to swap if the user is using a rtl languages such as Hebrew.
272 $THEME->blockrtlmanipulations should be an associative array, the key is the original block region, and the
273 value should be where the blocks in that region should be displayed.
274* New $OUTPUT methods to replace code that was previously using $PAGE. Converting to these methods is optional
275 but highly recommended. Refer to the bootstrapbase layouts for examples.
276 - $OUTPUT->body_attributes() returns a string you can use for the body id and classes.
277 - $OUTPUT->blocks() returns HTML to display a block region and all of its blocks. This adds data attributes
278 that ensure drag and drop of blocks will work no matter what block regions or how many you have.
279 - $OUTPUT->page_heading() returns the page heading. Replaces $PAGE->heading.
280 - $OUTPUT->page_heading_button() returns the button to display with the heading. Replaces $page->button.
281 - $OUTPUT->page_doc_link() returns the link to moodle docs for the page. Replaces page_doc_link().
282 - $OUTPUT->page_heading_menu() returns the heading menu for the page. Replaces $PAGE->headingmenu.
283 - $OUTPUT->page_title() Returns the title to use for the head section.
284 - $OUTPUT->favicon() returns the URL to the favicon.
285
286Renderer changes:
287* core_renderer::navbar now returns an empty string if there are no navigation items to display.
288* core_renderer::custom_menu now adds a class "custom_menu" to the div that contains the HTML for the custom menu.
289
fc7defef
JF
290=== 2.5 ===
291
09ae7ee0
MG
292required changes:
293* Functions core_course_renderer::course_category_tree() and course_category_tree_category()
294 are deprecated
295* Significant changes in rendering of courses and categories listings, lots of CSS classes changed,
296 several functions such as print_courses(), print_whole_category_list(), print_category_info()
297 are moved to course renderer.
298 See http://docs.moodle.org/dev/Courses_lists_upgrade_to_2.5
299
fc7defef
JF
300DOM changes:
301* changed the h1 title in the help popup to a h2.
97dbc8f2 302* new setting $THEME->yuicssmodules = array('cssreset', 'cssfonts', 'cssgrids', 'cssbase'); which
12cb45f1 303 allows themes to use different CSS reset normalisers such as cssnormalize YUI module.
6e5d002e 304* Re-wrote the user profile views to definition lists.
12cb45f1
MN
305* Re-wrote the table for the course completion status block to use html_table - added some CSS classes to
306 the table in the process (see MDL-35608).
5581c618 307* Cancel buttons have the class btn-cancel.
12cb45f1
MN
308* Added a z-index for the div#dateselector-calendar-panel so that the calendar pop-up renders above
309 the filemanager when they overlap, ie. the course settings page (see MDL-39047).
9074e478
DM
310* Trivial change of CSS selectors used to display plugin status at the plugins overview
311 screen (#plugins-control-panel).
fc7defef 312
6671fa73
JF
313Renderer changes:
314* Mymobile theme changed to support more verbose move-block-here descriptions.
315
2d0e682d
MV
316=== 2.4 ===
317
52b1ed5e
MG
318required changes:
319* output course and course content header/footer that may be returned by course format (see MDL-36048)
e40bd746 320* span.completionprogress has been changed to a <div> and is not a float by default any more.
52b1ed5e 321
fbb207c5
FM
322deprecation:
323* i/roles: Use t/assignroles instead
0cddd851
FM
324* t/manual_item: Use i/manual_item instead
325* t/unlock_gray: Use t/locked instead
f2bba619 326* t/userblue: Previously used to unblock a user, use t/unblock.
5326675e
BR
327* c/course: Use i/courseevent instead
328* c/group: Use i/groupevent instead
329* c/site: Use i/siteevent instead
330* c/user: Use i/userevent instead
99938034 331* t/clear: Use t/check instead
c3847443
FM
332* i/cross_red_big: Use i/invalid or i/grade_incorrect
333* i/tick_green_big: Use i/valid or i/grade_correct
334* i/tick_amber_big: Use i/caution or i/grade_partiallycorrect
335* No more small versions of i/cross_red_small, i/tick_green_small and i/tick_amber_small, use their big equivalent.
501380a9 336* t/addgreen: Use t/add instead.
851d3b7a 337* i/approve: Use t/approve instead
fbb207c5 338
2d0e682d
MV
339optional changes:
340* new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365)
341* new layout option "nologinlinks" and new page layout "secure" e.g. for safebrowser and securewindow (MDL-31365)
bb128107 342* new class 'iconlarge' for 24x24 icons.
fbb207c5
FM
343* new icons i/export and i/import (sized 16x16). Previously export and import actions used i/backup and i/restore.
344* new icon i/assignroles (sized 16x16), to prevent the use of i/roles which is 12x12.
345* new icon i/switchrole (sized 16x16), was previously using i/roles. Now is a copy of the new i/assignroles icon.
c42651d6
FM
346* new icons i/enrolusers and t/enrolusers, previsouly i/users was used.
347* new icon t/cohorts (sized 12x12), to prevent the use of i/cohorts which is 16x16.
06b7ed0a
FM
348* new icons t/sort_asc, t/sort_desc to use for ordering in table headers.
349* new class 'iconsort' for icons used for ordering in table headers.
fa9c0aab 350* new icons t/locked and t/unlocked (12x12) which should be used when there is no action associated to the icon.
0cddd851 351* new icons i/folder (16x16), monochrome equivalent to f/folder.
f2bba619
FM
352* new icons t/addcontact, t/removecontact and t/messages, previously t/addgreen, t/delete and t/log were used in messaging.
353* new icons t/unblock and i/twoway.
5326675e 354* new icons i/courseevent, i/groupevent, i/siteevent and i/userevent (16x16) instead of c/* for calendar events.
99938034
FM
355* new icon t/markasread (12x12) to replace t/clear used in forums.
356* new icon t/check (12x12) to replace t/clear which name does not reflect the icon meaning.
c22fbd38 357* new classes 'icon-pre' and 'icon-post' supposedly to be used when the icon is positioned before or after the text. This is not really used yet, but it's a start towards some standardisation of the icon selectors.
c3847443
FM
358* new icons i/valid, i/caution and i/invalid for generic statuses.
359* new icons i/grade_correct, i/grade_partiallycorrect and i/grade_incorrect for grades.
851d3b7a 360* new icon t/approve (12x12).
0348468b 361* new icon t/contextmenu (12x12) for a monochrome version of i/menu.
ee362526 362
33d9f44b
PS
363=== 2.3 ===
364
365optional changes:
366* add new u/f3.png image when theme contains customised f1 and f2 default user images
367
0f704140
PS
368=== 2.2 ===
369
370required changes:
371* use new page content placeholder "echo $OUTPUT->main_content()" instead of "echo core_renderer::MAIN_CONTENT_TOKEN"
ee362526 372 see git commit: 3b3f302855d7621405a8b93e49bd399d67a998d7
2d0e682d 373* upgrade report selectors: search for "-course-report-" and replace with "-report-"