Display H5P filter.
More...
|
| $localurl = '#\?url=([^" <]*[::/]+[^" <]*::.h5p)([?][^"]*)?#' |
|
if(empty($h5pcontents) &&empty($h5links)) foreach( $h5plinks as $h5plink) foreach($h5pcontents as $h5pcontent) | $result = filter_phrases($text, $h5pcontents, null, null, false, true) |
|
| $result |
|
return | $result |
|
|
context | $context |
| The context we are in.
|
|
array | $localconfig |
| Any local configuration for this filter in this context.
|
|
Display H5P filter.
This filter will replace any occurrence of H5P URLs with the corresponding H5P content embed code
- Copyright
- 2019 Victor Deniz victo.nosp@m.r@mo.nosp@m.odle..nosp@m.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ filter()
filter_displayh5p::filter |
( |
| $text, |
|
|
array | $options = array() ) |
Function filter replaces any h5p-sources.
- Parameters
-
string | $text | HTML content to process |
array | $options | options passed to the filters |
- Return values
-
Reimplemented from moodle_text_filter.
◆ $result
filter_displayh5p::$result |
Initial value:= preg_replace_callback($localurl,
function ($matches) {
$baseurl = rawurlencode($matches[1]);
if (!empty($matches[2])) {
$match = explode('?', $matches[2]);
if (!empty($match[1])) {
$baseurl = $baseurl."&".$match[1];
}
}
return "?url=".$baseurl;
}, $result)
The documentation for this class was generated from the following file:
- filter/displayh5p/filter.php