ver 1.4.0
This commit is contained in:
213
templates/editor/js-template-repeater-card.php
Normal file
213
templates/editor/js-template-repeater-card.php
Normal file
@@ -0,0 +1,213 @@
|
||||
<!-- Handlebars Template for Fields -->
|
||||
<script id="fields-template" type="text/x-handlebars-template">
|
||||
{{#each fields}}
|
||||
<div class="dw-checker-field">
|
||||
<label for="{{fieldId}}" style="color: {{fieldLabelColor}}; display: {{fieldDisplayLabel}};">{{fieldLabel}}</label>
|
||||
{{#if isTextField}}
|
||||
<input name="{{fieldId}}" placeholder="{{fieldPlaceholder}}"/>
|
||||
{{else if isSelectField}}
|
||||
<select name="{{fieldId}}" placeholder="{{fieldPlaceholder}}">
|
||||
<option value="" selected disabled>-- {{fieldPlaceholder}} --</option>
|
||||
{{#each uniqueValues}}
|
||||
<option value="{{this}}">{{this}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</script>
|
||||
|
||||
<!-- Vertical Table Template -->
|
||||
<script id="vertical-table-template" type="text/x-handlebars-template">
|
||||
<div class="dw-checker-results-container">
|
||||
{{#each results}}
|
||||
<div class="result-page" data-page="{{@index}}">
|
||||
<table class="dw-checker-result-table" {{{getStyle ../resultDivider ../resultDividerWidth}}}>
|
||||
<tbody>
|
||||
{{#each this}}
|
||||
{{#unless (getColumnSetting @key 'hide')}}
|
||||
<tr>
|
||||
<th {{{getStyleHeader ../resultDivider ../resultDividerWidth ../headerColor}}}>
|
||||
<span class="dw-checker-result-header">{{@key}}</span>
|
||||
</th>
|
||||
<td {{{getStyleValue ../resultDivider ../resultDividerWidth ../valueColor}}}>
|
||||
{{#if (eq (getColumnSetting @key 'type') 'link_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="{{getValueWithPrefix @key}}" class="btn btn-primary">{{getColumnSetting @key 'button_text'}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type') 'whatsapp_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="https://wa.me/{{getValueWithPrefix @key}}" class="btn btn-success">{{getColumnSetting @key 'button_text'}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type') 'text')}}
|
||||
<!-- Raw value for text type -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{else}}
|
||||
<!-- Default behavior: raw value -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="pagination-controls">
|
||||
<button type="button" class="prev-page">Previous</button>
|
||||
<span class="current-page">Data 1</span>
|
||||
<button type="button" class="next-page">Next</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Div Template -->
|
||||
<script id="div-template" type="text/x-handlebars-template">
|
||||
<div class="dw-checker-results-container">
|
||||
{{#each results}}
|
||||
<div class="result-page" data-page="{{@index}}">
|
||||
<div class="dw-checker-result-div" {{{getStyle ../resultDivider ../resultDividerWidth}}}>
|
||||
{{#each this}}
|
||||
{{#unless (getColumnSetting @key 'hide')}}
|
||||
<div class="dw-checker-result-div-item" {{{getStyleHeader ../resultDivider ../resultDividerWidth ../headerColor}}}>
|
||||
<div class="result-header" {{{getStyleHeader ../resultDivider ../resultDividerWidth ../headerColor}}}>
|
||||
<span class="dw-checker-result-header">{{@key}}</span>
|
||||
</div>
|
||||
<div class="result-value" {{{getStyleValue ../resultDivider ../resultDividerWidth ../valueColor}}}>
|
||||
{{#if (eq (getColumnSetting @key 'type') 'link_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="{{getValueWithPrefix @key}}" class="btn btn-primary">{{getColumnSetting @key 'button_text'}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type') 'whatsapp_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="https://wa.me/{{getValueWithPrefix @key}}" class="btn btn-success">{{getColumnSetting @key 'button_text'}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type') 'text')}}
|
||||
<!-- Raw value for text type -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{else}}
|
||||
<!-- Default behavior: raw value -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="pagination-controls">
|
||||
<button type="button" class="prev-page">Previous</button>
|
||||
<span class="current-page">Data 1</span>
|
||||
<button type="button" class="next-page">Next</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Card Template -->
|
||||
<script id="cards-template" type="text/x-handlebars-template">
|
||||
<div class="dw-cards-container">
|
||||
{{#each results}}
|
||||
<div class="result-page" data-page="{{@index}}" style="display: none;">
|
||||
{{#each this}}
|
||||
<div class="dw-card">
|
||||
<div class="dw-card-item">
|
||||
<h6 class="dw-card-title">{{@key}}</h6>
|
||||
<p class="dw-card-value">
|
||||
{{#if (eq (getColumnSetting @key 'type' this) 'link_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="{{getValueWithPrefix @key}}" class="btn btn-primary">{{getColumnSetting @key 'button_text'}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type' this) 'whatsapp_button')}}
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} <a href="https://wa.me/{{getValueWithPrefix @key}}" class="btn btn-success">{{getColumnSetting @key 'button_text' this}}</a></span>
|
||||
{{else if (eq (getColumnSetting @key 'type' this) 'text')}}
|
||||
<!-- Raw value for text type -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{else}}
|
||||
<!-- Default behavior: raw value -->
|
||||
<span class="dw-checker-result-value">{{getColumnSetting @key 'prefix' this}} {{formatValue this}}</span>
|
||||
{{/if}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="pagination-controls">
|
||||
<button type="button" class="prev-page">Previous</button>
|
||||
<span class="current-page">Data 1</span>
|
||||
<button type="button" class="next-page">Next</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- General Table Template -->
|
||||
<script id="standard-table-template" type="text/x-handlebars-template">
|
||||
<table class="dw-standard-table table">
|
||||
<thead>
|
||||
<tr>
|
||||
{{#each columnHeaders}}
|
||||
<th>{{this}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each results}}
|
||||
<tr>
|
||||
{{#each this}}
|
||||
<td>{{formatValue this}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
|
||||
<script id="repeater-template" type="text/x-handlebars-template">
|
||||
{{#each fields}}
|
||||
<div class="card shadow repeater-card gap-2 position-relative">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Field ID</label></div>
|
||||
<div class="col-9">
|
||||
<input class="form-control field-id" value="{{@key}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Kolom</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[fields][{{@key}}][kolom]" class="form-select form-control border select-kolom">
|
||||
{{#each kolom}}
|
||||
<option value="{{this}}">{{this}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Tipe</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[fields][{{@key}}][type]" class="form-select form-control border select-field-type">
|
||||
<option value="text" {{#ifCond type '==' 'text'}}selected{{/ifCond}}>Text</option>
|
||||
<option value="select" {{#ifCond type '==' 'select'}}selected{{/ifCond}}>Select</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Label</label></div>
|
||||
<div class="col-9">
|
||||
<input name="checker[fields][{{@key}}][label]" class="form-control field-label" value="{{label}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Placeholder</label></div>
|
||||
<div class="col-9">
|
||||
<input name="checker[fields][{{@key}}][placeholder]" class="form-control field-placeholder" value="{{placeholder}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Value Matcher</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[fields][{{@key}}][match]" class="form-select form-control border select-match-type">
|
||||
<option value="match" {{#ifCond match '==' 'match'}}selected{{/ifCond}}>Match</option>
|
||||
<option value="contain" {{#ifCond match '==' 'contain'}}selected{{/ifCond}}>Contain</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-buttons d-flex gap-2 flex-column position-absolute">
|
||||
<button type="button" class="btn btn-secondary py-1 px-2 move-card"><i class="bi bi-arrow-down-up"></i></button>
|
||||
<button type="button" class="btn btn-danger py-1 px-2 delete-form-card"><i class="bi bi-x"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</script>
|
||||
55
templates/editor/js-template-setting-output.php
Normal file
55
templates/editor/js-template-setting-output.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<script id="output-template" type="text/x-handlebars-template">
|
||||
{{#each data}}
|
||||
<div class="card p-0">
|
||||
<div class="card-header">
|
||||
<h6 class="mb-0">{{key}}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input output-value-visibility" type="checkbox" value="{{hide}}" id="output-visibility-{{id}}" name="checker[output][{{id}}][hide]" {{#ifCond hide '==' 'yes'}}checked{{/ifCond}}>
|
||||
<label class="form-check-label" for="output-visibility-{{id}}">
|
||||
Hide
|
||||
</label>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Type</label></div>
|
||||
<div class="col-9">
|
||||
<input type="hidden" name="checker[output][{{id}}][key]" value="{{key}}">
|
||||
<select name="checker[output][{{id}}][type]" id="output-type-{{id}}" class="output-type w-100">
|
||||
<option value="text" {{#ifCond type '==' 'text'}}selected{{/ifCond}}>Text</option>
|
||||
<option value="link_button" {{#ifCond type '==' 'link_button'}}selected{{/ifCond}}>Link Button</option>
|
||||
<option value="whatsapp_button" {{#ifCond type '==' 'whatsapp_button'}}selected{{/ifCond}}>WhatsApp Button</option>
|
||||
<option value="image" {{#ifCond type '==' 'image'}}selected{{/ifCond}}>Image</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2 type-button-link" {{#ifCond type '==' 'text'}}style="display:none;"{{/ifCond}}>
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Button Text</label></div>
|
||||
<div class="col-9">
|
||||
<input type="text" id="output-buttontext-{{id}}" name="checker[output][{{id}}][button_text]" value="{{button_text}}" class="w-100"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Prefix</label></div>
|
||||
<div class="col-9">
|
||||
<input type="text" id="output-prefix-{{id}}" name="checker[output][{{id}}][prefix]" value="{{prefix}}" class="w-100"/>
|
||||
</div>
|
||||
</div>
|
||||
{{#if display}}
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">BG Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" id="output-bg_color-{{id}}" name="checker[output][{{id}}][bg_color]" value="{{bg_color}}" class="w-100"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Text Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" id="output-text_color-{{id}}" name="checker[output][{{id}}][text_color]" value="{{text_color}}" class="w-100"/>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</script>
|
||||
38
templates/editor/preview.php
Normal file
38
templates/editor/preview.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="checker-preview container bg-light rounded">
|
||||
<div id="dummy">Fill Sheet URL first...</div>
|
||||
<div class="dw-checker-container" id="dw-checker-form">
|
||||
<div class="dw-checker-wrapper">
|
||||
<div class="dw-checker-title">Title</div>
|
||||
<div class="dw-checker-description"></div>
|
||||
<hr class="dw-checker-divider">
|
||||
<div class="dw-checker-form-fields"></div>
|
||||
<hr class="dw-checker-divider">
|
||||
<div class="dw-checker-buttons dw-checker-form-button">
|
||||
<button type="button" class="search-button"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dw-checker-container" id="dw-checker-result" style="display:none;">
|
||||
<div class="dw-checker-wrapper">
|
||||
<div class="dw-checker-title">Title</div>
|
||||
<div class="dw-checker-description"></div>
|
||||
<hr class="dw-checker-divider">
|
||||
<div class="dw-checker-results"></div>
|
||||
<hr class="dw-checker-divider">
|
||||
<div class="dw-checker-buttons dw-checker-result-button">
|
||||
<button type="button" class="back-button"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dw-checker-container" id="dw-checker-outside-results" style="display: none;">
|
||||
<div class="dw-checker-wrapper"></div>
|
||||
</div>
|
||||
<input type="hidden" id="post_id" value="<?= (isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] == 'edit') ? $_GET['post'] : '' ?>">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="input-group mt-3">
|
||||
<span class="input-group-text" id="basic-addon2">Reset Preview Interval</span>
|
||||
<input type="number" id="preview-interval" class="form-control border text-end pe-2" aria-describedby="basic-addon2" value="10">
|
||||
<span class="input-group-text border" id="basic-addon2">seconds</span>
|
||||
<button class="btn btn-primary border-primary set-preview"><i class="bi bi-arrow-clockwise me-1"></i>Refresh</button>
|
||||
</div>
|
||||
125
templates/editor/setting-table-card.php
Normal file
125
templates/editor/setting-table-card.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<table class="table checker-setting" data-toggle="table" id="checker-card">
|
||||
<tbody>
|
||||
<tr class="sheet_link">
|
||||
<th><label for="link">Sheet CSV/TSV Link</label></th>
|
||||
<td><textarea type="url" id="link" name="checker[link]" class="form-control sheet-url"><?php echo esc_url( $checker['link'] ?? '' ); ?></textarea></td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th><label for="description">Description</label></th>
|
||||
<td><textarea id="description" class="form-control" name="checker[description]"><?php echo esc_textarea( $checker['description'] ?? '' ); ?></textarea></td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display:none;">
|
||||
<th>Card</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Width</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[card][width]" class="form-control border card-width" value="<?php echo esc_attr( $checker['card']['width'] ?? '500' ); ?>" />
|
||||
<span class="input-group-text">px</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Background</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[card][background]" class="form-control border card-background" value="<?php echo esc_attr( $checker['card']['background'] ?? '#cccccc' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Color Opacity</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[card][bg_opacity]" class="form-control border card-bg-opacity" min="0" max="100" step="1" value="<?php echo esc_attr( $checker['card']['bg_opacity'] ?? '100' ); ?>" />
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Padding</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[card][padding]" class="form-control border card-padding" value="<?php echo esc_attr( $checker['card']['padding'] ?? '1' ); ?>" />
|
||||
<span class="input-group-text">em</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Border Radius</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[card][border_radius]" class="form-control border card-border-radius" value="<?php echo esc_attr( $checker['card']['border_radius'] ?? '1' ); ?>" />
|
||||
<span class="input-group-text">em</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Box Shadow</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="text" name="checker[card][box_shadow]" class="form-control border card-box-shadow" value="<?php echo esc_attr( $checker['card']['box_shadow'] ?? '10px 5px 15px -5px' ); ?>" />
|
||||
<input type="color" name="checker[card][box_shadow_color]" class="form-control border card-box-shadow-color" value="<?php echo esc_attr( $checker['card']['box_shadow_color'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display:none;">
|
||||
<th>Title & Description</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Title Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[card][title]" class="form-control border card-title" value="<?php echo esc_attr( $checker['card']['title'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Title Align</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[card][title_align]" class="form-select form-control border card-title-align">
|
||||
<option value="left" <?= ($checker['card']['title_align'] == 'left') ? 'checked' : '' ?>>Left</option>
|
||||
<option value="center" <?= ($checker['card']['title_align'] == 'center') ? 'checked' : '' ?>>Center</option>
|
||||
<option value="right" <?= ($checker['card']['title_align'] == 'right') ? 'checked' : '' ?>>Right</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Description Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[card][description]" class="form-control border card-description" value="<?php echo esc_attr( $checker['card']['description'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Description Align</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[card][description_align]" class="form-select form-control border card-description-align">
|
||||
<option value="left" <?= ($checker['card']['description_align'] == 'left') ? 'checked' : '' ?>>Left</option>
|
||||
<option value="center" <?= ($checker['card']['description_align'] == 'center') ? 'checked' : '' ?>>Center</option>
|
||||
<option value="right" <?= ($checker['card']['description_align'] == 'right') ? 'checked' : '' ?>>Right</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display:none;">
|
||||
<th>Divider</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[card][divider]" class="form-control border card-divider" value="<?php echo esc_attr( $checker['card']['divider'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Width</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[card][divider_width]" class="form-control border card-divider-width" value="<?php echo esc_attr( $checker['card']['divider_width'] ?? '1' ); ?>" />
|
||||
<span class="input-group-text">px</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
139
templates/editor/setting-table-form.php
Normal file
139
templates/editor/setting-table-form.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<table class="table checker-setting" data-toggle="table" id="checker-form" style="display:none;">
|
||||
<tbody>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Form Appearance</th>
|
||||
<td>
|
||||
<div class="row mb-3">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Label Visibility</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[field][label]" class="form-select form-control border field-display-label">
|
||||
<option value="block" <?= ($checker['field']['label'] == 'block') ? 'selected' : '' ?>>Show</option>
|
||||
<option value="none" <?= ($checker['field']['label'] == 'none') ? 'selected' : '' ?>>Hide</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Label Color</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[field][label-color]" class="form-control border field-label-color" value="<?php echo esc_attr( $checker['field']['label-color'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Form Fields</label></div>
|
||||
<div class="col-9">
|
||||
<div class="repeater-form-field inset bg-light">
|
||||
<?php
|
||||
if(isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] == 'edit'){
|
||||
?>
|
||||
<div class="card shadow repeater-card gap-2 position-relative placeholder-glow">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Field ID</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Column</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Type</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Label</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Placeholder</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Value Matcher</label></div>
|
||||
<div class="col-9">
|
||||
<span class="placeholder col-12"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-buttons d-flex gap-2 flex-column position-absolute">
|
||||
<button type="button" class="btn btn-danger py-1 px-2 delete-form-card"><i class="bi bi-dash"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary mt-2 py-1 px-2 add-form-card float-end"><i class="bi bi-plus"></i> Add Field</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Search Button</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">"Search"</label></div>
|
||||
<div class="col-9">
|
||||
<input name="checker[search_button][text]" class="form-control search-btn-text" value="<?php echo esc_attr( $checker['search_button']['text'] ?? 'Search' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Background</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[search_button][bg_color]" class="form-control border search-btn-bg-color" value="<?php echo esc_attr( $checker['search_button']['bg_color'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Text</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[search_button][text_color]" class="form-control border search-btn-text-color" value="<?php echo esc_attr( $checker['search_button']['text_color'] ?? '#ffffff' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Position</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[search_button][position]" class="form-select form-control border search-btn-position">
|
||||
<option value="flex-start" <?= ($checker['search_button']['position'] == 'flex-start') ? 'selected' : '' ?>>Left</option>
|
||||
<option value="center" <?= ($checker['search_button']['position'] == 'center') ? 'selected' : '' ?>>Center</option>
|
||||
<option value="flex-end" <?= ($checker['search_button']['position'] == 'flex-end') ? 'selected' : '' ?>>Right</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>URL Parameters</th>
|
||||
<td>
|
||||
<div class="row mb-3">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Enable URL Params</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[url_params][enabled]" class="form-select url-params-enabled">
|
||||
<option value="no" <?= ($checker['url_params']['enabled'] ?? 'no') == 'no' ? 'selected' : '' ?>>Disabled</option>
|
||||
<option value="yes" <?= ($checker['url_params']['enabled'] ?? 'no') == 'yes' ? 'selected' : '' ?>>Enabled</option>
|
||||
</select>
|
||||
<small class="text-muted">Allow pre-filling form via URL parameters (e.g., ?Name=John&City=Jakarta)</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Auto Search</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[url_params][auto_search]" class="form-select url-params-auto-search">
|
||||
<option value="no" <?= ($checker['url_params']['auto_search'] ?? 'no') == 'no' ? 'selected' : '' ?>>No - Just fill form</option>
|
||||
<option value="yes" <?= ($checker['url_params']['auto_search'] ?? 'no') == 'yes' ? 'selected' : '' ?>>Yes - Auto submit</option>
|
||||
</select>
|
||||
<small class="text-muted">Automatically search when URL params are present</small>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
153
templates/editor/setting-table-result.php
Normal file
153
templates/editor/setting-table-result.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<table class="table checker-setting" data-toggle="table" id="checker-result" style="display:none;">
|
||||
<tbody>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Data Display Mode</th>
|
||||
<td>
|
||||
<div class="row mb-3">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Initial Display</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[result][initial_display]" class="form-select result-initial-display">
|
||||
<option value="hidden" <?= ($checker['result']['initial_display'] ?? 'hidden') == 'hidden' ? 'selected' : '' ?>>Hidden - Show after search</option>
|
||||
<option value="all" <?= ($checker['result']['initial_display'] ?? 'hidden') == 'all' ? 'selected' : '' ?>>Show All - Display all records</option>
|
||||
<option value="limited" <?= ($checker['result']['initial_display'] ?? 'hidden') == 'limited' ? 'selected' : '' ?>>Show Limited - First 10 records</option>
|
||||
</select>
|
||||
<small class="text-muted">How to display data on page load</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Filter Mode</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[result][filter_mode]" class="form-select result-filter-mode">
|
||||
<option value="search" <?= ($checker['result']['filter_mode'] ?? 'search') == 'search' ? 'selected' : '' ?>>Search - Submit to find</option>
|
||||
<option value="filter" <?= ($checker['result']['filter_mode'] ?? 'search') == 'filter' ? 'selected' : '' ?>>Filter - Real-time filtering</option>
|
||||
</select>
|
||||
<small class="text-muted">Search requires submit, Filter updates live as you type</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Max Records</label></div>
|
||||
<div class="col-9">
|
||||
<input type="number" name="checker[result][max_records]" class="form-control" value="<?= $checker['result']['max_records'] ?? 100 ?>" min="10" max="1000">
|
||||
<small class="text-muted">Maximum records to display (performance limit)</small>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Result Display Type</th>
|
||||
<td>
|
||||
<select name="checker[result][display]" class="form-select form-control border result-display-type">
|
||||
<option value="standard-table" <?= ($checker['result']['display'] == 'standard-table') ? 'selected' : '' ?>>Standard Table</option>
|
||||
<option value="vertical-table" <?= ($checker['result']['display'] == 'vertical-table') ? 'selected' : '' ?>>Vertical Table</option>
|
||||
<option value="div" <?= ($checker['result']['display'] == 'div') ? 'selected' : '' ?>>Div</option>
|
||||
<option value="cards" <?= ($checker['result']['display'] == 'cards') ? 'selected' : '' ?>>Card</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting-card-column" <?= ($checker['result']['display'] !== 'cards') ? 'style="display: none;"' : '' ?>>
|
||||
<th>Result Display Column</th>
|
||||
<td>
|
||||
<div class="card-column-settings d-flex gap-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm4 15h10m-8-4v4m6-4v4" />
|
||||
</svg>
|
||||
</span>
|
||||
<input type="number" class="form-control border" name="checker[result][card_grid][desktop]" value="<?= ($checker['result']['card_grid']['desktop']) ? $checker['result']['card_grid']['desktop'] : '4' ?>">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
|
||||
<path d="M5 4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1z" />
|
||||
<path d="M11 17a1 1 0 1 0 2 0a1 1 0 0 0-2 0" />
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="number" class="form-control border" name="checker[result][card_grid][tablet]" value="<?= ($checker['result']['card_grid']['tablet']) ? $checker['result']['card_grid']['tablet'] : '2' ?>">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2zm5-1h2m-1 13v.01" />
|
||||
</svg>
|
||||
</span>
|
||||
<input type="number" class="form-control border" name="checker[result][card_grid][mobile]" value="<?= ($checker['result']['card_grid']['mobile']) ? $checker['result']['card_grid']['mobile'] : '1' ?>">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Content</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Header</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[result][header]" class="form-control result-header" id="result_header" value="<?php echo esc_attr( $checker['result']['header'] ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Value</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[result][value]" class="form-control result-value" id="result_value" value="<?php echo esc_attr( $checker['result']['value'] ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Divider</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[result][divider]" class="form-control result-divider" value="<?php echo esc_attr( $checker['result']['divider'] ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Divider Width</label></div>
|
||||
<div class="col-9">
|
||||
<div class="input-group">
|
||||
<input type="number" name="checker[result][divider_width]" class="form-control border result-divider-width" value="<?php echo esc_attr( $checker['result']['divider_width'] ?? '1' ); ?>" />
|
||||
<span class="input-group-text">px</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Output Value</label></div>
|
||||
<div class="col-9">
|
||||
<div class="result-value-output inset bg-light"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Back Button</th>
|
||||
<td>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">"Back"</label></div>
|
||||
<div class="col-9">
|
||||
<input name="checker[back_button][text]" class="form-control back-btn-text" value="<?php echo esc_attr( $checker['back_button']['text'] ?? 'Back' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Background</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[back_button][bg_color]" class="form-control border back-btn-bg-color" value="<?php echo esc_attr( $checker['back_button']['bg_color'] ?? '#333333' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Text</label></div>
|
||||
<div class="col-9">
|
||||
<input type="color" name="checker[back_button][text_color]" class="form-control border back-btn-text-color" value="<?php echo esc_attr( $checker['back_button']['text_color'] ?? '#ffffff' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-3"><label class="form-label fw-bold mb-0">Position</label></div>
|
||||
<div class="col-9">
|
||||
<select name="checker[back_button][position]" class="form-select form-control border back-btn-position">
|
||||
<option value="flex-start" <?= ($checker['back_button']['position'] == 'flex-start') ? 'selected' : '' ?>>Left</option>
|
||||
<option value="center" <?= ($checker['back_button']['position'] == 'center') ? 'selected' : '' ?>>Center</option>
|
||||
<option value="flex-end" <?= ($checker['back_button']['position'] == 'flex-end') ? 'selected' : '' ?>>Right</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
165
templates/editor/setting-table-security.php
Normal file
165
templates/editor/setting-table-security.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<table class="table checker-setting" data-toggle="table" id="checker-security" style="display:none;">
|
||||
<tbody>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Rate Limiting</th>
|
||||
<td>
|
||||
<p class="text-muted small mb-3">Limit the number of searches per IP address to prevent abuse</p>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" value="yes" id="security-rate-limit-enabled" name="checker[security][rate_limit][enabled]" <?= isset($checker['security']['rate_limit']['enabled']) && $checker['security']['rate_limit']['enabled'] == 'yes' ? 'checked' : '' ?>>
|
||||
<label class="form-check-label fw-bold" for="security-rate-limit-enabled">
|
||||
Enable Rate Limiting
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="rate-limit-settings" style="<?= isset($checker['security']['rate_limit']['enabled']) && $checker['security']['rate_limit']['enabled'] == 'yes' ? '' : 'display:none;' ?>">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Max Attempts</label>
|
||||
<input type="number" name="checker[security][rate_limit][max_attempts]" value="<?= $checker['security']['rate_limit']['max_attempts'] ?? 5 ?>" class="form-control" min="1" max="100">
|
||||
<small class="text-muted">Maximum searches allowed per time window</small>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Time Window (minutes)</label>
|
||||
<input type="number" name="checker[security][rate_limit][time_window]" value="<?= $checker['security']['rate_limit']['time_window'] ?? 15 ?>" class="form-control" min="1" max="1440">
|
||||
<small class="text-muted">Reset attempts after this duration</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Block Duration (minutes)</label>
|
||||
<input type="number" name="checker[security][rate_limit][block_duration]" value="<?= $checker['security']['rate_limit']['block_duration'] ?? 60 ?>" class="form-control" min="1" max="10080">
|
||||
<small class="text-muted">How long to block after exceeding limit</small>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Error Message</label>
|
||||
<input type="text" name="checker[security][rate_limit][error_message]" value="<?= $checker['security']['rate_limit']['error_message'] ?? 'Too many attempts. Please try again later.' ?>" class="form-control">
|
||||
<small class="text-muted">Message shown when blocked</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Google reCAPTCHA v3</th>
|
||||
<td>
|
||||
<p class="text-muted small mb-3">Invisible CAPTCHA protection. <a href="https://www.google.com/recaptcha/admin" target="_blank">Get keys here</a></p>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" value="yes" id="security-recaptcha-enabled" name="checker[security][recaptcha][enabled]" <?= isset($checker['security']['recaptcha']['enabled']) && $checker['security']['recaptcha']['enabled'] == 'yes' ? 'checked' : '' ?>>
|
||||
<label class="form-check-label fw-bold" for="security-recaptcha-enabled">
|
||||
Enable reCAPTCHA v3
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="recaptcha-settings" style="<?= isset($checker['security']['recaptcha']['enabled']) && $checker['security']['recaptcha']['enabled'] == 'yes' ? '' : 'display:none;' ?>">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Site Key</label>
|
||||
<input type="text" name="checker[security][recaptcha][site_key]" value="<?= $checker['security']['recaptcha']['site_key'] ?? '' ?>" class="form-control" placeholder="6Lc...">
|
||||
<small class="text-muted">Public key for frontend</small>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Secret Key</label>
|
||||
<input type="text" name="checker[security][recaptcha][secret_key]" value="<?= $checker['security']['recaptcha']['secret_key'] ?? '' ?>" class="form-control" placeholder="6Lc...">
|
||||
<small class="text-muted">Private key for backend verification</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Minimum Score</label>
|
||||
<input type="number" name="checker[security][recaptcha][min_score]" value="<?= $checker['security']['recaptcha']['min_score'] ?? 0.5 ?>" class="form-control" min="0" max="1" step="0.1">
|
||||
<small class="text-muted">0.0 (bot) to 1.0 (human). Recommended: 0.5</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th>Cloudflare Turnstile</th>
|
||||
<td>
|
||||
<p class="text-muted small mb-3">Privacy-friendly CAPTCHA alternative. <a href="https://dash.cloudflare.com/?to=/:account/turnstile" target="_blank">Get keys here</a></p>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" value="yes" id="security-turnstile-enabled" name="checker[security][turnstile][enabled]" <?= isset($checker['security']['turnstile']['enabled']) && $checker['security']['turnstile']['enabled'] == 'yes' ? 'checked' : '' ?>>
|
||||
<label class="form-check-label fw-bold" for="security-turnstile-enabled">
|
||||
Enable Cloudflare Turnstile
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="turnstile-settings" style="<?= isset($checker['security']['turnstile']['enabled']) && $checker['security']['turnstile']['enabled'] == 'yes' ? '' : 'display:none;' ?>">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Site Key</label>
|
||||
<input type="text" name="checker[security][turnstile][site_key]" value="<?= $checker['security']['turnstile']['site_key'] ?? '' ?>" class="form-control" placeholder="0x4AAA...">
|
||||
<small class="text-muted">Public key for frontend</small>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Secret Key</label>
|
||||
<input type="text" name="checker[security][turnstile][secret_key]" value="<?= $checker['security']['turnstile']['secret_key'] ?? '' ?>" class="form-control" placeholder="0x4AAA...">
|
||||
<small class="text-muted">Private key for backend verification</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Theme</label>
|
||||
<select name="checker[security][turnstile][theme]" class="form-select">
|
||||
<option value="light" <?= isset($checker['security']['turnstile']['theme']) && $checker['security']['turnstile']['theme'] == 'light' ? 'selected' : '' ?>>Light</option>
|
||||
<option value="dark" <?= isset($checker['security']['turnstile']['theme']) && $checker['security']['turnstile']['theme'] == 'dark' ? 'selected' : '' ?>>Dark</option>
|
||||
<option value="auto" <?= isset($checker['security']['turnstile']['theme']) && $checker['security']['turnstile']['theme'] == 'auto' ? 'selected' : '' ?>>Auto</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="has-link" style="display: none;">
|
||||
<th colspan="2">
|
||||
<div class="alert alert-info mb-0">
|
||||
<strong>Note:</strong> Only enable ONE CAPTCHA solution at a time. reCAPTCHA and Turnstile cannot be used together.
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($){
|
||||
// Toggle rate limit settings
|
||||
$('#security-rate-limit-enabled').on('change', function(){
|
||||
if($(this).is(':checked')){
|
||||
$('.rate-limit-settings').slideDown();
|
||||
}else{
|
||||
$('.rate-limit-settings').slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
// Toggle reCAPTCHA settings
|
||||
$('#security-recaptcha-enabled').on('change', function(){
|
||||
if($(this).is(':checked')){
|
||||
$('.recaptcha-settings').slideDown();
|
||||
// Disable Turnstile if reCAPTCHA is enabled
|
||||
if($('#security-turnstile-enabled').is(':checked')){
|
||||
$('#security-turnstile-enabled').prop('checked', false).trigger('change');
|
||||
alert('reCAPTCHA enabled. Turnstile has been disabled.');
|
||||
}
|
||||
}else{
|
||||
$('.recaptcha-settings').slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
// Toggle Turnstile settings
|
||||
$('#security-turnstile-enabled').on('change', function(){
|
||||
if($(this).is(':checked')){
|
||||
$('.turnstile-settings').slideDown();
|
||||
// Disable reCAPTCHA if Turnstile is enabled
|
||||
if($('#security-recaptcha-enabled').is(':checked')){
|
||||
$('#security-recaptcha-enabled').prop('checked', false).trigger('change');
|
||||
alert('Turnstile enabled. reCAPTCHA has been disabled.');
|
||||
}
|
||||
}else{
|
||||
$('.turnstile-settings').slideUp();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
18
templates/editor/settings.php
Normal file
18
templates/editor/settings.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="row">
|
||||
<div class="col-2 bg-secondary p-0">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item option-nav-menu mb-0 pointer active" data-table="#checker-card">General</li>
|
||||
<li class="list-group-item option-nav-menu mb-0 pointer" data-table="#checker-form">Form</li>
|
||||
<li class="list-group-item option-nav-menu mb-0 pointer" data-table="#checker-result">Result</li>
|
||||
<li class="list-group-item option-nav-menu mb-0 pointer" data-table="#checker-security">Security</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/setting-table-card.php'; ?>
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/setting-table-form.php'; ?>
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/setting-table-result.php'; ?>
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/setting-table-security.php'; ?>
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/js-template-repeater-card.php'; ?>
|
||||
<?php require_once SHEET_CHECKER_PRO_PATH . 'templates/editor/js-template-setting-output.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
48
templates/license.php
Normal file
48
templates/license.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit('This cannot be accessed directly!');
|
||||
?>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<div class="wrap">
|
||||
|
||||
<?php
|
||||
if(isset($_GET['messages'])) {
|
||||
?>
|
||||
<div class="alert alert-dark d-flex align-items-center gap-2" role="alert">
|
||||
<i class="fa-light fa-circle-exclamation"></i>
|
||||
<div>
|
||||
<?php echo implode('<br>', $_GET['messages']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<h1>Sheet Data Checker License Activation</h1>
|
||||
<p>Welcome!<Br>Please activate your <b>Sheet Data Checker</b> by using an official lisense that you got after purchase.</p>
|
||||
<hr>
|
||||
<form class="card" action="" method="post">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="fw-bold form-label"><?php _e('Email', SHEET_CHECKER_PRO_DOMAIN); ?></label>
|
||||
<input type="email" name="data[user_email]" value="" class='regular-text form-control' required />
|
||||
<p class="description" id="tagline-description">Your account's email on member.dwindi.com</p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="fw-bold form-label"><?php _e('Password', SHEET_CHECKER_PRO_DOMAIN); ?></label>
|
||||
<input type="text" name="data[user_pass]" value="" class='regular-text form-control' required />
|
||||
<p class="description" id="tagline-description">Your account's password on member.dwindi.com</p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="fw-bold form-label"><?php _e('Kode Lisensi', SHEET_CHECKER_PRO_DOMAIN); ?></label>
|
||||
<input type="text" name="data[license]" value="" class='regular-text form-control' required />
|
||||
<p class="description" id="tagline-description">Your license code</p>
|
||||
</div>
|
||||
<button type="submit" name="button" class='btn btn-primary'>
|
||||
<?php _e('AKTIFKAN', SHEET_CHECKER_PRO_DOMAIN); ?>
|
||||
</button>
|
||||
<?php wp_nonce_field('sheetcheckerpro-input-license'); ?>
|
||||
</div>
|
||||
</form>
|
||||
<p class="my-2">Haven't a license yet? <a href="https://t.me/dwindown">Contact Us</a></p>
|
||||
</div>
|
||||
20
templates/single-checker.php
Normal file
20
templates/single-checker.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
<?php echo do_shortcode('[checker id="'.get_the_ID().'"]'); ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
Reference in New Issue
Block a user