Skip to content

Commit c253cd6

Browse files
authored
Merge pull request #1392 from moodlemobile/app-docs
Moodle mobile app 5.0 docs update
2 parents 4bcac02 + 713c19a commit c253cd6

File tree

14 files changed

+219
-90
lines changed

14 files changed

+219
-90
lines changed

general/app/customisation/remote-themes.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Once you have everything ready, you can configure your theme by going to "Site a
2323
You can get started with the following example, and you should see the background of the top bar change to red once you log into the app:
2424

2525
```css
26-
html {
26+
:root {
2727
--core-header-toolbar-background: red;
2828
}
2929
```
@@ -76,23 +76,23 @@ Each of these also define other variants: `rgb`, `contrast`, `contrast-rgb`, `sh
7676
For example, if you want to override the primary color, you'll need to override the following variables:
7777

7878
```css
79-
html {
80-
--ion-color-primary: #006600;
79+
:root {
80+
--primary: #006600;
8181

8282
/* RGB list of the color */
8383
--ion-color-primary-rgb: 0,102,0;
8484

8585
/* Black or white, depending on which color gives more contrast */
86-
--ion-color-primary-contrast: #ffffff;
86+
--primary-contrast: #ffffff;
8787

8888
/* RGB version of the contrast color */
8989
--ion-color-primary-contrast-rgb: 255,255,255;
9090

9191
/* Slightly darker color. (mix 12% of black) */
92-
--ion-color-primary-shade: #005a00;
92+
--primary-shade: #005a00;
9393

9494
/* Slightly lighter color. (mix 10% of white) */
95-
--ion-color-primary-tint: #1a751a;
95+
--primary-tint: #1a751a;
9696
}
9797
```
9898

@@ -101,7 +101,7 @@ html {
101101
Other than the basic and semantic colors, other components and pages define their own variables that you can override. You can look at the source code to find more, but these are some of the most relevant:
102102

103103
```css
104-
html {
104+
:root {
105105
/* Page background */
106106
--background-color: white;
107107
--ion-background-color-rgb: 255, 255, 255;
@@ -120,27 +120,27 @@ html {
120120

121121
### Targeting different environments
122122

123-
The `html` element contains classes that indicate the environment the app is running on.
123+
The `:root` element contains classes that indicate the environment the app is running on.
124124

125125
#### Platform
126126

127-
You can specify styles that will only apply to iOS by prepending them with `html.ios`, or `html.md` for Android:
127+
You can specify styles that will only apply to iOS by prepending them with `:root.ios`, or `:root.md` for Android:
128128

129129
```css
130130
/* Red toolbar in iOS */
131-
html.ios {
131+
:root.ios {
132132
--core-header-toolbar-background: red;
133133
}
134134

135135
/* Green toolbar in Android */
136-
html.md {
136+
:root.md {
137137
--core-header-toolbar-background: green;
138138
}
139139
```
140140

141141
#### Moodle App and Moodle site versions
142142

143-
You can restrict CSS rules to a specific version using one of these classes. For example, when accessing a 3.11.2 site using the 3.9.5 app the following classes will be present in the `html` element:
143+
You can restrict CSS rules to a specific version using one of these classes. For example, when accessing a 3.11.2 site using the 3.9.5 app the following classes will be present in the `:root` element:
144144

145145
- `version-3`
146146
- `version-3-11`
@@ -153,12 +153,12 @@ And here's how to use them:
153153

154154
```css
155155
/* Red toolbar for Moodle App version 4.1.X */
156-
html.moodleapp-4-1 {
156+
:root.moodleapp-4-1 {
157157
--core-header-toolbar-background: red;
158158
}
159159

160160
/* Green toolbar for all other versions */
161-
html {
161+
:root {
162162
--core-header-toolbar-background: green;
163163
}
164164
```
@@ -170,16 +170,16 @@ Starting on Moodle App 4.4 you can restrict CSS rules to a specific site theme.
170170

171171
#### Application theme
172172

173-
The application uses a light theme by default, but it adds the `dark` class to the `html` element when it is using a dark theme:
173+
The application uses a light theme by default, but it adds the `dark` class to the `:root` element when it is using a dark theme:
174174

175175
```css
176176
/* Red toolbar for the Light Theme */
177-
html {
177+
:root {
178178
--core-header-toolbar-background: red;
179179
}
180180

181181
/* Green toolbar for the Dark Theme */
182-
html.dark {
182+
:root.dark {
183183
--core-header-toolbar-background: green;
184184
}
185185
```
@@ -193,7 +193,7 @@ Of course, you can combine any of these classes to create more granular styles.
193193
Let's say you want to have a red toolbar only in iOS, with the Dark Theme, for a Moodle site running 3.11.X:
194194

195195
```css
196-
html.ios.version-3-11.dark {
196+
:root.ios.version-3-11.dark {
197197
--core-header-toolbar-background: red;
198198
}
199199
```
@@ -305,7 +305,7 @@ core-tabs, core-tabs-outlet {
305305
### Items
306306

307307
```css
308-
html {
308+
:root {
309309
/* Background */
310310
--ion-item-background: green;
311311

@@ -354,7 +354,7 @@ page-core-mainmenu-more {
354354
You can personalise some colors in the Login page, but keep in mind that this only includes the credentials page (the one after you select the site).
355355

356356
```css
357-
html {
357+
:root {
358358
--core-login-background: red;
359359
--core-login-text-color: blue;
360360
--core-login-input-background: green;
@@ -365,16 +365,12 @@ html {
365365
### Messages page
366366

367367
```css
368-
html {
369-
--addon-messages-message-bg: white;
370-
--addon-messages-message-activated-bg: gray-light;
371-
--addon-messages-message-note-text: gray-dark;
372-
--addon-messages-message-mine-bg: gray-light;
373-
--addon-messages-message-mine-activated-bg: gray;
374-
--addon-messages-discussion-badge: orange;
375-
--addon-messages-discussion-badge-text: white;
376-
--core-send-message-input-background: gray-light;
377-
--core-send-message-input-color: black;
368+
:root {
369+
--core-messages-message-bg: white;
370+
--core-messages-message-activated-bg: gray-light;
371+
--core-messages-message-note-text: gray-dark;
372+
--core-messages-message-mine-bg: gray-light;
373+
--core-messages-message-mine-activated-bg: gray;
378374
}
379375
```
380376

general/app/development/plugins-development-guide/api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ These are the configuration options common to most handlers, you can find specif
7979
| `styles.version` | Required | Version number used to determine if the file needs to be downloaded again. You should change the version number every time you change the contents of the CSS file. |
8080
| `moodlecomponent` | Plugin name | Name of the component implemented by the handler. <br /> <br /> Most of the time, this can be ignored because mobile support is usually included in the same plugin where custom components are defined, but it may be different in some cases. For example, imagine a local plugin called `local_myactivitymobile` is implementing mobile support for a `mod_myactivity` component. In that case, you would set this option to `"mod_myactivity"`. |
8181
| `restricttocurrentuser` | `false` | Restricts the handler to appear only for the current user. For more advanced restrictions, you can use the `restrict` and `disabled` properties returned during [JavaScript initialisation](./index.md#javascript-initialisation). |
82-
| `restricttoenrolledcourses` | `false` | Restricts the handler to appear only for courses the user is enrolled in. For more advanced restrictions, you can use the `restrict` and `disabled` properties returned during [JavaScript initialisation](./index.md#javascript-initialisation). |
82+
| `restricttoenrolledcourses` | `true` | Restricts the handler to appear only for courses the user is enrolled in. For more advanced restrictions, you can use the `restrict` and `disabled` properties returned during [JavaScript initialisation](./index.md#javascript-initialisation). |
8383

8484
### CoreMainMenuDelegate
8585

general/app/overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ The app can also be compiled to work with a single site, or a list of approved s
2424

2525
Keep in mind that the application only works with moodle sites that allow it, and this is disabled by default in some sites. If you want to allow users to log into your site using the app, make sure to check that it's [enabled in the settings](https://docs.moodle.org/en/Moodle_app_guide_for_admins#Enable_mobile_services_on_your_site). If you are not the site owner, reach out to the administrators.
2626

27+
### Technologies used
28+
29+
The Moodle app is a hybrid app built using [Angular](https://angular.io/) and [Ionic Framework](https://ionicframework.com/). The main coding language used in the app is [Typescript](https://www.typescriptlang.org/).
30+
31+
The [Cordova framework](https://cordova.apache.org/) is used to use native features and to compile the Android and iOS apps.
32+
33+
The official app from MoodleHQ uses a server with [Airnotifier](https://github.com/dcai/airnotifier) to deliver push notifications to the app. The Moodle site sends the notifications to the Airnotifier server, and this server uses [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) to deliver the notifications to the devices using Google Cloud Messaging and Apple Push Notification service.
34+
2735
### Architecture
2836

2937
The code of the application follows an [hexagonal architecture](https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)), with core modules that include the main functionality and addon modules that provide additional features.

general/app/upgrading/plugins-upgrade-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ As you can see in that repository, the JS and the templates are duplicated in or
1616

1717
Depending on which version of the app you're upgrading from, you'll need to go through multiple version upgrades. This guide is divided by version ranges, so you should be able to start with your current version and build up from there.
1818

19-
Other than the changes outlined in this document, there may be smaller API changes that aren't highlighted here. Make sure to check the [upgrade.txt](https://github.com/moodlehq/moodleapp/blob/latest/upgrade.txt) file for an exhaustive list with all the changes.
19+
Other than the changes outlined in this document, there may be smaller API changes that aren't highlighted here. Make sure to check the [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md) file for an exhaustive list with all the changes.
2020

2121
## 4.4 to 4.5
2222

2323
The Ionic version has been upgraded to v8 (from v7), make sure to check the relevant upgrade guides for [v8](https://ionicframework.com/docs/updating/8-0). In particular, the legacy syntax to declare input labels that was deprecated on Ionic7 now has been removed.
2424

2525
## 4.3 to 4.4
2626

27-
Starting with this release, the changes listed in [upgrade.txt](https://github.com/moodlehq/moodleapp/blob/latest/upgrade.txt) will only document breaking changes for APIs exposed to site plugins. Internal changes will no longer be documented. Make sure to check out the file to learn about the changes in this version.
27+
Starting with this release, the changes listed in [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md) will only document breaking changes for APIs exposed to site plugins. Internal changes will no longer be documented. Make sure to check out the file to learn about the changes in this version.
2828

2929
Also, the Ionic version has been upgraded to v7 (from v5), make sure to check the relevant upgrade guides for [v6](https://ionicframework.com/docs/updating/6-0) and [v7](https://ionicframework.com/docs/updating/7-0). In particular, the syntax to declare input labels has been refactored. The legacy syntax will continue working for the time being, but we recommend migrating to the [modern syntax](https://ionicframework.com/docs/api/input#migrating-from-legacy-input-syntax) as soon as possible.
3030

@@ -36,7 +36,7 @@ Finally, the application now needs to run in a secure context (https://). This c
3636

3737
Font Awesome icons have been updated to version 6.4.0, so make sure that all the icons you're using in your plugin are still supported.
3838

39-
Other than that, there have been some changes in the APIs related to analytics. Check out [upgrade.txt](https://github.com/moodlehq/moodleapp/blob/latest/upgrade.txt) to learn about the specifics.
39+
Other than that, there have been some changes in the APIs related to analytics. Check out [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md) to learn about the specifics.
4040

4141
## 4.1 to 4.2
4242

@@ -84,7 +84,7 @@ In order to avoid breaking existing styles, version 4.1 will continue adding ver
8484

8585
## 3.9.5 to 4.0
8686

87-
There haven't been any breaking changes from 3.9.5 to 4.0, but the UI of the application has changed drastically so we recommend taking special care that the UI of your plugin is still working properly. Also, remember to double check all the changes listed in [upgrade.txt](https://github.com/moodlehq/moodleapp/blob/latest/upgrade.txt).
87+
There haven't been any breaking changes from 3.9.5 to 4.0, but the UI of the application has changed drastically so we recommend taking special care that the UI of your plugin is still working properly. Also, remember to double check all the changes listed in [UPGRADE.md](https://github.com/moodlehq/moodleapp/blob/latest/UPGRADE.md).
8888

8989
Other than that, everything should continue working as expected. If you find something that doesn't, please [let us know](https://moodle.atlassian.net/projects/MOBILE).
9090

general/app_releases.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ tags:
66
- Release notes
77
---
88

9+
## Moodle App 5.x
10+
11+
| **Version name** | **Date** |
12+
|---|---|
13+
| [Moodle App 5.0.0](./app_releases/v5/v5.0.0) | 27 June 2025 |
14+
915
## Moodle App 4.x
1016

1117
| **Version name** | **Date** |

general/app_releases/v1.x.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Moodle Mobile 1.x release notes
33
sidebar_label: Moodle Mobile 1
4-
sidebar_position: 4
4+
sidebar_position: 5
55
tags:
66
- Moodle App
77
- Release notes

general/app_releases/v2/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Moodle Mobile 2
3-
sidebar_position: 3
3+
sidebar_position: 4
44
---
55

66
<!-- markdownlint-disable no-inline-html -->

general/app_releases/v3/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Moodle App 3
3-
sidebar_position: 2
3+
sidebar_position: 3
44
---
55

66
<!-- markdownlint-disable no-inline-html -->

general/app_releases/v4/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Moodle App 4
3-
sidebar_position: 1
3+
sidebar_position: 2
44
---
55

66
<!-- markdownlint-disable no-inline-html -->

general/app_releases/v5/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Moodle App 5
3+
sidebar_position: 1
4+
---
5+
6+
<!-- markdownlint-disable no-inline-html -->
7+
8+
import { Redirect } from '@docusaurus/router';
9+
10+
<Redirect to="v5/v5.0.0" />

0 commit comments

Comments
 (0)