PluginProbe
MaxButtons – Create buttons / 7.13.1
MaxButtons – Create buttons v7.13.1
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / blocks / dimension.php

dimension.php in MaxButtons – Create buttons 7.13.1, at blocks/dimension.php

63 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MaxButtons;
3 defined('ABSPATH') or die('No direct access permitted');
4 $blockClass["dimension"] = "dimensionBlock";
5 $blockOrder[20][] = "dimension";
6
7 class dimensionBlock extends maxBlock
8 {
9 protected $blockname = "dimension";
10 protected $fields = array("button_width" => array("default" => '160px',
11 "css" => "width",
12 ),
13 "button_height" => array("default" => '50px',
14 "css" => "height")
15 );
16
17 public function parse_css($css, $mode = 'normal')
18 {
19 $css = parent::parse_css($css, $mode);
20
21 if (! isset($css["maxbutton"]["normal"]["width"])) return $css;
22
23 // do not allow zero's.
24 if (isset($css["maxbutton"]["normal"]["width"]) && ($css["maxbutton"]["normal"]["width"] == 0 || $css["maxbutton"]["normal"]["width"] == '') )
25 unset($css["maxbutton"]["normal"]["width"]);
26
27 if (isset($css["maxbutton"]["normal"]["height"]) && ($css["maxbutton"]["normal"]["height"] == 0 || $css["maxbutton"]["normal"]["height"] == '') )
28 unset($css["maxbutton"]["normal"]["height"]);
29
30
31 /* if ($css["normal"]["width"] > maxbuttons_strip_px(0) || $css["normal"]["height"] > maxbuttons_strip_px(0))
32 {
33 $css["normal"]["display"] = "inline-block";
34 }
35 */
36
37 return $css;
38 }
39
40 public function map_fields($map)
41 {
42 $map = parent::map_fields($map);
43
44 $map["button_width"]["func"] = "updateDimension";
45 $map["button_height"]["func"] = "updateDimension";
46
47 return $map;
48
49 }
50
51
52 public function admin_fields()
53 {
54 return;
55
56 } // admin_fields
57
58
59
60 } // class
61
62 ?>
63