<?php 
/**
 * Система управления сайтом HostCMS v. 5.xx
 * Copyright © 2005-2008 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
 *
 * Форма добаления/редактирования информационной системы
 * 
 * Файл: /admin/InformationSystems/action/form_edit_add_information_system.php
 * 
 * @author Hostmake LLC
 * @version 5.2
 */
$form_params = array();
$form_params['title'] = $information_system_id == 0
? $GLOBALS['MSG_information_systems']['information_systems_add_form_title']
: $GLOBALS['MSG_information_systems']['information_systems_edit_form_title'];

$form_params['form_attribs']['method'] = 'post';
$form_params['form_attribs']['action'] = '/admin/InformationSystems/InformationSystems.php';
$form_params['form_attribs']['name'] = 'EditAddInformationSystem';

$admin_forms_fields = new admin_forms_fields();

$InformationSystem = & singleton('InformationSystem');

// Формируем "хлебные крошки"
$new_path_array = array();

$new_path_array[] = array(
'link' => $admin_forms_fields->GetHtmlCallDoLoadAjax('/admin/InformationSystems/InformationSystems.php', '', 11, 'load_data'),
'onclick' => $admin_forms_fields->GetOnClickCallDoLoadAjax('/admin/InformationSystems/InformationSystems.php', '', 11, 'load_data'),
'name' => $GLOBALS['MSG_information_systems']['show_information_systems_title']);

// Передаем в массив для констурктора хлебные крошки
$form_params['path_array'] = $new_path_array;

$admin_forms_fields->admin_forms_fields($form_params);

$DataBase = & singleton('DataBase');

// Редактирование информационной системы
if ($information_system_id)
{
	$type = 1;

	// Получаем данные о пользователе системы администрирования из БД
	$information_system_row = $InformationSystem->GetInformationSystem($information_system_id);

	$information_system_name = $information_system_row['information_systems_name'];
	$information_system_description = $information_system_row['information_systems_description'];
	$site_id = $information_system_row['site_id'];
	$information_system_access = $information_system_row['information_systems_access'];
	$information_system_add_form_captcha_used = $information_system_row['information_systems_captcha_used'];
	$information_system_watermark_file = $information_system_row['information_systems_watermark_file'];
	$information_system_watermark_default_used = $information_system_row['information_systems_default_used_watermark'];
	$information_system_watermark_default_used_small = $information_system_row['information_systems_default_used_small_watermark'];
	$information_system_watermark_default_position_x = $information_system_row['information_systems_watermark_default_position_x'];
	$information_system_watermark_default_position_y = $information_system_row['information_systems_watermark_default_position_y'];
	$structure_id = $information_system_row['structure_id'];
	$items_on_page = $information_system_row['information_systems_items_on_page'];

	// Картинки.
	$information_system_image_big_max_width = $information_system_row['information_systems_image_big_max_width'];
	$information_system_image_big_max_height = $information_system_row['information_systems_image_big_max_height'];
	$information_system_image_small_max_width = $information_system_row['information_systems_image_small_max_width'];
	$information_system_image_small_max_height = $information_system_row['information_systems_image_small_max_height'];

	// Сортировка.
	$information_system_items_order_field = to_int($information_system_row['information_systems_items_order_field']);
	$information_system_items_order_type = to_int($information_system_row['information_systems_items_order_type']);
	$information_system_group_items_order_type = to_int($information_system_row['information_systems_group_items_order_type']);
	$information_system_group_items_order_field = to_int($information_system_row['information_systems_group_items_order_field']);

	// Формат даты.
	$information_system_format_date = to_str($information_system_row['information_systems_format_date']);
	$information_system_format_datetime = to_str($information_system_row['information_systems_format_datetime']);

	$information_systems_url_type = $information_system_row['information_systems_url_type'];

	$information_systems_typograph_item = $information_system_row['information_systems_typograph_item'];
	$information_systems_typograph_group = $information_system_row['information_systems_typograph_group'];
	
	$information_system_apply_tags_automatic = $information_system_row['information_systems_apply_tags_automatic'];
	$information_systems_file_name_conversion = $information_system_row['information_systems_file_name_conversion'];
	$information_systems_apply_keywords_automatic = $information_system_row['information_systems_apply_keywords_automatic'];
	
}
// Добавления информационной системы
else
{
	$type = 0;
	$site_id = CURRENT_SITE;
	$information_system_add_form_captcha_used = 1;
	$information_system_watermark_file = '';
	$information_system_watermark_default_used = 1;
	$information_system_watermark_default_used_small = 1;
	$items_on_page = 10;
	$structure_id = 0;

	// Формат даты.
	$information_system_format_date = '%d.%m.%Y';
	$information_system_format_datetime = '%d.%m.%Y %H:%M:%S';

	// Картинки.
	$information_system_image_big_max_width = 300;
	$information_system_image_big_max_height = 300;
	$information_system_image_small_max_width = 70;
	$information_system_image_small_max_height = 70;

	$information_systems_url_type = 0;

	$information_systems_typograph_item = 1;
	$information_systems_typograph_group = 1;
	$information_system_apply_tags_automatic = 1;	
	$information_systems_file_name_conversion = 1;
	$information_systems_apply_keywords_automatic = 1;
}

