Subversion-Projekte lars-tiefland.php_share

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        function item($id)
        {

                counter($id,'artikel',$_SESSION['INI']['shops_ID']);

                $item           =       getItem($id);
                //$AddOnItems   =       getAddOnItems($id);
                $item['beschreibung'] = trim($item['beschreibung']);
                $item['beschreibung'] = empty($item['beschreibung']) || $item['beschreibung']===NULL ? $_SESSION['INI']['itemKorrektur']['emptyArticleDescr'] : $item['beschreibung'];
                
                $features       =       getOptions($id);
                $tester         =       getTester($id);
                
                /* ************************************************************************ */
                // SelectTemplate auslesen
                $selectTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['selectTemplate']);
                $optionTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['optionTemplate']);
                
                $buffer=array();
                foreach($features as $feature)
                {
                        $buffer2=array();
                        foreach($feature['options'] as $option)
                        {
                                $buffer2[] = templateContent($option, $optionTemplate);                         
                        }
                        $feature['optionen'] = implode($buffer2,"");
                        $buffer[] = templateContent($feature, $selectTemplate);
                }

                $item['optionen'] = implode($buffer,"");


                /* ************************************************************************ */
                // Tester template auslesen
                $testerTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['tester']);
                
                $buffer=array();
                foreach($tester as $test)
                {
                        $buffer[] = templateContent($test, $testerTemplate);
                }

                $item['tester'] = implode($buffer,"");
                $item['kurzbezeichnung'] = $item['kurzbezeichnung'];

                /* ************************************************************************ */
                // AddOnItemstemplate auslesen
                /*
                $template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItem']);

                $addOnItemImageTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItemImage']);
                
                $buffer=array();
                foreach($AddOnItems as $AddOnItem)
                {
                        $buffer[] = templateContent($AddOnItem, $template);
                }

                $buffer['AddOnItems'] = implode("",$buffer);
                $buffer['kurzbezeichnung'] = $item['kurzbezeichnung'];

                // AddOnItemContainertemplate auslesen
                $template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItemContainer']);
                $item['AddOnItems'] = templateContent($buffer, $template);
                */


                /* ************************************************************************ */
                // Buttons definieren

                // Zubeh�r-Button ['b2']
                if (count($buffer) > 1)
                {
                        $item['b2'] = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['zubehoerButton']);
                }

                // Tests-Button ['b3']
                if ($tests)
                {
                        $item['b3'] = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['testButton']);
                }

                // Falls Bild_2: Bild_1 um Hyperlink erweitern
                if ($item["bild_2_url"] == $_SESSION['INI']['itemKorrektur']['noImage']) {
                        $template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['bild_1']);
                }
                else
                {
                        $template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['bild_1_and_2']);
                }
                $item['bild_1_and_2'] = templateContent($item, $template);

                /* ************************************************************************ */
                // Artikel Zusatzinfo
                
                if ($item["artikel_zusatzinfo"])
                {

                        $template = file_get_contents("templates/item/euLabelHead.htm");
                        $item["artikel_zusatzinfo"] = templateContent(array("tableContent" => implode("",decodeZusatzInfo($item["artikel_zusatzinfo"]))), $template);
                }               
                
                /* ************************************************************************ */
                // Artikeltemplate auslesen
                $template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['item']);


                /* ************************************************************************ */
                // kurzbeschreibung / langbezeichnung
                $item["langbezeichnung"] = templateContent($item, file_get_contents($_SESSION['INI']['TEMPLATE']['item']['shortDescr']));

                //pre($item);

                return templateContent($item, $template);
        }
        echo item($_GET['item'])
?>