public function Skin::load in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/Skin.php \Drupal\forena\Skin::load()
Load the skin based on the name.
Parameters
$name path/name of skin.:
File
- src/
Skin.php, line 72 - Skin.inc Skinning
Class
Namespace
Drupal\forenaCode
public function load($name) {
if (!$name) {
$name = $this->default_skin;
}
if ($this->name != $name) {
//Check for an info file
if (Frx::File()
->exists($name . '.skinfo')) {
// Parse the info file using drupals stock version
$this->info = drupal_parse_info_format(Frx::File()
->contents($name . '.skinfo'));
$path_info = Frx::File()
->pathinfo($name . '.skinfo');
$this->info['base_path'] = base_path() . $path_info['dirname'];
$this->info['dir'] = base_path() . $path_info['dirname'];
Frx::Data()
->setContext('skin', $this->info);
if (isset($this->info['stylesheets'])) {
foreach ($this->info['stylesheets'] as $type => $sheets) {
if ($sheets) {
foreach ($sheets as $sheet) {
$this
->addCSS($type, $sheet);
}
}
}
}
// Add the javascript files
if (@is_array($this->info['scripts'])) {
foreach ($this->info['scripts'] as $script) {
$this
->addJS($script);
}
}
}
else {
$this->info = array(
'name' => $name,
);
//Perform the legacy detection of css and pdf files.
$this
->addCSS('all', $name . '.css');
$this
->addJS($name . '.js');
}
$this->name = $name;
}
return $this;
}