// Параметры.
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_information_systems']['information_systems_form_tab_1']);

// Название информационной системы.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_name';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_name'];
$param['type'] = 0; // Поле ввода.
$param['attributes']['class'] = 'large';
$param['value'] = to_str($information_system_name);
$param['format']['minlen']['value'] = 1;
$param['format']['maxlen']['value'] = 255;
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Описание информационной системы.

// Определим $template_id для визуального редактора, для этого узнаем параметры у структуры
$structure = & singleton('Structure');

$structure_row = $structure->GetStructureItem($structure_id);

$template_id = to_int($structure_row['templates_id']);

$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_description';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_description'];
$param['type'] = 7; // Визуальный редактор.
$param['template'] = $template_id;
$param['value'] = to_str($information_system_description);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Сайт
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'site_id';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_site'];
$param['type'] = 2; // Выпадающий список.
$value = $site_id;

$param['value'] = $value;

$items = array();

// Получаем список сайтов
$sites = & singleton ('site');
$sites_result = $sites->SelectSites();

$count_sites = mysql_num_rows($sites_result);

for ($i = 0; $i < $count_sites; $i++)
{
	$row_site = mysql_fetch_assoc($sites_result);

	$items[$row_site['site_id']] = $row_site['site_name'];
}

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Узел структуры.
$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'structure_id';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_structure'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($structure_id);

$param['value'] = $value;

$items = array();

// Выбираем все элементы структуры для данного сайта
$Structure = & singleton('Structure');

$result_structure = $Structure->GetStructure("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $site_id, 0, -1, 0);

$items[0] = "..";

// Проверяем наличие узлов структуры
if (count($result_structure) > 0)
{
	foreach ($result_structure as $key => $value)
	{
		$items[$value['structure_id']] = $value['name_with_separator'];
	}
}

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Число элементов на странице
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_items_on_page';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_items_on_page'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_int($items_on_page);

$admin_forms_fields->AddField($param);

// Тип формирования URL для информационных элементов
$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_url_type';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_create_url_type'];
$param['type'] = 2; // Выпадающий список.

$value = $information_systems_url_type;

$param['value'] = $value;

$items = array();

$items[0] = $GLOBALS['MSG_information_systems']['information_systems_add_form_create_url_type_identificater'];
$items[1] = $GLOBALS['MSG_information_systems']['information_systems_add_form_create_url_type_transliteration'];

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Автоматически применять тэги
$param = array();
$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_apply_tags_automatic';
$param['html_id'] = 'id_apply_tags_automatic';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_apply_tags_automatic'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_system_apply_tags_automatic);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Преобразовывать названия загружаемых файлов  
$param = array();
$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_file_name_conversion';
$param['html_id'] = 'id_add_form_file_name_conversion';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_file_name_conversion'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_systems_file_name_conversion);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Автоматическая генерация ключевых слов
$param = array();
$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_apply_keywords_automatic';
$param['html_id'] = 'id_apply_keywords_automatic';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_apply_keywords_automatic'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_systems_apply_keywords_automatic);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);


// Сортировка.
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_information_systems']['information_systems_form_tab_2']);

// Поле сортировки элементов.
$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_items_order_field';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_order_field'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($information_system_items_order_field);

$param['value'] = $value;

$items = array();

$items[0] = $GLOBALS['MSG_information_systems']['information_date'];
$items[1] = $GLOBALS['MSG_information_systems']['show_information_groups_name'];
$items[2] = $GLOBALS['MSG_information_systems']['show_information_propertys_order'];

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Направление сортировки элементов.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_items_order_type';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_order_type'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($information_system_items_order_type);

$param['value'] = $value;

$items = array();

