You are here

function osmplayer_add_theme in MediaFront 7

Same name and namespace in other branches
  1. 6.2 players/osmplayer/osmplayer.module \osmplayer_add_theme()
  2. 6 players/osmplayer/osmplayer.module \osmplayer_add_theme()
1 call to osmplayer_add_theme()
osmplayer_theme in players/osmplayer/osmplayer.module
Implements hook_theme()

File

players/osmplayer/osmplayer.module, line 127

Code

function osmplayer_add_theme(&$themes, $template, $component, $path) {

  // The template name.
  $template = 'osmplayer_' . $template . '_' . $component;

  // Get the template file.
  $file = getcwd() . '/' . $path . '/' . $template . '.tpl.php';

  // Check to make sure the file exists.
  if (file_exists($file)) {

    // Add this theme.
    $themes[$template] = array(
      'template' => $template,
      'variables' => array(
        'params' => NULL,
        'templates' => NULL,
      ),
      'path' => $path,
    );

    // Check for the preprocess function.
    $preprocess = 'template_preprocess_osmplayer_' . $component;
    if (function_exists($preprocess)) {
      $themes[$template]['preprocess functions'] = array(
        $preprocess,
      );
    }
  }
}