From: Christian Weiske Date: Fri, 4 Jul 2014 09:11:53 +0000 (+0200) Subject: Lead users to setup check page when no config file given X-Git-Tag: v0.4.0~20 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/8c40f2a64ae2ba63a1ed6c89cb7ce8a4b07e4dd1?hp=47a3b51ef8ab7d47bc5492c830bc8905e3fb872e Lead users to setup check page when no config file given --- diff --git a/data/templates/base.htm b/data/templates/base.htm index 90ccc0a..86c79e6 100644 --- a/data/templates/base.htm +++ b/data/templates/base.htm @@ -74,6 +74,12 @@
+ {% if suggestSetupCheck %} +
+ It seems phorkie is not setup properly. + Visit the setup check page for more information. +
+ {% endif %} {% block content %}{% endblock %}
diff --git a/www/www-header.php b/www/www-header.php index 3fa4e0e..5381eed 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -40,9 +40,12 @@ if ($pharFile == '') { $cfgFilePath = substr($pharFile, 7) . '.config.php'; } $GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = false; +$GLOBALS['phorkie']['suggestSetupCheck'] = false; if (file_exists($cfgFilePath)) { $GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = true; require_once $cfgFilePath; +} else if ($GLOBALS['phorkie']['cfg']['setupcheck']) { + $GLOBALS['phorkie']['suggestSetupCheck'] = true; } if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) { @@ -101,6 +104,7 @@ function render($tplname, $vars = array()) if (!isset($vars['htmlhelper'])) { $vars['htmlhelper'] = new HtmlHelper(); } + $vars['suggestSetupCheck'] = $GLOBALS['phorkie']['suggestSetupCheck']; $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm'); echo $template->render($vars);