From c7861bc5ff03c1eb2b7e33d3f3a94d8a095650ab Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 8 Dec 2014 20:51:03 +0100 Subject: Define more default values. Some can be set to 'null' to avoid displaying some info. --- config.php.example | 2 ++ includes/config.defaults.php | 14 ++++++++++++++ index.php | 8 ++++---- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config.php.example b/config.php.example index f03e5e1..1126988 100644 --- a/config.php.example +++ b/config.php.example @@ -7,6 +7,7 @@ */ // People to contact +// Set both to null to not display any contact information $config['contact']['name'] = 'Example Support'; $config['contact']['mail'] = 'support@example.com'; @@ -17,6 +18,7 @@ $config['frontpage']['title'] = 'Looking Glass'; // Logo to display (remove it to not display any logo) $config['frontpage']['image'] = 'logo.png'; // Disclaimer to inform people using the looking glass +// Set it to null to not display a disclaimer $config['frontpage']['disclaimer'] = 'This is a disclaimer!'; // Things to remove from the output (PHP compatible regex) diff --git a/includes/config.defaults.php b/includes/config.defaults.php index d174967..24182c5 100644 --- a/includes/config.defaults.php +++ b/includes/config.defaults.php @@ -15,6 +15,12 @@ $config = array( 'custom_bootstrap_theme' => false, // CSS to use 'css' => 'css/style.css', + // Title + 'title' => 'Looking Glass', + // Image (null for no image) + 'image' => null, + // Disclaimer (null for no disclaimer) + 'disclaimer' => 'Disclaimer example', // Display the title 'show_title' => true, // Show visitor IP address @@ -23,6 +29,14 @@ $config = array( 'order' => array('routers', 'commands', 'parameters', 'buttons') ), + // Contact (both null for no contact) + 'contact' => array( + // Name of the contact + 'name' => 'Example Support', + // Email of the contact + 'mail' => 'support@example.com' + ), + // Filters 'filters' => array(), diff --git a/index.php b/index.php index f28bfd4..c7dcb90 100644 --- a/index.php +++ b/index.php @@ -100,8 +100,8 @@ final class LookingGlass { if ($this->frontpage['show_title']) { print('

'.htmlentities($this->frontpage['title']).'


'); } - if (isset($this->frontpage['image'])) { - print('logo'); + if ($this->frontpage['image'] != null) { + print('Logo'); } print(''); print(''); @@ -167,12 +167,12 @@ final class LookingGlass { } } - if (isset($this->frontpage['disclaimer'])) { + if ($this->frontpage['disclaimer'] != null) { print($this->frontpage['disclaimer']); print('

'); } - if (isset($this->contact) && !empty($this->contact)) { + if (($this->contact['name'] != null) && ($this->contact['mail'] != null)) { print('Contact: '); print(''. htmlentities($this->contact['name']).''); -- cgit v1.2.3