| 1 |
<?php |
| 2 |
|
| 3 |
use MPHB\Views\SingleRoomTypeView; |
| 4 |
|
| 5 |
class MPHB_Divi_Accommodation_Type_Attribute_Module extends MPHB_Divi_Abstract_Accommodation_Module { |
| 6 |
|
| 7 |
public $slug = 'mphb-divi-accommodation-type-attribute'; |
| 8 |
|
| 9 |
|
| 10 |
public function init() { |
| 11 |
$this->name = esc_html__( 'HB Acc. Type Attribute', 'mphb-divi' ); |
| 12 |
} |
| 13 |
|
| 14 |
public function mphb_get_fields() { |
| 15 |
|
| 16 |
$attributes = self::get_accommodations_attributes_to_select(); |
| 17 |
|
| 18 |
return array( |
| 19 |
'selected_attribute' => array( |
| 20 |
'label' => esc_html__( 'Attributes', 'mphb-divi' ), |
| 21 |
'type' => 'select', |
| 22 |
'options' => $attributes, |
| 23 |
'default' => 'adults', |
| 24 |
'computed_affects' => array( |
| 25 |
'__html', |
| 26 |
), |
| 27 |
), |
| 28 |
'show_label' => array( |
| 29 |
'label' => esc_html__( 'Show label', 'mphb-divi' ), |
| 30 |
'type' => 'yes_no_button', |
| 31 |
'options' => array( |
| 32 |
'on' => esc_html__( 'Yes', 'mphb-divi' ), |
| 33 |
'off' => esc_html__( 'No', 'mphb-divi' ), |
| 34 |
), |
| 35 |
'default' => 'off', |
| 36 |
'computed_affects' => array( |
| 37 |
'__html', |
| 38 |
), |
| 39 |
), |
| 40 |
); |
| 41 |
} |
| 42 |
|
| 43 |
public static function get_html( $attrs = array() ) { |
| 44 |
return MPHB_Divi_Renderers::accommodation_attribute( $attrs ); |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
new MPHB_Divi_Accommodation_Type_Attribute_Module(); |
| 49 |
|