summaryrefslogtreecommitdiffstats
path: root/modules/main.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2014-10-16 11:35:14 +0200
committerSimon Rettberg2014-10-16 11:35:14 +0200
commit358842a847ce67632204135bbb3c9c8f2267f243 (patch)
tree04d81e475f9faa2d181c62efa8c32a80a1fb8013 /modules/main.inc.php
parentDo a chdir in api.php to the script dir to simplify cmdline calls (diff)
downloadslx-admin-358842a847ce67632204135bbb3c9c8f2267f243.tar.gz
slx-admin-358842a847ce67632204135bbb3c9c8f2267f243.tar.xz
slx-admin-358842a847ce67632204135bbb3c9c8f2267f243.zip
Show notice in menu bar if setup is incomplete
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r--modules/main.inc.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/main.inc.php b/modules/main.inc.php
index 01adf768..71d5071a 100644
--- a/modules/main.inc.php
+++ b/modules/main.inc.php
@@ -3,9 +3,17 @@
class Page_Main extends Page
{
+ private $sysconfig;
+ private $minilinux;
+ private $vmstore;
+
protected function doPreprocess()
{
User::load();
+ $this->sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz');
+ $this->minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs');
+ $this->vmstore = !is_array(Property::getVmStoreConfig());
+ Property::setNeedsSetup(($this->sysconfig || $this->minilinux || $this->vmstore) ? 1 : 0);
}
protected function doRender()
@@ -19,14 +27,12 @@ class Page_Main extends Page
return;
}
// Logged in here
- $sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz');
- $minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs');
- $vmstore = !is_array(Property::getVmStoreConfig());
+
Render::addTemplate('page-main', array(
'user' => User::getName(),
- 'sysconfig' => $sysconfig,
- 'minilinux' => $minilinux,
- 'vmstore' => $vmstore
+ 'sysconfig' => $this->sysconfig,
+ 'minilinux' => $this->minilinux,
+ 'vmstore' => $this->vmstore
));
}