PluginProbe
WP Ultimate Post Grid / 2.6.0
WP Ultimate Post Grid v2.6.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 / fieldmultiimage.php

fieldmultiimage.php in WP Ultimate Post Grid 2.6.0, at vendor/vafpress/classes/control/fieldmultiimage.php

88 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The smallest unit of an item, the field it self.
5 */
6 abstract class VP_Control_FieldMultiImage extends VP_Control_FieldMulti
7 {
8
9 protected $_item_max_height;
10
11 protected $_item_max_width;
12
13 /**
14 * Basic self setup of the object
15 * @param SimpleXMLElement $simpleXML SimpleXML object representation of the field
16 * @return VP_Control_FieldMultiImage Field object
17 */
18 protected function _basic_make($arr)
19 {
20 parent::_basic_make($arr);
21
22 $this->set_item_max_height(isset($arr['item_max_height']) ? $arr['item_max_height'] : '')
23 ->set_item_max_width(isset($arr['item_max_width']) ? $arr['item_max_width'] : '');
24
25 return $this;
26 }
27
28 protected function _setup_data()
29 {
30 parent::_setup_data();
31 $this->add_data('item_max_height', $this->get_item_max_height());
32 $this->add_data('item_max_width', $this->get_item_max_width());
33 }
34
35 public function add_items_from_array($_items){
36 foreach ($_items as $item)
37 {
38 $the_item = new VP_Control_Field_Item_Generic();
39 $the_item->value($item['value'])
40 ->label($item['label'])
41 ->img($item['img']);
42 $this->add_item($the_item);
43 }
44 }
45
46 /**
47 * Get item max height
48 *
49 * @return Integer Item Max Height
50 */
51 public function get_item_max_height() {
52 return $this->_item_max_height;
53 }
54
55 /**
56 * Set item max height
57 *
58 * @param Integer $_item_max_height Item Max Height
59 */
60 public function set_item_max_height($_item_max_height) {
61 $this->_item_max_height = $_item_max_height;
62 return $this;
63 }
64
65 /**
66 * Get item max width
67 *
68 * @return Integer Item Max Width
69 */
70 public function get_item_max_width() {
71 return $this->_item_max_width;
72 }
73
74 /**
75 * Set item max width
76 *
77 * @param Integer $_item_max_width Item Max Width
78 */
79 public function set_item_max_width($_item_max_width) {
80 $this->_item_max_width = $_item_max_width;
81 return $this;
82 }
83
84 }
85
86 /**
87 * EOF
88 */