query($sql); $response = 'CHARSET now utf_8 COLLATE utf8_general_ci'; } else { $response = ''; } if (isset($_POST["reset_cache"])) { $button = new maxButton(); $button->reset_cache(); } if (isset($_POST["remigrate"])) { $install = MB()->getClass("install"); $install::create_database_table(); $install::migrate(); } if (isset($_POST["replace"]) && check_admin_referer('mb_bulk_edit', 'bulk_edit')) { $search = sanitize_text_field($_POST["search"]); $replace = sanitize_text_field($_POST["replace"]); $field = sanitize_text_field($_POST["replace_field"]); $button = new maxButton(); if ($field == '') exit("FATAL"); $admin = MB()->getClass('admin'); $buttonsIDS = $admin->getButtons(array('limit' => -1)); $data_found = false; foreach($buttonsIDS as $row) { $button_id = $row["id"]; $button->set($button_id); $data = $button->get(); foreach($data as $block => $fields) { if (isset($fields[$field])) { $value = $fields[$field]; $data[$block][$field] = str_replace($search, $replace, $value); $button->update($data); $data_found = true; continue; } if ($data_found) { $data_found = false; continue; } } } } ?> getClass('admin'); $page_title = __("Settings","maxbuttons"); $admin->get_header(array("tabs_active" => true, "title" => $page_title) ); ?>