* * 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) { set_defaults_for_routers($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('
'); if ($this->frontpage['show_title']) { print('

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


'); } if ($this->frontpage['image']) { print('Logo'); } print('
'); if ($this->frontpage['header_link']) { print('
'); } } private function render_content() { print('
'); print(''); print('Error! '); print('
'); print('
'); print('
'); foreach ($this->frontpage['order'] as $element) { switch ($element) { case 'routers': $this->render_routers(); break; case 'commands': $this->render_commands(); break; case 'parameter': $this->render_parameter(); break; case 'buttons': $this->render_buttons(); break; default: break; } } 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(''); } private function render_help_modal() { 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