Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
<?
2
	function item($id)
3
	{
4
 
5
		counter($id,'artikel',$_SESSION['INI']['shops_ID']);
6
 
7
		$item		=	getItem($id);
8
		//$AddOnItems	=	getAddOnItems($id);
9
		$item['beschreibung'] = trim($item['beschreibung']);
10
		$item['beschreibung'] = empty($item['beschreibung']) || $item['beschreibung']===NULL ? $_SESSION['INI']['itemKorrektur']['emptyArticleDescr'] : $item['beschreibung'];
11
 
12
		$features	=	getOptions($id);
13
		$tester		=	getTester($id);
14
 
15
		/* ************************************************************************ */
16
		// SelectTemplate auslesen
17
		$selectTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['selectTemplate']);
18
		$optionTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['optionTemplate']);
19
 
20
		$buffer=array();
21
		foreach($features as $feature)
22
		{
23
			$buffer2=array();
24
			foreach($feature['options'] as $option)
25
			{
26
				$buffer2[] = templateContent($option, $optionTemplate);
27
			}
28
			$feature['optionen'] = implode($buffer2,"");
29
			$buffer[] = templateContent($feature, $selectTemplate);
30
		}
31
 
32
		$item['optionen'] = implode($buffer,"");
33
 
34
 
35
		/* ************************************************************************ */
36
		// Tester template auslesen
37
		$testerTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['tester']);
38
 
39
		$buffer=array();
40
		foreach($tester as $test)
41
		{
42
			$buffer[] = templateContent($test, $testerTemplate);
43
		}
44
 
45
		$item['tester'] = implode($buffer,"");
46
		$item['kurzbezeichnung'] = $item['kurzbezeichnung'];
47
 
48
		/* ************************************************************************ */
49
		// AddOnItemstemplate auslesen
50
		/*
51
		$template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItem']);
52
 
53
		$addOnItemImageTemplate = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItemImage']);
54
 
55
		$buffer=array();
56
		foreach($AddOnItems as $AddOnItem)
57
		{
58
			$buffer[] = templateContent($AddOnItem, $template);
59
		}
60
 
61
		$buffer['AddOnItems'] = implode("",$buffer);
62
		$buffer['kurzbezeichnung'] = $item['kurzbezeichnung'];
63
 
64
		// AddOnItemContainertemplate auslesen
65
		$template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['addOnItemContainer']);
66
		$item['AddOnItems'] = templateContent($buffer, $template);
67
		*/
68
 
69
 
70
		/* ************************************************************************ */
71
		// Buttons definieren
72
 
73
		// Zubeh�r-Button ['b2']
74
		if (count($buffer) > 1)
75
		{
76
			$item['b2'] = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['zubehoerButton']);
77
		}
78
 
79
		// Tests-Button ['b3']
80
		if ($tests)
81
		{
82
			$item['b3'] = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['testButton']);
83
		}
84
 
85
		// Falls Bild_2: Bild_1 um Hyperlink erweitern
86
		if ($item["bild_2_url"] == $_SESSION['INI']['itemKorrektur']['noImage']) {
87
			$template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['bild_1']);
88
		}
89
		else
90
		{
91
			$template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['bild_1_and_2']);
92
		}
93
		$item['bild_1_and_2'] = templateContent($item, $template);
94
 
95
		/* ************************************************************************ */
96
		// Artikel Zusatzinfo
97
 
98
		if ($item["artikel_zusatzinfo"])
99
		{
100
 
101
			$template = file_get_contents("templates/item/euLabelHead.htm");
102
			$item["artikel_zusatzinfo"] = templateContent(array("tableContent" => implode("",decodeZusatzInfo($item["artikel_zusatzinfo"]))), $template);
103
		}
104
 
105
		/* ************************************************************************ */
106
		// Artikeltemplate auslesen
107
		$template = file_get_contents($_SESSION['INI']['TEMPLATE']['item']['item']);
108
 
109
 
110
		/* ************************************************************************ */
111
		// kurzbeschreibung / langbezeichnung
112
		$item["langbezeichnung"] = templateContent($item, file_get_contents($_SESSION['INI']['TEMPLATE']['item']['shortDescr']));
113
 
114
		//pre($item);
115
 
116
		return templateContent($item, $template);
117
	}
118
	echo item($_GET['item'])
119
?>