2012-09-07 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora.js, include/functions_ui.php,
	include/functions_html.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6947 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-09-10 15:51:47 +00:00
parent 50ae58aabd
commit 9087beb4de
4 changed files with 103 additions and 98 deletions

View File

@ -1,3 +1,8 @@
2012-09-07 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js, include/functions_ui.php,
include/functions_html.php: cleaned source code style.
2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php * include/functions_graph.php
@ -61,6 +66,7 @@
in metaconsole. in metaconsole.
2012-09-07 Miguel de Dios <miguel.dedios@artica.es> 2012-09-07 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: fixed the ui_get_full_url function, * include/functions_ui.php: fixed the ui_get_full_url function,
because sometimes added two times the php script name. because sometimes added two times the php script name.

View File

@ -553,12 +553,12 @@ function html_print_input_text_extended ($name, $value, $id, $alt, $size, $maxle
} //If the attribute was already processed, skip } //If the attribute was already processed, skip
/* /*
* Remember, this next code have a $$ that for example there is a var as * Remember, this next code have a $$ that for example there is a var as
* $a = 'john' then $$a is a var $john . * $a = 'john' then $$a is a var $john .
* *
* In this case is use for example for $name and $atribute = 'name' . * In this case is use for example for $name and $atribute = 'name' .
* *
*/ */
/* Exact operator because we want to show "0" on the value */ /* Exact operator because we want to show "0" on the value */
if ($$attribute !== '') { if ($$attribute !== '') {

View File

@ -2016,7 +2016,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
} }
} }
return $fullurl.$url; return $fullurl . $url;
} }
/** /**
@ -2092,7 +2092,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
$buffer .= '</ul></div>'; $buffer .= '</ul></div>';
} }
else { else {
if ($options != ""){ if ($options != "") {
$buffer .= '<div id="menu_tab"><ul class="mn"><li class="nomn">'; $buffer .= '<div id="menu_tab"><ul class="mn"><li class="nomn">';
$buffer .= $options; $buffer .= $options;
$buffer .= '</li></ul></div>'; $buffer .= '</li></ul></div>';

View File

@ -70,42 +70,42 @@ function agent_changed (event, id_agent, selected) {
$('#module').empty (); $('#module').empty ();
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0)); $('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page": "operation/agentes/ver_agente", {"page": "operation/agentes/ver_agente",
"get_agent_modules_json": 1, "get_agent_modules_json": 1,
"id_agent": id_agent "id_agent": id_agent
}, },
function (data) { function (data) {
$('#module').empty (); $('#module').empty ();
if (typeof($(document).data('text_for_module')) != 'undefined') { if (typeof($(document).data('text_for_module')) != 'undefined') {
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
} }
else { else {
if (typeof(data['any_text']) != 'undefined') { if (typeof(data['any_text']) != 'undefined') {
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
} }
else { else {
var anyText = $("#any_text").html(); //Trick for catch the translate text. var anyText = $("#any_text").html(); //Trick for catch the translate text.
if (anyText == null) { if (anyText == null) {
anyText = 'Any'; anyText = 'Any';
} }
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
} }
} }
jQuery.each (data, function (i, val) { jQuery.each (data, function (i, val) {
s = js_html_entity_decode (val['nombre']); s = js_html_entity_decode (val['nombre']);
$('#module').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo'])); $('#module').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo']));
$('#module').fadeIn ('normal'); $('#module').fadeIn ('normal');
}); });
if (selected != undefined) if (selected != undefined)
$('#module').attr ('value', selected); $('#module').attr ('value', selected);
$('#module').removeAttr('disabled'); $('#module').removeAttr('disabled');
}, },
"json" "json"
); );
} }
/** /**
@ -132,7 +132,6 @@ function isEmptyObject(obj) {
* @param selected Which module(s) have to be selected * @param selected Which module(s) have to be selected
*/ */
function agent_changed_by_multiple_agents (event, id_agent, selected) { function agent_changed_by_multiple_agents (event, id_agent, selected) {
// Hack to add custom condition // Hack to add custom condition
if($("#hidden-custom_condition").val() != undefined) { if($("#hidden-custom_condition").val() != undefined) {
custom_condition = $("#hidden-custom_condition").val(); custom_condition = $("#hidden-custom_condition").val();
@ -225,9 +224,9 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
$('#module').removeAttr('disabled'); $('#module').removeAttr('disabled');
}, },
"json" "json"
); );
} }
/** /**
@ -256,43 +255,43 @@ function agent_changed_by_multiple_agents_with_alerts (event, id_agent, selected
$('#module').empty (); $('#module').empty ();
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0)); $('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page": "operation/agentes/ver_agente", {"page": "operation/agentes/ver_agente",
"get_agent_modules_alerts_json_for_multiple_agents": 1, "get_agent_modules_alerts_json_for_multiple_agents": 1,
"template": template, "template": template,
"id_agent[]": idAgents, "id_agent[]": idAgents,
"selection_mode": selection_mode "selection_mode": selection_mode
}, },
function (data) { function (data) {
$('#module').empty (); $('#module').empty ();
if (typeof($(document).data('text_for_module')) != 'undefined') { if (typeof($(document).data('text_for_module')) != 'undefined') {
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
} }
else { else {
if (typeof(data['any_text']) != 'undefined') { if (typeof(data['any_text']) != 'undefined') {
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).attr('selected', true));
} }
else { else {
var anyText = $("#any_text").html(); //Trick for catch the translate text. var anyText = $("#any_text").html(); //Trick for catch the translate text.
if (anyText == null) { if (anyText == null) {
anyText = 'Any'; anyText = 'Any';
} }
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true)); $('#module').append ($('<option></option>').html (anyText).attr ("value", 0).attr('selected', true));
} }
} }
jQuery.each (data, function (i, val) { jQuery.each (data, function (i, val) {
s = js_html_entity_decode(val); s = js_html_entity_decode(val);
$('#module').append ($('<option></option>').html (s).attr ("value", val)); $('#module').append ($('<option></option>').html (s).attr ("value", val));
$('#module').fadeIn ('normal'); $('#module').fadeIn ('normal');
}); });
if (selected != undefined) if (selected != undefined)
$('#module').attr ('value', selected); $('#module').attr ('value', selected);
$('#module').removeAttr('disabled'); $('#module').removeAttr('disabled');
}, },
"json" "json"
); );
} }
/** /**
@ -463,7 +462,7 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
data: data_params, data: data_params,
async: false, async: false,
type: 'POST', type: 'POST',
url: action= homedir_path + "/ajax.php", url: action="ajax.php",
timeout: 10000, timeout: 10000,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {