Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 374 | Revision 376 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 374 Revision 375
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile -... Zeile 2...
-
 
2
 
2
 
3
    use Illuminate\Support\Facades\DB;
3
    use PHPHtmlParser\Dom;
4
    use PHPHtmlParser\Dom;
4
    use App\Models\Action;
5
    use App\Models\Action;
5
    use App\Models\Item;
6
    use App\Models\Item;
6
    use App\Models\Directory;
7
    use App\Models\Directory;
7
    use Illuminate\Support\Facades\Route;
8
    use Illuminate\Support\Facades\Route;
8
    use PHPHtmlParser\Exceptions\ChildNotFoundException;
9
    use PHPHtmlParser\Exceptions\ChildNotFoundException;
9
    use PHPHtmlParser\Exceptions\CircularException;
10
    use PHPHtmlParser\Exceptions\CircularException;
-
 
11
    use PHPHtmlParser\Exceptions\CurlException;
10
    use PHPHtmlParser\Exceptions\CurlException;
12
    use PHPHtmlParser\Exceptions\NotLoadedException;
Zeile 11... Zeile 13...
11
    use PHPHtmlParser\Exceptions\StrictException;
13
    use PHPHtmlParser\Exceptions\StrictException;
12
 
14
 
13
    /*
15
    /*
Zeile 33... Zeile 35...
33
        $GLOBALS["langstrings"][$langstring->page_id][$langstring->id] = $langstring->string;
35
        $GLOBALS["langstrings"][$langstring->page_id][$langstring->id] = $langstring->string;
34
    }
36
    }
Zeile 35... Zeile 37...
35
 
37
 
36
    function parseCMSPage( $url ): array
38
    function parseCMSPage( $url ): array
-
 
39
    {
-
 
40
        $menu = "";
37
    {
41
        $content = "";
38
        $dom = new Dom;
42
        $dom = new Dom;
39
        try
43
        try
40
        {
44
        {
-
 
45
            $dom->loadFromUrl( $url );
-
 
46
            $menu = $dom->getElementById( 'menu' )->innerHtml;
-
 
47
            $menu = str_replace( "/typo3", "/cms", $menu );
-
 
48
            $content = $dom->getElementById( 'content' )->innerHtml;
-
 
49
            $content = str_replace( "fileadmin/", $GLOBALS["INI"]["typo3"]["url"] . "/typo3/fileadmin/", $content );
41
            $dom->loadFromUrl( $url );
50
            $content = str_replace( "ce-textpic", "", $content );
42
        }
51
        }
43
        catch ( ChildNotFoundException|CircularException|CurlException|StrictException $e )
52
        catch ( ChildNotFoundException|CircularException|CurlException|StrictException|NotLoadedException $e )
44
        {
53
        {
45
        }
-
 
46
        $menu = $dom->getElementById( 'menu' )->innerHtml;
-
 
47
        $menu = str_replace( "/typo3", "/cms", $menu );
-
 
48
        $content = $dom->getElementById( 'content' )->innerHtml;
-
 
49
        $content = str_replace( "fileadmin/", $GLOBALS["INI"]["typo3"]["url"] . "/typo3/fileadmin/", $content );
-
 
50
        $content = str_replace( "ce-textpic", "", $content );
54
        }
51
        return array( "menu" => $menu, "content" => $content, );
55
        return array( "menu" => $menu, "content" => $content, );
Zeile 52... Zeile 56...
52
    }
56
    }
53
 
57
 
Zeile 116... Zeile 120...
116
    $sc = parseCMSPage( $GLOBALS["INI"]["typo3"]["url"] . "/typo3/" );
120
    $sc = parseCMSPage( $GLOBALS["INI"]["typo3"]["url"] . "/typo3/" );
117
    $GLOBALS["serviceCenterMenu"] = $sc["menu"];
121
    $GLOBALS["serviceCenterMenu"] = $sc["menu"];
118
    /* Mobile Weiche */
122
    /* Mobile Weiche */
119
    if ( isset( $_SERVER["HTTP_USER_AGENT"] ) )
123
    if ( isset( $_SERVER["HTTP_USER_AGENT"] ) )
120
    {
124
    {
121
        if ( !isset( $_SESSION['isMobile'] ) || $_SESSION['isMobile'] == false || !isset( $GLOBALS['isMobile'] ) || $GLOBALS['isMobile'] == false )
125
        if ( !isset( $_SESSION['isMobile'] ) || $_SESSION['isMobile'] === false || !isset( $GLOBALS['isMobile'] ) || $GLOBALS['isMobile'] === false )
122
        {
126
        {
Zeile 123... Zeile 127...
123
 
127
 
124
            $_SESSION['isMobile'] = false;
128
            $_SESSION['isMobile'] = false;
Zeile 125... Zeile 129...
125
            $GLOBALS['isMobile'] = false;
129
            $GLOBALS['isMobile'] = false;
126
 
130
 
127
            if (
-
 
128
                preg_match( "/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine
-
 
129
        |htc|iemobile|iphone|iPad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|
-
 
130
        panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus
131
            if (
131
        |up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i", $_SERVER["HTTP_USER_AGENT"] )
132
                preg_match( "/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|iPad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i", $_SERVER["HTTP_USER_AGENT"] )
Zeile 132... Zeile 133...
132
            )
133
            )
133
            {
134
            {