Working in the new elements for the visualmap. Ticket #1478

This commit is contained in:
mdtrooper 2014-11-21 13:37:07 +01:00
parent 9f7c8d4483
commit 93c1089cff

View File

@ -143,6 +143,10 @@ foreach ($layoutDatas as $layoutData) {
$table->data[$i + 1]['icon'] = $table->data[$i + 1]['icon'] =
html_print_image('images/photo.png', true, array('title' => __('Icon'))); html_print_image('images/photo.png', true, array('title' => __('Icon')));
break; break;
case BOX_ITEM:
$table->data[$i + 1]['icon'] =
html_print_image('images/box_item.png', true, array('title' => __('Box')));
break;
default: default:
if (enterprise_installed()) { if (enterprise_installed()) {
$table->data[$i + 1]['icon'] = $table->data[$i + 1]['icon'] =
@ -158,27 +162,35 @@ foreach ($layoutDatas as $layoutData) {
//First row //First row
//Label //Label
if ($layoutData['type'] != ICON) { switch ($layoutData['type']) {
$table->data[$i + 1][0] = '<span style="width: 150px; display: block;">' . case ICON:
html_print_input_hidden('label_' . $idLayoutData, $layoutData['label'], true) . case BOX_ITEM:
'<a href="javascript: show_dialog_label_editor(' . $idLayoutData . ');">' . __('Edit label') .'</a>' . // hasn't the label.
'</span>'; $table->data[$i + 1][0] = '';
break;
default:
$table->data[$i + 1][0] = '<span style="width: 150px; display: block;">' .
html_print_input_hidden('label_' . $idLayoutData, $layoutData['label'], true) .
'<a href="javascript: show_dialog_label_editor(' . $idLayoutData . ');">' . __('Edit label') .'</a>' .
'</span>';
break;
} }
else {
//Icon haven't the label.
$table->data[$i + 1][0] = '';
}
//Image //Image
if (($layoutData['type'] == STATIC_GRAPH) || ($layoutData['type'] == ICON)) { switch ($layoutData['type']) {
$table->data[$i + 1][1] = html_print_select ($images_list, 'image_' . $idLayoutData, $layoutData['image'], '', 'None', '', true, false, true, '', false, "width: 120px"); case STATIC_GRAPH:
} case ICON:
else { $table->data[$i + 1][1] =
$table->data[$i + 1][1] = ''; html_print_select ($images_list,
'image_' . $idLayoutData, $layoutData['image'], '',
'None', '', true, false, true, '', false,
"width: 120px");
break;
default:
$table->data[$i + 1][1] = '';
break;
} }
@ -194,8 +206,14 @@ foreach ($layoutDatas as $layoutData) {
')'; ')';
//Parent //Parent
$table->data[$i + 1][4] = html_print_select_from_sql ('SELECT id, label FROM tlayout_data WHERE id_layout = '. $idVisualConsole . ' AND id !=' . $idLayoutData, switch ($layoutData['type']) {
'parent_' . $idLayoutData, $layoutData['parent_item'], '', 'None', 0, true, false, true, false, 'width: 120px;'); case BOX_ITEM:
$table->data[$i + 1][4] = "";
break;
default:
$table->data[$i + 1][4] = html_print_select_from_sql ('SELECT id, label FROM tlayout_data WHERE id_layout = '. $idVisualConsole . ' AND id !=' . $idLayoutData,
'parent_' . $idLayoutData, $layoutData['parent_item'], '', 'None', 0, true, false, true, false, 'width: 120px;');
}
//Delete row button //Delete row button
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
@ -217,6 +235,7 @@ foreach ($layoutDatas as $layoutData) {
//Agent //Agent
switch ($layoutData['type']) { switch ($layoutData['type']) {
case BOX_ITEM:
case ICON: case ICON:
case LABEL: case LABEL:
$table->data[$i + 2][0] = ''; $table->data[$i + 2][0] = '';
@ -268,6 +287,7 @@ foreach ($layoutDatas as $layoutData) {
switch ($layoutData['type']) { switch ($layoutData['type']) {
case ICON: case ICON:
case LABEL: case LABEL:
case BOX_ITEM:
$table->data[$i + 2][1] = ''; $table->data[$i + 2][1] = '';
break; break;
default: default:
@ -328,9 +348,17 @@ foreach ($layoutDatas as $layoutData) {
} }
//Map linked //Map linked
$table->data[$i + 2][4] = html_print_select_from_sql( switch ($layoutData['type']) {
'SELECT id, name FROM tlayout WHERE id != ' . $idVisualConsole, case BOX_ITEM:
'map_linked_' . $idLayoutData, $layoutData['id_layout_linked'], '', 'None', '', true, false, true, '', false, "width: 120px"); $table->data[$i + 2][4] = "";
break;
default:
$table->data[$i + 2][4] = html_print_select_from_sql(
'SELECT id, name FROM tlayout WHERE id != ' . $idVisualConsole,
'map_linked_' . $idLayoutData, $layoutData['id_layout_linked'], '', 'None', '', true, false, true, '', false, "width: 120px");
break;
}
$table->data[$i + 2][5] = ''; $table->data[$i + 2][5] = '';
if ($alternativeStyle) { if ($alternativeStyle) {