PluginProbe
Microthemer Lite – Visual Editor to Customize CSS / trunk
Microthemer Lite – Visual Editor to Customize CSS vtrunk
trunk 5.0.0.2
microthemer / includes / program-data.php

program-data.php in Microthemer Lite – Visual Editor to Customize CSS trunk, at includes/program-data.php

2,385 lines 77.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 // central store of language strings - in future, have this is sep file and store escaped translates files in DB table rows
8 $this->lang = array(
9 'css_unit_types' => array(
10 'common' => esc_html__('Common', 'microthemer'),
11 'other' => esc_html__('Other', 'microthemer'),
12 'time' => esc_html__('Time', 'microthemer'),
13 'grid' => esc_html__('Grid', 'microthemer'),
14 'none' => esc_html__('No unit', 'microthemer'),
15 'angle' => esc_html__('Angle', 'microthemer'),
16 ),
17 );
18
19 // save time for use with ensuring non-cached files
20 $this->time = time();
21
22 $this->permissionshelp = esc_html__('Please see this help article for changing directory and file permissions:', 'microthemer') . ' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a>.' . esc_html__('Tip: you may want to jump to the "Using an FTP Client" section of the article. But bear in mind that if your web hosting runs windows it may not be possible to adjust permissions using an FTP program. You may need to log into your hosting control panel, or request that your host adjust the permissions for you.', 'microthemer');
23
24 // moved to constructor because __() can't be used on member declarations
25 $this->edge_mode = array(
26 'available' => false,
27 'edge_forum_url' => 'https://themeover.com/forum/topic/were-trialling-automatic-error-reporting/',
28 'cta' => __("Enable automatic error reporting!", 'microthemer'),
29 'config' => array(
30 'error_reporting_trial' => 1
31 ),
32 'active' => false // evaluated and set at top of ui page (don't change this)
33 );
34
35 // define folders (translatable)
36 $this->set_default_folders();
37
38 // custom code
39 $this->custom_code = Microthemer\Common::get_custom_code();
40
41 // params to strip
42 $this->params_to_strip = Microthemer\Common::params_to_strip();
43
44 // flatten custom_code array (easier to work with)
45 /*foreach ($this->custom_code as $key => $arr){
46 if ($key == 'ie_css'){
47 foreach ($arr as $key => $arr){
48 $flat[$key] = $arr;
49 }
50 } else {
51 $flat[$key] = $arr;
52 }
53 }*/
54
55 $this->custom_code_flat = $this->custom_code; // $flat;
56
57 // define possible CSS units
58 $unit_types = $this->lang['css_unit_types'];
59 $this->css_units = array();
60
61 $this->css_units[$unit_types['none']] = array(
62 'none' => array(
63 'type' => 'none',
64 'value' => '',
65 'desc' => esc_attr__('No unit', 'microthemer'),
66 ),
67 );
68
69 $this->css_units[$unit_types['grid']] = array(
70 'fr' => array(
71 'type' => 'fraction',
72 'desc' => esc_attr__('A fraction of the available space', 'microthemer'),
73 ),
74 );
75
76 $this->css_units[$unit_types['common']] = array(
77 'px'=> array(
78 'type' => 'common',
79 'desc' => esc_attr__('1px = 1/96th of 1in', 'microthemer')
80 ),
81 'em'=> array(
82 'type' => 'common',
83 'desc' => esc_attr__('1em = the element\'s font-size', 'microthemer')
84 ),
85 'rem'=> array(
86 'type' => 'common',
87 'desc' => esc_attr__('1rem = the html element\'s font-size', 'microthemer')
88 ),
89 '%'=> array(
90 'type' => 'common',
91 'desc' => esc_attr__('percentage of parent element\'s size', 'microthemer')
92 ),
93
94 );
95
96 $this->css_units[$unit_types['other']] = array(
97
98 'ch'=> array(
99 'type' => 'other',
100 'desc' => esc_attr__('width of a "0" (approx 0.5em)', 'microthemer')
101 ),
102 'cm'=> array(
103 'type' => 'other',
104 'desc' => esc_attr__('centimeters', 'microthemer')
105 ),
106 'ex'=> array(
107 'type' => 'other',
108 'desc' => esc_attr__('height of a lowercase "x" (approx 0.5em)', 'microthemer')
109 ),
110 'in'=> array(
111 'type' => 'other',
112 'desc' => esc_attr__('inches', 'microthemer')
113 ),
114 'mm'=> array(
115 'type' => 'other',
116 'desc' => esc_attr__('millimeters', 'microthemer')
117 ),
118 'pt'=> array(
119 'type' => 'other',
120 'desc' => esc_attr__('point: 1pt = 1/72nd of 1in', 'microthemer')
121 ),
122 'pc'=> array(
123 'type' => 'other',
124 'desc' => esc_attr__('pica: 1pc = 12pt', 'microthemer')
125 ),
126 'vw' => array(
127 'type' => 'other',
128 'desc' => esc_attr__('&#37; of viewport width', 'microthemer'),
129 'not_supported_in' => array('IE8')
130 ),
131 'vh' => array(
132 'type' => 'other',
133 'desc' => esc_attr__('&#37; viewport height', 'microthemer'),
134 'not_supported_in' => array('IE8')
135 ),
136 'vmin' => array(
137 'type' => 'other',
138 'desc' => esc_attr__('&#37; of viewport\'s smaller dimension', 'microthemer'),
139 'not_supported_in' => array('IE8')
140 // NOTE: in IE9 it's called 'vm'
141 ),
142 'vmax' => array(
143 'type' => 'other',
144 'desc' => esc_attr__('&#37; of viewport\'s larger dimension', 'microthemer'),
145 'not_supported_in' => array('IE8', 'IE9', 'IE10', 'IE11')
146 ),
147
148
149
150 );
151
152 $this->css_units[$unit_types['time']] = array(
153 's' => array(
154 'type' => 'time',
155 'desc' => esc_attr__('seconds', 'microthemer'),
156 ),
157 'ms' => array(
158 'type' => 'time',
159 'desc' => esc_attr__('milliseconds', 'microthemer'),
160 ),
161 );
162
163 $this->css_units[$unit_types['angle']] = array(
164 'deg' => array(
165 'type' => 'angle',
166 'desc' => esc_attr__('degree: circle = 360deg', 'microthemer'),
167 ),
168 'grad' => array(
169 'type' => 'angle',
170 'desc' => esc_attr__('gradian: circle = 400grad', 'microthemer'),
171 ),
172 'rad' => array(
173 'type' => 'angle',
174 'desc' => esc_attr__('radian: circle = 6.2832rad (approx)', 'microthemer'),
175 ),
176 'turn' => array(
177 'type' => 'angle',
178 'desc' => esc_attr__('circle = 1turn, half circle = .5turn', 'microthemer'),
179 ),
180 );
181
182 $this->folder_item_types = array(
183 'selector' => array(
184 'label' => esc_html__('Selector', 'microthemer'),
185 'label_plural' => esc_html__('Selectors', 'microthemer')
186 ),
187 // for adding custom CSS or Sass (inc mixins / functions which don't have dedicated type)
188 'snippet' => array(
189 'label' => esc_html__('Code snippet', 'microthemer'),
190 'label_plural' => esc_html__('Code snippets', 'microthemer')
191 ),
192 // types to support later - for UI integration (Code | Fields tabs)
193 /*'css_variables' => array(
194 'label' => esc_html__('CSS variable', 'microthemer'),
195 'label_plural' => esc_html__('CSS variables', 'microthemer')
196 ),
197 'sass_variables' => array(
198 'label' => esc_html__('Sass variable', 'microthemer'),
199 'label_plural' => esc_html__('Sass variables', 'microthemer')
200 ),
201 'keyframes' => array(
202 'label' => esc_html__('Keyframe', 'microthemer'),
203 'label_plural' => esc_html__('Keyframes', 'microthemer')
204 ),*/
205 );
206
207 // AI data
208 $contentTypes = array(
209 'css' => esc_html__('CSS', 'microthemer'),
210 'html' => esc_html__('HTML', 'microthemer'),
211 //'js' => esc_html__('JS', 'microthemer'),
212 );
213
214 $this->aiData = array(
215 'contentTypes' => $contentTypes,
216 'previousScratchpad' => array(
217 'replace' => esc_html__('Replace', 'microthemer'),
218 'add' => esc_html__('Add to', 'microthemer'),
219 ),
220 'tabs' => array_merge($contentTypes, array(
221 'css' => esc_html__('CSS', 'microthemer'),
222 'html' => esc_html__('HTML', 'microthemer'),
223 'js' => esc_html__('JS', 'microthemer'),
224 )),
225 'defaultTab' => 'css', //$defaultTab = $this->hasCSSSubscription() ? 'css' : 'html',
226 'actions' => array(
227 // Generate new content for the page CSS / HTML / JS
228 'generate' => array(
229 'label' => esc_html__('Update page elements', 'microthemer'),
230 'scope' => array(
231 esc_html__('Selected element(s)', 'microthemer'),
232 esc_html__('Whole page', 'microthemer')
233 ),
234 'commit' => array(
235 'type' => array(
236 'css' => array(
237 esc_html__('UI selector(s)', 'microthemer'),
238 esc_html__('Code snippet', 'microthemer')
239 ),
240 'html' => array(
241 esc_html__('Gutenberg block(s)', 'microthemer'),
242 esc_html__('Code snippet', 'microthemer')
243 )
244 ),
245 'location' => array(
246 'folder' => array(
247 'label' => esc_html__('Add to folder', 'microthemer'),
248 ),
249 'sub_folder' => array(
250 'label' => esc_html__('As sub-folder', 'microthemer'),
251 ),
252 )
253 )
254 ),
255
256 // Act on Microthemer's CSS / HTML / JS settings via an internal API
257 // Open AI will generate an array of functions to call
258 'edit' => array(
259 'label' => 'Edit '.$this->appName.' settings',
260 'scope' => array(
261 esc_html__('Current item', 'microthemer'),
262 esc_html__('Current folder', 'microthemer'),
263 esc_html__('All folders', 'microthemer'),
264 )
265 ),
266
267 ),
268
269 'advanced' => array(
270 'title' => esc_html__('AI assistant settings', 'microthemer')
271 )
272
273 );
274
275
276
277 // to_autocomplete_arr
278
279 // easy preview of common devices
280 $this->mob_preview = array(
281 array('(P) Apple iPhone 4', 320, 480),
282 array('(P) Apple iPhone 5', 320, 568),
283 array('(P) BlackBerry Z30', 360, 640),
284 array('(P) Google Nexus 5', 360, 640),
285 array('(P) Nokia N9', 360, 640),
286 array('(P) Samsung Gallaxy (All)', 360, 640),
287 array('(P) Apple iPhone 6', 375, 667),
288 array('(P) Google Nexus 4', 384, 640),
289 array('(P) LG Optimus L70', 384, 640),
290 array('(P) Apple iPhone 6 Plus', 414, 736),
291 // landscape (with some exceptions)
292 array('(L) Apple iPhone 4', 480, 320),
293 array('(L) Nokia Lumia 520', 533, 320),
294 array('(L) Apple iPhone 5', 568, 320),
295 array('(P) Google Nexus 7', 600, 960),
296 array('(P) BlackBerry PlayBook', 600, 1024),
297 array('(L) BlackBerry Z30', 640, 360),
298 array('(L) Google Nexus 5', 640, 360),
299 array('(L) Nokia N9', 640, 360),
300 array('(L) Samsung Gallaxy (All)', 640, 360),
301 array('(L) Google Nexus 4', 640, 384),
302 array('(L) LG Optimus L70', 640, 384),
303 array('(L) Apple iPhone 6/7', 667, 375),
304 array('(L) Apple iPhone 6+/7+', 736, 414),
305 array('(P) Apple iPad', 768, 1024),
306 array('(P) Google Nexus 10', 800, 1280),
307 array('(L) Google Nexus 7', 960, 600),
308 array('(L) BlackBerry PlayBook', 1024, 600),
309 array('(L) Apple iPad', 1024, 768),
310 array('(P) Apple iPad Pro', 1024, 1366),
311 array('(L) Google Nexus 10', 1280, 800),
312 array('(L) Apple iPad Pro', 1366, 1024),
313 );
314
315 // country codes
316 $this->country_codes = array(
317 "ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "ch", "ce", "ny", "zh", "zh-Hans", "zh-Hant", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gl", "gd", "gv", "ka", "de", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id, in", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kl", "kn", "kr", "ks", "kk", "km", "ki", "rw", "rn", "ky", "kv", "kg", "ko", "ku", "kj", "lo", "la", "lv", "li", "ln", "lt", "lu", "lg", "lb", "gv", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mh", "mo", "mn", "na", "nv", "ng", "nd", "ne", "no", "nb", "nn", "ii", "oc", "oj", "cu", "or", "om", "os", "pi", "ps", "fa", "pl", "pt", "pa", "qu", "rm", "ro", "ru", "se", "sm", "sg", "sa", "sr", "sh", "st", "tn", "sn", "ii", "sd", "si", "ss", "sk", "sl", "so", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "wo", "fy", "xh", "yi, ji", "yo", "za", "zu"
318 );
319
320 // nth-formulas
321 $this->nth_formulas = array(
322 '1',
323 '2',
324 '3',
325 '4',
326 '5',
327 '6',
328
329 'n+2',
330 'n+3',
331 'n+4',
332 'n+5',
333 'n+6',
334
335 '-n+1',
336 '-n+2',
337 '-n+3',
338 '-n+4',
339 '-n+5',
340 '-n+6',
341
342 'odd',
343 'even',
344 '3n',
345 '4n',
346 '5n',
347 '6n',
348
349 '2n+1',
350 '3n+1',
351 '4n+1',
352 '5n+1',
353 '6n+1',
354 );
355
356 // string for storing favourites
357 $this->fav_css_filters = '';
358
359 // pseudo selectors to show in selector wizard
360 $this->css_filters = array(
361
362 // classes found in the body tag, this is built dynamically (MT will add some)
363 'page_specific' => array(
364 'short_label' => esc_html__('Page-specific', 'microthemer'),
365 'label' => esc_html__('Page-specific', 'microthemer'),
366 'items' => array(
367 // note, if changing key text - must update js_i18n_overlay.cur_pid_filter
368 'page-id' => array(
369 'text' => esc_html__('page-id', 'microthemer'),
370 'tip' => esc_attr__('Add the page/post id, thus targeting only the current page.', 'microthemer'),
371 'common' => 1
372 ),
373 // note, if changing key text - must update js_i18n_overlay.cur_pid_filter
374 'page-name' => array(
375 'text' => esc_html__('page-name', 'microthemer'),
376 'tip' => esc_attr__('Add the page/post slug, an alternative way to target only the current page. This will need updating if you change the URL of the page.', 'microthemer'),
377 ),
378 // allow custom prefix for selectors
379 'custom-prefix' => array(
380 'text' => esc_html__('custom-prefix', 'microthemer'),
381 'tip' => esc_attr__('Prefix MT selectors with a custom class or id', 'microthemer'),
382 'editable' => array(
383 'str' => !empty($this->preferences['custom-prefix-extraValue'])
384 ? $this->preferences['custom-prefix-extraValue']
385 : '',
386 'combo' => 'custom_prefix',
387 'justInputValue' => 1
388 )
389 ),
390 )
391 ),
392
393 // show all pseudo elements
394 'pseudo_elements' => array(
395 'short_label' => esc_html__('Pseudo elements', 'microthemer'),
396 'label' => esc_html__('Pseudo elements', 'microthemer'),
397 'items' => array(
398 "::after" => array(
399 'tip' => esc_attr__('Insert a pseudo HTML element after any normal content the element may have', 'microthemer'),
400 'strip' => '1',
401 ),
402 "::before" => array(
403 'tip' => esc_attr__('Insert a pseudo HTML element before any normal content the element may have', 'microthemer'),
404 'strip' => '1',
405 ),
406 "::first-letter" => array(
407 'tip' => esc_attr__('Target the first letter of a block level element', 'microthemer'),
408 'strip' => '1',
409 ),
410 "::first-line" => array(
411 'tip' => esc_attr__('Target the first line of a block level element', 'microthemer'),
412 'strip' => '1',
413 ),
414 "::marker" => array(
415 'tip' => esc_attr__('Target bullets in a HTML list', 'microthemer'),
416 'strip' => '1',
417 ),
418 "::placeholder" => array(
419 'tip' => esc_attr__('Target an input field\'s placeholder text', 'microthemer'),
420 'strip' => '1',
421 ),
422 "::selection" => array(
423 'tip' => esc_attr__('Target the area of an element that is selected by the user', 'microthemer'),
424 'strip' => '1',
425 //'replace' => ':selected', I think this was a mistake
426 ),
427 )
428 ),
429
430 // there are lots of pseudo classes, maybe show some (0) as dyn controls like JS libraries
431 'pseudo_classes' => array(
432 'short_label' => esc_html__('Pseudo classes', 'microthemer'),
433 'label' => esc_html__('Pseudo classes', 'microthemer'),
434 'items' => array(
435 ":active" => array(
436 'tip' => esc_attr__('Target elements in the "being clicked" state', 'microthemer'),
437 'strip' => '1',
438 ),
439 ":checked" => array(
440 'tip' => esc_attr__('Target "checked" form elements', 'microthemer'),
441 //'strip' => '1',
442 //'replace' => '[checked]'
443 ),
444 ":disabled" => array(
445 'tip' => esc_attr__('Target "disabled" form elements', 'microthemer'),
446 //'strip' => '1',
447 //'replace' => '[disabled]'
448 ),
449 ":empty" => array(
450 'tip' => esc_attr__('Target elements that have no children', 'microthemer'),
451 ),
452 ":enabled" => array(
453 'tip' => esc_attr__('Target "enabled" form elements', 'microthemer'),
454 ),
455 ":first-child" => array(
456 'tip' => esc_attr__('Target elements that are the first child of their parent', 'microthemer'),
457 ),
458 ":first-of-type" => array(
459 'tip' => esc_attr__('Target elements that are the first child of their parent, of a certian type. For instance, the first <p>, of a parent <div>', 'microthemer'),
460 ),
461 ":focus" => array(
462 'tip' => esc_attr__('Target elements that "have focus". For instance, a textarea being edited.', 'microthemer'),
463 'strip' => '1',
464 //'common' => 1
465 ),
466 ":hover" => array(
467 'tip' => esc_attr__('Target elements in the "being hovered over" state', 'microthemer'),
468 'strip' => '1',
469 'common' => 1
470
471 ),
472 ":in-range" => array(
473 'tip' => esc_attr__('Target <input type="number"> elements with values no less or more than their min/max attributes respectively.', 'microthemer'),
474 'strip' => '1',
475 'filter' => 1,
476 ),
477 ":invalid" => array(
478 'tip' => esc_attr__('Target form elements that have an invalid value such as <input type="email"> fields with a malformed email address', 'microthemer'),
479 'strip' => '1',
480 'filter' => 1 // http://stackoverflow.com/questions/15820780/jquery-support-invalid-selector
481 ),
482 ":is(selector)" => array(
483 'tip' => esc_attr__('More concise e.g. .long-selector:is(:hover, :focus) instead of .long-selector:hover, .long-selector:focus', 'microthemer'),
484 'editable' => array(
485 'str' => '(selector)',
486 'combo' => 'is_options'
487 )
488 ),
489 ":lang(language)" => array(
490 'tip' => esc_attr__('Target elements that have a "lang" attribute set to a certain langauage code e.g. lang="en"', 'microthemer'),
491 'editable' => array(
492 'str' => '(language)',
493 'combo' => 'lang_codes'
494 )
495 ),
496 ":last-child" => array(
497 'tip' => esc_attr__('Target elements that are the last child of their parent', 'microthemer'),
498 ),
499 ":last-of-type" => array(
500 'tip' => esc_attr__('Target elements that are the last child of their parent, of a certian type. For instance, the last <p>, of a parent <div>', 'microthemer'),
501 ),
502 ":link" => array(
503 'tip' => esc_attr__('Target unvisited links', 'microthemer'),
504 'strip' => '1',
505 ),
506 ":not(selector)" => array(
507 'tip' => esc_attr__('Use a selector in between the brackets to exclude elements from the selection.', 'microthemer'),
508 'editable' => array(
509 'str' => '(selector)',
510 )
511 ),
512 ":nth-child(n)" => array(
513 'tip' => esc_attr__('Target elements that are the nth child of their parent', 'microthemer'),
514 'editable' => array(
515 'str' => '(n)',
516 'combo' => 'nth_formulas'
517 )
518 ),
519 ":nth-last-child(n)" => array(
520 'tip' => esc_attr__('Target elements that are the nth child of their parent, counting backwards from the last child', 'microthemer'),
521 'editable' => array(
522 'str' => '(n)',
523 'combo' => 'nth_formulas'
524 )
525 ),
526 ":nth-last-of-type(n)" => array(
527 'tip' => esc_attr__('Target elements that are the nth child of their parent, of a certain type (e.g. <p>), counting backwards from the last child', 'microthemer'),
528 'editable' => array(
529 'str' => '(n)',
530 'combo' => 'nth_formulas'
531 )
532 ),
533 ":nth-of-type(n)" => array(
534 'tip' => esc_attr__('Target elements that are the nth child of their parent, of a certain type (e.g. <p>)', 'microthemer'),
535 'editable' => array(
536 'str' => '(n)',
537 'combo' => 'nth_formulas'
538 )
539 ),
540 ":only-of-type" => array(
541 'tip' => esc_attr__('Target elements that are the only child of their parent, of a certain type', 'microthemer'),
542 ),
543 ":only-child" => array(
544 'tip' => esc_attr__('Target elements that are the only child of their parent', 'microthemer'),
545 ),
546 ":optional" => array(
547 'tip' => esc_attr__('Target elements that do not have the "required" attribute set', 'microthemer'),
548 //'strip' => '1',
549 //'replace' => ':not([required])',
550 ),
551 ":out-of-range" => array(
552 'tip' => esc_attr__('Target <input type="number"> elements with values outside their min/max attributes.', 'microthemer'),
553 'strip' => '1',
554 'filter' => 1,
555 ),
556 ":read-only" => array(
557 'tip' => esc_attr__('Target elements that have the "readonly" attribute set', 'microthemer'),
558 //'strip' => '1',
559 //'replace' => '[readonly]',
560 ),
561 ":read-write" => array(
562 'tip' => esc_attr__('Target elements that do not have the "readonly" attribute set', 'microthemer'),
563 //'strip' => '1',
564 //'replace' => ':not([readonly])',
565 ),
566 ":required" => array(
567 'tip' => esc_attr__('Target elements that have the "required" attribute set', 'microthemer'),
568 'strip' => '1',
569 'replace' => '[required]', // this pseudo selector still needs a replacement (only one now)
570 ),
571 ":root" => array(
572 'tip' => esc_attr__('Target the html element, using an alternative selector', 'microthemer'),
573 ),
574 ":target" => array(
575 'tip' => esc_attr__('Links can target elements on the same page that have an id attribute. So <a href="#logo">click me</a> would target <img id="logo" /> when clicked. And the selector "#logo:target" would apply to the image when the link was clicked. ":target" is used to show/hide elements dynamically without using JavaScript.', 'microthemer'),
576 ),
577 ":valid" => array(
578 'tip' => esc_attr__('Target form elements that have a valid value such as <input type="email"> fields with a correctly formatted email address', 'microthemer'),
579 'strip' => '1',
580 'filter' => 1
581 ),
582 ":visited" => array(
583 'tip' => esc_attr__('Target links that have been visited', 'microthemer'),
584 'strip' => '1',
585 ),
586 ":where(selector)" => array(
587 'tip' => esc_attr__('Like :is but with zero CSS specificity', 'microthemer'),
588 'editable' => array(
589 'str' => '(selector)',
590 )
591 ),
592 )
593 ),
594
595
596 );
597
598 // populate the default media queries
599 $this->legacy_m_queries = array(
600 $this->unq_base.'1' => array(
601 "label" => __('Large Desktop', 'microthemer'),
602 "query" => "@media (min-width: 1200px)",
603 ),
604 $this->unq_base.'2' => array(
605 "label" => __('Desktop & Tablet', 'microthemer'),
606 "query" => "@media (min-width: 768px) and (max-width: 979px)",
607 ),
608 $this->unq_base.'3' => array(
609 "label" => __('Tablet & Phone', 'microthemer'),
610 "query" => "@media (max-width: 767px)",
611 ),
612 $this->unq_base.'4' => array(
613 "label" => __('Phone', 'microthemer'),
614 "query" => "@media (max-width: 480px)",
615 )
616 );
617
618 // min and max width media queries
619 $this->min_and_max_mqs = array(
620 $this->unq_base.'1' => array(
621 "label" => __('< 1200', 'microthemer'),
622 "query" => "@media (max-width: 1199.98px)",
623 ),
624 $this->unq_base.'2' => array(
625 "label" => __('< 980', 'microthemer'),
626 "query" => "@media (max-width: 979.98px)",
627 ),
628 $this->unq_base.'3' => array(
629 "label" => __('< 768', 'microthemer'),
630 "query" => "@media (max-width: 767.98px)",
631 "site_preview_width" => "builder.gutenberg.tablet"
632 ),
633 $this->unq_base.'4' => array(
634 "label" => __('< 480', 'microthemer'),
635 "query" => "@media (max-width: 479.98px)",
636 "site_preview_width" => "builder.gutenberg.mobile"
637 ),
638 $this->unq_base.'7' => array(
639 "label" => __('768 >', 'microthemer'),
640 "query" => "@media (min-width: 768px)",
641 ),
642 $this->unq_base.'8' => array(
643 "label" => __('980 >', 'microthemer'),
644 "query" => "@media (min-width: 980px)",
645 ),
646 $this->unq_base.'9' => array(
647 "label" => __('1200 >', 'microthemer'),
648 "query" => "@media (min-width: 1200px)",
649 ),
650 $this->unq_base.'10' => array(
651 "label" => __('1400 >', 'microthemer'),
652 "query" => "@media (min-width: 1400px)",
653 ),
654 );
655
656 // Sample container queries
657 $this->container_queries = array(
658 $this->unq_base.'c1' => array(
659 "label" => __('< (c) 1100', 'microthemer'),
660 "query" => "@container (max-width: 1100px)",
661 ),
662 $this->unq_base.'c2' => array(
663 "label" => __('< (c) 900', 'microthemer'),
664 "query" => "@container (max-width: 900px)",
665 ),
666 $this->unq_base.'c3' => array(
667 "label" => __('< (c) 700', 'microthemer'),
668 "query" => "@container (max-width: 700px)",
669 ),
670 $this->unq_base.'4' => array(
671 "label" => __('< (c) 500', 'microthemer'),
672 "query" => "@container (max-width: 500px)",
673 )
674 );
675
676 $this->default_mqs = array_slice($this->min_and_max_mqs, 0, 4);
677
678 $this->mq_sets[esc_html__('Legacy MQs', 'microthemer')] = $this->legacy_m_queries;
679 $this->mq_sets[esc_html__('Mobile-first MQs', 'microthemer')] = array_slice($this->min_and_max_mqs, 4, 4);
680 $this->mq_sets[esc_html__('Desktop-first MQs (default)', 'microthemer')] = $this->default_mqs;
681 $this->mq_sets[esc_html__('Min and max MQs', 'microthemer')] = $this->min_and_max_mqs;
682 $this->mq_sets[esc_html__('Container Queries', 'microthemer')] = $this->container_queries;
683
684
685 // default preferences for devs are a bit different
686 $this->default_dev_preferences = array(
687 "css_important" => 0,
688 //"selname_code_synced" => 1,
689 "wizard_expanded" => 1,
690 );
691
692 $default_asset_loading_config = array(
693 'global_css' => 1,
694 'global_g_fonts' => 0,
695 'conditional' => array(),
696 'logic' => array(),
697
698 // may not be defined for updaters
699 "html_mods" => array(
700 'global' => array(),
701 'conditional' => array(),
702 'all' => array()
703 ),
704 );
705
706 // Initial Setup Preference Options
707 $this->initial_preference_options = array(
708 'css_important' => array(
709 'label' => __('Always add !important to CSS styles', 'microthemer'),
710 'label_no' => '(configure manually)',
711 'explain' => !$this->supportContent()
712 ? __('Always add the "!important" CSS declaration to CSS styles. This largely solves the issue of having to understand how CSS specificity works. But if you prefer, you can disable this functionality and still apply "!important" on a per style basis by clicking the [i] icons that will appear to the right of every style input.', 'microthemer')
713 : 'Auto-add !important to CSS styles added directly to the root code editor (< >)'
714 ),
715 'allow_scss' => array(
716 'label' => __('Enable Sass (at cost of syncing editor with UI fields)', 'microthemer'),
717 'explain' => __('Enable this option if you want to write raw Sass code in the custom code editors or use Sass variables and mixins etc in the GUI fields. Disable this option if you want the CSS code you write to be interchangeably editable with the GUI fields' , 'microthemer')
718 ),
719 'mt_dark_mode' => array(
720 'label' => __('Use a dark theme for the interface', 'microthemer'),
721 'explain' => __('Choose between a light vs dark theme', 'microthemer')
722 )
723 );
724
725 // define the default preferences here (these can be reset & exported)
726 $this->default_preferences = array(
727 "css_important" => 1,
728 "selname_code_synced" => 0,
729 "wizard_expanded" => 0,
730 "show_code_editor" => 0,
731 "code_manual_resize" => 0,
732 "initial_scale" => 0,
733 "abs_image_paths" => 0,
734 "full_editor_instant_save" => 0,
735 "inline_editor_instant_save" => 1,
736 "dock_whole_gui_left" => 0,
737 "dock_inline_editor_left" => 0,
738 "dock_full_editor_left" => 0,
739 "global_styles_on_login" => 1,
740 "pseudo_base_styles" => 0,
741 "active_scripts_footer" => 0,
742 "hover_inspect" => 1, // this is hard set in $this->getPreferences()
743 "prev_folder" => array(
744 'global' => '',
745 'conditional' => ''
746 ),
747 "fold_threshold" => 1440, // a conservative fold threshold, but still below 4K screens - user can customise of course
748 "hover_inspect_off_initially" => 0,
749 "scroll_to_elements" => 1, // scroll to out of view elements in reposition_overlays
750 "autofocus_editor" => 0,
751 "disable_ai" => 0,
752 "wireframe_mode" => 0,
753 "code_font_size" => 14,
754 "current_revision" => 0,
755 "ai_priority" => 'speed',
756 "whitelisted_domains" => array(''), // for allowing AI to reference external domains
757 "allow_scss" => 0, // if enabled by default, invalid css/scss will prevent stylesheet update.
758 "lastMultiTab" => array(
759 'html' => array(
760 'index' => 0,
761 'action' => 'replace',
762 'aspect' => 'text',
763 )
764 // todo - background, text_shadow & box_shadow (as separate), transition, animation, transform
765 ),
766 "default_html_group_tabs" => array(
767 array(
768 'action' => 'replace',
769 'aspect' => 'text'
770 ),
771 array(
772 'action' => 'add',
773 'aspect' => 'text'
774 ),
775 array(
776 'action' => 'remove',
777 'aspect' => 'html'
778 ),
779 array(
780 'action' => 'add',
781 'aspect' => 'class'
782 ),
783 array(
784 'action' => 'add',
785 'aspect' => 'css'
786 ),
787 array(
788 'action' => 'run',
789 'aspect' => 'jsFunction'
790 ),
791 ),
792 "npm_dependencies" => (object) array(),
793 "npm_dependencies_published" => (object) array(), // published
794 "npm_dependencies_in_use" => (object) array(),
795 "npm_dependencies_detect" => 1,
796 "npm_default_local" => 0,
797 "npm_addon_files" => array(),
798 "ai_admin_access" => 0,
799 "ai_can" => 'edit',
800 "tailwind" => 0,
801 "mt_rich_text" => 0,
802 "mt_rich_text_code" => 0,
803 "show_snippet_adv" => 0,
804 "default_amender_event" => 'DOMContentLoaded',
805 "sync_browser_tabs" => 1, // change for Gutenberg
806 "specificity_preference" => 1, // 1 = high, 0 = low
807 "wp55_jquery_version" => 0,
808 "bricks_container_hack" => 0, // no longer necessary since Bricks 1.4
809 "remove_all_bricks_container_hacks" => 0,
810 "insert_custom_field_classes" => 0,
811 "autoload_oxygen" => 0,
812 "autoload_elementor" => 0,
813 "autoload_FLBuilder" => 0,
814 "selector_auto_name" => 1, // always on by default
815 "tape_measure_slider" => 1,
816 "monitor_js_errors" => 1,
817 "stylesheet_in_footer" => 0,
818 "gzip" => 1, // try having this off by default - realised there was an issue with sessions now fixed - try having on again
819 "hide_ie_tabs" => 1,
820 "show_extra_actions" => 1, // have the icons showing by default (change)
821 "grid_highlight" => 1,
822 "expand_grid" => 0, // this doesn't get saved
823 "minify_css" => 1, // because this only happens to published assets now
824 "minify_js" => 1,
825 "mt_dark_mode" => 0, // dark theme
826 "draft_mode" => 1, // need to have draft_mode_conversion when upgrading people - on by default
827 "auto_save_mode" => 1, // Allow Auto-save to be configurable
828 "auto_publish_mode" => 0, // maybe don't launch beta with this, but add if requested
829 "color_as_hex" => 0,
830 "admin_bar_preview" => 1, // because WP jumps out of iframe now
831 "admin_asset_loading" => 1, // change for Gutenberg integration
832 "admin_asset_editing" => 0,
833 "admin_bar_shortcut" => 1,
834 "top_level_shortcut" => 1, // with auto referrer this is more useful and should be on by default
835 "first_and_last" => 0,
836 "all_devices_default_width" => '',
837 "edge_mode" => 0,
838 "tooltip_delay" => 500,
839 "num_history_points" => 50,
840 "suggested_layout" => 'M',
841 "dock_folders_left" => 1,
842 "dock_styles_left" => 1,
843 "dock_editor_left" => 1,
844 "full_height_left_sidebar" => 1,
845 "sticky_styles_toolbar" => 1,
846 "full_height_right_sidebar" => 0,
847 "expand_device_tabs" => 0,
848 "dock_wizard_right" => 0,
849 "dock_settings_right" => 0,
850 "dock_ai_right" => 0,
851 "detach_preview" => 0,
852 "layout" => array(
853 'preset' => 's', // maybe set this dynamically
854 'left' => array(
855 'items' => array(
856 'folders' => array(
857 'size' => 282, // 229
858 'size_category' => 'sm',
859 ),
860 'styles' => array(
861 'size' => 282,
862 'size_category' => 'sm'
863 ),
864 'editor' => array(
865 'size' => 282,
866 'size_category' => 'sm'
867 ),
868 ),
869 'min_column_sizes' => array(282, 282, 282),
870 'column_sizes' => array(282, 282, 282),
871 'num_items_docked' => 0,
872 'num_columns' => 1,
873 'effective_num_columns' => 1,
874 'top_panel' => array(
875 'current' => false,
876 'previous' => false,
877 ),
878 ),
879 'right' => array(
880 'items' => array(
881 'settings' => array(
882 'size' => 252,
883 'size_category' => 'sm'
884 ),
885 /*'wizard' => array(
886 'size' => 205,
887 'size_category' => 'sm'
888 ),*/
889 'ai' => array(
890 'size' => 252,
891 'size_category' => 'sm'
892 ),
893 ),
894 'min_column_sizes' => array(252, 252),
895 'column_sizes' => array(252, 252),
896 'num_items_docked' => 0,
897 'num_columns' => 1,
898 'effective_num_columns' => 1,
899 'top_panel' => array(
900 'current' => false,
901 'previous' => false,
902 ),
903 'expanded_settings' => array(
904 'exit'
905 ),
906 ),
907 'top' => array(
908 'effective_num_rows' => 1,
909 ),
910 'editor_height' => array(
911 'size' => 160,
912 'min_size' => 68,
913 ),
914 'inspection_height' => array(
915 'size' => 200,
916 'min_size' => 30,
917 ),
918 'inspection_columns' => array(
919 'min_column_sizes' => array(300, 310), // 1fr for first column (350, 375)
920 'column_sizes' => array(300, 360), // 1fr for first column
921 ),
922
923 ),
924 "show_rulers" => 1,
925 "show_text_labels" => 1,
926 "show_sampled_variables" => 0,
927 "show_sampled_values" => 0,
928 "adv_wizard_tab" => 'refine-targeting',
929 "program_settings_tab" => 'general',
930 "overwrite_existing_mqs" => 1,
931 "tooltip_en_prop" => 1,
932 "css_imp_only_selected" => 0,
933 "css_imp_mqs" => 1,
934 "css_imp_sels" => 1,
935 "css_imp_styles" => 1,
936 "css_imp_friendly" => 1,
937 "css_imp_adjust_paths" => 1,
938 "css_imp_always_cus_code" => 0,
939 "css_imp_copy_remote" => 1, // debating this
940 "css_imp_max" => 0,
941 "page_specific" => array(),
942 "pseudo_classes" => array(),
943 "pseudo_elements" => array(),
944 "font_config" => array(
945 'google' => false,
946 'typekit' => false,
947 ),
948
949 );
950
951 $this->subscription_defaults = array(
952 'member_id' => false,
953 'renewal_check' => false,
954 'eligible_version' => false,
955 'capped_version' => false,
956 'restriction_mode' => false,
957 );
958
959 $this->subscription_check_defaults = array(
960 'stop_attempts' => false,
961 'max' => 4,
962 'num' => 0,
963 'next_time' => false,
964 );
965
966 // if installing MT when a supported page builder is active, default to their MQs
967
968 if (count($this->elementor_mqs)){
969 $arr['m_queries'] = $this->elementor_mqs;
970 } elseif (count($this->bb_mqs)){
971 $arr['m_queries'] = $this->bb_mqs;
972 } elseif (count($this->oxygen_mqs)){
973 $arr['m_queries'] = $this->oxygen_mqs;
974 } else {
975 $arr['m_queries'] = $this->default_mqs;
976 }
977 /*wp_die('We got the queries: <pre>'.print_r(array(
978 'the one' => $arr,
979 'oxy' => $this->oxygen_mqs
980 ), true).'</pre>' );*/
981
982 $this->stylesheet_order_options = array(
983 array(
984 'label' => 1,
985 ),
986 array(
987 'label' => 10,
988 ),
989 array(
990 'label' => 100,
991 ),
992 array(
993 'category' => esc_html__('Legacy order (MT6)', 'microthemer'),
994 'label' => 999999,
995 ),
996 array(
997 'category' => esc_html__('After Oxygen Builder', 'microthemer'),
998 'label' => 11000000
999 ),
1000 array(
1001 'category' => esc_html__('Latest possible', 'microthemer'),
1002 'label' => PHP_INT_MAX
1003 )
1004 );
1005
1006 $this->page_class_prefix_options = array(
1007 array(
1008 'category' => esc_html__('Legacy prefix (MT6)', 'microthemer'),
1009 'label' => 'mt',
1010 ),
1011 array(
1012 'category' => esc_html__('Default prefix', 'microthemer'),
1013 'label' => 'mtp',
1014 ),
1015 );
1016
1017 // preferences that should not be reset if user resets global preferences
1018 $this->default_preferences_dont_reset_or_export = array(
1019
1020 "original_install" => $this->getAppName(0),
1021 "content_addon" => 0,
1022 "css_addon" => 0,
1023
1024 // Subscription contingent
1025 "buyer_email" => '',
1026 "buyer_validated" => false,
1027 'retro_sub_check_done' => false,
1028 "subscription" => $this->subscription_defaults,
1029 "subscription_checks" => $this->subscription_check_defaults,
1030
1031 "amender_buyer_email" => '',
1032 'amender_buyer_validated' => false,
1033 'amender_retro_sub_check_done' => false,
1034 "amender_subscription" => $this->subscription_defaults,
1035 "amender_subscription_checks" => $this->subscription_check_defaults,
1036
1037 // Site contingent
1038 "version" => $this->version,
1039 "previous_version" => '',
1040 "reporting" => array(
1041 'anonymous_id' => wp_rand(1000000000, mt_getrandmax()),
1042 'data' => array(
1043 'last_sent' => null,
1044 'sends_today' => 0
1045 ),
1046 'file' => array(
1047 'last_sent' => null,
1048 'sends_today' => 0,
1049 'unique_errors' => (object) array()
1050 ),
1051 'permission' => array(
1052 'file' => 1,
1053 'data' => 1
1054 )
1055 ),
1056 "clean_uninstall" => 0,
1057 "recent_logic" => array(),
1058 "recent_custom_prefixes" => array(),
1059 "preview_url" => $this->home_url,
1060 "preview_title" => false,
1061 "preview_item_id" => false,
1062 "inlineJsProgData" => 0,
1063 "draft_mode_uids" => array(),
1064 "custom_paths" => array('/'),
1065 "viewed_import_stylesheets" => array(
1066 // theme css is an obvious one
1067 get_stylesheet_directory_uri() . '/style.css',
1068 // and MT might be useful for authors converting custom code to GUI
1069 $this->micro_root_url . 'active-styles.css'
1070 ),
1071 "num_saves" => 0, // keep track of saves for caching purposes
1072 "tailwind_num_saves" => 0,
1073 "num_unpublished_saves" => 0,
1074 "code_tabs" => $this->custom_code,
1075
1076 // UI options contingent
1077 "active_events" => '',
1078 'g_fonts_used' => false,
1079 'found_gf_subsets' => array(),
1080 'g_url' => '',
1081 'g_url_with_subsets' => '',
1082 'gfont_subset' => '',
1083 "asset_loading" => $default_asset_loading_config,
1084 "asset_loading_published" => $default_asset_loading_config,
1085 "global_stylesheet_required" => 1,
1086 "global_stylesheet_required_published" => 1,
1087 "load_js" => 0,
1088 "load_js_published" => 0,
1089 "custom-prefix-extraValue" => '',
1090 "mt_color_variables_css" => "",
1091
1092 // UI state contingent
1093 "active_theme" => 'customised',
1094 "theme_in_focus" => '',
1095 "mq_device_focus" => 'all-devices',
1096 "css_focus" => 'all-browsers',
1097 "view_css_focus" => 'input',
1098 "pg_focus" => 'font',
1099 "grid_focus" => 'gridtemplate',
1100 "transform_focus" => 'transformscale',
1101 "generated_css_focus" => 0,
1102 "returned_ajax_msg" => '',
1103 "returned_ajax_msg_seen" => 1,
1104
1105 // Data processing/conversion contingent
1106 "units_added_to_suggestions" => 0,
1107 "subgrid_added_to_suggestions" => 0,
1108 "default_sug_values_set" => 0,
1109 "default_sug_variables_set" => 0,
1110 "manual_recompile_all_css" => 0,
1111 "refresh_template_map" => 0,
1112 "show_setup_screen" => 1,
1113 "show_setup_screen_first_time" => 1,
1114 );
1115
1116 // do export, don't reset
1117 $this->default_preferences_exportable = array(
1118
1119 // related but not dependent on UI data
1120 "m_queries" => $this->mq_min_max($arr),
1121 "active_scripts_deps" => 0,
1122 "enq_js" => array(),
1123 "my_props" => array(),
1124
1125 // useful to keep track of watched videos across installs
1126 "external_videos" => array(
1127 'last_viewed' => 'introducing-microthemer-7',
1128 'watched' => array()
1129 ),
1130 );
1131
1132 // do reset, don't export
1133 $this->default_preferences_resetable = array(
1134 "hide_interface" => 0, // so they can fix a missing UI
1135 );
1136
1137
1138 // some preferences should only be set once we've checked WP dependent variables (e.g. integrations)
1139 if ($pd_context === 'setup_wp_dependent_vars'){
1140
1141 global $wpdb;
1142 $revisions_table_name = $wpdb->prefix . "micro_revisions";
1143 $fresh_install = !$this->check_table_exists($revisions_table_name, true);
1144
1145 //$this->show_me.= 'Prefs set 2: ' . $this->preferences['allow_scss'] . ', oxy:' . $this->preferences['stylesheet_order'];
1146
1147 // if oxygen is active and it's a fresh install
1148 $default_preferences = array(
1149
1150 // if oxygen is active and it's a fresh install
1151 //"after_oxy_css" => !empty($this->integrations['oxygen']) && $fresh_install ? 1 : 0,
1152
1153 // only set stylesheet order on a fresh install
1154 "stylesheet_order" => ($fresh_install
1155
1156 // default to highest possible on fresh installs (new)
1157 // NO - this will invoke $wp_styles->add_data, which is less well tested, so safer to keep original
1158 ? '' //PHP_INT_MAX
1159
1160 // on existing site upgrades
1161 : (
1162 !empty($this->preferences['after_oxy_css'])
1163 ? 11000000 // keep things consistent with deprecated Oxygen setting
1164 : '' // keep things consistent with the legacy default using normal enqueue hook (999999)
1165 )
1166 ),
1167
1168 "page_class_prefix" => $fresh_install ? 'mtp' : 'mt',
1169
1170 // this is mainly because pre 7.2.1.0 - anyone on a global folder will not get page-specific styles
1171 // because they will already be on a global folder, which will apply to the page, and not trigger new auto-folder
1172 "auto_folders" => $fresh_install ? 1 : 0,
1173 "auto_folders_page" => $fresh_install ? 1 : 0
1174
1175 // todo remember to update exportable_preferences array merge values if adding new options here
1176 );
1177
1178 $this->default_preferences = array_merge($this->default_preferences, $default_preferences);
1179 }
1180
1181 // create micro-themes dir/blank active-styles.css, copy pie if doesn't exist
1182 $this->setup_micro_themes_dir();
1183
1184 // get the file structure - and create micro_root dir if it doesn't exist
1185 $this->file_structure = $this->dir_loop($this->micro_root_dir);
1186
1187 // get the styles from the DB
1188 $this->getOptions();
1189
1190 // get the css props
1191 $this->getPropertyOptions();
1192
1193 // get/set the preferences
1194 $this->getPreferences(true, $pd_context);
1195
1196
1197 //wp_die('<pre>'.print_r($this->file_structure, true).'</pre>');
1198
1199 /*wp_die('<pre>'.print_r($this->get_sass_import_paths("
1200 @import 'breakpoint/context';
1201 @import 'breakpoint/helpers';
1202 @import 'breakpoint/parsers';
1203
1204
1205 @import 'breakpoint/no-query';
1206
1207 @import 'breakpoint/respond-to';"), true).'</pre>');*/
1208
1209 //wp_die('<pre>'.print_r($this->strip_css_sass_comments($this->options['non_section']['hand_coded_css'], true), true).'</pre>');
1210
1211 /*if (!empty($this->options['non_section']['hand_coded_css'])){
1212 //wp_die('<pre>'.print_r($this->options['non_section']['hand_coded_css'], true).'</pre>');
1213 wp_die('<pre>'.print_r($this->get_sass_import_content(), true).'</pre>');
1214 }*/
1215
1216 // animation/ transition events
1217 $browser_events = array(
1218
1219 'CSS Events' => array(
1220 ':hover',
1221 ':focus',
1222 ),
1223
1224 'JavaScript Events' => array(
1225 'inView',
1226 'inView (once)',
1227 //'toggle',
1228 'click',
1229 'mouseenter',
1230 //'mouseleave',
1231 'JS focus',
1232 //'blur'
1233 ),
1234
1235 /*'View Events' => array(
1236 'inView',
1237 'inView (once)',
1238 ),
1239 'Mouse Events' => array(
1240 'click',
1241 'dblclick',
1242 'mouseenter',
1243 'mouseleave',
1244 'mouseover',
1245 'mouseout',
1246 ),
1247 'Form Events' => array(
1248 'change',
1249 'blur',
1250 'js focus',
1251 ),
1252 */
1253
1254 );
1255
1256 $this->selector_variations = array(
1257 'normal' => array(
1258 'label' => esc_html__('normal', 'microthemer'),
1259 'slug' => 'normal'
1260 ),
1261 ':hover' => array(
1262 'label' => esc_html__(':hover', 'microthemer'),
1263 'slug' => 'hover'
1264 ),
1265 ':focus' => array(
1266 'label' => esc_html__(':focus', 'microthemer'),
1267 'slug' => 'focus'
1268 ),
1269 '::before' => array(
1270 'label' => esc_html__('::before', 'microthemer'),
1271 'slug' => 'before'
1272 ),
1273 '::after' => array(
1274 'label' => esc_html__('::after', 'microthemer'),
1275 'slug' => 'after'
1276 )
1277 );
1278
1279 $this->browser_events = $this->to_autocomplete_arr($browser_events);
1280 $this->browser_event_keys = $this->autocomplete_to_param_keys($this->browser_events);
1281
1282 // system fonts
1283 $system_fonts = array(
1284
1285 __('System fonts', 'microthemer') => array(
1286 'Arial',
1287 '"Book Antiqua"',
1288 '"Bookman Old Style"',
1289 '"Arial Black"',
1290 'Charcoal',
1291 '"Comic Sans MS"',
1292 'cursive',
1293 'Courier',
1294 '"Courier New"',
1295 'Gadget',
1296 'Garamond',
1297 'Geneva',
1298 'Georgia',
1299 'Helvetica',
1300 'Impact',
1301 '"Lucida Console"',
1302 '"Lucida Grande"',
1303 '"Lucida Sans Unicode"',
1304 'Monaco',
1305 'monospace',
1306 '"MS Sans Serif"',
1307 '"MS Serif"',
1308 '"New York"',
1309 'Palatino',
1310 '"Palatino Linotype"',
1311 'sans-serif',
1312 'serif',
1313 'Symbol',
1314 'Tahoma',
1315 '"Times New Roman"',
1316 'Times',
1317 '"Trebuchet MS"',
1318 'Verdana',
1319 'Webdings',
1320 'Wingdings',
1321 '"Zapf Dingbats"'
1322 ),
1323 );
1324
1325 $this->system_fonts = $this->to_autocomplete_arr($system_fonts);
1326
1327
1328 $addActions = array(
1329 'add',
1330 'append',
1331 'prepend',
1332 'insertBefore',
1333 'insertAfter',
1334 );
1335 $this->modification = array(
1336 'juncture' => $this->to_autocomplete_arr(array(
1337 __('Server-side', 'microthemer') => array(
1338 'serverHTMLReady',
1339 ),
1340 __('Client-side', 'microthemer') => array(
1341 'DOMContentLoaded',
1342 'inview',
1343 'inview_once',
1344 'outview',
1345 'outview_once',
1346 'mouseenter',
1347 'mouseover',
1348 'mouseleave',
1349 'mouseout',
1350 'mousedown',
1351 'click',
1352 'focus',
1353 'input',
1354 'select',
1355 'change',
1356 'blur',
1357 ),
1358 )),
1359
1360 'action' => $this->to_autocomplete_arr(array(
1361 __('Add', 'microthemer') => $addActions,
1362 __('Rearrange', 'microthemer') => array(
1363 'replace',
1364 'replaceSubstring',
1365 'lazyLoad',
1366 'move',
1367 'remove',
1368 ),
1369 __('Run', 'microthemer') => array(
1370 'run',
1371 ),
1372
1373 )),
1374
1375 // attributes are concatenated on the JS side for the menu
1376 'aspect' => $this->to_autocomplete_arr(array(
1377 __('General', 'microthemer') => array(
1378 array(
1379 'label' => 'text',
1380 'value' => 'text',
1381 'condition' => 'action:add:1'
1382 ),
1383 /*array(
1384 'label' => 'blocks',
1385 'value' => 'blocks',
1386 'condition' => 'action:add:1'
1387 ),*/
1388 array(
1389 'label' => 'html',
1390 'value' => 'html',
1391 'condition' => 'action:add:1'
1392 ),
1393 array(
1394 'label' => 'innerHTML',
1395 'value' => 'innerHTML',
1396 'condition' => 'action:add:0'
1397 ),
1398
1399 // raw CSS code in any format - will be added to <head> as style tag
1400 array(
1401 'label' => 'css',
1402 'value' => 'css',
1403 'condition' => 'action:add:1'
1404 ),
1405
1406 // Raw JS code in any format - will be added before closing <body> as script tag following deps
1407 array(
1408 'label' => 'js',
1409 'value' => 'js',
1410 'condition' => 'action:add:1'
1411 ),
1412
1413 // For running single functions in response to events
1414 array(
1415 'label' => 'jsFunction',
1416 'value' => 'jsFunction',
1417 'condition' => 'action:add:1'
1418 ),
1419 ),
1420 __('Wrappers', 'microthemer') => array(
1421
1422 array(
1423 'label' => 'parentWrapper',
1424 'value' => 'parentWrapper',
1425 ),
1426 array(
1427 'label' => 'childWrapper',
1428 'value' => 'childWrapper',
1429 ),
1430 ),
1431
1432 /*__('Integrations', 'microthemer') => array(
1433 array(
1434 'label' => 'wp pattern',
1435 'value' => 'wp pattern',
1436 ),
1437 array(
1438 'label' => 'wp navigation',
1439 'value' => 'wp navigation',
1440 ),
1441 array(
1442 'label' => 'bricks template',
1443 'value' => 'bricks template',
1444 ),
1445 array(
1446 'label' => 'acf field',
1447 'value' => 'acf field',
1448 ),
1449 ),*/
1450 )),
1451
1452 'move_action' => $this->to_autocomplete_arr(array(
1453 __('Add', 'microthemer') => $addActions,
1454 __('Replace', 'microthemer') => array(
1455 'replace',
1456 'replaceSubstring',
1457 ),
1458 )),
1459
1460 'attribute' => $this->to_autocomplete_arr(array(
1461 'Multiple attributes' => array(
1462 'attributesString'
1463 ),
1464 __('Common attributes', 'microthemer') => array(
1465 'alt',
1466 'class',
1467 'height',
1468 'href',
1469 'id',
1470 'rel',
1471 'src',
1472 'style',
1473 'target',
1474 'title',
1475 'width',
1476 ),
1477 /*__('Form attributes', 'microthemer') => array(
1478 'autocomplete',
1479 'checked',
1480 'for',
1481 'name',
1482 'required',
1483 'selected',
1484 'type',
1485 'value'
1486 ),
1487 __('JavaScript event attributes', 'microthemer') => array(
1488 'onblur',
1489 'onchange',
1490 'onclick',
1491 'onfocus',
1492 'oninput',
1493 'onload',
1494 'onmouseover',
1495 'onmouseout',
1496 'onmousemove',
1497 'onselect'
1498 ),
1499 'Alpine.js attributes' => array(
1500 'x-data',
1501 'x-bind',
1502 'x-on',
1503 'x-text',
1504 'x-html',
1505 'x-model',
1506 'x-show',
1507 'x-transition',
1508 'x-for',
1509 'x-if',
1510 'x-init',
1511 'x-effect',
1512 'x-ref',
1513 'x-cloak',
1514 'x-ignore',
1515 ),*/
1516 )),
1517 'recent_prompts' => $this->to_autocomplete_arr(array(
1518
1519 // Microthemer and Amender
1520 __('CSS Styling', 'microthemer') => array(
1521 'Double the font-size',
1522 'Add a yellow/orange gradient',
1523 'Increase the padding',
1524 'Why aren\'t my styles having an effect?'
1525 ),
1526
1527 // Amender only, filter on the client-side if not supported
1528 __('Text', 'microthemer') => array(
1529 'Reword the text to sound more playful',
1530 'Add a "Take the tour" sub-heading',
1531 ),
1532 __('Media', 'microthemer') => array(
1533 'Add a video background of a whale swimming',
1534 'Insert an image of a monkey jumping after this element',
1535 'Replace this image with an image of a forest',
1536 ),
1537 __('Animate', 'microthemer') => array(
1538 'Slide the element up when it scrolls into view',
1539 'Create a GSAP typewriter animation that reveals letters in sequence'
1540 ),
1541 __('HTML', 'microthemer') => array(
1542 'Add a testimonial section with basic styling',
1543 'Insert a hero section after this header and style it with bold colors',
1544 'Remove this element',
1545 ),
1546 __('JavaScript', 'microthemer') => array(
1547 'Add a "confirm" prompt when they click this',
1548 'Make this link open in a new tab',
1549 'Add a countdown timer after this element for ' . wp_date('j M, Y', strtotime('+90 days'))
1550 ),
1551
1552 /*__('3D Effects', 'microthemer') => array(
1553 'Add a 3d scene of some animated golden stars',
1554 'Create a 3d scene of dust that gravitates towards mouse movement',
1555 ),*/
1556 )),
1557 );
1558
1559
1560
1561 // enq_js
1562 $this->enq_js_structure = array( // structure
1563 'slug' => 'enq_js',
1564 'name' => esc_html__('Enqueued Script', 'microthemer'),
1565 'add_button' => esc_html__('Add Script', 'microthemer'),
1566 'combo_add' => 1,
1567 'combo_add_arrow' => 1,
1568 'name_stub' => 'tvr_preferences[enq_js]',
1569 'level' => 'script',
1570 'items' => array(
1571 'fields' => array(
1572 'display_name' => array(
1573 'type' => 'hidden',
1574 'label' => 0
1575 )
1576 ),
1577 'icon' => array(
1578 'title' => esc_html__('Reorder Enqueued Script', 'microthemer'),
1579 ),
1580 'actions' => array(
1581 'delete' => array(
1582 'class' => 'delete-item',
1583 'title' => esc_html__('Remove Enqueued Script', 'microthemer'),
1584 ),
1585 'disabled' => array(
1586 'icon_control' => 1
1587 )
1588 ),
1589 'edit_fields' => 0
1590 )
1591 );
1592
1593 // media queries
1594 $this->mq_structure = array( // structure
1595 'slug' => 'mqs',
1596 'name' => esc_html__('Media Query', 'microthemer'),
1597 'add_button' => esc_html__('Add Media Query', 'microthemer'),
1598 'input_placeholder' => 'Enter label',
1599 'name_stub' => 'tvr_preferences[m_queries]',
1600 'level' => 'mquery',
1601 'base_key' => $this->unq_base,
1602 'items' => array(
1603 'fields' => array(
1604 'label' => array(
1605 'type' => 'text',
1606 'label' => esc_html__('Label', 'microthemer'),
1607 'name_class' => 'edit-item',
1608 'label_title' => esc_html__('Give your media query a descriptive name', 'microthemer'),
1609 ),
1610 'query' => array(
1611 'type' => 'textarea',
1612 'label' => esc_html__('Media Query', 'microthemer'),
1613 'label_title' => esc_html__('Set the media query condition', 'microthemer'),
1614 ),
1615 'site_preview_width' => array(
1616 'type' => 'text',
1617 'field_class' => 'tvr-input-wrap',
1618 'input_class' => 'combobox has-arrows',
1619 'input_rel' => 'builder_sync_tabs',
1620 'input_arrows' => '<span class="combo-arrow combo-dots"></span>',
1621 'label' => esc_html__('Site preview width / builder sync (optional)', 'microthemer'),
1622 'label_title' => esc_html__('Specify the site preview width for this tab, or sync with a page builder responsive view.', 'microthemer'),
1623 ),
1624 'hide' => array(
1625 'type' => 'checkbox',
1626 'field_class' => 'mq-checkbox-wrap',
1627 'label' => esc_html__('Hide tab in interface', 'microthemer'),
1628 'label_title' => esc_html__('Hide this tab in the interface if you don\'t need it right now', 'microthemer'),
1629 'label2' => esc_html__('Yes (no settings will be lost)', 'microthemer')
1630 ),
1631 ),
1632 'icon' => array(
1633 'title' => esc_html__('Reorder Media Query', 'microthemer'),
1634 ),
1635 'actions' => array(
1636 'delete' => array(
1637 'class' => 'delete-item',
1638 'title' => esc_html__('Delete Media Query', 'microthemer'),
1639 ),
1640 'edit' => array(
1641 'class' => 'edit-item',
1642 'title' => esc_html__('Edit Media Query', 'microthemer'),
1643 ),
1644 )
1645 )
1646 );
1647
1648 $this->suggested_screen_layouts = $this->suggested_screen_layouts();
1649
1650 // main options menu (should come after preferences have been got/set)
1651 $default_path = $this->root_rel($this->preferences['preview_url'], false, true);
1652 $default_path = $default_path ? $default_path : '/';
1653 $this->menu = array(
1654 'general' => array(
1655 'name' => esc_html__('General', 'microthemer'),
1656 'icon_class' => 'general-program-settings',
1657 'sub' => array(
1658
1659 'initial_setup' => array(
1660 'name' => esc_html__('Setup', 'microthemer'),
1661 'title' => $this->appNameFull . ' ' . esc_attr__('Setup', 'microthemer'),
1662 'dialog' => 1,
1663 'class' => 'mt-initial-setup',
1664 'icon_name' => 'box-open'
1665 ),
1666
1667 // prompt to unlock
1668 /*'buyer_validated' => array(
1669 'name' => esc_html__('Unlock Microthemer', 'microthemer'),
1670 'title' => $this->preferences['buyer_validated'] ?
1671 esc_attr__('Validate license using a different license key', 'microthemer') :
1672 esc_attr__('Enter your code to unlock Microthemer (see My Downloads on themeover.com)', 'microthemer'),
1673 'dialog' => 1,
1674 'class' => 'unlock-microthemer',
1675 'icon_name' => 'unlock-alt'
1676 ),*/
1677
1678 'generated' => array(
1679 //'new_set' => 1,
1680 'name' => esc_html__('Generated code', 'microthemer'),
1681 /* translators: %s: application name */
1682 'title' => sprintf(esc_attr__('View the code %s generates', 'microthemer'), $this->appName),
1683 'dialog' => 1,
1684 'class' => 'display-css-code',
1685 'icon_name' => 'view-code',
1686 'icon_title' => 'Ctrl + Alt + G',
1687 ),
1688
1689 'preferences' => array(
1690
1691 'name' => esc_html__('Preferences', 'microthemer'),
1692 'title' => esc_attr__('Edit global preferences', 'microthemer'),
1693 'dialog' => 1,
1694 'class' => 'display-preferences',
1695 'icon_name' => 'cog'
1696 ),
1697
1698 'media_queries' => array(
1699 'name' => esc_html__('Media queries', 'microthemer'),
1700 'title' => esc_attr__('Edit media queries', 'microthemer'),
1701 'dialog' => 1,
1702 'class' => 'edit-media-queries',
1703 'icon_name' => 'devices'
1704 ),
1705
1706 'js_libraries' => array(
1707 'name' => esc_html__('JS Libraries', 'microthemer'),
1708 'title' => esc_attr__('Enqueue WordPress JavaScript libraries', 'microthemer'),
1709 'dialog' => 1,
1710 'class' => 'mt-enqueue-js',
1711 'icon_name' => 'js'
1712 ),
1713
1714
1715 'auto_save_mode' => array(
1716 'name' => esc_html__('Auto-save', 'microthemer'),
1717 'title' => esc_attr__("Automatically save style changes as you make them (recommended)", 'microthemer'),
1718 'toggle' => $this->preferences['auto_save_mode'],
1719 'class' => 'auto-save-mode',
1720 'data-pos' => esc_attr__('Enable Auto-save', 'microthemer'),
1721 'data-neg' => esc_attr__('Disable Auto-save', 'microthemer'),
1722 ),
1723
1724 'auto_publish_mode' => array(
1725 //'new_set' => 1,
1726 'name' => esc_html__('Auto-publish', 'microthemer'),
1727 'title' => esc_attr__("Automatically publish changes rather than saving as draft first", 'microthemer'),
1728 'toggle' => $this->preferences['auto_publish_mode'],
1729 'class' => 'auto-publish-mode',
1730 'data-pos' => esc_attr__('Enable Auto-publish', 'microthemer'),
1731 'data-neg' => esc_attr__('Disable Auto-publish', 'microthemer'),
1732 ),
1733
1734 )
1735 ),
1736
1737 'preview_page' => array(
1738
1739 'name' => esc_html__('Page', 'microthemer'),
1740 'sub' => array(
1741 'preview_url' => array(
1742 'icon_title' => 'Ctrl + Alt + N',
1743 'name' => '',
1744 'title' => esc_html__('Go to a new page', 'microthemer'),
1745 'class' => 'switch-preview',
1746 'combo_data' => 'custom_paths',
1747 'input' => '', //$default_path,
1748 'input_id' => 'previewPath',
1749 'input_name' => 'set_preview_url',
1750 'input_placeholder' => esc_html__('Search site', 'microthemer'),
1751 'button' => array(
1752 'text' => esc_html__('Go', 'microthemer'),
1753 'class' => 'change-preview-url'
1754 ),
1755 // todo support Auto-load Elementor toggle
1756 /*'checkboxes' => array(
1757 array(
1758 'name' => 'launch_builder',
1759 'label' => 'Launch <span class="available-builder-name">builder</span> on new page'
1760 )
1761 )*/
1762 ),
1763 'mt_nonlog' => array(
1764 'name' => esc_html__('Logged out view', 'microthemer'),
1765 'title' => esc_attr__("View the page like a non-logged in site visitor", 'microthemer'),
1766 'class' => 'mt_non_logged',
1767 'toggle' => !empty($this->preferences['mt_nonlog']),
1768 'data-pos' => esc_attr__('Load preview as non-logged-in user', 'microthemer'),
1769 'data-neg' => esc_attr__('Load preview as logged-in user', 'microthemer'),
1770 ),
1771
1772 )
1773
1774 ),
1775
1776 // page builders (and maybe other integrations)
1777 'integrations' => array(
1778
1779 'name' => esc_html__('Integrations', 'microthemer'),
1780 'sub' => array(
1781
1782 'sync_browser_tabs' => array(
1783 //'icon_title' => '',
1784 'name' => esc_html__('Sync browser tabs', 'microthemer'),
1785 /* translators: %s: application name */
1786 'title' => sprintf(esc_attr__("Auto-refresh %s CSS in other browser tabs", 'microthemer'), $this->appName),
1787 'class' => 'sync-browser-tabs',
1788 'toggle' => !empty($this->preferences['sync_browser_tabs']),
1789 'data-pos' => esc_attr__('Enable synced browser tabs', 'microthemer'),
1790 'data-neg' => esc_attr__('Disable synced browser tabs', 'microthemer'),
1791 ),
1792
1793 'activate_gutenberg' => array(
1794 'icon_title' => 'Ctrl + Alt + B',
1795 'name' => esc_html__('Enable Gutenberg', 'microthemer'),
1796 'title' => esc_attr__("Make page editable with Gutenberg", 'microthemer'),
1797 'class' => 'toggle-elementor',
1798 'toggle' => strpos($this->preferences['preview_url'], 'post.php?post='),
1799 'data-pos' => esc_attr__('Enable Gutenberg', 'microthemer'),
1800 'data-neg' => esc_attr__('Save & Exit Gutenberg', 'microthemer'),
1801 ),
1802
1803 // autoload feature should only autoload if the page has already been edited
1804 // set an option on preferences "Only autoload builder if previously launched manually" : "Yes"
1805 // uncomment options below when the logic for testing this has been implemented
1806 // Changelog: * "Autoload" option added to the integrations menu for supported builders: Elementor, Beaver Builder, Oxygen.
1807
1808 'enable_beaver_builder' => array(
1809 'icon_title' => 'Ctrl + Alt + B',
1810 'name' => esc_html__('Enable BB', 'microthemer'),
1811 'title' => esc_attr__("Make page editable with Beaver Builder", 'microthemer'),
1812 'class' => 'toggle-beaver-builder',
1813 'toggle' => strpos($this->preferences['preview_url'], '?fl_builder'),
1814 'data-pos' => esc_attr__('Enable Beaver Builder', 'microthemer'),
1815 'data-neg' => esc_attr__('Publish & Exit Beaver Builder', 'microthemer'),
1816 ),
1817
1818 /*'autoload_FLBuilder' => array(
1819 'name' => esc_html__('Autoload Beaver Builder', 'microthemer'),
1820 'title' => esc_attr__("Automatically enable Beaver Builder on startup and page navigation", 'microthemer'),
1821 'class' => 'autoload-beaver_builder',
1822 'toggle' => !empty($this->preferences['autoload_FLBuilder']),
1823 'data-pos' => esc_attr__('Enable Beaver Builder autoload', 'microthemer'),
1824 'data-neg' => esc_attr__('Disable Beaver Builder autoload', 'microthemer'),
1825 ),*/
1826
1827 'activate_elementor' => array(
1828 'icon_title' => 'Ctrl + Alt + B',
1829 'name' => esc_html__('Enable Elementor', 'microthemer'),
1830 'title' => esc_attr__("Make page editable with Elementor", 'microthemer'),
1831 'class' => 'toggle-elementor',
1832 'toggle' => strpos($this->preferences['preview_url'], 'action=elementor'),
1833 'data-pos' => esc_attr__('Enable Elementor', 'microthemer'),
1834 'data-neg' => esc_attr__('Publish & Exit Elementor', 'microthemer'),
1835 ),
1836
1837 /*'autoload_elementor' => array(
1838 'name' => esc_html__('Autoload Elementor', 'microthemer'),
1839 'title' => esc_attr__("Automatically enable Elementor on startup and page navigation", 'microthemer'),
1840 'class' => 'autoload-elementor',
1841 'toggle' => !empty($this->preferences['autoload_elementor']),
1842 'data-pos' => esc_attr__('Enable Elementor autoload', 'microthemer'),
1843 'data-neg' => esc_attr__('Disable Elementor autoload', 'microthemer'),
1844 ),*/
1845
1846 'activate_oxygen' => array(
1847 //'new_set' => 1,
1848 'icon_title' => 'Ctrl + Alt + B',
1849 'name' => esc_html__('Enable Oxygen', 'microthemer'),
1850 'title' => esc_attr__("Make page editable with Oxygen", 'microthemer'),
1851 'class' => 'toggle-oxygen',
1852 'toggle' => strpos($this->preferences['preview_url'], 'oxygen_iframe=true'),
1853 'data-pos' => esc_attr__('Enable Oxygen', 'microthemer'),
1854 'data-neg' => esc_attr__('Save & Exit Oxygen', 'microthemer'),
1855 ),
1856 /*
1857 'autoload_oxygen' => array(
1858 'name' => esc_html__('Autoload Oxygen', 'microthemer'),
1859 'title' => esc_attr__("Automatically enable Oxygen on startup and page navigation", 'microthemer'),
1860 'class' => 'autoload-oxygen',
1861 'toggle' => !empty($this->preferences['autoload_oxygen']),
1862 'data-pos' => esc_attr__('Enable Oxygen autoload', 'microthemer'),
1863 'data-neg' => esc_attr__('Disable Oxygen autoload', 'microthemer'),
1864 ),*/
1865
1866
1867 )
1868
1869 ),
1870
1871
1872 'history' => array(
1873 'common_option' => 1,
1874 'icon_class' => 'change-history',
1875 'name' => esc_html__('History', 'microthemer'),
1876 'sub' => array(
1877 'revisions_summary' => array(
1878 'id' => 'revisions-summary',
1879 'class' => 'revisions-summary',
1880 'custom' => $this->getRevisions(true)
1881 ),
1882 'restore_styles' => array(
1883 'name' => esc_html__('All revisions', 'microthemer'),
1884 'title' => esc_attr__("View full list of revisions", 'microthemer'),
1885 'class' => 'display-revisions',
1886 'icon_name' => 'undo',
1887 'dialog' => 1
1888 ),
1889 'ui_reset' => array(
1890 'new_set' => '',
1891 'name' => esc_html__('Reset everything', 'microthemer'),
1892 'title' => esc_attr__("Reset the interface to the default empty folders", 'microthemer'),
1893 'class' => 'folder-reset',
1894 'icon_name' => 'reset-folders'
1895 ),
1896 )
1897 ),
1898 'view' => array(
1899 'common_option' => 1,
1900 'icon_class' => 'interface-view',
1901 'name' => esc_html__('View', 'microthemer'),
1902 'sub' => array(
1903
1904 'mt_dark_mode' => array(
1905 //'new_set' => 1,
1906 'name' => esc_html__('Dark theme', 'microthemer'),
1907 'title' => esc_attr__("Set a darker theme for the interface", 'microthemer'),
1908 'toggle' => $this->preferences['mt_dark_mode'],
1909 'class' => 'mt_dark_mode-switch',
1910 'data-pos' => esc_attr__('Enable dark theme', 'microthemer'),
1911 'data-neg' => esc_attr__('Disable dark theme', 'microthemer'),
1912 'data-fhtml' => 1
1913 ),
1914
1915 'show_code_editor' => array(
1916 'name' => esc_html__('Full code editor', 'microthemer'),
1917 'title' => esc_attr__("Switch code/GUI view", 'microthemer')
1918 . " (Ctrl + Alt + C)",
1919 'class' => 'edit-css-code',
1920 'toggle' => $this->preferences['show_code_editor'],
1921 'toggle_id' => 'toggle-full-code-editor',
1922 'data-pos' => esc_attr__('Show code editor', 'microthemer'),
1923 'data-neg' => esc_attr__('Show GUI', 'microthemer'),
1924 ),
1925
1926 // frontend view options
1927 'show_rulers' => array(
1928 //'new_set' => 1,
1929 'name' => esc_html__('Show rulers', 'microthemer'),
1930 'title' => esc_attr__("Toggle rulers", 'microthemer'),
1931 'class' => 'toggle-rulers',
1932 'toggle' => $this->preferences['show_rulers'],
1933 'data-pos' => esc_attr__('Show rulers', 'microthemer'),
1934 'data-neg' => esc_attr__('hide rulers', 'microthemer'),
1935 ),
1936
1937 'wireframe_mode' => array(
1938 //'new_set' => 1,
1939 'name' => esc_html__('Wireframe mode', 'microthemer'),
1940 'title' => esc_attr__("Toggle wireframe mode", 'microthemer'),
1941 'class' => 'toggle-rulers',
1942 'toggle' => !empty($this->preferences['wireframe_mode']),
1943 'data-pos' => esc_attr__('Enable wireframe mode', 'microthemer'),
1944 'data-neg' => esc_attr__('Disable wireframe mode', 'microthemer'),
1945 'data-no-save' => 1,
1946 'data-fhtml' => 1
1947 ),
1948
1949 // detach preview
1950 'detach_preview' => array(
1951 //'new_set' => 1,
1952 //'keyboard_shortcut' => 'Ctrl + Alt + D',
1953 'name' => esc_html__('Detach preview', 'microthemer'),
1954 'title' => esc_attr__("Detach site preview for separate screen", 'microthemer'),
1955 'class' => 'toggle-detached-preview',
1956 'toggle' => !empty($this->preferences['detach_preview']),
1957 'data-pos' => esc_attr__('Detach site preview', 'microthemer'),
1958 'data-neg' => esc_attr__('Attach site preview', 'microthemer'),
1959 ),
1960
1961
1962
1963 // full screen - see if anyone misses this
1964 /*'fullscreen' => array(
1965 //'new_set' => 1,
1966 'name' => esc_html__('Fullscreen', 'microthemer'),
1967 'title' => esc_attr__("Switch fullscreen mode", 'microthemer'),
1968 'class' => 'toggle-full-screen',
1969 'toggle' => 0,
1970 'data-pos' => esc_attr__('Enable fullscreen mode', 'microthemer'),
1971 'data-neg' => esc_attr__('Disable fullscreen mode', 'microthemer'),
1972 ),*/
1973
1974 // show
1975 /*'show_text_labels' => array(
1976 //'new_set' => 1,
1977 'name' => esc_html__('Property text labels', 'microthemer'),
1978 'title' => esc_attr__("Toggle text labels (Ctrl + Alt + L)", 'microthemer'),
1979 'class' => 'toggle-mt-property-labels',
1980 'toggle' => $this->preferences['show_text_labels'],
1981 'data-pos' => esc_attr__('Enable text labels', 'microthemer'),
1982 'data-neg' => esc_attr__('Disable text labels', 'microthemer'),
1983 ),*/
1984
1985
1986
1987 // suggested layout for screen size
1988 'suggested_layout' => array(
1989 'new_set' => '',
1990 'name' => esc_html__('Suggested layouts', 'microthemer'),
1991 'title' => esc_attr__("Suggested layout for screen size", 'microthemer'),
1992 'class' => 'suggested-screen-layout',
1993 'custom' => $this->screen_layout_options()
1994 ),
1995
1996 // suggested layout for screen size
1997 'advanced_layout_options' => array(
1998 'nested' => array(
1999 'name' => esc_html__('Fine tune layout', 'microthemer'),
2000 'sub' => array(
2001
2002 // expand device tabs onto a new row
2003 'expand_device_tabs' => array(
2004 //'new_set' => 1,
2005 'name' => esc_html__('Expand device tabs', 'microthemer'),
2006 'title' => esc_attr__("Have a separate row for the responsive tabs", 'microthemer'),
2007 'class' => 'full-width-responsive-tabs',
2008 'toggle' => !empty($this->preferences['expand_device_tabs']),
2009 'data-pos' => esc_attr__('Enable full width', 'microthemer'),
2010 'data-neg' => esc_attr__('Disable full width', 'microthemer'),
2011 'data_attr' => array(
2012 'layout-preset' => 'view'
2013 )
2014 ),
2015
2016 // dock folders left
2017 'dock_folders_left' => array(
2018 'new_set' => esc_html__('Left sidebar', 'microthemer'),
2019 'name' => esc_html__('Dock folders left', 'microthemer'),
2020 'title' => esc_attr__("Dock the style options to the left of the screen", 'microthemer'),
2021 'class' => 'toggle-dock-folders-left',
2022 'toggle' => !empty($this->preferences['dock_folders_left']),
2023 'data-pos' => esc_attr__('Dock folders left', 'microthemer'),
2024 'data-neg' => esc_attr__('Undock folders', 'microthemer'),
2025 'data_attr' => array(
2026 'layout-preset' => 'view'
2027 )
2028 ),
2029
2030 // dock editor left
2031 'dock_editor_left' => array(
2032 'name' => esc_html__('Dock editor left', 'microthemer'),
2033 'title' => esc_attr__("Dock the code editor to the left of the site preview", 'microthemer'),
2034 'class' => 'toggle-dock-editor-left',
2035 'toggle' => !empty($this->preferences['dock_editor_left']),
2036 'data-pos' => esc_attr__('Dock editor left', 'microthemer'),
2037 'data-neg' => esc_attr__('Dock editor top', 'microthemer'),
2038 'data_attr' => array(
2039 'layout-preset' => 'view'
2040 )
2041 ),
2042
2043 // dock styles left
2044 'dock_styles_left' => array(
2045
2046 'name' => esc_html__('Dock styles left', 'microthemer'),
2047 'title' => esc_attr__("Dock the style options to the left of the screen", 'microthemer'),
2048 'class' => 'toggle-dock-styles-left',
2049 'toggle' => !empty($this->preferences['dock_styles_left']),
2050 'data-pos' => esc_attr__('Dock styles left', 'microthemer'),
2051 'data-neg' => esc_attr__('Dock styles top', 'microthemer'),
2052 'data_attr' => array(
2053 'layout-preset' => 'view'
2054 )
2055 ),
2056
2057 // dock styles left
2058 'sticky_styles_toolbar' => array(
2059 'name' => esc_html__('Sticky styles toolbar', 'microthemer'),
2060 'title' => esc_attr__("Always display styles navigation toolbar", 'microthemer'),
2061 'class' => 'sticky-styles-toolbar',
2062 'toggle' => !empty($this->preferences['sticky_styles_toolbar']),
2063 'data-pos' => esc_attr__('Stick styles toolbar in place', 'microthemer'),
2064 'data-neg' => esc_attr__('Unstick styles toolbar', 'microthemer')
2065 ),
2066
2067 'full_height_left_sidebar' => array(
2068 'name' => esc_html__('Full height sidebar', 'microthemer'),
2069 'title' => esc_attr__("Make the left sidebar fill the height of the screen", 'microthemer'),
2070 'class' => 'full-height-left-sidebar',
2071 'toggle' => !empty($this->preferences['full_height_left_sidebar']),
2072 'data-pos' => esc_attr__('Enable full height', 'microthemer'),
2073 'data-neg' => esc_attr__('Disable full height', 'microthemer'),
2074 'data_attr' => array(
2075 'layout-preset' => 'view'
2076 )
2077 ),
2078
2079 // Num left columns
2080 'left_sidebar_columns' => array(
2081 'name' => esc_html__('Number of columns', 'microthemer'),
2082 'title' => esc_attr__("Display left docked content in one or more columns", 'microthemer'),
2083 'class' => 'left-sidebar-layout has-select-menu',
2084 'column_options' => 'left',
2085 'data_attr' => array(
2086 'layout-preset' => 'view',
2087 'aspect' => 'left_sidebar_columns'
2088 )
2089 ),
2090
2091 // RIGHT
2092
2093
2094
2095 // dock_settings_right
2096 'dock_settings_right' => array(
2097 'new_set' => esc_html__('Right sidebar', 'microthemer'),
2098 'name' => esc_html__('Dock settings right', 'microthemer'),
2099 'title' => esc_attr__("Dock these program settings right", 'microthemer'),
2100 'class' => 'toggle-dock-program-settings-right',
2101 'toggle' => !empty($this->preferences['dock_settings_right']),
2102 'data-pos' => esc_attr__('Dock program settings right', 'microthemer'),
2103 'data-neg' => esc_attr__('Undock program settings', 'microthemer'),
2104 'data_attr' => array(
2105 'layout-preset' => 'view'
2106 )
2107 ),
2108
2109 'dock_ai_right' => array(
2110 'name' => esc_html__('Dock AI right', 'microthemer'),
2111 'title' => esc_attr__("Dock AI assistant right", 'microthemer'),
2112 'class' => 'toggle-dock-ai-right',
2113 'toggle' => !empty($this->preferences['dock_ai_right']),
2114 'data-pos' => esc_attr__('Dock AI assistant right', 'microthemer'),
2115 'data-neg' => esc_attr__('Undock AI assistant', 'microthemer'),
2116 'data_attr' => array(
2117 'layout-preset' => 'view'
2118 )
2119 ),
2120
2121 // dock_settings_right
2122 /*'dock_wizard_right' => array(
2123 'name' => esc_html__('Dock inspection right', 'microthemer'),
2124 'title' => esc_attr__("Dock the inspection options to the right of the screen", 'microthemer'),
2125 'class' => 'toggle-dock-inspection-right',
2126 'toggle' => !empty($this->preferences['dock_wizard_right']),
2127 'data-pos' => esc_attr__('Dock right', 'microthemer'),
2128 'data-neg' => esc_attr__('Dock bottom', 'microthemer'),
2129 ),*/
2130
2131 // Always have full height so settings panel never moves based on toggle change
2132 'full_height_right_sidebar' => array(
2133 'name' => esc_html__('Full height sidebar', 'microthemer'),
2134 'title' => esc_attr__("Make the right sidebar fill the height of the screen", 'microthemer'),
2135 'class' => 'full-height-right-sidebar',
2136 'toggle' => !empty($this->preferences['full_height_right_sidebar']),
2137 'data-pos' => esc_attr__('Enable full height', 'microthemer'),
2138 'data-neg' => esc_attr__('Disable full height', 'microthemer'),
2139 'data_attr' => array(
2140 'layout-preset' => 'view'
2141 )
2142 ),
2143
2144 // Num right columns
2145 'right_sidebar_columns' => array(
2146 'name' => esc_html__('Number of columns', 'microthemer'),
2147 'title' => esc_attr__("Display right docked content in one or more columns", 'microthemer'),
2148 'class' => 'right-sidebar-layout has-select-menu',
2149 'column_options' => 'right',
2150 'data_attr' => array(
2151 'layout-preset' => 'view',
2152 'aspect' => 'right_sidebar_columns'
2153 )
2154 ),
2155 )
2156 ),
2157 ),
2158 )
2159 ),
2160
2161 'packs' => array(
2162 'icon_class' => 'import-export-icon',
2163 'name' => esc_html__('Import / Export', 'microthemer'),
2164 'sub' => array(
2165 'manage' => array(
2166 'name' => esc_html__('Install & Manage', 'microthemer'),
2167 'title' => esc_attr__("Install & manage your design packages", 'microthemer'),
2168 'class' => 'manage-design-packs',
2169 'icon_name' => 'manage-packs',
2170 'dialog' => 1
2171 ),
2172 'import' => array(
2173 'name' => esc_html__('Import Settings', 'microthemer'),
2174 'title' => esc_attr__("Import from a design pack or CSS stylesheet", 'microthemer'),
2175 'class' => 'import-from-pack',
2176 'icon_name' => 'import',
2177 'dialog' => 1
2178 ),
2179 'export' => array(
2180 'name' => esc_html__('Export Settings', 'microthemer'),
2181 'title' => esc_attr__("Export your settings to a design pack", 'microthemer'),
2182 'class' => 'export-to-pack',
2183 'icon_name' => 'export',
2184 'dialog' => 1
2185 ),
2186 )
2187 ),
2188
2189 'shortcuts' => array(
2190 'name' => esc_html__('Keyboard shortcuts', 'microthemer'),
2191 'sub' => array(
2192 'keyboard_shortcuts' => array(
2193 'name' => esc_html__('Keyboard shortcuts', 'microthemer'),
2194 //'title' => esc_attr__("Suggested layout for screen size", 'microthemer'),
2195 'class' => 'keyboard-shortcuts',
2196 'custom' => $this->keyboard_shortcuts_list()
2197 ),
2198 )
2199 ),
2200
2201 'support' => array(
2202 'name' => esc_html__('Microthemer Help', 'microthemer'),
2203 'icon_class' => 'help-icon',
2204 'sub' => array(
2205 'video' => array(
2206 'name' => esc_html__('Microthemer video', 'microthemer'),
2207 'title' => esc_attr__("Microthemer basic workflow",
2208 'microthemer'),
2209 'class' => 'demo-video',
2210 'icon_name' => 'play',
2211 'link_target' => '_blank',
2212 'item_link' => $this->demo_video
2213 ),
2214 'changes_video' => array(
2215 'name' => esc_html__('V6 to V7 changes', 'microthemer'),
2216 'title' => esc_attr__("The 3 main changes for V6 users to adjust to",
2217 'microthemer'),
2218 'class' => 'demo-video',
2219 'icon_name' => 'play',
2220 'link_target' => '_blank',
2221 'item_link' => 'https://themeover.com/v6-to-v7-3-main-changes/'
2222 ),
2223 'docs' => array(
2224 'name' => esc_html__('Microthemer Docs', 'microthemer'),
2225 'title' => esc_attr__("Learn how to use Microthemer", 'microthemer'),
2226 'class' => 'online-docs',
2227 'icon_name' => 'help',
2228 'link_target' => '_blank',
2229 'item_link' => 'https://themeover.com/install-and-setup/'
2230 ),
2231 'reference' => array(
2232 'name' => esc_html__('CSS Reference', 'microthemer'),
2233 'title' => esc_attr__("Learn how to use each CSS property", 'microthemer'),
2234 'class' => 'program-docs',
2235 'icon_name' => 'docs',
2236 'data_attr' => array(
2237 'prop-group' => 'font',
2238 'prop' => 'font_family'
2239 ),
2240 'dialog' => 1
2241 ),
2242 'forum' => array(
2243 'name' => esc_html__('Microthemer Forum', 'microthemer'),
2244 'title' => esc_attr__("Get help in the forum", 'microthemer'),
2245 'class' => 'support-forum',
2246 'icon_name' => 'forum',
2247 'link_target' => '_blank',
2248 'item_link' => 'https://themeover.com/forum/'
2249 ),
2250 )
2251 ),
2252
2253 'amender_support' => array(
2254 'name' => esc_html__('Amender Help', 'microthemer'),
2255 'icon_class' => 'help-icon',
2256 'sub' => array(
2257 'video' => array(
2258 'name' => esc_html__('Amender video', 'microthemer'),
2259 'title' => esc_attr__("Amender basic workflow",
2260 'microthemer'),
2261 'class' => 'demo-video',
2262 'icon_name' => 'play',
2263 'link_target' => '_blank',
2264 'item_link' => $this->amender_demo_video
2265 ),
2266 'forum' => array(
2267 'name' => esc_html__('Amender Forum', 'microthemer'),
2268 'title' => esc_attr__("Get help in the forum", 'microthemer'),
2269 'class' => 'support-forum',
2270 'icon_name' => 'forum',
2271 'link_target' => '_blank',
2272 'item_link' => 'https://themeover.com/forum/amender'
2273 ),
2274 )
2275 ),
2276
2277
2278 /*'dashboard' => array(
2279 'direct-action' => 1,
2280 'icon_class' => 'wp-dashboard-icon',
2281 'name' => esc_html__('WP Dashboard', 'microthemer'),
2282 'title' => esc_attr__("Go to your WordPress dashboard", 'microthemer'),
2283 'class' => 'back-to-wordpress',
2284 'item_link' => $this->wp_blog_admin_url
2285 ),
2286 'frontend' => array(
2287 'direct-action' => 1,
2288 'icon_class' => 'site-frontend-icon',
2289 'name' => esc_html__('Site frontend', 'microthemer'),
2290 'title' => esc_attr__("Go to your website", 'microthemer'),
2291 'class' => 'back-to-frontend',
2292 'item_link' => $this->preferences['preview_url'],
2293 'link_id' => 'back-to-frontend'
2294 ),*/
2295
2296 'exit' => array(
2297 'custom_insert' => 1,
2298 'icon_class' => 'exit-to-wordpress',
2299 'name' => esc_html__('Exit', 'microthemer'),
2300 'sub' => array(
2301 'dashboard' => array(
2302 'name' => esc_html__('WordPress dashboard', 'microthemer'),
2303 'title' => esc_attr__("Go to your WordPress dashboard", 'microthemer'),
2304 'class' => 'back-to-wordpress',
2305 'icon_name' => 'wordpress',
2306 'item_link' => $this->wp_blog_admin_url
2307 ),
2308 'outside' => array(
2309 'name' => esc_html__('Edit page directly', 'microthemer'),
2310 'title' => esc_attr__("Edit the page outside of", 'microthemer') . ' ' . $this->appName,
2311 'class' => 'edit-page-directly',
2312 'icon_name' => 'wordpress',
2313 'item_link' => $this->preferences['preview_url'],
2314 'link_id' => 'edit-page-directly',
2315 'text_data_attr' => array(
2316 'draft-status' => esc_attr__('draft', 'microthemer'),
2317 ),
2318 ),
2319 'frontend' => array(
2320 'name' => esc_html__('Site frontend', 'microthemer'),
2321 'title' => esc_attr__("View the frontend page", 'microthemer'),
2322 'class' => 'back-to-frontend',
2323 'icon_name' => 'site-frontend',
2324 'item_link' => $this->preferences['preview_url'],
2325 'link_id' => 'back-to-frontend',
2326 'text_data_attr' => array(
2327 'draft-status' => esc_attr__('draft', 'microthemer'),
2328 ),
2329 ),
2330 )
2331 ),
2332
2333 // more menu
2334
2335
2336
2337
2338 );
2339
2340 // have a dev menu solely for our testing
2341 if (TVR_DEV_MODE){
2342 $this->menu['dev'] = array(
2343 'common_option' => 1,
2344 'icon_class' => 'mt-dev-only',
2345 'name' => esc_html__('Dev', 'microthemer'),
2346 'sub' => array(
2347 'show_time_concurrently' => array(
2348 'name' => esc_html__('Concurrent timers', 'microthemer'),
2349 'title' => esc_attr__("Output functions times in browser console as they happen", 'microthemer'),
2350 'toggle' => 0,
2351 'class' => 'show_time_concurrently',
2352 'data-pos' => esc_attr__('Enable', 'microthemer'),
2353 'data-neg' => esc_attr__('Disable', 'microthemer'),
2354 ),
2355 'show_total_times' => array(
2356 'name' => esc_html__('Show total function times', 'microthemer'),
2357 'short_name' => esc_html__('Order by', 'microthemer'),
2358 'class' => 'show_total_times',
2359 'title' => esc_attr__("Show functions that have accrued time since page load and subsequent actions.", 'microthemer'),
2360 'text_class' => 'link menu-input-toggle',
2361 'combo_data' => 'show_total_times',
2362 'input' => 'avg_time',
2363 'button' => array(
2364 'text' => esc_html__('OK', 'microthemer'),
2365 'class' => 'change-show_total_times'
2366 )
2367 ),
2368 'clear_logs' => array(
2369 'name' => esc_html__('Clear console logs', 'microthemer'),
2370 'title' => esc_attr__('Clear everything in the browser console', 'microthemer'),
2371 'class' => 'clear-console-logs'
2372 ),
2373 /*
2374 'test_all_mt_actions' => array(
2375 'name' => esc_html__('Test every MT action', 'microthemer'),
2376 'title' => esc_attr__('Run every function in MT specified in auto-test.js', 'microthemer'),
2377 'class' => 'test_all_mt_actions'
2378 )*/
2379 )
2380 );
2381
2382 }
2383
2384
2385