| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
class FrmAlignStyleComponent extends FrmStyleComponent { |
| 6 |
|
| 7 |
/** |
| 8 |
* The view file name. |
| 9 |
* |
| 10 |
* @since 6.14 |
| 11 |
* |
| 12 |
* @var string |
| 13 |
*/ |
| 14 |
protected $view_name = 'align'; |
| 15 |
|
| 16 |
/** |
| 17 |
* Construct the FrmAlignStyleComponent. |
| 18 |
* |
| 19 |
* @since 6.14 |
| 20 |
*/ |
| 21 |
public function __construct( $field_name, $field_value, $data ) { |
| 22 |
$this->init( $data, $field_name, $field_value ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Get the wrapper classname. |
| 27 |
* |
| 28 |
* @since 6.14 |
| 29 |
* |
| 30 |
* @return string |
| 31 |
*/ |
| 32 |
protected function get_wrapper_class_name() { |
| 33 |
$class = $this->get_default_wrapper_class_names(); |
| 34 |
$class .= ' frm-align-component frm-radio-component'; |
| 35 |
|
| 36 |
if ( empty( $this->data['options'] ) || 2 !== count( $this->data['options'] ) ) { |
| 37 |
return $class; |
| 38 |
} |
| 39 |
|
| 40 |
return $class . ' frm-2-options'; |
| 41 |
} |
| 42 |
} |
| 43 |
|