Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mymods_h5p_semantics_alter(&$semantics, $library_name = NULL) {
- // Check if this is the multichoice question type.
- if ($library_name !== 'H5P.PersonalityQuiz') {
- return; // Nope, do not continue.
- }
- foreach ($semantics as $field) {
- // Go through list fields
- while ($field->type === 'list') {
- $field = $field->field;
- }
- // Go through group fields
- if ($field->type === 'group') {
- mymods_h5p_semantics_alter($field->fields, $library_name); // Check your function name!
- continue;
- }
- // Check to see if we have the correct type and widget
- if ($field->type === 'text' && isset($field->widget) && $field->widget === 'html') {
- // Found a field. Add support for table tags.
- if (!isset($field->tags)) {
- $field->tags = array();
- }
- $field->tags = array_merge($field->tags, array(
- 'table',
- 'thead',
- 'tfoot',
- 'tbody',
- 'tr',
- 'th',
- 'td'
- ));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement