<?php

/**

* @version		1.1

* @package		DJ Classifieds

* @subpackage	DJ Classifieds Component

* @copyright	Copyright (C) 2010 Blue Constant Media LTD, All rights reserved.

* @license		http://www.gnu.org/licenses GNU/GPL

* @autor url    http://design-joomla.eu

* @autor email  contact@design-joomla.eu

* @Developer    Lukasz Ciastek - lukasz.ciastek@design-joomla.eu

* 

* 

* DJ Classifieds is free software: you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation, either version 3 of the License, or

* (at your option) any later version.

*

* DJ Classifieds is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with DJ Classifieds. If not, see <http://www.gnu.org/licenses/>.

* 

*/

defined ('_JEXEC') or die('Restricted access');



jimport('joomla.application.component.view');





class DJClassifiedsViewAddItem extends JView



{



	function display()



	{

		global $mainframe;

		$par = &JComponentHelper::getParams( 'com_djclassifieds' );

		$session = &JFactory::getSession();		

		$val = $session->get('captcha_sta','0');

		$user = & JFactory::getUser();

		//echo $val;

		

		if($par->get('user_type')==1 && $user->id=='0'){

			parent::display('login');

		}else{		

			if($val==0 && $par->get('captcha')==1 && JRequest::getVar('id', 0, '', 'int' )==0){

				parent::display('captcha');	

			}else{

				$model =& $this->getModel();

	    		$cats = $model->getCategories();

				$par =& $mainframe->getParams('com_djclassifieds');

				$item = $model->getItem();

			

				$this->assignRef('par',$par);

 	    		$this->assignRef('list',$cats);

				$this->assignRef('nl',$item);



        		parent::display();			

			}

		}

	}



}









