diff --git a/private/htaccess.dist b/private/htaccess.dist new file mode 100644 index 0000000..3fdbd02 --- /dev/null +++ b/private/htaccess.dist @@ -0,0 +1,16 @@ +SetEnv STATUSBOARD_CONFIG /etc/status-board/config.php + + + + RewriteEngine on + RewriteBase / + + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(ajax/.*)$ a.php?l=$1 [L] + + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ index.php?l=$1 + + \ No newline at end of file diff --git a/public/.gitignore b/public/.gitignore new file mode 100644 index 0000000..79eb93b --- /dev/null +++ b/public/.gitignore @@ -0,0 +1 @@ +.htaccess \ No newline at end of file diff --git a/public/_inc.php b/public/_inc.php new file mode 100644 index 0000000..391d3db --- /dev/null +++ b/public/_inc.php @@ -0,0 +1,16 @@ + diff --git a/public/images/.gitignore b/public/images/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..1422a17 --- /dev/null +++ b/public/index.php @@ -0,0 +1,21 @@ +smarty(); + + $page = new StatusBoard_Page($smarty, $main->request()); + if ($page->evaluate()) { + $smarty->display('index.tpl'); + } + +} catch (StatusBoard_Exception $e) { + die("Uncaught Exception: " . $e->getMessage()); +} + +?> \ No newline at end of file diff --git a/public/scripts/main.js b/public/scripts/main.js new file mode 100644 index 0000000..e089232 --- /dev/null +++ b/public/scripts/main.js @@ -0,0 +1,5 @@ +/** + * StatusBoard main script file + * + * + */ \ No newline at end of file diff --git a/public/styles/normal.css b/public/styles/normal.css new file mode 100644 index 0000000..9f4e8eb --- /dev/null +++ b/public/styles/normal.css @@ -0,0 +1,92 @@ +/** + * StatusBoard normal stylesheet + * + */ + +@CHARSET "UTF-8"; + +body { + margin: 0em; + padding: 0em; + font-family: verdana, helvetica, sans-serif; +} + +a { + color: gray; +} + +label { + margin-left: 1em; + margin-right: 1em; +} + +#container { + width: 75%; + min-width: 75em; + margin: auto; +} + +#banner { + margin: 0em; + padding: 0em; +} + +#banner h1 { + padding: 0.5em; +} + +#navigation { + margin-top: 0em; + margin-bottom: 1em; + padding: 0.2em; +} + +#navigation ul { + margin: 0em; + padding: 0em 5em;; + list-style: none; +} + +#navigation li { + margin: 1em; + padding: 0em; + display: inline; +} + +#page-container { + margin: 0em; + padding: 0em; +} + +#sidebar { + float: left; + width: 20em; + margin-bottom: 1em; +} + +#page { + margin-left: 21em; + margin-bottom: 1em; + padding: 0.5em; +} + +#footer { + clear: both; + padding: 2em; + font-size: smaller; + font-style: italic; + + color: #333333; +} + +#errors { + background: peachpuff; + color: darkred; + margin: 1em; +} + +#messages { + background: lightcyan; + color: darkblue; + margin: 1em; +} \ No newline at end of file diff --git a/source/lib/StatusBoard/Main.class.php b/source/lib/StatusBoard/Main.class.php new file mode 100644 index 0000000..650c6ac --- /dev/null +++ b/source/lib/StatusBoard/Main.class.php @@ -0,0 +1,65 @@ +request = new StatusBoard_RequestParser($request_string, self::TEMPLATE_DIR); + + switch (StatusBoard_File) { + case 'ajax': + case 'index': { + $smarty_tmp = $this->config->get('templates.tmp_path'); + $this->smarty = new Smarty(); + $this->smarty->template_dir = static::makeAbsolutePath(self::TEMPLATE_DIR); + $this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/templates'); + $this->smarty->cache_dir = static::makeAbsolutePath($smarty_tmp . '/cache'); + $this->smarty->config_dir = static::makeAbsolutePath($smarty_tmp . '/config'); + $this->smarty->plugins_dir[]= static::makeAbsolutePath('../source/webui/smarty/plugins'); + + $this->smarty->registerPlugin('modifier', 'formatDuration', array('StatusBoard_Main', 'formatDuration')); + $this->smarty->registerPlugin('modifier', 'formatFilesize', array('StatusBoard_Main', 'formatFilesize')); + + $this->smarty->assign('version', '0.1.0'); + $this->smarty->assign('messages', array()); + + $this->smarty->assign('base_uri', $this->base_uri); + $this->smarty->assign('base_url', static::absoluteUrl('')); + + } break; + + } + } + + public function smarty() { + return $this->smarty; + } + + /** + * + * @return StatusBoard_RequestParser + */ + public function request() { + return $this->request; + } + + +} + +?> diff --git a/source/webui/templates/admin.tpl b/source/webui/templates/admin.tpl new file mode 100644 index 0000000..30404ce --- /dev/null +++ b/source/webui/templates/admin.tpl @@ -0,0 +1 @@ +TODO \ No newline at end of file diff --git a/source/webui/templates/errors/404.tpl b/source/webui/templates/errors/404.tpl new file mode 100644 index 0000000..607707a --- /dev/null +++ b/source/webui/templates/errors/404.tpl @@ -0,0 +1,6 @@ +

The requested page could not be found

+

+ The file you requested ({$requested_page}) could not be found. + If you typed in the address manually, check that you have spelled it correctly, + or if you followed a link, let us know and we'll look into it. +

\ No newline at end of file diff --git a/source/webui/templates/errors/unhandled-exception.tpl b/source/webui/templates/errors/unhandled-exception.tpl new file mode 100644 index 0000000..58ce7f6 --- /dev/null +++ b/source/webui/templates/errors/unhandled-exception.tpl @@ -0,0 +1,46 @@ +

An unhandled error has occurred

+

+ There was a problem trying to complete the requested action. Please try again and if the problem persists, let us know. +

+ +{if $display_exceptions} +

+ An unhandled exception was caught during the page template processing. The full details are shown below: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exception{$exception_type}
File{$exception->getFile()}
Line{$exception->getLine()}
Message{$exception->getMessage()}
Stack Trace
{$exception->getTrace()|print_r}
+ +

+ Note: Exception details should not be displayed on production systems. + Disable the debug.show_exceptions + setting to omit the exception details from this page. +

+{/if} \ No newline at end of file diff --git a/source/webui/templates/home.tpl b/source/webui/templates/home.tpl new file mode 100644 index 0000000..30404ce --- /dev/null +++ b/source/webui/templates/home.tpl @@ -0,0 +1 @@ +TODO \ No newline at end of file diff --git a/source/webui/templates/index.tpl b/source/webui/templates/index.tpl new file mode 100644 index 0000000..5c3acc6 --- /dev/null +++ b/source/webui/templates/index.tpl @@ -0,0 +1,60 @@ + + + + Status Board + + + + + + + + + + + + + +
+ + + + + +
+ + + +
+ + {if $messages} +
+ {foreach from=$messages item=message} + {$message} + {/foreach} +
+ {/if} + + {$page_content} + +
+ +
+ + + +
+ + diff --git a/source/webui/templates/navigation.tpl b/source/webui/templates/navigation.tpl new file mode 100644 index 0000000..96cbfc9 --- /dev/null +++ b/source/webui/templates/navigation.tpl @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/source/webui/templates/sidebar.tpl b/source/webui/templates/sidebar.tpl new file mode 100644 index 0000000..1dcbf63 --- /dev/null +++ b/source/webui/templates/sidebar.tpl @@ -0,0 +1,6 @@ +
+

Services

+ +
\ No newline at end of file