PluginProbe
MaxButtons – Create buttons / 6.28
MaxButtons – Create buttons v6.28
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
← All changes | blocks/gradient.php +38 -36 7.136.28 View file →
@@ -31,9 +31,9 @@
31 31
32 32
33 33 public function map_fields($map)
34 34 {
35 - $map = parent::map_fields($map);
35 +
36 36 $map["gradient_stop"]["func"] = "updateGradientOpacity";
37 37 $map["gradient_start_opacity"]["func"] = "updateGradientOpacity";
38 38 $map["gradient_end_opacity"]["func"] = "updateGradientOpacity";
39 39 $map["gradient_start_opacity_hover"]["func"] = "updateGradientOpacity";
@@ -45,16 +45,15 @@
45 45
46 46 public function admin_fields()
47 47 {
48 48 $data = $this->data[$this->blockname];
49 - $admin = MB()->getClass('admin');
50 49
51 - $start_block = new maxField('block_start');
52 - $start_block->name = __('gradient-options', 'maxbuttons');
53 - $start_block->label = __('Background', 'maxbuttons');
54 - $admin->addField($start_block);
50 +?>
51 +<div class="mb_tab option-container gradient-options">
52 + <div class="title"><?php _e('Background', 'maxbuttons') ?></div>
53 + <div class="inside">
54 + <?php
55 55
56 -
57 56 $g_start = maxBlocks::getColorValue('gradient_start_color');
58 57 $g_end = maxBlocks::getColorValue('gradient_end_color');
59 58 $gh_start = maxBlocks::getColorValue('gradient_start_color_hover');
60 59 $gh_end = maxBlocks::getColorValue('gradient_end_color_hover');
@@ -69,14 +68,14 @@
69 68 $use_gradient = false;
70 69
71 70 }
72 71
73 -
74 72 $condition = array('target' => 'use_gradient', 'values' => 'checked');
75 73 $gradient_conditional = htmlentities(json_encode($condition));
76 74
77 75 $color_copy_self = __("Replace color from other field", "maxbuttons");
78 76 $color_copy_move = __("Copy Color to other field", "maxbuttons");
77 + // $fspacer->output('start');
79 78
80 79 $useg = new maxField('switch');
81 80 $useg->label = __('Use Gradients', 'maxbuttons');
82 81 $useg->name = 'use_gradient';
@@ -82,34 +81,29 @@
82 81 $useg->name = 'use_gradient';
83 82 $useg->id = $useg->name;
84 83 $useg->value = '1';
85 84 $useg->checked = checked($use_gradient, 1, false);
86 - $admin->addField($useg, 'start', 'end');
85 + $useg->output ('start','end');
87 86
88 87 // Spacer
89 88 $fspacer = new maxField('spacer');
90 89 $fspacer->label = '&nbsp;';
91 90 $fspacer->name = 'gradient_head';
92 - $fspacer->id = $fspacer->name;
93 - $admin->addField($fspacer, 'start');
91 + $fspacer->output('start');
94 92
95 -
96 93 // Spacer
97 - $fspacer = clone $fspacer;
94 + //$fspacer = new maxField('spacer');
98 95 $fspacer->label = __('Start','maxbuttons');
99 96 $fspacer->name = 'gradient_start';
100 - $fspacer->id = $fspacer->name;
101 - $admin->addField($fspacer, '','');
97 + $fspacer->output('');
102 98
103 99 // Spacer
104 - $fspacer = clone $fspacer;
100 + //$fspacer = new maxField('spacer');
105 101 $fspacer->label = __('End','maxbuttons');
106 102 $fspacer->name = 'gradient_end';
107 - $fspacer->id = $fspacer->name;
108 103 $fspacer->conditional = $gradient_conditional;
109 - $admin->addField($fspacer, '','end');
104 + $fspacer->output('', 'end');
110 105
111 -
112 106 // Background Color
113 107 $color = new maxField('color');
114 108 $color->id = 'gradient_start_color';
115 109 $color->name = $color->id;
@@ -121,9 +115,9 @@
121 115 $color->left_title = $color_copy_self;
122 116 $color->right_title = $color_copy_move;
123 117 $color->copypos = 'right';
124 118
125 - $admin->addField($color, 'start');
119 + $color->output('start');
126 120
127 121 // Background Color (End Gradient)
128 122 $ecolor = new maxField('color');
129 123 $ecolor->id = 'gradient_end_color';
@@ -135,10 +129,10 @@
135 129 $ecolor->copypos = 'left';
136 130 $ecolor->left_title = $color_copy_move;
137 131 $ecolor->right_title = $color_copy_self;
138 132 $ecolor->conditional = $gradient_conditional;
133 + $ecolor->output('', 'end');
139 134
140 - $admin->addField($ecolor, '', 'end');
141 135
142 136 // Background Color Hover
143 137 $color_hover = new maxField('color');
144 138 $color_hover->id = 'gradient_start_color_hover';
@@ -151,9 +145,9 @@
151 145 $color_hover->left_title = $color_copy_self;
152 146 $color_hover->right_title = $color_copy_move;
153 147 $color_hover->copypos = 'right';
154 148
155 - $admin->addField($color_hover, 'start', '');
149 + $color_hover->output('start','');
156 150
157 151 // Background Color Hover
158 152 $ecolor_hover = new maxField('color');
159 153 $ecolor_hover->id = 'gradient_end_color_hover';
@@ -166,24 +160,31 @@
166 160 $ecolor_hover->copypos = 'left';
167 161 $ecolor_hover->left_title = $color_copy_move;
168 162 $ecolor_hover->right_title = $color_copy_self;
169 163 $ecolor_hover->conditional = $gradient_conditional;
164 + $ecolor_hover->output('','end');
170 165
171 - $admin->addField($ecolor_hover, '', 'end');
166 + ?>
172 167
168 + <!--
169 + <p><a href='#'>See more options</a></p>
170 + -->
171 + <div id='gradient_fold' class="fold">
173 172
173 + <?php
174 174 $startop = new maxField('number');
175 175 $startop->label = __('Normal Opacity','maxbuttons');
176 176 $startop->name = 'gradient_start_opacity';
177 177 $startop->id = $startop->name;
178 178 $startop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_start_opacity') );
179 + //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity'));
179 180 $startop->min = 1;
180 181 $startop->max = 100;
181 182 $startop->inputclass = 'small';
183 + $startop->output('start','');
182 184
183 - $admin->addField($startop, 'start');
184 -
185 185 $endop = new maxField('number');
186 + // $endop->label = __('Normal Opacity','maxbuttons');
186 187 $endop->name = 'gradient_end_opacity';
187 188 $endop->id = $endop->name;
188 189 $endop->value = maxUtils::strip_px( maxBlocks::getValue('gradient_end_opacity') );
189 190 $endop->setDefault(maxBlocks::getDefault('gradient_end_opacity'));
@@ -190,11 +191,10 @@
190 191 $endop->min = 1;
191 192 $endop->max = 100;
192 193 $endop->inputclass = 'small';
193 194 $endop->conditional = $gradient_conditional;
195 + $endop->output('','end');
194 196
195 - $admin->addField($endop, '', 'end');
196 -
197 197 $startop = new maxField('number');
198 198 $startop->label = __('Hover opacity','maxbuttons');
199 199 $startop->name = 'gradient_start_opacity_hover';
200 200 $startop->id = $startop->name;
@@ -202,10 +202,11 @@
202 202 //$startop->setDefault(maxBlocks::getDefault('gradient_start_opacity_hover'));
203 203 $startop->min = 1;
204 204 $startop->max = 100;
205 205 $startop->inputclass = 'small';
206 - $admin->addField($startop, 'start');
207 206
207 + $startop->output('start','');
208 +
208 209 $endop = new maxField('number');
209 210 // $endop->label = __('Hover Opacity','maxbuttons');
210 211 $endop->name = 'gradient_end_opacity_hover';
211 212 $endop->id = $endop->name;
@@ -214,10 +215,12 @@
214 215 $endop->min = 1;
215 216 $endop->max = 100;
216 217 $endop->inputclass = 'small';
217 218 $endop->conditional = $gradient_conditional;
218 - $admin->addField($endop, '', 'end');
219 219
220 + $endop->output('','end');
221 +
222 +
220 223 $stop = new maxField('number');
221 224 $stop->label = __('Gradient stop','maxbuttons');
222 225 $stop->name = 'gradient_stop';
223 226 $stop->id = $stop->name;
@@ -225,19 +228,18 @@
225 228 $stop->setDefault(maxBlocks::getDefault('gradient_stop'));
226 229 $stop->min = 1;
227 230 $stop->max = 99;
228 231 $stop->inputclass = 'small';
229 - $stop->start_conditional = $gradient_conditional;
232 + $stop->output('start','end');
233 + ?>
230 234
231 - $admin->addField($stop, 'start', 'end');
232 235
236 + </div><!-- // fold -->
233 237
234 - $this->sidebar();
235 - $endblock = new maxField('block_end');
236 - $admin->addField($endblock);
237 -
238 + </div>
239 + </div>
240 +<?php
238 241 } // admin_fields
239 -
240 242
241 243 } // class
242 244
243 245