You are here

public function OSMTemplate::getThemeRollerCSS in MediaFront 6.2

Same name and namespace in other branches
  1. 6 players/osmplayer/player/OSMTemplate.php \OSMTemplate::getThemeRollerCSS()
  2. 7 players/osmplayer/player/OSMTemplate.php \OSMTemplate::getThemeRollerCSS()

Returns the CSS file that is located within the current theme.

1 call to OSMTemplate::getThemeRollerCSS()
DefaultTemplate::getSettings in players/osmplayer/player/templates/default/template.php
Return's this templates settings. This function is used to tell the Open Standard Media Player class about your template.

File

players/osmplayer/player/OSMTemplate.php, line 131

Class

OSMTemplate
Copyright (c) 2010 Alethia Inc, http://www.alethia-inc.com Developed by Travis Tidwell | travist at alethia-inc.com

Code

public function getThemeRollerCSS() {
  $theme_css = '';
  if ($this->playerSettings['theme']) {
    $theme_folder = 'jquery-ui/css/' . $this->playerSettings['theme'];

    // Now search this folder for the CSS file...
    if ($contents = opendir(dirname(__FILE__) . '/' . $theme_folder)) {
      while (($node = readdir($contents)) !== false) {
        if (preg_match('/\\.css$/', $node)) {
          $theme_css = $node;
          break;
        }
      }
    }
  }

  // Add the theme.
  return $theme_css ? $theme_folder . '/' . $theme_css : '';
}