Subversion-Projekte lars-tiefland.shop_ns

Revision

Revision 28 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php
    /**
     * @package shop
     * @author Lars Tiefland <ltiefland@gmail.com>
     * @copyright 2012
     * @version $Id$
     */

    /**
     * @package shop
     * @author Lars Tiefland <ltiefland@gmail.com>
     * @copyright 2012
     * @version $Id$
     */

    namespace Weban;
    define( "__SITE__", "mediaran.de" );
    define( "__SHOP__", "neu.mediaran.de" );
    require_once "classes/shop.class.php";

    $shop=new shop();

    function getPath( $root )
    {
        static $level = 0;
        $level++;

        if ( $root > 0 )
        {
            if ( $linked )
            {
                if ( $_GET["navigation"] )
                {
                    $nav = $_GET["navigation"];
                }
                else
                {
                    $nav = $root;
                }
                if ( $_GET["item"] )
                {
                    $verwendung = "a2d";
                }
                else
                {
                    $verwendung = "d2d";
                }
                $query = "SELECT
                        d.*
                    FROM
                        shop_link_table AS sl,
                        directory AS d
                    WHERE
                        sl.Father = " . $nav . "
                    AND
                        Verwendung='$verwendung'
                    AND
                        d.ID=sl.Father
                    AND
                        language= '" . $GLOBALS["INI"]["language"] . "'
                ";
            }
            else
            {
                $query = "SELECT
                        *
                    FROM
                        directory
                    WHERE
                        ID = $root
                    AND
                        language= '" . $GLOBALS["INI"]["language"] . "'
                ";
            }
            $result = $GLOBALS["db"]->query( $query );
            $GLOBALS['cnt_select']++;
            $zeile = $result->fetchRow();
            $dir = new directory( $zeile["ID"] );

            $path = getPath( $zeile['Father'] );

            $path[] = $dir;

            $level--;

            if ( $level == 0 )
            {
                foreach ( $path as $p )
                {
                    if ( $p->status == 1 )
                    {
                        $path = array();
                    }
                }
            }
            return $path;
        }
        else
        {
            $level--;
            return array();
        }
    }

    function shopPosition( $root )
    {
        $path = getPath( $root );
        //rsort( $path );
        return $path;
    }

    function getPageType( $type = "normal" )
    {
        // Überprüfung ob die Seite statisch ist, sollte die Seite statisch sein --> return "statisch"
        if ( $_GET['staticNav'] == true )
        {
            $p_type = "Statisch";
        }
        else
        {

            //Login-Seiten
            if ( $_POST['mode'] )
            {
                $p_type = "Loginseite";
            }
            elseif ( $_GET['mode'] )
            {
                $p_type = "Loginseite";
            }
            //Typo3-Seiten
            elseif ( $_GET['id'] or ( $_POST['id'] ) )
            {
                $p_type = "Typo3seite";
            }

            // Suchseite
            elseif ( $_GET['search'] )
            {
                if ( $type == "sonderkasten" )
                {
                    $p_type = "Unterseite";
                }
                else
                {
                    $p_type = "Suchseite";
                }
            }

            // Bestellvorgangsseite
            elseif ( $_GET['step'] )
            {
                $p_type = "Bestellvorgang" . $step;
            }

            // Warenkorbseite
            elseif ( $_GET['basket'] == true )
            {
                $p_type = "Warenkorb";
            }

            // Itemseite
            elseif ( $_GET['item'] )
            {
                if ( $type == "sonderkasten" )
                {
                    $p_type = "Unterseite";
                }
                else
                {
                    $p_type = "Itemseite";
                }
            }

            // Navigationsseite
            elseif ( $_GET['navigation'] )
            {
                if ( $type == "sonderkasten" )
                {
                    $p_type = "Unterseite";
                }
                else
                {
                    $p_type = "Navigationsseite";
                }
            }
            else
            {
                $p_type = "Startseite";
            }
        }
        return $p_type;
    }
?>