public function OSMTemplate::theme in MediaFront 7
Same name and namespace in other branches
- 6.2 players/osmplayer/player/OSMTemplate.php \OSMTemplate::theme()
- 6 players/osmplayer/player/OSMTemplate.php \OSMTemplate::theme()
Theme function for the base template class.
Parameters
array $variables - The variables used within this particular theme.:
string $subtemplate - The subtemplate to include.:
Return value
string The HTML markup of this theme.
1 call to OSMTemplate::theme()
- DefaultTemplate::theme_preprocess in players/
osmplayer/ player/ templates/ default/ template.php - A theme preprocess function for the main player.
File
- players/
osmplayer/ player/ OSMTemplate.php, line 399
Class
- OSMTemplate
- Copyright (c) 2010 Alethia Inc, http://www.alethia-inc.com Developed by Travis Tidwell | travist at alethia-inc.com
Code
public function theme($variables, $subtemplate = '') {
$template = $variables['params']['template'];
$preprocess = 'theme_preprocess' . $subtemplate;
if (method_exists($this, $preprocess)) {
$this
->{$preprocess}($variables);
}
// Extract the variables to a local namespace
extract($variables, EXTR_SKIP);
// Start output buffering
ob_start();
// Include the template.
include "templates/{$template}/osmplayer_{$template}{$subtemplate}.tpl.php";
// Get the contents of the buffer
$contents = ob_get_contents();
// End buffering and discard
ob_end_clean();
// Return the contents
return $contents;
}