Subversion-Projekte lars-tiefland.ci

Revision

Revision 1737 | Revision 1746 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
898 lars 1
<?php
1577 lars 2
 
3
class Artikel extends CI_Controller
4
{
5
	public function __construct()
828 lars 6
	{
1577 lars 7
		parent::__construct();
8
		$this->load->model('artikel_model', 'artikel');
1584 lars 9
		$this->load->model('herstellerkatalog_model', 'hersteller');
1729 lars 10
		$this->load->model('metatags_model', 'metatags');
1739 lars 11
		$this->load->model('preise_model', 'preise');
828 lars 12
	}
1584 lars 13
 
14
	public function edit($id = null)
1577 lars 15
	{
1702 lars 16
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
17
		{
18
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
19
			$this->smarty->assign('artikelstatus', $artikelstatus);
20
		}
21
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
22
		{
23
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
24
			$this->smarty->assign('lieferstatus', $lieferstatus);
25
		}
26
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
27
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
28
		{
29
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
30
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
31
		}
1618 lars 32
		$robots = array(
33
			"index,follow",
34
			"index,nofollow",
35
			"noindex,follow",
36
			"noindex,nofollow",
37
			);
1588 lars 38
		$hersteller = $this->hersteller->get_list('dropdown');
1577 lars 39
		$daten = array();
1584 lars 40
		if ($id)
1577 lars 41
		{
42
			$daten = $this->artikel->get($id);
43
		}
1737 lars 44
		$preiseNamen = explode(";", ";".$GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"]);
45
		$this->smarty->assign('preisNamen', $preiseNamen);
1618 lars 46
		$this->smarty->assign('robots', $robots);
1586 lars 47
		$this->smarty->assign('hersteller', $hersteller);
1584 lars 48
		$this->smarty->assign('daten', $daten);
1577 lars 49
		$this->smarty->view('artikel.tpl');
50
	}
1673 lars 51
 
52
	public function save()
53
	{
54
		$artikel = $this->input->post('artikel');
1729 lars 55
		$meta = $this->input->post('metatags');
1673 lars 56
		$preise = $this->input->post('preise');
57
		$auispraegungen = $this->input->post('auspraegung');
58
		$optionen = $this->input->post('optionen');
59
		$this->artikel->save($artikel);
1729 lars 60
		$this->metatags->save($meta, 'artikel');
1673 lars 61
	}
1577 lars 62
}