mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
fixed vc elements edition
This commit is contained in:
parent
871e1cc0c0
commit
705ebb8168
@ -165,6 +165,7 @@ if ($layoutDatas === false) {
|
|||||||
|
|
||||||
$alternativeStyle = true;
|
$alternativeStyle = true;
|
||||||
|
|
||||||
|
$parents = visual_map_get_items_parents($idVisualConsole);
|
||||||
|
|
||||||
foreach ($layoutDatas as $layoutData) {
|
foreach ($layoutDatas as $layoutData) {
|
||||||
$idLayoutData = $layoutData['id'];
|
$idLayoutData = $layoutData['id'];
|
||||||
@ -473,7 +474,6 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$parents = visual_map_get_items_parents($idVisualConsole);
|
|
||||||
$table->data[($i + 1)][4] = html_print_select(
|
$table->data[($i + 1)][4] = html_print_select(
|
||||||
$parents,
|
$parents,
|
||||||
'parent_'.$idLayoutData,
|
'parent_'.$idLayoutData,
|
||||||
@ -740,9 +740,9 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
$pure = get_parameter('pure', 0);
|
$pure = get_parameter('pure', 0);
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
if (!defined('METACONSOLE')) {
|
||||||
echo '<form method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
|
echo '<form class="vc_elem_form" method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
|
||||||
} else {
|
} else {
|
||||||
echo "<form method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
|
echo "<form class='vc_elem_form' method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
if (!defined('METACONSOLE')) {
|
||||||
@ -807,7 +807,30 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$('form.vc_elem_form').submit(function() {
|
||||||
|
var inputs_array = $(this).serializeArray();
|
||||||
|
var form_action = {};
|
||||||
|
|
||||||
|
form_action.name = 'go';
|
||||||
|
form_action.value = 'Update';
|
||||||
|
inputs_array.push(form_action);
|
||||||
|
|
||||||
|
var serialized_form_inputs = JSON.stringify(inputs_array);
|
||||||
|
var ajax_url = "<?php echo (is_metaconsole() === true) ? 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console='.$idVisualConsole : 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id']; ?>";
|
||||||
|
|
||||||
|
$.post({
|
||||||
|
url: ajax_url,
|
||||||
|
data: { serialized_form_inputs },
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
complete: function (data) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
var added_config = {
|
var added_config = {
|
||||||
"selector": "#tinyMCE_editor",
|
"selector": "#tinyMCE_editor",
|
||||||
"elements": "text-label",
|
"elements": "text-label",
|
||||||
|
@ -40,6 +40,21 @@ require_once $config['homedir'].'/include/functions_visual_map.php';
|
|||||||
require_once $config['homedir'].'/include/functions_agents.php';
|
require_once $config['homedir'].'/include/functions_agents.php';
|
||||||
enterprise_include_once('include/functions_visual_map.php');
|
enterprise_include_once('include/functions_visual_map.php');
|
||||||
|
|
||||||
|
// Bypass the size limitation of posted inputs given by PHP config token 'max_input_vars'.
|
||||||
|
if (isset($_POST['serialized_form_inputs']) === true) {
|
||||||
|
$posted_data_serialized = json_decode($_POST['serialized_form_inputs'], true);
|
||||||
|
|
||||||
|
unset($_POST['serialized_form_inputs']);
|
||||||
|
|
||||||
|
$posted_data_array = array_combine(
|
||||||
|
array_column($posted_data_serialized, 'name'),
|
||||||
|
array_column($posted_data_serialized, 'value')
|
||||||
|
);
|
||||||
|
|
||||||
|
// Merge data to $_POST superglobal.
|
||||||
|
$_POST += $posted_data_array;
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve the visual console id.
|
// Retrieve the visual console id.
|
||||||
set_unless_defined($idVisualConsole, 0);
|
set_unless_defined($idVisualConsole, 0);
|
||||||
// Set default.
|
// Set default.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user