Skip to content

Commit 89b1aa7

Browse files
authored
Merge pull request #1276 from ferranrecio/MDL-84602-main
MDL-84602 add overview item documentation.
2 parents 57a2a80 + 12c500b commit 89b1aa7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/apis/plugintypes/mod/courseoverview.md

+15
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ class overview extends activityoverviewbase {
3535
}
3636
```
3737

38+
### The `overviewitem` class
39+
40+
The `core_courseformat\local\overview\overviewitem` class represents a specific activity overview item. Currently, items are used only as cells in the course overview table, but they may be used in other places like the course page or the activity page in the future.
41+
42+
The class has the following mandatory properties:
43+
44+
- **`name`** (`string`): The name of the item, used as the table header in the course overview.
45+
- **`value`** (`int|string|bool|null`): The value of the item, used for filtering purposes. It won't be displayed in the overview table but will be included as a data attribute.
46+
- **`content`** (`string|renderable|null`): The content of the item. It can be a string for simple elements, but it is highly recommended to use renderable objects to provide useful extra information depending on the context. If the content is null, the item will be displayed as '-' in the overview table.
47+
48+
Also, the class has the following optional properties:
49+
50+
- **`textalign`** (`core\output\local\properties\text_align`): Indicates the preferred text alignment for the parent container. Notice the type hint is not string but `text_align` enum, this limit only to valid text alignment values.
51+
- **`alertcount`** (`integer`) and **`alertlabel`** (`string`): Some items may have an alert count to inform the user of pending actions. This information is not displayed in the table (must be included also in the content) but is added as a data attribute and may be used in other places in the future, such as filtering or mobile app notifications.
52+
3853
### Extra Overview Items
3954

4055
To provide extra overview items, the plugin can override the `get_extra_overview_items` method. This method should return an array of `\core_courseformat\local\overview\overviewitem` objects indexed by item shortname.

0 commit comments

Comments
 (0)