*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once('includes/config.defaults.php');
require_once('config.php');
final class LookingGlass {
private $release;
private $frontpage;
private $contact;
private $misc;
private $routers;
function __construct($config) {
$this->release = $config['release'];
$this->frontpage = $config['frontpage'];
$this->contact = $config['contact'];
$this->misc = $config['misc'];
$this->routers = $config['routers'];
}
private function render_routers() {
print('
');
print('');
print('');
print('
');
}
private function render_commands() {
print('
');
print('');
print('');
print('
');
}
private function render_parameter() {
print('
');
print('');
print('
');
print('');
print('
');
print('');
print('
');
print('
');
print('
');
}
private function render_buttons() {
print('
');
print('
');
print('');
print('');
print('
');
print('
');
}
private function render_header() {
if ($this->frontpage['header_link']) {
print('');
}
print('
');
print('Configuration error! ');
print('It looks like you have disabled IPv6 and IPv4. Do you want to do any networking someday? ');
print('Please enable IPv6 or IPv4 (or even both) by using the following lines in your configuration:
');
print('
$config[\'misc\'][\'disable_ipv6\'] = false;
');
print('
$config[\'misc\'][\'disable_ipv4\'] = false;
');
print('
');
return;
}
print('
');
print('');
print('Error! ');
print('
');
print('
');
print('');
print('
');
print('
');
print('
');
print('
');
print('
');
print('
');
print('
');
print('
');
print('');
print('
');
print('');
print('
');
print('
');
}
private function render_footer() {
print('');
}
private function render_peering_policy_modal() {
print('
');
print('
');
print('
');
print('
');
print('');
print('
Peering Policy
');
print('
');
print('
');
if (!file_exists($this->frontpage['peering_policy_file'])) {
print('The peering policy file ('.
$this->frontpage['peering_policy_file'].') does not exist.');
} else if (!is_readable($this->frontpage['peering_policy_file'])) {
print('The peering policy file ('.
$this->frontpage['peering_policy_file'].') is not readable.');
} else {
include($this->frontpage['peering_policy_file']);
}
print('
');
print('');
print('
');
print('
');
print('
');
}
private function render_help_modal() {
print('
');
print('
');
print('
');
print('
');
print('');
print('
Help
');
print('
');
print('
');
print('
Command
');
print('');
print('
Parameter
');
print('');
print('
');
print('');
print('
');
print('
');
print('
');
}
public function render() {
print('');
print('');
print('');
print('');
print('');
print('');
print('');
print('');
print(''.htmlentities($this->frontpage['title']).'');
print('');
if ($this->frontpage['bootstrap_theme']) {
print('');
}
if ($this->frontpage['custom_bootstrap_theme']) {
print('');
}
print('');
print('');
print('');
$this->render_header();
$this->render_content();
$this->render_footer();
$this->render_help_modal();
if ($this->frontpage['peering_policy_file']) {
$this->render_peering_policy_modal();
}
print('');
print('');
print('');
print('');
print('');
}
}
$looking_glass = new LookingGlass($config);
$looking_glass->render();
// End of index.php