From 32413c47fda8cefcda837f509452ee21e365a22a Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 1 Nov 2010 12:02:00 +0000 Subject: [PATCH] 2010-11-01 Miguel de Dios * include/functions_html.php: cleaned source code style. And added line comments for to explain obfuscated $$ operation in function "print_input_text_extended". * godmode/agentes/module_manager_editor_plugin.php: set the field "plugin_parameters" with unlimited size. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3483 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 +++++++++ .../agentes/module_manager_editor_plugin.php | 2 +- pandora_console/include/functions_html.php | 20 +++++++++++++++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e9dda89d1e..551209a711 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2010-11-01 Miguel de Dios + + * include/functions_html.php: cleaned source code style. And added line + comments for to explain obfuscated $$ operation in function + "print_input_text_extended". + + * godmode/agentes/module_manager_editor_plugin.php: set the field + "plugin_parameters" with unlimited size. + 2010-10-29 Ramon Novoa * include/fgraph.php: Do not propagate compressed data to dates in the diff --git a/pandora_console/godmode/agentes/module_manager_editor_plugin.php b/pandora_console/godmode/agentes/module_manager_editor_plugin.php index b4b52f0b5e..d0bdc08a82 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_plugin.php +++ b/pandora_console/godmode/agentes/module_manager_editor_plugin.php @@ -66,7 +66,7 @@ push_table_simple ($data, 'plugin_2'); $data = array (); $data[0] = __('Plugin parameters'); $data[0] .= print_help_icon ('plugin_parameters', true); -$data[1] = print_input_text ('plugin_parameter', $plugin_parameter, '', 255, 255, true, $disabledBecauseInPolicy); +$data[1] = print_input_text ('plugin_parameter', $plugin_parameter, '', 255, '', true, $disabledBecauseInPolicy); $table_simple->colspan['plugin_3'][1] = 3; push_table_simple ($data, 'plugin_3'); diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 8fe919374f..586b2eb6a5 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -420,6 +420,7 @@ function print_input_text_extended ($name, $value, $id, $alt, $size, $maxlength, if ($maxlength == 0) $maxlength = 255; + if ($size == 0) $size = 10; @@ -438,12 +439,13 @@ function print_input_text_extended ($name, $value, $id, $alt, $size, $maxlength, if (is_array ($attributes)) { foreach ($attributes as $attribute => $attr_value) { - if (! in_array ($attribute,$valid_attrs)) { + if (! in_array ($attribute, $valid_attrs)) { continue; } $output .= $attribute.'="'.$attr_value.'" '; } - } else { + } + else { $output .= trim ($attributes)." "; $attributes = array (); } @@ -452,16 +454,25 @@ function print_input_text_extended ($name, $value, $id, $alt, $size, $maxlength, $attrs = array ("name" => "unnamed", "value" => "", "id" => "text-".sprintf ('%04d', $idcounter), "size" => "", "maxlength" => ""); - + foreach ($attrs as $attribute => $default) { if (array_key_exists ($attribute, $attributes)) { continue; } //If the attribute was already processed, skip + /* + * Remember, this next code have a $$ that for example there is a var as + * $a = 'john' then $$a is a var $john . + * + * In this case is use for example for $name and $atribute = 'name' . + * + */ + /* Exact operator because we want to show "0" on the value */ if ($$attribute !== '') { $output .= $attribute.'="'.$$attribute.'" '; - } elseif ($default != '') { + } + elseif ($default != '') { $output .= $attribute.'="'.$default.'" '; } } @@ -515,6 +526,7 @@ function print_input_password ($name, $value, $alt = '', $size = 50, $maxlength function print_input_text ($name, $value, $alt = '', $size = 50, $maxlength = 255, $return = false, $disabled = false) { if ($maxlength == 0) $maxlength = 255; + if ($size == 0) $size = 10;