Added the _VALUE_ macro to the simple value items of the visual console created using the wizard

(cherry picked from commit 2d269a3d184bb8032e5d85bd862bdfb3db3c58fe)
This commit is contained in:
Alejandro Gallardo Escobar 2016-05-17 13:49:45 +02:00
parent e6a84b2aff
commit 0fa6369733
1 changed files with 16 additions and 6 deletions

View File

@ -1243,11 +1243,18 @@ function visual_map_process_wizard_add ($id_agents, $image, $id_layout, $range,
break;
}
$label = agents_get_name($id_agent);
$value_label = '(_VALUE_)';
if ($type === SIMPLE_VALUE) {
$label .= ' ' . $value_label;
}
$values = array ('type' => $value_type,
'id_layout' => $id_layout,
'pos_x' => $pos_x,
'pos_y' => $pos_y,
'label' => agents_get_name ($id_agent),
'label' => $label,
'image' => $value_image,
'id_agent' => $id_agent,
'width' => $width,
@ -1314,24 +1321,25 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
}
$id_agent = modules_get_agentmodule_agent ($id_module);
$value_label = '(_VALUE_)';
switch ($label_type) {
case 'agent_module':
default:
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false);
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false);
$label = $agent_label . " - " . $module_label;
$label = $agent_label . " - " . $module_label . " " . $value_label;
break;
case 'module':
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false);
$label = $module_label;
$label = $module_label . " " . $value_label;
break;
case 'agent':
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false);
$label = $agent_label;
$label = $agent_label . " " . $value_label;
break;
case 'none':
$label = '';
$label = $value_label;
break;
}
$label = io_safe_input($label);
@ -1516,6 +1524,7 @@ function visual_map_process_wizard_add_agents ($id_agents, $image,
}
}
$value_label = '(_VALUE_)';
switch ($label_type) {
case 'agent':
@ -1523,9 +1532,10 @@ function visual_map_process_wizard_add_agents ($id_agents, $image,
agents_get_name($id_agent),
'agent_small', false, true, false, '…', false);
$label = $agent_label;
if ($type === SIMPLE_VALUE) $label .= ' ' . $value_label;
break;
case 'none':
$label = '';
$label = ($type === SIMPLE_VALUE) ? $value_label : '';
break;
}
$label = io_safe_input($label);