Subversion-Projekte lars-tiefland.ci

Revision

Revision 1702 | Revision 1737 | 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');
828 lars 11
	}
1584 lars 12
 
13
	public function edit($id = null)
1577 lars 14
	{
1702 lars 15
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
16
		{
17
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
18
			$this->smarty->assign('artikelstatus', $artikelstatus);
19
		}
20
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
21
		{
22
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
23
			$this->smarty->assign('lieferstatus', $lieferstatus);
24
		}
25
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
26
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
27
		{
28
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
29
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
30
		}
1618 lars 31
		$robots = array(
32
			"index,follow",
33
			"index,nofollow",
34
			"noindex,follow",
35
			"noindex,nofollow",
36
			);
1588 lars 37
		$hersteller = $this->hersteller->get_list('dropdown');
1577 lars 38
		$daten = array();
1584 lars 39
		if ($id)
1577 lars 40
		{
41
			$daten = $this->artikel->get($id);
42
		}
1618 lars 43
		$this->smarty->assign('robots', $robots);
1586 lars 44
		$this->smarty->assign('hersteller', $hersteller);
1584 lars 45
		$this->smarty->assign('daten', $daten);
1577 lars 46
		$this->smarty->view('artikel.tpl');
47
	}
1673 lars 48
 
49
	public function save()
50
	{
51
		$artikel = $this->input->post('artikel');
1729 lars 52
		$meta = $this->input->post('metatags');
1673 lars 53
		$preise = $this->input->post('preise');
54
		$auispraegungen = $this->input->post('auspraegung');
55
		$optionen = $this->input->post('optionen');
56
		$this->artikel->save($artikel);
1729 lars 57
		$this->metatags->save($meta, 'artikel');
1673 lars 58
	}
1577 lars 59
}