Lead users to setup check page when no config file given
[phorkie.git] / www / www-header.php
index 3fa4e0e7ba6e05b38d10cf9ffb4d41ff5ffdb525..5381eed67a4f01e89b528ad7a47a8630d6031d9d 100644 (file)
@@ -40,9 +40,12 @@ if ($pharFile == '') {
     $cfgFilePath = substr($pharFile, 7) . '.config.php';
 }
 $GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = false;
     $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;
 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) {
 }
 
 if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) {
@@ -101,6 +104,7 @@ function render($tplname, $vars = array())
     if (!isset($vars['htmlhelper'])) {
         $vars['htmlhelper'] = new HtmlHelper();
     }
     if (!isset($vars['htmlhelper'])) {
         $vars['htmlhelper'] = new HtmlHelper();
     }
+    $vars['suggestSetupCheck'] = $GLOBALS['phorkie']['suggestSetupCheck'];
 
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     echo $template->render($vars);
 
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     echo $template->render($vars);