2013-01-30 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/planned_downtime.list.php, include/db/oracle.php,
	include/Image/image_functions.php,
	operation/events/events.build_table.php,
	operation/messages/message_edit.php, operation/users/user_edit.php,
	operation/tree.php: improved the source style.
	
	* include/constants.php: added constants for the subtype of modules.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7550 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-01-30 13:53:02 +00:00
parent 470864b136
commit 4b174a29b0
9 changed files with 85 additions and 65 deletions

View File

@ -1,3 +1,13 @@
2013-01-30 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/planned_downtime.list.php, include/db/oracle.php,
include/Image/image_functions.php,
operation/events/events.build_table.php,
operation/messages/message_edit.php, operation/users/user_edit.php,
operation/tree.php: improved the source style.
* include/constants.php: added constants for the subtype of modules.
2013-01-30 Sergio Martin <sergio.martin@artica.es> 2013-01-30 Sergio Martin <sergio.martin@artica.es>
* godmode/events/event_responses.editor.php: Little fix * godmode/events/event_responses.editor.php: Little fix

View File

@ -153,7 +153,7 @@ else {
$data[5] .= "&nbsp;"; $data[5] .= "&nbsp;";
} }
$data[5] .= "&nbsp;(" . $downtime['periodically_time_from']; $data[5] .= "&nbsp;(" . $downtime['periodically_time_from'];
$data[5] .= "-" . $downtime['periodically_time_to'] . ")"; $data[5] .= "-" . $downtime['periodically_time_to'] . ")";
break; break;
case 'monthly': case 'monthly':
$data[5] = __('Monthly:'); $data[5] = __('Monthly:');

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @category Images * @category Images
* @package Image_Graph * @package Image_Graph
*/ */
/** /**

View File

@ -208,6 +208,8 @@ define ('STATUS_ALERT_DISABLED', 'alert_disabled.png');
define ('STATUS_SERVER_OK', 'server_ok.png'); define ('STATUS_SERVER_OK', 'server_ok.png');
define ('STATUS_SERVER_DOWN', 'server_down.png'); define ('STATUS_SERVER_DOWN', 'server_down.png');
/* Events criticity */ /* Events criticity */
define ('EVENT_CRIT_MAINTENANCE', 0); define ('EVENT_CRIT_MAINTENANCE', 0);
define ('EVENT_CRIT_INFORMATIONAL', 1); define ('EVENT_CRIT_INFORMATIONAL', 1);
@ -219,4 +221,9 @@ define ('EVENT_CRIT_CRITICAL', 4);
define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34); define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34);
define ('EVENT_CRIT_NOT_NORMAL', 20); define ('EVENT_CRIT_NOT_NORMAL', 20);
?> /* Id Module (more use in component)*/
define ('MODULE_WMI', 6);
define ('MODULE_NETWORK', 2);
define ('MODULE_PLUGIN', 4);
define ('MODULE_WEB', 7);
?>

View File

