mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2013-03-05 Miguel de Dios <miguel.dedios@artica.es>
* extensions/snmp_explorer.php: improved the code style. * include/functions_html.php, include/ajax/module.php: rewrote the code for to use the last autocomplete jquery UI. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7786 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
97e9ac4ce2
commit
4af01ca236
@ -1,3 +1,10 @@
|
|||||||
|
2013-03-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* extensions/snmp_explorer.php: improved the code style.
|
||||||
|
|
||||||
|
* include/functions_html.php, include/ajax/module.php: rewrote the
|
||||||
|
code for to use the last autocomplete jquery UI.
|
||||||
|
|
||||||
2013-03-05 Mario Pulido <mario.pulido@artica.es>
|
2013-03-05 Mario Pulido <mario.pulido@artica.es>
|
||||||
|
|
||||||
*include/help/en/help_view_services.php,
|
*include/help/en/help_view_services.php,
|
||||||
|
@ -393,7 +393,6 @@ function snmp_explorer() {
|
|||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('ajaxqueue');
|
ui_require_jquery_file ('ajaxqueue');
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
//ui_require_jquery_file ('autocomplete');
|
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
@ -23,18 +23,20 @@ if ($search_modules) {
|
|||||||
$filter = get_parameter('q', '') . '%';
|
$filter = get_parameter('q', '') . '%';
|
||||||
$other_filter = json_decode(io_safe_output(get_parameter('other_filter')), true);
|
$other_filter = json_decode(io_safe_output(get_parameter('other_filter')), true);
|
||||||
|
|
||||||
$modules = agents_get_modules($id_agents, false, (array('nombre' => $filter) + $other_filter));
|
$modules = agents_get_modules($id_agents, false,
|
||||||
|
(array('nombre' => $filter) + $other_filter));
|
||||||
|
|
||||||
if ($modules === false) $modules = array();
|
if ($modules === false) $modules = array();
|
||||||
|
|
||||||
$modules = array_unique($modules);
|
$modules = array_unique($modules);
|
||||||
|
|
||||||
foreach ($modules as $module) {
|
$modules = io_safe_output($modules);
|
||||||
echo io_safe_output($module) . "\n";
|
|
||||||
}
|
echo json_encode($modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
$get_plugin_macros = get_parameter('get_plugin_macros');
|
$get_plugin_macros = get_parameter('get_plugin_macros');
|
||||||
if($get_plugin_macros) {
|
if ($get_plugin_macros) {
|
||||||
$plugin_macros = db_get_value('macros','tplugin','id',get_parameter('id_plugin',0));
|
$plugin_macros = db_get_value('macros','tplugin','id',get_parameter('id_plugin',0));
|
||||||
|
|
||||||
$macros = array();
|
$macros = array();
|
||||||
|
@ -1890,8 +1890,12 @@ function html_print_autocomplete_modules($name = 'module', $default = '', $id_ag
|
|||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
ui_require_jquery_file ('autocomplete');
|
html_print_input_text_extended ($name, $default, 'text-' . $name, '', 30, 100, false, '',
|
||||||
|
array('style' => 'background: url(images/lightning_blue.png) no-repeat right;'));
|
||||||
|
ui_print_help_tip(__('Type at least two characters to search the module.'), false);
|
||||||
|
|
||||||
|
$javascript_ajax_page =
|
||||||
|
ui_get_full_url('ajax.php', false, false, false, false);
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function escapeHTML (str)
|
function escapeHTML (str)
|
||||||
@ -1903,43 +1907,37 @@ function html_print_autocomplete_modules($name = 'module', $default = '', $id_ag
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$("#text-<?php echo $name; ?>").autocomplete(
|
$("#text-<?php echo $name; ?>").autocomplete({
|
||||||
"ajax.php",
|
minLength: 2,
|
||||||
{
|
source: function( request, response ) {
|
||||||
minChars: 2,
|
var term = request.term; //Word to search
|
||||||
scroll:true,
|
|
||||||
extraParams: {
|
data_params = {
|
||||||
page: "include/ajax/module",
|
page: "include/ajax/module",
|
||||||
|
q: term,
|
||||||
search_modules: 1,
|
search_modules: 1,
|
||||||
id_agents: '<?php echo json_encode($id_agents); ?>',
|
id_agents: '<?php echo json_encode($id_agents); ?>',
|
||||||
other_filter: '<?php echo json_encode($filter); ?>'
|
other_filter: '<?php echo json_encode($filter); ?>'
|
||||||
},
|
};
|
||||||
formatItem: function (data, i, total) {
|
|
||||||
if (total == 0)
|
|
||||||
$("#text-<?php echo $name; ?>").css ('background-color', '#cc0000');
|
|
||||||
else
|
|
||||||
$("#text-<?php echo $name; ?>").css ('background-color', '');
|
|
||||||
|
|
||||||
if (data == "")
|
jQuery.ajax ({
|
||||||
return false;
|
data: data_params,
|
||||||
|
async: false,
|
||||||
return escapeHTML(data[0]);
|
type: "POST",
|
||||||
},
|
url: action="<?php echo $javascript_ajax_page;?>",
|
||||||
delay: 200
|
timeout: 10000,
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
response(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
$("#text-<?php echo $name; ?>").result (
|
|
||||||
<?php echo $scriptResult; ?>
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
html_print_input_text_extended ($name, $default, 'text-' . $name, '', 30, 100, false, '',
|
|
||||||
array('style' => 'background: url(images/lightning_blue.png) no-repeat right;'));
|
|
||||||
ui_print_help_tip(__('Type at least two characters to search the module.'), false);
|
|
||||||
|
|
||||||
$output = ob_get_clean();
|
$output = ob_get_clean();
|
||||||
|
|
||||||
if ($return) {
|
if ($return) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user