diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b26631cd4a..8036fab855 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2013-07-16 Miguel de Dios + + * include/functions.php, + include/javascript/jquery.pandora.controls.js: improved the + functions to pass the php vars to js, now it supports json. + + * include/javascript/d3.v3.js: added this library for to make + beautiful things. + + * include/functions_ui.php, include/graphs/fgraph.php, + include/javascript/pandora_events.js, include/javascript/pandora.js, + include/functions_treeview.php, + include/include_graph_dependencies.php, + include/functions_categories.php, include/db/postgresql.php, + include/db/oracle.php, include/db/mysql.php: cleaned source code + style. + 2013-07-16 Miguel de Dios * include/graphs/flot/pandora.flot.js, diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index debfd4f186..5824e21dd4 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -580,7 +580,7 @@ function mysql_db_get_value_sql($sql, $dbconnection = false) { $sql .= " LIMIT 1"; $result = mysql_db_get_all_rows_sql ($sql, false, true, $dbconnection); - if($result === false) + if ($result === false) return false; foreach ($result[0] as $f) @@ -598,7 +598,7 @@ function mysql_db_get_row_sql ($sql, $search_history_db = false) { $sql .= " LIMIT 1"; $result = db_get_all_rows_sql ($sql, $search_history_db); - if($result === false) + if ($result === false) return false; return $result[0]; diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index 1eb6a7f10b..0461b145a7 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -65,7 +65,7 @@ function oracle_connect_db($host = null, $db = null, $user = null, $pass = null, * @return mixed Value of first column of the first row. False if there were no row. */ function oracle_db_get_value ($field, $table, $field_search = 1, $condition = 1, $search_history_db = false) { - + if (is_int ($condition)) { $sql = sprintf ("SELECT * FROM (SELECT %s FROM %s WHERE %s = %d) @@ -861,7 +861,7 @@ function oracle_db_get_value_sql($sql, $dbconnection = false) { $sql = "SELECT * FROM (" . $sql . ") WHERE rownum < 2"; $result = oracle_db_get_all_rows_sql ($sql, false, true, $dbconnection); - if($result === false) + if ($result === false) return false; foreach ($result[0] as $f) @@ -879,7 +879,7 @@ function oracle_db_get_row_sql ($sql, $search_history_db = false) { $sql = "SELECT * FROM (" . $sql . ") WHERE rownum < 2"; $result = oracle_db_get_all_rows_sql($sql, $search_history_db); - if($result === false) + if ($result === false) return false; return $result[0]; @@ -1115,7 +1115,7 @@ function oracle_db_format_array_to_update_sql ($values) { else if (substr($value, 0,1) == '#'){ $sql = sprintf ("%s = %s", $field, substr($value,1)); } - else{ + else { $sql = sprintf ("%s = '%s'", $field, $value); } } diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index a8d57c475b..3df090c0ec 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -37,7 +37,7 @@ function postgresql_connect_db($host = null, $db = null, $user = null, $pass = n if (! $connect_id) { return false; } - + return $connect_id; } @@ -54,18 +54,18 @@ function postgresql_connect_db($host = null, $db = null, $user = null, $pass = n function postgresql_db_get_value ($field, $table, $field_search = 1, $condition = 1, $search_history_db = false) { if ($field_search[0] == '`') $field_search = str_replace ('`', '', $field_search); - + if (is_int ($condition)) { $sql = sprintf ("SELECT %s FROM %s WHERE %s = %d LIMIT 1", - $field, $table, $field_search, $condition); + $field, $table, $field_search, $condition); } else if (is_float ($condition) || is_double ($condition)) { $sql = sprintf ("SELECT %s FROM %s WHERE %s = %f LIMIT 1", - $field, $table, $field_search, $condition); + $field, $table, $field_search, $condition); } else { $sql = sprintf ("SELECT %s FROM %s WHERE %s = '%s' LIMIT 1", - $field, $table, $field_search, $condition); + $field, $table, $field_search, $condition); } $result = db_get_all_rows_sql ($sql, $search_history_db); @@ -74,7 +74,7 @@ function postgresql_db_get_value ($field, $table, $field_search = 1, $condition if ($field[0] == '`') $field = str_replace ('`', '', $field); - + if (!isset($result[0][$field])) { return reset($result[0]); } @@ -120,7 +120,7 @@ function postgresql_db_get_row ($table, $field_search, $condition, $fields = fal $fields, $table, $field_search, $condition); } $result = db_get_all_rows_sql ($sql); - + if ($result === false) return false; @@ -131,11 +131,11 @@ function postgresql_db_get_all_rows_sql ($sql, $search_history_db = false, $cach global $config; $history = array (); - + if ($dbconnection === false) { $dbconnection = $config['dbconnection']; } - + // To disable globally SQL cache depending on global variable. // Used in several critical places like Metaconsole trans-server queries if (isset($config["dbcache"])) @@ -161,16 +161,17 @@ function postgresql_db_get_all_rows_sql ($sql, $search_history_db = false, $cach if ($return === false) { $return = array (); } - + // Append result to the history DB data if (! empty ($return)) { foreach ($return as $row) { array_push ($history, $row); } } - + if (! empty ($history)) return $history; + //Return false, check with === or !== return false; } @@ -247,8 +248,8 @@ function postgresql_db_process_sql($sql, $rettype = "affected_rows", $dbconnecti $result = $rows; } db_add_database_debug_trace ($sql, $result, $rows, - array ('time' => $time)); - + array ('time' => $time)); + return $result; } else { //The query IS a select. @@ -308,7 +309,7 @@ function postgresql_db_process_sql_insert($table, $values) { return false; $values = (array) $values; - + $query = sprintf ('INSERT INTO "%s" ', $table); $fields = array (); $values_str = ''; @@ -357,7 +358,7 @@ function postgresql_db_process_sql_insert($table, $values) { */ function postgresql_escape_string_sql($string) { $str = pg_escape_string($string); - + return $str; } @@ -389,7 +390,7 @@ function postgresql_escape_string_sql($string) { function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { if (! is_array ($filter) || empty ($filter)) return false; - + /* Avoid limit and offset if given */ unset ($filter['limit']); unset ($filter['offset']); @@ -413,7 +414,7 @@ function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = if ($result === false) return false; - + if (!$is_a_function) { $fieldClean = str_replace('"', '', $field); $fieldClean = str_replace('`', '', $fieldClean); @@ -536,7 +537,7 @@ function postgresql_db_format_array_where_clause_sql ($values, $join = 'AND', $p $group = sprintf (' GROUP BY %s', $values['group']); unset ($values['group']); } - + $i = 1; $max = count ($values); foreach ($values as $field => $value) { @@ -550,7 +551,7 @@ function postgresql_db_format_array_where_clause_sql ($values, $join = 'AND', $p $i++; continue; } - + if ($field[0] != "\"") { //If the field is as ., don't scape. if (strstr($field, '.') === false) @@ -597,7 +598,7 @@ function postgresql_db_format_array_where_clause_sql ($values, $join = 'AND', $p } $i++; } - + return (! empty ($query) ? $prefix: '').$query.$group.$order.$limit.$offset; } @@ -613,7 +614,7 @@ function postgresql_db_get_value_sql($sql, $dbconnection = false) { $sql .= " LIMIT 1"; $result = postgresql_db_get_all_rows_sql ($sql, false, true, $dbconnection); - if($result === false) + if ($result === false) return false; foreach ($result[0] as $f) @@ -631,7 +632,7 @@ function postgresql_db_get_row_sql ($sql, $search_history_db = false) { $sql .= " LIMIT 1"; $result = postgresql_db_get_all_rows_sql($sql, $search_history_db); - if($result === false) + if ($result === false) return false; return $result[0]; @@ -671,7 +672,7 @@ function postgresql_db_get_row_filter ($table, $filter, $fields = false, $where_ else if (! is_string ($fields)) return false; } - + if (is_array ($filter)) $filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE '); else if (is_string ($filter)) @@ -680,7 +681,7 @@ function postgresql_db_get_row_filter ($table, $filter, $fields = false, $where_ $filter = ''; $sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter); - + return db_get_row_sql ($sql); } @@ -719,7 +720,7 @@ function postgresql_db_get_all_rows_filter ($table, $filter = array(), $fields = elseif (!is_string($fields)) { return false; } - + //TODO: Validate and clean filter options if (is_array ($filter)) { $filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE '); @@ -730,7 +731,7 @@ function postgresql_db_get_all_rows_filter ($table, $filter = array(), $fields = else { $filter = ''; } - + $sql = sprintf ('SELECT %s FROM %s %s', $fields, $table, $filter); if ($returnSQL) @@ -747,7 +748,7 @@ function postgresql_db_get_all_rows_filter ($table, $filter = array(), $fields = */ function postgresql_db_get_num_rows ($sql) { $result = pg_query($sql); - + return pg_num_rows($result); } @@ -771,10 +772,10 @@ function postgresql_db_get_all_rows_field_filter ($table, $field, $condition, $o else { $sql = sprintf ("SELECT * FROM \"%s\" WHERE \"%s\" = '%s'", $table, $field, $condition); } - + if ($order_field != "") $sql .= sprintf (" ORDER BY %s", $order_field); - + return db_get_all_rows_sql ($sql); } @@ -792,10 +793,10 @@ function postgresql_db_get_all_fields_in_table ($table, $field = '', $condition if ($condition != '') { $sql .= sprintf (" WHERE \"%s\" = '%s'", $field, $condition); } - + if ($order_field != "") $sql .= sprintf (" ORDER BY %s", $order_field); - + return db_get_all_rows_sql ($sql); } @@ -824,7 +825,7 @@ function postgresql_db_get_all_fields_in_table ($table, $field = '', $condition */ function postgresql_db_format_array_to_update_sql ($values) { $fields = array (); - + foreach ($values as $field => $value) { if (is_numeric($field)) { array_push ($fields, $value); @@ -833,7 +834,7 @@ function postgresql_db_format_array_to_update_sql ($values) { else if ($field[0] == "`") { $field = str_replace('`', '', $field); } - + if ($value === NULL) { $sql = sprintf ("\"%s\" = NULL", $field); } @@ -853,7 +854,7 @@ function postgresql_db_format_array_to_update_sql ($values) { } array_push ($fields, $sql); } - + return implode (", ", $fields); } @@ -885,7 +886,7 @@ function postgresql_db_process_sql_update($table, $values, $where = false, $wher $query = sprintf ("UPDATE \"%s\" SET %s", $table, db_format_array_to_update_sql ($values)); - + if ($where) { if (is_string ($where)) { // No clean, the caller should make sure all input is clean, this is a raw function @@ -895,7 +896,7 @@ function postgresql_db_process_sql_update($table, $values, $where = false, $wher $query .= db_format_array_where_clause_sql ($where, $where_join, ' WHERE '); } } - + return db_process_sql ($query); } @@ -931,9 +932,9 @@ function postgresql_db_process_sql_delete($table, $where, $where_join = 'AND') { if (empty ($where)) /* Should avoid any mistake that lead to deleting all data */ return false; - + $query = sprintf ("DELETE FROM \"%s\" WHERE ", $table); - + if ($where) { if (is_string ($where)) { /* FIXME: Should we clean the string for sanity? @@ -944,7 +945,7 @@ function postgresql_db_process_sql_delete($table, $where, $where_join = 'AND') { $query .= db_format_array_where_clause_sql ($where, $where_join); } } - + return db_process_sql ($query); } @@ -961,7 +962,7 @@ function postgresql_db_process_sql_delete($table, $where, $where_join = 'AND') { function postgresql_db_get_all_row_by_steps_sql($new = true, &$result, $sql = null) { if ($new == true) $result = pg_query($sql); - + return pg_fetch_assoc($result); } @@ -1056,16 +1057,16 @@ function postgresql_db_get_type_field_table($table, $field) { */ function postgresql_db_get_table_count($sql, $search_history_db = false) { global $config; - + $history_count = 0; $count = postgresql_db_get_value_sql ($sql); if ($count === false) { $count = 0; } - + // Search the history DB for matches if ($search_history_db && $config['history_db_enabled'] == 1) { - + // Connect to the history DB if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { $config['history_db_connection'] = postgresql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], $config['history_db_pass'], $config['history_db_port'], false); @@ -1077,9 +1078,9 @@ function postgresql_db_get_table_count($sql, $search_history_db = false) { } } } - + $count += $history_count; - + return $count; } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 44e2a0243f..46f72b241d 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -138,48 +138,6 @@ function safe_url_extraclean ($string, $default_string = '') { return $string; } -/** - * DEPRECATED: This function is not used anywhere. Remove it? - * (use general/noaccess.php followed by exit instead) - */ -function no_permission () { - require ("config.php"); - - ui_print_error_message(__('You don\'t have access')); - echo html_print_image('images/noaccess.png', true, array("alt" => 'No access', "width" => '120')) . "

"; - echo "
"; - echo "
"; - echo __('You don\'t have enough permission to access this resource'); - echo "
"; - echo ""; - include "general/footer.php"; - - exit; -} - -/** - * DEPRECATED: This function is not used anywhere. Remove it? - * (use print_error function instead followed by return or exit) - * - * @param string $error Aditional error string to be shown. Blank by default - */ -function unmanaged_error ($error = "") { - require_once ("config.php"); - - ui_print_error_message(__('Unmanaged error')); - echo html_print_image('images/error.png', true, array("alt" => 'error')) . "

"; - echo ""; - echo "
"; - echo __('Unmanaged error'); - echo "
"; - echo $error; - echo "
"; - echo ""; - include "general/footer.php"; - - exit; -} - /** * List files in a directory in the local path. * @@ -1775,10 +1733,11 @@ function is_snapshot_data ($data) { /** * Create an invisible div with a provided ID and value to -* can retrieve it from javascript with function get_php_value(value) +* can retrieve it from javascript with function get_php_value(name) */ function set_js_value($name, $value) { - html_print_div(array('id' => 'php_to_js_value_' . $name, 'content' => $value, 'hidden' => true)); + html_print_div(array('id' => 'php_to_js_value_' . $name, + 'content' => json_encode($value), 'hidden' => true)); } diff --git a/pandora_console/include/functions_categories.php b/pandora_console/include/functions_categories.php index 8c6407712d..2b9f77f65e 100644 --- a/pandora_console/include/functions_categories.php +++ b/pandora_console/include/functions_categories.php @@ -31,7 +31,7 @@ function categories_delete_category ($id_category) { // Change the elements of this category to "without category" db_process_sql_update('tagente_modulo', array('id_category' => 0), array('id_category' => $id_category)); db_process_sql_update('tnetwork_component', array('id_category' => 0), array('id_category' => $id_category)); - if(enterprise_installed()) { + if (enterprise_installed()) { db_process_sql_update('tlocal_component', array('id_category' => 0), array('id_category' => $id_category)); db_process_sql_update('tpolicy_modules', array('id_category' => 0), array('id_category' => $id_category)); } diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index afcf918a1d..bee17c41ce 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -17,7 +17,7 @@ function treeview_printModuleTable($id_module, $server_data = false) { global $config; - if(empty($server_data)) { + if (empty($server_data)) { $server_name = ''; $server_id = ''; $url_hash = ''; @@ -40,9 +40,9 @@ function treeview_printModuleTable($id_module, $server_data = false) { enterprise_include_once ('meta/include/functions_metaconsole.php'); $filter["id_agente_modulo"] = $id_module; - + $module = db_get_row_filter ("tagente_modulo", $filter); - + if ($module === false) { ui_print_error_message(__('There was a problem loading module')); return; @@ -50,7 +50,7 @@ function treeview_printModuleTable($id_module, $server_data = false) { if (! check_acl ($config["id_user"], $module["id_grupo"], "AR")) { db_pandora_audit("ACL Violation", - "Trying to access Module Information"); + "Trying to access Module Information"); require_once ("general/noaccess.php"); return; } @@ -108,13 +108,13 @@ function treeview_printModuleTable($id_module, $server_data = false) { // Tags $tags = tags_get_module_tags($module['id_agente_modulo']); - if(empty($tags)) { + if (empty($tags)) { $tags = array(); } - foreach($tags as $k => $v) { + foreach ($tags as $k => $v) { $tag_name = tags_get_name($v); - if(empty($tag_name)) { + if (empty($tag_name)) { unset($tags[$k]); } else { @@ -122,16 +122,16 @@ function treeview_printModuleTable($id_module, $server_data = false) { } } - if(empty($tags)) { + if (empty($tags)) { $tags = '' . __('N/A') . ''; } else { $tags = implode(', ' , $tags); } - + echo ''.__('Tags').''; echo '' . $tags . ''; - + // Data $last_data = db_get_row_filter ('tagente_estado', array('id_agente_modulo' => $module['id_agente_modulo'], 'order' => array('field' => 'id_agente_estado', 'order' => 'DESC'))); if (is_numeric($last_data["datos"])) @@ -141,15 +141,15 @@ function treeview_printModuleTable($id_module, $server_data = false) { echo ''.__('Last data').''; echo ''; - + if (!empty($last_data['utimestamp'])) { echo $data; - + if ($module['unit'] != '') { echo " "; echo '('.$module['unit'].')'; } - + echo " "; html_print_image('images/clock2.png', false, array('title' => $last_data["timestamp"], 'width' => '18px')); } @@ -189,7 +189,7 @@ function treeview_printModuleTable($id_module, $server_data = false) { function treeview_printAlertsTable($id_module, $server_data = array()) { global $config; - if(empty($server_data)) { + if (empty($server_data)) { $server_name = ''; $server_id = ''; $url_hash = ''; @@ -226,7 +226,7 @@ function treeview_printAlertsTable($id_module, $server_data = array()) { echo ''.$template_name.''; $actions = alerts_get_alert_agent_module_actions($module_alert['id']); echo ''; - if(empty($actions)) { + if (empty($actions)) { echo ''.__('N/A').''; } else { @@ -242,7 +242,7 @@ function treeview_printAlertsTable($id_module, $server_data = array()) { } echo ''; - if(can_user_access_node () && check_acl ($config["id_user"], $id_group, 'LW')) { + if (can_user_access_node () && check_acl ($config["id_user"], $id_group, 'LW')) { // Actions table echo '
'; echo '
'; @@ -255,7 +255,7 @@ function treeview_printAlertsTable($id_module, $server_data = array()) { function treeview_printTable($id_agente, $server_data = array()) { global $config; - if(empty($server_data)) { + if (empty($server_data)) { $server_name = ''; $server_id = ''; $url_hash = ''; @@ -283,7 +283,7 @@ function treeview_printTable($id_agente, $server_data = array()) { $is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente)); - if($is_extra === ENTERPRISE_NOT_HOOK) { + if ($is_extra === ENTERPRISE_NOT_HOOK) { $is_extra = false; } @@ -313,8 +313,8 @@ function treeview_printTable($id_agente, $server_data = array()) { $addresses = agents_get_addresses ($id_agente); $address = agents_get_address($id_agente); - foreach($addresses as $k => $add) { - if($add == $address) { + foreach ($addresses as $k => $add) { + if ($add == $address) { unset($addresses[$k]); } } @@ -590,7 +590,7 @@ function treeview_getData ($type) { $avariableGroups = array_intersect_key($avariableGroups, $fgroups); $avariableGroupsIds = implode(',',array_keys($avariableGroups)); - if($avariableGroupsIds == '') { + if ($avariableGroupsIds == '') { $avariableGroupsIds == -1; } @@ -874,7 +874,7 @@ function treeview_getData ($type) { default: case 'module': $avariableGroupsIds = implode(',',array_keys($avariableGroups)); - if($avariableGroupsIds == ''){ + if ($avariableGroupsIds == ''){ $avariableGroupsIds == -1; } @@ -926,7 +926,7 @@ function treeview_getData ($type) { case 'tag': // Restrict the tags showed to the user tags $user_tags = tags_get_user_tags(); - if(empty($user_tags)) { + if (empty($user_tags)) { $user_tags_sql = ' AND 1 = 0'; } else { @@ -953,7 +953,7 @@ function treeview_getData ($type) { break; } - if($list == false) { + if ($list == false) { $list = array(); } @@ -1041,7 +1041,7 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel //TODO CHANGE POLICY ACL FOR TAG ACL $extra_sql = ''; - if($extra_sql != '') { + if ($extra_sql != '') { $extra_sql .= ' OR'; } $groups_sql = implode(', ', $avariableGroupsIds); @@ -1184,7 +1184,7 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel return false; } - if(empty($groups_sql)) { + if (empty($groups_sql)) { $groups_condition = ' AND 1 = 0'; } else { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 1e2e3e6d97..d83c4b030e 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -20,7 +20,7 @@ */ // Check to avoid error when load this library in error screen situations -if(isset($config['homedir'])) { +if (isset($config['homedir'])) { require_once($config['homedir'] . '/include/functions_agents.php'); require_once($config['homedir'] . '/include/functions_modules.php'); require_once($config['homedir'] . '/include/functions.php'); @@ -474,7 +474,7 @@ function ui_print_tags_warning ($return = false) { $msg .= __("Is possible that this view uses part of information which your user has not access"); $msg .= '
'; - if($return) { + if ($return) { return $msg; } else { @@ -535,12 +535,12 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small" * @return string HTML code if return parameter is true. */ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/groups_small", $style='', $link = true) { - if($id_group > 0) + if ($id_group > 0) $icon = (string) db_get_value ('icon', 'tgrupo', 'id_grupo', (int) $id_group); else $icon = "world"; - if($style == '') + if ($style == '') $style = 'width: 16px; height: 16px;'; $output = ''; @@ -593,7 +593,7 @@ function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin = $output = html_print_image("images/" . $subfolter . "/" . $icon, true, $options, true, $relative); } else { - if(!isset($options['title'])) { + if (!isset($options['title'])) { $options['title'] = $os_name; } $output = html_print_image("images/" . $subfolter . "/" . $icon, true, $options, false, $relative); @@ -627,7 +627,7 @@ function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin = * @return string HTML with agent name and link */ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_medium', $style = '', $cutname = false, $server_url = '', $extra_params = '', $known_agent_name = false) { - if($known_agent_name === false) { + if ($known_agent_name === false) { $agent_name = (string) agents_get_name ($id_agent); } else { @@ -669,7 +669,7 @@ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_mediu function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = false) { global $config; - if(!isset($alert['server_data'])) { + if (!isset($alert['server_data'])) { $server_name = ''; $server_id = ''; $url_hash = ''; @@ -1004,7 +1004,7 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = if (empty($home_url)) $home_url = ""; - if(defined('METACONSOLE')) { + if (defined('METACONSOLE')) { $home_url = "../../" . $home_url; } @@ -1855,7 +1855,7 @@ function ui_get_status_images_path () { * @return string HTML code if return parameter is true. */ function ui_print_status_image ($type, $title = "", $return = false, $options = false, $path = false) { - if($path === false) { + if ($path === false) { list ($imagepath) = ui_get_status_images_path (); } else { @@ -1864,7 +1864,7 @@ function ui_print_status_image ($type, $title = "", $return = false, $options = $imagepath .= "/" . $type; - if($options === false) { + if ($options === false) { $options = array(); } @@ -2184,7 +2184,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "", if (is_array($options)) { $buffer .= '