{include file="header.html"} {$text.db_selected} {$f_db}
{$text.tpl_error}: {$error}

## {$text.tpl_error_on_border}

- {$text.tpl_error_type}: {$array_border_error.error}
- {$text.tpl_error_on_page_title} "{$array_border_error.title}" {$text.tpl_error_on_page_number} {$array_border_error.id}
- {$text.tpl_error_value} {$array_border_error.bad_border} {$text.tpl_error_incorrect_border}
- {$text.tpl_error_correct_value} {$array_border_error.correct_border}

#### {$text.tpl_no_error}

### {$text.tpl_error_container_without_link_design}:

- {$container_error.page_title}: {$container_error.page_id}

{net_array name="tab1_1"} {net_array_push name="tab1_1" key="text" value=$text.tpl_tab_container} {net_array name="tab1_2"} {net_array_push name="tab1_2" key="text" value=$text.tpl_tab_page} {net_array name="tab1_3"} {net_array_push name="tab1_3" key="text" value=$text.tpl_tab_design} {net_array name="tab1_4"} {net_array_push name="tab1_4" key="text" value=$text.tpl_tab_check} {net_array name="tab_list_1"} {net_array_push name="tab_list_1" key=1 value=$tab1_1} {net_array_push name="tab_list_1" key=2 value=$tab1_2} {net_array_push name="tab_list_1" key=3 value=$tab1_3} {net_array_push name="tab_list_1" key=4 value=$tab1_4} {net_array name="tab_list"} {net_array_push name="tab_list" key=1 value=$tab_list_1} {net_array_push name="tab_list" key=2 value=$tab_list_2} {net_array_push name="tab_list" key=3 value=$tab_list_3} {net_array_push name="tab_list" key=4 value=$tab_list_4} {include file="_display_tab.html" tab_id=1 tab_list=$tab_list[1]}
{$text.tpl_tab_container}
{$text.tpl_add_container_insert}

{$text.tpl_add_container_name}:
{$text.tpl_add_container_plici_page_id}:

{$text.tpl_add_container_position}: {$text.tpl_add_container_position_top} {$text.tpl_add_container_position_left} {$text.tpl_add_container_position_right} {$text.tpl_add_container_position_bottom} {$text.tpl_add_container_position_trash}

{$text.tpl_add_container_design_name}:

{$text.tpl_add_container_design_file}:

{$text.tpl_add_container_entry_file}:

{$text.tpl_add_container_get_script}

    /*** {$text.tpl_add_container_code_comment_var} ***/
    $container_name = trim(" "); //{$text.tpl_add_container_code_comment_container_name}
    $plici_page_id = trim(" "); //{$text.tpl_add_container_code_comment_container_plici_page_id}
    $position = trim("LEFT"); //{$text.tpl_add_container_code_comment_container_position}
    $tpl_name = trim(" "); //{$text.tpl_add_container_code_comment_container_design_name}
    $tpl_uri = trim(" "); //{$text.tpl_add_container_code_comment_container_design_file}
    $entry_uri = null; // {$text.tpl_add_container_code_comment_container_entry}

    /*** {$text.tpl_add_container_code_comment_cons} ***/
    $array_page_id = array("TOP", "BOTTOM", "LEFT", "RIGHT", "TRASH");
    $position = in_array($position, $array_page_id)?$position:"LEFT";

    /*** {$text.tpl_add_container_code_comment_log} ***/
    $LOG_REQUEST = false;
    $LOG_RESULT = false;
    $filename = "log_script.log";
    if ($LOG_REQUEST || $LOG_RESULT) {literal}{{/literal} $handle = fopen($filename, 'w'); fwrite($handle, "\n\n\n");}

    if ("" != $container_name) && ("" != $tpl_name) && ("" != $tpl_uri) {literal}{{/literal}
    	$request= "SELECT page_rb FROM t_page WHERE page_id=".$position.";";
    	$result = mysql_query($request);
    	$row = mysql_fetch_row($result);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);
    	$father_node_info["page_rb"] = $row[0];
    	if ($LOG_RESULT)
    		fwrite($handle, "\n{$text.tpl_add_container_code_result}=".$father_node_info["page_rb"]);

    	$request="UPDATE t_page SET page_lb = page_lb + 2 WHERE page_lb >= ".$father_node_info["page_rb"].";";
    	mysql_query($request);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);
    	$request="UPDATE t_page SET page_rb = page_rb + 2 WHERE page_rb >= ".$father_node_info["page_rb"].";";
    	mysql_query($request);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);

    	if (0<strlen(trim($plici_page_id)))
    	{literal}{{/literal}
    		$request="INSERT INTO t_page(plici_page_id, page_lb, page_rb, page_level, page_title_l1, page_visibility, page_type) VALUES('".$plici_page_id."', ".$father_node_info["page_rb"].", ".$father_node_info["page_rb"]."+1, 3, '".$container_name."', 'VI', 'CO')";
    	} else {literal}{{/literal}
    		$request="INSERT INTO t_page(page_lb, page_rb, page_level, page_title_l1, page_visibility, page_type) VALUES(".$father_node_info["page_rb"].", ".$father_node_info["page_rb"]."+1, 3, '".$container_name."', 'VI', 'CO')";
    	}
    	mysql_query($request);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);
    	$container_id = mysql_insert_id();
    	if ($LOG_RESULT)
    		fwrite($handle, "\n{$text.tpl_add_container_code_result}=".$container_id);

    	$request="INSERT INTO t_design(des_type, des_page_id, des_title, des_entry, des_template, des_level) VALUES ('CONTAINER', ".$container_id.", '".$tpl_name."', ";
    	$request .= null==$entry_uri?"null":"'".$entry_uri."'";
    	$request .= ", '".$tpl_uri."', null);";
    	mysql_query($request);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);
    	$design_id = mysql_insert_id();
    	if ($LOG_RESULT)
    		fwrite($handle, "\n{$text.tpl_add_container_code_result}=".$design_id);

    	$request="UPDATE t_page SET page_detail_des_id = ".$design_id." WHERE page_id=".$container_id.";";
    	mysql_query($request);
    	if ($LOG_REQUEST)
    		fwrite($handle, "\n".$request);
    }
    if ($LOG_REQUEST || $LOG_RESULT)
    	fclose($handle);

