<?php
/**
 * Система управления сайтом HostCMS v. 5.xx
 * Copyright © 2005-2010 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
 *
 * Обработчик добавления/редактирования категорий свойств для групп.
 * 
 * Файл: /admin/InformationSystems/action/add_group_property_dir.php
 * 
 * @author Hostmake LLC
 * @version 5.x
 */
$InformationSystem = new InformationSystem();

$param = array();

if (isset($_REQUEST['information_propertys_groups_dir_id'])) 
{
	$param['information_propertys_groups_dir_id'] = $_REQUEST['information_propertys_groups_dir_id'];
}

$param['information_systems_id'] = $_REQUEST['information_systems_res'];

$param['information_propertys_groups_dir_parent_id'] = $_REQUEST['information_propertys_groups_dir_parent_id'];

$param['information_propertys_groups_dir_name'] = $_REQUEST['information_propertys_groups_dir_name'];

$param['information_propertys_groups_dir_description'] = $_REQUEST['information_propertys_groups_dir_description'];

$param['information_propertys_groups_dir_order'] = $_REQUEST['information_propertys_groups_dir_order'];

if ($information_propertys_groups_dir_id = $InformationSystem->InsertPropertyGroupsDir($param))
{
	$admin_forms = new admin_forms();
	$window_id = $admin_forms->GetWindowId();
	?><script type="text/javascript">
	$.appendInput('<?php echo $window_id?>', 'EditAddISDirPropertyGroup', 'information_propertys_groups_dir_id', '<?php echo $information_propertys_groups_dir_id?>');
	</script><?php

	if ($information_propertys_groups_dir_id)
	{
		if (isset($_REQUEST['information_propertys_groups_dir_id']))
		{
			show_message($GLOBALS['MSG_information_systems']['edit_property_item_dir_success']);
		}
		else 
		{
			show_message($GLOBALS['MSG_information_systems']['add_property_item_dir_success']);
		}
	}
	else
	{
		if (isset($_REQUEST['information_propertys_groups_dir_id']))
		{
			show_error_message($GLOBALS['MSG_information_systems']['edit_property_item_dir_error']);
		}
		else 
		{
			show_error_message($GLOBALS['MSG_information_systems']['add_property_item_dir_error']);
		}
	}
	
}
?>