Skip to content

Commit

Permalink
MDL-78288 formslib: filter_shown_headers() dev updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aanabit authored Jul 11, 2023
1 parent 3f69582 commit 5614ce0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/devupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,17 @@ public function add_sticky_action_buttons(
?string $submitlabel = null,
);
```

A new method `filter_shown_headers() is created to [Forms API](./apis/subsystems/form/index.md#filter_shown_headers) to show some expanded headers only and hide the rest.

```php
public function filter_shown_headers(array $shownonly): void {
$toshow = [];
foreach ($shownonly as $show) {
if ($this->_form->elementExists($show) && $this->_form->getElementType($show) == 'header') {
$toshow[] = $show;
}
}
$this->_form->filter_shown_headers($toshow);
}
```

0 comments on commit 5614ce0

Please sign in to comment.