$templates.shared.doctype {= string profile_name = internal.profile_name; node tuning_node = "profiles." . profile_name . ".database.tuning"; node option; string option_name; string option_label; string option_type; =} $lang_options.profile.database.tuning.edit_form_title {= expand(templates.shared.content_type); =}
{= foreach option tuning_node ( option_name = node_name(option); option_type = node_value("option_info.profile.database.tuning." . option_name . ".type"); if (option_type eq "bytes") then ( option_label = "lang_options.profile.database.tuning." . option_name . ".label"; string option_value = node_value(option); bool option_value_match = matches_regular_expression(option_value, "([0-9]*)( ?)([a-zA-Z]*)"); int number_value = $1; string unit_value = lowercase($3); if (starts_with(unit_value, "k")) then ( unit_value = "KB"; ) else if (starts_with(unit_value, "m")) then ( unit_value = "MB"; ) else if (starts_with(unit_value, "g")) then ( unit_value = "GB"; ) else if (starts_with(unit_value, "t")) then ( unit_value = "TB"; ) else ( unit_value = "bytes"; ); '\n'; '\n'; '\n'; '\n'; ); ); foreach option tuning_node ( option_name = node_name(option); option_type = node_value("option_info.profile.database.tuning." . option_name . ".type"); if (option_type eq "boolean") then ( option_label = "lang_options.profile.database.tuning." . option_name . ".label"; bool option_is_checked = node_value(option); '\n'; '\n'; '\n'; ); ); '
' . $option_label . ':\n'; expand(' \n'); string select_id = option_name . "_unit"; expand('\n'; '
'; ' '; ''; '
\n'; '
\n'; =}