From 2c4d55aafd5210b72feadf51496596fc024920ed Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Thu, 29 May 2014 22:08:00 +0200 Subject: Rewrite index.php in object style. Add a way to define an order in the frontpage between routers/commands/parameters/buttons. --- config.php.example | 2 + index.php | 280 ++++++++++++++++++++++++++++++++--------------------- 2 files changed, 172 insertions(+), 110 deletions(-) diff --git a/config.php.example b/config.php.example index 7355e92..be03e54 100644 --- a/config.php.example +++ b/config.php.example @@ -14,6 +14,8 @@ $config['frontpage']['title'] = 'Looking Glass'; $config['frontpage']['image'] = 'logo.png'; // Disclaimer to inform people using the looking glass $config['frontpage']['disclaimer'] = 'This is a disclaimer!'; +// Frontpage order you can use: routers, commands, parameters, buttons +$config['frontpage']['order'] = array('routers', 'commands', 'parameters', 'buttons'); // Logs file when commands will be written $config['misc']['logs'] = '/var/log/looking-glass.log'; diff --git a/index.php b/index.php index 5ad4d74..b2ca721 100644 --- a/index.php +++ b/index.php @@ -19,116 +19,176 @@ */ require_once 'config.php'; -?> - - - - - - - - - <?php echo $config['frontpage']['title']; ?> - - - - - - -
-


- '; - } - ?> -
- -
-
-
- - -
- -
- - -
- -
- - -
- -
-
- -
-
- -
-
-
-
- -
-
-
-
-
-
- -
-

-    
- -
-
- - '; + print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print '
';
+    print '
'; + print ''; + print '
'; + print '
'; + } + + private function render_footer() { + print ''; + } + + public function render() { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $this->render_header(); + $this->render_content(); + $this->render_footer(); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } +} + +$looking_glass = new LookingGlass(); +$looking_glass->render(); + +// End of index.php -- cgit v1.2.3