public static function update_templatemerge_active() { check_ajax_referer('templatemerge_update_feed_active', 'templatemerge_update_feed_active'); $id = $_POST["id"]; $feed = TemplateData::get_feed($id); TemplateData::update_data($id, $feed["form_id"], $_POST["is_active"], $feed["meta"]); }
$config['meta']['files'][$file_id]['form_field'] = trim($_POST['form_field'][$i]); $config['meta']['files'][$file_id]['operator_value_e'] = trim($_POST['templatemerge_operator_value_e'][$i]); $config['meta']['files'][$file_id]['form_field_e'] = trim($_POST['form_field_e'][$i]); $config['meta']['files'][$file_id]['operator_value_f'] = trim($_POST['templatemerge_operator_value_f'][$i]); $config['meta']['files'][$file_id]['form_field_f'] = trim($_POST['form_field_f'][$i]); $config['meta']['files'][$file_id]['operator_value_g'] = trim($_POST['templatemerge_operator_value_g'][$i]); $config['meta']['files'][$file_id]['form_field_g'] = trim($_POST['form_field_g'][$i]); $config['meta']['files'][$file_id]['enable'] = isset($_POST['templatemerge_enable'][$i]) && $_POST['templatemerge_enable'][$i] == 1 ? 1 : 1; echo 'Error with uploading'; } else { echo 'There was an error with moving the file. ' . print_r($movefile['error'], true); } //$file_id++; } if (!empty($config['meta'])) { $id = TemplateData::update_data($id, $config["form_id"], $config["is_active"], $config["meta"]); ?> <div class="updated fade" style="padding:6px"><?php echo sprintf(__("Feed Updated. %sback to list%s", "templatemerge"), "<a href='?page=templatemerge'>", "</a>"); ?> </div> <?php } else { echo 'Error with uploading xx'; $is_validation_error = true; } } $total_files = count($config['meta']['files']); if ($total_files > 0) { $config['meta']['files'] = postion_level_sort($config['meta']['files']); $config['meta']['files'] = array_merge($config['meta']['files']);