summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Mazoyer <respawneral@gmail.com>2014-12-18 11:16:51 +0100
committerGuillaume Mazoyer <respawneral@gmail.com>2014-12-18 11:16:51 +0100
commitaf39db4bc0c638380ccac651836777c5775d66e4 (patch)
treeb23c3bbd70277b7ea705b781163145f59291845b
parent35a4e5cf48ba418fd9bce4b023a1f897823aafb8 (diff)
Option to configure the header's link.
Use $config['frontpage']['header_link'] to give a link to be used when the header is clicked. The default value is null and means that no link will be used.
-rw-r--r--docs/configuration.md6
-rw-r--r--includes/config.defaults.php2
-rw-r--r--index.php8
3 files changed, 14 insertions, 2 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 56d6efd..f37ab6b 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -48,6 +48,12 @@ Sets the image (logo) that should be displayed. If set to null no image will
be shown.
```php
+$config['frontpage']['header_link'] = null;
+```
+Sets the link used in the header of the page. If set to null no link will be
+used and the header will not be clickable.
+
+```php
$config['frontpage']['disclaimer'] = 'Disclaimer example';
```
Sets the disclaimer that should displayed. If set to null no disclaimer will
diff --git a/includes/config.defaults.php b/includes/config.defaults.php
index 7c3b583..78084e5 100644
--- a/includes/config.defaults.php
+++ b/includes/config.defaults.php
@@ -25,6 +25,8 @@ $config = array(
'title' => 'Looking Glass',
// Image (null for no image)
'image' => null,
+ // Link for the title/image
+ 'header_link' => null,
// Disclaimer (null for no disclaimer)
'disclaimer' => 'Disclaimer example',
// Display the title
diff --git a/index.php b/index.php
index 767cc71..679f6f1 100644
--- a/index.php
+++ b/index.php
@@ -97,7 +97,9 @@ final class LookingGlass {
}
private function render_header() {
- print('<a href="." title="Home">');
+ if ($this->frontpage['header_link'] != null) {
+ print('<a href="'.$this->frontpage['header_link'].'" title="Home">');
+ }
print('<div class="header_bar">');
if ($this->frontpage['show_title']) {
print('<h1>'.htmlentities($this->frontpage['title']).'</h1><br />');
@@ -106,7 +108,9 @@ final class LookingGlass {
print('<img src="'.$this->frontpage['image'].'" alt="Logo" />');
}
print('</div>');
- print('</a>');
+ if ($this->frontpage['header_link'] != null) {
+ print('</a>');
+ }
}
private function render_content() {