Skip to content

Commit

Permalink
output: Clarify format_string() parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchamp authored and andrewnicols committed Aug 1, 2024
1 parent 6ed7485 commit 14996be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/apis/subsystems/output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ Please note that this function is a stripped version of the full `format_text()`

Some interesting parameters for this function are:

- `striplinks`: Set to `false` to remove all links after the text has been processed by filters. Used when we want to show the text inside menus, page titles, etc. (Default is `true`)
- `striplinks`: Set to `false` to keep all links after the text has been processed by filters. Used when we want to show the text inside menus, page titles, etc. (Default is `true`)
- `options`
- `options->context`: Context (id or object) for applying filters. If context is not specified it will be taken from `$PAGE->context` and may potentially result in displaying the same text differently on different pages. For example, all module-related information should have module context even when it appears in course-level reports, all course-related information such as name and description should have course context even when they are displayed on the front page or system pages.
- `options->escape`: Set to `false` if you do not want to escape HTML entities. (Default is `true`)
- `options->filter`: Set to `false` if you want to allow filters to process the text. This is ignored by `FORMAT_PLAIN` for which filters are never applied. (Default to `true`)
- `options->filter`: Set to `false` if you do not want to allow filters to process the text. This is ignored by `FORMAT_PLAIN` for which filters are never applied. (Default is `true`)

### Simple elements rendering

Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-4.3/apis/subsystems/output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ Please note that this function is basically one stripped version of the full `fo

Some interesting parameters for this function are:

- `striplinks`: To decide if, after the text has been processed by filters, we must delete any link from the result text. Used when we want to show the text inside menus, page titles... (defaults to true).
- `striplinks`: Set to `false` to keep all links after the text has been processed by filters. Used when we want to show the text inside menus, page titles, etc. (Default is `true`)
- `options`
- `options->context`: Context (id or object) for applying filters. If context is not specified it will be taken from `$PAGE->context` and may potentially result in displaying the same text differently on different pages. For example all module-related information should have module context even when it appears in course-level reports, all course-related information such as name and description should have course context even when they are displayed on front page or system pages.
- `options->escape`: To decide if you want to escape HTML entities. True by default.
- `options->filter`: To decide if you want to allow filters to process the text (defaults to true). This is ignored by `FORMAT_PLAIN` for which filters are never applied.
- `options->context`: Context (id or object) for applying filters. If context is not specified it will be taken from `$PAGE->context` and may potentially result in displaying the same text differently on different pages. For example, all module-related information should have module context even when it appears in course-level reports, all course-related information such as name and description should have course context even when they are displayed on the front page or system pages.
- `options->escape`: Set to `false` if you do not want to escape HTML entities. (Default is `true`)
- `options->filter`: Set to `false` if you do not want to allow filters to process the text. This is ignored by `FORMAT_PLAIN` for which filters are never applied. (Default is `true`)

:::note
In earlier versions of Moodle, the third argument was integer `$courseid`. It is still supported for legacy - if the third argument is an integer instead of an array or object, it is considered to be course id and is this course's context is passed to the filters being applied.
Expand Down
4 changes: 2 additions & 2 deletions versioned_docs/version-4.4/apis/subsystems/output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ Please note that this function is a stripped version of the full `format_text()`

Some interesting parameters for this function are:

- `striplinks`: Set to `false` to remove all links after the text has been processed by filters. Used when we want to show the text inside menus, page titles, etc. (Default is `true`)
- `striplinks`: Set to `false` to keep all links after the text has been processed by filters. Used when we want to show the text inside menus, page titles, etc. (Default is `true`)
- `options`
- `options->context`: Context (id or object) for applying filters. If context is not specified it will be taken from `$PAGE->context` and may potentially result in displaying the same text differently on different pages. For example, all module-related information should have module context even when it appears in course-level reports, all course-related information such as name and description should have course context even when they are displayed on the front page or system pages.
- `options->escape`: Set to `false` if you do not want to escape HTML entities. (Default is `true`)
- `options->filter`: Set to `false` if you want to allow filters to process the text. This is ignored by `FORMAT_PLAIN` for which filters are never applied. (Default to `true`)
- `options->filter`: Set to `false` if you do not want to allow filters to process the text. This is ignored by `FORMAT_PLAIN` for which filters are never applied. (Default to `true`)

### Simple elements rendering

Expand Down

0 comments on commit 14996be

Please sign in to comment.