Makes custom headers/footers optional. Disabled by default.

This commit is contained in:
Lars Jung 2012-02-12 23:56:19 +01:00
parent 20858a1f43
commit cbdd185602
4 changed files with 30 additions and 20 deletions

View file

@ -7,8 +7,8 @@ class Customize {
$absPath = $h5ai->getAbsPath();
$options = $h5ai->getOptions();
$this->customHeader = $absPath . "/" . $options["customHeader"];
$this->customFooter = $absPath . "/" . $options["customFooter"];
$this->customHeader = $options["customHeader"] ? $absPath . "/" . $options["customHeader"] : false;
$this->customFooter = $options["customFooter"] ? $absPath . "/" . $options["customFooter"] : false;
}
public function getHeader() {
@ -23,7 +23,7 @@ class Customize {
private function getContent($file, $tag) {
return file_exists($file) ? ("<" . $tag . ">" . file_get_contents($file) . "</" . $tag . ">") : "";
return (is_string($file) && file_exists($file)) ? ("<" . $tag . ">" . file_get_contents($file) . "</" . $tag . ">") : "";
}
}