$items[0] = $GLOBALS['MSG_information_systems']['sort_to_increase'];
$items[1] = $GLOBALS['MSG_information_systems']['sort_to_decrease'];

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Поле сортировки групп.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_group_items_order_field';
$param['caption'] = $GLOBALS['MSG_information_systems']['is_sort_field_group_title'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($information_system_group_items_order_field);

$param['value'] = $value;

$items = array();

$items[0] = $GLOBALS['MSG_information_systems']['show_information_groups_name'];
$items[1] = $GLOBALS['MSG_information_systems']['show_information_propertys_order'];

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Направление сортировки групп.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_group_items_order_type';
$param['caption'] = $GLOBALS['MSG_information_systems']['is_sort_order_group_type'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($information_system_group_items_order_type);

$param['value'] = $value;

$items = array();

$items[0] = $GLOBALS['MSG_information_systems']['sort_to_increase'];
$items[1] = $GLOBALS['MSG_information_systems']['sort_to_decrease'];

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Форматы.
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_information_systems']['information_systems_form_tab_3']);

// Формат даты.
$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_format_date';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_format_date'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_str($information_system_format_date);
$param['format']['minlen']['value'] = 1;
$param['format']['maxlen']['value'] = 255;
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Формат даты.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_format_datetime';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_format_datetime'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_str($information_system_format_datetime);
$param['format']['minlen']['value'] = 1;
$param['format']['maxlen']['value'] = 255;
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Максимальная ширина большой картинки.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_image_big_max_width';
$param['caption'] = $GLOBALS['MSG_information_systems']['info_sys_form_big_max_width'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_int($information_system_image_big_max_width);
$param['format']['lib']['value'] = 'integer';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Максимальная высота большой картинки.
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_image_big_max_height';
$param['caption'] = $GLOBALS['MSG_information_systems']['info_sys_form_big_max_height'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_int($information_system_image_big_max_height);
$param['format']['lib']['value'] = 'integer';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Максимальная ширина малой картинки
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_image_small_max_width';
$param['caption'] = $GLOBALS['MSG_information_systems']['info_sys_form_small_max_width'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_int($information_system_image_small_max_width);
$param['format']['lib']['value'] = 'integer';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Максимальная высота малой картинки
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_image_small_max_height';
$param['caption'] = $GLOBALS['MSG_information_systems']['info_sys_form_small_max_height'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_int($information_system_image_small_max_height);
$param['format']['lib']['value'] = 'integer';

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Группа доступа
$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_access';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_access'];
$param['type'] = 2; // Выпадающий список.

$value = to_int($information_system_access);

$param['value'] = $value;

$items = array();

if (class_exists('SiteUsers'))
{
	$site_users = & singleton('SiteUsers');

	$param_site_users_group['order_field'] = 'site_users_group_name';

	$result = $site_users->SelectSiteUsersGroups($param_site_users_group);

	$count_site_users_groups = mysql_num_rows($result);
}
else
{
	$count_site_users_groups = 0;
}

for ($i = -2; $i < $count_site_users_groups - 1; $i++)
{
	switch ($i)
	{
		case -2:
			{
				$option_text = 'Все';
				$option_value = 0;
				break;
			}
		default:
			{
				$row = mysql_fetch_assoc($result);
				$option_text = $row["site_users_group_name"];
				$option_value = $row["site_users_group_id"];
			}
	}

	$items[$option_value] = $option_text;
}

$param['items'] = $items;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Использовать CAPTCHA
$param = array();

$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_captcha_used';
$param['html_id'] = 'id_captcha_used';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_captcha_used'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_system_add_form_captcha_used);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Типографировать элементы
$param = array();

$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_typograph_item';
$param['html_id'] = 'id_typograph_item';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_typograph_item'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_systems_typograph_item);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Типографировать группы
$param = array();

$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_typograph_group';
$param['html_id'] = 'id_typograph_group';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_typograph_group'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_systems_typograph_group);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Водяной знак
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_information_systems']['information_systems_form_tab_4']);

$param = array();

$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_watermark_file';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_watermark_file'];
$param['type'] = 9; // Поле загрузки файла.

$param['options'] = array();

// Отображать ли checkbox с подписью "Создать малое изображение из большого" (1 -  отображать (по умолчанию), 0 - не отображать);
$param['options']['make_small_image_from_big_show'] = 0;

// Вид ображения checkbox'а с подписью "Создать малое изображение из большого" выбранным (1 -  отображать выбранным (по умолчанию), 0 - невыбранным);
$param['options']['make_small_image_from_big_checked'] = 0;

// Отображать ли поле загрузки малого изображения (1 -  отображать (по умолчанию), 0 - не отображать);
$param['options']['load_small_image_show'] = 0;

// Заголовок поля загрузки малого изображения
$param['options']['load_small_image_caption'] = '';

// Значение максимальной ширины большого изображения;
$param['options']['image_big_max_width'] = 1000;

// Значение максимальной высоты большого изображения;
$param['options']['image_big_max_height'] = 1000;

// Отображать ли checkbox с подписью "Наложить водяной знак на большое изображение" (1 -  отображать (по умолчанию), 0 - не отображать);
$param['options']['used_watermark_big_image_show'] = 0;

// Вид ображения checkbox'а с подписью "Наложить водяной знак на большое изображение" (1 -  отображать выбранным (по умолчанию), 0 - невыбранным);
$param['options']['used_watermark_big_image_checked'] = 0;

// Параметр, определяющий отображать ли настройки большого изображения
$param['options']['show_big_image_params'] = 0;

// Задано большое изображение
if ($information_system_watermark_file != '')
{
	// Адрес большого загруженного изображения
	$param['options']['big_image_path'] = '/' . UPLOADDIR . urlencode($information_system_watermark_file);

	$param['options']['href_delete_big_image'] = "/admin/InformationSystems/InformationSystems.php?delete_information_system_watermark={$information_system_id}";

	// Значение для onclick
	$param['options']['onclick_delete_big_image'] = "sendRequest('{$param['options']['href_delete_big_image']}', 'get', callback_function_exec_from_return); return false;";
}
else
{
	$param['options']['big_image_path'] = '';
	$param['options']['href_delete_big_image'] = '';
	$param['options']['onclick_delete_big_image'] = '';
}

$param['options']['small_image_path'] = '';
$param['attributes']['size'] = '80%;';

$admin_forms_fields->AddField($param);
// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Использовать watermark по умолчанию
$param = array();
$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_default_used_watermark';
$param['html_id'] = 'id_captcha_default_used';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_watermark_default_used'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_system_watermark_default_used);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Использовать watermark по умолчанию для малых изображений
$param = array();

$param['tab_id'] = $tab_id;
$param['type'] = 1;
$param['name'] = 'information_systems_default_used_small_watermark';
$param['html_id'] = 'id_captcha_default_used_small';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_watermark_default_used_small'];
$param['lable'] = $GLOBALS['MSG_information_systems']['yes'];
$param['value'] = to_int($information_system_watermark_default_used_small);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиция по оси X по умолчанию
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_watermark_default_position_x';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_watermark_default_position_x'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_str($information_system_watermark_default_position_x);

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиция по оси Y по умолчанию
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'information_systems_watermark_default_position_y';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_watermark_default_position_y'];
$param['type'] = 0; // Поле ввода.
$param['value'] = to_str($information_system_watermark_default_position_y);

$admin_forms_fields->AddField($param);

// Редактирование данных об информационной системе
if ($information_system_id)
{
	// Добавляем скрытое поле с идентификатором пользователя.
	$param = array();

	$param['tab_id'] = $tab_id;
	$param['name'] = 'information_system_id';
	$param['type'] = 4; // Скрытое поле.
	$param['value'] = $information_system_id;
	$admin_forms_fields->AddField($param);
}

// Кнопка "Сохранить".
$param = array();
$param['name'] = 'save_information_system';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_save_form_button_name'];
$param['image'] = '/admin/images/add.gif';
$param['attributes']['onclick'] = "return doSendForm('{$admin_forms_fields->AAction}', '{$admin_forms_fields->AAdditionalParams}', this, ".to_int($_REQUEST['admin_forms_id']).", 'load_data', " . to_int($admin_forms_fields->form_params['current_page']) . ", " . to_int($admin_forms_fields->form_params['on_page']) . " )";
$param['attributes']['type'] = 'button';
$admin_forms_fields->AddButton($param);

// Кнопка "Применить".
$param = array();
$param['name'] = 'add_information_system';
$param['caption'] = $GLOBALS['MSG_information_systems']['information_systems_add_form_button_name'];
$param['image'] = '/admin/images/add.gif';
$param['attributes']['onclick'] = "return doSendForm('{$admin_forms_fields->AAction}', '{$admin_forms_fields->AAdditionalParams}', this, ".to_int($_REQUEST['admin_forms_id']).", 'load_data', " . to_int($admin_forms_fields->form_params['current_page']) . ", " . to_int($admin_forms_fields->form_params['on_page']) . " )";
$param['attributes']['type'] = 'submit';
$admin_forms_fields->AddButton($param);

// Отображение формы.
$admin_forms_fields->ShowForm();
?>