PluginProbe
WP Ultimate Post Grid / 2.8.0
WP Ultimate Post Grid v2.8.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / vendor / vafpress / classes / control / field / html.php

html.php in WP Ultimate Post Grid 2.8.0, at vendor/vafpress/classes/control/field/html.php

73 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class VP_Control_Field_HTML extends VP_Control_Field
4 {
5
6 protected $_height;
7
8 public function __construct()
9 {
10 parent::__construct();
11 }
12
13 public static function withArray($arr = array(), $class_name = null)
14 {
15 if(is_null($class_name))
16 $instance = new self();
17 else
18 $instance = new $class_name;
19 $instance->_basic_make($arr);
20 $instance->set_height(isset($arr['height']) ? $arr['height'] : 'auto');
21 return $instance;
22 }
23
24 protected function _setup_data()
25 {
26 $this->add_data('height', $this->get_height());
27 parent::_setup_data();
28 }
29
30 public function render($is_compact = false)
31 {
32 // Setup Data
33 $this->_setup_data();
34 $this->add_data('is_compact', $is_compact);
35 return VP_View::instance()->load('control/html', $this->get_data());
36 }
37
38 public function set_value($_value)
39 {
40 // normalize linebreak to \n for all saved data
41 if( is_string($_value) )
42 {
43 $_value = str_replace(array("\r\n", "\r"), "\n", $_value);
44 }
45 $this->_value = $_value;
46 return $this;
47 }
48
49
50 /**
51 * Get the Height of the Container
52 *
53 * @return String Height of the Container
54 */
55 public function get_height() {
56 return $this->_height;
57 }
58
59 /**
60 * Set the Height of the Container
61 *
62 * @param String $_status Height of the Container
63 */
64 public function set_height($_height) {
65 $this->_height = $_height;
66 return $this;
67 }
68
69 }
70
71 /**
72 * EOF
73 */