| 1 |
<div class="usk-modal-overlay" id="ultimate-builder-kit-builder-modal" style="display: none"> |
| 2 |
<div id="ultimate-builder-kit-builder-modal-wrapper"> |
| 3 |
<div class="usk-template-modal-header"> |
| 4 |
<div class="usk-modal-logo-wrap"> |
| 5 |
<img class="usk-modal-logo" src="<?php echo esc_attr( BDTUSK_ADM_ASSETS_URL . '/images/logo.svg' ) ?>" |
| 6 |
alt=""> |
| 7 |
<span class="usk-logo-text">New Template</span> |
| 8 |
</div> |
| 9 |
<div class="usk-modal-close-button"> |
| 10 |
<a href="javascript:void(0)"> |
| 11 |
<span class="dashicons dashicons-no-alt"></span> |
| 12 |
</a> |
| 13 |
</div> |
| 14 |
</div> |
| 15 |
<div class="usk-template-modal-main-wrap"> |
| 16 |
<div class="usk-modal-content-wrap"> |
| 17 |
<h3 class="usk-modal-title">Templates Help You <span>Work Efficiently</span> |
| 18 |
</h3> |
| 19 |
<div class="usk-modal-desc">Use templates to create the |
| 20 |
different pieces of your site, and reuse them |
| 21 |
with one click whenever needed. |
| 22 |
</div> |
| 23 |
</div> |
| 24 |
<div class="usk-modal-form-wrap"> |
| 25 |
<form class="usk-modal-form" method="post"> |
| 26 |
<input type="hidden" name="template_id" value="" class="template_id" /> |
| 27 |
<div class="usk-form-title">Choose Template Type</div> |
| 28 |
<label for="template_type">Select the type of template you want to work on</label> |
| 29 |
<select name="template_type" id="template_type"> |
| 30 |
<option value="">select</option> |
| 31 |
<?php |
| 32 |
|
| 33 |
$templates = \UltimateStoreKit\Includes\Builder\Builder_Template_Helper::templateForSelectDropdown(); |
| 34 |
$separator = \UltimateStoreKit\Includes\Builder\Builder_Template_Helper::separator(); |
| 35 |
|
| 36 |
// It is single |
| 37 |
if ( count( $templates ) == 1 ) { |
| 38 |
$templateKey = array_key_last( $templates ); |
| 39 |
$template = $templates[ $templateKey ]; |
| 40 |
foreach ( $template as $key => $item ) : |
| 41 |
$selectValue = "{$templateKey}{$separator}{$key}"; |
| 42 |
?> |
| 43 |
<option value="<?php echo esc_attr( $selectValue ) ?>"><?php echo esc_attr( $item ) ?></option> |
| 44 |
<?php |
| 45 |
endforeach; |
| 46 |
} |
| 47 |
|
| 48 |
if ( count( $templates ) > 1 ) { |
| 49 |
foreach ( $templates as $keys => $items ) : |
| 50 |
$label = ucwords( str_replace( [ '-', '_' ], [ ' ' ], $keys ) ); |
| 51 |
if ( is_array( $items ) ) { |
| 52 |
?> |
| 53 |
<optgroup label="<?php echo esc_attr( $label ) ?>"><?php |
| 54 |
foreach ( $items as $key => $item ) : |
| 55 |
$itemValue = "{$keys}{$separator}{$key}" |
| 56 |
?> |
| 57 |
<option value="<?php echo esc_attr( $itemValue ) ?>"><?php echo esc_attr( $item ) ?></option> |
| 58 |
<?php |
| 59 |
endforeach; |
| 60 |
?> |
| 61 |
</optgroup> |
| 62 |
<?php |
| 63 |
} |
| 64 |
endforeach; |
| 65 |
} |
| 66 |
?> |
| 67 |
</select> |
| 68 |
<label for="fname">Name your template</label> |
| 69 |
<input type="text" name="template_name" id="template_name" placeholder="Enter template name"> |
| 70 |
<select name="template_status" id="template_status"> |
| 71 |
<option value="">select</option> |
| 72 |
<option value="1">Active</option> |
| 73 |
<option value="0">Inactive</option> |
| 74 |
</select> |
| 75 |
<input class="usk-modal-submit-btn" type="submit" value="Create Template"> |
| 76 |
</form> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
|
| 83 |
<style> |
| 84 |
.input-error { |
| 85 |
border: 1px solid red !important; |
| 86 |
} |
| 87 |
</style> |