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

if (!isset($site_id))
{
	$site_id = 0;
}

$constant = new Constants();

$form_params = array();

$form_params['title'] = $GLOBALS['MSG_site']['edit_registration_data'];

$form_params['form_attribs']['method'] = 'post';
$form_params['form_attribs']['action'] = '/admin/site/site.php';
$form_params['form_attribs']['ENCTYPE'] = 'multipart/form-data';
$form_params['form_attribs']['name'] = 'EditAddSite';

$admin_forms_fields = new admin_forms_fields();

$form_params['path_array'][] = array(
'link' => $admin_forms_fields->GetHtmlCallDoLoadAjax('/admin/site/site.php', '', 42, 'load_data'),
'onclick' => $admin_forms_fields->GetOnClickCallDoLoadAjax('/admin/site/site.php', '', 42, 'load_data'),
'name' => $GLOBALS['MSG_site']['site_link_sites']);

$admin_forms_fields->admin_forms_fields($form_params);

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

$admin_forms_fields->AddField($param);

// Логин
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'HOSTCMS_USER_LOGIN';
$param['caption'] = $GLOBALS['MSG_site']['form_edit_add_hostcms_user_login'];
$param['type'] = 0; // textbox
$param['value'] = (defined('HOSTCMS_USER_LOGIN'))?HOSTCMS_USER_LOGIN:'';
$param['format']['minlen']['value'] = 1;
$admin_forms_fields->AddField($param);

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

// № договора

$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'HOSTCMS_CONTRACT_NUMBER';
$param['caption'] = $GLOBALS['MSG_site']['form_edit_add_hostcms_contract_number'];
$param['type'] = 0; // textbox
$param['value'] = (defined('HOSTCMS_CONTRACT_NUMBER'))?HOSTCMS_CONTRACT_NUMBER:'';
$param['format']['minlen']['value'] = 1;
$admin_forms_fields->AddField($param);

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


// Pin-код
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'HOSTCMS_PIN_CODE';
$param['caption'] = $GLOBALS['MSG_site']['form_edit_add_hostcms_pin_code'];
$param['type'] = 0; // textbox
$param['value'] = (defined('HOSTCMS_PIN_CODE'))?HOSTCMS_PIN_CODE:'';
$param['format']['minlen']['value'] = 1;
$admin_forms_fields->AddField($param);

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


// Кнопка "Применить".
$param = array();
$param['name'] = 'add_regdata';
$param['caption'] = $GLOBALS['MSG_site']['site_save'];
$param['image'] = '/admin/images/add.gif';
$param['attributes']['onclick'] = "return SendForm('{$admin_forms_fields->GetWindowId()}', '{$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';
$param['class'] = 'button_image';
$admin_forms_fields->AddButton($param);

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