From b1bb5fdc0ab52342ae17da470f8368e75d9172c8 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 14 Mar 2016 12:53:55 +0100 Subject: Peering Policy configuration options. Add configuration variable to set the path to a file containing a peering policy. This file must be readable by the webserver and must contain HTML formatted text (on which CSS rules will be applied). If the variable is set to null, no peering policy will be displayed. --- docs/configuration.md | 7 +++++++ includes/config.defaults.php | 2 ++ index.php | 39 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index d237231..47ef38e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -53,6 +53,13 @@ $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']['peering_policy_file'] = null; +``` +Sets the path to the peering policy file. If set to null no peering policy +will be able to be shown. The peering policy file must be located in a +readable location and must contain only HTML formatted text. + ```php $config['frontpage']['disclaimer'] = 'Disclaimer example'; ``` diff --git a/includes/config.defaults.php b/includes/config.defaults.php index 9e44343..25eaf6f 100644 --- a/includes/config.defaults.php +++ b/includes/config.defaults.php @@ -46,6 +46,8 @@ $config = array( 'image' => null, // Link for the title/image 'header_link' => null, + // Peering Policy file (null for no peering policy) + 'peering_policy_file' => null, // Disclaimer (null for no disclaimer) 'disclaimer' => 'Disclaimer example', // Display the title diff --git a/index.php b/index.php index 12ff3a4..3acee49 100644 --- a/index.php +++ b/index.php @@ -171,12 +171,17 @@ final class LookingGlass { } } - if ($this->frontpage['disclaimer'] != null) { + if ($this->frontpage['disclaimer']) { print($this->frontpage['disclaimer']); print('

'); } - if (($this->contact['name'] != null) && ($this->contact['mail'] != null)) { + if ($this->frontpage['peering_policy_file']) { + print(''); + print('

'); + } + + if ($this->contact['name'] && $this->contact['mail']) { print('Contact: '); print(''. htmlentities($this->contact['name']).''); @@ -188,6 +193,33 @@ final class LookingGlass { print(''); } + private function render_peering_policy_modal() { + print(''); + } + private function render_help_modal() { print('