@ -590,14 +590,14 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi
} }
if ($i == $max) { if ($i == $max) {
$query .= ' ) '; $query .= ' ) ';
} }
$i++; $i++;
continue; continue;
} }
else if (is_numeric ($field)) { else if (is_numeric ($field)) {
/* User provide the exact operation to do */ /* User provide the exact operation to do */
$query .= $value; $query .= $value;
if ($i < $max) { if ($i < $max) {
$query .= ' '.$join.' '; $query .= ' '.$join.' ';
} }
@ -621,12 +621,12 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi
$query .= sprintf ("%s IN ('%s')", $field, implode ("', '", $value)); $query .= sprintf ("%s IN ('%s')", $field, implode ("', '", $value));
} }
else { else {
if ($value[0] == ">"){ if ($value[0] == ">") {
$value = substr($value,1,strlen($value)-1); $value = substr($value,1,strlen($value)-1);
$query .= sprintf ("%s > '%s'", $field, $value); $query .= sprintf ("%s > '%s'", $field, $value);
} }
else if ($value[0] == "<"){ else if ($value[0] == "<") {
if ($value[1] == ">"){ if ($value[1] == ">") {
$value = substr($value,2,strlen($value)-2); $value = substr($value,2,strlen($value)-2);
$query .= sprintf ("%s <> '%s'", $field, $value); $query .= sprintf ("%s <> '%s'", $field, $value);
} }
@ -707,11 +707,11 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi
**/ **/
function oracle_recode_query ($sql, $values, $join = 'AND', $return = true) { function oracle_recode_query ($sql, $values, $join = 'AND', $return = true) {
$fields = array (); $fields = array ();
if (! is_array ($values) || empty($sql)) { if (! is_array ($values) || empty($sql)) {
return ''; return '';
} }
$query = ''; $query = '';
$limit = ''; $limit = '';
$offset = ''; $offset = '';
@ -736,7 +736,7 @@ function oracle_recode_query ($sql, $values, $join = 'AND', $return = true) {
else if (isset ($values['offset'])) { else if (isset ($values['offset'])) {
unset ($values['offset']); unset ($values['offset']);
} }
if (isset ($values['order'])) { if (isset ($values['order'])) {
if (is_array($values['order'])) { if (is_array($values['order'])) {
if (!isset($values['order']['order'])) { if (!isset($values['order']['order'])) {
@ -755,19 +755,19 @@ function oracle_recode_query ($sql, $values, $join = 'AND', $return = true) {
} }
unset ($values['order']); unset ($values['order']);
} }
if (isset ($values['group'])) { if (isset ($values['group'])) {
$group = sprintf (' GROUP BY %s', $values['group']); $group = sprintf (' GROUP BY %s', $values['group']);
unset ($values['group']); unset ($values['group']);
} }
$i = 1; $i = 1;
$max = count ($values); $max = count ($values);
foreach ($values as $field => $value) { foreach ($values as $field => $value) {
if ($i == 1) { if ($i == 1) {
$query .= ' ( '; $query .= ' ( ';
} }
if (is_numeric ($field)) { if (is_numeric ($field)) {
/* User provide the exact operation to do */ /* User provide the exact operation to do */
$query .= $value; $query .= $value;
@ -778,7 +778,7 @@ function oracle_recode_query ($sql, $values, $join = 'AND', $return = true) {
$i++; $i++;
continue; continue;
} }
if (is_null ($value)) { if (is_null ($value)) {
$query .= sprintf ("%s IS NULL", $field); $query .= sprintf ("%s IS NULL", $field);
} }
@ -867,10 +867,10 @@ function oracle_db_get_value_sql($sql, $dbconnection = false) {
function oracle_db_get_row_sql ($sql, $search_history_db = false) { function oracle_db_get_row_sql ($sql, $search_history_db = false) {
$sql = "SELECT * FROM (" . $sql . ") WHERE rownum < 2"; $sql = "SELECT * FROM (" . $sql . ") WHERE rownum < 2";
$result = oracle_db_get_all_rows_sql($sql, $search_history_db); $result = oracle_db_get_all_rows_sql($sql, $search_history_db);
if($result === false) if($result === false)
return false; return false;
return $result[0]; return $result[0];
} }
@ -904,11 +904,11 @@ function oracle_db_get_row_filter ($table, $filter, $fields = false, $where_join
} }
else { else {
if (is_array ($fields)) if (is_array ($fields))
$fields = implode (',', $fields); $fields = implode (',', $fields);
else if (! is_string ($fields)) else if (! is_string ($fields))
return false; return false;
} }
if (is_array ($filter)) if (is_array ($filter))
$filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE '); $filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE ');
else if (is_string ($filter)) else if (is_string ($filter))
@ -917,7 +917,7 @@ function oracle_db_get_row_filter ($table, $filter, $fields = false, $where_join
$filter = ''; $filter = '';
$sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter); $sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql ($sql); return db_get_row_sql ($sql);
} }
@ -956,7 +956,7 @@ function oracle_db_get_all_rows_filter ($table, $filter = array(), $fields = fal
elseif (!is_string($fields)) { elseif (!is_string($fields)) {
return false; return false;
} }
//TODO: Validate and clean filter options //TODO: Validate and clean filter options
if (is_array ($filter)) { if (is_array ($filter)) {
$filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE '); $filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE ');
@ -967,9 +967,9 @@ function oracle_db_get_all_rows_filter ($table, $filter = array(), $fields = fal
else { else {
$filter = ''; $filter = '';
} }
$sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter); $sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter);
if ($returnSQL) if ($returnSQL)
return $sql; return $sql;
else else
@ -984,7 +984,7 @@ function oracle_db_get_all_rows_filter ($table, $filter = array(), $fields = fal
*/ */
function oracle_db_get_num_rows ($sql) { function oracle_db_get_num_rows ($sql) {
global $config; global $config;
$type = explode(' ',strtoupper(trim($sql))); $type = explode(' ',strtoupper(trim($sql)));
if ($type[0] == 'SELECT'){ if ($type[0] == 'SELECT'){
$sql = "SELECT count(*) as NUM FROM (" . $sql . ")"; $sql = "SELECT count(*) as NUM FROM (" . $sql . ")";
@ -1000,7 +1000,7 @@ function oracle_db_get_num_rows ($sql) {
} }
oci_free_statement($query); oci_free_statement($query);
return $rows; return $rows;
} }
@ -1024,10 +1024,10 @@ function oracle_db_get_all_rows_field_filter ($table, $field, $condition, $order
else { else {
$sql = sprintf ("SELECT * FROM %s WHERE %s = '%s'", $table, $field, $condition); $sql = sprintf ("SELECT * FROM %s WHERE %s = '%s'", $table, $field, $condition);
} }
if ($order_field != "") if ($order_field != "")
$sql .= sprintf (" ORDER BY %s", $order_field); $sql .= sprintf (" ORDER BY %s", $order_field);
return db_get_all_rows_sql ($sql); return db_get_all_rows_sql ($sql);
} }
@ -1045,10 +1045,10 @@ function oracle_db_get_all_fields_in_table ($table, $field = '', $condition = ''
if ($condition != '') { if ($condition != '') {
$sql .= sprintf (" WHERE %s = '%s'", $field, $condition); $sql .= sprintf (" WHERE %s = '%s'", $field, $condition);
} }
if ($order_field != "") if ($order_field != "")
$sql .= sprintf (" ORDER BY %s", $order_field); $sql .= sprintf (" ORDER BY %s", $order_field);
return db_get_all_rows_sql ($sql); return db_get_all_rows_sql ($sql);
} }
@ -1077,7 +1077,7 @@ function oracle_db_get_all_fields_in_table ($table, $field = '', $condition = ''
*/ */
function oracle_db_format_array_to_update_sql ($values) { function oracle_db_format_array_to_update_sql ($values) {
$fields = array (); $fields = array ();
foreach ($values as $field => $value) { foreach ($values as $field => $value) {
if (is_numeric($field)) { if (is_numeric($field)) {
array_push ($fields, $value); array_push ($fields, $value);
@ -1086,7 +1086,7 @@ function oracle_db_format_array_to_update_sql ($values) {
else if ($field[0] == "`") { else if ($field[0] == "`") {
$field = str_replace('`', '', $field); $field = str_replace('`', '', $field);
} }
if ($value === NULL) { if ($value === NULL) {
$sql = sprintf ("%s = NULL", $field); $sql = sprintf ("%s = NULL", $field);
} }
@ -1110,7 +1110,7 @@ function oracle_db_format_array_to_update_sql ($values) {
} }
array_push ($fields, $sql); array_push ($fields, $sql);
} }
return implode (", ", $fields); return implode (", ", $fields);
} }
@ -1142,7 +1142,7 @@ function oracle_db_process_sql_update($table, $values, $where = false, $where_jo
$query = sprintf ("UPDATE %s SET %s", $query = sprintf ("UPDATE %s SET %s",
$table, $table,
db_format_array_to_update_sql ($values)); db_format_array_to_update_sql ($values));
if ($where) { if ($where) {
if (is_string ($where)) { if (is_string ($where)) {
// No clean, the caller should make sure all input is clean, this is a raw function // No clean, the caller should make sure all input is clean, this is a raw function
@ -1188,9 +1188,9 @@ function oracle_db_process_sql_delete($table, $where, $where_join = 'AND') {
if (empty ($where)) if (empty ($where))
/* Should avoid any mistake that lead to deleting all data */ /* Should avoid any mistake that lead to deleting all data */
return false; return false;
$query = sprintf ("DELETE FROM %s WHERE ", $table); $query = sprintf ("DELETE FROM %s WHERE ", $table);
if ($where) { if ($where) {
if (is_string ($where)) { if (is_string ($where)) {
/* FIXME: Should we clean the string for sanity? /* FIXME: Should we clean the string for sanity?
@ -1201,7 +1201,7 @@ function oracle_db_process_sql_delete($table, $where, $where_join = 'AND') {
$query .= db_format_array_where_clause_sql ($where, $where_join); $query .= db_format_array_where_clause_sql ($where, $where_join);
} }
} }
return db_process_sql ($query); return db_process_sql ($query);
} }
@ -1209,9 +1209,9 @@ function oracle_db_process_sql_delete_temp ($table, $where, $where_join = 'AND')
if (empty ($where)) if (empty ($where))
/* Should avoid any mistake that lead to deleting all data */ /* Should avoid any mistake that lead to deleting all data */
return false; return false;
$query = sprintf ("DELETE FROM %s WHERE ", $table); $query = sprintf ("DELETE FROM %s WHERE ", $table);
if ($where) { if ($where) {
if (is_string ($where)) { if (is_string ($where)) {
/* FIXME: Should we clean the string for sanity? /* FIXME: Should we clean the string for sanity?
@ -1222,8 +1222,9 @@ function oracle_db_process_sql_delete_temp ($table, $where, $where_join = 'AND')
$query .= db_format_array_where_clause_sql ($where, $where_join); $query .= db_format_array_where_clause_sql ($where, $where_join);
} }
} }
$result = ''; $result = '';
return db_process_sql ($query, "affected_rows", '', true, $result, false); return db_process_sql ($query, "affected_rows", '', true, $result, false);
} }

View File

@ -289,7 +289,7 @@ foreach ($result as $event) {
$data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">'; $data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">';
$data[$i] .= $event["agent_name"]; $data[$i] .= $event["agent_name"];
$data[$i] .= "</a></b>"; $data[$i] .= "</a></b>";
} }
else { else {
$data[$i] .= ui_print_agent_name ($event["id_agente"], true); $data[$i] .= ui_print_agent_name ($event["id_agente"], true);
} }

View File

@ -82,8 +82,8 @@ if ($read_message) {
$table->data[2][0] = __('Subject'); $table->data[2][0] = __('Subject');
$table->data[2][1] = html_print_input_text_extended ("subject", $message["subject"], 'text-subject', '', 50, 70, true, false, '', 'readonly'); $table->data[2][1] = html_print_input_text_extended ("subject", $message["subject"], 'text-subject', '', 50, 70, true, false, '', 'readonly');
$order = array("\r\n", "\n", "\r"); $order = array("\r\n", "\n", "\r");
$replace = '<br />'; $replace = '<br />';
$parsed_message = str_replace($order, $replace, $message["mensaje"]); $parsed_message = str_replace($order, $replace, $message["mensaje"]);
@ -124,7 +124,7 @@ if ($read_message) {
// Create message (destination user) // Create message (destination user)
if (($new_msg) && (!empty ($dst_user)) && (!$reply)) { if (($new_msg) && (!empty ($dst_user)) && (!$reply)) {
$return = messages_create_message ($config["id_user"], $dst_user, $subject, $message); $return = messages_create_message ($config["id_user"], $dst_user, $subject, $message);
$user_name = get_user_fullname ($dst_user); $user_name = get_user_fullname ($dst_user);
if (!$user_name) { if (!$user_name) {
$user_name = $dst_user; $user_name = $dst_user;

View File

@ -561,8 +561,8 @@ if (! defined ('METACONSOLE')) {
$img_style = array ("class" => "top", "width" => 16); $img_style = array ("class" => "top", "width" => 16);
$activeTab = get_parameter('tab','group'); $activeTab = get_parameter('tab','group');
$group_tab = array('text' => "<a href='index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure=$pure'>" $group_tab = array('text' => "<a href='index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure=$pure'>"
. html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>", . html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>",
'active' => $activeTab == "group"); 'active' => $activeTab == "group");
$tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&tab=tag&pure=$pure'>" $tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&tab=tag&pure=$pure'>"
. html_print_image ("images/tag_red.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag"); . html_print_image ("images/tag_red.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag");
$subsections = array('group' => $group_tab, 'tag' => $tags_tab); $subsections = array('group' => $group_tab, 'tag' => $tags_tab);
@ -586,7 +586,8 @@ if(tags_has_user_acl_tags()) {
echo "<br>"; echo "<br>";
if (! defined ('METACONSOLE')) { if (! defined ('METACONSOLE')) {
echo '<form id="tree_search" method="post" action="index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by='.$activeTab.'&pure='.$pure.'">'; echo '<form id="tree_search" method="post" action="index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by='.$activeTab.'&pure='.$pure.'">';
} else { }
else {
echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$activeTab.'&pure='.$pure.'">'; echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$activeTab.'&pure='.$pure.'">';
} }
echo "<b>" . __('Agent status') . "</b>"; echo "<b>" . __('Agent status') . "</b>";
@ -635,7 +636,7 @@ treeview_printTree($activeTab);
* less_branchs int use in ajax php as binary structure 0b00, 0b01, 0b10 and 0b11 * less_branchs int use in ajax php as binary structure 0b00, 0b01, 0b10 and 0b11
* id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one * id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one
*/ */
function loadSubTree(type, div_id, less_branchs, id_father, server_name) { function loadSubTree(type, div_id, less_branchs, id_father, server_name) {
hiddenDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv'); hiddenDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv');
loadDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv'); loadDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv');
pos = parseInt($('#tree_image'+id_father+'_'+type+'_'+div_id).attr('pos_tree')); pos = parseInt($('#tree_image'+id_father+'_'+type+'_'+div_id).attr('pos_tree'));
@ -690,9 +691,11 @@ treeview_printTree($activeTab);
}); });
} }
else { else {
<?php if (! defined ('METACONSOLE')) { <?php
if (! defined ('METACONSOLE')) {
echo 'var icon_path = \'operation/tree\';'; echo 'var icon_path = \'operation/tree\';';
} else { }
else {
echo 'var icon_path = \'../../operation/tree\';'; echo 'var icon_path = \'../../operation/tree\';';
} }
?> ?>
@ -781,7 +784,7 @@ treeview_printTree($activeTab);
success: function(data){ success: function(data){
$('#cont').html(data); $('#cont').html(data);
} }
}); });
} }
function loadModuleTable(id_module, server_name) { function loadModuleTable(id_module, server_name) {
@ -792,6 +795,6 @@ treeview_printTree($activeTab);
success: function(data){ success: function(data){
$('#cont').html(data); $('#cont').html(data);
} }
}); });
} }
</script> </script>

View File

@ -226,7 +226,7 @@ echo html_print_select_from_sql ('SELECT id_language, name FROM tlanguage',
echo '</td></tr><tr><td class="datos2">'.__('Comments').'</td><td class="datos">'; echo '</td></tr><tr><td class="datos2">'.__('Comments').'</td><td class="datos">';
html_print_textarea ("comments", 2, 60, $user_info["comments"], ($view_mode ? 'readonly="readonly"' : '')); html_print_textarea ("comments", 2, 60, $user_info["comments"], ($view_mode ? 'readonly="readonly"' : ''));
html_print_input_hidden('quick_language_change', 1); html_print_input_hidden('quick_language_change', 1);
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$display_all_group = true; $display_all_group = true;
@ -237,8 +237,7 @@ $usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group));
$id_usr = $config['id_user']; $id_usr = $config['id_user'];
// User only can change skins if has more than one group // User only can change skins if has more than one group
if (count($usr_groups) > 1){ if (count($usr_groups) > 1) {
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); $isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
echo '</td></tr><tr><td class="datos">' . __('Skin') . '</td><td class="datos2">'; echo '</td></tr><tr><td class="datos">' . __('Skin') . '</td><td class="datos2">';
@ -250,7 +249,7 @@ echo '</td></tr><tr><td class="datos">'.__('Interactive charts') . ui_print_help
$values = array(-1 => __('Default'),1 => __('Yes'),0 => __('No')); $values = array(-1 => __('Default'),1 => __('Yes'),0 => __('No'));
echo html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false); echo html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false);
echo '</td></tr><tr><td class="datos">'.__('Block size for pagination'). ui_print_help_tip(__('If checkbox is clicked then block size global configuration is used'), true) . '</td><td class="datos2">'; echo '</td></tr><tr><td class="datos">'.__('Block size for pagination'). ui_print_help_tip(__('If checkbox is clicked then block size global configuration is used'), true) . '</td><td class="datos2">';
if($user_info["block_size"] == 0) { if ($user_info["block_size"] == 0) {
$block_size = $config["global_block_size"]; $block_size = $config["global_block_size"];
} }
else { else {
@ -371,42 +370,42 @@ $(document).ready (function () {
function show_data_section () { function show_data_section () {
section=$("#section").val(); section=$("#section").val();
switch (section) { switch (section) {
case <?php echo "'".__('Dashboard')."'"; ?>: case <?php echo "'" . __('Dashboard') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", ""); $("#dashboard").css("display", "");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Visual console')."'"; ?>: case <?php echo "'" . __('Visual console') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", ""); $("#visual_console").css("display", "");
break; break;
case <?php echo "'".__('Event list')."'"; ?>: case <?php echo "'" . __('Event list') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Group view')."'"; ?>: case <?php echo "'" . __('Group view') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Tactical view')."'"; ?>: case <?php echo "'" . __('Tactical view') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Alert detail')."'"; ?>: case <?php echo "'" . __('Alert detail') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Other')."'"; ?>: case <?php echo "'" . __('Other') . "'"; ?>:
$("#text-data_section").css("display", ""); $("#text-data_section").css("display", "");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Default')."'"; ?>: case <?php echo "'" . __('Default') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");