From cb923ec4bc113e7dd7547bc0afdf1789250b2040 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 16 Aug 2013 09:15:44 +0000 Subject: [PATCH] 2013-08-16 Miguel de Dios * include/ajax/module.php, include/javascript/pandora_modules.js: fixed the ajax call to get the plugin fields in the form editor module plugin server. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8667 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++++ pandora_console/include/ajax/module.php | 25 ++++++++++--------- .../include/javascript/pandora_modules.js | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8741045846..6d96b6d305 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-08-16 Miguel de Dios + + * include/ajax/module.php, include/javascript/pandora_modules.js: + fixed the ajax call to get the plugin fields in the form editor + module plugin server. + 2013-08-14 Ramon Novoa * godmode/agentes/module_manager_editor_plugin.php, diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 894affec3e..3d29f6b46f 100644 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -20,6 +20,19 @@ include_once($config['homedir'] . "/include/functions_agents.php"); include_once($config['homedir'] . "/include/functions_ui.php"); require_once ($config['homedir'] . '/enterprise/include/functions_metaconsole.php'); +$get_plugin_macros = get_parameter('get_plugin_macros'); +if ($get_plugin_macros) { + $plugin_macros = db_get_value('macros','tplugin','id',get_parameter('id_plugin',0)); + + $macros = array(); + + $macros['base64'] = base64_encode($plugin_macros); + $macros['array'] = json_decode($plugin_macros,true); + + echo json_encode($macros); + return; +} + ui_require_jquery_file ("ui-timepicker-addon"); // This script is included manually to be included after jquery and avoid error echo ''; @@ -44,18 +57,6 @@ if ($search_modules) { echo json_encode($modules); } -$get_plugin_macros = get_parameter('get_plugin_macros'); -if ($get_plugin_macros) { - $plugin_macros = db_get_value('macros','tplugin','id',get_parameter('id_plugin',0)); - - $macros = array(); - - $macros['base64'] = base64_encode($plugin_macros); - $macros['array'] = json_decode($plugin_macros,true); - - echo json_encode($macros); -} - $get_module_detail = get_parameter ('get_module_detail', 0); if ($get_module_detail) { diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 091e5c3a00..3f7af0fecf 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -572,7 +572,7 @@ function add_macro_field(macro, row_model_id) { regex = /forced_title_(\w+)/; var forced_title_id = field_desc.match(regex)[1]; var uniq_id = 'id' + (new Date()).getTime(); - + field_desc = field_desc.replace(forced_title_id, uniq_id); field_desc = field_desc.replace(forced_title_id, uniq_id);