<?php
/******************************************************************************/
// Posebna stran modula, kjer se nastavlja editor (request in response)
// Date: 2008
/******************************************************************************/

/* NE SPREMINJAJ **************************************************************/
if($editor_stage == "generate")
{
/******************************************************************************/
/* Uporaba:
	- vsak zavihek ima svojo stopnjo, najprej kličemo ukaz:
--> $editor->generate_stopnja("stopnja");
	  * stopnja mora biti definirana v $mod_settings['editor_stopnja']

	- potem poljubno definiramo vnosna polja
--> $editor->generate_field("ime_polja", "ime_prikaz", "vrsta_polja", "lang");
	  * vrsta polja je lahko (text, textarea, izberi)
	  * required (ni obvezen), drugače prazno
	  * lang (ni obvezen), true ali false
/******************************************************************************/
	$editor->required(array("sifra", "kategorija"));
	switch($clean['stopnja'])
	{
		case "1":
			$_SESSION['editor_stopnja'] = 1;
			$editor->generate_stopnja("Splošno");
			$editor->generate_field("nepremicnina", "Nepremičnina", "text");
			$editor->generate_field("sifra", "Šifra", "text");
			$editor->generate_field("test", "Test", "text", true);
			$editor->generate_field("karneki", "Karneki", "text", true);
			$editor->generate_field("opis", "Opis", "richtextarea");
		break;
		case "2":
			$_SESSION['editor_stopnja'] = 2;
			$editor->generate_stopnja("Kategorija");
			$editor->generate_field("kategorija", "Kategorija", "kategorija");
		break;
		case "3":
			$_SESSION['editor_stopnja'] = 3;
			$editor->generate_stopnja("Galerija");
			$editor->generate_galerija();
		break;
		case "4":
			$_SESSION['editor_stopnja'] = 4;
			$editor->generate_stopnja("Slika");
			$editor->generate_poljeSlika();
		break;
		case "5":
			$_SESSION['editor_stopnja'] = 5;
			$editor->generate_stopnja("Datoteke");
			$editor->generate_datoteka();
		break;
		default:
			unset($_SESSION['editor_stopnja']);
			$editor->generate_zakljucek();
		break;
	}

/* NE SPREMINJAJ **************************************************************/
}
elseif($editor_stage == "response")
{
/******************************************************************************/

	switch($_SESSION['editor_stopnja'])
	{
		case 1:
			$sqlclean['nepremicnina'] = inputXSScheck($_POST['nepremicnina']);
			$sqlclean['sifra'] = inputXSScheck($_POST['sifra']);
			$sqlclean['kraj'] = inputXSScheck($_POST['kraj']);
			//zadeva ni preverjana
			$sqlclean['opis'] = inputXSSallowHTML($_POST['opis']);
			$sqlclean[$clean['lang'].'test'] = inputXSScheck($_POST[$clean['lang'].'test']);
			$sqlclean[$clean['lang'].'karneki'] = inputXSScheck($_POST[$clean['lang'].'karneki']);
		break;
		case 2:
			$sqlclean['kategorija'] = intval($_POST['kategorija']);
		break;
		case 3:
			$sqlclean = array();
		break;
		case 4:
			$sqlclean = array();
		break;
		case 5:
			$sqlclean = array();
		break;
		default:
			$sqlclean = array();
		break;
	}

/******************************************************************************/
}
/******************************************************************************/
?>