<?php

$sql_query = 'UPDATE ' . $config['table_prefix'] . 'calc_template SET ';
$sql_query .= <<<'EOT'
params = '{\r\n     \"title\": \"Число: Математическая формула\",\r\n     \"help\": \"tpl_math_formulas\",\r\n     \"parameters\": {\r\n         \"result\": {\r\n             \"type\": \"Field\",\r\n             \"name\": \"result\",\r\n             \"description\": \"Выберите поле записи результата\",\r\n             \"type_field\": 1,\r\n             \"help\": \"tpl_to_field\"\r\n         },\r\n         \"field1\": {\r\n             \"type\": \"LinkField\",\r\n             \"name\": \"field1\",\r\n             \"description\": \"Выберите поле\",\r\n             \"type_field\": [1,5],\r\n             \"get_link_fields\": [1],\r\n             \"help\": \"tpl_sel_field\"\r\n         },\r\n         \"func_row\": {\r\n             \"type\": \"String\",\r\n             \"name\": \"func_row\",\r\n             \"description\": \"Поле записи функции\",\r\n             \"textarea\": true,\r\n             \"help\": \"tpl_func_field\"\r\n         },\r\n         \"flex_data\": {\r\n             \"type\": \"String\",\r\n             \"name\": \"flex_data\",\r\n             \"description\": \"\",\r\n             \"help\": \"tpl_flex_string\"\r\n         }\r\n     },\r\n    \"events\": [\r\n        {\r\n            \"type\": 1\r\n        }\r\n    ]\r\n}' WHERE id = 21
EOT;
run_query($sql_query);
