| 1 |
<?php if (!defined('ABSPATH')) { |
| 2 |
die; |
| 3 |
} // Cannot access directly. |
| 4 |
/** |
| 5 |
* |
| 6 |
* Field: switcher_shortcode |
| 7 |
* |
| 8 |
* @since 1.0.0 |
| 9 |
* @version 1.0.0 |
| 10 |
* |
| 11 |
*/ |
| 12 |
if (!class_exists('DRK_LITE_Field_switcher_shortcode')) { |
| 13 |
class DRK_LITE_Field_switcher_shortcode extends DRK_LITE_Fields |
| 14 |
{ |
| 15 |
|
| 16 |
public function __construct($field, $value = '', $unique = '', $where = '', $parent = '') |
| 17 |
{ |
| 18 |
parent::__construct($field, $value, $unique, $where, $parent); |
| 19 |
} |
| 20 |
|
| 21 |
public function render() |
| 22 |
{ |
| 23 |
|
| 24 |
echo $this->field_before(); |
| 25 |
|
| 26 |
?> |
| 27 |
<textarea type='text' id='switcher_shortcode' class='switcher_shortcode_input' id='switcher_shortcode_after_copy' onClick='this.select();' readonly='readonly'>[darkify switch="1" width_height="60px" border_radius="7px" icon_size="40px" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116"]</textarea> |
| 28 |
|
| 29 |
<button id="switcher_shortcode_copy" class="button button-primary"><?php echo esc_html('Copy Shortcode', 'darkify-pro') ?></button> |
| 30 |
|
| 31 |
<div class='switcher_shortcode_after_copy'><i class='fa fa-check-circle'></i><?php echo esc_html('Shortcode Copied to Clipboard!', 'darkify-pro') ?></div> |
| 32 |
<?php |
| 33 |
|
| 34 |
|
| 35 |
echo (!empty($this->field['label'])) ? '<span class="drk--label">' . esc_attr($this->field['label']) . '</span>' : ''; |
| 36 |
|
| 37 |
echo $this->field_after(); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|