namespace MO_CAW\Common\Views;
use MO_CAW\Common\Utils;
use MO_CAW\Common\DB_Utils;
use MO_CAW\Common\Constants;
class API_Creation
{
private $api_name = '';
private $namespace = "mo/v1";
private $method = Constants::HTTP_GET;
private $selected_table = '';
private $request_columns = array();
private $response = array();
private $blocked_roles = array();
private $common_filters = array();
private $value_specific_filter = array();
private $gui_endpoint_config = array();
protected $license_status = '';
public function __construct($gt)
{
if (!(isset($_GET["_wpnonce"]) && check_admin_referer("MO_CAW_API_Creation_" . ucfirst($gt) . "_Nonce", "_wpnonce"))) {
goto cm;
}
$DT = isset($_SESSION["MO_CAW_API_Creation_Form_Data"]) ? wp_unslash($_SESSION["MO_CAW_API_Creation_Form_Data"]) : array();
Utils::sanitize_nested_array($DT);
$this->gui_endpoint_config = !empty($DT) ? $DT : $this->gui_endpoint_config;
if ((Constants::EDIT === $gt || Constants::VIEW === $gt || Constants::TEST === $gt || Constants::DELETE === $gt) && Constants::DISABLED !== $this->license_status) {
goto W0;
}
if (Constants::ADD === $gt && Constants::DISABLED !== $this->license_status) {
goto KD;
}
goto Si;
W0:
$this->api_name = isset($_GET["api-name"]) ? sanitize_text_field(wp_unslash($_GET["api-name"])) : $this->api_name;
$this->method = isset($_GET["method"]) ? sanitize_text_field(wp_unslash($_GET["method"])) : $this->method;
$this->namespace = isset($_GET["namespace"]) ? sanitize_text_field(wp_unslash($_GET["namespace"])) : $this->namespace;
$UK = array("connection_name" => $this->api_name, "type" => Constants::GUI_ENDPOINT, "method" => $this->method, "namespace" => $this->namespace);
$this->gui_endpoint_config = empty($this->gui_endpoint_config) ? DB_Utils::get_configuration($UK)[0] : $this->gui_endpoint_config;
goto Si;
KD:
$this->namespace = $this->gui_endpoint_config["namespace"] ?? $this->namespace;
$this->method = $this->gui_endpoint_config["method"] ?? $this->method;
$this->api_name = $this->gui_endpoint_config["connection_name"] ?? $this->api_name;
Si:
$this->selected_table = $this->gui_endpoint_config["configuration"]["table"] ?? $this->selected_table;
$this->request_columns = $this->gui_endpoint_config["configuration"]["request_columns"] ?? $this->request_columns;
$this->response = $this->gui_endpoint_config["configuration"]["response"] ?? $this->response;
$this->blocked_roles = $this->gui_endpoint_config["configuration"]["blocked_roles"] ?? $this->blocked_roles;
$this->common_filters = $this->gui_endpoint_config["configuration"]["common_filters"] ?? $this->common_filters;
$this->value_specific_filter = $this->gui_endpoint_config["configuration"]["value_specific_filter"] ?? $this->value_specific_filter;
cm:
}
public function display_api_creation_ui($Z5, $gt)
{
switch ($gt) {
case Constants::ADD:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case Constants::VIEW:
$this->display_api_creation_view();
goto wL;
case Constants::EDIT:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case Constants::TEST:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case "export":
$this->display_api_creation_export();
goto wL;
default:
$this->display_api_creation_all_config();
goto wL;
}
r4:
wL:
}
private function display_api_creation_all_config()
{
$UK["type"] = Constants::GUI_ENDPOINT;
$kV = DB_Utils::get_configuration($UK);
$kV = Utils::organize_endpoints_by_namespace($kV);
echo "\x9 <div class="d-flex justify-content-between align-items-center mbl">
<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Configured APIs</h6>
\x9\x9\x9<div class="d-grid gap-2 d-md-block">\xa \x9 <button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 px-4 mo-caw-element-to-toggle mo-caw-light-mode" method="button" data-bs-toggle="modal" data-bs-target="#" aria-hidden="true" hidden ";
echo esc_attr($this->license_status);
echo ">Export Postman Collection</button>\xa \x9\x9\x9<a class="btn btn-primary mo-caw-rounded- mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=add", "MO_CAW_API_Creation_Add_Nonce"));
echo "">Create API</a>
\x9 </div>
\x9\x9<div class="modal fade mo-caw-export-modal" id="mo-caw-custom-api-export-modal" tabindex="-1" aria-labelledby="mo-caw-custom-api-export-modal-label" aria-hidden="true">
\x9 \x9<div class="modal-dialog modal-dialog-centered justify-content-center">\xa\x9 \x9\x9\x9<form method="POST">
\x9 \x9 \x9";
wp_nonce_field("MO_CAW_API_Creation_Export", "MO_CAW_API_Creation_Nonce");
echo "\x9 \x9\x9<div class="modal-content">
\x9\x9\x9 <div class="modal-header">
\x9 \x9 <h5 class="modal-title" id="mo-caw-custom-api-export-modal-label">Export Postman Collection</h5>\xa \x9\x9 \x9\x9<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\xa \x9\x9 </div>
\x9 \x9\x9 <div class="modal-body">\xa \x9 \x9 \x9\x9\x9<h6 class="mo-caw-element-to-toggle mo-caw-light-mode">Select namespaces to export</h6>\xa\x9 \x9 \x9\x9 <div class="form-check d-flex align-items-center justify-content-start pj">\xa\x9 \x9 \x9 \x9\x9<input class="form-check-input m-0 bg-white me-2 mo-caw-select-all-checkbox" type="checkbox" value="" id="mo-caw-custom-api-export-select-all" data-target="mo-caw-custom-api-export">
\x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-export-select-all">Select All</label>\xa\x9\x9 \x9 \x9</div>\xa\x9\x9 \x9 \x9 ";
foreach ($kV as $Qi => $J1) {
echo "\x9 \x9\x9\x9\x9 <div class="form-check d-flex align-items-center justify-content-start p-2">
\x9 \x9\x9 \x9<input class="form-check-input m-0 bg-white me-2 mo-caw-custom-api-export" type="checkbox" value="";
echo esc_attr($Qi);
echo "" id="mo-caw-custom-api-export-";
echo esc_attr($Qi);
echo "" name="mo-caw-custom-api-export[]">\xa \x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-export">";
echo esc_attr($Qi);
echo "</label>\xa\x9\x9 \x9 \x9 \x9 </div>
\x9\x9 \x9\x9 ";
ZS:
}
ck:
echo "\x9\x9 \x9\x9 </div>
\x9\x9\x9\x9 <div class="modal-footer d-md-flex justify-content-md-center">
\x9\x9 \x9<button class="btn btn-primary mo-caw-bg-blue-medium mo-caw-rounded-" type="submit">Export</button>
\x9\x9\x9\x9 \x9 </div>
\x9\x9 \x9</div>
\x9\x9\x9\x9</form>\xa\x9 \x9</div>\xa \x9 </div>
\x9\x9</div>
\x9";
if (!empty($kV)) {
goto IH;
}
echo "\x9 <div class="d-flex align-items-center flex-column">
\x9 \x9<img src="";
echo esc_url(MO_CUSTOM_API_URL . "classes/Common/Resources/Images/not-found.jpeg");
echo "" width="4px" >
\x9<h6 class="mtm text-secondary">Oops! Seems like you have not created any Custom APIs.</h6>\xa\x9 \x9</div>\xa\x9\x9";
goto j_;
IH:
echo " \x9<div class="accordion" id="mo-caw-custom-api-accordion">\xa\x9\x9 \x9<div class="accordion accordion-flush" id="mo-caw-custom-api-accordion-flush">\xa \x9\x9\x9";
$gZ = 0;
echo "\x9 ";
foreach ($kV as $Qi => $J1) {
echo " \x9 \x9<div class="accordion-item mo-caw-accordion-item mbj border-0 mo-caw-rounded-8 mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9\x9<h2 class="accordion-header" id="mo-caw-custom-api-config-accordion-";
echo esc_attr($gZ);
echo "">
\x9\x9\x9<button class="accordion-button mo-caw-bg-blue-light fw-normal shadow-none mo-caw-rounded-8 ";
echo 0 === $gZ ? '' : "collapsed";
echo "" type="button" data-bs-toggle="collapse" data-bs-target="#mo-caw-create-api-accordion-collapse-";
echo esc_attr($gZ);
echo "" aria-expanded="false" aria-controls="flush-collapseOne">\xa \x9\x9 ";
echo esc_attr($Qi);
echo "\x9 \x9\x9 \x9</button>\xa\x9\x9 \x9 \x9</h2>\xa\x9 \x9 \x9<div id="mo-caw-create-api-accordion-collapse-";
echo esc_attr($gZ);
echo "" class="accordion-collapse collapse ";
echo 0 === $gZ ? "show" : '';
echo "" aria-labelledby="mo-caw-custom-api-config-accordion-";
echo esc_attr($gZ);
echo "" data-bs-parent="#mo-caw-custom-api-accordion-flush">\xa \x9\x9 \x9\x9<div class="accordion-body">\xa\x9 \x9<table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9 \x9\x9 <thead>
\x9\x9 \x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9 \x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3">API Name</th>\xa \x9\x9 \x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3">Method</th>\xa\x9 \x9\x9\x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3">Enable/Disable</th>
\x9\x9 \x9 \x9 \x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3">Actions</th>\xa\x9\x9 </tr>
\x9\x9 \x9\x9 </thead>
\x9 \x9 \x9<tbody>\xa \x9\x9\x9 \x9 \x9 \x9";
foreach ($J1 as $jS => $Uq) {
echo " \x9 \x9 \x9 <tr>
\x9 \x9\x9 \x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle">";
echo esc_attr($Uq["connection_name"]);
echo "</td>
\x9 \x9 \x9\x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle"><span class="rounded-pill py-2 px-4 mo-caw-";
echo esc_attr($Uq["method"]);
echo "-method">";
echo esc_attr(strtoupper($Uq["method"]));
echo "</span></td>
\x9\x9\x9 \x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">\xa\x9 \x9 \x9\x9 \x9\x9\x9\x9 <div class="form-check form-switch d-flex justify-content-center align-items-center">\xa\x9\x9\x9\x9 \x9 \x9 <input class="form-check-input mo-caw-toggle-switch" type="checkbox" onchange="moCawEnableDisableApi(this, '";
echo esc_attr(wp_create_nonce("mo_caw_custom_api_enable_disable_api"));
echo "', '";
echo esc_attr($Uq["connection_name"]);
echo "', '";
echo esc_attr($Uq["method"]);
echo "', '";
echo esc_attr($Qi);
echo "', '";
echo esc_attr(Constants::GUI_ENDPOINT);
echo "')"
\x9\x9\x9\x9\x9\x9\x9\x9\x9 ";
echo !isset($Uq["is_enabled"]) || $Uq["is_enabled"] ? "checked " : '';
echo esc_attr($this->license_status);
echo " \x9\x9 \x9\x9\x9\x9 \x9\x9\x9\x9>
\x9 \x9 \x9\x9\x9\x9\x9 \x9\x9 </div>
\x9 \x9 \x9\x9\x9 \x9\x9 </td>
\x9 \x9 \x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">\xa\x9 \x9 \x9\x9\x9\x9\x9\x9 \x9<div class="dropdown">\xa \x9\x9 \x9\x9\x9 \x9\x9 <button class="btn btn-secondary dropdown-toggle mo-caw-dropdown-toggle rounded-pill mo-caw-bg-grey-light border-0 mo-caw-text-grey-medium" type="button" id="mo-caw-api-creation-actions-";
echo esc_attr($jS);
echo "" data-bs-toggle="dropdown" aria-expanded="false">Pick an option</button>\xa \x9 \x9\x9 \x9\x9 \x9\x9 <ul class="dropdown-menu mo-caw-dropdown-menu" aria-labelledby="mo-caw-api-creation-actions-";
echo esc_attr($jS);
echo "">\xa\x9 \x9 \x9\x9\x9\x9 \x9 <li><a class="dropdown-item d-flex align-items-center justify-content-between" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=view&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi, "MO_CAW_API_Creation_View_Nonce"));
echo ""><span>View</span><i class="far fa-eye mo-caw-text-black"></i></a></li>\xa \x9 \x9 \x9 \x9 \x9 \x9\x9\x9<li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=edit&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi, "MO_CAW_API_Creation_Edit_Nonce"));
echo ""><span>Edit</span><i class="fas fa-pencil mo-caw-text-black"></i></a></li>\xa \x9 \x9\x9\x9\x9 \x9 \x9<li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=test&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi . "&test-mode=true", "MO_CAW_API_Creation_Test_Nonce"));
echo ""><span>Test</span><i class="fas fa-check mo-caw-text-black"></i></a></li>
\x9\x9 \x9 \x9\x9\x9 \x9 \x9 <li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" onclick="if(confirm('Are you sure you want to delete this API?')){document.getElementById('mo-caw-api-creation-delete-form-";
echo esc_attr($Uq["connection_name"]) . "-" . esc_attr($Uq["method"]) . "-" . esc_attr($Qi);
echo "').submit(); return false;}"><span>Delete</span><i class="far fa-trash-can mo-caw-text-black"></i></a></li>\xa \x9 \x9\x9\x9 \x9\x9 </ul>
\x9 \x9 \x9 \x9 \x9 </div>
\x9\x9 \x9\x9\x9 <form method="POST" id="mo-caw-api-creation-delete-form-";
echo esc_attr($Uq["connection_name"]) . "-" . esc_attr($Uq["method"]) . "-" . esc_attr($Qi);
echo "">\xa \x9 \x9\x9 \x9 \x9 \x9";
wp_nonce_field("MO_CAW_API_Creation_Delete", "MO_CAW_API_Creation_Nonce");
echo " \x9 \x9 \x9 \x9 \x9<input type="hidden" name="api-name" value="";
echo esc_attr($Uq["connection_name"]);
echo "">
\x9 \x9\x9 \x9 <input type="hidden" name="method" value="";
echo esc_attr($Uq["method"]);
echo "">\xa \x9\x9\x9\x9\x9 \x9 \x9\x9\x9<input type="hidden" name="namespace" value="";
echo esc_attr($Qi);
echo "">\xa\x9 \x9 \x9\x9\x9\x9 </form>\xa \x9 \x9 \x9\x9 </td>\xa\x9\x9 \x9\x9\x9\x9 </tr>
\x9\x9 \x9\x9 \x9 ";
Th:
}
e5:
echo " \x9\x9\x9 \x9 \x9\x9</tbody>
\x9\x9 \x9\x9\x9</table>\xa\x9 \x9\x9\x9 \x9</div>
\x9 \x9\x9 </div>\xa\x9\x9\x9\x9 </div>
\x9 ";
++$gZ;
echo " \x9";
UG:
}
du:
echo " \x9\x9 </div>
\x9\x9</div>
\x9 ";
j_:
echo " \x9";
}
private function display_api_creation_add_or_edit($gt)
{
global $wpdb;
global $wp_roles;
$zM = array();
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto d0;
}
$zM = DB_Utils::get_all_column_names($this->selected_table);
d0:
$Dv = $wpdb->get_results("SHOW TABLES");
$Ml = array();
foreach ($Dv as $gZ => $I4) {
foreach ($I4 as $gL) {
array_push($Ml, $gL);
N5:
}
lk:
T3:
}
sv:
$nt = $wp_roles->roles;
$Ra = array();
$i2 = array_keys($nt);
foreach ($nt as $gZ => $tW) {
array_push($Ra, $tW["name"]);
xP:
}
WA:
$ax = array("type" => Constants::GUI_ENDPOINT);
$mP = DB_Utils::get_all_namespaces($ax);
$iT = array();
foreach ($mP as $Qi) {
if (in_array($Qi->namespace, $iT, true)) {
goto cY;
}
array_push($iT, $Qi->namespace);
cY:
t9:
}
di:
$iZ = isset($_GET["test-mode"]) ? filter_var(sanitize_text_field(wp_unslash($_GET["test-mode"])), FILTER_VALIDATE_BOOLEAN) : false;
echo " \x9<form method="POST" id="mo-caw-custom-api-form" class="mo-caw-element-to-toggle mo-caw-light-mode">
\x9";
wp_nonce_field("MO_CAW_API_Creation", "MO_CAW_API_Creation_Nonce");
echo " \x9<input type="hidden" id="mo-caw-custom-api-test-mode" name="mo-caw-custom-api-test-mode" value="false">
\x9\x9\x9<div class="d-flex justify-content-between align-items-end mbl">\xa \x9 <h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">";
echo Constants::ADD === $gt ? "Create Custom API" : "Edit API - " . esc_attr($this->api_name);
echo "</h6>
\x9\x9\x9\x9<div class="d-grid gap-2 d-md-block">
\x9 \x9\x9\x9<button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 pxl mo-caw-element-to-toggle mo-caw-light-mode" type="button"
\x9 ";
if (!(Constants::DISABLED !== $this->license_status)) {
goto Dd;
}
echo esc_attr("onclick=moCawEnableTestMode()");
Dd:
echo " \x9\x9\x9";
echo esc_attr($this->license_status);
echo ">Test</button>\xa \x9 <button class="btn btn-primary mo-caw-rounded-16 mo-caw-bg-blue-dark px-4" id="mo-caw-custom-api-form-submit" type="submit" ";
echo esc_attr($this->license_status);
echo ">Save</button>
\x9\x9\x9</div>
\x9\x9\x9</div>
<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16">
\x9 \x9 <div class="mbk">\xa\x9\x9\x9\x9\x9<label for="mo-caw-custom-api-namespace" class="form-label mo-caw-form-label">Custom Namespace</label>\xa\x9 \x9\x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9\x9 <input type="text" class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pyi px-2" id="mo-caw-custom-api-namespace" name="mo-caw-custom-api-namespace" value="";
echo esc_attr($this->namespace);
echo "" placeholder="Custom Namespace (eg. mo/v1)" list="mo-caw-custom-api-namespace-list" pattern="^(?=.{1a5}$)[A-Za-z]+/v[0-9]+$" title="Namespace must be of max length 15 and contain at least one '/' in between, [A-Z, a-z] before '/', 'v' (denoting version) and numbers only after '/'" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">\xa \x9 \x9\x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto NE;
}
echo " \x9\x9\x9\x9 \x9<input type="hidden" name="mo-caw-custom-api-namespace" value="";
echo esc_attr($this->namespace);
echo "">
\x9\x9\x9\x9";
NE:
echo "\x9\x9 </div>
\x9 \x9 \x9<datalist id="mo-caw-custom-api-namespace-list">\xa \x9\x9 \x9 ";
foreach ($iT as $Qi) {
echo "\x9 \x9 \x9\x9<option value="";
echo esc_attr($Qi);
echo "">\xa \x9 \x9";
sO:
}
MP:
echo " \x9 </datalist>
\x9\x9</div>
\x9\x9<div class="row">
\x9 \x9\x9<div class="mb-3 col">
\x9 \x9 <label for="mo-caw-custom-api-name" class="form-label mo-caw-form-label">API Name</label>
\x9 \x9\x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode py-1 pxj" id="mo-caw-custom-api-name" name="mo-caw-custom-api-name" value="";
echo esc_attr($this->api_name);
echo "" placeholder="API Name" pattern="^(?=.{1,25}$)[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$" title="Should be of maximum length 25 and only '-' are accepted in between along with [A-Z, a-z and 0-9]" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">
\x9 \x9 \x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto D0;
}
echo "\x9 \x9 \x9\x9<input type="hidden" name="mo-caw-custom-api-name" value="";
echo esc_attr($this->api_name);
echo "">
\x9 \x9 ";
D0:
echo " \x9</div>\xa\x9\x9 \x9\x9<div class="mbk col">
\x9 \x9 <label for="mo-caw-custom-api-method" class="form-label mo-caw-form-label">Method <i class="fas fa-info rounded-circle border py-1 pxj" data-bs-toggle="tooltip" data-bs-placement="bottom" title="HTTP request method"></i></label>
\x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-method-selector" id="mo-caw-custom-api-method" name="mo-caw-custom-api-method" aria-label="#mo-caw-custom-api-method" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">\xa\x9 \x9\x9<option value="">Select Method</option>
\x9 <option value="get" ";
echo Constants::HTTP_GET === $this->method ? "selected" : '';
echo ">GET</option>
\x9 \x9\x9<option value="post" ";
echo Constants::HTTP_POST === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">POST</option>\xa \x9 \x9 \x9\x9<option value="put" ";
echo Constants::HTTP_PUT === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">PUT</option>\xa \x9\x9 \x9 <option value="delete" ";
echo Constants::HTTP_DELETE === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">DELETE</option>
</select>
\x9\x9 \x9\x9\x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto M3;
}
echo "\x9\x9 \x9\x9 \x9<input type="hidden" name="mo-caw-custom-api-method" value="";
echo esc_attr($this->method);
echo "">\xa\x9 \x9 ";
M3:
echo " \x9 \x9</div>\xa\x9 \x9</div>
\x9 \x9 <div class="row">
\x9 \x9 <div class="mbk col mo-caw-form-content d-none" request-methods="get post put delete">\xa\x9 \x9\x9\x9<label for="mo-caw-custom-api-table" class="form-label mo-caw-form-label">Table</label>\xa \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-table" name="mo-caw-custom-api-table" aria-label="#mo-caw-custom-api-method" aria-required="true" required onchange="moCawCustomApiGetTableColumns(this.value, '";
echo esc_attr(wp_create_nonce("mo_caw_get_columns_nonce"));
echo "', '";
echo esc_attr(Constants::CUSTOM_API_TAB);
echo "')">
\x9 \x9 \x9\x9 <option value="">Select Table</option>
\x9\x9\x9 \x9 ";
foreach ($Ml as $gL) {
echo " \x9 \x9<option value="";
echo esc_attr($gL);
echo "" ";
echo $gL === $this->selected_table ? "selected" : '';
echo ">";
echo esc_attr($gL);
echo "</option>
\x9\x9 \x9\x9\x9";
qU:
}
Rz:
echo " \x9 </select>\xa\x9\x9\x9 \x9</div>
\x9 \x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put">
\x9 <label for="mo-caw-custom-api-columns" class="form-label mo-caw-form-label">Request Columns</label>\xa \x9\x9<div class="dropdown">
\x9 \x9\x9 <button class="btn dropdown-toggle mo-caw-dropdown-toggle wi00 bg-white mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-text-grey-medium d-flex justify-content-between align-items-center" type="button" id="mo-caw-custom-api-columns-dropdown" data-bs-toggle="dropdown" aria-expanded="false">
\x9\x9\x9\x9 \x9\x9";
echo empty($this->request_columns) ? "Select Request Columns" : "Selected (" . count($this->request_columns) . ")";
echo " \x9 \x9 </button>
\x9\x9 \x9 <div class="dropdown-menu mo-caw-dropdown-menu w-100" aria-labelledby="mo-caw-custom-api-columns-dropdown">\xa\x9\x9 \x9\x9 <div class="form-check d-flex align-items-center justify-content-start p-2">\xa\x9 \x9 \x9<input class="form-check-input m-0 bg-white me-2 mo-caw-select-all-checkbox" type="checkbox" value="" id="mo-caw-custom-api-columns-select-all" data-target="mo-caw-custom-api-columns" ";
echo empty($this->selected_table) ? "hidden" : '';
echo " ";
echo count($this->request_columns) === count($zM) ? "checked" : '';
echo ">\xa\x9 \x9\x9 \x9 \x9\x9<label class="form-check-label" for="mo-caw-custom-api-columns-select-all">";
echo empty($this->selected_table) ? "Please select a table" : "Select All";
echo "</label>\xa\x9 \x9\x9 \x9\x9</div>
\x9\x9 \x9\x9\x9 ";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto eV;
}
echo "\x9 \x9\x9\x9 \x9 ";
foreach ($zM as $yS) {
echo " \x9\x9 \x9 \x9\x9\x9<div class="form-check d-flex align-items-center justify-content-start mo-caw-custom-api-columns-div p-2">
\x9\x9\x9 \x9\x9\x9 \x9<input class="form-check-input mh bg-white me-2 mo-caw-custom-api-columns" type="checkbox" value="";
echo esc_attr($yS);
echo "" id="mo-caw-custom-api-columns-";
echo esc_attr($yS);
echo "" name="mo-caw-custom-api-columns[]" ";
echo in_array($yS, $this->request_columns, true) ? "checked" : '';
echo ">\xa\x9\x9 \x9\x9\x9\x9\x9\x9 <label class="form-check-label" for="mo-caw-custom-api-columns-";
echo esc_attr($yS);
echo """>";
echo esc_attr($yS);
echo "</label>
\x9 \x9\x9\x9 \x9\x9\x9\x9</div>\xa\x9\x9\x9 \x9 \x9";
By:
}
ua:
echo "\x9 \x9\x9\x9\x9\x9";
eV:
echo " \x9 </div>
\x9\x9\x9\x9 </div>\xa\x9\x9 \x9</div>
\x9 \x9</div>
\x9 \x9<div class="accordion d-none" id="mo-caw-adv-setting-accordion">
\x9 \x9 <div class="accordion accordion-flush" id="mo-caw-custom-api-accordion-flush">
\x9<div class="accordion-item mb-2 borderh mo-caw-rounded-8 mo-caw-accordion-item mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9\x9\x9\x9<h2 class="accordion-header" id="mo-caw-custom-api-adv-settings-accordion-heading">
\x9 \x9\x9\x9\x9 \x9<button class="accordion-button collapsed mo-caw-bg-blue-light shadow-none mo-caw-rounded-8" type="button" data-bs-toggle="collapse" data-bs-target="#mo-caw-custom-api-adv-settings-accordion-collapse" aria-expanded="false" aria-controls="mo-caw-custom-api-adv-settings-accordion-collapse">
\x9 \x9Advance Settings
\x9 \x9\x9\x9\x9 </button>\xa\x9 \x9 </h2>
\x9 \x9\x9\x9 <div id="mo-caw-custom-api-adv-settings-accordion-collapse" class="accordion-collapse collapse" aria-labelledby="mo-caw-custom-api-adv-settings-accordion-heading" data-bs-parent="#mo-caw-custom-api-accordion-flush">
\x9 \x9\x9\x9\x9\x9<div class="accordion-body">
\x9\x9\x9 \x9 \x9<div class="row">
\x9\x9\x9 \x9\x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put delete">
\x9\x9\x9 \x9\x9\x9 \x9<label for="mo-caw-custom-api-response-format" class="form-label mo-caw-form-label">Response Type <i class="fas fa-info rounded-circle border py-1 px-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Send response in default or your custom format"></i></label>\xa\x9\x9 \x9 \x9\x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9 \x9 \x9\x9\x9 \x9<select class="mo-caw-crown-standard-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-response-type" name="mo-caw-custom-api-response-type" aria-label="#mo-caw-custom-api-method">\xa\x9 \x9 \x9\x9 \x9\x9 \x9<option value="default" ";
echo !isset($this->response["response_type"]) || Constants::DEFAULT === $this->response["response_type"] ? "selected" : '';
echo ">Default</option>\xa \x9 <option value="custom" ";
echo isset($this->response["response_type"]) && Constants::CUSTOM === $this->response["response_type"] ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan" >Custom Response</option>
\x9 \x9 \x9\x9 \x9</select>\xa \x9\x9 \x9\x9\x9\x9 </div>
\x9 \x9 \x9 </div>
\x9 \x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put delete">
\x9 \x9 \x9 \x9\x9 \x9<label for="mo-caw-custom-api-response-format" class="form-label mo-caw-form-label">Response Format</label>
\x9 \x9\x9\x9\x9\x9\x9<div class="d-flex justify-content-between align-items-center">
\x9\x9 \x9 \x9\x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-response-format" name="mo-caw-custom-api-response-format" aria-label="#mo-caw-custom-api-method">
\x9\x9 \x9 \x9 \x9 <option value="json" ";
echo !isset($this->response["response_content_type"]) || Constants::JSON === $this->response["response_content_type"] ? "selected" : '';
echo ">JSON</option>\xa \x9\x9 \x9 \x9\x9 \x9 \x9 <option value="xml" ";
echo isset($this->response["response_content_type"]) && Constants::XML === $this->response["response_content_type"] ? "selected" : '';
echo " aria-hidden="true" hidden >XML</option>\xa\x9\x9\x9\x9 \x9 \x9\x9\x9 </select>\xa\x9\x9\x9 \x9 \x9\x9 </div>
\x9 \x9 \x9 </div>\xa\x9\x9 \x9 \x9 \x9<div id="mo-caw-response-format-block" class="";
echo !isset($this->response["response_type"]) || Constants::DEFAULT === $this->response["response_type"] ? "d-none" : '';
echo "">\xa\x9\x9 \x9 \x9\x9 \x9\x9<ul class="nav nav-tabs nav-pills border-0 flex-column flex-sm-row text-center rounded">\xa \x9\x9\x9\x9\x9\x9 \x9<li class="nav-item mo-caw-bg-blue-light flex-sm-fill">\xa \x9 \x9 \x9\x9 \x9 <a class="nav-link active" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-success">Success</a>
\x9 \x9\x9 \x9 </li>\xa \x9\x9 \x9\x9<li class="nav-item mx-1 mo-caw-bg-blue-light flex-sm-fill">
\x9 \x9 \x9\x9 \x9\x9\x9<a class="nav-link" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-error">Error</a>\xa \x9 \x9 \x9</li>\xa \x9\x9 \x9 \x9\x9\x9<li class="nav-item mo-caw-bg-blue-light flex-sm-fill">\xa\x9 \x9\x9 \x9\x9 \x9 \x9<a class="nav-link" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-authentication">Authentication</a>
\x9 \x9 \x9\x9 </li>\xa\x9 \x9\x9 \x9\x9 \x9\x9</ul>
\x9 \x9\x9 \x9 \x9<div class="tab-content pbk">\xa \x9 \x9 \x9 \x9\x9 <div class="tab-pane active" id="mo-caw-custom-api-response-type-success">\xa\x9\x9\x9\x9 \x9\x9 \x9 <label for="mo-caw-custom-api-response-type-success-format"></label>\xa \x9 \x9\x9\x9\x9\x9 \x9 <textarea class="form-control" placeholder="{&#; "message": "success",&#; "data": "$response_data" }&3;&#;" id="mo-caw-custom-api-response-type-success-format" name="mo-caw-custom-api-response-type-success-format" rows="10">";
echo isset($this->response["response_content"]["success"]) && !empty($this->response["response_content"]["success"]) ? esc_attr($this->response["response_content"]["success"]) : '';
echo "</textarea>\xa \x9 \x9\x9 \x9\x9 </div>
\x9\x9\x9 \x9 \x9\x9 \x9<div class="tab-pane fade" id="mo-caw-custom-api-response-type-error">\xa \x9\x9 \x9 \x9\x9\x9 <label for="mo-caw-custom-api-response-type-error-format"></label>\xa\x9 \x9\x9 \x9 \x9 <textarea class="form-control" placeholder="{ &#; "message": "error", &0; "data": "$response_data"&3;&0;}&3;&0;" id="mo-caw-custom-api-response-type-error-format" name="mo-caw-custom-api-response-type-error-format" rows="">";
echo isset($this->response["response_content"]["error"]) && !empty($this->response["response_content"]["error"]) ? esc_attr($this->response["response_content"]["error"]) : '';
echo "</textarea>
\x9 \x9 \x9 \x9 \x9\x9</div>
\x9 \x9 <div class="tab-pane fade" id="mo-caw-custom-api-response-type-authentication">\xa\x9 \x9\x9 \x9\x9 \x9\x9<label for="mo-caw-custom-api-response-type-authentication-format"></label>\xa \x9 \x9 \x9 \x9 <textarea class="form-control" placeholder="{&3;&0; "message": "authentication_error", &0; "data": "$response_data" &#;}&#; " id="mo-caw-custom-api-response-type-authentication-format" name="mo-caw-custom-api-response-type-authentication-format" rows="">";
echo isset($this->response["response_content"]["authentication"]) && !empty($this->response["response_content"]["authentication"]) ? esc_attr($this->response["response_content"]["authentication"]) : '';
echo "</textarea>\xa \x9\x9\x9 \x9 \x9 \x9</div>
\x9 \x9 \x9 \x9</div>
\x9\x9 \x9\x9\x9\x9\x9 \x9</div>
\x9\x9\x9 \x9 \x9</div>
\x9\x9 \x9\x9 <div>\xa \x9 \x9\x9\x9 <div class="mb-3">
\x9 \x9\x9\x9\x9\x9 <label for="mo-caw-custom-api-allowed-roles" class="form-label mo-caw-form-label">Restrict role-based access</label>
\x9 \x9\x9\x9 \x9\x9 <div class="dropdown mo-caw-disable-standard-plan mo-caw-disable-eai-plan" >\xa\x9 \x9 \x9\x9\x9 \x9 \x9 <button class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan btn dropdown-toggle mo-caw-dropdown-toggle w-0 bg-white mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-text-grey-medium d-flex justify-content-between align-items-center" type="button" id="mo-caw-custom-api-allowed-roles-dropdown" data-bs-toggle="dropdown" aria-expanded="false" >\xa \x9\x9\x9\x9 \x9 ";
echo !empty($this->blocked_roles) ? "Selected (" . count($this->blocked_roles) . ")" : "Select Roles";
echo "\x9 \x9\x9\x9 \x9\x9 \x9 \x9</button>\xa\x9\x9\x9\x9 \x9 \x9\x9 <div class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan dropdown-menu mo-caw-dropdown-menu wi00" aria-labelledby="mo-caw-custom-api-allowed-roles-dropdown" >
\x9 \x9 \x9\x9\x9 \x9\x9<div class="form-check d-flex align-items-center p-2">
\x9 \x9 \x9 \x9\x9 <input class="form-check-input mh bg-white mo-caw-select-all-checkbox me-2" type="checkbox" value="" id="mo-caw-custom-api-allowed-roles-select-all" data-target="mo-caw-custom-api-allowed-roles" ";
echo count($this->blocked_roles) === count($i2) ? "checked" : '';
echo ">
\x9\x9\x9\x9\x9\x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-allowed-roles-select-all">Select All</label>\xa \x9\x9 \x9\x9\x9\x9 \x9 </div>\xa \x9\x9\x9 \x9\x9";
foreach ($i2 as $gZ => $al) {
echo " \x9\x9 \x9 \x9\x9\x9\x9\x9 <div class="form-check d-flex align-items-center pj">
\x9 \x9\x9 \x9 \x9\x9\x9 <input class="form-check-input m-0 bg-white mo-caw-custom-api-allowed-roles me-2" type="checkbox" value="";
echo esc_attr($al);
echo "" id="mo-caw-custom-api-allowed-roles-";
echo esc_attr($gZ);
echo "" name="mo-caw-custom-api-allowed-roles[]" ";
echo in_array($al, $this->blocked_roles, true) ? "checked" : '';
echo ">\xa \x9 \x9 \x9\x9 \x9 \x9\x9<label class="form-check-label" for="mo-caw-custom-api-allowed-roles-";
echo esc_attr($gZ);
echo "">";
echo esc_attr($Ra[$gZ]);
echo "</label>\xa\x9\x9 \x9 \x9 \x9</div>
\x9 \x9 \x9\x9 \x9\x9\x9 ";
I9:
}
bb:
echo "\x9 \x9\x9 \x9 </div>
\x9\x9 \x9\x9\x9\x9\x9 \x9 </div>\xa \x9\x9 \x9\x9 </div>\xa \x9\x9 \x9\x9\x9\x9 <div class="row mo-caw-form-content d-none" request-methods="get">\xa \x9 \x9\x9\x9<label class="form-label mo-caw-form-label">Filters <em>(Based on Order)</em></label>
\x9 \x9\x9 <div class="mb-3 col">
\x9\x9\x9 \x9 \x9\x9\x9\x9 <div class="d-flex justify-content-between align-items-center">
\x9\x9 \x9\x9\x9\x9 \x9\x9<select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-filter" name="mo-caw-custom-api-common-filter-filter" aria-label="#mo-caw-custom-api-common-filter-filter" >
\x9 \x9\x9\x9\x9 \x9\x9\x9 <option value="">Filter</option>\xa\x9 \x9\x9 \x9 \x9 <option value="orderby" selected>Order By</option>
\x9 \x9\x9\x9 \x9 </select>\xa\x9\x9\x9 \x9\x9 \x9 </div>\xa \x9\x9\x9\x9 \x9\x9 </div>
\x9\x9 \x9 \x9\x9\x9\x9 <div class="mb-3 col">
\x9 \x9 \x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9 \x9<select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-column" name="mo-caw-custom-api-common-filter-column" aria-label="#mo-caw-custom-api-common-filter-column" >
\x9\x9 \x9 \x9 \x9\x9\x9 <option value="">Column</option>\xa \x9 \x9\x9\x9\x9";
if (!("edit" === $gt)) {
goto HE;
}
echo " \x9 \x9 \x9 \x9\x9\x9 ";
foreach ($zM as $yS) {
echo " \x9\x9\x9\x9\x9\x9 \x9\x9\x9 \x9\x9 <option class="mo-caw-custom-api-common-filter-column-option" value="";
echo esc_attr($yS);
echo "" ";
echo isset($this->common_filters["orderby"]["column"]) && $yS === $this->common_filters["orderby"]["column"] ? "selected" : '';
echo ">";
echo esc_attr($yS);
echo "</option>\xa \x9 \x9 \x9\x9 \x9 \x9";
K3:
}
Q6:
echo " \x9 \x9\x9\x9 \x9\x9\x9\x9 ";
HE:
echo "\x9 \x9\x9\x9\x9\x9\x9 </select>
\x9\x9 \x9 \x9 \x9\x9 </div>
\x9\x9 \x9 \x9 </div>
\x9 \x9 \x9\x9 \x9\x9 <div class="mb-3 col">
\x9\x9\x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9\x9\x9\x9\x9 \x9 <select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-order" name="mo-caw-custom-api-common-filter-order" aria-label="#mo-caw-custom-api-common-filter-order" >\xa\x9 \x9 \x9\x9 \x9\x9 <option value="">Order</option>
\x9 \x9\x9 \x9 \x9\x9 \x9\x9<option value="asc" ";
echo isset($this->common_filters["orderby"]["option"]) && "asc" === $this->common_filters["orderby"]["option"] ? "selected" : '';
echo ">Ascending</option>\xa \x9\x9\x9 \x9 \x9\x9 \x9<option value="desc" ";
echo isset($this->common_filters["orderby"]["option"]) && "desc" === $this->common_filters["orderby"]["option"] ? "selected" : '';
echo ">Descending</option>\xa \x9 \x9\x9\x9 \x9 \x9 </select>\xa \x9 \x9 \x9\x9 </div>\xa\x9 \x9 \x9\x9 \x9\x9\x9</div>\xa\x9 \x9 \x9 \x9 \x9</div>\xa\x9\x9 \x9\x9 \x9\x9\x9</div>\xa \x9 \x9 \x9<div>\xa\x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center mb-2 mo-caw-form-content d-none" request-methods="get put delete">\xa\x9 \x9\x9 \x9\x9 <label class="form-label mo-caw-form-label">Filters <em>(Based on column, condition and parameter)</em></label>\xa \x9\x9 \x9\x9 \x9\x9<span>\xa\x9 \x9 \x9 \x9\x9<button class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip border-0 bg-white p-0" type="button" onclick="moCawAddField('gui', 'mo-caw-custom-api-value-specific-filter-duplicate-div-0', 'mo-caw-custom-api-value-specific-filter-duplicate-div-', this.nextElementSibling)" ><i class="fa-solid fa-plus mo-caw-text-grey-medium border border-3 rounded p-1"></i></button>\xa \x9 \x9 \x9<button class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip border-0 bg-white ph" type="button" onclick="moCawRemoveField('mo-caw-custom-api-value-specific-filter-duplicate-div-', this)" ><i class="fa-solid fa-minus mo-caw-text-grey-medium border border-3 rounded p-1"></i></button>\xa \x9\x9\x9\x9\x9\x9 \x9 </span>
\x9 \x9\x9 \x9\x9 </div>
\x9\x9 \x9 \x9\x9";
if (!empty($this->value_specific_filter["filter_details"])) {
goto d6;
}
echo " \x9\x9 \x9 \x9<div class="row" id="mo-caw-custom-api-value-specific-filter-duplicate-div-0">\xa \x9\x9 \x9 \x9\x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa\x9\x9\x9\x9 \x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9\x9 \x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-custom-api-specific-filter-column" id="mo-caw-custom-api-specific-filter-column" name="mo-caw-custom-api-specific-filter-column[]" aria-label="#mo-caw-custom-api-specific-filter-column">\xa\x9 \x9 \x9\x9 \x9\x9 \x9 <option value="">Column</option>\xa\x9\x9 \x9 \x9\x9\x9\x9\x9\x9 \x9\x9";
if (!("edit" === $gt)) {
goto mX;
}
echo " \x9\x9\x9 \x9\x9 \x9\x9\x9 ";
foreach ($zM as $yS) {
echo " \x9\x9 \x9 \x9 \x9\x9<option class="mo-caw-custom-api-specific-filter-column-option" value="";
echo esc_attr($yS);
echo "">";
echo esc_attr($yS);
echo "</option>
\x9\x9 \x9\x9 ";
cL:
}
Bj:
echo "\x9 \x9\x9 \x9 \x9\x9 \x9\x9\x9";
mX:
echo " \x9\x9 \x9\x9\x9\x9 \x9</select>
\x9 \x9\x9\x9 \x9 \x9 </div>
\x9\x9\x9\x9 \x9 \x9\x9\x9</div>\xa\x9\x9 \x9\x9 \x9 \x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa \x9 \x9\x9\x9 \x9 \x9<div class="d-flex justify-content-between align-items-center">\xa \x9 \x9\x9\x9 \x9\x9\x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-specific-filter-condition" name="mo-caw-custom-api-specific-filter-condition[]" aria-label="#mo-caw-custom-api-specific-filter-condition">\xa \x9 \x9 \x9\x9\x9<option value="">Condition</option>
\x9\x9 \x9\x9\x9 <option value="like">Like</option>\xa \x9\x9 \x9\x9\x9\x9 <option value="not-like">Not Like</option>
\x9\x9 \x9\x9 \x9 \x9\x9\x9 <option value="=">Equal</option>
\x9 \x9 \x9 \x9\x9\x9 <option value="!=">Not Equal</option>
\x9\x9 \x9 \x9\x9 \x9 \x9<option value=">">Greater Than</option>
\x9 \x9 \x9 \x9 <option value="<">Less Than</option>
\x9\x9 \x9\x9\x9\x9 \x9 </select>
\x9\x9 \x9\x9 \x9 \x9</div>
\x9 \x9 \x9\x9 \x9</div>\xa \x9\x9 \x9 \x9\x9\x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get">
\x9 \x9 \x9 \x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9\x9\x9 \x9\x9\x9 <input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pt-1 px-2" id="mo-caw-custom-api-specific-filter-parameter-get-0" name="mo-caw-custom-api-specific-filter-parameter-get[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-get-0" value="";
echo "Position - 1";
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the position of parameter in the API request" placeholder="Parameter position in request URL" aria-readonly="true" readonly>
\x9\x9 \x9\x9 </div>
\x9\x9\x9\x9 \x9 \x9</div>
\x9\x9\x9\x9\x9 \x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="put">
\x9\x9 \x9 \x9\x9\x9 \x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9 \x9 \x9 \x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pti px-2" id="mo-caw-custom-api-specific-filter-parameter-put-0" name="mo-caw-custom-api-specific-filter-parameter-put[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-puth" value="";
echo "column_param1";
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the name of parameter in the API request" placeholder="Parameter name in request URL">\xa\x9 \x9\x9\x9 \x9 \x9</div>\xa\x9\x9\x9 \x9\x9 \x9\x9\x9 \x9</div>\xa\x9 \x9\x9\x9\x9 \x9\x9\x9\x9</div>\xa\x9 \x9 \x9\x9 \x9\x9";
goto wy;
d6:
echo " \x9 \x9 \x9\x9 \x9 ";
$BV = count($this->value_specific_filter["filter_details"]);
echo "\x9 \x9\x9 \x9 \x9\x9\x9";
foreach ($this->value_specific_filter["filter_details"] as $gZ => $qe) {
echo " \x9 \x9 \x9 \x9 <div class="row" id="mo-caw-custom-api-value-specific-filter-duplicate-div-";
echo esc_attr($gZ);
echo "">\xa \x9\x9 \x9\x9 \x9 ";
if (!(1 <= $BV && 1 <= $gZ)) {
goto m9;
}
echo " \x9 \x9 \x9\x9\x9 \x9 <div class="d-flex justify-content-center mbk mo-caw-form-content d-none" request-methods="get put delete">
\x9\x9\x9\x9\x9 \x9 \x9\x9\x9\x9 <input type="hidden" name="mo-caw-custom-api-specific-filter-operator[]" value="";
echo esc_attr($this->value_specific_filter["filter_relation"][$gZ - 1]);
echo "" />
\x9\x9\x9\x9\x9\x9 \x9 \x9<button class="btn mo-caw-bg-grey-light mo-caw-text-grey-medium border-0" type="button" id="mo-custom-api-specific-filter-operator-";
echo esc_attr($gZ - 1);
echo "" onclick="moCawToggleOperation(this)">";
echo esc_attr(strtoupper($this->value_specific_filter["filter_relation"][$gZ - 1]));
echo " <i class="fa-solid fa-arrows-rotate"></i></button>
\x9 \x9 \x9 \x9\x9\x9\x9 </div>\xa \x9 \x9\x9\x9\x9 \x9\x9\x9";
m9:
echo "\x9\x9\x9 \x9\x9 \x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">
\x9\x9 \x9\x9\x9\x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9 \x9 \x9\x9 \x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-custom-api-specific-filter-column" id="mo-caw-custom-api-specific-filter-column" name="mo-caw-custom-api-specific-filter-column[]" aria-label="#mo-caw-custom-api-specific-filter-column">\xa \x9\x9 \x9 \x9 \x9\x9 \x9\x9<option value="">Column</option>\xa \x9\x9\x9\x9 \x9 \x9 \x9 \x9\x9";
foreach ($zM as $yS) {
echo "\x9\x9\x9\x9\x9 \x9 \x9\x9\x9 \x9\x9<option class="mo-caw-custom-api-specific-filter-column-option" value="";
echo esc_attr($yS);
echo "" ";
echo $yS === $qe["column"] ? "selected" : '';
echo ">";
echo esc_attr($yS);
echo "</option>\xa \x9 \x9 \x9 \x9 \x9 ";
ha:
}
FY:
echo " \x9 \x9\x9\x9 \x9 \x9 </select>
\x9\x9\x9 \x9 \x9\x9\x9 </div>
\x9\x9\x9 \x9 \x9\x9\x9 </div>
\x9 \x9\x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa\x9\x9 \x9\x9\x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-specific-filter-condition" name="mo-caw-custom-api-specific-filter-condition[]" aria-label="#mo-caw-custom-api-specific-filter-condition">\xa\x9\x9\x9\x9\x9\x9\x9 \x9\x9\x9\x9\x9\x9 \x9<option value="">Condition</option>
\x9\x9\x9\x9 \x9\x9\x9\x9 \x9 \x9\x9\x9<option value="like" ";
echo "like" === $qe["condition"] ? "selected" : '';
echo ">Like</option>\xa \x9 \x9\x9\x9 \x9 <option value="not-like" ";
echo "not-like" === $qe["condition"] ? "selected" : '';
echo ">Not Like</option>\xa \x9 \x9\x9 \x9 \x9 <option value="=" ";
echo "=" === $qe["condition"] ? "selected" : '';
echo ">Equal</option>
\x9 \x9 \x9 \x9\x9\x9 <option value="!=" ";
echo "!=" === $qe["condition"] ? "selected" : '';
echo ">Not Equal</option>\xa \x9\x9\x9 \x9\x9\x9 \x9 <option value=">" ";
echo ">" === $qe["condition"] ? "selected" : '';
echo ">Greater Than</option>\xa\x9 \x9\x9 \x9 \x9\x9 \x9<option value="<" ";
echo "<" === htmlspecialchars_decode($qe["condition"]) ? "selected" : '';
echo ">Less Than</option>\xa \x9\x9 \x9 \x9 \x9\x9 \x9</select>
\x9\x9\x9\x9\x9\x9 \x9\x9 \x9</div>
\x9 \x9 \x9 \x9 \x9 </div>
\x9 \x9 \x9 \x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get">
\x9\x9 \x9 \x9 \x9 \x9 <div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pti pxj" id="mo-caw-custom-api-specific-filter-parameter-get-";
echo esc_attr($gZ++);
echo "" name="mo-caw-custom-api-specific-filter-parameter-get[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-get" value="";
echo isset($qe["parameter"]) ? esc_attr("Position - " . $qe["parameter"]) : "Position - " . esc_attr($gZ++);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the position of parameter in the API request" placeholder="Parameter position in request URL" aria-readonly="true" readonly>\xa \x9\x9\x9 \x9 \x9 \x9 </div>\xa \x9 \x9\x9\x9 \x9 \x9 </div>
\x9 \x9\x9\x9 <div class="mbk col mo-caw-form-content d-none" request-methods="put">
\x9\x9 \x9\x9 \x9\x9\x9\x9<div class="d-flex justify-content-between align-items-center">
\x9 \x9 \x9\x9\x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pt-1 pxj" id="mo-caw-custom-api-specific-filter-parameter-put-";
echo esc_attr($gZ++);
echo "" name="mo-caw-custom-api-specific-filter-parameter-put[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-put" value="";
echo isset($qe["parameter"]) ? esc_attr($qe["parameter"]) : "column_param" . esc_attr($gZ++);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the name of parameter in the API request" placeholder="Parameter name in request URL">
\x9 \x9\x9 \x9\x9\x9\x9 \x9 \x9</div>\xa \x9 \x9 \x9 </div>
\x9 \x9\x9 \x9 \x9</div>
\x9 \x9\x9\x9 \x9\x9 \x9 ";
R5:
}
zV:
echo " \x9 \x9\x9 ";
wy:
echo " \x9\x9\x9\x9 </div>\xa \x9 \x9\x9</div>
\x9\x9 \x9\x9\x9</div>
\x9 \x9</div>
\x9\x9 </div>
\x9\x9 </div>
</div>\xa \x9</form>
\x9\x9<div class="modal fade mo-caw-export-modal" id="mo-caw-custom-api-test-inputs-modal" tabindex="i" aria-labelledby="mo-caw-custom-api-test-inputs-modal-label" aria-hidden="true">\xa \x9 <div class="modal-dialog modal-dialog-centered justify-content-center">\xa\x9\x9\x9\x9<form method="POST" id="mo-caw-custom-api-test-inputs-form">
\x9 <div class="modal-content">
\x9\x9\x9\x9\x9 <div class="modal-header">
\x9\x9\x9 <h5 class="modal-title" id="mo-caw-custom-api-test-inputs-modal-label">Values to run test</h5>\xa \x9\x9 \x9 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
\x9 \x9 \x9</div>\xa\x9 \x9<div class="modal-body">\xa\x9\x9\x9\x9\x9 </div>\xa \x9\x9\x9 <div class="modal-footer d-md-flex justify-content-md-center">\xa\x9 \x9 <button class="btn btn-primary mo-caw-bg-blue-medium mo-caw-rounded-" type="button" onclick="moCawGetCustomAPITestResult('";
echo esc_attr(site_url());
echo "')">Continue</button>\xa \x9 \x9 </div>
\x9 </div>\xa\x9 \x9</form>
\x9\x9</div>
\x9</div>\xa\x9\x9";
if (!$iZ) {
goto lX;
}
echo "\x9\x9\x9<div class="d-flex justify-content-between align-items-end my-4">\xa <div class="d-flex justify-content-center align-items-baseline">
\x9<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Test Results</h6>
\x9\x9 \x9<span class="msj badge rounded-pill" id="mo-caw-custom-api-test-result-status"></span>
\x9\x9\x9\x9</div>
\x9 \x9</div>\xa\x9\x9\x9<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16 mo-caw-test-result" id="mo-caw-custom-api-test-result">
\x9 </div>
\x9 ";
lX:
echo "\x9 ";
}
private function display_api_creation_view()
{
$G8 = site_url() . "/wp-json/" . $this->namespace . "/" . $this->api_name;
if (Constants::HTTP_GET === $this->method) {
goto M7;
}
if (Constants::HTTP_DELETE === $this->method) {
goto Ta;
}
goto l0;
M7:
if (empty($this->value_specific_filter["filter_details"])) {
goto yo;
}
$qe = $this->value_specific_filter["filter_details"];
$rS = array();
foreach ($qe as $FK) {
$rS[$FK["parameter"]] = $FK["column"];
F3:
}
T9:
ksort($rS);
foreach ($rS as $Tw) {
$G8 = $G8 . "/<" . $Tw . ">";
ei:
}
Me:
yo:
goto l0;
Ta:
if (empty($this->value_specific_filter["filter_details"])) {
goto ra;
}
$qe = $this->value_specific_filter["filter_details"];
$EA = array();
foreach ($qe as $FK) {
$EA[$FK["column"]] = "<" . $FK["column"] . ">";
w8:
}
Gi:
$G8 = add_query_arg($EA, $G8);
ra:
l0:
echo "\xa \x9<div class="d-flex justify-content-between align-items-end mb-4">
\x9<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">";
echo "View API - " . esc_attr($this->api_name);
echo "</h6>\xa\x9 \x9<div class="d-grid gap-2 d-md-block">
\x9 \x9
\x9 \x9<button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded- mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="submit" aria-hidden="true" hidden>Export Postman Collection</button>\xa\x9 \x9\x9<a class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 px-4 mo-caw-element-to-toggle mo-caw-light-mode ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=test&api-name=" . $this->api_name . "&method=" . $this->method . "&namespace=" . $this->namespace . "&test-mode=true", "MO_CAW_API_Creation_Test_Nonce"));
echo "">Test</a>\xa \x9<a class="btn btn-primary mo-caw-rounded-16 mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=edit&api-name=" . $this->api_name . "&method=" . $this->method . "&namespace=" . $this->namespace, "MO_CAW_API_Creation_Edit_Nonce"));
echo "">Edit API</a>\xa\x9\x9 </div>
\x9 </div>\xa <div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16">\xa \x9 <div class="input-group mb-3">
\x9 \x9<span class="input-group-text mo-caw-";
echo esc_attr($this->method);
echo "-method borderh fs-6 px-3">";
echo esc_attr(strtoupper($this->method));
echo "</span>\xa \x9 <input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode border-endh border-start-0 bg-white fsn" aria-label="" placeholder="https://<your_domain>/wp-json/<namespace>/<api-name>?<params>" value="";
echo esc_attr($G8);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Any parameters enclosed within <> should be replaced with actual values" aria-readonly="true" readonly> \xa\x9 \x9 <span class="input-group-text bg-white mo-caw-cursor-pointer fs-6 mo-caw-copy-icon" data-bs-toggle="tooltip" data-bs-placement="right" title="Copy API Endpoint"><i class="far fa-copy fa-lg"></i></span>
\x9</div>
\x9\x9\x9";
if (!(!empty($this->value_specific_filter) && isset($this->value_specific_filter["filter_details"]))) {
goto Sl;
}
echo "\x9\x9 <div class="mt-4">
\x9 \x9\x9 <h6 class="mb-3 mo-caw-element-to-toggle mo-caw-light-mode">Request Format</h6>\xa \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 <thead>\xa\x9 \x9\x9\x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3 align-middle">Column Name</th>
\x9\x9\x9 \x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Description</th>
\x9 \x9 \x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Condition Applied</th>
\x9\x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3 align-middle mo-caw-form-content d-none" request-methods="get">Parameter place in API</th>\xa \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle mo-caw-form-content d-none" request-methods="get">Operator if any</th>\xa\x9 \x9 \x9\x9</tr>
\x9 </thead>
\x9\x9\x9\x9 <tbody>
\x9 ";
foreach ($this->value_specific_filter["filter_details"] as $gZ => $FK) {
echo " \x9\x9 \x9\x9 <tr>\xa \x9\x9 \x9\x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr($FK["column"]);
echo " </td>
\x9\x9\x9\x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Enter data of respective column in mentioned parameter</td>
\x9 \x9\x9\x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle">";
echo esc_attr($FK["condition"]);
echo "</td>
\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle mo-caw-form-content d-none" request-methods="get">";
echo esc_attr($FK["parameter"]);
echo "</td>\xa \x9\x9 \x9 \x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle mo-caw-form-content d-none" request-methods="get">";
echo isset($this->value_specific_filter["filter_relation"]) && !empty($this->value_specific_filter["filter_relation"][$gZ]) ? esc_attr(strtoupper($this->value_specific_filter["filter_relation"][$gZ])) : "None";
echo "</td>
\x9\x9\x9 \x9\x9</tr>\xa \x9\x9\x9 ";
lg:
}
Jx:
echo " \x9</tbody>
\x9 \x9 </table>\xa\x9 \x9\x9</div>
\x9 ";
Sl:
echo "\x9\x9 ";
if (empty($this->common_filters)) {
goto tx;
}
echo "\x9 \x9\x9<div class="mt-4">\xa\x9\x9 <h6 class="mbk mo-caw-element-to-toggle mo-caw-light-mode">Filters</h6>\xa \x9\x9\x9 <table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9<thead>\xa \x9\x9 \x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9\x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Filters Applied</th>\xa \x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Column Name</th>\xa\x9 \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Order</th>\xa\x9 \x9 \x9 </tr>\xa \x9 </thead>\xa \x9\x9 <tbody>
\x9\x9\x9\x9\x9 <tr>
\x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Order By</td>
\x9 \x9 \x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr($this->common_filters["orderby"]["column"]);
echo "</td>\xa\x9 \x9 \x9\x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr(ucfirst($this->common_filters["orderby"]["option"]));
echo "</td>\xa\x9 \x9 \x9</tr>\xa\x9 </tbody>
\x9\x9 \x9</table>
\x9 </div>\xa\x9 \x9";
tx:
echo " \x9";
if (!(Constants::HTTP_POST === $this->method || Constants::HTTP_PUT === $this->method)) {
goto j0;
}
$o_ = $this->request_columns;
$t2 = array_fill_keys($o_, "value");
$vC = wp_json_encode($t2, JSON_PRETTY_PRINT);
echo "\x9\x9 <h6 class="mb-3 mo-caw-element-to-toggle mo-caw-light-mode">Required parameters for Custom APIs</h6>\xa\x9\x9\x9<div id="mo-caw-external-api-request-format-block">
\x9\x9\x9\x9<ul class="nav nav-tabs nav-pills border-0 flex-column flex-sm-row text-center rounded mb-2">
\x9 \x9 <li class="nav-item mo-caw-bg-blue-light flex-sm-fill coln">\xa\x9\x9\x9 <a class="nav-link active" data-bs-toggle="tab" href="#mo-caw-external-api-request-format-x-www">X-WWW-FORM-URLENCODED</a>\xa \x9\x9</li>\xa\x9\x9 \x9 <li class="nav-item mo-caw-bg-blue-light flex-sm-fill col-6">\xa\x9 \x9 \x9 <a class="nav-link" data-bs-toggle="tab" href="#mo-caw-external-api-request-format-json">JSON</a>\xa\x9 \x9\x9 </li>\xa\x9 \x9 </ul>
\x9\x9 </div>\xa \x9<div class="tab-content pbk">
\x9\x9 <div class="tab-pane active" id="mo-caw-external-api-request-format-x-www">\xa \x9\x9<div>
\x9\x9\x9 \x9 <table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9<thead>
\x9 \x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9 \x9\x9\x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 pk align-middle">Header Name</th>
\x9\x9\x9\x9\x9\x9\x9 <th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3 align-middle">Header Value</th>\xa\x9 \x9 </tr>
\x9 \x9 </thead>
\x9 \x9<tbody>
\x9 \x9\x9 \x9 <tr>
\x9 \x9 \x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using POST/PUT method with x-www-form-urlencoded format">Content-Type</td>
\x9 \x9 \x9<td class="col-md-3 borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_html(Constants::X_WWW_HEADER_NAME);
echo "</td>
\x9 \x9 \x9</tr>
\x9\x9 \x9\x9\x9</tbody>\xa\x9\x9 \x9\x9</table>\xa \x9<div class="overflow-auto mh-50 mo-caw-table-wrapper" >\xa\x9 \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9\x9\x9 \x9\x9<thead class="sticky-top">
\x9\x9\x9 \x9\x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9 \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Body Parameter Name</th>\xa \x9\x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3 align-middle">Body Parameter Value</th>
\x9 \x9 </tr>\xa\x9\x9\x9 \x9\x9\x9 </thead>
\x9\x9\x9\x9\x9 \x9<tbody>\xa\x9\x9\x9 \x9\x9 \x9 ";
foreach ($this->request_columns as $O0 => $I4) {
echo "\x9 \x9 \x9\x9 \x9\x9<tr>\xa\x9\x9 \x9\x9 \x9\x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using x-www-form-urlencoded format">";
echo esc_html($I4);
echo " </td>
\x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Column Value</td>\xa\x9 \x9\x9\x9\x9 </tr>
\x9 \x9\x9\x9\x9";
WW:
}
S0:
echo "\x9\x9\x9\x9\x9 </tbody>
\x9 \x9 \x9\x9 </table>
\x9\x9 \x9 </div>
\x9\x9 </div>
\x9\x9\x9</div>\xa\x9\x9 \x9<div class="tab-pane fade" id="mo-caw-external-api-request-format-json">
\x9\x9 <div>\xa\x9 \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9 \x9 <thead>\xa\x9\x9\x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9\x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Header Name</th>
\x9\x9 \x9\x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Header Value</th>
\x9 \x9\x9 \x9\x9\x9</tr>\xa \x9\x9\x9\x9 </thead>\xa\x9 \x9 \x9 <tbody>
\x9\x9\x9 \x9 \x9\x9<tr>\xa \x9 \x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using POST/PUT method with application/json format">Content-Type</td>
\x9\x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_html(Constants::JSON_HEADER_NAME);
echo "</td>\xa \x9 \x9 \x9</tr>
\x9\x9\x9\x9 </tbody>\xa\x9\x9\x9\x9\x9 </table>\xa\x9\x9 \x9\x9<table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9\x9 <thead>\xa \x9\x9 \x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9\x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Body</th>\xa\x9\x9 \x9\x9\x9\x9\x9</tr>
</thead>
\x9\x9\x9\x9\x9\x9</table>
\x9\x9 \x9\x9\x9<div>
\x9 \x9\x9\x9 \x9<textarea class="form-control mo-caw-form-control py-1" id="mo-caw-external-api-json-body" name="mo-caw-external-api-json-body" placeholder="Add JSON body" rows="10">";
echo esc_attr($vC);
echo "</textarea>
\x9 \x9\x9</div>\xa \x9 \x9</div>\xa\x9 \x9\x9</div>
\x9 </div>\xa\x9 ";
j0:
echo "\x9\x9 <div class="mt-4">
\x9\x9\x9<h6 class="mbk mo-caw-element-to-toggle mo-caw-light-mode">Request parameters for Pagination <em class="fw-normal">(Optional)</em></h6>\xa \x9\x9 <table class="table text-center fsn border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9<thead>\xa \x9\x9\x9\x9\x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9 \x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Parameter Name</th>\xa \x9 \x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Description</th>\xa \x9 </tr>\xa \x9 </thead>\xa\x9 \x9 <tbody>\xa\x9\x9 \x9 <tr>\xa \x9 \x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using pagination">size</td>
\x9\x9\x9\x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Defines page size</td>
\x9</tr>
\x9\x9\x9\x9\x9\x9<tr>
\x9\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Optional in pagination">page</td>\xa\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Page number needed in the response <em>(starts from)</em></td>
\x9\x9 </tr>\xa \x9 \x9\x9\x9<tr>
\x9\x9\x9\x9<td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Optional in pagination">offset</td>
\x9\x9\x9 <td class="col-md-3 borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Defines from which count number to start returning data <em>(starts from 1)</em></td>
\x9 \x9</tr>\xa \x9 \x9</tbody>\xa \x9 </table>\xa </div>
\x9 </div>\xa \x9<div class="d-flex justify-content-between align-items-end my-4 d-none"> \xa\x9\x9 <h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Code Snippets</h6>
<div class="dropdown">
\x9 <button class="btn mo-caw-btn-outline-blue-medium dropdown-toggle mo-caw-rounded- mo-caw-dropdown-toggle mo-caw-element-to-toggle mo-caw-light-mode" type="button" id="mo-caw-custom-api-test-result-dropdown" data-bs-toggle="dropdown" aria-expanded="false" ";
echo esc_attr($this->license_status);
echo ">
\x9\x9 \x9\x9Select Language
</button>\xa \x9\x9\x9<ul class="dropdown-menu mo-caw-dropdown-menu" aria-labelledby="mo-caw-custom-api-test-result-dropdown">\xa\x9\x9\x9 <li><a class="dropdown-item" href="#">Node.js</a></li>
\x9 \x9 <li><a class="dropdown-item" href="#">PHP</a></li>
\x9 \x9<li><a class="dropdown-item" href="#">Python</a></li>
\x9 </ul>\xa\x9 \x9</div>
\x9\x9</div>
<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16 d-none">
\x9<pre>\xa \x9 const axios = require('axios');
\x9 const url = 'http://localhost/wp_1/wp-json/mo/v1/bghfx/{args}/{attempts}';
\x9\x9 \x9axios.get(url)
\x9 \x9 .then(response => {\xa \x9\x9\x9 console.log(response.data);
\x9\x9\x9 })
\x9 .catch(error => {\xa console.error('Request failed:', error);
\x9 \x9 });\xa\x9\x9 </pre>
\x9 </div>
\x9 ";
}
private function display_api_creation_export()
{
}
}
namespace MO_CAW\Common\Views;
use MO_CAW\Common\Utils;
use MO_CAW\Common\DB_Utils;
use MO_CAW\Common\Constants;
class API_Creation
{
private $api_name = '';
private $namespace = "mo/v1";
private $method = Constants::HTTP_GET;
private $selected_table = '';
private $request_columns = array();
private $response = array();
private $blocked_roles = array();
private $common_filters = array();
private $value_specific_filter = array();
private $gui_endpoint_config = array();
protected $license_status = '';
public function __construct($gt)
{
if (!(isset($_GET["_wpnonce"]) && check_admin_referer("MO_CAW_API_Creation_" . ucfirst($gt) . "_Nonce", "_wpnonce"))) {
goto cm;
}
$DT = isset($_SESSION["MO_CAW_API_Creation_Form_Data"]) ? wp_unslash($_SESSION["MO_CAW_API_Creation_Form_Data"]) : array();
Utils::sanitize_nested_array($DT);
$this->gui_endpoint_config = !empty($DT) ? $DT : $this->gui_endpoint_config;
if ((Constants::EDIT === $gt || Constants::VIEW === $gt || Constants::TEST === $gt || Constants::DELETE === $gt) && Constants::DISABLED !== $this->license_status) {
goto W0;
}
if (Constants::ADD === $gt && Constants::DISABLED !== $this->license_status) {
goto KD;
}
goto Si;
W0:
$this->api_name = isset($_GET["api-name"]) ? sanitize_text_field(wp_unslash($_GET["api-name"])) : $this->api_name;
$this->method = isset($_GET["method"]) ? sanitize_text_field(wp_unslash($_GET["method"])) : $this->method;
$this->namespace = isset($_GET["namespace"]) ? sanitize_text_field(wp_unslash($_GET["namespace"])) : $this->namespace;
$UK = array("connection_name" => $this->api_name, "type" => Constants::GUI_ENDPOINT, "method" => $this->method, "namespace" => $this->namespace);
$this->gui_endpoint_config = empty($this->gui_endpoint_config) ? DB_Utils::get_configuration($UK)[0] : $this->gui_endpoint_config;
goto Si;
KD:
$this->namespace = $this->gui_endpoint_config["namespace"] ?? $this->namespace;
$this->method = $this->gui_endpoint_config["method"] ?? $this->method;
$this->api_name = $this->gui_endpoint_config["connection_name"] ?? $this->api_name;
Si:
$this->selected_table = $this->gui_endpoint_config["configuration"]["table"] ?? $this->selected_table;
$this->request_columns = $this->gui_endpoint_config["configuration"]["request_columns"] ?? $this->request_columns;
$this->response = $this->gui_endpoint_config["configuration"]["response"] ?? $this->response;
$this->blocked_roles = $this->gui_endpoint_config["configuration"]["blocked_roles"] ?? $this->blocked_roles;
$this->common_filters = $this->gui_endpoint_config["configuration"]["common_filters"] ?? $this->common_filters;
$this->value_specific_filter = $this->gui_endpoint_config["configuration"]["value_specific_filter"] ?? $this->value_specific_filter;
cm:
}
public function display_api_creation_ui($Z5, $gt)
{
switch ($gt) {
case Constants::ADD:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case Constants::VIEW:
$this->display_api_creation_view();
goto wL;
case Constants::EDIT:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case Constants::TEST:
$this->display_api_creation_add_or_edit($gt);
goto wL;
case "export":
$this->display_api_creation_export();
goto wL;
default:
$this->display_api_creation_all_config();
goto wL;
}
r4:
wL:
}
private function display_api_creation_all_config()
{
$UK["type"] = Constants::GUI_ENDPOINT;
$kV = DB_Utils::get_configuration($UK);
$kV = Utils::organize_endpoints_by_namespace($kV);
echo "\x9 <div class="d-flex justify-content-between align-items-center mbl">
<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Configured APIs</h6>
\x9\x9\x9<div class="d-grid gap-2 d-md-block">\xa \x9 <button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 px-4 mo-caw-element-to-toggle mo-caw-light-mode" method="button" data-bs-toggle="modal" data-bs-target="#" aria-hidden="true" hidden ";
echo esc_attr($this->license_status);
echo ">Export Postman Collection</button>\xa \x9\x9\x9<a class="btn btn-primary mo-caw-rounded- mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=add", "MO_CAW_API_Creation_Add_Nonce"));
echo "">Create API</a>
\x9 </div>
\x9\x9<div class="modal fade mo-caw-export-modal" id="mo-caw-custom-api-export-modal" tabindex="-1" aria-labelledby="mo-caw-custom-api-export-modal-label" aria-hidden="true">
\x9 \x9<div class="modal-dialog modal-dialog-centered justify-content-center">\xa\x9 \x9\x9\x9<form method="POST">
\x9 \x9 \x9";
wp_nonce_field("MO_CAW_API_Creation_Export", "MO_CAW_API_Creation_Nonce");
echo "\x9 \x9\x9<div class="modal-content">
\x9\x9\x9 <div class="modal-header">
\x9 \x9 <h5 class="modal-title" id="mo-caw-custom-api-export-modal-label">Export Postman Collection</h5>\xa \x9\x9 \x9\x9<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\xa \x9\x9 </div>
\x9 \x9\x9 <div class="modal-body">\xa \x9 \x9 \x9\x9\x9<h6 class="mo-caw-element-to-toggle mo-caw-light-mode">Select namespaces to export</h6>\xa\x9 \x9 \x9\x9 <div class="form-check d-flex align-items-center justify-content-start pj">\xa\x9 \x9 \x9 \x9\x9<input class="form-check-input m-0 bg-white me-2 mo-caw-select-all-checkbox" type="checkbox" value="" id="mo-caw-custom-api-export-select-all" data-target="mo-caw-custom-api-export">
\x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-export-select-all">Select All</label>\xa\x9\x9 \x9 \x9</div>\xa\x9\x9 \x9 \x9 ";
foreach ($kV as $Qi => $J1) {
echo "\x9 \x9\x9\x9\x9 <div class="form-check d-flex align-items-center justify-content-start p-2">
\x9 \x9\x9 \x9<input class="form-check-input m-0 bg-white me-2 mo-caw-custom-api-export" type="checkbox" value="";
echo esc_attr($Qi);
echo "" id="mo-caw-custom-api-export-";
echo esc_attr($Qi);
echo "" name="mo-caw-custom-api-export[]">\xa \x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-export">";
echo esc_attr($Qi);
echo "</label>\xa\x9\x9 \x9 \x9 \x9 </div>
\x9\x9 \x9\x9 ";
ZS:
}
ck:
echo "\x9\x9 \x9\x9 </div>
\x9\x9\x9\x9 <div class="modal-footer d-md-flex justify-content-md-center">
\x9\x9 \x9<button class="btn btn-primary mo-caw-bg-blue-medium mo-caw-rounded-" type="submit">Export</button>
\x9\x9\x9\x9 \x9 </div>
\x9\x9 \x9</div>
\x9\x9\x9\x9</form>\xa\x9 \x9</div>\xa \x9 </div>
\x9\x9</div>
\x9";
if (!empty($kV)) {
goto IH;
}
echo "\x9 <div class="d-flex align-items-center flex-column">
\x9 \x9<img src="";
echo esc_url(MO_CUSTOM_API_URL . "classes/Common/Resources/Images/not-found.jpeg");
echo "" width="4px" >
\x9<h6 class="mtm text-secondary">Oops! Seems like you have not created any Custom APIs.</h6>\xa\x9 \x9</div>\xa\x9\x9";
goto j_;
IH:
echo " \x9<div class="accordion" id="mo-caw-custom-api-accordion">\xa\x9\x9 \x9<div class="accordion accordion-flush" id="mo-caw-custom-api-accordion-flush">\xa \x9\x9\x9";
$gZ = 0;
echo "\x9 ";
foreach ($kV as $Qi => $J1) {
echo " \x9 \x9<div class="accordion-item mo-caw-accordion-item mbj border-0 mo-caw-rounded-8 mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9\x9<h2 class="accordion-header" id="mo-caw-custom-api-config-accordion-";
echo esc_attr($gZ);
echo "">
\x9\x9\x9<button class="accordion-button mo-caw-bg-blue-light fw-normal shadow-none mo-caw-rounded-8 ";
echo 0 === $gZ ? '' : "collapsed";
echo "" type="button" data-bs-toggle="collapse" data-bs-target="#mo-caw-create-api-accordion-collapse-";
echo esc_attr($gZ);
echo "" aria-expanded="false" aria-controls="flush-collapseOne">\xa \x9\x9 ";
echo esc_attr($Qi);
echo "\x9 \x9\x9 \x9</button>\xa\x9\x9 \x9 \x9</h2>\xa\x9 \x9 \x9<div id="mo-caw-create-api-accordion-collapse-";
echo esc_attr($gZ);
echo "" class="accordion-collapse collapse ";
echo 0 === $gZ ? "show" : '';
echo "" aria-labelledby="mo-caw-custom-api-config-accordion-";
echo esc_attr($gZ);
echo "" data-bs-parent="#mo-caw-custom-api-accordion-flush">\xa \x9\x9 \x9\x9<div class="accordion-body">\xa\x9 \x9<table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9 \x9\x9 <thead>
\x9\x9 \x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9 \x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3">API Name</th>\xa \x9\x9 \x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3">Method</th>\xa\x9 \x9\x9\x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3">Enable/Disable</th>
\x9\x9 \x9 \x9 \x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3">Actions</th>\xa\x9\x9 </tr>
\x9\x9 \x9\x9 </thead>
\x9 \x9 \x9<tbody>\xa \x9\x9\x9 \x9 \x9 \x9";
foreach ($J1 as $jS => $Uq) {
echo " \x9 \x9 \x9 <tr>
\x9 \x9\x9 \x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle">";
echo esc_attr($Uq["connection_name"]);
echo "</td>
\x9 \x9 \x9\x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle"><span class="rounded-pill py-2 px-4 mo-caw-";
echo esc_attr($Uq["method"]);
echo "-method">";
echo esc_attr(strtoupper($Uq["method"]));
echo "</span></td>
\x9\x9\x9 \x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">\xa\x9 \x9 \x9\x9 \x9\x9\x9\x9 <div class="form-check form-switch d-flex justify-content-center align-items-center">\xa\x9\x9\x9\x9 \x9 \x9 <input class="form-check-input mo-caw-toggle-switch" type="checkbox" onchange="moCawEnableDisableApi(this, '";
echo esc_attr(wp_create_nonce("mo_caw_custom_api_enable_disable_api"));
echo "', '";
echo esc_attr($Uq["connection_name"]);
echo "', '";
echo esc_attr($Uq["method"]);
echo "', '";
echo esc_attr($Qi);
echo "', '";
echo esc_attr(Constants::GUI_ENDPOINT);
echo "')"
\x9\x9\x9\x9\x9\x9\x9\x9\x9 ";
echo !isset($Uq["is_enabled"]) || $Uq["is_enabled"] ? "checked " : '';
echo esc_attr($this->license_status);
echo " \x9\x9 \x9\x9\x9\x9 \x9\x9\x9\x9>
\x9 \x9 \x9\x9\x9\x9\x9 \x9\x9 </div>
\x9 \x9 \x9\x9\x9 \x9\x9 </td>
\x9 \x9 \x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">\xa\x9 \x9 \x9\x9\x9\x9\x9\x9 \x9<div class="dropdown">\xa \x9\x9 \x9\x9\x9 \x9\x9 <button class="btn btn-secondary dropdown-toggle mo-caw-dropdown-toggle rounded-pill mo-caw-bg-grey-light border-0 mo-caw-text-grey-medium" type="button" id="mo-caw-api-creation-actions-";
echo esc_attr($jS);
echo "" data-bs-toggle="dropdown" aria-expanded="false">Pick an option</button>\xa \x9 \x9\x9 \x9\x9 \x9\x9 <ul class="dropdown-menu mo-caw-dropdown-menu" aria-labelledby="mo-caw-api-creation-actions-";
echo esc_attr($jS);
echo "">\xa\x9 \x9 \x9\x9\x9\x9 \x9 <li><a class="dropdown-item d-flex align-items-center justify-content-between" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=view&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi, "MO_CAW_API_Creation_View_Nonce"));
echo ""><span>View</span><i class="far fa-eye mo-caw-text-black"></i></a></li>\xa \x9 \x9 \x9 \x9 \x9 \x9\x9\x9<li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=edit&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi, "MO_CAW_API_Creation_Edit_Nonce"));
echo ""><span>Edit</span><i class="fas fa-pencil mo-caw-text-black"></i></a></li>\xa \x9 \x9\x9\x9\x9 \x9 \x9<li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=test&api-name=" . $Uq["connection_name"] . "&method=" . $Uq["method"] . "&namespace=" . $Qi . "&test-mode=true", "MO_CAW_API_Creation_Test_Nonce"));
echo ""><span>Test</span><i class="fas fa-check mo-caw-text-black"></i></a></li>
\x9\x9 \x9 \x9\x9\x9 \x9 \x9 <li><a class="dropdown-item d-flex align-items-center justify-content-between ";
echo esc_attr($this->license_status);
echo "" onclick="if(confirm('Are you sure you want to delete this API?')){document.getElementById('mo-caw-api-creation-delete-form-";
echo esc_attr($Uq["connection_name"]) . "-" . esc_attr($Uq["method"]) . "-" . esc_attr($Qi);
echo "').submit(); return false;}"><span>Delete</span><i class="far fa-trash-can mo-caw-text-black"></i></a></li>\xa \x9 \x9\x9\x9 \x9\x9 </ul>
\x9 \x9 \x9 \x9 \x9 </div>
\x9\x9 \x9\x9\x9 <form method="POST" id="mo-caw-api-creation-delete-form-";
echo esc_attr($Uq["connection_name"]) . "-" . esc_attr($Uq["method"]) . "-" . esc_attr($Qi);
echo "">\xa \x9 \x9\x9 \x9 \x9 \x9";
wp_nonce_field("MO_CAW_API_Creation_Delete", "MO_CAW_API_Creation_Nonce");
echo " \x9 \x9 \x9 \x9 \x9<input type="hidden" name="api-name" value="";
echo esc_attr($Uq["connection_name"]);
echo "">
\x9 \x9\x9 \x9 <input type="hidden" name="method" value="";
echo esc_attr($Uq["method"]);
echo "">\xa \x9\x9\x9\x9\x9 \x9 \x9\x9\x9<input type="hidden" name="namespace" value="";
echo esc_attr($Qi);
echo "">\xa\x9 \x9 \x9\x9\x9\x9 </form>\xa \x9 \x9 \x9\x9 </td>\xa\x9\x9 \x9\x9\x9\x9 </tr>
\x9\x9 \x9\x9 \x9 ";
Th:
}
e5:
echo " \x9\x9\x9 \x9 \x9\x9</tbody>
\x9\x9 \x9\x9\x9</table>\xa\x9 \x9\x9\x9 \x9</div>
\x9 \x9\x9 </div>\xa\x9\x9\x9\x9 </div>
\x9 ";
++$gZ;
echo " \x9";
UG:
}
du:
echo " \x9\x9 </div>
\x9\x9</div>
\x9 ";
j_:
echo " \x9";
}
private function display_api_creation_add_or_edit($gt)
{
global $wpdb;
global $wp_roles;
$zM = array();
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto d0;
}
$zM = DB_Utils::get_all_column_names($this->selected_table);
d0:
$Dv = $wpdb->get_results("SHOW TABLES");
$Ml = array();
foreach ($Dv as $gZ => $I4) {
foreach ($I4 as $gL) {
array_push($Ml, $gL);
N5:
}
lk:
T3:
}
sv:
$nt = $wp_roles->roles;
$Ra = array();
$i2 = array_keys($nt);
foreach ($nt as $gZ => $tW) {
array_push($Ra, $tW["name"]);
xP:
}
WA:
$ax = array("type" => Constants::GUI_ENDPOINT);
$mP = DB_Utils::get_all_namespaces($ax);
$iT = array();
foreach ($mP as $Qi) {
if (in_array($Qi->namespace, $iT, true)) {
goto cY;
}
array_push($iT, $Qi->namespace);
cY:
t9:
}
di:
$iZ = isset($_GET["test-mode"]) ? filter_var(sanitize_text_field(wp_unslash($_GET["test-mode"])), FILTER_VALIDATE_BOOLEAN) : false;
echo " \x9<form method="POST" id="mo-caw-custom-api-form" class="mo-caw-element-to-toggle mo-caw-light-mode">
\x9";
wp_nonce_field("MO_CAW_API_Creation", "MO_CAW_API_Creation_Nonce");
echo " \x9<input type="hidden" id="mo-caw-custom-api-test-mode" name="mo-caw-custom-api-test-mode" value="false">
\x9\x9\x9<div class="d-flex justify-content-between align-items-end mbl">\xa \x9 <h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">";
echo Constants::ADD === $gt ? "Create Custom API" : "Edit API - " . esc_attr($this->api_name);
echo "</h6>
\x9\x9\x9\x9<div class="d-grid gap-2 d-md-block">
\x9 \x9\x9\x9<button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 pxl mo-caw-element-to-toggle mo-caw-light-mode" type="button"
\x9 ";
if (!(Constants::DISABLED !== $this->license_status)) {
goto Dd;
}
echo esc_attr("onclick=moCawEnableTestMode()");
Dd:
echo " \x9\x9\x9";
echo esc_attr($this->license_status);
echo ">Test</button>\xa \x9 <button class="btn btn-primary mo-caw-rounded-16 mo-caw-bg-blue-dark px-4" id="mo-caw-custom-api-form-submit" type="submit" ";
echo esc_attr($this->license_status);
echo ">Save</button>
\x9\x9\x9</div>
\x9\x9\x9</div>
<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16">
\x9 \x9 <div class="mbk">\xa\x9\x9\x9\x9\x9<label for="mo-caw-custom-api-namespace" class="form-label mo-caw-form-label">Custom Namespace</label>\xa\x9 \x9\x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9\x9 <input type="text" class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pyi px-2" id="mo-caw-custom-api-namespace" name="mo-caw-custom-api-namespace" value="";
echo esc_attr($this->namespace);
echo "" placeholder="Custom Namespace (eg. mo/v1)" list="mo-caw-custom-api-namespace-list" pattern="^(?=.{1a5}$)[A-Za-z]+/v[0-9]+$" title="Namespace must be of max length 15 and contain at least one '/' in between, [A-Z, a-z] before '/', 'v' (denoting version) and numbers only after '/'" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">\xa \x9 \x9\x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto NE;
}
echo " \x9\x9\x9\x9 \x9<input type="hidden" name="mo-caw-custom-api-namespace" value="";
echo esc_attr($this->namespace);
echo "">
\x9\x9\x9\x9";
NE:
echo "\x9\x9 </div>
\x9 \x9 \x9<datalist id="mo-caw-custom-api-namespace-list">\xa \x9\x9 \x9 ";
foreach ($iT as $Qi) {
echo "\x9 \x9 \x9\x9<option value="";
echo esc_attr($Qi);
echo "">\xa \x9 \x9";
sO:
}
MP:
echo " \x9 </datalist>
\x9\x9</div>
\x9\x9<div class="row">
\x9 \x9\x9<div class="mb-3 col">
\x9 \x9 <label for="mo-caw-custom-api-name" class="form-label mo-caw-form-label">API Name</label>
\x9 \x9\x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode py-1 pxj" id="mo-caw-custom-api-name" name="mo-caw-custom-api-name" value="";
echo esc_attr($this->api_name);
echo "" placeholder="API Name" pattern="^(?=.{1,25}$)[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$" title="Should be of maximum length 25 and only '-' are accepted in between along with [A-Z, a-z and 0-9]" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">
\x9 \x9 \x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto D0;
}
echo "\x9 \x9 \x9\x9<input type="hidden" name="mo-caw-custom-api-name" value="";
echo esc_attr($this->api_name);
echo "">
\x9 \x9 ";
D0:
echo " \x9</div>\xa\x9\x9 \x9\x9<div class="mbk col">
\x9 \x9 <label for="mo-caw-custom-api-method" class="form-label mo-caw-form-label">Method <i class="fas fa-info rounded-circle border py-1 pxj" data-bs-toggle="tooltip" data-bs-placement="bottom" title="HTTP request method"></i></label>
\x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-method-selector" id="mo-caw-custom-api-method" name="mo-caw-custom-api-method" aria-label="#mo-caw-custom-api-method" aria-required="true" required ";
echo Constants::EDIT === $gt || Constants::TEST === $gt ? "disabled" : '';
echo ">\xa\x9 \x9\x9<option value="">Select Method</option>
\x9 <option value="get" ";
echo Constants::HTTP_GET === $this->method ? "selected" : '';
echo ">GET</option>
\x9 \x9\x9<option value="post" ";
echo Constants::HTTP_POST === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">POST</option>\xa \x9 \x9 \x9\x9<option value="put" ";
echo Constants::HTTP_PUT === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">PUT</option>\xa \x9\x9 \x9 <option value="delete" ";
echo Constants::HTTP_DELETE === $this->method ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip">DELETE</option>
</select>
\x9\x9 \x9\x9\x9";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto M3;
}
echo "\x9\x9 \x9\x9 \x9<input type="hidden" name="mo-caw-custom-api-method" value="";
echo esc_attr($this->method);
echo "">\xa\x9 \x9 ";
M3:
echo " \x9 \x9</div>\xa\x9 \x9</div>
\x9 \x9 <div class="row">
\x9 \x9 <div class="mbk col mo-caw-form-content d-none" request-methods="get post put delete">\xa\x9 \x9\x9\x9<label for="mo-caw-custom-api-table" class="form-label mo-caw-form-label">Table</label>\xa \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-table" name="mo-caw-custom-api-table" aria-label="#mo-caw-custom-api-method" aria-required="true" required onchange="moCawCustomApiGetTableColumns(this.value, '";
echo esc_attr(wp_create_nonce("mo_caw_get_columns_nonce"));
echo "', '";
echo esc_attr(Constants::CUSTOM_API_TAB);
echo "')">
\x9 \x9 \x9\x9 <option value="">Select Table</option>
\x9\x9\x9 \x9 ";
foreach ($Ml as $gL) {
echo " \x9 \x9<option value="";
echo esc_attr($gL);
echo "" ";
echo $gL === $this->selected_table ? "selected" : '';
echo ">";
echo esc_attr($gL);
echo "</option>
\x9\x9 \x9\x9\x9";
qU:
}
Rz:
echo " \x9 </select>\xa\x9\x9\x9 \x9</div>
\x9 \x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put">
\x9 <label for="mo-caw-custom-api-columns" class="form-label mo-caw-form-label">Request Columns</label>\xa \x9\x9<div class="dropdown">
\x9 \x9\x9 <button class="btn dropdown-toggle mo-caw-dropdown-toggle wi00 bg-white mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-text-grey-medium d-flex justify-content-between align-items-center" type="button" id="mo-caw-custom-api-columns-dropdown" data-bs-toggle="dropdown" aria-expanded="false">
\x9\x9\x9\x9 \x9\x9";
echo empty($this->request_columns) ? "Select Request Columns" : "Selected (" . count($this->request_columns) . ")";
echo " \x9 \x9 </button>
\x9\x9 \x9 <div class="dropdown-menu mo-caw-dropdown-menu w-100" aria-labelledby="mo-caw-custom-api-columns-dropdown">\xa\x9\x9 \x9\x9 <div class="form-check d-flex align-items-center justify-content-start p-2">\xa\x9 \x9 \x9<input class="form-check-input m-0 bg-white me-2 mo-caw-select-all-checkbox" type="checkbox" value="" id="mo-caw-custom-api-columns-select-all" data-target="mo-caw-custom-api-columns" ";
echo empty($this->selected_table) ? "hidden" : '';
echo " ";
echo count($this->request_columns) === count($zM) ? "checked" : '';
echo ">\xa\x9 \x9\x9 \x9 \x9\x9<label class="form-check-label" for="mo-caw-custom-api-columns-select-all">";
echo empty($this->selected_table) ? "Please select a table" : "Select All";
echo "</label>\xa\x9 \x9\x9 \x9\x9</div>
\x9\x9 \x9\x9\x9 ";
if (!(Constants::EDIT === $gt || Constants::TEST === $gt)) {
goto eV;
}
echo "\x9 \x9\x9\x9 \x9 ";
foreach ($zM as $yS) {
echo " \x9\x9 \x9 \x9\x9\x9<div class="form-check d-flex align-items-center justify-content-start mo-caw-custom-api-columns-div p-2">
\x9\x9\x9 \x9\x9\x9 \x9<input class="form-check-input mh bg-white me-2 mo-caw-custom-api-columns" type="checkbox" value="";
echo esc_attr($yS);
echo "" id="mo-caw-custom-api-columns-";
echo esc_attr($yS);
echo "" name="mo-caw-custom-api-columns[]" ";
echo in_array($yS, $this->request_columns, true) ? "checked" : '';
echo ">\xa\x9\x9 \x9\x9\x9\x9\x9\x9 <label class="form-check-label" for="mo-caw-custom-api-columns-";
echo esc_attr($yS);
echo """>";
echo esc_attr($yS);
echo "</label>
\x9 \x9\x9\x9 \x9\x9\x9\x9</div>\xa\x9\x9\x9 \x9 \x9";
By:
}
ua:
echo "\x9 \x9\x9\x9\x9\x9";
eV:
echo " \x9 </div>
\x9\x9\x9\x9 </div>\xa\x9\x9 \x9</div>
\x9 \x9</div>
\x9 \x9<div class="accordion d-none" id="mo-caw-adv-setting-accordion">
\x9 \x9 <div class="accordion accordion-flush" id="mo-caw-custom-api-accordion-flush">
\x9<div class="accordion-item mb-2 borderh mo-caw-rounded-8 mo-caw-accordion-item mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9\x9\x9\x9<h2 class="accordion-header" id="mo-caw-custom-api-adv-settings-accordion-heading">
\x9 \x9\x9\x9\x9 \x9<button class="accordion-button collapsed mo-caw-bg-blue-light shadow-none mo-caw-rounded-8" type="button" data-bs-toggle="collapse" data-bs-target="#mo-caw-custom-api-adv-settings-accordion-collapse" aria-expanded="false" aria-controls="mo-caw-custom-api-adv-settings-accordion-collapse">
\x9 dvance Settings
\x9 \x9\x9\x9\x9 </button>\xa\x9 \x9 </h2>
\x9 \x9\x9\x9 <div id="mo-caw-custom-api-adv-settings-accordion-collapse" class="accordion-collapse collapse" aria-labelledby="mo-caw-custom-api-adv-settings-accordion-heading" data-bs-parent="#mo-caw-custom-api-accordion-flush">
\x9 \x9\x9\x9\x9\x9<div class="accordion-body">
\x9\x9\x9 \x9 \x9<div class="row">
\x9\x9\x9 \x9\x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put delete">
\x9\x9\x9 \x9\x9\x9 \x9<label for="mo-caw-custom-api-response-format" class="form-label mo-caw-form-label">Response Type <i class="fas fa-info rounded-circle border py-1 px-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Send response in default or your custom format"></i></label>\xa\x9\x9 \x9 \x9\x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9 \x9 \x9\x9\x9 \x9<select class="mo-caw-crown-standard-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-response-type" name="mo-caw-custom-api-response-type" aria-label="#mo-caw-custom-api-method">\xa\x9 \x9 \x9\x9 \x9\x9 \x9<option value="default" ";
echo !isset($this->response["response_type"]) || Constants::DEFAULT === $this->response["response_type"] ? "selected" : '';
echo ">Default</option>\xa \x9 <option value="custom" ";
echo isset($this->response["response_type"]) && Constants::CUSTOM === $this->response["response_type"] ? "selected" : '';
echo " class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan" >Custom Response</option>
\x9 \x9 \x9\x9 \x9</select>\xa \x9\x9 \x9\x9\x9\x9 </div>
\x9 \x9 \x9 </div>
\x9 \x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get post put delete">
\x9 \x9 \x9 \x9\x9 \x9<label for="mo-caw-custom-api-response-format" class="form-label mo-caw-form-label">Response Format</label>
\x9 \x9\x9\x9\x9\x9\x9<div class="d-flex justify-content-between align-items-center">
\x9\x9 \x9 \x9\x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-response-format" name="mo-caw-custom-api-response-format" aria-label="#mo-caw-custom-api-method">
\x9\x9 \x9 \x9 \x9 <option value="json" ";
echo !isset($this->response["response_content_type"]) || Constants::JSON === $this->response["response_content_type"] ? "selected" : '';
echo ">JSON</option>\xa \x9\x9 \x9 \x9\x9 \x9 \x9 <option value="xml" ";
echo isset($this->response["response_content_type"]) && Constants::XML === $this->response["response_content_type"] ? "selected" : '';
echo " aria-hidden="true" hidden >XML</option>\xa\x9\x9\x9\x9 \x9 \x9\x9\x9 </select>\xa\x9\x9\x9 \x9 \x9\x9 </div>
\x9 \x9 \x9 </div>\xa\x9\x9 \x9 \x9 \x9<div id="mo-caw-response-format-block" class="";
echo !isset($this->response["response_type"]) || Constants::DEFAULT === $this->response["response_type"] ? "d-none" : '';
echo "">\xa\x9\x9 \x9 \x9\x9 \x9\x9<ul class="nav nav-tabs nav-pills border-0 flex-column flex-sm-row text-center rounded">\xa \x9\x9\x9\x9\x9\x9 \x9<li class="nav-item mo-caw-bg-blue-light flex-sm-fill">\xa \x9 \x9 \x9\x9 \x9 <a class="nav-link active" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-success">Success</a>
\x9 \x9\x9 \x9 </li>\xa \x9\x9 \x9\x9<li class="nav-item mx-1 mo-caw-bg-blue-light flex-sm-fill">
\x9 \x9 \x9\x9 \x9\x9\x9<a class="nav-link" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-error">Error</a>\xa \x9 \x9 \x9</li>\xa \x9\x9 \x9 \x9\x9\x9<li class="nav-item mo-caw-bg-blue-light flex-sm-fill">\xa\x9 \x9\x9 \x9\x9 \x9 \x9<a class="nav-link" data-bs-toggle="tab" href="#mo-caw-custom-api-response-type-authentication">Authentication</a>
\x9 \x9 \x9\x9 </li>\xa\x9 \x9\x9 \x9\x9 \x9\x9</ul>
\x9 \x9\x9 \x9 \x9<div class="tab-content pbk">\xa \x9 \x9 \x9 \x9\x9 <div class="tab-pane active" id="mo-caw-custom-api-response-type-success">\xa\x9\x9\x9\x9 \x9\x9 \x9 <label for="mo-caw-custom-api-response-type-success-format"></label>\xa \x9 \x9\x9\x9\x9\x9 \x9 <textarea class="form-control" placeholder="{&#; "message": "success",&#; "data": "$response_data" }&3;&#;" id="mo-caw-custom-api-response-type-success-format" name="mo-caw-custom-api-response-type-success-format" rows="10">";
echo isset($this->response["response_content"]["success"]) && !empty($this->response["response_content"]["success"]) ? esc_attr($this->response["response_content"]["success"]) : '';
echo "</textarea>\xa \x9 \x9\x9 \x9\x9 </div>
\x9\x9\x9 \x9 \x9\x9 \x9<div class="tab-pane fade" id="mo-caw-custom-api-response-type-error">\xa \x9\x9 \x9 \x9\x9\x9 <label for="mo-caw-custom-api-response-type-error-format"></label>\xa\x9 \x9\x9 \x9 \x9 <textarea class="form-control" placeholder="{ &#; "message": "error", &0; "data": "$response_data"&3;&0;}&3;&0;" id="mo-caw-custom-api-response-type-error-format" name="mo-caw-custom-api-response-type-error-format" rows="">";
echo isset($this->response["response_content"]["error"]) && !empty($this->response["response_content"]["error"]) ? esc_attr($this->response["response_content"]["error"]) : '';
echo "</textarea>
\x9 \x9 \x9 \x9 \x9\x9</div>
\x9 \x9 <div class="tab-pane fade" id="mo-caw-custom-api-response-type-authentication">\xa\x9 \x9\x9 \x9\x9 \x9\x9<label for="mo-caw-custom-api-response-type-authentication-format"></label>\xa \x9 \x9 \x9 \x9 <textarea class="form-control" placeholder="{&3;&0; "message": "authentication_error", &0; "data": "$response_data" &#;}&#; " id="mo-caw-custom-api-response-type-authentication-format" name="mo-caw-custom-api-response-type-authentication-format" rows="">";
echo isset($this->response["response_content"]["authentication"]) && !empty($this->response["response_content"]["authentication"]) ? esc_attr($this->response["response_content"]["authentication"]) : '';
echo "</textarea>\xa \x9\x9\x9 \x9 \x9 \x9</div>
\x9 \x9 \x9 \x9</div>
\x9\x9 \x9\x9\x9\x9\x9 \x9</div>
\x9\x9\x9 \x9 \x9</div>
\x9\x9 \x9\x9 <div>\xa \x9 \x9\x9\x9 <div class="mb-3">
\x9 \x9\x9\x9\x9\x9 <label for="mo-caw-custom-api-allowed-roles" class="form-label mo-caw-form-label">Restrict role-based access</label>
\x9 \x9\x9\x9 \x9\x9 <div class="dropdown mo-caw-disable-standard-plan mo-caw-disable-eai-plan" >\xa\x9 \x9 \x9\x9\x9 \x9 \x9 <button class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan btn dropdown-toggle mo-caw-dropdown-toggle w-0 bg-white mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-text-grey-medium d-flex justify-content-between align-items-center" type="button" id="mo-caw-custom-api-allowed-roles-dropdown" data-bs-toggle="dropdown" aria-expanded="false" >\xa \x9\x9\x9\x9 \x9 ";
echo !empty($this->blocked_roles) ? "Selected (" . count($this->blocked_roles) . ")" : "Select Roles";
echo "\x9 \x9\x9\x9 \x9\x9 \x9 \x9</button>\xa\x9\x9\x9\x9 \x9 \x9\x9 <div class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan dropdown-menu mo-caw-dropdown-menu wi00" aria-labelledby="mo-caw-custom-api-allowed-roles-dropdown" >
\x9 \x9 \x9\x9\x9 \x9\x9<div class="form-check d-flex align-items-center p-2">
\x9 \x9 \x9 \x9\x9 <input class="form-check-input mh bg-white mo-caw-select-all-checkbox me-2" type="checkbox" value="" id="mo-caw-custom-api-allowed-roles-select-all" data-target="mo-caw-custom-api-allowed-roles" ";
echo count($this->blocked_roles) === count($i2) ? "checked" : '';
echo ">
\x9\x9\x9\x9\x9\x9 \x9 \x9 \x9 <label class="form-check-label" for="mo-caw-custom-api-allowed-roles-select-all">Select All</label>\xa \x9\x9 \x9\x9\x9\x9 \x9 </div>\xa \x9\x9\x9 \x9\x9";
foreach ($i2 as $gZ => $al) {
echo " \x9\x9 \x9 \x9\x9\x9\x9\x9 <div class="form-check d-flex align-items-center pj">
\x9 \x9\x9 \x9 \x9\x9\x9 <input class="form-check-input m-0 bg-white mo-caw-custom-api-allowed-roles me-2" type="checkbox" value="";
echo esc_attr($al);
echo "" id="mo-caw-custom-api-allowed-roles-";
echo esc_attr($gZ);
echo "" name="mo-caw-custom-api-allowed-roles[]" ";
echo in_array($al, $this->blocked_roles, true) ? "checked" : '';
echo ">\xa \x9 \x9 \x9\x9 \x9 \x9\x9<label class="form-check-label" for="mo-caw-custom-api-allowed-roles-";
echo esc_attr($gZ);
echo "">";
echo esc_attr($Ra[$gZ]);
echo "</label>\xa\x9\x9 \x9 \x9 \x9</div>
\x9 \x9 \x9\x9 \x9\x9\x9 ";
I9:
}
bb:
echo "\x9 \x9\x9 \x9 </div>
\x9\x9 \x9\x9\x9\x9\x9 \x9 </div>\xa \x9\x9 \x9\x9 </div>\xa \x9\x9 \x9\x9\x9\x9 <div class="row mo-caw-form-content d-none" request-methods="get">\xa \x9 \x9\x9\x9<label class="form-label mo-caw-form-label">Filters <em>(Based on Order)</em></label>
\x9 \x9\x9 <div class="mb-3 col">
\x9\x9\x9 \x9 \x9\x9\x9\x9 <div class="d-flex justify-content-between align-items-center">
\x9\x9 \x9\x9\x9\x9 \x9\x9<select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-filter" name="mo-caw-custom-api-common-filter-filter" aria-label="#mo-caw-custom-api-common-filter-filter" >
\x9 \x9\x9\x9\x9 \x9\x9\x9 <option value="">Filter</option>\xa\x9 \x9\x9 \x9 \x9 <option value="orderby" selected>Order By</option>
\x9 \x9\x9\x9 \x9 </select>\xa\x9\x9\x9 \x9\x9 \x9 </div>\xa \x9\x9\x9\x9 \x9\x9 </div>
\x9\x9 \x9 \x9\x9\x9\x9 <div class="mb-3 col">
\x9 \x9 \x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9 \x9<select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-column" name="mo-caw-custom-api-common-filter-column" aria-label="#mo-caw-custom-api-common-filter-column" >
\x9\x9 \x9 \x9 \x9\x9\x9 <option value="">Column</option>\xa \x9 \x9\x9\x9\x9";
if (!("edit" === $gt)) {
goto HE;
}
echo " \x9 \x9 \x9 \x9\x9\x9 ";
foreach ($zM as $yS) {
echo " \x9\x9\x9\x9\x9\x9 \x9\x9\x9 \x9\x9 <option class="mo-caw-custom-api-common-filter-column-option" value="";
echo esc_attr($yS);
echo "" ";
echo isset($this->common_filters["orderby"]["column"]) && $yS === $this->common_filters["orderby"]["column"] ? "selected" : '';
echo ">";
echo esc_attr($yS);
echo "</option>\xa \x9 \x9 \x9\x9 \x9 \x9";
K3:
}
Q6:
echo " \x9 \x9\x9\x9 \x9\x9\x9\x9 ";
HE:
echo "\x9 \x9\x9\x9\x9\x9\x9 </select>
\x9\x9 \x9 \x9 \x9\x9 </div>
\x9\x9 \x9 \x9 </div>
\x9 \x9 \x9\x9 \x9\x9 <div class="mb-3 col">
\x9\x9\x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9\x9\x9\x9\x9 \x9 <select class="mo-caw-disable-standard-plan mo-caw-crown-standard-plan mo-caw-disable-eai-plan mo-caw-crown-eai-plan form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-common-filter-order" name="mo-caw-custom-api-common-filter-order" aria-label="#mo-caw-custom-api-common-filter-order" >\xa\x9 \x9 \x9\x9 \x9\x9 <option value="">Order</option>
\x9 \x9\x9 \x9 \x9\x9 \x9\x9<option value="asc" ";
echo isset($this->common_filters["orderby"]["option"]) && "asc" === $this->common_filters["orderby"]["option"] ? "selected" : '';
echo ">Ascending</option>\xa \x9\x9\x9 \x9 \x9\x9 \x9<option value="desc" ";
echo isset($this->common_filters["orderby"]["option"]) && "desc" === $this->common_filters["orderby"]["option"] ? "selected" : '';
echo ">Descending</option>\xa \x9 \x9\x9\x9 \x9 \x9 </select>\xa \x9 \x9 \x9\x9 </div>\xa\x9 \x9 \x9\x9 \x9\x9\x9</div>\xa\x9 \x9 \x9 \x9 \x9</div>\xa\x9\x9 \x9\x9 \x9\x9\x9</div>\xa \x9 \x9 \x9<div>\xa\x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center mb-2 mo-caw-form-content d-none" request-methods="get put delete">\xa\x9 \x9\x9 \x9\x9 <label class="form-label mo-caw-form-label">Filters <em>(Based on column, condition and parameter)</em></label>\xa \x9\x9 \x9\x9 \x9\x9<span>\xa\x9 \x9 \x9 \x9\x9<button class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip border-0 bg-white p-0" type="button" onclick="moCawAddField('gui', 'mo-caw-custom-api-value-specific-filter-duplicate-div-0', 'mo-caw-custom-api-value-specific-filter-duplicate-div-', this.nextElementSibling)" ><i class="fa-solid fa-plus mo-caw-text-grey-medium border border-3 rounded p-1"></i></button>\xa \x9 \x9 \x9<button class="mo-caw-disable-standard-plan mo-caw-disable-eai-plan mo-caw-add-standard-tooltip mo-caw-add-eai-tooltip border-0 bg-white ph" type="button" onclick="moCawRemoveField('mo-caw-custom-api-value-specific-filter-duplicate-div-', this)" ><i class="fa-solid fa-minus mo-caw-text-grey-medium border border-3 rounded p-1"></i></button>\xa \x9\x9\x9\x9\x9\x9 \x9 </span>
\x9 \x9\x9 \x9\x9 </div>
\x9\x9 \x9 \x9\x9";
if (!empty($this->value_specific_filter["filter_details"])) {
goto d6;
}
echo " \x9\x9 \x9 \x9<div class="row" id="mo-caw-custom-api-value-specific-filter-duplicate-div-0">\xa \x9\x9 \x9 \x9\x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa\x9\x9\x9\x9 \x9 \x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9\x9 \x9 \x9<select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-custom-api-specific-filter-column" id="mo-caw-custom-api-specific-filter-column" name="mo-caw-custom-api-specific-filter-column[]" aria-label="#mo-caw-custom-api-specific-filter-column">\xa\x9 \x9 \x9\x9 \x9\x9 \x9 <option value="">Column</option>\xa\x9\x9 \x9 \x9\x9\x9\x9\x9\x9 \x9\x9";
if (!("edit" === $gt)) {
goto mX;
}
echo " \x9\x9\x9 \x9\x9 \x9\x9\x9 ";
foreach ($zM as $yS) {
echo " \x9\x9 \x9 \x9 \x9\x9<option class="mo-caw-custom-api-specific-filter-column-option" value="";
echo esc_attr($yS);
echo "">";
echo esc_attr($yS);
echo "</option>
\x9\x9 \x9\x9 ";
cL:
}
Bj:
echo "\x9 \x9\x9 \x9 \x9\x9 \x9\x9\x9";
mX:
echo " \x9\x9 \x9\x9\x9\x9 \x9</select>
\x9 \x9\x9\x9 \x9 \x9 </div>
\x9\x9\x9\x9 \x9 \x9\x9\x9</div>\xa\x9\x9 \x9\x9 \x9 \x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa \x9 \x9\x9\x9 \x9 \x9<div class="d-flex justify-content-between align-items-center">\xa \x9 \x9\x9\x9 \x9\x9\x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-specific-filter-condition" name="mo-caw-custom-api-specific-filter-condition[]" aria-label="#mo-caw-custom-api-specific-filter-condition">\xa \x9 \x9 \x9\x9\x9<option value="">Condition</option>
\x9\x9 \x9\x9\x9 <option value="like">Like</option>\xa \x9\x9 \x9\x9\x9\x9 <option value="not-like">Not Like</option>
\x9\x9 \x9\x9 \x9 \x9\x9\x9 <option value="=">Equal</option>
\x9 \x9 \x9 \x9\x9\x9 <option value="!=">Not Equal</option>
\x9\x9 \x9 \x9\x9 \x9 \x9<option value=">">Greater Than</option>
\x9 \x9 \x9 \x9 <option value="<">Less Than</option>
\x9\x9 \x9\x9\x9\x9 \x9 </select>
\x9\x9 \x9\x9 \x9 \x9</div>
\x9 \x9 \x9\x9 \x9</div>\xa \x9\x9 \x9 \x9\x9\x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get">
\x9 \x9 \x9 \x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9\x9\x9 \x9\x9\x9 <input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pt-1 px-2" id="mo-caw-custom-api-specific-filter-parameter-get-0" name="mo-caw-custom-api-specific-filter-parameter-get[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-get-0" value="";
echo "Position - 1";
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the position of parameter in the API request" placeholder="Parameter position in request URL" aria-readonly="true" readonly>
\x9\x9 \x9\x9 </div>
\x9\x9\x9\x9 \x9 \x9</div>
\x9\x9\x9\x9\x9 \x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="put">
\x9\x9 \x9 \x9\x9\x9 \x9 <div class="d-flex justify-content-between align-items-center">
\x9 \x9 \x9 \x9 \x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pti px-2" id="mo-caw-custom-api-specific-filter-parameter-put-0" name="mo-caw-custom-api-specific-filter-parameter-put[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-puth" value="";
echo "column_param1";
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the name of parameter in the API request" placeholder="Parameter name in request URL">\xa\x9 \x9\x9\x9 \x9 \x9</div>\xa\x9\x9\x9 \x9\x9 \x9\x9\x9 \x9</div>\xa\x9 \x9\x9\x9\x9 \x9\x9\x9\x9</div>\xa\x9 \x9 \x9\x9 \x9\x9";
goto wy;
d6:
echo " \x9 \x9 \x9\x9 \x9 ";
$BV = count($this->value_specific_filter["filter_details"]);
echo "\x9 \x9\x9 \x9 \x9\x9\x9";
foreach ($this->value_specific_filter["filter_details"] as $gZ => $qe) {
echo " \x9 \x9 \x9 \x9 <div class="row" id="mo-caw-custom-api-value-specific-filter-duplicate-div-";
echo esc_attr($gZ);
echo "">\xa \x9\x9 \x9\x9 \x9 ";
if (!(1 <= $BV && 1 <= $gZ)) {
goto m9;
}
echo " \x9 \x9 \x9\x9\x9 \x9 <div class="d-flex justify-content-center mbk mo-caw-form-content d-none" request-methods="get put delete">
\x9\x9\x9\x9\x9 \x9 \x9\x9\x9\x9 <input type="hidden" name="mo-caw-custom-api-specific-filter-operator[]" value="";
echo esc_attr($this->value_specific_filter["filter_relation"][$gZ - 1]);
echo "" />
\x9\x9\x9\x9\x9\x9 \x9 \x9<button class="btn mo-caw-bg-grey-light mo-caw-text-grey-medium border-0" type="button" id="mo-custom-api-specific-filter-operator-";
echo esc_attr($gZ - 1);
echo "" onclick="moCawToggleOperation(this)">";
echo esc_attr(strtoupper($this->value_specific_filter["filter_relation"][$gZ - 1]));
echo " <i class="fa-solid fa-arrows-rotate"></i></button>
\x9 \x9 \x9 \x9\x9\x9\x9 </div>\xa \x9 \x9\x9\x9\x9 \x9\x9\x9";
m9:
echo "\x9\x9\x9 \x9\x9 \x9 \x9\x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">
\x9\x9 \x9\x9\x9\x9\x9 <div class="d-flex justify-content-between align-items-center">\xa \x9 \x9 \x9\x9 \x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode mo-caw-custom-api-specific-filter-column" id="mo-caw-custom-api-specific-filter-column" name="mo-caw-custom-api-specific-filter-column[]" aria-label="#mo-caw-custom-api-specific-filter-column">\xa \x9\x9 \x9 \x9 \x9\x9 \x9\x9<option value="">Column</option>\xa \x9\x9\x9\x9 \x9 \x9 \x9 \x9\x9";
foreach ($zM as $yS) {
echo "\x9\x9\x9\x9\x9 \x9 \x9\x9\x9 \x9\x9<option class="mo-caw-custom-api-specific-filter-column-option" value="";
echo esc_attr($yS);
echo "" ";
echo $yS === $qe["column"] ? "selected" : '';
echo ">";
echo esc_attr($yS);
echo "</option>\xa \x9 \x9 \x9 \x9 \x9 ";
ha:
}
FY:
echo " \x9 \x9\x9\x9 \x9 \x9 </select>
\x9\x9\x9 \x9 \x9\x9\x9 </div>
\x9\x9\x9 \x9 \x9\x9\x9 </div>
\x9 \x9\x9 \x9<div class="mb-3 col mo-caw-form-content d-none" request-methods="get put delete">\xa\x9\x9 \x9\x9\x9\x9 \x9\x9<div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9\x9 <select class="form-select mo-caw-form-select mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode" id="mo-caw-custom-api-specific-filter-condition" name="mo-caw-custom-api-specific-filter-condition[]" aria-label="#mo-caw-custom-api-specific-filter-condition">\xa\x9\x9\x9\x9\x9\x9\x9 \x9\x9\x9\x9\x9\x9 \x9<option value="">Condition</option>
\x9\x9\x9\x9 \x9\x9\x9\x9 \x9 \x9\x9\x9<option value="like" ";
echo "like" === $qe["condition"] ? "selected" : '';
echo ">Like</option>\xa \x9 \x9\x9\x9 \x9 <option value="not-like" ";
echo "not-like" === $qe["condition"] ? "selected" : '';
echo ">Not Like</option>\xa \x9 \x9\x9 \x9 \x9 <option value="=" ";
echo "=" === $qe["condition"] ? "selected" : '';
echo ">Equal</option>
\x9 \x9 \x9 \x9\x9\x9 <option value="!=" ";
echo "!=" === $qe["condition"] ? "selected" : '';
echo ">Not Equal</option>\xa \x9\x9\x9 \x9\x9\x9 \x9 <option value=">" ";
echo ">" === $qe["condition"] ? "selected" : '';
echo ">Greater Than</option>\xa\x9 \x9\x9 \x9 \x9\x9 \x9<option value="<" ";
echo "<" === htmlspecialchars_decode($qe["condition"]) ? "selected" : '';
echo ">Less Than</option>\xa \x9\x9 \x9 \x9 \x9\x9 \x9</select>
\x9\x9\x9\x9\x9\x9 \x9\x9 \x9</div>
\x9 \x9 \x9 \x9 \x9 </div>
\x9 \x9 \x9 \x9 <div class="mb-3 col mo-caw-form-content d-none" request-methods="get">
\x9\x9 \x9 \x9 \x9 \x9 <div class="d-flex justify-content-between align-items-center">\xa \x9\x9 \x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pti pxj" id="mo-caw-custom-api-specific-filter-parameter-get-";
echo esc_attr($gZ++);
echo "" name="mo-caw-custom-api-specific-filter-parameter-get[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-get" value="";
echo isset($qe["parameter"]) ? esc_attr("Position - " . $qe["parameter"]) : "Position - " . esc_attr($gZ++);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the position of parameter in the API request" placeholder="Parameter position in request URL" aria-readonly="true" readonly>\xa \x9\x9\x9 \x9 \x9 \x9 </div>\xa \x9 \x9\x9\x9 \x9 \x9 </div>
\x9 \x9\x9\x9 <div class="mbk col mo-caw-form-content d-none" request-methods="put">
\x9\x9 \x9\x9 \x9\x9\x9\x9<div class="d-flex justify-content-between align-items-center">
\x9 \x9 \x9\x9\x9 \x9<input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode pt-1 pxj" id="mo-caw-custom-api-specific-filter-parameter-put-";
echo esc_attr($gZ++);
echo "" name="mo-caw-custom-api-specific-filter-parameter-put[]" aria-label="#mo-caw-custom-api-specific-filter-parameter-put" value="";
echo isset($qe["parameter"]) ? esc_attr($qe["parameter"]) : "column_param" . esc_attr($gZ++);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Indicates the name of parameter in the API request" placeholder="Parameter name in request URL">
\x9 \x9\x9 \x9\x9\x9\x9 \x9 \x9</div>\xa \x9 \x9 \x9 </div>
\x9 \x9\x9 \x9 \x9</div>
\x9 \x9\x9\x9 \x9\x9 \x9 ";
R5:
}
zV:
echo " \x9 \x9\x9 ";
wy:
echo " \x9\x9\x9\x9 </div>\xa \x9 \x9\x9</div>
\x9\x9 \x9\x9\x9</div>
\x9 \x9</div>
\x9\x9 </div>
\x9\x9 </div>
</div>\xa \x9</form>
\x9\x9<div class="modal fade mo-caw-export-modal" id="mo-caw-custom-api-test-inputs-modal" tabindex="i" aria-labelledby="mo-caw-custom-api-test-inputs-modal-label" aria-hidden="true">\xa \x9 <div class="modal-dialog modal-dialog-centered justify-content-center">\xa\x9\x9\x9\x9<form method="POST" id="mo-caw-custom-api-test-inputs-form">
\x9 <div class="modal-content">
\x9\x9\x9\x9\x9 <div class="modal-header">
\x9\x9\x9 <h5 class="modal-title" id="mo-caw-custom-api-test-inputs-modal-label">Values to run test</h5>\xa \x9\x9 \x9 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
\x9 \x9 \x9</div>\xa\x9 \x9<div class="modal-body">\xa\x9\x9\x9\x9\x9 </div>\xa \x9\x9\x9 <div class="modal-footer d-md-flex justify-content-md-center">\xa\x9 \x9 <button class="btn btn-primary mo-caw-bg-blue-medium mo-caw-rounded-" type="button" onclick="moCawGetCustomAPITestResult('";
echo esc_attr(site_url());
echo "')">Continue</button>\xa \x9 \x9 </div>
\x9 </div>\xa\x9 \x9</form>
\x9\x9</div>
\x9</div>\xa\x9\x9";
if (!$iZ) {
goto lX;
}
echo "\x9\x9\x9<div class="d-flex justify-content-between align-items-end my-4">\xa <div class="d-flex justify-content-center align-items-baseline">
\x9<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Test Results</h6>
\x9\x9 \x9<span class="msj badge rounded-pill" id="mo-caw-custom-api-test-result-status"></span>
\x9\x9\x9\x9</div>
\x9 \x9</div>\xa\x9\x9\x9<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16 mo-caw-test-result" id="mo-caw-custom-api-test-result">
\x9 </div>
\x9 ";
lX:
echo "\x9 ";
}
private function display_api_creation_view()
{
$G8 = site_url() . "/wp-json/" . $this->namespace . "/" . $this->api_name;
if (Constants::HTTP_GET === $this->method) {
goto M7;
}
if (Constants::HTTP_DELETE === $this->method) {
goto Ta;
}
goto l0;
M7:
if (empty($this->value_specific_filter["filter_details"])) {
goto yo;
}
$qe = $this->value_specific_filter["filter_details"];
$rS = array();
foreach ($qe as $FK) {
$rS[$FK["parameter"]] = $FK["column"];
F3:
}
T9:
ksort($rS);
foreach ($rS as $Tw) {
$G8 = $G8 . "/<" . $Tw . ">";
ei:
}
Me:
yo:
goto l0;
Ta:
if (empty($this->value_specific_filter["filter_details"])) {
goto ra;
}
$qe = $this->value_specific_filter["filter_details"];
$EA = array();
foreach ($qe as $FK) {
$EA[$FK["column"]] = "<" . $FK["column"] . ">";
w8:
}
Gi:
$G8 = add_query_arg($EA, $G8);
ra:
l0:
echo "\xa \x9<div class="d-flex justify-content-between align-items-end mb-4">
\x9<h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">";
echo "View API - " . esc_attr($this->api_name);
echo "</h6>\xa\x9 \x9<div class="d-grid gap-2 d-md-block">
\x9 \x9
\x9 \x9<button class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded- mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="submit" aria-hidden="true" hidden>Export Postman Collection</button>\xa\x9 \x9\x9<a class="btn mo-caw-btn-outline-blue-medium mo-caw-rounded-16 px-4 mo-caw-element-to-toggle mo-caw-light-mode ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=test&api-name=" . $this->api_name . "&method=" . $this->method . "&namespace=" . $this->namespace . "&test-mode=true", "MO_CAW_API_Creation_Test_Nonce"));
echo "">Test</a>\xa \x9<a class="btn btn-primary mo-caw-rounded-16 mo-caw-bg-blue-dark px-4 ";
echo esc_attr($this->license_status);
echo "" type="button" href="";
echo esc_url(wp_nonce_url("admin.php?page=custom_api_wp_settings&tab=custom-api&action=edit&api-name=" . $this->api_name . "&method=" . $this->method . "&namespace=" . $this->namespace, "MO_CAW_API_Creation_Edit_Nonce"));
echo "">Edit API</a>\xa\x9\x9 </div>
\x9 </div>\xa <div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16">\xa \x9 <div class="input-group mb-3">
\x9 \x9<span class="input-group-text mo-caw-";
echo esc_attr($this->method);
echo "-method borderh fs-6 px-3">";
echo esc_attr(strtoupper($this->method));
echo "</span>\xa \x9 <input type="text" class="form-control mo-caw-form-control mo-caw-element-to-toggle mo-caw-light-mode border-endh border-start-0 bg-white fsn" aria-label="" placeholder="https://<your_domain>/wp-json/<namespace>/<api-name>?<params>" value="";
echo esc_attr($G8);
echo "" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Any parameters enclosed within <> should be replaced with actual values" aria-readonly="true" readonly> \xa\x9 \x9 <span class="input-group-text bg-white mo-caw-cursor-pointer fs-6 mo-caw-copy-icon" data-bs-toggle="tooltip" data-bs-placement="right" title="Copy API Endpoint"><i class="far fa-copy fa-lg"></i></span>
\x9</div>
\x9\x9\x9";
if (!(!empty($this->value_specific_filter) && isset($this->value_specific_filter["filter_details"]))) {
goto Sl;
}
echo "\x9\x9 <div class="mt-4">
\x9 \x9\x9 <h6 class="mb-3 mo-caw-element-to-toggle mo-caw-light-mode">Request Format</h6>\xa \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 <thead>\xa\x9 \x9\x9\x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3 align-middle">Column Name</th>
\x9\x9\x9 \x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Description</th>
\x9 \x9 \x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Condition Applied</th>
\x9\x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3 align-middle mo-caw-form-content d-none" request-methods="get">Parameter place in API</th>\xa \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle mo-caw-form-content d-none" request-methods="get">Operator if any</th>\xa\x9 \x9 \x9\x9</tr>
\x9 </thead>
\x9\x9\x9\x9 <tbody>
\x9 ";
foreach ($this->value_specific_filter["filter_details"] as $gZ => $FK) {
echo " \x9\x9 \x9\x9 <tr>\xa \x9\x9 \x9\x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr($FK["column"]);
echo " </td>
\x9\x9\x9\x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Enter data of respective column in mentioned parameter</td>
\x9 \x9\x9\x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle">";
echo esc_attr($FK["condition"]);
echo "</td>
\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle mo-caw-form-content d-none" request-methods="get">";
echo esc_attr($FK["parameter"]);
echo "</td>\xa \x9\x9 \x9 \x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle mo-caw-form-content d-none" request-methods="get">";
echo isset($this->value_specific_filter["filter_relation"]) && !empty($this->value_specific_filter["filter_relation"][$gZ]) ? esc_attr(strtoupper($this->value_specific_filter["filter_relation"][$gZ])) : "None";
echo "</td>
\x9\x9\x9 \x9\x9</tr>\xa \x9\x9\x9 ";
lg:
}
Jx:
echo " \x9</tbody>
\x9 \x9 </table>\xa\x9 \x9\x9</div>
\x9 ";
Sl:
echo "\x9\x9 ";
if (empty($this->common_filters)) {
goto tx;
}
echo "\x9 \x9\x9<div class="mt-4">\xa\x9\x9 <h6 class="mbk mo-caw-element-to-toggle mo-caw-light-mode">Filters</h6>\xa \x9\x9\x9 <table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9<thead>\xa \x9\x9 \x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9\x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Filters Applied</th>\xa \x9\x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Column Name</th>\xa\x9 \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Order</th>\xa\x9 \x9 \x9 </tr>\xa \x9 </thead>\xa \x9\x9 <tbody>
\x9\x9\x9\x9\x9 <tr>
\x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Order By</td>
\x9 \x9 \x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr($this->common_filters["orderby"]["column"]);
echo "</td>\xa\x9 \x9 \x9\x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_attr(ucfirst($this->common_filters["orderby"]["option"]));
echo "</td>\xa\x9 \x9 \x9</tr>\xa\x9 </tbody>
\x9\x9 \x9</table>
\x9 </div>\xa\x9 \x9";
tx:
echo " \x9";
if (!(Constants::HTTP_POST === $this->method || Constants::HTTP_PUT === $this->method)) {
goto j0;
}
$o_ = $this->request_columns;
$t2 = array_fill_keys($o_, "value");
$vC = wp_json_encode($t2, JSON_PRETTY_PRINT);
echo "\x9\x9 <h6 class="mb-3 mo-caw-element-to-toggle mo-caw-light-mode">Required parameters for Custom APIs</h6>\xa\x9\x9\x9<div id="mo-caw-external-api-request-format-block">
\x9\x9\x9\x9<ul class="nav nav-tabs nav-pills border-0 flex-column flex-sm-row text-center rounded mb-2">
\x9 \x9 <li class="nav-item mo-caw-bg-blue-light flex-sm-fill coln">\xa\x9\x9\x9 <a class="nav-link active" data-bs-toggle="tab" href="#mo-caw-external-api-request-format-x-www">X-WWW-FORM-URLENCODED</a>\xa \x9\x9</li>\xa\x9\x9 \x9 <li class="nav-item mo-caw-bg-blue-light flex-sm-fill col-6">\xa\x9 \x9 \x9 <a class="nav-link" data-bs-toggle="tab" href="#mo-caw-external-api-request-format-json">JSON</a>\xa\x9 \x9\x9 </li>\xa\x9 \x9 </ul>
\x9\x9 </div>\xa \x9<div class="tab-content pbk">
\x9\x9 <div class="tab-pane active" id="mo-caw-external-api-request-format-x-www">\xa \x9\x9<div>
\x9\x9\x9 \x9 <table class="table text-center fs-6 border borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9<thead>
\x9 \x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9 \x9\x9\x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 pk align-middle">Header Name</th>
\x9\x9\x9\x9\x9\x9\x9 <th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottomh col-md-3 p-3 align-middle">Header Value</th>\xa\x9 \x9 </tr>
\x9 \x9 </thead>
\x9 \x9<tbody>
\x9 \x9\x9 \x9 <tr>
\x9 \x9 \x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using POST/PUT method with x-www-form-urlencoded format">Content-Type</td>
\x9 \x9 \x9<td class="col-md-3 borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_html(Constants::X_WWW_HEADER_NAME);
echo "</td>
\x9 \x9 \x9</tr>
\x9\x9 \x9\x9\x9</tbody>\xa\x9\x9 \x9\x9</table>\xa \x9<div class="overflow-auto mh-50 mo-caw-table-wrapper" >\xa\x9 \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9 \x9\x9\x9 \x9\x9<thead class="sticky-top">
\x9\x9\x9 \x9\x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9 \x9 \x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Body Parameter Name</th>\xa \x9\x9 \x9 \x9<th scope="col" class="borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-mdk p-3 align-middle">Body Parameter Value</th>
\x9 \x9 </tr>\xa\x9\x9\x9 \x9\x9\x9 </thead>
\x9\x9\x9\x9\x9 \x9<tbody>\xa\x9\x9\x9 \x9\x9 \x9 ";
foreach ($this->request_columns as $O0 => $I4) {
echo "\x9 \x9 \x9\x9 \x9\x9<tr>\xa\x9\x9 \x9\x9 \x9\x9 <td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode pk align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using x-www-form-urlencoded format">";
echo esc_html($I4);
echo " </td>
\x9\x9 \x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Column Value</td>\xa\x9 \x9\x9\x9\x9 </tr>
\x9 \x9\x9\x9\x9";
WW:
}
S0:
echo "\x9\x9\x9\x9\x9 </tbody>
\x9 \x9 \x9\x9 </table>
\x9\x9 \x9 </div>
\x9\x9 </div>
\x9\x9\x9</div>\xa\x9\x9 \x9<div class="tab-pane fade" id="mo-caw-external-api-request-format-json">
\x9\x9 <div>\xa\x9 \x9 <table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa\x9 \x9 \x9 <thead>\xa\x9\x9\x9\x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9\x9\x9\x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Header Name</th>
\x9\x9 \x9\x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Header Value</th>
\x9 \x9\x9 \x9\x9\x9</tr>\xa \x9\x9\x9\x9 </thead>\xa\x9 \x9 \x9 <tbody>
\x9\x9\x9 \x9 \x9\x9<tr>\xa \x9 \x9\x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using POST/PUT method with application/json format">Content-Type</td>
\x9\x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">";
echo esc_html(Constants::JSON_HEADER_NAME);
echo "</td>\xa \x9 \x9 \x9</tr>
\x9\x9\x9\x9 </tbody>\xa\x9\x9\x9\x9\x9 </table>\xa\x9\x9 \x9\x9<table class="table text-center fs-6 border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9\x9 <thead>\xa \x9\x9 \x9 <tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9\x9\x9 \x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Body</th>\xa\x9\x9 \x9\x9\x9\x9\x9</tr>
</thead>
\x9\x9\x9\x9\x9\x9</table>
\x9\x9 \x9\x9\x9<div>
\x9 \x9\x9\x9 \x9<textarea class="form-control mo-caw-form-control py-1" id="mo-caw-external-api-json-body" name="mo-caw-external-api-json-body" placeholder="Add JSON body" rows="10">";
echo esc_attr($vC);
echo "</textarea>
\x9 \x9\x9</div>\xa \x9 \x9</div>\xa\x9 \x9\x9</div>
\x9 </div>\xa\x9 ";
j0:
echo "\x9\x9 <div class="mt-4">
\x9\x9\x9<h6 class="mbk mo-caw-element-to-toggle mo-caw-light-mode">Request parameters for Pagination <em class="fw-normal">(Optional)</em></h6>\xa \x9\x9 <table class="table text-center fsn border border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">
\x9<thead>\xa \x9\x9\x9\x9\x9<tr class="mo-caw-bg-blue-light mo-caw-rounded-top border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode">\xa \x9 \x9<th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 p-3 align-middle">Parameter Name</th>\xa \x9 \x9\x9 <th scope="col" class="border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode border-bottom-0 col-md-3 pk align-middle">Description</th>\xa \x9 </tr>\xa \x9 </thead>\xa\x9 \x9 <tbody>\xa\x9\x9 \x9 <tr>\xa \x9 \x9 \x9<td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Required if using pagination">size</td>
\x9\x9\x9\x9\x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Defines page size</td>
\x9</tr>
\x9\x9\x9\x9\x9\x9<tr>
\x9\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Optional in pagination">page</td>\xa\x9 \x9 <td class="col-md-3 border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Page number needed in the response <em>(starts from)</em></td>
\x9\x9 </tr>\xa \x9 \x9\x9\x9<tr>
\x9\x9\x9\x9<td class="col-mdk border-1 mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Optional in pagination">offset</td>
\x9\x9\x9 <td class="col-md-3 borderi mo-caw-dark-border mo-caw-element-to-toggle mo-caw-light-mode p-3 align-middle">Defines from which count number to start returning data <em>(starts from 1)</em></td>
\x9 \x9</tr>\xa \x9 \x9</tbody>\xa \x9 </table>\xa </div>
\x9 </div>\xa \x9<div class="d-flex justify-content-between align-items-end my-4 d-none"> \xa\x9\x9 <h6 class="fw-bolder mo-caw-element-to-toggle mo-caw-light-mode">Code Snippets</h6>
<div class="dropdown">
\x9 <button class="btn mo-caw-btn-outline-blue-medium dropdown-toggle mo-caw-rounded- mo-caw-dropdown-toggle mo-caw-element-to-toggle mo-caw-light-mode" type="button" id="mo-caw-custom-api-test-result-dropdown" data-bs-toggle="dropdown" aria-expanded="false" ";
echo esc_attr($this->license_status);
echo ">
\x9\x9 \x9\x9Select Language
</button>\xa \x9\x9\x9<ul class="dropdown-menu mo-caw-dropdown-menu" aria-labelledby="mo-caw-custom-api-test-result-dropdown">\xa\x9\x9\x9 <li><a class="dropdown-item" href="#">Node.js</a></li>
\x9 \x9 <li><a class="dropdown-item" href="#">PHP</a></li>
\x9 \x9<li><a class="dropdown-item" href="#">Python</a></li>
\x9 </ul>\xa\x9 \x9</div>
\x9\x9</div>
<div class="bg-white mo-caw-shadow p-3 mo-caw-rounded-16 d-none">
\x9<pre>\xa \x9 const axios = require('axios');
\x9 const url = 'http://localhost/wp_1/wp-json/mo/v1/bghfx/{args}/{attempts}';
\x9\x9 xios.get(url)
\x9 \x9 .then(response => {\xa \x9\x9\x9 console.log(response.data);
\x9\x9\x9 })
\x9 .catch(error => {\xa console.error('Request failed:', error);
\x9 \x9 });\xa\x9\x9 </pre>
\x9 </div>
\x9 ";
}
private function display_api_creation_export()
{
}
}
© 2023 Quttera Ltd. All rights reserved.