Example #1
0
 private function default_vars()
 {
     $curPageFull = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $curPage = explode("?", $curPageFull);
     $cfg = $this->f3->get('cfg');
     unset($cfg['DB']);
     $this->vars['_isLocal'] = isLocal();
     $this->vars['_version'] = $this->f3->get('_version');
     $this->vars['_v'] = $this->f3->get('_v');
     $this->vars['_cfg'] = $cfg;
     $this->vars['_folder'] = $this->vars['folder'];
     $this->vars['_domain'] = "http://" . $_SERVER['HTTP_HOST'];
     $this->vars['_user'] = $this->f3->get('user');
     $this->vars['_isAjax'] = is_ajax();
     $pageContent = models\pages::getInstance()->getAll();
     $p = array();
     foreach ($pageContent as $item) {
         $p[$item['ID']] = $item['content'];
     }
     $this->vars['_page_content'] = $p;
     $this->vars['_categories'] = models\categories::format($this->f3->get('categories'), true);
     $this->vars['_itemCount'] = $this->f3->get('itemCount');
     //test_array($categories);
 }
Example #2
0
        $uri = str_replace($_GET['login_password'], "", $uri);
    }
    $uri = str_replace("&&", "&", $uri);
    $uri = str_replace("&&", "&", $uri);
    $uri = str_replace("&&", "&", $uri);
    $uri = str_replace("&&", "&", $uri);
    $uri = str_replace("&&", "&", $uri);
    $uri = str_replace("?&", "?", $uri);
    if ($uri == "?") {
        $uri = "";
    }
    $url = "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s://" : "://") . $_SERVER['HTTP_HOST'] . $uri;
    $f3->reroute($url);
}
$user = $userO->get($uID);
$categories = models\categories::getInstance()->getAll("", "category ASC");
$f3->set('user', $user);
$f3->set('session', $SID);
$f3->set('categories', $categories);
$f3->set('itemCount', count(models\items::getInstance()->getAll("")));
$f3->route('GET /txt', function ($f3) {
    echo "Hallo World";
});
$f3->route('GET|POST /login', 'controllers\\login->page');
$f3->route('GET|POST /', 'controllers\\home->page');
$f3->route('GET|POST /map', 'controllers\\map->page');
$f3->route('GET|POST /list/@letter', 'controllers\\list_alphabet->page');
$f3->route('GET|POST /list/@catID/@url', 'controllers\\list_category->page');
$f3->route('GET|POST /item/@ID/@url', 'controllers\\item_details->page');
$f3->route('GET|POST /search', 'controllers\\search->page');
$f3->route('GET|POST /about', 'controllers\\about->page');