| 1 |
<?php |
| 2 |
namespace MasterAddons\Inc\Admin\WidgetBuilder\Controls; |
| 3 |
|
| 4 |
defined('ABSPATH') || exit; |
| 5 |
|
| 6 |
/** |
| 7 |
* HEADING Control |
| 8 |
* Handles Elementor HEADING control type |
| 9 |
* Section heading/title control for organizing widget settings |
| 10 |
* |
| 11 |
* Supported properties: |
| 12 |
* - label: The heading text to display |
| 13 |
* - name: Field name (used for control key) |
| 14 |
* |
| 15 |
* Common settings (handled by base class): |
| 16 |
* - separator: Control separator position |
| 17 |
* - condition: Conditional display logic |
| 18 |
*/ |
| 19 |
class Heading extends Control_Base { |
| 20 |
|
| 21 |
public function get_type() { |
| 22 |
return 'HEADING'; |
| 23 |
} |
| 24 |
|
| 25 |
public function build($control_key, $field) { |
| 26 |
$label = !empty($field['label']) ? $field['label'] : 'Heading'; |
| 27 |
|
| 28 |
// Check if responsive control |
| 29 |
$is_responsive = isset($field['responsive']) && $field['responsive']; |
| 30 |
|
| 31 |
// Build control header |
| 32 |
$content = $this->build_control_header($control_key, $label, 'HEADING', $is_responsive); |
| 33 |
|
| 34 |
// HEADING doesn't have specific properties beyond common ones |
| 35 |
// Add common properties |
| 36 |
$content .= $this->build_common_properties($field); |
| 37 |
|
| 38 |
// Close control |
| 39 |
$content .= $this->build_control_footer(); |
| 40 |
|
| 41 |
return $content; |
| 42 |
} |
| 43 |
|
| 44 |
protected function default_label() { |
| 45 |
return 'Heading'; |
| 46 |
} |
| 47 |
} |
| 48 |
|