tra('H5P'), 'documentation' => 'PluginH5P', 'description' => tra('Enable the creation, sharing and reuse of interactive HTML5 content.'), 'prefs' => ['wikiplugin_h5p', 'h5p_enabled'], 'iconname' => 'html', 'format' => 'html', 'introduced' => 17, 'params' => [ 'fileId' => [ 'required' => false, 'name' => tra('File ID'), 'description' => tr('The H5P file in a file gallery'), 'since' => '17.0', 'filter' => 'digits', 'default' => '', 'profile_reference' => 'file', 'area' => 'fgal_picker_id', 'type' => 'fileId', ], ], ]; } function wikiplugin_h5p($data, $params) { global $page, $prefs; static $instance = 0; $instance++; // temporary issue in 17.x with annotatorjs 1.2 (we hope) if ($prefs['comments_inline_annotator'] === 'y') { if ($instance === 1) { Feedback::warning(tr('H5P is not compatible with the Inline comments (annotations) feature')); } return ''; } $smarty = TikiLib::lib('smarty'); $smarty->loadPlugin('smarty_function_service_inline'); $params['controller'] = 'h5p'; $params['action'] = 'embed'; if (! empty($page)) { // only wiki pages for now $params['page'] = $page; $params['index'] = $instance; } return smarty_function_service_inline($params, $smarty->getEmptyInternalTemplate()); } function wikiplugin_h5p_rewrite($data, $params, $context) { if (! empty($params['fileId'])) { return "{h5p fileId=\"{$params['fileId']}\"}"; } else { return "{h5p}"; } }