| 2 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
use Illuminate\Support\Facades\Route;
|
|
|
4 |
|
|
|
5 |
/*
|
|
|
6 |
|--------------------------------------------------------------------------
|
|
|
7 |
| Web Routes
|
|
|
8 |
|--------------------------------------------------------------------------
|
|
|
9 |
|
|
|
|
10 |
| Here is where you can register web routes for your application. These
|
|
|
11 |
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
12 |
| contains the "web" middleware group. Now create something great!
|
|
|
13 |
|
|
| 88 |
lars |
14 |
*/
|
| 2 |
lars |
15 |
|
| 88 |
lars |
16 |
session_start();
|
|
|
17 |
|
| 91 |
lars |
18 |
/* Mobile Weiche */
|
|
|
19 |
if (isset($_SERVER["HTTP_USER_AGENT"])) {
|
|
|
20 |
if (!isset($_SESSION['isMobile']) || $_SESSION['isMobile'] == false || !isset($GLOBALS['isMobile']) || $GLOBALS['isMobile'] == false) {
|
| 88 |
lars |
21 |
|
|
|
22 |
$_SESSION['isMobile'] = false;
|
|
|
23 |
$GLOBALS['isMobile'] = false;
|
|
|
24 |
|
| 91 |
lars |
25 |
if (preg_match("/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine
|
| 88 |
lars |
26 |
|htc|iemobile|iphone|iPad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|
|
|
|
27 |
panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus
|
| 91 |
lars |
28 |
|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i", $_SERVER["HTTP_USER_AGENT"])) {
|
| 88 |
lars |
29 |
|
|
|
30 |
$_SESSION['isMobile'] = true;
|
|
|
31 |
$GLOBALS['isMobile'] = true;
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
}
|
| 91 |
lars |
35 |
}
|
| 68 |
lars |
36 |
Route::get("/directory/{id}", function ($id) {
|
| 70 |
lars |
37 |
$menu = \App\Models\Directory::where("directory_id", -1)->get();
|
| 68 |
lars |
38 |
$dirs = \App\Models\Directory::where("directory_id", $id)->get();
|
|
|
39 |
$items = \App\Models\Item::where("directory_id", $id)->get();
|
| 91 |
lars |
40 |
return view('subdir', ["dirs" => $dirs, "items" => $items, "menu" => $menu, "ini" => array("infoline" => "")]);
|
| 67 |
lars |
41 |
});
|
| 74 |
lars |
42 |
Route::get("/item/{id}", function ($id) {
|
|
|
43 |
$menu = \App\Models\Directory::where("directory_id", -1)->get();
|
|
|
44 |
$item = \App\Models\Item::find($id);
|
| 91 |
lars |
45 |
return view('item', ["item" => $item, "menu" => $menu, "ini" => array("infoline" => "")]);
|
| 74 |
lars |
46 |
});
|
| 2 |
lars |
47 |
Route::get('/', function () {
|
| 16 |
lars |
48 |
$aktion = \App\Models\Action::all();
|
| 68 |
lars |
49 |
$dirs = \App\Models\Directory::where("directory_id", -1)->get();
|
| 91 |
lars |
50 |
return view('startpage', ["aktion" => $aktion, "menu" => $dirs, "ini" => array("infoline" => "")]);
|
| 2 |
lars |
51 |
});
|