<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');
require_once(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_kip'.DS.'classes'.DS.'config.php');

class KipViewSettings extends JView
{
	function display( $tpl = null )
	{
		global $mainframe, $option;

		$config = & KipConfig::getInstance();
		$settings = $config->getParamsInfo();
		
		
		$filtering_mode = array();
		$filtering_mode[] = JHTML::_('select.option', '0', JText::_('disabled'));
		$filtering_mode[] = JHTML::_('select.option', '1', JText::_('whitelist'));
		$filtering_mode[] = JHTML::_('select.option', '2', JText::_('blacklist'));
		$settings['site.filtering_mode']->control = JHTML::_('select.radiolist',  $filtering_mode, 'site_filtering_mode', 'class="inputbox"', 'value', 'text', $settings['site.filtering_mode']->value);
		$settings['admin.filtering_mode']->control = JHTML::_('select.radiolist',  $filtering_mode, 'admin_filtering_mode', 'class="inputbox"', 'value', 'text', $settings['admin.filtering_mode']->value);

		$filtering_action = array();
		$filtering_action[] = JHTML::_('select.option', '1', JText::_('terminate application'));
		$filtering_action[] = JHTML::_('select.option', '2', JText::_('redirect to homepage'));
		$filtering_action[] = JHTML::_('select.option', '3', JText::_('"Site Offline" imitation'));
		$settings['site.filtering_action']->control = JHTML::_('select.genericlist',  $filtering_action, 'site_filtering_action', 'class="inputbox"', 'value', 'text', $settings['site.filtering_action']->value);
		
		$filtering_action = array();
		$filtering_action[] = JHTML::_('select.option', '1', JText::_('terminate application'));
		$filtering_action[] = JHTML::_('select.option', '2', JText::_('redirect to login page'));
		
		$settings['admin.filtering_action']->control = JHTML::_('select.genericlist',  $filtering_action, 'admin_filtering_action', 'class="inputbox"', 'value', 'text', $settings['admin.filtering_action']->value);

		$filtering_warning = array();
		$filtering_warning[] = JHTML::_('select.option', '0', JText::_('hide'));
		$filtering_warning[] = JHTML::_('select.option', '1', JText::_('show'));
		
		$settings['site.filtering_warning']->control = JHTML::_('select.radiolist',  $filtering_warning, 'site_filtering_warning', 'class="inputbox"', 'value', 'text', $settings['site.filtering_warning']->value);
		$settings['admin.filtering_warning']->control = JHTML::_('select.radiolist',  $filtering_warning, 'admin_filtering_warning', 'class="inputbox"', 'value', 'text', $settings['admin.filtering_warning']->value);
		$settings['users.filtering_warning']->control = JHTML::_('select.radiolist',  $filtering_warning, 'users_filtering_warning', 'class="inputbox"', 'value', 'text', $settings['users.filtering_warning']->value);

		$filtering_mode = array();
		$filtering_mode[] = JHTML::_('select.option', '0', JText::_('disabled'));
		$filtering_mode[] = JHTML::_('select.option', '1', JText::_('whitelist'));
		$settings['users.filtering_mode']->control = JHTML::_('select.radiolist',  $filtering_mode, 'users_filtering_mode', 'class="inputbox"', 'value', 'text', $settings['users.filtering_mode']->value);

		
		
		$this->assignRef('settings',		$settings);
		$this->assignRef('option', $option);
		$this->assignRef('view', $this->getName());
		parent::display($tpl);
		
	}
	
}
?>