| 1 |
<?php |
| 2 |
|
| 3 |
class VP_Control_Field_Toggle extends VP_Control_Field |
| 4 |
{ |
| 5 |
|
| 6 |
public function __construct() |
| 7 |
{ |
| 8 |
parent::__construct(); |
| 9 |
$this->add_container_extra_classes('vp-checked-field'); |
| 10 |
} |
| 11 |
|
| 12 |
public static function withArray($arr = array(), $class_name = null) |
| 13 |
{ |
| 14 |
if(is_null($class_name)) |
| 15 |
$instance = new self(); |
| 16 |
else |
| 17 |
$instance = new $class_name; |
| 18 |
$instance->_basic_make($arr); |
| 19 |
return $instance; |
| 20 |
} |
| 21 |
|
| 22 |
public function render($is_compact = false) |
| 23 |
{ |
| 24 |
$this->_setup_data(); |
| 25 |
$this->add_data('is_compact', $is_compact); |
| 26 |
return VP_View::instance()->load('control/toggle', $this->get_data()); |
| 27 |
} |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* EOF |
| 33 |
*/ |