You are here

function opigno_module_h5p_styles_alter in Opigno module 3.x

Same name and namespace in other branches
  1. 8 opigno_module.module \opigno_module_h5p_styles_alter()

Implements hook_h5p_styles_alter().

File

./opigno_module.module, line 831
Contains opigno_module.module.

Code

function opigno_module_h5p_styles_alter(&$styles, $libraries, $mode) {
  if (isset($mode) && in_array($mode, [
    'iframe',
    'editor',
  ])) {
    if (!empty($libraries)) {
      foreach ($libraries as $library) {
        if (!is_array($library) && strpos($library, 'h5p/h5p.coursepresentation-') !== FALSE) {
          $styles[] = (object) [
            'path' => drupal_get_path('module', 'opigno_module') . '/css/h5p_course_presentation.css',
            'version' => '?ver=1.0.0',
          ];
          break;
        }
      }
    }
  }
}