{$text.tpl_delete_container_delete}

{$text.tpl_delete_container_name}:

### {$text.tpl_delete_container_entry_file_list}

- {$entry_uri}

### {$text.tpl_delete_container_tpl_file_list}:

- {$tpl_uri}

{$text.tpl_tab_page}
{$text.tpl_add_page_legend_unit}

{$text.tpl_add_page_id}:
{$text.tpl_add_page_plici_page_id}:

{$text.tpl_add_page_title}:

{$text.tpl_add_page_have_product}: {$text.yes} {$text.no}

{$text.tpl_add_sp_page_lgd}

# {$text.tpl_add_sp_page_step1}

{$text.tpl_add_sp_page_step1_title}:

{$text.tpl_add_sp_page_step1_plici_page_id}:

{$text.tpl_add_sp_page_step1_product}: {$text.yes}

{$text.tpl_next_step}

# {$text.tpl_add_sp_page_step2}

{$text.tpl_add_sp_page_step2_design}: {$text.yes}

{$text.tpl_add_sp_page_step2_design_title}:

{$text.tpl_add_sp_page_step2_design_entry}:

{$text.tpl_add_sp_page_step2_design_tpl}:

{$text.tpl_previous_step}
{$text.tpl_next_step}

# {$text.tpl_add_sp_page_step3}

{$text.tpl_add_sp_page_step3_design}: {$text.yes}

{$text.tpl_add_sp_page_step3_design_title}:

{$text.tpl_add_sp_page_step3_design_entry}:

{$text.tpl_add_sp_page_step3_design_tpl}:

{$text.tpl_previous_step}
{$text.tpl_tab_design}
{$text.tpl_add_design_lgd}

# {$text.tpl_add_design_step1}

{$text.tpl_add_design_step1_container}:

{$text.tpl_add_design_step1_link}:

{$text.tpl_add_design_step1_detail}:

{$text.tpl_add_design_step1_sp_link}:

{$text.tpl_add_design_step1_sp_detail}:

{$text.tpl_add_design_step1_product}:

{$text.tpl_next_step}

# {$text.tpl_add_design_step2}

{$text.tpl_add_design_step2_page}:

{$text.tpl_previous_step}
{$text.tpl_next_step}

# {$text.tpl_add_design_step3}

{$text.tpl_add_design_step3_title}:

{$text.tpl_add_design_step3_entry}:

{$text.tpl_add_design_step3_tpl}:

{$text.tpl_add_design_step3_level}:

{$text.tpl_previous_step}
{$text.tpl_check_info_detail}
{$text.tpl_check_info_title}

- {$text.tpl_check_info_title}: {$page_info.page_title}
- {$text.tpl_check_info_id}: {$page_info.page_id}

{$text.tpl_check_info_link_design}

- {$text.tpl_check_info_entry}: {$page_info.page_link_des_entry}{$text.tpl_check_info_empty}
- {$text.tpl_check_info_tpl}: {$page_info.page_link_des_template}{$text.tpl_check_info_empty}

{$text.tpl_check_info_detail_design}

- {$text.tpl_check_info_entry}: {$page_info.page_detail_des_entry}{$text.tpl_check_info_empty}
- {$text.tpl_check_info_tpl}: {$page_info.page_detail_des_template}{$text.tpl_check_info_empty}

{$text.tpl_correct_border}

### {$text.tpl_correct_border_warning}

{$text.tpl_correct_border}

{$text.tpl_correct_border_bad}:

{$text.tpl_correct_border_correct}:

{$text.tpl_check_supervision}

|--- ( {$page.page_lb} {$array_border_error.correct_border}{$page.page_lb}, {$page.page_id} - {$page.page_title} [{$page.plici_page_id}] , {$page.page_rb} {$array_border_error.correct_border}{$page.page_rb}) X

{include file="footer.html"}