Browse Source

prevent errors if menu is not defined

tags/v1.0
parent
commit
01db93ed0f
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      index.php

+ 12
- 6
index.php View File

@@ -17,6 +17,10 @@ $f3->set('UI', implode(';',array(
ROOT.'content/' // content folders can contain .html templates
)));

if(!is_dir($f3->get('TEMP'))) {
mkdir($f3->get('TEMP'));
}



/////////////////////////
@@ -71,12 +75,14 @@ if(array_key_exists($f3->get('LANG'), $f3->get('nav.network'))) {
} else {
$menu=$f3->get('nav.network.'.$f3->get('default_lang'));
}
foreach($menu as $k=>$v) {
$ex = explode(": ", $menu[$k]);
$menu[$k] = array(
'name' => trim($ex[0]),
'href' => count($ex) > 1 ? $ex[1] : $ex
);
if(is_array($menu)) {
foreach($menu as $k=>$v) {
$ex = explode(": ", $menu[$k]);
$menu[$k] = array(
'name' => trim($ex[0]),
'href' => count($ex) > 1 ? $ex[1] : $ex
);
}
}
$f3->set('navi.network._config.addHome', $f3->get('nav.network.config.addHome'));
$f3->set('navi.network', $menu);

Loading…
Cancel
Save