diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3c9281bda4..a89d06558a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2012-02-22 Miguel de Dios + + * install.php, index.php, include/functions_ui.php: cleaned source code + style. + + * include/styles/dialog.css: fix the bad selector that it finished with + colon. + + * godmode/reporting/visual_console_builder.editor.php: fixed the bad syntax + in the styles from the grid. + + * godmode/reporting/visual_console_builder.editor.js: fixed a tiny + javascript warning. + 2012-02-21 Vanessa Gil * godmode/reporting/graph_template_item_editor.php: Added option to edit diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 1ecb2b7b1b..bddd8c60fd 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1476,7 +1476,7 @@ function click_button_toolbox(id) { } break; case 'save': - status = true; + var status = true; activeToolboxButton('save', false); jQuery.each(list_actions_pending_save, function(key, action_pending_save) { jQuery.ajax ({ diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 47d79ad617..c7b8e396cb 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -254,7 +254,7 @@ echo '
'; //echo ""; -echo ""; //
"; +echo ""; //"; echo ""; foreach ($layoutDatas as $layoutData) { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 87db21ad84..fc691f2b23 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -879,6 +879,7 @@ function ui_require_jquery_file ($name, $path = 'include/javascript/') { return false; $config['jquery'][$name] = $filename; + return true; } diff --git a/pandora_console/include/styles/dialog.css b/pandora_console/include/styles/dialog.css index 57fd925d9f..84414faf1b 100644 --- a/pandora_console/include/styles/dialog.css +++ b/pandora_console/include/styles/dialog.css @@ -93,7 +93,7 @@ } /* Dialog handle styles */ -.ui-dialog .ui-resizable-n, { +.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; diff --git a/pandora_console/index.php b/pandora_console/index.php index 6b4d2a848d..338c54d823 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -251,11 +251,11 @@ else { if ($page != "") { $page .= '.php'; // Enterprise ACL check - if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2)) == false){ + if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2)) == false) { require ("general/noaccess.php"); } elseif (file_exists ($page)) { - if (! extensions_is_extension ($page)){ + if (! extensions_is_extension ($page)) { require_once($page); } else { diff --git a/pandora_console/install.php b/pandora_console/install.php index 3f06749446..deb3b3b2e1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -51,7 +51,7 @@ function ChangeDBAction(causer) { else { window.document.step2_form.db_action.length=2; } - while (i < window.document.step2_form.db_action.length){ + while (i < window.document.step2_form.db_action.length) { window.document.step2_form.db_action.options[i].value =options_values[i]; window.document.step2_form.db_action.options[i].text =options_text[i]; i++; @@ -72,11 +72,11 @@ $banner = "v$version Build $build"; error_reporting(0); -function check_extension ( $ext, $label ){ +function check_extension ( $ext, $label ) { echo ""; echo " $label "; echo ""; - if (!extension_loaded($ext)){ + if (!extension_loaded($ext)) { echo ""; return 1; } @@ -87,11 +87,11 @@ function check_extension ( $ext, $label ){ echo ""; } -function check_include ( $ext, $label ){ +function check_include ( $ext, $label ) { echo ""; echo " $label "; echo ""; - if (!include($ext)){ + if (!include($ext)) { echo ""; return 1; } @@ -102,11 +102,11 @@ function check_include ( $ext, $label ){ echo ""; } -function check_exists ( $file, $label ){ +function check_exists ( $file, $label ) { echo ""; echo " $label "; echo ""; - if (!file_exists ($file)){ + if (!file_exists ($file)) { echo " "; return 1; } @@ -117,11 +117,11 @@ function check_exists ( $file, $label ){ echo ""; } -function check_generic ( $ok, $label ){ +function check_generic ( $ok, $label ) { echo ""; echo " $label "; echo ""; - if ($ok == 0 ){ + if ($ok == 0 ) { echo " "; return 1; } @@ -132,12 +132,12 @@ function check_generic ( $ok, $label ){ echo ""; } -function check_writable ( $fullpath, $label ){ +function check_writable ( $fullpath, $label ) { echo ""; echo " $label "; echo ""; if (file_exists($fullpath)) - if (is_writable($fullpath)){ + if (is_writable($fullpath)) { echo " "; echo ""; return 0; @@ -155,12 +155,12 @@ function check_writable ( $fullpath, $label ){ } -function check_variable ( $var, $value, $label, $mode ){ +function check_variable ( $var, $value, $label, $mode ) { echo ""; echo " $label "; echo ""; - if ($mode == 1){ - if ($var >= $value){ + if ($mode == 1) { + if ($var >= $value) { echo " "; return 0; } @@ -169,7 +169,7 @@ function check_variable ( $var, $value, $label, $mode ){ return 1; } } - elseif ($var == $value){ + elseif ($var == $value) { echo " "; return 0; } @@ -180,14 +180,14 @@ function check_variable ( $var, $value, $label, $mode ){ echo ""; } -function parse_mysql_dump($url){ - if (file_exists($url)){ +function parse_mysql_dump($url) { + if (file_exists($url)) { $file_content = file($url); $query = ""; - foreach($file_content as $sql_line){ - if(trim($sql_line) != "" && strpos($sql_line, "--") === false){ + foreach($file_content as $sql_line) { + if(trim($sql_line) != "" && strpos($sql_line, "--") === false) { $query .= $sql_line; - if(preg_match("/;[\040]*\$/", $sql_line)){ + if(preg_match("/;[\040]*\$/", $sql_line)) { if (!$result = mysql_query($query)) { echo mysql_error(); //Uncomment for debug echo "
$query
"; @@ -209,7 +209,7 @@ function parse_postgresql_dump($connection, $url, $debug = false) { $query = ""; - foreach($file_content as $sql_line){ + foreach($file_content as $sql_line) { $clean_line = trim($sql_line); $comment = preg_match("/^(\s|\t)*--.*$/", $clean_line); if ($comment) { @@ -259,7 +259,7 @@ function parse_oracle_dump($connection, $url, $debug = false) { $query = ""; $plsql_block = false; - foreach($file_content as $sql_line){ + foreach($file_content as $sql_line) { $clean_line = trim($sql_line); $comment = preg_match("/^(\s|\t)*--.*$/", $clean_line); if ($comment) { @@ -271,7 +271,7 @@ function parse_oracle_dump($connection, $url, $debug = false) { } //Support for PL/SQL blocks - if (preg_match("/^BEGIN$/", $clean_line)){ + if (preg_match("/^BEGIN$/", $clean_line)) { $query .= $clean_line . ' '; $plsql_block = true; } @@ -281,7 +281,7 @@ function parse_oracle_dump($connection, $url, $debug = false) { //Check query's end with a back slash and any returns in the end of line or if it's a PL/SQL block 'END;;' string if ((preg_match("/;[\040]*\$/", $clean_line) && !$plsql_block) || - (preg_match("/^END;;[\040]*\$/", $clean_line) && $plsql_block)) { + (preg_match("/^END;;[\040]*\$/", $clean_line) && $plsql_block)) { $plsql_block = false; //Execute and clean buffer @@ -343,7 +343,7 @@ function oracle_drop_all_objects ($connection) { return 0; } -function random_name ($size){ +function random_name ($size) { $temp = ""; for ($a=0;$a< $size;$a++) $temp = $temp. chr(rand(122,97)); @@ -351,7 +351,7 @@ function random_name ($size){ return $temp; } -function print_logo_status ($step, $step_total){ +function print_logo_status ($step, $step_total) { global $banner; echo " @@ -366,7 +366,7 @@ function print_logo_status ($step, $step_total){ function install_step1() { global $banner; - + echo "
@@ -377,11 +377,11 @@ function install_step1() {

For more information, please refer to documentation.
Pandora FMS Development Team

"; - if (file_exists("include/config.php")){ + if (file_exists("include/config.php")) { echo "
Warning: You already have a config.php file. Configuration and database would be overwritten if you continued.
"; } - echo "
"; + echo "
"; echo ""; $writable = check_writable ( "include", "Checking if ./include is writable"); if (file_exists("include/config.php")) @@ -399,9 +399,9 @@ function install_step1() { PandoraFMS.com web site."; echo ""; - + print_logo_status (1, 5); - + echo "
"; if ($writable == 0) { echo " @@ -431,7 +431,7 @@ function install_step1_licence() {

If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.

"; - if (!file_exists("COPYING")){ + if (!file_exists("COPYING")) { echo "
Licence file 'COPYING' is not present in your distribution. This means you have some 'partial' Pandora FMS distribution. We cannot continue without accepting the licence file."; echo "
"; } @@ -444,9 +444,9 @@ function install_step1_licence() { echo ""; } echo "
"; - + print_logo_status (2, 5); - + echo "
@@ -702,7 +702,7 @@ function install_step4() { } // Create schema - if ($dbaction == 'db_new' || $dbdrop == 1){ + if ($dbaction == 'db_new' || $dbdrop == 1) { $step1 = mysql_query ("CREATE DATABASE $dbname"); check_generic ($step1, "Creating database '$dbname'"); } @@ -763,7 +763,7 @@ function install_step4() { break; case 'oracle': $connection = oci_connect($dbuser, $dbpassword, '//' . $dbhost . '/' . $dbname); - if (!$connection){ + if (!$connection) { check_generic(0, "Connection with Database"); } else { @@ -840,7 +840,7 @@ function install_step4() { $result = pg_query($connection, "DROP DATABASE \"" . $dbname . "\";"); } - if ($dbaction != 'db_exist' || $dbdrop == 1){ + if ($dbaction != 'db_exist' || $dbdrop == 1) { pg_send_query($connection, "CREATE DATABASE \"" . $dbname . "\" WITH ENCODING 'utf8';"); $result = pg_get_result($connection); if (pg_result_status($result) != PGSQL_FATAL_ERROR) { @@ -1086,7 +1086,7 @@ function install_step5() { // Main page code // --------------- -if (! isset($_GET["step"])){ +if (! isset($_GET["step"])) { install_step1(); } else {