Version Description
- SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
- New admin interface (new framework)
- You can now add links in the feature area using the tag (user request)
- You can now force the plugin's original fonts (user request)
- Added docs and support forums links
- Added instructions
- Much cleaner code
Download this release
Release Info
Developer | spwebguy |
Plugin | Responsive Pricing Table |
Version | 4.0 |
Comparing to | |
See all releases |
Code changes from version 3.5.1 to 4.0
- cmb2/bootstrap.php +61 -0
- cmb2/css/cmb2.css +2928 -0
- cmb2/css/cmb2.css.map +7 -0
- cmb2/css/cmb2.min.css +1 -0
- cmb2/css/index.php +0 -0
- cmb2/css/sass/cmb2.scss +14 -0
- cmb2/css/sass/index.php +0 -0
- cmb2/css/sass/partials/_collapsible_ui.scss +52 -0
- cmb2/css/sass/partials/_jquery_ui.scss +289 -0
- cmb2/css/sass/partials/_main_wrap.scss +438 -0
- cmb2/css/sass/partials/_misc.scss +20 -0
- cmb2/css/sass/partials/_mixins.scss +40 -0
- cmb2/css/sass/partials/_post_metaboxes.scss +114 -0
- cmb2/css/sass/partials/_sidebar_placements.scss +153 -0
- cmb2/css/sass/partials/_timepicker.scss +40 -0
- cmb2/css/sass/partials/_variables.scss +22 -0
- cmb2/css/sass/partials/index.php +0 -0
- {dkrpt → cmb2}/images/ico-delete.png +0 -0
- cmb2/images/index.php +0 -0
- {dkrpt → cmb2}/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- {dkrpt → cmb2}/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- {dkrpt → cmb2}/images/ui-icons_222222_256x240.png +0 -0
- {dkrpt → cmb2}/images/ui-icons_2e83ff_256x240.png +0 -0
- {dkrpt → cmb2}/images/ui-icons_454545_256x240.png +0 -0
- {dkrpt → cmb2}/images/ui-icons_888888_256x240.png +0 -0
- {dkrpt → cmb2}/images/ui-icons_cd0a0a_256x240.png +0 -0
- cmb2/includes/CMB2.php +859 -0
- cmb2/includes/CMB2_Ajax.php +209 -0
- cmb2/includes/CMB2_Boxes.php +36 -0
- cmb2/includes/CMB2_Field.php +892 -0
- cmb2/includes/CMB2_Options.php +178 -0
- dkrpt/helpers/dkrpt_Meta_Box_Sanitize.php → cmb2/includes/CMB2_Sanitize.php +73 -43
- cmb2/includes/CMB2_Show_Filters.php +168 -0
- cmb2/includes/CMB2_Types.php +962 -0
- cmb2/includes/CMB2_Utils.php +181 -0
- cmb2/includes/CMB2_hookup.php +395 -0
- cmb2/includes/helper-functions.php +283 -0
- cmb2/includes/index.php +0 -0
- cmb2/index.php +0 -0
- cmb2/init.php +78 -0
- cmb2/js/cmb2.js +891 -0
- cmb2/js/cmb2.min.js +1 -0
- cmb2/js/index.php +0 -0
- {dkrpt → cmb2}/js/jquery.timePicker.min.js +0 -0
- css/admin_de_style.css +147 -0
- css/admin_de_style.min.css +1 -0
- css/{rpt_custom_style.css → rpt_style.css} +4 -3
- css/{rpt_custom_style.min.css → rpt_style.min.css} +1 -1
- dkrpt/Gruntfile.js +0 -112
- dkrpt/helpers/dkrpt_Meta_Box_Show_Filters.php +0 -105
- dkrpt/helpers/dkrpt_Meta_Box_ajax.php +0 -203
- dkrpt/helpers/dkrpt_Meta_Box_field.php +0 -497
- dkrpt/helpers/dkrpt_Meta_Box_types.php +0 -794
- dkrpt/init.php +0 -1187
- dkrpt/js/dkrpt.min.js +0 -1
- dkrpt/js/jquery.datePicker.min.js +0 -2038
- dkrpt/phpunit.xml +0 -18
- dkrpt/style.css +0 -652
- dkrpt/style.min.css +0 -1
- img/skeleton_plan.png +0 -0
- readme.txt +9 -0
- rpt.php +402 -270
cmb2/bootstrap.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Helper function to provide directory path to CMB
|
5 |
+
* @since 2.0.0
|
6 |
+
* @param string $path Path to append
|
7 |
+
* @return string Directory with optional path appended
|
8 |
+
*/
|
9 |
+
function cmb2_dir( $path = '' ) {
|
10 |
+
static $cmb2_dir = null;
|
11 |
+
if ( is_null( $cmb2_dir ) ) {
|
12 |
+
$cmb2_dir = trailingslashit( dirname( __FILE__ ) );
|
13 |
+
}
|
14 |
+
return $cmb2_dir . $path;
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Include helper functions,
|
19 |
+
* and more importantly, the class/file autoloader
|
20 |
+
*/
|
21 |
+
require_once cmb2_dir( 'includes/helper-functions.php' );
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Fires when CMB2 is included/loaded
|
25 |
+
*
|
26 |
+
* Should be used to to add metaboxes. See example-functions.php
|
27 |
+
*/
|
28 |
+
do_action( 'cmb2_init' );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* For back-compat. Does the dirtywork of instantiatiating all the
|
32 |
+
* CMB2 instances for the cmb2_meta_boxes filter
|
33 |
+
* @since 2.0.2
|
34 |
+
*/
|
35 |
+
$all_meta_boxes_config = apply_filters( 'cmb2_meta_boxes', array() );
|
36 |
+
foreach ( (array) $all_meta_boxes_config as $meta_box_config ) {
|
37 |
+
new CMB2( $meta_box_config );
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Fires after all CMB2 instances are created
|
42 |
+
*/
|
43 |
+
do_action( 'cmb2_init_before_hookup' );
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get all created metaboxes, and instantiate CMB2_hookup
|
47 |
+
* on metaboxes which require it.
|
48 |
+
* @since 2.0.2
|
49 |
+
*/
|
50 |
+
foreach ( CMB2_Boxes::get_all() as $cmb ) {
|
51 |
+
if ( $cmb->prop( 'hookup' ) ) {
|
52 |
+
$hookup = new CMB2_hookup( $cmb );
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Fires after CMB2 initiation process has been completed
|
58 |
+
*/
|
59 |
+
do_action( 'cmb2_after_init' );
|
60 |
+
|
61 |
+
// End. That's it, folks! //
|
cmb2/css/cmb2.css
ADDED
@@ -0,0 +1,2928 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* CMB Styling
|
3 |
+
*/
|
4 |
+
|
5 |
+
/*--------------------------------------------------------------
|
6 |
+
Main Wrap
|
7 |
+
--------------------------------------------------------------*/
|
8 |
+
|
9 |
+
/* line 5, sass/partials/_main_wrap.scss */
|
10 |
+
|
11 |
+
.cmb2-wrap {
|
12 |
+
margin: 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
/* line 8, sass/partials/_main_wrap.scss */
|
16 |
+
|
17 |
+
.cmb2-wrap input,
|
18 |
+
.cmb2-wrap textarea {
|
19 |
+
font-size: 14px;
|
20 |
+
max-width: 100%;
|
21 |
+
padding: 5px;
|
22 |
+
}
|
23 |
+
|
24 |
+
/* line 18, sass/partials/_main_wrap.scss */
|
25 |
+
|
26 |
+
.cmb2-wrap input[type=text].cmb2-oembed {
|
27 |
+
width: 100%;
|
28 |
+
}
|
29 |
+
|
30 |
+
/* line 23, sass/partials/_main_wrap.scss */
|
31 |
+
|
32 |
+
.cmb2-wrap textarea {
|
33 |
+
width: 500px;
|
34 |
+
}
|
35 |
+
|
36 |
+
/* line 26, sass/partials/_main_wrap.scss */
|
37 |
+
|
38 |
+
.cmb2-wrap textarea.cmb2-textarea-code {
|
39 |
+
font-family: "Courier 10 Pitch", Courier, monospace;
|
40 |
+
line-height: 16px;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* line 34, sass/partials/_main_wrap.scss */
|
44 |
+
|
45 |
+
.cmb2-wrap input.cmb2-text-small,
|
46 |
+
.cmb2-wrap input.cmb2-timepicker {
|
47 |
+
width: 100px;
|
48 |
+
}
|
49 |
+
|
50 |
+
/* line 40, sass/partials/_main_wrap.scss */
|
51 |
+
|
52 |
+
.cmb2-wrap input.cmb2-text-money {
|
53 |
+
width: 90px;
|
54 |
+
}
|
55 |
+
|
56 |
+
/* line 45, sass/partials/_main_wrap.scss */
|
57 |
+
|
58 |
+
.cmb2-wrap input.cmb2-text-medium {
|
59 |
+
width: 230px;
|
60 |
+
}
|
61 |
+
|
62 |
+
/* line 50, sass/partials/_main_wrap.scss */
|
63 |
+
|
64 |
+
.cmb2-wrap input.cmb2-upload-file {
|
65 |
+
width: 65%;
|
66 |
+
}
|
67 |
+
|
68 |
+
/* line 54, sass/partials/_main_wrap.scss */
|
69 |
+
|
70 |
+
.cmb2-wrap input.ed_button {
|
71 |
+
padding: 2px 4px;
|
72 |
+
}
|
73 |
+
|
74 |
+
/* line 59, sass/partials/_main_wrap.scss */
|
75 |
+
|
76 |
+
.cmb2-wrap input:not([type="hidden"]) + input,
|
77 |
+
.cmb2-wrap input:not([type="hidden"]) + .button,
|
78 |
+
.cmb2-wrap input:not([type="hidden"]) + select {
|
79 |
+
margin-left: 20px;
|
80 |
+
}
|
81 |
+
|
82 |
+
/* line 67, sass/partials/_main_wrap.scss */
|
83 |
+
|
84 |
+
.cmb2-wrap ul {
|
85 |
+
margin: 0;
|
86 |
+
}
|
87 |
+
|
88 |
+
/* line 71, sass/partials/_main_wrap.scss */
|
89 |
+
|
90 |
+
.cmb2-wrap li {
|
91 |
+
font-size: 14px;
|
92 |
+
line-height: 16px;
|
93 |
+
margin: 1px 0 5px 0;
|
94 |
+
}
|
95 |
+
|
96 |
+
/* line 82, sass/partials/_main_wrap.scss */
|
97 |
+
|
98 |
+
.cmb2-wrap select {
|
99 |
+
font-size: 14px;
|
100 |
+
margin-top: 3px;
|
101 |
+
}
|
102 |
+
|
103 |
+
/* line 87, sass/partials/_main_wrap.scss */
|
104 |
+
|
105 |
+
.cmb2-wrap input:focus,
|
106 |
+
.cmb2-wrap textarea:focus {
|
107 |
+
background: #fffff8;
|
108 |
+
}
|
109 |
+
|
110 |
+
/* line 92, sass/partials/_main_wrap.scss */
|
111 |
+
|
112 |
+
.cmb2-wrap input[type="radio"] {
|
113 |
+
margin: 0 5px 0 0;
|
114 |
+
padding: 0;
|
115 |
+
}
|
116 |
+
|
117 |
+
/* line 97, sass/partials/_main_wrap.scss */
|
118 |
+
|
119 |
+
.cmb2-wrap input[type="checkbox"] {
|
120 |
+
margin: 0 5px 0 0;
|
121 |
+
padding: 0;
|
122 |
+
}
|
123 |
+
|
124 |
+
/* line 102, sass/partials/_main_wrap.scss */
|
125 |
+
|
126 |
+
.cmb2-wrap button,
|
127 |
+
.cmb2-wrap .button {
|
128 |
+
white-space: nowrap;
|
129 |
+
}
|
130 |
+
|
131 |
+
/* line 107, sass/partials/_main_wrap.scss */
|
132 |
+
|
133 |
+
.cmb2-wrap .mceLayout {
|
134 |
+
border: 1px solid #e9e9e9 !important;
|
135 |
+
}
|
136 |
+
|
137 |
+
/* line 111, sass/partials/_main_wrap.scss */
|
138 |
+
|
139 |
+
.cmb2-wrap .mceIframeContainer {
|
140 |
+
background: #fff;
|
141 |
+
}
|
142 |
+
|
143 |
+
/* line 115, sass/partials/_main_wrap.scss */
|
144 |
+
|
145 |
+
.cmb2-wrap .meta_mce {
|
146 |
+
width: 97%;
|
147 |
+
}
|
148 |
+
|
149 |
+
/* line 118, sass/partials/_main_wrap.scss */
|
150 |
+
|
151 |
+
.cmb2-wrap .meta_mce textarea {
|
152 |
+
width: 100%;
|
153 |
+
}
|
154 |
+
|
155 |
+
/* line 126, sass/partials/_main_wrap.scss */
|
156 |
+
|
157 |
+
.cmb2-wrap .wp-color-result,
|
158 |
+
.cmb2-wrap .wp-picker-input-wrap {
|
159 |
+
vertical-align: middle;
|
160 |
+
}
|
161 |
+
|
162 |
+
/* line 131, sass/partials/_main_wrap.scss */
|
163 |
+
|
164 |
+
.cmb2-wrap .wp-color-result,
|
165 |
+
.cmb2-wrap .wp-picker-container {
|
166 |
+
margin: 0 10px 0 0;
|
167 |
+
}
|
168 |
+
|
169 |
+
/* line 136, sass/partials/_main_wrap.scss */
|
170 |
+
|
171 |
+
.cmb2-wrap .cmb-row {
|
172 |
+
margin: 0;
|
173 |
+
}
|
174 |
+
|
175 |
+
/* line 139, sass/partials/_main_wrap.scss */
|
176 |
+
|
177 |
+
.cmb2-wrap .cmb-row:after {
|
178 |
+
content: '';
|
179 |
+
clear: both;
|
180 |
+
display: block;
|
181 |
+
width: 100%;
|
182 |
+
}
|
183 |
+
|
184 |
+
/* line 146, sass/partials/_main_wrap.scss */
|
185 |
+
|
186 |
+
.cmb2-wrap .cmb-row.cmb-repeat-row {
|
187 |
+
padding: 1.8em 0 0;
|
188 |
+
}
|
189 |
+
|
190 |
+
/* line 149, sass/partials/_main_wrap.scss */
|
191 |
+
|
192 |
+
.cmb2-wrap .cmb-row.cmb-repeat-row:first-of-type {
|
193 |
+
padding: 0;
|
194 |
+
}
|
195 |
+
|
196 |
+
/* line 154, sass/partials/_main_wrap.scss */
|
197 |
+
|
198 |
+
.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
|
199 |
+
padding-top: 0;
|
200 |
+
padding-bottom: 1.8em;
|
201 |
+
}
|
202 |
+
|
203 |
+
/* line 161, sass/partials/_main_wrap.scss */
|
204 |
+
|
205 |
+
.cmb2-metabox {
|
206 |
+
clear: both;
|
207 |
+
margin: 0;
|
208 |
+
}
|
209 |
+
|
210 |
+
/* line 167, sass/partials/_main_wrap.scss */
|
211 |
+
|
212 |
+
.cmb2-metabox > .cmb-row:first-of-type > .cmb-td,
|
213 |
+
.cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
|
214 |
+
.cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-td,
|
215 |
+
.cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
|
216 |
+
border: 0;
|
217 |
+
}
|
218 |
+
|
219 |
+
/* line 174, sass/partials/_main_wrap.scss */
|
220 |
+
|
221 |
+
.cmb2-metabox > .cmb-row .cmb-repeat-table .cmb-row > .cmb-td {
|
222 |
+
padding-right: 20px;
|
223 |
+
box-sizing: border-box;
|
224 |
+
float: left;
|
225 |
+
}
|
226 |
+
|
227 |
+
/* line 182, sass/partials/_main_wrap.scss */
|
228 |
+
|
229 |
+
.cmb-add-row {
|
230 |
+
margin: 1.8em 0 0;
|
231 |
+
}
|
232 |
+
|
233 |
+
/* line 186, sass/partials/_main_wrap.scss */
|
234 |
+
|
235 |
+
.cmb-nested .cmb-td,
|
236 |
+
.cmb-repeatable-group .cmb-th,
|
237 |
+
.cmb-repeatable-group:first-of-type {
|
238 |
+
border: 0;
|
239 |
+
}
|
240 |
+
|
241 |
+
/* line 192, sass/partials/_main_wrap.scss */
|
242 |
+
|
243 |
+
.cmb-row:last-of-type,
|
244 |
+
.cmb2-wrap .cmb-row:last-of-type,
|
245 |
+
.cmb-repeatable-group:last-of-type {
|
246 |
+
border-bottom: 0;
|
247 |
+
}
|
248 |
+
|
249 |
+
/* line 198, sass/partials/_main_wrap.scss */
|
250 |
+
|
251 |
+
.cmb-repeatable-grouping {
|
252 |
+
border: 1px solid #e9e9e9;
|
253 |
+
padding: 0 1em;
|
254 |
+
max-width: 1000px;
|
255 |
+
}
|
256 |
+
|
257 |
+
/* line 202, sass/partials/_main_wrap.scss */
|
258 |
+
|
259 |
+
.cmb-repeatable-grouping.cmb-row {
|
260 |
+
margin: 0 0 0.8em;
|
261 |
+
}
|
262 |
+
|
263 |
+
/* line 209, sass/partials/_main_wrap.scss */
|
264 |
+
|
265 |
+
.cmb-th {
|
266 |
+
color: #222222;
|
267 |
+
float: left;
|
268 |
+
font-weight: 600;
|
269 |
+
line-height: 1.3;
|
270 |
+
padding: 20px 10px 20px 0;
|
271 |
+
vertical-align: top;
|
272 |
+
width: 200px;
|
273 |
+
}
|
274 |
+
|
275 |
+
/* line 223, sass/partials/_main_wrap.scss */
|
276 |
+
|
277 |
+
.cmb-td {
|
278 |
+
line-height: 1.3;
|
279 |
+
max-width: 100%;
|
280 |
+
padding: 15px 10px;
|
281 |
+
vertical-align: middle;
|
282 |
+
}
|
283 |
+
|
284 |
+
/* line 232, sass/partials/_main_wrap.scss */
|
285 |
+
|
286 |
+
.cmb-type-title .cmb-td {
|
287 |
+
padding: 0;
|
288 |
+
}
|
289 |
+
|
290 |
+
/* line 237, sass/partials/_main_wrap.scss */
|
291 |
+
|
292 |
+
.cmb-th label {
|
293 |
+
display: block;
|
294 |
+
padding: 5px 0;
|
295 |
+
}
|
296 |
+
|
297 |
+
/* line 242, sass/partials/_main_wrap.scss */
|
298 |
+
|
299 |
+
.cmb-th + .cmb-td {
|
300 |
+
float: left;
|
301 |
+
}
|
302 |
+
|
303 |
+
/* line 246, sass/partials/_main_wrap.scss */
|
304 |
+
|
305 |
+
.cmb-td .cmb-td {
|
306 |
+
padding-bottom: 1em;
|
307 |
+
}
|
308 |
+
|
309 |
+
/* line 250, sass/partials/_main_wrap.scss */
|
310 |
+
|
311 |
+
.cmb-remove-row {
|
312 |
+
text-align: right;
|
313 |
+
}
|
314 |
+
|
315 |
+
/* line 254, sass/partials/_main_wrap.scss */
|
316 |
+
|
317 |
+
.empty-row.hidden {
|
318 |
+
display: none;
|
319 |
+
}
|
320 |
+
|
321 |
+
/* line 260, sass/partials/_main_wrap.scss */
|
322 |
+
|
323 |
+
.cmb-repeatable-group .cmb-th {
|
324 |
+
padding: 5px;
|
325 |
+
}
|
326 |
+
|
327 |
+
/* line 264, sass/partials/_main_wrap.scss */
|
328 |
+
|
329 |
+
.cmb-repeatable-group .cmb-group-title {
|
330 |
+
background-color: #e9e9e9;
|
331 |
+
padding: 8px 12px 8px 2.2em;
|
332 |
+
margin: 0 -1em;
|
333 |
+
min-height: 1.5em;
|
334 |
+
font-size: 14px;
|
335 |
+
line-height: 1.4;
|
336 |
+
}
|
337 |
+
|
338 |
+
/* line 272, sass/partials/_main_wrap.scss */
|
339 |
+
|
340 |
+
.cmb-repeatable-group .cmb-group-title h4 {
|
341 |
+
border: 0;
|
342 |
+
margin: 0;
|
343 |
+
font-size: 1.2em;
|
344 |
+
font-weight: 500;
|
345 |
+
padding: 0.5em 0.75em;
|
346 |
+
}
|
347 |
+
|
348 |
+
/* line 280, sass/partials/_main_wrap.scss */
|
349 |
+
|
350 |
+
.cmb-repeatable-group .cmb-group-title .cmb-th {
|
351 |
+
display: block;
|
352 |
+
width: 100%;
|
353 |
+
}
|
354 |
+
|
355 |
+
/* line 286, sass/partials/_main_wrap.scss */
|
356 |
+
|
357 |
+
.cmb-repeatable-group .cmb-group-description .cmb-th {
|
358 |
+
font-size: 1.2em;
|
359 |
+
display: block;
|
360 |
+
float: none;
|
361 |
+
padding-bottom: 1em;
|
362 |
+
text-align: left;
|
363 |
+
width: 100%;
|
364 |
+
}
|
365 |
+
|
366 |
+
/* line 27, sass/partials/_mixins.scss */
|
367 |
+
|
368 |
+
.cmb-repeatable-group .cmb-group-description .cmb-th label {
|
369 |
+
display: block;
|
370 |
+
margin-top: 0em;
|
371 |
+
padding-bottom: 5px;
|
372 |
+
}
|
373 |
+
|
374 |
+
/* line 32, sass/partials/_mixins.scss */
|
375 |
+
|
376 |
+
.cmb-repeatable-group .cmb-group-description .cmb-th label:after {
|
377 |
+
border-bottom: 1px solid #e9e9e9;
|
378 |
+
content: '';
|
379 |
+
clear: both;
|
380 |
+
display: block;
|
381 |
+
padding-top: .4em;
|
382 |
+
}
|
383 |
+
|
384 |
+
/* line 290, sass/partials/_main_wrap.scss */
|
385 |
+
|
386 |
+
.cmb-repeatable-group .cmb-shift-rows {
|
387 |
+
font-size: 1em;
|
388 |
+
margin-right: 1em;
|
389 |
+
text-decoration: none;
|
390 |
+
}
|
391 |
+
|
392 |
+
/* line 295, sass/partials/_main_wrap.scss */
|
393 |
+
|
394 |
+
.cmb-repeatable-group .cmb-shift-rows .dashicons {
|
395 |
+
font-size: 1.5em;
|
396 |
+
height: 1.5em;
|
397 |
+
line-height: 1.2em;
|
398 |
+
width: 1em;
|
399 |
+
}
|
400 |
+
|
401 |
+
/* line 301, sass/partials/_main_wrap.scss */
|
402 |
+
|
403 |
+
.cmb-repeatable-group .cmb-shift-rows .dashicons.dashicons-arrow-down-alt2 {
|
404 |
+
line-height: 1.3em;
|
405 |
+
}
|
406 |
+
|
407 |
+
/* line 308, sass/partials/_main_wrap.scss */
|
408 |
+
|
409 |
+
.cmb-repeatable-group .cmb2-upload-button {
|
410 |
+
float: right;
|
411 |
+
}
|
412 |
+
|
413 |
+
/* line 314, sass/partials/_main_wrap.scss */
|
414 |
+
|
415 |
+
p.cmb2-metabox-description {
|
416 |
+
color: #aaaaaa;
|
417 |
+
font-style: italic;
|
418 |
+
margin: 0;
|
419 |
+
padding-top: .5em;
|
420 |
+
}
|
421 |
+
|
422 |
+
/* line 321, sass/partials/_main_wrap.scss */
|
423 |
+
|
424 |
+
span.cmb2-metabox-description {
|
425 |
+
color: #aaaaaa;
|
426 |
+
font-style: italic;
|
427 |
+
}
|
428 |
+
|
429 |
+
/* line 326, sass/partials/_main_wrap.scss */
|
430 |
+
|
431 |
+
.cmb2-metabox-title {
|
432 |
+
margin: 0 0 5px 0;
|
433 |
+
padding: 5px 0 0 0;
|
434 |
+
font-size: 14px;
|
435 |
+
}
|
436 |
+
|
437 |
+
/* line 332, sass/partials/_main_wrap.scss */
|
438 |
+
|
439 |
+
.cmb-inline ul {
|
440 |
+
padding: 4px 0 0 0;
|
441 |
+
}
|
442 |
+
|
443 |
+
/* line 336, sass/partials/_main_wrap.scss */
|
444 |
+
|
445 |
+
.cmb-inline li {
|
446 |
+
display: inline-block;
|
447 |
+
padding-right: 18px;
|
448 |
+
}
|
449 |
+
|
450 |
+
/* line 341, sass/partials/_main_wrap.scss */
|
451 |
+
|
452 |
+
.cmb-type-textarea-code pre {
|
453 |
+
margin: 0;
|
454 |
+
}
|
455 |
+
|
456 |
+
/* line 347, sass/partials/_main_wrap.scss */
|
457 |
+
|
458 |
+
.cmb2-media-status .img-status {
|
459 |
+
clear: none;
|
460 |
+
display: inline-block;
|
461 |
+
float: left;
|
462 |
+
margin-right: 10px;
|
463 |
+
width: auto;
|
464 |
+
}
|
465 |
+
|
466 |
+
/* line 354, sass/partials/_main_wrap.scss */
|
467 |
+
|
468 |
+
.cmb2-media-status .img-status img {
|
469 |
+
max-width: 350px;
|
470 |
+
}
|
471 |
+
|
472 |
+
/* line 359, sass/partials/_main_wrap.scss */
|
473 |
+
|
474 |
+
.cmb2-media-status .img-status img,
|
475 |
+
.cmb2-media-status .embed-status {
|
476 |
+
background: #ffffff;
|
477 |
+
border: 1px solid #e9e9e9;
|
478 |
+
border-radius: 2px;
|
479 |
+
-moz-border-radius: 2px;
|
480 |
+
margin: 15px 0 0 0;
|
481 |
+
padding: 5px;
|
482 |
+
}
|
483 |
+
|
484 |
+
/* line 369, sass/partials/_main_wrap.scss */
|
485 |
+
|
486 |
+
.cmb2-media-status .embed-status {
|
487 |
+
float: left;
|
488 |
+
max-width: 800px;
|
489 |
+
}
|
490 |
+
|
491 |
+
/* line 374, sass/partials/_main_wrap.scss */
|
492 |
+
|
493 |
+
.cmb2-media-status .img-status,
|
494 |
+
.cmb2-media-status .embed-status {
|
495 |
+
position: relative;
|
496 |
+
}
|
497 |
+
|
498 |
+
/* line 377, sass/partials/_main_wrap.scss */
|
499 |
+
|
500 |
+
.cmb2-media-status .img-status .cmb2-remove-file-button,
|
501 |
+
.cmb2-media-status .embed-status .cmb2-remove-file-button {
|
502 |
+
background: url(../images/ico-delete.png);
|
503 |
+
height: 16px;
|
504 |
+
left: -5px;
|
505 |
+
position: absolute;
|
506 |
+
text-indent: -9999px;
|
507 |
+
top: -5px;
|
508 |
+
width: 16px;
|
509 |
+
}
|
510 |
+
|
511 |
+
/* line 391, sass/partials/_main_wrap.scss */
|
512 |
+
|
513 |
+
.cmb2-media-status .img-status .cmb2-remove-file-button {
|
514 |
+
top: 10px;
|
515 |
+
}
|
516 |
+
|
517 |
+
/* line 396, sass/partials/_main_wrap.scss */
|
518 |
+
|
519 |
+
.cmb2-media-status .img-status img,
|
520 |
+
.cmb2-media-status .file-status > span {
|
521 |
+
cursor: pointer;
|
522 |
+
}
|
523 |
+
|
524 |
+
/* line 402, sass/partials/_main_wrap.scss */
|
525 |
+
|
526 |
+
.cmb-type-file-list .cmb2-media-status .img-status {
|
527 |
+
clear: none;
|
528 |
+
float: left;
|
529 |
+
margin-right: 10px;
|
530 |
+
width: auto;
|
531 |
+
}
|
532 |
+
|
533 |
+
/* line 409, sass/partials/_main_wrap.scss */
|
534 |
+
|
535 |
+
.cmb-attach-list li {
|
536 |
+
clear: both;
|
537 |
+
display: inline-block;
|
538 |
+
margin-bottom: 25px;
|
539 |
+
width: 100%;
|
540 |
+
}
|
541 |
+
|
542 |
+
/* line 415, sass/partials/_main_wrap.scss */
|
543 |
+
|
544 |
+
.cmb-attach-list li img {
|
545 |
+
cursor: move;
|
546 |
+
float: left;
|
547 |
+
margin-right: 10px;
|
548 |
+
}
|
549 |
+
|
550 |
+
/* line 422, sass/partials/_main_wrap.scss */
|
551 |
+
|
552 |
+
.cmb2-remove-wrapper {
|
553 |
+
margin: 0;
|
554 |
+
}
|
555 |
+
|
556 |
+
/* line 426, sass/partials/_main_wrap.scss */
|
557 |
+
|
558 |
+
.child-cmb2 .cmb-th {
|
559 |
+
text-align: left;
|
560 |
+
}
|
561 |
+
|
562 |
+
/*--------------------------------------------------------------
|
563 |
+
Timepicker
|
564 |
+
--------------------------------------------------------------*/
|
565 |
+
|
566 |
+
/* line 7, sass/partials/_timepicker.scss */
|
567 |
+
|
568 |
+
div.time-picker {
|
569 |
+
background: #fff;
|
570 |
+
border: 1px solid #aaaaaa;
|
571 |
+
height: 191px;
|
572 |
+
margin: 0;
|
573 |
+
position: absolute;
|
574 |
+
overflow: auto;
|
575 |
+
width: 6em; /* needed for IE */
|
576 |
+
z-index: 99;
|
577 |
+
}
|
578 |
+
|
579 |
+
/* line 17, sass/partials/_timepicker.scss */
|
580 |
+
|
581 |
+
div.time-picker ul {
|
582 |
+
list-style-type: none;
|
583 |
+
margin: 0;
|
584 |
+
padding: 0;
|
585 |
+
}
|
586 |
+
|
587 |
+
/* line 23, sass/partials/_timepicker.scss */
|
588 |
+
|
589 |
+
div.time-picker li {
|
590 |
+
cursor: pointer;
|
591 |
+
margin-bottom: 0;
|
592 |
+
font-family: sans-serif;
|
593 |
+
font-size: 14px;
|
594 |
+
padding: 4px 3px;
|
595 |
+
}
|
596 |
+
|
597 |
+
/* line 30, sass/partials/_timepicker.scss */
|
598 |
+
|
599 |
+
div.time-picker li.selected {
|
600 |
+
background: #0063ce;
|
601 |
+
color: #fff;
|
602 |
+
}
|
603 |
+
|
604 |
+
/* line 37, sass/partials/_timepicker.scss */
|
605 |
+
|
606 |
+
div.time-picker-12hours {
|
607 |
+
width: 8em; /* needed for IE */
|
608 |
+
}
|
609 |
+
|
610 |
+
/*--------------------------------------------------------------
|
611 |
+
Post Metaboxes
|
612 |
+
--------------------------------------------------------------*/
|
613 |
+
|
614 |
+
/* line 4, sass/partials/_post_metaboxes.scss */
|
615 |
+
|
616 |
+
#poststuff .cmb-group-title {
|
617 |
+
margin-left: -1em;
|
618 |
+
margin-right: -1em;
|
619 |
+
padding-left: 2.2em;
|
620 |
+
min-height: 1.5em;
|
621 |
+
}
|
622 |
+
|
623 |
+
/* line 14, sass/partials/_post_metaboxes.scss */
|
624 |
+
|
625 |
+
.postbox-container .cmb2-wrap,
|
626 |
+
.cmb-repeat-group-wrap .cmb2-wrap {
|
627 |
+
margin: 0;
|
628 |
+
}
|
629 |
+
|
630 |
+
/* line 17, sass/partials/_post_metaboxes.scss */
|
631 |
+
|
632 |
+
.postbox-container .cmb2-wrap > .cmb-field-list > .cmb-row,
|
633 |
+
.cmb-repeat-group-wrap .cmb2-wrap > .cmb-field-list > .cmb-row {
|
634 |
+
padding: 1.8em 0;
|
635 |
+
}
|
636 |
+
|
637 |
+
/* line 23, sass/partials/_post_metaboxes.scss */
|
638 |
+
|
639 |
+
.postbox-container .cmb2-wrap input[type=text].cmb2-oembed,
|
640 |
+
.cmb-repeat-group-wrap .cmb2-wrap input[type=text].cmb2-oembed {
|
641 |
+
width: 100%;
|
642 |
+
}
|
643 |
+
|
644 |
+
/* line 29, sass/partials/_post_metaboxes.scss */
|
645 |
+
|
646 |
+
.postbox-container .cmb-row,
|
647 |
+
.cmb-repeat-group-wrap .cmb-row {
|
648 |
+
padding: 0 0 1.8em;
|
649 |
+
margin: 0 0 0.8em;
|
650 |
+
}
|
651 |
+
|
652 |
+
/* line 33, sass/partials/_post_metaboxes.scss */
|
653 |
+
|
654 |
+
.postbox-container .cmb-row .cmbhandle,
|
655 |
+
.cmb-repeat-group-wrap .cmb-row .cmbhandle {
|
656 |
+
right: -1em;
|
657 |
+
position: relative;
|
658 |
+
}
|
659 |
+
|
660 |
+
/* line 39, sass/partials/_post_metaboxes.scss */
|
661 |
+
|
662 |
+
.postbox-container .cmb-repeatable-grouping,
|
663 |
+
.cmb-repeat-group-wrap .cmb-repeatable-grouping {
|
664 |
+
padding: 0 1em;
|
665 |
+
max-width: 100%;
|
666 |
+
min-width: 1px !important;
|
667 |
+
}
|
668 |
+
|
669 |
+
/* line 45, sass/partials/_post_metaboxes.scss */
|
670 |
+
|
671 |
+
.postbox-container .cmb-repeatable-group > .cmb-row,
|
672 |
+
.cmb-repeat-group-wrap .cmb-repeatable-group > .cmb-row {
|
673 |
+
padding-bottom: 0;
|
674 |
+
}
|
675 |
+
|
676 |
+
/* line 49, sass/partials/_post_metaboxes.scss */
|
677 |
+
|
678 |
+
.postbox-container .cmb-th,
|
679 |
+
.cmb-repeat-group-wrap .cmb-th {
|
680 |
+
width: 18%;
|
681 |
+
padding: 0 2% 0 0;
|
682 |
+
}
|
683 |
+
|
684 |
+
/* line 55, sass/partials/_post_metaboxes.scss */
|
685 |
+
|
686 |
+
.postbox-container .cmb-td,
|
687 |
+
.cmb-repeat-group-wrap .cmb-td {
|
688 |
+
margin-bottom: 0;
|
689 |
+
padding: 0;
|
690 |
+
line-height: 1.3;
|
691 |
+
}
|
692 |
+
|
693 |
+
/* line 61, sass/partials/_post_metaboxes.scss */
|
694 |
+
|
695 |
+
.postbox-container .cmb-repeat-row .cmb-td,
|
696 |
+
.cmb-repeat-group-wrap .cmb-repeat-row .cmb-td {
|
697 |
+
padding-bottom: 1.8em;
|
698 |
+
}
|
699 |
+
|
700 |
+
/* line 65, sass/partials/_post_metaboxes.scss */
|
701 |
+
|
702 |
+
.postbox-container .cmb-th + .cmb-td,
|
703 |
+
.cmb-repeat-group-wrap .cmb-th + .cmb-td {
|
704 |
+
width: 80%;
|
705 |
+
float: right;
|
706 |
+
}
|
707 |
+
|
708 |
+
/* line 70, sass/partials/_post_metaboxes.scss */
|
709 |
+
|
710 |
+
.postbox-container .cmb-row:not(:last-of-type),
|
711 |
+
.postbox-container .cmb-repeatable-group:not(:last-of-type),
|
712 |
+
.cmb-repeat-group-wrap .cmb-row:not(:last-of-type),
|
713 |
+
.cmb-repeat-group-wrap .cmb-repeatable-group:not(:last-of-type) {
|
714 |
+
border-bottom: 1px solid #e9e9e9;
|
715 |
+
}
|
716 |
+
|
717 |
+
/* line 79, sass/partials/_post_metaboxes.scss */
|
718 |
+
|
719 |
+
.postbox-container .cmb-repeat-group-field,
|
720 |
+
.postbox-container .cmb-remove-field-row,
|
721 |
+
.cmb-repeat-group-wrap .cmb-repeat-group-field,
|
722 |
+
.cmb-repeat-group-wrap .cmb-remove-field-row {
|
723 |
+
padding-top: 1.8em;
|
724 |
+
}
|
725 |
+
|
726 |
+
/* line 86, sass/partials/_post_metaboxes.scss */
|
727 |
+
|
728 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody,
|
729 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody,
|
730 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody,
|
731 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody {
|
732 |
+
display: table;
|
733 |
+
width: 100%;
|
734 |
+
}
|
735 |
+
|
736 |
+
/* line 90, sass/partials/_post_metaboxes.scss */
|
737 |
+
|
738 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,
|
739 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,
|
740 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,
|
741 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text {
|
742 |
+
width: 100%;
|
743 |
+
}
|
744 |
+
|
745 |
+
/* line 94, sass/partials/_post_metaboxes.scss */
|
746 |
+
|
747 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),
|
748 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),
|
749 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),
|
750 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row) {
|
751 |
+
display: table-row;
|
752 |
+
}
|
753 |
+
|
754 |
+
/* line 98, sass/partials/_post_metaboxes.scss */
|
755 |
+
|
756 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,
|
757 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,
|
758 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,
|
759 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td {
|
760 |
+
display: table-cell;
|
761 |
+
float: none;
|
762 |
+
width: 100%;
|
763 |
+
}
|
764 |
+
|
765 |
+
/* line 104, sass/partials/_post_metaboxes.scss */
|
766 |
+
|
767 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,
|
768 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,
|
769 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,
|
770 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td {
|
771 |
+
padding-top: 1.8em;
|
772 |
+
}
|
773 |
+
|
774 |
+
/* line 108, sass/partials/_post_metaboxes.scss */
|
775 |
+
|
776 |
+
.postbox-container .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,
|
777 |
+
.postbox-container .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,
|
778 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,
|
779 |
+
.cmb-repeat-group-wrap .cmb2-metabox > .cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row {
|
780 |
+
padding-right: 0;
|
781 |
+
}
|
782 |
+
|
783 |
+
/*--------------------------------------------------------------
|
784 |
+
Misc.
|
785 |
+
--------------------------------------------------------------*/
|
786 |
+
|
787 |
+
/* line 5, sass/partials/_misc.scss */
|
788 |
+
|
789 |
+
#poststuff .cmb-repeatable-group h2 {
|
790 |
+
margin: 0;
|
791 |
+
}
|
792 |
+
|
793 |
+
/* line 13, sass/partials/_misc.scss */
|
794 |
+
|
795 |
+
.edit-tags-php .cmb2-metabox-title,
|
796 |
+
.profile-php .cmb2-metabox-title,
|
797 |
+
.user-edit-php .cmb2-metabox-title {
|
798 |
+
font-size: 1.4em;
|
799 |
+
}
|
800 |
+
|
801 |
+
/* line 18, sass/partials/_misc.scss */
|
802 |
+
|
803 |
+
.postbox .cmb-spinner {
|
804 |
+
float: left;
|
805 |
+
}
|
806 |
+
|
807 |
+
/*--------------------------------------------------------------
|
808 |
+
Sidebar Placement Adjustments
|
809 |
+
--------------------------------------------------------------*/
|
810 |
+
|
811 |
+
/* line 10, sass/partials/_sidebar_placements.scss */
|
812 |
+
|
813 |
+
.inner-sidebar .cmb2-wrap > .cmb-field-list > .cmb-row,
|
814 |
+
#side-sortables .cmb2-wrap > .cmb-field-list > .cmb-row {
|
815 |
+
padding: 1.4em 0;
|
816 |
+
}
|
817 |
+
|
818 |
+
/* line 16, sass/partials/_sidebar_placements.scss */
|
819 |
+
|
820 |
+
.inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker),
|
821 |
+
#side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker) {
|
822 |
+
width: 100%;
|
823 |
+
}
|
824 |
+
|
825 |
+
/* line 20, sass/partials/_sidebar_placements.scss */
|
826 |
+
|
827 |
+
.inner-sidebar .cmb2-wrap input + input:not(.wp-picker-clear),
|
828 |
+
.inner-sidebar .cmb2-wrap input + select,
|
829 |
+
#side-sortables .cmb2-wrap input + input:not(.wp-picker-clear),
|
830 |
+
#side-sortables .cmb2-wrap input + select {
|
831 |
+
margin-left: 0;
|
832 |
+
margin-top: 1em;
|
833 |
+
display: block;
|
834 |
+
}
|
835 |
+
|
836 |
+
/* line 27, sass/partials/_sidebar_placements.scss */
|
837 |
+
|
838 |
+
.inner-sidebar .cmb2-wrap label,
|
839 |
+
#side-sortables .cmb2-wrap label {
|
840 |
+
display: block;
|
841 |
+
font-weight: 700;
|
842 |
+
padding: 0 0 5px;
|
843 |
+
}
|
844 |
+
|
845 |
+
/* line 35, sass/partials/_sidebar_placements.scss */
|
846 |
+
|
847 |
+
.inner-sidebar .cmb-repeatable-group,
|
848 |
+
#side-sortables .cmb-repeatable-group {
|
849 |
+
border-bottom: 1px solid #e9e9e9;
|
850 |
+
}
|
851 |
+
|
852 |
+
/* line 39, sass/partials/_sidebar_placements.scss */
|
853 |
+
|
854 |
+
.inner-sidebar .cmb-repeat-group-wrap > .cmb-td > .cmb-repeatable-group,
|
855 |
+
#side-sortables .cmb-repeat-group-wrap > .cmb-td > .cmb-repeatable-group {
|
856 |
+
border-bottom: 0;
|
857 |
+
margin-bottom: -1.4em;
|
858 |
+
}
|
859 |
+
|
860 |
+
/* line 44, sass/partials/_sidebar_placements.scss */
|
861 |
+
|
862 |
+
.inner-sidebar .cmb-th,
|
863 |
+
.inner-sidebar .cmb-td,
|
864 |
+
.inner-sidebar .cmb-th + .cmb-td,
|
865 |
+
#side-sortables .cmb-th,
|
866 |
+
#side-sortables .cmb-td,
|
867 |
+
#side-sortables .cmb-th + .cmb-td {
|
868 |
+
width: 100%;
|
869 |
+
display: block;
|
870 |
+
float: none;
|
871 |
+
}
|
872 |
+
|
873 |
+
/* line 52, sass/partials/_sidebar_placements.scss */
|
874 |
+
|
875 |
+
.inner-sidebar .closed .inside,
|
876 |
+
#side-sortables .closed .inside {
|
877 |
+
display: none;
|
878 |
+
}
|
879 |
+
|
880 |
+
/* line 56, sass/partials/_sidebar_placements.scss */
|
881 |
+
|
882 |
+
.inner-sidebar .cmb-td .cmb-td,
|
883 |
+
#side-sortables .cmb-td .cmb-td {
|
884 |
+
padding-bottom: 1em;
|
885 |
+
}
|
886 |
+
|
887 |
+
/* line 60, sass/partials/_sidebar_placements.scss */
|
888 |
+
|
889 |
+
.inner-sidebar .cmb-th,
|
890 |
+
#side-sortables .cmb-th {
|
891 |
+
display: block;
|
892 |
+
float: none;
|
893 |
+
padding-bottom: 1em;
|
894 |
+
text-align: left;
|
895 |
+
width: 100%;
|
896 |
+
padding-left: 0;
|
897 |
+
padding-right: 0;
|
898 |
+
}
|
899 |
+
|
900 |
+
/* line 27, sass/partials/_mixins.scss */
|
901 |
+
|
902 |
+
.inner-sidebar .cmb-th label,
|
903 |
+
#side-sortables .cmb-th label {
|
904 |
+
display: block;
|
905 |
+
margin-top: 0em;
|
906 |
+
padding-bottom: 5px;
|
907 |
+
}
|
908 |
+
|
909 |
+
/* line 32, sass/partials/_mixins.scss */
|
910 |
+
|
911 |
+
.inner-sidebar .cmb-th label:after,
|
912 |
+
#side-sortables .cmb-th label:after {
|
913 |
+
border-bottom: 1px solid #e9e9e9;
|
914 |
+
content: '';
|
915 |
+
clear: both;
|
916 |
+
display: block;
|
917 |
+
padding-top: .4em;
|
918 |
+
}
|
919 |
+
|
920 |
+
/* line 14, sass/partials/_mixins.scss */
|
921 |
+
|
922 |
+
.inner-sidebar .cmb-th label,
|
923 |
+
#side-sortables .cmb-th label {
|
924 |
+
font-size: 14px;
|
925 |
+
line-height: 1.4em;
|
926 |
+
}
|
927 |
+
|
928 |
+
/* line 67, sass/partials/_sidebar_placements.scss */
|
929 |
+
|
930 |
+
.inner-sidebar .cmb-group-description .cmb-th,
|
931 |
+
#side-sortables .cmb-group-description .cmb-th {
|
932 |
+
padding-top: 0;
|
933 |
+
}
|
934 |
+
|
935 |
+
/* line 70, sass/partials/_sidebar_placements.scss */
|
936 |
+
|
937 |
+
.inner-sidebar .cmb-group-description .cmb2-metabox-description,
|
938 |
+
#side-sortables .cmb-group-description .cmb2-metabox-description {
|
939 |
+
padding: 0;
|
940 |
+
}
|
941 |
+
|
942 |
+
/* line 77, sass/partials/_sidebar_placements.scss */
|
943 |
+
|
944 |
+
.inner-sidebar .cmb-group-title .cmb-th,
|
945 |
+
#side-sortables .cmb-group-title .cmb-th {
|
946 |
+
padding: 0;
|
947 |
+
}
|
948 |
+
|
949 |
+
/* line 83, sass/partials/_sidebar_placements.scss */
|
950 |
+
|
951 |
+
.inner-sidebar .cmb-repeatable-grouping + .cmb-repeatable-grouping,
|
952 |
+
#side-sortables .cmb-repeatable-grouping + .cmb-repeatable-grouping {
|
953 |
+
margin-top: 1em;
|
954 |
+
}
|
955 |
+
|
956 |
+
/* line 92, sass/partials/_sidebar_placements.scss */
|
957 |
+
|
958 |
+
.inner-sidebar .cmb2-media-status .img-status img,
|
959 |
+
.inner-sidebar .cmb2-media-status .embed-status img,
|
960 |
+
#side-sortables .cmb2-media-status .img-status img,
|
961 |
+
#side-sortables .cmb2-media-status .embed-status img {
|
962 |
+
max-width: 90%;
|
963 |
+
height: auto;
|
964 |
+
}
|
965 |
+
|
966 |
+
/* line 100, sass/partials/_sidebar_placements.scss */
|
967 |
+
|
968 |
+
.inner-sidebar .cmb2-list label,
|
969 |
+
#side-sortables .cmb2-list label {
|
970 |
+
display: inline;
|
971 |
+
font-weight: normal;
|
972 |
+
}
|
973 |
+
|
974 |
+
/* line 105, sass/partials/_sidebar_placements.scss */
|
975 |
+
|
976 |
+
.inner-sidebar .cmb2-metabox-description,
|
977 |
+
#side-sortables .cmb2-metabox-description {
|
978 |
+
display: block;
|
979 |
+
padding: 7px 0 0;
|
980 |
+
}
|
981 |
+
|
982 |
+
/* line 112, sass/partials/_sidebar_placements.scss */
|
983 |
+
|
984 |
+
.inner-sidebar .cmb-type-checkbox .cmb-td label,
|
985 |
+
.inner-sidebar .cmb-type-checkbox .cmb2-metabox-description,
|
986 |
+
#side-sortables .cmb-type-checkbox .cmb-td label,
|
987 |
+
#side-sortables .cmb-type-checkbox .cmb2-metabox-description {
|
988 |
+
font-weight: normal;
|
989 |
+
display: inline;
|
990 |
+
}
|
991 |
+
|
992 |
+
/* line 119, sass/partials/_sidebar_placements.scss */
|
993 |
+
|
994 |
+
.inner-sidebar .cmb-row .cmb2-metabox-description,
|
995 |
+
#side-sortables .cmb-row .cmb2-metabox-description {
|
996 |
+
padding-bottom: 1.8em;
|
997 |
+
}
|
998 |
+
|
999 |
+
/* line 123, sass/partials/_sidebar_placements.scss */
|
1000 |
+
|
1001 |
+
.inner-sidebar .cmb2-metabox-title,
|
1002 |
+
#side-sortables .cmb2-metabox-title {
|
1003 |
+
font-size: 1.2em;
|
1004 |
+
font-style: italic;
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
/* line 128, sass/partials/_sidebar_placements.scss */
|
1008 |
+
|
1009 |
+
.inner-sidebar .cmb-remove-row,
|
1010 |
+
#side-sortables .cmb-remove-row {
|
1011 |
+
clear: both;
|
1012 |
+
padding-top: 12px;
|
1013 |
+
padding-bottom: 0;
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
/* line 135, sass/partials/_sidebar_placements.scss */
|
1017 |
+
|
1018 |
+
.inner-sidebar .cmb-type-colorpicker .cmb-repeat-row .cmb-td,
|
1019 |
+
#side-sortables .cmb-type-colorpicker .cmb-repeat-row .cmb-td {
|
1020 |
+
width: auto;
|
1021 |
+
clear: none;
|
1022 |
+
float: left;
|
1023 |
+
padding-top: 0;
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
/* line 140, sass/partials/_sidebar_placements.scss */
|
1027 |
+
|
1028 |
+
.inner-sidebar .cmb-type-colorpicker .cmb-repeat-row .cmb-td.cmb-remove-row,
|
1029 |
+
#side-sortables .cmb-type-colorpicker .cmb-repeat-row .cmb-td.cmb-remove-row {
|
1030 |
+
float: right;
|
1031 |
+
margin: 0;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
/* line 147, sass/partials/_sidebar_placements.scss */
|
1035 |
+
|
1036 |
+
.inner-sidebar .cmb2-upload-button,
|
1037 |
+
#side-sortables .cmb2-upload-button {
|
1038 |
+
clear: both;
|
1039 |
+
margin-top: 12px;
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
/* line 2, sass/partials/_collapsible_ui.scss */
|
1043 |
+
|
1044 |
+
.cmb2-metabox .cmb-repeat-group-wrap {
|
1045 |
+
max-width: 1000px;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
/* line 5, sass/partials/_collapsible_ui.scss */
|
1049 |
+
|
1050 |
+
.cmb2-metabox .cmbhandle {
|
1051 |
+
color: #aaa;
|
1052 |
+
float: right;
|
1053 |
+
width: 27px;
|
1054 |
+
height: 30px;
|
1055 |
+
cursor: pointer;
|
1056 |
+
right: -1em;
|
1057 |
+
position: relative;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
/* line 13, sass/partials/_collapsible_ui.scss */
|
1061 |
+
|
1062 |
+
.cmb2-metabox .cmbhandle:before {
|
1063 |
+
content: '\f142';
|
1064 |
+
right: 12px;
|
1065 |
+
font: normal 20px/1 'dashicons';
|
1066 |
+
speak: none;
|
1067 |
+
display: inline-block;
|
1068 |
+
padding: 8px 10px;
|
1069 |
+
top: 0;
|
1070 |
+
position: relative;
|
1071 |
+
-webkit-font-smoothing: antialiased;
|
1072 |
+
-moz-osx-font-smoothing: grayscale;
|
1073 |
+
text-decoration: none !important;
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
/* line 30, sass/partials/_collapsible_ui.scss */
|
1077 |
+
|
1078 |
+
.cmb2-metabox .postbox.closed .cmbhandle:before {
|
1079 |
+
content: '\f140';
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
/* line 36, sass/partials/_collapsible_ui.scss */
|
1083 |
+
|
1084 |
+
.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
|
1085 |
+
-webkit-appearance: none !important;
|
1086 |
+
background: none !important;
|
1087 |
+
border: none !important;
|
1088 |
+
position: absolute;
|
1089 |
+
left: 0;
|
1090 |
+
top: .5em;
|
1091 |
+
line-height: 1em;
|
1092 |
+
cursor: pointer;
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
/* line 45, sass/partials/_collapsible_ui.scss */
|
1096 |
+
|
1097 |
+
.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]) {
|
1098 |
+
color: #a00;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
/* line 47, sass/partials/_collapsible_ui.scss */
|
1102 |
+
|
1103 |
+
.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover {
|
1104 |
+
color: #f00;
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
/*
|
1108 |
+
* jQuery UI CSS Framework 1.8.16
|
1109 |
+
*
|
1110 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
1111 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
1112 |
+
* http://jquery.org/license
|
1113 |
+
*
|
1114 |
+
* http://docs.jquery.com/UI/Theming/API
|
1115 |
+
*/
|
1116 |
+
|
1117 |
+
/* line 11, sass/partials/_jquery_ui.scss */
|
1118 |
+
|
1119 |
+
.cmb2-element .ui-helper-hidden {
|
1120 |
+
display: none;
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
/* line 12, sass/partials/_jquery_ui.scss */
|
1124 |
+
|
1125 |
+
.cmb2-element .ui-helper-hidden-accessible {
|
1126 |
+
position: absolute !important;
|
1127 |
+
clip: rect(1px 1px 1px 1px);
|
1128 |
+
clip: rect(1px, 1px, 1px, 1px);
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
/* line 13, sass/partials/_jquery_ui.scss */
|
1132 |
+
|
1133 |
+
.cmb2-element .ui-helper-reset {
|
1134 |
+
margin: 0;
|
1135 |
+
padding: 0;
|
1136 |
+
border: 0;
|
1137 |
+
outline: 0;
|
1138 |
+
line-height: 1.3;
|
1139 |
+
text-decoration: none;
|
1140 |
+
font-size: 100%;
|
1141 |
+
list-style: none;
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
/* line 14, sass/partials/_jquery_ui.scss */
|
1145 |
+
|
1146 |
+
.cmb2-element .ui-helper-clearfix:after {
|
1147 |
+
content: ".";
|
1148 |
+
display: block;
|
1149 |
+
height: 0;
|
1150 |
+
clear: both;
|
1151 |
+
visibility: hidden;
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
/* line 15, sass/partials/_jquery_ui.scss */
|
1155 |
+
|
1156 |
+
.cmb2-element .ui-helper-clearfix {
|
1157 |
+
display: inline-block;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
/* line 16, sass/partials/_jquery_ui.scss */
|
1161 |
+
|
1162 |
+
.cmb2-element * html .ui-helper-clearfix {
|
1163 |
+
height: 1%;
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
/* line 17, sass/partials/_jquery_ui.scss */
|
1167 |
+
|
1168 |
+
.cmb2-element .ui-helper-clearfix {
|
1169 |
+
display: block;
|
1170 |
+
}
|
1171 |
+
|
1172 |
+
/* line 18, sass/partials/_jquery_ui.scss */
|
1173 |
+
|
1174 |
+
.cmb2-element .ui-helper-zfix {
|
1175 |
+
width: 100%;
|
1176 |
+
height: 100%;
|
1177 |
+
top: 0;
|
1178 |
+
left: 0;
|
1179 |
+
position: absolute;
|
1180 |
+
opacity: 0;
|
1181 |
+
filter: Alpha(Opacity=0);
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
/* line 19, sass/partials/_jquery_ui.scss */
|
1185 |
+
|
1186 |
+
.cmb2-element .ui-state-disabled {
|
1187 |
+
cursor: default !important;
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
/* line 20, sass/partials/_jquery_ui.scss */
|
1191 |
+
|
1192 |
+
.cmb2-element .ui-icon {
|
1193 |
+
display: block;
|
1194 |
+
text-indent: -99999px;
|
1195 |
+
overflow: hidden;
|
1196 |
+
background-repeat: no-repeat;
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
/* line 21, sass/partials/_jquery_ui.scss */
|
1200 |
+
|
1201 |
+
.cmb2-element .ui-widget-overlay {
|
1202 |
+
position: absolute;
|
1203 |
+
top: 0;
|
1204 |
+
left: 0;
|
1205 |
+
width: 100%;
|
1206 |
+
height: 100%;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
/* line 22, sass/partials/_jquery_ui.scss */
|
1210 |
+
|
1211 |
+
.cmb2-element .ui-widget {
|
1212 |
+
font-family: Verdana,Arial,sans-serif;
|
1213 |
+
font-size: 1.1em;
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
/* line 24, sass/partials/_jquery_ui.scss */
|
1217 |
+
|
1218 |
+
.cmb2-element .ui-widget .ui-widget {
|
1219 |
+
font-size: 1em;
|
1220 |
+
}
|
1221 |
+
|
1222 |
+
/* line 25, sass/partials/_jquery_ui.scss */
|
1223 |
+
|
1224 |
+
.cmb2-element .ui-widget input,
|
1225 |
+
.cmb2-element .ui-widget select,
|
1226 |
+
.cmb2-element .ui-widget textarea,
|
1227 |
+
.cmb2-element .ui-widget button {
|
1228 |
+
font-family: Verdana,Arial,sans-serif;
|
1229 |
+
font-size: 1em;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
/* line 27, sass/partials/_jquery_ui.scss */
|
1233 |
+
|
1234 |
+
.cmb2-element .ui-widget-content {
|
1235 |
+
border: 1px solid #aaaaaa;
|
1236 |
+
background: #ffffff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
|
1237 |
+
color: #222222;
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
/* line 28, sass/partials/_jquery_ui.scss */
|
1241 |
+
|
1242 |
+
.cmb2-element .ui-widget-content a {
|
1243 |
+
color: #222222;
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
/* line 29, sass/partials/_jquery_ui.scss */
|
1247 |
+
|
1248 |
+
.cmb2-element .ui-widget-header {
|
1249 |
+
border: 1px solid #aaaaaa;
|
1250 |
+
background: #cccccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
|
1251 |
+
color: #222222;
|
1252 |
+
font-weight: bold;
|
1253 |
+
}
|
1254 |
+
|
1255 |
+
/* line 30, sass/partials/_jquery_ui.scss */
|
1256 |
+
|
1257 |
+
.cmb2-element .ui-widget-header a {
|
1258 |
+
color: #222222;
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
/* line 31, sass/partials/_jquery_ui.scss */
|
1262 |
+
|
1263 |
+
.cmb2-element .ui-state-default,
|
1264 |
+
.cmb2-element .ui-widget-content .ui-state-default,
|
1265 |
+
.cmb2-element .ui-widget-header .ui-state-default {
|
1266 |
+
border: 1px solid #d3d3d3;
|
1267 |
+
background: #e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
|
1268 |
+
font-weight: normal;
|
1269 |
+
color: #555555;
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
/* line 32, sass/partials/_jquery_ui.scss */
|
1273 |
+
|
1274 |
+
.cmb2-element .ui-state-default a,
|
1275 |
+
.cmb2-element .ui-state-default a:link,
|
1276 |
+
.cmb2-element .ui-state-default a:visited {
|
1277 |
+
color: #555555;
|
1278 |
+
text-decoration: none;
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
/* line 33, sass/partials/_jquery_ui.scss */
|
1282 |
+
|
1283 |
+
.cmb2-element .ui-state-hover,
|
1284 |
+
.cmb2-element .ui-widget-content .ui-state-hover,
|
1285 |
+
.cmb2-element .ui-widget-header .ui-state-hover,
|
1286 |
+
.cmb2-element .ui-state-focus,
|
1287 |
+
.cmb2-element .ui-widget-content .ui-state-focus,
|
1288 |
+
.cmb2-element .ui-widget-header .ui-state-focus {
|
1289 |
+
border: 1px solid #999999;
|
1290 |
+
background: #dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
|
1291 |
+
font-weight: normal;
|
1292 |
+
color: #212121;
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
/* line 34, sass/partials/_jquery_ui.scss */
|
1296 |
+
|
1297 |
+
.cmb2-element .ui-state-hover a,
|
1298 |
+
.cmb2-element .ui-state-hover a:hover {
|
1299 |
+
color: #212121;
|
1300 |
+
text-decoration: none;
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
/* line 35, sass/partials/_jquery_ui.scss */
|
1304 |
+
|
1305 |
+
.cmb2-element .ui-state-active,
|
1306 |
+
.cmb2-element .ui-widget-content .ui-state-active,
|
1307 |
+
.cmb2-element .ui-widget-header .ui-state-active {
|
1308 |
+
border: 1px solid #aaaaaa;
|
1309 |
+
background: #ffffff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
|
1310 |
+
font-weight: normal;
|
1311 |
+
color: #212121;
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
/* line 36, sass/partials/_jquery_ui.scss */
|
1315 |
+
|
1316 |
+
.cmb2-element .ui-state-active a,
|
1317 |
+
.cmb2-element .ui-state-active a:link,
|
1318 |
+
.cmb2-element .ui-state-active a:visited {
|
1319 |
+
color: #212121;
|
1320 |
+
text-decoration: none;
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
/* line 37, sass/partials/_jquery_ui.scss */
|
1324 |
+
|
1325 |
+
.cmb2-element .ui-widget :active {
|
1326 |
+
outline: none;
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
/* line 38, sass/partials/_jquery_ui.scss */
|
1330 |
+
|
1331 |
+
.cmb2-element .ui-state-highlight,
|
1332 |
+
.cmb2-element .ui-widget-content .ui-state-highlight,
|
1333 |
+
.cmb2-element .ui-widget-header .ui-state-highlight {
|
1334 |
+
border: 1px solid #fcefa1;
|
1335 |
+
background: #fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
|
1336 |
+
color: #363636;
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
/* line 39, sass/partials/_jquery_ui.scss */
|
1340 |
+
|
1341 |
+
.cmb2-element .ui-state-highlight a,
|
1342 |
+
.cmb2-element .ui-widget-content .ui-state-highlight a,
|
1343 |
+
.cmb2-element .ui-widget-header .ui-state-highlight a {
|
1344 |
+
color: #363636;
|
1345 |
+
}
|
1346 |
+
|
1347 |
+
/* line 40, sass/partials/_jquery_ui.scss */
|
1348 |
+
|
1349 |
+
.cmb2-element .ui-state-error,
|
1350 |
+
.cmb2-element .ui-widget-content .ui-state-error,
|
1351 |
+
.cmb2-element .ui-widget-header .ui-state-error {
|
1352 |
+
border: 1px solid #cd0a0a;
|
1353 |
+
background: #fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
|
1354 |
+
color: #cd0a0a;
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
/* line 41, sass/partials/_jquery_ui.scss */
|
1358 |
+
|
1359 |
+
.cmb2-element .ui-state-error a,
|
1360 |
+
.cmb2-element .ui-widget-content .ui-state-error a,
|
1361 |
+
.cmb2-element .ui-widget-header .ui-state-error a {
|
1362 |
+
color: #cd0a0a;
|
1363 |
+
}
|
1364 |
+
|
1365 |
+
/* line 42, sass/partials/_jquery_ui.scss */
|
1366 |
+
|
1367 |
+
.cmb2-element .ui-state-error-text,
|
1368 |
+
.cmb2-element .ui-widget-content .ui-state-error-text,
|
1369 |
+
.cmb2-element .ui-widget-header .ui-state-error-text {
|
1370 |
+
color: #cd0a0a;
|
1371 |
+
}
|
1372 |
+
|
1373 |
+
/* line 43, sass/partials/_jquery_ui.scss */
|
1374 |
+
|
1375 |
+
.cmb2-element .ui-priority-primary,
|
1376 |
+
.cmb2-element .ui-widget-content .ui-priority-primary,
|
1377 |
+
.cmb2-element .ui-widget-header .ui-priority-primary {
|
1378 |
+
font-weight: bold;
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
/* line 44, sass/partials/_jquery_ui.scss */
|
1382 |
+
|
1383 |
+
.cmb2-element .ui-priority-secondary,
|
1384 |
+
.cmb2-element .ui-widget-content .ui-priority-secondary,
|
1385 |
+
.cmb2-element .ui-widget-header .ui-priority-secondary {
|
1386 |
+
opacity: .7;
|
1387 |
+
filter: Alpha(Opacity=70);
|
1388 |
+
font-weight: normal;
|
1389 |
+
}
|
1390 |
+
|
1391 |
+
/* line 45, sass/partials/_jquery_ui.scss */
|
1392 |
+
|
1393 |
+
.cmb2-element .ui-state-disabled,
|
1394 |
+
.cmb2-element .ui-widget-content .ui-state-disabled,
|
1395 |
+
.cmb2-element .ui-widget-header .ui-state-disabled {
|
1396 |
+
opacity: .35;
|
1397 |
+
filter: Alpha(Opacity=35);
|
1398 |
+
background-image: none;
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
/* line 46, sass/partials/_jquery_ui.scss */
|
1402 |
+
|
1403 |
+
.cmb2-element .ui-icon {
|
1404 |
+
width: 16px;
|
1405 |
+
height: 16px;
|
1406 |
+
background-image: url(../images/ui-icons_222222_256x240.png);
|
1407 |
+
}
|
1408 |
+
|
1409 |
+
/* line 47, sass/partials/_jquery_ui.scss */
|
1410 |
+
|
1411 |
+
.cmb2-element .ui-widget-content .ui-icon {
|
1412 |
+
background-image: url(../images/ui-icons_222222_256x240.png);
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
/* line 48, sass/partials/_jquery_ui.scss */
|
1416 |
+
|
1417 |
+
.cmb2-element .ui-widget-header .ui-icon {
|
1418 |
+
background-image: url(../images/ui-icons_222222_256x240.png);
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
/* line 49, sass/partials/_jquery_ui.scss */
|
1422 |
+
|
1423 |
+
.cmb2-element .ui-state-default .ui-icon {
|
1424 |
+
background-image: url(../images/ui-icons_888888_256x240.png);
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
/* line 50, sass/partials/_jquery_ui.scss */
|
1428 |
+
|
1429 |
+
.cmb2-element .ui-state-hover .ui-icon,
|
1430 |
+
.cmb2-element .ui-state-focus .ui-icon {
|
1431 |
+
background-image: url(../images/ui-icons_454545_256x240.png);
|
1432 |
+
}
|
1433 |
+
|
1434 |
+
/* line 51, sass/partials/_jquery_ui.scss */
|
1435 |
+
|
1436 |
+
.cmb2-element .ui-state-active .ui-icon {
|
1437 |
+
background-image: url(../images/ui-icons_454545_256x240.png);
|
1438 |
+
}
|
1439 |
+
|
1440 |
+
/* line 52, sass/partials/_jquery_ui.scss */
|
1441 |
+
|
1442 |
+
.cmb2-element .ui-state-highlight .ui-icon {
|
1443 |
+
background-image: url(../images/ui-icons_2e83ff_256x240.png);
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
/* line 53, sass/partials/_jquery_ui.scss */
|
1447 |
+
|
1448 |
+
.cmb2-element .ui-state-error .ui-icon,
|
1449 |
+
.cmb2-element .ui-state-error-text .ui-icon {
|
1450 |
+
background-image: url(../images/ui-icons_cd0a0a_256x240.png);
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
/* line 54, sass/partials/_jquery_ui.scss */
|
1454 |
+
|
1455 |
+
.cmb2-element .ui-icon-carat-1-n {
|
1456 |
+
background-position: 0 0;
|
1457 |
+
}
|
1458 |
+
|
1459 |
+
/* line 55, sass/partials/_jquery_ui.scss */
|
1460 |
+
|
1461 |
+
.cmb2-element .ui-icon-carat-1-ne {
|
1462 |
+
background-position: -16px 0;
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
/* line 56, sass/partials/_jquery_ui.scss */
|
1466 |
+
|
1467 |
+
.cmb2-element .ui-icon-carat-1-e {
|
1468 |
+
background-position: -32px 0;
|
1469 |
+
}
|
1470 |
+
|
1471 |
+
/* line 57, sass/partials/_jquery_ui.scss */
|
1472 |
+
|
1473 |
+
.cmb2-element .ui-icon-carat-1-se {
|
1474 |
+
background-position: -48px 0;
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
/* line 58, sass/partials/_jquery_ui.scss */
|
1478 |
+
|
1479 |
+
.cmb2-element .ui-icon-carat-1-s {
|
1480 |
+
background-position: -64px 0;
|
1481 |
+
}
|
1482 |
+
|
1483 |
+
/* line 59, sass/partials/_jquery_ui.scss */
|
1484 |
+
|
1485 |
+
.cmb2-element .ui-icon-carat-1-sw {
|
1486 |
+
background-position: -80px 0;
|
1487 |
+
}
|
1488 |
+
|
1489 |
+
/* line 60, sass/partials/_jquery_ui.scss */
|
1490 |
+
|
1491 |
+
.cmb2-element .ui-icon-carat-1-w {
|
1492 |
+
background-position: -96px 0;
|
1493 |
+
}
|
1494 |
+
|
1495 |
+
/* line 61, sass/partials/_jquery_ui.scss */
|
1496 |
+
|
1497 |
+
.cmb2-element .ui-icon-carat-1-nw {
|
1498 |
+
background-position: -112px 0;
|
1499 |
+
}
|
1500 |
+
|
1501 |
+
/* line 62, sass/partials/_jquery_ui.scss */
|
1502 |
+
|
1503 |
+
.cmb2-element .ui-icon-carat-2-n-s {
|
1504 |
+
background-position: -128px 0;
|
1505 |
+
}
|
1506 |
+
|
1507 |
+
/* line 63, sass/partials/_jquery_ui.scss */
|
1508 |
+
|
1509 |
+
.cmb2-element .ui-icon-carat-2-e-w {
|
1510 |
+
background-position: -144px 0;
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
/* line 64, sass/partials/_jquery_ui.scss */
|
1514 |
+
|
1515 |
+
.cmb2-element .ui-icon-triangle-1-n {
|
1516 |
+
background-position: 0 -16px;
|
1517 |
+
}
|
1518 |
+
|
1519 |
+
/* line 65, sass/partials/_jquery_ui.scss */
|
1520 |
+
|
1521 |
+
.cmb2-element .ui-icon-triangle-1-ne {
|
1522 |
+
background-position: -16px -16px;
|
1523 |
+
}
|
1524 |
+
|
1525 |
+
/* line 66, sass/partials/_jquery_ui.scss */
|
1526 |
+
|
1527 |
+
.cmb2-element .ui-icon-triangle-1-e {
|
1528 |
+
background-position: -32px -16px;
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
/* line 67, sass/partials/_jquery_ui.scss */
|
1532 |
+
|
1533 |
+
.cmb2-element .ui-icon-triangle-1-se {
|
1534 |
+
background-position: -48px -16px;
|
1535 |
+
}
|
1536 |
+
|
1537 |
+
/* line 68, sass/partials/_jquery_ui.scss */
|
1538 |
+
|
1539 |
+
.cmb2-element .ui-icon-triangle-1-s {
|
1540 |
+
background-position: -64px -16px;
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
/* line 69, sass/partials/_jquery_ui.scss */
|
1544 |
+
|
1545 |
+
.cmb2-element .ui-icon-triangle-1-sw {
|
1546 |
+
background-position: -80px -16px;
|
1547 |
+
}
|
1548 |
+
|
1549 |
+
/* line 70, sass/partials/_jquery_ui.scss */
|
1550 |
+
|
1551 |
+
.cmb2-element .ui-icon-triangle-1-w {
|
1552 |
+
background-position: -96px -16px;
|
1553 |
+
}
|
1554 |
+
|
1555 |
+
/* line 71, sass/partials/_jquery_ui.scss */
|
1556 |
+
|
1557 |
+
.cmb2-element .ui-icon-triangle-1-nw {
|
1558 |
+
background-position: -112px -16px;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
/* line 72, sass/partials/_jquery_ui.scss */
|
1562 |
+
|
1563 |
+
.cmb2-element .ui-icon-triangle-2-n-s {
|
1564 |
+
background-position: -128px -16px;
|
1565 |
+
}
|
1566 |
+
|
1567 |
+
/* line 73, sass/partials/_jquery_ui.scss */
|
1568 |
+
|
1569 |
+
.cmb2-element .ui-icon-triangle-2-e-w {
|
1570 |
+
background-position: -144px -16px;
|
1571 |
+
}
|
1572 |
+
|
1573 |
+
/* line 74, sass/partials/_jquery_ui.scss */
|
1574 |
+
|
1575 |
+
.cmb2-element .ui-icon-arrow-1-n {
|
1576 |
+
background-position: 0 -32px;
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
/* line 75, sass/partials/_jquery_ui.scss */
|
1580 |
+
|
1581 |
+
.cmb2-element .ui-icon-arrow-1-ne {
|
1582 |
+
background-position: -16px -32px;
|
1583 |
+
}
|
1584 |
+
|
1585 |
+
/* line 76, sass/partials/_jquery_ui.scss */
|
1586 |
+
|
1587 |
+
.cmb2-element .ui-icon-arrow-1-e {
|
1588 |
+
background-position: -32px -32px;
|
1589 |
+
}
|
1590 |
+
|
1591 |
+
/* line 77, sass/partials/_jquery_ui.scss */
|
1592 |
+
|
1593 |
+
.cmb2-element .ui-icon-arrow-1-se {
|
1594 |
+
background-position: -48px -32px;
|
1595 |
+
}
|
1596 |
+
|
1597 |
+
/* line 78, sass/partials/_jquery_ui.scss */
|
1598 |
+
|
1599 |
+
.cmb2-element .ui-icon-arrow-1-s {
|
1600 |
+
background-position: -64px -32px;
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
/* line 79, sass/partials/_jquery_ui.scss */
|
1604 |
+
|
1605 |
+
.cmb2-element .ui-icon-arrow-1-sw {
|
1606 |
+
background-position: -80px -32px;
|
1607 |
+
}
|
1608 |
+
|
1609 |
+
/* line 80, sass/partials/_jquery_ui.scss */
|
1610 |
+
|
1611 |
+
.cmb2-element .ui-icon-arrow-1-w {
|
1612 |
+
background-position: -96px -32px;
|
1613 |
+
}
|
1614 |
+
|
1615 |
+
/* line 81, sass/partials/_jquery_ui.scss */
|
1616 |
+
|
1617 |
+
.cmb2-element .ui-icon-arrow-1-nw {
|
1618 |
+
background-position: -112px -32px;
|
1619 |
+
}
|
1620 |
+
|
1621 |
+
/* line 82, sass/partials/_jquery_ui.scss */
|
1622 |
+
|
1623 |
+
.cmb2-element .ui-icon-arrow-2-n-s {
|
1624 |
+
background-position: -128px -32px;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
/* line 83, sass/partials/_jquery_ui.scss */
|
1628 |
+
|
1629 |
+
.cmb2-element .ui-icon-arrow-2-ne-sw {
|
1630 |
+
background-position: -144px -32px;
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
/* line 84, sass/partials/_jquery_ui.scss */
|
1634 |
+
|
1635 |
+
.cmb2-element .ui-icon-arrow-2-e-w {
|
1636 |
+
background-position: -160px -32px;
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
/* line 85, sass/partials/_jquery_ui.scss */
|
1640 |
+
|
1641 |
+
.cmb2-element .ui-icon-arrow-2-se-nw {
|
1642 |
+
background-position: -176px -32px;
|
1643 |
+
}
|
1644 |
+
|
1645 |
+
/* line 86, sass/partials/_jquery_ui.scss */
|
1646 |
+
|
1647 |
+
.cmb2-element .ui-icon-arrowstop-1-n {
|
1648 |
+
background-position: -192px -32px;
|
1649 |
+
}
|
1650 |
+
|
1651 |
+
/* line 87, sass/partials/_jquery_ui.scss */
|
1652 |
+
|
1653 |
+
.cmb2-element .ui-icon-arrowstop-1-e {
|
1654 |
+
background-position: -208px -32px;
|
1655 |
+
}
|
1656 |
+
|
1657 |
+
/* line 88, sass/partials/_jquery_ui.scss */
|
1658 |
+
|
1659 |
+
.cmb2-element .ui-icon-arrowstop-1-s {
|
1660 |
+
background-position: -224px -32px;
|
1661 |
+
}
|
1662 |
+
|
1663 |
+
/* line 89, sass/partials/_jquery_ui.scss */
|
1664 |
+
|
1665 |
+
.cmb2-element .ui-icon-arrowstop-1-w {
|
1666 |
+
background-position: -240px -32px;
|
1667 |
+
}
|
1668 |
+
|
1669 |
+
/* line 90, sass/partials/_jquery_ui.scss */
|
1670 |
+
|
1671 |
+
.cmb2-element .ui-icon-arrowthick-1-n {
|
1672 |
+
background-position: 0 -48px;
|
1673 |
+
}
|
1674 |
+
|
1675 |
+
/* line 91, sass/partials/_jquery_ui.scss */
|
1676 |
+
|
1677 |
+
.cmb2-element .ui-icon-arrowthick-1-ne {
|
1678 |
+
background-position: -16px -48px;
|
1679 |
+
}
|
1680 |
+
|
1681 |
+
/* line 92, sass/partials/_jquery_ui.scss */
|
1682 |
+
|
1683 |
+
.cmb2-element .ui-icon-arrowthick-1-e {
|
1684 |
+
background-position: -32px -48px;
|
1685 |
+
}
|
1686 |
+
|
1687 |
+
/* line 93, sass/partials/_jquery_ui.scss */
|
1688 |
+
|
1689 |
+
.cmb2-element .ui-icon-arrowthick-1-se {
|
1690 |
+
background-position: -48px -48px;
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
/* line 94, sass/partials/_jquery_ui.scss */
|
1694 |
+
|
1695 |
+
.cmb2-element .ui-icon-arrowthick-1-s {
|
1696 |
+
background-position: -64px -48px;
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
/* line 95, sass/partials/_jquery_ui.scss */
|
1700 |
+
|
1701 |
+
.cmb2-element .ui-icon-arrowthick-1-sw {
|
1702 |
+
background-position: -80px -48px;
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
/* line 96, sass/partials/_jquery_ui.scss */
|
1706 |
+
|
1707 |
+
.cmb2-element .ui-icon-arrowthick-1-w {
|
1708 |
+
background-position: -96px -48px;
|
1709 |
+
}
|
1710 |
+
|
1711 |
+
/* line 97, sass/partials/_jquery_ui.scss */
|
1712 |
+
|
1713 |
+
.cmb2-element .ui-icon-arrowthick-1-nw {
|
1714 |
+
background-position: -112px -48px;
|
1715 |
+
}
|
1716 |
+
|
1717 |
+
/* line 98, sass/partials/_jquery_ui.scss */
|
1718 |
+
|
1719 |
+
.cmb2-element .ui-icon-arrowthick-2-n-s {
|
1720 |
+
background-position: -128px -48px;
|
1721 |
+
}
|
1722 |
+
|
1723 |
+
/* line 99, sass/partials/_jquery_ui.scss */
|
1724 |
+
|
1725 |
+
.cmb2-element .ui-icon-arrowthick-2-ne-sw {
|
1726 |
+
background-position: -144px -48px;
|
1727 |
+
}
|
1728 |
+
|
1729 |
+
/* line 100, sass/partials/_jquery_ui.scss */
|
1730 |
+
|
1731 |
+
.cmb2-element .ui-icon-arrowthick-2-e-w {
|
1732 |
+
background-position: -160px -48px;
|
1733 |
+
}
|
1734 |
+
|
1735 |
+
/* line 101, sass/partials/_jquery_ui.scss */
|
1736 |
+
|
1737 |
+
.cmb2-element .ui-icon-arrowthick-2-se-nw {
|
1738 |
+
background-position: -176px -48px;
|
1739 |
+
}
|
1740 |
+
|
1741 |
+
/* line 102, sass/partials/_jquery_ui.scss */
|
1742 |
+
|
1743 |
+
.cmb2-element .ui-icon-arrowthickstop-1-n {
|
1744 |
+
background-position: -192px -48px;
|
1745 |
+
}
|
1746 |
+
|
1747 |
+
/* line 103, sass/partials/_jquery_ui.scss */
|
1748 |
+
|
1749 |
+
.cmb2-element .ui-icon-arrowthickstop-1-e {
|
1750 |
+
background-position: -208px -48px;
|
1751 |
+
}
|
1752 |
+
|
1753 |
+
/* line 104, sass/partials/_jquery_ui.scss */
|
1754 |
+
|
1755 |
+
.cmb2-element .ui-icon-arrowthickstop-1-s {
|
1756 |
+
background-position: -224px -48px;
|
1757 |
+
}
|
1758 |
+
|
1759 |
+
/* line 105, sass/partials/_jquery_ui.scss */
|
1760 |
+
|
1761 |
+
.cmb2-element .ui-icon-arrowthickstop-1-w {
|
1762 |
+
background-position: -240px -48px;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
/* line 106, sass/partials/_jquery_ui.scss */
|
1766 |
+
|
1767 |
+
.cmb2-element .ui-icon-arrowreturnthick-1-w {
|
1768 |
+
background-position: 0 -64px;
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
/* line 107, sass/partials/_jquery_ui.scss */
|
1772 |
+
|
1773 |
+
.cmb2-element .ui-icon-arrowreturnthick-1-n {
|
1774 |
+
background-position: -16px -64px;
|
1775 |
+
}
|
1776 |
+
|
1777 |
+
/* line 108, sass/partials/_jquery_ui.scss */
|
1778 |
+
|
1779 |
+
.cmb2-element .ui-icon-arrowreturnthick-1-e {
|
1780 |
+
background-position: -32px -64px;
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
/* line 109, sass/partials/_jquery_ui.scss */
|
1784 |
+
|
1785 |
+
.cmb2-element .ui-icon-arrowreturnthick-1-s {
|
1786 |
+
background-position: -48px -64px;
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
/* line 110, sass/partials/_jquery_ui.scss */
|
1790 |
+
|
1791 |
+
.cmb2-element .ui-icon-arrowreturn-1-w {
|
1792 |
+
background-position: -64px -64px;
|
1793 |
+
}
|
1794 |
+
|
1795 |
+
/* line 111, sass/partials/_jquery_ui.scss */
|
1796 |
+
|
1797 |
+
.cmb2-element .ui-icon-arrowreturn-1-n {
|
1798 |
+
background-position: -80px -64px;
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
/* line 112, sass/partials/_jquery_ui.scss */
|
1802 |
+
|
1803 |
+
.cmb2-element .ui-icon-arrowreturn-1-e {
|
1804 |
+
background-position: -96px -64px;
|
1805 |
+
}
|
1806 |
+
|
1807 |
+
/* line 113, sass/partials/_jquery_ui.scss */
|
1808 |
+
|
1809 |
+
.cmb2-element .ui-icon-arrowreturn-1-s {
|
1810 |
+
background-position: -112px -64px;
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
/* line 114, sass/partials/_jquery_ui.scss */
|
1814 |
+
|
1815 |
+
.cmb2-element .ui-icon-arrowrefresh-1-w {
|
1816 |
+
background-position: -128px -64px;
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
/* line 115, sass/partials/_jquery_ui.scss */
|
1820 |
+
|
1821 |
+
.cmb2-element .ui-icon-arrowrefresh-1-n {
|
1822 |
+
background-position: -144px -64px;
|
1823 |
+
}
|
1824 |
+
|
1825 |
+
/* line 116, sass/partials/_jquery_ui.scss */
|
1826 |
+
|
1827 |
+
.cmb2-element .ui-icon-arrowrefresh-1-e {
|
1828 |
+
background-position: -160px -64px;
|
1829 |
+
}
|
1830 |
+
|
1831 |
+
/* line 117, sass/partials/_jquery_ui.scss */
|
1832 |
+
|
1833 |
+
.cmb2-element .ui-icon-arrowrefresh-1-s {
|
1834 |
+
background-position: -176px -64px;
|
1835 |
+
}
|
1836 |
+
|
1837 |
+
/* line 118, sass/partials/_jquery_ui.scss */
|
1838 |
+
|
1839 |
+
.cmb2-element .ui-icon-arrow-4 {
|
1840 |
+
background-position: 0 -80px;
|
1841 |
+
}
|
1842 |
+
|
1843 |
+
/* line 119, sass/partials/_jquery_ui.scss */
|
1844 |
+
|
1845 |
+
.cmb2-element .ui-icon-arrow-4-diag {
|
1846 |
+
background-position: -16px -80px;
|
1847 |
+
}
|
1848 |
+
|
1849 |
+
/* line 120, sass/partials/_jquery_ui.scss */
|
1850 |
+
|
1851 |
+
.cmb2-element .ui-icon-extlink {
|
1852 |
+
background-position: -32px -80px;
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
/* line 121, sass/partials/_jquery_ui.scss */
|
1856 |
+
|
1857 |
+
.cmb2-element .ui-icon-newwin {
|
1858 |
+
background-position: -48px -80px;
|
1859 |
+
}
|
1860 |
+
|
1861 |
+
/* line 122, sass/partials/_jquery_ui.scss */
|
1862 |
+
|
1863 |
+
.cmb2-element .ui-icon-refresh {
|
1864 |
+
background-position: -64px -80px;
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
/* line 123, sass/partials/_jquery_ui.scss */
|
1868 |
+
|
1869 |
+
.cmb2-element .ui-icon-shuffle {
|
1870 |
+
background-position: -80px -80px;
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
/* line 124, sass/partials/_jquery_ui.scss */
|
1874 |
+
|
1875 |
+
.cmb2-element .ui-icon-transfer-e-w {
|
1876 |
+
background-position: -96px -80px;
|
1877 |
+
}
|
1878 |
+
|
1879 |
+
/* line 125, sass/partials/_jquery_ui.scss */
|
1880 |
+
|
1881 |
+
.cmb2-element .ui-icon-transferthick-e-w {
|
1882 |
+
background-position: -112px -80px;
|
1883 |
+
}
|
1884 |
+
|
1885 |
+
/* line 126, sass/partials/_jquery_ui.scss */
|
1886 |
+
|
1887 |
+
.cmb2-element .ui-icon-folder-collapsed {
|
1888 |
+
background-position: 0 -96px;
|
1889 |
+
}
|
1890 |
+
|
1891 |
+
/* line 127, sass/partials/_jquery_ui.scss */
|
1892 |
+
|
1893 |
+
.cmb2-element .ui-icon-folder-open {
|
1894 |
+
background-position: -16px -96px;
|
1895 |
+
}
|
1896 |
+
|
1897 |
+
/* line 128, sass/partials/_jquery_ui.scss */
|
1898 |
+
|
1899 |
+
.cmb2-element .ui-icon-document {
|
1900 |
+
background-position: -32px -96px;
|
1901 |
+
}
|
1902 |
+
|
1903 |
+
/* line 129, sass/partials/_jquery_ui.scss */
|
1904 |
+
|
1905 |
+
.cmb2-element .ui-icon-document-b {
|
1906 |
+
background-position: -48px -96px;
|
1907 |
+
}
|
1908 |
+
|
1909 |
+
/* line 130, sass/partials/_jquery_ui.scss */
|
1910 |
+
|
1911 |
+
.cmb2-element .ui-icon-note {
|
1912 |
+
background-position: -64px -96px;
|
1913 |
+
}
|
1914 |
+
|
1915 |
+
/* line 131, sass/partials/_jquery_ui.scss */
|
1916 |
+
|
1917 |
+
.cmb2-element .ui-icon-mail-closed {
|
1918 |
+
background-position: -80px -96px;
|
1919 |
+
}
|
1920 |
+
|
1921 |
+
/* line 132, sass/partials/_jquery_ui.scss */
|
1922 |
+
|
1923 |
+
.cmb2-element .ui-icon-mail-open {
|
1924 |
+
background-position: -96px -96px;
|
1925 |
+
}
|
1926 |
+
|
1927 |
+
/* line 133, sass/partials/_jquery_ui.scss */
|
1928 |
+
|
1929 |
+
.cmb2-element .ui-icon-suitcase {
|
1930 |
+
background-position: -112px -96px;
|
1931 |
+
}
|
1932 |
+
|
1933 |
+
/* line 134, sass/partials/_jquery_ui.scss */
|
1934 |
+
|
1935 |
+
.cmb2-element .ui-icon-comment {
|
1936 |
+
background-position: -128px -96px;
|
1937 |
+
}
|
1938 |
+
|
1939 |
+
/* line 135, sass/partials/_jquery_ui.scss */
|
1940 |
+
|
1941 |
+
.cmb2-element .ui-icon-person {
|
1942 |
+
background-position: -144px -96px;
|
1943 |
+
}
|
1944 |
+
|
1945 |
+
/* line 136, sass/partials/_jquery_ui.scss */
|
1946 |
+
|
1947 |
+
.cmb2-element .ui-icon-print {
|
1948 |
+
background-position: -160px -96px;
|
1949 |
+
}
|
1950 |
+
|
1951 |
+
/* line 137, sass/partials/_jquery_ui.scss */
|
1952 |
+
|
1953 |
+
.cmb2-element .ui-icon-trash {
|
1954 |
+
background-position: -176px -96px;
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
/* line 138, sass/partials/_jquery_ui.scss */
|
1958 |
+
|
1959 |
+
.cmb2-element .ui-icon-locked {
|
1960 |
+
background-position: -192px -96px;
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
/* line 139, sass/partials/_jquery_ui.scss */
|
1964 |
+
|
1965 |
+
.cmb2-element .ui-icon-unlocked {
|
1966 |
+
background-position: -208px -96px;
|
1967 |
+
}
|
1968 |
+
|
1969 |
+
/* line 140, sass/partials/_jquery_ui.scss */
|
1970 |
+
|
1971 |
+
.cmb2-element .ui-icon-bookmark {
|
1972 |
+
background-position: -224px -96px;
|
1973 |
+
}
|
1974 |
+
|
1975 |
+
/* line 141, sass/partials/_jquery_ui.scss */
|
1976 |
+
|
1977 |
+
.cmb2-element .ui-icon-tag {
|
1978 |
+
background-position: -240px -96px;
|
1979 |
+
}
|
1980 |
+
|
1981 |
+
/* line 142, sass/partials/_jquery_ui.scss */
|
1982 |
+
|
1983 |
+
.cmb2-element .ui-icon-home {
|
1984 |
+
background-position: 0 -112px;
|
1985 |
+
}
|
1986 |
+
|
1987 |
+
/* line 143, sass/partials/_jquery_ui.scss */
|
1988 |
+
|
1989 |
+
.cmb2-element .ui-icon-flag {
|
1990 |
+
background-position: -16px -112px;
|
1991 |
+
}
|
1992 |
+
|
1993 |
+
/* line 144, sass/partials/_jquery_ui.scss */
|
1994 |
+
|
1995 |
+
.cmb2-element .ui-icon-calendar {
|
1996 |
+
background-position: -32px -112px;
|
1997 |
+
}
|
1998 |
+
|
1999 |
+
/* line 145, sass/partials/_jquery_ui.scss */
|
2000 |
+
|
2001 |
+
.cmb2-element .ui-icon-cart {
|
2002 |
+
background-position: -48px -112px;
|
2003 |
+
}
|
2004 |
+
|
2005 |
+
/* line 146, sass/partials/_jquery_ui.scss */
|
2006 |
+
|
2007 |
+
.cmb2-element .ui-icon-pencil {
|
2008 |
+
background-position: -64px -112px;
|
2009 |
+
}
|
2010 |
+
|
2011 |
+
/* line 147, sass/partials/_jquery_ui.scss */
|
2012 |
+
|
2013 |
+
.cmb2-element .ui-icon-clock {
|
2014 |
+
background-position: -80px -112px;
|
2015 |
+
}
|
2016 |
+
|
2017 |
+
/* line 148, sass/partials/_jquery_ui.scss */
|
2018 |
+
|
2019 |
+
.cmb2-element .ui-icon-disk {
|
2020 |
+
background-position: -96px -112px;
|
2021 |
+
}
|
2022 |
+
|
2023 |
+
/* line 149, sass/partials/_jquery_ui.scss */
|
2024 |
+
|
2025 |
+
.cmb2-element .ui-icon-calculator {
|
2026 |
+
background-position: -112px -112px;
|
2027 |
+
}
|
2028 |
+
|
2029 |
+
/* line 150, sass/partials/_jquery_ui.scss */
|
2030 |
+
|
2031 |
+
.cmb2-element .ui-icon-zoomin {
|
2032 |
+
background-position: -128px -112px;
|
2033 |
+
}
|
2034 |
+
|
2035 |
+
/* line 151, sass/partials/_jquery_ui.scss */
|
2036 |
+
|
2037 |
+
.cmb2-element .ui-icon-zoomout {
|
2038 |
+
background-position: -144px -112px;
|
2039 |
+
}
|
2040 |
+
|
2041 |
+
/* line 152, sass/partials/_jquery_ui.scss */
|
2042 |
+
|
2043 |
+
.cmb2-element .ui-icon-search {
|
2044 |
+
background-position: -160px -112px;
|
2045 |
+
}
|
2046 |
+
|
2047 |
+
/* line 153, sass/partials/_jquery_ui.scss */
|
2048 |
+
|
2049 |
+
.cmb2-element .ui-icon-wrench {
|
2050 |
+
background-position: -176px -112px;
|
2051 |
+
}
|
2052 |
+
|
2053 |
+
/* line 154, sass/partials/_jquery_ui.scss */
|
2054 |
+
|
2055 |
+
.cmb2-element .ui-icon-gear {
|
2056 |
+
background-position: -192px -112px;
|
2057 |
+
}
|
2058 |
+
|
2059 |
+
/* line 155, sass/partials/_jquery_ui.scss */
|
2060 |
+
|
2061 |
+
.cmb2-element .ui-icon-heart {
|
2062 |
+
background-position: -208px -112px;
|
2063 |
+
}
|
2064 |
+
|
2065 |
+
/* line 156, sass/partials/_jquery_ui.scss */
|
2066 |
+
|
2067 |
+
.cmb2-element .ui-icon-star {
|
2068 |
+
background-position: -224px -112px;
|
2069 |
+
}
|
2070 |
+
|
2071 |
+
/* line 157, sass/partials/_jquery_ui.scss */
|
2072 |
+
|
2073 |
+
.cmb2-element .ui-icon-link {
|
2074 |
+
background-position: -240px -112px;
|
2075 |
+
}
|
2076 |
+
|
2077 |
+
/* line 158, sass/partials/_jquery_ui.scss */
|
2078 |
+
|
2079 |
+
.cmb2-element .ui-icon-cancel {
|
2080 |
+
background-position: 0 -128px;
|
2081 |
+
}
|
2082 |
+
|
2083 |
+
/* line 159, sass/partials/_jquery_ui.scss */
|
2084 |
+
|
2085 |
+
.cmb2-element .ui-icon-plus {
|
2086 |
+
background-position: -16px -128px;
|
2087 |
+
}
|
2088 |
+
|
2089 |
+
/* line 160, sass/partials/_jquery_ui.scss */
|
2090 |
+
|
2091 |
+
.cmb2-element .ui-icon-plusthick {
|
2092 |
+
background-position: -32px -128px;
|
2093 |
+
}
|
2094 |
+
|
2095 |
+
/* line 161, sass/partials/_jquery_ui.scss */
|
2096 |
+
|
2097 |
+
.cmb2-element .ui-icon-minus {
|
2098 |
+
background-position: -48px -128px;
|
2099 |
+
}
|
2100 |
+
|
2101 |
+
/* line 162, sass/partials/_jquery_ui.scss */
|
2102 |
+
|
2103 |
+
.cmb2-element .ui-icon-minusthick {
|
2104 |
+
background-position: -64px -128px;
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
/* line 163, sass/partials/_jquery_ui.scss */
|
2108 |
+
|
2109 |
+
.cmb2-element .ui-icon-close {
|
2110 |
+
background-position: -80px -128px;
|
2111 |
+
}
|
2112 |
+
|
2113 |
+
/* line 164, sass/partials/_jquery_ui.scss */
|
2114 |
+
|
2115 |
+
.cmb2-element .ui-icon-closethick {
|
2116 |
+
background-position: -96px -128px;
|
2117 |
+
}
|
2118 |
+
|
2119 |
+
/* line 165, sass/partials/_jquery_ui.scss */
|
2120 |
+
|
2121 |
+
.cmb2-element .ui-icon-key {
|
2122 |
+
background-position: -112px -128px;
|
2123 |
+
}
|
2124 |
+
|
2125 |
+
/* line 166, sass/partials/_jquery_ui.scss */
|
2126 |
+
|
2127 |
+
.cmb2-element .ui-icon-lightbulb {
|
2128 |
+
background-position: -128px -128px;
|
2129 |
+
}
|
2130 |
+
|
2131 |
+
/* line 167, sass/partials/_jquery_ui.scss */
|
2132 |
+
|
2133 |
+
.cmb2-element .ui-icon-scissors {
|
2134 |
+
background-position: -144px -128px;
|
2135 |
+
}
|
2136 |
+
|
2137 |
+
/* line 168, sass/partials/_jquery_ui.scss */
|
2138 |
+
|
2139 |
+
.cmb2-element .ui-icon-clipboard {
|
2140 |
+
background-position: -160px -128px;
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
/* line 169, sass/partials/_jquery_ui.scss */
|
2144 |
+
|
2145 |
+
.cmb2-element .ui-icon-copy {
|
2146 |
+
background-position: -176px -128px;
|
2147 |
+
}
|
2148 |
+
|
2149 |
+
/* line 170, sass/partials/_jquery_ui.scss */
|
2150 |
+
|
2151 |
+
.cmb2-element .ui-icon-contact {
|
2152 |
+
background-position: -192px -128px;
|
2153 |
+
}
|
2154 |
+
|
2155 |
+
/* line 171, sass/partials/_jquery_ui.scss */
|
2156 |
+
|
2157 |
+
.cmb2-element .ui-icon-image {
|
2158 |
+
background-position: -208px -128px;
|
2159 |
+
}
|
2160 |
+
|
2161 |
+
/* line 172, sass/partials/_jquery_ui.scss */
|
2162 |
+
|
2163 |
+
.cmb2-element .ui-icon-video {
|
2164 |
+
background-position: -224px -128px;
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
/* line 173, sass/partials/_jquery_ui.scss */
|
2168 |
+
|
2169 |
+
.cmb2-element .ui-icon-script {
|
2170 |
+
background-position: -240px -128px;
|
2171 |
+
}
|
2172 |
+
|
2173 |
+
/* line 174, sass/partials/_jquery_ui.scss */
|
2174 |
+
|
2175 |
+
.cmb2-element .ui-icon-alert {
|
2176 |
+
background-position: 0 -144px;
|
2177 |
+
}
|
2178 |
+
|
2179 |
+
/* line 175, sass/partials/_jquery_ui.scss */
|
2180 |
+
|
2181 |
+
.cmb2-element .ui-icon-info {
|
2182 |
+
background-position: -16px -144px;
|
2183 |
+
}
|
2184 |
+
|
2185 |
+
/* line 176, sass/partials/_jquery_ui.scss */
|
2186 |
+
|
2187 |
+
.cmb2-element .ui-icon-notice {
|
2188 |
+
background-position: -32px -144px;
|
2189 |
+
}
|
2190 |
+
|
2191 |
+
/* line 177, sass/partials/_jquery_ui.scss */
|
2192 |
+
|
2193 |
+
.cmb2-element .ui-icon-help {
|
2194 |
+
background-position: -48px -144px;
|
2195 |
+
}
|
2196 |
+
|
2197 |
+
/* line 178, sass/partials/_jquery_ui.scss */
|
2198 |
+
|
2199 |
+
.cmb2-element .ui-icon-check {
|
2200 |
+
background-position: -64px -144px;
|
2201 |
+
}
|
2202 |
+
|
2203 |
+
/* line 179, sass/partials/_jquery_ui.scss */
|
2204 |
+
|
2205 |
+
.cmb2-element .ui-icon-bullet {
|
2206 |
+
background-position: -80px -144px;
|
2207 |
+
}
|
2208 |
+
|
2209 |
+
/* line 180, sass/partials/_jquery_ui.scss */
|
2210 |
+
|
2211 |
+
.cmb2-element .ui-icon-radio-off {
|
2212 |
+
background-position: -96px -144px;
|
2213 |
+
}
|
2214 |
+
|
2215 |
+
/* line 181, sass/partials/_jquery_ui.scss */
|
2216 |
+
|
2217 |
+
.cmb2-element .ui-icon-radio-on {
|
2218 |
+
background-position: -112px -144px;
|
2219 |
+
}
|
2220 |
+
|
2221 |
+
/* line 182, sass/partials/_jquery_ui.scss */
|
2222 |
+
|
2223 |
+
.cmb2-element .ui-icon-pin-w {
|
2224 |
+
background-position: -128px -144px;
|
2225 |
+
}
|
2226 |
+
|
2227 |
+
/* line 183, sass/partials/_jquery_ui.scss */
|
2228 |
+
|
2229 |
+
.cmb2-element .ui-icon-pin-s {
|
2230 |
+
background-position: -144px -144px;
|
2231 |
+
}
|
2232 |
+
|
2233 |
+
/* line 184, sass/partials/_jquery_ui.scss */
|
2234 |
+
|
2235 |
+
.cmb2-element .ui-icon-play {
|
2236 |
+
background-position: 0 -160px;
|
2237 |
+
}
|
2238 |
+
|
2239 |
+
/* line 185, sass/partials/_jquery_ui.scss */
|
2240 |
+
|
2241 |
+
.cmb2-element .ui-icon-pause {
|
2242 |
+
background-position: -16px -160px;
|
2243 |
+
}
|
2244 |
+
|
2245 |
+
/* line 186, sass/partials/_jquery_ui.scss */
|
2246 |
+
|
2247 |
+
.cmb2-element .ui-icon-seek-next {
|
2248 |
+
background-position: -32px -160px;
|
2249 |
+
}
|
2250 |
+
|
2251 |
+
/* line 187, sass/partials/_jquery_ui.scss */
|
2252 |
+
|
2253 |
+
.cmb2-element .ui-icon-seek-prev {
|
2254 |
+
background-position: -48px -160px;
|
2255 |
+
}
|
2256 |
+
|
2257 |
+
/* line 188, sass/partials/_jquery_ui.scss */
|
2258 |
+
|
2259 |
+
.cmb2-element .ui-icon-seek-end {
|
2260 |
+
background-position: -64px -160px;
|
2261 |
+
}
|
2262 |
+
|
2263 |
+
/* line 189, sass/partials/_jquery_ui.scss */
|
2264 |
+
|
2265 |
+
.cmb2-element .ui-icon-seek-start {
|
2266 |
+
background-position: -80px -160px;
|
2267 |
+
}
|
2268 |
+
|
2269 |
+
/* line 190, sass/partials/_jquery_ui.scss */
|
2270 |
+
|
2271 |
+
.cmb2-element .ui-icon-seek-first {
|
2272 |
+
background-position: -80px -160px;
|
2273 |
+
}
|
2274 |
+
|
2275 |
+
/* line 191, sass/partials/_jquery_ui.scss */
|
2276 |
+
|
2277 |
+
.cmb2-element .ui-icon-stop {
|
2278 |
+
background-position: -96px -160px;
|
2279 |
+
}
|
2280 |
+
|
2281 |
+
/* line 192, sass/partials/_jquery_ui.scss */
|
2282 |
+
|
2283 |
+
.cmb2-element .ui-icon-eject {
|
2284 |
+
background-position: -112px -160px;
|
2285 |
+
}
|
2286 |
+
|
2287 |
+
/* line 193, sass/partials/_jquery_ui.scss */
|
2288 |
+
|
2289 |
+
.cmb2-element .ui-icon-volume-off {
|
2290 |
+
background-position: -128px -160px;
|
2291 |
+
}
|
2292 |
+
|
2293 |
+
/* line 194, sass/partials/_jquery_ui.scss */
|
2294 |
+
|
2295 |
+
.cmb2-element .ui-icon-volume-on {
|
2296 |
+
background-position: -144px -160px;
|
2297 |
+
}
|
2298 |
+
|
2299 |
+
/* line 195, sass/partials/_jquery_ui.scss */
|
2300 |
+
|
2301 |
+
.cmb2-element .ui-icon-power {
|
2302 |
+
background-position: 0 -176px;
|
2303 |
+
}
|
2304 |
+
|
2305 |
+
/* line 196, sass/partials/_jquery_ui.scss */
|
2306 |
+
|
2307 |
+
.cmb2-element .ui-icon-signal-diag {
|
2308 |
+
background-position: -16px -176px;
|
2309 |
+
}
|
2310 |
+
|
2311 |
+
/* line 197, sass/partials/_jquery_ui.scss */
|
2312 |
+
|
2313 |
+
.cmb2-element .ui-icon-signal {
|
2314 |
+
background-position: -32px -176px;
|
2315 |
+
}
|
2316 |
+
|
2317 |
+
/* line 198, sass/partials/_jquery_ui.scss */
|
2318 |
+
|
2319 |
+
.cmb2-element .ui-icon-battery-0 {
|
2320 |
+
background-position: -48px -176px;
|
2321 |
+
}
|
2322 |
+
|
2323 |
+
/* line 199, sass/partials/_jquery_ui.scss */
|
2324 |
+
|
2325 |
+
.cmb2-element .ui-icon-battery-1 {
|
2326 |
+
background-position: -64px -176px;
|
2327 |
+
}
|
2328 |
+
|
2329 |
+
/* line 200, sass/partials/_jquery_ui.scss */
|
2330 |
+
|
2331 |
+
.cmb2-element .ui-icon-battery-2 {
|
2332 |
+
background-position: -80px -176px;
|
2333 |
+
}
|
2334 |
+
|
2335 |
+
/* line 201, sass/partials/_jquery_ui.scss */
|
2336 |
+
|
2337 |
+
.cmb2-element .ui-icon-battery-3 {
|
2338 |
+
background-position: -96px -176px;
|
2339 |
+
}
|
2340 |
+
|
2341 |
+
/* line 202, sass/partials/_jquery_ui.scss */
|
2342 |
+
|
2343 |
+
.cmb2-element .ui-icon-circle-plus {
|
2344 |
+
background-position: 0 -192px;
|
2345 |
+
}
|
2346 |
+
|
2347 |
+
/* line 203, sass/partials/_jquery_ui.scss */
|
2348 |
+
|
2349 |
+
.cmb2-element .ui-icon-circle-minus {
|
2350 |
+
background-position: -16px -192px;
|
2351 |
+
}
|
2352 |
+
|
2353 |
+
/* line 204, sass/partials/_jquery_ui.scss */
|
2354 |
+
|
2355 |
+
.cmb2-element .ui-icon-circle-close {
|
2356 |
+
background-position: -32px -192px;
|
2357 |
+
}
|
2358 |
+
|
2359 |
+
/* line 205, sass/partials/_jquery_ui.scss */
|
2360 |
+
|
2361 |
+
.cmb2-element .ui-icon-circle-triangle-e {
|
2362 |
+
background-position: -48px -192px;
|
2363 |
+
}
|
2364 |
+
|
2365 |
+
/* line 206, sass/partials/_jquery_ui.scss */
|
2366 |
+
|
2367 |
+
.cmb2-element .ui-icon-circle-triangle-s {
|
2368 |
+
background-position: -64px -192px;
|
2369 |
+
}
|
2370 |
+
|
2371 |
+
/* line 207, sass/partials/_jquery_ui.scss */
|
2372 |
+
|
2373 |
+
.cmb2-element .ui-icon-circle-triangle-w {
|
2374 |
+
background-position: -80px -192px;
|
2375 |
+
}
|
2376 |
+
|
2377 |
+
/* line 208, sass/partials/_jquery_ui.scss */
|
2378 |
+
|
2379 |
+
.cmb2-element .ui-icon-circle-triangle-n {
|
2380 |
+
background-position: -96px -192px;
|
2381 |
+
}
|
2382 |
+
|
2383 |
+
/* line 209, sass/partials/_jquery_ui.scss */
|
2384 |
+
|
2385 |
+
.cmb2-element .ui-icon-circle-arrow-e {
|
2386 |
+
background-position: -112px -192px;
|
2387 |
+
}
|
2388 |
+
|
2389 |
+
/* line 210, sass/partials/_jquery_ui.scss */
|
2390 |
+
|
2391 |
+
.cmb2-element .ui-icon-circle-arrow-s {
|
2392 |
+
background-position: -128px -192px;
|
2393 |
+
}
|
2394 |
+
|
2395 |
+
/* line 211, sass/partials/_jquery_ui.scss */
|
2396 |
+
|
2397 |
+
.cmb2-element .ui-icon-circle-arrow-w {
|
2398 |
+
background-position: -144px -192px;
|
2399 |
+
}
|
2400 |
+
|
2401 |
+
/* line 212, sass/partials/_jquery_ui.scss */
|
2402 |
+
|
2403 |
+
.cmb2-element .ui-icon-circle-arrow-n {
|
2404 |
+
background-position: -160px -192px;
|
2405 |
+
}
|
2406 |
+
|
2407 |
+
/* line 213, sass/partials/_jquery_ui.scss */
|
2408 |
+
|
2409 |
+
.cmb2-element .ui-icon-circle-zoomin {
|
2410 |
+
background-position: -176px -192px;
|
2411 |
+
}
|
2412 |
+
|
2413 |
+
/* line 214, sass/partials/_jquery_ui.scss */
|
2414 |
+
|
2415 |
+
.cmb2-element .ui-icon-circle-zoomout {
|
2416 |
+
background-position: -192px -192px;
|
2417 |
+
}
|
2418 |
+
|
2419 |
+
/* line 215, sass/partials/_jquery_ui.scss */
|
2420 |
+
|
2421 |
+
.cmb2-element .ui-icon-circle-check {
|
2422 |
+
background-position: -208px -192px;
|
2423 |
+
}
|
2424 |
+
|
2425 |
+
/* line 216, sass/partials/_jquery_ui.scss */
|
2426 |
+
|
2427 |
+
.cmb2-element .ui-icon-circlesmall-plus {
|
2428 |
+
background-position: 0 -208px;
|
2429 |
+
}
|
2430 |
+
|
2431 |
+
/* line 217, sass/partials/_jquery_ui.scss */
|
2432 |
+
|
2433 |
+
.cmb2-element .ui-icon-circlesmall-minus {
|
2434 |
+
background-position: -16px -208px;
|
2435 |
+
}
|
2436 |
+
|
2437 |
+
/* line 218, sass/partials/_jquery_ui.scss */
|
2438 |
+
|
2439 |
+
.cmb2-element .ui-icon-circlesmall-close {
|
2440 |
+
background-position: -32px -208px;
|
2441 |
+
}
|
2442 |
+
|
2443 |
+
/* line 219, sass/partials/_jquery_ui.scss */
|
2444 |
+
|
2445 |
+
.cmb2-element .ui-icon-squaresmall-plus {
|
2446 |
+
background-position: -48px -208px;
|
2447 |
+
}
|
2448 |
+
|
2449 |
+
/* line 220, sass/partials/_jquery_ui.scss */
|
2450 |
+
|
2451 |
+
.cmb2-element .ui-icon-squaresmall-minus {
|
2452 |
+
background-position: -64px -208px;
|
2453 |
+
}
|
2454 |
+
|
2455 |
+
/* line 221, sass/partials/_jquery_ui.scss */
|
2456 |
+
|
2457 |
+
.cmb2-element .ui-icon-squaresmall-close {
|
2458 |
+
background-position: -80px -208px;
|
2459 |
+
}
|
2460 |
+
|
2461 |
+
/* line 222, sass/partials/_jquery_ui.scss */
|
2462 |
+
|
2463 |
+
.cmb2-element .ui-icon-grip-dotted-vertical {
|
2464 |
+
background-position: 0 -224px;
|
2465 |
+
}
|
2466 |
+
|
2467 |
+
/* line 223, sass/partials/_jquery_ui.scss */
|
2468 |
+
|
2469 |
+
.cmb2-element .ui-icon-grip-dotted-horizontal {
|
2470 |
+
background-position: -16px -224px;
|
2471 |
+
}
|
2472 |
+
|
2473 |
+
/* line 224, sass/partials/_jquery_ui.scss */
|
2474 |
+
|
2475 |
+
.cmb2-element .ui-icon-grip-solid-vertical {
|
2476 |
+
background-position: -32px -224px;
|
2477 |
+
}
|
2478 |
+
|
2479 |
+
/* line 225, sass/partials/_jquery_ui.scss */
|
2480 |
+
|
2481 |
+
.cmb2-element .ui-icon-grip-solid-horizontal {
|
2482 |
+
background-position: -48px -224px;
|
2483 |
+
}
|
2484 |
+
|
2485 |
+
/* line 226, sass/partials/_jquery_ui.scss */
|
2486 |
+
|
2487 |
+
.cmb2-element .ui-icon-gripsmall-diagonal-se {
|
2488 |
+
background-position: -64px -224px;
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
/* line 227, sass/partials/_jquery_ui.scss */
|
2492 |
+
|
2493 |
+
.cmb2-element .ui-icon-grip-diagonal-se {
|
2494 |
+
background-position: -80px -224px;
|
2495 |
+
}
|
2496 |
+
|
2497 |
+
/* line 228, sass/partials/_jquery_ui.scss */
|
2498 |
+
|
2499 |
+
.cmb2-element .ui-corner-all,
|
2500 |
+
.cmb2-element .ui-corner-top,
|
2501 |
+
.cmb2-element .ui-corner-left,
|
2502 |
+
.cmb2-element .ui-corner-tl {
|
2503 |
+
-moz-border-radius-topleft: 4px;
|
2504 |
+
-webkit-border-top-left-radius: 4px;
|
2505 |
+
-khtml-border-top-left-radius: 4px;
|
2506 |
+
border-top-left-radius: 4px;
|
2507 |
+
}
|
2508 |
+
|
2509 |
+
/* line 229, sass/partials/_jquery_ui.scss */
|
2510 |
+
|
2511 |
+
.cmb2-element .ui-corner-all,
|
2512 |
+
.cmb2-element .ui-corner-top,
|
2513 |
+
.cmb2-element .ui-corner-right,
|
2514 |
+
.cmb2-element .ui-corner-tr {
|
2515 |
+
-moz-border-radius-topright: 4px;
|
2516 |
+
-webkit-border-top-right-radius: 4px;
|
2517 |
+
-khtml-border-top-right-radius: 4px;
|
2518 |
+
border-top-right-radius: 4px;
|
2519 |
+
}
|
2520 |
+
|
2521 |
+
/* line 230, sass/partials/_jquery_ui.scss */
|
2522 |
+
|
2523 |
+
.cmb2-element .ui-corner-all,
|
2524 |
+
.cmb2-element .ui-corner-bottom,
|
2525 |
+
.cmb2-element .ui-corner-left,
|
2526 |
+
.cmb2-element .ui-corner-bl {
|
2527 |
+
-moz-border-radius-bottomleft: 4px;
|
2528 |
+
-webkit-border-bottom-left-radius: 4px;
|
2529 |
+
-khtml-border-bottom-left-radius: 4px;
|
2530 |
+
border-bottom-left-radius: 4px;
|
2531 |
+
}
|
2532 |
+
|
2533 |
+
/* line 231, sass/partials/_jquery_ui.scss */
|
2534 |
+
|
2535 |
+
.cmb2-element .ui-corner-all,
|
2536 |
+
.cmb2-element .ui-corner-bottom,
|
2537 |
+
.cmb2-element .ui-corner-right,
|
2538 |
+
.cmb2-element .ui-corner-br {
|
2539 |
+
-moz-border-radius-bottomright: 4px;
|
2540 |
+
-webkit-border-bottom-right-radius: 4px;
|
2541 |
+
-khtml-border-bottom-right-radius: 4px;
|
2542 |
+
border-bottom-right-radius: 4px;
|
2543 |
+
}
|
2544 |
+
|
2545 |
+
/* line 232, sass/partials/_jquery_ui.scss */
|
2546 |
+
|
2547 |
+
.cmb2-element .ui-widget-overlay {
|
2548 |
+
background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
2549 |
+
opacity: .30;
|
2550 |
+
filter: Alpha(Opacity=30);
|
2551 |
+
}
|
2552 |
+
|
2553 |
+
/* line 233, sass/partials/_jquery_ui.scss */
|
2554 |
+
|
2555 |
+
.cmb2-element .ui-widget-shadow {
|
2556 |
+
margin: -8px 0 0 -8px;
|
2557 |
+
padding: 8px;
|
2558 |
+
background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
2559 |
+
opacity: .30;
|
2560 |
+
filter: Alpha(Opacity=30);
|
2561 |
+
-moz-border-radius: 8px;
|
2562 |
+
-khtml-border-radius: 8px;
|
2563 |
+
-webkit-border-radius: 8px;
|
2564 |
+
border-radius: 8px;
|
2565 |
+
}
|
2566 |
+
|
2567 |
+
/* line 234, sass/partials/_jquery_ui.scss */
|
2568 |
+
|
2569 |
+
.cmb2-element .ui-datepicker {
|
2570 |
+
width: 17em;
|
2571 |
+
padding: .2em .2em 0;
|
2572 |
+
display: none;
|
2573 |
+
}
|
2574 |
+
|
2575 |
+
/* line 235, sass/partials/_jquery_ui.scss */
|
2576 |
+
|
2577 |
+
.cmb2-element .ui-datepicker .ui-datepicker-header {
|
2578 |
+
position: relative;
|
2579 |
+
padding: .2em 0;
|
2580 |
+
}
|
2581 |
+
|
2582 |
+
/* line 236, sass/partials/_jquery_ui.scss */
|
2583 |
+
|
2584 |
+
.cmb2-element .ui-datepicker .ui-datepicker-prev,
|
2585 |
+
.cmb2-element .ui-datepicker .ui-datepicker-next {
|
2586 |
+
position: absolute;
|
2587 |
+
top: 2px;
|
2588 |
+
width: 1.8em;
|
2589 |
+
height: 1.8em;
|
2590 |
+
}
|
2591 |
+
|
2592 |
+
/* line 237, sass/partials/_jquery_ui.scss */
|
2593 |
+
|
2594 |
+
.cmb2-element .ui-datepicker .ui-datepicker-prev-hover,
|
2595 |
+
.cmb2-element .ui-datepicker .ui-datepicker-next-hover {
|
2596 |
+
top: 1px;
|
2597 |
+
}
|
2598 |
+
|
2599 |
+
/* line 238, sass/partials/_jquery_ui.scss */
|
2600 |
+
|
2601 |
+
.cmb2-element .ui-datepicker .ui-datepicker-prev {
|
2602 |
+
left: 2px;
|
2603 |
+
}
|
2604 |
+
|
2605 |
+
/* line 239, sass/partials/_jquery_ui.scss */
|
2606 |
+
|
2607 |
+
.cmb2-element .ui-datepicker .ui-datepicker-next {
|
2608 |
+
right: 2px;
|
2609 |
+
}
|
2610 |
+
|
2611 |
+
/* line 240, sass/partials/_jquery_ui.scss */
|
2612 |
+
|
2613 |
+
.cmb2-element .ui-datepicker .ui-datepicker-prev-hover {
|
2614 |
+
left: 1px;
|
2615 |
+
}
|
2616 |
+
|
2617 |
+
/* line 241, sass/partials/_jquery_ui.scss */
|
2618 |
+
|
2619 |
+
.cmb2-element .ui-datepicker .ui-datepicker-next-hover {
|
2620 |
+
right: 1px;
|
2621 |
+
}
|
2622 |
+
|
2623 |
+
/* line 242, sass/partials/_jquery_ui.scss */
|
2624 |
+
|
2625 |
+
.cmb2-element .ui-datepicker .ui-datepicker-prev span,
|
2626 |
+
.cmb2-element .ui-datepicker .ui-datepicker-next span {
|
2627 |
+
display: block;
|
2628 |
+
position: absolute;
|
2629 |
+
left: 50%;
|
2630 |
+
margin-left: -8px;
|
2631 |
+
top: 50%;
|
2632 |
+
margin-top: -8px;
|
2633 |
+
}
|
2634 |
+
|
2635 |
+
/* line 243, sass/partials/_jquery_ui.scss */
|
2636 |
+
|
2637 |
+
.cmb2-element .ui-datepicker .ui-datepicker-title {
|
2638 |
+
margin: 0 2.3em;
|
2639 |
+
line-height: 1.8em;
|
2640 |
+
text-align: center;
|
2641 |
+
}
|
2642 |
+
|
2643 |
+
/* line 244, sass/partials/_jquery_ui.scss */
|
2644 |
+
|
2645 |
+
.cmb2-element .ui-datepicker .ui-datepicker-title select {
|
2646 |
+
font-size: 1em;
|
2647 |
+
margin: 1px 0;
|
2648 |
+
}
|
2649 |
+
|
2650 |
+
/* line 245, sass/partials/_jquery_ui.scss */
|
2651 |
+
|
2652 |
+
.cmb2-element .ui-datepicker select.ui-datepicker-month-year {
|
2653 |
+
width: 100%;
|
2654 |
+
}
|
2655 |
+
|
2656 |
+
/* line 246, sass/partials/_jquery_ui.scss */
|
2657 |
+
|
2658 |
+
.cmb2-element .ui-datepicker select.ui-datepicker-month,
|
2659 |
+
.cmb2-element .ui-datepicker select.ui-datepicker-year {
|
2660 |
+
width: 49%;
|
2661 |
+
}
|
2662 |
+
|
2663 |
+
/* line 248, sass/partials/_jquery_ui.scss */
|
2664 |
+
|
2665 |
+
.cmb2-element .ui-datepicker table {
|
2666 |
+
width: 100%;
|
2667 |
+
font-size: .9em;
|
2668 |
+
border-collapse: collapse;
|
2669 |
+
margin: 0 0 .4em;
|
2670 |
+
}
|
2671 |
+
|
2672 |
+
/* line 249, sass/partials/_jquery_ui.scss */
|
2673 |
+
|
2674 |
+
.cmb2-element .ui-datepicker th {
|
2675 |
+
padding: .7em .3em;
|
2676 |
+
text-align: center;
|
2677 |
+
font-weight: bold;
|
2678 |
+
border: 0;
|
2679 |
+
}
|
2680 |
+
|
2681 |
+
/* line 250, sass/partials/_jquery_ui.scss */
|
2682 |
+
|
2683 |
+
.cmb2-element .ui-datepicker td {
|
2684 |
+
border: 0;
|
2685 |
+
padding: 1px;
|
2686 |
+
}
|
2687 |
+
|
2688 |
+
/* line 251, sass/partials/_jquery_ui.scss */
|
2689 |
+
|
2690 |
+
.cmb2-element .ui-datepicker td span,
|
2691 |
+
.cmb2-element .ui-datepicker td a {
|
2692 |
+
display: block;
|
2693 |
+
padding: .2em;
|
2694 |
+
text-align: right;
|
2695 |
+
text-decoration: none;
|
2696 |
+
}
|
2697 |
+
|
2698 |
+
/* line 252, sass/partials/_jquery_ui.scss */
|
2699 |
+
|
2700 |
+
.cmb2-element .ui-datepicker .ui-datepicker-buttonpane {
|
2701 |
+
background-image: none;
|
2702 |
+
margin: .7em 0 0 0;
|
2703 |
+
padding: 0 .2em;
|
2704 |
+
border-left: 0;
|
2705 |
+
border-right: 0;
|
2706 |
+
border-bottom: 0;
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
/* line 253, sass/partials/_jquery_ui.scss */
|
2710 |
+
|
2711 |
+
.cmb2-element .ui-datepicker .ui-datepicker-buttonpane button {
|
2712 |
+
float: right;
|
2713 |
+
margin: .5em .2em .4em;
|
2714 |
+
cursor: pointer;
|
2715 |
+
padding: .2em .6em .3em .6em;
|
2716 |
+
width: auto;
|
2717 |
+
overflow: visible;
|
2718 |
+
}
|
2719 |
+
|
2720 |
+
/* line 254, sass/partials/_jquery_ui.scss */
|
2721 |
+
|
2722 |
+
.cmb2-element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
2723 |
+
float: left;
|
2724 |
+
}
|
2725 |
+
|
2726 |
+
/* line 255, sass/partials/_jquery_ui.scss */
|
2727 |
+
|
2728 |
+
.cmb2-element .ui-datepicker.ui-datepicker-multi {
|
2729 |
+
width: auto;
|
2730 |
+
}
|
2731 |
+
|
2732 |
+
/* line 256, sass/partials/_jquery_ui.scss */
|
2733 |
+
|
2734 |
+
.cmb2-element .ui-datepicker-multi .ui-datepicker-group {
|
2735 |
+
float: left;
|
2736 |
+
}
|
2737 |
+
|
2738 |
+
/* line 257, sass/partials/_jquery_ui.scss */
|
2739 |
+
|
2740 |
+
.cmb2-element .ui-datepicker-multi .ui-datepicker-group table {
|
2741 |
+
width: 95%;
|
2742 |
+
margin: 0 auto .4em;
|
2743 |
+
}
|
2744 |
+
|
2745 |
+
/* line 258, sass/partials/_jquery_ui.scss */
|
2746 |
+
|
2747 |
+
.cmb2-element .ui-datepicker-multi-2 .ui-datepicker-group {
|
2748 |
+
width: 50%;
|
2749 |
+
}
|
2750 |
+
|
2751 |
+
/* line 259, sass/partials/_jquery_ui.scss */
|
2752 |
+
|
2753 |
+
.cmb2-element .ui-datepicker-multi-3 .ui-datepicker-group {
|
2754 |
+
width: 33.3%;
|
2755 |
+
}
|
2756 |
+
|
2757 |
+
/* line 260, sass/partials/_jquery_ui.scss */
|
2758 |
+
|
2759 |
+
.cmb2-element .ui-datepicker-multi-4 .ui-datepicker-group {
|
2760 |
+
width: 25%;
|
2761 |
+
}
|
2762 |
+
|
2763 |
+
/* line 261, sass/partials/_jquery_ui.scss */
|
2764 |
+
|
2765 |
+
.cmb2-element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
|
2766 |
+
border-left-width: 0;
|
2767 |
+
}
|
2768 |
+
|
2769 |
+
/* line 262, sass/partials/_jquery_ui.scss */
|
2770 |
+
|
2771 |
+
.cmb2-element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
2772 |
+
border-left-width: 0;
|
2773 |
+
}
|
2774 |
+
|
2775 |
+
/* line 263, sass/partials/_jquery_ui.scss */
|
2776 |
+
|
2777 |
+
.cmb2-element .ui-datepicker-multi .ui-datepicker-buttonpane {
|
2778 |
+
clear: left;
|
2779 |
+
}
|
2780 |
+
|
2781 |
+
/* line 264, sass/partials/_jquery_ui.scss */
|
2782 |
+
|
2783 |
+
.cmb2-element .ui-datepicker-row-break {
|
2784 |
+
clear: both;
|
2785 |
+
width: 100%;
|
2786 |
+
font-size: 0em;
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
/* line 265, sass/partials/_jquery_ui.scss */
|
2790 |
+
|
2791 |
+
.cmb2-element .ui-datepicker-rtl {
|
2792 |
+
direction: rtl;
|
2793 |
+
}
|
2794 |
+
|
2795 |
+
/* line 267, sass/partials/_jquery_ui.scss */
|
2796 |
+
|
2797 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-prev {
|
2798 |
+
right: 2px;
|
2799 |
+
left: auto;
|
2800 |
+
}
|
2801 |
+
|
2802 |
+
/* line 268, sass/partials/_jquery_ui.scss */
|
2803 |
+
|
2804 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-next {
|
2805 |
+
left: 2px;
|
2806 |
+
right: auto;
|
2807 |
+
}
|
2808 |
+
|
2809 |
+
/* line 269, sass/partials/_jquery_ui.scss */
|
2810 |
+
|
2811 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-prev:hover {
|
2812 |
+
right: 1px;
|
2813 |
+
left: auto;
|
2814 |
+
}
|
2815 |
+
|
2816 |
+
/* line 270, sass/partials/_jquery_ui.scss */
|
2817 |
+
|
2818 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-next:hover {
|
2819 |
+
left: 1px;
|
2820 |
+
right: auto;
|
2821 |
+
}
|
2822 |
+
|
2823 |
+
/* line 271, sass/partials/_jquery_ui.scss */
|
2824 |
+
|
2825 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane {
|
2826 |
+
clear: right;
|
2827 |
+
}
|
2828 |
+
|
2829 |
+
/* line 272, sass/partials/_jquery_ui.scss */
|
2830 |
+
|
2831 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
2832 |
+
float: left;
|
2833 |
+
}
|
2834 |
+
|
2835 |
+
/* line 273, sass/partials/_jquery_ui.scss */
|
2836 |
+
|
2837 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
|
2838 |
+
float: right;
|
2839 |
+
}
|
2840 |
+
|
2841 |
+
/* line 274, sass/partials/_jquery_ui.scss */
|
2842 |
+
|
2843 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-group {
|
2844 |
+
float: right;
|
2845 |
+
}
|
2846 |
+
|
2847 |
+
/* line 275, sass/partials/_jquery_ui.scss */
|
2848 |
+
|
2849 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
|
2850 |
+
border-right-width: 0;
|
2851 |
+
border-left-width: 1px;
|
2852 |
+
}
|
2853 |
+
|
2854 |
+
/* line 276, sass/partials/_jquery_ui.scss */
|
2855 |
+
|
2856 |
+
.cmb2-element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
2857 |
+
border-right-width: 0;
|
2858 |
+
border-left-width: 1px;
|
2859 |
+
}
|
2860 |
+
|
2861 |
+
/* line 278, sass/partials/_jquery_ui.scss */
|
2862 |
+
|
2863 |
+
.cmb2-element .ui-datepicker-cover {
|
2864 |
+
display: none; /*sorry for IE5*/
|
2865 |
+
display/**/: block; /*sorry for IE5*/
|
2866 |
+
position: absolute; /*must have*/
|
2867 |
+
z-index: -1; /*must have*/
|
2868 |
+
filter: mask(); /*must have*/
|
2869 |
+
top: -4px; /*must have*/
|
2870 |
+
left: -4px; /*must have*/
|
2871 |
+
width: 200px; /*must have*/
|
2872 |
+
height: 200px; /*must have*/
|
2873 |
+
}
|
2874 |
+
|
2875 |
+
/*# sourceMappingURL=cmb2.css.map */
|
2876 |
+
|
2877 |
+
@media (max-width: 450px) {
|
2878 |
+
|
2879 |
+
/* line 209, sass/partials/_main_wrap.scss */
|
2880 |
+
|
2881 |
+
.cmb-th {
|
2882 |
+
font-size: 1.2em;
|
2883 |
+
display: block;
|
2884 |
+
float: none;
|
2885 |
+
padding-bottom: 1em;
|
2886 |
+
text-align: left;
|
2887 |
+
width: 100%;
|
2888 |
+
}
|
2889 |
+
|
2890 |
+
/* line 27, sass/partials/_mixins.scss */
|
2891 |
+
|
2892 |
+
.cmb-th label {
|
2893 |
+
display: block;
|
2894 |
+
margin-top: 0em;
|
2895 |
+
padding-bottom: 5px;
|
2896 |
+
}
|
2897 |
+
|
2898 |
+
/* line 32, sass/partials/_mixins.scss */
|
2899 |
+
|
2900 |
+
.cmb-th label:after {
|
2901 |
+
border-bottom: 1px solid #e9e9e9;
|
2902 |
+
content: '';
|
2903 |
+
clear: both;
|
2904 |
+
display: block;
|
2905 |
+
padding-top: .4em;
|
2906 |
+
}
|
2907 |
+
|
2908 |
+
/* line 431, sass/partials/_main_wrap.scss */
|
2909 |
+
|
2910 |
+
.cmb-th,
|
2911 |
+
.cmb-td,
|
2912 |
+
.cmb-th + .cmb-td {
|
2913 |
+
display: block;
|
2914 |
+
float: none;
|
2915 |
+
width: 100%;
|
2916 |
+
}
|
2917 |
+
|
2918 |
+
/* line 70, sass/partials/_post_metaboxes.scss */
|
2919 |
+
|
2920 |
+
.postbox-container .cmb-row:not(:last-of-type),
|
2921 |
+
.postbox-container .cmb-repeatable-group:not(:last-of-type),
|
2922 |
+
.cmb-repeat-group-wrap .cmb-row:not(:last-of-type),
|
2923 |
+
.cmb-repeat-group-wrap .cmb-repeatable-group:not(:last-of-type) {
|
2924 |
+
border-bottom: 0;
|
2925 |
+
}
|
2926 |
+
|
2927 |
+
}
|
2928 |
+
|
cmb2/css/cmb2.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": ";;;;;;;AAIA,UAAW;EACV,MAAM,EAAE,CAAC;;;AAET;mBACS;EACR,SAAS,ECEK,IAAI;EDDlB,SAAS,EAAE,IAAI;EACf,OAAO,EAAE,GAAG;;;AAMZ,uCAAc;EACb,KAAK,EAAE,IAA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["sass/partials/_main_wrap.scss","sass/partials/_variables.scss","sass/partials/_mixins.scss","sass/partials/_timepicker.scss","sass/partials/_post_metaboxes.scss","sass/partials/_misc.scss","sass/partials/_sidebar_placements.scss","sass/partials/_collapsible_ui.scss","sass/partials/_jquery_ui.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "cmb2.css"
|
7 |
+
}
|
cmb2/css/cmb2.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cmb2-wrap{margin:0}.cmb2-wrap input,.cmb2-wrap textarea{font-size:14px;max-width:100%;padding:5px}.cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb2-wrap textarea{width:500px}.cmb2-wrap textarea.cmb2-textarea-code{font-family:"Courier 10 Pitch",Courier,monospace;line-height:16px}.cmb2-wrap input.cmb2-text-small,.cmb2-wrap input.cmb2-timepicker{width:100px}.cmb2-wrap input.cmb2-text-money{width:90px}.cmb2-wrap input.cmb2-text-medium{width:230px}.cmb2-wrap input.cmb2-upload-file{width:65%}.cmb2-wrap input.ed_button{padding:2px 4px}.cmb2-wrap input:not([type=hidden])+.button,.cmb2-wrap input:not([type=hidden])+input,.cmb2-wrap input:not([type=hidden])+select{margin-left:20px}.cmb2-wrap ul{margin:0}.cmb2-wrap li{font-size:14px;line-height:16px;margin:1px 0 5px}.cmb2-wrap select{font-size:14px;margin-top:3px}.cmb2-wrap input:focus,.cmb2-wrap textarea:focus{background:#fffff8}.cmb2-wrap input[type=checkbox],.cmb2-wrap input[type=radio]{margin:0 5px 0 0;padding:0}.cmb2-wrap .button,.cmb2-wrap button{white-space:nowrap}.cmb2-wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2-wrap .mceIframeContainer{background:#fff}.cmb2-wrap .meta_mce{width:97%}.cmb2-wrap .meta_mce textarea{width:100%}.cmb2-wrap .wp-color-result,.cmb2-wrap .wp-picker-input-wrap{vertical-align:middle}.cmb2-wrap .wp-color-result,.cmb2-wrap .wp-picker-container{margin:0 10px 0 0}.cmb2-wrap .cmb-row{margin:0}.cmb2-wrap .cmb-row:after{content:'';clear:both;display:block;width:100%}.cmb2-wrap .cmb-row.cmb-repeat-row{padding:1.8em 0 0}.cmb2-wrap .cmb-row.cmb-repeat-row:first-of-type{padding:0}.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description{padding-top:0;padding-bottom:1.8em}.cmb2-metabox{clear:both;margin:0}.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th,.cmb2-metabox>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb2-metabox>.cmb-row .cmb-repeat-table .cmb-row>.cmb-td{padding-right:20px;box-sizing:border-box;float:left}.cmb-add-row{margin:1.8em 0 0}.cmb-nested .cmb-td,.cmb-repeatable-group .cmb-th,.cmb-repeatable-group:first-of-type{border:0}.cmb-repeatable-group:last-of-type,.cmb-row:last-of-type,.cmb2-wrap .cmb-row:last-of-type{border-bottom:0}.cmb-repeatable-grouping{border:1px solid #e9e9e9;padding:0 1em;max-width:1000px}.cmb-repeatable-grouping.cmb-row{margin:0 0 .8em}.cmb-th{color:#222;float:left;font-weight:600;line-height:1.3;padding:20px 10px 20px 0;vertical-align:top;width:200px}.cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb-type-title .cmb-td{padding:0}.cmb-th label{display:block;padding:5px 0}.cmb-th+.cmb-td{float:left}.cmb-td .cmb-td{padding-bottom:1em}.cmb-remove-row{text-align:right}.empty-row.hidden{display:none}.cmb-repeatable-group .cmb-th{padding:5px}.cmb-repeatable-group .cmb-group-title{background-color:#e9e9e9;padding:8px 12px 8px 2.2em;margin:0 -1em;min-height:1.5em;font-size:14px;line-height:1.4}.cmb-repeatable-group .cmb-group-title h4{border:0;margin:0;font-size:1.2em;font-weight:500;padding:.5em .75em}.cmb-repeatable-group .cmb-group-title .cmb-th{display:block;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:left;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;padding-bottom:5px}.cmb-repeatable-group .cmb-group-description .cmb-th label:after{border-bottom:1px solid #e9e9e9;content:'';clear:both;display:block;padding-top:.4em}.cmb-repeatable-group .cmb-shift-rows{font-size:1em;margin-right:1em;text-decoration:none}.cmb-repeatable-group .cmb-shift-rows .dashicons{font-size:1.5em;height:1.5em;line-height:1.2em;width:1em}.cmb-repeatable-group .cmb-shift-rows .dashicons.dashicons-arrow-down-alt2{line-height:1.3em}.cmb-repeatable-group .cmb2-upload-button{float:right}p.cmb2-metabox-description{color:#aaa;font-style:italic;margin:0;padding-top:.5em}span.cmb2-metabox-description{color:#aaa;font-style:italic}.cmb2-metabox-title{margin:0 0 5px;padding:5px 0 0;font-size:14px}.cmb-inline ul{padding:4px 0 0}.cmb-inline li{display:inline-block;padding-right:18px}.cmb-type-textarea-code pre{margin:0}.cmb2-media-status .img-status{clear:none;display:inline-block;float:left;margin-right:10px;width:auto}.cmb2-media-status .img-status img{max-width:350px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status img{background:#fff;border:1px solid #e9e9e9;border-radius:2px;-moz-border-radius:2px;margin:15px 0 0;padding:5px}.cmb2-media-status .embed-status{float:left;max-width:800px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status{position:relative}.cmb2-media-status .embed-status .cmb2-remove-file-button,.cmb2-media-status .img-status .cmb2-remove-file-button{background:url(../images/ico-delete.png);height:16px;left:-5px;position:absolute;text-indent:-9999px;top:-5px;width:16px}.cmb2-media-status .img-status .cmb2-remove-file-button{top:10px}.cmb2-media-status .file-status>span,.cmb2-media-status .img-status img{cursor:pointer}.cmb-type-file-list .cmb2-media-status .img-status{clear:none;float:left;margin-right:10px;width:auto}.cmb-attach-list li{clear:both;display:inline-block;margin-bottom:25px;width:100%}.cmb-attach-list li img{cursor:move;float:left;margin-right:10px}.cmb2-remove-wrapper{margin:0}.child-cmb2 .cmb-th{text-align:left}div.time-picker{background:#fff;border:1px solid #aaa;height:191px;margin:0;position:absolute;overflow:auto;width:6em;z-index:99}div.time-picker ul{list-style-type:none;margin:0;padding:0}div.time-picker li{cursor:pointer;margin-bottom:0;font-family:sans-serif;font-size:14px;padding:4px 3px}div.time-picker li.selected{background:#0063ce;color:#fff}div.time-picker-12hours{width:8em}#poststuff .cmb-group-title{margin-left:-1em;margin-right:-1em;padding-left:2.2em;min-height:1.5em}.cmb-repeat-group-wrap .cmb2-wrap,.postbox-container .cmb2-wrap{margin:0}.cmb-repeat-group-wrap .cmb2-wrap>.cmb-field-list>.cmb-row,.postbox-container .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.8em 0}.cmb-repeat-group-wrap .cmb2-wrap input[type=text].cmb2-oembed,.postbox-container .cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb-repeat-group-wrap .cmb-row,.postbox-container .cmb-row{padding:0 0 1.8em;margin:0 0 .8em}.cmb-repeat-group-wrap .cmb-row .cmbhandle,.postbox-container .cmb-row .cmbhandle{right:-1em;position:relative}.cmb-repeat-group-wrap .cmb-repeatable-grouping,.postbox-container .cmb-repeatable-grouping{padding:0 1em;max-width:100%;min-width:1px!important}.cmb-repeat-group-wrap .cmb-repeatable-group>.cmb-row,.postbox-container .cmb-repeatable-group>.cmb-row{padding-bottom:0}.cmb-repeat-group-wrap .cmb-th,.postbox-container .cmb-th{width:18%;padding:0 2% 0 0}.cmb-repeat-group-wrap .cmb-td,.postbox-container .cmb-td{margin-bottom:0;padding:0;line-height:1.3}.cmb-repeat-group-wrap .cmb-repeat-row .cmb-td,.postbox-container .cmb-repeat-row .cmb-td{padding-bottom:1.8em}.cmb-repeat-group-wrap .cmb-th+.cmb-td,.postbox-container .cmb-th+.cmb-td{width:80%;float:right}.cmb-repeat-group-wrap .cmb-repeatable-group:not(:last-of-type),.cmb-repeat-group-wrap .cmb-row:not(:last-of-type),.postbox-container .cmb-repeatable-group:not(:last-of-type),.postbox-container .cmb-row:not(:last-of-type){border-bottom:1px solid #e9e9e9}.cmb-repeat-group-wrap .cmb-remove-field-row,.cmb-repeat-group-wrap .cmb-repeat-group-field,.postbox-container .cmb-remove-field-row,.postbox-container .cmb-repeat-group-field{padding-top:1.8em}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody,.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody,.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody,.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody{display:table;width:100%}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text,.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody input.regular-text{width:100%}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row),.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(.hidden):not(.empty-row){display:table-row}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td,.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td{display:table-cell;float:none;width:100%}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td,.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-row:not(:first-of-type) .cmb-td{padding-top:1.8em}.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,.cmb-repeat-group-wrap .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,.postbox-container .cmb2-metabox>.cmb-row .cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row,.postbox-container .cmb2-metabox>.cmb-row.table-layout .cmb-repeat-table .cmb-tbody .cmb-td.cmb-remove-row{padding-right:0}#poststuff .cmb-repeatable-group h2{margin:0}.edit-tags-php .cmb2-metabox-title,.profile-php .cmb2-metabox-title,.user-edit-php .cmb2-metabox-title{font-size:1.4em}.postbox .cmb-spinner{float:left}#side-sortables .cmb2-wrap>.cmb-field-list>.cmb-row,.inner-sidebar .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.4em 0}#side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker),.inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker){width:100%}#side-sortables .cmb2-wrap input+input:not(.wp-picker-clear),#side-sortables .cmb2-wrap input+select,.inner-sidebar .cmb2-wrap input+input:not(.wp-picker-clear),.inner-sidebar .cmb2-wrap input+select{margin-left:0;margin-top:1em;display:block}#side-sortables .cmb2-wrap label,.inner-sidebar .cmb2-wrap label{display:block;font-weight:700;padding:0 0 5px}#side-sortables .cmb-repeatable-group,.inner-sidebar .cmb-repeatable-group{border-bottom:1px solid #e9e9e9}#side-sortables .cmb-repeat-group-wrap>.cmb-td>.cmb-repeatable-group,.inner-sidebar .cmb-repeat-group-wrap>.cmb-td>.cmb-repeatable-group{border-bottom:0;margin-bottom:-1.4em}#side-sortables .cmb-td,#side-sortables .cmb-th,#side-sortables .cmb-th+.cmb-td,.inner-sidebar .cmb-td,.inner-sidebar .cmb-th,.inner-sidebar .cmb-th+.cmb-td{width:100%;display:block;float:none}#side-sortables .closed .inside,.inner-sidebar .closed .inside{display:none}#side-sortables .cmb-td .cmb-td,.inner-sidebar .cmb-td .cmb-td{padding-bottom:1em}#side-sortables .cmb-th,.inner-sidebar .cmb-th{display:block;float:none;padding-bottom:1em;text-align:left;width:100%;padding-left:0;padding-right:0}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{display:block;margin-top:0;padding-bottom:5px}#side-sortables .cmb-th label:after,.inner-sidebar .cmb-th label:after{border-bottom:1px solid #e9e9e9;content:'';clear:both;display:block;padding-top:.4em}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{font-size:14px;line-height:1.4em}#side-sortables .cmb-group-description .cmb-th,.inner-sidebar .cmb-group-description .cmb-th{padding-top:0}#side-sortables .cmb-group-description .cmb2-metabox-description,#side-sortables .cmb-group-title .cmb-th,.inner-sidebar .cmb-group-description .cmb2-metabox-description,.inner-sidebar .cmb-group-title .cmb-th{padding:0}#side-sortables .cmb-repeatable-grouping+.cmb-repeatable-grouping,.inner-sidebar .cmb-repeatable-grouping+.cmb-repeatable-grouping{margin-top:1em}#side-sortables .cmb2-media-status .embed-status img,#side-sortables .cmb2-media-status .img-status img,.inner-sidebar .cmb2-media-status .embed-status img,.inner-sidebar .cmb2-media-status .img-status img{max-width:90%;height:auto}#side-sortables .cmb2-list label,.inner-sidebar .cmb2-list label{display:inline;font-weight:400}#side-sortables .cmb2-metabox-description,.inner-sidebar .cmb2-metabox-description{display:block;padding:7px 0 0}#side-sortables .cmb-type-checkbox .cmb-td label,#side-sortables .cmb-type-checkbox .cmb2-metabox-description,.inner-sidebar .cmb-type-checkbox .cmb-td label,.inner-sidebar .cmb-type-checkbox .cmb2-metabox-description{font-weight:400;display:inline}#side-sortables .cmb-row .cmb2-metabox-description,.inner-sidebar .cmb-row .cmb2-metabox-description{padding-bottom:1.8em}#side-sortables .cmb2-metabox-title,.inner-sidebar .cmb2-metabox-title{font-size:1.2em;font-style:italic}#side-sortables .cmb-remove-row,.inner-sidebar .cmb-remove-row{clear:both;padding-top:12px;padding-bottom:0}#side-sortables .cmb-type-colorpicker .cmb-repeat-row .cmb-td,.inner-sidebar .cmb-type-colorpicker .cmb-repeat-row .cmb-td{width:auto;clear:none;float:left;padding-top:0}#side-sortables .cmb-type-colorpicker .cmb-repeat-row .cmb-td.cmb-remove-row,.inner-sidebar .cmb-type-colorpicker .cmb-repeat-row .cmb-td.cmb-remove-row{float:right;margin:0}#side-sortables .cmb2-upload-button,.inner-sidebar .cmb2-upload-button{clear:both;margin-top:12px}.cmb2-metabox .cmb-repeat-group-wrap{max-width:1000px}.cmb2-metabox .cmbhandle{color:#aaa;float:right;width:27px;height:30px;cursor:pointer;right:-1em;position:relative}.cmb2-metabox .cmbhandle:before{content:'\f142';right:12px;font:400 20px/1 dashicons;speak:none;display:inline-block;padding:8px 10px;top:0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.cmb2-metabox .postbox.closed .cmbhandle:before{content:'\f140'}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row{-webkit-appearance:none!important;background:none!important;border:none!important;position:absolute;left:0;top:.5em;line-height:1em;cursor:pointer}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]){color:#a00}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover{color:red}.cmb2-element .ui-helper-hidden{display:none}.cmb2-element .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.cmb2-element .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.cmb2-element .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.cmb2-element * html .ui-helper-clearfix{height:1%}.cmb2-element .ui-helper-clearfix{display:block}.cmb2-element .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.cmb2-element .ui-state-disabled{cursor:default!important}.cmb2-element .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.cmb2-element .ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.cmb2-element .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.cmb2-element .ui-widget .ui-widget{font-size:1em}.cmb2-element .ui-widget button,.cmb2-element .ui-widget input,.cmb2-element .ui-widget select,.cmb2-element .ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.cmb2-element .ui-widget-content{border:1px solid #aaa;background:#fff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.cmb2-element .ui-widget-content a{color:#222}.cmb2-element .ui-widget-header{border:1px solid #aaa;background:#ccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.cmb2-element .ui-widget-header a{color:#222}.cmb2-element .ui-state-default,.cmb2-element .ui-widget-content .ui-state-default,.cmb2-element .ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.cmb2-element .ui-state-default a,.cmb2-element .ui-state-default a:link,.cmb2-element .ui-state-default a:visited{color:#555;text-decoration:none}.cmb2-element .ui-state-focus,.cmb2-element .ui-state-hover,.cmb2-element .ui-widget-content .ui-state-focus,.cmb2-element .ui-widget-content .ui-state-hover,.cmb2-element .ui-widget-header .ui-state-focus,.cmb2-element .ui-widget-header .ui-state-hover{border:1px solid #999;background:#dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.cmb2-element .ui-state-hover a,.cmb2-element .ui-state-hover a:hover{color:#212121;text-decoration:none}.cmb2-element .ui-state-active,.cmb2-element .ui-widget-content .ui-state-active,.cmb2-element .ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.cmb2-element .ui-state-active a,.cmb2-element .ui-state-active a:link,.cmb2-element .ui-state-active a:visited{color:#212121;text-decoration:none}.cmb2-element .ui-widget :active{outline:0}.cmb2-element .ui-state-highlight,.cmb2-element .ui-widget-content .ui-state-highlight,.cmb2-element .ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.cmb2-element .ui-state-highlight a,.cmb2-element .ui-widget-content .ui-state-highlight a,.cmb2-element .ui-widget-header .ui-state-highlight a{color:#363636}.cmb2-element .ui-state-error,.cmb2-element .ui-widget-content .ui-state-error,.cmb2-element .ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.cmb2-element .ui-state-error a,.cmb2-element .ui-state-error-text,.cmb2-element .ui-widget-content .ui-state-error a,.cmb2-element .ui-widget-content .ui-state-error-text,.cmb2-element .ui-widget-header .ui-state-error a,.cmb2-element .ui-widget-header .ui-state-error-text{color:#cd0a0a}.cmb2-element .ui-priority-primary,.cmb2-element .ui-widget-content .ui-priority-primary,.cmb2-element .ui-widget-header .ui-priority-primary{font-weight:700}.cmb2-element .ui-priority-secondary,.cmb2-element .ui-widget-content .ui-priority-secondary,.cmb2-element .ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.cmb2-element .ui-state-disabled,.cmb2-element .ui-widget-content .ui-state-disabled,.cmb2-element .ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.cmb2-element .ui-icon{width:16px;height:16px;background-image:url(../images/ui-icons_222222_256x240.png)}.cmb2-element .ui-widget-content .ui-icon,.cmb2-element .ui-widget-header .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}.cmb2-element .ui-state-default .ui-icon{background-image:url(../images/ui-icons_888888_256x240.png)}.cmb2-element .ui-state-active .ui-icon,.cmb2-element .ui-state-focus .ui-icon,.cmb2-element .ui-state-hover .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}.cmb2-element .ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_2e83ff_256x240.png)}.cmb2-element .ui-state-error .ui-icon,.cmb2-element .ui-state-error-text .ui-icon{background-image:url(../images/ui-icons_cd0a0a_256x240.png)}.cmb2-element .ui-icon-carat-1-n{background-position:0 0}.cmb2-element .ui-icon-carat-1-ne{background-position:-16px 0}.cmb2-element .ui-icon-carat-1-e{background-position:-32px 0}.cmb2-element .ui-icon-carat-1-se{background-position:-48px 0}.cmb2-element .ui-icon-carat-1-s{background-position:-64px 0}.cmb2-element .ui-icon-carat-1-sw{background-position:-80px 0}.cmb2-element .ui-icon-carat-1-w{background-position:-96px 0}.cmb2-element .ui-icon-carat-1-nw{background-position:-112px 0}.cmb2-element .ui-icon-carat-2-n-s{background-position:-128px 0}.cmb2-element .ui-icon-carat-2-e-w{background-position:-144px 0}.cmb2-element .ui-icon-triangle-1-n{background-position:0 -16px}.cmb2-element .ui-icon-triangle-1-ne{background-position:-16px -16px}.cmb2-element .ui-icon-triangle-1-e{background-position:-32px -16px}.cmb2-element .ui-icon-triangle-1-se{background-position:-48px -16px}.cmb2-element .ui-icon-triangle-1-s{background-position:-64px -16px}.cmb2-element .ui-icon-triangle-1-sw{background-position:-80px -16px}.cmb2-element .ui-icon-triangle-1-w{background-position:-96px -16px}.cmb2-element .ui-icon-triangle-1-nw{background-position:-112px -16px}.cmb2-element .ui-icon-triangle-2-n-s{background-position:-128px -16px}.cmb2-element .ui-icon-triangle-2-e-w{background-position:-144px -16px}.cmb2-element .ui-icon-arrow-1-n{background-position:0 -32px}.cmb2-element .ui-icon-arrow-1-ne{background-position:-16px -32px}.cmb2-element .ui-icon-arrow-1-e{background-position:-32px -32px}.cmb2-element .ui-icon-arrow-1-se{background-position:-48px -32px}.cmb2-element .ui-icon-arrow-1-s{background-position:-64px -32px}.cmb2-element .ui-icon-arrow-1-sw{background-position:-80px -32px}.cmb2-element .ui-icon-arrow-1-w{background-position:-96px -32px}.cmb2-element .ui-icon-arrow-1-nw{background-position:-112px -32px}.cmb2-element .ui-icon-arrow-2-n-s{background-position:-128px -32px}.cmb2-element .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.cmb2-element .ui-icon-arrow-2-e-w{background-position:-160px -32px}.cmb2-element .ui-icon-arrow-2-se-nw{background-position:-176px -32px}.cmb2-element .ui-icon-arrowstop-1-n{background-position:-192px -32px}.cmb2-element .ui-icon-arrowstop-1-e{background-position:-208px -32px}.cmb2-element .ui-icon-arrowstop-1-s{background-position:-224px -32px}.cmb2-element .ui-icon-arrowstop-1-w{background-position:-240px -32px}.cmb2-element .ui-icon-arrowthick-1-n{background-position:0 -48px}.cmb2-element .ui-icon-arrowthick-1-ne{background-position:-16px -48px}.cmb2-element .ui-icon-arrowthick-1-e{background-position:-32px -48px}.cmb2-element .ui-icon-arrowthick-1-se{background-position:-48px -48px}.cmb2-element .ui-icon-arrowthick-1-s{background-position:-64px -48px}.cmb2-element .ui-icon-arrowthick-1-sw{background-position:-80px -48px}.cmb2-element .ui-icon-arrowthick-1-w{background-position:-96px -48px}.cmb2-element .ui-icon-arrowthick-1-nw{background-position:-112px -48px}.cmb2-element .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.cmb2-element .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.cmb2-element .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.cmb2-element .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.cmb2-element .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.cmb2-element .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.cmb2-element .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.cmb2-element .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.cmb2-element .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.cmb2-element .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.cmb2-element .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.cmb2-element .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.cmb2-element .ui-icon-arrowreturn-1-w{background-position:-64px -64px}.cmb2-element .ui-icon-arrowreturn-1-n{background-position:-80px -64px}.cmb2-element .ui-icon-arrowreturn-1-e{background-position:-96px -64px}.cmb2-element .ui-icon-arrowreturn-1-s{background-position:-112px -64px}.cmb2-element .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.cmb2-element .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.cmb2-element .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.cmb2-element .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.cmb2-element .ui-icon-arrow-4{background-position:0 -80px}.cmb2-element .ui-icon-arrow-4-diag{background-position:-16px -80px}.cmb2-element .ui-icon-extlink{background-position:-32px -80px}.cmb2-element .ui-icon-newwin{background-position:-48px -80px}.cmb2-element .ui-icon-refresh{background-position:-64px -80px}.cmb2-element .ui-icon-shuffle{background-position:-80px -80px}.cmb2-element .ui-icon-transfer-e-w{background-position:-96px -80px}.cmb2-element .ui-icon-transferthick-e-w{background-position:-112px -80px}.cmb2-element .ui-icon-folder-collapsed{background-position:0 -96px}.cmb2-element .ui-icon-folder-open{background-position:-16px -96px}.cmb2-element .ui-icon-document{background-position:-32px -96px}.cmb2-element .ui-icon-document-b{background-position:-48px -96px}.cmb2-element .ui-icon-note{background-position:-64px -96px}.cmb2-element .ui-icon-mail-closed{background-position:-80px -96px}.cmb2-element .ui-icon-mail-open{background-position:-96px -96px}.cmb2-element .ui-icon-suitcase{background-position:-112px -96px}.cmb2-element .ui-icon-comment{background-position:-128px -96px}.cmb2-element .ui-icon-person{background-position:-144px -96px}.cmb2-element .ui-icon-print{background-position:-160px -96px}.cmb2-element .ui-icon-trash{background-position:-176px -96px}.cmb2-element .ui-icon-locked{background-position:-192px -96px}.cmb2-element .ui-icon-unlocked{background-position:-208px -96px}.cmb2-element .ui-icon-bookmark{background-position:-224px -96px}.cmb2-element .ui-icon-tag{background-position:-240px -96px}.cmb2-element .ui-icon-home{background-position:0 -112px}.cmb2-element .ui-icon-flag{background-position:-16px -112px}.cmb2-element .ui-icon-calendar{background-position:-32px -112px}.cmb2-element .ui-icon-cart{background-position:-48px -112px}.cmb2-element .ui-icon-pencil{background-position:-64px -112px}.cmb2-element .ui-icon-clock{background-position:-80px -112px}.cmb2-element .ui-icon-disk{background-position:-96px -112px}.cmb2-element .ui-icon-calculator{background-position:-112px -112px}.cmb2-element .ui-icon-zoomin{background-position:-128px -112px}.cmb2-element .ui-icon-zoomout{background-position:-144px -112px}.cmb2-element .ui-icon-search{background-position:-160px -112px}.cmb2-element .ui-icon-wrench{background-position:-176px -112px}.cmb2-element .ui-icon-gear{background-position:-192px -112px}.cmb2-element .ui-icon-heart{background-position:-208px -112px}.cmb2-element .ui-icon-star{background-position:-224px -112px}.cmb2-element .ui-icon-link{background-position:-240px -112px}.cmb2-element .ui-icon-cancel{background-position:0 -128px}.cmb2-element .ui-icon-plus{background-position:-16px -128px}.cmb2-element .ui-icon-plusthick{background-position:-32px -128px}.cmb2-element .ui-icon-minus{background-position:-48px -128px}.cmb2-element .ui-icon-minusthick{background-position:-64px -128px}.cmb2-element .ui-icon-close{background-position:-80px -128px}.cmb2-element .ui-icon-closethick{background-position:-96px -128px}.cmb2-element .ui-icon-key{background-position:-112px -128px}.cmb2-element .ui-icon-lightbulb{background-position:-128px -128px}.cmb2-element .ui-icon-scissors{background-position:-144px -128px}.cmb2-element .ui-icon-clipboard{background-position:-160px -128px}.cmb2-element .ui-icon-copy{background-position:-176px -128px}.cmb2-element .ui-icon-contact{background-position:-192px -128px}.cmb2-element .ui-icon-image{background-position:-208px -128px}.cmb2-element .ui-icon-video{background-position:-224px -128px}.cmb2-element .ui-icon-script{background-position:-240px -128px}.cmb2-element .ui-icon-alert{background-position:0 -144px}.cmb2-element .ui-icon-info{background-position:-16px -144px}.cmb2-element .ui-icon-notice{background-position:-32px -144px}.cmb2-element .ui-icon-help{background-position:-48px -144px}.cmb2-element .ui-icon-check{background-position:-64px -144px}.cmb2-element .ui-icon-bullet{background-position:-80px -144px}.cmb2-element .ui-icon-radio-off{background-position:-96px -144px}.cmb2-element .ui-icon-radio-on{background-position:-112px -144px}.cmb2-element .ui-icon-pin-w{background-position:-128px -144px}.cmb2-element .ui-icon-pin-s{background-position:-144px -144px}.cmb2-element .ui-icon-play{background-position:0 -160px}.cmb2-element .ui-icon-pause{background-position:-16px -160px}.cmb2-element .ui-icon-seek-next{background-position:-32px -160px}.cmb2-element .ui-icon-seek-prev{background-position:-48px -160px}.cmb2-element .ui-icon-seek-end{background-position:-64px -160px}.cmb2-element .ui-icon-seek-first,.cmb2-element .ui-icon-seek-start{background-position:-80px -160px}.cmb2-element .ui-icon-stop{background-position:-96px -160px}.cmb2-element .ui-icon-eject{background-position:-112px -160px}.cmb2-element .ui-icon-volume-off{background-position:-128px -160px}.cmb2-element .ui-icon-volume-on{background-position:-144px -160px}.cmb2-element .ui-icon-power{background-position:0 -176px}.cmb2-element .ui-icon-signal-diag{background-position:-16px -176px}.cmb2-element .ui-icon-signal{background-position:-32px -176px}.cmb2-element .ui-icon-battery-0{background-position:-48px -176px}.cmb2-element .ui-icon-battery-1{background-position:-64px -176px}.cmb2-element .ui-icon-battery-2{background-position:-80px -176px}.cmb2-element .ui-icon-battery-3{background-position:-96px -176px}.cmb2-element .ui-icon-circle-plus{background-position:0 -192px}.cmb2-element .ui-icon-circle-minus{background-position:-16px -192px}.cmb2-element .ui-icon-circle-close{background-position:-32px -192px}.cmb2-element .ui-icon-circle-triangle-e{background-position:-48px -192px}.cmb2-element .ui-icon-circle-triangle-s{background-position:-64px -192px}.cmb2-element .ui-icon-circle-triangle-w{background-position:-80px -192px}.cmb2-element .ui-icon-circle-triangle-n{background-position:-96px -192px}.cmb2-element .ui-icon-circle-arrow-e{background-position:-112px -192px}.cmb2-element .ui-icon-circle-arrow-s{background-position:-128px -192px}.cmb2-element .ui-icon-circle-arrow-w{background-position:-144px -192px}.cmb2-element .ui-icon-circle-arrow-n{background-position:-160px -192px}.cmb2-element .ui-icon-circle-zoomin{background-position:-176px -192px}.cmb2-element .ui-icon-circle-zoomout{background-position:-192px -192px}.cmb2-element .ui-icon-circle-check{background-position:-208px -192px}.cmb2-element .ui-icon-circlesmall-plus{background-position:0 -208px}.cmb2-element .ui-icon-circlesmall-minus{background-position:-16px -208px}.cmb2-element .ui-icon-circlesmall-close{background-position:-32px -208px}.cmb2-element .ui-icon-squaresmall-plus{background-position:-48px -208px}.cmb2-element .ui-icon-squaresmall-minus{background-position:-64px -208px}.cmb2-element .ui-icon-squaresmall-close{background-position:-80px -208px}.cmb2-element .ui-icon-grip-dotted-vertical{background-position:0 -224px}.cmb2-element .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.cmb2-element .ui-icon-grip-solid-vertical{background-position:-32px -224px}.cmb2-element .ui-icon-grip-solid-horizontal{background-position:-48px -224px}.cmb2-element .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.cmb2-element .ui-icon-grip-diagonal-se{background-position:-80px -224px}.cmb2-element .ui-corner-all,.cmb2-element .ui-corner-left,.cmb2-element .ui-corner-tl,.cmb2-element .ui-corner-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.cmb2-element .ui-corner-all,.cmb2-element .ui-corner-right,.cmb2-element .ui-corner-top,.cmb2-element .ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.cmb2-element .ui-corner-all,.cmb2-element .ui-corner-bl,.cmb2-element .ui-corner-bottom,.cmb2-element .ui-corner-left{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.cmb2-element .ui-corner-all,.cmb2-element .ui-corner-bottom,.cmb2-element .ui-corner-br,.cmb2-element .ui-corner-right{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.cmb2-element .ui-widget-overlay{background:#aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.cmb2-element .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.cmb2-element .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.cmb2-element .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.cmb2-element .ui-datepicker .ui-datepicker-next-hover,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover{top:1px}.cmb2-element .ui-datepicker .ui-datepicker-prev{left:2px}.cmb2-element .ui-datepicker .ui-datepicker-next{right:2px}.cmb2-element .ui-datepicker .ui-datepicker-prev-hover{left:1px}.cmb2-element .ui-datepicker .ui-datepicker-next-hover{right:1px}.cmb2-element .ui-datepicker .ui-datepicker-next span,.cmb2-element .ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.cmb2-element .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.cmb2-element .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.cmb2-element .ui-datepicker select.ui-datepicker-month-year{width:100%}.cmb2-element .ui-datepicker select.ui-datepicker-month,.cmb2-element .ui-datepicker select.ui-datepicker-year{width:49%}.cmb2-element .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.cmb2-element .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.cmb2-element .ui-datepicker td{border:0;padding:1px}.cmb2-element .ui-datepicker td a,.cmb2-element .ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.cmb2-element .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.cmb2-element .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.cmb2-element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.cmb2-element .ui-datepicker.ui-datepicker-multi{width:auto}.cmb2-element .ui-datepicker-multi .ui-datepicker-group{float:left}.cmb2-element .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.cmb2-element .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.cmb2-element .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.cmb2-element .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.cmb2-element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.cmb2-element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.cmb2-element .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.cmb2-element .ui-datepicker-row-break{clear:both;width:100%;font-size:0}.cmb2-element .ui-datepicker-rtl{direction:rtl}.cmb2-element .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.cmb2-element .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.cmb2-element .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.cmb2-element .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.cmb2-element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.cmb2-element .ui-datepicker-rtl .ui-datepicker-group{float:right}.cmb2-element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.cmb2-element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.cmb2-element .ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}@media (max-width:450px){.cmb-th{font-size:1.2em;padding-bottom:1em;text-align:left}.cmb-th label{display:block;margin-top:0;padding-bottom:5px}.cmb-th label:after{border-bottom:1px solid #e9e9e9;content:'';clear:both;display:block;padding-top:.4em}.cmb-td,.cmb-th,.cmb-th+.cmb-td{display:block;float:none;width:100%}.cmb-repeat-group-wrap .cmb-repeatable-group:not(:last-of-type),.cmb-repeat-group-wrap .cmb-row:not(:last-of-type),.postbox-container .cmb-repeatable-group:not(:last-of-type),.postbox-container .cmb-row:not(:last-of-type){border-bottom:0}}
|
cmb2/css/index.php
ADDED
File without changes
|
cmb2/css/sass/cmb2.scss
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* CMB Styling
|
3 |
+
*/
|
4 |
+
|
5 |
+
@import "partials/variables";
|
6 |
+
@import "partials/mixins";
|
7 |
+
|
8 |
+
@import "partials/main_wrap";
|
9 |
+
@import "partials/timepicker";
|
10 |
+
@import "partials/post_metaboxes";
|
11 |
+
@import "partials/misc";
|
12 |
+
@import "partials/sidebar_placements";
|
13 |
+
@import "partials/collapsible_ui";
|
14 |
+
@import "partials/jquery_ui";
|
cmb2/css/sass/index.php
ADDED
File without changes
|
cmb2/css/sass/partials/_collapsible_ui.scss
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.cmb2-metabox {
|
2 |
+
.cmb-repeat-group-wrap {
|
3 |
+
max-width: 1000px
|
4 |
+
}
|
5 |
+
.cmbhandle {
|
6 |
+
color: #aaa;
|
7 |
+
float: right;
|
8 |
+
width: 27px;
|
9 |
+
height: 30px;
|
10 |
+
cursor: pointer;
|
11 |
+
right: -1em;
|
12 |
+
position: relative;
|
13 |
+
&:before {
|
14 |
+
content: '\f142';
|
15 |
+
right: 12px;
|
16 |
+
font: normal 20px/1 'dashicons';
|
17 |
+
speak: none;
|
18 |
+
display: inline-block;
|
19 |
+
padding: 8px 10px;
|
20 |
+
top: 0;
|
21 |
+
position: relative;
|
22 |
+
-webkit-font-smoothing: antialiased;
|
23 |
+
-moz-osx-font-smoothing: grayscale;
|
24 |
+
text-decoration: none !important;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
.postbox.closed {
|
29 |
+
.cmbhandle {
|
30 |
+
&:before {
|
31 |
+
content: '\f140';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
|
37 |
+
-webkit-appearance: none !important;
|
38 |
+
background: none !important;
|
39 |
+
border: none !important;
|
40 |
+
position: absolute;
|
41 |
+
left: 0;
|
42 |
+
top: .5em;
|
43 |
+
line-height: 1em;
|
44 |
+
cursor: pointer;
|
45 |
+
&:not([disabled]) {
|
46 |
+
color: $dark-red;
|
47 |
+
&:hover {
|
48 |
+
color: $red;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
cmb2/css/sass/partials/_jquery_ui.scss
ADDED
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery UI CSS Framework 1.8.16
|
3 |
+
*
|
4 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6 |
+
* http://jquery.org/license
|
7 |
+
*
|
8 |
+
* http://docs.jquery.com/UI/Theming/API
|
9 |
+
*/
|
10 |
+
.cmb2-element {
|
11 |
+
.ui-helper-hidden { display: none; }
|
12 |
+
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
13 |
+
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
14 |
+
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
15 |
+
.ui-helper-clearfix { display: inline-block; }
|
16 |
+
* html .ui-helper-clearfix { height:1%; }
|
17 |
+
.ui-helper-clearfix { display:block; }
|
18 |
+
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
19 |
+
.ui-state-disabled { cursor: default !important; }
|
20 |
+
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
21 |
+
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
22 |
+
.ui-widget {
|
23 |
+
font-family: Verdana,Arial,sans-serif; font-size: 1.1em;
|
24 |
+
.ui-widget { font-size: 1em; }
|
25 |
+
input, select, textarea, button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
26 |
+
}
|
27 |
+
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
28 |
+
.ui-widget-content a { color: #222222; }
|
29 |
+
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
30 |
+
.ui-widget-header a { color: #222222; }
|
31 |
+
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
32 |
+
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
33 |
+
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
34 |
+
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
35 |
+
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
36 |
+
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
37 |
+
.ui-widget :active { outline: none; }
|
38 |
+
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
39 |
+
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
40 |
+
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
41 |
+
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
42 |
+
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
43 |
+
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
44 |
+
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
45 |
+
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
46 |
+
.ui-icon { width: 16px; height: 16px; background-image: url(../images/ui-icons_222222_256x240.png); }
|
47 |
+
.ui-widget-content .ui-icon {background-image: url(../images/ui-icons_222222_256x240.png); }
|
48 |
+
.ui-widget-header .ui-icon {background-image: url(../images/ui-icons_222222_256x240.png); }
|
49 |
+
.ui-state-default .ui-icon { background-image: url(../images/ui-icons_888888_256x240.png); }
|
50 |
+
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../images/ui-icons_454545_256x240.png); }
|
51 |
+
.ui-state-active .ui-icon {background-image: url(../images/ui-icons_454545_256x240.png); }
|
52 |
+
.ui-state-highlight .ui-icon {background-image: url(../images/ui-icons_2e83ff_256x240.png); }
|
53 |
+
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../images/ui-icons_cd0a0a_256x240.png); }
|
54 |
+
.ui-icon-carat-1-n { background-position: 0 0; }
|
55 |
+
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
56 |
+
.ui-icon-carat-1-e { background-position: -32px 0; }
|
57 |
+
.ui-icon-carat-1-se { background-position: -48px 0; }
|
58 |
+
.ui-icon-carat-1-s { background-position: -64px 0; }
|
59 |
+
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
60 |
+
.ui-icon-carat-1-w { background-position: -96px 0; }
|
61 |
+
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
62 |
+
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
63 |
+
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
64 |
+
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
65 |
+
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
66 |
+
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
67 |
+
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
68 |
+
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
69 |
+
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
70 |
+
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
71 |
+
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
72 |
+
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
73 |
+
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
74 |
+
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
75 |
+
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
76 |
+
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
77 |
+
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
78 |
+
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
79 |
+
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
80 |
+
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
81 |
+
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
82 |
+
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
83 |
+
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
84 |
+
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
85 |
+
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
86 |
+
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
87 |
+
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
88 |
+
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
89 |
+
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
90 |
+
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
91 |
+
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
92 |
+
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
93 |
+
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
94 |
+
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
95 |
+
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
96 |
+
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
97 |
+
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
98 |
+
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
99 |
+
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
100 |
+
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
101 |
+
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
102 |
+
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
103 |
+
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
104 |
+
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
105 |
+
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
106 |
+
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
107 |
+
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
108 |
+
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
109 |
+
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
110 |
+
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
111 |
+
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
112 |
+
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
113 |
+
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
114 |
+
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
115 |
+
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
116 |
+
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
117 |
+
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
118 |
+
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
119 |
+
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
120 |
+
.ui-icon-extlink { background-position: -32px -80px; }
|
121 |
+
.ui-icon-newwin { background-position: -48px -80px; }
|
122 |
+
.ui-icon-refresh { background-position: -64px -80px; }
|
123 |
+
.ui-icon-shuffle { background-position: -80px -80px; }
|
124 |
+
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
125 |
+
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
126 |
+
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
127 |
+
.ui-icon-folder-open { background-position: -16px -96px; }
|
128 |
+
.ui-icon-document { background-position: -32px -96px; }
|
129 |
+
.ui-icon-document-b { background-position: -48px -96px; }
|
130 |
+
.ui-icon-note { background-position: -64px -96px; }
|
131 |
+
.ui-icon-mail-closed { background-position: -80px -96px; }
|
132 |
+
.ui-icon-mail-open { background-position: -96px -96px; }
|
133 |
+
.ui-icon-suitcase { background-position: -112px -96px; }
|
134 |
+
.ui-icon-comment { background-position: -128px -96px; }
|
135 |
+
.ui-icon-person { background-position: -144px -96px; }
|
136 |
+
.ui-icon-print { background-position: -160px -96px; }
|
137 |
+
.ui-icon-trash { background-position: -176px -96px; }
|
138 |
+
.ui-icon-locked { background-position: -192px -96px; }
|
139 |
+
.ui-icon-unlocked { background-position: -208px -96px; }
|
140 |
+
.ui-icon-bookmark { background-position: -224px -96px; }
|
141 |
+
.ui-icon-tag { background-position: -240px -96px; }
|
142 |
+
.ui-icon-home { background-position: 0 -112px; }
|
143 |
+
.ui-icon-flag { background-position: -16px -112px; }
|
144 |
+
.ui-icon-calendar { background-position: -32px -112px; }
|
145 |
+
.ui-icon-cart { background-position: -48px -112px; }
|
146 |
+
.ui-icon-pencil { background-position: -64px -112px; }
|
147 |
+
.ui-icon-clock { background-position: -80px -112px; }
|
148 |
+
.ui-icon-disk { background-position: -96px -112px; }
|
149 |
+
.ui-icon-calculator { background-position: -112px -112px; }
|
150 |
+
.ui-icon-zoomin { background-position: -128px -112px; }
|
151 |
+
.ui-icon-zoomout { background-position: -144px -112px; }
|
152 |
+
.ui-icon-search { background-position: -160px -112px; }
|
153 |
+
.ui-icon-wrench { background-position: -176px -112px; }
|
154 |
+
.ui-icon-gear { background-position: -192px -112px; }
|
155 |
+
.ui-icon-heart { background-position: -208px -112px; }
|
156 |
+
.ui-icon-star { background-position: -224px -112px; }
|
157 |
+
.ui-icon-link { background-position: -240px -112px; }
|
158 |
+
.ui-icon-cancel { background-position: 0 -128px; }
|
159 |
+
.ui-icon-plus { background-position: -16px -128px; }
|
160 |
+
.ui-icon-plusthick { background-position: -32px -128px; }
|
161 |
+
.ui-icon-minus { background-position: -48px -128px; }
|
162 |
+
.ui-icon-minusthick { background-position: -64px -128px; }
|
163 |
+
.ui-icon-close { background-position: -80px -128px; }
|
164 |
+
.ui-icon-closethick { background-position: -96px -128px; }
|
165 |
+
.ui-icon-key { background-position: -112px -128px; }
|
166 |
+
.ui-icon-lightbulb { background-position: -128px -128px; }
|
167 |
+
.ui-icon-scissors { background-position: -144px -128px; }
|
168 |
+
.ui-icon-clipboard { background-position: -160px -128px; }
|
169 |
+
.ui-icon-copy { background-position: -176px -128px; }
|
170 |
+
.ui-icon-contact { background-position: -192px -128px; }
|
171 |
+
.ui-icon-image { background-position: -208px -128px; }
|
172 |
+
.ui-icon-video { background-position: -224px -128px; }
|
173 |
+
.ui-icon-script { background-position: -240px -128px; }
|
174 |
+
.ui-icon-alert { background-position: 0 -144px; }
|
175 |
+
.ui-icon-info { background-position: -16px -144px; }
|
176 |
+
.ui-icon-notice { background-position: -32px -144px; }
|
177 |
+
.ui-icon-help { background-position: -48px -144px; }
|
178 |
+
.ui-icon-check { background-position: -64px -144px; }
|
179 |
+
.ui-icon-bullet { background-position: -80px -144px; }
|
180 |
+
.ui-icon-radio-off { background-position: -96px -144px; }
|
181 |
+
.ui-icon-radio-on { background-position: -112px -144px; }
|
182 |
+
.ui-icon-pin-w { background-position: -128px -144px; }
|
183 |
+
.ui-icon-pin-s { background-position: -144px -144px; }
|
184 |
+
.ui-icon-play { background-position: 0 -160px; }
|
185 |
+
.ui-icon-pause { background-position: -16px -160px; }
|
186 |
+
.ui-icon-seek-next { background-position: -32px -160px; }
|
187 |
+
.ui-icon-seek-prev { background-position: -48px -160px; }
|
188 |
+
.ui-icon-seek-end { background-position: -64px -160px; }
|
189 |
+
.ui-icon-seek-start { background-position: -80px -160px; }
|
190 |
+
.ui-icon-seek-first { background-position: -80px -160px; }
|
191 |
+
.ui-icon-stop { background-position: -96px -160px; }
|
192 |
+
.ui-icon-eject { background-position: -112px -160px; }
|
193 |
+
.ui-icon-volume-off { background-position: -128px -160px; }
|
194 |
+
.ui-icon-volume-on { background-position: -144px -160px; }
|
195 |
+
.ui-icon-power { background-position: 0 -176px; }
|
196 |
+
.ui-icon-signal-diag { background-position: -16px -176px; }
|
197 |
+
.ui-icon-signal { background-position: -32px -176px; }
|
198 |
+
.ui-icon-battery-0 { background-position: -48px -176px; }
|
199 |
+
.ui-icon-battery-1 { background-position: -64px -176px; }
|
200 |
+
.ui-icon-battery-2 { background-position: -80px -176px; }
|
201 |
+
.ui-icon-battery-3 { background-position: -96px -176px; }
|
202 |
+
.ui-icon-circle-plus { background-position: 0 -192px; }
|
203 |
+
.ui-icon-circle-minus { background-position: -16px -192px; }
|
204 |
+
.ui-icon-circle-close { background-position: -32px -192px; }
|
205 |
+
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
206 |
+
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
207 |
+
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
208 |
+
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
209 |
+
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
210 |
+
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
211 |
+
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
212 |
+
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
213 |
+
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
214 |
+
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
215 |
+
.ui-icon-circle-check { background-position: -208px -192px; }
|
216 |
+
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
217 |
+
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
218 |
+
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
219 |
+
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
220 |
+
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
221 |
+
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
222 |
+
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
223 |
+
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
224 |
+
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
225 |
+
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
226 |
+
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
227 |
+
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
228 |
+
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
229 |
+
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
230 |
+
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
231 |
+
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
232 |
+
.ui-widget-overlay { background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
233 |
+
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
234 |
+
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
235 |
+
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
236 |
+
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
237 |
+
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
238 |
+
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
239 |
+
.ui-datepicker .ui-datepicker-next { right:2px; }
|
240 |
+
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
241 |
+
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
242 |
+
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
243 |
+
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
244 |
+
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
245 |
+
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
246 |
+
.ui-datepicker select.ui-datepicker-month,
|
247 |
+
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
248 |
+
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
249 |
+
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
250 |
+
.ui-datepicker td { border: 0; padding: 1px; }
|
251 |
+
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
252 |
+
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
253 |
+
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
254 |
+
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
255 |
+
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
256 |
+
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
257 |
+
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
258 |
+
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
259 |
+
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
260 |
+
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
261 |
+
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
262 |
+
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
263 |
+
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
264 |
+
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
265 |
+
.ui-datepicker-rtl {
|
266 |
+
direction: rtl;
|
267 |
+
.ui-datepicker-prev { right: 2px; left: auto; }
|
268 |
+
.ui-datepicker-next { left: 2px; right: auto; }
|
269 |
+
.ui-datepicker-prev:hover { right: 1px; left: auto; }
|
270 |
+
.ui-datepicker-next:hover { left: 1px; right: auto; }
|
271 |
+
.ui-datepicker-buttonpane { clear:right; }
|
272 |
+
.ui-datepicker-buttonpane button { float: left; }
|
273 |
+
.ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
274 |
+
.ui-datepicker-group { float:right; }
|
275 |
+
.ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
276 |
+
.ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
277 |
+
}
|
278 |
+
.ui-datepicker-cover {
|
279 |
+
display: none; /*sorry for IE5*/
|
280 |
+
display/**/: block; /*sorry for IE5*/
|
281 |
+
position: absolute; /*must have*/
|
282 |
+
z-index: -1; /*must have*/
|
283 |
+
filter: mask(); /*must have*/
|
284 |
+
top: -4px; /*must have*/
|
285 |
+
left: -4px; /*must have*/
|
286 |
+
width: 200px; /*must have*/
|
287 |
+
height: 200px; /*must have*/
|
288 |
+
}
|
289 |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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*--------------------------------------------------------------
|
2 |
+
Main Wrap
|
3 |
+
--------------------------------------------------------------*/
|
4 |
+
|
5 |
+
.cmb2-wrap {
|
6 |
+
margin: 0;
|
7 |
+
|
8 |
+
input,
|
9 |
+
textarea {
|
10 |
+
font-size: $font-size;
|
11 |
+
max-width: 100%;
|
12 |
+
padding: 5px;
|
13 |
+
|
14 |
+
}
|
15 |
+
|
16 |
+
input[type=text] {
|
17 |
+
|
18 |
+
&.cmb2-oembed {
|
19 |
+
width: 100%;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
textarea {
|
24 |
+
width: 500px;
|
25 |
+
|
26 |
+
&.cmb2-textarea-code {
|
27 |
+
font-family: $font-mono;
|
28 |
+
line-height: 16px;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
input {
|
33 |
+
|
34 |
+
&.cmb2-text-small,
|
35 |
+
&.cmb2-timepicker {
|
36 |
+
width: 100px;
|
37 |
+
// margin-right: 15px
|
38 |
+
}
|
39 |
+
|
40 |
+
&.cmb2-text-money {
|
41 |
+
width: 90px;
|
42 |
+
// margin-right: 15px
|
43 |
+
}
|
44 |
+
|
45 |
+
&.cmb2-text-medium {
|
46 |
+
width: 230px;
|
47 |
+
// margin-right: 15px
|
48 |
+
}
|
49 |
+
|
50 |
+
&.cmb2-upload-file {
|
51 |
+
width: 65%;
|
52 |
+
}
|
53 |
+
|
54 |
+
&.ed_button {
|
55 |
+
padding: 2px 4px;
|
56 |
+
}
|
57 |
+
|
58 |
+
&:not([type="hidden"]) {
|
59 |
+
+ input,
|
60 |
+
+ .button,
|
61 |
+
+ select {
|
62 |
+
margin-left: 20px;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
ul {
|
68 |
+
margin: 0;
|
69 |
+
}
|
70 |
+
|
71 |
+
li {
|
72 |
+
font-size: $font-size;
|
73 |
+
line-height: 16px;
|
74 |
+
margin: 1px 0 5px 0;
|
75 |
+
}
|
76 |
+
|
77 |
+
// .cmb-field-list .cmb-field-list {
|
78 |
+
// padding-top:5px;
|
79 |
+
// margin: 0;
|
80 |
+
// }
|
81 |
+
|
82 |
+
select {
|
83 |
+
font-size: $font-size;
|
84 |
+
margin-top: 3px;
|
85 |
+
}
|
86 |
+
|
87 |
+
input:focus,
|
88 |
+
textarea:focus {
|
89 |
+
background: $light-yellow;
|
90 |
+
}
|
91 |
+
|
92 |
+
input[type="radio"] {
|
93 |
+
margin: 0 5px 0 0;
|
94 |
+
padding: 0
|
95 |
+
}
|
96 |
+
|
97 |
+
input[type="checkbox"] {
|
98 |
+
margin: 0 5px 0 0;
|
99 |
+
padding: 0;
|
100 |
+
}
|
101 |
+
|
102 |
+
button,
|
103 |
+
.button {
|
104 |
+
white-space: nowrap;
|
105 |
+
}
|
106 |
+
|
107 |
+
.mceLayout {
|
108 |
+
border: 1px solid $light-gray !important;
|
109 |
+
}
|
110 |
+
|
111 |
+
.mceIframeContainer {
|
112 |
+
background: #fff;
|
113 |
+
}
|
114 |
+
|
115 |
+
.meta_mce {
|
116 |
+
width: 97%;
|
117 |
+
|
118 |
+
textarea {
|
119 |
+
width: 100%;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
// /**
|
124 |
+
// * Color picker
|
125 |
+
// */
|
126 |
+
.wp-color-result,
|
127 |
+
.wp-picker-input-wrap {
|
128 |
+
vertical-align: middle;
|
129 |
+
}
|
130 |
+
|
131 |
+
.wp-color-result,
|
132 |
+
.wp-picker-container {
|
133 |
+
margin: 0 10px 0 0;
|
134 |
+
}
|
135 |
+
|
136 |
+
.cmb-row {
|
137 |
+
margin: 0;
|
138 |
+
|
139 |
+
&:after {
|
140 |
+
content: '';
|
141 |
+
clear: both;
|
142 |
+
display: block;
|
143 |
+
width: 100%;
|
144 |
+
}
|
145 |
+
|
146 |
+
&.cmb-repeat-row {
|
147 |
+
padding: 1.8em 0 0;
|
148 |
+
|
149 |
+
&:first-of-type {
|
150 |
+
padding: 0;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
&.cmb-repeat .cmb2-metabox-description {
|
155 |
+
padding-top: 0;
|
156 |
+
padding-bottom: 1.8em;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
.cmb2-metabox {
|
162 |
+
clear: both;
|
163 |
+
margin: 0;
|
164 |
+
|
165 |
+
> .cmb-row:first-of-type >,
|
166 |
+
.cmb-field-list > .cmb-row:first-of-type > {
|
167 |
+
.cmb-td,
|
168 |
+
.cmb-th {
|
169 |
+
border: 0;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
> .cmb-row {
|
174 |
+
.cmb-repeat-table .cmb-row > .cmb-td {
|
175 |
+
padding-right: 20px;
|
176 |
+
box-sizing: border-box;
|
177 |
+
float: left;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
.cmb-add-row {
|
183 |
+
margin: 1.8em 0 0;
|
184 |
+
}
|
185 |
+
|
186 |
+
.cmb-nested .cmb-td,
|
187 |
+
.cmb-repeatable-group .cmb-th,
|
188 |
+
.cmb-repeatable-group:first-of-type {
|
189 |
+
border: 0;
|
190 |
+
}
|
191 |
+
|
192 |
+
.cmb-row:last-of-type,
|
193 |
+
.cmb2-wrap .cmb-row:last-of-type,
|
194 |
+
.cmb-repeatable-group:last-of-type {
|
195 |
+
border-bottom: 0;
|
196 |
+
}
|
197 |
+
|
198 |
+
.cmb-repeatable-grouping {
|
199 |
+
border: 1px solid $light-gray;
|
200 |
+
padding: 0 1em;
|
201 |
+
max-width: 1000px;
|
202 |
+
&.cmb-row {
|
203 |
+
margin: 0 0 0.8em;
|
204 |
+
}
|
205 |
+
+ .cmb-repeatable-grouping {
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
.cmb-th {
|
210 |
+
color: $dark-gray;
|
211 |
+
float: left;
|
212 |
+
font-weight: 600;
|
213 |
+
line-height: 1.3;
|
214 |
+
padding: 20px 10px 20px 0;
|
215 |
+
vertical-align: top;
|
216 |
+
width: 200px;
|
217 |
+
|
218 |
+
@media (max-width: $mobile-break) {
|
219 |
+
@include fullth;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
.cmb-td {
|
224 |
+
line-height: 1.3;
|
225 |
+
max-width: 100%;
|
226 |
+
padding: 15px 10px;
|
227 |
+
vertical-align: middle;
|
228 |
+
}
|
229 |
+
|
230 |
+
.cmb-type-title {
|
231 |
+
|
232 |
+
.cmb-td {
|
233 |
+
padding: 0;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
.cmb-th label {
|
238 |
+
display: block;
|
239 |
+
padding: 5px 0;
|
240 |
+
}
|
241 |
+
|
242 |
+
.cmb-th + .cmb-td {
|
243 |
+
float: left;
|
244 |
+
}
|
245 |
+
|
246 |
+
.cmb-td .cmb-td {
|
247 |
+
padding-bottom: 1em;
|
248 |
+
}
|
249 |
+
|
250 |
+
.cmb-remove-row {
|
251 |
+
text-align: right;
|
252 |
+
}
|
253 |
+
|
254 |
+
.empty-row.hidden {
|
255 |
+
display: none;
|
256 |
+
}
|
257 |
+
|
258 |
+
.cmb-repeatable-group {
|
259 |
+
|
260 |
+
.cmb-th {
|
261 |
+
padding: 5px;
|
262 |
+
}
|
263 |
+
|
264 |
+
.cmb-group-title {
|
265 |
+
background-color: $light-gray;
|
266 |
+
padding: 8px 12px 8px 2.2em;
|
267 |
+
margin: 0 -1em;
|
268 |
+
min-height: 1.5em;
|
269 |
+
font-size: 14px;
|
270 |
+
line-height: 1.4;
|
271 |
+
|
272 |
+
h4 {
|
273 |
+
border: 0;
|
274 |
+
margin: 0;
|
275 |
+
font-size: 1.2em;
|
276 |
+
font-weight: 500;
|
277 |
+
padding: 0.5em 0.75em;
|
278 |
+
}
|
279 |
+
|
280 |
+
.cmb-th {
|
281 |
+
display: block;
|
282 |
+
width: 100%;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
.cmb-group-description .cmb-th {
|
287 |
+
@include fullth;
|
288 |
+
}
|
289 |
+
|
290 |
+
.cmb-shift-rows {
|
291 |
+
font-size: 1em;
|
292 |
+
margin-right: 1em;
|
293 |
+
text-decoration: none;
|
294 |
+
|
295 |
+
.dashicons {
|
296 |
+
font-size: 1.5em;
|
297 |
+
height: 1.5em;
|
298 |
+
line-height: 1.2em;
|
299 |
+
width: 1em;
|
300 |
+
|
301 |
+
&.dashicons-arrow-down-alt2 {
|
302 |
+
line-height: 1.3em;
|
303 |
+
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
|
308 |
+
.cmb2-upload-button {
|
309 |
+
float: right;
|
310 |
+
}
|
311 |
+
|
312 |
+
}
|
313 |
+
|
314 |
+
p.cmb2-metabox-description {
|
315 |
+
color: $gray;
|
316 |
+
font-style: italic;
|
317 |
+
margin: 0;
|
318 |
+
padding-top: .5em;
|
319 |
+
}
|
320 |
+
|
321 |
+
span.cmb2-metabox-description {
|
322 |
+
color: $gray;
|
323 |
+
font-style: italic;
|
324 |
+
}
|
325 |
+
|
326 |
+
.cmb2-metabox-title {
|
327 |
+
margin: 0 0 5px 0;
|
328 |
+
padding: 5px 0 0 0;
|
329 |
+
font-size: 14px;
|
330 |
+
}
|
331 |
+
|
332 |
+
.cmb-inline ul {
|
333 |
+
padding: 4px 0 0 0;
|
334 |
+
}
|
335 |
+
|
336 |
+
.cmb-inline li {
|
337 |
+
display: inline-block;
|
338 |
+
padding-right: 18px;
|
339 |
+
}
|
340 |
+
|
341 |
+
.cmb-type-textarea-code pre {
|
342 |
+
margin: 0;
|
343 |
+
}
|
344 |
+
|
345 |
+
.cmb2-media-status {
|
346 |
+
|
347 |
+
.img-status {
|
348 |
+
clear: none;
|
349 |
+
display: inline-block;
|
350 |
+
float: left;
|
351 |
+
margin-right: 10px;
|
352 |
+
width: auto;
|
353 |
+
|
354 |
+
img {
|
355 |
+
max-width: 350px;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
.img-status img,
|
360 |
+
.embed-status {
|
361 |
+
background: $white;
|
362 |
+
border: 1px solid $light-gray;
|
363 |
+
border-radius: 2px;
|
364 |
+
-moz-border-radius: 2px;
|
365 |
+
margin: 15px 0 0 0;
|
366 |
+
padding: 5px;
|
367 |
+
}
|
368 |
+
|
369 |
+
.embed-status {
|
370 |
+
float: left;
|
371 |
+
max-width: 800px;
|
372 |
+
}
|
373 |
+
|
374 |
+
.img-status, .embed-status {
|
375 |
+
position: relative;
|
376 |
+
|
377 |
+
.cmb2-remove-file-button {
|
378 |
+
background: url(../images/ico-delete.png);
|
379 |
+
height: 16px;
|
380 |
+
left: -5px;
|
381 |
+
position: absolute;
|
382 |
+
text-indent: -9999px;
|
383 |
+
top: -5px;
|
384 |
+
width: 16px;
|
385 |
+
}
|
386 |
+
|
387 |
+
}
|
388 |
+
|
389 |
+
.img-status {
|
390 |
+
|
391 |
+
.cmb2-remove-file-button {
|
392 |
+
top: 10px;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
.img-status img, .file-status > span {
|
397 |
+
cursor: pointer;
|
398 |
+
}
|
399 |
+
|
400 |
+
}
|
401 |
+
|
402 |
+
.cmb-type-file-list .cmb2-media-status .img-status {
|
403 |
+
clear: none;
|
404 |
+
float: left;
|
405 |
+
margin-right: 10px;
|
406 |
+
width: auto;
|
407 |
+
}
|
408 |
+
|
409 |
+
.cmb-attach-list li {
|
410 |
+
clear: both;
|
411 |
+
display: inline-block;
|
412 |
+
margin-bottom: 25px;
|
413 |
+
width: 100%;
|
414 |
+
|
415 |
+
img {
|
416 |
+
cursor: move;
|
417 |
+
float: left;
|
418 |
+
margin-right: 10px;
|
419 |
+
}
|
420 |
+
}
|
421 |
+
|
422 |
+
.cmb2-remove-wrapper {
|
423 |
+
margin: 0;
|
424 |
+
}
|
425 |
+
|
426 |
+
.child-cmb2 .cmb-th {
|
427 |
+
text-align: left;
|
428 |
+
}
|
429 |
+
|
430 |
+
@media (max-width: $mobile-break) {
|
431 |
+
.cmb-th,
|
432 |
+
.cmb-td,
|
433 |
+
.cmb-th + .cmb-td {
|
434 |
+
display: block;
|
435 |
+
float: none;
|
436 |
+
width: 100%;
|
437 |
+
}
|
438 |
+
}
|
cmb2/css/sass/partials/_misc.scss
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*--------------------------------------------------------------
|
2 |
+
Misc.
|
3 |
+
--------------------------------------------------------------*/
|
4 |
+
|
5 |
+
#poststuff .cmb-repeatable-group h2 {
|
6 |
+
margin: 0;
|
7 |
+
}
|
8 |
+
|
9 |
+
.edit-tags-php,
|
10 |
+
.profile-php,
|
11 |
+
.user-edit-php {
|
12 |
+
|
13 |
+
.cmb2-metabox-title {
|
14 |
+
font-size: 1.4em;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
.postbox .cmb-spinner {
|
19 |
+
float: left;
|
20 |
+
}
|
cmb2/css/sass/partials/_mixins.scss
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//--------------------------------------------------------------
|
2 |
+
// Mixins
|
3 |
+
//--------------------------------------------------------------
|
4 |
+
|
5 |
+
@mixin fullth() {
|
6 |
+
font-size: 1.2em;
|
7 |
+
@include _fullth;
|
8 |
+
}
|
9 |
+
|
10 |
+
@mixin fullth_side() {
|
11 |
+
|
12 |
+
@include _fullth;
|
13 |
+
|
14 |
+
label {
|
15 |
+
font-size: $font-size;
|
16 |
+
line-height: 1.4em;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
@mixin _fullth() {
|
21 |
+
display: block;
|
22 |
+
float: none;
|
23 |
+
padding-bottom: 1em;
|
24 |
+
text-align: left;
|
25 |
+
width: 100%;
|
26 |
+
|
27 |
+
label {
|
28 |
+
display: block;
|
29 |
+
margin-top: 0em;
|
30 |
+
padding-bottom: 5px;
|
31 |
+
|
32 |
+
&:after {
|
33 |
+
border-bottom: 1px solid $light-gray;
|
34 |
+
content: '';
|
35 |
+
clear: both;
|
36 |
+
display: block;
|
37 |
+
padding-top: .4em;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
cmb2/css/sass/partials/_post_metaboxes.scss
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*--------------------------------------------------------------
|
2 |
+
Post Metaboxes
|
3 |
+
--------------------------------------------------------------*/
|
4 |
+
#poststuff .cmb-group-title {
|
5 |
+
margin-left: -1em;
|
6 |
+
margin-right: -1em;
|
7 |
+
padding-left: 2.2em;
|
8 |
+
// cursor: move;
|
9 |
+
min-height: 1.5em;
|
10 |
+
}
|
11 |
+
|
12 |
+
.postbox-container, .cmb-repeat-group-wrap {
|
13 |
+
|
14 |
+
.cmb2-wrap {
|
15 |
+
margin: 0;
|
16 |
+
|
17 |
+
> .cmb-field-list > .cmb-row {
|
18 |
+
padding: 1.8em 0;
|
19 |
+
}
|
20 |
+
|
21 |
+
input[type=text] {
|
22 |
+
|
23 |
+
&.cmb2-oembed {
|
24 |
+
width: 100%;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
.cmb-row {
|
30 |
+
padding: 0 0 1.8em;
|
31 |
+
margin: 0 0 0.8em;
|
32 |
+
|
33 |
+
.cmbhandle {
|
34 |
+
right: -1em;
|
35 |
+
position: relative;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
.cmb-repeatable-grouping {
|
40 |
+
padding: 0 1em;
|
41 |
+
max-width: 100%;
|
42 |
+
min-width: 1px !important;
|
43 |
+
}
|
44 |
+
|
45 |
+
.cmb-repeatable-group > .cmb-row {
|
46 |
+
padding-bottom: 0;
|
47 |
+
}
|
48 |
+
|
49 |
+
.cmb-th {
|
50 |
+
width: 18%;
|
51 |
+
padding: 0 2% 0 0;
|
52 |
+
// text-align: right;
|
53 |
+
}
|
54 |
+
|
55 |
+
.cmb-td {
|
56 |
+
margin-bottom: 0;
|
57 |
+
padding: 0;
|
58 |
+
line-height: 1.3;
|
59 |
+
}
|
60 |
+
|
61 |
+
.cmb-repeat-row .cmb-td {
|
62 |
+
padding-bottom: 1.8em;
|
63 |
+
}
|
64 |
+
|
65 |
+
.cmb-th + .cmb-td {
|
66 |
+
width: 80%;
|
67 |
+
float: right;
|
68 |
+
}
|
69 |
+
|
70 |
+
.cmb-row:not(:last-of-type),
|
71 |
+
.cmb-repeatable-group:not(:last-of-type) {
|
72 |
+
border-bottom: 1px solid $light-gray;
|
73 |
+
|
74 |
+
@media (max-width: $mobile-break) {
|
75 |
+
border-bottom: 0;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
.cmb-repeat-group-field,
|
80 |
+
.cmb-remove-field-row {
|
81 |
+
padding-top: 1.8em;
|
82 |
+
}
|
83 |
+
|
84 |
+
.cmb2-metabox > .cmb-row {
|
85 |
+
&.table-layout, .cmb-row.table-layout {
|
86 |
+
.cmb-repeat-table .cmb-tbody {
|
87 |
+
display: table;
|
88 |
+
width: 100%;
|
89 |
+
|
90 |
+
input.regular-text {
|
91 |
+
width: 100%;
|
92 |
+
}
|
93 |
+
|
94 |
+
.cmb-row:not(.hidden):not(.empty-row) {
|
95 |
+
display: table-row;
|
96 |
+
}
|
97 |
+
|
98 |
+
.cmb-td {
|
99 |
+
display: table-cell;
|
100 |
+
float: none;
|
101 |
+
width: 100%;
|
102 |
+
}
|
103 |
+
|
104 |
+
.cmb-row:not(:first-of-type) .cmb-td {
|
105 |
+
padding-top: 1.8em;
|
106 |
+
}
|
107 |
+
|
108 |
+
.cmb-td.cmb-remove-row {
|
109 |
+
padding-right: 0;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
cmb2/css/sass/partials/_sidebar_placements.scss
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*--------------------------------------------------------------
|
2 |
+
Sidebar Placement Adjustments
|
3 |
+
--------------------------------------------------------------*/
|
4 |
+
|
5 |
+
.inner-sidebar,
|
6 |
+
#side-sortables {
|
7 |
+
|
8 |
+
.cmb2-wrap {
|
9 |
+
|
10 |
+
> .cmb-field-list > .cmb-row {
|
11 |
+
padding: 1.4em 0;
|
12 |
+
}
|
13 |
+
|
14 |
+
input {
|
15 |
+
|
16 |
+
&[type=text]:not( .wp-color-picker ) {
|
17 |
+
width: 100%;
|
18 |
+
}
|
19 |
+
|
20 |
+
+ input:not( .wp-picker-clear ), + select {
|
21 |
+
margin-left: 0;
|
22 |
+
margin-top: 1em;
|
23 |
+
display: block;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
label {
|
28 |
+
display: block;
|
29 |
+
font-weight: 700;
|
30 |
+
padding: 0 0 5px;
|
31 |
+
}
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
.cmb-repeatable-group {
|
36 |
+
border-bottom: 1px solid $light-gray;
|
37 |
+
}
|
38 |
+
|
39 |
+
.cmb-repeat-group-wrap > .cmb-td > .cmb-repeatable-group {
|
40 |
+
border-bottom: 0;
|
41 |
+
margin-bottom: -1.4em;
|
42 |
+
}
|
43 |
+
|
44 |
+
.cmb-th,
|
45 |
+
.cmb-td,
|
46 |
+
.cmb-th + .cmb-td {
|
47 |
+
width: 100%;
|
48 |
+
display: block;
|
49 |
+
float: none;
|
50 |
+
}
|
51 |
+
|
52 |
+
.closed .inside {
|
53 |
+
display: none;
|
54 |
+
}
|
55 |
+
|
56 |
+
.cmb-td .cmb-td {
|
57 |
+
padding-bottom: 1em;
|
58 |
+
}
|
59 |
+
|
60 |
+
.cmb-th {
|
61 |
+
@include fullth_side;
|
62 |
+
padding-left: 0;
|
63 |
+
padding-right: 0;
|
64 |
+
}
|
65 |
+
|
66 |
+
.cmb-group-description {
|
67 |
+
.cmb-th {
|
68 |
+
padding-top: 0;
|
69 |
+
}
|
70 |
+
.cmb2-metabox-description {
|
71 |
+
padding: 0;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
.cmb-group-title {
|
76 |
+
// padding-bottom: 0;
|
77 |
+
.cmb-th {
|
78 |
+
padding: 0;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
.cmb-repeatable-grouping {
|
83 |
+
+ .cmb-repeatable-grouping {
|
84 |
+
margin-top: 1em;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
.cmb2-media-status {
|
88 |
+
|
89 |
+
.img-status,
|
90 |
+
.embed-status {
|
91 |
+
|
92 |
+
img {
|
93 |
+
max-width: 90%;
|
94 |
+
// width: auto;
|
95 |
+
height: auto;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
.cmb2-list label {
|
101 |
+
display: inline;
|
102 |
+
font-weight: normal;
|
103 |
+
}
|
104 |
+
|
105 |
+
.cmb2-metabox-description {
|
106 |
+
display: block;
|
107 |
+
padding: 7px 0 0;
|
108 |
+
}
|
109 |
+
|
110 |
+
.cmb-type-checkbox {
|
111 |
+
|
112 |
+
.cmb-td label,
|
113 |
+
.cmb2-metabox-description {
|
114 |
+
font-weight: normal;
|
115 |
+
display: inline;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
.cmb-row .cmb2-metabox-description {
|
120 |
+
padding-bottom: 1.8em;
|
121 |
+
}
|
122 |
+
|
123 |
+
.cmb2-metabox-title {
|
124 |
+
font-size: 1.2em;
|
125 |
+
font-style: italic;
|
126 |
+
}
|
127 |
+
|
128 |
+
.cmb-remove-row {
|
129 |
+
clear: both;
|
130 |
+
padding-top: 12px;
|
131 |
+
padding-bottom: 0;
|
132 |
+
}
|
133 |
+
|
134 |
+
.cmb-type-colorpicker .cmb-repeat-row {
|
135 |
+
.cmb-td {
|
136 |
+
width: auto;
|
137 |
+
clear: none;
|
138 |
+
float: left;
|
139 |
+
padding-top: 0;
|
140 |
+
&.cmb-remove-row {
|
141 |
+
float: right;
|
142 |
+
margin: 0;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
.cmb2-upload-button {
|
148 |
+
clear: both;
|
149 |
+
margin-top: 12px;
|
150 |
+
}
|
151 |
+
|
152 |
+
}
|
153 |
+
|
cmb2/css/sass/partials/_timepicker.scss
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*--------------------------------------------------------------
|
2 |
+
Timepicker
|
3 |
+
--------------------------------------------------------------*/
|
4 |
+
|
5 |
+
div {
|
6 |
+
|
7 |
+
&.time-picker {
|
8 |
+
background: #fff;
|
9 |
+
border: 1px solid $gray;
|
10 |
+
height: 191px;
|
11 |
+
margin: 0;
|
12 |
+
position: absolute;
|
13 |
+
overflow: auto;
|
14 |
+
width: 6em; /* needed for IE */
|
15 |
+
z-index: 99;
|
16 |
+
|
17 |
+
ul {
|
18 |
+
list-style-type: none;
|
19 |
+
margin: 0;
|
20 |
+
padding: 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
li {
|
24 |
+
cursor: pointer;
|
25 |
+
margin-bottom: 0;
|
26 |
+
font-family: $font-sans;
|
27 |
+
font-size: 14px;
|
28 |
+
padding: 4px 3px;
|
29 |
+
|
30 |
+
&.selected {
|
31 |
+
background: $blue;
|
32 |
+
color: #fff;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
&.time-picker-12hours {
|
38 |
+
width: 8em; /* needed for IE */
|
39 |
+
}
|
40 |
+
}
|
cmb2/css/sass/partials/_variables.scss
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//--------------------------------------------------------------
|
2 |
+
// Variables
|
3 |
+
//--------------------------------------------------------------
|
4 |
+
|
5 |
+
// Mobile break-point
|
6 |
+
$mobile-break : 450px;
|
7 |
+
|
8 |
+
// Fonts
|
9 |
+
$font-sans : sans-serif;
|
10 |
+
$font-serif : Georgia, Times, "Times New Roman", serif;
|
11 |
+
$font-mono : "Courier 10 Pitch", Courier, monospace;
|
12 |
+
$font-size : 14px;
|
13 |
+
|
14 |
+
// Colors
|
15 |
+
$dark-gray : #222222;
|
16 |
+
$gray : #aaaaaa;
|
17 |
+
$light-gray : #e9e9e9;
|
18 |
+
$blue : #0063ce;
|
19 |
+
$light-yellow : #fffff8;
|
20 |
+
$white : #ffffff;
|
21 |
+
$red : #f00;
|
22 |
+
$dark-red : #a00;
|
cmb2/css/sass/partials/index.php
ADDED
File without changes
|
{dkrpt → cmb2}/images/ico-delete.png
RENAMED
File without changes
|
cmb2/images/index.php
ADDED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_flat_0_aaaaaa_40x100.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_flat_75_ffffff_40x100.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_glass_55_fbf9ee_1x400.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_glass_65_ffffff_1x400.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_glass_75_dadada_1x400.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_glass_75_e6e6e6_1x400.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_glass_95_fef1ec_1x400.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-bg_highlight-soft_75_cccccc_1x100.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-icons_222222_256x240.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-icons_2e83ff_256x240.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-icons_454545_256x240.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-icons_888888_256x240.png
RENAMED
File without changes
|
{dkrpt → cmb2}/images/ui-icons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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Create meta boxes
|
4 |
+
*
|
5 |
+
* @property-read string $cmb_id
|
6 |
+
* @property-read array $meta_box
|
7 |
+
* @property-read array $updated
|
8 |
+
*/
|
9 |
+
class CMB2 {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Current field's ID
|
13 |
+
* @var string
|
14 |
+
* @since 2.0.0
|
15 |
+
*/
|
16 |
+
protected $cmb_id = '';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Metabox Config array
|
20 |
+
* @var array
|
21 |
+
* @since 0.9.0
|
22 |
+
*/
|
23 |
+
protected $meta_box;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Object ID for metabox meta retrieving/saving
|
27 |
+
* @var int
|
28 |
+
* @since 1.0.0
|
29 |
+
*/
|
30 |
+
protected $object_id = 0;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Type of object being saved. (e.g., post, user, or comment)
|
34 |
+
* @var string
|
35 |
+
* @since 1.0.0
|
36 |
+
*/
|
37 |
+
protected $object_type = 'post';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Type of object registered for metabox. (e.g., post, user, or comment)
|
41 |
+
* @var string
|
42 |
+
* @since 1.0.0
|
43 |
+
*/
|
44 |
+
protected $mb_object_type = null;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* List of fields that are changed/updated on save
|
48 |
+
* @var array
|
49 |
+
* @since 1.1.0
|
50 |
+
*/
|
51 |
+
protected $updated = array();
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Metabox Defaults
|
55 |
+
* @var array
|
56 |
+
* @since 1.0.1
|
57 |
+
*/
|
58 |
+
protected $mb_defaults = array(
|
59 |
+
'id' => '',
|
60 |
+
'title' => '',
|
61 |
+
'type' => '',
|
62 |
+
'object_types' => array(), // Post type
|
63 |
+
'context' => 'normal',
|
64 |
+
'priority' => 'high',
|
65 |
+
'show_names' => true, // Show field names on the left
|
66 |
+
'show_on' => array(), // Specific post IDs or page templates to display this metabox
|
67 |
+
'cmb_styles' => true, // Include cmb bundled stylesheet
|
68 |
+
'fields' => array(),
|
69 |
+
'hookup' => true,
|
70 |
+
'closed' => false, // Default to metabox being closed?
|
71 |
+
'new_user_section' => 'add-new-user', // or 'add-existing-user'
|
72 |
+
);
|
73 |
+
|
74 |
+
/**
|
75 |
+
* An array of hidden fields to output at the end of the form
|
76 |
+
* @var array
|
77 |
+
* @since 2.0.0
|
78 |
+
*/
|
79 |
+
protected $hidden_fields = array();
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Array of key => value data for saving. Likely $_POST data.
|
83 |
+
* @var array
|
84 |
+
* @since 2.0.0
|
85 |
+
*/
|
86 |
+
public $data_to_save = array();
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Array of key => value data for saving. Likely $_POST data.
|
90 |
+
* @var string
|
91 |
+
* @since 2.0.0
|
92 |
+
*/
|
93 |
+
protected $generated_nonce = '';
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Get started
|
97 |
+
*/
|
98 |
+
function __construct( $meta_box, $object_id = 0 ) {
|
99 |
+
|
100 |
+
if ( empty( $meta_box['id'] ) ) {
|
101 |
+
wp_die( __( 'Metabox configuration is required to have an ID parameter', 'cmb2' ) );
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->meta_box = wp_parse_args( $meta_box, $this->mb_defaults );
|
105 |
+
$this->object_id( $object_id );
|
106 |
+
$this->mb_object_type();
|
107 |
+
$this->cmb_id = $meta_box['id'];
|
108 |
+
|
109 |
+
CMB2_Boxes::add( $this );
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Hook during initiation of CMB2 object
|
113 |
+
*
|
114 |
+
* The dynamic portion of the hook name, $this->cmb_id, is this meta_box id.
|
115 |
+
*
|
116 |
+
* @param array $cmb This CMB2 object
|
117 |
+
*/
|
118 |
+
do_action( "cmb2_init_{$this->cmb_id}", $this );
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Loops through and displays fields
|
123 |
+
* @since 1.0.0
|
124 |
+
* @param int $object_id Object ID
|
125 |
+
* @param string $object_type Type of object being saved. (e.g., post, user, or comment)
|
126 |
+
*/
|
127 |
+
public function show_form( $object_id = 0, $object_type = '' ) {
|
128 |
+
$object_type = $this->object_type( $object_type );
|
129 |
+
$object_id = $this->object_id( $object_id );
|
130 |
+
|
131 |
+
$this->nonce_field();
|
132 |
+
|
133 |
+
echo "\n<!-- Begin CMB Fields -->\n";
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Hook before form table begins
|
137 |
+
*
|
138 |
+
* @param array $cmb_id The current box ID
|
139 |
+
* @param int $object_id The ID of the current object
|
140 |
+
* @param string $object_type The type of object you are working with.
|
141 |
+
* Usually `post` (this applies to all post-types).
|
142 |
+
* Could also be `comment`, `user` or `options-page`.
|
143 |
+
* @param array $cmb This CMB2 object
|
144 |
+
*/
|
145 |
+
do_action( 'cmb2_before_form', $this->cmb_id, $object_id, $object_type, $this );
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Hook before form table begins
|
149 |
+
*
|
150 |
+
* The first dynamic portion of the hook name, $object_type, is the type of object
|
151 |
+
* you are working with. Usually `post` (this applies to all post-types).
|
152 |
+
* Could also be `comment`, `user` or `options-page`.
|
153 |
+
*
|
154 |
+
* The second dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
|
155 |
+
*
|
156 |
+
* @param array $cmb_id The current box ID
|
157 |
+
* @param int $object_id The ID of the current object
|
158 |
+
* @param array $cmb This CMB2 object
|
159 |
+
*/
|
160 |
+
do_action( "cmb2_before_{$object_type}_form_{$this->cmb_id}", $object_id, $this );
|
161 |
+
|
162 |
+
echo '<div class="cmb2-wrap form-table"><div id="cmb2-metabox-', sanitize_html_class( $this->cmb_id ), '" class="cmb2-metabox cmb-field-list">';
|
163 |
+
|
164 |
+
foreach ( $this->prop( 'fields' ) as $field_args ) {
|
165 |
+
|
166 |
+
$field_args['context'] = $this->prop( 'context' );
|
167 |
+
|
168 |
+
if ( 'group' == $field_args['type'] ) {
|
169 |
+
|
170 |
+
if ( ! isset( $field_args['show_names'] ) ) {
|
171 |
+
$field_args['show_names'] = $this->prop( 'show_names' );
|
172 |
+
}
|
173 |
+
$this->render_group( $field_args );
|
174 |
+
|
175 |
+
} elseif ( 'hidden' == $field_args['type'] ) {
|
176 |
+
|
177 |
+
// Save rendering for after the metabox
|
178 |
+
$this->add_hidden_field( array(
|
179 |
+
'field_args' => $field_args,
|
180 |
+
'object_type' => $this->object_type(),
|
181 |
+
'object_id' => $this->object_id(),
|
182 |
+
) );
|
183 |
+
|
184 |
+
} else {
|
185 |
+
|
186 |
+
$field_args['show_names'] = $this->prop( 'show_names' );
|
187 |
+
|
188 |
+
// Render default fields
|
189 |
+
$field = new CMB2_Field( array(
|
190 |
+
'field_args' => $field_args,
|
191 |
+
'object_type' => $this->object_type(),
|
192 |
+
'object_id' => $this->object_id(),
|
193 |
+
) );
|
194 |
+
$field->render_field();
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
echo '</div></div>';
|
199 |
+
|
200 |
+
$this->render_hidden_fields();
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Hook after form form has been rendered
|
204 |
+
*
|
205 |
+
* @param array $cmb_id The current box ID
|
206 |
+
* @param int $object_id The ID of the current object
|
207 |
+
* @param string $object_type The type of object you are working with.
|
208 |
+
* Usually `post` (this applies to all post-types).
|
209 |
+
* Could also be `comment`, `user` or `options-page`.
|
210 |
+
* @param array $cmb This CMB2 object
|
211 |
+
*/
|
212 |
+
do_action( 'cmb2_after_form', $this->cmb_id, $object_id, $object_type, $this );
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Hook after form form has been rendered
|
216 |
+
*
|
217 |
+
* The dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
|
218 |
+
*
|
219 |
+
* The first dynamic portion of the hook name, $object_type, is the type of object
|
220 |
+
* you are working with. Usually `post` (this applies to all post-types).
|
221 |
+
* Could also be `comment`, `user` or `options-page`.
|
222 |
+
*
|
223 |
+
* @param int $object_id The ID of the current object
|
224 |
+
* @param array $cmb This CMB2 object
|
225 |
+
*/
|
226 |
+
do_action( "cmb2_after_{$object_type}_form_{$this->cmb_id}", $object_id, $this );
|
227 |
+
|
228 |
+
echo "\n<!-- End CMB Fields -->\n";
|
229 |
+
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Render a repeatable group
|
234 |
+
*/
|
235 |
+
public function render_group( $args ) {
|
236 |
+
|
237 |
+
// If field is requesting to be conditionally shown
|
238 |
+
if ( isset( $args['show_on_cb'] ) && is_callable( $args['show_on_cb'] ) && ! call_user_func( $args['show_on_cb'], $this ) ) {
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) {
|
243 |
+
return;
|
244 |
+
}
|
245 |
+
|
246 |
+
$args['count'] = 0;
|
247 |
+
$field_group = new CMB2_Field( array(
|
248 |
+
'field_args' => $args,
|
249 |
+
'object_type' => $this->object_type(),
|
250 |
+
'object_id' => $this->object_id(),
|
251 |
+
) );
|
252 |
+
$desc = $field_group->args( 'description' );
|
253 |
+
$label = $field_group->args( 'name' );
|
254 |
+
$sortable = $field_group->options( 'sortable' ) ? ' sortable' : '';
|
255 |
+
$group_val = (array) $field_group->value();
|
256 |
+
$nrows = count( $group_val );
|
257 |
+
$remove_disabled = $nrows <= 1 ? 'disabled="disabled" ' : '';
|
258 |
+
|
259 |
+
echo '<div class="cmb-row cmb-repeat-group-wrap"><div class="cmb-td"><div id="', $field_group->id(), '_repeat" class="cmb-nested cmb-field-list cmb-repeatable-group', $sortable, '" style="width:100%;">';
|
260 |
+
if ( $desc || $label ) {
|
261 |
+
$class = $desc ? ' cmb-group-description' : '';
|
262 |
+
echo '<div class="cmb-row', $class, '"><div class="cmb-th">';
|
263 |
+
if ( $label ) {
|
264 |
+
echo '<h2 class="cmb-group-name">', $label, '</h2>';
|
265 |
+
}
|
266 |
+
if ( $desc ) {
|
267 |
+
echo '<p class="cmb2-metabox-description">', $desc, '</p>';
|
268 |
+
}
|
269 |
+
echo '</div></div>';
|
270 |
+
}
|
271 |
+
|
272 |
+
if ( ! empty( $group_val ) ) {
|
273 |
+
|
274 |
+
foreach ( $group_val as $iterator => $field_id ) {
|
275 |
+
$this->render_group_row( $field_group, $remove_disabled );
|
276 |
+
}
|
277 |
+
} else {
|
278 |
+
$this->render_group_row( $field_group, $remove_disabled );
|
279 |
+
}
|
280 |
+
|
281 |
+
echo '<div class="cmb-row"><div class="cmb-td"><p class="cmb-add-row"><button data-selector="', $field_group->id(), '_repeat" data-grouptitle="', $field_group->options( 'group_title' ), '" class="cmb-add-group-row button">', $field_group->options( 'add_button' ), '</button></p></div></div>';
|
282 |
+
|
283 |
+
echo '</div></div></div>';
|
284 |
+
|
285 |
+
}
|
286 |
+
|
287 |
+
public function render_group_row( $field_group, $remove_disabled ) {
|
288 |
+
|
289 |
+
echo '
|
290 |
+
<div class="postbox cmb-row cmb-repeatable-grouping" data-iterator="', $field_group->count(), '">
|
291 |
+
|
292 |
+
<button ', $remove_disabled, 'data-selector="', $field_group->id(), '_repeat" class="dashicons-before dashicons-no-alt cmb-remove-group-row"></button>
|
293 |
+
<div class="cmbhandle" title="' , __( 'Click to toggle', 'cmb2' ), '"><br></div>
|
294 |
+
<h3 class="cmb-group-title cmbhandle-title"><span>', $field_group->replace_hash( $field_group->options( 'group_title' ) ), '</span></h3>
|
295 |
+
|
296 |
+
<div class="inside cmb-td cmb-nested cmb-field-list">';
|
297 |
+
// Loop and render repeatable group fields
|
298 |
+
foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
|
299 |
+
if ( 'hidden' == $field_args['type'] ) {
|
300 |
+
|
301 |
+
// Save rendering for after the metabox
|
302 |
+
$this->add_hidden_field( array(
|
303 |
+
'field_args' => $field_args,
|
304 |
+
'group_field' => $field_group,
|
305 |
+
) );
|
306 |
+
|
307 |
+
} else {
|
308 |
+
|
309 |
+
$field_args['show_names'] = $field_group->args( 'show_names' );
|
310 |
+
$field_args['context'] = $field_group->args( 'context' );
|
311 |
+
$field = new CMB2_Field( array(
|
312 |
+
'field_args' => $field_args,
|
313 |
+
'group_field' => $field_group,
|
314 |
+
) );
|
315 |
+
$field->render_field();
|
316 |
+
}
|
317 |
+
}
|
318 |
+
echo '
|
319 |
+
<div class="cmb-row cmb-remove-field-row">
|
320 |
+
<div class="cmb-remove-row">
|
321 |
+
<button ', $remove_disabled, 'data-selector="', $field_group->id(), '_repeat" class="button cmb-remove-group-row alignright">', $field_group->options( 'remove_button' ), '</button>
|
322 |
+
</div>
|
323 |
+
</div>
|
324 |
+
|
325 |
+
</div>
|
326 |
+
</div>
|
327 |
+
';
|
328 |
+
|
329 |
+
$field_group->args['count']++;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Add a hidden field to the list of hidden fields to be rendered later
|
334 |
+
* @since 2.0.0
|
335 |
+
* @param array $args Array of arguments to be passed to CMB2_Field
|
336 |
+
*/
|
337 |
+
public function add_hidden_field( $args ) {
|
338 |
+
$this->hidden_fields[] = new CMB2_Types( new CMB2_Field( $args ) );
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Loop through and output hidden fields
|
343 |
+
* @since 2.0.0
|
344 |
+
*/
|
345 |
+
public function render_hidden_fields() {
|
346 |
+
if ( ! empty( $this->hidden_fields ) ) {
|
347 |
+
foreach ( $this->hidden_fields as $hidden ) {
|
348 |
+
$hidden->render();
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Loops through and saves field data
|
355 |
+
* @since 1.0.0
|
356 |
+
* @param int $object_id Object ID
|
357 |
+
* @param string $object_type Type of object being saved. (e.g., post, user, or comment)
|
358 |
+
* @param array $data_to_save Array of key => value data for saving. Likely $_POST data.
|
359 |
+
*/
|
360 |
+
public function save_fields( $object_id = 0, $object_type = '', $data_to_save ) {
|
361 |
+
|
362 |
+
$this->data_to_save = $data_to_save;
|
363 |
+
$object_id = $this->object_id( $object_id );
|
364 |
+
$object_type = $this->object_type( $object_type );
|
365 |
+
|
366 |
+
$this->process_fields();
|
367 |
+
|
368 |
+
// If options page, save the updated options
|
369 |
+
if ( 'options-page' == $object_type ) {
|
370 |
+
cmb2_options( $object_id )->set();
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Fires after all fields have been saved.
|
375 |
+
*
|
376 |
+
* The dynamic portion of the hook name, $object_type, refers to the metabox/form's object type
|
377 |
+
* Usually `post` (this applies to all post-types).
|
378 |
+
* Could also be `comment`, `user` or `options-page`.
|
379 |
+
*
|
380 |
+
* @param int $object_id The ID of the current object
|
381 |
+
* @param array $cmb_id The current box ID
|
382 |
+
* @param string $updated All fields that were updated.
|
383 |
+
* Will only include fields that had values change.
|
384 |
+
* @param array $cmb This CMB2 object
|
385 |
+
*/
|
386 |
+
do_action( "cmb2_save_{$object_type}_fields", $object_id, $this->cmb_id, $this->updated, $this );
|
387 |
+
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Process and save form fields
|
392 |
+
* @since 2.0.0
|
393 |
+
*/
|
394 |
+
public function process_fields() {
|
395 |
+
$this->prop( 'show_on', array() );
|
396 |
+
|
397 |
+
// save field ids of those that are updated
|
398 |
+
$this->updated = array();
|
399 |
+
|
400 |
+
foreach ( $this->prop( 'fields' ) as $field_args ) {
|
401 |
+
$this->process_field( $field_args );
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Process and save a field
|
407 |
+
* @since 2.0.0
|
408 |
+
* @param array $field_args Array of field arguments
|
409 |
+
*/
|
410 |
+
public function process_field( $field_args ) {
|
411 |
+
|
412 |
+
switch ( $field_args['type'] ) {
|
413 |
+
|
414 |
+
case 'group':
|
415 |
+
$this->save_group( $field_args );
|
416 |
+
break;
|
417 |
+
|
418 |
+
case 'title':
|
419 |
+
// Don't process title fields
|
420 |
+
break;
|
421 |
+
|
422 |
+
default:
|
423 |
+
|
424 |
+
// Save default fields
|
425 |
+
$field = new CMB2_Field( array(
|
426 |
+
'field_args' => $field_args,
|
427 |
+
'object_type' => $this->object_type(),
|
428 |
+
'object_id' => $this->object_id(),
|
429 |
+
) );
|
430 |
+
|
431 |
+
if ( $field->save_field( $this->data_to_save ) ) {
|
432 |
+
$this->updated[] = $field->id();
|
433 |
+
}
|
434 |
+
|
435 |
+
break;
|
436 |
+
}
|
437 |
+
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Save a repeatable group
|
442 |
+
*/
|
443 |
+
public function save_group( $args ) {
|
444 |
+
|
445 |
+
if ( ! isset( $args['id'], $args['fields'], $this->data_to_save[ $args['id'] ] ) || ! is_array( $args['fields'] ) ) {
|
446 |
+
return;
|
447 |
+
}
|
448 |
+
|
449 |
+
$field_group = new CMB2_Field( array(
|
450 |
+
'field_args' => $args,
|
451 |
+
'object_type' => $this->object_type(),
|
452 |
+
'object_id' => $this->object_id(),
|
453 |
+
) );
|
454 |
+
$base_id = $field_group->id();
|
455 |
+
$old = $field_group->get_data();
|
456 |
+
$group_vals = $this->data_to_save[ $base_id ];
|
457 |
+
$saved = array();
|
458 |
+
$field_group->index = 0;
|
459 |
+
|
460 |
+
foreach ( array_values( $field_group->fields() ) as $field_args ) {
|
461 |
+
$field = new CMB2_Field( array(
|
462 |
+
'field_args' => $field_args,
|
463 |
+
'group_field' => $field_group,
|
464 |
+
) );
|
465 |
+
$sub_id = $field->id( true );
|
466 |
+
|
467 |
+
foreach ( (array) $group_vals as $field_group->index => $post_vals ) {
|
468 |
+
|
469 |
+
// Get value
|
470 |
+
$new_val = isset( $group_vals[ $field_group->index ][ $sub_id ] )
|
471 |
+
? $group_vals[ $field_group->index ][ $sub_id ]
|
472 |
+
: false;
|
473 |
+
|
474 |
+
// Sanitize
|
475 |
+
$new_val = $field->sanitization_cb( $new_val );
|
476 |
+
|
477 |
+
if ( 'file' == $field->type() && is_array( $new_val ) ) {
|
478 |
+
// Add image ID to the array stack
|
479 |
+
$saved[ $field_group->index ][ $new_val['field_id'] ] = $new_val['attach_id'];
|
480 |
+
// Reset var to url string
|
481 |
+
$new_val = $new_val['url'];
|
482 |
+
}
|
483 |
+
|
484 |
+
// Get old value
|
485 |
+
$old_val = is_array( $old ) && isset( $old[ $field_group->index ][ $sub_id ] )
|
486 |
+
? $old[ $field_group->index ][ $sub_id ]
|
487 |
+
: false;
|
488 |
+
|
489 |
+
$is_updated = ( ! empty( $new_val ) && $new_val != $old_val );
|
490 |
+
$is_removed = ( empty( $new_val ) && ! empty( $old_val ) );
|
491 |
+
// Compare values and add to `$updated` array
|
492 |
+
if ( $is_updated || $is_removed ) {
|
493 |
+
$this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id;
|
494 |
+
}
|
495 |
+
|
496 |
+
// Add to `$saved` array
|
497 |
+
$saved[ $field_group->index ][ $sub_id ] = $new_val;
|
498 |
+
|
499 |
+
}
|
500 |
+
$saved[ $field_group->index ] = array_filter( $saved[ $field_group->index ] );
|
501 |
+
}
|
502 |
+
$saved = array_filter( $saved );
|
503 |
+
|
504 |
+
$field_group->update_data( $saved, true );
|
505 |
+
}
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Get object id from global space if no id is provided
|
509 |
+
* @since 1.0.0
|
510 |
+
* @param integer $object_id Object ID
|
511 |
+
* @return integer $object_id Object ID
|
512 |
+
*/
|
513 |
+
public function object_id( $object_id = 0 ) {
|
514 |
+
|
515 |
+
if ( $object_id ) {
|
516 |
+
$this->object_id = $object_id;
|
517 |
+
return $this->object_id;
|
518 |
+
}
|
519 |
+
|
520 |
+
if ( $this->object_id ) {
|
521 |
+
return $this->object_id;
|
522 |
+
}
|
523 |
+
|
524 |
+
// Try to get our object ID from the global space
|
525 |
+
switch ( $this->object_type() ) {
|
526 |
+
case 'user':
|
527 |
+
$object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id;
|
528 |
+
$object_id = ! $object_id && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
|
529 |
+
break;
|
530 |
+
|
531 |
+
default:
|
532 |
+
$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
|
533 |
+
$object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id;
|
534 |
+
break;
|
535 |
+
}
|
536 |
+
|
537 |
+
// reset to id or 0
|
538 |
+
$this->object_id = $object_id ? $object_id : 0;
|
539 |
+
|
540 |
+
return $this->object_id;
|
541 |
+
}
|
542 |
+
|
543 |
+
/**
|
544 |
+
* Sets the $object_type based on metabox settings
|
545 |
+
* @since 1.0.0
|
546 |
+
* @return string Object type
|
547 |
+
*/
|
548 |
+
public function mb_object_type() {
|
549 |
+
|
550 |
+
if ( null !== $this->mb_object_type ) {
|
551 |
+
return $this->mb_object_type;
|
552 |
+
}
|
553 |
+
|
554 |
+
if ( $this->is_options_page_mb() ) {
|
555 |
+
$this->mb_object_type = 'options-page';
|
556 |
+
return $this->mb_object_type;
|
557 |
+
}
|
558 |
+
|
559 |
+
if ( ! $this->prop( 'object_types' ) ) {
|
560 |
+
$this->mb_object_type = 'post';
|
561 |
+
return $this->mb_object_type;
|
562 |
+
}
|
563 |
+
|
564 |
+
$type = false;
|
565 |
+
// check if 'object_types' is a string
|
566 |
+
if ( is_string( $this->prop( 'object_types' ) ) ) {
|
567 |
+
$type = $this->prop( 'object_types' );
|
568 |
+
}
|
569 |
+
// if it's an array of one, extract it
|
570 |
+
elseif ( is_array( $this->prop( 'object_types' ) ) && 1 === count( $this->prop( 'object_types' ) ) ) {
|
571 |
+
$cpts = $this->prop( 'object_types' );
|
572 |
+
$type = is_string( end( $cpts ) )
|
573 |
+
? end( $cpts )
|
574 |
+
: false;
|
575 |
+
}
|
576 |
+
|
577 |
+
if ( ! $type ) {
|
578 |
+
$this->mb_object_type = 'post';
|
579 |
+
return $this->mb_object_type;
|
580 |
+
}
|
581 |
+
|
582 |
+
// Get our object type
|
583 |
+
switch ( $type ) {
|
584 |
+
|
585 |
+
case 'user':
|
586 |
+
case 'comment':
|
587 |
+
$this->mb_object_type = $type;
|
588 |
+
break;
|
589 |
+
|
590 |
+
default:
|
591 |
+
$this->mb_object_type = 'post';
|
592 |
+
break;
|
593 |
+
}
|
594 |
+
|
595 |
+
return $this->mb_object_type;
|
596 |
+
}
|
597 |
+
|
598 |
+
/**
|
599 |
+
* Determines if metabox is for an options page
|
600 |
+
* @since 1.0.1
|
601 |
+
* @return boolean True/False
|
602 |
+
*/
|
603 |
+
public function is_options_page_mb() {
|
604 |
+
return ( isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key'] || array_key_exists( 'options-page', $this->meta_box['show_on'] ) );
|
605 |
+
}
|
606 |
+
|
607 |
+
/**
|
608 |
+
* Returns the object type
|
609 |
+
* @since 1.0.0
|
610 |
+
* @return string Object type
|
611 |
+
*/
|
612 |
+
public function object_type( $object_type = '' ) {
|
613 |
+
if ( $object_type ) {
|
614 |
+
$this->object_type = $object_type;
|
615 |
+
return $this->object_type;
|
616 |
+
}
|
617 |
+
|
618 |
+
if ( $this->object_type ) {
|
619 |
+
return $this->object_type;
|
620 |
+
}
|
621 |
+
|
622 |
+
global $pagenow;
|
623 |
+
|
624 |
+
if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
|
625 |
+
$this->object_type = 'user';
|
626 |
+
|
627 |
+
} elseif ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
|
628 |
+
$this->object_type = 'comment';
|
629 |
+
|
630 |
+
} else {
|
631 |
+
$this->object_type = 'post';
|
632 |
+
}
|
633 |
+
|
634 |
+
return $this->object_type;
|
635 |
+
}
|
636 |
+
|
637 |
+
/**
|
638 |
+
* Get metabox property and optionally set a fallback
|
639 |
+
* @since 2.0.0
|
640 |
+
* @param string $property Metabox config property to retrieve
|
641 |
+
* @param mixed $fallback Fallback value to set if no value found
|
642 |
+
* @return mixed Metabox config property value or false
|
643 |
+
*/
|
644 |
+
public function prop( $property, $fallback = null ) {
|
645 |
+
if ( array_key_exists( $property, $this->meta_box ) ) {
|
646 |
+
return $this->meta_box[ $property ];
|
647 |
+
} elseif ( $fallback ) {
|
648 |
+
return $this->meta_box[ $property ] = $fallback;
|
649 |
+
}
|
650 |
+
}
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Add a field to the metabox
|
654 |
+
* @since 2.0.0
|
655 |
+
* @param array $field Metabox field config array
|
656 |
+
* @param int $position (optional) Position of metabox. 1 for first, etc
|
657 |
+
* @return mixed Field id or false
|
658 |
+
*/
|
659 |
+
public function add_field( array $field, $position = 0 ) {
|
660 |
+
if ( ! is_array( $field ) || ! array_key_exists( 'id', $field ) ) {
|
661 |
+
return false;
|
662 |
+
}
|
663 |
+
|
664 |
+
$this->_add_field_to_array(
|
665 |
+
$field,
|
666 |
+
$this->meta_box['fields'],
|
667 |
+
$position
|
668 |
+
);
|
669 |
+
|
670 |
+
return $field['id'];
|
671 |
+
}
|
672 |
+
|
673 |
+
/**
|
674 |
+
* Add a field to the metabox
|
675 |
+
* @since 2.0.0
|
676 |
+
* @param string $parent_field_id The field id of the group field to add the field
|
677 |
+
* @param array $field Metabox field config array
|
678 |
+
* @param int $position (optional) Position of metabox. 1 for first, etc
|
679 |
+
* @return mixed Array of parent/field ids or false
|
680 |
+
*/
|
681 |
+
public function add_group_field( $parent_field_id, array $field, $position = 0 ) {
|
682 |
+
if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) {
|
683 |
+
return false;
|
684 |
+
}
|
685 |
+
|
686 |
+
$parent_field = $this->meta_box['fields'][ $parent_field_id ];
|
687 |
+
|
688 |
+
if ( 'group' !== $parent_field['type'] ) {
|
689 |
+
return false;
|
690 |
+
}
|
691 |
+
|
692 |
+
if ( ! isset( $parent_field['fields'] ) ) {
|
693 |
+
$this->meta_box['fields'][ $parent_field_id ]['fields'] = array();
|
694 |
+
}
|
695 |
+
|
696 |
+
$this->_add_field_to_array(
|
697 |
+
$field,
|
698 |
+
$this->meta_box['fields'][ $parent_field_id ]['fields'],
|
699 |
+
$position
|
700 |
+
);
|
701 |
+
|
702 |
+
return array( $parent_field_id, $field['id'] );
|
703 |
+
}
|
704 |
+
|
705 |
+
/**
|
706 |
+
* Add a field array to a fields array in desired position
|
707 |
+
* @since 2.0.2
|
708 |
+
* @param array $field Metabox field config array
|
709 |
+
* @param array &$fields Array (passed by reference) to append the field (array) to
|
710 |
+
* @param integer $position Optionally specify a position in the array to be inserted
|
711 |
+
*/
|
712 |
+
protected function _add_field_to_array( $field, &$fields, $position = 0 ) {
|
713 |
+
if ( $position ) {
|
714 |
+
cmb2_utils()->array_insert( $fields, array( $field['id'] => $field ), $position );
|
715 |
+
} else {
|
716 |
+
$fields[ $field['id'] ] = $field;
|
717 |
+
}
|
718 |
+
}
|
719 |
+
|
720 |
+
/**
|
721 |
+
* Remove a field from the metabox
|
722 |
+
* @since 2.0.0
|
723 |
+
* @param string $field_id The field id of the field to remove
|
724 |
+
* @param string $parent_field_id (optional) The field id of the group field to remove field from
|
725 |
+
* @return bool True if field was removed
|
726 |
+
*/
|
727 |
+
public function remove_field( $field_id, $parent_field_id = '' ) {
|
728 |
+
$ids = $this->get_field_ids( $field_id, $parent_field_id );
|
729 |
+
|
730 |
+
if ( ! $ids ) {
|
731 |
+
return false;
|
732 |
+
}
|
733 |
+
|
734 |
+
list( $field_id, $sub_field_id ) = $ids;
|
735 |
+
|
736 |
+
if ( ! $sub_field_id ) {
|
737 |
+
unset( $this->meta_box['fields'][ $field_id ] );
|
738 |
+
return true;
|
739 |
+
}
|
740 |
+
|
741 |
+
unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] );
|
742 |
+
return true;
|
743 |
+
}
|
744 |
+
|
745 |
+
/**
|
746 |
+
* Update or add a property to a field
|
747 |
+
* @since 2.0.0
|
748 |
+
* @param string $field_id Field id
|
749 |
+
* @param string $property Field property to set/update
|
750 |
+
* @param mixed $value Value to set the field property
|
751 |
+
* @param string $parent_field_id (optional) The field id of the group field to remove field from
|
752 |
+
* @return mixed Field id. Strict compare to false, as success can return a falsey value (like 0)
|
753 |
+
*/
|
754 |
+
public function update_field_property( $field_id, $property, $value, $parent_field_id = '' ) {
|
755 |
+
$ids = $this->get_field_ids( $field_id, $parent_field_id );
|
756 |
+
|
757 |
+
if ( ! $ids ) {
|
758 |
+
return false;
|
759 |
+
}
|
760 |
+
|
761 |
+
list( $field_id, $sub_field_id ) = $ids;
|
762 |
+
|
763 |
+
if ( ! $sub_field_id ) {
|
764 |
+
$this->meta_box['fields'][ $field_id ][ $property ] = $value;
|
765 |
+
return $field_id;
|
766 |
+
}
|
767 |
+
|
768 |
+
$this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value;
|
769 |
+
return $field_id;
|
770 |
+
}
|
771 |
+
|
772 |
+
/**
|
773 |
+
* Check if field ids match a field and return the index/field id
|
774 |
+
* @since 2.0.2
|
775 |
+
* @param string $field_id Field id
|
776 |
+
* @param string $parent_field_id (optional) Parent field id
|
777 |
+
* @return mixed Array of field/parent ids, or false
|
778 |
+
*/
|
779 |
+
public function get_field_ids( $field_id, $parent_field_id = '' ) {
|
780 |
+
$sub_field_id = $parent_field_id ? $field_id : '';
|
781 |
+
$field_id = $parent_field_id ? $parent_field_id : $field_id;
|
782 |
+
$fields =& $this->meta_box['fields'];
|
783 |
+
|
784 |
+
if ( ! array_key_exists( $field_id, $fields ) ) {
|
785 |
+
$field_id = $this->search_old_school_array( $field_id, $fields );
|
786 |
+
}
|
787 |
+
|
788 |
+
if ( false === $field_id ) {
|
789 |
+
return false;
|
790 |
+
}
|
791 |
+
|
792 |
+
if ( ! $sub_field_id ) {
|
793 |
+
return array( $field_id, $sub_field_id );
|
794 |
+
}
|
795 |
+
|
796 |
+
if ( 'group' !== $fields[ $field_id ]['type'] ) {
|
797 |
+
return false;
|
798 |
+
}
|
799 |
+
|
800 |
+
if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) {
|
801 |
+
$sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] );
|
802 |
+
}
|
803 |
+
|
804 |
+
return false === $sub_field_id ? false : array( $field_id, $sub_field_id );
|
805 |
+
}
|
806 |
+
|
807 |
+
/**
|
808 |
+
* When using the old array filter, it is unlikely field array indexes will be the field id
|
809 |
+
* @since 2.0.2
|
810 |
+
* @param string $field_id The field id
|
811 |
+
* @param array $fields Array of fields to search
|
812 |
+
* @return mixed Field index or false
|
813 |
+
*/
|
814 |
+
public function search_old_school_array( $field_id, $fields ) {
|
815 |
+
$ids = wp_list_pluck( $fields, 'id' );
|
816 |
+
$index = array_search( $field_id, $ids );
|
817 |
+
return false !== $index ? $index : false;
|
818 |
+
}
|
819 |
+
|
820 |
+
/**
|
821 |
+
* Generate a unique nonce field for each registered meta_box
|
822 |
+
* @since 2.0.0
|
823 |
+
* @return string unique nonce hidden input
|
824 |
+
*/
|
825 |
+
public function nonce_field() {
|
826 |
+
wp_nonce_field( $this->nonce(), $this->nonce(), false, true );
|
827 |
+
}
|
828 |
+
|
829 |
+
/**
|
830 |
+
* Generate a unique nonce for each registered meta_box
|
831 |
+
* @since 2.0.0
|
832 |
+
* @return string unique nonce string
|
833 |
+
*/
|
834 |
+
public function nonce() {
|
835 |
+
if ( $this->generated_nonce ) {
|
836 |
+
return $this->generated_nonce;
|
837 |
+
}
|
838 |
+
$this->generated_nonce = sanitize_html_class( 'nonce_' . basename( __FILE__ ) . $this->cmb_id );
|
839 |
+
return $this->generated_nonce;
|
840 |
+
}
|
841 |
+
|
842 |
+
/**
|
843 |
+
* Magic getter for our object.
|
844 |
+
* @param string $field
|
845 |
+
* @throws Exception Throws an exception if the field is invalid.
|
846 |
+
* @return mixed
|
847 |
+
*/
|
848 |
+
public function __get( $field ) {
|
849 |
+
switch ( $field ) {
|
850 |
+
case 'cmb_id':
|
851 |
+
case 'meta_box':
|
852 |
+
case 'updated':
|
853 |
+
return $this->{$field};
|
854 |
+
default:
|
855 |
+
throw new Exception( 'Invalid ' . __CLASS__ . ' property: ' . $field );
|
856 |
+
}
|
857 |
+
}
|
858 |
+
|
859 |
+
}
|
cmb2/includes/CMB2_Ajax.php
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* CMB ajax methods
|
5 |
+
* (i.e. a lot of work to get oEmbeds to work with non-post objects)
|
6 |
+
*
|
7 |
+
* @since 0.9.5
|
8 |
+
*/
|
9 |
+
class CMB2_Ajax {
|
10 |
+
|
11 |
+
|
12 |
+
// Whether to hijack the oembed cache system
|
13 |
+
protected $hijack = false;
|
14 |
+
protected $object_id = 0;
|
15 |
+
protected $embed_args = array();
|
16 |
+
protected $object_type = 'post';
|
17 |
+
protected $ajax_update = false;
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Handles our oEmbed ajax request
|
22 |
+
* @since 0.9.5
|
23 |
+
* @return object oEmbed embed code | fallback | error message
|
24 |
+
*/
|
25 |
+
public function oembed_handler() {
|
26 |
+
|
27 |
+
// Verify our nonce
|
28 |
+
if ( ! ( isset( $_REQUEST['cmb2_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['cmb2_ajax_nonce'], 'ajax_nonce' ) ) ) {
|
29 |
+
die();
|
30 |
+
}
|
31 |
+
|
32 |
+
// Sanitize our search string
|
33 |
+
$oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
|
34 |
+
|
35 |
+
// Send back error if empty
|
36 |
+
if ( empty( $oembed_string ) ) {
|
37 |
+
wp_send_json_error( '<p class="ui-state-error-text">' . __( 'Please Try Again', 'cmb2' ) . '</p>' );
|
38 |
+
}
|
39 |
+
|
40 |
+
// Set width of embed
|
41 |
+
$embed_width = isset( $_REQUEST['oembed_width'] ) && intval( $_REQUEST['oembed_width'] ) < 640 ? intval( $_REQUEST['oembed_width'] ) : '640';
|
42 |
+
|
43 |
+
// Set url
|
44 |
+
$oembed_url = esc_url( $oembed_string );
|
45 |
+
|
46 |
+
// Set args
|
47 |
+
$embed_args = array( 'width' => $embed_width );
|
48 |
+
|
49 |
+
$this->ajax_update = true;
|
50 |
+
|
51 |
+
// Get embed code (or fallback link)
|
52 |
+
$html = $this->get_oembed( array(
|
53 |
+
'url' => $oembed_url,
|
54 |
+
'object_id' => $_REQUEST['object_id'],
|
55 |
+
'object_type' => isset( $_REQUEST['object_type'] ) ? $_REQUEST['object_type'] : 'post',
|
56 |
+
'oembed_args' => $embed_args,
|
57 |
+
'field_id' => $_REQUEST['field_id'],
|
58 |
+
) );
|
59 |
+
|
60 |
+
wp_send_json_success( $html );
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Retrieves oEmbed from url/object ID
|
66 |
+
* @since 0.9.5
|
67 |
+
* @param array $args Arguments for method
|
68 |
+
* @return string html markup with embed or fallback
|
69 |
+
*/
|
70 |
+
public function get_oembed( $args ) {
|
71 |
+
|
72 |
+
global $wp_embed;
|
73 |
+
|
74 |
+
$oembed_url = esc_url( $args['url'] );
|
75 |
+
|
76 |
+
// Sanitize object_id
|
77 |
+
$this->object_id = is_numeric( $args['object_id'] ) ? absint( $args['object_id'] ) : sanitize_text_field( $args['object_id'] );
|
78 |
+
|
79 |
+
$args = wp_parse_args( $args, array(
|
80 |
+
'object_type' => 'post',
|
81 |
+
'oembed_args' => $this->embed_args,
|
82 |
+
'field_id' => false,
|
83 |
+
'cache_key' => false,
|
84 |
+
) );
|
85 |
+
|
86 |
+
$this->embed_args =& $args;
|
87 |
+
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Set the post_ID so oEmbed won't fail
|
91 |
+
* wp-includes/class-wp-embed.php, WP_Embed::shortcode()
|
92 |
+
*/
|
93 |
+
$wp_embed->post_ID = $this->object_id;
|
94 |
+
|
95 |
+
// Special scenario if NOT a post object
|
96 |
+
if ( isset( $args['object_type'] ) && 'post' != $args['object_type'] ) {
|
97 |
+
|
98 |
+
if ( 'options-page' == $args['object_type'] ) {
|
99 |
+
|
100 |
+
// Bogus id to pass some numeric checks. Issue with a VERY large WP install?
|
101 |
+
$wp_embed->post_ID = 1987645321;
|
102 |
+
|
103 |
+
// Use our own cache key to correspond to this field (vs one cache key per url)
|
104 |
+
$args['cache_key'] = $args['field_id'] . '_cache';
|
105 |
+
}
|
106 |
+
|
107 |
+
// Ok, we need to hijack the oembed cache system
|
108 |
+
$this->hijack = true;
|
109 |
+
$this->object_type = $args['object_type'];
|
110 |
+
|
111 |
+
// Gets ombed cache from our object's meta (vs postmeta)
|
112 |
+
add_filter( 'get_post_metadata', array( $this, 'hijack_oembed_cache_get' ), 10, 3 );
|
113 |
+
|
114 |
+
// Sets ombed cache in our object's meta (vs postmeta)
|
115 |
+
add_filter( 'update_post_metadata', array( $this, 'hijack_oembed_cache_set' ), 10, 4 );
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
$embed_args = '';
|
120 |
+
|
121 |
+
foreach ( $args['oembed_args'] as $key => $val ) {
|
122 |
+
$embed_args .= " $key=\"$val\"";
|
123 |
+
}
|
124 |
+
|
125 |
+
// Ping WordPress for an embed
|
126 |
+
$check_embed = $wp_embed->run_shortcode( '[embed' . $embed_args . ']' . $oembed_url . '[/embed]' );
|
127 |
+
|
128 |
+
// Fallback that WordPress creates when no oEmbed was found
|
129 |
+
$fallback = $wp_embed->maybe_make_link( $oembed_url );
|
130 |
+
|
131 |
+
// Send back our embed
|
132 |
+
if ( $check_embed && $check_embed != $fallback ) {
|
133 |
+
return '<div class="embed-status">' . $check_embed . '<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button" rel="' . $args['field_id'] . '">' . __( 'Remove Embed', 'cmb2' ) . '</a></p></div>';
|
134 |
+
}
|
135 |
+
|
136 |
+
// Otherwise, send back error info that no oEmbeds were found
|
137 |
+
return '<p class="ui-state-error-text">' . sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb2' ), $fallback ) . ' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Hijacks retrieving of cached oEmbed.
|
144 |
+
* Returns cached data from relevant object metadata (vs postmeta)
|
145 |
+
*
|
146 |
+
* @since 0.9.5
|
147 |
+
* @param boolean $check Whether to retrieve postmeta or override
|
148 |
+
* @param int $object_id Object ID
|
149 |
+
* @param string $meta_key Object metakey
|
150 |
+
* @return mixed Object's oEmbed cached data
|
151 |
+
*/
|
152 |
+
public function hijack_oembed_cache_get( $check, $object_id, $meta_key ) {
|
153 |
+
|
154 |
+
if ( ! $this->hijack || ( $this->object_id != $object_id && 1987645321 !== $object_id ) ) {
|
155 |
+
return $check;
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( $this->ajax_update ) {
|
159 |
+
return false;
|
160 |
+
}
|
161 |
+
|
162 |
+
// Get cached data
|
163 |
+
return ( 'options-page' === $this->object_type )
|
164 |
+
? cmb2_options( $this->object_id )->get( $this->embed_args['cache_key'] )
|
165 |
+
: get_metadata( $this->object_type, $this->object_id, $meta_key, true );
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Hijacks saving of cached oEmbed.
|
172 |
+
* Saves cached data to relevant object metadata (vs postmeta)
|
173 |
+
*
|
174 |
+
* @since 0.9.5
|
175 |
+
* @param boolean $check Whether to continue setting postmeta
|
176 |
+
* @param int $object_id Object ID to get postmeta from
|
177 |
+
* @param string $meta_key Postmeta's key
|
178 |
+
* @param mixed $meta_value Value of the postmeta to be saved
|
179 |
+
* @return boolean Whether to continue setting
|
180 |
+
*/
|
181 |
+
public function hijack_oembed_cache_set( $check, $object_id, $meta_key, $meta_value ) {
|
182 |
+
|
183 |
+
if ( ! $this->hijack || ( $this->object_id != $object_id && 1987645321 !== $object_id ) ) {
|
184 |
+
return $check;
|
185 |
+
}
|
186 |
+
|
187 |
+
$this->oembed_cache_set( $meta_key, $meta_value );
|
188 |
+
|
189 |
+
// Anything other than `null` to cancel saving to postmeta
|
190 |
+
return true;
|
191 |
+
}
|
192 |
+
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Saves the cached oEmbed value to relevant object metadata (vs postmeta)
|
196 |
+
*
|
197 |
+
* @since 1.3.0
|
198 |
+
* @param string $meta_key Postmeta's key
|
199 |
+
* @param mixed $meta_value Value of the postmeta to be saved
|
200 |
+
*/
|
201 |
+
public function oembed_cache_set( $meta_key, $meta_value ) {
|
202 |
+
|
203 |
+
// Cache the result to our metadata
|
204 |
+
return ( 'options-page' !== $this->object_type )
|
205 |
+
? update_metadata( $this->object_type, $this->object_id, $meta_key, $meta_value )
|
206 |
+
: cmb2_options( $this->object_id )->update( $this->embed_args['cache_key'], $meta_value, true );
|
207 |
+
}
|
208 |
+
|
209 |
+
}
|
cmb2/includes/CMB2_Boxes.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Stores each CMB2 instance
|
4 |
+
*/
|
5 |
+
class CMB2_Boxes {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Array of all metabox objects
|
9 |
+
* @var array
|
10 |
+
* @since 2.0.0
|
11 |
+
*/
|
12 |
+
protected static $meta_boxes = array();
|
13 |
+
|
14 |
+
public static function add( $meta_box ) {
|
15 |
+
self::$meta_boxes[ $meta_box->cmb_id ] = $meta_box;
|
16 |
+
}
|
17 |
+
|
18 |
+
public static function remove( $meta_box_id ) {
|
19 |
+
if ( array_key_exists( $meta_box_id, self::$meta_boxes ) ) {
|
20 |
+
unset( self::$meta_boxes[ $meta_box_id ] );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
public static function get( $cmb_id ) {
|
25 |
+
if ( empty( self::$meta_boxes ) || empty( self::$meta_boxes[ $cmb_id ] ) ) {
|
26 |
+
return false;
|
27 |
+
}
|
28 |
+
|
29 |
+
return self::$meta_boxes[ $cmb_id ];
|
30 |
+
}
|
31 |
+
|
32 |
+
public static function get_all() {
|
33 |
+
return self::$meta_boxes;
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
cmb2/includes/CMB2_Field.php
ADDED
@@ -0,0 +1,892 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
3 |
+
/**
|
4 |
+
* CMB field class
|
5 |
+
*
|
6 |
+
* @since 1.1.0
|
7 |
+
*
|
8 |
+
* @method string _id()
|
9 |
+
* @method string type()
|
10 |
+
* @method mixed fields()
|
11 |
+
* @method mixed count()
|
12 |
+
*/
|
13 |
+
class CMB2_Field {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Metabox object id
|
17 |
+
* @var mixed
|
18 |
+
* @since 1.1.0
|
19 |
+
*/
|
20 |
+
public $object_id = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Metabox object type
|
24 |
+
* @var string
|
25 |
+
* @since 1.1.0
|
26 |
+
*/
|
27 |
+
public $object_type = '';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Field arguments
|
31 |
+
* @var mixed
|
32 |
+
* @since 1.1.0
|
33 |
+
*/
|
34 |
+
public $args = array();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Field group object or false (if no group)
|
38 |
+
* @var mixed
|
39 |
+
* @since 1.1.0
|
40 |
+
*/
|
41 |
+
public $group = false;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Field meta value
|
45 |
+
* @var mixed
|
46 |
+
* @since 1.1.0
|
47 |
+
*/
|
48 |
+
public $value = null;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Field meta value
|
52 |
+
* @var mixed
|
53 |
+
* @since 1.1.0
|
54 |
+
*/
|
55 |
+
public $escaped_value = null;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Grouped Field's current numeric index during the save process
|
59 |
+
* @var mixed
|
60 |
+
* @since 2.0.0
|
61 |
+
*/
|
62 |
+
public $index = 0;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Array of field options
|
66 |
+
* @var array
|
67 |
+
* @since 2.0.0
|
68 |
+
*/
|
69 |
+
protected $field_options = array();
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Array of field param callback results
|
73 |
+
* @var array
|
74 |
+
* @since 2.0.0
|
75 |
+
*/
|
76 |
+
protected $callback_results = array();
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Constructs our field object
|
80 |
+
* @since 1.1.0
|
81 |
+
* @param array $args Field arguments
|
82 |
+
*/
|
83 |
+
public function __construct( $args ) {
|
84 |
+
|
85 |
+
if ( ! empty( $args['group_field'] ) ) {
|
86 |
+
$this->group = $args['group_field'];
|
87 |
+
$this->object_id = $this->group->object_id;
|
88 |
+
$this->object_type = $this->group->object_type;
|
89 |
+
} else {
|
90 |
+
$this->object_id = $args['object_id'];
|
91 |
+
$this->object_type = isset( $args['object_type'] ) ? $args['object_type'] : 'post';
|
92 |
+
}
|
93 |
+
|
94 |
+
$this->args = $this->_set_field_defaults( $args['field_args'] );
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Filter whether to override getting of meta value.
|
98 |
+
* Returning a non 'cmb2_field_no_override_val' value
|
99 |
+
* will effectively short-circuit the value retrieval.
|
100 |
+
*
|
101 |
+
* @since 2.0.0
|
102 |
+
*
|
103 |
+
* @param null|array|string $value The value get_metadata() should
|
104 |
+
* return - a single metadata value,
|
105 |
+
* or an array of values.
|
106 |
+
* @param int $object_id Object ID.
|
107 |
+
* @param array $field_args All field arguments
|
108 |
+
* @param string $object_type Object Type
|
109 |
+
* @param CMB2_Field object $field_obj This field object
|
110 |
+
*/
|
111 |
+
$this->value = apply_filters( 'cmb2_override_meta_value', 'cmb2_field_no_override_val', $this->object_id, $this->args(), $this->object_type, $this );
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Filter whether to override getting of meta value.
|
115 |
+
*
|
116 |
+
* The dynamic portion of the hook, $field_id, refers to the current
|
117 |
+
* field id paramater. Returning a non 'cmb2_field_no_override_val' value
|
118 |
+
* will effectively short-circuit the value retrieval.
|
119 |
+
*
|
120 |
+
* @since 2.0.0
|
121 |
+
*
|
122 |
+
* @param null|array|string $value The value get_metadata() should
|
123 |
+
* return - a single metadata value,
|
124 |
+
* or an array of values.
|
125 |
+
* @param int $object_id Object ID.
|
126 |
+
* @param array $field_args All field arguments
|
127 |
+
* @param string $object_type Object Type
|
128 |
+
* @param CMB2_Field object $field_obj This field object
|
129 |
+
*/
|
130 |
+
$this->value = apply_filters( "cmb2_override_{$this->id( true )}_meta_value", $this->value, $this->object_id, $this->args(), $this->object_type, $this );
|
131 |
+
|
132 |
+
// If no override, get our meta
|
133 |
+
$this->value = 'cmb2_field_no_override_val' === $this->value
|
134 |
+
? $this->get_data()
|
135 |
+
: $this->value;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Non-existent methods fallback to checking for field arguments of the same name
|
140 |
+
* @since 1.1.0
|
141 |
+
* @param string $name Method name
|
142 |
+
* @param array $arguments Array of passed-in arguments
|
143 |
+
* @return mixed Value of field argument
|
144 |
+
*/
|
145 |
+
public function __call( $name, $arguments ) {
|
146 |
+
$key = isset( $arguments[0] ) ? $arguments[0] : false;
|
147 |
+
return $this->args( $name, $key );
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Retrieves the field id
|
152 |
+
* @since 1.1.0
|
153 |
+
* @param boolean $raw Whether to retrieve pre-modidifed id
|
154 |
+
* @return string Field id
|
155 |
+
*/
|
156 |
+
public function id( $raw = false ) {
|
157 |
+
$id = $raw ? '_id' : 'id';
|
158 |
+
return $this->args( $id );
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Get a field argument
|
163 |
+
* @since 1.1.0
|
164 |
+
* @param string $key Argument to check
|
165 |
+
* @param string $key Sub argument to check
|
166 |
+
* @return mixed Argument value or false if non-existent
|
167 |
+
*/
|
168 |
+
public function args( $key = '', $_key = '' ) {
|
169 |
+
$vars = $this->_data( 'args', $key );
|
170 |
+
if ( $_key ) {
|
171 |
+
return isset( $vars[ $_key ] ) ? $vars[ $_key ] : false;
|
172 |
+
}
|
173 |
+
return $vars;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get Field's value
|
178 |
+
* @since 1.1.0
|
179 |
+
* @param string $key If value is an array, is used to get array key->value
|
180 |
+
* @return mixed Field value or false if non-existent
|
181 |
+
*/
|
182 |
+
public function value( $key = '' ) {
|
183 |
+
return $this->_data( 'value', $key );
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Retrieve a portion of a field property
|
188 |
+
* @since 1.1.0
|
189 |
+
* @param string $var Field property to check
|
190 |
+
* @param string $key Field property array key to check
|
191 |
+
* @return mixed Queried property value or false
|
192 |
+
*/
|
193 |
+
public function _data( $var, $key = '' ) {
|
194 |
+
$vars = $this->$var;
|
195 |
+
if ( $key ) {
|
196 |
+
return isset( $vars[ $key ] ) ? $vars[ $key ] : false;
|
197 |
+
}
|
198 |
+
return $vars;
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Retrieves metadata/option data
|
203 |
+
* @since 1.0.1
|
204 |
+
* @param string $field_id Meta key/Option array key
|
205 |
+
* @return mixed Meta/Option value
|
206 |
+
*/
|
207 |
+
public function get_data( $field_id = '', $args = array() ) {
|
208 |
+
if ( $field_id ) {
|
209 |
+
$args['field_id'] = $field_id;
|
210 |
+
} else if ( $this->group ) {
|
211 |
+
$args['field_id'] = $this->group->id();
|
212 |
+
}
|
213 |
+
|
214 |
+
$a = $this->data_args( $args );
|
215 |
+
|
216 |
+
$data = 'options-page' === $a['type']
|
217 |
+
? cmb2_options( $a['id'] )->get( $a['field_id'] )
|
218 |
+
: get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) );
|
219 |
+
|
220 |
+
if ( $this->group && $data ) {
|
221 |
+
$data = isset( $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ] )
|
222 |
+
? $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ]
|
223 |
+
: false;
|
224 |
+
}
|
225 |
+
return $data;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Updates metadata/option data
|
230 |
+
* @since 1.0.1
|
231 |
+
* @param mixed $new_value Value to update data with
|
232 |
+
* @param bool $single Whether data is an array (add_metadata)
|
233 |
+
*/
|
234 |
+
public function update_data( $new_value, $single = true ) {
|
235 |
+
$a = $this->data_args( array( 'single' => $single ) );
|
236 |
+
|
237 |
+
$a[ 'value' ] = $a['repeat'] ? array_values( $new_value ) : $new_value;
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Filter whether to override saving of meta value.
|
241 |
+
* Returning a non-null value will effectively short-circuit the function.
|
242 |
+
*
|
243 |
+
* @since 2.0.0
|
244 |
+
*
|
245 |
+
* @param null|bool $check Whether to allow updating metadata for the given type.
|
246 |
+
* @param array $args Array of data about current field including:
|
247 |
+
* 'type' : Current object type
|
248 |
+
* 'id' : Current object ID
|
249 |
+
* 'field_id' : Current Field ID
|
250 |
+
* 'repeat' : Whether current field is repeatable
|
251 |
+
* 'single' : Whether to save as a
|
252 |
+
* single meta value
|
253 |
+
* @param array $field_args All field arguments
|
254 |
+
* @param CMB2_Field object $field_obj This field object
|
255 |
+
*/
|
256 |
+
$override = apply_filters( 'cmb2_override_meta_save', null, $a, $this->args(), $this );
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Filter whether to override saving of meta value.
|
260 |
+
*
|
261 |
+
* The dynamic portion of the hook, $a['field_id'], refers to the current
|
262 |
+
* field id paramater. Returning a non-null value
|
263 |
+
* will effectively short-circuit the function.
|
264 |
+
*
|
265 |
+
* @since 2.0.0
|
266 |
+
*
|
267 |
+
* @param null|bool $check Whether to allow updating metadata for the given type.
|
268 |
+
* @param array $args Array of data about current field including:
|
269 |
+
* 'type' : Current object type
|
270 |
+
* 'id' : Current object ID
|
271 |
+
* 'field_id' : Current Field ID
|
272 |
+
* 'repeat' : Whether current field is repeatable
|
273 |
+
* 'single' : Whether to save as a
|
274 |
+
* single meta value
|
275 |
+
* @param array $field_args All field arguments
|
276 |
+
* @param CMB2_Field object $field_obj This field object
|
277 |
+
*/
|
278 |
+
$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this );
|
279 |
+
|
280 |
+
// If override, return that
|
281 |
+
if ( null !== $override ) {
|
282 |
+
return $override;
|
283 |
+
}
|
284 |
+
// Options page handling
|
285 |
+
if ( 'options-page' === $a['type'] ) {
|
286 |
+
return cmb2_options( $a['id'] )->update( $a['field_id'], $a[ 'value' ], false, $a['single'] );
|
287 |
+
}
|
288 |
+
// Add metadata if not single
|
289 |
+
if ( ! $a['single'] ) {
|
290 |
+
return add_metadata( $a['type'], $a['id'], $a['field_id'], $a[ 'value' ], false );
|
291 |
+
}
|
292 |
+
// Delete meta if we have an empty array
|
293 |
+
if ( is_array( $a[ 'value' ] ) && empty( $a[ 'value' ] ) ) {
|
294 |
+
return delete_metadata( $a['type'], $a['id'], $a['field_id'], $this->value );
|
295 |
+
}
|
296 |
+
|
297 |
+
// Update metadata
|
298 |
+
return update_metadata( $a['type'], $a['id'], $a['field_id'], $a[ 'value' ] );
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Removes/updates metadata/option data
|
303 |
+
* @since 1.0.1
|
304 |
+
* @param string $old Old value
|
305 |
+
*/
|
306 |
+
public function remove_data( $old = '' ) {
|
307 |
+
$a = $this->data_args( array( 'old' => $old ) );
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Filter whether to override removing of meta value.
|
311 |
+
* Returning a non-null value will effectively short-circuit the function.
|
312 |
+
*
|
313 |
+
* @since 2.0.0
|
314 |
+
*
|
315 |
+
* @param null|bool $delete Whether to allow metadata deletion of the given type.
|
316 |
+
* @param array $args Array of data about current field including:
|
317 |
+
* 'type' : Current object type
|
318 |
+
* 'id' : Current object ID
|
319 |
+
* 'field_id' : Current Field ID
|
320 |
+
* 'repeat' : Whether current field is repeatable
|
321 |
+
* 'single' : Whether to save as a
|
322 |
+
* single meta value
|
323 |
+
* @param array $field_args All field arguments
|
324 |
+
* @param CMB2_Field object $field_obj This field object
|
325 |
+
*/
|
326 |
+
$override = apply_filters( 'cmb2_override_meta_remove', null, $a, $this->args(), $this );
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Filter whether to override removing of meta value.
|
330 |
+
*
|
331 |
+
* The dynamic portion of the hook, $a['field_id'], refers to the current
|
332 |
+
* field id paramater. Returning a non-null value
|
333 |
+
* will effectively short-circuit the function.
|
334 |
+
*
|
335 |
+
* @since 2.0.0
|
336 |
+
*
|
337 |
+
* @param null|bool $delete Whether to allow metadata deletion of the given type.
|
338 |
+
* @param array $args Array of data about current field including:
|
339 |
+
* 'type' : Current object type
|
340 |
+
* 'id' : Current object ID
|
341 |
+
* 'field_id' : Current Field ID
|
342 |
+
* 'repeat' : Whether current field is repeatable
|
343 |
+
* 'single' : Whether to save as a
|
344 |
+
* single meta value
|
345 |
+
* @param array $field_args All field arguments
|
346 |
+
* @param CMB2_Field object $field_obj This field object
|
347 |
+
*/
|
348 |
+
$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this );
|
349 |
+
|
350 |
+
// If no override, remove as usual
|
351 |
+
if ( null !== $override ) {
|
352 |
+
return $override;
|
353 |
+
}
|
354 |
+
// Option page handling
|
355 |
+
elseif ( 'options-page' === $a['type'] ) {
|
356 |
+
return cmb2_options( $a['id'] )->remove( $a['field_id'] );
|
357 |
+
}
|
358 |
+
|
359 |
+
// Remove metadata
|
360 |
+
return delete_metadata( $a['type'], $a['id'], $a['field_id'], $old );
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* data variables for get/set data methods
|
365 |
+
* @since 1.1.0
|
366 |
+
* @param array $args Override arguments
|
367 |
+
* @return array Updated arguments
|
368 |
+
*/
|
369 |
+
public function data_args( $args = array() ) {
|
370 |
+
$args = wp_parse_args( $args, array(
|
371 |
+
'type' => $this->object_type,
|
372 |
+
'id' => $this->object_id,
|
373 |
+
'field_id' => $this->id( true ),
|
374 |
+
'repeat' => $this->args( 'repeatable' ),
|
375 |
+
'single' => ! $this->args( 'multiple' ),
|
376 |
+
) );
|
377 |
+
return $args;
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Checks if field has a registered sanitization callback
|
382 |
+
* @since 1.0.1
|
383 |
+
* @param mixed $meta_value Meta value
|
384 |
+
* @return mixed Possibly sanitized meta value
|
385 |
+
*/
|
386 |
+
public function sanitization_cb( $meta_value ) {
|
387 |
+
|
388 |
+
if ( $this->args( 'repeatable' ) && is_array( $meta_value ) ) {
|
389 |
+
// Remove empties
|
390 |
+
$meta_value = array_filter( $meta_value );
|
391 |
+
}
|
392 |
+
|
393 |
+
// Check if the field has a registered validation callback
|
394 |
+
$cb = $this->maybe_callback( 'sanitization_cb' );
|
395 |
+
if ( false === $cb ) {
|
396 |
+
// If requesting NO validation, return meta value
|
397 |
+
return $meta_value;
|
398 |
+
} elseif ( $cb ) {
|
399 |
+
// Ok, callback is good, let's run it.
|
400 |
+
return call_user_func( $cb, $meta_value, $this->args(), $this );
|
401 |
+
}
|
402 |
+
|
403 |
+
$clean = new CMB2_Sanitize( $this, $meta_value );
|
404 |
+
// Validation via 'CMB2_Sanitize' (with fallback filter)
|
405 |
+
return $clean->{$this->type()}( $meta_value );
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Process $_POST data to save this field's value
|
410 |
+
* @since 2.0.0
|
411 |
+
* @param array $data_to_save $_POST data to check
|
412 |
+
* @return bool Result of save
|
413 |
+
*/
|
414 |
+
public function save_field( $data_to_save ) {
|
415 |
+
|
416 |
+
$meta_value = isset( $data_to_save[ $this->id( true ) ] )
|
417 |
+
? $data_to_save[ $this->id( true ) ]
|
418 |
+
: null;
|
419 |
+
|
420 |
+
$new_value = $this->sanitization_cb( $meta_value );
|
421 |
+
$old = $this->get_data();
|
422 |
+
// $name = $this->id();
|
423 |
+
// if ( $this->args( 'multiple' ) && ! $this->args( 'repeatable' ) && ! $this->group ) {
|
424 |
+
// $this->remove_data();
|
425 |
+
// if ( ! empty( $new_value ) ) {
|
426 |
+
// foreach ( $new_value as $add_new ) {
|
427 |
+
// $this->updated[] = $name;
|
428 |
+
// $this->update_data( $add_new, $name, false );
|
429 |
+
// }
|
430 |
+
// }
|
431 |
+
// } else
|
432 |
+
if ( ! cmb2_utils()->isempty( $new_value ) && $new_value !== $old ) {
|
433 |
+
return $this->update_data( $new_value );
|
434 |
+
} elseif ( cmb2_utils()->isempty( $new_value ) ) {
|
435 |
+
return $this->remove_data();
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Checks if field has a callback value
|
441 |
+
* @since 1.0.1
|
442 |
+
* @param string $cb Callback string
|
443 |
+
* @return mixed NULL, false for NO validation, or $cb string if it exists.
|
444 |
+
*/
|
445 |
+
public function maybe_callback( $cb ) {
|
446 |
+
$field_args = $this->args();
|
447 |
+
if ( ! isset( $field_args[ $cb ] ) ) {
|
448 |
+
return;
|
449 |
+
}
|
450 |
+
|
451 |
+
// Check if metabox is requesting NO validation
|
452 |
+
$cb = false !== $field_args[ $cb ] && 'false' !== $field_args[ $cb ] ? $field_args[ $cb ] : false;
|
453 |
+
|
454 |
+
// If requestion NO validation, return false
|
455 |
+
if ( ! $cb ) {
|
456 |
+
return false;
|
457 |
+
}
|
458 |
+
|
459 |
+
if ( is_callable( $cb ) ) {
|
460 |
+
return $cb;
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Determine if current type is excempt from escaping
|
466 |
+
* @since 1.1.0
|
467 |
+
* @return bool True if exempt
|
468 |
+
*/
|
469 |
+
public function escaping_exception() {
|
470 |
+
// These types cannot be escaped
|
471 |
+
return in_array( $this->type(), array(
|
472 |
+
'file_list',
|
473 |
+
'multicheck',
|
474 |
+
'text_datetime_timestamp_timezone',
|
475 |
+
) );
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Determine if current type cannot be repeatable
|
480 |
+
* @since 1.1.0
|
481 |
+
* @param string $type Field type to check
|
482 |
+
* @return bool True if type cannot be repeatable
|
483 |
+
*/
|
484 |
+
public function repeatable_exception( $type ) {
|
485 |
+
// These types cannot be escaped
|
486 |
+
return in_array( $type, array(
|
487 |
+
'file', // Use file_list
|
488 |
+
'radio',
|
489 |
+
'title',
|
490 |
+
'group',
|
491 |
+
// @todo Ajax load wp_editor: http://wordpress.stackexchange.com/questions/51776/how-to-load-wp-editor-through-ajax-jquery
|
492 |
+
'wysiwyg',
|
493 |
+
'checkbox',
|
494 |
+
'radio_inline',
|
495 |
+
'taxonomy_radio',
|
496 |
+
'taxonomy_select',
|
497 |
+
'taxonomy_multicheck',
|
498 |
+
) );
|
499 |
+
}
|
500 |
+
|
501 |
+
/**
|
502 |
+
* Escape the value before output. Defaults to 'esc_attr()'
|
503 |
+
* @since 1.0.1
|
504 |
+
* @param mixed $meta_value Meta value
|
505 |
+
* @param callable $func Escaping function (if not esc_attr())
|
506 |
+
* @return mixed Final value
|
507 |
+
*/
|
508 |
+
public function escaped_value( $func = 'esc_attr', $meta_value = '' ) {
|
509 |
+
|
510 |
+
if ( ! is_null( $this->escaped_value ) ) {
|
511 |
+
return $this->escaped_value;
|
512 |
+
}
|
513 |
+
|
514 |
+
$meta_value = $meta_value ? $meta_value : $this->value();
|
515 |
+
|
516 |
+
// Check if the field has a registered escaping callback
|
517 |
+
if ( $cb = $this->maybe_callback( 'escape_cb' ) ) {
|
518 |
+
// Ok, callback is good, let's run it.
|
519 |
+
return call_user_func( $cb, $meta_value, $this->args(), $this );
|
520 |
+
}
|
521 |
+
|
522 |
+
// Or custom escaping filter can be used
|
523 |
+
$esc = apply_filters( "cmb2_types_esc_{$this->type()}", null, $meta_value, $this->args(), $this );
|
524 |
+
if ( null !== $esc ) {
|
525 |
+
return $esc;
|
526 |
+
}
|
527 |
+
|
528 |
+
if ( false === $cb || $this->escaping_exception() ) {
|
529 |
+
// If requesting NO escaping, return meta value
|
530 |
+
return $this->val_or_default( $meta_value );
|
531 |
+
}
|
532 |
+
|
533 |
+
// escaping function passed in?
|
534 |
+
$func = $func ? $func : 'esc_attr';
|
535 |
+
$meta_value = $this->val_or_default( $meta_value );
|
536 |
+
|
537 |
+
if ( is_array( $meta_value ) ) {
|
538 |
+
foreach ( $meta_value as $key => $value ) {
|
539 |
+
$meta_value[ $key ] = call_user_func( $func, $value );
|
540 |
+
}
|
541 |
+
} else {
|
542 |
+
$meta_value = call_user_func( $func, $meta_value );
|
543 |
+
}
|
544 |
+
|
545 |
+
$this->escaped_value = $meta_value;
|
546 |
+
return $this->escaped_value;
|
547 |
+
}
|
548 |
+
|
549 |
+
/**
|
550 |
+
* Return non-empty value or field default if value IS empty
|
551 |
+
* @since 2.0.0
|
552 |
+
* @param mixed $meta_value Field value
|
553 |
+
* @return mixed Field value, or default value
|
554 |
+
*/
|
555 |
+
public function val_or_default( $meta_value ) {
|
556 |
+
return ! cmb2_utils()->isempty( $meta_value ) ? $meta_value : $this->args( 'default' );
|
557 |
+
}
|
558 |
+
|
559 |
+
/**
|
560 |
+
* Offset a time value based on timezone
|
561 |
+
* @since 1.0.0
|
562 |
+
* @return string Offset time string
|
563 |
+
*/
|
564 |
+
public function field_timezone_offset() {
|
565 |
+
return cmb2_utils()->timezone_offset( $this->field_timezone() );
|
566 |
+
}
|
567 |
+
|
568 |
+
/**
|
569 |
+
* Return timezone string
|
570 |
+
* @since 1.0.0
|
571 |
+
* @return string Timezone string
|
572 |
+
*/
|
573 |
+
public function field_timezone() {
|
574 |
+
|
575 |
+
// Is timezone arg set?
|
576 |
+
if ( $this->args( 'timezone' ) ) {
|
577 |
+
return $this->args( 'timezone' );
|
578 |
+
}
|
579 |
+
// Is there another meta key with a timezone stored as its value we should use?
|
580 |
+
else if ( $this->args( 'timezone_meta_key' ) ) {
|
581 |
+
return $this->get_data( $this->args( 'timezone_meta_key' ) );
|
582 |
+
}
|
583 |
+
|
584 |
+
return '';
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Format the timestamp field value based on the field date/time format arg
|
589 |
+
* @since 2.0.0
|
590 |
+
* @param int $meta_value Timestamp
|
591 |
+
* @param string $format Either date_format or time_format
|
592 |
+
* @return string Formatted date
|
593 |
+
*/
|
594 |
+
public function format_timestamp( $meta_value, $format = 'date_format' ) {
|
595 |
+
return date( stripslashes( $this->args( $format ) ), $meta_value );
|
596 |
+
}
|
597 |
+
|
598 |
+
/**
|
599 |
+
* Return a formatted timestamp for a field
|
600 |
+
* @since 2.0.0
|
601 |
+
* @param string $format Either date_format or time_format
|
602 |
+
* @return string Formatted date
|
603 |
+
*/
|
604 |
+
public function get_timestamp_format( $format = 'date_format', $meta_value = 0 ) {
|
605 |
+
$meta_value = $meta_value ? $meta_value : $this->escaped_value();
|
606 |
+
$meta_value = cmb2_utils()->make_valid_time_stamp( $meta_value );
|
607 |
+
|
608 |
+
if ( empty( $meta_value ) ) {
|
609 |
+
return '';
|
610 |
+
}
|
611 |
+
|
612 |
+
return is_array( $meta_value )
|
613 |
+
? array_map( array( $this, 'format_timestamp' ), $meta_value, $format )
|
614 |
+
: $this->format_timestamp( $meta_value, $format );
|
615 |
+
}
|
616 |
+
|
617 |
+
/**
|
618 |
+
* Render a field row
|
619 |
+
* @since 1.0.0
|
620 |
+
*/
|
621 |
+
public function render_field() {
|
622 |
+
|
623 |
+
// If field is requesting to not be shown on the front-end
|
624 |
+
if ( ! is_admin() && ! $this->args( 'on_front' ) ) {
|
625 |
+
return;
|
626 |
+
}
|
627 |
+
|
628 |
+
// If field is requesting to be conditionally shown
|
629 |
+
if ( is_callable( $this->args( 'show_on_cb' ) ) && ! call_user_func( $this->args( 'show_on_cb' ), $this ) ) {
|
630 |
+
return;
|
631 |
+
}
|
632 |
+
|
633 |
+
$this->peform_param_callback( 'before_row' );
|
634 |
+
|
635 |
+
printf( "<div class=\"cmb-row %s\">\n", $this->row_classes() );
|
636 |
+
|
637 |
+
if ( 'title' == $this->type() || ! $this->args( 'show_names' ) ) {
|
638 |
+
echo "\t<div class=\"cmb-td\">\n";
|
639 |
+
|
640 |
+
if ( ! $this->args( 'show_names' ) ) {
|
641 |
+
$style = 'title' == $this->type() ? '' : ' style="display:none;"';
|
642 |
+
printf( "\n<label%s for=\"%s\">%s</label>\n", $style, $this->id(), $this->args( 'name' ) );
|
643 |
+
}
|
644 |
+
} else {
|
645 |
+
|
646 |
+
if ( $this->args( 'name' ) ) {
|
647 |
+
printf( '<div class="cmb-th"><label for="%1$s">%2$s</label></div>', $this->id(), $this->args( 'name' ) );
|
648 |
+
}
|
649 |
+
|
650 |
+
echo "\n\t<div class=\"cmb-td\">\n";
|
651 |
+
}
|
652 |
+
|
653 |
+
$this->peform_param_callback( 'before' );
|
654 |
+
|
655 |
+
$this_type = new CMB2_Types( $this );
|
656 |
+
$this_type->render();
|
657 |
+
|
658 |
+
$this->peform_param_callback( 'after' );
|
659 |
+
|
660 |
+
echo "\n\t</div>\n</div>";
|
661 |
+
|
662 |
+
$this->peform_param_callback( 'after_row' );
|
663 |
+
}
|
664 |
+
|
665 |
+
/**
|
666 |
+
* Defines the classes for the current CMB field row
|
667 |
+
*
|
668 |
+
* @since 2.0.0
|
669 |
+
* @return string Space concatenated list of classes
|
670 |
+
*/
|
671 |
+
public function row_classes() {
|
672 |
+
|
673 |
+
$classes = array();
|
674 |
+
|
675 |
+
/**
|
676 |
+
* By default, 'text_url' and 'text' fields get table-like styling
|
677 |
+
*
|
678 |
+
* @since 2.0.0
|
679 |
+
*
|
680 |
+
* @param array $field_types The types of fields which should get the 'table-layout' class
|
681 |
+
*/
|
682 |
+
$repeat_table_rows_types = apply_filters( 'cmb2_repeat_table_row_types', array(
|
683 |
+
'text_url', 'text',
|
684 |
+
) );
|
685 |
+
|
686 |
+
$conditional_classes = array(
|
687 |
+
'cmb-type-' . str_replace( '_', '-', sanitize_html_class( $this->type() ) ) => true,
|
688 |
+
'cmb2-id-' . str_replace( '_', '-', sanitize_html_class( $this->id() ) ) => true,
|
689 |
+
'cmb-repeat' => $this->args( 'repeatable' ),
|
690 |
+
'cmb-repeat-group-field' => $this->group,
|
691 |
+
'cmb-inline' => $this->args( 'inline' ),
|
692 |
+
'table-layout' => in_array( $this->type(), $repeat_table_rows_types ),
|
693 |
+
);
|
694 |
+
|
695 |
+
foreach ( $conditional_classes as $class => $condition ) {
|
696 |
+
if ( $condition ) {
|
697 |
+
$classes[] = $class;
|
698 |
+
}
|
699 |
+
}
|
700 |
+
|
701 |
+
if ( $added_classes = $this->get_param_callback_result( 'row_classes', false ) ) {
|
702 |
+
$added_classes = is_array( $added_classes ) ? implode( ' ', $added_classes ) : (string) $added_classes;
|
703 |
+
}
|
704 |
+
|
705 |
+
if ( $added_classes ) {
|
706 |
+
$classes[] = esc_attr( $added_classes );
|
707 |
+
}
|
708 |
+
|
709 |
+
/**
|
710 |
+
* Globally filter row classes
|
711 |
+
*
|
712 |
+
* @since 2.0.0
|
713 |
+
*
|
714 |
+
* @param string $classes Space-separated list of row classes
|
715 |
+
* @param CMB2_Field object $field This field object
|
716 |
+
*/
|
717 |
+
return apply_filters( 'cmb2_row_classes', implode( ' ', $classes ), $this );
|
718 |
+
}
|
719 |
+
|
720 |
+
/**
|
721 |
+
* Displays the results of the param callbacks.
|
722 |
+
*
|
723 |
+
* @since 2.0.0
|
724 |
+
* @param string $param Field parameter
|
725 |
+
*/
|
726 |
+
public function peform_param_callback( $param ) {
|
727 |
+
echo $this->get_param_callback_result( $param );
|
728 |
+
}
|
729 |
+
|
730 |
+
/**
|
731 |
+
* Store results of the param callbacks for continual access
|
732 |
+
* @since 2.0.0
|
733 |
+
* @param string $param Field parameter
|
734 |
+
* @param bool $echo Whether field should be 'echoed'
|
735 |
+
* @return mixed Results of param/param callback
|
736 |
+
*/
|
737 |
+
public function get_param_callback_result( $param, $echo = true ) {
|
738 |
+
|
739 |
+
// If we've already retrieved this param's value,
|
740 |
+
if ( array_key_exists( $param, $this->callback_results ) ) {
|
741 |
+
// send it back
|
742 |
+
return $this->callback_results[ $param ];
|
743 |
+
}
|
744 |
+
|
745 |
+
if ( $cb = $this->maybe_callback( $param ) ) {
|
746 |
+
if ( $echo ) {
|
747 |
+
// Ok, callback is good, let's run it and store the result
|
748 |
+
ob_start();
|
749 |
+
echo call_user_func( $cb, $this->args(), $this );
|
750 |
+
// grab the result from the output buffer and store it
|
751 |
+
$this->callback_results[ $param ] = ob_get_contents();
|
752 |
+
ob_end_clean();
|
753 |
+
} else {
|
754 |
+
$this->callback_results[ $param ] = call_user_func( $cb, $this->args(), $this );
|
755 |
+
}
|
756 |
+
|
757 |
+
return $this->callback_results[ $param ];
|
758 |
+
}
|
759 |
+
|
760 |
+
// Otherwise just get whatever is there
|
761 |
+
$this->callback_results[ $param ] = $this->args( $param );
|
762 |
+
|
763 |
+
return $this->callback_results[ $param ];
|
764 |
+
}
|
765 |
+
|
766 |
+
/**
|
767 |
+
* Replaces a hash key - {#} - with the repeatable count
|
768 |
+
* @since 1.2.0
|
769 |
+
* @param string $value Value to update
|
770 |
+
* @return string Updated value
|
771 |
+
*/
|
772 |
+
public function replace_hash( $value ) {
|
773 |
+
// Replace hash with 1 based count
|
774 |
+
return str_ireplace( '{#}', ( $this->count() + 1 ), $value );
|
775 |
+
}
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Retrieve options args. Calls options_cb if it exists.
|
779 |
+
* @since 2.0.0
|
780 |
+
* @param string $key Specific option to retrieve
|
781 |
+
* @return array Array of options
|
782 |
+
*/
|
783 |
+
public function options( $key = '' ) {
|
784 |
+
if ( ! empty( $this->field_options ) ) {
|
785 |
+
if ( $key ) {
|
786 |
+
return array_key_exists( $key, $this->field_options ) ? $this->field_options[ $key ] : false;
|
787 |
+
}
|
788 |
+
|
789 |
+
return $this->field_options;
|
790 |
+
}
|
791 |
+
|
792 |
+
$this->field_options = (array) $this->args['options'];
|
793 |
+
|
794 |
+
if ( is_callable( $this->args['options_cb'] ) ) {
|
795 |
+
$options = call_user_func( $this->args['options_cb'], $this );
|
796 |
+
|
797 |
+
if ( $options && is_array( $options ) ) {
|
798 |
+
$this->field_options += $options;
|
799 |
+
}
|
800 |
+
}
|
801 |
+
|
802 |
+
if ( $key ) {
|
803 |
+
return array_key_exists( $key, $this->field_options ) ? $this->field_options[ $key ] : false;
|
804 |
+
}
|
805 |
+
|
806 |
+
return $this->field_options;
|
807 |
+
}
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Fills in empty field parameters with defaults
|
811 |
+
* @since 1.1.0
|
812 |
+
* @param array $args Metabox field config array
|
813 |
+
*/
|
814 |
+
public function _set_field_defaults( $args ) {
|
815 |
+
|
816 |
+
// Set up blank or default values for empty ones
|
817 |
+
$args = wp_parse_args( $args, array(
|
818 |
+
'type' => '',
|
819 |
+
'name' => '',
|
820 |
+
'desc' => '',
|
821 |
+
'before' => '',
|
822 |
+
'after' => '',
|
823 |
+
'options_cb' => '',
|
824 |
+
'options' => array(),
|
825 |
+
'attributes' => array(),
|
826 |
+
'protocols' => null,
|
827 |
+
'default' => null,
|
828 |
+
'select_all_button' => true,
|
829 |
+
'multiple' => false,
|
830 |
+
'repeatable' => false,
|
831 |
+
'inline' => false,
|
832 |
+
'on_front' => true,
|
833 |
+
'show_names' => true,
|
834 |
+
'date_format' => 'm\/d\/Y',
|
835 |
+
'time_format' => 'h:i A',
|
836 |
+
'description' => isset( $args['desc'] ) ? $args['desc'] : '',
|
837 |
+
'preview_size' => 'file' == $args['type'] ? array( 350, 350 ) : array( 50, 50 ),
|
838 |
+
) );
|
839 |
+
|
840 |
+
// Allow a filter override of the default value
|
841 |
+
$args['default'] = apply_filters( 'cmb2_default_filter', $args['default'], $this );
|
842 |
+
// $args['multiple'] = isset( $args['multiple'] ) ? $args['multiple'] : ( 'multicheck' == $args['type'] ? true : false );
|
843 |
+
$args['repeatable'] = $args['repeatable'] && ! $this->repeatable_exception( $args['type'] );
|
844 |
+
$args['inline'] = $args['inline'] || false !== stripos( $args['type'], '_inline' );
|
845 |
+
|
846 |
+
// options param can be passed a callback as well
|
847 |
+
if ( is_callable( $args['options'] ) ) {
|
848 |
+
$args['options_cb'] = $args['options'];
|
849 |
+
$args['options'] = array();
|
850 |
+
}
|
851 |
+
|
852 |
+
$args['options'] = 'group' == $args['type'] ? wp_parse_args( $args['options'], array(
|
853 |
+
'add_button' => __( 'Add Group', 'cmb2' ),
|
854 |
+
'remove_button' => __( 'Remove Group', 'cmb2' ),
|
855 |
+
) ) : $args['options'];
|
856 |
+
|
857 |
+
$args['_id'] = $args['id'];
|
858 |
+
$args['_name'] = $args['id'];
|
859 |
+
|
860 |
+
if ( $this->group ) {
|
861 |
+
|
862 |
+
$args['id'] = $this->group->args( 'id' ) . '_' . $this->group->args( 'count' ) . '_' . $args['id'];
|
863 |
+
$args['_name'] = $this->group->args( 'id' ) . '[' . $this->group->args( 'count' ) . '][' . $args['_name'] . ']';
|
864 |
+
}
|
865 |
+
|
866 |
+
if ( 'wysiwyg' == $args['type'] ) {
|
867 |
+
$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );
|
868 |
+
$args['options']['textarea_name'] = $args['_name'];
|
869 |
+
}
|
870 |
+
|
871 |
+
$option_types = apply_filters( 'cmb2_all_or_nothing_types', array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' ), $this );
|
872 |
+
|
873 |
+
if ( in_array( $args['type'], $option_types, true ) ) {
|
874 |
+
|
875 |
+
$args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : __( 'None', 'cmb2' );
|
876 |
+
$args['show_option_all'] = isset( $args['show_option_all'] ) ? $args['show_option_all'] : __( 'All', 'cmb2' ); // @todo: implementation
|
877 |
+
|
878 |
+
}
|
879 |
+
|
880 |
+
return $args;
|
881 |
+
}
|
882 |
+
|
883 |
+
/**
|
884 |
+
* Updates attributes array values unless they exist from the field config array
|
885 |
+
* @since 1.1.0
|
886 |
+
* @param array $attrs Array of attributes to update
|
887 |
+
*/
|
888 |
+
public function maybe_set_attributes( $attrs = array() ) {
|
889 |
+
return wp_parse_args( $this->args['attributes'], $attrs );
|
890 |
+
}
|
891 |
+
|
892 |
+
}
|
cmb2/includes/CMB2_Options.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Retrieves an instance of CMB2_Option based on the option key
|
5 |
+
*/
|
6 |
+
class CMB2_Options {
|
7 |
+
/**
|
8 |
+
* Array of all CMB2_Option instances
|
9 |
+
* @var array
|
10 |
+
* @since 1.0.0
|
11 |
+
*/
|
12 |
+
protected static $option_sets = array();
|
13 |
+
|
14 |
+
public static function get( $option_key ) {
|
15 |
+
|
16 |
+
if ( empty( self::$option_sets ) || empty( self::$option_sets[ $option_key ] ) ) {
|
17 |
+
self::$option_sets[ $option_key ] = new CMB2_Option( $option_key );
|
18 |
+
}
|
19 |
+
|
20 |
+
return self::$option_sets[ $option_key ];
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Handles getting/setting of values to an option array
|
26 |
+
* for a specific option key
|
27 |
+
*/
|
28 |
+
class CMB2_Option {
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Options array
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $options = array();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Current option key
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
protected $key = '';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Initiate option object
|
44 |
+
* @since 2.0.0
|
45 |
+
*/
|
46 |
+
public function __construct( $option_key ) {
|
47 |
+
$this->key = $option_key;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Delete the option from the db
|
52 |
+
* @since 2.0.0
|
53 |
+
* @return bool Delete success or failure
|
54 |
+
*/
|
55 |
+
public function delete_option() {
|
56 |
+
$this->options = delete_option( $this->key );
|
57 |
+
return $this->options;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Removes an option from an option array
|
62 |
+
* @since 1.0.1
|
63 |
+
* @param string $field_id Option array field key
|
64 |
+
* @return array Modified options
|
65 |
+
*/
|
66 |
+
public function remove( $field_id, $resave = false ) {
|
67 |
+
|
68 |
+
$this->get_options();
|
69 |
+
|
70 |
+
if ( isset( $this->options[ $field_id ] ) ) {
|
71 |
+
unset( $this->options[ $field_id ] );
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( $resave ) {
|
75 |
+
$this->set();
|
76 |
+
}
|
77 |
+
|
78 |
+
return $this->options;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Retrieves an option from an option array
|
83 |
+
* @since 1.0.1
|
84 |
+
* @param string $field_id Option array field key
|
85 |
+
* @param mixed $default Fallback value for the option
|
86 |
+
* @return array Requested field or default
|
87 |
+
*/
|
88 |
+
function get( $field_id, $default = false ) {
|
89 |
+
$opts = $this->get_options();
|
90 |
+
|
91 |
+
if ( 'all' == $field_id ) {
|
92 |
+
return $opts;
|
93 |
+
} elseif ( array_key_exists( $field_id, $opts ) ) {
|
94 |
+
return false !== $opts[ $field_id ] ? $opts[ $field_id ] : $default;
|
95 |
+
}
|
96 |
+
|
97 |
+
return $default;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Updates Option data
|
102 |
+
* @since 1.0.1
|
103 |
+
* @param string $field_id Option array field key
|
104 |
+
* @param mixed $value Value to update data with
|
105 |
+
* @param bool $resave Whether to re-save the data
|
106 |
+
* @param bool $single Whether data should not be an array
|
107 |
+
* @return boolean Return status of update
|
108 |
+
*/
|
109 |
+
function update( $field_id, $value = '', $resave = false, $single = true ) {
|
110 |
+
$this->get_options();
|
111 |
+
|
112 |
+
if ( true !== $field_id ) {
|
113 |
+
|
114 |
+
if ( ! $single ) {
|
115 |
+
// If multiple, add to array
|
116 |
+
$this->options[ $field_id ][] = $value;
|
117 |
+
} else {
|
118 |
+
$this->options[ $field_id ] = $value;
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( $resave || true === $field_id ) {
|
124 |
+
return $this->set();
|
125 |
+
}
|
126 |
+
|
127 |
+
return true;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Saves the option array
|
132 |
+
* Needs to be run after finished using remove/update_option
|
133 |
+
* @uses apply_filters() Calls 'cmb2_override_option_save_{$this->key}' hook
|
134 |
+
* to allow overwriting the option value to be stored.
|
135 |
+
*
|
136 |
+
* @since 1.0.1
|
137 |
+
* @param array $options Optional options to override
|
138 |
+
* @return bool Success/Failure
|
139 |
+
*/
|
140 |
+
function set( $options = array() ) {
|
141 |
+
$this->options = ! empty( $options ) ? $options : $this->options;
|
142 |
+
|
143 |
+
$test_save = apply_filters( "cmb2_override_option_save_{$this->key}", 'cmb2_no_override_option_save', $this->options, $this );
|
144 |
+
|
145 |
+
if ( 'cmb2_no_override_option_save' !== $test_save ) {
|
146 |
+
return $test_save;
|
147 |
+
}
|
148 |
+
|
149 |
+
// If no override, update the option
|
150 |
+
return update_option( $this->key, $this->options );
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Retrieve option value based on name of option.
|
155 |
+
* @uses apply_filters() Calls 'cmb2_override_option_get_{$this->key}' hook to allow
|
156 |
+
* overwriting the option value to be retrieved.
|
157 |
+
*
|
158 |
+
* @since 1.0.1
|
159 |
+
* @param mixed $default Optional. Default value to return if the option does not exist.
|
160 |
+
* @return mixed Value set for the option.
|
161 |
+
*/
|
162 |
+
function get_options( $default = null ) {
|
163 |
+
if ( empty( $this->options ) ) {
|
164 |
+
|
165 |
+
$test_get = apply_filters( "cmb2_override_option_get_{$this->key}", 'cmb2_no_override_option_get', $default, $this );
|
166 |
+
|
167 |
+
if ( 'cmb2_no_override_option_get' !== $test_get ) {
|
168 |
+
$this->options = $test_get;
|
169 |
+
} else {
|
170 |
+
// If no override, get the option
|
171 |
+
$this->options = get_option( $this->key, $default );
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
return (array) $this->options;
|
176 |
+
}
|
177 |
+
|
178 |
+
}
|
dkrpt/helpers/dkrpt_Meta_Box_Sanitize.php → cmb2/includes/CMB2_Sanitize.php
RENAMED
@@ -1,14 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
* @since 0.0.4
|
|
|
6 |
*/
|
7 |
-
class
|
8 |
|
9 |
/**
|
10 |
-
* A
|
11 |
-
* @var
|
12 |
*/
|
13 |
public $field;
|
14 |
|
@@ -21,14 +22,12 @@ class dkrpt_Meta_Box_Sanitize {
|
|
21 |
/**
|
22 |
* Setup our class vars
|
23 |
* @since 1.1.0
|
24 |
-
* @param
|
25 |
-
* @param mixed
|
26 |
*/
|
27 |
-
public function __construct( $field, $value ) {
|
28 |
-
$this->field
|
29 |
-
$this->value
|
30 |
-
$this->object_id = dkrpt_Meta_Box::get_object_id();
|
31 |
-
$this->object_type = dkrpt_Meta_Box::get_object_type();
|
32 |
}
|
33 |
|
34 |
/**
|
@@ -49,11 +48,30 @@ class dkrpt_Meta_Box_Sanitize {
|
|
49 |
*/
|
50 |
public function default_sanitization( $value ) {
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
switch ( $this->field->type() ) {
|
59 |
case 'wysiwyg':
|
@@ -65,7 +83,7 @@ class dkrpt_Meta_Box_Sanitize {
|
|
65 |
case 'taxonomy_radio':
|
66 |
case 'taxonomy_multicheck':
|
67 |
if ( $this->field->args( 'taxonomy' ) ) {
|
68 |
-
return wp_set_object_terms( $this->object_id, $value, $this->field->args( 'taxonomy' ) );
|
69 |
}
|
70 |
case 'multicheck':
|
71 |
case 'file_list':
|
@@ -82,8 +100,8 @@ class dkrpt_Meta_Box_Sanitize {
|
|
82 |
/**
|
83 |
* Simple checkbox validation
|
84 |
* @since 1.0.1
|
85 |
-
* @param mixed
|
86 |
-
* @return
|
87 |
*/
|
88 |
public function checkbox( $value ) {
|
89 |
return $value === 'on' ? 'on' : false;
|
@@ -129,7 +147,7 @@ class dkrpt_Meta_Box_Sanitize {
|
|
129 |
* Validate email in a meta value
|
130 |
* @since 1.0.1
|
131 |
* @param string $value Meta value
|
132 |
-
* @return string Empty string or
|
133 |
*/
|
134 |
public function text_email( $value ) {
|
135 |
// for repeatable
|
@@ -150,7 +168,7 @@ class dkrpt_Meta_Box_Sanitize {
|
|
150 |
* Validate money in a meta value
|
151 |
* @since 1.0.1
|
152 |
* @param string $value Meta value
|
153 |
-
* @return string Empty string or
|
154 |
*/
|
155 |
public function text_money( $value ) {
|
156 |
|
@@ -190,16 +208,19 @@ class dkrpt_Meta_Box_Sanitize {
|
|
190 |
public function text_datetime_timestamp( $value, $repeat = false ) {
|
191 |
|
192 |
$test = is_array( $value ) ? array_filter( $value ) : '';
|
193 |
-
if ( empty( $test ) )
|
194 |
return '';
|
|
|
195 |
|
196 |
-
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) )
|
197 |
return $repeat_value;
|
|
|
198 |
|
199 |
-
$value = strtotime( $value['date'] .' '. $value['time'] );
|
200 |
|
201 |
-
if ( $tz_offset = $this->field->field_timezone_offset() )
|
202 |
$value += $tz_offset;
|
|
|
203 |
|
204 |
return $value;
|
205 |
}
|
@@ -213,26 +234,31 @@ class dkrpt_Meta_Box_Sanitize {
|
|
213 |
public function text_datetime_timestamp_timezone( $value, $repeat = false ) {
|
214 |
|
215 |
$test = is_array( $value ) ? array_filter( $value ) : '';
|
216 |
-
if ( empty( $test ) )
|
217 |
return '';
|
|
|
218 |
|
219 |
-
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) )
|
220 |
return $repeat_value;
|
|
|
221 |
|
222 |
$tzstring = null;
|
223 |
|
224 |
-
if ( is_array( $value ) && array_key_exists( 'timezone', $value ) )
|
225 |
$tzstring = $value['timezone'];
|
|
|
226 |
|
227 |
-
if ( empty( $tzstring ) )
|
228 |
-
$tzstring =
|
|
|
229 |
|
230 |
-
$offset =
|
231 |
|
232 |
-
if ( substr( $tzstring, 0, 3 )
|
233 |
$tzstring = timezone_name_from_abbr( '', $offset, 0 );
|
|
|
234 |
|
235 |
-
$value = new DateTime( $value['date'] .' '. $value['time'], new DateTimeZone( $tzstring ) );
|
236 |
$value = serialize( $value );
|
237 |
|
238 |
return $value;
|
@@ -255,8 +281,9 @@ class dkrpt_Meta_Box_Sanitize {
|
|
255 |
* @return string Sanitized data
|
256 |
*/
|
257 |
public function textarea_code( $value, $repeat = false ) {
|
258 |
-
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) )
|
259 |
return $repeat_value;
|
|
|
260 |
|
261 |
return htmlspecialchars_decode( stripslashes( $value ) );
|
262 |
}
|
@@ -273,7 +300,12 @@ class dkrpt_Meta_Box_Sanitize {
|
|
273 |
|
274 |
unset( $args['_id'], $args['_name'] );
|
275 |
// And get new field object
|
276 |
-
$field = new
|
|
|
|
|
|
|
|
|
|
|
277 |
$id_key = $field->_id();
|
278 |
$id_val_old = $field->escaped_value( 'absint' );
|
279 |
|
@@ -291,20 +323,20 @@ class dkrpt_Meta_Box_Sanitize {
|
|
291 |
|
292 |
// If there is no ID saved yet, try to get it from the url
|
293 |
if ( $value && ! $id_val ) {
|
294 |
-
$id_val =
|
295 |
}
|
296 |
|
297 |
if ( $group ) {
|
298 |
return array(
|
299 |
'attach_id' => $id_val,
|
300 |
-
'field_id' => $id_key
|
301 |
);
|
302 |
}
|
303 |
|
304 |
if ( $id_val && $id_val != $id_val_old ) {
|
305 |
return $field->update_data( $id_val );
|
306 |
} elseif ( empty( $id_val ) && $id_val_old ) {
|
307 |
-
return $field->remove_data( $
|
308 |
}
|
309 |
}
|
310 |
|
@@ -315,10 +347,7 @@ class dkrpt_Meta_Box_Sanitize {
|
|
315 |
* @return string Sanitized url
|
316 |
*/
|
317 |
public function file( $value ) {
|
318 |
-
|
319 |
-
if ( $this->field->args( 'save_id' ) ) {
|
320 |
-
$id_value = $this->_save_file_id( $value );
|
321 |
-
}
|
322 |
$clean = $this->text_url( $value );
|
323 |
|
324 |
// Return an array with url/id if saving a group field
|
@@ -334,8 +363,9 @@ class dkrpt_Meta_Box_Sanitize {
|
|
334 |
* @return mixed Sanitized value
|
335 |
*/
|
336 |
public function _check_repeat( $value, $method, $repeat ) {
|
337 |
-
if ( $repeat || ! $this->field->args( 'repeatable' ) )
|
338 |
return;
|
|
|
339 |
$new_value = array();
|
340 |
foreach ( $value as $iterator => $val ) {
|
341 |
$new_value[] = $this->$method( $val, true );
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* CMB field validation
|
5 |
* @since 0.0.4
|
6 |
+
* @method string _id()
|
7 |
*/
|
8 |
+
class CMB2_Sanitize {
|
9 |
|
10 |
/**
|
11 |
+
* A CMB field object
|
12 |
+
* @var CMB2_Field object
|
13 |
*/
|
14 |
public $field;
|
15 |
|
22 |
/**
|
23 |
* Setup our class vars
|
24 |
* @since 1.1.0
|
25 |
+
* @param CMB2_Field $field A CMB field object
|
26 |
+
* @param mixed $value Field value
|
27 |
*/
|
28 |
+
public function __construct( CMB2_Field $field, $value ) {
|
29 |
+
$this->field = $field;
|
30 |
+
$this->value = stripslashes_deep( $value ); // get rid of those evil magic quotes
|
|
|
|
|
31 |
}
|
32 |
|
33 |
/**
|
48 |
*/
|
49 |
public function default_sanitization( $value ) {
|
50 |
|
51 |
+
/**
|
52 |
+
* Filter the value before it is saved.
|
53 |
+
*
|
54 |
+
* The dynamic portion of the hook name, $this->field->type(), refers to the field type.
|
55 |
+
*
|
56 |
+
* Passing a non-null value to the filter will short-circuit saving
|
57 |
+
* the field value, saving the passed value instead.
|
58 |
+
*
|
59 |
+
* @param bool|mixed $override_value Sanitization/Validation override value to return.
|
60 |
+
* Default false to skip it.
|
61 |
+
* @param mixed $value The value to be saved to this field.
|
62 |
+
* @param int $object_id The ID of the object where the value will be saved
|
63 |
+
* @param array $field_args The current field's arguments
|
64 |
+
* @param object $sanitizer This `CMB2_Sanitize` object
|
65 |
+
*/
|
66 |
+
$override_value = apply_filters( "cmb2_sanitize_{$this->field->type()}", null, $value, $this->field->object_id, $this->field->args(), $this );
|
67 |
+
/**
|
68 |
+
* DEPRECATED. See documentation above.
|
69 |
+
*/
|
70 |
+
$override_value = apply_filters( "cmb2_validate_{$this->field->type()}", $override_value, $value, $this->field->object_id, $this->field->args(), $this );
|
71 |
+
|
72 |
+
if ( null !== $override_value ) {
|
73 |
+
return $override_value;
|
74 |
+
}
|
75 |
|
76 |
switch ( $this->field->type() ) {
|
77 |
case 'wysiwyg':
|
83 |
case 'taxonomy_radio':
|
84 |
case 'taxonomy_multicheck':
|
85 |
if ( $this->field->args( 'taxonomy' ) ) {
|
86 |
+
return wp_set_object_terms( $this->field->object_id, $value, $this->field->args( 'taxonomy' ) );
|
87 |
}
|
88 |
case 'multicheck':
|
89 |
case 'file_list':
|
100 |
/**
|
101 |
* Simple checkbox validation
|
102 |
* @since 1.0.1
|
103 |
+
* @param mixed $value 'on' or false
|
104 |
+
* @return string|false 'on' or false
|
105 |
*/
|
106 |
public function checkbox( $value ) {
|
107 |
return $value === 'on' ? 'on' : false;
|
147 |
* Validate email in a meta value
|
148 |
* @since 1.0.1
|
149 |
* @param string $value Meta value
|
150 |
+
* @return string Empty string or sanitized email
|
151 |
*/
|
152 |
public function text_email( $value ) {
|
153 |
// for repeatable
|
168 |
* Validate money in a meta value
|
169 |
* @since 1.0.1
|
170 |
* @param string $value Meta value
|
171 |
+
* @return string Empty string or sanitized money value
|
172 |
*/
|
173 |
public function text_money( $value ) {
|
174 |
|
208 |
public function text_datetime_timestamp( $value, $repeat = false ) {
|
209 |
|
210 |
$test = is_array( $value ) ? array_filter( $value ) : '';
|
211 |
+
if ( empty( $test ) ) {
|
212 |
return '';
|
213 |
+
}
|
214 |
|
215 |
+
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) {
|
216 |
return $repeat_value;
|
217 |
+
}
|
218 |
|
219 |
+
$value = strtotime( $value['date'] . ' ' . $value['time'] );
|
220 |
|
221 |
+
if ( $tz_offset = $this->field->field_timezone_offset() ) {
|
222 |
$value += $tz_offset;
|
223 |
+
}
|
224 |
|
225 |
return $value;
|
226 |
}
|
234 |
public function text_datetime_timestamp_timezone( $value, $repeat = false ) {
|
235 |
|
236 |
$test = is_array( $value ) ? array_filter( $value ) : '';
|
237 |
+
if ( empty( $test ) ) {
|
238 |
return '';
|
239 |
+
}
|
240 |
|
241 |
+
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) {
|
242 |
return $repeat_value;
|
243 |
+
}
|
244 |
|
245 |
$tzstring = null;
|
246 |
|
247 |
+
if ( is_array( $value ) && array_key_exists( 'timezone', $value ) ) {
|
248 |
$tzstring = $value['timezone'];
|
249 |
+
}
|
250 |
|
251 |
+
if ( empty( $tzstring ) ) {
|
252 |
+
$tzstring = cmb2_utils()->timezone_string();
|
253 |
+
}
|
254 |
|
255 |
+
$offset = cmb2_utils()->timezone_offset( $tzstring );
|
256 |
|
257 |
+
if ( 'UTC' === substr( $tzstring, 0, 3 ) ) {
|
258 |
$tzstring = timezone_name_from_abbr( '', $offset, 0 );
|
259 |
+
}
|
260 |
|
261 |
+
$value = new DateTime( $value['date'] . ' ' . $value['time'], new DateTimeZone( $tzstring ) );
|
262 |
$value = serialize( $value );
|
263 |
|
264 |
return $value;
|
281 |
* @return string Sanitized data
|
282 |
*/
|
283 |
public function textarea_code( $value, $repeat = false ) {
|
284 |
+
if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) {
|
285 |
return $repeat_value;
|
286 |
+
}
|
287 |
|
288 |
return htmlspecialchars_decode( stripslashes( $value ) );
|
289 |
}
|
300 |
|
301 |
unset( $args['_id'], $args['_name'] );
|
302 |
// And get new field object
|
303 |
+
$field = new CMB2_Field( array(
|
304 |
+
'field_args' => $args,
|
305 |
+
'group_field' => $group,
|
306 |
+
'object_id' => $this->field->object_id,
|
307 |
+
'object_type' => $this->field->object_type,
|
308 |
+
) );
|
309 |
$id_key = $field->_id();
|
310 |
$id_val_old = $field->escaped_value( 'absint' );
|
311 |
|
323 |
|
324 |
// If there is no ID saved yet, try to get it from the url
|
325 |
if ( $value && ! $id_val ) {
|
326 |
+
$id_val = cmb2_utils()->image_id_from_url( $value );
|
327 |
}
|
328 |
|
329 |
if ( $group ) {
|
330 |
return array(
|
331 |
'attach_id' => $id_val,
|
332 |
+
'field_id' => $id_key,
|
333 |
);
|
334 |
}
|
335 |
|
336 |
if ( $id_val && $id_val != $id_val_old ) {
|
337 |
return $field->update_data( $id_val );
|
338 |
} elseif ( empty( $id_val ) && $id_val_old ) {
|
339 |
+
return $field->remove_data( $id_val_old );
|
340 |
}
|
341 |
}
|
342 |
|
347 |
* @return string Sanitized url
|
348 |
*/
|
349 |
public function file( $value ) {
|
350 |
+
$id_value = $this->_save_file_id( $value );
|
|
|
|
|
|
|
351 |
$clean = $this->text_url( $value );
|
352 |
|
353 |
// Return an array with url/id if saving a group field
|
363 |
* @return mixed Sanitized value
|
364 |
*/
|
365 |
public function _check_repeat( $value, $method, $repeat ) {
|
366 |
+
if ( $repeat || ! $this->field->args( 'repeatable' ) ) {
|
367 |
return;
|
368 |
+
}
|
369 |
$new_value = array();
|
370 |
foreach ( $value as $iterator => $val ) {
|
371 |
$new_value[] = $this->$method( $val, true );
|
cmb2/includes/CMB2_Show_Filters.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Show On Filters
|
5 |
+
* Use the 'cmb2_show_on' filter to further refine the conditions under which a metabox is displayed.
|
6 |
+
* Below you can limit it by ID and page template
|
7 |
+
*
|
8 |
+
* All methods in this class are automatically filtered
|
9 |
+
*
|
10 |
+
* @since 1.0.0
|
11 |
+
*/
|
12 |
+
class CMB2_Show_Filters {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get Show_on key. backwards compatible w/ 'key' indexes
|
16 |
+
*
|
17 |
+
* @since 2.0.0
|
18 |
+
*
|
19 |
+
* @param array $meta_box_args Metabox config array
|
20 |
+
*
|
21 |
+
* @return mixed show_on key or false
|
22 |
+
*/
|
23 |
+
private static function get_show_on_key( $meta_box_args ) {
|
24 |
+
$show_on = isset( $meta_box_args['show_on'] ) ? (array) $meta_box_args['show_on'] : false;
|
25 |
+
if ( $show_on && is_array( $show_on ) ) {
|
26 |
+
|
27 |
+
if ( array_key_exists( 'key', $show_on ) ) {
|
28 |
+
return $show_on['key'];
|
29 |
+
}
|
30 |
+
|
31 |
+
$keys = array_keys( $show_on );
|
32 |
+
return $keys[0];
|
33 |
+
}
|
34 |
+
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get Show_on value. backwards compatible w/ 'value' indexes
|
40 |
+
*
|
41 |
+
* @since 2.0.0
|
42 |
+
*
|
43 |
+
* @param array $meta_box_args Metabox config array
|
44 |
+
*
|
45 |
+
* @return mixed show_on value or false
|
46 |
+
*/
|
47 |
+
private static function get_show_on_value( $meta_box_args ) {
|
48 |
+
$show_on = isset( $meta_box_args['show_on'] ) ? (array) $meta_box_args['show_on'] : false;
|
49 |
+
|
50 |
+
if ( $show_on && is_array( $show_on ) ) {
|
51 |
+
|
52 |
+
if ( array_key_exists( 'value', $show_on ) ) {
|
53 |
+
return $show_on['value'];
|
54 |
+
}
|
55 |
+
|
56 |
+
$keys = array_keys( $show_on );
|
57 |
+
|
58 |
+
return $show_on[ $keys[0] ];
|
59 |
+
}
|
60 |
+
|
61 |
+
return array();
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Add metaboxes for an specific ID
|
66 |
+
* @since 1.0.0
|
67 |
+
* @param bool $display To display or not
|
68 |
+
* @param array $meta_box_args Metabox config array
|
69 |
+
* @return bool Whether to display this metabox on the current page.
|
70 |
+
*/
|
71 |
+
public static function check_id( $display, $meta_box_args, $cmb ) {
|
72 |
+
|
73 |
+
$key = self::get_show_on_key( $meta_box_args );
|
74 |
+
if ( ! $key || 'id' !== $key ) {
|
75 |
+
return $display;
|
76 |
+
}
|
77 |
+
|
78 |
+
$object_id = is_admin() ? $cmb->object_id() : @get_the_id();
|
79 |
+
|
80 |
+
if ( ! $object_id ) {
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
// If current page id is in the included array, display the metabox
|
85 |
+
return in_array( $object_id, (array) self::get_show_on_value( $meta_box_args ) );
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Add metaboxes for an specific Page Template
|
90 |
+
* @since 1.0.0
|
91 |
+
* @param bool $display To display or not
|
92 |
+
* @param array $meta_box_args Metabox config array
|
93 |
+
* @return bool Whether to display this metabox on the current page.
|
94 |
+
*/
|
95 |
+
public static function check_page_template( $display, $meta_box_args, $cmb ) {
|
96 |
+
|
97 |
+
$key = self::get_show_on_key( $meta_box_args );
|
98 |
+
if ( ! $key || 'page-template' !== $key ) {
|
99 |
+
return $display;
|
100 |
+
}
|
101 |
+
|
102 |
+
$object_id = $cmb->object_id();
|
103 |
+
|
104 |
+
if ( ! $object_id || 'post' !== $cmb->object_type() ) {
|
105 |
+
return false;
|
106 |
+
}
|
107 |
+
|
108 |
+
// Get current template
|
109 |
+
$current_template = get_post_meta( $object_id, '_wp_page_template', true );
|
110 |
+
|
111 |
+
// See if there's a match
|
112 |
+
if ( $current_template && in_array( $current_template, (array) self::get_show_on_value( $meta_box_args ) ) ) {
|
113 |
+
return true;
|
114 |
+
}
|
115 |
+
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Only show options-page metaboxes on their options page (but only enforce on the admin side)
|
121 |
+
* @since 1.0.0
|
122 |
+
* @param bool $display To display or not
|
123 |
+
* @param array $meta_box_args Metabox config array
|
124 |
+
* @return bool Whether to display this metabox on the current page.
|
125 |
+
*/
|
126 |
+
public static function check_admin_page( $display, $meta_box_args ) {
|
127 |
+
|
128 |
+
$key = self::get_show_on_key( $meta_box_args );
|
129 |
+
// check if this is a 'options-page' metabox
|
130 |
+
if ( ! $key || 'options-page' !== $key ) {
|
131 |
+
return $display;
|
132 |
+
}
|
133 |
+
|
134 |
+
// Enforce 'show_on' filter in the admin
|
135 |
+
if ( is_admin() ) {
|
136 |
+
|
137 |
+
// If there is no 'page' query var, our filter isn't applicable
|
138 |
+
if ( ! isset( $_GET['page'] ) ) {
|
139 |
+
return $display;
|
140 |
+
}
|
141 |
+
|
142 |
+
$show_on = self::get_show_on_value( $meta_box_args );
|
143 |
+
|
144 |
+
if ( empty( $show_on ) ) {
|
145 |
+
return false;
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( is_array( $show_on ) ) {
|
149 |
+
foreach ( $show_on as $page ) {
|
150 |
+
if ( $_GET['page'] == $page ) {
|
151 |
+
return true;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
} else {
|
155 |
+
if ( $_GET['page'] == $show_on ) {
|
156 |
+
return true;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
return false;
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
// Allow options-page metaboxes to be displayed anywhere on the front-end
|
165 |
+
return true;
|
166 |
+
}
|
167 |
+
|
168 |
+
}
|
cmb2/includes/CMB2_Types.php
ADDED
@@ -0,0 +1,962 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* CMB field types
|
5 |
+
*
|
6 |
+
* @todo test taxonomy methods with non-post objects
|
7 |
+
* @todo test all methods with non-post objects
|
8 |
+
* @todo Date/Time fields should store date format as data attribute for JS
|
9 |
+
*
|
10 |
+
* @since 1.0.0
|
11 |
+
*/
|
12 |
+
class CMB2_Types {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* An iterator value for repeatable fields
|
16 |
+
* @var integer
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
public $iterator = 0;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Current CMB2_Field field object
|
23 |
+
* @var CMB2_Field object
|
24 |
+
* @since 1.0.0
|
25 |
+
*/
|
26 |
+
public $field;
|
27 |
+
|
28 |
+
public function __construct( CMB2_Field $field ) {
|
29 |
+
$this->field = $field;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Default fallback. Allows rendering fields via "cmb2_render_$name" hook
|
34 |
+
* @since 1.0.0
|
35 |
+
* @param string $name Non-existent method name
|
36 |
+
* @param array $arguments All arguments passed to the method
|
37 |
+
*/
|
38 |
+
public function __call( $name, $arguments ) {
|
39 |
+
/**
|
40 |
+
* Pass non-existent field types through an action
|
41 |
+
*
|
42 |
+
* The dynamic portion of the hook name, $name, refers to the field type.
|
43 |
+
*
|
44 |
+
* @param array $field The passed in `CMB2_Field` object
|
45 |
+
* @param mixed $escaped_value The value of this field escaped.
|
46 |
+
* It defaults to `sanitize_text_field`.
|
47 |
+
* If you need the unescaped value, you can access it
|
48 |
+
* via `$field->value()`
|
49 |
+
* @param int $object_id The ID of the current object
|
50 |
+
* @param string $object_type The type of object you are working with.
|
51 |
+
* Most commonly, `post` (this applies to all post-types),
|
52 |
+
* but could also be `comment`, `user` or `options-page`.
|
53 |
+
* @param object $field_type_object This `CMB2_Types` object
|
54 |
+
*/
|
55 |
+
do_action( "cmb2_render_$name", $this->field, $this->field->escaped_value(), $this->field->object_id, $this->field->object_type, $this );
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Render a field (and handle repeatable)
|
60 |
+
* @since 1.1.0
|
61 |
+
*/
|
62 |
+
public function render() {
|
63 |
+
if ( $this->field->args( 'repeatable' ) ) {
|
64 |
+
$this->render_repeatable_field();
|
65 |
+
} else {
|
66 |
+
$this->_render();
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Render a field type
|
72 |
+
* @since 1.1.0
|
73 |
+
*/
|
74 |
+
protected function _render() {
|
75 |
+
$this->field->peform_param_callback( 'before_field' );
|
76 |
+
echo $this->{$this->field->type()}();
|
77 |
+
$this->field->peform_param_callback( 'after_field' );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Checks if we can get a post object, and if so, uses `get_the_terms` which utilizes caching
|
82 |
+
* @since 1.0.2
|
83 |
+
* @return mixed Array of terms on success
|
84 |
+
*/
|
85 |
+
public function get_object_terms() {
|
86 |
+
$object_id = $this->field->object_id;
|
87 |
+
$taxonomy = $this->field->args( 'taxonomy' );
|
88 |
+
|
89 |
+
if ( ! $post = get_post( $object_id ) ) {
|
90 |
+
|
91 |
+
$cache_key = "cmb-cache-{$taxonomy}-{$object_id}";
|
92 |
+
|
93 |
+
// Check cache
|
94 |
+
$cached = get_transient( $cache_key );
|
95 |
+
if ( $cached ) {
|
96 |
+
return $cached;
|
97 |
+
}
|
98 |
+
|
99 |
+
$cached = wp_get_object_terms( $object_id, $taxonomy );
|
100 |
+
// Do our own (minimal) caching. Long enough for a page-load.
|
101 |
+
set_transient( $cache_key, $cached, 60 );
|
102 |
+
return $cached;
|
103 |
+
}
|
104 |
+
|
105 |
+
// WP caches internally so it's better to use
|
106 |
+
return get_the_terms( $post, $taxonomy );
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Retrieve text parameter from field's options array (if it has one), or use fallback text
|
112 |
+
* @since 2.0.0
|
113 |
+
* @param string $option_key Key in field's options array
|
114 |
+
* @param string $fallback Fallback text
|
115 |
+
* @return string Text
|
116 |
+
*/
|
117 |
+
public function _text( $option_key, $fallback ) {
|
118 |
+
$has_string_param = $this->field->options( $option_key );
|
119 |
+
return $has_string_param ? $has_string_param : $fallback;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Determine a file's extension
|
124 |
+
* @since 1.0.0
|
125 |
+
* @param string $file File url
|
126 |
+
* @return string|false File extension or false
|
127 |
+
*/
|
128 |
+
public function get_file_ext( $file ) {
|
129 |
+
$parsed = @parse_url( $file, PHP_URL_PATH );
|
130 |
+
return $parsed ? strtolower( pathinfo( $parsed, PATHINFO_EXTENSION ) ) : false;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Get the file name from a url
|
135 |
+
* @since 2.0.0
|
136 |
+
* @param string $value File url or path
|
137 |
+
* @return string File name
|
138 |
+
*/
|
139 |
+
public function get_file_name_from_path( $value ) {
|
140 |
+
$parts = explode( '/', $value );
|
141 |
+
return is_array( $parts ) ? end( $parts ) : $value;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Determines if a file has a valid image extension
|
146 |
+
* @since 1.0.0
|
147 |
+
* @param string $file File url
|
148 |
+
* @return bool Whether file has a valid image extension
|
149 |
+
*/
|
150 |
+
public function is_valid_img_ext( $file ) {
|
151 |
+
$file_ext = $this->get_file_ext( $file );
|
152 |
+
|
153 |
+
$is_valid_types = (array) apply_filters( 'cmb2_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) );
|
154 |
+
|
155 |
+
return ( $file_ext && in_array( $file_ext, $is_valid_types ) );
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Handles parsing and filtering attributes while preserving any passed in via field config.
|
160 |
+
* @since 1.1.0
|
161 |
+
* @param array $args Override arguments
|
162 |
+
* @param string $element Element for filter
|
163 |
+
* @param array $defaults Default arguments
|
164 |
+
* @return array Parsed and filtered arguments
|
165 |
+
*/
|
166 |
+
public function parse_args( $args, $element, $defaults ) {
|
167 |
+
return wp_parse_args( apply_filters( "cmb2_{$element}_attributes", $this->field->maybe_set_attributes( $args ), $defaults, $this->field, $this ), $defaults );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Combines attributes into a string for a form element
|
172 |
+
* @since 1.1.0
|
173 |
+
* @param array $attrs Attributes to concatenate
|
174 |
+
* @param array $attr_exclude Attributes that should NOT be concatenated
|
175 |
+
* @return string String of attributes for form element
|
176 |
+
*/
|
177 |
+
public function concat_attrs( $attrs, $attr_exclude = array() ) {
|
178 |
+
$attributes = '';
|
179 |
+
foreach ( $attrs as $attr => $val ) {
|
180 |
+
$excluded = in_array( $attr, (array) $attr_exclude, true );
|
181 |
+
$empty = false === $val && 'value' !== $attr;
|
182 |
+
if ( ! $excluded && ! $empty ) {
|
183 |
+
// if data attribute, use single quote wraps, else double
|
184 |
+
$quotes = false !== stripos( $attr, 'data-' ) ? "'" : '"';
|
185 |
+
$attributes .= sprintf( ' %1$s=%3$s%2$s%3$s', $attr, $val, $quotes );
|
186 |
+
}
|
187 |
+
}
|
188 |
+
return $attributes;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Generates html for concatenated items
|
193 |
+
* @since 1.1.0
|
194 |
+
* @param array $args Optional arguments
|
195 |
+
* @return string Concatenated html items
|
196 |
+
*/
|
197 |
+
public function concat_items( $args = array() ) {
|
198 |
+
|
199 |
+
$method = isset( $args['method'] ) ? $args['method'] : 'select_option';
|
200 |
+
unset( $args['method'] );
|
201 |
+
|
202 |
+
$value = $this->field->escaped_value()
|
203 |
+
? $this->field->escaped_value()
|
204 |
+
: $this->field->args( 'default' );
|
205 |
+
|
206 |
+
$concatenated_items = ''; $i = 1;
|
207 |
+
foreach ( (array) $this->field->options() as $opt_value => $opt_label ) {
|
208 |
+
|
209 |
+
// Clone args & modify for just this item
|
210 |
+
$a = $args;
|
211 |
+
|
212 |
+
$a['value'] = $opt_value;
|
213 |
+
$a['label'] = $opt_label;
|
214 |
+
|
215 |
+
// Check if this option is the value of the input
|
216 |
+
if ( $value == $opt_value ) {
|
217 |
+
$a['checked'] = 'checked';
|
218 |
+
}
|
219 |
+
|
220 |
+
$concatenated_items .= $this->$method( $a, $i++ );
|
221 |
+
}
|
222 |
+
|
223 |
+
return $concatenated_items;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Generates html for an option element
|
228 |
+
* @since 1.1.0
|
229 |
+
* @param array $args Arguments array containing value, label, and checked boolean
|
230 |
+
* @return string Generated option element html
|
231 |
+
*/
|
232 |
+
public function select_option( $args = array() ) {
|
233 |
+
return sprintf( "\t" . '<option value="%s" %s>%s</option>', $args['value'], selected( isset( $args['checked'] ) && $args['checked'], true, false ), $args['label'] ) . "\n";
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Generates html for list item with input
|
238 |
+
* @since 1.1.0
|
239 |
+
* @param array $args Override arguments
|
240 |
+
* @param int $i Iterator value
|
241 |
+
* @return string Gnerated list item html
|
242 |
+
*/
|
243 |
+
public function list_input( $args = array(), $i ) {
|
244 |
+
$a = $this->parse_args( $args, 'list_input', array(
|
245 |
+
'type' => 'radio',
|
246 |
+
'class' => 'cmb2-option',
|
247 |
+
'name' => $this->_name(),
|
248 |
+
'id' => $this->_id( $i ),
|
249 |
+
'value' => $this->field->escaped_value(),
|
250 |
+
'label' => '',
|
251 |
+
) );
|
252 |
+
|
253 |
+
return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->concat_attrs( $a, array( 'label' ) ), $a['id'], $a['label'] );
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Generates html for list item with checkbox input
|
258 |
+
* @since 1.1.0
|
259 |
+
* @param array $args Override arguments
|
260 |
+
* @param int $i Iterator value
|
261 |
+
* @return string Gnerated list item html
|
262 |
+
*/
|
263 |
+
public function list_input_checkbox( $args, $i ) {
|
264 |
+
$saved_value = $this->field->escaped_value();
|
265 |
+
if ( is_array( $saved_value ) && in_array( $args['value'], $saved_value ) ) {
|
266 |
+
$args['checked'] = 'checked';
|
267 |
+
}
|
268 |
+
$args['type'] = 'checkbox';
|
269 |
+
return $this->list_input( $args, $i );
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Generates repeatable field table markup
|
274 |
+
* @since 1.0.0
|
275 |
+
*/
|
276 |
+
public function render_repeatable_field() {
|
277 |
+
$table_id = $this->field->id() . '_repeat';
|
278 |
+
|
279 |
+
$this->_desc( true, true, true );
|
280 |
+
?>
|
281 |
+
|
282 |
+
<div id="<?php echo $table_id; ?>" class="cmb-repeat-table cmb-nested">
|
283 |
+
<div class="cmb-tbody cmb-field-list">
|
284 |
+
<?php $this->repeatable_rows(); ?>
|
285 |
+
</div>
|
286 |
+
</div>
|
287 |
+
<p class="cmb-add-row">
|
288 |
+
<button data-selector="<?php echo $table_id; ?>" class="cmb-add-row-button button"><?php echo esc_html( $this->_text( 'add_row_text', __( 'Add Row', 'cmb2' ) ) ); ?></button>
|
289 |
+
</p>
|
290 |
+
|
291 |
+
<?php
|
292 |
+
// reset iterator
|
293 |
+
$this->iterator = 0;
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Generates repeatable field rows
|
298 |
+
* @since 1.1.0
|
299 |
+
*/
|
300 |
+
public function repeatable_rows() {
|
301 |
+
$meta_value = array_filter( (array) $this->field->escaped_value() );
|
302 |
+
// check for default content
|
303 |
+
$default = $this->field->args( 'default' );
|
304 |
+
|
305 |
+
// check for saved data
|
306 |
+
if ( ! empty( $meta_value ) ) {
|
307 |
+
$meta_value = is_array( $meta_value ) ? array_filter( $meta_value ) : $meta_value;
|
308 |
+
$meta_value = ! empty( $meta_value ) ? $meta_value : $default;
|
309 |
+
} else {
|
310 |
+
$meta_value = $default;
|
311 |
+
}
|
312 |
+
|
313 |
+
// Loop value array and add a row
|
314 |
+
if ( ! empty( $meta_value ) ) {
|
315 |
+
$count = count( $meta_value );
|
316 |
+
foreach ( (array) $meta_value as $val ) {
|
317 |
+
$this->field->escaped_value = $val;
|
318 |
+
$this->repeat_row( $count < 2 );
|
319 |
+
$this->iterator++;
|
320 |
+
}
|
321 |
+
} else {
|
322 |
+
// Otherwise add one row
|
323 |
+
$this->repeat_row( true );
|
324 |
+
}
|
325 |
+
|
326 |
+
// Then add an empty row
|
327 |
+
$this->field->escaped_value = '';
|
328 |
+
$this->iterator = $this->iterator ? $this->iterator : 1;
|
329 |
+
$this->repeat_row( false, 'empty-row hidden' );
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Generates a repeatable row's markup
|
334 |
+
* @since 1.1.0
|
335 |
+
* @param bool $disable_remover Whether remove button should be disabled
|
336 |
+
* @param string $class Repeatable table row's class
|
337 |
+
*/
|
338 |
+
protected function repeat_row( $disable_remover = false, $class = 'cmb-repeat-row' ) {
|
339 |
+
$disabled = $disable_remover ? ' button-disabled' : '';
|
340 |
+
?>
|
341 |
+
|
342 |
+
<div class="cmb-row <?php echo $class; ?>">
|
343 |
+
<div class="cmb-td">
|
344 |
+
<?php $this->_render(); ?>
|
345 |
+
</div>
|
346 |
+
<div class="cmb-td cmb-remove-row">
|
347 |
+
<button class="button cmb-remove-row-button<?php echo $disabled; ?>"><?php echo esc_html( $this->_text( 'remove_row_text', __( 'Remove', 'cmb2' ) ) ); ?></button>
|
348 |
+
</div>
|
349 |
+
</div>
|
350 |
+
|
351 |
+
<?php
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Generates description markup
|
356 |
+
* @since 1.0.0
|
357 |
+
* @param boolean $paragraph Paragraph tag or span
|
358 |
+
* @param boolean $echo Whether to echo description or only return it
|
359 |
+
* @return string Field's description markup
|
360 |
+
*/
|
361 |
+
public function _desc( $paragraph = false, $echo = false, $repeat_group = false ) {
|
362 |
+
// Prevent description from printing multiple times for repeatable fields
|
363 |
+
if ( ! $repeat_group && ( $this->field->args( 'repeatable' ) || $this->iterator > 0 ) ) {
|
364 |
+
return '';
|
365 |
+
}
|
366 |
+
|
367 |
+
$desc = $this->field->args( 'description' );
|
368 |
+
|
369 |
+
if ( ! $desc ) {
|
370 |
+
return;
|
371 |
+
}
|
372 |
+
|
373 |
+
$tag = $paragraph ? 'p' : 'span';
|
374 |
+
$desc = sprintf( "\n" . '<%1$s class="cmb2-metabox-description">%2$s</%1$s>' . "\n", $tag, $desc );
|
375 |
+
|
376 |
+
if ( $echo ) {
|
377 |
+
echo $desc;
|
378 |
+
}
|
379 |
+
return $desc;
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Generate field name attribute
|
384 |
+
* @since 1.1.0
|
385 |
+
* @param string $suffix For multi-part fields
|
386 |
+
* @return string Name attribute
|
387 |
+
*/
|
388 |
+
public function _name( $suffix = '' ) {
|
389 |
+
return $this->field->args( '_name' ) . ( $this->field->args( 'repeatable' ) ? '[' . $this->iterator . ']' : '' ) . $suffix;
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Generate field id attribute
|
394 |
+
* @since 1.1.0
|
395 |
+
* @param string $suffix For multi-part fields
|
396 |
+
* @return string Id attribute
|
397 |
+
*/
|
398 |
+
public function _id( $suffix = '' ) {
|
399 |
+
return $this->field->id() . $suffix . ( $this->field->args( 'repeatable' ) ? '_' . $this->iterator . '" data-iterator="' . $this->iterator : '' );
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Handles outputting an 'input' element
|
404 |
+
* @since 1.1.0
|
405 |
+
* @param array $args Override arguments
|
406 |
+
* @return string Form input element
|
407 |
+
*/
|
408 |
+
public function input( $args = array() ) {
|
409 |
+
$a = $this->parse_args( $args, 'input', array(
|
410 |
+
'type' => 'text',
|
411 |
+
'class' => 'regular-text',
|
412 |
+
'name' => $this->_name(),
|
413 |
+
'id' => $this->_id(),
|
414 |
+
'value' => $this->field->escaped_value(),
|
415 |
+
'desc' => $this->_desc( true ),
|
416 |
+
) );
|
417 |
+
|
418 |
+
return sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc' ) ), $a['desc'] );
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Handles outputting an 'textarea' element
|
423 |
+
* @since 1.1.0
|
424 |
+
* @param array $args Override arguments
|
425 |
+
* @return string Form textarea element
|
426 |
+
*/
|
427 |
+
public function textarea( $args = array() ) {
|
428 |
+
$a = $this->parse_args( $args, 'textarea', array(
|
429 |
+
'class' => 'cmb2_textarea',
|
430 |
+
'name' => $this->_name(),
|
431 |
+
'id' => $this->_id(),
|
432 |
+
'cols' => 60,
|
433 |
+
'rows' => 10,
|
434 |
+
'value' => $this->field->escaped_value( 'esc_textarea' ),
|
435 |
+
'desc' => $this->_desc( true ),
|
436 |
+
) );
|
437 |
+
return sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a['value'], $a['desc'] );
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Begin Field Types
|
442 |
+
*/
|
443 |
+
|
444 |
+
public function text() {
|
445 |
+
return $this->input();
|
446 |
+
}
|
447 |
+
|
448 |
+
public function hidden() {
|
449 |
+
return $this->input( array( 'type' => 'hidden', 'desc' => '', 'class' => false ) );
|
450 |
+
}
|
451 |
+
|
452 |
+
public function text_small() {
|
453 |
+
return $this->input( array( 'class' => 'cmb2-text-small', 'desc' => $this->_desc() ) );
|
454 |
+
}
|
455 |
+
|
456 |
+
public function text_medium() {
|
457 |
+
return $this->input( array( 'class' => 'cmb2-text-medium', 'desc' => $this->_desc() ) );
|
458 |
+
}
|
459 |
+
|
460 |
+
public function text_email() {
|
461 |
+
return $this->input( array( 'class' => 'cmb2-text-email cmb2-text-medium', 'type' => 'email' ) );
|
462 |
+
}
|
463 |
+
|
464 |
+
public function text_url() {
|
465 |
+
return $this->input( array( 'class' => 'cmb2-text-url cmb2-text-medium regular-text', 'value' => $this->field->escaped_value( 'esc_url' ) ) );
|
466 |
+
}
|
467 |
+
|
468 |
+
public function text_date() {
|
469 |
+
$formatted_value = $this->field->get_timestamp_format();
|
470 |
+
|
471 |
+
return $this->input( array( 'class' => 'cmb2-text-small cmb2-datepicker', 'desc' => $this->_desc(), 'value' => $formatted_value ) );
|
472 |
+
}
|
473 |
+
|
474 |
+
public function text_time() {
|
475 |
+
$formatted_value = $this->field->get_timestamp_format( 'time_format' );
|
476 |
+
|
477 |
+
return $this->input( array( 'class' => 'cmb2-timepicker text-time', 'desc' => $this->_desc(), 'value' => $formatted_value ) );
|
478 |
+
}
|
479 |
+
|
480 |
+
public function text_money() {
|
481 |
+
return ( ! $this->field->get_param_callback_result( 'before_field' ) ? '$ ' : ' ' ) . $this->input( array( 'class' => 'cmb2-text-money', 'desc' => $this->_desc() ) );
|
482 |
+
}
|
483 |
+
|
484 |
+
public function textarea_small() {
|
485 |
+
return $this->textarea( array( 'class' => 'cmb2-textarea-small', 'rows' => 4 ) );
|
486 |
+
}
|
487 |
+
|
488 |
+
public function textarea_code() {
|
489 |
+
return sprintf( '<pre>%s', $this->textarea( array( 'class' => 'cmb2-textarea-code', 'desc' => '</pre>' . $this->_desc( true ) ) ) );
|
490 |
+
}
|
491 |
+
|
492 |
+
public function wysiwyg( $args = array() ) {
|
493 |
+
$a = $this->parse_args( $args, 'input', array(
|
494 |
+
'id' => $this->_id(),
|
495 |
+
'value' => $this->field->escaped_value( 'stripslashes' ),
|
496 |
+
'desc' => $this->_desc( true ),
|
497 |
+
'options' => $this->field->options(),
|
498 |
+
) );
|
499 |
+
|
500 |
+
wp_editor( $a['value'], $a['id'], $a['options'] );
|
501 |
+
echo $a['desc'];
|
502 |
+
}
|
503 |
+
|
504 |
+
public function text_date_timestamp() {
|
505 |
+
$formatted_value = $this->field->get_timestamp_format();
|
506 |
+
|
507 |
+
return $this->input( array( 'class' => 'cmb2-text-small cmb2-datepicker', 'value' => $formatted_value ) );
|
508 |
+
}
|
509 |
+
|
510 |
+
public function text_datetime_timestamp( $meta_value = null ) {
|
511 |
+
$desc = '';
|
512 |
+
if ( ! $meta_value ) {
|
513 |
+
$meta_value = $this->field->escaped_value();
|
514 |
+
// This will be used if there is a select_timezone set for this field
|
515 |
+
$tz_offset = $this->field->field_timezone_offset();
|
516 |
+
if ( ! empty( $tz_offset ) ) {
|
517 |
+
$meta_value -= $tz_offset;
|
518 |
+
}
|
519 |
+
$desc = $this->_desc();
|
520 |
+
}
|
521 |
+
|
522 |
+
$inputs = array(
|
523 |
+
$this->input( array(
|
524 |
+
'class' => 'cmb2-text-small cmb2-datepicker',
|
525 |
+
'name' => $this->_name( '[date]' ),
|
526 |
+
'id' => $this->_id( '_date' ),
|
527 |
+
'value' => ! empty( $meta_value ) && ! is_array( $meta_value ) ? $this->field->get_timestamp_format( 'date_format', $meta_value ) : '',
|
528 |
+
'desc' => '',
|
529 |
+
) ),
|
530 |
+
$this->input( array(
|
531 |
+
'class' => 'cmb2-timepicker text-time',
|
532 |
+
'name' => $this->_name( '[time]' ),
|
533 |
+
'id' => $this->_id( '_time' ),
|
534 |
+
'value' => ! empty( $meta_value ) && ! is_array( $meta_value ) ? $this->field->get_timestamp_format( 'time_format', $meta_value ) : '',
|
535 |
+
'desc' => $desc,
|
536 |
+
) ),
|
537 |
+
);
|
538 |
+
|
539 |
+
return implode( "\n", $inputs );
|
540 |
+
}
|
541 |
+
|
542 |
+
public function text_datetime_timestamp_timezone() {
|
543 |
+
$meta_value = $this->field->escaped_value();
|
544 |
+
if ( is_array( $meta_value ) ) {
|
545 |
+
$meta_value = '';
|
546 |
+
}
|
547 |
+
$datetime = unserialize( $meta_value );
|
548 |
+
$meta_value = $tzstring = '';
|
549 |
+
|
550 |
+
if ( $datetime && $datetime instanceof DateTime ) {
|
551 |
+
$tz = $datetime->getTimezone();
|
552 |
+
$tzstring = $tz->getName();
|
553 |
+
$meta_value = $datetime->getTimestamp() + $tz->getOffset( new DateTime( 'NOW' ) );
|
554 |
+
}
|
555 |
+
|
556 |
+
$inputs = array(
|
557 |
+
$this->text_datetime_timestamp( $meta_value ),
|
558 |
+
$this->select( array(
|
559 |
+
'class' => 'cmb2_select cmb2-select-timezone',
|
560 |
+
'name' => $this->_name( '[timezone]' ),
|
561 |
+
'id' => $this->_id( '_timezone' ),
|
562 |
+
'options' => wp_timezone_choice( $tzstring ),
|
563 |
+
'desc' => $this->_desc(),
|
564 |
+
) ),
|
565 |
+
);
|
566 |
+
|
567 |
+
return implode( "\n", $inputs );
|
568 |
+
}
|
569 |
+
|
570 |
+
public function select_timezone() {
|
571 |
+
$this->field->args['default'] = $this->field->args( 'default' )
|
572 |
+
? $this->field->args( 'default' )
|
573 |
+
: cmb2_utils()->timezone_string();
|
574 |
+
|
575 |
+
return $this->select( array(
|
576 |
+
'class' => 'cmb2_select cmb2-select-timezone',
|
577 |
+
'options' => wp_timezone_choice( $this->field->escaped_value() ),
|
578 |
+
'desc' => $this->_desc(),
|
579 |
+
) );
|
580 |
+
}
|
581 |
+
|
582 |
+
public function colorpicker() {
|
583 |
+
$meta_value = $this->field->escaped_value();
|
584 |
+
$hex_color = '(([a-fA-F0-9]){3}){1,2}$';
|
585 |
+
if ( preg_match( '/^' . $hex_color . '/i', $meta_value ) ) {
|
586 |
+
// Value is just 123abc, so prepend #
|
587 |
+
$meta_value = '#' . $meta_value;
|
588 |
+
} elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta_value ) ) {
|
589 |
+
// Value doesn't match #123abc, so sanitize to just #
|
590 |
+
$meta_value = '#';
|
591 |
+
}
|
592 |
+
|
593 |
+
return $this->input( array( 'class' => 'cmb2-colorpicker cmb2-text-small', 'value' => $meta_value ) );
|
594 |
+
}
|
595 |
+
|
596 |
+
public function title( $args = array() ) {
|
597 |
+
$a = $this->parse_args( $args, 'title', array(
|
598 |
+
'tag' => $this->field->object_type == 'post' ? 'h5' : 'h3',
|
599 |
+
'class' => 'cmb2-metabox-title',
|
600 |
+
'name' => $this->field->args( 'name' ),
|
601 |
+
'desc' => $this->_desc( true ),
|
602 |
+
) );
|
603 |
+
|
604 |
+
return sprintf( '<%1$s class="%2$s">%3$s</%1$s>%4$s', $a['tag'], $a['class'], $a['name'], $a['desc'] );
|
605 |
+
}
|
606 |
+
|
607 |
+
public function select( $args = array() ) {
|
608 |
+
$a = $this->parse_args( $args, 'select', array(
|
609 |
+
'class' => 'cmb2_select',
|
610 |
+
'name' => $this->_name(),
|
611 |
+
'id' => $this->_id(),
|
612 |
+
'desc' => $this->_desc( true ),
|
613 |
+
'options' => $this->concat_items(),
|
614 |
+
) );
|
615 |
+
|
616 |
+
$attrs = $this->concat_attrs( $a, array( 'desc', 'options' ) );
|
617 |
+
return sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] );
|
618 |
+
}
|
619 |
+
|
620 |
+
public function taxonomy_select() {
|
621 |
+
|
622 |
+
$names = $this->get_object_terms();
|
623 |
+
$saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[key( $names )]->slug;
|
624 |
+
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
625 |
+
$options = '';
|
626 |
+
|
627 |
+
$option_none = $this->field->args( 'show_option_none' );
|
628 |
+
if ( ! empty( $option_none ) ) {
|
629 |
+
$option_none_value = apply_filters( 'cmb2_taxonomy_select_default_value', '' );
|
630 |
+
$option_none_value = apply_filters( "cmb2_taxonomy_select_{$this->_id()}_default_value", $option_none_value );
|
631 |
+
|
632 |
+
$options .= $this->select_option( array(
|
633 |
+
'label' => $option_none,
|
634 |
+
'value' => $option_none_value,
|
635 |
+
'checked' => $saved_term == $option_none_value,
|
636 |
+
) );
|
637 |
+
}
|
638 |
+
|
639 |
+
foreach ( $terms as $term ) {
|
640 |
+
$options .= $this->select_option( array(
|
641 |
+
'label' => $term->name,
|
642 |
+
'value' => $term->slug,
|
643 |
+
'checked' => $saved_term == $term->slug,
|
644 |
+
) );
|
645 |
+
}
|
646 |
+
|
647 |
+
return $this->select( array( 'options' => $options ) );
|
648 |
+
}
|
649 |
+
|
650 |
+
public function radio( $args = array(), $type = 'radio' ) {
|
651 |
+
$a = $this->parse_args( $args, $type, array(
|
652 |
+
'class' => 'cmb2-radio-list cmb2-list',
|
653 |
+
'options' => $this->concat_items( array( 'label' => 'test', 'method' => 'list_input' ) ),
|
654 |
+
'desc' => $this->_desc( true ),
|
655 |
+
) );
|
656 |
+
|
657 |
+
return sprintf( '<ul class="%s">%s</ul>%s', $a['class'], $a['options'], $a['desc'] );
|
658 |
+
}
|
659 |
+
|
660 |
+
public function radio_inline() {
|
661 |
+
return $this->radio( array(), 'radio_inline' );
|
662 |
+
}
|
663 |
+
|
664 |
+
public function multicheck( $type = 'checkbox' ) {
|
665 |
+
|
666 |
+
$classes = false === $this->field->args( 'select_all_button' )
|
667 |
+
? 'cmb2-checkbox-list no-select-all cmb2-list'
|
668 |
+
: 'cmb2-checkbox-list cmb2-list';
|
669 |
+
|
670 |
+
return $this->radio( array( 'class' => $classes, 'options' => $this->concat_items( array( 'name' => $this->_name() . '[]', 'method' => 'list_input_checkbox' ) ) ), $type );
|
671 |
+
}
|
672 |
+
|
673 |
+
public function multicheck_inline() {
|
674 |
+
$this->multicheck( 'multicheck_inline' );
|
675 |
+
}
|
676 |
+
|
677 |
+
public function checkbox() {
|
678 |
+
$meta_value = $this->field->escaped_value();
|
679 |
+
$args = array( 'type' => 'checkbox', 'class' => 'cmb2-option cmb2-list', 'value' => 'on', 'desc' => '' );
|
680 |
+
if ( ! empty( $meta_value ) ) {
|
681 |
+
$args['checked'] = 'checked';
|
682 |
+
}
|
683 |
+
return sprintf( '%s <label for="%s">%s</label>', $this->input( $args ), $this->_id(), $this->_desc() );
|
684 |
+
}
|
685 |
+
|
686 |
+
public function taxonomy_radio() {
|
687 |
+
$names = $this->get_object_terms();
|
688 |
+
$saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[key( $names )]->slug;
|
689 |
+
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
690 |
+
$options = ''; $i = 1;
|
691 |
+
|
692 |
+
if ( ! $terms ) {
|
693 |
+
$options .= sprintf( '<li><label>%s</label></li>', esc_html( $this->_text( 'no_terms_text', __( 'No terms', 'cmb2' ) ) ) );
|
694 |
+
} else {
|
695 |
+
$option_none = $this->field->args( 'show_option_none' );
|
696 |
+
if ( ! empty( $option_none ) ) {
|
697 |
+
$option_none_value = apply_filters( "cmb2_taxonomy_radio_{$this->_id()}_default_value", apply_filters( 'cmb2_taxonomy_radio_default_value', '' ) );
|
698 |
+
$args = array(
|
699 |
+
'value' => $option_none_value,
|
700 |
+
'label' => $option_none,
|
701 |
+
);
|
702 |
+
if ( $saved_term == $option_none_value ) {
|
703 |
+
$args['checked'] = 'checked';
|
704 |
+
}
|
705 |
+
$options .= $this->list_input( $args, $i );
|
706 |
+
$i++;
|
707 |
+
}
|
708 |
+
|
709 |
+
foreach ( $terms as $term ) {
|
710 |
+
$args = array(
|
711 |
+
'value' => $term->slug,
|
712 |
+
'label' => $term->name,
|
713 |
+
);
|
714 |
+
|
715 |
+
if ( $saved_term == $term->slug ) {
|
716 |
+
$args['checked'] = 'checked';
|
717 |
+
}
|
718 |
+
$options .= $this->list_input( $args, $i );
|
719 |
+
$i++;
|
720 |
+
}
|
721 |
+
}
|
722 |
+
|
723 |
+
return $this->radio( array( 'options' => $options ), 'taxonomy_radio' );
|
724 |
+
}
|
725 |
+
|
726 |
+
public function taxonomy_radio_inline() {
|
727 |
+
$this->taxonomy_radio();
|
728 |
+
}
|
729 |
+
|
730 |
+
public function taxonomy_multicheck() {
|
731 |
+
|
732 |
+
$names = $this->get_object_terms();
|
733 |
+
$saved_terms = is_wp_error( $names ) || empty( $names )
|
734 |
+
? $this->field->args( 'default' )
|
735 |
+
: wp_list_pluck( $names, 'slug' );
|
736 |
+
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
737 |
+
$name = $this->_name() . '[]';
|
738 |
+
$options = ''; $i = 1;
|
739 |
+
|
740 |
+
if ( ! $terms ) {
|
741 |
+
$options .= sprintf( '<li><label>%s</label></li>', esc_html( $this->_text( 'no_terms_text', __( 'No terms', 'cmb2' ) ) ) );
|
742 |
+
} else {
|
743 |
+
|
744 |
+
foreach ( $terms as $term ) {
|
745 |
+
$args = array(
|
746 |
+
'value' => $term->slug,
|
747 |
+
'label' => $term->name,
|
748 |
+
'type' => 'checkbox',
|
749 |
+
'name' => $name,
|
750 |
+
);
|
751 |
+
|
752 |
+
if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) {
|
753 |
+
$args['checked'] = 'checked';
|
754 |
+
}
|
755 |
+
$options .= $this->list_input( $args, $i );
|
756 |
+
$i++;
|
757 |
+
}
|
758 |
+
}
|
759 |
+
|
760 |
+
$classes = false === $this->field->args( 'select_all_button' )
|
761 |
+
? 'cmb2-checkbox-list no-select-all cmb2-list'
|
762 |
+
: 'cmb2-checkbox-list cmb2-list';
|
763 |
+
|
764 |
+
return $this->radio( array( 'class' => $classes, 'options' => $options ), 'taxonomy_multicheck' );
|
765 |
+
}
|
766 |
+
|
767 |
+
public function taxonomy_multicheck_inline() {
|
768 |
+
$this->taxonomy_multicheck();
|
769 |
+
}
|
770 |
+
|
771 |
+
public function oembed() {
|
772 |
+
$meta_value = trim( $this->field->escaped_value() );
|
773 |
+
$oembed = ! empty( $meta_value )
|
774 |
+
? cmb2_get_oembed( array(
|
775 |
+
'url' => $this->field->escaped_value(),
|
776 |
+
'object_id' => $this->field->object_id,
|
777 |
+
'object_type' => $this->field->object_type,
|
778 |
+
'oembed_args' => array( 'width' => '640' ),
|
779 |
+
'field_id' => $this->_id(),
|
780 |
+
) )
|
781 |
+
: '';
|
782 |
+
|
783 |
+
echo $this->input( array(
|
784 |
+
'class' => 'cmb2-oembed regular-text',
|
785 |
+
'data-objectid' => $this->field->object_id,
|
786 |
+
'data-objecttype' => $this->field->object_type,
|
787 |
+
) ),
|
788 |
+
'<p class="cmb-spinner spinner" style="display:none;"></p>',
|
789 |
+
'<div id="', $this->_id( '-status' ), '" class="cmb2-media-status ui-helper-clearfix embed_wrap">', $oembed, '</div>';
|
790 |
+
}
|
791 |
+
|
792 |
+
public function file_list() {
|
793 |
+
$meta_value = $this->field->escaped_value();
|
794 |
+
$name = $this->_name();
|
795 |
+
$img_size = $this->field->args( 'preview_size' );
|
796 |
+
|
797 |
+
echo $this->input( array(
|
798 |
+
'type' => 'hidden',
|
799 |
+
'class' => 'cmb2-upload-file cmb2-upload-list',
|
800 |
+
'size' => 45, 'desc' => '', 'value' => '',
|
801 |
+
'data-previewsize' => is_array( $img_size ) ? sprintf( '[%s]', implode( ',', $img_size ) ) : 50,
|
802 |
+
) ),
|
803 |
+
$this->input( array(
|
804 |
+
'type' => 'button',
|
805 |
+
'class' => 'cmb2-upload-button button cmb2-upload-list',
|
806 |
+
'value' => esc_html( $this->_text( 'add_upload_files_text', __( 'Add or Upload Files', 'cmb2' ) ) ),
|
807 |
+
'name' => '', 'id' => '',
|
808 |
+
) );
|
809 |
+
|
810 |
+
echo '<ul id="', $this->_id( '-status' ), '" class="cmb2-media-status cmb-attach-list">';
|
811 |
+
|
812 |
+
if ( $meta_value && is_array( $meta_value ) ) {
|
813 |
+
|
814 |
+
foreach ( $meta_value as $id => $fullurl ) {
|
815 |
+
$id_input = $this->input( array(
|
816 |
+
'type' => 'hidden',
|
817 |
+
'value' => $fullurl,
|
818 |
+
'name' => $name . '[' . $id . ']',
|
819 |
+
'id' => 'filelist-' . $id,
|
820 |
+
'data-id' => $id,
|
821 |
+
'desc' => '',
|
822 |
+
'class' => false,
|
823 |
+
) );
|
824 |
+
|
825 |
+
if ( $this->is_valid_img_ext( $fullurl ) ) {
|
826 |
+
|
827 |
+
$this->img_status_output( array(
|
828 |
+
'image' => wp_get_attachment_image( $id, $img_size ),
|
829 |
+
'tag' => 'li',
|
830 |
+
'id_input' => $id_input,
|
831 |
+
) );
|
832 |
+
|
833 |
+
} else {
|
834 |
+
|
835 |
+
$this->file_status_output( array(
|
836 |
+
'value' => $fullurl,
|
837 |
+
'tag' => 'li',
|
838 |
+
'id_input' => $id_input,
|
839 |
+
) );
|
840 |
+
|
841 |
+
}
|
842 |
+
}
|
843 |
+
}
|
844 |
+
|
845 |
+
echo '</ul>';
|
846 |
+
}
|
847 |
+
|
848 |
+
public function file() {
|
849 |
+
$meta_value = $this->field->escaped_value();
|
850 |
+
$options = (array) $this->field->options();
|
851 |
+
$img_size = $this->field->args( 'preview_size' );
|
852 |
+
|
853 |
+
// if options array and 'url' => false, then hide the url field
|
854 |
+
$input_type = array_key_exists( 'url', $options ) && false === $options['url'] ? 'hidden' : 'text';
|
855 |
+
|
856 |
+
echo $this->input( array(
|
857 |
+
'type' => $input_type,
|
858 |
+
'class' => 'cmb2-upload-file regular-text',
|
859 |
+
'size' => 45,
|
860 |
+
'desc' => '',
|
861 |
+
'data-previewsize' => is_array( $img_size ) ? '[' . implode( ',', $img_size ) . ']' : 350,
|
862 |
+
) );
|
863 |
+
|
864 |
+
printf( '<input class="cmb2-upload-button button" type="button" value="%s" />', esc_attr( $this->_text( 'add_upload_file_text', __( 'Add or Upload File', 'cmb2' ) ) ) );
|
865 |
+
|
866 |
+
$this->_desc( true, true );
|
867 |
+
|
868 |
+
$cached_id = $this->_id();
|
869 |
+
// Reset field args for attachment ID
|
870 |
+
$args = $this->field->args();
|
871 |
+
$args['id'] = $cached_id . '_id';
|
872 |
+
unset( $args['_id'], $args['_name'] );
|
873 |
+
|
874 |
+
// And get new field object
|
875 |
+
$this->field = new CMB2_Field( array(
|
876 |
+
'field_args' => $args,
|
877 |
+
'group_field' => $this->field->group,
|
878 |
+
'object_type' => $this->field->object_type,
|
879 |
+
'object_id' => $this->field->object_id,
|
880 |
+
) );
|
881 |
+
|
882 |
+
// Get ID value
|
883 |
+
$_id_value = $this->field->escaped_value( 'absint' );
|
884 |
+
|
885 |
+
// If there is no ID saved yet, try to get it from the url
|
886 |
+
if ( $meta_value && ! $_id_value ) {
|
887 |
+
$_id_value = cmb2_utils()->image_id_from_url( esc_url_raw( $meta_value ) );
|
888 |
+
}
|
889 |
+
|
890 |
+
echo $this->input( array(
|
891 |
+
'type' => 'hidden',
|
892 |
+
'class' => 'cmb2-upload-file-id',
|
893 |
+
'value' => $_id_value,
|
894 |
+
'desc' => '',
|
895 |
+
) ),
|
896 |
+
'<div id="', $this->_id( '-status' ), '" class="cmb2-media-status">';
|
897 |
+
if ( ! empty( $meta_value ) ) {
|
898 |
+
|
899 |
+
if ( $this->is_valid_img_ext( $meta_value ) ) {
|
900 |
+
|
901 |
+
if ( $_id_value ) {
|
902 |
+
$image = wp_get_attachment_image( $_id_value, $img_size, null, array( 'class' => 'cmb-file-field-image' ) );
|
903 |
+
} else {
|
904 |
+
$size = is_array( $img_size ) ? $img_size[0] : 350;
|
905 |
+
$image = '<img style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . $meta_value . '" alt="" />';
|
906 |
+
}
|
907 |
+
|
908 |
+
$this->img_status_output( array(
|
909 |
+
'image' => $image,
|
910 |
+
'tag' => 'div',
|
911 |
+
'cached_id' => $cached_id,
|
912 |
+
) );
|
913 |
+
|
914 |
+
} else {
|
915 |
+
|
916 |
+
$this->file_status_output( array(
|
917 |
+
'value' => $meta_value,
|
918 |
+
'tag' => 'div',
|
919 |
+
'cached_id' => $cached_id,
|
920 |
+
) );
|
921 |
+
|
922 |
+
}
|
923 |
+
}
|
924 |
+
echo '</div>';
|
925 |
+
}
|
926 |
+
|
927 |
+
/**
|
928 |
+
* file/file_list image wrap
|
929 |
+
* @since 2.0.2
|
930 |
+
* @param array $args Array of arguments for output
|
931 |
+
* @return string Image wrap output
|
932 |
+
*/
|
933 |
+
public function img_status_output( $args ) {
|
934 |
+
printf( '<%1$s class="img-status">%2$s<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button"%3$s>%4$s</a></p>%5$s</%1$s>',
|
935 |
+
$args['tag'],
|
936 |
+
$args['image'],
|
937 |
+
isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '',
|
938 |
+
esc_html( $this->_text( 'remove_image_text', __( 'Remove Image', 'cmb2' ) ) ),
|
939 |
+
isset( $args['id_input'] ) ? $args['id_input'] : ''
|
940 |
+
);
|
941 |
+
}
|
942 |
+
|
943 |
+
/**
|
944 |
+
* file/file_list file wrap
|
945 |
+
* @since 2.0.2
|
946 |
+
* @param array $args Array of arguments for output
|
947 |
+
* @return string File wrap output
|
948 |
+
*/
|
949 |
+
public function file_status_output( $args ) {
|
950 |
+
printf( '<%1$s class="file-status"><span>%2$s <strong>%3$s</strong></span> (<a href="%4$s" target="_blank" rel="external">%5$s</a> / <a href="#" class="cmb2-remove-file-button"%6$s>%7$s</a>)%8$s</%1$s>',
|
951 |
+
$args['tag'],
|
952 |
+
esc_html( $this->_text( 'file_text', __( 'File:', 'cmb2' ) ) ),
|
953 |
+
$this->get_file_name_from_path( $args['value'] ),
|
954 |
+
$args['value'],
|
955 |
+
esc_html( $this->_text( 'file-download-text', __( 'Download', 'cmb2' ) ) ),
|
956 |
+
isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '',
|
957 |
+
esc_html( $this->_text( 'remove_text', __( 'Remove', 'cmb2' ) ) ),
|
958 |
+
isset( $args['id_input'] ) ? $args['id_input'] : ''
|
959 |
+
);
|
960 |
+
}
|
961 |
+
|
962 |
+
}
|
cmb2/includes/CMB2_Utils.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* CMB field class
|
5 |
+
* @since 1.1.0
|
6 |
+
*/
|
7 |
+
class CMB2_Utils {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The url which is used to load local resources.
|
11 |
+
* @var string
|
12 |
+
* @since 2.0.0
|
13 |
+
*/
|
14 |
+
protected $url = '';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Utility method that attempts to get an attachment's ID by it's url
|
18 |
+
* @since 1.0.0
|
19 |
+
* @param string $img_url Attachment url
|
20 |
+
* @return mixed Attachment ID or false
|
21 |
+
*/
|
22 |
+
public function image_id_from_url( $img_url ) {
|
23 |
+
global $wpdb;
|
24 |
+
|
25 |
+
$img_url = esc_url_raw( $img_url );
|
26 |
+
// Get just the file name
|
27 |
+
if ( false !== strpos( $img_url, '/' ) ) {
|
28 |
+
$explode = explode( '/', $img_url );
|
29 |
+
$img_url = end( $explode );
|
30 |
+
}
|
31 |
+
|
32 |
+
// And search for a fuzzy match of the file name
|
33 |
+
$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid LIKE '%%%s%%' LIMIT 1;", $img_url ) );
|
34 |
+
|
35 |
+
// If we found an attachement ID, return it
|
36 |
+
if ( ! empty( $attachment ) && is_array( $attachment ) ) {
|
37 |
+
return $attachment[0];
|
38 |
+
}
|
39 |
+
|
40 |
+
// No luck
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Utility method that returns time string offset by timezone
|
46 |
+
* @since 1.0.0
|
47 |
+
* @param string $tzstring Time string
|
48 |
+
* @return string Offset time string
|
49 |
+
*/
|
50 |
+
public function timezone_offset( $tzstring ) {
|
51 |
+
if ( ! empty( $tzstring ) && is_string( $tzstring ) ) {
|
52 |
+
if ( 'UTC' === substr( $tzstring, 0, 3 ) ) {
|
53 |
+
$tzstring = str_replace( array( ':15', ':30', ':45' ), array( '.25', '.5', '.75' ), $tzstring );
|
54 |
+
return intval( floatval( substr( $tzstring, 3 ) ) * HOUR_IN_SECONDS );
|
55 |
+
}
|
56 |
+
|
57 |
+
$date_time_zone_selected = new DateTimeZone( $tzstring );
|
58 |
+
$tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
|
59 |
+
|
60 |
+
return $tz_offset;
|
61 |
+
}
|
62 |
+
|
63 |
+
return 0;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Utility method that returns a timezone string representing the default timezone for the site.
|
68 |
+
*
|
69 |
+
* Roughly copied from WordPress, as get_option('timezone_string') will return
|
70 |
+
* an empty string if no value has been set on the options page.
|
71 |
+
* A timezone string is required by the wp_timezone_choice() used by the
|
72 |
+
* select_timezone field.
|
73 |
+
*
|
74 |
+
* @since 1.0.0
|
75 |
+
* @return string Timezone string
|
76 |
+
*/
|
77 |
+
public function timezone_string() {
|
78 |
+
$current_offset = get_option( 'gmt_offset' );
|
79 |
+
$tzstring = get_option( 'timezone_string' );
|
80 |
+
|
81 |
+
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
|
82 |
+
if ( 0 == $current_offset ) {
|
83 |
+
$tzstring = 'UTC+0';
|
84 |
+
} elseif ( $current_offset < 0 ) {
|
85 |
+
$tzstring = 'UTC' . $current_offset;
|
86 |
+
} else {
|
87 |
+
$tzstring = 'UTC+' . $current_offset;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
return $tzstring;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Returns a timestamp, first checking if value already is a timestamp.
|
96 |
+
* @since 2.0.0
|
97 |
+
* @param string|int $string Possible timestamp string
|
98 |
+
* @return int Time stamp
|
99 |
+
*/
|
100 |
+
public function make_valid_time_stamp( $string ) {
|
101 |
+
if ( ! $string ) {
|
102 |
+
return 0;
|
103 |
+
}
|
104 |
+
|
105 |
+
return $this->is_valid_time_stamp( $string )
|
106 |
+
? (int) $string :
|
107 |
+
strtotime( $string );
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Determine if a value is a valid timestamp
|
112 |
+
* @since 2.0.0
|
113 |
+
* @param mixed $timestamp Value to check
|
114 |
+
* @return boolean Whether value is a valid timestamp
|
115 |
+
*/
|
116 |
+
public function is_valid_time_stamp( $timestamp ) {
|
117 |
+
return (string) (int) $timestamp === (string) $timestamp
|
118 |
+
&& $timestamp <= PHP_INT_MAX
|
119 |
+
&& $timestamp >= ~PHP_INT_MAX;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Checks if a value is 'empty'. Still accepts 0.
|
124 |
+
* @since 2.0.0
|
125 |
+
* @param mixed $value Value to check
|
126 |
+
* @return bool True or false
|
127 |
+
*/
|
128 |
+
public function isempty( $value ) {
|
129 |
+
return is_null( $value ) || '' === $value || false === $value;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Insert a single array item inside another array at a set position
|
134 |
+
* @since 2.0.2
|
135 |
+
* @param array &$array Array to modify. Is passed by reference, and no return is needed.
|
136 |
+
* @param array $new New array to insert
|
137 |
+
* @param int $position Position in the main array to insert the new array
|
138 |
+
*/
|
139 |
+
public function array_insert( &$array, $new, $position ) {
|
140 |
+
$before = array_slice( $array, 0, $position - 1 );
|
141 |
+
$after = array_diff_key( $array, $before );
|
142 |
+
$array = array_merge( $before, $new, $after );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Defines the url which is used to load local resources.
|
147 |
+
* This may need to be filtered for local Window installations.
|
148 |
+
* If resources do not load, please check the wiki for details.
|
149 |
+
* @since 1.0.1
|
150 |
+
* @return string URL to CMB resources
|
151 |
+
*/
|
152 |
+
public function url( $path = '' ) {
|
153 |
+
if ( $this->url ) {
|
154 |
+
return $this->url . $path;
|
155 |
+
}
|
156 |
+
|
157 |
+
if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
|
158 |
+
// Windows
|
159 |
+
$content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
|
160 |
+
$content_url = str_replace( $content_dir, WP_CONTENT_URL, cmb2_dir() );
|
161 |
+
$cmb2_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
|
162 |
+
|
163 |
+
} else {
|
164 |
+
$cmb2_url = str_replace(
|
165 |
+
array( WP_CONTENT_DIR, WP_PLUGIN_DIR ),
|
166 |
+
array( WP_CONTENT_URL, WP_PLUGIN_URL ),
|
167 |
+
cmb2_dir()
|
168 |
+
);
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Filter the CMB location url
|
173 |
+
*
|
174 |
+
* @param string $cmb2_url Currently registered url
|
175 |
+
*/
|
176 |
+
$this->url = trailingslashit( apply_filters( 'cmb2_meta_box_url', set_url_scheme( $cmb2_url ), CMB2_VERSION ) );
|
177 |
+
|
178 |
+
return $this->url . $path;
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
cmb2/includes/CMB2_hookup.php
ADDED
@@ -0,0 +1,395 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CMB2_hookup {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Metabox Form ID
|
7 |
+
* @var string
|
8 |
+
* @since 0.9.4
|
9 |
+
*/
|
10 |
+
protected $form_id = 'post';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Array of all hooks done (to be run once)
|
14 |
+
* @var array
|
15 |
+
* @since 2.0.0
|
16 |
+
*/
|
17 |
+
protected static $hooks_completed = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Only allow JS registration once
|
21 |
+
* @var bool
|
22 |
+
* @since 2.0.0
|
23 |
+
*/
|
24 |
+
protected static $registration_done = false;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Metabox Form ID
|
28 |
+
* @var CMB2 object
|
29 |
+
* @since 2.0.2
|
30 |
+
*/
|
31 |
+
protected $cmb;
|
32 |
+
|
33 |
+
public function __construct( CMB2 $cmb ) {
|
34 |
+
$this->cmb = $cmb;
|
35 |
+
|
36 |
+
$this->hooks();
|
37 |
+
if ( is_admin() ) {
|
38 |
+
$this->admin_hooks();
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
public function hooks() {
|
43 |
+
// Handle oembed Ajax
|
44 |
+
$this->once( 'wp_ajax_cmb2_oembed_handler', array( cmb2_ajax(), 'oembed_handler' ) );
|
45 |
+
$this->once( 'wp_ajax_nopriv_cmb2_oembed_handler', array( cmb2_ajax(), 'oembed_handler' ) );
|
46 |
+
|
47 |
+
foreach ( get_class_methods( 'CMB2_Show_Filters' ) as $filter ) {
|
48 |
+
add_filter( 'cmb2_show_on', array( 'CMB2_Show_Filters', $filter ), 10, 3 );
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
public function admin_hooks() {
|
54 |
+
|
55 |
+
$field_types = (array) wp_list_pluck( $this->cmb->prop( 'fields', array() ), 'type' );
|
56 |
+
$has_upload = in_array( 'file', $field_types ) || in_array( 'file_list', $field_types );
|
57 |
+
|
58 |
+
global $pagenow;
|
59 |
+
|
60 |
+
// register our scripts and styles for cmb
|
61 |
+
$this->once( 'admin_enqueue_scripts', array( __CLASS__, 'register_scripts' ), 8 );
|
62 |
+
|
63 |
+
$type = $this->cmb->mb_object_type();
|
64 |
+
if ( 'post' == $type ) {
|
65 |
+
add_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );
|
66 |
+
add_action( 'add_attachment', array( $this, 'save_post' ) );
|
67 |
+
add_action( 'edit_attachment', array( $this, 'save_post' ) );
|
68 |
+
add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
|
69 |
+
|
70 |
+
$this->once( 'admin_enqueue_scripts', array( $this, 'do_scripts' ) );
|
71 |
+
|
72 |
+
if ( $has_upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
|
73 |
+
$this->once( 'admin_head', array( $this, 'add_post_enctype' ) );
|
74 |
+
}
|
75 |
+
|
76 |
+
} elseif ( 'user' == $type ) {
|
77 |
+
|
78 |
+
$priority = $this->cmb->prop( 'priority' );
|
79 |
+
|
80 |
+
if ( ! is_numeric( $priority ) ) {
|
81 |
+
switch ( $priority ) {
|
82 |
+
|
83 |
+
case 'high':
|
84 |
+
$priority = 5;
|
85 |
+
break;
|
86 |
+
|
87 |
+
case 'low':
|
88 |
+
$priority = 20;
|
89 |
+
break;
|
90 |
+
|
91 |
+
default:
|
92 |
+
$priority = 10;
|
93 |
+
break;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
add_action( 'show_user_profile', array( $this, 'user_metabox' ), $priority );
|
98 |
+
add_action( 'edit_user_profile', array( $this, 'user_metabox' ), $priority );
|
99 |
+
add_action( 'user_new_form', array( $this, 'user_new_metabox' ), $priority );
|
100 |
+
|
101 |
+
add_action( 'personal_options_update', array( $this, 'save_user' ) );
|
102 |
+
add_action( 'edit_user_profile_update', array( $this, 'save_user' ) );
|
103 |
+
add_action( 'user_register', array( $this, 'save_user' ) );
|
104 |
+
if ( $has_upload && in_array( $pagenow, array( 'profile.php', 'user-edit.php', 'user-add.php' ) ) ) {
|
105 |
+
$this->form_id = 'your-profile';
|
106 |
+
$this->once( 'admin_head', array( $this, 'add_post_enctype' ) );
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Registers scripts and styles for CMB
|
113 |
+
* @since 1.0.0
|
114 |
+
*/
|
115 |
+
public static function register_scripts() {
|
116 |
+
if ( self::$registration_done ) {
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
|
120 |
+
// Only use minified files if SCRIPT_DEBUG is off
|
121 |
+
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
122 |
+
|
123 |
+
if ( ! is_admin() ) {
|
124 |
+
// we need to register colorpicker on the front-end
|
125 |
+
wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), CMB2_VERSION );
|
126 |
+
wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), CMB2_VERSION );
|
127 |
+
wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
|
128 |
+
'clear' => __( 'Clear', 'cmb2' ),
|
129 |
+
'defaultString' => __( 'Default', 'cmb2' ),
|
130 |
+
'pick' => __( 'Select Color', 'cmb2' ),
|
131 |
+
'current' => __( 'Current Color', 'cmb2' ),
|
132 |
+
) );
|
133 |
+
}
|
134 |
+
|
135 |
+
wp_register_script( 'cmb-timepicker', cmb2_utils()->url( 'js/jquery.timePicker.min.js' ) );
|
136 |
+
|
137 |
+
// scripts required for cmb
|
138 |
+
$scripts = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'cmb-timepicker', 'wp-color-picker' );
|
139 |
+
// styles required for cmb
|
140 |
+
$styles = array( 'wp-color-picker' );
|
141 |
+
|
142 |
+
wp_register_script( 'cmb2-scripts', cmb2_utils()->url( "js/cmb2{$min}.js" ), $scripts, CMB2_VERSION );
|
143 |
+
|
144 |
+
wp_localize_script( 'cmb2-scripts', 'cmb2_l10', apply_filters( 'cmb2_localized_data', array(
|
145 |
+
'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ),
|
146 |
+
'ajaxurl' => admin_url( '/admin-ajax.php' ),
|
147 |
+
'script_debug' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG,
|
148 |
+
'up_arrow_class' => 'dashicons dashicons-arrow-up-alt2',
|
149 |
+
'down_arrow_class' => 'dashicons dashicons-arrow-down-alt2',
|
150 |
+
'defaults' => array(
|
151 |
+
'color_picker' => false,
|
152 |
+
'date_picker' => array(
|
153 |
+
'changeMonth' => true,
|
154 |
+
'changeYear' => true,
|
155 |
+
'dateFormat' => __( 'mm/dd/yy', 'cmb2' ),
|
156 |
+
'dayNames' => explode( ',', __( 'Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday', 'cmb2' ) ),
|
157 |
+
'dayNamesMin' => explode( ',', __( 'Su, Mo, Tu, We, Th, Fr, Sa', 'cmb2' ) ),
|
158 |
+
'dayNamesShort' => explode( ',', __( 'Sun, Mon, Tue, Wed, Thu, Fri, Sat', 'cmb2' ) ),
|
159 |
+
'monthNames' => explode( ',', __( 'January, February, March, April, May, June, July, August, September, October, November, December', 'cmb2' ) ),
|
160 |
+
'monthNamesShort' => explode( ',', __( 'Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec', 'cmb2' ) ),
|
161 |
+
'nextText' => __( 'Next', 'cmb2' ),
|
162 |
+
'prevText' => __( 'Prev', 'cmb2' ),
|
163 |
+
'currentText' => __( 'Today', 'cmb2' ),
|
164 |
+
'closeText' => __( 'Done', 'cmb2' ),
|
165 |
+
'clearText' => __( 'Clear', 'cmb2' ),
|
166 |
+
),
|
167 |
+
'time_picker' => array(
|
168 |
+
'startTime' => '00:00',
|
169 |
+
'endTime' => '23:59',
|
170 |
+
'show24Hours' => false,
|
171 |
+
'separator' => ':',
|
172 |
+
'step' => 30,
|
173 |
+
),
|
174 |
+
),
|
175 |
+
'strings' => array(
|
176 |
+
'upload_file' => __( 'Use this file', 'cmb2' ),
|
177 |
+
'remove_image' => __( 'Remove Image', 'cmb2' ),
|
178 |
+
'remove_file' => __( 'Remove', 'cmb2' ),
|
179 |
+
'file' => __( 'File:', 'cmb2' ),
|
180 |
+
'download' => __( 'Download', 'cmb2' ),
|
181 |
+
'check_toggle' => __( 'Select / Deselect All', 'cmb2' ),
|
182 |
+
),
|
183 |
+
) ) );
|
184 |
+
|
185 |
+
wp_register_style( 'cmb2-styles', cmb2_utils()->url( "css/cmb2{$min}.css" ), $styles );
|
186 |
+
|
187 |
+
self::$registration_done = true;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Enqueues scripts and styles for CMB
|
192 |
+
* @since 1.0.0
|
193 |
+
*/
|
194 |
+
public function do_scripts( $hook ) {
|
195 |
+
// only enqueue our scripts/styles on the proper pages
|
196 |
+
if ( in_array( $hook, array( 'post.php', 'post-new.php', 'page-new.php', 'page.php' ), true ) ) {
|
197 |
+
if ( $this->cmb->prop( 'cmb_styles' ) ) {
|
198 |
+
self::enqueue_cmb_css();
|
199 |
+
}
|
200 |
+
self::enqueue_cmb_js();
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Add encoding attribute
|
206 |
+
*/
|
207 |
+
public function add_post_enctype() {
|
208 |
+
echo '
|
209 |
+
<script type="text/javascript">
|
210 |
+
jQuery(document).ready(function(){
|
211 |
+
$form = jQuery("#' . $this->form_id . '");
|
212 |
+
if ( $form.length ) {
|
213 |
+
$form.attr( {
|
214 |
+
"enctype" : "multipart/form-data",
|
215 |
+
"encoding" : "multipart/form-data"
|
216 |
+
} );
|
217 |
+
}
|
218 |
+
});
|
219 |
+
</script>';
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Add metaboxes (to 'post' object type)
|
224 |
+
*/
|
225 |
+
public function add_metaboxes() {
|
226 |
+
|
227 |
+
if ( ! $this->show_on() ) {
|
228 |
+
return;
|
229 |
+
}
|
230 |
+
|
231 |
+
foreach ( $this->cmb->prop( 'object_types' ) as $page ) {
|
232 |
+
|
233 |
+
if ( $this->cmb->prop( 'closed' ) ) {
|
234 |
+
add_filter( "postbox_classes_{$page}_{$this->cmb->cmb_id}", array( $this, 'close_metabox_class' ) );
|
235 |
+
}
|
236 |
+
|
237 |
+
add_meta_box( $this->cmb->cmb_id, $this->cmb->prop( 'title' ), array( $this, 'post_metabox' ), $page, $this->cmb->prop( 'context' ), $this->cmb->prop( 'priority' ) );
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Add 'closed' class to metabox
|
243 |
+
* @since 2.0.0
|
244 |
+
* @param array $classes Array of classes
|
245 |
+
* @return array Modified array of classes
|
246 |
+
*/
|
247 |
+
public function close_metabox_class( $classes ) {
|
248 |
+
$classes[] = 'closed';
|
249 |
+
return $classes;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Display metaboxes for a post object
|
254 |
+
* @since 1.0.0
|
255 |
+
*/
|
256 |
+
public function post_metabox() {
|
257 |
+
$this->cmb->show_form( get_the_ID(), 'post' );
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Display metaboxes for new user page
|
262 |
+
* @since 1.0.0
|
263 |
+
*/
|
264 |
+
public function user_new_metabox( $section ) {
|
265 |
+
if ( $section == $this->cmb->prop( 'new_user_section' ) ) {
|
266 |
+
$object_id = $this->cmb->object_id();
|
267 |
+
$this->cmb->object_id( isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id );
|
268 |
+
$this->user_metabox();
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Display metaboxes for a user object
|
274 |
+
* @since 1.0.0
|
275 |
+
*/
|
276 |
+
public function user_metabox() {
|
277 |
+
|
278 |
+
if ( 'user' != $this->cmb->mb_object_type() ) {
|
279 |
+
return;
|
280 |
+
}
|
281 |
+
|
282 |
+
if ( ! $this->show_on() ) {
|
283 |
+
return;
|
284 |
+
}
|
285 |
+
|
286 |
+
if ( $this->cmb->prop( 'cmb_styles' ) ) {
|
287 |
+
self::enqueue_cmb_css();
|
288 |
+
}
|
289 |
+
self::enqueue_cmb_js();
|
290 |
+
|
291 |
+
$this->cmb->show_form( 0, 'user' );
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Save data from metabox
|
296 |
+
*/
|
297 |
+
public function save_post( $post_id, $post = false ) {
|
298 |
+
|
299 |
+
$post_type = $post ? $post->post_type : get_post_type( $post_id );
|
300 |
+
|
301 |
+
$do_not_pass_go = (
|
302 |
+
// check nonce
|
303 |
+
! isset( $_POST[ $this->cmb->nonce() ] )
|
304 |
+
|| ! wp_verify_nonce( $_POST[ $this->cmb->nonce() ], $this->cmb->nonce() )
|
305 |
+
// check if autosave
|
306 |
+
|| defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE
|
307 |
+
// check user editing permissions
|
308 |
+
|| ( 'page' == $post_type && ! current_user_can( 'edit_page', $post_id ) )
|
309 |
+
|| ! current_user_can( 'edit_post', $post_id )
|
310 |
+
// get the metabox post_types & compare it to this post_type
|
311 |
+
|| ! in_array( $post_type, $this->cmb->prop( 'object_types' ) )
|
312 |
+
);
|
313 |
+
|
314 |
+
if ( $do_not_pass_go ) {
|
315 |
+
// do not collect $200
|
316 |
+
return;
|
317 |
+
}
|
318 |
+
|
319 |
+
// take a trip to reading railroad – if you pass go collect $200
|
320 |
+
$this->cmb->save_fields( $post_id, 'post', $_POST );
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Save data from metabox
|
325 |
+
*/
|
326 |
+
public function save_user( $user_id ) {
|
327 |
+
// check permissions
|
328 |
+
if (
|
329 |
+
// check nonce
|
330 |
+
! isset( $_POST[ $this->cmb->nonce() ] )
|
331 |
+
|| ! wp_verify_nonce( $_POST[ $this->cmb->nonce() ], $this->cmb->nonce() )
|
332 |
+
) {
|
333 |
+
// @todo more hardening?
|
334 |
+
return;
|
335 |
+
}
|
336 |
+
|
337 |
+
$this->cmb->save_fields( $user_id, 'user', $_POST );
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Determines if metabox should be shown in current context
|
342 |
+
* @since 2.0.0
|
343 |
+
* @return bool
|
344 |
+
*/
|
345 |
+
public function show_on() {
|
346 |
+
return (bool) apply_filters( 'cmb2_show_on', true, $this->cmb->meta_box, $this->cmb );
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Ensures WordPress hook only gets fired once
|
351 |
+
* @since 2.0.0
|
352 |
+
* @param string $action The name of the filter to hook the $hook callback to.
|
353 |
+
* @param callback $hook The callback to be run when the filter is applied.
|
354 |
+
* @param integer $priority Order the functions are executed
|
355 |
+
* @param int $accepted_args The number of arguments the function accepts.
|
356 |
+
*/
|
357 |
+
public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) {
|
358 |
+
$key = md5( serialize( func_get_args() ) );
|
359 |
+
|
360 |
+
if ( in_array( $key, self::$hooks_completed ) ) {
|
361 |
+
return;
|
362 |
+
}
|
363 |
+
|
364 |
+
self::$hooks_completed[] = $key;
|
365 |
+
add_filter( $action, $hook, $priority, $accepted_args );
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Includes CMB styles
|
370 |
+
* @since 2.0.0
|
371 |
+
*/
|
372 |
+
public static function enqueue_cmb_css() {
|
373 |
+
if ( ! apply_filters( 'cmb2_enqueue_css', true ) ) {
|
374 |
+
return false;
|
375 |
+
}
|
376 |
+
|
377 |
+
self::register_scripts();
|
378 |
+
return wp_enqueue_style( 'cmb2-styles' );
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Includes CMB JS
|
383 |
+
* @since 2.0.0
|
384 |
+
*/
|
385 |
+
public static function enqueue_cmb_js() {
|
386 |
+
if ( ! apply_filters( 'cmb2_enqueue_js', true ) ) {
|
387 |
+
return false;
|
388 |
+
}
|
389 |
+
|
390 |
+
self::register_scripts();
|
391 |
+
wp_enqueue_media();
|
392 |
+
return wp_enqueue_script( 'cmb2-scripts' );
|
393 |
+
}
|
394 |
+
|
395 |
+
}
|
cmb2/includes/helper-functions.php
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Autoloads files with CMB2 classes when needed
|
5 |
+
* @since 1.0.0
|
6 |
+
* @param string $class_name Name of the class being requested
|
7 |
+
*/
|
8 |
+
function cmb2_autoload_classes( $class_name ) {
|
9 |
+
if ( class_exists( $class_name, false ) || false === strpos( $class_name, 'CMB2' ) ) {
|
10 |
+
return;
|
11 |
+
}
|
12 |
+
|
13 |
+
$file = cmb2_dir( "includes/{$class_name}.php" );
|
14 |
+
if ( file_exists( $file ) ) {
|
15 |
+
include_once( $file );
|
16 |
+
}
|
17 |
+
}
|
18 |
+
spl_autoload_register( 'cmb2_autoload_classes' );
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Get instance of the CMB2_Utils class
|
22 |
+
* @since 2.0.0
|
23 |
+
* @return CMB2_Utils object CMB utilities class
|
24 |
+
*/
|
25 |
+
function cmb2_utils() {
|
26 |
+
static $cmb2_utils;
|
27 |
+
$cmb2_utils = $cmb2_utils ? $cmb2_utils : new CMB2_Utils();
|
28 |
+
return $cmb2_utils;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Get instance of the CMB2_Ajax class
|
33 |
+
* @since 2.0.0
|
34 |
+
* @return CMB2_Ajax object CMB utilities class
|
35 |
+
*/
|
36 |
+
function cmb2_ajax() {
|
37 |
+
static $cmb2_ajax;
|
38 |
+
$cmb2_ajax = $cmb2_ajax ? $cmb2_ajax : new CMB2_Ajax();
|
39 |
+
return $cmb2_ajax;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get instance of the CMB2_Option class for the passed metabox ID
|
44 |
+
* @since 2.0.0
|
45 |
+
* @return CMB2_Option object Options class for setting/getting options for metabox
|
46 |
+
*/
|
47 |
+
function cmb2_options( $key ) {
|
48 |
+
return CMB2_Options::get( $key );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get a cmb oEmbed. Handles oEmbed getting for non-post objects
|
53 |
+
* @since 2.0.0
|
54 |
+
* @param array $args Arguments. Accepts:
|
55 |
+
*
|
56 |
+
* 'url' - URL to retrieve the oEmbed from,
|
57 |
+
* 'object_id' - $post_id,
|
58 |
+
* 'object_type' - 'post',
|
59 |
+
* 'oembed_args' - $embed_args, // array containing 'width', etc
|
60 |
+
* 'field_id' - false,
|
61 |
+
* 'cache_key' - false,
|
62 |
+
*
|
63 |
+
* @return string oEmbed string
|
64 |
+
*/
|
65 |
+
function cmb2_get_oembed( $args = array() ) {
|
66 |
+
return cmb2_ajax()->get_oembed( $args );
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* A helper function to get an option from a CMB options array
|
71 |
+
* @since 1.0.1
|
72 |
+
* @param string $option_key Option key
|
73 |
+
* @param string $field_id Option array field key
|
74 |
+
* @return array Options array or specific field
|
75 |
+
*/
|
76 |
+
function cmb2_get_option( $option_key, $field_id = '' ) {
|
77 |
+
return cmb2_options( $option_key )->get( $field_id );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* A helper function to update an option in a CMB options array
|
82 |
+
* @since 2.0.0
|
83 |
+
* @param string $option_key Option key
|
84 |
+
* @param string $field_id Option array field key
|
85 |
+
* @param mixed $value Value to update data with
|
86 |
+
* @param boolean $single Whether data should not be an array
|
87 |
+
* @return boolean Success/Failure
|
88 |
+
*/
|
89 |
+
function cmb2_update_option( $option_key, $field_id, $value, $single = true ) {
|
90 |
+
if ( cmb2_options( $option_key )->update( $field_id, $value, false, $single ) ) {
|
91 |
+
return cmb2_options( $option_key )->set();
|
92 |
+
}
|
93 |
+
|
94 |
+
return false;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Get a CMB field object.
|
99 |
+
* @since 1.1.0
|
100 |
+
* @param array $meta_box Metabox ID or Metabox config array
|
101 |
+
* @param array $field_id Field ID or all field arguments
|
102 |
+
* @param int $object_id Object ID
|
103 |
+
* @param string $object_type Type of object being saved. (e.g., post, user, comment, or options-page)
|
104 |
+
* @return CMB2_Field|null CMB2_Field object unless metabox config cannot be found
|
105 |
+
*/
|
106 |
+
function cmb2_get_field( $meta_box, $field_id, $object_id = 0, $object_type = 'post' ) {
|
107 |
+
|
108 |
+
$object_id = $object_id ? $object_id : get_the_ID();
|
109 |
+
$cmb = ( $meta_box instanceof CMB2 ) ? $meta_box : cmb2_get_metabox( $meta_box, $object_id );
|
110 |
+
|
111 |
+
if ( ! $cmb ) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
$object_type = $object_type ? $object_type : $cmb->mb_object_type();
|
116 |
+
$cmb->object_type( $object_type );
|
117 |
+
|
118 |
+
if ( is_array( $field_id ) && isset( $field_id['id'] ) ) {
|
119 |
+
return new CMB2_Field( array(
|
120 |
+
'field_args' => $field_id,
|
121 |
+
'object_id' => $object_id,
|
122 |
+
'object_type' => $object_type,
|
123 |
+
) );
|
124 |
+
}
|
125 |
+
|
126 |
+
$fields = (array) $cmb->prop( 'fields' );
|
127 |
+
foreach ( $fields as $field ) {
|
128 |
+
if ( $field['id'] == $field_id || $field['name'] == $field_id ) {
|
129 |
+
// Send back field object
|
130 |
+
return new CMB2_Field( array(
|
131 |
+
'field_args' => $field,
|
132 |
+
'object_id' => $object_id,
|
133 |
+
'object_type' => $object_type,
|
134 |
+
) );
|
135 |
+
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Get a field's value.
|
142 |
+
* @since 1.1.0
|
143 |
+
* @param array $meta_box Metabox ID or Metabox config array
|
144 |
+
* @param array $field_id Field ID or all field arguments
|
145 |
+
* @param int $object_id Object ID
|
146 |
+
* @param string $object_type Type of object being saved. (e.g., post, user, comment, or options-page)
|
147 |
+
* @return mixed Maybe escaped value
|
148 |
+
*/
|
149 |
+
function cmb2_get_field_value( $meta_box, $field_id, $object_id = 0, $object_type = 'post' ) {
|
150 |
+
$field = cmb2_get_field( $meta_box, $field_id, $object_id, $object_type );
|
151 |
+
return $field->escaped_value();
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Because OOP can be scary
|
156 |
+
* @since 2.0.2
|
157 |
+
* @param array $meta_box_config Metabox Config array
|
158 |
+
* @return CMB2 object Instantiated CMB2 object
|
159 |
+
*/
|
160 |
+
function new_cmb2_box( array $meta_box_config ) {
|
161 |
+
return cmb2_get_metabox( $meta_box_config );
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Retrieve a CMB instance by the metabox ID
|
166 |
+
* @since 2.0.0
|
167 |
+
* @param mixed $meta_box Metabox ID or Metabox config array
|
168 |
+
* @return CMB2 object
|
169 |
+
*/
|
170 |
+
function cmb2_get_metabox( $meta_box, $object_id = 0 ) {
|
171 |
+
|
172 |
+
if ( $meta_box instanceof CMB2 ) {
|
173 |
+
return $meta_box;
|
174 |
+
}
|
175 |
+
|
176 |
+
if ( is_string( $meta_box ) ) {
|
177 |
+
$cmb = CMB2_Boxes::get( $meta_box );
|
178 |
+
} else {
|
179 |
+
// See if we already have an instance of this metabox
|
180 |
+
$cmb = CMB2_Boxes::get( $meta_box['id'] );
|
181 |
+
// If not, we'll initate a new metabox
|
182 |
+
$cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id );
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( $cmb && $object_id ) {
|
186 |
+
$cmb->object_id( $object_id );
|
187 |
+
}
|
188 |
+
return $cmb;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Retrieve a metabox form
|
193 |
+
* @since 2.0.0
|
194 |
+
* @param mixed $meta_box Metabox config array or Metabox ID
|
195 |
+
* @param int $object_id Object ID
|
196 |
+
* @param array $args Optional arguments array
|
197 |
+
* @return string CMB html form markup
|
198 |
+
*/
|
199 |
+
function cmb2_get_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
|
200 |
+
|
201 |
+
$object_id = $object_id ? $object_id : get_the_ID();
|
202 |
+
$cmb = cmb2_get_metabox( $meta_box, $object_id );
|
203 |
+
|
204 |
+
ob_start();
|
205 |
+
// Get cmb form
|
206 |
+
cmb2_print_metabox_form( $cmb, $object_id, $args );
|
207 |
+
$form = ob_get_contents();
|
208 |
+
ob_end_clean();
|
209 |
+
|
210 |
+
return apply_filters( 'cmb2_get_metabox_form', $form, $object_id, $cmb );
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Display a metabox form & save it on submission
|
215 |
+
* @since 1.0.0
|
216 |
+
* @param mixed $meta_box Metabox config array or Metabox ID
|
217 |
+
* @param int $object_id Object ID
|
218 |
+
* @param array $args Optional arguments array
|
219 |
+
*/
|
220 |
+
function cmb2_print_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
|
221 |
+
|
222 |
+
$object_id = $object_id ? $object_id : get_the_ID();
|
223 |
+
$cmb = cmb2_get_metabox( $meta_box, $object_id );
|
224 |
+
|
225 |
+
// if passing a metabox ID, and that ID was not found
|
226 |
+
if ( ! $cmb ) {
|
227 |
+
return;
|
228 |
+
}
|
229 |
+
|
230 |
+
// Set object type to what is declared in the metabox (rather than trying to guess from context)
|
231 |
+
$cmb->object_type( $cmb->mb_object_type() );
|
232 |
+
|
233 |
+
// Save the metabox if it's been submitted
|
234 |
+
// check permissions
|
235 |
+
// @todo more hardening?
|
236 |
+
if (
|
237 |
+
// check nonce
|
238 |
+
isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] )
|
239 |
+
&& wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() )
|
240 |
+
&& $object_id && $_POST['object_id'] == $object_id
|
241 |
+
) {
|
242 |
+
$cmb->save_fields( $object_id, $cmb->object_type(), $_POST );
|
243 |
+
}
|
244 |
+
|
245 |
+
// Enqueue JS/CSS
|
246 |
+
if ( $cmb->prop( 'cmb_styles' ) ) {
|
247 |
+
CMB2_hookup::enqueue_cmb_css();
|
248 |
+
}
|
249 |
+
CMB2_hookup::enqueue_cmb_js();
|
250 |
+
|
251 |
+
$args = wp_parse_args( $args, array(
|
252 |
+
'form_format' => '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<input type="submit" name="submit-cmb" value="%4$s" class="button-primary"></form>',
|
253 |
+
'save_button' => __( 'Save', 'cmb2' ),
|
254 |
+
) );
|
255 |
+
|
256 |
+
$form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb );
|
257 |
+
|
258 |
+
$format_parts = explode( '%3$s', $form_format );
|
259 |
+
|
260 |
+
// Show cmb form
|
261 |
+
printf( $format_parts[0], $cmb->cmb_id, $object_id );
|
262 |
+
$cmb->show_form();
|
263 |
+
|
264 |
+
if ( isset( $format_parts[1] ) && $format_parts[1] ) {
|
265 |
+
printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] );
|
266 |
+
}
|
267 |
+
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Display a metabox form (or optionally return it) & save it on submission
|
272 |
+
* @since 1.0.0
|
273 |
+
* @param mixed $meta_box Metabox config array or Metabox ID
|
274 |
+
* @param int $object_id Object ID
|
275 |
+
* @param array $args Optional arguments array
|
276 |
+
*/
|
277 |
+
function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
|
278 |
+
if ( ! isset( $args['echo'] ) || $args['echo'] ) {
|
279 |
+
cmb2_print_metabox_form( $meta_box, $object_id, $args );
|
280 |
+
} else {
|
281 |
+
return cmb2_get_metabox_form( $meta_box, $object_id, $args );
|
282 |
+
}
|
283 |
+
}
|
cmb2/includes/index.php
ADDED
File without changes
|
cmb2/index.php
ADDED
File without changes
|
cmb2/init.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! class_exists( 'cmb2_bootstrap_202', false ) ) {
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Check for newest version of CMB
|
6 |
+
*/
|
7 |
+
class cmb2_bootstrap_202 {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Current version number
|
11 |
+
* @var string
|
12 |
+
* @since 1.0.0
|
13 |
+
*/
|
14 |
+
const VERSION = '2.0.2';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Current version hook priority
|
18 |
+
* Will decrement with each release
|
19 |
+
*
|
20 |
+
* @var int
|
21 |
+
* @since 2.0.0
|
22 |
+
*/
|
23 |
+
const PRIORITY = 9997;
|
24 |
+
|
25 |
+
public static $single = null;
|
26 |
+
|
27 |
+
public static function go() {
|
28 |
+
if ( null === self::$single ) {
|
29 |
+
self::$single = new self();
|
30 |
+
}
|
31 |
+
return self::$single;
|
32 |
+
}
|
33 |
+
|
34 |
+
private function __construct() {
|
35 |
+
/**
|
36 |
+
* A constant you can use to check if CMB2 is loaded
|
37 |
+
* for your plugins/themes with CMB2 dependency
|
38 |
+
*/
|
39 |
+
if ( ! defined( 'CMB2_LOADED' ) ) {
|
40 |
+
define( 'CMB2_LOADED', true );
|
41 |
+
}
|
42 |
+
add_action( 'init', array( $this, 'include_cmb' ), self::PRIORITY );
|
43 |
+
}
|
44 |
+
|
45 |
+
public function include_cmb() {
|
46 |
+
if ( ! class_exists( 'CMB2', false ) ) {
|
47 |
+
if ( ! defined( 'CMB2_VERSION' ) ) {
|
48 |
+
define( 'CMB2_VERSION', self::VERSION );
|
49 |
+
}
|
50 |
+
$this->l10ni18n();
|
51 |
+
require_once 'bootstrap.php';
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Load CMB text domain
|
57 |
+
* @since 2.0.0
|
58 |
+
*/
|
59 |
+
public function l10ni18n() {
|
60 |
+
$loaded = load_plugin_textdomain( 'cmb2', false, '/languages/' );
|
61 |
+
if ( ! $loaded ) {
|
62 |
+
$loaded = load_muplugin_textdomain( 'cmb2', '/languages/' );
|
63 |
+
}
|
64 |
+
if ( ! $loaded ) {
|
65 |
+
$loaded = load_theme_textdomain( 'cmb2', '/languages/' );
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( ! $loaded ) {
|
69 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'cmb2' );
|
70 |
+
$mofile = dirname( __FILE__ ) . '/languages/cmb2-' . $locale . '.mo';
|
71 |
+
load_textdomain( 'cmb2', $mofile );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
}
|
76 |
+
cmb2_bootstrap_202::go();
|
77 |
+
|
78 |
+
} // class exists check
|
cmb2/js/cmb2.js
ADDED
@@ -0,0 +1,891 @@
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Controls the behaviours of custom metabox fields.
|
3 |
+
*
|
4 |
+
* @author WebDevStudios
|
5 |
+
* @see https://github.com/WebDevStudios/CMB2
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Custom jQuery for Custom Metaboxes and Fields
|
10 |
+
*/
|
11 |
+
window.CMB2 = (function(window, document, $, undefined){
|
12 |
+
'use strict';
|
13 |
+
|
14 |
+
// localization strings
|
15 |
+
var l10n = window.cmb2_l10;
|
16 |
+
var setTimeout = window.setTimeout;
|
17 |
+
|
18 |
+
// CMB functionality object
|
19 |
+
var cmb = {
|
20 |
+
formfield : '',
|
21 |
+
idNumber : false,
|
22 |
+
file_frames : {},
|
23 |
+
repeatEls : 'input:not([type="button"]),select,textarea,.cmb2-media-status',
|
24 |
+
styleBreakPoint : 450,
|
25 |
+
mediaHandlers : {},
|
26 |
+
defaults : {
|
27 |
+
time_picker : l10n.defaults.time_picker,
|
28 |
+
date_picker : l10n.defaults.date_picker,
|
29 |
+
color_picker : l10n.defaults.color_picker || {},
|
30 |
+
},
|
31 |
+
};
|
32 |
+
|
33 |
+
// Because it's a more efficient way of getting an element by id.
|
34 |
+
var $id = function( selector ) {
|
35 |
+
return $( document.getElementById( selector ) );
|
36 |
+
};
|
37 |
+
|
38 |
+
cmb.metabox = function() {
|
39 |
+
if ( cmb.$metabox ) {
|
40 |
+
return cmb.$metabox;
|
41 |
+
}
|
42 |
+
cmb.$metabox = $('.cmb2-wrap > .cmb2-metabox');
|
43 |
+
return cmb.$metabox;
|
44 |
+
};
|
45 |
+
|
46 |
+
cmb.init = function() {
|
47 |
+
|
48 |
+
cmb.log( 'CMB2 localized data', l10n );
|
49 |
+
var $metabox = cmb.metabox();
|
50 |
+
var $repeatGroup = $metabox.find('.cmb-repeatable-group');
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Initialize time/date/color pickers
|
54 |
+
*/
|
55 |
+
cmb.initPickers( $metabox.find('input[type="text"].cmb2-timepicker'), $metabox.find('input[type="text"].cmb2-datepicker'), $metabox.find('input[type="text"].cmb2-colorpicker') );
|
56 |
+
|
57 |
+
// Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts
|
58 |
+
$id( 'ui-datepicker-div' ).wrap('<div class="cmb2-element" />');
|
59 |
+
|
60 |
+
// Insert toggle button into DOM wherever there is multicheck. credit: Genesis Framework
|
61 |
+
$( '<p><span class="button cmb-multicheck-toggle">' + l10n.strings.check_toggle + '</span></p>' ).insertBefore( '.cmb2-checkbox-list:not(.no-select-all)' );
|
62 |
+
|
63 |
+
// Make File List drag/drop sortable:
|
64 |
+
cmb.makeListSortable();
|
65 |
+
|
66 |
+
$metabox
|
67 |
+
.on( 'change', '.cmb2_upload_file', function() {
|
68 |
+
cmb.formfield = $(this).attr('id');
|
69 |
+
$id( cmb.formfield + '_id' ).val('');
|
70 |
+
})
|
71 |
+
// Media/file management
|
72 |
+
.on( 'click', '.cmb-multicheck-toggle', cmb.toggleCheckBoxes )
|
73 |
+
.on( 'click', '.cmb2-upload-button', cmb.handleMedia )
|
74 |
+
.on( 'click', '.cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span', cmb.handleFileClick )
|
75 |
+
.on( 'click', '.cmb2-remove-file-button', cmb.handleRemoveMedia )
|
76 |
+
// Repeatable content
|
77 |
+
.on( 'click', '.cmb-add-group-row', cmb.addGroupRow )
|
78 |
+
.on( 'click', '.cmb-add-row-button', cmb.addAjaxRow )
|
79 |
+
.on( 'click', '.cmb-remove-group-row', cmb.removeGroupRow )
|
80 |
+
.on( 'click', '.cmb-remove-row-button', cmb.removeAjaxRow )
|
81 |
+
// Ajax oEmbed display
|
82 |
+
.on( 'keyup paste focusout', '.cmb2-oembed', cmb.maybeOembed )
|
83 |
+
// Reset titles when removing a row
|
84 |
+
.on( 'cmb2_remove_row', '.cmb-repeatable-group', cmb.resetTitlesAndIterator )
|
85 |
+
.on( 'click', '.cmbhandle, .cmbhandle + .cmbhandle-title', cmb.toggleHandle );
|
86 |
+
|
87 |
+
if ( $repeatGroup.length ) {
|
88 |
+
$repeatGroup
|
89 |
+
.filter('.sortable').each( function() {
|
90 |
+
// Add sorting arrows
|
91 |
+
$(this).find( '.button.cmb-remove-group-row' ).before( '<a class="button cmb-shift-rows move-up alignleft" href="#"><span class="'+ l10n.up_arrow_class +'"></span></a> <a class="button cmb-shift-rows move-down alignleft" href="#"><span class="'+ l10n.down_arrow_class +'"></span></a>' );
|
92 |
+
})
|
93 |
+
.on( 'click', '.cmb-shift-rows', cmb.shiftRows )
|
94 |
+
.on( 'cmb2_add_row', cmb.emptyValue );
|
95 |
+
}
|
96 |
+
|
97 |
+
// on pageload
|
98 |
+
setTimeout( cmb.resizeoEmbeds, 500);
|
99 |
+
// and on window resize
|
100 |
+
$(window).on( 'resize', cmb.resizeoEmbeds );
|
101 |
+
|
102 |
+
};
|
103 |
+
|
104 |
+
cmb.resetTitlesAndIterator = function() {
|
105 |
+
// Loop repeatable group tables
|
106 |
+
$( '.cmb-repeatable-group' ).each( function() {
|
107 |
+
var $table = $(this);
|
108 |
+
// Loop repeatable group table rows
|
109 |
+
$table.find( '.cmb-repeatable-grouping' ).each( function( rowindex ) {
|
110 |
+
var $row = $(this);
|
111 |
+
// Reset rows iterator
|
112 |
+
$row.data( 'iterator', rowindex );
|
113 |
+
// Reset rows title
|
114 |
+
$row.find( '.cmb-group-title h4' ).text( $table.find( '.cmb-add-group-row' ).data( 'grouptitle' ).replace( '{#}', ( rowindex + 1 ) ) );
|
115 |
+
});
|
116 |
+
});
|
117 |
+
};
|
118 |
+
|
119 |
+
cmb.toggleHandle = function( evt ) {
|
120 |
+
evt.preventDefault();
|
121 |
+
$(document).trigger( 'postbox-toggled', $(this).parent('.postbox').toggleClass('closed') );
|
122 |
+
};
|
123 |
+
|
124 |
+
cmb.toggleCheckBoxes = function( evt ) {
|
125 |
+
evt.preventDefault();
|
126 |
+
var $self = $(this);
|
127 |
+
var $multicheck = $self.closest( '.cmb-td' ).find( 'input[type=checkbox]' );
|
128 |
+
|
129 |
+
// If the button has already been clicked once...
|
130 |
+
if ( $self.data( 'checked' ) ) {
|
131 |
+
// clear the checkboxes and remove the flag
|
132 |
+
$multicheck.prop( 'checked', false );
|
133 |
+
$self.data( 'checked', false );
|
134 |
+
}
|
135 |
+
// Otherwise mark the checkboxes and add a flag
|
136 |
+
else {
|
137 |
+
$multicheck.prop( 'checked', true );
|
138 |
+
$self.data( 'checked', true );
|
139 |
+
}
|
140 |
+
};
|
141 |
+
|
142 |
+
cmb.handleMedia = function( evt ) {
|
143 |
+
evt.preventDefault();
|
144 |
+
|
145 |
+
var $el = $( this );
|
146 |
+
cmb.attach_id = ! $el.hasClass( 'cmb2-upload-list' ) ? $el.closest( '.cmb-td' ).find( '.cmb2-upload-file-id' ).val() : false;
|
147 |
+
// Clean up default 0 value
|
148 |
+
cmb.attach_id = '0' !== cmb.attach_id ? cmb.attach_id : false;
|
149 |
+
|
150 |
+
cmb._handleMedia( $el.prev('input.cmb2-upload-file').attr('id'), $el.hasClass( 'cmb2-upload-list' ) );
|
151 |
+
};
|
152 |
+
|
153 |
+
cmb.handleFileClick = function( evt ) {
|
154 |
+
evt.preventDefault();
|
155 |
+
|
156 |
+
var $el = $( this );
|
157 |
+
var $td = $el.closest( '.cmb-td' );
|
158 |
+
var isList = $td.find( '.cmb2-upload-button' ).hasClass( 'cmb2-upload-list' );
|
159 |
+
cmb.attach_id = isList ? $el.find( 'input[type="hidden"]' ).data( 'id' ) : $td.find( '.cmb2-upload-file-id' ).val();
|
160 |
+
|
161 |
+
if ( cmb.attach_id ) {
|
162 |
+
cmb._handleMedia( $td.find( 'input.cmb2-upload-file' ).attr('id'), isList, cmb.attach_id );
|
163 |
+
}
|
164 |
+
};
|
165 |
+
|
166 |
+
cmb._handleMedia = function( formfield, isList ) {
|
167 |
+
if ( ! wp ) {
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
var $metabox = cmb.metabox();
|
172 |
+
cmb.formfield = formfield;
|
173 |
+
var $formfield = $id( cmb.formfield );
|
174 |
+
var previewSize = $formfield.data( 'previewsize' );
|
175 |
+
var formName = $formfield.attr('name');
|
176 |
+
var uploadStatus = true;
|
177 |
+
var attachment = true;
|
178 |
+
|
179 |
+
// If this field's media frame already exists, reopen it.
|
180 |
+
if ( cmb.formfield in cmb.file_frames ) {
|
181 |
+
cmb.file_frames[ cmb.formfield ].open();
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
+
// Create the media frame.
|
186 |
+
cmb.file_frames[ cmb.formfield ] = wp.media({
|
187 |
+
title: $metabox.find('label[for=' + cmb.formfield + ']').text(),
|
188 |
+
button: {
|
189 |
+
text: l10n.strings.upload_file
|
190 |
+
},
|
191 |
+
multiple: isList ? true : false
|
192 |
+
});
|
193 |
+
|
194 |
+
cmb.mediaHandlers.list = function( selection, returnIt ) {
|
195 |
+
// Get all of our selected files
|
196 |
+
attachment = selection.toJSON();
|
197 |
+
|
198 |
+
$formfield.val(attachment.url);
|
199 |
+
$id( cmb.formfield +'_id' ).val(attachment.id);
|
200 |
+
|
201 |
+
// Setup our fileGroup array
|
202 |
+
var fileGroup = [];
|
203 |
+
|
204 |
+
// Loop through each attachment
|
205 |
+
$( attachment ).each( function() {
|
206 |
+
if ( this.type && this.type === 'image' ) {
|
207 |
+
var width = previewSize[0] ? previewSize[0] : 50;
|
208 |
+
var height = previewSize[1] ? previewSize[1] : 50;
|
209 |
+
|
210 |
+
// image preview
|
211 |
+
uploadStatus = '<li class="img-status">'+
|
212 |
+
'<img width="'+ width +'" height="'+ height +'" src="' + this.url + '" class="attachment-'+ width +'px'+ height +'px" alt="'+ this.filename +'">'+
|
213 |
+
'<p><a href="#" class="cmb2-remove-file-button" rel="'+ cmb.formfield +'['+ this.id +']">'+ l10n.strings.remove_image +'</a></p>'+
|
214 |
+
'<input type="hidden" id="filelist-'+ this.id +'" data-id="'+ this.id +'" name="'+ formName +'['+ this.id +']" value="' + this.url + '">'+
|
215 |
+
'</li>';
|
216 |
+
|
217 |
+
} else {
|
218 |
+
// Standard generic output if it's not an image.
|
219 |
+
uploadStatus = '<li class="file-status"><span>'+ l10n.strings.file +' <strong>'+ this.filename +'</strong></span> (<a href="' + this.url + '" target="_blank" rel="external">'+ l10n.strings.download +'</a> / <a href="#" class="cmb2-remove-file-button" rel="'+ cmb.formfield +'['+ this.id +']">'+ l10n.strings.remove_file +'</a>)'+
|
220 |
+
'<input type="hidden" id="filelist-'+ this.id +'" data-id="'+ this.id +'" name="'+ formName +'['+ this.id +']" value="' + this.url + '">'+
|
221 |
+
'</li>';
|
222 |
+
|
223 |
+
}
|
224 |
+
|
225 |
+
// Add our file to our fileGroup array
|
226 |
+
fileGroup.push( uploadStatus );
|
227 |
+
});
|
228 |
+
|
229 |
+
if ( ! returnIt ) {
|
230 |
+
// Append each item from our fileGroup array to .cmb2-media-status
|
231 |
+
$( fileGroup ).each( function() {
|
232 |
+
$formfield.siblings('.cmb2-media-status').slideDown().append(this);
|
233 |
+
});
|
234 |
+
} else {
|
235 |
+
return fileGroup;
|
236 |
+
}
|
237 |
+
|
238 |
+
};
|
239 |
+
cmb.mediaHandlers.single = function( selection ) {
|
240 |
+
// Only get one file from the uploader
|
241 |
+
attachment = selection.first().toJSON();
|
242 |
+
|
243 |
+
$formfield.val(attachment.url);
|
244 |
+
$id( cmb.formfield +'_id' ).val(attachment.id);
|
245 |
+
|
246 |
+
if ( attachment.type && attachment.type === 'image' ) {
|
247 |
+
// image preview
|
248 |
+
var width = previewSize[0] ? previewSize[0] : 350;
|
249 |
+
uploadStatus = '<div class="img-status"><img width="'+ width +'px" style="max-width: '+ width +'px; width: 100%; height: auto;" src="' + attachment.url + '" alt="'+ attachment.filename +'" title="'+ attachment.filename +'" /><p><a href="#" class="cmb2-remove-file-button" rel="' + cmb.formfield + '">'+ l10n.strings.remove_image +'</a></p></div>';
|
250 |
+
} else {
|
251 |
+
// Standard generic output if it's not an image.
|
252 |
+
uploadStatus = '<div class="file-status"><span>'+ l10n.strings.file +' <strong>'+ attachment.filename +'</strong></span> (<a href="'+ attachment.url +'" target="_blank" rel="external">'+ l10n.strings.download +'</a> / <a href="#" class="cmb2-remove-file-button" rel="'+ cmb.formfield +'">'+ l10n.strings.remove_file +'</a>)</div>';
|
253 |
+
}
|
254 |
+
|
255 |
+
// add/display our output
|
256 |
+
$formfield.siblings('.cmb2-media-status').slideDown().html(uploadStatus);
|
257 |
+
};
|
258 |
+
|
259 |
+
cmb.mediaHandlers.selectFile = function() {
|
260 |
+
var selection = cmb.file_frames[ cmb.formfield ].state().get('selection');
|
261 |
+
var type = isList ? 'list' : 'single';
|
262 |
+
|
263 |
+
if ( cmb.attach_id && isList ) {
|
264 |
+
$( '[data-id="'+ cmb.attach_id +'"]' ).parents( 'li' ).replaceWith( cmb.mediaHandlers.list( selection, true ) );
|
265 |
+
return;
|
266 |
+
}
|
267 |
+
|
268 |
+
cmb.mediaHandlers[type]( selection );
|
269 |
+
};
|
270 |
+
|
271 |
+
cmb.mediaHandlers.openModal = function() {
|
272 |
+
var selection = cmb.file_frames[ cmb.formfield ].state().get('selection');
|
273 |
+
|
274 |
+
if ( ! cmb.attach_id ) {
|
275 |
+
return selection.reset();
|
276 |
+
}
|
277 |
+
|
278 |
+
var attach = wp.media.attachment( cmb.attach_id );
|
279 |
+
attach.fetch();
|
280 |
+
selection.set( attach ? [ attach ] : [] );
|
281 |
+
};
|
282 |
+
|
283 |
+
// When a file is selected, run a callback.
|
284 |
+
cmb.file_frames[ cmb.formfield ]
|
285 |
+
.on( 'select', cmb.mediaHandlers.selectFile )
|
286 |
+
.on( 'open', cmb.mediaHandlers.openModal );
|
287 |
+
|
288 |
+
// Finally, open the modal
|
289 |
+
cmb.file_frames[ cmb.formfield ].open();
|
290 |
+
};
|
291 |
+
|
292 |
+
cmb.handleRemoveMedia = function( evt ) {
|
293 |
+
evt.preventDefault();
|
294 |
+
var $self = $(this);
|
295 |
+
if ( $self.is( '.cmb-attach-list .cmb2-remove-file-button' ) ){
|
296 |
+
$self.parents('li').remove();
|
297 |
+
return false;
|
298 |
+
}
|
299 |
+
|
300 |
+
cmb.formfield = $self.attr('rel');
|
301 |
+
|
302 |
+
cmb.metabox().find( 'input#' + cmb.formfield ).val('');
|
303 |
+
cmb.metabox().find( 'input#' + cmb.formfield + '_id' ).val('');
|
304 |
+
$self.parents('.cmb2-media-status').html('');
|
305 |
+
|
306 |
+
return false;
|
307 |
+
};
|
308 |
+
|
309 |
+
$.fn.cleanRow = function( prevNum, group ) {
|
310 |
+
var $self = $(this);
|
311 |
+
var $inputs = $self.find( 'input:not([type="button"]), select, textarea, label' );
|
312 |
+
var $other = $self.find('[id]').not( 'input:not([type="button"]), select, textarea, label' );
|
313 |
+
if ( group ) {
|
314 |
+
// Remove extra ajaxed rows
|
315 |
+
$self.find('.cmb-repeat-table .cmb-repeat-row:not(:first-child)').remove();
|
316 |
+
|
317 |
+
// Update all elements w/ an ID
|
318 |
+
if ( $other.length ) {
|
319 |
+
$other.each( function() {
|
320 |
+
var $_this = $( this );
|
321 |
+
var oldID = $_this.attr( 'id' );
|
322 |
+
var newID = oldID.replace( '_'+ prevNum, '_'+ cmb.idNumber );
|
323 |
+
var $buttons = $self.find('[data-selector="'+ oldID +'"]');
|
324 |
+
$_this.attr( 'id', newID );
|
325 |
+
|
326 |
+
// Replace data-selector vars
|
327 |
+
if ( $buttons.length ) {
|
328 |
+
$buttons.attr( 'data-selector', newID ).data( 'selector', newID );
|
329 |
+
}
|
330 |
+
});
|
331 |
+
}
|
332 |
+
}
|
333 |
+
cmb.neweditor_id = [];
|
334 |
+
|
335 |
+
$inputs.filter(':checked').prop( 'checked', false );
|
336 |
+
$inputs.filter(':selected').prop( 'selected', false );
|
337 |
+
|
338 |
+
if ( $self.find('h3.cmb-group-title').length ) {
|
339 |
+
$self.find( 'h3.cmb-group-title' ).text( $self.data( 'title' ).replace( '{#}', ( cmb.idNumber + 1 ) ) );
|
340 |
+
}
|
341 |
+
|
342 |
+
$inputs.each( function(){
|
343 |
+
var $newInput = $(this);
|
344 |
+
var isEditor = $newInput.hasClass( 'wp-editor-area' );
|
345 |
+
var oldFor = $newInput.attr( 'for' );
|
346 |
+
// var $next = $newInput.next();
|
347 |
+
var attrs = {};
|
348 |
+
var newID, oldID;
|
349 |
+
if ( oldFor ) {
|
350 |
+
attrs = { 'for' : oldFor.replace( '_'+ prevNum, '_'+ cmb.idNumber ) };
|
351 |
+
} else {
|
352 |
+
var oldName = $newInput.attr( 'name' );
|
353 |
+
// Replace 'name' attribute key
|
354 |
+
var newName = oldName ? oldName.replace( '['+ prevNum +']', '['+ cmb.idNumber +']' ) : '';
|
355 |
+
oldID = $newInput.attr( 'id' );
|
356 |
+
newID = oldID ? oldID.replace( '_'+ prevNum, '_'+ cmb.idNumber ) : '';
|
357 |
+
attrs = {
|
358 |
+
id: newID,
|
359 |
+
name: newName,
|
360 |
+
// value: '',
|
361 |
+
'data-iterator': cmb.idNumber,
|
362 |
+
};
|
363 |
+
}
|
364 |
+
|
365 |
+
$newInput
|
366 |
+
.removeClass( 'hasDatepicker' )
|
367 |
+
.attr( attrs ).val('');
|
368 |
+
|
369 |
+
// wysiwyg field
|
370 |
+
if ( isEditor ) {
|
371 |
+
// Get new wysiwyg ID
|
372 |
+
newID = newID ? oldID.replace( 'zx'+ prevNum, 'zx'+ cmb.idNumber ) : '';
|
373 |
+
// Empty the contents
|
374 |
+
$newInput.html('');
|
375 |
+
// Get wysiwyg field
|
376 |
+
var $wysiwyg = $newInput.parents( '.cmb-type-wysiwyg' );
|
377 |
+
// Remove extra mce divs
|
378 |
+
$wysiwyg.find('.mce-tinymce:not(:first-child)').remove();
|
379 |
+
// Replace id instances
|
380 |
+
var html = $wysiwyg.html().replace( new RegExp( oldID, 'g' ), newID );
|
381 |
+
// Update field html
|
382 |
+
$wysiwyg.html( html );
|
383 |
+
// Save ids for later to re-init tinymce
|
384 |
+
cmb.neweditor_id.push( { 'id': newID, 'old': oldID } );
|
385 |
+
}
|
386 |
+
});
|
387 |
+
|
388 |
+
return this;
|
389 |
+
};
|
390 |
+
|
391 |
+
$.fn.newRowHousekeeping = function() {
|
392 |
+
var $row = $(this);
|
393 |
+
var $colorPicker = $row.find( '.wp-picker-container' );
|
394 |
+
var $list = $row.find( '.cmb2-media-status' );
|
395 |
+
|
396 |
+
if ( $colorPicker.length ) {
|
397 |
+
// Need to clean-up colorpicker before appending
|
398 |
+
$colorPicker.each( function() {
|
399 |
+
var $td = $(this).parent();
|
400 |
+
$td.html( $td.find( 'input[type="text"].cmb2-colorpicker' ).attr('style', '') );
|
401 |
+
});
|
402 |
+
}
|
403 |
+
|
404 |
+
// Need to clean-up colorpicker before appending
|
405 |
+
if ( $list.length ) {
|
406 |
+
$list.empty();
|
407 |
+
}
|
408 |
+
|
409 |
+
return this;
|
410 |
+
};
|
411 |
+
|
412 |
+
cmb.afterRowInsert = function( $row, group ) {
|
413 |
+
|
414 |
+
var $focus = $row.find('input:not([type="button"]), textarea, select').first();
|
415 |
+
if ( $focus.length ) {
|
416 |
+
if ( group ) {
|
417 |
+
$('html, body').animate({
|
418 |
+
scrollTop: Math.round( $focus.offset().top - 150 )
|
419 |
+
}, 1000);
|
420 |
+
}
|
421 |
+
$focus.focus();
|
422 |
+
}
|
423 |
+
|
424 |
+
var _prop;
|
425 |
+
|
426 |
+
// Need to re-init wp_editor instances
|
427 |
+
if ( cmb.neweditor_id.length ) {
|
428 |
+
var i;
|
429 |
+
for ( i = cmb.neweditor_id.length - 1; i >= 0; i-- ) {
|
430 |
+
var id = cmb.neweditor_id[i].id;
|
431 |
+
var old = cmb.neweditor_id[i].old;
|
432 |
+
|
433 |
+
if ( typeof( tinyMCEPreInit.mceInit[ id ] ) === 'undefined' ) {
|
434 |
+
var newSettings = jQuery.extend( {}, tinyMCEPreInit.mceInit[ old ] );
|
435 |
+
|
436 |
+
for ( _prop in newSettings ) {
|
437 |
+
if ( 'string' === typeof( newSettings[_prop] ) ) {
|
438 |
+
newSettings[_prop] = newSettings[_prop].replace( new RegExp( old, 'g' ), id );
|
439 |
+
}
|
440 |
+
}
|
441 |
+
tinyMCEPreInit.mceInit[ id ] = newSettings;
|
442 |
+
}
|
443 |
+
if ( typeof( tinyMCEPreInit.qtInit[ id ] ) === 'undefined' ) {
|
444 |
+
var newQTS = jQuery.extend( {}, tinyMCEPreInit.qtInit[ old ] );
|
445 |
+
for ( _prop in newQTS ) {
|
446 |
+
if ( 'string' === typeof( newQTS[_prop] ) ) {
|
447 |
+
newQTS[_prop] = newQTS[_prop].replace( new RegExp( old, 'g' ), id );
|
448 |
+
}
|
449 |
+
}
|
450 |
+
tinyMCEPreInit.qtInit[ id ] = newQTS;
|
451 |
+
}
|
452 |
+
tinyMCE.init({
|
453 |
+
id : tinyMCEPreInit.mceInit[ id ],
|
454 |
+
});
|
455 |
+
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
// Init pickers from new row
|
460 |
+
cmb.initPickers( $row.find('input[type="text"].cmb2-timepicker'), $row.find('input[type="text"].cmb2-datepicker'), $row.find('input[type="text"].cmb2-colorpicker') );
|
461 |
+
};
|
462 |
+
|
463 |
+
cmb.updateNameAttr = function () {
|
464 |
+
|
465 |
+
var $this = $(this);
|
466 |
+
var name = $this.attr( 'name' ); // get current name
|
467 |
+
|
468 |
+
// No name? bail
|
469 |
+
if ( typeof name === 'undefined' ) {
|
470 |
+
return false;
|
471 |
+
}
|
472 |
+
|
473 |
+
var prevNum = parseInt( $this.parents( '.cmb-repeatable-grouping' ).data( 'iterator' ) );
|
474 |
+
var newNum = prevNum - 1; // Subtract 1 to get new iterator number
|
475 |
+
|
476 |
+
// Update field name attributes so data is not orphaned when a row is removed and post is saved
|
477 |
+
var $newName = name.replace( '[' + prevNum + ']', '[' + newNum + ']' );
|
478 |
+
|
479 |
+
// New name with replaced iterator
|
480 |
+
$this.attr( 'name', $newName );
|
481 |
+
|
482 |
+
};
|
483 |
+
|
484 |
+
cmb.emptyValue = function( evt, row ) {
|
485 |
+
$('input:not([type="button"]), textarea', row).val('');
|
486 |
+
};
|
487 |
+
|
488 |
+
cmb.addGroupRow = function( evt ) {
|
489 |
+
evt.preventDefault();
|
490 |
+
|
491 |
+
var $self = $(this);
|
492 |
+
|
493 |
+
// before anything significant happens
|
494 |
+
$self.trigger( 'cmb2_add_group_row_start', $self );
|
495 |
+
|
496 |
+
var $table = $id( $self.data('selector') );
|
497 |
+
var $oldRow = $table.find('.cmb-repeatable-grouping').last();
|
498 |
+
var prevNum = parseInt( $oldRow.data('iterator') );
|
499 |
+
cmb.idNumber = prevNum + 1;
|
500 |
+
var $row = $oldRow.clone();
|
501 |
+
|
502 |
+
$row.data( 'title', $self.data( 'grouptitle' ) ).newRowHousekeeping().cleanRow( prevNum, true ).find( '.cmb-add-row-button' ).prop( 'disabled', false );
|
503 |
+
|
504 |
+
var $newRow = $( '<div class="postbox cmb-row cmb-repeatable-grouping" data-iterator="'+ cmb.idNumber +'">'+ $row.html() +'</div>' );
|
505 |
+
$oldRow.after( $newRow );
|
506 |
+
|
507 |
+
cmb.afterRowInsert( $newRow, true );
|
508 |
+
|
509 |
+
if ( $table.find('.cmb-repeatable-grouping').length <= 1 ) {
|
510 |
+
$table.find('.cmb-remove-group-row').prop( 'disabled', true );
|
511 |
+
} else {
|
512 |
+
$table.find('.cmb-remove-group-row').prop( 'disabled', false );
|
513 |
+
}
|
514 |
+
|
515 |
+
$table.trigger( 'cmb2_add_row', $newRow );
|
516 |
+
};
|
517 |
+
|
518 |
+
cmb.addAjaxRow = function( evt ) {
|
519 |
+
evt.preventDefault();
|
520 |
+
|
521 |
+
var $self = $(this);
|
522 |
+
var $table = $id( $self.data('selector') );
|
523 |
+
var $emptyrow = $table.find('.empty-row');
|
524 |
+
var prevNum = parseInt( $emptyrow.find('[data-iterator]').data('iterator') );
|
525 |
+
cmb.idNumber = prevNum + 1;
|
526 |
+
var $row = $emptyrow.clone();
|
527 |
+
|
528 |
+
$row.newRowHousekeeping().cleanRow( prevNum );
|
529 |
+
|
530 |
+
$emptyrow.removeClass('empty-row hidden').addClass('cmb-repeat-row');
|
531 |
+
$emptyrow.after( $row );
|
532 |
+
|
533 |
+
cmb.afterRowInsert( $row );
|
534 |
+
|
535 |
+
$table.trigger( 'cmb2_add_row', $row );
|
536 |
+
|
537 |
+
$table.find( '.cmb-remove-row-button' ).removeClass( 'button-disabled' );
|
538 |
+
|
539 |
+
};
|
540 |
+
|
541 |
+
cmb.removeGroupRow = function( evt ) {
|
542 |
+
evt.preventDefault();
|
543 |
+
|
544 |
+
var $self = $(this);
|
545 |
+
var $table = $id( $self.data('selector') );
|
546 |
+
var $parent = $self.parents('.cmb-repeatable-grouping');
|
547 |
+
var number = $table.find('.cmb-repeatable-grouping').length;
|
548 |
+
|
549 |
+
if ( number > 1 ) {
|
550 |
+
|
551 |
+
$table.trigger( 'cmb2_remove_group_row_start', $self );
|
552 |
+
|
553 |
+
// when a group is removed loop through all next groups and update fields names
|
554 |
+
$parent.nextAll( '.cmb-repeatable-grouping' ).find( cmb.repeatEls ).each( cmb.updateNameAttr );
|
555 |
+
|
556 |
+
$parent.remove();
|
557 |
+
|
558 |
+
if ( number <= 2 ) {
|
559 |
+
$table.find('.cmb-remove-group-row').prop( 'disabled', true );
|
560 |
+
} else {
|
561 |
+
$table.find('.cmb-remove-group-row').prop( 'disabled', false );
|
562 |
+
}
|
563 |
+
|
564 |
+
$table.trigger( 'cmb2_remove_row' );
|
565 |
+
}
|
566 |
+
|
567 |
+
};
|
568 |
+
|
569 |
+
cmb.removeAjaxRow = function( evt ) {
|
570 |
+
evt.preventDefault();
|
571 |
+
|
572 |
+
var $self = $(this);
|
573 |
+
|
574 |
+
// Check if disabled
|
575 |
+
if ( $self.hasClass( 'button-disabled' ) ) {
|
576 |
+
return;
|
577 |
+
}
|
578 |
+
|
579 |
+
var $parent = $self.parents('.cmb-row');
|
580 |
+
var $table = $self.parents('.cmb-repeat-table');
|
581 |
+
var number = $table.find('.cmb-row').length;
|
582 |
+
|
583 |
+
if ( number > 2 ) {
|
584 |
+
if ( $parent.hasClass('empty-row') ) {
|
585 |
+
$parent.prev().addClass( 'empty-row' ).removeClass('cmb-repeat-row');
|
586 |
+
}
|
587 |
+
$self.parents('.cmb-repeat-table .cmb-row').remove();
|
588 |
+
if ( number === 3 ) {
|
589 |
+
$table.find( '.cmb-remove-row-button' ).addClass( 'button-disabled' );
|
590 |
+
}
|
591 |
+
$table.trigger( 'cmb2_remove_row' );
|
592 |
+
} else {
|
593 |
+
$self.addClass( 'button-disabled' );
|
594 |
+
}
|
595 |
+
};
|
596 |
+
|
597 |
+
cmb.shiftRows = function( evt ) {
|
598 |
+
|
599 |
+
evt.preventDefault();
|
600 |
+
|
601 |
+
var $self = $(this);
|
602 |
+
// before anything signif happens
|
603 |
+
$self.trigger( 'cmb2_shift_rows_enter', $self );
|
604 |
+
|
605 |
+
var $parent = $self.parents( '.cmb-repeatable-grouping' );
|
606 |
+
var $goto = $self.hasClass( 'move-up' ) ? $parent.prev( '.cmb-repeatable-grouping' ) : $parent.next( '.cmb-repeatable-grouping' );
|
607 |
+
|
608 |
+
if ( ! $goto.length ) {
|
609 |
+
return;
|
610 |
+
}
|
611 |
+
|
612 |
+
// we're gonna shift
|
613 |
+
$self.trigger( 'cmb2_shift_rows_start', $self );
|
614 |
+
|
615 |
+
var inputVals = [];
|
616 |
+
// Loop this items fields
|
617 |
+
$parent.find( cmb.repeatEls ).each( function() {
|
618 |
+
var $element = $(this);
|
619 |
+
var val;
|
620 |
+
if ( $element.hasClass('cmb2-media-status') ) {
|
621 |
+
// special case for image previews
|
622 |
+
val = $element.html();
|
623 |
+
} else if ( 'checkbox' === $element.attr('type') || 'radio' === $element.attr('type') ) {
|
624 |
+
val = $element.is(':checked');
|
625 |
+
} else if ( 'select' === $element.prop('tagName') ) {
|
626 |
+
val = $element.is(':selected');
|
627 |
+
} else {
|
628 |
+
val = $element.val();
|
629 |
+
}
|
630 |
+
// Get all the current values per element
|
631 |
+
inputVals.push( { val: val, $: $element } );
|
632 |
+
});
|
633 |
+
// And swap them all
|
634 |
+
$goto.find( cmb.repeatEls ).each( function( index ) {
|
635 |
+
var $element = $(this);
|
636 |
+
var val;
|
637 |
+
|
638 |
+
if ( $element.hasClass('cmb2-media-status') ) {
|
639 |
+
// special case for image previews
|
640 |
+
val = $element.html();
|
641 |
+
$element.html( inputVals[ index ].val );
|
642 |
+
inputVals[ index ].$.html( val );
|
643 |
+
|
644 |
+
}
|
645 |
+
// handle checkbox swapping
|
646 |
+
else if ( 'checkbox' === $element.attr('type') || 'radio' === $element.attr( 'type' ) ) {
|
647 |
+
inputVals[ index ].$.prop( 'checked', $element.is(':checked') );
|
648 |
+
$element.prop( 'checked', inputVals[ index ].val );
|
649 |
+
}
|
650 |
+
// handle select swapping
|
651 |
+
else if ( 'select' === $element.prop('tagName') ) {
|
652 |
+
inputVals[ index ].$.prop( 'selected', $element.is(':selected') );
|
653 |
+
$element.prop( 'selected', inputVals[ index ].val );
|
654 |
+
}
|
655 |
+
// handle normal input swapping
|
656 |
+
else {
|
657 |
+
inputVals[ index ].$.val( $element.val() );
|
658 |
+
$element.val( inputVals[ index ].val );
|
659 |
+
}
|
660 |
+
});
|
661 |
+
|
662 |
+
// shift done
|
663 |
+
$self.trigger( 'cmb2_shift_rows_complete', $self );
|
664 |
+
};
|
665 |
+
|
666 |
+
cmb.initPickers = function( $timePickers, $datePickers, $colorPickers ) {
|
667 |
+
// Initialize timepicker
|
668 |
+
cmb.initTimePickers( $timePickers );
|
669 |
+
|
670 |
+
// Initialize jQuery UI datepicker
|
671 |
+
cmb.initDatePickers( $datePickers );
|
672 |
+
|
673 |
+
// Initialize color picker
|
674 |
+
cmb.initColorPickers( $colorPickers );
|
675 |
+
};
|
676 |
+
|
677 |
+
cmb.initTimePickers = function( $selector ) {
|
678 |
+
if ( ! $selector.length ) {
|
679 |
+
return;
|
680 |
+
}
|
681 |
+
|
682 |
+
$selector.timePicker( cmb.defaults.time_picker );
|
683 |
+
};
|
684 |
+
|
685 |
+
cmb.initDatePickers = function( $selector ) {
|
686 |
+
if ( ! $selector.length ) {
|
687 |
+
return;
|
688 |
+
}
|
689 |
+
|
690 |
+
$selector.datepicker( "destroy" );
|
691 |
+
$selector.datepicker( cmb.defaults.date_picker );
|
692 |
+
};
|
693 |
+
|
694 |
+
cmb.initColorPickers = function( $selector ) {
|
695 |
+
if ( ! $selector.length ) {
|
696 |
+
return;
|
697 |
+
}
|
698 |
+
if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
|
699 |
+
|
700 |
+
$selector.wpColorPicker( cmb.defaults.color_picker );
|
701 |
+
|
702 |
+
} else {
|
703 |
+
$selector.each( function(i) {
|
704 |
+
$(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
|
705 |
+
$id( 'picker-' + i ).hide().farbtastic($(this));
|
706 |
+
})
|
707 |
+
.focus( function() {
|
708 |
+
$(this).next().show();
|
709 |
+
})
|
710 |
+
.blur( function() {
|
711 |
+
$(this).next().hide();
|
712 |
+
});
|
713 |
+
}
|
714 |
+
};
|
715 |
+
|
716 |
+
cmb.makeListSortable = function() {
|
717 |
+
var $filelist = cmb.metabox().find( '.cmb2-media-status.cmb-attach-list' );
|
718 |
+
if ( $filelist.length ) {
|
719 |
+
$filelist.sortable({ cursor: "move" }).disableSelection();
|
720 |
+
}
|
721 |
+
};
|
722 |
+
|
723 |
+
cmb.maybeOembed = function( evt ) {
|
724 |
+
var $self = $(this);
|
725 |
+
var type = evt.type;
|
726 |
+
|
727 |
+
var m = {
|
728 |
+
focusout : function() {
|
729 |
+
setTimeout( function() {
|
730 |
+
// if it's been 2 seconds, hide our spinner
|
731 |
+
cmb.spinner( '.postbox .cmb2-metabox', true );
|
732 |
+
}, 2000);
|
733 |
+
},
|
734 |
+
keyup : function() {
|
735 |
+
var betw = function( min, max ) {
|
736 |
+
return ( evt.which <= max && evt.which >= min );
|
737 |
+
};
|
738 |
+
// Only Ajax on normal keystrokes
|
739 |
+
if ( betw( 48, 90 ) || betw( 96, 111 ) || betw( 8, 9 ) || evt.which === 187 || evt.which === 190 ) {
|
740 |
+
// fire our ajax function
|
741 |
+
cmb.doAjax( $self, evt);
|
742 |
+
}
|
743 |
+
},
|
744 |
+
paste : function() {
|
745 |
+
// paste event is fired before the value is filled, so wait a bit
|
746 |
+
setTimeout( function() { cmb.doAjax( $self ); }, 100);
|
747 |
+
}
|
748 |
+
};
|
749 |
+
m[type]();
|
750 |
+
|
751 |
+
};
|
752 |
+
|
753 |
+
/**
|
754 |
+
* Resize oEmbed videos to fit in their respective metaboxes
|
755 |
+
*/
|
756 |
+
cmb.resizeoEmbeds = function() {
|
757 |
+
cmb.metabox().each( function() {
|
758 |
+
var $self = $(this);
|
759 |
+
var $tableWrap = $self.parents('.inside');
|
760 |
+
var isSide = $self.parents('.inner-sidebar').length || $self.parents( '#side-sortables' ).length;
|
761 |
+
var isSmall = isSide;
|
762 |
+
var isSmallest = false;
|
763 |
+
if ( ! $tableWrap.length ) {
|
764 |
+
return true; // continue
|
765 |
+
}
|
766 |
+
|
767 |
+
// Calculate new width
|
768 |
+
var tableW = $tableWrap.width();
|
769 |
+
|
770 |
+
if ( cmb.styleBreakPoint > tableW ) {
|
771 |
+
isSmall = true;
|
772 |
+
isSmallest = ( cmb.styleBreakPoint - 62 ) > tableW;
|
773 |
+
}
|
774 |
+
|
775 |
+
tableW = isSmall ? tableW : Math.round(($tableWrap.width() * 0.82)*0.97);
|
776 |
+
var newWidth = tableW - 30;
|
777 |
+
if ( isSmall && ! isSide && ! isSmallest ) {
|
778 |
+
newWidth = newWidth - 75;
|
779 |
+
}
|
780 |
+
if ( newWidth > 639 ) {
|
781 |
+
return true; // continue
|
782 |
+
}
|
783 |
+
|
784 |
+
var $embeds = $self.find('.cmb-type-oembed .embed-status');
|
785 |
+
var $children = $embeds.children().not('.cmb2-remove-wrapper');
|
786 |
+
if ( ! $children.length ) {
|
787 |
+
return true; // continue
|
788 |
+
}
|
789 |
+
|
790 |
+
$children.each( function() {
|
791 |
+
var $self = $(this);
|
792 |
+
var iwidth = $self.width();
|
793 |
+
var iheight = $self.height();
|
794 |
+
var _newWidth = newWidth;
|
795 |
+
if ( $self.parents( '.cmb-repeat-row' ).length && ! isSmall ) {
|
796 |
+
// Make room for our repeatable "remove" button column
|
797 |
+
_newWidth = newWidth - 91;
|
798 |
+
_newWidth = 785 > tableW ? _newWidth - 15 : _newWidth;
|
799 |
+
}
|
800 |
+
// Calc new height
|
801 |
+
var newHeight = Math.round((_newWidth * iheight)/iwidth);
|
802 |
+
$self.width(_newWidth).height(newHeight);
|
803 |
+
});
|
804 |
+
|
805 |
+
});
|
806 |
+
};
|
807 |
+
|
808 |
+
/**
|
809 |
+
* Safely log things if query var is set
|
810 |
+
* @since 1.0.0
|
811 |
+
*/
|
812 |
+
cmb.log = function() {
|
813 |
+
if ( l10n.script_debug && console && typeof console.log === 'function' ) {
|
814 |
+
console.log.apply(console, arguments);
|
815 |
+
}
|
816 |
+
};
|
817 |
+
|
818 |
+
cmb.spinner = function( $context, hide ) {
|
819 |
+
if ( hide ) {
|
820 |
+
$('.cmb-spinner', $context ).hide();
|
821 |
+
}
|
822 |
+
else {
|
823 |
+
$('.cmb-spinner', $context ).show();
|
824 |
+
}
|
825 |
+
};
|
826 |
+
|
827 |
+
// function for running our ajax
|
828 |
+
cmb.doAjax = function($obj) {
|
829 |
+
// get typed value
|
830 |
+
var oembed_url = $obj.val();
|
831 |
+
// only proceed if the field contains more than 6 characters
|
832 |
+
if ( oembed_url.length < 6 ) {
|
833 |
+
return;
|
834 |
+
}
|
835 |
+
|
836 |
+
// only proceed if the user has pasted, pressed a number, letter, or whitelisted characters
|
837 |
+
|
838 |
+
// get field id
|
839 |
+
var field_id = $obj.attr('id');
|
840 |
+
// get our inputs $context for pinpointing
|
841 |
+
var $context = $obj.parents('.cmb-repeat-table .cmb-row .cmb-td');
|
842 |
+
$context = $context.length ? $context : $obj.parents('.cmb2-metabox .cmb-row .cmb-td');
|
843 |
+
|
844 |
+
var embed_container = $('.embed-status', $context);
|
845 |
+
var oembed_width = $obj.width();
|
846 |
+
var child_el = $(':first-child', embed_container);
|
847 |
+
|
848 |
+
// http://www.youtube.com/watch?v=dGG7aru2S6U
|
849 |
+
cmb.log( 'oembed_url', oembed_url, field_id );
|
850 |
+
oembed_width = ( embed_container.length && child_el.length ) ? child_el.width() : $obj.width();
|
851 |
+
|
852 |
+
// show our spinner
|
853 |
+
cmb.spinner( $context );
|
854 |
+
// clear out previous results
|
855 |
+
$('.embed_wrap', $context).html('');
|
856 |
+
// and run our ajax function
|
857 |
+
setTimeout( function() {
|
858 |
+
// if they haven't typed in 500 ms
|
859 |
+
if ( $('.cmb2-oembed:focus').val() !== oembed_url ) {
|
860 |
+
return;
|
861 |
+
}
|
862 |
+
$.ajax({
|
863 |
+
type : 'post',
|
864 |
+
dataType : 'json',
|
865 |
+
url : l10n.ajaxurl,
|
866 |
+
data : {
|
867 |
+
'action': 'cmb2_oembed_handler',
|
868 |
+
'oembed_url': oembed_url,
|
869 |
+
'oembed_width': oembed_width > 300 ? oembed_width : 300,
|
870 |
+
'field_id': field_id,
|
871 |
+
'object_id': $obj.data('objectid'),
|
872 |
+
'object_type': $obj.data('objecttype'),
|
873 |
+
'cmb2_ajax_nonce': l10n.ajax_nonce
|
874 |
+
},
|
875 |
+
success: function(response) {
|
876 |
+
cmb.log( response );
|
877 |
+
// hide our spinner
|
878 |
+
cmb.spinner( $context, true );
|
879 |
+
// and populate our results from ajax response
|
880 |
+
$('.embed_wrap', $context).html(response.data);
|
881 |
+
}
|
882 |
+
});
|
883 |
+
|
884 |
+
}, 500);
|
885 |
+
};
|
886 |
+
|
887 |
+
$(document).ready(cmb.init);
|
888 |
+
|
889 |
+
return cmb;
|
890 |
+
|
891 |
+
})(window, document, jQuery);
|
cmb2/js/cmb2.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.CMB2=function(window,document,$){"use strict";var l10n=window.cmb2_l10,setTimeout=window.setTimeout,cmb={formfield:"",idNumber:!1,file_frames:{},repeatEls:'input:not([type="button"]),select,textarea,.cmb2-media-status',styleBreakPoint:450,mediaHandlers:{},defaults:{time_picker:l10n.defaults.time_picker,date_picker:l10n.defaults.date_picker,color_picker:l10n.defaults.color_picker||{}}},$id=function(selector){return $(document.getElementById(selector))};return cmb.metabox=function(){return cmb.$metabox?cmb.$metabox:(cmb.$metabox=$(".cmb2-wrap > .cmb2-metabox"),cmb.$metabox)},cmb.init=function(){cmb.log("CMB2 localized data",l10n);var $metabox=cmb.metabox(),$repeatGroup=$metabox.find(".cmb-repeatable-group");cmb.initPickers($metabox.find('input[type="text"].cmb2-timepicker'),$metabox.find('input[type="text"].cmb2-datepicker'),$metabox.find('input[type="text"].cmb2-colorpicker')),$id("ui-datepicker-div").wrap('<div class="cmb2-element" />'),$('<p><span class="button cmb-multicheck-toggle">'+l10n.strings.check_toggle+"</span></p>").insertBefore(".cmb2-checkbox-list:not(.no-select-all)"),cmb.makeListSortable(),$metabox.on("change",".cmb2_upload_file",function(){cmb.formfield=$(this).attr("id"),$id(cmb.formfield+"_id").val("")}).on("click",".cmb-multicheck-toggle",cmb.toggleCheckBoxes).on("click",".cmb2-upload-button",cmb.handleMedia).on("click",".cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span",cmb.handleFileClick).on("click",".cmb2-remove-file-button",cmb.handleRemoveMedia).on("click",".cmb-add-group-row",cmb.addGroupRow).on("click",".cmb-add-row-button",cmb.addAjaxRow).on("click",".cmb-remove-group-row",cmb.removeGroupRow).on("click",".cmb-remove-row-button",cmb.removeAjaxRow).on("keyup paste focusout",".cmb2-oembed",cmb.maybeOembed).on("cmb2_remove_row",".cmb-repeatable-group",cmb.resetTitlesAndIterator).on("click",".cmbhandle, .cmbhandle + .cmbhandle-title",cmb.toggleHandle),$repeatGroup.length&&$repeatGroup.filter(".sortable").each(function(){$(this).find(".button.cmb-remove-group-row").before('<a class="button cmb-shift-rows move-up alignleft" href="#"><span class="'+l10n.up_arrow_class+'"></span></a> <a class="button cmb-shift-rows move-down alignleft" href="#"><span class="'+l10n.down_arrow_class+'"></span></a>')}).on("click",".cmb-shift-rows",cmb.shiftRows).on("cmb2_add_row",cmb.emptyValue),setTimeout(cmb.resizeoEmbeds,500),$(window).on("resize",cmb.resizeoEmbeds)},cmb.resetTitlesAndIterator=function(){$(".cmb-repeatable-group").each(function(){var $table=$(this);$table.find(".cmb-repeatable-grouping").each(function(rowindex){var $row=$(this);$row.data("iterator",rowindex),$row.find(".cmb-group-title h4").text($table.find(".cmb-add-group-row").data("grouptitle").replace("{#}",rowindex+1))})})},cmb.toggleHandle=function(evt){evt.preventDefault(),$(document).trigger("postbox-toggled",$(this).parent(".postbox").toggleClass("closed"))},cmb.toggleCheckBoxes=function(evt){evt.preventDefault();var $self=$(this),$multicheck=$self.closest(".cmb-td").find("input[type=checkbox]");$self.data("checked")?($multicheck.prop("checked",!1),$self.data("checked",!1)):($multicheck.prop("checked",!0),$self.data("checked",!0))},cmb.handleMedia=function(evt){evt.preventDefault();var $el=$(this);cmb.attach_id=$el.hasClass("cmb2-upload-list")?!1:$el.closest(".cmb-td").find(".cmb2-upload-file-id").val(),cmb.attach_id="0"!==cmb.attach_id?cmb.attach_id:!1,cmb._handleMedia($el.prev("input.cmb2-upload-file").attr("id"),$el.hasClass("cmb2-upload-list"))},cmb.handleFileClick=function(evt){evt.preventDefault();var $el=$(this),$td=$el.closest(".cmb-td"),isList=$td.find(".cmb2-upload-button").hasClass("cmb2-upload-list");cmb.attach_id=isList?$el.find('input[type="hidden"]').data("id"):$td.find(".cmb2-upload-file-id").val(),cmb.attach_id&&cmb._handleMedia($td.find("input.cmb2-upload-file").attr("id"),isList,cmb.attach_id)},cmb._handleMedia=function(formfield,isList){if(wp){var $metabox=cmb.metabox();cmb.formfield=formfield;var $formfield=$id(cmb.formfield),previewSize=$formfield.data("previewsize"),formName=$formfield.attr("name"),uploadStatus=!0,attachment=!0;if(cmb.formfield in cmb.file_frames)return void cmb.file_frames[cmb.formfield].open();cmb.file_frames[cmb.formfield]=wp.media({title:$metabox.find("label[for="+cmb.formfield+"]").text(),button:{text:l10n.strings.upload_file},multiple:isList?!0:!1}),cmb.mediaHandlers.list=function(selection,returnIt){attachment=selection.toJSON(),$formfield.val(attachment.url),$id(cmb.formfield+"_id").val(attachment.id);var fileGroup=[];return $(attachment).each(function(){if(this.type&&"image"===this.type){var width=previewSize[0]?previewSize[0]:50,height=previewSize[1]?previewSize[1]:50;uploadStatus='<li class="img-status"><img width="'+width+'" height="'+height+'" src="'+this.url+'" class="attachment-'+width+"px"+height+'px" alt="'+this.filename+'"><p><a href="#" class="cmb2-remove-file-button" rel="'+cmb.formfield+"["+this.id+']">'+l10n.strings.remove_image+'</a></p><input type="hidden" id="filelist-'+this.id+'" data-id="'+this.id+'" name="'+formName+"["+this.id+']" value="'+this.url+'"></li>'}else uploadStatus='<li class="file-status"><span>'+l10n.strings.file+" <strong>"+this.filename+'</strong></span> (<a href="'+this.url+'" target="_blank" rel="external">'+l10n.strings.download+'</a> / <a href="#" class="cmb2-remove-file-button" rel="'+cmb.formfield+"["+this.id+']">'+l10n.strings.remove_file+'</a>)<input type="hidden" id="filelist-'+this.id+'" data-id="'+this.id+'" name="'+formName+"["+this.id+']" value="'+this.url+'"></li>';fileGroup.push(uploadStatus)}),returnIt?fileGroup:void $(fileGroup).each(function(){$formfield.siblings(".cmb2-media-status").slideDown().append(this)})},cmb.mediaHandlers.single=function(selection){if(attachment=selection.first().toJSON(),$formfield.val(attachment.url),$id(cmb.formfield+"_id").val(attachment.id),attachment.type&&"image"===attachment.type){var width=previewSize[0]?previewSize[0]:350;uploadStatus='<div class="img-status"><img width="'+width+'px" style="max-width: '+width+'px; width: 100%; height: auto;" src="'+attachment.url+'" alt="'+attachment.filename+'" title="'+attachment.filename+'" /><p><a href="#" class="cmb2-remove-file-button" rel="'+cmb.formfield+'">'+l10n.strings.remove_image+"</a></p></div>"}else uploadStatus='<div class="file-status"><span>'+l10n.strings.file+" <strong>"+attachment.filename+'</strong></span> (<a href="'+attachment.url+'" target="_blank" rel="external">'+l10n.strings.download+'</a> / <a href="#" class="cmb2-remove-file-button" rel="'+cmb.formfield+'">'+l10n.strings.remove_file+"</a>)</div>";$formfield.siblings(".cmb2-media-status").slideDown().html(uploadStatus)},cmb.mediaHandlers.selectFile=function(){var selection=cmb.file_frames[cmb.formfield].state().get("selection"),type=isList?"list":"single";return cmb.attach_id&&isList?void $('[data-id="'+cmb.attach_id+'"]').parents("li").replaceWith(cmb.mediaHandlers.list(selection,!0)):void cmb.mediaHandlers[type](selection)},cmb.mediaHandlers.openModal=function(){var selection=cmb.file_frames[cmb.formfield].state().get("selection");if(!cmb.attach_id)return selection.reset();var attach=wp.media.attachment(cmb.attach_id);attach.fetch(),selection.set(attach?[attach]:[])},cmb.file_frames[cmb.formfield].on("select",cmb.mediaHandlers.selectFile).on("open",cmb.mediaHandlers.openModal),cmb.file_frames[cmb.formfield].open()}},cmb.handleRemoveMedia=function(evt){evt.preventDefault();var $self=$(this);return $self.is(".cmb-attach-list .cmb2-remove-file-button")?($self.parents("li").remove(),!1):(cmb.formfield=$self.attr("rel"),cmb.metabox().find("input#"+cmb.formfield).val(""),cmb.metabox().find("input#"+cmb.formfield+"_id").val(""),$self.parents(".cmb2-media-status").html(""),!1)},$.fn.cleanRow=function(prevNum,group){var $self=$(this),$inputs=$self.find('input:not([type="button"]), select, textarea, label'),$other=$self.find("[id]").not('input:not([type="button"]), select, textarea, label');return group&&($self.find(".cmb-repeat-table .cmb-repeat-row:not(:first-child)").remove(),$other.length&&$other.each(function(){var $_this=$(this),oldID=$_this.attr("id"),newID=oldID.replace("_"+prevNum,"_"+cmb.idNumber),$buttons=$self.find('[data-selector="'+oldID+'"]');$_this.attr("id",newID),$buttons.length&&$buttons.attr("data-selector",newID).data("selector",newID)})),cmb.neweditor_id=[],$inputs.filter(":checked").prop("checked",!1),$inputs.filter(":selected").prop("selected",!1),$self.find("h3.cmb-group-title").length&&$self.find("h3.cmb-group-title").text($self.data("title").replace("{#}",cmb.idNumber+1)),$inputs.each(function(){var newID,oldID,$newInput=$(this),isEditor=$newInput.hasClass("wp-editor-area"),oldFor=$newInput.attr("for"),attrs={};if(oldFor)attrs={"for":oldFor.replace("_"+prevNum,"_"+cmb.idNumber)};else{var oldName=$newInput.attr("name"),newName=oldName?oldName.replace("["+prevNum+"]","["+cmb.idNumber+"]"):"";oldID=$newInput.attr("id"),newID=oldID?oldID.replace("_"+prevNum,"_"+cmb.idNumber):"",attrs={id:newID,name:newName,"data-iterator":cmb.idNumber}}if($newInput.removeClass("hasDatepicker").attr(attrs).val(""),isEditor){newID=newID?oldID.replace("zx"+prevNum,"zx"+cmb.idNumber):"",$newInput.html("");var $wysiwyg=$newInput.parents(".cmb-type-wysiwyg");$wysiwyg.find(".mce-tinymce:not(:first-child)").remove();var html=$wysiwyg.html().replace(new RegExp(oldID,"g"),newID);$wysiwyg.html(html),cmb.neweditor_id.push({id:newID,old:oldID})}}),this},$.fn.newRowHousekeeping=function(){var $row=$(this),$colorPicker=$row.find(".wp-picker-container"),$list=$row.find(".cmb2-media-status");return $colorPicker.length&&$colorPicker.each(function(){var $td=$(this).parent();$td.html($td.find('input[type="text"].cmb2-colorpicker').attr("style",""))}),$list.length&&$list.empty(),this},cmb.afterRowInsert=function($row,group){var $focus=$row.find('input:not([type="button"]), textarea, select').first();$focus.length&&(group&&$("html, body").animate({scrollTop:Math.round($focus.offset().top-150)},1e3),$focus.focus());var _prop;if(cmb.neweditor_id.length){var i;for(i=cmb.neweditor_id.length-1;i>=0;i--){var id=cmb.neweditor_id[i].id,old=cmb.neweditor_id[i].old;if("undefined"==typeof tinyMCEPreInit.mceInit[id]){var newSettings=jQuery.extend({},tinyMCEPreInit.mceInit[old]);for(_prop in newSettings)"string"==typeof newSettings[_prop]&&(newSettings[_prop]=newSettings[_prop].replace(new RegExp(old,"g"),id));tinyMCEPreInit.mceInit[id]=newSettings}if("undefined"==typeof tinyMCEPreInit.qtInit[id]){var newQTS=jQuery.extend({},tinyMCEPreInit.qtInit[old]);for(_prop in newQTS)"string"==typeof newQTS[_prop]&&(newQTS[_prop]=newQTS[_prop].replace(new RegExp(old,"g"),id));tinyMCEPreInit.qtInit[id]=newQTS}tinyMCE.init({id:tinyMCEPreInit.mceInit[id]})}}cmb.initPickers($row.find('input[type="text"].cmb2-timepicker'),$row.find('input[type="text"].cmb2-datepicker'),$row.find('input[type="text"].cmb2-colorpicker'))},cmb.updateNameAttr=function(){var $this=$(this),name=$this.attr("name");if("undefined"==typeof name)return!1;var prevNum=parseInt($this.parents(".cmb-repeatable-grouping").data("iterator")),newNum=prevNum-1,$newName=name.replace("["+prevNum+"]","["+newNum+"]");$this.attr("name",$newName)},cmb.emptyValue=function(evt,row){$('input:not([type="button"]), textarea',row).val("")},cmb.addGroupRow=function(evt){evt.preventDefault();var $self=$(this);$self.trigger("cmb2_add_group_row_start",$self);var $table=$id($self.data("selector")),$oldRow=$table.find(".cmb-repeatable-grouping").last(),prevNum=parseInt($oldRow.data("iterator"));cmb.idNumber=prevNum+1;var $row=$oldRow.clone();$row.data("title",$self.data("grouptitle")).newRowHousekeeping().cleanRow(prevNum,!0).find(".cmb-add-row-button").prop("disabled",!1);var $newRow=$('<div class="postbox cmb-row cmb-repeatable-grouping" data-iterator="'+cmb.idNumber+'">'+$row.html()+"</div>");$oldRow.after($newRow),cmb.afterRowInsert($newRow,!0),$table.find(".cmb-repeatable-grouping").length<=1?$table.find(".cmb-remove-group-row").prop("disabled",!0):$table.find(".cmb-remove-group-row").prop("disabled",!1),$table.trigger("cmb2_add_row",$newRow)},cmb.addAjaxRow=function(evt){evt.preventDefault();var $self=$(this),$table=$id($self.data("selector")),$emptyrow=$table.find(".empty-row"),prevNum=parseInt($emptyrow.find("[data-iterator]").data("iterator"));cmb.idNumber=prevNum+1;var $row=$emptyrow.clone();$row.newRowHousekeeping().cleanRow(prevNum),$emptyrow.removeClass("empty-row hidden").addClass("cmb-repeat-row"),$emptyrow.after($row),cmb.afterRowInsert($row),$table.trigger("cmb2_add_row",$row),$table.find(".cmb-remove-row-button").removeClass("button-disabled")},cmb.removeGroupRow=function(evt){evt.preventDefault();var $self=$(this),$table=$id($self.data("selector")),$parent=$self.parents(".cmb-repeatable-grouping"),number=$table.find(".cmb-repeatable-grouping").length;number>1&&($table.trigger("cmb2_remove_group_row_start",$self),$parent.nextAll(".cmb-repeatable-grouping").find(cmb.repeatEls).each(cmb.updateNameAttr),$parent.remove(),2>=number?$table.find(".cmb-remove-group-row").prop("disabled",!0):$table.find(".cmb-remove-group-row").prop("disabled",!1),$table.trigger("cmb2_remove_row"))},cmb.removeAjaxRow=function(evt){evt.preventDefault();var $self=$(this);if(!$self.hasClass("button-disabled")){var $parent=$self.parents(".cmb-row"),$table=$self.parents(".cmb-repeat-table"),number=$table.find(".cmb-row").length;number>2?($parent.hasClass("empty-row")&&$parent.prev().addClass("empty-row").removeClass("cmb-repeat-row"),$self.parents(".cmb-repeat-table .cmb-row").remove(),3===number&&$table.find(".cmb-remove-row-button").addClass("button-disabled"),$table.trigger("cmb2_remove_row")):$self.addClass("button-disabled")}},cmb.shiftRows=function(evt){evt.preventDefault();var $self=$(this);$self.trigger("cmb2_shift_rows_enter",$self);var $parent=$self.parents(".cmb-repeatable-grouping"),$goto=$self.hasClass("move-up")?$parent.prev(".cmb-repeatable-grouping"):$parent.next(".cmb-repeatable-grouping");if($goto.length){$self.trigger("cmb2_shift_rows_start",$self);var inputVals=[];$parent.find(cmb.repeatEls).each(function(){var val,$element=$(this);val=$element.hasClass("cmb2-media-status")?$element.html():"checkbox"===$element.attr("type")||"radio"===$element.attr("type")?$element.is(":checked"):"select"===$element.prop("tagName")?$element.is(":selected"):$element.val(),inputVals.push({val:val,$:$element})}),$goto.find(cmb.repeatEls).each(function(index){var val,$element=$(this);$element.hasClass("cmb2-media-status")?(val=$element.html(),$element.html(inputVals[index].val),inputVals[index].$.html(val)):"checkbox"===$element.attr("type")||"radio"===$element.attr("type")?(inputVals[index].$.prop("checked",$element.is(":checked")),$element.prop("checked",inputVals[index].val)):"select"===$element.prop("tagName")?(inputVals[index].$.prop("selected",$element.is(":selected")),$element.prop("selected",inputVals[index].val)):(inputVals[index].$.val($element.val()),$element.val(inputVals[index].val))}),$self.trigger("cmb2_shift_rows_complete",$self)}},cmb.initPickers=function($timePickers,$datePickers,$colorPickers){cmb.initTimePickers($timePickers),cmb.initDatePickers($datePickers),cmb.initColorPickers($colorPickers)},cmb.initTimePickers=function($selector){$selector.length&&$selector.timePicker(cmb.defaults.time_picker)},cmb.initDatePickers=function($selector){$selector.length&&($selector.datepicker("destroy"),$selector.datepicker(cmb.defaults.date_picker))},cmb.initColorPickers=function($selector){$selector.length&&("object"==typeof jQuery.wp&&"function"==typeof jQuery.wp.wpColorPicker?$selector.wpColorPicker(cmb.defaults.color_picker):$selector.each(function(i){$(this).after('<div id="picker-'+i+'" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>'),$id("picker-"+i).hide().farbtastic($(this))}).focus(function(){$(this).next().show()}).blur(function(){$(this).next().hide()}))},cmb.makeListSortable=function(){var $filelist=cmb.metabox().find(".cmb2-media-status.cmb-attach-list");$filelist.length&&$filelist.sortable({cursor:"move"}).disableSelection()},cmb.maybeOembed=function(evt){var $self=$(this),type=evt.type,m={focusout:function(){setTimeout(function(){cmb.spinner(".postbox .cmb2-metabox",!0)},2e3)},keyup:function(){var betw=function(min,max){return evt.which<=max&&evt.which>=min};(betw(48,90)||betw(96,111)||betw(8,9)||187===evt.which||190===evt.which)&&cmb.doAjax($self,evt)},paste:function(){setTimeout(function(){cmb.doAjax($self)},100)}};m[type]()},cmb.resizeoEmbeds=function(){cmb.metabox().each(function(){var $self=$(this),$tableWrap=$self.parents(".inside"),isSide=$self.parents(".inner-sidebar").length||$self.parents("#side-sortables").length,isSmall=isSide,isSmallest=!1;if(!$tableWrap.length)return!0;var tableW=$tableWrap.width();cmb.styleBreakPoint>tableW&&(isSmall=!0,isSmallest=cmb.styleBreakPoint-62>tableW),tableW=isSmall?tableW:Math.round(.82*$tableWrap.width()*.97);var newWidth=tableW-30;if(!isSmall||isSide||isSmallest||(newWidth-=75),newWidth>639)return!0;var $embeds=$self.find(".cmb-type-oembed .embed-status"),$children=$embeds.children().not(".cmb2-remove-wrapper");return $children.length?void $children.each(function(){var $self=$(this),iwidth=$self.width(),iheight=$self.height(),_newWidth=newWidth;$self.parents(".cmb-repeat-row").length&&!isSmall&&(_newWidth=newWidth-91,_newWidth=785>tableW?_newWidth-15:_newWidth);var newHeight=Math.round(_newWidth*iheight/iwidth);$self.width(_newWidth).height(newHeight)}):!0})},cmb.log=function(){l10n.script_debug&&console&&"function"==typeof console.log&&console.log.apply(console,arguments)},cmb.spinner=function($context,hide){hide?$(".cmb-spinner",$context).hide():$(".cmb-spinner",$context).show()},cmb.doAjax=function($obj){var oembed_url=$obj.val();if(!(oembed_url.length<6)){var field_id=$obj.attr("id"),$context=$obj.parents(".cmb-repeat-table .cmb-row .cmb-td");$context=$context.length?$context:$obj.parents(".cmb2-metabox .cmb-row .cmb-td");var embed_container=$(".embed-status",$context),oembed_width=$obj.width(),child_el=$(":first-child",embed_container);cmb.log("oembed_url",oembed_url,field_id),oembed_width=embed_container.length&&child_el.length?child_el.width():$obj.width(),cmb.spinner($context),$(".embed_wrap",$context).html(""),setTimeout(function(){$(".cmb2-oembed:focus").val()===oembed_url&&$.ajax({type:"post",dataType:"json",url:l10n.ajaxurl,data:{action:"cmb2_oembed_handler",oembed_url:oembed_url,oembed_width:oembed_width>300?oembed_width:300,field_id:field_id,object_id:$obj.data("objectid"),object_type:$obj.data("objecttype"),cmb2_ajax_nonce:l10n.ajax_nonce},success:function(response){cmb.log(response),cmb.spinner($context,!0),$(".embed_wrap",$context).html(response.data)}})},500)}},$(document).ready(cmb.init),cmb}(window,document,jQuery);
|
cmb2/js/index.php
ADDED
File without changes
|
{dkrpt → cmb2}/js/jquery.timePicker.min.js
RENAMED
File without changes
|
css/admin_de_style.css
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.de_first {clear:left;}
|
2 |
+
.de_input input[type=text] {border:2px #dddddd solid !important; box-shadow: 0 0 0 !important;}
|
3 |
+
.de_input textarea {border:2px #dddddd solid !important; box-shadow: 0 0 0 !important;}
|
4 |
+
|
5 |
+
.de_text {padding:0 !important; margin:0 !important; border:none !important;}
|
6 |
+
.de_text .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
7 |
+
.de_text .cmb-td {width:100% !important;}
|
8 |
+
.de_text .cmb-td input {width:100% !important;}
|
9 |
+
|
10 |
+
.de_text_side {padding:0 !important; margin:0 !important;border:none !important;}
|
11 |
+
.de_text_side .cmb-th {font-size:14px; width:100% !important; color:#333 !important; padding-bottom:5px !important;}
|
12 |
+
.de_text_side .cmb-th label {padding-bottom:0 !important}
|
13 |
+
.de_text_side .cmb-th label::after {display:none !important;}
|
14 |
+
.de_text_side .cmb-td {width:100% !important;}
|
15 |
+
.de_text_side .cmb-td input, .de_text_side .cmb-td select {width:100% !important;}
|
16 |
+
|
17 |
+
.de_color {padding:0 !important; margin:0 !important; border:none !important;}
|
18 |
+
.de_color .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
19 |
+
.de_color .cmb-td {width:100% !important;}
|
20 |
+
|
21 |
+
.de_textarea {padding:0 !important; margin:0 !important; border:none !important;}
|
22 |
+
.de_textarea .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
23 |
+
.de_textarea .cmb-td {width:100% !important;}
|
24 |
+
.de_textarea .cmb-td input {width:100% !important;}
|
25 |
+
|
26 |
+
.de_info {padding:0 !important; margin:0 !important; border:none !important;}
|
27 |
+
.de_info .cmb-td h5 {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
28 |
+
.de_info .cmb-td {width:100% !important;}
|
29 |
+
.de_info .cmb-td input {width:100% !important;}
|
30 |
+
.de_info .cmb-td p {font-size:12px; color:grey; font-style:normal !important;}
|
31 |
+
|
32 |
+
.de_instructions {padding:0 !important; margin:0 !important; border:none !important; padding-top:10px !important;}
|
33 |
+
.de_instructions .cmb-td h5 {font-size:18px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
34 |
+
.de_instructions .cmb-td {width:100% !important;}
|
35 |
+
.de_instructions .cmb-td input {width:100% !important;}
|
36 |
+
.de_instructions .cmb-td p {font-size:14px; color:grey; font-style:normal !important;}
|
37 |
+
|
38 |
+
.de_info_side .cmb-td a {font-size:15px !important; text-decoration:none !important;}
|
39 |
+
.de_info_side .cmb-td a span {position:relative; top:3px;}
|
40 |
+
.de_info_side .cmb-td p {padding:0 !important; color: #bbb; font-size:14px !important;}
|
41 |
+
|
42 |
+
.de_upload {padding:0 !important; margin:0 !important; border:none !important; padding-top:14px !important;}
|
43 |
+
.de_upload .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
44 |
+
.de_upload .cmb-td {width:100% !important;}
|
45 |
+
.de_upload .cmb-td input[type=text] {width:80% !important; color:#ccc !important; border:2px whitesmoke solid !important; box-shadow: 0 0 0 !important;}
|
46 |
+
.de_upload .cmb-td .button {margin-left:0 !important; width:19% !important; position:relative; top:4px;}
|
47 |
+
|
48 |
+
.de_heading {padding:0 !important; margin:0 !important; padding-top:14px !important; border:none !important;}
|
49 |
+
.de_heading_side {padding:0 !important; margin:0 !important; padding-top:0px !important; border:none !important;}
|
50 |
+
.de_heading .cmb-td h5 {font-style:normal !important; color:#0074A2; padding-left:4px; font-size:18px !important; font-weight:400 !important; border-bottom:6px whitesmoke double !important; padding-bottom:5px !important;}
|
51 |
+
.de_heading_side .cmb-td h5 {font-style:normal !important; color:#0074A2; padding-left:4px; font-size:18px !important; font-weight:400 !important; border-bottom:6px whitesmoke double !important; padding-bottom:5px !important;}
|
52 |
+
|
53 |
+
.de_checkbox {padding:0 !important; margin:0 !important; border:none !important;}
|
54 |
+
.de_checkbox .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
55 |
+
.de_checkbox .cmb-td {width:100% !important;}
|
56 |
+
.de_checkbox .cmb-td label span {font-size:12px; color:grey; font-style:normal !important;}
|
57 |
+
|
58 |
+
.de_checkbox_side {padding:0 !important; margin:0 !important; border:none !important;}
|
59 |
+
.de_checkbox_side .cmb-th {font-size:14px; width:100% !important; color:#333 !important;}
|
60 |
+
.de_checkbox_side .cmb-td {width:100% !important;}
|
61 |
+
.de_checkbox_side .cmb-th {padding-bottom:0 !important}
|
62 |
+
.de_checkbox_side .cmb-th label::after {display:none !important;}
|
63 |
+
.de_checkbox_side .cmb-td label span {font-size:12px; color:grey; font-style:normal !important;}
|
64 |
+
|
65 |
+
.de_fifty {margin-left:1.5% !important; margin-right:1.5% !important; width:47% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
66 |
+
|
67 |
+
.de_twentyfive {margin-left:1.5% !important; margin-right:1.5% !important; width:22% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
68 |
+
|
69 |
+
.de_seventyfive {margin-left:1.5% !important; margin-right:1.5% !important; width:72% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
70 |
+
|
71 |
+
.de_hundred {clear:both; margin-left:1.5% !important; margin-right:1.5% !important; width:97% !important; margin-bottom:14px !important; margin-top:14px !important;}
|
72 |
+
|
73 |
+
.de_hundred_side {clear:both; margin-left:1.5% !important; margin-right:1.5% !important; width:97% !important; margin-bottom:20px !important; margin-top:24px !important;}
|
74 |
+
|
75 |
+
.de_first {clear:left;}
|
76 |
+
.de_input input[type=text] {border:2px #dddddd solid !important; box-shadow: 0 0 0 !important;}
|
77 |
+
.de_input textarea {border:2px #dddddd solid !important; box-shadow: 0 0 0 !important;}
|
78 |
+
|
79 |
+
.de_text {padding:0 !important; margin:0 !important; border:none !important;}
|
80 |
+
.de_text .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
81 |
+
.de_text .cmb-td {width:100% !important;}
|
82 |
+
.de_text .cmb-td input {width:100% !important;}
|
83 |
+
|
84 |
+
.de_text_side {padding:0 !important; margin:0 !important;border:none !important;}
|
85 |
+
.de_text_side .cmb-th {font-size:14px; width:100% !important; color:#333 !important; padding-bottom:5px !important;}
|
86 |
+
.de_text_side .cmb-th label {padding-bottom:0 !important}
|
87 |
+
.de_text_side .cmb-th label::after {display:none !important;}
|
88 |
+
.de_text_side .cmb-td {width:100% !important;}
|
89 |
+
.de_text_side .cmb-td input, .de_text_side .cmb-td select {width:100% !important;}
|
90 |
+
|
91 |
+
.de_color {padding:0 !important; margin:0 !important; border:none !important;}
|
92 |
+
.de_color .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
93 |
+
.de_color .cmb-td {width:100% !important;}
|
94 |
+
|
95 |
+
.de_textarea {padding:0 !important; margin:0 !important; border:none !important;}
|
96 |
+
.de_textarea .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
97 |
+
.de_textarea .cmb-td {width:100% !important;}
|
98 |
+
.de_textarea .cmb-td input {width:100% !important;}
|
99 |
+
|
100 |
+
.de_info {padding:0 !important; margin:0 !important; border:none !important;}
|
101 |
+
.de_info .cmb-td h5 {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
102 |
+
.de_info .cmb-td {width:100% !important;}
|
103 |
+
.de_info .cmb-td input {width:100% !important;}
|
104 |
+
.de_info .cmb-td p {font-size:12px; color:grey; font-style:normal !important;}
|
105 |
+
|
106 |
+
.de_info_side .cmb-td a {font-size:15px !important; text-decoration:none !important;}
|
107 |
+
.de_info_side .cmb-td a span {position:relative; top:3px;}
|
108 |
+
.de_info_side .cmb-td p {padding:0 !important; color: #bbb; font-size:14px !important;}
|
109 |
+
|
110 |
+
.de_upload {padding:0 !important; margin:0 !important; border:none !important; padding-top:14px !important;}
|
111 |
+
.de_upload .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
112 |
+
.de_upload .cmb-td {width:100% !important;}
|
113 |
+
.de_upload .cmb-td input[type=text] {width:80% !important; color:#ccc !important; border:2px whitesmoke solid !important; box-shadow: 0 0 0 !important;}
|
114 |
+
.de_upload .cmb-td .button {margin-left:0 !important; width:19% !important; position:relative; top:4px;}
|
115 |
+
|
116 |
+
.de_heading {padding:0 !important; margin:0 !important; padding-top:14px !important; border:none !important;}
|
117 |
+
.de_heading_side {padding:0 !important; margin:0 !important; padding-top:0px !important; border:none !important;}
|
118 |
+
.de_heading .cmb-td h5 {font-style:normal !important; color:#0074A2; padding-left:4px; font-size:18px !important; font-weight:400 !important; border-bottom:6px whitesmoke double !important; padding-bottom:5px !important;}
|
119 |
+
.de_heading_side .cmb-td h5 {font-style:normal !important; color:#0074A2; padding-left:4px; font-size:18px !important; font-weight:400 !important; border-bottom:6px whitesmoke double !important; padding-bottom:5px !important;}
|
120 |
+
|
121 |
+
.de_checkbox {padding:0 !important; margin:0 !important; border:none !important;}
|
122 |
+
.de_checkbox .cmb-th {font-size:14px; text-transform:uppercase; width:100% !important; color:#333 !important;}
|
123 |
+
.de_checkbox .cmb-td {width:100% !important;}
|
124 |
+
.de_checkbox .cmb-td label span {font-size:12px; color:grey; font-style:normal !important;}
|
125 |
+
|
126 |
+
.de_checkbox_side {padding:0 !important; margin:0 !important; border:none !important;}
|
127 |
+
.de_checkbox_side .cmb-th {font-size:14px; width:100% !important; color:#333 !important;}
|
128 |
+
.de_checkbox_side .cmb-td {width:100% !important;}
|
129 |
+
.de_checkbox_side .cmb-th {padding-bottom:0 !important}
|
130 |
+
.de_checkbox_side .cmb-th label::after {display:none !important;}
|
131 |
+
.de_checkbox_side .cmb-td label span {font-size:12px; color:grey; font-style:normal !important;}
|
132 |
+
|
133 |
+
.de_fifty {margin-left:1.5% !important; margin-right:1.5% !important; width:47% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
134 |
+
|
135 |
+
.de_twentyfive {margin-left:1.5% !important; margin-right:1.5% !important; width:22% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
136 |
+
|
137 |
+
.de_seventyfive {margin-left:1.5% !important; margin-right:1.5% !important; width:72% !important; float:left !important; margin-bottom:14px !important; margin-top:14px !important;}
|
138 |
+
|
139 |
+
.de_hundred {clear:both; margin-left:1.5% !important; margin-right:1.5% !important; width:97% !important; margin-bottom:14px !important; margin-top:14px !important;}
|
140 |
+
|
141 |
+
.de_hundred_side {clear:both; margin-left:1.5% !important; margin-right:1.5% !important; width:97% !important; margin-bottom:20px !important; margin-top:24px !important;}
|
142 |
+
|
143 |
+
@media only screen and (max-width: 1100px) {
|
144 |
+
.de_fifty, .de_twentyfive, .de_seventyfive, .de_hundred {
|
145 |
+
clear:both; margin-left:1.5% !important; margin-right:1.5% !important; width:97% !important; margin-bottom:14px !important; margin-top:14px !important;
|
146 |
+
}
|
147 |
+
}
|
css/admin_de_style.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.de_first{clear:left}.de_input input[type=text]{border:2px #ddd solid!important;box-shadow:0 0 0!important}.de_input textarea{border:2px #ddd solid!important;box-shadow:0 0 0!important}.de_text{padding:0!important;margin:0!important;border:none!important}.de_text .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_text .cmb-td{width:100%!important}.de_text .cmb-td input{width:100%!important}.de_text_side{padding:0!important;margin:0!important;border:none!important}.de_text_side .cmb-th{font-size:14px;width:100%!important;color:#333!important;padding-bottom:5px!important}.de_text_side .cmb-th label{padding-bottom:0!important}.de_text_side .cmb-th label::after{display:none!important}.de_text_side .cmb-td{width:100%!important}.de_text_side .cmb-td input,.de_text_side .cmb-td select{width:100%!important}.de_color{padding:0!important;margin:0!important;border:none!important}.de_color .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_color .cmb-td{width:100%!important}.de_textarea{padding:0!important;margin:0!important;border:none!important}.de_textarea .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_textarea .cmb-td{width:100%!important}.de_textarea .cmb-td input{width:100%!important}.de_info{padding:0!important;margin:0!important;border:none!important}.de_info .cmb-td h5{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_info .cmb-td{width:100%!important}.de_info .cmb-td input{width:100%!important}.de_info .cmb-td p{font-size:12px;color:grey;font-style:normal!important}.de_instructions{padding:0!important;margin:0!important;border:none!important;padding-top:10px!important}.de_instructions .cmb-td h5{font-size:18px;text-transform:uppercase;width:100%!important;color:#333!important}.de_instructions .cmb-td{width:100%!important}.de_instructions .cmb-td input{width:100%!important}.de_instructions .cmb-td p{font-size:14px;color:grey;font-style:normal!important}.de_info_side .cmb-td a{font-size:15px!important;text-decoration:none!important}.de_info_side .cmb-td a span{position:relative;top:3px}.de_info_side .cmb-td p{padding:0!important;color:#bbb;font-size:14px!important}.de_upload{padding:0!important;margin:0!important;border:none!important;padding-top:14px!important}.de_upload .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_upload .cmb-td{width:100%!important}.de_upload .cmb-td input[type=text]{width:80%!important;color:#ccc!important;border:2px #f5f5f5 solid!important;box-shadow:0 0 0!important}.de_upload .cmb-td .button{margin-left:0!important;width:19%!important;position:relative;top:4px}.de_heading{padding:0!important;margin:0!important;padding-top:14px!important;border:none!important}.de_heading_side{padding:0!important;margin:0!important;padding-top:0!important;border:none!important}.de_heading .cmb-td h5{font-style:normal!important;color:#0074A2;padding-left:4px;font-size:18px!important;font-weight:400!important;border-bottom:6px #f5f5f5 double!important;padding-bottom:5px!important}.de_heading_side .cmb-td h5{font-style:normal!important;color:#0074A2;padding-left:4px;font-size:18px!important;font-weight:400!important;border-bottom:6px #f5f5f5 double!important;padding-bottom:5px!important}.de_checkbox{padding:0!important;margin:0!important;border:none!important}.de_checkbox .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_checkbox .cmb-td{width:100%!important}.de_checkbox .cmb-td label span{font-size:12px;color:grey;font-style:normal!important}.de_checkbox_side{padding:0!important;margin:0!important;border:none!important}.de_checkbox_side .cmb-th{font-size:14px;width:100%!important;color:#333!important}.de_checkbox_side .cmb-td{width:100%!important}.de_checkbox_side .cmb-th{padding-bottom:0!important}.de_checkbox_side .cmb-th label::after{display:none!important}.de_checkbox_side .cmb-td label span{font-size:12px;color:grey;font-style:normal!important}.de_fifty{width:47%!important;float:left!important;margin:14px 1.5%!important}.de_twentyfive{width:22%!important;float:left!important;margin:14px 1.5%!important}.de_seventyfive{width:72%!important;float:left!important;margin:14px 1.5%!important}.de_hundred{clear:both;width:97%!important;margin:14px 1.5%!important}.de_hundred_side{clear:both;width:97%!important;margin:24px 1.5% 20px!important}.de_first{clear:left}.de_input input[type=text]{border:2px #ddd solid!important;box-shadow:0 0 0!important}.de_input textarea{border:2px #ddd solid!important;box-shadow:0 0 0!important}.de_text{padding:0!important;margin:0!important;border:none!important}.de_text .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_text .cmb-td{width:100%!important}.de_text .cmb-td input{width:100%!important}.de_text_side{padding:0!important;margin:0!important;border:none!important}.de_text_side .cmb-th{font-size:14px;width:100%!important;color:#333!important;padding-bottom:5px!important}.de_text_side .cmb-th label{padding-bottom:0!important}.de_text_side .cmb-th label::after{display:none!important}.de_text_side .cmb-td{width:100%!important}.de_text_side .cmb-td input,.de_text_side .cmb-td select{width:100%!important}.de_color{padding:0!important;margin:0!important;border:none!important}.de_color .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_color .cmb-td{width:100%!important}.de_textarea{padding:0!important;margin:0!important;border:none!important}.de_textarea .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_textarea .cmb-td{width:100%!important}.de_textarea .cmb-td input{width:100%!important}.de_info{padding:0!important;margin:0!important;border:none!important}.de_info .cmb-td h5{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_info .cmb-td{width:100%!important}.de_info .cmb-td input{width:100%!important}.de_info .cmb-td p{font-size:12px;color:grey;font-style:normal!important}.de_info_side .cmb-td a{font-size:15px!important;text-decoration:none!important}.de_info_side .cmb-td a span{position:relative;top:3px}.de_info_side .cmb-td p{padding:0!important;color:#bbb;font-size:14px!important}.de_upload{padding:0!important;margin:0!important;border:none!important;padding-top:14px!important}.de_upload .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_upload .cmb-td{width:100%!important}.de_upload .cmb-td input[type=text]{width:80%!important;color:#ccc!important;border:2px #f5f5f5 solid!important;box-shadow:0 0 0!important}.de_upload .cmb-td .button{margin-left:0!important;width:19%!important;position:relative;top:4px}.de_heading{padding:0!important;margin:0!important;padding-top:14px!important;border:none!important}.de_heading_side{padding:0!important;margin:0!important;padding-top:0!important;border:none!important}.de_heading .cmb-td h5{font-style:normal!important;color:#0074A2;padding-left:4px;font-size:18px!important;font-weight:400!important;border-bottom:6px #f5f5f5 double!important;padding-bottom:5px!important}.de_heading_side .cmb-td h5{font-style:normal!important;color:#0074A2;padding-left:4px;font-size:18px!important;font-weight:400!important;border-bottom:6px #f5f5f5 double!important;padding-bottom:5px!important}.de_checkbox{padding:0!important;margin:0!important;border:none!important}.de_checkbox .cmb-th{font-size:14px;text-transform:uppercase;width:100%!important;color:#333!important}.de_checkbox .cmb-td{width:100%!important}.de_checkbox .cmb-td label span{font-size:12px;color:grey;font-style:normal!important}.de_checkbox_side{padding:0!important;margin:0!important;border:none!important}.de_checkbox_side .cmb-th{font-size:14px;width:100%!important;color:#333!important}.de_checkbox_side .cmb-td{width:100%!important}.de_checkbox_side .cmb-th{padding-bottom:0!important}.de_checkbox_side .cmb-th label::after{display:none!important}.de_checkbox_side .cmb-td label span{font-size:12px;color:grey;font-style:normal!important}.de_fifty{width:47%!important;float:left!important;margin:14px 1.5%!important}.de_twentyfive{width:22%!important;float:left!important;margin:14px 1.5%!important}.de_seventyfive{width:72%!important;float:left!important;margin:14px 1.5%!important}.de_hundred{clear:both;width:97%!important;margin:14px 1.5%!important}.de_hundred_side{clear:both;width:97%!important;margin:24px 1.5% 20px!important}@media only screen and (max-width: 1100px){.de_fifty,.de_twentyfive,.de_seventyfive,.de_hundred{clear:both;width:97%!important;margin:14px 1.5%!important}}
|
css/{rpt_custom_style.css → rpt_style.css}
RENAMED
@@ -257,13 +257,11 @@ img.rpt_recommended {float:right;}
|
|
257 |
.rpt_plan a {border-bottom:none;}
|
258 |
|
259 |
/* TABLETS */
|
260 |
-
|
261 |
@media only screen and (min-width: 40em) and (max-width: 64.063em) {
|
262 |
.rpt_style_basic .rpt_plan .rpt_head .rpt_price {font-size:64px; margin-top:20px;}
|
263 |
}
|
264 |
|
265 |
/* MOBILE SCREENS */
|
266 |
-
|
267 |
@media only screen and (max-width: 40em) {
|
268 |
.rpt_style_basic .rpt_recommended_plan .rpt_foot {font-size:30px; font-weight:300; padding:20px 0px;}
|
269 |
.rpt_style_basic .rpt_plan .rpt_head .rpt_price {font-size:74px !important;line-height:100px !important;}
|
@@ -292,4 +290,7 @@ img.rpt_recommended {float:right;}
|
|
292 |
.rpt_plans .rpt_plan {margin:10px 2% 20px !important;}
|
293 |
|
294 |
.rpt_plan .rpt_head .rpt_price .rpt_currency {top:-36px !important; left:-10px !important; font-size:35px !important;}
|
295 |
-
}
|
|
|
|
|
|
257 |
.rpt_plan a {border-bottom:none;}
|
258 |
|
259 |
/* TABLETS */
|
|
|
260 |
@media only screen and (min-width: 40em) and (max-width: 64.063em) {
|
261 |
.rpt_style_basic .rpt_plan .rpt_head .rpt_price {font-size:64px; margin-top:20px;}
|
262 |
}
|
263 |
|
264 |
/* MOBILE SCREENS */
|
|
|
265 |
@media only screen and (max-width: 40em) {
|
266 |
.rpt_style_basic .rpt_recommended_plan .rpt_foot {font-size:30px; font-weight:300; padding:20px 0px;}
|
267 |
.rpt_style_basic .rpt_plan .rpt_head .rpt_price {font-size:74px !important;line-height:100px !important;}
|
290 |
.rpt_plans .rpt_plan {margin:10px 2% 20px !important;}
|
291 |
|
292 |
.rpt_plan .rpt_head .rpt_price .rpt_currency {top:-36px !important; left:-10px !important; font-size:35px !important;}
|
293 |
+
}
|
294 |
+
|
295 |
+
/* Original plugin font style */
|
296 |
+
#rpt_pricr .rpt_plan_ori .rpt_title, #rpt_pricr .rpt_plan_ori .rpt_head .rpt_recurrence, #rpt_pricr .rpt_plan_ori .rpt_head .rpt_price, #rpt_pricr .rpt_plan_ori .rpt_head .rpt_price .rpt_currency, #rpt_pricr .rpt_plan_ori .rpt_head .rpt_subtitle, #rpt_pricr .rpt_plan_ori .rpt_head .rpt_description, #rpt_pricr .rpt_plan_ori .rpt_features .rpt_feature, #rpt_pricr .rpt_plan_ori .rpt_features .rpt_feature a, #rpt_pricr .rpt_plan_ori .rpt_foot {font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; font-weight:300 !important;}
|
css/{rpt_custom_style.min.css → rpt_style.min.css}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
.rpt_5_plans .rpt_plan{width:19.5%;float:left}.rpt_5_plans .rpt_plan_0{margin-right:.62%}.rpt_5_plans .rpt_plan_2{margin-left:.62%}.rpt_5_plans .rpt_plan_3{margin-left:.62%}.rpt_5_plans .rpt_plan_4{margin-left:.62%}.rpt_4_plans .rpt_plan{width:24.5%;float:left}.rpt_4_plans .rpt_plan_0{margin-right:.66%}.rpt_4_plans .rpt_plan_2{margin-left:.66%}.rpt_4_plans .rpt_plan_3{margin-left:.66%}.rpt_3_plans .rpt_plan{width:32%;float:left}.rpt_3_plans .rpt_plan_0{margin-right:1.9%}.rpt_3_plans .rpt_plan_2{margin-left:1.9%}.rpt_2_plans .rpt_plan{width:49%;float:left}.rpt_2_plans .rpt_plan_0{margin-right:2%}.rpt_style_basic .rpt_plan .rpt_title img{margin-right:10px;position:relative;vertical-align:middle}.rpt_style_basic .rpt_plan .rpt_title{border-bottom:#111 solid 1px;background:#222;padding:14px 18px;font-size:26px;color:#fff;line-height:48px;-webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;border-top-left-radius:8px;border-top-right-radius:8px}.rpt_style_basic .rpt_sm_title .rpt_plan .rpt_title{font-size:20px}.rpt_style_basic .rpt_xsm_title .rpt_plan .rpt_title{font-size:17px}.rpt_4_plans .rpt_plan .rpt_title{font-size:17px}.rpt_4_plans .rpt_sm_title .rpt_plan .rpt_title{font-size:15px}.rpt_4_plans .rpt_xsm_title .rpt_plan .rpt_title{font-size:13px}.rpt_5_plans .rpt_plan .rpt_title{font-size:15px}.rpt_5_plans .rpt_sm_title .rpt_plan .rpt_title{font-size:13px}.rpt_5_plans .rpt_xsm_title .rpt_plan .rpt_title{font-size:12px}.rpt_style_basic .rpt_plan .rpt_head .rpt_price .rpt_currency{position:relative;top:-44px;left:-10px;font-size:35px;line-height:0}.rpt_4_plans .rpt_plan .rpt_head .rpt_price .rpt_currency{top:-36px}.rpt_5_plans .rpt_plan .rpt_head .rpt_price .rpt_currency{top:-26px}.rpt_style_basic .rpt_sm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:30px;top:-44px;left:-4px}.rpt_style_basic .rpt_xsm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:25px;top:-30px;left:-4px}.rpt_style_basic .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:21px;top:-14px;left:-4px}.rpt_style_basic .rpt_plan .rpt_head{border-top:#222 solid 2px;background:#333;background:-moz-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#333),color-stop(100%,#1c1c1c));background:-webkit-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-o-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-ms-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:linear-gradient(45deg,#333 0%,#1c1c1c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333',endColorstr='#1c1c1c',GradientType=1)}.rpt_style_basic .rpt_plan .rpt_head .rpt_price{padding:6px 10px;font-size:74px;line-height:100px;font-weight:300;text-align:center;color:#fff;text-shadow:1px 2px 7px rgba(0,0,0,0.6)}.rpt_style_basic .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:62px}.rpt_style_basic .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:56px}.rpt_style_basic .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:38px}.rpt_4_plans .rpt_plan .rpt_head .rpt_price{font-size:69px;line-height:80px}.rpt_4_plans .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:53px;line-height:65px}.rpt_4_plans .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:47px;line-height:64px}.rpt_4_plans .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:31px;line-height:60px}.rpt_5_plans .rpt_plan .rpt_head .rpt_price{font-size:59px;line-height:80px}.rpt_5_plans .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:44px;line-height:60px}.rpt_5_plans .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:37px;line-height:53px}.rpt_5_plans .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:24px;line-height:50px}.rpt_style_basic .rpt_plan .rpt_head .rpt_recurrence{font-size:13px;font-weight:300;line-height:18px;padding:20px 40px 10px;color:#d3d3d3;text-align:center}.rpt_style_basic .rpt_sm_recurrence .rpt_plan .rpt_head .rpt_recurrence{font-size:11px;padding:20px 40px 4px}.rpt_style_basic .rpt_plan .rpt_head .rpt_subtitle{font-size:16px;line-height:20px;font-weight:300;text-align:center;padding:10px 30px 20px}.rpt_style_basic .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:14px}.rpt_style_basic .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:12px}.rpt_4_plans .rpt_plan .rpt_head .rpt_subtitle{font-size:16px;line-height:18px;padding:10px 10px 20px}.rpt_4_plans .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:14px;line-height:17px}.rpt_4_plans .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:13px;line-height:16px}.rpt_5_plans .rpt_plan .rpt_head .rpt_subtitle{font-size:15px;line-height:18px;padding:10px 10px 20px}.rpt_5_plans .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:13px;line-height:17px}.rpt_5_plans .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:12px;line-height:16px}.rpt_style_basic .rpt_plan .rpt_head .rpt_description{font-size:14px;line-height:20px;padding:0 20px 30px;font-weight:300;text-align:center;color:grey}.rpt_style_basic .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:12px}.rpt_4_plans .rpt_plan .rpt_head .rpt_description{font-size:13px;line-height:18px}.rpt_4_plans .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:12px;line-height:17px}.rpt_5_plans .rpt_plan .rpt_head .rpt_description{font-size:12px;line-height:18px}.rpt_5_plans .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:11px;line-height:17px}.rpt_style_basic .rpt_plan .rpt_features{padding:20px;background:#f5f5f5;text-align:center}.rpt_style_basic .rpt_plan .rpt_features .rpt_feature{font-size:16px;padding:6px 16px;border-bottom:1px dotted #d3d3d3}.rpt_style_basic .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:14px}.rpt_4_plans .rpt_plan .rpt_features .rpt_feature{padding:6px 10px;font-size:14px}.rpt_4_plans .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:12px}.rpt_5_plans .rpt_plan .rpt_features .rpt_feature{padding:6px 10px;font-size:13px}.rpt_5_plans .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:11px}.rpt_style_basic .rpt_plan .rpt_foot{display:block;padding:10px 30px;border-top:#f5f5f5 solid 2px;-webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;text-align:center;color:#fff;font-size:24px;text-decoration:none;font-weight:300;transition:All 500ms ease;-webkit-transition:All 500ms ease;-moz-transition:All 500ms ease;-o-transition:All 500ms ease}.rpt_style_basic .rpt_sm_button .rpt_plan .rpt_foot{font-size:19px}.rpt_4_plans .rpt_plan .rpt_foot{padding:4px 20px;font-size:19px}.rpt_4_plans .rpt_sm_button .rpt_plan .rpt_foot{padding:4px 20px;font-size:17px}.rpt_5_plans .rpt_plan .rpt_foot{padding:4px 20px;font-size:17px}.rpt_5_plans .rpt_sm_button .rpt_plan .rpt_foot{font-size:16px}.rpt_style_basic .rpt_plan .rpt_foot:hover{opacity:.8}.rpt_style_basic .rpt_plan img{display:inline;margin:0 10px 0 0;padding:0;-webkit-box-shadow:0 0 0 0 rgba(0,0,0,0);-moz-box-shadow:0 0 0 0 rgba(0,0,0,0);box-shadow:0 0 0 0 rgba(0,0,0,0);border:none}.rpt_style_basic .rpt_recommended_plan{position:relative;top:-10px}.rpt_style_basic .rpt_recommended_plan .rpt_title{background:#111}.rpt_style_basic .rpt_recommended_plan .rpt_head .rpt_price{font-size:98px}.rpt_4_plans .rpt_recommended_plan .rpt_head .rpt_price{font-size:74px}.rpt_5_plans .rpt_recommended_plan .rpt_head .rpt_price{font-size:67px}.rpt_style_basic .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:83px}.rpt_4_plans .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:60px}.rpt_5_plans .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:54px}.rpt_style_basic .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:55px}.rpt_4_plans .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:49px}.rpt_5_plans .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:41px}.rpt_style_basic .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:42px}.rpt_4_plans .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:34px}.rpt_5_plans .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:26px}.rpt_style_basic .rpt_recommended_plan .rpt_head{background:#1e1e1e;background:-moz-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#1e1e1e),color-stop(100%,#191919));background:-webkit-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-o-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-ms-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:linear-gradient(45deg,#1e1e1e 0%,#191919 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e',endColorstr='#191919',GradientType=1)}.rpt_style_basic .rpt_recommended_plan .rpt_foot{font-size:30px;padding:16px 0}.rpt_style_basic .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:25px}.rpt_4_plans .rpt_recommended_plan .rpt_foot{font-size:22px;font-weight:300;padding:10px 0}.rpt_4_plans .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:19px;padding:10px 0}.rpt_5_plans .rpt_recommended_plan .rpt_foot{font-size:20px;font-weight:300;padding:10px 0}.rpt_5_plans .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:18px;padding:10px 0}img.rpt_recommended{float:right}.entry-content .rpt_plan a{border-bottom:none}.rpt_plan a{border-bottom:none}@media only screen and (min-width: 40em) and (max-width: 64.063em){.rpt_style_basic .rpt_plan .rpt_head .rpt_price{font-size:64px;margin-top:20px}}@media only screen and (max-width: 40em){.rpt_style_basic .rpt_recommended_plan .rpt_foot{font-size:30px;font-weight:300;padding:20px 0}.rpt_style_basic .rpt_plan .rpt_head .rpt_price{font-size:74px!important;line-height:100px!important}.rpt_style_basic .rpt_plan .rpt_title{font-size:26px!important;line-height:48px}.rpt_style_basic .rpt_plan .rpt_head .rpt_subtitle{font-size:17px!important;line-height:28px;padding:10px 40px 20px}.rpt_style_basic .rpt_plan .rpt_head .rpt_description{font-size:15px!important;line-height:26px!important;padding:0 40px 30px}.rpt_style_basic .rpt_plan .rpt_features .rpt_feature{padding:6px 16px;font-size:14px!important}.rpt_style_basic .rpt_plan .rpt_foot{padding:10px 40px;text-align:center;font-size:20px!important}.rpt_plans .rpt_plan{width:96%;margin:10px 2% 20px!important}.rpt_plan .rpt_head .rpt_price .rpt_currency{top:-36px!important;left:-10px!important;font-size:35px!important}}
|
1 |
+
.rpt_5_plans .rpt_plan{width:19.5%;float:left}.rpt_5_plans .rpt_plan_0{margin-right:.62%}.rpt_5_plans .rpt_plan_2{margin-left:.62%}.rpt_5_plans .rpt_plan_3{margin-left:.62%}.rpt_5_plans .rpt_plan_4{margin-left:.62%}.rpt_4_plans .rpt_plan{width:24.5%;float:left}.rpt_4_plans .rpt_plan_0{margin-right:.66%}.rpt_4_plans .rpt_plan_2{margin-left:.66%}.rpt_4_plans .rpt_plan_3{margin-left:.66%}.rpt_3_plans .rpt_plan{width:32%;float:left}.rpt_3_plans .rpt_plan_0{margin-right:1.9%}.rpt_3_plans .rpt_plan_2{margin-left:1.9%}.rpt_2_plans .rpt_plan{width:49%;float:left}.rpt_2_plans .rpt_plan_0{margin-right:2%}.rpt_style_basic .rpt_plan .rpt_title img{margin-right:10px;position:relative;vertical-align:middle}.rpt_style_basic .rpt_plan .rpt_title{border-bottom:#111 solid 1px;background:#222;padding:14px 18px;font-size:26px;color:#fff;line-height:48px;-webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;border-top-left-radius:8px;border-top-right-radius:8px}.rpt_style_basic .rpt_sm_title .rpt_plan .rpt_title{font-size:20px}.rpt_style_basic .rpt_xsm_title .rpt_plan .rpt_title{font-size:17px}.rpt_4_plans .rpt_plan .rpt_title{font-size:17px}.rpt_4_plans .rpt_sm_title .rpt_plan .rpt_title{font-size:15px}.rpt_4_plans .rpt_xsm_title .rpt_plan .rpt_title{font-size:13px}.rpt_5_plans .rpt_plan .rpt_title{font-size:15px}.rpt_5_plans .rpt_sm_title .rpt_plan .rpt_title{font-size:13px}.rpt_5_plans .rpt_xsm_title .rpt_plan .rpt_title{font-size:12px}.rpt_style_basic .rpt_plan .rpt_head .rpt_price .rpt_currency{position:relative;top:-44px;left:-10px;font-size:35px;line-height:0}.rpt_4_plans .rpt_plan .rpt_head .rpt_price .rpt_currency{top:-36px}.rpt_5_plans .rpt_plan .rpt_head .rpt_price .rpt_currency{top:-26px}.rpt_style_basic .rpt_sm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:30px;top:-44px;left:-4px}.rpt_style_basic .rpt_xsm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:25px;top:-30px;left:-4px}.rpt_style_basic .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price .rpt_currency{font-size:21px;top:-14px;left:-4px}.rpt_style_basic .rpt_plan .rpt_head{border-top:#222 solid 2px;background:#333;background:-moz-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#333),color-stop(100%,#1c1c1c));background:-webkit-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-o-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:-ms-linear-gradient(45deg,#333 0%,#1c1c1c 100%);background:linear-gradient(45deg,#333 0%,#1c1c1c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333',endColorstr='#1c1c1c',GradientType=1)}.rpt_style_basic .rpt_plan .rpt_head .rpt_price{padding:6px 10px;font-size:74px;line-height:100px;font-weight:300;text-align:center;color:#fff;text-shadow:1px 2px 7px rgba(0,0,0,0.6)}.rpt_style_basic .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:62px}.rpt_style_basic .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:56px}.rpt_style_basic .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:38px}.rpt_4_plans .rpt_plan .rpt_head .rpt_price{font-size:69px;line-height:80px}.rpt_4_plans .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:53px;line-height:65px}.rpt_4_plans .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:47px;line-height:64px}.rpt_4_plans .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:31px;line-height:60px}.rpt_5_plans .rpt_plan .rpt_head .rpt_price{font-size:59px;line-height:80px}.rpt_5_plans .rpt_sm_price .rpt_plan .rpt_head .rpt_price{font-size:44px;line-height:60px}.rpt_5_plans .rpt_xsm_price .rpt_plan .rpt_head .rpt_price{font-size:37px;line-height:53px}.rpt_5_plans .rpt_xxsm_price .rpt_plan .rpt_head .rpt_price{font-size:24px;line-height:50px}.rpt_style_basic .rpt_plan .rpt_head .rpt_recurrence{font-size:13px;font-weight:300;line-height:18px;padding:20px 40px 10px;color:#d3d3d3;text-align:center}.rpt_style_basic .rpt_sm_recurrence .rpt_plan .rpt_head .rpt_recurrence{font-size:11px;padding:20px 40px 4px}.rpt_style_basic .rpt_plan .rpt_head .rpt_subtitle{font-size:16px;line-height:20px;font-weight:300;text-align:center;padding:10px 30px 20px}.rpt_style_basic .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:14px}.rpt_style_basic .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:12px}.rpt_4_plans .rpt_plan .rpt_head .rpt_subtitle{font-size:16px;line-height:18px;padding:10px 10px 20px}.rpt_4_plans .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:14px;line-height:17px}.rpt_4_plans .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:13px;line-height:16px}.rpt_5_plans .rpt_plan .rpt_head .rpt_subtitle{font-size:15px;line-height:18px;padding:10px 10px 20px}.rpt_5_plans .rpt_sm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:13px;line-height:17px}.rpt_5_plans .rpt_xsm_subtitle .rpt_plan .rpt_head .rpt_subtitle{font-size:12px;line-height:16px}.rpt_style_basic .rpt_plan .rpt_head .rpt_description{font-size:14px;line-height:20px;padding:0 20px 30px;font-weight:300;text-align:center;color:grey}.rpt_style_basic .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:12px}.rpt_4_plans .rpt_plan .rpt_head .rpt_description{font-size:13px;line-height:18px}.rpt_4_plans .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:12px;line-height:17px}.rpt_5_plans .rpt_plan .rpt_head .rpt_description{font-size:12px;line-height:18px}.rpt_5_plans .rpt_sm_description .rpt_plan .rpt_head .rpt_description{font-size:11px;line-height:17px}.rpt_style_basic .rpt_plan .rpt_features{padding:20px;background:#f5f5f5;text-align:center}.rpt_style_basic .rpt_plan .rpt_features .rpt_feature{font-size:16px;padding:6px 16px;border-bottom:1px dotted #d3d3d3}.rpt_style_basic .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:14px}.rpt_4_plans .rpt_plan .rpt_features .rpt_feature{padding:6px 10px;font-size:14px}.rpt_4_plans .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:12px}.rpt_5_plans .rpt_plan .rpt_features .rpt_feature{padding:6px 10px;font-size:13px}.rpt_5_plans .rpt_sm_features .rpt_plan .rpt_features .rpt_feature{font-size:11px}.rpt_style_basic .rpt_plan .rpt_foot{display:block;padding:10px 30px;border-top:#f5f5f5 solid 2px;-webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;text-align:center;color:#fff;font-size:24px;text-decoration:none;font-weight:300;transition:All 500ms ease;-webkit-transition:All 500ms ease;-moz-transition:All 500ms ease;-o-transition:All 500ms ease}.rpt_style_basic .rpt_sm_button .rpt_plan .rpt_foot{font-size:19px}.rpt_4_plans .rpt_plan .rpt_foot{padding:4px 20px;font-size:19px}.rpt_4_plans .rpt_sm_button .rpt_plan .rpt_foot{padding:4px 20px;font-size:17px}.rpt_5_plans .rpt_plan .rpt_foot{padding:4px 20px;font-size:17px}.rpt_5_plans .rpt_sm_button .rpt_plan .rpt_foot{font-size:16px}.rpt_style_basic .rpt_plan .rpt_foot:hover{opacity:.8}.rpt_style_basic .rpt_plan img{display:inline;margin:0 10px 0 0;padding:0;-webkit-box-shadow:0 0 0 0 rgba(0,0,0,0);-moz-box-shadow:0 0 0 0 rgba(0,0,0,0);box-shadow:0 0 0 0 rgba(0,0,0,0);border:none}.rpt_style_basic .rpt_recommended_plan{position:relative;top:-10px}.rpt_style_basic .rpt_recommended_plan .rpt_title{background:#111}.rpt_style_basic .rpt_recommended_plan .rpt_head .rpt_price{font-size:98px}.rpt_4_plans .rpt_recommended_plan .rpt_head .rpt_price{font-size:74px}.rpt_5_plans .rpt_recommended_plan .rpt_head .rpt_price{font-size:67px}.rpt_style_basic .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:83px}.rpt_4_plans .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:60px}.rpt_5_plans .rpt_sm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:54px}.rpt_style_basic .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:55px}.rpt_4_plans .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:49px}.rpt_5_plans .rpt_xsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:41px}.rpt_style_basic .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:42px}.rpt_4_plans .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:34px}.rpt_5_plans .rpt_xxsm_price .rpt_recommended_plan .rpt_head .rpt_price{font-size:26px}.rpt_style_basic .rpt_recommended_plan .rpt_head{background:#1e1e1e;background:-moz-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#1e1e1e),color-stop(100%,#191919));background:-webkit-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-o-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:-ms-linear-gradient(45deg,#1e1e1e 0%,#191919 100%);background:linear-gradient(45deg,#1e1e1e 0%,#191919 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e',endColorstr='#191919',GradientType=1)}.rpt_style_basic .rpt_recommended_plan .rpt_foot{font-size:30px;padding:16px 0}.rpt_style_basic .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:25px}.rpt_4_plans .rpt_recommended_plan .rpt_foot{font-size:22px;font-weight:300;padding:10px 0}.rpt_4_plans .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:19px;padding:10px 0}.rpt_5_plans .rpt_recommended_plan .rpt_foot{font-size:20px;font-weight:300;padding:10px 0}.rpt_5_plans .rpt_sm_button .rpt_recommended_plan .rpt_foot{font-size:18px;padding:10px 0}img.rpt_recommended{float:right}.entry-content .rpt_plan a{border-bottom:none}.rpt_plan a{border-bottom:none}@media only screen and (min-width: 40em) and (max-width: 64.063em){.rpt_style_basic .rpt_plan .rpt_head .rpt_price{font-size:64px;margin-top:20px}}@media only screen and (max-width: 40em){.rpt_style_basic .rpt_recommended_plan .rpt_foot{font-size:30px;font-weight:300;padding:20px 0}.rpt_style_basic .rpt_plan .rpt_head .rpt_price{font-size:74px!important;line-height:100px!important}.rpt_style_basic .rpt_plan .rpt_title{font-size:26px!important;line-height:48px}.rpt_style_basic .rpt_plan .rpt_head .rpt_subtitle{font-size:17px!important;line-height:28px;padding:10px 40px 20px}.rpt_style_basic .rpt_plan .rpt_head .rpt_description{font-size:15px!important;line-height:26px!important;padding:0 40px 30px}.rpt_style_basic .rpt_plan .rpt_features .rpt_feature{padding:6px 16px;font-size:14px!important}.rpt_style_basic .rpt_plan .rpt_foot{padding:10px 40px;text-align:center;font-size:20px!important}.rpt_plans .rpt_plan{width:96%;margin:10px 2% 20px!important}.rpt_plan .rpt_head .rpt_price .rpt_currency{top:-36px!important;left:-10px!important;font-size:35px!important}}#rpt_pricr .rpt_plan_ori .rpt_title,#rpt_pricr .rpt_plan_ori .rpt_head .rpt_recurrence,#rpt_pricr .rpt_plan_ori .rpt_head .rpt_price,#rpt_pricr .rpt_plan_ori .rpt_head .rpt_price .rpt_currency,#rpt_pricr .rpt_plan_ori .rpt_head .rpt_subtitle,#rpt_pricr .rpt_plan_ori .rpt_head .rpt_description,#rpt_pricr .rpt_plan_ori .rpt_features .rpt_feature,#rpt_pricr .rpt_plan_ori .rpt_features .rpt_feature a,#rpt_pricr .rpt_plan_ori .rpt_foot{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif!important;font-weight:300!important}
|
dkrpt/Gruntfile.js
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
module.exports = function(grunt) {
|
2 |
-
grunt.initConfig({
|
3 |
-
pkg: grunt.file.readJSON('package.json'),
|
4 |
-
phpunit: {
|
5 |
-
classes: {}
|
6 |
-
},
|
7 |
-
githooks: {
|
8 |
-
all: {
|
9 |
-
'pre-commit': 'default'
|
10 |
-
}
|
11 |
-
},
|
12 |
-
// concat: {
|
13 |
-
// options: {
|
14 |
-
// stripBanners: true,
|
15 |
-
// // banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
16 |
-
// // ' * <%= pkg.homepage %>\n' +
|
17 |
-
// // ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
|
18 |
-
// // ' * Licensed GPLv2+' +
|
19 |
-
// // ' */\n'
|
20 |
-
// },
|
21 |
-
// '': {
|
22 |
-
// src: [
|
23 |
-
// 'js/dkrpt.js',
|
24 |
-
// 'js/dkrpt.js',
|
25 |
-
// ],
|
26 |
-
// dest: 'assets/js/{%= dir_name %}.js'
|
27 |
-
// }
|
28 |
-
// },
|
29 |
-
cssmin: {
|
30 |
-
options: {
|
31 |
-
// banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
32 |
-
// ' * <%= pkg.homepage %>\n' +
|
33 |
-
// ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
|
34 |
-
// ' * Licensed GPLv2+' +
|
35 |
-
// ' */\n'
|
36 |
-
},
|
37 |
-
minify: {
|
38 |
-
expand: true,
|
39 |
-
src: ['style.css'],
|
40 |
-
// dest: '',
|
41 |
-
ext: '.min.css'
|
42 |
-
}
|
43 |
-
},
|
44 |
-
jshint: {
|
45 |
-
all: [
|
46 |
-
'Gruntfile.js',
|
47 |
-
'js/dkrpt.js'
|
48 |
-
],
|
49 |
-
options: {
|
50 |
-
curly : true,
|
51 |
-
eqeqeq : true,
|
52 |
-
immed : true,
|
53 |
-
latedef : true,
|
54 |
-
newcap : true,
|
55 |
-
noarg : true,
|
56 |
-
sub : true,
|
57 |
-
unused : true,
|
58 |
-
undef : true,
|
59 |
-
boss : true,
|
60 |
-
eqnull : true,
|
61 |
-
globals : {
|
62 |
-
exports : true,
|
63 |
-
module : false
|
64 |
-
},
|
65 |
-
predef :['document','window','jQuery','dkrpt_l10','wp','tinyMCEPreInit','tinyMCE','console']
|
66 |
-
}
|
67 |
-
},
|
68 |
-
uglify: {
|
69 |
-
all: {
|
70 |
-
files: {
|
71 |
-
'js/dkrpt.min.js': ['js/dkrpt.js']
|
72 |
-
},
|
73 |
-
options: {
|
74 |
-
// banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
75 |
-
// ' * <%= pkg.homepage %>\n' +
|
76 |
-
// ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
|
77 |
-
// ' * Licensed GPLv2+' +
|
78 |
-
// ' */\n',
|
79 |
-
mangle: false
|
80 |
-
}
|
81 |
-
}
|
82 |
-
},
|
83 |
-
watch: {
|
84 |
-
|
85 |
-
css: {
|
86 |
-
files: ['style.css'],
|
87 |
-
tasks: ['cssmin']
|
88 |
-
},
|
89 |
-
|
90 |
-
scripts: {
|
91 |
-
files: ['js/dkrpt.js'],
|
92 |
-
tasks: ['jshint', 'uglify'],
|
93 |
-
options: {
|
94 |
-
debounceDelay: 500
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
|
100 |
-
});
|
101 |
-
|
102 |
-
grunt.loadNpmTasks('grunt-phpunit');
|
103 |
-
grunt.loadNpmTasks('grunt-githooks');
|
104 |
-
grunt.loadNpmTasks('grunt-contrib-jshint');
|
105 |
-
grunt.loadNpmTasks('grunt-contrib-uglify');
|
106 |
-
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
107 |
-
grunt.loadNpmTasks('grunt-contrib-watch');
|
108 |
-
// grunt.loadNpmTasks('grunt-contrib-concat');
|
109 |
-
|
110 |
-
grunt.registerTask('default', ['jshint', 'cssmin', 'uglify', 'phpunit']);
|
111 |
-
grunt.registerTask('tests', ['jshint', 'phpunit']);
|
112 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/helpers/dkrpt_Meta_Box_Show_Filters.php
DELETED
@@ -1,105 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Show On Filters
|
5 |
-
* Use the 'dkrpt_show_on' filter to further refine the conditions under which a metabox is displayed.
|
6 |
-
* Below you can limit it by ID and page template
|
7 |
-
*
|
8 |
-
* All methods in this class are automatically filtered
|
9 |
-
*
|
10 |
-
* @since 1.0.0
|
11 |
-
*/
|
12 |
-
class dkrpt_Meta_Box_Show_Filters {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Add metaboxes for an specific ID
|
16 |
-
* @since 1.0.0
|
17 |
-
* @param bool $display To display or not
|
18 |
-
* @param array $meta_box Metabox config array
|
19 |
-
* @return bool Whether to display this metabox on the current page.
|
20 |
-
*/
|
21 |
-
public static function check_id( $display, $meta_box ) {
|
22 |
-
|
23 |
-
if ( ! isset( $meta_box['show_on']['key'] ) || 'id' !== $meta_box['show_on']['key'] )
|
24 |
-
return $display;
|
25 |
-
|
26 |
-
$object_id = is_admin() ? dkrpt_Meta_Box::get_object_id() : @get_the_id();
|
27 |
-
|
28 |
-
if ( ! $object_id )
|
29 |
-
return false;
|
30 |
-
|
31 |
-
// If current page id is in the included array, display the metabox
|
32 |
-
return in_array( $object_id, (array) $meta_box['show_on']['value'] );
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Add metaboxes for an specific Page Template
|
37 |
-
* @since 1.0.0
|
38 |
-
* @param bool $display To display or not
|
39 |
-
* @param array $meta_box Metabox config array
|
40 |
-
* @return bool Whether to display this metabox on the current page.
|
41 |
-
*/
|
42 |
-
public static function check_page_template( $display, $meta_box ) {
|
43 |
-
|
44 |
-
if ( ! isset( $meta_box['show_on']['key'] ) || 'page-template' !== $meta_box['show_on']['key'] )
|
45 |
-
return $display;
|
46 |
-
|
47 |
-
$object_id = dkrpt_Meta_Box::get_object_id();
|
48 |
-
|
49 |
-
if ( ! $object_id || dkrpt_Meta_Box::get_object_type() !== 'post' )
|
50 |
-
return false;
|
51 |
-
|
52 |
-
// Get current template
|
53 |
-
$current_template = get_post_meta( $object_id, '_wp_page_template', true );
|
54 |
-
|
55 |
-
// See if there's a match
|
56 |
-
if ( $current_template && in_array( $current_template, (array) $meta_box['show_on']['value'] ) )
|
57 |
-
return true;
|
58 |
-
|
59 |
-
return false;
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Only show options-page metaboxes on their options page (but only enforce on the admin side)
|
64 |
-
* @since 1.0.0
|
65 |
-
* @param bool $display To display or not
|
66 |
-
* @param array $meta_box Metabox config array
|
67 |
-
* @return bool Whether to display this metabox on the current page.
|
68 |
-
*/
|
69 |
-
public static function check_admin_page( $display, $meta_box ) {
|
70 |
-
|
71 |
-
// check if this is a 'options-page' metabox
|
72 |
-
if ( ! isset( $meta_box['show_on']['key'] ) || 'options-page' !== $meta_box['show_on']['key'] )
|
73 |
-
return $display;
|
74 |
-
|
75 |
-
// Enforce 'show_on' filter in the admin
|
76 |
-
if ( is_admin() ) {
|
77 |
-
|
78 |
-
// If there is no 'page' query var, our filter isn't applicable
|
79 |
-
if ( ! isset( $_GET['page'] ) )
|
80 |
-
return $display;
|
81 |
-
|
82 |
-
if ( ! isset( $meta_box['show_on']['value'] ) )
|
83 |
-
return false;
|
84 |
-
|
85 |
-
$pages = $meta_box['show_on']['value'];
|
86 |
-
|
87 |
-
if ( is_array( $pages ) ) {
|
88 |
-
foreach ( $pages as $page ) {
|
89 |
-
if ( $_GET['page'] == $page )
|
90 |
-
return true;
|
91 |
-
}
|
92 |
-
} else {
|
93 |
-
if ( $_GET['page'] == $pages )
|
94 |
-
return true;
|
95 |
-
}
|
96 |
-
|
97 |
-
return false;
|
98 |
-
|
99 |
-
}
|
100 |
-
|
101 |
-
// Allow options-page metaboxes to be displayed anywhere on the front-end
|
102 |
-
return true;
|
103 |
-
}
|
104 |
-
|
105 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/helpers/dkrpt_Meta_Box_ajax.php
DELETED
@@ -1,203 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* dkrpt ajax methods
|
5 |
-
* (i.e. a lot of work to get oEmbeds to work with non-post objects)
|
6 |
-
*
|
7 |
-
* @since 0.9.5
|
8 |
-
*/
|
9 |
-
class dkrpt_Meta_Box_ajax {
|
10 |
-
|
11 |
-
// A single instance of this class.
|
12 |
-
public static $instance = null;
|
13 |
-
// Whether to hijack the oembed cache system
|
14 |
-
public static $hijack = false;
|
15 |
-
public static $object_id = 0;
|
16 |
-
public static $embed_args = array();
|
17 |
-
public static $object_type = 'post';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Creates or returns an instance of this class.
|
21 |
-
* @since 0.1.0
|
22 |
-
* @return dkrpt_Meta_Box_ajax A single instance of this class.
|
23 |
-
*/
|
24 |
-
public static function get() {
|
25 |
-
if ( self::$instance === null )
|
26 |
-
self::$instance = new self();
|
27 |
-
|
28 |
-
return self::$instance;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Handles our oEmbed ajax request
|
33 |
-
* @since 0.9.5
|
34 |
-
* @return object oEmbed embed code | fallback | error message
|
35 |
-
*/
|
36 |
-
public function oembed_handler() {
|
37 |
-
|
38 |
-
// verify our nonce
|
39 |
-
if ( ! ( isset( $_REQUEST['dkrpt_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['dkrpt_ajax_nonce'], 'ajax_nonce' ) ) )
|
40 |
-
die();
|
41 |
-
|
42 |
-
// sanitize our search string
|
43 |
-
$oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
|
44 |
-
|
45 |
-
// send back error if empty
|
46 |
-
if ( empty( $oembed_string ) )
|
47 |
-
self::send_result( '<p class="ui-state-error-text">'. __( 'Please Try Again', 'dkrpt' ) .'</p>', false );
|
48 |
-
|
49 |
-
// Set width of embed
|
50 |
-
$embed_width = isset( $_REQUEST['oembed_width'] ) && intval( $_REQUEST['oembed_width'] ) < 640 ? intval( $_REQUEST['oembed_width'] ) : '640';
|
51 |
-
|
52 |
-
// set url
|
53 |
-
$oembed_url = esc_url( $oembed_string );
|
54 |
-
// set args
|
55 |
-
$embed_args = array( 'width' => $embed_width );
|
56 |
-
|
57 |
-
// Get embed code (or fallback link)
|
58 |
-
$html = self::get_oembed( $oembed_url, $_REQUEST['object_id'], array(
|
59 |
-
'object_type' => isset( $_REQUEST['object_type'] ) ? $_REQUEST['object_type'] : 'post',
|
60 |
-
'oembed_args' => $embed_args,
|
61 |
-
'field_id' => $_REQUEST['field_id'],
|
62 |
-
) );
|
63 |
-
|
64 |
-
self::send_result( $html );
|
65 |
-
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Retrieves oEmbed from url/object ID
|
70 |
-
* @since 0.9.5
|
71 |
-
* @param string $url URL to retrieve oEmbed
|
72 |
-
* @param int $object_id Object ID
|
73 |
-
* @param array $args Arguments for method
|
74 |
-
* @return string html markup with embed or fallback
|
75 |
-
*/
|
76 |
-
public static function get_oembed( $url, $object_id, $args = array() ) {
|
77 |
-
global $wp_embed;
|
78 |
-
|
79 |
-
$oembed_url = esc_url( $url );
|
80 |
-
|
81 |
-
// Sanitize object_id
|
82 |
-
self::$object_id = is_numeric( $object_id ) ? absint( $object_id ) : sanitize_text_field( $object_id );
|
83 |
-
|
84 |
-
$args = wp_parse_args( $args, array(
|
85 |
-
'object_type' => 'post',
|
86 |
-
'oembed_args' => self::$embed_args,
|
87 |
-
'field_id' => false,
|
88 |
-
'cache_key' => false,
|
89 |
-
) );
|
90 |
-
|
91 |
-
self::$embed_args =& $args;
|
92 |
-
|
93 |
-
// set the post_ID so oEmbed won't fail
|
94 |
-
// wp-includes/class-wp-embed.php, WP_Embed::shortcode(), line 162
|
95 |
-
$wp_embed->post_ID = self::$object_id;
|
96 |
-
|
97 |
-
// Special scenario if NOT a post object
|
98 |
-
if ( isset( $args['object_type'] ) && $args['object_type'] != 'post' ) {
|
99 |
-
|
100 |
-
if ( 'options-page' == $args['object_type'] ) {
|
101 |
-
// bogus id to pass some numeric checks
|
102 |
-
// Issue with a VERY large WP install?
|
103 |
-
$wp_embed->post_ID = 1987645321;
|
104 |
-
// Use our own cache key to correspond to this field (vs one cache key per url)
|
105 |
-
$args['cache_key'] = $args['field_id'] .'_cache';
|
106 |
-
}
|
107 |
-
// Ok, we need to hijack the oembed cache system
|
108 |
-
self::$hijack = true;
|
109 |
-
self::$object_type = $args['object_type'];
|
110 |
-
|
111 |
-
// Gets ombed cache from our object's meta (vs postmeta)
|
112 |
-
add_filter( 'get_post_metadata', array( 'dkrpt_Meta_Box_ajax', 'hijack_oembed_cache_get' ), 10, 3 );
|
113 |
-
// Sets ombed cache in our object's meta (vs postmeta)
|
114 |
-
add_filter( 'update_post_metadata', array( 'dkrpt_Meta_Box_ajax', 'hijack_oembed_cache_set' ), 10, 4 );
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
$embed_args = '';
|
119 |
-
foreach ( $args['oembed_args'] as $key => $val ) {
|
120 |
-
$embed_args .= " $key=\"$val\"";
|
121 |
-
}
|
122 |
-
|
123 |
-
// ping WordPress for an embed
|
124 |
-
$check_embed = $wp_embed->run_shortcode( '[embed'. $embed_args .']'. $oembed_url .'[/embed]' );
|
125 |
-
|
126 |
-
// fallback that WordPress creates when no oEmbed was found
|
127 |
-
$fallback = $wp_embed->maybe_make_link( $oembed_url );
|
128 |
-
|
129 |
-
// Send back our embed
|
130 |
-
if ( $check_embed && $check_embed != $fallback )
|
131 |
-
return '<div class="embed_status">'. $check_embed .'<p class="dkrpt_remove_wrapper"><a href="#" class="dkrpt_remove_file_button" rel="'. $args['field_id'] .'">'. __( 'Remove Embed', 'dkrpt' ) .'</a></p></div>';
|
132 |
-
|
133 |
-
// Otherwise, send back error info that no oEmbeds were found
|
134 |
-
return '<p class="ui-state-error-text">'. sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'dkrpt' ), $fallback ) .' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Hijacks retrieving of cached oEmbed.
|
140 |
-
* Returns cached data from relevant object metadata (vs postmeta)
|
141 |
-
*
|
142 |
-
* @since 0.9.5
|
143 |
-
* @param boolean $check Whether to retrieve postmeta or override
|
144 |
-
* @param int $object_id Object ID
|
145 |
-
* @param string $meta_key Object metakey
|
146 |
-
* @return mixed Object's oEmbed cached data
|
147 |
-
*/
|
148 |
-
public static function hijack_oembed_cache_get( $check, $object_id, $meta_key ) {
|
149 |
-
|
150 |
-
if ( ! self::$hijack || ( self::$object_id != $object_id && 1987645321 !== $object_id ) )
|
151 |
-
return $check;
|
152 |
-
|
153 |
-
// get cached data
|
154 |
-
$data = 'options-page' === self::$object_type
|
155 |
-
? dkrpt_Meta_Box::get_option( self::$object_id, self::$embed_args['cache_key'] )
|
156 |
-
: get_metadata( self::$object_type, self::$object_id, $meta_key, true );
|
157 |
-
|
158 |
-
return $data;
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Hijacks saving of cached oEmbed.
|
163 |
-
* Saves cached data to relevant object metadata (vs postmeta)
|
164 |
-
*
|
165 |
-
* @since 0.9.5
|
166 |
-
* @param boolean $check Whether to continue setting postmeta
|
167 |
-
* @param int $object_id Object ID to get postmeta from
|
168 |
-
* @param string $meta_key Postmeta's key
|
169 |
-
* @param mixed $meta_value Value of the postmeta to be saved
|
170 |
-
* @return boolean Whether to continue setting
|
171 |
-
*/
|
172 |
-
public static function hijack_oembed_cache_set( $check, $object_id, $meta_key, $meta_value ) {
|
173 |
-
if ( ! self::$hijack || ( self::$object_id != $object_id && 1987645321 !== $object_id ) )
|
174 |
-
return $check;
|
175 |
-
|
176 |
-
// Cache the result to our metadata
|
177 |
-
if ( 'options-page' === self::$object_type ) {
|
178 |
-
// Set the option
|
179 |
-
dkrpt_Meta_Box::update_option( self::$object_id, self::$embed_args['cache_key'], $meta_value, array( 'type' => 'oembed' ) );
|
180 |
-
// Save the option
|
181 |
-
dkrpt_Meta_Box::save_option( self::$object_id );
|
182 |
-
} else {
|
183 |
-
update_metadata( self::$object_type, self::$object_id, $meta_key, $meta_value );
|
184 |
-
}
|
185 |
-
|
186 |
-
// Anything other than `null` to cancel saving to postmeta
|
187 |
-
return true;
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Helper to send json encoded response to ajax
|
192 |
-
* @since 0.9.5
|
193 |
-
* @param string $data Data to be shown via ajax
|
194 |
-
* @param boolean $success Success or fail
|
195 |
-
*/
|
196 |
-
public static function send_result( $data, $success = true ) {
|
197 |
-
$found = $success ? 'found' : 'not found';
|
198 |
-
// send back our encoded data
|
199 |
-
echo json_encode( array( 'result' => $data, 'id' => $found ) );
|
200 |
-
die();
|
201 |
-
}
|
202 |
-
|
203 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/helpers/dkrpt_Meta_Box_field.php
DELETED
@@ -1,497 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* dkrpt field class
|
5 |
-
* @since 1.1.0
|
6 |
-
*/
|
7 |
-
class dkrpt_Meta_Box_field {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Metabox object id
|
11 |
-
* @var mixed
|
12 |
-
* @since 1.1.0
|
13 |
-
*/
|
14 |
-
public $object_id;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Metabox object type
|
18 |
-
* @var mixed
|
19 |
-
* @since 1.1.0
|
20 |
-
*/
|
21 |
-
public $object_type;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Field arguments
|
25 |
-
* @var mixed
|
26 |
-
* @since 1.1.0
|
27 |
-
*/
|
28 |
-
public $args;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Field group object
|
32 |
-
* @var mixed
|
33 |
-
* @since 1.1.0
|
34 |
-
*/
|
35 |
-
public $group;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Field meta value
|
39 |
-
* @var mixed
|
40 |
-
* @since 1.1.0
|
41 |
-
*/
|
42 |
-
public $value;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Constructs our field object
|
46 |
-
* @since 1.1.0
|
47 |
-
* @param array $field_args Field arguments
|
48 |
-
* @param array $group_field (optional) Group field object
|
49 |
-
*/
|
50 |
-
public function __construct( $field_args, $group_field = null ) {
|
51 |
-
$this->object_id = dkrpt_Meta_Box::get_object_id();
|
52 |
-
$this->object_type = dkrpt_Meta_Box::get_object_type();
|
53 |
-
$this->group = ! empty( $group_field ) ? $group_field : false;
|
54 |
-
$this->args = $this->_set_field_defaults( $field_args );
|
55 |
-
|
56 |
-
// Allow an override for the field's value
|
57 |
-
// (assuming no one would want to save 'dkrpt_no_override_val' as a value)
|
58 |
-
$this->value = apply_filters( 'dkrpt_override_meta_value', 'dkrpt_no_override_val', $this->object_id, $this->args(), $this->object_type, $this );
|
59 |
-
|
60 |
-
// If no override, get our meta
|
61 |
-
$this->value = 'dkrpt_no_override_val' === $this->value
|
62 |
-
? $this->get_data()
|
63 |
-
: $this->value;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Non-existent methods fallback to checking for field arguments of the same name
|
68 |
-
* @since 1.1.0
|
69 |
-
* @param string $name Method name
|
70 |
-
* @param array $arguments Array of passed-in arguments
|
71 |
-
* @return mixed Value of field argument
|
72 |
-
*/
|
73 |
-
public function __call( $name, $arguments ) {
|
74 |
-
$key = isset( $arguments[0] ) ? $arguments[0] : false;
|
75 |
-
return $this->args( $name, $key );
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Retrieves the field id
|
80 |
-
* @since 1.1.0
|
81 |
-
* @param boolean $raw Whether to retrieve pre-modidifed id
|
82 |
-
* @return string Field id
|
83 |
-
*/
|
84 |
-
public function id( $raw = false ) {
|
85 |
-
$id = $raw ? '_id' : 'id';
|
86 |
-
return $this->args( $id );
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Get a field argument
|
91 |
-
* @since 1.1.0
|
92 |
-
* @param string $key Argument to check
|
93 |
-
* @param string $key Sub argument to check
|
94 |
-
* @return mixed Argument value or false if non-existent
|
95 |
-
*/
|
96 |
-
public function args( $key = '', $_key = '' ) {
|
97 |
-
$vars = $this->_data( 'args', $key );
|
98 |
-
if ( $_key ) {
|
99 |
-
return isset( $vars[ $_key ] ) ? $vars[ $_key ] : false;
|
100 |
-
}
|
101 |
-
return $vars;
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Get Field's value
|
106 |
-
* @since 1.1.0
|
107 |
-
* @param string $key If value is an array, is used to get array key->value
|
108 |
-
* @return mixed Field value or false if non-existent
|
109 |
-
*/
|
110 |
-
public function value( $key = '' ) {
|
111 |
-
return $this->_data( 'value', $key );
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Retrieve a portion of a field property
|
116 |
-
* @since 1.1.0
|
117 |
-
* @param string $var Field property to check
|
118 |
-
* @param string $key Field property array key to check
|
119 |
-
* @return mixed Queried property value or false
|
120 |
-
*/
|
121 |
-
public function _data( $var, $key = '' ) {
|
122 |
-
$vars = $this->$var;
|
123 |
-
if ( $key ) {
|
124 |
-
return isset( $vars[ $key ] ) ? $vars[ $key ] : false;
|
125 |
-
}
|
126 |
-
return $vars;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Retrieves metadata/option data
|
131 |
-
* @since 1.0.1
|
132 |
-
* @param string $field_id Meta key/Option array key
|
133 |
-
* @return mixed Meta/Option value
|
134 |
-
*/
|
135 |
-
public function get_data( $field_id = '', $args = array() ) {
|
136 |
-
if ( $field_id ) {
|
137 |
-
$args['field_id'] = $field_id;
|
138 |
-
} else if ( $this->group ) {
|
139 |
-
$args['field_id'] = $this->group->id();
|
140 |
-
}
|
141 |
-
extract( $this->data_args( $args ) );
|
142 |
-
|
143 |
-
$data = 'options-page' === $type
|
144 |
-
? dkrpt_Meta_Box::get_option( $id, $field_id )
|
145 |
-
: get_metadata( $type, $id, $field_id, ( $single || $repeat ) /* If multicheck this can be multiple values */ );
|
146 |
-
|
147 |
-
if ( $this->group && $data ) {
|
148 |
-
$data = isset( $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ] )
|
149 |
-
? $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ]
|
150 |
-
: false;
|
151 |
-
}
|
152 |
-
return $data;
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Updates metadata/option data
|
157 |
-
* @since 1.0.1
|
158 |
-
* @param mixed $value Value to update data with
|
159 |
-
* @param bool $single Whether data is an array (add_metadata)
|
160 |
-
*/
|
161 |
-
public function update_data( $new_value, $single = true ) {
|
162 |
-
extract( $this->data_args( array( 'new_value' => $new_value, 'single' => $single ) ) );
|
163 |
-
|
164 |
-
$new_value = $repeat ? array_values( $new_value ) : $new_value;
|
165 |
-
|
166 |
-
if ( 'options-page' === $type )
|
167 |
-
return dkrpt_Meta_Box::update_option( $id, $field_id, $new_value, $single );
|
168 |
-
|
169 |
-
if ( ! $single )
|
170 |
-
return add_metadata( $type, $id, $field_id, $new_value, false );
|
171 |
-
|
172 |
-
return update_metadata( $type, $id, $field_id, $new_value );
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Removes/updates metadata/option data
|
177 |
-
* @since 1.0.1
|
178 |
-
* @param string $old Old value
|
179 |
-
*/
|
180 |
-
public function remove_data( $old = '' ) {
|
181 |
-
extract( $this->data_args() );
|
182 |
-
|
183 |
-
return 'options-page' === $type
|
184 |
-
? dkrpt_Meta_Box::remove_option( $id, $field_id )
|
185 |
-
: delete_metadata( $type, $id, $field_id, $old );
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* data variables for get/set data methods
|
190 |
-
* @since 1.1.0
|
191 |
-
* @param array $args Override arguments
|
192 |
-
* @return array Updated arguments
|
193 |
-
*/
|
194 |
-
public function data_args( $args = array() ) {
|
195 |
-
$args = wp_parse_args( $args, array(
|
196 |
-
'type' => $this->object_type,
|
197 |
-
'id' => $this->object_id,
|
198 |
-
'field_id' => $this->id( true ),
|
199 |
-
'repeat' => $this->args( 'repeatable' ),
|
200 |
-
'single' => ! $this->args( 'multiple' ),
|
201 |
-
) );
|
202 |
-
return $args;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Checks if field has a registered validation callback
|
207 |
-
* @since 1.0.1
|
208 |
-
* @param mixed $meta_value Meta value
|
209 |
-
* @return mixed Possibly validated meta value
|
210 |
-
*/
|
211 |
-
public function sanitization_cb( $meta_value ) {
|
212 |
-
if ( empty( $meta_value ) )
|
213 |
-
return $meta_value;
|
214 |
-
|
215 |
-
// Check if the field has a registered validation callback
|
216 |
-
$cb = $this->maybe_callback( 'sanitization_cb' );
|
217 |
-
if ( false === $cb ) {
|
218 |
-
// If requestion NO validation, return meta value
|
219 |
-
return $meta_value;
|
220 |
-
} elseif ( $cb ) {
|
221 |
-
// Ok, callback is good, let's run it.
|
222 |
-
return call_user_func( $cb, $meta_value, $this->args(), $this );
|
223 |
-
}
|
224 |
-
|
225 |
-
$clean = new dkrpt_Meta_Box_Sanitize( $this, $meta_value );
|
226 |
-
// Validation via 'dkrpt_Meta_Box_Sanitize' (with fallback filter)
|
227 |
-
return $clean->{$this->type()}( $meta_value );
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Checks if field has a callback value
|
232 |
-
* @since 1.0.1
|
233 |
-
* @param string $cb Callback string
|
234 |
-
* @return mixed NULL, false for NO validation, or $cb string if it exists.
|
235 |
-
*/
|
236 |
-
public function maybe_callback( $cb ) {
|
237 |
-
$field_args = $this->args();
|
238 |
-
if ( ! isset( $field_args[ $cb ] ) )
|
239 |
-
return;
|
240 |
-
|
241 |
-
// Check if metabox is requesting NO validation
|
242 |
-
$cb = false !== $field_args[ $cb ] && 'false' !== $field_args[ $cb ] ? $field_args[ $cb ] : false;
|
243 |
-
|
244 |
-
// If requestion NO validation, return false
|
245 |
-
if ( ! $cb )
|
246 |
-
return false;
|
247 |
-
|
248 |
-
if ( is_callable( $cb ) )
|
249 |
-
return $cb;
|
250 |
-
}
|
251 |
-
|
252 |
-
/**
|
253 |
-
* Determine if current type is excempt from escaping
|
254 |
-
* @since 1.1.0
|
255 |
-
* @return bool True if exempt
|
256 |
-
*/
|
257 |
-
public function escaping_exception() {
|
258 |
-
// These types cannot be escaped
|
259 |
-
return in_array( $this->type(), array(
|
260 |
-
'file_list',
|
261 |
-
'multicheck',
|
262 |
-
'text_datetime_timestamp_timezone',
|
263 |
-
) );
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Determine if current type cannot be repeatable
|
268 |
-
* @since 1.1.0
|
269 |
-
* @param string $type Field type to check
|
270 |
-
* @return bool True if type cannot be repeatable
|
271 |
-
*/
|
272 |
-
public function repeatable_exception( $type ) {
|
273 |
-
// These types cannot be escaped
|
274 |
-
return in_array( $type, array(
|
275 |
-
'file', // Use file_list
|
276 |
-
'radio',
|
277 |
-
'title',
|
278 |
-
'group',
|
279 |
-
// @todo Ajax load wp_editor: http://wordpress.stackexchange.com/questions/51776/how-to-load-wp-editor-through-ajax-jquery
|
280 |
-
'wysiwyg',
|
281 |
-
'checkbox',
|
282 |
-
'radio_inline',
|
283 |
-
'taxonomy_radio',
|
284 |
-
'taxonomy_select',
|
285 |
-
'taxonomy_multicheck',
|
286 |
-
) );
|
287 |
-
}
|
288 |
-
|
289 |
-
/**
|
290 |
-
* Escape the value before output. Defaults to 'esc_attr()'
|
291 |
-
* @since 1.0.1
|
292 |
-
* @param mixed $meta_value Meta value
|
293 |
-
* @param mixed $func Escaping function (if not esc_attr())
|
294 |
-
* @return mixed Final value
|
295 |
-
*/
|
296 |
-
public function escaped_value( $func = 'esc_attr', $meta_value = '' ) {
|
297 |
-
|
298 |
-
if ( isset( $this->escaped_value ) )
|
299 |
-
return $this->escaped_value;
|
300 |
-
|
301 |
-
$meta_value = $meta_value ? $meta_value : $this->value();
|
302 |
-
// Check if the field has a registered escaping callback
|
303 |
-
$cb = $this->maybe_callback( 'escape_cb' );
|
304 |
-
if ( false === $cb || $this->escaping_exception() ) {
|
305 |
-
// If requesting NO escaping, return meta value
|
306 |
-
return ! empty( $meta_value ) ? $meta_value : $this->args( 'default' );
|
307 |
-
} elseif ( $cb ) {
|
308 |
-
// Ok, callback is good, let's run it.
|
309 |
-
return call_user_func( $cb, $meta_value, $this->args(), $this );
|
310 |
-
}
|
311 |
-
|
312 |
-
// Or custom escaping filter can be used
|
313 |
-
$esc = apply_filters( 'dkrpt_types_esc_'. $this->type(), null, $meta_value, $this->args(), $this );
|
314 |
-
if ( null !== $esc ) {
|
315 |
-
return $esc;
|
316 |
-
}
|
317 |
-
|
318 |
-
// escaping function passed in?
|
319 |
-
$func = $func ? $func : 'esc_attr';
|
320 |
-
$meta_value = ! empty( $meta_value ) ? $meta_value : $this->args( 'default' );
|
321 |
-
|
322 |
-
if ( is_array( $meta_value ) ) {
|
323 |
-
foreach ( $meta_value as $key => $value ) {
|
324 |
-
$meta_value[ $key ] = call_user_func( $func, $value );
|
325 |
-
}
|
326 |
-
} else {
|
327 |
-
$meta_value = call_user_func( $func, $meta_value );
|
328 |
-
}
|
329 |
-
|
330 |
-
$this->escaped_value = $meta_value;
|
331 |
-
return $this->escaped_value;
|
332 |
-
}
|
333 |
-
|
334 |
-
/**
|
335 |
-
* Offset a time value based on timezone
|
336 |
-
* @since 1.0.0
|
337 |
-
* @return string Offset time string
|
338 |
-
*/
|
339 |
-
public function field_timezone_offset() {
|
340 |
-
return dkrpt_Meta_Box::timezone_offset( $this->field_timezone() );
|
341 |
-
}
|
342 |
-
|
343 |
-
/**
|
344 |
-
* Return timezone string
|
345 |
-
* @since 1.0.0
|
346 |
-
* @return string Timezone string
|
347 |
-
*/
|
348 |
-
public function field_timezone() {
|
349 |
-
|
350 |
-
// Is timezone arg set?
|
351 |
-
if ( $this->args( 'timezone' ) ) {
|
352 |
-
return $this->args( 'timezone' ) ;
|
353 |
-
}
|
354 |
-
// Is there another meta key with a timezone stored as its value we should use?
|
355 |
-
else if ( $this->args( 'timezone_meta_key' ) ) {
|
356 |
-
return $this->get_data( $this->args( 'timezone_meta_key' ) );
|
357 |
-
}
|
358 |
-
|
359 |
-
return false;
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Render a field row
|
364 |
-
* @since 1.0.0
|
365 |
-
*/
|
366 |
-
public function render_field() {
|
367 |
-
|
368 |
-
// If field is requesting to not be shown on the front-end
|
369 |
-
if ( ! is_admin() && ! $this->args( 'on_front' ) )
|
370 |
-
return;
|
371 |
-
|
372 |
-
// If field is requesting to be conditionally shown
|
373 |
-
if ( is_callable( $this->args( 'show_on_cb' ) ) && ! call_user_func( $this->args( 'show_on_cb' ), $this ) )
|
374 |
-
return;
|
375 |
-
|
376 |
-
$classes = 'dkrpt-type-'. sanitize_html_class( $this->type() );
|
377 |
-
$classes .= ' dkrpt_id_'. sanitize_html_class( $this->id() );
|
378 |
-
$classes .= $this->args( 'repeatable' ) ? ' dkrpt-repeat' : '';
|
379 |
-
// 'inline' flag, or _inline in the field type, set to true
|
380 |
-
$classes .= $this->args( 'inline' ) ? ' dkrpt-inline' : '';
|
381 |
-
$is_side = 'side' === $this->args( 'context' );
|
382 |
-
|
383 |
-
printf( "<tr class=\"%s\">\n", $classes );
|
384 |
-
|
385 |
-
if ( 'title' == $this->type() || ! $this->args( 'show_names' ) || $is_side ) {
|
386 |
-
echo "\t<td colspan=\"2\">\n";
|
387 |
-
|
388 |
-
if ( ! $this->args( 'show_names' ) || $is_side ) {
|
389 |
-
$style = ! $is_side || 'title' == $this->type() ? ' style="display:none;"' : '';
|
390 |
-
printf( "\n<label%s for=\"%s\">%s</label>\n", $style, $this->id(), $this->args( 'name' ) );
|
391 |
-
}
|
392 |
-
} else {
|
393 |
-
|
394 |
-
$style = 'post' == $this->object_type ? ' style="width:18%"' : '';
|
395 |
-
// $tag = 'side' !== $this->args( 'context' ) ? 'th' : 'p';
|
396 |
-
$tag = 'th';
|
397 |
-
printf( '<%1$s%2$s><label for="%3$s">%4$s</label></%1$s>', $tag, $style, $this->id(), $this->args( 'name' ) );
|
398 |
-
|
399 |
-
echo "\n\t<td>\n";
|
400 |
-
}
|
401 |
-
|
402 |
-
echo $this->args( 'before' );
|
403 |
-
|
404 |
-
$this_type = new dkrpt_Meta_Box_types( $this );
|
405 |
-
$this_type->render();
|
406 |
-
|
407 |
-
echo $this->args( 'after' );
|
408 |
-
|
409 |
-
echo "\n\t</td>\n</tr>";
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Replaces a hash key - {#} - with the repeatable count
|
414 |
-
* @since 1.2.0
|
415 |
-
* @param string $value Value to update
|
416 |
-
* @return string Updated value
|
417 |
-
*/
|
418 |
-
public function replace_hash( $value ) {
|
419 |
-
// Replace hash with 1 based count
|
420 |
-
return str_ireplace( '{#}', ( $this->count() + 1 ), $value );
|
421 |
-
}
|
422 |
-
|
423 |
-
/**
|
424 |
-
* Fills in empty field parameters with defaults
|
425 |
-
* @since 1.1.0
|
426 |
-
* @param array $args Metabox field config array
|
427 |
-
*/
|
428 |
-
public function _set_field_defaults( $args ) {
|
429 |
-
|
430 |
-
// Set up blank or default values for empty ones
|
431 |
-
if ( ! isset( $args['name'] ) ) $args['name'] = '';
|
432 |
-
if ( ! isset( $args['desc'] ) ) $args['desc'] = '';
|
433 |
-
if ( ! isset( $args['before'] ) ) $args['before'] = '';
|
434 |
-
if ( ! isset( $args['after'] ) ) $args['after'] = '';
|
435 |
-
if ( ! isset( $args['protocols'] ) ) $args['protocols'] = null;
|
436 |
-
if ( ! isset( $args['description'] ) ) {
|
437 |
-
$args['description'] = isset( $args['desc'] ) ? $args['desc'] : '';
|
438 |
-
}
|
439 |
-
if ( ! isset( $args['default'] ) ) {
|
440 |
-
// Phase out 'std', and use 'default' instead
|
441 |
-
$args['default'] = isset( $args['std'] ) ? $args['std'] : '';
|
442 |
-
}
|
443 |
-
if ( ! isset( $args['preview_size'] ) ) $args['preview_size'] = array( 50, 50 );
|
444 |
-
if ( ! isset( $args['date_format'] ) ) $args['date_format'] = 'm\/d\/Y';
|
445 |
-
if ( ! isset( $args['time_format'] ) ) $args['time_format'] = 'h:i A';
|
446 |
-
// Allow a filter override of the default value
|
447 |
-
$args['default'] = apply_filters( 'dkrpt_default_filter', $args['default'], $args, $this->object_type, $this->object_type );
|
448 |
-
$args['allow'] = 'file' == $args['type'] && ! isset( $args['allow'] ) ? array( 'url', 'attachment' ) : array();
|
449 |
-
$args['save_id'] = 'file' == $args['type'] && ! ( isset( $args['save_id'] ) && ! $args['save_id'] );
|
450 |
-
// $args['multiple'] = isset( $args['multiple'] ) ? $args['multiple'] : ( 'multicheck' == $args['type'] ? true : false );
|
451 |
-
$args['multiple'] = isset( $args['multiple'] ) ? $args['multiple'] : false;
|
452 |
-
$args['repeatable'] = isset( $args['repeatable'] ) && $args['repeatable'] && ! $this->repeatable_exception( $args['type'] );
|
453 |
-
$args['inline'] = isset( $args['inline'] ) && $args['inline'] || false !== stripos( $args['type'], '_inline' );
|
454 |
-
$args['on_front'] = ! ( isset( $args['on_front'] ) && ! $args['on_front'] );
|
455 |
-
$args['attributes'] = isset( $args['attributes'] ) && is_array( $args['attributes'] ) ? $args['attributes'] : array();
|
456 |
-
$args['options'] = isset( $args['options'] ) && is_array( $args['options'] ) ? $args['options'] : array();
|
457 |
-
|
458 |
-
$args['options'] = 'group' == $args['type'] ? wp_parse_args( $args['options'], array(
|
459 |
-
'add_button' => __( 'Add Group', 'dkrpt' ),
|
460 |
-
'remove_button' => __( 'Remove Group', 'dkrpt' ),
|
461 |
-
) ) : $args['options'];
|
462 |
-
|
463 |
-
$args['_id'] = $args['id'];
|
464 |
-
$args['_name'] = $args['id'];
|
465 |
-
|
466 |
-
if ( $this->group ) {
|
467 |
-
$args['id'] = $this->group->args( 'id' ) .'_'. $this->group->args( 'count' ) .'_'. $args['id'];
|
468 |
-
$args['_name'] = $this->group->args( 'id' ) .'['. $this->group->args( 'count' ) .']['. $args['_name'] .']';
|
469 |
-
}
|
470 |
-
|
471 |
-
if ( 'wysiwyg' == $args['type'] ) {
|
472 |
-
$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );
|
473 |
-
$args['options']['textarea_name'] = $args['_name'];
|
474 |
-
}
|
475 |
-
|
476 |
-
$option_types = array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' );
|
477 |
-
if ( in_array( $args['type'], $option_types, true ) ) {
|
478 |
-
|
479 |
-
// @todo implemention
|
480 |
-
$args['show_option_all'] = isset( $args['show_option_all'] ) && ! $args['show_option_all'] ? false : true;
|
481 |
-
$args['show_option_none'] = isset( $args['show_option_none'] ) && ! $args['show_option_none'] ? false : true;
|
482 |
-
|
483 |
-
}
|
484 |
-
|
485 |
-
return $args;
|
486 |
-
}
|
487 |
-
|
488 |
-
/**
|
489 |
-
* Updates attributes array values unless they exist from the field config array
|
490 |
-
* @since 1.1.0
|
491 |
-
* @param array $attrs Array of attributes to update
|
492 |
-
*/
|
493 |
-
public function maybe_set_attributes( $attrs = array() ) {
|
494 |
-
return wp_parse_args( $this->args['attributes'], $attrs );
|
495 |
-
}
|
496 |
-
|
497 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/helpers/dkrpt_Meta_Box_types.php
DELETED
@@ -1,794 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* dkrpt field types
|
5 |
-
*
|
6 |
-
* @todo test taxonomy methods with non-post objects
|
7 |
-
* @todo test all methods with non-post objects
|
8 |
-
* @todo Date/Time fields should store date format as data attribute for JS
|
9 |
-
*
|
10 |
-
* @since 1.0.0
|
11 |
-
*/
|
12 |
-
class dkrpt_Meta_Box_types {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* An iterator value for repeatable fields
|
16 |
-
* @var integer
|
17 |
-
* @since 1.0.0
|
18 |
-
*/
|
19 |
-
public $iterator = 0;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Current field
|
23 |
-
* @var array
|
24 |
-
* @since 1.0.0
|
25 |
-
*/
|
26 |
-
public $field;
|
27 |
-
|
28 |
-
public function __construct( $field ) {
|
29 |
-
$this->field = $field;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Default fallback. Allows rendering fields via "dkrpt_render_$name" hook
|
34 |
-
* @since 1.0.0
|
35 |
-
* @param string $name Non-existent method name
|
36 |
-
* @param array $arguments All arguments passed to the method
|
37 |
-
*/
|
38 |
-
public function __call( $name, $arguments ) {
|
39 |
-
// When a non-registered field is called, send it through an action.
|
40 |
-
do_action( "dkrpt_render_$name", $this->field->args(), $this->field->escaped_value(), $this->field->object_id, $this->field->object_type, $this );
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Render a field (and handle repeatable)
|
45 |
-
* @since 1.1.0
|
46 |
-
*/
|
47 |
-
public function render() {
|
48 |
-
if ( $this->field->args( 'repeatable' ) ) {
|
49 |
-
$this->render_repeatable_field();
|
50 |
-
} else {
|
51 |
-
$this->_render();
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Render a field type
|
57 |
-
* @since 1.1.0
|
58 |
-
*/
|
59 |
-
protected function _render() {
|
60 |
-
echo $this->{$this->field->type()}();
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Checks if we can get a post object, and if so, uses `get_the_terms` which utilizes caching
|
65 |
-
* @since 1.0.2
|
66 |
-
* @return mixed Array of terms on success
|
67 |
-
*/
|
68 |
-
public function get_object_terms() {
|
69 |
-
$object_id = $this->field->object_id;
|
70 |
-
$taxonomy = $this->field->args( 'taxonomy' );
|
71 |
-
|
72 |
-
if ( ! $post = get_post( $object_id ) ) {
|
73 |
-
|
74 |
-
$cache_key = 'dkrpt-cache-'. $taxonomy .'-'. $object_id;
|
75 |
-
|
76 |
-
// Check cache
|
77 |
-
$cached = $test = get_transient( $cache_key );
|
78 |
-
if ( $cached )
|
79 |
-
return $cached;
|
80 |
-
|
81 |
-
$cached = wp_get_object_terms( $object_id, $taxonomy );
|
82 |
-
// Do our own (minimal) caching. Long enough for a page-load.
|
83 |
-
$set = set_transient( $cache_key, $cached, 60 );
|
84 |
-
return $cached;
|
85 |
-
}
|
86 |
-
|
87 |
-
// WP caches internally so it's better to use
|
88 |
-
return get_the_terms( $post, $taxonomy );
|
89 |
-
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Determine a file's extension
|
94 |
-
* @since 1.0.0
|
95 |
-
* @param string $file File url
|
96 |
-
* @return string|false File extension or false
|
97 |
-
*/
|
98 |
-
public function get_file_ext( $file ) {
|
99 |
-
$parsed = @parse_url( $file, PHP_URL_PATH );
|
100 |
-
return $parsed ? strtolower( pathinfo( $parsed, PATHINFO_EXTENSION ) ) : false;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Determines if a file has a valid image extension
|
105 |
-
* @since 1.0.0
|
106 |
-
* @param string $file File url
|
107 |
-
* @return bool Whether file has a valid image extension
|
108 |
-
*/
|
109 |
-
public function is_valid_img_ext( $file ) {
|
110 |
-
$file_ext = $this->get_file_ext( $file );
|
111 |
-
|
112 |
-
$this->valid = empty( $this->valid )
|
113 |
-
? (array) apply_filters( 'dkrpt_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) )
|
114 |
-
: $this->valid;
|
115 |
-
|
116 |
-
return ( $file_ext && in_array( $file_ext, $this->valid ) );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Handles parsing and filtering attributes while preserving any passed in via field config.
|
121 |
-
* @since 1.1.0
|
122 |
-
* @param array $args Override arguments
|
123 |
-
* @param string $element Element for filter
|
124 |
-
* @param array $defaults Default arguments
|
125 |
-
* @return array Parsed and filtered arguments
|
126 |
-
*/
|
127 |
-
public function parse_args( $args, $element, $defaults ) {
|
128 |
-
return wp_parse_args( apply_filters( "dkrpt_{$element}_attributes", $this->field->maybe_set_attributes( $args ), $this->field, $this ), $defaults );
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Combines attributes into a string for a form element
|
133 |
-
* @since 1.1.0
|
134 |
-
* @param array $attrs Attributes to concatenate
|
135 |
-
* @param array $attr_exclude Attributes that should NOT be concatenated
|
136 |
-
* @return string String of attributes for form element
|
137 |
-
*/
|
138 |
-
public function concat_attrs( $attrs, $attr_exclude = array() ) {
|
139 |
-
$attributes = '';
|
140 |
-
foreach ( $attrs as $attr => $val ) {
|
141 |
-
if ( ! in_array( $attr, (array) $attr_exclude, true ) )
|
142 |
-
$attributes .= sprintf( ' %s="%s"', $attr, $val );
|
143 |
-
}
|
144 |
-
return $attributes;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Generates html for an option element
|
149 |
-
* @since 1.1.0
|
150 |
-
* @param string $opt_label Option label
|
151 |
-
* @param string $opt_value Option value
|
152 |
-
* @param mixed $selected Selected attribute if option is selected
|
153 |
-
* @return string Generated option element html
|
154 |
-
*/
|
155 |
-
public function option( $opt_label, $opt_value, $selected ) {
|
156 |
-
return sprintf( "\t".'<option value="%s" %s>%s</option>', $opt_value, selected( $selected, true, false ), $opt_label )."\n";
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Generates options html
|
161 |
-
* @since 1.1.0
|
162 |
-
* @param array $args Optional arguments
|
163 |
-
* @param string $method Method to generate individual option item
|
164 |
-
* @return string Concatenated html options
|
165 |
-
*/
|
166 |
-
public function concat_options( $args = array(), $method = 'list_input' ) {
|
167 |
-
|
168 |
-
$options = (array) $this->field->args( 'options' );
|
169 |
-
$saved_value = $this->field->escaped_value();
|
170 |
-
$value = $saved_value ? $saved_value : $this->field->args( 'default' );
|
171 |
-
|
172 |
-
$_options = ''; $i = 1;
|
173 |
-
foreach ( $options as $option_key => $option ) {
|
174 |
-
|
175 |
-
// Check for the "old" way
|
176 |
-
$opt_label = is_array( $option ) && array_key_exists( 'name', $option ) ? $option['name'] : $option;
|
177 |
-
$opt_value = is_array( $option ) && array_key_exists( 'value', $option ) ? $option['value'] : $option_key;
|
178 |
-
// Check if this option is the value of the input
|
179 |
-
$is_current = $value == $opt_value;
|
180 |
-
|
181 |
-
if ( ! empty( $args ) ) {
|
182 |
-
// Clone args & modify for just this item
|
183 |
-
$this_args = $args;
|
184 |
-
$this_args['value'] = $opt_value;
|
185 |
-
$this_args['label'] = $opt_label;
|
186 |
-
if ( $is_current )
|
187 |
-
$this_args['checked'] = 'checked';
|
188 |
-
|
189 |
-
$_options .= $this->$method( $this_args, $i );
|
190 |
-
} else {
|
191 |
-
$_options .= $this->option( $opt_label, $opt_value, $is_current );
|
192 |
-
}
|
193 |
-
$i++;
|
194 |
-
}
|
195 |
-
return $_options;
|
196 |
-
}
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Generates html for list item with input
|
200 |
-
* @since 1.1.0
|
201 |
-
* @param array $args Override arguments
|
202 |
-
* @param int $i Iterator value
|
203 |
-
* @return string Gnerated list item html
|
204 |
-
*/
|
205 |
-
public function list_input( $args = array(), $i ) {
|
206 |
-
$args = $this->parse_args( $args, 'list_input', array(
|
207 |
-
'type' => 'radio',
|
208 |
-
'class' => 'dkrpt_option',
|
209 |
-
'name' => $this->_name(),
|
210 |
-
'id' => $this->_id( $i ),
|
211 |
-
'value' => $this->field->escaped_value(),
|
212 |
-
'label' => '',
|
213 |
-
) );
|
214 |
-
|
215 |
-
return sprintf( "\t".'<li><input%s/> <label for="%s">%s</label></li>'."\n", $this->concat_attrs( $args, 'label' ), $args['id'], $args['label'] );
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Generates html for list item with checkbox input
|
220 |
-
* @since 1.1.0
|
221 |
-
* @param array $args Override arguments
|
222 |
-
* @param int $i Iterator value
|
223 |
-
* @return string Gnerated list item html
|
224 |
-
*/
|
225 |
-
public function list_input_checkbox( $args, $i ) {
|
226 |
-
unset( $args['selected'] );
|
227 |
-
$saved_value = $this->field->escaped_value();
|
228 |
-
if ( is_array( $saved_value ) && in_array( $args['value'], $saved_value ) ) {
|
229 |
-
$args['checked'] = 'checked';
|
230 |
-
}
|
231 |
-
return $this->list_input( $args, $i );
|
232 |
-
}
|
233 |
-
|
234 |
-
/**
|
235 |
-
* Generates repeatable field table markup
|
236 |
-
* @since 1.0.0
|
237 |
-
*/
|
238 |
-
public function render_repeatable_field() {
|
239 |
-
$table_id = $this->field->id() .'_repeat';
|
240 |
-
|
241 |
-
$this->_desc( true, true );
|
242 |
-
?>
|
243 |
-
|
244 |
-
<table id="<?php echo $table_id; ?>" class="dkrpt-repeat-table">
|
245 |
-
<tbody>
|
246 |
-
<?php $this->repeatable_rows(); ?>
|
247 |
-
</tbody>
|
248 |
-
</table>
|
249 |
-
<p class="add-row">
|
250 |
-
<a data-selector="<?php echo $table_id; ?>" class="add-row-button button" href="#"><?php _e( 'Add Row', 'dkrpt' ); ?></a>
|
251 |
-
</p>
|
252 |
-
|
253 |
-
<?php
|
254 |
-
// reset iterator
|
255 |
-
$this->iterator = 0;
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Generates repeatable field rows
|
260 |
-
* @since 1.1.0
|
261 |
-
*/
|
262 |
-
public function repeatable_rows() {
|
263 |
-
$meta_value = $this->field->escaped_value();
|
264 |
-
// check for default content
|
265 |
-
$default = $this->field->args( 'default' );
|
266 |
-
|
267 |
-
// check for saved data
|
268 |
-
if ( ! empty( $meta_value ) ) {
|
269 |
-
$meta_value = is_array( $meta_value ) ? array_filter( $meta_value ) : $meta_value;
|
270 |
-
$meta_value = ! empty( $meta_value ) ? $meta_value : $default;
|
271 |
-
} else {
|
272 |
-
$meta_value = $default;
|
273 |
-
}
|
274 |
-
|
275 |
-
// Loop value array and add a row
|
276 |
-
if ( ! empty( $meta_value ) ) {
|
277 |
-
foreach ( (array) $meta_value as $val ) {
|
278 |
-
$this->field->escaped_value = $val;
|
279 |
-
$this->repeat_row();
|
280 |
-
$this->iterator++;
|
281 |
-
}
|
282 |
-
} else {
|
283 |
-
// Otherwise add one row
|
284 |
-
$this->repeat_row();
|
285 |
-
}
|
286 |
-
|
287 |
-
// Then add an empty row
|
288 |
-
$this->field->escaped_value = '';
|
289 |
-
$this->iterator = $this->iterator ? $this->iterator : 1;
|
290 |
-
$this->repeat_row( 'empty-row' );
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Generates a repeatable row's markup
|
295 |
-
* @since 1.1.0
|
296 |
-
* @param string $class Repeatable table row's class
|
297 |
-
*/
|
298 |
-
protected function repeat_row( $class = 'repeat-row' ) {
|
299 |
-
?>
|
300 |
-
|
301 |
-
<tr class="<?php echo $class; ?>">
|
302 |
-
<td>
|
303 |
-
<?php $this->_render(); ?>
|
304 |
-
</td>
|
305 |
-
<td class="remove-row">
|
306 |
-
<a class="button remove-row-button" href="#"><?php _e( 'Remove', 'dkrpt' ); ?></a>
|
307 |
-
</td>
|
308 |
-
</tr>
|
309 |
-
|
310 |
-
<?php
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Generates description markup
|
315 |
-
* @since 1.0.0
|
316 |
-
* @param boolean $paragraph Paragraph tag or span
|
317 |
-
* @param boolean $echo Whether to echo description or only return it
|
318 |
-
* @return string Field's description markup
|
319 |
-
*/
|
320 |
-
public function _desc( $paragraph = false, $echo = false ) {
|
321 |
-
// Prevent description from printing multiple times for repeatable fields
|
322 |
-
if ( $this->field->args( 'repeatable' ) || $this->iterator > 0 ) {
|
323 |
-
return '';
|
324 |
-
}
|
325 |
-
$tag = $paragraph ? 'p' : 'span';
|
326 |
-
$desc = "\n<$tag class=\"dkrpt_metabox_description\">{$this->field->args( 'description' )}</$tag>\n";
|
327 |
-
if ( $echo )
|
328 |
-
echo $desc;
|
329 |
-
return $desc;
|
330 |
-
}
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Generate field name attribute
|
334 |
-
* @since 1.1.0
|
335 |
-
* @param string $suffix For multi-part fields
|
336 |
-
* @return string Name attribute
|
337 |
-
*/
|
338 |
-
public function _name( $suffix = '' ) {
|
339 |
-
return $this->field->args( '_name' ) . ( $this->field->args( 'repeatable' ) ? '['. $this->iterator .']' : '' ) . $suffix;
|
340 |
-
}
|
341 |
-
|
342 |
-
/**
|
343 |
-
* Generate field id attribute
|
344 |
-
* @since 1.1.0
|
345 |
-
* @param string $suffix For multi-part fields
|
346 |
-
* @return string Id attribute
|
347 |
-
*/
|
348 |
-
public function _id( $suffix = '' ) {
|
349 |
-
return $this->field->id() . $suffix . ( $this->field->args( 'repeatable' ) ? '_'. $this->iterator .'" data-iterator="'. $this->iterator : '' );
|
350 |
-
}
|
351 |
-
|
352 |
-
/**
|
353 |
-
* Handles outputting an 'input' element
|
354 |
-
* @since 1.1.0
|
355 |
-
* @param array $args Override arguments
|
356 |
-
* @return string Form input element
|
357 |
-
*/
|
358 |
-
public function input( $args = array() ) {
|
359 |
-
$args = $this->parse_args( $args, 'input', array(
|
360 |
-
'type' => 'text',
|
361 |
-
'class' => 'regular-text',
|
362 |
-
'name' => $this->_name(),
|
363 |
-
'id' => $this->_id(),
|
364 |
-
'value' => $this->field->escaped_value(),
|
365 |
-
'desc' => $this->_desc( true ),
|
366 |
-
) );
|
367 |
-
|
368 |
-
return sprintf( '<input%s/>%s', $this->concat_attrs( $args, 'desc' ), $args['desc'] );
|
369 |
-
}
|
370 |
-
|
371 |
-
/**
|
372 |
-
* Handles outputting an 'textarea' element
|
373 |
-
* @since 1.1.0
|
374 |
-
* @param array $args Override arguments
|
375 |
-
* @return string Form textarea element
|
376 |
-
*/
|
377 |
-
public function textarea( $args = array() ) {
|
378 |
-
$args = $this->parse_args( $args, 'textarea', array(
|
379 |
-
'class' => 'dkrpt_textarea',
|
380 |
-
'name' => $this->_name(),
|
381 |
-
'id' => $this->_id(),
|
382 |
-
'cols' => 60,
|
383 |
-
'rows' => 10,
|
384 |
-
'value' => $this->field->escaped_value( 'esc_textarea' ),
|
385 |
-
'desc' => $this->_desc( true ),
|
386 |
-
) );
|
387 |
-
return sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $args, array( 'desc', 'value' ) ), $args['value'], $args['desc'] );
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Begin Field Types
|
392 |
-
*/
|
393 |
-
|
394 |
-
public function text() {
|
395 |
-
return $this->input();
|
396 |
-
}
|
397 |
-
|
398 |
-
public function text_small() {
|
399 |
-
return $this->input( array( 'class' => 'dkrpt_text_small', 'desc' => $this->_desc() ) );
|
400 |
-
}
|
401 |
-
|
402 |
-
public function text_medium() {
|
403 |
-
return $this->input( array( 'class' => 'dkrpt_text_medium', 'desc' => $this->_desc() ) );
|
404 |
-
}
|
405 |
-
|
406 |
-
public function text_email() {
|
407 |
-
return $this->input( array( 'class' => 'dkrpt_text_email dkrpt_text_medium', 'type' => 'email' ) );
|
408 |
-
}
|
409 |
-
|
410 |
-
public function text_url() {
|
411 |
-
return $this->input( array( 'class' => 'dkrpt_text_url dkrpt_text_medium regular-text', 'value' => $this->field->escaped_value( 'esc_url' ) ) );
|
412 |
-
}
|
413 |
-
|
414 |
-
public function text_date() {
|
415 |
-
return $this->input( array( 'class' => 'dkrpt_text_small dkrpt_datepicker', 'desc' => $this->_desc() ) );
|
416 |
-
}
|
417 |
-
|
418 |
-
public function text_time() {
|
419 |
-
return $this->input( array( 'class' => 'dkrpt_timepicker text_time', 'desc' => $this->_desc() ) );
|
420 |
-
}
|
421 |
-
|
422 |
-
public function text_money() {
|
423 |
-
return ( ! $this->field->args( 'before' ) ? '$ ' : ' ' ) . $this->input( array( 'class' => 'dkrpt_text_money', 'desc' => $this->_desc() ) );
|
424 |
-
}
|
425 |
-
|
426 |
-
public function textarea_small() {
|
427 |
-
return $this->textarea( array( 'class' => 'dkrpt_textarea_small', 'rows' => 4 ) );
|
428 |
-
}
|
429 |
-
|
430 |
-
public function textarea_code() {
|
431 |
-
return sprintf( '<pre>%s</pre>', $this->textarea( array( 'class' => 'dkrpt_textarea_code' ) ) );
|
432 |
-
}
|
433 |
-
|
434 |
-
public function wysiwyg( $args = array() ) {
|
435 |
-
extract( $this->parse_args( $args, 'input', array(
|
436 |
-
'id' => $this->_id(),
|
437 |
-
'value' => $this->field->escaped_value( 'stripslashes' ),
|
438 |
-
'desc' => $this->_desc( true ),
|
439 |
-
'options' => $this->field->args( 'options' ),
|
440 |
-
) ) );
|
441 |
-
|
442 |
-
wp_editor( $value, $id, $options );
|
443 |
-
echo $desc;
|
444 |
-
}
|
445 |
-
|
446 |
-
public function text_date_timestamp() {
|
447 |
-
$meta_value = $this->field->escaped_value();
|
448 |
-
$value = ! empty( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : '';
|
449 |
-
return $this->input( array( 'class' => 'dkrpt_text_small dkrpt_datepicker', 'value' => $value ) );
|
450 |
-
}
|
451 |
-
|
452 |
-
public function text_datetime_timestamp( $meta_value = '' ) {
|
453 |
-
$desc = '';
|
454 |
-
if ( ! $meta_value ) {
|
455 |
-
$meta_value = $this->field->escaped_value();
|
456 |
-
// This will be used if there is a select_timezone set for this field
|
457 |
-
$tz_offset = $this->field->field_timezone_offset();
|
458 |
-
if ( ! empty( $tz_offset ) ) {
|
459 |
-
$meta_value -= $tz_offset;
|
460 |
-
}
|
461 |
-
$desc = $this->_desc();
|
462 |
-
}
|
463 |
-
|
464 |
-
$inputs = array(
|
465 |
-
$this->input( array(
|
466 |
-
'class' => 'dkrpt_text_small dkrpt_datepicker',
|
467 |
-
'name' => $this->_name( '[date]' ),
|
468 |
-
'id' => $this->_id( '_date' ),
|
469 |
-
'value' => ! empty( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : '',
|
470 |
-
'desc' => '',
|
471 |
-
) ),
|
472 |
-
$this->input( array(
|
473 |
-
'class' => 'dkrpt_timepicker text_time',
|
474 |
-
'name' => $this->_name( '[time]' ),
|
475 |
-
'id' => $this->_id( '_time' ),
|
476 |
-
'value' => ! empty( $meta_value ) ? date( $this->field->args( 'time_format' ), $meta_value ) : '',
|
477 |
-
'desc' => $desc,
|
478 |
-
) )
|
479 |
-
);
|
480 |
-
|
481 |
-
return implode( "\n", $inputs );
|
482 |
-
}
|
483 |
-
|
484 |
-
public function text_datetime_timestamp_timezone() {
|
485 |
-
$meta_value = $this->field->escaped_value();
|
486 |
-
$datetime = unserialize( $meta_value );
|
487 |
-
$meta_value = $tzstring = false;
|
488 |
-
|
489 |
-
if ( $datetime && $datetime instanceof DateTime ) {
|
490 |
-
$tz = $datetime->getTimezone();
|
491 |
-
$tzstring = $tz->getName();
|
492 |
-
$meta_value = $datetime->getTimestamp() + $tz->getOffset( new DateTime( 'NOW' ) );
|
493 |
-
}
|
494 |
-
|
495 |
-
$inputs = $this->text_datetime_timestamp( $meta_value );
|
496 |
-
$inputs .= '<select name="'. $this->_name( '[timezone]' ) .'" id="'. $this->_id( '_timezone' ) .'">';
|
497 |
-
$inputs .= wp_timezone_choice( $tzstring );
|
498 |
-
$inputs .= '</select>'. $this->_desc();
|
499 |
-
|
500 |
-
return $inputs;
|
501 |
-
}
|
502 |
-
|
503 |
-
public function select_timezone() {
|
504 |
-
$this->field->args['default'] = $this->field->args( 'default' )
|
505 |
-
? $this->field->args( 'default' )
|
506 |
-
: dkrpt_Meta_Box::timezone_string();
|
507 |
-
|
508 |
-
$meta_value = $this->field->escaped_value();
|
509 |
-
|
510 |
-
return '<select name="'. $this->_name() .'" id="'. $this->_id() .'">'. wp_timezone_choice( $meta_value ) .'</select>';
|
511 |
-
}
|
512 |
-
|
513 |
-
public function colorpicker() {
|
514 |
-
$meta_value = $this->field->escaped_value();
|
515 |
-
$hex_color = '(([a-fA-F0-9]){3}){1,2}$';
|
516 |
-
if ( preg_match( '/^' . $hex_color . '/i', $meta_value ) ) // Value is just 123abc, so prepend #.
|
517 |
-
$meta_value = '#' . $meta_value;
|
518 |
-
elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta_value ) ) // Value doesn't match #123abc, so sanitize to just #.
|
519 |
-
$meta_value = "#";
|
520 |
-
|
521 |
-
return $this->input( array( 'class' => 'dkrpt_colorpicker dkrpt_text_small', 'value' => $meta_value ) );
|
522 |
-
}
|
523 |
-
|
524 |
-
public function title() {
|
525 |
-
extract( $this->parse_args( array(), 'title', array(
|
526 |
-
'tag' => $this->field->object_type == 'post' ? 'h5' : 'h3',
|
527 |
-
'class' => 'dkrpt_metabox_title',
|
528 |
-
'name' => $this->field->args( 'name' ),
|
529 |
-
'desc' => $this->_desc( true ),
|
530 |
-
) ) );
|
531 |
-
|
532 |
-
return sprintf( '<%1$s class="%2$s">%3$s</%1$s>%4$s', $tag, $class, $name, $desc );
|
533 |
-
}
|
534 |
-
|
535 |
-
public function select( $args = array() ) {
|
536 |
-
$args = $this->parse_args( $args, 'select', array(
|
537 |
-
'class' => 'dkrpt_select',
|
538 |
-
'name' => $this->_name(),
|
539 |
-
'id' => $this->_id(),
|
540 |
-
'desc' => $this->_desc( true ),
|
541 |
-
'options' => $this->concat_options(),
|
542 |
-
) );
|
543 |
-
|
544 |
-
$attrs = $this->concat_attrs( $args, array( 'desc', 'options' ) );
|
545 |
-
return sprintf( '<select%s>%s</select>%s', $attrs, $args['options'], $args['desc'] );
|
546 |
-
}
|
547 |
-
|
548 |
-
public function taxonomy_select() {
|
549 |
-
|
550 |
-
$names = $this->get_object_terms();
|
551 |
-
$saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[0]->slug;
|
552 |
-
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
553 |
-
$options = '';
|
554 |
-
|
555 |
-
foreach ( $terms as $term ) {
|
556 |
-
$selected = $saved_term == $term->slug;
|
557 |
-
$options .= $this->option( $term->name, $term->slug, $selected );
|
558 |
-
}
|
559 |
-
|
560 |
-
return $this->select( array( 'options' => $options ) );
|
561 |
-
}
|
562 |
-
|
563 |
-
public function radio( $args = array(), $type = 'radio' ) {
|
564 |
-
extract( $this->parse_args( $args, $type, array(
|
565 |
-
'class' => 'dkrpt_radio_list dkrpt_list',
|
566 |
-
'options' => $this->concat_options( array( 'label' => 'test' ) ),
|
567 |
-
'desc' => $this->_desc( true ),
|
568 |
-
) ) );
|
569 |
-
|
570 |
-
return sprintf( '<ul class="%s">%s</ul>%s', $class, $options, $desc );
|
571 |
-
}
|
572 |
-
|
573 |
-
public function radio_inline() {
|
574 |
-
return $this->radio( array(), 'radio_inline' );
|
575 |
-
}
|
576 |
-
|
577 |
-
public function multicheck( $type = 'checkbox' ) {
|
578 |
-
return $this->radio( array( 'class' => 'dkrpt_checkbox_list dkrpt_list', 'options' => $this->concat_options( array( 'type' => 'checkbox', 'name' => $this->_name() .'[]' ), 'list_input_checkbox' ) ), $type );
|
579 |
-
}
|
580 |
-
|
581 |
-
public function multicheck_inline() {
|
582 |
-
$this->multicheck( 'multicheck_inline' );
|
583 |
-
}
|
584 |
-
|
585 |
-
public function checkbox() {
|
586 |
-
$meta_value = $this->field->escaped_value();
|
587 |
-
$args = array( 'type' => 'checkbox', 'class' => 'dkrpt_option dkrpt_list', 'value' => 'on', 'desc' => '' );
|
588 |
-
if ( ! empty( $meta_value ) ) {
|
589 |
-
$args['checked'] = 'checked';
|
590 |
-
}
|
591 |
-
return sprintf( '%s <label for="%s">%s</label>', $this->input( $args ), $this->_id(), $this->_desc() );
|
592 |
-
}
|
593 |
-
|
594 |
-
public function taxonomy_radio() {
|
595 |
-
$names = $this->get_object_terms();
|
596 |
-
$saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[0]->slug;
|
597 |
-
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
598 |
-
$options = ''; $i = 1;
|
599 |
-
|
600 |
-
if ( ! $terms ) {
|
601 |
-
$options .= '<li><label>'. __( 'No terms', 'dkrpt' ) .'</label></li>';
|
602 |
-
} else {
|
603 |
-
foreach ( $terms as $term ) {
|
604 |
-
$args = array(
|
605 |
-
'value' => $term->slug,
|
606 |
-
'label' => $term->name,
|
607 |
-
);
|
608 |
-
|
609 |
-
if ( $saved_term == $term->slug ) {
|
610 |
-
$args['checked'] = 'checked';
|
611 |
-
}
|
612 |
-
$options .= $this->list_input( $args, $i );
|
613 |
-
$i++;
|
614 |
-
}
|
615 |
-
}
|
616 |
-
|
617 |
-
return $this->radio( array( 'options' => $options ), 'taxonomy_radio' );
|
618 |
-
}
|
619 |
-
|
620 |
-
public function taxonomy_radio_inline() {
|
621 |
-
$this->taxonomy_radio();
|
622 |
-
}
|
623 |
-
|
624 |
-
public function taxonomy_multicheck() {
|
625 |
-
|
626 |
-
$names = $this->get_object_terms();
|
627 |
-
$saved_terms = is_wp_error( $names ) || empty( $names )
|
628 |
-
? $this->field->args( 'default' )
|
629 |
-
: wp_list_pluck( $names, 'slug' );
|
630 |
-
$terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
|
631 |
-
$name = $this->_name() .'[]';
|
632 |
-
$options = ''; $i = 1;
|
633 |
-
|
634 |
-
if ( ! $terms ) {
|
635 |
-
$options .= '<li><label>'. __( 'No terms', 'dkrpt' ) .'</label></li>';
|
636 |
-
} else {
|
637 |
-
|
638 |
-
foreach ( $terms as $term ) {
|
639 |
-
$args = array(
|
640 |
-
'value' => $term->slug,
|
641 |
-
'label' => $term->name,
|
642 |
-
'type' => 'checkbox',
|
643 |
-
'name' => $name,
|
644 |
-
);
|
645 |
-
|
646 |
-
if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) {
|
647 |
-
$args['checked'] = 'checked';
|
648 |
-
}
|
649 |
-
$options .= $this->list_input( $args, $i );
|
650 |
-
$i++;
|
651 |
-
}
|
652 |
-
}
|
653 |
-
|
654 |
-
return $this->radio( array( 'class' => 'dkrpt_checkbox_list dkrpt_list', 'options' => $options ), 'taxonomy_multicheck' );
|
655 |
-
}
|
656 |
-
|
657 |
-
public function taxonomy_multicheck_inline() {
|
658 |
-
$this->taxonomy_multicheck();
|
659 |
-
}
|
660 |
-
|
661 |
-
public function file_list() {
|
662 |
-
$meta_value = $this->field->escaped_value();
|
663 |
-
|
664 |
-
$name = $this->_name();
|
665 |
-
|
666 |
-
echo $this->input( array(
|
667 |
-
'type' => 'hidden',
|
668 |
-
'class' => 'dkrpt_upload_file dkrpt_upload_list',
|
669 |
-
'size' => 45, 'desc' => '', 'value' => '',
|
670 |
-
) ),
|
671 |
-
$this->input( array(
|
672 |
-
'type' => 'button',
|
673 |
-
'class' => 'dkrpt_upload_button button dkrpt_upload_list',
|
674 |
-
'value' => __( 'Add or Upload File', 'dkrpt' ),
|
675 |
-
'name' => '', 'id' => '',
|
676 |
-
) );
|
677 |
-
|
678 |
-
echo '<ul id="', $this->_id( '_status' ) ,'" class="dkrpt_media_status attach_list">';
|
679 |
-
|
680 |
-
if ( $meta_value && is_array( $meta_value ) ) {
|
681 |
-
|
682 |
-
foreach ( $meta_value as $id => $fullurl ) {
|
683 |
-
$id_input = $this->input( array(
|
684 |
-
'type' => 'hidden',
|
685 |
-
'value' => $fullurl,
|
686 |
-
'name' => $name .'['. $id .']',
|
687 |
-
'id' => 'filelist-'. $id,
|
688 |
-
'desc' => '', 'class' => '',
|
689 |
-
) );
|
690 |
-
|
691 |
-
if ( $this->is_valid_img_ext( $fullurl ) ) {
|
692 |
-
echo
|
693 |
-
'<li class="img_status">',
|
694 |
-
wp_get_attachment_image( $id, $this->field->args( 'preview_size' ) ),
|
695 |
-
'<p class="dkrpt_remove_wrapper"><a href="#" class="dkrpt_remove_file_button">'. __( 'Remove Image', 'dkrpt' ) .'</a></p>
|
696 |
-
'. $id_input .'
|
697 |
-
</li>';
|
698 |
-
|
699 |
-
} else {
|
700 |
-
$parts = explode( '/', $fullurl );
|
701 |
-
for ( $i = 0; $i < count( $parts ); ++$i ) {
|
702 |
-
$title = $parts[$i];
|
703 |
-
}
|
704 |
-
echo
|
705 |
-
'<li>',
|
706 |
-
__( 'File:', 'dkrpt' ), ' <strong>', $title, '</strong> (<a href="', $fullurl, '" target="_blank" rel="external">'. __( 'Download', 'dkrpt' ) .'</a> / <a href="#" class="dkrpt_remove_file_button">'. __( 'Remove', 'dkrpt' ) .'</a>)
|
707 |
-
'. $id_input .'
|
708 |
-
</li>';
|
709 |
-
}
|
710 |
-
}
|
711 |
-
}
|
712 |
-
|
713 |
-
echo '</ul>';
|
714 |
-
}
|
715 |
-
|
716 |
-
public function file() {
|
717 |
-
$meta_value = $this->field->escaped_value();
|
718 |
-
$allow = $this->field->args( 'allow' );
|
719 |
-
$input_type = ( 'url' == $allow || ( is_array( $allow ) && in_array( 'url', $allow ) ) )
|
720 |
-
? 'text' : 'hidden';
|
721 |
-
|
722 |
-
echo $this->input( array(
|
723 |
-
'type' => $input_type,
|
724 |
-
'class' => 'dkrpt_upload_file',
|
725 |
-
'size' => 45,
|
726 |
-
'desc' => '',
|
727 |
-
) ),
|
728 |
-
'<input class="dkrpt_upload_button button" type="button" value="'. __( 'Add or Upload File', 'dkrpt' ) .'" />',
|
729 |
-
$this->_desc( true );
|
730 |
-
|
731 |
-
$cached_id = $this->_id();
|
732 |
-
// Reset field args for attachment ID
|
733 |
-
$args = $this->field->args();
|
734 |
-
$args['id'] = $args['_id'] . '_id';
|
735 |
-
unset( $args['_id'], $args['_name'] );
|
736 |
-
|
737 |
-
// And get new field object
|
738 |
-
$this->field = new dkrpt_Meta_Box_field( $args, $this->field->group );
|
739 |
-
|
740 |
-
// Get ID value
|
741 |
-
$_id_value = $this->field->escaped_value( 'absint' );
|
742 |
-
|
743 |
-
// If there is no ID saved yet, try to get it from the url
|
744 |
-
if ( $meta_value && ! $_id_value ) {
|
745 |
-
$_id_value = dkrpt_Meta_Box::image_id_from_url( esc_url_raw( $meta_value ) );
|
746 |
-
}
|
747 |
-
|
748 |
-
echo $this->input( array(
|
749 |
-
'type' => 'hidden',
|
750 |
-
'class' => 'dkrpt_upload_file_id',
|
751 |
-
'value' => $_id_value,
|
752 |
-
'desc' => '',
|
753 |
-
) ),
|
754 |
-
'<div id="', $this->_id( '_status' ) ,'" class="dkrpt_media_status">';
|
755 |
-
if ( ! empty( $meta_value ) ) {
|
756 |
-
|
757 |
-
if ( $this->is_valid_img_ext( $meta_value ) ) {
|
758 |
-
echo '<div class="img_status">';
|
759 |
-
echo '<img style="max-width: 350px; width: 100%; height: auto;" src="', $meta_value, '" alt="" />';
|
760 |
-
echo '<p class="dkrpt_remove_wrapper"><a href="#" class="dkrpt_remove_file_button" rel="', $cached_id, '">'. __( 'Remove Image', 'dkrpt' ) .'</a></p>';
|
761 |
-
echo '</div>';
|
762 |
-
} else {
|
763 |
-
// $file_ext = $this->get_file_ext( $meta_value );
|
764 |
-
$parts = explode( '/', $meta_value );
|
765 |
-
for ( $i = 0; $i < count( $parts ); ++$i ) {
|
766 |
-
$title = $parts[$i];
|
767 |
-
}
|
768 |
-
echo __( 'File:', 'dkrpt' ), ' <strong>', $title, '</strong> (<a href="', $meta_value, '" target="_blank" rel="external">'. __( 'Download', 'dkrpt' ) .'</a> / <a href="#" class="dkrpt_remove_file_button" rel="', $cached_id, '">'. __( 'Remove', 'dkrpt' ) .'</a>)';
|
769 |
-
}
|
770 |
-
}
|
771 |
-
echo '</div>';
|
772 |
-
}
|
773 |
-
|
774 |
-
public function oembed() {
|
775 |
-
echo $this->input( array(
|
776 |
-
'class' => 'dkrpt_oembed regular-text',
|
777 |
-
'data-objectid' => $this->field->object_id,
|
778 |
-
'data-objecttype' => $this->field->object_type
|
779 |
-
) ),
|
780 |
-
'<p class="dkrpt-spinner spinner" style="display:none;"><img src="'. admin_url( '/images/wpspin_light.gif' ) .'" alt="spinner"/></p>',
|
781 |
-
'<div id="',$this->_id( '_status' ) ,'" class="dkrpt_media_status ui-helper-clearfix embed_wrap">';
|
782 |
-
|
783 |
-
if ( $meta_value = $this->field->escaped_value() ) {
|
784 |
-
echo dkrpt_Meta_Box_ajax::get_oembed( $meta_value, $this->field->object_id, array(
|
785 |
-
'object_type' => $this->field->object_type,
|
786 |
-
'oembed_args' => array( 'width' => '640' ),
|
787 |
-
'field_id' => $this->_id(),
|
788 |
-
) );
|
789 |
-
}
|
790 |
-
|
791 |
-
echo '</div>';
|
792 |
-
}
|
793 |
-
|
794 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/init.php
DELETED
@@ -1,1187 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Script Name: Custom Metaboxes and Fields
|
4 |
-
Contributors: WebDevStudios (@webdevstudios / webdevstudios.com)
|
5 |
-
Justin Sternberg (@jtsternberg / dsgnwrks.pro)
|
6 |
-
Jared Atchison (@jaredatch / jaredatchison.com)
|
7 |
-
Bill Erickson (@billerickson / billerickson.net)
|
8 |
-
Andrew Norcross (@norcross / andrewnorcross.com)
|
9 |
-
Description: This will create metaboxes with custom fields that will blow your mind.
|
10 |
-
Version: 1.2.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Released under the GPL license
|
15 |
-
* http://www.opensource.org/licenses/gpl-license.php
|
16 |
-
*
|
17 |
-
* This is an add-on for WordPress
|
18 |
-
* http://wordpress.org/
|
19 |
-
*
|
20 |
-
* **********************************************************************
|
21 |
-
* This program is free software; you can redistribute it and/or modify
|
22 |
-
* it under the terms of the GNU General Public License as published by
|
23 |
-
* the Free Software Foundation; either version 2 of the License, or
|
24 |
-
* (at your option) any later version.
|
25 |
-
*
|
26 |
-
* This program is distributed in the hope that it will be useful,
|
27 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
28 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
29 |
-
* GNU General Public License for more details.
|
30 |
-
* **********************************************************************
|
31 |
-
*/
|
32 |
-
|
33 |
-
/************************************************************************
|
34 |
-
You should not edit the code below or things might explode!
|
35 |
-
*************************************************************************/
|
36 |
-
|
37 |
-
// Autoload helper classes
|
38 |
-
spl_autoload_register('dkrpt_Meta_Box::autoload_helpers');
|
39 |
-
|
40 |
-
$meta_boxes = array();
|
41 |
-
$meta_boxes = apply_filters( 'dkrpt_meta_boxes', $meta_boxes );
|
42 |
-
foreach ( $meta_boxes as $meta_box ) {
|
43 |
-
$my_box = new dkrpt_Meta_Box( $meta_box );
|
44 |
-
}
|
45 |
-
|
46 |
-
define( 'dkrpt_META_BOX_URL', dkrpt_Meta_Box::get_meta_box_url() );
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Create meta boxes
|
50 |
-
*/
|
51 |
-
class dkrpt_Meta_Box {
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Current version number
|
55 |
-
* @var string
|
56 |
-
* @since 1.0.0
|
57 |
-
*/
|
58 |
-
const dkrpt_VERSION = '1.2.0';
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Metabox Config array
|
62 |
-
* @var array
|
63 |
-
* @since 0.9.0
|
64 |
-
*/
|
65 |
-
protected $_meta_box;
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Metabox Defaults
|
69 |
-
* @var array
|
70 |
-
* @since 1.0.1
|
71 |
-
*/
|
72 |
-
protected static $mb_defaults = array(
|
73 |
-
'id' => '',
|
74 |
-
'title' => '',
|
75 |
-
'type' => '',
|
76 |
-
'pages' => array(), // Post type
|
77 |
-
'context' => 'normal',
|
78 |
-
'priority' => 'high',
|
79 |
-
'show_names' => true, // Show field names on the left
|
80 |
-
'show_on' => array( 'key' => false, 'value' => false ), // Specific post IDs or page templates to display this metabox
|
81 |
-
'dkrpt_styles' => true, // Include dkrpt bundled stylesheet
|
82 |
-
'fields' => array(),
|
83 |
-
);
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Metabox Form ID
|
87 |
-
* @var string
|
88 |
-
* @since 0.9.4
|
89 |
-
*/
|
90 |
-
protected $form_id = 'post';
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Current field config array
|
94 |
-
* @var array
|
95 |
-
* @since 1.0.0
|
96 |
-
*/
|
97 |
-
public static $field = array();
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Object ID for metabox meta retrieving/saving
|
101 |
-
* @var int
|
102 |
-
* @since 1.0.0
|
103 |
-
*/
|
104 |
-
protected static $object_id = 0;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Type of object being saved. (e.g., post, user, or comment)
|
108 |
-
* @var string
|
109 |
-
* @since 1.0.0
|
110 |
-
*/
|
111 |
-
protected static $object_type = '';
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Whether scripts/styles have been enqueued yet
|
115 |
-
* @var bool
|
116 |
-
* @since 1.0.0
|
117 |
-
*/
|
118 |
-
protected static $is_enqueued = false;
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Whether dkrpt nonce has been added to the page. (oly add once)
|
122 |
-
* @var bool
|
123 |
-
* @since 1.2.0
|
124 |
-
*/
|
125 |
-
protected static $nonce_added = false;
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Type of object specified by the metabox Config
|
129 |
-
* @var string
|
130 |
-
* @since 1.0.0
|
131 |
-
*/
|
132 |
-
protected static $mb_object_type = 'post';
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Array of all options from manage-options metaboxes
|
136 |
-
* @var array
|
137 |
-
* @since 1.0.0
|
138 |
-
*/
|
139 |
-
protected static $options = array();
|
140 |
-
|
141 |
-
/**
|
142 |
-
* List of fields that are changed/updated on save
|
143 |
-
* @var array
|
144 |
-
* @since 1.1.0
|
145 |
-
*/
|
146 |
-
protected static $updated = array();
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Get started
|
150 |
-
*/
|
151 |
-
function __construct( $meta_box ) {
|
152 |
-
|
153 |
-
$meta_box = self::set_mb_defaults( $meta_box );
|
154 |
-
|
155 |
-
$allow_frontend = apply_filters( 'dkrpt_allow_frontend', true, $meta_box );
|
156 |
-
|
157 |
-
if ( ! is_admin() && ! $allow_frontend )
|
158 |
-
return;
|
159 |
-
|
160 |
-
$this->_meta_box = $meta_box;
|
161 |
-
|
162 |
-
self::set_mb_type( $meta_box );
|
163 |
-
|
164 |
-
$types = wp_list_pluck( $meta_box['fields'], 'type' );
|
165 |
-
$upload = in_array( 'file', $types ) || in_array( 'file_list', $types );
|
166 |
-
|
167 |
-
global $pagenow;
|
168 |
-
|
169 |
-
$show_filters = 'dkrpt_Meta_Box_Show_Filters';
|
170 |
-
foreach ( get_class_methods( $show_filters ) as $filter ) {
|
171 |
-
add_filter( 'dkrpt_show_on', array( $show_filters, $filter ), 10, 2 );
|
172 |
-
}
|
173 |
-
|
174 |
-
// register our scripts and styles for dkrpt
|
175 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ), 8 );
|
176 |
-
|
177 |
-
if ( self::get_object_type() == 'post' ) {
|
178 |
-
add_action( 'admin_menu', array( $this, 'add_metaboxes' ) );
|
179 |
-
add_action( 'add_attachment', array( $this, 'save_post' ) );
|
180 |
-
add_action( 'edit_attachment', array( $this, 'save_post' ) );
|
181 |
-
add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
|
182 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'do_scripts' ) );
|
183 |
-
|
184 |
-
if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
|
185 |
-
add_action( 'admin_head', array( $this, 'add_post_enctype' ) );
|
186 |
-
}
|
187 |
-
|
188 |
-
}
|
189 |
-
if ( self::get_object_type() == 'user' ) {
|
190 |
-
|
191 |
-
$priority = 10;
|
192 |
-
if ( isset( $meta_box['priority'] ) ) {
|
193 |
-
if ( is_numeric( $meta_box['priority'] ) )
|
194 |
-
$priority = $meta_box['priority'];
|
195 |
-
elseif ( $meta_box['priority'] == 'high' )
|
196 |
-
$priority = 5;
|
197 |
-
elseif ( $meta_box['priority'] == 'low' )
|
198 |
-
$priority = 20;
|
199 |
-
}
|
200 |
-
add_action( 'show_user_profile', array( $this, 'user_metabox' ), $priority );
|
201 |
-
add_action( 'edit_user_profile', array( $this, 'user_metabox' ), $priority );
|
202 |
-
|
203 |
-
add_action( 'personal_options_update', array( $this, 'save_user' ) );
|
204 |
-
add_action( 'edit_user_profile_update', array( $this, 'save_user' ) );
|
205 |
-
if ( $upload && in_array( $pagenow, array( 'profile.php', 'user-edit.php' ) ) ) {
|
206 |
-
$this->form_id = 'your-profile';
|
207 |
-
add_action( 'admin_head', array( $this, 'add_post_enctype' ) );
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* Autoloads files with classes when needed
|
215 |
-
* @since 1.0.0
|
216 |
-
* @param string $class_name Name of the class being requested
|
217 |
-
*/
|
218 |
-
public static function autoload_helpers( $class_name ) {
|
219 |
-
if ( class_exists( $class_name, false ) )
|
220 |
-
return;
|
221 |
-
|
222 |
-
// for PHP versions < 5.3
|
223 |
-
$dir = dirname( __FILE__ );
|
224 |
-
|
225 |
-
$file = "$dir/helpers/$class_name.php";
|
226 |
-
if ( file_exists( $file ) )
|
227 |
-
@include( $file );
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Registers scripts and styles for dkrpt
|
232 |
-
* @since 1.0.0
|
233 |
-
*/
|
234 |
-
public function register_scripts() {
|
235 |
-
|
236 |
-
// Should only be run once
|
237 |
-
if ( self::$is_enqueued )
|
238 |
-
return;
|
239 |
-
|
240 |
-
global $wp_version;
|
241 |
-
// Only use minified files if SCRIPT_DEBUG is off
|
242 |
-
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
243 |
-
|
244 |
-
// scripts required for dkrpt
|
245 |
-
$scripts = array( 'jquery', 'jquery-ui-core', 'dkrpt-datepicker', /*'media-upload', */'dkrpt-timepicker' );
|
246 |
-
// styles required for dkrpt
|
247 |
-
$styles = array();
|
248 |
-
|
249 |
-
// if we're 3.5 or later, user wp-color-picker
|
250 |
-
if ( 3.5 <= $wp_version ) {
|
251 |
-
$scripts[] = 'wp-color-picker';
|
252 |
-
$styles[] = 'wp-color-picker';
|
253 |
-
if ( ! is_admin() ) {
|
254 |
-
// we need to register colorpicker on the front-end
|
255 |
-
wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), self::dkrpt_VERSION );
|
256 |
-
wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), self::dkrpt_VERSION );
|
257 |
-
wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
|
258 |
-
'clear' => __( 'Clear' ),
|
259 |
-
'defaultString' => __( 'Default' ),
|
260 |
-
'pick' => __( 'Select Color' ),
|
261 |
-
'current' => __( 'Current Color' ),
|
262 |
-
) );
|
263 |
-
}
|
264 |
-
} else {
|
265 |
-
// otherwise use the older 'farbtastic'
|
266 |
-
$scripts[] = 'farbtastic';
|
267 |
-
$styles[] = 'farbtastic';
|
268 |
-
}
|
269 |
-
wp_register_script( 'dkrpt-datepicker', dkrpt_META_BOX_URL . 'js/jquery.datePicker.min.js' );
|
270 |
-
wp_register_script( 'dkrpt-timepicker', dkrpt_META_BOX_URL . 'js/jquery.timePicker.min.js' );
|
271 |
-
wp_register_script( 'dkrpt-scripts', dkrpt_META_BOX_URL .'js/dkrpt'. $min .'.js', $scripts, self::dkrpt_VERSION );
|
272 |
-
|
273 |
-
wp_enqueue_media();
|
274 |
-
|
275 |
-
wp_localize_script( 'dkrpt-scripts', 'dkrpt_l10', apply_filters( 'dkrpt_localized_data', array(
|
276 |
-
'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ),
|
277 |
-
'script_debug' => defined('SCRIPT_DEBUG') && SCRIPT_DEBUG,
|
278 |
-
'new_admin_style' => version_compare( $wp_version, '3.7', '>' ),
|
279 |
-
'object_type' => self::get_object_type(),
|
280 |
-
'upload_file' => 'Use this file',
|
281 |
-
'remove_image' => 'Remove Image',
|
282 |
-
'remove_file' => 'Remove',
|
283 |
-
'file' => 'File:',
|
284 |
-
'download' => 'Download',
|
285 |
-
'ajaxurl' => admin_url( '/admin-ajax.php' ),
|
286 |
-
'up_arrow' => '[ ↑ ] ',
|
287 |
-
'down_arrow' => ' [ ↓ ]',
|
288 |
-
'check_toggle' => __( 'Select / Deselect All', 'dkrpt' ),
|
289 |
-
) ) );
|
290 |
-
|
291 |
-
wp_register_style( 'dkrpt-styles', dkrpt_META_BOX_URL . 'style'. $min .'.css', $styles );
|
292 |
-
|
293 |
-
// Ok, we've enqueued our scripts/styles
|
294 |
-
self::$is_enqueued = true;
|
295 |
-
}
|
296 |
-
|
297 |
-
/**
|
298 |
-
* Enqueues scripts and styles for dkrpt
|
299 |
-
* @since 1.0.0
|
300 |
-
*/
|
301 |
-
public function do_scripts( $hook ) {
|
302 |
-
// only enqueue our scripts/styles on the proper pages
|
303 |
-
if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
|
304 |
-
wp_enqueue_script( 'dkrpt-scripts' );
|
305 |
-
|
306 |
-
// default is to show dkrpt styles on post pages
|
307 |
-
if ( $this->_meta_box['dkrpt_styles'] )
|
308 |
-
wp_enqueue_style( 'dkrpt-styles' );
|
309 |
-
}
|
310 |
-
}
|
311 |
-
|
312 |
-
/**
|
313 |
-
* Add encoding attribute
|
314 |
-
*/
|
315 |
-
public function add_post_enctype() {
|
316 |
-
echo '
|
317 |
-
<script type="text/javascript">
|
318 |
-
jQuery(document).ready(function(){
|
319 |
-
jQuery("#'. $this->form_id .'").attr("enctype", "multipart/form-data");
|
320 |
-
jQuery("#'. $this->form_id .'").attr("encoding", "multipart/form-data");
|
321 |
-
});
|
322 |
-
</script>';
|
323 |
-
}
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Add metaboxes (to 'post' object type)
|
327 |
-
*/
|
328 |
-
public function add_metaboxes() {
|
329 |
-
|
330 |
-
foreach ( $this->_meta_box['pages'] as $page ) {
|
331 |
-
if ( apply_filters( 'dkrpt_show_on', true, $this->_meta_box ) )
|
332 |
-
add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array( $this, 'post_metabox' ), $page, $this->_meta_box['context'], $this->_meta_box['priority']) ;
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* Display metaboxes for a post object
|
338 |
-
* @since 1.0.0
|
339 |
-
*/
|
340 |
-
public function post_metabox() {
|
341 |
-
if ( ! $this->_meta_box )
|
342 |
-
return;
|
343 |
-
|
344 |
-
self::show_form( $this->_meta_box, get_the_ID(), 'post' );
|
345 |
-
|
346 |
-
}
|
347 |
-
|
348 |
-
/**
|
349 |
-
* Display metaboxes for a user object
|
350 |
-
* @since 1.0.0
|
351 |
-
*/
|
352 |
-
public function user_metabox() {
|
353 |
-
if ( ! $this->_meta_box )
|
354 |
-
return;
|
355 |
-
|
356 |
-
if ( 'user' != self::set_mb_type( $this->_meta_box ) )
|
357 |
-
return;
|
358 |
-
|
359 |
-
if ( ! apply_filters( 'dkrpt_show_on', true, $this->_meta_box ) )
|
360 |
-
return;
|
361 |
-
|
362 |
-
wp_enqueue_script( 'dkrpt-scripts' );
|
363 |
-
|
364 |
-
// default is to NOT show dkrpt styles on user profile page
|
365 |
-
if ( $this->_meta_box['dkrpt_styles'] != false )
|
366 |
-
wp_enqueue_style( 'dkrpt-styles' );
|
367 |
-
|
368 |
-
self::show_form( $this->_meta_box );
|
369 |
-
|
370 |
-
}
|
371 |
-
|
372 |
-
/**
|
373 |
-
* Loops through and displays fields
|
374 |
-
* @since 1.0.0
|
375 |
-
* @param array $meta_box Metabox config array
|
376 |
-
* @param int $object_id Object ID
|
377 |
-
* @param string $object_type Type of object being saved. (e.g., post, user, or comment)
|
378 |
-
*/
|
379 |
-
public static function show_form( $meta_box, $object_id = 0, $object_type = '' ) {
|
380 |
-
$meta_box = self::set_mb_defaults( $meta_box );
|
381 |
-
// Set/get type
|
382 |
-
$object_type = self::set_object_type( $object_type ? $object_type : self::set_mb_type( $meta_box ) );
|
383 |
-
// Set/get ID
|
384 |
-
$object_id = self::set_object_id( $object_id ? $object_id : self::get_object_id() );
|
385 |
-
|
386 |
-
// Add nonce only once per page.
|
387 |
-
if ( ! self::$nonce_added ) {
|
388 |
-
wp_nonce_field( self::nonce(), 'wp_meta_box_nonce', false, true );
|
389 |
-
self::$nonce_added = true;
|
390 |
-
}
|
391 |
-
|
392 |
-
// Use nonce for verification
|
393 |
-
echo "\n<!-- Begin dkrpt Fields -->\n";
|
394 |
-
do_action( 'dkrpt_before_table', $meta_box, $object_id, $object_type );
|
395 |
-
echo '<table class="form-table dkrpt_metabox">';
|
396 |
-
|
397 |
-
foreach ( $meta_box['fields'] as $field_args ) {
|
398 |
-
|
399 |
-
$field_args['context'] = $meta_box['context'];
|
400 |
-
|
401 |
-
if ( 'group' == $field_args['type'] ) {
|
402 |
-
|
403 |
-
if ( ! isset( $field_args['show_names'] ) ) {
|
404 |
-
$field_args['show_names'] = $meta_box['show_names'];
|
405 |
-
}
|
406 |
-
self::render_group( $field_args );
|
407 |
-
} else {
|
408 |
-
|
409 |
-
$field_args['show_names'] = $meta_box['show_names'];
|
410 |
-
// Render default fields
|
411 |
-
$field = new dkrpt_Meta_Box_field( $field_args );
|
412 |
-
$field->render_field();
|
413 |
-
}
|
414 |
-
}
|
415 |
-
echo '</table>';
|
416 |
-
do_action( 'dkrpt_after_table', $meta_box, $object_id, $object_type );
|
417 |
-
echo "\n<!-- End dkrpt Fields -->\n";
|
418 |
-
|
419 |
-
}
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Render a repeatable group
|
423 |
-
*/
|
424 |
-
public static function render_group( $args ) {
|
425 |
-
if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) )
|
426 |
-
return;
|
427 |
-
|
428 |
-
$args['count'] = 0;
|
429 |
-
$field_group = new dkrpt_Meta_Box_field( $args );
|
430 |
-
$desc = $field_group->args( 'description' );
|
431 |
-
$label = $field_group->args( 'name' );
|
432 |
-
$sortable = $field_group->options( 'sortable' ) ? ' sortable' : '';
|
433 |
-
$group_val = (array) $field_group->value();
|
434 |
-
$nrows = count( $group_val );
|
435 |
-
$remove_disabled = $nrows <= 1 ? 'disabled="disabled" ' : '';
|
436 |
-
|
437 |
-
echo '<tr><td colspan="2"><table id="', $field_group->id(), '_repeat" class="repeatable-group'. $sortable .'" style="width:100%;">';
|
438 |
-
if ( $desc || $label ) {
|
439 |
-
echo '<tr><th>';
|
440 |
-
if ( $label )
|
441 |
-
echo '<h2 class="dkrpt-group-name">'. $label .'</h2>';
|
442 |
-
if ( $desc )
|
443 |
-
echo '<p class="dkrpt_metabox_description">'. $desc .'</p>';
|
444 |
-
echo '</th></tr>';
|
445 |
-
}
|
446 |
-
|
447 |
-
if ( ! empty( $group_val ) ) {
|
448 |
-
|
449 |
-
foreach ( $group_val as $iterator => $field_id ) {
|
450 |
-
self::render_group_row( $field_group, $remove_disabled );
|
451 |
-
}
|
452 |
-
} else {
|
453 |
-
self::render_group_row( $field_group, $remove_disabled );
|
454 |
-
}
|
455 |
-
|
456 |
-
echo '<tr><td><p class="add-row"><button data-selector="', $field_group->id() ,'_repeat" data-grouptitle="', $field_group->options( 'group_title' ) ,'" class="add-group-row button">'. $field_group->options( 'add_button' ) .'</button></p></td></tr>';
|
457 |
-
|
458 |
-
echo '</table></td></tr>';
|
459 |
-
|
460 |
-
}
|
461 |
-
|
462 |
-
public static function render_group_row( $field_group, $remove_disabled ) {
|
463 |
-
|
464 |
-
echo '
|
465 |
-
<tr class="repeatable-grouping" data-iterator="'. $field_group->count() .'">
|
466 |
-
<td>
|
467 |
-
<table class="dkrpt-nested-table" style="width: 100%;">';
|
468 |
-
if ( $field_group->options( 'group_title' ) ) {
|
469 |
-
echo '
|
470 |
-
<tr class="dkrpt-group-title">
|
471 |
-
<th colspan="2">
|
472 |
-
', sprintf( '<h4>%1$s</h4>', $field_group->replace_hash( $field_group->options( 'group_title' ) ) ), '
|
473 |
-
<th>
|
474 |
-
</tr>
|
475 |
-
';
|
476 |
-
}
|
477 |
-
// Render repeatable group fields
|
478 |
-
foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
|
479 |
-
$field_args['show_names'] = $field_group->args( 'show_names' );
|
480 |
-
$field_args['context'] = $field_group->args( 'context' );
|
481 |
-
$field = new dkrpt_Meta_Box_field( $field_args, $field_group );
|
482 |
-
$field->render_field();
|
483 |
-
}
|
484 |
-
echo '
|
485 |
-
<tr>
|
486 |
-
<td class="remove-row" colspan="2">
|
487 |
-
<button '. $remove_disabled .'data-selector="'. $field_group->id() .'_repeat" class="button remove-group-row alignright">'. $field_group->options( 'remove_button' ) .'</button>
|
488 |
-
</td>
|
489 |
-
</tr>
|
490 |
-
</table>
|
491 |
-
</td>
|
492 |
-
</tr>
|
493 |
-
';
|
494 |
-
|
495 |
-
$field_group->args['count']++;
|
496 |
-
}
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Save data from metabox
|
500 |
-
*/
|
501 |
-
public function save_post( $post_id, $post = false ) {
|
502 |
-
|
503 |
-
$post_type = $post ? $post->post_type : get_post_type( $post_id );
|
504 |
-
|
505 |
-
// check permissions
|
506 |
-
if (
|
507 |
-
// check nonce
|
508 |
-
! isset( $_POST['wp_meta_box_nonce'] )
|
509 |
-
|| ! wp_verify_nonce( $_POST['wp_meta_box_nonce'], self::nonce() )
|
510 |
-
// check if autosave
|
511 |
-
|| defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE
|
512 |
-
// check user editing permissions
|
513 |
-
|| ( 'page' == $_POST['post_type'] && ! current_user_can( 'edit_page', $post_id ) )
|
514 |
-
|| ! current_user_can( 'edit_post', $post_id )
|
515 |
-
// get the metabox post_types & compare it to this post_type
|
516 |
-
|| ! in_array( $post_type, $this->_meta_box['pages'] )
|
517 |
-
)
|
518 |
-
return $post_id;
|
519 |
-
|
520 |
-
self::save_fields( $this->_meta_box, $post_id, 'post' );
|
521 |
-
}
|
522 |
-
|
523 |
-
/**
|
524 |
-
* Save data from metabox
|
525 |
-
*/
|
526 |
-
public function save_user( $user_id ) {
|
527 |
-
|
528 |
-
// check permissions
|
529 |
-
// @todo more hardening?
|
530 |
-
if (
|
531 |
-
// check nonce
|
532 |
-
! isset( $_POST['wp_meta_box_nonce'] )
|
533 |
-
|| ! wp_verify_nonce( $_POST['wp_meta_box_nonce'], self::nonce() )
|
534 |
-
)
|
535 |
-
return $user_id;
|
536 |
-
|
537 |
-
self::save_fields( $this->_meta_box, $user_id, 'user' );
|
538 |
-
}
|
539 |
-
|
540 |
-
/**
|
541 |
-
* Loops through and saves field data
|
542 |
-
* @since 1.0.0
|
543 |
-
* @param array $meta_box Metabox config array
|
544 |
-
* @param int $object_id Object ID
|
545 |
-
* @param string $object_type Type of object being saved. (e.g., post, user, or comment)
|
546 |
-
*/
|
547 |
-
public static function save_fields( $meta_box, $object_id, $object_type = '' ) {
|
548 |
-
$meta_box = self::set_mb_defaults( $meta_box );
|
549 |
-
|
550 |
-
$meta_box['show_on'] = empty( $meta_box['show_on'] ) ? array( 'key' => false, 'value' => false ) : $meta_box['show_on'];
|
551 |
-
|
552 |
-
self::set_object_id( $object_id );
|
553 |
-
// Set/get type
|
554 |
-
$object_type = self::set_object_type( $object_type ? $object_type : self::set_mb_type( $meta_box ) );
|
555 |
-
|
556 |
-
if ( ! apply_filters( 'dkrpt_show_on', true, $meta_box ) )
|
557 |
-
return;
|
558 |
-
|
559 |
-
// save field ids of those that are updated
|
560 |
-
self::$updated = array();
|
561 |
-
|
562 |
-
foreach ( $meta_box['fields'] as $field_args ) {
|
563 |
-
|
564 |
-
if ( 'group' == $field_args['type'] ) {
|
565 |
-
self::save_group( $field_args );
|
566 |
-
} else {
|
567 |
-
// Save default fields
|
568 |
-
$field = new dkrpt_Meta_Box_field( $field_args );
|
569 |
-
self::save_field( self::sanitize_field( $field ), $field );
|
570 |
-
}
|
571 |
-
|
572 |
-
}
|
573 |
-
|
574 |
-
// If options page, save the updated options
|
575 |
-
if ( $object_type == 'options-page' )
|
576 |
-
self::save_option( $object_id );
|
577 |
-
|
578 |
-
do_action( "dkrpt_save_{$object_type}_fields", $object_id, $meta_box['id'], self::$updated, $meta_box );
|
579 |
-
|
580 |
-
}
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Save a repeatable group
|
584 |
-
*/
|
585 |
-
public static function save_group( $args ) {
|
586 |
-
if ( ! isset( $args['id'], $args['fields'], $_POST[ $args['id'] ] ) || ! is_array( $args['fields'] ) )
|
587 |
-
return;
|
588 |
-
|
589 |
-
$field_group = new dkrpt_Meta_Box_field( $args );
|
590 |
-
$base_id = $field_group->id();
|
591 |
-
$old = $field_group->get_data();
|
592 |
-
$group_vals = $_POST[ $base_id ];
|
593 |
-
$saved = array();
|
594 |
-
$is_updated = false;
|
595 |
-
$field_group->index = 0;
|
596 |
-
|
597 |
-
// $group_vals[0]['color'] = '333';
|
598 |
-
foreach ( array_values( $field_group->fields() ) as $field_args ) {
|
599 |
-
$field = new dkrpt_Meta_Box_field( $field_args, $field_group );
|
600 |
-
$sub_id = $field->id( true );
|
601 |
-
|
602 |
-
foreach ( (array) $group_vals as $field_group->index => $post_vals ) {
|
603 |
-
|
604 |
-
// Get value
|
605 |
-
$new_val = isset( $group_vals[ $field_group->index ][ $sub_id ] )
|
606 |
-
? $group_vals[ $field_group->index ][ $sub_id ]
|
607 |
-
: false;
|
608 |
-
|
609 |
-
// Sanitize
|
610 |
-
$new_val = self::sanitize_field( $field, $new_val, $field_group->index );
|
611 |
-
|
612 |
-
if ( 'file' == $field->type() && is_array( $new_val ) ) {
|
613 |
-
// Add image ID to the array stack
|
614 |
-
$saved[ $field_group->index ][ $new_val['field_id'] ] = $new_val['attach_id'];
|
615 |
-
// Reset var to url string
|
616 |
-
$new_val = $new_val['url'];
|
617 |
-
}
|
618 |
-
|
619 |
-
// Get old value
|
620 |
-
$old_val = is_array( $old ) && isset( $old[ $field_group->index ][ $sub_id ] )
|
621 |
-
? $old[ $field_group->index ][ $sub_id ]
|
622 |
-
: false;
|
623 |
-
|
624 |
-
$is_updated = ( ! empty( $new_val ) && $new_val != $old_val );
|
625 |
-
$is_removed = ( empty( $new_val ) && ! empty( $old_val ) );
|
626 |
-
// Compare values and add to `$updated` array
|
627 |
-
if ( $is_updated || $is_removed )
|
628 |
-
self::$updated[] = $base_id .'::'. $field_group->index .'::'. $sub_id;
|
629 |
-
|
630 |
-
// Add to `$saved` array
|
631 |
-
$saved[ $field_group->index ][ $sub_id ] = $new_val;
|
632 |
-
|
633 |
-
}
|
634 |
-
$saved[ $field_group->index ] = array_filter( $saved[ $field_group->index ] );
|
635 |
-
}
|
636 |
-
$saved = array_filter( $saved );
|
637 |
-
|
638 |
-
$field_group->update_data( $saved, true );
|
639 |
-
}
|
640 |
-
|
641 |
-
public static function sanitize_field( $field, $new_value = null ) {
|
642 |
-
|
643 |
-
$new_value = null !== $new_value
|
644 |
-
? $new_value
|
645 |
-
: ( isset( $_POST[ $field->id( true ) ] ) ? $_POST[ $field->id( true ) ] : null );
|
646 |
-
|
647 |
-
if ( $field->args( 'repeatable' ) && is_array( $new_value ) ) {
|
648 |
-
// Remove empties
|
649 |
-
$new_value = array_filter( $new_value );
|
650 |
-
}
|
651 |
-
|
652 |
-
// Check if this metabox field has a registered validation callback, or perform default sanitization
|
653 |
-
return $field->sanitization_cb( $new_value );
|
654 |
-
}
|
655 |
-
|
656 |
-
public static function save_field( $new_value, $field ) {
|
657 |
-
$name = $field->id();
|
658 |
-
$old = $field->get_data();
|
659 |
-
|
660 |
-
// if ( $field->args( 'multiple' ) && ! $field->args( 'repeatable' ) && ! $field->group ) {
|
661 |
-
// $field->remove_data();
|
662 |
-
// if ( ! empty( $new_value ) ) {
|
663 |
-
// foreach ( $new_value as $add_new ) {
|
664 |
-
// self::$updated[] = $name;
|
665 |
-
// $field->update_data( $add_new, $name, false );
|
666 |
-
// }
|
667 |
-
// }
|
668 |
-
// } else
|
669 |
-
if ( ! empty( $new_value ) && $new_value != $old ) {
|
670 |
-
self::$updated[] = $name;
|
671 |
-
return $field->update_data( $new_value );
|
672 |
-
} elseif ( empty( $new_value ) ) {
|
673 |
-
if ( ! empty( $old ) )
|
674 |
-
self::$updated[] = $name;
|
675 |
-
return $field->remove_data();
|
676 |
-
}
|
677 |
-
}
|
678 |
-
|
679 |
-
/**
|
680 |
-
* Get object id from global space if no id is provided
|
681 |
-
* @since 1.0.0
|
682 |
-
* @param integer $object_id Object ID
|
683 |
-
* @return integer $object_id Object ID
|
684 |
-
*/
|
685 |
-
public static function get_object_id( $object_id = 0 ) {
|
686 |
-
|
687 |
-
if ( $object_id )
|
688 |
-
return $object_id;
|
689 |
-
|
690 |
-
if ( self::$object_id )
|
691 |
-
return self::$object_id;
|
692 |
-
|
693 |
-
// Try to get our object ID from the global space
|
694 |
-
switch ( self::get_object_type() ) {
|
695 |
-
case 'user':
|
696 |
-
$object_id = isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
|
697 |
-
$object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id;
|
698 |
-
break;
|
699 |
-
|
700 |
-
default:
|
701 |
-
$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
|
702 |
-
$object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id;
|
703 |
-
break;
|
704 |
-
}
|
705 |
-
|
706 |
-
// reset to id or 0
|
707 |
-
self::set_object_id( $object_id ? $object_id : 0 );
|
708 |
-
|
709 |
-
return self::$object_id;
|
710 |
-
}
|
711 |
-
|
712 |
-
/**
|
713 |
-
* Explicitly Set object id
|
714 |
-
* @since 1.0.0
|
715 |
-
* @param integer $object_id Object ID
|
716 |
-
* @return integer $object_id Object ID
|
717 |
-
*/
|
718 |
-
public static function set_object_id( $object_id ) {
|
719 |
-
return self::$object_id = $object_id;
|
720 |
-
}
|
721 |
-
|
722 |
-
/**
|
723 |
-
* Sets the $object_type based on metabox settings
|
724 |
-
* @since 1.0.0
|
725 |
-
* @param array|string $meta_box Metabox config array or explicit setting
|
726 |
-
* @return string Object type
|
727 |
-
*/
|
728 |
-
public static function set_mb_type( $meta_box ) {
|
729 |
-
|
730 |
-
if ( is_string( $meta_box ) ) {
|
731 |
-
self::$mb_object_type = $meta_box;
|
732 |
-
return self::get_mb_type();
|
733 |
-
}
|
734 |
-
|
735 |
-
if ( ! isset( $meta_box['pages'] ) )
|
736 |
-
return self::get_mb_type();
|
737 |
-
|
738 |
-
$type = false;
|
739 |
-
// check if 'pages' is a string
|
740 |
-
if ( self::is_options_page_mb( $meta_box ) )
|
741 |
-
$type = 'options-page';
|
742 |
-
// check if 'pages' is a string
|
743 |
-
elseif ( is_string( $meta_box['pages'] ) )
|
744 |
-
$type = $meta_box['pages'];
|
745 |
-
// if it's an array of one, extract it
|
746 |
-
elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] === 1 ) )
|
747 |
-
$type = is_string( end( $meta_box['pages'] ) ) ? end( $meta_box['pages'] ) : false;
|
748 |
-
|
749 |
-
if ( !$type )
|
750 |
-
return self::get_mb_type();
|
751 |
-
|
752 |
-
// Get our object type
|
753 |
-
if ( 'user' == $type )
|
754 |
-
self::$mb_object_type = 'user';
|
755 |
-
elseif ( 'comment' == $type )
|
756 |
-
self::$mb_object_type = 'comment';
|
757 |
-
elseif ( 'options-page' == $type )
|
758 |
-
self::$mb_object_type = 'options-page';
|
759 |
-
else
|
760 |
-
self::$mb_object_type = 'post';
|
761 |
-
|
762 |
-
return self::get_mb_type();
|
763 |
-
}
|
764 |
-
|
765 |
-
/**
|
766 |
-
* Determines if metabox is for an options page
|
767 |
-
* @since 1.0.1
|
768 |
-
* @param array $meta_box Metabox config array
|
769 |
-
* @return boolean True/False
|
770 |
-
*/
|
771 |
-
public static function is_options_page_mb( $meta_box ) {
|
772 |
-
return ( isset( $meta_box['show_on']['key'] ) && 'options-page' === $meta_box['show_on']['key'] );
|
773 |
-
}
|
774 |
-
|
775 |
-
/**
|
776 |
-
* Returns the object type
|
777 |
-
* @since 1.0.0
|
778 |
-
* @return string Object type
|
779 |
-
*/
|
780 |
-
public static function get_object_type() {
|
781 |
-
if ( self::$object_type )
|
782 |
-
return self::$object_type;
|
783 |
-
|
784 |
-
global $pagenow;
|
785 |
-
|
786 |
-
if (
|
787 |
-
$pagenow == 'user-edit.php'
|
788 |
-
|| $pagenow == 'profile.php'
|
789 |
-
)
|
790 |
-
self::set_object_type( 'user' );
|
791 |
-
|
792 |
-
elseif (
|
793 |
-
$pagenow == 'edit-comments.php'
|
794 |
-
|| $pagenow == 'comment.php'
|
795 |
-
)
|
796 |
-
self::set_object_type( 'comment' );
|
797 |
-
else
|
798 |
-
self::set_object_type( 'post' );
|
799 |
-
|
800 |
-
return self::$object_type;
|
801 |
-
}
|
802 |
-
|
803 |
-
/**
|
804 |
-
* Sets the object type
|
805 |
-
* @since 1.0.0
|
806 |
-
* @return string Object type
|
807 |
-
*/
|
808 |
-
public static function set_object_type( $object_type ) {
|
809 |
-
return self::$object_type = $object_type;
|
810 |
-
}
|
811 |
-
|
812 |
-
/**
|
813 |
-
* Returns the object type
|
814 |
-
* @since 1.0.0
|
815 |
-
* @return string Object type
|
816 |
-
*/
|
817 |
-
public static function get_mb_type() {
|
818 |
-
return self::$mb_object_type;
|
819 |
-
}
|
820 |
-
|
821 |
-
/**
|
822 |
-
* Returns the nonce value for wp_meta_box_nonce
|
823 |
-
* @since 1.0.0
|
824 |
-
* @return string Nonce value
|
825 |
-
*/
|
826 |
-
public static function nonce() {
|
827 |
-
return basename( __FILE__ );
|
828 |
-
}
|
829 |
-
|
830 |
-
/**
|
831 |
-
* Defines the url which is used to load local resources.
|
832 |
-
* This may need to be filtered for local Window installations.
|
833 |
-
* If resources do not load, please check the wiki for details.
|
834 |
-
* @since 1.0.1
|
835 |
-
* @return string URL to dkrpt resources
|
836 |
-
*/
|
837 |
-
public static function get_meta_box_url() {
|
838 |
-
|
839 |
-
if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
|
840 |
-
// Windows
|
841 |
-
$content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
|
842 |
-
$content_url = str_replace( $content_dir, WP_CONTENT_URL, dirname(__FILE__) );
|
843 |
-
$dkrpt_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
|
844 |
-
|
845 |
-
} else {
|
846 |
-
$dkrpt_url = str_replace(
|
847 |
-
array(WP_CONTENT_DIR, WP_PLUGIN_DIR),
|
848 |
-
array(WP_CONTENT_URL, WP_PLUGIN_URL),
|
849 |
-
dirname( __FILE__ )
|
850 |
-
);
|
851 |
-
}
|
852 |
-
|
853 |
-
$dkrpt_url = set_url_scheme( $dkrpt_url );
|
854 |
-
|
855 |
-
return trailingslashit( apply_filters('dkrpt_meta_box_url', $dkrpt_url ) );
|
856 |
-
}
|
857 |
-
|
858 |
-
/**
|
859 |
-
* Fills in empty metabox parameters with defaults
|
860 |
-
* @since 1.0.1
|
861 |
-
* @param array $meta_box Metabox config array
|
862 |
-
* @return array Modified Metabox config array
|
863 |
-
*/
|
864 |
-
public static function set_mb_defaults( $meta_box ) {
|
865 |
-
return wp_parse_args( $meta_box, self::$mb_defaults );
|
866 |
-
}
|
867 |
-
|
868 |
-
/**
|
869 |
-
* Removes an option from an option array
|
870 |
-
* @since 1.0.1
|
871 |
-
* @param string $option_key Option key
|
872 |
-
* @param string $field_id Option array field key
|
873 |
-
* @return array Modified options
|
874 |
-
*/
|
875 |
-
public static function remove_option( $option_key, $field_id ) {
|
876 |
-
|
877 |
-
self::$options[ $option_key ] = ! isset( self::$options[ $option_key ] ) || empty( self::$options[ $option_key ] ) ? self::_get_option( $option_key ) : self::$options[ $option_key ];
|
878 |
-
|
879 |
-
if ( isset( self::$options[ $option_key ][ $field_id ] ) )
|
880 |
-
unset( self::$options[ $option_key ][ $field_id ] );
|
881 |
-
|
882 |
-
return self::$options[ $option_key ];
|
883 |
-
}
|
884 |
-
|
885 |
-
/**
|
886 |
-
* Retrieves an option from an option array
|
887 |
-
* @since 1.0.1
|
888 |
-
* @param string $option_key Option key
|
889 |
-
* @param string $field_id Option array field key
|
890 |
-
* @return array Options array or specific field
|
891 |
-
*/
|
892 |
-
public static function get_option( $option_key, $field_id = '' ) {
|
893 |
-
|
894 |
-
self::$options[ $option_key ] = ! isset( self::$options[ $option_key ] ) || empty( self::$options[ $option_key ] ) ? self::_get_option( $option_key ) : self::$options[ $option_key ];
|
895 |
-
|
896 |
-
if ( $field_id ) {
|
897 |
-
return isset( self::$options[ $option_key ][ $field_id ] ) ? self::$options[ $option_key ][ $field_id ] : false;
|
898 |
-
}
|
899 |
-
|
900 |
-
return self::$options[ $option_key ];
|
901 |
-
}
|
902 |
-
|
903 |
-
/**
|
904 |
-
* Updates Option data
|
905 |
-
* @since 1.0.1
|
906 |
-
* @param string $option_key Option key
|
907 |
-
* @param string $field_id Option array field key
|
908 |
-
* @param mixed $value Value to update data with
|
909 |
-
* @param bool $single Whether data should be an array
|
910 |
-
* @return array Modified options
|
911 |
-
*/
|
912 |
-
public static function update_option( $option_key, $field_id, $value, $single = true ) {
|
913 |
-
|
914 |
-
if ( ! $single ) {
|
915 |
-
// If multiple, add to array
|
916 |
-
self::$options[ $option_key ][ $field_id ][] = $value;
|
917 |
-
} else {
|
918 |
-
self::$options[ $option_key ][ $field_id ] = $value;
|
919 |
-
}
|
920 |
-
|
921 |
-
return self::$options[ $option_key ];
|
922 |
-
}
|
923 |
-
|
924 |
-
/**
|
925 |
-
* Retrieve option value based on name of option.
|
926 |
-
* @uses apply_filters() Calls 'dkrpt_override_option_get_$option_key' hook to allow
|
927 |
-
* overwriting the option value to be retrieved.
|
928 |
-
*
|
929 |
-
* @since 1.0.1
|
930 |
-
* @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
|
931 |
-
* @param mixed $default Optional. Default value to return if the option does not exist.
|
932 |
-
* @return mixed Value set for the option.
|
933 |
-
*/
|
934 |
-
public static function _get_option( $option_key, $default = false ) {
|
935 |
-
|
936 |
-
$test_get = apply_filters( "dkrpt_override_option_get_$option_key", 'dkrpt_no_override_option_get', $default );
|
937 |
-
|
938 |
-
if ( $test_get !== 'dkrpt_no_override_option_get' )
|
939 |
-
return $test_get;
|
940 |
-
|
941 |
-
// If no override, get the option
|
942 |
-
return get_option( $option_key, $default );
|
943 |
-
}
|
944 |
-
|
945 |
-
/**
|
946 |
-
* Saves the option array
|
947 |
-
* Needs to be run after finished using remove/update_option
|
948 |
-
* @uses apply_filters() Calls 'dkrpt_override_option_save_$option_key' hook to allow
|
949 |
-
* overwriting the option value to be stored.
|
950 |
-
*
|
951 |
-
* @since 1.0.1
|
952 |
-
* @param string $option_key Option key
|
953 |
-
* @return boolean Success/Failure
|
954 |
-
*/
|
955 |
-
public static function save_option( $option_key ) {
|
956 |
-
|
957 |
-
$to_save = self::get_option( $option_key );
|
958 |
-
|
959 |
-
$test_save = apply_filters( "dkrpt_override_option_save_$option_key", 'dkrpt_no_override_option_save', $to_save );
|
960 |
-
|
961 |
-
if ( $test_save !== 'dkrpt_no_override_option_save' )
|
962 |
-
return $test_save;
|
963 |
-
|
964 |
-
// If no override, update the option
|
965 |
-
return update_option( $option_key, $to_save );
|
966 |
-
}
|
967 |
-
|
968 |
-
/**
|
969 |
-
* Utility method that returns a timezone string representing the default timezone for the site.
|
970 |
-
*
|
971 |
-
* Roughly copied from WordPress, as get_option('timezone_string') will return
|
972 |
-
* and empty string if no value has beens set on the options page.
|
973 |
-
* A timezone string is required by the wp_timezone_choice() used by the
|
974 |
-
* select_timezone field.
|
975 |
-
*
|
976 |
-
* @since 1.0.0
|
977 |
-
* @return string Timezone string
|
978 |
-
*/
|
979 |
-
public static function timezone_string() {
|
980 |
-
$current_offset = get_option( 'gmt_offset' );
|
981 |
-
$tzstring = get_option( 'timezone_string' );
|
982 |
-
|
983 |
-
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
|
984 |
-
if ( 0 == $current_offset )
|
985 |
-
$tzstring = 'UTC+0';
|
986 |
-
elseif ( $current_offset < 0 )
|
987 |
-
$tzstring = 'UTC' . $current_offset;
|
988 |
-
else
|
989 |
-
$tzstring = 'UTC+' . $current_offset;
|
990 |
-
}
|
991 |
-
|
992 |
-
return $tzstring;
|
993 |
-
}
|
994 |
-
|
995 |
-
/**
|
996 |
-
* Utility method that returns time string offset by timezone
|
997 |
-
* @since 1.0.0
|
998 |
-
* @param string $tzstring Time string
|
999 |
-
* @return string Offset time string
|
1000 |
-
*/
|
1001 |
-
public static function timezone_offset( $tzstring ) {
|
1002 |
-
if ( ! empty( $tzstring ) && is_string( $tzstring ) ) {
|
1003 |
-
if ( substr( $tzstring, 0, 3 ) === 'UTC' ) {
|
1004 |
-
$tzstring = str_replace( array( ':15',':30',':45' ), array( '.25','.5','.75' ), $tzstring );
|
1005 |
-
return intval( floatval( substr( $tzstring, 3 ) ) * HOUR_IN_SECONDS );
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
$date_time_zone_selected = new DateTimeZone( $tzstring );
|
1009 |
-
$tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
|
1010 |
-
|
1011 |
-
return $tz_offset;
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
return 0;
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
/**
|
1018 |
-
* Utility method that attempts to get an attachment's ID by it's url
|
1019 |
-
* @since 1.0.0
|
1020 |
-
* @param string $img_url Attachment url
|
1021 |
-
* @return mixed Attachment ID or false
|
1022 |
-
*/
|
1023 |
-
public static function image_id_from_url( $img_url ) {
|
1024 |
-
global $wpdb;
|
1025 |
-
|
1026 |
-
$img_url = esc_url_raw( $img_url );
|
1027 |
-
// Get just the file name
|
1028 |
-
if ( false !== strpos( $img_url, '/' ) ) {
|
1029 |
-
$explode = explode( '/', $img_url );
|
1030 |
-
$img_url = end( $explode );
|
1031 |
-
}
|
1032 |
-
|
1033 |
-
// And search for a fuzzy match of the file name
|
1034 |
-
$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid LIKE '%%%s%%' LIMIT 1;", $img_url ) );
|
1035 |
-
|
1036 |
-
// If we found an attachement ID, return it
|
1037 |
-
if ( !empty( $attachment ) && is_array( $attachment ) )
|
1038 |
-
return $attachment[0];
|
1039 |
-
|
1040 |
-
// No luck
|
1041 |
-
return false;
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
// Handle oembed Ajax
|
1047 |
-
add_action( 'wp_ajax_dkrpt_oembed_handler', array( 'dkrpt_Meta_Box_ajax', 'oembed_handler' ) );
|
1048 |
-
add_action( 'wp_ajax_nopriv_dkrpt_oembed_handler', array( 'dkrpt_Meta_Box_ajax', 'oembed_handler' ) );
|
1049 |
-
|
1050 |
-
/**
|
1051 |
-
* A helper function to get an option from a dkrpt options array
|
1052 |
-
* @since 1.0.1
|
1053 |
-
* @param string $option_key Option key
|
1054 |
-
* @param string $field_id Option array field key
|
1055 |
-
* @return array Options array or specific field
|
1056 |
-
*/
|
1057 |
-
function dkrpt_get_option( $option_key, $field_id = '' ) {
|
1058 |
-
return dkrpt_Meta_Box::get_option( $option_key, $field_id );
|
1059 |
-
}
|
1060 |
-
|
1061 |
-
/**
|
1062 |
-
* Get a dkrpt field object.
|
1063 |
-
* @since 1.1.0
|
1064 |
-
* @param array $field_args Field arguments
|
1065 |
-
* @param int $object_id Object ID
|
1066 |
-
* @param string $object_type Type of object being saved. (e.g., post, user, or comment)
|
1067 |
-
* @return object dkrpt_Meta_Box_field object
|
1068 |
-
*/
|
1069 |
-
function dkrpt_get_field( $field_args, $object_id = 0, $object_type = 'post' ) {
|
1070 |
-
// Default to the loop post ID
|
1071 |
-
$object_id = $object_id ? $object_id : get_the_ID();
|
1072 |
-
dkrpt_Meta_Box::set_object_id( $object_id );
|
1073 |
-
dkrpt_Meta_Box::set_object_type( $object_type );
|
1074 |
-
// Send back field object
|
1075 |
-
return new dkrpt_Meta_Box_field( $field_args );
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
/**
|
1079 |
-
* Get a field's value.
|
1080 |
-
* @since 1.1.0
|
1081 |
-
* @param array $field_args Field arguments
|
1082 |
-
* @param int $object_id Object ID
|
1083 |
-
* @param string $object_type Type of object being saved. (e.g., post, user, comment, or options-page)
|
1084 |
-
* @return mixed Maybe escaped value
|
1085 |
-
*/
|
1086 |
-
function dkrpt_get_field_value( $field_args, $object_id = 0, $object_type = 'post' ) {
|
1087 |
-
$field = dkrpt_get_field( $field_args, $object_id, $object_type );
|
1088 |
-
return $field->escaped_value();
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
/**
|
1092 |
-
* Loop and output multiple metaboxes
|
1093 |
-
* @since 1.0.0
|
1094 |
-
* @param array $meta_boxes Metaboxes config array
|
1095 |
-
* @param int $object_id Object ID
|
1096 |
-
*/
|
1097 |
-
function dkrpt_print_metaboxes( $meta_boxes, $object_id ) {
|
1098 |
-
foreach ( (array) $meta_boxes as $meta_box ) {
|
1099 |
-
dkrpt_print_metabox( $meta_box, $object_id );
|
1100 |
-
}
|
1101 |
-
}
|
1102 |
-
|
1103 |
-
/**
|
1104 |
-
* Output a metabox
|
1105 |
-
* @since 1.0.0
|
1106 |
-
* @param array $meta_box Metabox config array
|
1107 |
-
* @param int $object_id Object ID
|
1108 |
-
*/
|
1109 |
-
function dkrpt_print_metabox( $meta_box, $object_id ) {
|
1110 |
-
$dkrpt = new dkrpt_Meta_Box( $meta_box );
|
1111 |
-
if ( $dkrpt ) {
|
1112 |
-
|
1113 |
-
dkrpt_Meta_Box::set_object_id( $object_id );
|
1114 |
-
|
1115 |
-
if ( ! wp_script_is( 'dkrpt-scripts', 'registered' ) )
|
1116 |
-
$dkrpt->register_scripts();
|
1117 |
-
|
1118 |
-
wp_enqueue_script( 'dkrpt-scripts' );
|
1119 |
-
|
1120 |
-
// default is to show dkrpt styles
|
1121 |
-
if ( $meta_box['dkrpt_styles'] != false )
|
1122 |
-
wp_enqueue_style( 'dkrpt-styles' );
|
1123 |
-
|
1124 |
-
dkrpt_Meta_Box::show_form( $meta_box );
|
1125 |
-
}
|
1126 |
-
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
/**
|
1130 |
-
* Saves a particular metabox's fields
|
1131 |
-
* @since 1.0.0
|
1132 |
-
* @param array $meta_box Metabox config array
|
1133 |
-
* @param int $object_id Object ID
|
1134 |
-
*/
|
1135 |
-
function dkrpt_save_metabox_fields( $meta_box, $object_id ) {
|
1136 |
-
dkrpt_Meta_Box::save_fields( $meta_box, $object_id );
|
1137 |
-
}
|
1138 |
-
|
1139 |
-
/**
|
1140 |
-
* Display a metabox form & save it on submission
|
1141 |
-
* @since 1.0.0
|
1142 |
-
* @param array $meta_box Metabox config array
|
1143 |
-
* @param int $object_id Object ID
|
1144 |
-
* @param boolean $return Whether to return or echo form
|
1145 |
-
* @return string dkrpt html form markup
|
1146 |
-
*/
|
1147 |
-
function dkrpt_metabox_form( $meta_box, $object_id, $echo = true ) {
|
1148 |
-
|
1149 |
-
$meta_box = dkrpt_Meta_Box::set_mb_defaults( $meta_box );
|
1150 |
-
|
1151 |
-
// Make sure form should be shown
|
1152 |
-
if ( ! apply_filters( 'dkrpt_show_on', true, $meta_box ) )
|
1153 |
-
return '';
|
1154 |
-
|
1155 |
-
// Make sure that our object type is explicitly set by the metabox config
|
1156 |
-
dkrpt_Meta_Box::set_object_type( dkrpt_Meta_Box::set_mb_type( $meta_box ) );
|
1157 |
-
|
1158 |
-
// Save the metabox if it's been submitted
|
1159 |
-
// check permissions
|
1160 |
-
// @todo more hardening?
|
1161 |
-
if (
|
1162 |
-
// check nonce
|
1163 |
-
isset( $_POST['submit-dkrpt'], $_POST['object_id'], $_POST['wp_meta_box_nonce'] )
|
1164 |
-
&& wp_verify_nonce( $_POST['wp_meta_box_nonce'], dkrpt_Meta_Box::nonce() )
|
1165 |
-
&& $_POST['object_id'] == $object_id
|
1166 |
-
)
|
1167 |
-
dkrpt_save_metabox_fields( $meta_box, $object_id );
|
1168 |
-
|
1169 |
-
// Show specific metabox form
|
1170 |
-
|
1171 |
-
// Get dkrpt form
|
1172 |
-
ob_start();
|
1173 |
-
dkrpt_print_metabox( $meta_box, $object_id );
|
1174 |
-
$form = ob_get_contents();
|
1175 |
-
ob_end_clean();
|
1176 |
-
|
1177 |
-
$form_format = apply_filters( 'dkrpt_frontend_form_format', '<form class="dkrpt-form" method="post" id="%s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%s">%s<input type="submit" name="submit-dkrpt" value="%s" class="button-primary"></form>', $object_id, $meta_box, $form );
|
1178 |
-
|
1179 |
-
$form = sprintf( $form_format, $meta_box['id'], $object_id, $form, __( 'Save' ) );
|
1180 |
-
|
1181 |
-
if ( $echo )
|
1182 |
-
echo $form;
|
1183 |
-
|
1184 |
-
return $form;
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
// End. That's it, folks! //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/js/dkrpt.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
window.dkrpt=function(e,t,n,r){"use strict";var i=e.dkrpt_l10;var s=e.setTimeout;var o={formfield:"",idNumber:false,file_frames:{},repeatEls:'input:not([type="button"]),select,textarea,.dkrpt_media_status'};o.metabox=function(){if(o.$metabox){return o.$metabox}o.$metabox=n("table.dkrpt_metabox");return o.$metabox};o.init=function(){var t=o.metabox();var r=t.find(".repeatable-group");if(i.new_admin_style){t.find(".dkrpt-spinner img").hide()}o.initPickers(t.find("input:text.dkrpt_timepicker"),t.find("input:text.dkrpt_datepicker"),t.find("input:text.dkrpt_colorpicker"));n("#ui-datepicker-div").wrap('<div class="dkrpt_element" />');n('<p><span class="button dkrpt-multicheck-toggle">'+i.check_toggle+"</span></p>").insertBefore("ul.dkrpt_checkbox_list");t.on("change",".dkrpt_upload_file",function(){o.formfield=n(this).attr("id");n("#"+o.formfield+"_id").val("")}).on("click",".dkrpt-multicheck-toggle",o.toggleCheckBoxes).on("click",".dkrpt_upload_button",o.handleMedia).on("click",".dkrpt_remove_file_button",o.handleRemoveMedia).on("click",".add-group-row",o.addGroupRow).on("click",".add-row-button",o.addAjaxRow).on("click",".remove-group-row",o.removeGroupRow).on("click",".remove-row-button",o.removeAjaxRow).on("keyup paste focusout",".dkrpt_oembed",o.maybeOembed).on("dkrpt_remove_row",".repeatable-group",o.resetTitlesAndIterator);if(r.length){r.filter(".sortable").each(function(){n(this).find(".remove-group-row").before('<a class="shift-rows move-up alignleft" href="#">'+i.up_arrow+'</a> <a class="shift-rows move-down alignleft" href="#">'+i.down_arrow+"</a>")}).on("click",".shift-rows",o.shiftRows).on("dkrpt_add_row",o.emptyValue)}s(o.resizeoEmbeds,500);n(e).on("resize",o.resizeoEmbeds)};o.resetTitlesAndIterator=function(){n(".repeatable-group").each(function(){var e=n(this);e.find(".repeatable-grouping").each(function(t){var r=n(this);r.data("iterator",t);r.find(".dkrpt-group-title h4").text(e.find(".add-group-row").data("grouptitle").replace("{#}",t+1))})})};o.toggleCheckBoxes=function(e){e.preventDefault();var t=n(this);var r=t.parents("td").find("input[type=checkbox]");if(t.data("checked")){r.prop("checked",false);t.data("checked",false)}else{r.prop("checked",true);t.data("checked",true)}};o.handleMedia=function(e){if(!wp){return}e.preventDefault();var t=o.metabox();var r=n(this);o.formfield=r.prev("input").attr("id");var s=n("#"+o.formfield);var u=s.attr("name");var a=true;var f=true;var l=r.hasClass("dkrpt_upload_list");if(o.formfield in o.file_frames){o.file_frames[o.formfield].open();return}o.file_frames[o.formfield]=wp.media.frames.file_frame=wp.media({title:t.find("label[for="+o.formfield+"]").text(),button:{text:i.upload_file},multiple:l?true:false});var c={list:function(e){f=e.toJSON();s.val(f.url);n("#"+o.formfield+"_id").val(f.id);var t=[];n(f).each(function(){if(this.type&&this.type==="image"){a='<li class="img_status">'+'<img width="50" height="50" src="'+this.url+'" class="attachment-50x50" alt="'+this.filename+'">'+'<p><a href="#" class="dkrpt_remove_file_button" rel="'+o.formfield+"["+this.id+']">'+i.remove_image+"</a></p>"+'<input type="hidden" id="filelist-'+this.id+'" name="'+u+"["+this.id+']" value="'+this.url+'">'+"</li>"}else{a="<li>"+i.file+" <strong>"+this.filename+'</strong> (<a href="'+this.url+'" target="_blank" rel="external">'+i.download+'</a> / <a href="#" class="dkrpt_remove_file_button" rel="'+o.formfield+"["+this.id+']">'+i.remove_file+"</a>)"+'<input type="hidden" id="filelist-'+this.id+'" name="'+u+"["+this.id+']" value="'+this.url+'">'+"</li>"}t.push(a)});n(t).each(function(){s.siblings(".dkrpt_media_status").slideDown().append(this)})},single:function(e){f=e.first().toJSON();s.val(f.url);n("#"+o.formfield+"_id").val(f.id);if(f.type&&f.type==="image"){a='<div class="img_status"><img style="max-width: 350px; width: 100%; height: auto;" src="'+f.url+'" alt="'+f.filename+'" title="'+f.filename+'" /><p><a href="#" class="dkrpt_remove_file_button" rel="'+o.formfield+'">'+i.remove_image+"</a></p></div>"}else{a=i.file+" <strong>"+f.filename+'</strong> (<a href="'+f.url+'" target="_blank" rel="external">'+i.download+'</a> / <a href="#" class="dkrpt_remove_file_button" rel="'+o.formfield+'">'+i.remove_file+"</a>)"}s.siblings(".dkrpt_media_status").slideDown().html(a)}};o.file_frames[o.formfield].on("select",function(){var e=o.file_frames[o.formfield].state().get("selection");var t=l?"list":"single";c[t](e)});o.file_frames[o.formfield].open()};o.handleRemoveMedia=function(e){e.preventDefault();var t=n(this);if(t.is(".attach_list .dkrpt_remove_file_button")){t.parents("li").remove();return false}o.formfield=t.attr("rel");var r=t.parents(".img_status");o.metabox().find("input#"+o.formfield).val("");o.metabox().find("input#"+o.formfield+"_id").val("");if(!r.length){t.parents(".dkrpt_media_status").html("")}else{r.html("")}return false};n.fn.replaceText=function(e,t,r){return this.each(function(){var i=this.firstChild,s,o,u=[];if(i){do{if(i.nodeType===3){s=i.nodeValue;o=s.replace(e,t);if(o!==s){if(!r&&/</.test(o)){n(i).before(o);u.push(i)}else{i.nodeValue=o}}}}while(i=i.nextSibling)}if(u.length){n(u).remove()}})};n.fn.cleanRow=function(e,t){var r=n(this);var i=r.find('input:not([type="button"]), select, textarea, label');if(t){r.find(".dkrpt-repeat-table .repeat-row:not(:first-child)").remove()}o.$focus=false;o.neweditor_id=[];i.filter(":checked").removeAttr("checked");i.filter(":selected").removeAttr("selected");if(t){if(r.find(".dkrpt-group-title")){r.find(".dkrpt-group-title h4").text(r.data("title").replace("{#}",o.idNumber+1))}}i.each(function(){var t=n(this);var r=t.hasClass("wp-editor-area");var i=t.attr("for");var s={};var u,a;if(i){s={"for":i.replace("_"+e,"_"+o.idNumber)}}else{var f=t.attr("name");var l=f?f.replace("["+e+"]","["+o.idNumber+"]"):"";a=t.attr("id");u=a?a.replace("_"+e,"_"+o.idNumber):"";s={id:u,name:l,"data-iterator":o.idNumber}}t.removeClass("hasDatepicker").attr(s).val("");if(r){u=u?a.replace("zx"+e,"zx"+o.idNumber):"";t.html("");var c=t.parents(".dkrpt-type-wysiwyg");c.find(".mce-tinymce:not(:first-child)").remove();var h=c.html().replace(new RegExp(a,"g"),u);c.html(h);o.neweditor_id.push({id:u,old:a})}o.$focus=o.$focus?o.$focus:t});return this};n.fn.newRowHousekeeping=function(){var e=n(this);var t=e.find(".wp-picker-container");var r=e.find(".dkrpt_media_status");if(t.length){t.each(function(){var e=n(this).parent();e.html(e.find("input:text.dkrpt_colorpicker").attr("style",""))})}if(r.length){r.empty()}return this};o.afterRowInsert=function(e){if(o.$focus){o.$focus.focus()}var t;if(o.neweditor_id.length){var n;for(n=o.neweditor_id.length-1;n>=0;n--){var r=o.neweditor_id[n].id;var i=o.neweditor_id[n].old;if(typeof tinyMCEPreInit.mceInit[r]==="undefined"){var s=jQuery.extend({},tinyMCEPreInit.mceInit[i]);for(t in s){if("string"===typeof s[t]){s[t]=s[t].replace(new RegExp(i,"g"),r)}}tinyMCEPreInit.mceInit[r]=s}if(typeof tinyMCEPreInit.qtInit[r]==="undefined"){var u=jQuery.extend({},tinyMCEPreInit.qtInit[i]);for(t in u){if("string"===typeof u[t]){u[t]=u[t].replace(new RegExp(i,"g"),r)}}tinyMCEPreInit.qtInit[r]=u}tinyMCE.init({id:tinyMCEPreInit.mceInit[r]})}}o.initPickers(e.find("input:text.dkrpt_timepicker"),e.find("input:text.dkrpt_datepicker"),e.find("input:text.dkrpt_colorpicker"))};o.updateNameAttr=function(){var e=n(this);var t=e.attr("name");if(typeof t==="undefined"){return false}var r=parseInt(e.parents(".repeatable-grouping").data("iterator"));var i=r-1;var s=t.replace("["+r+"]","["+i+"]");e.attr("name",s)};o.emptyValue=function(e,t){n('input:not([type="button"]), textarea',t).val("")};o.addGroupRow=function(e){e.preventDefault();var t=n(this);var r=n("#"+t.data("selector"));var i=r.find(".repeatable-grouping").last();var s=parseInt(i.data("iterator"));var u=r.find(".repeatable-grouping").length;o.idNumber=s+1;var a=i.clone();a.data("title",t.data("grouptitle")).newRowHousekeeping().cleanRow(s,true);var f=n('<tr class="repeatable-grouping" data-iterator="'+o.idNumber+'">'+a.html()+"</tr>");i.after(f);o.afterRowInsert(f);if(r.find(".repeatable-grouping").length<=1){r.find(".remove-group-row").prop("disabled",true)}else{r.find(".remove-group-row").removeAttr("disabled")}r.trigger("dkrpt_add_row",f);if(u>3){var l='<div class="143413253" style="margin-bottom:18px; color:#97473d;">The number of plans is limited to <strong>5</strong>.</div>';n(".add-group-row").before(l);n(".add-group-row").remove()}};o.addAjaxRow=function(e){e.preventDefault();var t=n(this);var r="#"+t.data("selector");var i=n(r);var s=i.find(".empty-row");var u=parseInt(s.find("[data-iterator]").data("iterator"));o.idNumber=u+1;var a=s.clone();a.newRowHousekeeping().cleanRow(u);s.removeClass("empty-row").addClass("repeat-row");s.after(a);o.afterRowInsert(a);i.trigger("dkrpt_add_row",a)};o.removeGroupRow=function(e){e.preventDefault();var t=n(this);var r=n("#"+t.data("selector"));var i=t.parents(".repeatable-grouping");var s=r.find(".repeatable-grouping").length;i.nextAll(".repeatable-grouping").find(o.repeatEls).each(o.updateNameAttr);if(s>1){i.remove();if(s<3){r.find(".remove-group-row").prop("disabled",true)}else{r.find(".remove-group-row").prop("disabled",false)}r.trigger("dkrpt_remove_row")}};o.removeAjaxRow=function(e){e.preventDefault();var t=n(this);var r=t.parents("tr");var i=t.parents(".dkrpt-repeat-table");if(i.find("tr").length>1){if(r.hasClass("empty-row")){r.prev().addClass("empty-row").removeClass("repeat-row")}t.parents(".dkrpt-repeat-table tr").remove();i.trigger("dkrpt_remove_row")}};o.shiftRows=function(e){e.preventDefault();var t=n(this);var r=t.parents(".repeatable-grouping");var i=t.hasClass("move-up")?r.prev(".repeatable-grouping"):r.next(".repeatable-grouping");if(!i.length){return}var s=[];r.find(o.repeatEls).each(function(){var e=n(this);var t;if(e.hasClass("dkrpt_media_status")){t=e.html()}else if("checkbox"===e.attr("type")){t=e.is(":checked");o.log("checked",t)}else if("select"===e.prop("tagName")){t=e.is(":selected");o.log("checked",t)}else{t=e.val()}s.push({val:t,$:e})});i.find(o.repeatEls).each(function(e){var t=n(this);var r;if(t.hasClass("dkrpt_media_status")){r=t.html();t.html(s[e]["val"]);s[e]["$"].html(r)}else if("checkbox"===t.attr("type")){s[e]["$"].prop("checked",t.is(":checked"));t.prop("checked",s[e]["val"])}else if("select"===t.prop("tagName")){s[e]["$"].prop("selected",t.is(":selected"));t.prop("selected",s[e]["val"])}else{s[e]["$"].val(t.val());t.val(s[e]["val"])}})};o.initPickers=function(e,t,n){o.initTimePickers(e);o.initDatePickers(t);o.initColorPickers(n)};o.initTimePickers=function(e){if(!e.length){return}e.timePicker({startTime:"00:00",endTime:"23:59",show24Hours:false,separator:":",step:30})};o.initDatePickers=function(e){if(!e.length){return}e.datepicker("destroy");e.datepicker()};o.initColorPickers=function(e){if(!e.length){return}if(typeof jQuery.wp==="object"&&typeof jQuery.wp.wpColorPicker==="function"){e.wpColorPicker()}else{e.each(function(e){n(this).after('<div id="picker-'+e+'" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');n("#picker-"+e).hide().farbtastic(n(this))}).focus(function(){n(this).next().show()}).blur(function(){n(this).next().hide()})}};o.maybeOembed=function(e){var t=n(this);var r=e.type;var i={focusout:function(){s(function(){o.spinner(".postbox table.dkrpt_metabox",true)},2e3)},keyup:function(){var n=function(t,n){return e.which<=n&&e.which>=t};if(n(48,90)||n(96,111)||n(8,9)||e.which===187||e.which===190){o.doAjax(t,e)}},paste:function(){s(function(){o.doAjax(t)},100)}};i[r]()};o.resizeoEmbeds=function(){o.metabox().each(function(){var e=n(this);var t=e.parents(".inside");if(!t.length){return true}var r=Math.round(t.width()*.82*.97)-30;if(r>639){return true}var i=e.find(".dkrpt-type-oembed .embed_status");var s=i.children().not(".dkrpt_remove_wrapper");if(!s.length){return true}s.each(function(){var e=n(this);var t=e.width();var i=e.height();var s=r;if(e.parents(".repeat-row").length){s=r-91}var o=Math.round(s*i/t);e.width(s).height(o)})})};o.log=function(){if(i.script_debug&&console&&typeof console.log==="function"){console.log.apply(console,arguments)}};o.spinner=function(e,t){if(t){n(".dkrpt-spinner",e).hide()}else{n(".dkrpt-spinner",e).show()}};o.doAjax=function(e){var t=e.val();if(t.length<6){return}var r=e.attr("id");var u=e.parents(".dkrpt-repeat-table tr td");u=u.length?u:e.parents(".dkrpt_metabox tr td");var a=n(".embed_status",u);var f=e.width();var l=n(":first-child",a);o.log("oembed_url",t,r);f=a.length&&l.length?l.width():e.width();o.spinner(u);n(".embed_wrap",u).html("");s(function(){if(n(".dkrpt_oembed:focus").val()!==t){return}n.ajax({type:"post",dataType:"json",url:i.ajaxurl,data:{action:"dkrpt_oembed_handler",oembed_url:t,oembed_width:f>300?f:300,field_id:r,object_id:e.data("objectid"),object_type:e.data("objecttype"),dkrpt_ajax_nonce:i.ajax_nonce},success:function(e){o.log(e);if(typeof e.id==="undefined"){return}o.spinner(u,true);n(".embed_wrap",u).html(e.result)}})},500)};n(t).ready(o.init);return o}(window,document,jQuery)
|
|
dkrpt/js/jquery.datePicker.min.js
DELETED
@@ -1,2038 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery UI Datepicker 1.10.4
|
3 |
-
* http://jqueryui.com
|
4 |
-
*
|
5 |
-
* Copyright 2014 jQuery Foundation and other contributors
|
6 |
-
* Released under the MIT license.
|
7 |
-
* http://jquery.org/license
|
8 |
-
*
|
9 |
-
* http://api.jqueryui.com/datepicker/
|
10 |
-
*
|
11 |
-
* Depends:
|
12 |
-
* jquery.ui.core.js
|
13 |
-
*/
|
14 |
-
(function( $, undefined ) {
|
15 |
-
|
16 |
-
$.extend($.ui, { datepicker: { version: "1.10.4" } });
|
17 |
-
|
18 |
-
var PROP_NAME = "datepicker",
|
19 |
-
instActive;
|
20 |
-
|
21 |
-
/* Date picker manager.
|
22 |
-
Use the singleton instance of this class, $.datepicker, to interact with the date picker.
|
23 |
-
Settings for (groups of) date pickers are maintained in an instance object,
|
24 |
-
allowing multiple different settings on the same page. */
|
25 |
-
|
26 |
-
function Datepicker() {
|
27 |
-
this._curInst = null; // The current instance in use
|
28 |
-
this._keyEvent = false; // If the last event was a key event
|
29 |
-
this._disabledInputs = []; // List of date picker inputs that have been disabled
|
30 |
-
this._datepickerShowing = false; // True if the popup picker is showing , false if not
|
31 |
-
this._inDialog = false; // True if showing within a "dialog", false if not
|
32 |
-
this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
|
33 |
-
this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
|
34 |
-
this._appendClass = "ui-datepicker-append"; // The name of the append marker class
|
35 |
-
this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
|
36 |
-
this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
|
37 |
-
this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
|
38 |
-
this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
|
39 |
-
this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
|
40 |
-
this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
|
41 |
-
this.regional = []; // Available regional settings, indexed by language code
|
42 |
-
this.regional[""] = { // Default regional settings
|
43 |
-
closeText: "Done", // Display text for close link
|
44 |
-
prevText: "Prev", // Display text for previous month link
|
45 |
-
nextText: "Next", // Display text for next month link
|
46 |
-
currentText: "Today", // Display text for current month link
|
47 |
-
monthNames: ["January","February","March","April","May","June",
|
48 |
-
"July","August","September","October","November","December"], // Names of months for drop-down and formatting
|
49 |
-
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
|
50 |
-
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
|
51 |
-
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
|
52 |
-
dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
|
53 |
-
weekHeader: "Wk", // Column header for week of the year
|
54 |
-
dateFormat: "mm/dd/yy", // See format options on parseDate
|
55 |
-
firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
|
56 |
-
isRTL: false, // True if right-to-left language, false if left-to-right
|
57 |
-
showMonthAfterYear: false, // True if the year select precedes month, false for month then year
|
58 |
-
yearSuffix: "" // Additional text to append to the year in the month headers
|
59 |
-
};
|
60 |
-
this._defaults = { // Global defaults for all the date picker instances
|
61 |
-
showOn: "focus", // "focus" for popup on focus,
|
62 |
-
// "button" for trigger button, or "both" for either
|
63 |
-
showAnim: "fadeIn", // Name of jQuery animation for popup
|
64 |
-
showOptions: {}, // Options for enhanced animations
|
65 |
-
defaultDate: null, // Used when field is blank: actual date,
|
66 |
-
// +/-number for offset from today, null for today
|
67 |
-
appendText: "", // Display text following the input box, e.g. showing the format
|
68 |
-
buttonText: "...", // Text for trigger button
|
69 |
-
buttonImage: "", // URL for trigger button image
|
70 |
-
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
|
71 |
-
hideIfNoPrevNext: false, // True to hide next/previous month links
|
72 |
-
// if not applicable, false to just disable them
|
73 |
-
navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
|
74 |
-
gotoCurrent: false, // True if today link goes back to current selection instead
|
75 |
-
changeMonth: false, // True if month can be selected directly, false if only prev/next
|
76 |
-
changeYear: false, // True if year can be selected directly, false if only prev/next
|
77 |
-
yearRange: "c-10:c+10", // Range of years to display in drop-down,
|
78 |
-
// either relative to today's year (-nn:+nn), relative to currently displayed year
|
79 |
-
// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
|
80 |
-
showOtherMonths: false, // True to show dates in other months, false to leave blank
|
81 |
-
selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
|
82 |
-
showWeek: false, // True to show week of the year, false to not show it
|
83 |
-
calculateWeek: this.iso8601Week, // How to calculate the week of the year,
|
84 |
-
// takes a Date and returns the number of the week for it
|
85 |
-
shortYearCutoff: "+10", // Short year values < this are in the current century,
|
86 |
-
// > this are in the previous century,
|
87 |
-
// string value starting with "+" for current year + value
|
88 |
-
minDate: null, // The earliest selectable date, or null for no limit
|
89 |
-
maxDate: null, // The latest selectable date, or null for no limit
|
90 |
-
duration: "fast", // Duration of display/closure
|
91 |
-
beforeShowDay: null, // Function that takes a date and returns an array with
|
92 |
-
// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
|
93 |
-
// [2] = cell title (optional), e.g. $.datepicker.noWeekends
|
94 |
-
beforeShow: null, // Function that takes an input field and
|
95 |
-
// returns a set of custom settings for the date picker
|
96 |
-
onSelect: null, // Define a callback function when a date is selected
|
97 |
-
onChangeMonthYear: null, // Define a callback function when the month or year is changed
|
98 |
-
onClose: null, // Define a callback function when the datepicker is closed
|
99 |
-
numberOfMonths: 1, // Number of months to show at a time
|
100 |
-
showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
|
101 |
-
stepMonths: 1, // Number of months to step back/forward
|
102 |
-
stepBigMonths: 12, // Number of months to step back/forward for the big links
|
103 |
-
altField: "", // Selector for an alternate field to store selected dates into
|
104 |
-
altFormat: "", // The date format to use for the alternate field
|
105 |
-
constrainInput: true, // The input is constrained by the current date format
|
106 |
-
showButtonPanel: false, // True to show button panel, false to not show it
|
107 |
-
autoSize: false, // True to size the input for the date format, false to leave as is
|
108 |
-
disabled: false // The initial disabled state
|
109 |
-
};
|
110 |
-
$.extend(this._defaults, this.regional[""]);
|
111 |
-
this.dpDiv = bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
|
112 |
-
}
|
113 |
-
|
114 |
-
$.extend(Datepicker.prototype, {
|
115 |
-
/* Class name added to elements to indicate already configured with a date picker. */
|
116 |
-
markerClassName: "hasDatepicker",
|
117 |
-
|
118 |
-
//Keep track of the maximum number of rows displayed (see #7043)
|
119 |
-
maxRows: 4,
|
120 |
-
|
121 |
-
// TODO rename to "widget" when switching to widget factory
|
122 |
-
_widgetDatepicker: function() {
|
123 |
-
return this.dpDiv;
|
124 |
-
},
|
125 |
-
|
126 |
-
/* Override the default settings for all instances of the date picker.
|
127 |
-
* @param settings object - the new settings to use as defaults (anonymous object)
|
128 |
-
* @return the manager object
|
129 |
-
*/
|
130 |
-
setDefaults: function(settings) {
|
131 |
-
extendRemove(this._defaults, settings || {});
|
132 |
-
return this;
|
133 |
-
},
|
134 |
-
|
135 |
-
/* Attach the date picker to a jQuery selection.
|
136 |
-
* @param target element - the target input field or division or span
|
137 |
-
* @param settings object - the new settings to use for this date picker instance (anonymous)
|
138 |
-
*/
|
139 |
-
_attachDatepicker: function(target, settings) {
|
140 |
-
var nodeName, inline, inst;
|
141 |
-
nodeName = target.nodeName.toLowerCase();
|
142 |
-
inline = (nodeName === "div" || nodeName === "span");
|
143 |
-
if (!target.id) {
|
144 |
-
this.uuid += 1;
|
145 |
-
target.id = "dp" + this.uuid;
|
146 |
-
}
|
147 |
-
inst = this._newInst($(target), inline);
|
148 |
-
inst.settings = $.extend({}, settings || {});
|
149 |
-
if (nodeName === "input") {
|
150 |
-
this._connectDatepicker(target, inst);
|
151 |
-
} else if (inline) {
|
152 |
-
this._inlineDatepicker(target, inst);
|
153 |
-
}
|
154 |
-
},
|
155 |
-
|
156 |
-
/* Create a new instance object. */
|
157 |
-
_newInst: function(target, inline) {
|
158 |
-
var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
|
159 |
-
return {id: id, input: target, // associated target
|
160 |
-
selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
|
161 |
-
drawMonth: 0, drawYear: 0, // month being drawn
|
162 |
-
inline: inline, // is datepicker inline or not
|
163 |
-
dpDiv: (!inline ? this.dpDiv : // presentation div
|
164 |
-
bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
|
165 |
-
},
|
166 |
-
|
167 |
-
/* Attach the date picker to an input field. */
|
168 |
-
_connectDatepicker: function(target, inst) {
|
169 |
-
var input = $(target);
|
170 |
-
inst.append = $([]);
|
171 |
-
inst.trigger = $([]);
|
172 |
-
if (input.hasClass(this.markerClassName)) {
|
173 |
-
return;
|
174 |
-
}
|
175 |
-
this._attachments(input, inst);
|
176 |
-
input.addClass(this.markerClassName).keydown(this._doKeyDown).
|
177 |
-
keypress(this._doKeyPress).keyup(this._doKeyUp);
|
178 |
-
this._autoSize(inst);
|
179 |
-
$.data(target, PROP_NAME, inst);
|
180 |
-
//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
|
181 |
-
if( inst.settings.disabled ) {
|
182 |
-
this._disableDatepicker( target );
|
183 |
-
}
|
184 |
-
},
|
185 |
-
|
186 |
-
/* Make attachments based on settings. */
|
187 |
-
_attachments: function(input, inst) {
|
188 |
-
var showOn, buttonText, buttonImage,
|
189 |
-
appendText = this._get(inst, "appendText"),
|
190 |
-
isRTL = this._get(inst, "isRTL");
|
191 |
-
|
192 |
-
if (inst.append) {
|
193 |
-
inst.append.remove();
|
194 |
-
}
|
195 |
-
if (appendText) {
|
196 |
-
inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
|
197 |
-
input[isRTL ? "before" : "after"](inst.append);
|
198 |
-
}
|
199 |
-
|
200 |
-
input.unbind("focus", this._showDatepicker);
|
201 |
-
|
202 |
-
if (inst.trigger) {
|
203 |
-
inst.trigger.remove();
|
204 |
-
}
|
205 |
-
|
206 |
-
showOn = this._get(inst, "showOn");
|
207 |
-
if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
|
208 |
-
input.focus(this._showDatepicker);
|
209 |
-
}
|
210 |
-
if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
|
211 |
-
buttonText = this._get(inst, "buttonText");
|
212 |
-
buttonImage = this._get(inst, "buttonImage");
|
213 |
-
inst.trigger = $(this._get(inst, "buttonImageOnly") ?
|
214 |
-
$("<img/>").addClass(this._triggerClass).
|
215 |
-
attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
|
216 |
-
$("<button type='button'></button>").addClass(this._triggerClass).
|
217 |
-
html(!buttonImage ? buttonText : $("<img/>").attr(
|
218 |
-
{ src:buttonImage, alt:buttonText, title:buttonText })));
|
219 |
-
input[isRTL ? "before" : "after"](inst.trigger);
|
220 |
-
inst.trigger.click(function() {
|
221 |
-
if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
|
222 |
-
$.datepicker._hideDatepicker();
|
223 |
-
} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
|
224 |
-
$.datepicker._hideDatepicker();
|
225 |
-
$.datepicker._showDatepicker(input[0]);
|
226 |
-
} else {
|
227 |
-
$.datepicker._showDatepicker(input[0]);
|
228 |
-
}
|
229 |
-
return false;
|
230 |
-
});
|
231 |
-
}
|
232 |
-
},
|
233 |
-
|
234 |
-
/* Apply the maximum length for the date format. */
|
235 |
-
_autoSize: function(inst) {
|
236 |
-
if (this._get(inst, "autoSize") && !inst.inline) {
|
237 |
-
var findMax, max, maxI, i,
|
238 |
-
date = new Date(2009, 12 - 1, 20), // Ensure double digits
|
239 |
-
dateFormat = this._get(inst, "dateFormat");
|
240 |
-
|
241 |
-
if (dateFormat.match(/[DM]/)) {
|
242 |
-
findMax = function(names) {
|
243 |
-
max = 0;
|
244 |
-
maxI = 0;
|
245 |
-
for (i = 0; i < names.length; i++) {
|
246 |
-
if (names[i].length > max) {
|
247 |
-
max = names[i].length;
|
248 |
-
maxI = i;
|
249 |
-
}
|
250 |
-
}
|
251 |
-
return maxI;
|
252 |
-
};
|
253 |
-
date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
|
254 |
-
"monthNames" : "monthNamesShort"))));
|
255 |
-
date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
|
256 |
-
"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
|
257 |
-
}
|
258 |
-
inst.input.attr("size", this._formatDate(inst, date).length);
|
259 |
-
}
|
260 |
-
},
|
261 |
-
|
262 |
-
/* Attach an inline date picker to a div. */
|
263 |
-
_inlineDatepicker: function(target, inst) {
|
264 |
-
var divSpan = $(target);
|
265 |
-
if (divSpan.hasClass(this.markerClassName)) {
|
266 |
-
return;
|
267 |
-
}
|
268 |
-
divSpan.addClass(this.markerClassName).append(inst.dpDiv);
|
269 |
-
$.data(target, PROP_NAME, inst);
|
270 |
-
this._setDate(inst, this._getDefaultDate(inst), true);
|
271 |
-
this._updateDatepicker(inst);
|
272 |
-
this._updateAlternate(inst);
|
273 |
-
//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
|
274 |
-
if( inst.settings.disabled ) {
|
275 |
-
this._disableDatepicker( target );
|
276 |
-
}
|
277 |
-
// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
|
278 |
-
// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
|
279 |
-
inst.dpDiv.css( "display", "block" );
|
280 |
-
},
|
281 |
-
|
282 |
-
/* Pop-up the date picker in a "dialog" box.
|
283 |
-
* @param input element - ignored
|
284 |
-
* @param date string or Date - the initial date to display
|
285 |
-
* @param onSelect function - the function to call when a date is selected
|
286 |
-
* @param settings object - update the dialog date picker instance's settings (anonymous object)
|
287 |
-
* @param pos int[2] - coordinates for the dialog's position within the screen or
|
288 |
-
* event - with x/y coordinates or
|
289 |
-
* leave empty for default (screen centre)
|
290 |
-
* @return the manager object
|
291 |
-
*/
|
292 |
-
_dialogDatepicker: function(input, date, onSelect, settings, pos) {
|
293 |
-
var id, browserWidth, browserHeight, scrollX, scrollY,
|
294 |
-
inst = this._dialogInst; // internal instance
|
295 |
-
|
296 |
-
if (!inst) {
|
297 |
-
this.uuid += 1;
|
298 |
-
id = "dp" + this.uuid;
|
299 |
-
this._dialogInput = $("<input type='text' id='" + id +
|
300 |
-
"' style='position: absolute; top: -100px; width: 0px;'/>");
|
301 |
-
this._dialogInput.keydown(this._doKeyDown);
|
302 |
-
$("body").append(this._dialogInput);
|
303 |
-
inst = this._dialogInst = this._newInst(this._dialogInput, false);
|
304 |
-
inst.settings = {};
|
305 |
-
$.data(this._dialogInput[0], PROP_NAME, inst);
|
306 |
-
}
|
307 |
-
extendRemove(inst.settings, settings || {});
|
308 |
-
date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
|
309 |
-
this._dialogInput.val(date);
|
310 |
-
|
311 |
-
this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
|
312 |
-
if (!this._pos) {
|
313 |
-
browserWidth = document.documentElement.clientWidth;
|
314 |
-
browserHeight = document.documentElement.clientHeight;
|
315 |
-
scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
|
316 |
-
scrollY = document.documentElement.scrollTop || document.body.scrollTop;
|
317 |
-
this._pos = // should use actual width/height below
|
318 |
-
[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
|
319 |
-
}
|
320 |
-
|
321 |
-
// move input on screen for focus, but hidden behind dialog
|
322 |
-
this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
|
323 |
-
inst.settings.onSelect = onSelect;
|
324 |
-
this._inDialog = true;
|
325 |
-
this.dpDiv.addClass(this._dialogClass);
|
326 |
-
this._showDatepicker(this._dialogInput[0]);
|
327 |
-
if ($.blockUI) {
|
328 |
-
$.blockUI(this.dpDiv);
|
329 |
-
}
|
330 |
-
$.data(this._dialogInput[0], PROP_NAME, inst);
|
331 |
-
return this;
|
332 |
-
},
|
333 |
-
|
334 |
-
/* Detach a datepicker from its control.
|
335 |
-
* @param target element - the target input field or division or span
|
336 |
-
*/
|
337 |
-
_destroyDatepicker: function(target) {
|
338 |
-
var nodeName,
|
339 |
-
$target = $(target),
|
340 |
-
inst = $.data(target, PROP_NAME);
|
341 |
-
|
342 |
-
if (!$target.hasClass(this.markerClassName)) {
|
343 |
-
return;
|
344 |
-
}
|
345 |
-
|
346 |
-
nodeName = target.nodeName.toLowerCase();
|
347 |
-
$.removeData(target, PROP_NAME);
|
348 |
-
if (nodeName === "input") {
|
349 |
-
inst.append.remove();
|
350 |
-
inst.trigger.remove();
|
351 |
-
$target.removeClass(this.markerClassName).
|
352 |
-
unbind("focus", this._showDatepicker).
|
353 |
-
unbind("keydown", this._doKeyDown).
|
354 |
-
unbind("keypress", this._doKeyPress).
|
355 |
-
unbind("keyup", this._doKeyUp);
|
356 |
-
} else if (nodeName === "div" || nodeName === "span") {
|
357 |
-
$target.removeClass(this.markerClassName).empty();
|
358 |
-
}
|
359 |
-
},
|
360 |
-
|
361 |
-
/* Enable the date picker to a jQuery selection.
|
362 |
-
* @param target element - the target input field or division or span
|
363 |
-
*/
|
364 |
-
_enableDatepicker: function(target) {
|
365 |
-
var nodeName, inline,
|
366 |
-
$target = $(target),
|
367 |
-
inst = $.data(target, PROP_NAME);
|
368 |
-
|
369 |
-
if (!$target.hasClass(this.markerClassName)) {
|
370 |
-
return;
|
371 |
-
}
|
372 |
-
|
373 |
-
nodeName = target.nodeName.toLowerCase();
|
374 |
-
if (nodeName === "input") {
|
375 |
-
target.disabled = false;
|
376 |
-
inst.trigger.filter("button").
|
377 |
-
each(function() { this.disabled = false; }).end().
|
378 |
-
filter("img").css({opacity: "1.0", cursor: ""});
|
379 |
-
} else if (nodeName === "div" || nodeName === "span") {
|
380 |
-
inline = $target.children("." + this._inlineClass);
|
381 |
-
inline.children().removeClass("ui-state-disabled");
|
382 |
-
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
|
383 |
-
prop("disabled", false);
|
384 |
-
}
|
385 |
-
this._disabledInputs = $.map(this._disabledInputs,
|
386 |
-
function(value) { return (value === target ? null : value); }); // delete entry
|
387 |
-
},
|
388 |
-
|
389 |
-
/* Disable the date picker to a jQuery selection.
|
390 |
-
* @param target element - the target input field or division or span
|
391 |
-
*/
|
392 |
-
_disableDatepicker: function(target) {
|
393 |
-
var nodeName, inline,
|
394 |
-
$target = $(target),
|
395 |
-
inst = $.data(target, PROP_NAME);
|
396 |
-
|
397 |
-
if (!$target.hasClass(this.markerClassName)) {
|
398 |
-
return;
|
399 |
-
}
|
400 |
-
|
401 |
-
nodeName = target.nodeName.toLowerCase();
|
402 |
-
if (nodeName === "input") {
|
403 |
-
target.disabled = true;
|
404 |
-
inst.trigger.filter("button").
|
405 |
-
each(function() { this.disabled = true; }).end().
|
406 |
-
filter("img").css({opacity: "0.5", cursor: "default"});
|
407 |
-
} else if (nodeName === "div" || nodeName === "span") {
|
408 |
-
inline = $target.children("." + this._inlineClass);
|
409 |
-
inline.children().addClass("ui-state-disabled");
|
410 |
-
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
|
411 |
-
prop("disabled", true);
|
412 |
-
}
|
413 |
-
this._disabledInputs = $.map(this._disabledInputs,
|
414 |
-
function(value) { return (value === target ? null : value); }); // delete entry
|
415 |
-
this._disabledInputs[this._disabledInputs.length] = target;
|
416 |
-
},
|
417 |
-
|
418 |
-
/* Is the first field in a jQuery collection disabled as a datepicker?
|
419 |
-
* @param target element - the target input field or division or span
|
420 |
-
* @return boolean - true if disabled, false if enabled
|
421 |
-
*/
|
422 |
-
_isDisabledDatepicker: function(target) {
|
423 |
-
if (!target) {
|
424 |
-
return false;
|
425 |
-
}
|
426 |
-
for (var i = 0; i < this._disabledInputs.length; i++) {
|
427 |
-
if (this._disabledInputs[i] === target) {
|
428 |
-
return true;
|
429 |
-
}
|
430 |
-
}
|
431 |
-
return false;
|
432 |
-
},
|
433 |
-
|
434 |
-
/* Retrieve the instance data for the target control.
|
435 |
-
* @param target element - the target input field or division or span
|
436 |
-
* @return object - the associated instance data
|
437 |
-
* @throws error if a jQuery problem getting data
|
438 |
-
*/
|
439 |
-
_getInst: function(target) {
|
440 |
-
try {
|
441 |
-
return $.data(target, PROP_NAME);
|
442 |
-
}
|
443 |
-
catch (err) {
|
444 |
-
throw "Missing instance data for this datepicker";
|
445 |
-
}
|
446 |
-
},
|
447 |
-
|
448 |
-
/* Update or retrieve the settings for a date picker attached to an input field or division.
|
449 |
-
* @param target element - the target input field or division or span
|
450 |
-
* @param name object - the new settings to update or
|
451 |
-
* string - the name of the setting to change or retrieve,
|
452 |
-
* when retrieving also "all" for all instance settings or
|
453 |
-
* "defaults" for all global defaults
|
454 |
-
* @param value any - the new value for the setting
|
455 |
-
* (omit if above is an object or to retrieve a value)
|
456 |
-
*/
|
457 |
-
_optionDatepicker: function(target, name, value) {
|
458 |
-
var settings, date, minDate, maxDate,
|
459 |
-
inst = this._getInst(target);
|
460 |
-
|
461 |
-
if (arguments.length === 2 && typeof name === "string") {
|
462 |
-
return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
|
463 |
-
(inst ? (name === "all" ? $.extend({}, inst.settings) :
|
464 |
-
this._get(inst, name)) : null));
|
465 |
-
}
|
466 |
-
|
467 |
-
settings = name || {};
|
468 |
-
if (typeof name === "string") {
|
469 |
-
settings = {};
|
470 |
-
settings[name] = value;
|
471 |
-
}
|
472 |
-
|
473 |
-
if (inst) {
|
474 |
-
if (this._curInst === inst) {
|
475 |
-
this._hideDatepicker();
|
476 |
-
}
|
477 |
-
|
478 |
-
date = this._getDateDatepicker(target, true);
|
479 |
-
minDate = this._getMinMaxDate(inst, "min");
|
480 |
-
maxDate = this._getMinMaxDate(inst, "max");
|
481 |
-
extendRemove(inst.settings, settings);
|
482 |
-
// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
|
483 |
-
if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
|
484 |
-
inst.settings.minDate = this._formatDate(inst, minDate);
|
485 |
-
}
|
486 |
-
if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
|
487 |
-
inst.settings.maxDate = this._formatDate(inst, maxDate);
|
488 |
-
}
|
489 |
-
if ( "disabled" in settings ) {
|
490 |
-
if ( settings.disabled ) {
|
491 |
-
this._disableDatepicker(target);
|
492 |
-
} else {
|
493 |
-
this._enableDatepicker(target);
|
494 |
-
}
|
495 |
-
}
|
496 |
-
this._attachments($(target), inst);
|
497 |
-
this._autoSize(inst);
|
498 |
-
this._setDate(inst, date);
|
499 |
-
this._updateAlternate(inst);
|
500 |
-
this._updateDatepicker(inst);
|
501 |
-
}
|
502 |
-
},
|
503 |
-
|
504 |
-
// change method deprecated
|
505 |
-
_changeDatepicker: function(target, name, value) {
|
506 |
-
this._optionDatepicker(target, name, value);
|
507 |
-
},
|
508 |
-
|
509 |
-
/* Redraw the date picker attached to an input field or division.
|
510 |
-
* @param target element - the target input field or division or span
|
511 |
-
*/
|
512 |
-
_refreshDatepicker: function(target) {
|
513 |
-
var inst = this._getInst(target);
|
514 |
-
if (inst) {
|
515 |
-
this._updateDatepicker(inst);
|
516 |
-
}
|
517 |
-
},
|
518 |
-
|
519 |
-
/* Set the dates for a jQuery selection.
|
520 |
-
* @param target element - the target input field or division or span
|
521 |
-
* @param date Date - the new date
|
522 |
-
*/
|
523 |
-
_setDateDatepicker: function(target, date) {
|
524 |
-
var inst = this._getInst(target);
|
525 |
-
if (inst) {
|
526 |
-
this._setDate(inst, date);
|
527 |
-
this._updateDatepicker(inst);
|
528 |
-
this._updateAlternate(inst);
|
529 |
-
}
|
530 |
-
},
|
531 |
-
|
532 |
-
/* Get the date(s) for the first entry in a jQuery selection.
|
533 |
-
* @param target element - the target input field or division or span
|
534 |
-
* @param noDefault boolean - true if no default date is to be used
|
535 |
-
* @return Date - the current date
|
536 |
-
*/
|
537 |
-
_getDateDatepicker: function(target, noDefault) {
|
538 |
-
var inst = this._getInst(target);
|
539 |
-
if (inst && !inst.inline) {
|
540 |
-
this._setDateFromField(inst, noDefault);
|
541 |
-
}
|
542 |
-
return (inst ? this._getDate(inst) : null);
|
543 |
-
},
|
544 |
-
|
545 |
-
/* Handle keystrokes. */
|
546 |
-
_doKeyDown: function(event) {
|
547 |
-
var onSelect, dateStr, sel,
|
548 |
-
inst = $.datepicker._getInst(event.target),
|
549 |
-
handled = true,
|
550 |
-
isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
|
551 |
-
|
552 |
-
inst._keyEvent = true;
|
553 |
-
if ($.datepicker._datepickerShowing) {
|
554 |
-
switch (event.keyCode) {
|
555 |
-
case 9: $.datepicker._hideDatepicker();
|
556 |
-
handled = false;
|
557 |
-
break; // hide on tab out
|
558 |
-
case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
|
559 |
-
$.datepicker._currentClass + ")", inst.dpDiv);
|
560 |
-
if (sel[0]) {
|
561 |
-
$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
|
562 |
-
}
|
563 |
-
|
564 |
-
onSelect = $.datepicker._get(inst, "onSelect");
|
565 |
-
if (onSelect) {
|
566 |
-
dateStr = $.datepicker._formatDate(inst);
|
567 |
-
|
568 |
-
// trigger custom callback
|
569 |
-
onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
|
570 |
-
} else {
|
571 |
-
$.datepicker._hideDatepicker();
|
572 |
-
}
|
573 |
-
|
574 |
-
return false; // don't submit the form
|
575 |
-
case 27: $.datepicker._hideDatepicker();
|
576 |
-
break; // hide on escape
|
577 |
-
case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
|
578 |
-
-$.datepicker._get(inst, "stepBigMonths") :
|
579 |
-
-$.datepicker._get(inst, "stepMonths")), "M");
|
580 |
-
break; // previous month/year on page up/+ ctrl
|
581 |
-
case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
|
582 |
-
+$.datepicker._get(inst, "stepBigMonths") :
|
583 |
-
+$.datepicker._get(inst, "stepMonths")), "M");
|
584 |
-
break; // next month/year on page down/+ ctrl
|
585 |
-
case 35: if (event.ctrlKey || event.metaKey) {
|
586 |
-
$.datepicker._clearDate(event.target);
|
587 |
-
}
|
588 |
-
handled = event.ctrlKey || event.metaKey;
|
589 |
-
break; // clear on ctrl or command +end
|
590 |
-
case 36: if (event.ctrlKey || event.metaKey) {
|
591 |
-
$.datepicker._gotoToday(event.target);
|
592 |
-
}
|
593 |
-
handled = event.ctrlKey || event.metaKey;
|
594 |
-
break; // current on ctrl or command +home
|
595 |
-
case 37: if (event.ctrlKey || event.metaKey) {
|
596 |
-
$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
|
597 |
-
}
|
598 |
-
handled = event.ctrlKey || event.metaKey;
|
599 |
-
// -1 day on ctrl or command +left
|
600 |
-
if (event.originalEvent.altKey) {
|
601 |
-
$.datepicker._adjustDate(event.target, (event.ctrlKey ?
|
602 |
-
-$.datepicker._get(inst, "stepBigMonths") :
|
603 |
-
-$.datepicker._get(inst, "stepMonths")), "M");
|
604 |
-
}
|
605 |
-
// next month/year on alt +left on Mac
|
606 |
-
break;
|
607 |
-
case 38: if (event.ctrlKey || event.metaKey) {
|
608 |
-
$.datepicker._adjustDate(event.target, -7, "D");
|
609 |
-
}
|
610 |
-
handled = event.ctrlKey || event.metaKey;
|
611 |
-
break; // -1 week on ctrl or command +up
|
612 |
-
case 39: if (event.ctrlKey || event.metaKey) {
|
613 |
-
$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
|
614 |
-
}
|
615 |
-
handled = event.ctrlKey || event.metaKey;
|
616 |
-
// +1 day on ctrl or command +right
|
617 |
-
if (event.originalEvent.altKey) {
|
618 |
-
$.datepicker._adjustDate(event.target, (event.ctrlKey ?
|
619 |
-
+$.datepicker._get(inst, "stepBigMonths") :
|
620 |
-
+$.datepicker._get(inst, "stepMonths")), "M");
|
621 |
-
}
|
622 |
-
// next month/year on alt +right
|
623 |
-
break;
|
624 |
-
case 40: if (event.ctrlKey || event.metaKey) {
|
625 |
-
$.datepicker._adjustDate(event.target, +7, "D");
|
626 |
-
}
|
627 |
-
handled = event.ctrlKey || event.metaKey;
|
628 |
-
break; // +1 week on ctrl or command +down
|
629 |
-
default: handled = false;
|
630 |
-
}
|
631 |
-
} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
|
632 |
-
$.datepicker._showDatepicker(this);
|
633 |
-
} else {
|
634 |
-
handled = false;
|
635 |
-
}
|
636 |
-
|
637 |
-
if (handled) {
|
638 |
-
event.preventDefault();
|
639 |
-
event.stopPropagation();
|
640 |
-
}
|
641 |
-
},
|
642 |
-
|
643 |
-
/* Filter entered characters - based on date format. */
|
644 |
-
_doKeyPress: function(event) {
|
645 |
-
var chars, chr,
|
646 |
-
inst = $.datepicker._getInst(event.target);
|
647 |
-
|
648 |
-
if ($.datepicker._get(inst, "constrainInput")) {
|
649 |
-
chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
|
650 |
-
chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
|
651 |
-
return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
|
652 |
-
}
|
653 |
-
},
|
654 |
-
|
655 |
-
/* Synchronise manual entry and field/alternate field. */
|
656 |
-
_doKeyUp: function(event) {
|
657 |
-
var date,
|
658 |
-
inst = $.datepicker._getInst(event.target);
|
659 |
-
|
660 |
-
if (inst.input.val() !== inst.lastVal) {
|
661 |
-
try {
|
662 |
-
date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
|
663 |
-
(inst.input ? inst.input.val() : null),
|
664 |
-
$.datepicker._getFormatConfig(inst));
|
665 |
-
|
666 |
-
if (date) { // only if valid
|
667 |
-
$.datepicker._setDateFromField(inst);
|
668 |
-
$.datepicker._updateAlternate(inst);
|
669 |
-
$.datepicker._updateDatepicker(inst);
|
670 |
-
}
|
671 |
-
}
|
672 |
-
catch (err) {
|
673 |
-
}
|
674 |
-
}
|
675 |
-
return true;
|
676 |
-
},
|
677 |
-
|
678 |
-
/* Pop-up the date picker for a given input field.
|
679 |
-
* If false returned from beforeShow event handler do not show.
|
680 |
-
* @param input element - the input field attached to the date picker or
|
681 |
-
* event - if triggered by focus
|
682 |
-
*/
|
683 |
-
_showDatepicker: function(input) {
|
684 |
-
input = input.target || input;
|
685 |
-
if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
|
686 |
-
input = $("input", input.parentNode)[0];
|
687 |
-
}
|
688 |
-
|
689 |
-
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
|
690 |
-
return;
|
691 |
-
}
|
692 |
-
|
693 |
-
var inst, beforeShow, beforeShowSettings, isFixed,
|
694 |
-
offset, showAnim, duration;
|
695 |
-
|
696 |
-
inst = $.datepicker._getInst(input);
|
697 |
-
if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
|
698 |
-
$.datepicker._curInst.dpDiv.stop(true, true);
|
699 |
-
if ( inst && $.datepicker._datepickerShowing ) {
|
700 |
-
$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
|
701 |
-
}
|
702 |
-
}
|
703 |
-
|
704 |
-
beforeShow = $.datepicker._get(inst, "beforeShow");
|
705 |
-
beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
|
706 |
-
if(beforeShowSettings === false){
|
707 |
-
return;
|
708 |
-
}
|
709 |
-
extendRemove(inst.settings, beforeShowSettings);
|
710 |
-
|
711 |
-
inst.lastVal = null;
|
712 |
-
$.datepicker._lastInput = input;
|
713 |
-
$.datepicker._setDateFromField(inst);
|
714 |
-
|
715 |
-
if ($.datepicker._inDialog) { // hide cursor
|
716 |
-
input.value = "";
|
717 |
-
}
|
718 |
-
if (!$.datepicker._pos) { // position below input
|
719 |
-
$.datepicker._pos = $.datepicker._findPos(input);
|
720 |
-
$.datepicker._pos[1] += input.offsetHeight; // add the height
|
721 |
-
}
|
722 |
-
|
723 |
-
isFixed = false;
|
724 |
-
$(input).parents().each(function() {
|
725 |
-
isFixed |= $(this).css("position") === "fixed";
|
726 |
-
return !isFixed;
|
727 |
-
});
|
728 |
-
|
729 |
-
offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
|
730 |
-
$.datepicker._pos = null;
|
731 |
-
//to avoid flashes on Firefox
|
732 |
-
inst.dpDiv.empty();
|
733 |
-
// determine sizing offscreen
|
734 |
-
inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
|
735 |
-
$.datepicker._updateDatepicker(inst);
|
736 |
-
// fix width for dynamic number of date pickers
|
737 |
-
// and adjust position before showing
|
738 |
-
offset = $.datepicker._checkOffset(inst, offset, isFixed);
|
739 |
-
inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
|
740 |
-
"static" : (isFixed ? "fixed" : "absolute")), display: "none",
|
741 |
-
left: offset.left + "px", top: offset.top + "px"});
|
742 |
-
|
743 |
-
if (!inst.inline) {
|
744 |
-
showAnim = $.datepicker._get(inst, "showAnim");
|
745 |
-
duration = $.datepicker._get(inst, "duration");
|
746 |
-
inst.dpDiv.zIndex($(input).zIndex()+1);
|
747 |
-
$.datepicker._datepickerShowing = true;
|
748 |
-
|
749 |
-
if ( $.effects && $.effects.effect[ showAnim ] ) {
|
750 |
-
inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
|
751 |
-
} else {
|
752 |
-
inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
|
753 |
-
}
|
754 |
-
|
755 |
-
if ( $.datepicker._shouldFocusInput( inst ) ) {
|
756 |
-
inst.input.focus();
|
757 |
-
}
|
758 |
-
|
759 |
-
$.datepicker._curInst = inst;
|
760 |
-
}
|
761 |
-
},
|
762 |
-
|
763 |
-
/* Generate the date picker content. */
|
764 |
-
_updateDatepicker: function(inst) {
|
765 |
-
this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
|
766 |
-
instActive = inst; // for delegate hover events
|
767 |
-
inst.dpDiv.empty().append(this._generateHTML(inst));
|
768 |
-
this._attachHandlers(inst);
|
769 |
-
inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
|
770 |
-
|
771 |
-
var origyearshtml,
|
772 |
-
numMonths = this._getNumberOfMonths(inst),
|
773 |
-
cols = numMonths[1],
|
774 |
-
width = 17;
|
775 |
-
|
776 |
-
inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
|
777 |
-
if (cols > 1) {
|
778 |
-
inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
|
779 |
-
}
|
780 |
-
inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
|
781 |
-
"Class"]("ui-datepicker-multi");
|
782 |
-
inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
|
783 |
-
"Class"]("ui-datepicker-rtl");
|
784 |
-
|
785 |
-
if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
|
786 |
-
inst.input.focus();
|
787 |
-
}
|
788 |
-
|
789 |
-
// deffered render of the years select (to avoid flashes on Firefox)
|
790 |
-
if( inst.yearshtml ){
|
791 |
-
origyearshtml = inst.yearshtml;
|
792 |
-
setTimeout(function(){
|
793 |
-
//assure that inst.yearshtml didn't change.
|
794 |
-
if( origyearshtml === inst.yearshtml && inst.yearshtml ){
|
795 |
-
inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
|
796 |
-
}
|
797 |
-
origyearshtml = inst.yearshtml = null;
|
798 |
-
}, 0);
|
799 |
-
}
|
800 |
-
},
|
801 |
-
|
802 |
-
// #6694 - don't focus the input if it's already focused
|
803 |
-
// this breaks the change event in IE
|
804 |
-
// Support: IE and jQuery <1.9
|
805 |
-
_shouldFocusInput: function( inst ) {
|
806 |
-
return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
|
807 |
-
},
|
808 |
-
|
809 |
-
/* Check positioning to remain on screen. */
|
810 |
-
_checkOffset: function(inst, offset, isFixed) {
|
811 |
-
var dpWidth = inst.dpDiv.outerWidth(),
|
812 |
-
dpHeight = inst.dpDiv.outerHeight(),
|
813 |
-
inputWidth = inst.input ? inst.input.outerWidth() : 0,
|
814 |
-
inputHeight = inst.input ? inst.input.outerHeight() : 0,
|
815 |
-
viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
|
816 |
-
viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
|
817 |
-
|
818 |
-
offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
|
819 |
-
offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
|
820 |
-
offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
|
821 |
-
|
822 |
-
// now check if datepicker is showing outside window viewport - move to a better place if so.
|
823 |
-
offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
|
824 |
-
Math.abs(offset.left + dpWidth - viewWidth) : 0);
|
825 |
-
offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
|
826 |
-
Math.abs(dpHeight + inputHeight) : 0);
|
827 |
-
|
828 |
-
return offset;
|
829 |
-
},
|
830 |
-
|
831 |
-
/* Find an object's position on the screen. */
|
832 |
-
_findPos: function(obj) {
|
833 |
-
var position,
|
834 |
-
inst = this._getInst(obj),
|
835 |
-
isRTL = this._get(inst, "isRTL");
|
836 |
-
|
837 |
-
while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
|
838 |
-
obj = obj[isRTL ? "previousSibling" : "nextSibling"];
|
839 |
-
}
|
840 |
-
|
841 |
-
position = $(obj).offset();
|
842 |
-
return [position.left, position.top];
|
843 |
-
},
|
844 |
-
|
845 |
-
/* Hide the date picker from view.
|
846 |
-
* @param input element - the input field attached to the date picker
|
847 |
-
*/
|
848 |
-
_hideDatepicker: function(input) {
|
849 |
-
var showAnim, duration, postProcess, onClose,
|
850 |
-
inst = this._curInst;
|
851 |
-
|
852 |
-
if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
|
853 |
-
return;
|
854 |
-
}
|
855 |
-
|
856 |
-
if (this._datepickerShowing) {
|
857 |
-
showAnim = this._get(inst, "showAnim");
|
858 |
-
duration = this._get(inst, "duration");
|
859 |
-
postProcess = function() {
|
860 |
-
$.datepicker._tidyDialog(inst);
|
861 |
-
};
|
862 |
-
|
863 |
-
// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
|
864 |
-
if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
|
865 |
-
inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
|
866 |
-
} else {
|
867 |
-
inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
|
868 |
-
(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
|
869 |
-
}
|
870 |
-
|
871 |
-
if (!showAnim) {
|
872 |
-
postProcess();
|
873 |
-
}
|
874 |
-
this._datepickerShowing = false;
|
875 |
-
|
876 |
-
onClose = this._get(inst, "onClose");
|
877 |
-
if (onClose) {
|
878 |
-
onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
|
879 |
-
}
|
880 |
-
|
881 |
-
this._lastInput = null;
|
882 |
-
if (this._inDialog) {
|
883 |
-
this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
|
884 |
-
if ($.blockUI) {
|
885 |
-
$.unblockUI();
|
886 |
-
$("body").append(this.dpDiv);
|
887 |
-
}
|
888 |
-
}
|
889 |
-
this._inDialog = false;
|
890 |
-
}
|
891 |
-
},
|
892 |
-
|
893 |
-
/* Tidy up after a dialog display. */
|
894 |
-
_tidyDialog: function(inst) {
|
895 |
-
inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
|
896 |
-
},
|
897 |
-
|
898 |
-
/* Close date picker if clicked elsewhere. */
|
899 |
-
_checkExternalClick: function(event) {
|
900 |
-
if (!$.datepicker._curInst) {
|
901 |
-
return;
|
902 |
-
}
|
903 |
-
|
904 |
-
var $target = $(event.target),
|
905 |
-
inst = $.datepicker._getInst($target[0]);
|
906 |
-
|
907 |
-
if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
|
908 |
-
$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
|
909 |
-
!$target.hasClass($.datepicker.markerClassName) &&
|
910 |
-
!$target.closest("." + $.datepicker._triggerClass).length &&
|
911 |
-
$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
|
912 |
-
( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
|
913 |
-
$.datepicker._hideDatepicker();
|
914 |
-
}
|
915 |
-
},
|
916 |
-
|
917 |
-
/* Adjust one of the date sub-fields. */
|
918 |
-
_adjustDate: function(id, offset, period) {
|
919 |
-
var target = $(id),
|
920 |
-
inst = this._getInst(target[0]);
|
921 |
-
|
922 |
-
if (this._isDisabledDatepicker(target[0])) {
|
923 |
-
return;
|
924 |
-
}
|
925 |
-
this._adjustInstDate(inst, offset +
|
926 |
-
(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
|
927 |
-
period);
|
928 |
-
this._updateDatepicker(inst);
|
929 |
-
},
|
930 |
-
|
931 |
-
/* Action for current link. */
|
932 |
-
_gotoToday: function(id) {
|
933 |
-
var date,
|
934 |
-
target = $(id),
|
935 |
-
inst = this._getInst(target[0]);
|
936 |
-
|
937 |
-
if (this._get(inst, "gotoCurrent") && inst.currentDay) {
|
938 |
-
inst.selectedDay = inst.currentDay;
|
939 |
-
inst.drawMonth = inst.selectedMonth = inst.currentMonth;
|
940 |
-
inst.drawYear = inst.selectedYear = inst.currentYear;
|
941 |
-
} else {
|
942 |
-
date = new Date();
|
943 |
-
inst.selectedDay = date.getDate();
|
944 |
-
inst.drawMonth = inst.selectedMonth = date.getMonth();
|
945 |
-
inst.drawYear = inst.selectedYear = date.getFullYear();
|
946 |
-
}
|
947 |
-
this._notifyChange(inst);
|
948 |
-
this._adjustDate(target);
|
949 |
-
},
|
950 |
-
|
951 |
-
/* Action for selecting a new month/year. */
|
952 |
-
_selectMonthYear: function(id, select, period) {
|
953 |
-
var target = $(id),
|
954 |
-
inst = this._getInst(target[0]);
|
955 |
-
|
956 |
-
inst["selected" + (period === "M" ? "Month" : "Year")] =
|
957 |
-
inst["draw" + (period === "M" ? "Month" : "Year")] =
|
958 |
-
parseInt(select.options[select.selectedIndex].value,10);
|
959 |
-
|
960 |
-
this._notifyChange(inst);
|
961 |
-
this._adjustDate(target);
|
962 |
-
},
|
963 |
-
|
964 |
-
/* Action for selecting a day. */
|
965 |
-
_selectDay: function(id, month, year, td) {
|
966 |
-
var inst,
|
967 |
-
target = $(id);
|
968 |
-
|
969 |
-
if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
|
970 |
-
return;
|
971 |
-
}
|
972 |
-
|
973 |
-
inst = this._getInst(target[0]);
|
974 |
-
inst.selectedDay = inst.currentDay = $("a", td).html();
|
975 |
-
inst.selectedMonth = inst.currentMonth = month;
|
976 |
-
inst.selectedYear = inst.currentYear = year;
|
977 |
-
this._selectDate(id, this._formatDate(inst,
|
978 |
-
inst.currentDay, inst.currentMonth, inst.currentYear));
|
979 |
-
},
|
980 |
-
|
981 |
-
/* Erase the input field and hide the date picker. */
|
982 |
-
_clearDate: function(id) {
|
983 |
-
var target = $(id);
|
984 |
-
this._selectDate(target, "");
|
985 |
-
},
|
986 |
-
|
987 |
-
/* Update the input field with the selected date. */
|
988 |
-
_selectDate: function(id, dateStr) {
|
989 |
-
var onSelect,
|
990 |
-
target = $(id),
|
991 |
-
inst = this._getInst(target[0]);
|
992 |
-
|
993 |
-
dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
|
994 |
-
if (inst.input) {
|
995 |
-
inst.input.val(dateStr);
|
996 |
-
}
|
997 |
-
this._updateAlternate(inst);
|
998 |
-
|
999 |
-
onSelect = this._get(inst, "onSelect");
|
1000 |
-
if (onSelect) {
|
1001 |
-
onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
|
1002 |
-
} else if (inst.input) {
|
1003 |
-
inst.input.trigger("change"); // fire the change event
|
1004 |
-
}
|
1005 |
-
|
1006 |
-
if (inst.inline){
|
1007 |
-
this._updateDatepicker(inst);
|
1008 |
-
} else {
|
1009 |
-
this._hideDatepicker();
|
1010 |
-
this._lastInput = inst.input[0];
|
1011 |
-
if (typeof(inst.input[0]) !== "object") {
|
1012 |
-
inst.input.focus(); // restore focus
|
1013 |
-
}
|
1014 |
-
this._lastInput = null;
|
1015 |
-
}
|
1016 |
-
},
|
1017 |
-
|
1018 |
-
/* Update any alternate field to synchronise with the main field. */
|
1019 |
-
_updateAlternate: function(inst) {
|
1020 |
-
var altFormat, date, dateStr,
|
1021 |
-
altField = this._get(inst, "altField");
|
1022 |
-
|
1023 |
-
if (altField) { // update alternate field too
|
1024 |
-
altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
|
1025 |
-
date = this._getDate(inst);
|
1026 |
-
dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
|
1027 |
-
$(altField).each(function() { $(this).val(dateStr); });
|
1028 |
-
}
|
1029 |
-
},
|
1030 |
-
|
1031 |
-
/* Set as beforeShowDay function to prevent selection of weekends.
|
1032 |
-
* @param date Date - the date to customise
|
1033 |
-
* @return [boolean, string] - is this date selectable?, what is its CSS class?
|
1034 |
-
*/
|
1035 |
-
noWeekends: function(date) {
|
1036 |
-
var day = date.getDay();
|
1037 |
-
return [(day > 0 && day < 6), ""];
|
1038 |
-
},
|
1039 |
-
|
1040 |
-
/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
|
1041 |
-
* @param date Date - the date to get the week for
|
1042 |
-
* @return number - the number of the week within the year that contains this date
|
1043 |
-
*/
|
1044 |
-
iso8601Week: function(date) {
|
1045 |
-
var time,
|
1046 |
-
checkDate = new Date(date.getTime());
|
1047 |
-
|
1048 |
-
// Find Thursday of this week starting on Monday
|
1049 |
-
checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
|
1050 |
-
|
1051 |
-
time = checkDate.getTime();
|
1052 |
-
checkDate.setMonth(0); // Compare with Jan 1
|
1053 |
-
checkDate.setDate(1);
|
1054 |
-
return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
|
1055 |
-
},
|
1056 |
-
|
1057 |
-
/* Parse a string value into a date object.
|
1058 |
-
* See formatDate below for the possible formats.
|
1059 |
-
*
|
1060 |
-
* @param format string - the expected format of the date
|
1061 |
-
* @param value string - the date in the above format
|
1062 |
-
* @param settings Object - attributes include:
|
1063 |
-
* shortYearCutoff number - the cutoff year for determining the century (optional)
|
1064 |
-
* dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
|
1065 |
-
* dayNames string[7] - names of the days from Sunday (optional)
|
1066 |
-
* monthNamesShort string[12] - abbreviated names of the months (optional)
|
1067 |
-
* monthNames string[12] - names of the months (optional)
|
1068 |
-
* @return Date - the extracted date value or null if value is blank
|
1069 |
-
*/
|
1070 |
-
parseDate: function (format, value, settings) {
|
1071 |
-
if (format == null || value == null) {
|
1072 |
-
throw "Invalid arguments";
|
1073 |
-
}
|
1074 |
-
|
1075 |
-
value = (typeof value === "object" ? value.toString() : value + "");
|
1076 |
-
if (value === "") {
|
1077 |
-
return null;
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
var iFormat, dim, extra,
|
1081 |
-
iValue = 0,
|
1082 |
-
shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
|
1083 |
-
shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
|
1084 |
-
new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
|
1085 |
-
dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
|
1086 |
-
dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
|
1087 |
-
monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
|
1088 |
-
monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
|
1089 |
-
year = -1,
|
1090 |
-
month = -1,
|
1091 |
-
day = -1,
|
1092 |
-
doy = -1,
|
1093 |
-
literal = false,
|
1094 |
-
date,
|
1095 |
-
// Check whether a format character is doubled
|
1096 |
-
lookAhead = function(match) {
|
1097 |
-
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
|
1098 |
-
if (matches) {
|
1099 |
-
iFormat++;
|
1100 |
-
}
|
1101 |
-
return matches;
|
1102 |
-
},
|
1103 |
-
// Extract a number from the string value
|
1104 |
-
getNumber = function(match) {
|
1105 |
-
var isDoubled = lookAhead(match),
|
1106 |
-
size = (match === "@" ? 14 : (match === "!" ? 20 :
|
1107 |
-
(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
|
1108 |
-
digits = new RegExp("^\\d{1," + size + "}"),
|
1109 |
-
num = value.substring(iValue).match(digits);
|
1110 |
-
if (!num) {
|
1111 |
-
throw "Missing number at position " + iValue;
|
1112 |
-
}
|
1113 |
-
iValue += num[0].length;
|
1114 |
-
return parseInt(num[0], 10);
|
1115 |
-
},
|
1116 |
-
// Extract a name from the string value and convert to an index
|
1117 |
-
getName = function(match, shortNames, longNames) {
|
1118 |
-
var index = -1,
|
1119 |
-
names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
|
1120 |
-
return [ [k, v] ];
|
1121 |
-
}).sort(function (a, b) {
|
1122 |
-
return -(a[1].length - b[1].length);
|
1123 |
-
});
|
1124 |
-
|
1125 |
-
$.each(names, function (i, pair) {
|
1126 |
-
var name = pair[1];
|
1127 |
-
if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
|
1128 |
-
index = pair[0];
|
1129 |
-
iValue += name.length;
|
1130 |
-
return false;
|
1131 |
-
}
|
1132 |
-
});
|
1133 |
-
if (index !== -1) {
|
1134 |
-
return index + 1;
|
1135 |
-
} else {
|
1136 |
-
throw "Unknown name at position " + iValue;
|
1137 |
-
}
|
1138 |
-
},
|
1139 |
-
// Confirm that a literal character matches the string value
|
1140 |
-
checkLiteral = function() {
|
1141 |
-
if (value.charAt(iValue) !== format.charAt(iFormat)) {
|
1142 |
-
throw "Unexpected literal at position " + iValue;
|
1143 |
-
}
|
1144 |
-
iValue++;
|
1145 |
-
};
|
1146 |
-
|
1147 |
-
for (iFormat = 0; iFormat < format.length; iFormat++) {
|
1148 |
-
if (literal) {
|
1149 |
-
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
|
1150 |
-
literal = false;
|
1151 |
-
} else {
|
1152 |
-
checkLiteral();
|
1153 |
-
}
|
1154 |
-
} else {
|
1155 |
-
switch (format.charAt(iFormat)) {
|
1156 |
-
case "d":
|
1157 |
-
day = getNumber("d");
|
1158 |
-
break;
|
1159 |
-
case "D":
|
1160 |
-
getName("D", dayNamesShort, dayNames);
|
1161 |
-
break;
|
1162 |
-
case "o":
|
1163 |
-
doy = getNumber("o");
|
1164 |
-
break;
|
1165 |
-
case "m":
|
1166 |
-
month = getNumber("m");
|
1167 |
-
break;
|
1168 |
-
case "M":
|
1169 |
-
month = getName("M", monthNamesShort, monthNames);
|
1170 |
-
break;
|
1171 |
-
case "y":
|
1172 |
-
year = getNumber("y");
|
1173 |
-
break;
|
1174 |
-
case "@":
|
1175 |
-
date = new Date(getNumber("@"));
|
1176 |
-
year = date.getFullYear();
|
1177 |
-
month = date.getMonth() + 1;
|
1178 |
-
day = date.getDate();
|
1179 |
-
break;
|
1180 |
-
case "!":
|
1181 |
-
date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
|
1182 |
-
year = date.getFullYear();
|
1183 |
-
month = date.getMonth() + 1;
|
1184 |
-
day = date.getDate();
|
1185 |
-
break;
|
1186 |
-
case "'":
|
1187 |
-
if (lookAhead("'")){
|
1188 |
-
checkLiteral();
|
1189 |
-
} else {
|
1190 |
-
literal = true;
|
1191 |
-
}
|
1192 |
-
break;
|
1193 |
-
default:
|
1194 |
-
checkLiteral();
|
1195 |
-
}
|
1196 |
-
}
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
if (iValue < value.length){
|
1200 |
-
extra = value.substr(iValue);
|
1201 |
-
if (!/^\s+/.test(extra)) {
|
1202 |
-
throw "Extra/unparsed characters found in date: " + extra;
|
1203 |
-
}
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
if (year === -1) {
|
1207 |
-
year = new Date().getFullYear();
|
1208 |
-
} else if (year < 100) {
|
1209 |
-
year += new Date().getFullYear() - new Date().getFullYear() % 100 +
|
1210 |
-
(year <= shortYearCutoff ? 0 : -100);
|
1211 |
-
}
|
1212 |
-
|
1213 |
-
if (doy > -1) {
|
1214 |
-
month = 1;
|
1215 |
-
day = doy;
|
1216 |
-
do {
|
1217 |
-
dim = this._getDaysInMonth(year, month - 1);
|
1218 |
-
if (day <= dim) {
|
1219 |
-
break;
|
1220 |
-
}
|
1221 |
-
month++;
|
1222 |
-
day -= dim;
|
1223 |
-
} while (true);
|
1224 |
-
}
|
1225 |
-
|
1226 |
-
date = this._daylightSavingAdjust(new Date(year, month - 1, day));
|
1227 |
-
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
|
1228 |
-
throw "Invalid date"; // E.g. 31/02/00
|
1229 |
-
}
|
1230 |
-
return date;
|
1231 |
-
},
|
1232 |
-
|
1233 |
-
/* Standard date formats. */
|
1234 |
-
ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
|
1235 |
-
COOKIE: "D, dd M yy",
|
1236 |
-
ISO_8601: "yy-mm-dd",
|
1237 |
-
RFC_822: "D, d M y",
|
1238 |
-
RFC_850: "DD, dd-M-y",
|
1239 |
-
RFC_1036: "D, d M y",
|
1240 |
-
RFC_1123: "D, d M yy",
|
1241 |
-
RFC_2822: "D, d M yy",
|
1242 |
-
RSS: "D, d M y", // RFC 822
|
1243 |
-
TICKS: "!",
|
1244 |
-
TIMESTAMP: "@",
|
1245 |
-
W3C: "yy-mm-dd", // ISO 8601
|
1246 |
-
|
1247 |
-
_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
|
1248 |
-
Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
|
1249 |
-
|
1250 |
-
/* Format a date object into a string value.
|
1251 |
-
* The format can be combinations of the following:
|
1252 |
-
* d - day of month (no leading zero)
|
1253 |
-
* dd - day of month (two digit)
|
1254 |
-
* o - day of year (no leading zeros)
|
1255 |
-
* oo - day of year (three digit)
|
1256 |
-
* D - day name short
|
1257 |
-
* DD - day name long
|
1258 |
-
* m - month of year (no leading zero)
|
1259 |
-
* mm - month of year (two digit)
|
1260 |
-
* M - month name short
|
1261 |
-
* MM - month name long
|
1262 |
-
* y - year (two digit)
|
1263 |
-
* yy - year (four digit)
|
1264 |
-
* @ - Unix timestamp (ms since 01/01/1970)
|
1265 |
-
* ! - Windows ticks (100ns since 01/01/0001)
|
1266 |
-
* "..." - literal text
|
1267 |
-
* '' - single quote
|
1268 |
-
*
|
1269 |
-
* @param format string - the desired format of the date
|
1270 |
-
* @param date Date - the date value to format
|
1271 |
-
* @param settings Object - attributes include:
|
1272 |
-
* dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
|
1273 |
-
* dayNames string[7] - names of the days from Sunday (optional)
|
1274 |
-
* monthNamesShort string[12] - abbreviated names of the months (optional)
|
1275 |
-
* monthNames string[12] - names of the months (optional)
|
1276 |
-
* @return string - the date in the above format
|
1277 |
-
*/
|
1278 |
-
formatDate: function (format, date, settings) {
|
1279 |
-
if (!date) {
|
1280 |
-
return "";
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
var iFormat,
|
1284 |
-
dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
|
1285 |
-
dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
|
1286 |
-
monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
|
1287 |
-
monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
|
1288 |
-
// Check whether a format character is doubled
|
1289 |
-
lookAhead = function(match) {
|
1290 |
-
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
|
1291 |
-
if (matches) {
|
1292 |
-
iFormat++;
|
1293 |
-
}
|
1294 |
-
return matches;
|
1295 |
-
},
|
1296 |
-
// Format a number, with leading zero if necessary
|
1297 |
-
formatNumber = function(match, value, len) {
|
1298 |
-
var num = "" + value;
|
1299 |
-
if (lookAhead(match)) {
|
1300 |
-
while (num.length < len) {
|
1301 |
-
num = "0" + num;
|
1302 |
-
}
|
1303 |
-
}
|
1304 |
-
return num;
|
1305 |
-
},
|
1306 |
-
// Format a name, short or long as requested
|
1307 |
-
formatName = function(match, value, shortNames, longNames) {
|
1308 |
-
return (lookAhead(match) ? longNames[value] : shortNames[value]);
|
1309 |
-
},
|
1310 |
-
output = "",
|
1311 |
-
literal = false;
|
1312 |
-
|
1313 |
-
if (date) {
|
1314 |
-
for (iFormat = 0; iFormat < format.length; iFormat++) {
|
1315 |
-
if (literal) {
|
1316 |
-
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
|
1317 |
-
literal = false;
|
1318 |
-
} else {
|
1319 |
-
output += format.charAt(iFormat);
|
1320 |
-
}
|
1321 |
-
} else {
|
1322 |
-
switch (format.charAt(iFormat)) {
|
1323 |
-
case "d":
|
1324 |
-
output += formatNumber("d", date.getDate(), 2);
|
1325 |
-
break;
|
1326 |
-
case "D":
|
1327 |
-
output += formatName("D", date.getDay(), dayNamesShort, dayNames);
|
1328 |
-
break;
|
1329 |
-
case "o":
|
1330 |
-
output += formatNumber("o",
|
1331 |
-
Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
|
1332 |
-
break;
|
1333 |
-
case "m":
|
1334 |
-
output += formatNumber("m", date.getMonth() + 1, 2);
|
1335 |
-
break;
|
1336 |
-
case "M":
|
1337 |
-
output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
|
1338 |
-
break;
|
1339 |
-
case "y":
|
1340 |
-
output += (lookAhead("y") ? date.getFullYear() :
|
1341 |
-
(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
|
1342 |
-
break;
|
1343 |
-
case "@":
|
1344 |
-
output += date.getTime();
|
1345 |
-
break;
|
1346 |
-
case "!":
|
1347 |
-
output += date.getTime() * 10000 + this._ticksTo1970;
|
1348 |
-
break;
|
1349 |
-
case "'":
|
1350 |
-
if (lookAhead("'")) {
|
1351 |
-
output += "'";
|
1352 |
-
} else {
|
1353 |
-
literal = true;
|
1354 |
-
}
|
1355 |
-
break;
|
1356 |
-
default:
|
1357 |
-
output += format.charAt(iFormat);
|
1358 |
-
}
|
1359 |
-
}
|
1360 |
-
}
|
1361 |
-
}
|
1362 |
-
return output;
|
1363 |
-
},
|
1364 |
-
|
1365 |
-
/* Extract all possible characters from the date format. */
|
1366 |
-
_possibleChars: function (format) {
|
1367 |
-
var iFormat,
|
1368 |
-
chars = "",
|
1369 |
-
literal = false,
|
1370 |
-
// Check whether a format character is doubled
|
1371 |
-
lookAhead = function(match) {
|
1372 |
-
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
|
1373 |
-
if (matches) {
|
1374 |
-
iFormat++;
|
1375 |
-
}
|
1376 |
-
return matches;
|
1377 |
-
};
|
1378 |
-
|
1379 |
-
for (iFormat = 0; iFormat < format.length; iFormat++) {
|
1380 |
-
if (literal) {
|
1381 |
-
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
|
1382 |
-
literal = false;
|
1383 |
-
} else {
|
1384 |
-
chars += format.charAt(iFormat);
|
1385 |
-
}
|
1386 |
-
} else {
|
1387 |
-
switch (format.charAt(iFormat)) {
|
1388 |
-
case "d": case "m": case "y": case "@":
|
1389 |
-
chars += "0123456789";
|
1390 |
-
break;
|
1391 |
-
case "D": case "M":
|
1392 |
-
return null; // Accept anything
|
1393 |
-
case "'":
|
1394 |
-
if (lookAhead("'")) {
|
1395 |
-
chars += "'";
|
1396 |
-
} else {
|
1397 |
-
literal = true;
|
1398 |
-
}
|
1399 |
-
break;
|
1400 |
-
default:
|
1401 |
-
chars += format.charAt(iFormat);
|
1402 |
-
}
|
1403 |
-
}
|
1404 |
-
}
|
1405 |
-
return chars;
|
1406 |
-
},
|
1407 |
-
|
1408 |
-
/* Get a setting value, defaulting if necessary. */
|
1409 |
-
_get: function(inst, name) {
|
1410 |
-
return inst.settings[name] !== undefined ?
|
1411 |
-
inst.settings[name] : this._defaults[name];
|
1412 |
-
},
|
1413 |
-
|
1414 |
-
/* Parse existing date and initialise date picker. */
|
1415 |
-
_setDateFromField: function(inst, noDefault) {
|
1416 |
-
if (inst.input.val() === inst.lastVal) {
|
1417 |
-
return;
|
1418 |
-
}
|
1419 |
-
|
1420 |
-
var dateFormat = this._get(inst, "dateFormat"),
|
1421 |
-
dates = inst.lastVal = inst.input ? inst.input.val() : null,
|
1422 |
-
defaultDate = this._getDefaultDate(inst),
|
1423 |
-
date = defaultDate,
|
1424 |
-
settings = this._getFormatConfig(inst);
|
1425 |
-
|
1426 |
-
try {
|
1427 |
-
date = this.parseDate(dateFormat, dates, settings) || defaultDate;
|
1428 |
-
} catch (event) {
|
1429 |
-
dates = (noDefault ? "" : dates);
|
1430 |
-
}
|
1431 |
-
inst.selectedDay = date.getDate();
|
1432 |
-
inst.drawMonth = inst.selectedMonth = date.getMonth();
|
1433 |
-
inst.drawYear = inst.selectedYear = date.getFullYear();
|
1434 |
-
inst.currentDay = (dates ? date.getDate() : 0);
|
1435 |
-
inst.currentMonth = (dates ? date.getMonth() : 0);
|
1436 |
-
inst.currentYear = (dates ? date.getFullYear() : 0);
|
1437 |
-
this._adjustInstDate(inst);
|
1438 |
-
},
|
1439 |
-
|
1440 |
-
/* Retrieve the default date shown on opening. */
|
1441 |
-
_getDefaultDate: function(inst) {
|
1442 |
-
return this._restrictMinMax(inst,
|
1443 |
-
this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
|
1444 |
-
},
|
1445 |
-
|
1446 |
-
/* A date may be specified as an exact value or a relative one. */
|
1447 |
-
_determineDate: function(inst, date, defaultDate) {
|
1448 |
-
var offsetNumeric = function(offset) {
|
1449 |
-
var date = new Date();
|
1450 |
-
date.setDate(date.getDate() + offset);
|
1451 |
-
return date;
|
1452 |
-
},
|
1453 |
-
offsetString = function(offset) {
|
1454 |
-
try {
|
1455 |
-
return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
|
1456 |
-
offset, $.datepicker._getFormatConfig(inst));
|
1457 |
-
}
|
1458 |
-
catch (e) {
|
1459 |
-
// Ignore
|
1460 |
-
}
|
1461 |
-
|
1462 |
-
var date = (offset.toLowerCase().match(/^c/) ?
|
1463 |
-
$.datepicker._getDate(inst) : null) || new Date(),
|
1464 |
-
year = date.getFullYear(),
|
1465 |
-
month = date.getMonth(),
|
1466 |
-
day = date.getDate(),
|
1467 |
-
pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
|
1468 |
-
matches = pattern.exec(offset);
|
1469 |
-
|
1470 |
-
while (matches) {
|
1471 |
-
switch (matches[2] || "d") {
|
1472 |
-
case "d" : case "D" :
|
1473 |
-
day += parseInt(matches[1],10); break;
|
1474 |
-
case "w" : case "W" :
|
1475 |
-
day += parseInt(matches[1],10) * 7; break;
|
1476 |
-
case "m" : case "M" :
|
1477 |
-
month += parseInt(matches[1],10);
|
1478 |
-
day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
|
1479 |
-
break;
|
1480 |
-
case "y": case "Y" :
|
1481 |
-
year += parseInt(matches[1],10);
|
1482 |
-
day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
|
1483 |
-
break;
|
1484 |
-
}
|
1485 |
-
matches = pattern.exec(offset);
|
1486 |
-
}
|
1487 |
-
return new Date(year, month, day);
|
1488 |
-
},
|
1489 |
-
newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
|
1490 |
-
(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
|
1491 |
-
|
1492 |
-
newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
|
1493 |
-
if (newDate) {
|
1494 |
-
newDate.setHours(0);
|
1495 |
-
newDate.setMinutes(0);
|
1496 |
-
newDate.setSeconds(0);
|
1497 |
-
newDate.setMilliseconds(0);
|
1498 |
-
}
|
1499 |
-
return this._daylightSavingAdjust(newDate);
|
1500 |
-
},
|
1501 |
-
|
1502 |
-
/* Handle switch to/from daylight saving.
|
1503 |
-
* Hours may be non-zero on daylight saving cut-over:
|
1504 |
-
* > 12 when midnight changeover, but then cannot generate
|
1505 |
-
* midnight datetime, so jump to 1AM, otherwise reset.
|
1506 |
-
* @param date (Date) the date to check
|
1507 |
-
* @return (Date) the corrected date
|
1508 |
-
*/
|
1509 |
-
_daylightSavingAdjust: function(date) {
|
1510 |
-
if (!date) {
|
1511 |
-
return null;
|
1512 |
-
}
|
1513 |
-
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
|
1514 |
-
return date;
|
1515 |
-
},
|
1516 |
-
|
1517 |
-
/* Set the date(s) directly. */
|
1518 |
-
_setDate: function(inst, date, noChange) {
|
1519 |
-
var clear = !date,
|
1520 |
-
origMonth = inst.selectedMonth,
|
1521 |
-
origYear = inst.selectedYear,
|
1522 |
-
newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
|
1523 |
-
|
1524 |
-
inst.selectedDay = inst.currentDay = newDate.getDate();
|
1525 |
-
inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
|
1526 |
-
inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
|
1527 |
-
if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
|
1528 |
-
this._notifyChange(inst);
|
1529 |
-
}
|
1530 |
-
this._adjustInstDate(inst);
|
1531 |
-
if (inst.input) {
|
1532 |
-
inst.input.val(clear ? "" : this._formatDate(inst));
|
1533 |
-
}
|
1534 |
-
},
|
1535 |
-
|
1536 |
-
/* Retrieve the date(s) directly. */
|
1537 |
-
_getDate: function(inst) {
|
1538 |
-
var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
|
1539 |
-
this._daylightSavingAdjust(new Date(
|
1540 |
-
inst.currentYear, inst.currentMonth, inst.currentDay)));
|
1541 |
-
return startDate;
|
1542 |
-
},
|
1543 |
-
|
1544 |
-
/* Attach the onxxx handlers. These are declared statically so
|
1545 |
-
* they work with static code transformers like Caja.
|
1546 |
-
*/
|
1547 |
-
_attachHandlers: function(inst) {
|
1548 |
-
var stepMonths = this._get(inst, "stepMonths"),
|
1549 |
-
id = "#" + inst.id.replace( /\\\\/g, "\\" );
|
1550 |
-
inst.dpDiv.find("[data-handler]").map(function () {
|
1551 |
-
var handler = {
|
1552 |
-
prev: function () {
|
1553 |
-
$.datepicker._adjustDate(id, -stepMonths, "M");
|
1554 |
-
},
|
1555 |
-
next: function () {
|
1556 |
-
$.datepicker._adjustDate(id, +stepMonths, "M");
|
1557 |
-
},
|
1558 |
-
hide: function () {
|
1559 |
-
$.datepicker._hideDatepicker();
|
1560 |
-
},
|
1561 |
-
today: function () {
|
1562 |
-
$.datepicker._gotoToday(id);
|
1563 |
-
},
|
1564 |
-
selectDay: function () {
|
1565 |
-
$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
|
1566 |
-
return false;
|
1567 |
-
},
|
1568 |
-
selectMonth: function () {
|
1569 |
-
$.datepicker._selectMonthYear(id, this, "M");
|
1570 |
-
return false;
|
1571 |
-
},
|
1572 |
-
selectYear: function () {
|
1573 |
-
$.datepicker._selectMonthYear(id, this, "Y");
|
1574 |
-
return false;
|
1575 |
-
}
|
1576 |
-
};
|
1577 |
-
$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
|
1578 |
-
});
|
1579 |
-
},
|
1580 |
-
|
1581 |
-
/* Generate the HTML for the current state of the date picker. */
|
1582 |
-
_generateHTML: function(inst) {
|
1583 |
-
var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
|
1584 |
-
controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
|
1585 |
-
monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
|
1586 |
-
selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
|
1587 |
-
cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
|
1588 |
-
printDate, dRow, tbody, daySettings, otherMonth, unselectable,
|
1589 |
-
tempDate = new Date(),
|
1590 |
-
today = this._daylightSavingAdjust(
|
1591 |
-
new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
|
1592 |
-
isRTL = this._get(inst, "isRTL"),
|
1593 |
-
showButtonPanel = this._get(inst, "showButtonPanel"),
|
1594 |
-
hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
|
1595 |
-
navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
|
1596 |
-
numMonths = this._getNumberOfMonths(inst),
|
1597 |
-
showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
|
1598 |
-
stepMonths = this._get(inst, "stepMonths"),
|
1599 |
-
isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
|
1600 |
-
currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
|
1601 |
-
new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
|
1602 |
-
minDate = this._getMinMaxDate(inst, "min"),
|
1603 |
-
maxDate = this._getMinMaxDate(inst, "max"),
|
1604 |
-
drawMonth = inst.drawMonth - showCurrentAtPos,
|
1605 |
-
drawYear = inst.drawYear;
|
1606 |
-
|
1607 |
-
if (drawMonth < 0) {
|
1608 |
-
drawMonth += 12;
|
1609 |
-
drawYear--;
|
1610 |
-
}
|
1611 |
-
if (maxDate) {
|
1612 |
-
maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
|
1613 |
-
maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
|
1614 |
-
maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
|
1615 |
-
while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
|
1616 |
-
drawMonth--;
|
1617 |
-
if (drawMonth < 0) {
|
1618 |
-
drawMonth = 11;
|
1619 |
-
drawYear--;
|
1620 |
-
}
|
1621 |
-
}
|
1622 |
-
}
|
1623 |
-
inst.drawMonth = drawMonth;
|
1624 |
-
inst.drawYear = drawYear;
|
1625 |
-
|
1626 |
-
prevText = this._get(inst, "prevText");
|
1627 |
-
prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
|
1628 |
-
this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
|
1629 |
-
this._getFormatConfig(inst)));
|
1630 |
-
|
1631 |
-
prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
|
1632 |
-
"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
|
1633 |
-
" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
|
1634 |
-
(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
|
1635 |
-
|
1636 |
-
nextText = this._get(inst, "nextText");
|
1637 |
-
nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
|
1638 |
-
this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
|
1639 |
-
this._getFormatConfig(inst)));
|
1640 |
-
|
1641 |
-
next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
|
1642 |
-
"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
|
1643 |
-
" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
|
1644 |
-
(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
|
1645 |
-
|
1646 |
-
currentText = this._get(inst, "currentText");
|
1647 |
-
gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
|
1648 |
-
currentText = (!navigationAsDateFormat ? currentText :
|
1649 |
-
this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
|
1650 |
-
|
1651 |
-
controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
|
1652 |
-
this._get(inst, "closeText") + "</button>" : "");
|
1653 |
-
|
1654 |
-
buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
|
1655 |
-
(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
|
1656 |
-
">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
|
1657 |
-
|
1658 |
-
firstDay = parseInt(this._get(inst, "firstDay"),10);
|
1659 |
-
firstDay = (isNaN(firstDay) ? 0 : firstDay);
|
1660 |
-
|
1661 |
-
showWeek = this._get(inst, "showWeek");
|
1662 |
-
dayNames = this._get(inst, "dayNames");
|
1663 |
-
dayNamesMin = this._get(inst, "dayNamesMin");
|
1664 |
-
monthNames = this._get(inst, "monthNames");
|
1665 |
-
monthNamesShort = this._get(inst, "monthNamesShort");
|
1666 |
-
beforeShowDay = this._get(inst, "beforeShowDay");
|
1667 |
-
showOtherMonths = this._get(inst, "showOtherMonths");
|
1668 |
-
selectOtherMonths = this._get(inst, "selectOtherMonths");
|
1669 |
-
defaultDate = this._getDefaultDate(inst);
|
1670 |
-
html = "";
|
1671 |
-
dow;
|
1672 |
-
for (row = 0; row < numMonths[0]; row++) {
|
1673 |
-
group = "";
|
1674 |
-
this.maxRows = 4;
|
1675 |
-
for (col = 0; col < numMonths[1]; col++) {
|
1676 |
-
selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
|
1677 |
-
cornerClass = " ui-corner-all";
|
1678 |
-
calender = "";
|
1679 |
-
if (isMultiMonth) {
|
1680 |
-
calender += "<div class='ui-datepicker-group";
|
1681 |
-
if (numMonths[1] > 1) {
|
1682 |
-
switch (col) {
|
1683 |
-
case 0: calender += " ui-datepicker-group-first";
|
1684 |
-
cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
|
1685 |
-
case numMonths[1]-1: calender += " ui-datepicker-group-last";
|
1686 |
-
cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
|
1687 |
-
default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
|
1688 |
-
}
|
1689 |
-
}
|
1690 |
-
calender += "'>";
|
1691 |
-
}
|
1692 |
-
calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
|
1693 |
-
(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
|
1694 |
-
(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
|
1695 |
-
this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
|
1696 |
-
row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
|
1697 |
-
"</div><table class='ui-datepicker-calendar'><thead>" +
|
1698 |
-
"<tr>";
|
1699 |
-
thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
|
1700 |
-
for (dow = 0; dow < 7; dow++) { // days of the week
|
1701 |
-
day = (dow + firstDay) % 7;
|
1702 |
-
thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
|
1703 |
-
"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
|
1704 |
-
}
|
1705 |
-
calender += thead + "</tr></thead><tbody>";
|
1706 |
-
daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
|
1707 |
-
if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
|
1708 |
-
inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
|
1709 |
-
}
|
1710 |
-
leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
|
1711 |
-
curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
|
1712 |
-
numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
|
1713 |
-
this.maxRows = numRows;
|
1714 |
-
printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
|
1715 |
-
for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
|
1716 |
-
calender += "<tr>";
|
1717 |
-
tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
|
1718 |
-
this._get(inst, "calculateWeek")(printDate) + "</td>");
|
1719 |
-
for (dow = 0; dow < 7; dow++) { // create date picker days
|
1720 |
-
daySettings = (beforeShowDay ?
|
1721 |
-
beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
|
1722 |
-
otherMonth = (printDate.getMonth() !== drawMonth);
|
1723 |
-
unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
|
1724 |
-
(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
|
1725 |
-
tbody += "<td class='" +
|
1726 |
-
((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
|
1727 |
-
(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
|
1728 |
-
((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
|
1729 |
-
(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
|
1730 |
-
// or defaultDate is current printedDate and defaultDate is selectedDate
|
1731 |
-
" " + this._dayOverClass : "") + // highlight selected day
|
1732 |
-
(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
|
1733 |
-
(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
|
1734 |
-
(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
|
1735 |
-
(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
|
1736 |
-
((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "'") + "'" : "") + // cell title
|
1737 |
-
(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
|
1738 |
-
(otherMonth && !showOtherMonths ? " " : // display for other months
|
1739 |
-
(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
|
1740 |
-
(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
|
1741 |
-
(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
|
1742 |
-
(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
|
1743 |
-
"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
|
1744 |
-
printDate.setDate(printDate.getDate() + 1);
|
1745 |
-
printDate = this._daylightSavingAdjust(printDate);
|
1746 |
-
}
|
1747 |
-
calender += tbody + "</tr>";
|
1748 |
-
}
|
1749 |
-
drawMonth++;
|
1750 |
-
if (drawMonth > 11) {
|
1751 |
-
drawMonth = 0;
|
1752 |
-
drawYear++;
|
1753 |
-
}
|
1754 |
-
calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
|
1755 |
-
((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
|
1756 |
-
group += calender;
|
1757 |
-
}
|
1758 |
-
html += group;
|
1759 |
-
}
|
1760 |
-
html += buttonPanel;
|
1761 |
-
inst._keyEvent = false;
|
1762 |
-
return html;
|
1763 |
-
},
|
1764 |
-
|
1765 |
-
/* Generate the month and year header. */
|
1766 |
-
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
|
1767 |
-
secondary, monthNames, monthNamesShort) {
|
1768 |
-
|
1769 |
-
var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
|
1770 |
-
changeMonth = this._get(inst, "changeMonth"),
|
1771 |
-
changeYear = this._get(inst, "changeYear"),
|
1772 |
-
showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
|
1773 |
-
html = "<div class='ui-datepicker-title'>",
|
1774 |
-
monthHtml = "";
|
1775 |
-
|
1776 |
-
// month selection
|
1777 |
-
if (secondary || !changeMonth) {
|
1778 |
-
monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
|
1779 |
-
} else {
|
1780 |
-
inMinYear = (minDate && minDate.getFullYear() === drawYear);
|
1781 |
-
inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
|
1782 |
-
monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
|
1783 |
-
for ( month = 0; month < 12; month++) {
|
1784 |
-
if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
|
1785 |
-
monthHtml += "<option value='" + month + "'" +
|
1786 |
-
(month === drawMonth ? " selected='selected'" : "") +
|
1787 |
-
">" + monthNamesShort[month] + "</option>";
|
1788 |
-
}
|
1789 |
-
}
|
1790 |
-
monthHtml += "</select>";
|
1791 |
-
}
|
1792 |
-
|
1793 |
-
if (!showMonthAfterYear) {
|
1794 |
-
html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : "");
|
1795 |
-
}
|
1796 |
-
|
1797 |
-
// year selection
|
1798 |
-
if ( !inst.yearshtml ) {
|
1799 |
-
inst.yearshtml = "";
|
1800 |
-
if (secondary || !changeYear) {
|
1801 |
-
html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
|
1802 |
-
} else {
|
1803 |
-
// determine range of years to display
|
1804 |
-
years = this._get(inst, "yearRange").split(":");
|
1805 |
-
thisYear = new Date().getFullYear();
|
1806 |
-
determineYear = function(value) {
|
1807 |
-
var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
|
1808 |
-
(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
|
1809 |
-
parseInt(value, 10)));
|
1810 |
-
return (isNaN(year) ? thisYear : year);
|
1811 |
-
};
|
1812 |
-
year = determineYear(years[0]);
|
1813 |
-
endYear = Math.max(year, determineYear(years[1] || ""));
|
1814 |
-
year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
|
1815 |
-
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
|
1816 |
-
inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
|
1817 |
-
for (; year <= endYear; year++) {
|
1818 |
-
inst.yearshtml += "<option value='" + year + "'" +
|
1819 |
-
(year === drawYear ? " selected='selected'" : "") +
|
1820 |
-
">" + year + "</option>";
|
1821 |
-
}
|
1822 |
-
inst.yearshtml += "</select>";
|
1823 |
-
|
1824 |
-
html += inst.yearshtml;
|
1825 |
-
inst.yearshtml = null;
|
1826 |
-
}
|
1827 |
-
}
|
1828 |
-
|
1829 |
-
html += this._get(inst, "yearSuffix");
|
1830 |
-
if (showMonthAfterYear) {
|
1831 |
-
html += (secondary || !(changeMonth && changeYear) ? " " : "") + monthHtml;
|
1832 |
-
}
|
1833 |
-
html += "</div>"; // Close datepicker_header
|
1834 |
-
return html;
|
1835 |
-
},
|
1836 |
-
|
1837 |
-
/* Adjust one of the date sub-fields. */
|
1838 |
-
_adjustInstDate: function(inst, offset, period) {
|
1839 |
-
var year = inst.drawYear + (period === "Y" ? offset : 0),
|
1840 |
-
month = inst.drawMonth + (period === "M" ? offset : 0),
|
1841 |
-
day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
|
1842 |
-
date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
|
1843 |
-
|
1844 |
-
inst.selectedDay = date.getDate();
|
1845 |
-
inst.drawMonth = inst.selectedMonth = date.getMonth();
|
1846 |
-
inst.drawYear = inst.selectedYear = date.getFullYear();
|
1847 |
-
if (period === "M" || period === "Y") {
|
1848 |
-
this._notifyChange(inst);
|
1849 |
-
}
|
1850 |
-
},
|
1851 |
-
|
1852 |
-
/* Ensure a date is within any min/max bounds. */
|
1853 |
-
_restrictMinMax: function(inst, date) {
|
1854 |
-
var minDate = this._getMinMaxDate(inst, "min"),
|
1855 |
-
maxDate = this._getMinMaxDate(inst, "max"),
|
1856 |
-
newDate = (minDate && date < minDate ? minDate : date);
|
1857 |
-
return (maxDate && newDate > maxDate ? maxDate : newDate);
|
1858 |
-
},
|
1859 |
-
|
1860 |
-
/* Notify change of month/year. */
|
1861 |
-
_notifyChange: function(inst) {
|
1862 |
-
var onChange = this._get(inst, "onChangeMonthYear");
|
1863 |
-
if (onChange) {
|
1864 |
-
onChange.apply((inst.input ? inst.input[0] : null),
|
1865 |
-
[inst.selectedYear, inst.selectedMonth + 1, inst]);
|
1866 |
-
}
|
1867 |
-
},
|
1868 |
-
|
1869 |
-
/* Determine the number of months to show. */
|
1870 |
-
_getNumberOfMonths: function(inst) {
|
1871 |
-
var numMonths = this._get(inst, "numberOfMonths");
|
1872 |
-
return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
|
1873 |
-
},
|
1874 |
-
|
1875 |
-
/* Determine the current maximum date - ensure no time components are set. */
|
1876 |
-
_getMinMaxDate: function(inst, minMax) {
|
1877 |
-
return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
|
1878 |
-
},
|
1879 |
-
|
1880 |
-
/* Find the number of days in a given month. */
|
1881 |
-
_getDaysInMonth: function(year, month) {
|
1882 |
-
return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
|
1883 |
-
},
|
1884 |
-
|
1885 |
-
/* Find the day of the week of the first of a month. */
|
1886 |
-
_getFirstDayOfMonth: function(year, month) {
|
1887 |
-
return new Date(year, month, 1).getDay();
|
1888 |
-
},
|
1889 |
-
|
1890 |
-
/* Determines if we should allow a "next/prev" month display change. */
|
1891 |
-
_canAdjustMonth: function(inst, offset, curYear, curMonth) {
|
1892 |
-
var numMonths = this._getNumberOfMonths(inst),
|
1893 |
-
date = this._daylightSavingAdjust(new Date(curYear,
|
1894 |
-
curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
|
1895 |
-
|
1896 |
-
if (offset < 0) {
|
1897 |
-
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
|
1898 |
-
}
|
1899 |
-
return this._isInRange(inst, date);
|
1900 |
-
},
|
1901 |
-
|
1902 |
-
/* Is the given date in the accepted range? */
|
1903 |
-
_isInRange: function(inst, date) {
|
1904 |
-
var yearSplit, currentYear,
|
1905 |
-
minDate = this._getMinMaxDate(inst, "min"),
|
1906 |
-
maxDate = this._getMinMaxDate(inst, "max"),
|
1907 |
-
minYear = null,
|
1908 |
-
maxYear = null,
|
1909 |
-
years = this._get(inst, "yearRange");
|
1910 |
-
if (years){
|
1911 |
-
yearSplit = years.split(":");
|
1912 |
-
currentYear = new Date().getFullYear();
|
1913 |
-
minYear = parseInt(yearSplit[0], 10);
|
1914 |
-
maxYear = parseInt(yearSplit[1], 10);
|
1915 |
-
if ( yearSplit[0].match(/[+\-].*/) ) {
|
1916 |
-
minYear += currentYear;
|
1917 |
-
}
|
1918 |
-
if ( yearSplit[1].match(/[+\-].*/) ) {
|
1919 |
-
maxYear += currentYear;
|
1920 |
-
}
|
1921 |
-
}
|
1922 |
-
|
1923 |
-
return ((!minDate || date.getTime() >= minDate.getTime()) &&
|
1924 |
-
(!maxDate || date.getTime() <= maxDate.getTime()) &&
|
1925 |
-
(!minYear || date.getFullYear() >= minYear) &&
|
1926 |
-
(!maxYear || date.getFullYear() <= maxYear));
|
1927 |
-
},
|
1928 |
-
|
1929 |
-
/* Provide the configuration settings for formatting/parsing. */
|
1930 |
-
_getFormatConfig: function(inst) {
|
1931 |
-
var shortYearCutoff = this._get(inst, "shortYearCutoff");
|
1932 |
-
shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
|
1933 |
-
new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
|
1934 |
-
return {shortYearCutoff: shortYearCutoff,
|
1935 |
-
dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
|
1936 |
-
monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
|
1937 |
-
},
|
1938 |
-
|
1939 |
-
/* Format the given date for display. */
|
1940 |
-
_formatDate: function(inst, day, month, year) {
|
1941 |
-
if (!day) {
|
1942 |
-
inst.currentDay = inst.selectedDay;
|
1943 |
-
inst.currentMonth = inst.selectedMonth;
|
1944 |
-
inst.currentYear = inst.selectedYear;
|
1945 |
-
}
|
1946 |
-
var date = (day ? (typeof day === "object" ? day :
|
1947 |
-
this._daylightSavingAdjust(new Date(year, month, day))) :
|
1948 |
-
this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
|
1949 |
-
return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
|
1950 |
-
}
|
1951 |
-
});
|
1952 |
-
|
1953 |
-
/*
|
1954 |
-
* Bind hover events for datepicker elements.
|
1955 |
-
* Done via delegate so the binding only occurs once in the lifetime of the parent div.
|
1956 |
-
* Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
|
1957 |
-
*/
|
1958 |
-
function bindHover(dpDiv) {
|
1959 |
-
var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
|
1960 |
-
return dpDiv.delegate(selector, "mouseout", function() {
|
1961 |
-
$(this).removeClass("ui-state-hover");
|
1962 |
-
if (this.className.indexOf("ui-datepicker-prev") !== -1) {
|
1963 |
-
$(this).removeClass("ui-datepicker-prev-hover");
|
1964 |
-
}
|
1965 |
-
if (this.className.indexOf("ui-datepicker-next") !== -1) {
|
1966 |
-
$(this).removeClass("ui-datepicker-next-hover");
|
1967 |
-
}
|
1968 |
-
})
|
1969 |
-
.delegate(selector, "mouseover", function(){
|
1970 |
-
if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {
|
1971 |
-
$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
|
1972 |
-
$(this).addClass("ui-state-hover");
|
1973 |
-
if (this.className.indexOf("ui-datepicker-prev") !== -1) {
|
1974 |
-
$(this).addClass("ui-datepicker-prev-hover");
|
1975 |
-
}
|
1976 |
-
if (this.className.indexOf("ui-datepicker-next") !== -1) {
|
1977 |
-
$(this).addClass("ui-datepicker-next-hover");
|
1978 |
-
}
|
1979 |
-
}
|
1980 |
-
});
|
1981 |
-
}
|
1982 |
-
|
1983 |
-
/* jQuery extend now ignores nulls! */
|
1984 |
-
function extendRemove(target, props) {
|
1985 |
-
$.extend(target, props);
|
1986 |
-
for (var name in props) {
|
1987 |
-
if (props[name] == null) {
|
1988 |
-
target[name] = props[name];
|
1989 |
-
}
|
1990 |
-
}
|
1991 |
-
return target;
|
1992 |
-
}
|
1993 |
-
|
1994 |
-
/* Invoke the datepicker functionality.
|
1995 |
-
@param options string - a command, optionally followed by additional parameters or
|
1996 |
-
Object - settings for attaching new datepicker functionality
|
1997 |
-
@return jQuery object */
|
1998 |
-
$.fn.datepicker = function(options){
|
1999 |
-
|
2000 |
-
/* Verify an empty collection wasn't passed - Fixes #6976 */
|
2001 |
-
if ( !this.length ) {
|
2002 |
-
return this;
|
2003 |
-
}
|
2004 |
-
|
2005 |
-
/* Initialise the date picker. */
|
2006 |
-
if (!$.datepicker.initialized) {
|
2007 |
-
$(document).mousedown($.datepicker._checkExternalClick);
|
2008 |
-
$.datepicker.initialized = true;
|
2009 |
-
}
|
2010 |
-
|
2011 |
-
/* Append datepicker main container to body if not exist. */
|
2012 |
-
if ($("#"+$.datepicker._mainDivId).length === 0) {
|
2013 |
-
$("body").append($.datepicker.dpDiv);
|
2014 |
-
}
|
2015 |
-
|
2016 |
-
var otherArgs = Array.prototype.slice.call(arguments, 1);
|
2017 |
-
if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
|
2018 |
-
return $.datepicker["_" + options + "Datepicker"].
|
2019 |
-
apply($.datepicker, [this[0]].concat(otherArgs));
|
2020 |
-
}
|
2021 |
-
if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
|
2022 |
-
return $.datepicker["_" + options + "Datepicker"].
|
2023 |
-
apply($.datepicker, [this[0]].concat(otherArgs));
|
2024 |
-
}
|
2025 |
-
return this.each(function() {
|
2026 |
-
typeof options === "string" ?
|
2027 |
-
$.datepicker["_" + options + "Datepicker"].
|
2028 |
-
apply($.datepicker, [this].concat(otherArgs)) :
|
2029 |
-
$.datepicker._attachDatepicker(this, options);
|
2030 |
-
});
|
2031 |
-
};
|
2032 |
-
|
2033 |
-
$.datepicker = new Datepicker(); // singleton instance
|
2034 |
-
$.datepicker.initialized = false;
|
2035 |
-
$.datepicker.uuid = new Date().getTime();
|
2036 |
-
$.datepicker.version = "1.10.4";
|
2037 |
-
|
2038 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
7 |
-
convertNoticesToExceptions = "true"
|
8 |
-
convertWarningsToExceptions = "true"
|
9 |
-
syntaxCheck = "false"
|
10 |
-
verbose = "true"
|
11 |
-
>
|
12 |
-
<testsuites>
|
13 |
-
<!-- Default test suite to run all tests -->
|
14 |
-
<testsuite name="BadgeOS Test Suite">
|
15 |
-
<directory suffix=".php">./tests/phpunit/tests</directory>
|
16 |
-
</testsuite>
|
17 |
-
</testsuites>
|
18 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/style.css
DELETED
@@ -1,652 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* dkrpt Styling
|
3 |
-
*/
|
4 |
-
|
5 |
-
table.dkrpt_metabox {
|
6 |
-
clear: both;
|
7 |
-
}
|
8 |
-
|
9 |
-
table.dkrpt_metabox > tr:first-of-type > td,
|
10 |
-
table.dkrpt_metabox > tr:first-of-type > th,
|
11 |
-
table.dkrpt_metabox tbody > tr:first-of-type > td,
|
12 |
-
table.dkrpt_metabox tbody > tr:first-of-type > th,
|
13 |
-
.post-php table.dkrpt_metabox .dkrpt-nested-table td,
|
14 |
-
.post-new-php table.dkrpt_metabox .dkrpt-nested-table td,
|
15 |
-
.post-php table.dkrpt_metabox .repeatable-group th,
|
16 |
-
.post-new-php table.dkrpt_metabox .repeatable-group th,
|
17 |
-
.post-php table.dkrpt_metabox .repeatable-group:first-of-type,
|
18 |
-
.post-new-php table.dkrpt_metabox .repeatable-group:first-of-type {
|
19 |
-
border: 0;
|
20 |
-
}
|
21 |
-
|
22 |
-
.post-php table.dkrpt_metabox td,
|
23 |
-
.post-new-php table.dkrpt_metabox td,
|
24 |
-
.post-php table.dkrpt_metabox th,
|
25 |
-
.post-new-php table.dkrpt_metabox th,
|
26 |
-
.post-php table.dkrpt_metabox .repeatable-group,
|
27 |
-
.post-new-php table.dkrpt_metabox .repeatable-group,
|
28 |
-
.post-php table.dkrpt_metabox .repeatable-group,
|
29 |
-
.post-new-php table.dkrpt_metabox .repeatable-group {
|
30 |
-
border-top: 1px solid #E9E9E9;
|
31 |
-
}
|
32 |
-
|
33 |
-
.repeatable-group th {
|
34 |
-
padding: 0px;
|
35 |
-
}
|
36 |
-
|
37 |
-
.repeatable-group .shift-rows {
|
38 |
-
text-decoration: none;
|
39 |
-
margin-right: 5px;
|
40 |
-
font-size: 1.2em;
|
41 |
-
}
|
42 |
-
|
43 |
-
.repeatable-group .dkrpt_upload_button {
|
44 |
-
margin: 3px 0px 0px 9px !important;
|
45 |
-
}
|
46 |
-
|
47 |
-
#poststuff .repeatable-group h2 {
|
48 |
-
margin: 0;
|
49 |
-
}
|
50 |
-
|
51 |
-
.dkrpt-group-title h4 {
|
52 |
-
font-size: 1.8em;
|
53 |
-
margin-top: 0px;
|
54 |
-
margin-bottom: 0px;
|
55 |
-
border-bottom:solid 7px whitesmoke;
|
56 |
-
text-align: center;
|
57 |
-
padding: 9px 10px;
|
58 |
-
font-weight:400;
|
59 |
-
color: black;
|
60 |
-
}
|
61 |
-
|
62 |
-
.post-php table.dkrpt_metabox th, .post-new-php table.dkrpt_metabox th {
|
63 |
-
text-align: right;
|
64 |
-
font-weight:bold;
|
65 |
-
}
|
66 |
-
|
67 |
-
.post-php table.dkrpt_metabox table th, .post-new-php table.dkrpt_metabox table th {
|
68 |
-
text-align: left;
|
69 |
-
}
|
70 |
-
|
71 |
-
table.dkrpt_metabox th label {
|
72 |
-
padding-left:10px;
|
73 |
-
margin-top:14px;
|
74 |
-
display:block;
|
75 |
-
font-weight:400;
|
76 |
-
font-size:13px;
|
77 |
-
color:#333;
|
78 |
-
}
|
79 |
-
|
80 |
-
p.dkrpt_metabox_description {
|
81 |
-
color: #AAA;
|
82 |
-
font-style: italic;
|
83 |
-
margin: 2px 0 !important
|
84 |
-
}
|
85 |
-
|
86 |
-
span.dkrpt_metabox_description {
|
87 |
-
color: #AAA;
|
88 |
-
font-style: italic
|
89 |
-
}
|
90 |
-
|
91 |
-
table.dkrpt_metabox input, table.dkrpt_metabox textarea {
|
92 |
-
font-size:14px;
|
93 |
-
padding: 5px;
|
94 |
-
}
|
95 |
-
|
96 |
-
table.dkrpt_metabox input[type=text], table.dkrpt_metabox textarea {
|
97 |
-
width: 97%;
|
98 |
-
}
|
99 |
-
|
100 |
-
table.dkrpt_metabox textarea.dkrpt_textarea_code {
|
101 |
-
font-family: Consolas,Monaco,monospace;
|
102 |
-
line-height: 16px;
|
103 |
-
}
|
104 |
-
|
105 |
-
table.dkrpt_metabox input.dkrpt_text_small {
|
106 |
-
width: 100px;
|
107 |
-
margin-right: 15px
|
108 |
-
}
|
109 |
-
|
110 |
-
table.dkrpt_metabox input.dkrpt_timepicker {
|
111 |
-
width: 100px;
|
112 |
-
margin-right: 15px
|
113 |
-
}
|
114 |
-
|
115 |
-
table.dkrpt_metabox input.dkrpt_text_money {
|
116 |
-
width: 90px;
|
117 |
-
margin-right: 15px
|
118 |
-
}
|
119 |
-
|
120 |
-
table.dkrpt_metabox input.dkrpt_text_medium {
|
121 |
-
width: 230px;
|
122 |
-
margin-right: 15px
|
123 |
-
}
|
124 |
-
|
125 |
-
table.dkrpt_metabox input.dkrpt_upload_file {
|
126 |
-
width: 65%;
|
127 |
-
}
|
128 |
-
|
129 |
-
table.dkrpt_metabox input.ed_button{
|
130 |
-
padding:2px 4px
|
131 |
-
}
|
132 |
-
|
133 |
-
table.dkrpt_metabox li {
|
134 |
-
font-size:14px;
|
135 |
-
margin: 1px 0 5px 0;
|
136 |
-
line-height: 16px;
|
137 |
-
}
|
138 |
-
|
139 |
-
table.dkrpt_metabox ul {
|
140 |
-
padding-top:5px;
|
141 |
-
margin: 0;
|
142 |
-
}
|
143 |
-
|
144 |
-
table.dkrpt_metabox select {
|
145 |
-
font-size:14px;
|
146 |
-
margin-top: 3px
|
147 |
-
}
|
148 |
-
|
149 |
-
table.dkrpt_metabox input:focus, table.dkrpt_metabox textarea:focus {
|
150 |
-
background: #fffff8
|
151 |
-
}
|
152 |
-
|
153 |
-
.dkrpt_metabox_title {
|
154 |
-
margin: 0 0 5px 0;
|
155 |
-
padding: 5px 0 0 0;
|
156 |
-
}
|
157 |
-
|
158 |
-
.edit-tags-php .dkrpt_metabox_title, .profile-php .dkrpt_metabox_title, .user-edit-php .dkrpt_metabox_title {
|
159 |
-
margin-left: -10px;
|
160 |
-
}
|
161 |
-
|
162 |
-
.dkrpt-inline ul {
|
163 |
-
padding: 4px 0 0 0
|
164 |
-
}
|
165 |
-
|
166 |
-
.dkrpt-inline li {display: inline-block;
|
167 |
-
padding-right: 18px
|
168 |
-
}
|
169 |
-
|
170 |
-
table.dkrpt_metabox input[type="radio"] {
|
171 |
-
margin: 0 5px 0 0;
|
172 |
-
padding: 0
|
173 |
-
}
|
174 |
-
|
175 |
-
table.dkrpt_metabox input[type="checkbox"] {
|
176 |
-
margin: 0 5px 0 0;
|
177 |
-
padding: 0
|
178 |
-
}
|
179 |
-
|
180 |
-
table.dkrpt_metabox .mceLayout {
|
181 |
-
border:1px solid #DFDFDF !important
|
182 |
-
}
|
183 |
-
|
184 |
-
table.dkrpt_metabox .mceIframeContainer {
|
185 |
-
background:#FFF
|
186 |
-
}
|
187 |
-
|
188 |
-
table.dkrpt_metabox .meta_mce {
|
189 |
-
width:97%
|
190 |
-
}
|
191 |
-
|
192 |
-
table.dkrpt_metabox .meta_mce textarea {
|
193 |
-
width:100%
|
194 |
-
}
|
195 |
-
|
196 |
-
table.dkrpt_metabox .dkrpt_media_status {
|
197 |
-
margin: 10px 0 0 0
|
198 |
-
}
|
199 |
-
|
200 |
-
table.dkrpt_metabox .dkrpt_media_status .img_status {
|
201 |
-
clear: none;
|
202 |
-
float: left;
|
203 |
-
display: inline-block;
|
204 |
-
margin-right: 10px;
|
205 |
-
width: auto;
|
206 |
-
}
|
207 |
-
|
208 |
-
table.dkrpt_metabox .dkrpt-type-file_list .dkrpt_media_status .img_status {
|
209 |
-
clear: none;
|
210 |
-
float: left;
|
211 |
-
margin-right: 10px;
|
212 |
-
width: auto;
|
213 |
-
}
|
214 |
-
|
215 |
-
table.dkrpt_metabox .dkrpt_media_status .img_status, table.dkrpt_metabox .dkrpt_media_status .embed_status {
|
216 |
-
position: relative;
|
217 |
-
}
|
218 |
-
|
219 |
-
table.dkrpt_metabox .dkrpt_media_status .img_status img, table.dkrpt_metabox .dkrpt_media_status .embed_status {
|
220 |
-
border:1px solid #DFDFDF;
|
221 |
-
background: #FAFAFA;
|
222 |
-
max-width:350px;
|
223 |
-
padding: 5px;
|
224 |
-
-moz-border-radius: 2px;
|
225 |
-
border-radius: 2px
|
226 |
-
}
|
227 |
-
|
228 |
-
table.dkrpt_metabox .dkrpt_media_status .embed_status {
|
229 |
-
float: left;
|
230 |
-
max-width:800px
|
231 |
-
}
|
232 |
-
|
233 |
-
table.dkrpt_metabox .dkrpt_media_status .img_status .dkrpt_remove_file_button, table.dkrpt_metabox .dkrpt_media_status .embed_status .dkrpt_remove_file_button {
|
234 |
-
text-indent: -9999px;
|
235 |
-
background: url(images/ico-delete.png);
|
236 |
-
width: 16px;
|
237 |
-
height: 16px;
|
238 |
-
position: absolute;
|
239 |
-
top: -5px;
|
240 |
-
left: -5px
|
241 |
-
}
|
242 |
-
|
243 |
-
table.dkrpt_metabox .attach_list li {
|
244 |
-
clear: both;
|
245 |
-
display: inline-block;
|
246 |
-
margin-bottom: 25px;
|
247 |
-
width: 100%;
|
248 |
-
}
|
249 |
-
|
250 |
-
table.dkrpt_metabox .attach_list li img {
|
251 |
-
float: left;
|
252 |
-
margin-right: 10px;
|
253 |
-
}
|
254 |
-
|
255 |
-
/**
|
256 |
-
* Sidebar placement adjustments
|
257 |
-
*/
|
258 |
-
.inner-sidebar table.dkrpt_metabox input[type=text],
|
259 |
-
#side-sortables table.dkrpt_metabox input[type=text],
|
260 |
-
table.dkrpt_metabox textarea {
|
261 |
-
width: 95%;
|
262 |
-
}
|
263 |
-
|
264 |
-
.inner-sidebar table.dkrpt_metabox .dkrpt_media_status .img_status img,
|
265 |
-
#side-sortables table.dkrpt_metabox .dkrpt_media_status .img_status img,
|
266 |
-
.inner-sidebar table.dkrpt_metabox .dkrpt_media_status .embed_status img,
|
267 |
-
#side-sortables table.dkrpt_metabox .dkrpt_media_status .embed_status img {
|
268 |
-
width: 90%;
|
269 |
-
}
|
270 |
-
|
271 |
-
.inner-sidebar table.dkrpt_metabox label,
|
272 |
-
#side-sortables table.dkrpt_metabox label {
|
273 |
-
display: block;
|
274 |
-
font-weight: bold;
|
275 |
-
padding: 0 0 5px;
|
276 |
-
}
|
277 |
-
|
278 |
-
.inner-sidebar table.dkrpt_metabox .dkrpt_list label,
|
279 |
-
#side-sortables table.dkrpt_metabox .dkrpt_list label {
|
280 |
-
display: inline;
|
281 |
-
font-weight: normal;
|
282 |
-
}
|
283 |
-
|
284 |
-
.inner-sidebar table.dkrpt_metabox .dkrpt_metabox_description,
|
285 |
-
#side-sortables table.dkrpt_metabox .dkrpt_metabox_description {
|
286 |
-
display: block;
|
287 |
-
padding: 7px 0 0;
|
288 |
-
}
|
289 |
-
|
290 |
-
.inner-sidebar table.dkrpt_metabox .dkrpt_metabox_title,
|
291 |
-
#side-sortables table.dkrpt_metabox .dkrpt_metabox_title {
|
292 |
-
font-size: 1.2em;
|
293 |
-
font-style: italic;
|
294 |
-
}
|
295 |
-
|
296 |
-
.postbox table.dkrpt_metabox .dkrpt-spinner {
|
297 |
-
float: left;
|
298 |
-
}
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Color picker
|
302 |
-
*/
|
303 |
-
table.dkrpt_metabox .wp-color-result, table.dkrpt_metabox .wp-picker-input-wrap {
|
304 |
-
vertical-align: middle;
|
305 |
-
}
|
306 |
-
|
307 |
-
table.dkrpt_metabox .wp-color-result, table.dkrpt_metabox .wp-picker-container {
|
308 |
-
margin: 0 10px 0 0;
|
309 |
-
}
|
310 |
-
|
311 |
-
|
312 |
-
/**
|
313 |
-
* Timepicker
|
314 |
-
*/
|
315 |
-
div.time-picker {
|
316 |
-
position: absolute;
|
317 |
-
height: 191px;
|
318 |
-
width:6em;
|
319 |
-
/* needed for IE */overflow: auto;
|
320 |
-
background: #fff;
|
321 |
-
border: 1px solid #aaa;
|
322 |
-
z-index: 99;
|
323 |
-
margin: 0
|
324 |
-
}
|
325 |
-
|
326 |
-
div.time-picker-12hours {
|
327 |
-
width:8em; /* needed for IE */
|
328 |
-
}
|
329 |
-
|
330 |
-
div.time-picker ul {
|
331 |
-
list-style-type: none;
|
332 |
-
margin: 0;
|
333 |
-
padding: 0;
|
334 |
-
}
|
335 |
-
|
336 |
-
div.time-picker li {
|
337 |
-
cursor: pointer;
|
338 |
-
height: 10px;
|
339 |
-
font: 14px/1 Helvetica, Arial, sans-serif;
|
340 |
-
padding: 4px 3px;
|
341 |
-
}
|
342 |
-
|
343 |
-
div.time-picker li.selected {
|
344 |
-
background: #0063CE;
|
345 |
-
color: #fff;
|
346 |
-
}
|
347 |
-
|
348 |
-
/**
|
349 |
-
* jQuery UI CSS Framework 1.8.16
|
350 |
-
*
|
351 |
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
352 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
353 |
-
* http://jquery.org/license
|
354 |
-
*
|
355 |
-
* http://docs.jquery.com/UI/Theming/API
|
356 |
-
*/
|
357 |
-
.dkrpt_element .ui-helper-hidden { display: none; }
|
358 |
-
.dkrpt_element .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
359 |
-
.dkrpt_element .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
360 |
-
.dkrpt_element .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
361 |
-
.dkrpt_element .ui-helper-clearfix { display: inline-block; }
|
362 |
-
* html .ui-helper-clearfix { height:1%; }
|
363 |
-
.dkrpt_element .ui-helper-clearfix { display:block; }
|
364 |
-
.dkrpt_element .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
365 |
-
.dkrpt_element .ui-state-disabled { cursor: default !important; }
|
366 |
-
.dkrpt_element .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
367 |
-
.dkrpt_element .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
368 |
-
.dkrpt_element .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
369 |
-
.dkrpt_element .ui-widget .ui-widget { font-size: 1em; }
|
370 |
-
.dkrpt_element .ui-widget input, .dkrpt_element .ui-widget select, .dkrpt_element .ui-widget textarea, .dkrpt_element .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
371 |
-
.dkrpt_element .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
372 |
-
.dkrpt_element .ui-widget-content a { color: #222222; }
|
373 |
-
.dkrpt_element .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
374 |
-
.dkrpt_element .ui-widget-header a { color: #222222; }
|
375 |
-
.dkrpt_element .ui-state-default, .dkrpt_element .ui-widget-content .ui-state-default, .dkrpt_element .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
376 |
-
.dkrpt_element .ui-state-default a, .dkrpt_element .ui-state-default a:link, .dkrpt_element .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
377 |
-
.dkrpt_element .ui-state-hover, .dkrpt_element .ui-widget-content .ui-state-hover, .dkrpt_element .ui-widget-header .ui-state-hover, .dkrpt_element .ui-state-focus, .dkrpt_element .ui-widget-content .ui-state-focus, .dkrpt_element .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
378 |
-
.dkrpt_element .ui-state-hover a, .dkrpt_element .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
379 |
-
.dkrpt_element .ui-state-active, .dkrpt_element .ui-widget-content .ui-state-active, .dkrpt_element .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
380 |
-
.dkrpt_element .ui-state-active a, .dkrpt_element .ui-state-active a:link, .dkrpt_element .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
381 |
-
.dkrpt_element .ui-widget :active { outline: none; }
|
382 |
-
.dkrpt_element .ui-state-highlight, .dkrpt_element .ui-widget-content .ui-state-highlight, .dkrpt_element .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
383 |
-
.dkrpt_element .ui-state-highlight a, .dkrpt_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
384 |
-
.dkrpt_element .ui-state-error, .dkrpt_element .ui-widget-content .ui-state-error, .dkrpt_element .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
385 |
-
.dkrpt_element .ui-state-error a, .dkrpt_element .ui-widget-content .ui-state-error a, .dkrpt_element .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
386 |
-
.dkrpt_element .ui-state-error-text, .dkrpt_element .ui-widget-content .ui-state-error-text, .dkrpt_element .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
387 |
-
.dkrpt_element .ui-priority-primary, .dkrpt_element .ui-widget-content .ui-priority-primary, .dkrpt_element .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
388 |
-
.dkrpt_element .ui-priority-secondary, .dkrpt_element .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
389 |
-
.dkrpt_element .ui-state-disabled, .dkrpt_element .ui-widget-content .ui-state-disabled, .dkrpt_element .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
390 |
-
.dkrpt_element .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
|
391 |
-
.dkrpt_element .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
392 |
-
.dkrpt_element .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
393 |
-
.dkrpt_element .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
|
394 |
-
.dkrpt_element .ui-state-hover .ui-icon, .dkrpt_element .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
395 |
-
.dkrpt_element .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
396 |
-
.dkrpt_element .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
397 |
-
.dkrpt_element .ui-state-error .ui-icon, .dkrpt_element .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
398 |
-
.dkrpt_element .ui-icon-carat-1-n { background-position: 0 0; }
|
399 |
-
.dkrpt_element .ui-icon-carat-1-ne { background-position: -16px 0; }
|
400 |
-
.dkrpt_element .ui-icon-carat-1-e { background-position: -32px 0; }
|
401 |
-
.dkrpt_element .ui-icon-carat-1-se { background-position: -48px 0; }
|
402 |
-
.dkrpt_element .ui-icon-carat-1-s { background-position: -64px 0; }
|
403 |
-
.dkrpt_element .ui-icon-carat-1-sw { background-position: -80px 0; }
|
404 |
-
.dkrpt_element .ui-icon-carat-1-w { background-position: -96px 0; }
|
405 |
-
.dkrpt_element .ui-icon-carat-1-nw { background-position: -112px 0; }
|
406 |
-
.dkrpt_element .ui-icon-carat-2-n-s { background-position: -128px 0; }
|
407 |
-
.dkrpt_element .ui-icon-carat-2-e-w { background-position: -144px 0; }
|
408 |
-
.dkrpt_element .ui-icon-triangle-1-n { background-position: 0 -16px; }
|
409 |
-
.dkrpt_element .ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
410 |
-
.dkrpt_element .ui-icon-triangle-1-e { background-position: -32px -16px; }
|
411 |
-
.dkrpt_element .ui-icon-triangle-1-se { background-position: -48px -16px; }
|
412 |
-
.dkrpt_element .ui-icon-triangle-1-s { background-position: -64px -16px; }
|
413 |
-
.dkrpt_element .ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
414 |
-
.dkrpt_element .ui-icon-triangle-1-w { background-position: -96px -16px; }
|
415 |
-
.dkrpt_element .ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
416 |
-
.dkrpt_element .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
417 |
-
.dkrpt_element .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
418 |
-
.dkrpt_element .ui-icon-arrow-1-n { background-position: 0 -32px; }
|
419 |
-
.dkrpt_element .ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
420 |
-
.dkrpt_element .ui-icon-arrow-1-e { background-position: -32px -32px; }
|
421 |
-
.dkrpt_element .ui-icon-arrow-1-se { background-position: -48px -32px; }
|
422 |
-
.dkrpt_element .ui-icon-arrow-1-s { background-position: -64px -32px; }
|
423 |
-
.dkrpt_element .ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
424 |
-
.dkrpt_element .ui-icon-arrow-1-w { background-position: -96px -32px; }
|
425 |
-
.dkrpt_element .ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
426 |
-
.dkrpt_element .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
427 |
-
.dkrpt_element .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
428 |
-
.dkrpt_element .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
429 |
-
.dkrpt_element .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
430 |
-
.dkrpt_element .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
431 |
-
.dkrpt_element .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
432 |
-
.dkrpt_element .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
433 |
-
.dkrpt_element .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
434 |
-
.dkrpt_element .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
435 |
-
.dkrpt_element .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
436 |
-
.dkrpt_element .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
437 |
-
.dkrpt_element .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
438 |
-
.dkrpt_element .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
439 |
-
.dkrpt_element .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
440 |
-
.dkrpt_element .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
441 |
-
.dkrpt_element .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
442 |
-
.dkrpt_element .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
443 |
-
.dkrpt_element .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
444 |
-
.dkrpt_element .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
445 |
-
.dkrpt_element .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
446 |
-
.dkrpt_element .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
447 |
-
.dkrpt_element .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
448 |
-
.dkrpt_element .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
449 |
-
.dkrpt_element .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
450 |
-
.dkrpt_element .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
451 |
-
.dkrpt_element .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
452 |
-
.dkrpt_element .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
453 |
-
.dkrpt_element .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
454 |
-
.dkrpt_element .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
455 |
-
.dkrpt_element .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
456 |
-
.dkrpt_element .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
457 |
-
.dkrpt_element .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
458 |
-
.dkrpt_element .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
459 |
-
.dkrpt_element .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
460 |
-
.dkrpt_element .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
461 |
-
.dkrpt_element .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
462 |
-
.dkrpt_element .ui-icon-arrow-4 { background-position: 0 -80px; }
|
463 |
-
.dkrpt_element .ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
464 |
-
.dkrpt_element .ui-icon-extlink { background-position: -32px -80px; }
|
465 |
-
.dkrpt_element .ui-icon-newwin { background-position: -48px -80px; }
|
466 |
-
.dkrpt_element .ui-icon-refresh { background-position: -64px -80px; }
|
467 |
-
.dkrpt_element .ui-icon-shuffle { background-position: -80px -80px; }
|
468 |
-
.dkrpt_element .ui-icon-transfer-e-w { background-position: -96px -80px; }
|
469 |
-
.dkrpt_element .ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
470 |
-
.dkrpt_element .ui-icon-folder-collapsed { background-position: 0 -96px; }
|
471 |
-
.dkrpt_element .ui-icon-folder-open { background-position: -16px -96px; }
|
472 |
-
.dkrpt_element .ui-icon-document { background-position: -32px -96px; }
|
473 |
-
.dkrpt_element .ui-icon-document-b { background-position: -48px -96px; }
|
474 |
-
.dkrpt_element .ui-icon-note { background-position: -64px -96px; }
|
475 |
-
.dkrpt_element .ui-icon-mail-closed { background-position: -80px -96px; }
|
476 |
-
.dkrpt_element .ui-icon-mail-open { background-position: -96px -96px; }
|
477 |
-
.dkrpt_element .ui-icon-suitcase { background-position: -112px -96px; }
|
478 |
-
.dkrpt_element .ui-icon-comment { background-position: -128px -96px; }
|
479 |
-
.dkrpt_element .ui-icon-person { background-position: -144px -96px; }
|
480 |
-
.dkrpt_element .ui-icon-print { background-position: -160px -96px; }
|
481 |
-
.dkrpt_element .ui-icon-trash { background-position: -176px -96px; }
|
482 |
-
.dkrpt_element .ui-icon-locked { background-position: -192px -96px; }
|
483 |
-
.dkrpt_element .ui-icon-unlocked { background-position: -208px -96px; }
|
484 |
-
.dkrpt_element .ui-icon-bookmark { background-position: -224px -96px; }
|
485 |
-
.dkrpt_element .ui-icon-tag { background-position: -240px -96px; }
|
486 |
-
.dkrpt_element .ui-icon-home { background-position: 0 -112px; }
|
487 |
-
.dkrpt_element .ui-icon-flag { background-position: -16px -112px; }
|
488 |
-
.dkrpt_element .ui-icon-calendar { background-position: -32px -112px; }
|
489 |
-
.dkrpt_element .ui-icon-cart { background-position: -48px -112px; }
|
490 |
-
.dkrpt_element .ui-icon-pencil { background-position: -64px -112px; }
|
491 |
-
.dkrpt_element .ui-icon-clock { background-position: -80px -112px; }
|
492 |
-
.dkrpt_element .ui-icon-disk { background-position: -96px -112px; }
|
493 |
-
.dkrpt_element .ui-icon-calculator { background-position: -112px -112px; }
|
494 |
-
.dkrpt_element .ui-icon-zoomin { background-position: -128px -112px; }
|
495 |
-
.dkrpt_element .ui-icon-zoomout { background-position: -144px -112px; }
|
496 |
-
.dkrpt_element .ui-icon-search { background-position: -160px -112px; }
|
497 |
-
.dkrpt_element .ui-icon-wrench { background-position: -176px -112px; }
|
498 |
-
.dkrpt_element .ui-icon-gear { background-position: -192px -112px; }
|
499 |
-
.dkrpt_element .ui-icon-heart { background-position: -208px -112px; }
|
500 |
-
.dkrpt_element .ui-icon-star { background-position: -224px -112px; }
|
501 |
-
.dkrpt_element .ui-icon-link { background-position: -240px -112px; }
|
502 |
-
.dkrpt_element .ui-icon-cancel { background-position: 0 -128px; }
|
503 |
-
.dkrpt_element .ui-icon-plus { background-position: -16px -128px; }
|
504 |
-
.dkrpt_element .ui-icon-plusthick { background-position: -32px -128px; }
|
505 |
-
.dkrpt_element .ui-icon-minus { background-position: -48px -128px; }
|
506 |
-
.dkrpt_element .ui-icon-minusthick { background-position: -64px -128px; }
|
507 |
-
.dkrpt_element .ui-icon-close { background-position: -80px -128px; }
|
508 |
-
.dkrpt_element .ui-icon-closethick { background-position: -96px -128px; }
|
509 |
-
.dkrpt_element .ui-icon-key { background-position: -112px -128px; }
|
510 |
-
.dkrpt_element .ui-icon-lightbulb { background-position: -128px -128px; }
|
511 |
-
.dkrpt_element .ui-icon-scissors { background-position: -144px -128px; }
|
512 |
-
.dkrpt_element .ui-icon-clipboard { background-position: -160px -128px; }
|
513 |
-
.dkrpt_element .ui-icon-copy { background-position: -176px -128px; }
|
514 |
-
.dkrpt_element .ui-icon-contact { background-position: -192px -128px; }
|
515 |
-
.dkrpt_element .ui-icon-image { background-position: -208px -128px; }
|
516 |
-
.dkrpt_element .ui-icon-video { background-position: -224px -128px; }
|
517 |
-
.dkrpt_element .ui-icon-script { background-position: -240px -128px; }
|
518 |
-
.dkrpt_element .ui-icon-alert { background-position: 0 -144px; }
|
519 |
-
.dkrpt_element .ui-icon-info { background-position: -16px -144px; }
|
520 |
-
.dkrpt_element .ui-icon-notice { background-position: -32px -144px; }
|
521 |
-
.dkrpt_element .ui-icon-help { background-position: -48px -144px; }
|
522 |
-
.dkrpt_element .ui-icon-check { background-position: -64px -144px; }
|
523 |
-
.dkrpt_element .ui-icon-bullet { background-position: -80px -144px; }
|
524 |
-
.dkrpt_element .ui-icon-radio-off { background-position: -96px -144px; }
|
525 |
-
.dkrpt_element .ui-icon-radio-on { background-position: -112px -144px; }
|
526 |
-
.dkrpt_element .ui-icon-pin-w { background-position: -128px -144px; }
|
527 |
-
.dkrpt_element .ui-icon-pin-s { background-position: -144px -144px; }
|
528 |
-
.dkrpt_element .ui-icon-play { background-position: 0 -160px; }
|
529 |
-
.dkrpt_element .ui-icon-pause { background-position: -16px -160px; }
|
530 |
-
.dkrpt_element .ui-icon-seek-next { background-position: -32px -160px; }
|
531 |
-
.dkrpt_element .ui-icon-seek-prev { background-position: -48px -160px; }
|
532 |
-
.dkrpt_element .ui-icon-seek-end { background-position: -64px -160px; }
|
533 |
-
.dkrpt_element .ui-icon-seek-start { background-position: -80px -160px; }
|
534 |
-
.dkrpt_element .ui-icon-seek-first { background-position: -80px -160px; }
|
535 |
-
.dkrpt_element .ui-icon-stop { background-position: -96px -160px; }
|
536 |
-
.dkrpt_element .ui-icon-eject { background-position: -112px -160px; }
|
537 |
-
.dkrpt_element .ui-icon-volume-off { background-position: -128px -160px; }
|
538 |
-
.dkrpt_element .ui-icon-volume-on { background-position: -144px -160px; }
|
539 |
-
.dkrpt_element .ui-icon-power { background-position: 0 -176px; }
|
540 |
-
.dkrpt_element .ui-icon-signal-diag { background-position: -16px -176px; }
|
541 |
-
.dkrpt_element .ui-icon-signal { background-position: -32px -176px; }
|
542 |
-
.dkrpt_element .ui-icon-battery-0 { background-position: -48px -176px; }
|
543 |
-
.dkrpt_element .ui-icon-battery-1 { background-position: -64px -176px; }
|
544 |
-
.dkrpt_element .ui-icon-battery-2 { background-position: -80px -176px; }
|
545 |
-
.dkrpt_element .ui-icon-battery-3 { background-position: -96px -176px; }
|
546 |
-
.dkrpt_element .ui-icon-circle-plus { background-position: 0 -192px; }
|
547 |
-
.dkrpt_element .ui-icon-circle-minus { background-position: -16px -192px; }
|
548 |
-
.dkrpt_element .ui-icon-circle-close { background-position: -32px -192px; }
|
549 |
-
.dkrpt_element .ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
550 |
-
.dkrpt_element .ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
551 |
-
.dkrpt_element .ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
552 |
-
.dkrpt_element .ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
553 |
-
.dkrpt_element .ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
554 |
-
.dkrpt_element .ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
555 |
-
.dkrpt_element .ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
556 |
-
.dkrpt_element .ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
557 |
-
.dkrpt_element .ui-icon-circle-zoomin { background-position: -176px -192px; }
|
558 |
-
.dkrpt_element .ui-icon-circle-zoomout { background-position: -192px -192px; }
|
559 |
-
.dkrpt_element .ui-icon-circle-check { background-position: -208px -192px; }
|
560 |
-
.dkrpt_element .ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
561 |
-
.dkrpt_element .ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
562 |
-
.dkrpt_element .ui-icon-circlesmall-close { background-position: -32px -208px; }
|
563 |
-
.dkrpt_element .ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
564 |
-
.dkrpt_element .ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
565 |
-
.dkrpt_element .ui-icon-squaresmall-close { background-position: -80px -208px; }
|
566 |
-
.dkrpt_element .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
567 |
-
.dkrpt_element .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
568 |
-
.dkrpt_element .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
569 |
-
.dkrpt_element .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
570 |
-
.dkrpt_element .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
571 |
-
.dkrpt_element .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
572 |
-
.dkrpt_element .ui-corner-all, .dkrpt_element .ui-corner-top, .dkrpt_element .ui-corner-left, .dkrpt_element .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
573 |
-
.dkrpt_element .ui-corner-all, .dkrpt_element .ui-corner-top, .dkrpt_element .ui-corner-right, .dkrpt_element .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
574 |
-
.dkrpt_element .ui-corner-all, .dkrpt_element .ui-corner-bottom, .dkrpt_element .ui-corner-left, .dkrpt_element .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
575 |
-
.dkrpt_element .ui-corner-all, .dkrpt_element .ui-corner-bottom, .dkrpt_element .ui-corner-right, .dkrpt_element .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
576 |
-
.dkrpt_element .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
577 |
-
.dkrpt_element .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
578 |
-
.dkrpt_element .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
579 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
580 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-prev, .dkrpt_element .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
581 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-prev-hover, .dkrpt_element .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
582 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-prev { left:2px; }
|
583 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-next { right:2px; }
|
584 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
585 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
586 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-prev span, .dkrpt_element .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
587 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
588 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
589 |
-
.dkrpt_element .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
590 |
-
.dkrpt_element .ui-datepicker select.ui-datepicker-month,
|
591 |
-
.dkrpt_element .ui-datepicker select.ui-datepicker-year { width: 49%;}
|
592 |
-
.dkrpt_element .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
593 |
-
.dkrpt_element .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
594 |
-
.dkrpt_element .ui-datepicker td { border: 0; padding: 1px; }
|
595 |
-
.dkrpt_element .ui-datepicker td span, .dkrpt_element .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
596 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
597 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
598 |
-
.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
599 |
-
.dkrpt_element .ui-datepicker.ui-datepicker-multi { width:auto; }
|
600 |
-
.dkrpt_element .ui-datepicker-multi .ui-datepicker-group { float:left; }
|
601 |
-
.dkrpt_element .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
602 |
-
.dkrpt_element .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
603 |
-
.dkrpt_element .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
604 |
-
.dkrpt_element .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
605 |
-
.dkrpt_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
606 |
-
.dkrpt_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
607 |
-
.dkrpt_element .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
608 |
-
.dkrpt_element .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
609 |
-
.dkrpt_element .ui-datepicker-rtl { direction: rtl; }
|
610 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
611 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
612 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
613 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
614 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
615 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
616 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
617 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
618 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
619 |
-
.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
620 |
-
.dkrpt_element .ui-datepicker-cover {
|
621 |
-
display: none; /*sorry for IE5*/
|
622 |
-
display/**/: block; /*sorry for IE5*/
|
623 |
-
position: absolute; /*must have*/
|
624 |
-
z-index: -1; /*must have*/
|
625 |
-
filter: mask(); /*must have*/
|
626 |
-
top: -4px; /*must have*/
|
627 |
-
left: -4px; /*must have*/
|
628 |
-
width: 200px; /*must have*/
|
629 |
-
height: 200px; /*must have*/
|
630 |
-
}
|
631 |
-
|
632 |
-
.post-new-php table.dkrpt_metabox .dkrpt-nested-table td {padding:7px;}
|
633 |
-
|
634 |
-
.dkrpt-repeat-table tr td {padding:7px 15px 10px 8px;}
|
635 |
-
|
636 |
-
.dkrpt-repeat > td {padding:0px 15px 10px 0px;}
|
637 |
-
.form-table td p.add-row {margin-left:11px !important;}
|
638 |
-
.form-table td {padding:10px 0px 10px;}
|
639 |
-
|
640 |
-
.dkrpt_id__dkpdk_short_text h5 {font-size:18px; font-style:normal !important;}
|
641 |
-
.dkrpt_id__dkpdk_shortcode_code h5 {font-size:16px; color:green; font-style:normal;}
|
642 |
-
|
643 |
-
.dkrpt_metabox_title {font-size:16px !important; margin-bottom:0px; padding-left:0px; text-align:center; padding:18px 0px 0px; color:#999999; font-weight:500; margin-top:-6px; text-transform:uppercase;}
|
644 |
-
|
645 |
-
|
646 |
-
.dkrpt_metabox td {width: 100%; padding: 10px 0px 14px;}
|
647 |
-
.repeatable-group {padding: 0px 10px !important;}
|
648 |
-
|
649 |
-
.dkrpt-type-title td {padding-top:0px;}
|
650 |
-
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dkrpt/style.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
table.dkrpt_metabox{clear:both}.post-new-php table.dkrpt_metabox .dkrpt-nested-table td,.post-new-php table.dkrpt_metabox .repeatable-group th,.post-new-php table.dkrpt_metabox .repeatable-group:first-of-type,.post-php table.dkrpt_metabox .dkrpt-nested-table td,.post-php table.dkrpt_metabox .repeatable-group th,.post-php table.dkrpt_metabox .repeatable-group:first-of-type,table.dkrpt_metabox tbody>tr:first-of-type>td,table.dkrpt_metabox tbody>tr:first-of-type>th,table.dkrpt_metabox>tr:first-of-type>td,table.dkrpt_metabox>tr:first-of-type>th{border:0}.post-new-php table.dkrpt_metabox .repeatable-group,.post-new-php table.dkrpt_metabox td,.post-new-php table.dkrpt_metabox th,.post-php table.dkrpt_metabox .repeatable-group,.post-php table.dkrpt_metabox td,.post-php table.dkrpt_metabox th{border-top:1px solid #E9E9E9}.repeatable-group th{padding:0}.repeatable-group .shift-rows{text-decoration:none;margin-right:5px;font-size:1.2em}.repeatable-group .dkrpt_upload_button{margin:3px 0 0 9px!important}#poststuff .repeatable-group h2{margin:0}.dkrpt-group-title h4{font-size:1.8em;margin-top:0;margin-bottom:0;border-bottom:solid 7px #f5f5f5;text-align:center;padding:9px 10px;font-weight:400;color:#000}.post-new-php table.dkrpt_metabox th,.post-php table.dkrpt_metabox th{text-align:right;font-weight:700}.post-new-php table.dkrpt_metabox table th,.post-php table.dkrpt_metabox table th{text-align:left}table.dkrpt_metabox th label{padding-left:10px;margin-top:14px;display:block;font-weight:400;font-size:13px;color:#333}p.dkrpt_metabox_description{color:#AAA;font-style:italic;margin:2px 0!important}span.dkrpt_metabox_description{color:#AAA;font-style:italic}table.dkrpt_metabox input,table.dkrpt_metabox textarea{font-size:14px;padding:5px}table.dkrpt_metabox input[type=text],table.dkrpt_metabox textarea{width:97%}table.dkrpt_metabox textarea.dkrpt_textarea_code{font-family:Consolas,Monaco,monospace;line-height:16px}table.dkrpt_metabox input.dkrpt_text_small,table.dkrpt_metabox input.dkrpt_timepicker{width:100px;margin-right:15px}table.dkrpt_metabox input.dkrpt_text_money{width:90px;margin-right:15px}table.dkrpt_metabox input.dkrpt_text_medium{width:230px;margin-right:15px}table.dkrpt_metabox input.dkrpt_upload_file{width:65%}table.dkrpt_metabox input.ed_button{padding:2px 4px}table.dkrpt_metabox li{font-size:14px;margin:1px 0 5px;line-height:16px}table.dkrpt_metabox ul{padding-top:5px;margin:0}table.dkrpt_metabox select{font-size:14px;margin-top:3px}table.dkrpt_metabox input:focus,table.dkrpt_metabox textarea:focus{background:#fffff8}.dkrpt_metabox_title{margin:0 0 5px}.edit-tags-php .dkrpt_metabox_title,.profile-php .dkrpt_metabox_title,.user-edit-php .dkrpt_metabox_title{margin-left:-10px}.dkrpt-inline ul{padding:4px 0 0}.dkrpt-inline li{display:inline-block;padding-right:18px}table.dkrpt_metabox input[type=checkbox],table.dkrpt_metabox input[type=radio]{margin:0 5px 0 0;padding:0}table.dkrpt_metabox .mceLayout{border:1px solid #DFDFDF!important}table.dkrpt_metabox .mceIframeContainer{background:#FFF}table.dkrpt_metabox .meta_mce{width:97%}table.dkrpt_metabox .meta_mce textarea{width:100%}table.dkrpt_metabox .dkrpt_media_status{margin:10px 0 0}table.dkrpt_metabox .dkrpt_media_status .img_status{clear:none;float:left;display:inline-block;margin-right:10px;width:auto}table.dkrpt_metabox .dkrpt-type-file_list .dkrpt_media_status .img_status{clear:none;float:left;margin-right:10px;width:auto}table.dkrpt_metabox .dkrpt_media_status .embed_status,table.dkrpt_metabox .dkrpt_media_status .img_status{position:relative}table.dkrpt_metabox .dkrpt_media_status .embed_status,table.dkrpt_metabox .dkrpt_media_status .img_status img{border:1px solid #DFDFDF;background:#FAFAFA;max-width:350px;padding:5px;-moz-border-radius:2px;border-radius:2px}table.dkrpt_metabox .dkrpt_media_status .embed_status{float:left;max-width:800px}table.dkrpt_metabox .dkrpt_media_status .embed_status .dkrpt_remove_file_button,table.dkrpt_metabox .dkrpt_media_status .img_status .dkrpt_remove_file_button{text-indent:-9999px;background:url(images/ico-delete.png);width:16px;height:16px;position:absolute;top:-5px;left:-5px}table.dkrpt_metabox .attach_list li{clear:both;display:inline-block;margin-bottom:25px;width:100%}table.dkrpt_metabox .attach_list li img{float:left;margin-right:10px}#side-sortables table.dkrpt_metabox input[type=text],.inner-sidebar table.dkrpt_metabox input[type=text],table.dkrpt_metabox textarea{width:95%}#side-sortables table.dkrpt_metabox .dkrpt_media_status .embed_status img,#side-sortables table.dkrpt_metabox .dkrpt_media_status .img_status img,.inner-sidebar table.dkrpt_metabox .dkrpt_media_status .embed_status img,.inner-sidebar table.dkrpt_metabox .dkrpt_media_status .img_status img{width:90%}#side-sortables table.dkrpt_metabox label,.inner-sidebar table.dkrpt_metabox label{display:block;font-weight:700;padding:0 0 5px}#side-sortables table.dkrpt_metabox .dkrpt_list label,.inner-sidebar table.dkrpt_metabox .dkrpt_list label{display:inline;font-weight:400}#side-sortables table.dkrpt_metabox .dkrpt_metabox_description,.inner-sidebar table.dkrpt_metabox .dkrpt_metabox_description{display:block;padding:7px 0 0}#side-sortables table.dkrpt_metabox .dkrpt_metabox_title,.inner-sidebar table.dkrpt_metabox .dkrpt_metabox_title{font-size:1.2em;font-style:italic}.postbox table.dkrpt_metabox .dkrpt-spinner{float:left}table.dkrpt_metabox .wp-color-result,table.dkrpt_metabox .wp-picker-input-wrap{vertical-align:middle}table.dkrpt_metabox .wp-color-result,table.dkrpt_metabox .wp-picker-container{margin:0 10px 0 0}div.time-picker{position:absolute;height:191px;width:6em;overflow:auto;background:#fff;border:1px solid #aaa;z-index:99;margin:0}div.time-picker-12hours{width:8em}div.time-picker ul{list-style-type:none;margin:0;padding:0}div.time-picker li{cursor:pointer;height:10px;font:14px/1 Helvetica,Arial,sans-serif;padding:4px 3px}div.time-picker li.selected{background:#0063CE;color:#fff}.dkrpt_element .ui-helper-hidden{display:none}.dkrpt_element .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.dkrpt_element .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.dkrpt_element .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html .ui-helper-clearfix{height:1%}.dkrpt_element .ui-helper-clearfix{display:block}.dkrpt_element .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.dkrpt_element .ui-state-disabled{cursor:default!important}.dkrpt_element .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.dkrpt_element .ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.dkrpt_element .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.dkrpt_element .ui-widget .ui-widget{font-size:1em}.dkrpt_element .ui-widget button,.dkrpt_element .ui-widget input,.dkrpt_element .ui-widget select,.dkrpt_element .ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.dkrpt_element .ui-widget-content{border:1px solid #aaa;background:url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x #fff;color:#222}.dkrpt_element .ui-widget-content a{color:#222}.dkrpt_element .ui-widget-header{border:1px solid #aaa;background:url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x #ccc;color:#222;font-weight:700}.dkrpt_element .ui-widget-header a{color:#222}.dkrpt_element .ui-state-default,.dkrpt_element .ui-widget-content .ui-state-default,.dkrpt_element .ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x #e6e6e6;font-weight:400;color:#555}.dkrpt_element .ui-state-default a,.dkrpt_element .ui-state-default a:link,.dkrpt_element .ui-state-default a:visited{color:#555;text-decoration:none}.dkrpt_element .ui-state-focus,.dkrpt_element .ui-state-hover,.dkrpt_element .ui-widget-content .ui-state-focus,.dkrpt_element .ui-widget-content .ui-state-hover,.dkrpt_element .ui-widget-header .ui-state-focus,.dkrpt_element .ui-widget-header .ui-state-hover{border:1px solid #999;background:url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x #dadada;font-weight:400;color:#212121}.dkrpt_element .ui-state-hover a,.dkrpt_element .ui-state-hover a:hover{color:#212121;text-decoration:none}.dkrpt_element .ui-state-active,.dkrpt_element .ui-widget-content .ui-state-active,.dkrpt_element .ui-widget-header .ui-state-active{border:1px solid #aaa;background:url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x #fff;font-weight:400;color:#212121}.dkrpt_element .ui-state-active a,.dkrpt_element .ui-state-active a:link,.dkrpt_element .ui-state-active a:visited{color:#212121;text-decoration:none}.dkrpt_element .ui-widget :active{outline:0}.dkrpt_element .ui-state-highlight,.dkrpt_element .ui-widget-content .ui-state-highlight,.dkrpt_element .ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x #fbf9ee;color:#363636}.dkrpt_element .ui-state-highlight a,.dkrpt_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.dkrpt_element .ui-state-error,.dkrpt_element .ui-widget-content .ui-state-error,.dkrpt_element .ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x #fef1ec;color:#cd0a0a}.dkrpt_element .ui-state-error a,.dkrpt_element .ui-state-error-text,.dkrpt_element .ui-widget-content .ui-state-error a,.dkrpt_element .ui-widget-content .ui-state-error-text,.dkrpt_element .ui-widget-header .ui-state-error a,.dkrpt_element .ui-widget-header .ui-state-error-text{color:#cd0a0a}.dkrpt_element .ui-priority-primary,.dkrpt_element .ui-widget-content .ui-priority-primary,.dkrpt_element .ui-widget-header .ui-priority-primary{font-weight:700}.dkrpt_element .ui-priority-secondary,.dkrpt_element .ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.dkrpt_element .ui-state-disabled,.dkrpt_element .ui-widget-content .ui-state-disabled,.dkrpt_element .ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.dkrpt_element .ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.dkrpt_element .ui-widget-content .ui-icon,.dkrpt_element .ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.dkrpt_element .ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.dkrpt_element .ui-state-active .ui-icon,.dkrpt_element .ui-state-focus .ui-icon,.dkrpt_element .ui-state-hover .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.dkrpt_element .ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.dkrpt_element .ui-state-error .ui-icon,.dkrpt_element .ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.dkrpt_element .ui-icon-carat-1-n{background-position:0 0}.dkrpt_element .ui-icon-carat-1-ne{background-position:-16px 0}.dkrpt_element .ui-icon-carat-1-e{background-position:-32px 0}.dkrpt_element .ui-icon-carat-1-se{background-position:-48px 0}.dkrpt_element .ui-icon-carat-1-s{background-position:-64px 0}.dkrpt_element .ui-icon-carat-1-sw{background-position:-80px 0}.dkrpt_element .ui-icon-carat-1-w{background-position:-96px 0}.dkrpt_element .ui-icon-carat-1-nw{background-position:-112px 0}.dkrpt_element .ui-icon-carat-2-n-s{background-position:-128px 0}.dkrpt_element .ui-icon-carat-2-e-w{background-position:-144px 0}.dkrpt_element .ui-icon-triangle-1-n{background-position:0 -16px}.dkrpt_element .ui-icon-triangle-1-ne{background-position:-16px -16px}.dkrpt_element .ui-icon-triangle-1-e{background-position:-32px -16px}.dkrpt_element .ui-icon-triangle-1-se{background-position:-48px -16px}.dkrpt_element .ui-icon-triangle-1-s{background-position:-64px -16px}.dkrpt_element .ui-icon-triangle-1-sw{background-position:-80px -16px}.dkrpt_element .ui-icon-triangle-1-w{background-position:-96px -16px}.dkrpt_element .ui-icon-triangle-1-nw{background-position:-112px -16px}.dkrpt_element .ui-icon-triangle-2-n-s{background-position:-128px -16px}.dkrpt_element .ui-icon-triangle-2-e-w{background-position:-144px -16px}.dkrpt_element .ui-icon-arrow-1-n{background-position:0 -32px}.dkrpt_element .ui-icon-arrow-1-ne{background-position:-16px -32px}.dkrpt_element .ui-icon-arrow-1-e{background-position:-32px -32px}.dkrpt_element .ui-icon-arrow-1-se{background-position:-48px -32px}.dkrpt_element .ui-icon-arrow-1-s{background-position:-64px -32px}.dkrpt_element .ui-icon-arrow-1-sw{background-position:-80px -32px}.dkrpt_element .ui-icon-arrow-1-w{background-position:-96px -32px}.dkrpt_element .ui-icon-arrow-1-nw{background-position:-112px -32px}.dkrpt_element .ui-icon-arrow-2-n-s{background-position:-128px -32px}.dkrpt_element .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.dkrpt_element .ui-icon-arrow-2-e-w{background-position:-160px -32px}.dkrpt_element .ui-icon-arrow-2-se-nw{background-position:-176px -32px}.dkrpt_element .ui-icon-arrowstop-1-n{background-position:-192px -32px}.dkrpt_element .ui-icon-arrowstop-1-e{background-position:-208px -32px}.dkrpt_element .ui-icon-arrowstop-1-s{background-position:-224px -32px}.dkrpt_element .ui-icon-arrowstop-1-w{background-position:-240px -32px}.dkrpt_element .ui-icon-arrowthick-1-n{background-position:0 -48px}.dkrpt_element .ui-icon-arrowthick-1-ne{background-position:-16px -48px}.dkrpt_element .ui-icon-arrowthick-1-e{background-position:-32px -48px}.dkrpt_element .ui-icon-arrowthick-1-se{background-position:-48px -48px}.dkrpt_element .ui-icon-arrowthick-1-s{background-position:-64px -48px}.dkrpt_element .ui-icon-arrowthick-1-sw{background-position:-80px -48px}.dkrpt_element .ui-icon-arrowthick-1-w{background-position:-96px -48px}.dkrpt_element .ui-icon-arrowthick-1-nw{background-position:-112px -48px}.dkrpt_element .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.dkrpt_element .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.dkrpt_element .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.dkrpt_element .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.dkrpt_element .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.dkrpt_element .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.dkrpt_element .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.dkrpt_element .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.dkrpt_element .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.dkrpt_element .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.dkrpt_element .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.dkrpt_element .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.dkrpt_element .ui-icon-arrowreturn-1-w{background-position:-64px -64px}.dkrpt_element .ui-icon-arrowreturn-1-n{background-position:-80px -64px}.dkrpt_element .ui-icon-arrowreturn-1-e{background-position:-96px -64px}.dkrpt_element .ui-icon-arrowreturn-1-s{background-position:-112px -64px}.dkrpt_element .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.dkrpt_element .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.dkrpt_element .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.dkrpt_element .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.dkrpt_element .ui-icon-arrow-4{background-position:0 -80px}.dkrpt_element .ui-icon-arrow-4-diag{background-position:-16px -80px}.dkrpt_element .ui-icon-extlink{background-position:-32px -80px}.dkrpt_element .ui-icon-newwin{background-position:-48px -80px}.dkrpt_element .ui-icon-refresh{background-position:-64px -80px}.dkrpt_element .ui-icon-shuffle{background-position:-80px -80px}.dkrpt_element .ui-icon-transfer-e-w{background-position:-96px -80px}.dkrpt_element .ui-icon-transferthick-e-w{background-position:-112px -80px}.dkrpt_element .ui-icon-folder-collapsed{background-position:0 -96px}.dkrpt_element .ui-icon-folder-open{background-position:-16px -96px}.dkrpt_element .ui-icon-document{background-position:-32px -96px}.dkrpt_element .ui-icon-document-b{background-position:-48px -96px}.dkrpt_element .ui-icon-note{background-position:-64px -96px}.dkrpt_element .ui-icon-mail-closed{background-position:-80px -96px}.dkrpt_element .ui-icon-mail-open{background-position:-96px -96px}.dkrpt_element .ui-icon-suitcase{background-position:-112px -96px}.dkrpt_element .ui-icon-comment{background-position:-128px -96px}.dkrpt_element .ui-icon-person{background-position:-144px -96px}.dkrpt_element .ui-icon-print{background-position:-160px -96px}.dkrpt_element .ui-icon-trash{background-position:-176px -96px}.dkrpt_element .ui-icon-locked{background-position:-192px -96px}.dkrpt_element .ui-icon-unlocked{background-position:-208px -96px}.dkrpt_element .ui-icon-bookmark{background-position:-224px -96px}.dkrpt_element .ui-icon-tag{background-position:-240px -96px}.dkrpt_element .ui-icon-home{background-position:0 -112px}.dkrpt_element .ui-icon-flag{background-position:-16px -112px}.dkrpt_element .ui-icon-calendar{background-position:-32px -112px}.dkrpt_element .ui-icon-cart{background-position:-48px -112px}.dkrpt_element .ui-icon-pencil{background-position:-64px -112px}.dkrpt_element .ui-icon-clock{background-position:-80px -112px}.dkrpt_element .ui-icon-disk{background-position:-96px -112px}.dkrpt_element .ui-icon-calculator{background-position:-112px -112px}.dkrpt_element .ui-icon-zoomin{background-position:-128px -112px}.dkrpt_element .ui-icon-zoomout{background-position:-144px -112px}.dkrpt_element .ui-icon-search{background-position:-160px -112px}.dkrpt_element .ui-icon-wrench{background-position:-176px -112px}.dkrpt_element .ui-icon-gear{background-position:-192px -112px}.dkrpt_element .ui-icon-heart{background-position:-208px -112px}.dkrpt_element .ui-icon-star{background-position:-224px -112px}.dkrpt_element .ui-icon-link{background-position:-240px -112px}.dkrpt_element .ui-icon-cancel{background-position:0 -128px}.dkrpt_element .ui-icon-plus{background-position:-16px -128px}.dkrpt_element .ui-icon-plusthick{background-position:-32px -128px}.dkrpt_element .ui-icon-minus{background-position:-48px -128px}.dkrpt_element .ui-icon-minusthick{background-position:-64px -128px}.dkrpt_element .ui-icon-close{background-position:-80px -128px}.dkrpt_element .ui-icon-closethick{background-position:-96px -128px}.dkrpt_element .ui-icon-key{background-position:-112px -128px}.dkrpt_element .ui-icon-lightbulb{background-position:-128px -128px}.dkrpt_element .ui-icon-scissors{background-position:-144px -128px}.dkrpt_element .ui-icon-clipboard{background-position:-160px -128px}.dkrpt_element .ui-icon-copy{background-position:-176px -128px}.dkrpt_element .ui-icon-contact{background-position:-192px -128px}.dkrpt_element .ui-icon-image{background-position:-208px -128px}.dkrpt_element .ui-icon-video{background-position:-224px -128px}.dkrpt_element .ui-icon-script{background-position:-240px -128px}.dkrpt_element .ui-icon-alert{background-position:0 -144px}.dkrpt_element .ui-icon-info{background-position:-16px -144px}.dkrpt_element .ui-icon-notice{background-position:-32px -144px}.dkrpt_element .ui-icon-help{background-position:-48px -144px}.dkrpt_element .ui-icon-check{background-position:-64px -144px}.dkrpt_element .ui-icon-bullet{background-position:-80px -144px}.dkrpt_element .ui-icon-radio-off{background-position:-96px -144px}.dkrpt_element .ui-icon-radio-on{background-position:-112px -144px}.dkrpt_element .ui-icon-pin-w{background-position:-128px -144px}.dkrpt_element .ui-icon-pin-s{background-position:-144px -144px}.dkrpt_element .ui-icon-play{background-position:0 -160px}.dkrpt_element .ui-icon-pause{background-position:-16px -160px}.dkrpt_element .ui-icon-seek-next{background-position:-32px -160px}.dkrpt_element .ui-icon-seek-prev{background-position:-48px -160px}.dkrpt_element .ui-icon-seek-end{background-position:-64px -160px}.dkrpt_element .ui-icon-seek-first,.dkrpt_element .ui-icon-seek-start{background-position:-80px -160px}.dkrpt_element .ui-icon-stop{background-position:-96px -160px}.dkrpt_element .ui-icon-eject{background-position:-112px -160px}.dkrpt_element .ui-icon-volume-off{background-position:-128px -160px}.dkrpt_element .ui-icon-volume-on{background-position:-144px -160px}.dkrpt_element .ui-icon-power{background-position:0 -176px}.dkrpt_element .ui-icon-signal-diag{background-position:-16px -176px}.dkrpt_element .ui-icon-signal{background-position:-32px -176px}.dkrpt_element .ui-icon-battery-0{background-position:-48px -176px}.dkrpt_element .ui-icon-battery-1{background-position:-64px -176px}.dkrpt_element .ui-icon-battery-2{background-position:-80px -176px}.dkrpt_element .ui-icon-battery-3{background-position:-96px -176px}.dkrpt_element .ui-icon-circle-plus{background-position:0 -192px}.dkrpt_element .ui-icon-circle-minus{background-position:-16px -192px}.dkrpt_element .ui-icon-circle-close{background-position:-32px -192px}.dkrpt_element .ui-icon-circle-triangle-e{background-position:-48px -192px}.dkrpt_element .ui-icon-circle-triangle-s{background-position:-64px -192px}.dkrpt_element .ui-icon-circle-triangle-w{background-position:-80px -192px}.dkrpt_element .ui-icon-circle-triangle-n{background-position:-96px -192px}.dkrpt_element .ui-icon-circle-arrow-e{background-position:-112px -192px}.dkrpt_element .ui-icon-circle-arrow-s{background-position:-128px -192px}.dkrpt_element .ui-icon-circle-arrow-w{background-position:-144px -192px}.dkrpt_element .ui-icon-circle-arrow-n{background-position:-160px -192px}.dkrpt_element .ui-icon-circle-zoomin{background-position:-176px -192px}.dkrpt_element .ui-icon-circle-zoomout{background-position:-192px -192px}.dkrpt_element .ui-icon-circle-check{background-position:-208px -192px}.dkrpt_element .ui-icon-circlesmall-plus{background-position:0 -208px}.dkrpt_element .ui-icon-circlesmall-minus{background-position:-16px -208px}.dkrpt_element .ui-icon-circlesmall-close{background-position:-32px -208px}.dkrpt_element .ui-icon-squaresmall-plus{background-position:-48px -208px}.dkrpt_element .ui-icon-squaresmall-minus{background-position:-64px -208px}.dkrpt_element .ui-icon-squaresmall-close{background-position:-80px -208px}.dkrpt_element .ui-icon-grip-dotted-vertical{background-position:0 -224px}.dkrpt_element .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.dkrpt_element .ui-icon-grip-solid-vertical{background-position:-32px -224px}.dkrpt_element .ui-icon-grip-solid-horizontal{background-position:-48px -224px}.dkrpt_element .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.dkrpt_element .ui-icon-grip-diagonal-se{background-position:-80px -224px}.dkrpt_element .ui-corner-all,.dkrpt_element .ui-corner-left,.dkrpt_element .ui-corner-tl,.dkrpt_element .ui-corner-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.dkrpt_element .ui-corner-all,.dkrpt_element .ui-corner-right,.dkrpt_element .ui-corner-top,.dkrpt_element .ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.dkrpt_element .ui-corner-all,.dkrpt_element .ui-corner-bl,.dkrpt_element .ui-corner-bottom,.dkrpt_element .ui-corner-left{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.dkrpt_element .ui-corner-all,.dkrpt_element .ui-corner-bottom,.dkrpt_element .ui-corner-br,.dkrpt_element .ui-corner-right{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.dkrpt_element .ui-widget-overlay{background:url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x #aaa;opacity:.3;filter:Alpha(Opacity=30)}.dkrpt_element .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x #aaa;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.dkrpt_element .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.dkrpt_element .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.dkrpt_element .ui-datepicker .ui-datepicker-next,.dkrpt_element .ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.dkrpt_element .ui-datepicker .ui-datepicker-next-hover,.dkrpt_element .ui-datepicker .ui-datepicker-prev-hover{top:1px}.dkrpt_element .ui-datepicker .ui-datepicker-prev{left:2px}.dkrpt_element .ui-datepicker .ui-datepicker-next{right:2px}.dkrpt_element .ui-datepicker .ui-datepicker-prev-hover{left:1px}.dkrpt_element .ui-datepicker .ui-datepicker-next-hover{right:1px}.dkrpt_element .ui-datepicker .ui-datepicker-next span,.dkrpt_element .ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.dkrpt_element .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.dkrpt_element .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.dkrpt_element .ui-datepicker select.ui-datepicker-month-year{width:100%}.dkrpt_element .ui-datepicker select.ui-datepicker-month,.dkrpt_element .ui-datepicker select.ui-datepicker-year{width:49%}.dkrpt_element .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.dkrpt_element .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.dkrpt_element .ui-datepicker td{border:0;padding:1px}.dkrpt_element .ui-datepicker td a,.dkrpt_element .ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.dkrpt_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.dkrpt_element .ui-datepicker.ui-datepicker-multi{width:auto}.dkrpt_element .ui-datepicker-multi .ui-datepicker-group{float:left}.dkrpt_element .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.dkrpt_element .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.dkrpt_element .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.dkrpt_element .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.dkrpt_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.dkrpt_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.dkrpt_element .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.dkrpt_element .ui-datepicker-row-break{clear:both;width:100%;font-size:0}.dkrpt_element .ui-datepicker-rtl{direction:rtl}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group{float:right}.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.dkrpt_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.dkrpt_element .ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.post-new-php table.dkrpt_metabox .dkrpt-nested-table td{padding:7px}.dkrpt-repeat-table tr td{padding:7px 15px 10px 8px}.dkrpt-repeat>td{padding:0 15px 10px 0}.form-table td p.add-row{margin-left:11px!important}.form-table td{padding:10px 0}.dkrpt_id__dkpdk_short_text h5{font-size:18px;font-style:normal!important}.dkrpt_id__dkpdk_shortcode_code h5{font-size:16px;color:green;font-style:normal}.dkrpt_metabox_title{font-size:16px!important;margin-bottom:0;text-align:center;padding:18px 0 0;color:#999;font-weight:500;margin-top:-6px;text-transform:uppercase}.dkrpt_metabox td{width:100%;padding:10px 0 14px}.repeatable-group{padding:0 10px!important}.dkrpt-type-title td{padding-top:0}.dkrpt-type-checkbox td{padding-top:13px!important}#side-sortables table.dkrpt_metabox .dkrpt_metabox_title{font-style:normal}
|
|
img/skeleton_plan.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -73,6 +73,15 @@ The [PRO version](http://wpdarko.com/items/responsive-pricing-table-pro/) gives
|
|
73 |
5. Finding the shortcode (admin view)
|
74 |
|
75 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
= 3.5.1 =
|
77 |
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
78 |
* You can now add pictures/icons in the feature area using the <img> tag
|
73 |
5. Finding the shortcode (admin view)
|
74 |
|
75 |
== Changelog ==
|
76 |
+
= 4.0 =
|
77 |
+
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
78 |
+
* New admin interface (new framework)
|
79 |
+
* You can now add links in the feature area using the <a> tag (user request)
|
80 |
+
* You can now force the plugin's original fonts (user request)
|
81 |
+
* Added docs and support forums links
|
82 |
+
* Added instructions
|
83 |
+
* Much cleaner code
|
84 |
+
|
85 |
= 3.5.1 =
|
86 |
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
87 |
* You can now add pictures/icons in the feature area using the <img> tag
|
rpt.php
CHANGED
@@ -3,14 +3,15 @@
|
|
3 |
Plugin Name: Responsive Pricing Table
|
4 |
Plugin URI: http://wpdarko.com/support/documentation/get-started-responsive-pricing-table/
|
5 |
Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. Find support and information on the <a href="http://wpdarko.com/responsive-pricing-table/">plugin's page</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='http://wpdarko.com/items/responsive-pricing-table-pro/'>PRO version</a> for more great features.
|
6 |
-
Version:
|
7 |
Author: WP Darko
|
8 |
Author URI: http://wpdarko.com
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
|
|
12 |
function rpt_free_pro_check() {
|
13 |
-
if (is_plugin_active('responsive-pricing-table-pro/rpt_pro.php')) {
|
14 |
|
15 |
function my_admin_notice(){
|
16 |
echo '<div class="updated">
|
@@ -25,14 +26,21 @@ function rpt_free_pro_check() {
|
|
25 |
|
26 |
add_action( 'admin_init', 'rpt_free_pro_check' );
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
wp_enqueue_style( 'rpt', plugins_url('css/rpt_custom_style.min.css', __FILE__));
|
32 |
}
|
33 |
|
34 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
|
|
36 |
function create_rpt_pricing_table_type() {
|
37 |
register_post_type( 'rpt_pricing_table',
|
38 |
array(
|
@@ -49,210 +57,284 @@ function create_rpt_pricing_table_type() {
|
|
49 |
);
|
50 |
}
|
51 |
|
52 |
-
|
53 |
-
* Include and setup custom metaboxes and fields.
|
54 |
-
* @category Responsive Pricing Table
|
55 |
-
* @package Metaboxes
|
56 |
-
*/
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
* Define the metabox and field configurations.
|
62 |
-
* @param array $meta_boxes
|
63 |
-
* @return array
|
64 |
-
*/
|
65 |
-
function rpt_metaboxes( array $meta_boxes ) {
|
66 |
|
67 |
-
|
68 |
-
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
'remove_button' => 'Remove Plan',
|
84 |
-
'sortable' => true,
|
85 |
-
),
|
86 |
-
'fields' => array(
|
87 |
-
array(
|
88 |
-
'name' => 'Plan header',
|
89 |
-
'id' => $prefix . 'header_desc',
|
90 |
-
'type' => 'title',
|
91 |
-
),
|
92 |
-
array(
|
93 |
-
'name' => 'Title',
|
94 |
-
'id' => $prefix . 'title',
|
95 |
-
'type' => 'text',
|
96 |
-
),
|
97 |
-
array(
|
98 |
-
'name' => 'Recommended?',
|
99 |
-
'desc' => 'check this if it\'s a recommended plan',
|
100 |
-
'id' => $prefix . 'recommended',
|
101 |
-
'type' => 'checkbox',
|
102 |
-
'default' => false,
|
103 |
-
),
|
104 |
-
array(
|
105 |
-
'name' => 'Subtitle',
|
106 |
-
'id' => $prefix . 'subtitle',
|
107 |
-
'type' => 'text',
|
108 |
-
'sanitization_cb' => false,
|
109 |
-
),
|
110 |
-
array(
|
111 |
-
'name' => 'Description',
|
112 |
-
'id' => $prefix . 'description',
|
113 |
-
'type' => 'text',
|
114 |
-
'sanitization_cb' => false,
|
115 |
-
),
|
116 |
-
array(
|
117 |
-
'name' => 'Price',
|
118 |
-
'id' => $prefix . 'price',
|
119 |
-
'type' => 'text',
|
120 |
-
),
|
121 |
-
array(
|
122 |
-
'name' => 'Free?',
|
123 |
-
'desc' => 'check this if this plan is free',
|
124 |
-
'id' => $prefix . 'free',
|
125 |
-
'type' => 'checkbox',
|
126 |
-
'default' => false,
|
127 |
-
),
|
128 |
-
array(
|
129 |
-
'name' => 'Recurrence',
|
130 |
-
'id' => $prefix . 'recurrence',
|
131 |
-
'type' => 'text',
|
132 |
-
'sanitization_cb' => false,
|
133 |
-
'attributes' => array(
|
134 |
-
'placeholder' => 'eg. per month, one time fee',
|
135 |
-
),
|
136 |
-
),
|
137 |
-
array(
|
138 |
-
'name' => 'Small icon',
|
139 |
-
'id' => $prefix . 'icon',
|
140 |
-
'type' => 'file',
|
141 |
-
'attributes' => array(
|
142 |
-
'placeholder' => 'recommended size: 30 x 30',
|
143 |
-
),
|
144 |
-
),
|
145 |
-
array(
|
146 |
-
'name' => 'Plan features',
|
147 |
-
'desc' => '<div style="margin-top: 20px;line-height:24px; padding:10px; padding-left:30px; border-left:grey solid 4px;"><span style="font-style:normal; color:black;"><span style="color:black;"><strong><strong></strong></span> tags allowed for bold text.<br/><span style="color:#bbbbbb; font-size:12px;">eg. "<strong>5</strong> products in the store".</span><br/>Use prefix "<span style="color:black;"><strong>-n</strong></span>" if the feature isn\'t available in this plan.<br/><span style="color:#bbbbbb; font-size:12px;">eg. "-n Custom domain name."</span></span></div>',
|
148 |
-
'id' => $prefix . 'features_desc',
|
149 |
-
'type' => 'title',
|
150 |
-
),
|
151 |
-
array(
|
152 |
-
'name' => 'Features',
|
153 |
-
'id' => $prefix . 'features',
|
154 |
-
'type' => 'textarea',
|
155 |
-
'attributes' => array(
|
156 |
-
'placeholder' => 'one per line',
|
157 |
-
),
|
158 |
-
),
|
159 |
-
array(
|
160 |
-
'name' => 'Plan button',
|
161 |
-
'id' => $prefix . 'plan_button_desc',
|
162 |
-
'type' => 'title',
|
163 |
-
),
|
164 |
-
array(
|
165 |
-
'name' => 'Button text',
|
166 |
-
'id' => $prefix . 'btn_text',
|
167 |
-
'type' => 'text',
|
168 |
-
'attributes' => array(
|
169 |
-
'placeholder' => 'eg. Sign up, Buy',
|
170 |
-
),
|
171 |
-
),
|
172 |
-
array(
|
173 |
-
'name' => 'Button link',
|
174 |
-
'id' => $prefix . 'btn_link',
|
175 |
-
'type' => 'text',
|
176 |
-
'sanitization_cb' => false,
|
177 |
-
'attributes' => array(
|
178 |
-
'placeholder' => 'eg. http://anything.com',
|
179 |
-
),
|
180 |
-
),
|
181 |
-
array(
|
182 |
-
'name' => 'Plan styling',
|
183 |
-
'id' => $prefix . 'styling_desc',
|
184 |
-
'type' => 'title',
|
185 |
-
),
|
186 |
-
array(
|
187 |
-
'name' => 'Color',
|
188 |
-
'id' => $prefix . 'color',
|
189 |
-
'type' => 'colorpicker',
|
190 |
-
'default' => '#9fdb80',
|
191 |
-
),
|
192 |
-
),
|
193 |
-
),
|
194 |
-
),
|
195 |
-
);
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
'
|
204 |
-
'
|
205 |
-
'
|
206 |
-
|
207 |
-
|
208 |
-
'priority' => 'low',
|
209 |
-
'fields' => array(
|
210 |
-
array(
|
211 |
-
'name' => '',
|
212 |
-
'id' => $prefix . 'pro_desc',
|
213 |
-
'type' => 'title',
|
214 |
-
'desc' => lala(),
|
215 |
-
),
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
'priority' => 'high',
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
),
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
'newwindow' => 'Open in new window/tab',
|
246 |
-
),
|
247 |
-
'default' => 'currentwindow',
|
248 |
),
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
'name' => 'Font sizes',
|
251 |
'id' => $prefix . 'font_sizes_desc',
|
252 |
'type' => 'title',
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
256 |
'id' => $prefix . 'title_fontsize',
|
257 |
'type' => 'select',
|
258 |
'options' => array(
|
@@ -261,9 +343,11 @@ function rpt_metaboxes( array $meta_boxes ) {
|
|
261 |
'normal' => 'Normal',
|
262 |
),
|
263 |
'default' => 'normal',
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
|
|
267 |
'id' => $prefix . 'subtitle_fontsize',
|
268 |
'type' => 'select',
|
269 |
'options' => array(
|
@@ -272,9 +356,11 @@ function rpt_metaboxes( array $meta_boxes ) {
|
|
272 |
'normal' => 'Normal',
|
273 |
),
|
274 |
'default' => 'normal',
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
|
|
278 |
'id' => $prefix . 'description_fontsize',
|
279 |
'type' => 'select',
|
280 |
'options' => array(
|
@@ -282,9 +368,11 @@ function rpt_metaboxes( array $meta_boxes ) {
|
|
282 |
'normal' => 'Normal',
|
283 |
),
|
284 |
'default' => 'normal',
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
288 |
'id' => $prefix . 'price_fontsize',
|
289 |
'type' => 'select',
|
290 |
'options' => array(
|
@@ -294,9 +382,11 @@ function rpt_metaboxes( array $meta_boxes ) {
|
|
294 |
'normal' => 'Big',
|
295 |
),
|
296 |
'default' => 'normal',
|
297 |
-
|
298 |
-
|
299 |
-
|
|
|
|
|
300 |
'id' => $prefix . 'recurrence_fontsize',
|
301 |
'type' => 'select',
|
302 |
'options' => array(
|
@@ -304,72 +394,108 @@ function rpt_metaboxes( array $meta_boxes ) {
|
|
304 |
'normal' => 'Normal',
|
305 |
),
|
306 |
'default' => 'normal',
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
|
|
|
|
311 |
'type' => 'select',
|
312 |
'options' => array(
|
313 |
'small' => 'Small',
|
314 |
'normal' => 'Normal',
|
315 |
),
|
316 |
'default' => 'normal',
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
|
|
321 |
'type' => 'select',
|
322 |
'options' => array(
|
323 |
'small' => 'Small',
|
324 |
'normal' => 'Normal',
|
325 |
),
|
326 |
'default' => 'normal',
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
}
|
342 |
|
343 |
-
|
344 |
-
add_action( 'manage_rpt_pricing_table_posts_custom_column' , 'rpt_custom_columns', 10, 2 );
|
345 |
|
|
|
346 |
function rpt_custom_columns( $column, $post_id ) {
|
347 |
switch ( $column ) {
|
348 |
case 'dk_shortcode' :
|
349 |
global $post;
|
350 |
$slug = '' ;
|
351 |
$slug = $post->post_name;
|
352 |
-
|
353 |
-
|
354 |
-
$shortcode = '<span style="border: solid 3px lightgray; background:white; padding:7px; font-size:17px; line-height:40px;">[rpt name="'.$slug.'"]</strong>';
|
355 |
echo $shortcode;
|
356 |
break;
|
357 |
}
|
358 |
}
|
359 |
|
|
|
|
|
360 |
function add_rpt_pricing_table_columns($columns) {
|
361 |
-
return array_merge($columns,
|
362 |
-
array('dk_shortcode' => __('Shortcode'),
|
363 |
-
));
|
364 |
}
|
|
|
365 |
add_filter('manage_rpt_pricing_table_posts_columns' , 'add_rpt_pricing_table_columns');
|
366 |
|
367 |
-
//
|
368 |
function rpt_sc($atts) {
|
369 |
extract(shortcode_atts(array(
|
370 |
"name" => ''
|
371 |
), $atts));
|
372 |
-
|
373 |
$output2 = '';
|
374 |
|
375 |
global $post;
|
@@ -381,8 +507,16 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
381 |
$entries = get_post_meta( $post->ID, '_rpt_plan_group', true );
|
382 |
|
383 |
$nb_entries = count($entries);;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
|
385 |
-
//
|
386 |
$title_fontsize = get_post_meta( $post->ID, '_rpt_title_fontsize', true );
|
387 |
if ($title_fontsize == 'small') {
|
388 |
$title_fs_class = ' rpt_sm_title';
|
@@ -440,17 +574,18 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
440 |
$button_fs_class = '';
|
441 |
}
|
442 |
|
443 |
-
//
|
444 |
$output2 .= '<div id="rpt_pricr" class="rpt_plans rpt_'.$nb_entries .'_plans rpt_style_basic">';
|
445 |
|
446 |
-
//
|
447 |
$output2 .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
|
448 |
|
449 |
foreach ($entries as $key => $plans) {
|
450 |
|
451 |
if (!empty($plans['_rpt_recommended'])){
|
452 |
$is_reco = $plans['_rpt_recommended'];
|
453 |
-
|
|
|
454 |
if ($is_reco == true ){
|
455 |
$reco = '<img class="rpt_recommended" src="' . plugins_url('img/rpt_recommended.png', __FILE__) . '"/>';
|
456 |
$reco_class = 'rpt_recommended_plan';
|
@@ -463,9 +598,9 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
463 |
$reco_class = '';
|
464 |
}
|
465 |
|
466 |
-
$output2 .= '<div class="rpt_plan rpt_plan_' . $key . ' ' . $reco_class . '">';
|
467 |
|
468 |
-
//
|
469 |
if (!empty($plans['_rpt_title'])){
|
470 |
$output2 .= '<div class="rpt_title rpt_title_' . $key . '">';
|
471 |
|
@@ -477,22 +612,22 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
477 |
$output2 .= $reco . '</div>';
|
478 |
}
|
479 |
|
480 |
-
//
|
481 |
$output2 .= '<div class="rpt_head rpt_head_' . $key . '">';
|
482 |
|
483 |
-
//
|
484 |
if (!empty($plans['_rpt_recurrence'])){
|
485 |
$output2 .= '<div class="rpt_recurrence rpt_recurrence_' . $key . '">' . $plans['_rpt_recurrence'] . '</div>';
|
486 |
}
|
487 |
|
488 |
-
//
|
489 |
if (!empty($plans['_rpt_price'])){
|
490 |
|
491 |
$output2 .= '<div class="rpt_price rpt_price_' . $key . '">';
|
492 |
|
493 |
if (!empty($plans['_rpt_free'])){
|
494 |
if ($plans['_rpt_free'] == true ){
|
495 |
-
$output2 .=
|
496 |
} else {
|
497 |
$output2 .= '<span class="rpt_currency"></span>' . $plans['_rpt_price'];
|
498 |
}
|
@@ -513,17 +648,17 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
513 |
$output2 .= '</div>';
|
514 |
}
|
515 |
|
516 |
-
//
|
517 |
if (!empty($plans['_rpt_subtitle'])){
|
518 |
$output2 .= '<div style="color:' . $plans['_rpt_color'] . ';" class="rpt_subtitle rpt_subtitle_' . $key . '">' . $plans['_rpt_subtitle'] . '</div>';
|
519 |
}
|
520 |
|
521 |
-
//
|
522 |
if (!empty($plans['_rpt_description'])){
|
523 |
$output2 .= '<div class="rpt_description rpt_description_' . $key . '">' . $plans['_rpt_description'] . '</div>';
|
524 |
}
|
525 |
|
526 |
-
//
|
527 |
$output2 .= '</div>';
|
528 |
|
529 |
|
@@ -535,12 +670,12 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
535 |
|
536 |
$string = $plans['_rpt_features'];
|
537 |
$stringAr = explode("\n", $string);
|
538 |
-
$stringAr = array_filter($stringAr, 'trim');
|
539 |
|
540 |
$features = '';
|
541 |
|
542 |
foreach ($stringAr as $feature) {
|
543 |
-
$features[] .= strip_tags($feature,'<strong></strong><br><br/></br><img>');
|
544 |
}
|
545 |
|
546 |
foreach ($features as $small_key => $feature){
|
@@ -574,7 +709,7 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
574 |
$btn_link = '#';
|
575 |
}
|
576 |
|
577 |
-
//
|
578 |
$newcurrentwindow = get_post_meta( $post->ID, '_rpt_open_newwindow', true );
|
579 |
if ($newcurrentwindow == 'newwindow'){
|
580 |
$link_behavior = 'target="_blank"';
|
@@ -582,37 +717,34 @@ foreach($custom_posts as $post) : setup_postdata($post);
|
|
582 |
$link_behavior = 'target="_self"';
|
583 |
}
|
584 |
|
585 |
-
//
|
586 |
if (!empty($plans['_rpt_btn_text'])){
|
587 |
$output2 .= '<a '. $link_behavior .' href="' . $btn_link . '" style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
|
588 |
} else {
|
589 |
$output2 .= '<a '. $link_behavior .' style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
|
590 |
}
|
|
|
|
|
591 |
|
592 |
-
|
593 |
-
$output2 .= $btn_text;
|
594 |
-
|
595 |
-
//closing foot
|
596 |
$output2 .= '</a>';
|
597 |
|
598 |
-
|
599 |
-
|
600 |
}
|
601 |
|
602 |
-
//
|
603 |
$output2 .= '</div>';
|
604 |
|
605 |
-
//
|
606 |
$output2 .= '</div>';
|
607 |
|
608 |
$output2 .= '<div style="clear:both;"></div>';
|
609 |
|
610 |
-
|
611 |
endforeach; wp_reset_query();
|
612 |
-
|
613 |
return $output2;
|
614 |
|
615 |
}
|
616 |
-
add_shortcode("rpt", "rpt_sc");
|
617 |
|
|
|
618 |
?>
|
3 |
Plugin Name: Responsive Pricing Table
|
4 |
Plugin URI: http://wpdarko.com/support/documentation/get-started-responsive-pricing-table/
|
5 |
Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. Find support and information on the <a href="http://wpdarko.com/responsive-pricing-table/">plugin's page</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='http://wpdarko.com/items/responsive-pricing-table-pro/'>PRO version</a> for more great features.
|
6 |
+
Version: 4.0
|
7 |
Author: WP Darko
|
8 |
Author URI: http://wpdarko.com
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
+
// Check for the PRO version
|
13 |
function rpt_free_pro_check() {
|
14 |
+
if (is_plugin_active('responsive-pricing-table-pro/rpt_pro.php')) {
|
15 |
|
16 |
function my_admin_notice(){
|
17 |
echo '<div class="updated">
|
26 |
|
27 |
add_action( 'admin_init', 'rpt_free_pro_check' );
|
28 |
|
29 |
+
/* Enqueue styles */
|
30 |
+
function add_rpt_scripts() {
|
31 |
+
wp_enqueue_style( 'rpt', plugins_url('css/rpt_style.min.css', __FILE__));
|
|
|
32 |
}
|
33 |
|
34 |
+
add_action( 'wp_enqueue_scripts', 'add_rpt_scripts', 99 );
|
35 |
+
|
36 |
+
/* Enqueue admin styles */
|
37 |
+
add_action( 'admin_enqueue_scripts', 'add_admin_rpt_style' );
|
38 |
+
|
39 |
+
function add_admin_rpt_style() {
|
40 |
+
wp_enqueue_style( 'rpt', plugins_url('css/admin_de_style.min.css', __FILE__));
|
41 |
+
}
|
42 |
|
43 |
+
// Create Pricing Table custom type
|
44 |
function create_rpt_pricing_table_type() {
|
45 |
register_post_type( 'rpt_pricing_table',
|
46 |
array(
|
57 |
);
|
58 |
}
|
59 |
|
60 |
+
add_action( 'init', 'create_rpt_pricing_table_type' );
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
/* Hide View/Preview since it's a shortcode */
|
63 |
+
function rpt_pricing_table_admin_css() {
|
64 |
+
global $post_type;
|
65 |
+
$post_types = array(
|
66 |
+
'rpt_pricing_table',
|
67 |
+
);
|
68 |
+
if(in_array($post_type, $post_types))
|
69 |
+
echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
|
70 |
+
}
|
71 |
|
72 |
+
function remove_view_link_rpt_pricing_table( $action ) {
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
unset ($action['view']);
|
75 |
+
return $action;
|
76 |
+
}
|
77 |
|
78 |
+
add_filter( 'post_row_actions', 'remove_view_link_rpt_pricing_table' );
|
79 |
+
add_action( 'admin_head-post-new.php', 'rpt_pricing_table_admin_css' );
|
80 |
+
add_action( 'admin_head-post.php', 'rpt_pricing_table_admin_css' );
|
81 |
+
|
82 |
+
// Adding the CMB2 Metabox class
|
83 |
+
if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
|
84 |
+
require_once dirname( __FILE__ ) . '/cmb2/init.php';
|
85 |
+
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
|
86 |
+
require_once dirname( __FILE__ ) . '/CMB2/init.php';
|
87 |
+
}
|
88 |
+
|
89 |
+
// Registering Pricing Table metaboxes
|
90 |
+
function rpt_register_plan_group_metabox() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
+
$plan_skeleton_url = plugins_url('dk-pricr-responsive-pricing-table/img/skeleton_plan.png');
|
93 |
+
$prefix = '_rpt_';
|
94 |
+
|
95 |
+
// Tables group
|
96 |
+
$main_group = new_cmb2_box( array(
|
97 |
+
'id' => $prefix . 'plan_metabox',
|
98 |
+
'title' => '<span class="dashicons dashicons-welcome-add-page"></span> Pricing Table Plans <span style="color:#8a7463; font-weight:400; float:right; padding-right:14px;"><span class="dashicons dashicons-lock"></span> Free version</span>',
|
99 |
+
'object_types' => array( 'rpt_pricing_table' ),
|
100 |
+
));
|
101 |
|
102 |
+
$main_group->add_field( array(
|
103 |
+
'name' => '<span style="font-weight:400;">Getting started / Instructions</span>',
|
104 |
+
'desc' => 'Edit your plans (see below), add more (up to 5), reorder them and play around with the settings on the right. If you have trouble understanding how this works, click the "Help & Support tab on the right."',
|
105 |
+
'id' => $prefix . 'instructions',
|
106 |
+
'type' => 'title',
|
107 |
+
'row_classes' => 'de_hundred de_instructions',
|
108 |
+
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
$rpt_plan_group = $main_group->add_field( array(
|
111 |
+
'id' => $prefix . 'plan_group',
|
112 |
+
'type' => 'group',
|
113 |
+
'options' => array(
|
114 |
+
'group_title' => 'Plan {#}',
|
115 |
+
'add_button' => 'Add another plan',
|
116 |
+
'remove_button' => 'Remove plan',
|
117 |
+
'sortable' => true,
|
118 |
+
),
|
119 |
+
));
|
120 |
+
|
121 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
122 |
+
'name' => 'Plan Header',
|
123 |
+
'id' => $prefix . 'head_header',
|
124 |
+
'type' => 'title',
|
125 |
+
'row_classes' => 'de_hundred de_heading',
|
126 |
+
));
|
127 |
+
|
128 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
129 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Title',
|
130 |
+
'id' => $prefix . 'title',
|
131 |
+
'type' => 'text',
|
132 |
+
'row_classes' => 'de_first de_fifty de_text de_input',
|
133 |
+
));
|
134 |
+
|
135 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
136 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Subtitle',
|
137 |
+
'id' => $prefix . 'subtitle',
|
138 |
+
'type' => 'text',
|
139 |
+
'sanitization_cb' => false,
|
140 |
+
'row_classes' => 'de_fifty de_text de_input',
|
141 |
+
));
|
142 |
+
|
143 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
144 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Description',
|
145 |
+
'id' => $prefix . 'description',
|
146 |
+
'type' => 'text',
|
147 |
+
'sanitization_cb' => false,
|
148 |
+
'row_classes' => 'de_first de_fifty de_text de_input',
|
149 |
+
));
|
150 |
+
|
151 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
152 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Price',
|
153 |
+
'id' => $prefix . 'price',
|
154 |
+
'type' => 'text',
|
155 |
+
'row_classes' => 'de_twentyfive de_text de_input',
|
156 |
+
));
|
157 |
+
|
158 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
159 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Recurrence',
|
160 |
+
'id' => $prefix . 'recurrence',
|
161 |
+
'type' => 'text',
|
162 |
+
'sanitization_cb' => false,
|
163 |
+
'row_classes' => 'de_twentyfive de_text de_input',
|
164 |
+
'attributes' => array(
|
165 |
+
'placeholder' => 'eg. per month',
|
166 |
+
),
|
167 |
+
));
|
168 |
+
|
169 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
170 |
+
'name' => '<span class="dashicons dashicons-format-image"></span> Small icon',
|
171 |
+
'id' => $prefix . 'icon',
|
172 |
+
'type' => 'file',
|
173 |
+
'attributes' => array(
|
174 |
+
'placeholder' => 'recommended size: 30 x 30',
|
175 |
+
),
|
176 |
+
'row_classes' => 'de_hundred de_upload de_input',
|
177 |
+
));
|
178 |
+
|
179 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
180 |
+
'name' => '<span class="dashicons dashicons-admin-post"></span> Mark as a RECOMMENDED plan',
|
181 |
+
'desc' => 'Checking this will highlight the plan (eg. best deal).',
|
182 |
+
'id' => $prefix . 'recommended',
|
183 |
+
'type' => 'checkbox',
|
184 |
+
'default' => false,
|
185 |
+
'row_classes' => 'de_first de_fifty de_checkbox',
|
186 |
+
));
|
187 |
+
|
188 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
189 |
+
'name' => '<span class="dashicons dashicons-admin-post"></span> Remove currency sign',
|
190 |
+
'desc' => 'Checking this will remove the currency sign (eg. free plans).',
|
191 |
+
'id' => $prefix . 'free',
|
192 |
+
'type' => 'checkbox',
|
193 |
+
'default' => false,
|
194 |
+
'row_classes' => 'de_fifty de_checkbox',
|
195 |
+
));
|
196 |
+
|
197 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
198 |
+
'name' => 'Plan Features',
|
199 |
+
'id' => $prefix . 'features_header',
|
200 |
+
'type' => 'title',
|
201 |
+
'row_classes' => 'de_hundred de_heading',
|
202 |
+
));
|
203 |
+
|
204 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
205 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Feature list',
|
206 |
+
'id' => $prefix . 'features',
|
207 |
+
'type' => 'textarea',
|
208 |
+
'attributes' => array(
|
209 |
+
'placeholder' => 'one per line',
|
210 |
+
'rows' => 10,
|
211 |
+
),
|
212 |
+
'row_classes' => 'de_first de_fifty de_textarea de_input',
|
213 |
+
));
|
214 |
+
|
215 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
216 |
+
'name' => 'Tips & Tricks',
|
217 |
+
'desc' => '<span class="dashicons dashicons-yes"></span> Add images (not recommended)<br/><span style="color:#bbb;"><img src="http://yoursite.com/yourimage.png"/></span><br/><br/><span class="dashicons dashicons-yes"></span> Add links<br/><span style="color:#bbb;"><a href="http://yoursite.com">Go to yoursite.com</a></span><br/><br/><span class="dashicons dashicons-yes"></span> Add bold text<br/><span style="color:#bbb;"><strong>Something <strong>important</strong></strong></span><br/><br/><span style="color:#8a7463;"><span class="dashicons dashicons-lock"></span> PRO Add Tooltips<br/>Tooltips are info bubbles for your features.</span>',
|
218 |
+
'id' => $prefix . 'features_desc',
|
219 |
+
'type' => 'title',
|
220 |
+
'row_classes' => 'de_fifty de_info',
|
221 |
+
));
|
222 |
+
|
223 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
224 |
+
'name' => 'Plan Button',
|
225 |
+
'id' => $prefix . 'button_header',
|
226 |
+
'type' => 'title',
|
227 |
+
'row_classes' => 'de_hundred de_heading',
|
228 |
+
));
|
229 |
+
|
230 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
231 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Button text',
|
232 |
+
'id' => $prefix . 'btn_text',
|
233 |
+
'type' => 'text',
|
234 |
+
'attributes' => array(
|
235 |
+
'placeholder' => 'eg. Sign up, Buy',
|
236 |
+
),
|
237 |
+
'row_classes' => 'de_first de_fifty de_text de_input',
|
238 |
+
));
|
239 |
+
|
240 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
241 |
+
'name' => '<span class="dashicons dashicons-admin-links"></span> Button link',
|
242 |
+
'id' => $prefix . 'btn_link',
|
243 |
+
'type' => 'text',
|
244 |
+
'sanitization_cb' => false,
|
245 |
+
'attributes' => array(
|
246 |
+
'placeholder' => 'eg. http://anything.com',
|
247 |
+
),
|
248 |
+
'row_classes' => 'de_fifty de_text de_input',
|
249 |
+
));
|
250 |
+
|
251 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
252 |
+
'name' => 'Plan styling',
|
253 |
+
'id' => $prefix . 'styling_desc',
|
254 |
+
'type' => 'title',
|
255 |
+
'row_classes' => 'de_hundred de_heading',
|
256 |
+
));
|
257 |
+
|
258 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
259 |
+
'name' => '<span class="dashicons dashicons-admin-appearance"></span> Color',
|
260 |
+
'desc' => 'This color will be used for several elements of the plan.',
|
261 |
+
'id' => $prefix . 'color',
|
262 |
+
'type' => 'colorpicker',
|
263 |
+
'default' => '#9fdb80',
|
264 |
+
'row_classes' => 'de_hundred de_color',
|
265 |
+
));
|
266 |
+
|
267 |
+
$main_group->add_group_field( $rpt_plan_group, array(
|
268 |
+
'name' => '',
|
269 |
+
'id' => $prefix . 'sep_header',
|
270 |
+
'type' => 'title',
|
271 |
+
));
|
272 |
+
|
273 |
+
// Settings group
|
274 |
+
$side_group = new_cmb2_box( array(
|
275 |
+
'id' => $prefix . 'settings_metabox',
|
276 |
+
'title' => '<span class="dashicons dashicons-admin-tools"></span> Pricing Table Settings',
|
277 |
+
'object_types' => array( 'rpt_pricing_table' ),
|
278 |
+
'context' => 'side',
|
279 |
'priority' => 'high',
|
280 |
+
'closed' => true,
|
281 |
+
));
|
282 |
+
|
283 |
+
$side_group->add_field( array(
|
284 |
+
'name' => 'General settings',
|
285 |
+
'id' => $prefix . 'other_settings_desc',
|
286 |
+
'type' => 'title',
|
287 |
+
'row_classes' => 'de_hundred_side de_heading_side',
|
288 |
+
));
|
289 |
+
|
290 |
+
$side_group->add_field( array(
|
291 |
+
'name' => '<span class="dashicons dashicons-edit"></span> Change currency',
|
292 |
+
'id' => $prefix . 'currency',
|
293 |
+
'type' => 'text',
|
294 |
+
'row_classes' => 'de_hundred_side de_text_side de_input',
|
295 |
+
));
|
296 |
+
|
297 |
+
$side_group->add_field( array(
|
298 |
+
'name' => '<span style="color:#8a7463;"><span class="dashicons dashicons-lock"></span> PRO Select table skin</span>',
|
299 |
+
'id' => $prefix . 'skin',
|
300 |
+
'type' => 'select',
|
301 |
+
'options' => array(
|
302 |
+
'basic' => 'Skins are new table designs',
|
303 |
),
|
304 |
+
'default' => 'basic',
|
305 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
306 |
+
));
|
307 |
+
|
308 |
+
$side_group->add_field( array(
|
309 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Links behavior',
|
310 |
+
'id' => $prefix . 'open_newwindow',
|
311 |
+
'type' => 'select',
|
312 |
+
'options' => array(
|
313 |
+
'currentwindow' => 'Open in current window',
|
314 |
+
'newwindow' => 'Open in new window/tab',
|
|
|
|
|
|
|
315 |
),
|
316 |
+
'default' => 'currentwindow',
|
317 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
318 |
+
));
|
319 |
+
|
320 |
+
$side_group->add_field( array(
|
321 |
+
'name' => '<span class="dashicons dashicons-admin-generic"></span> Force original fonts',
|
322 |
+
'desc' => 'By default this plugin will use your theme\'s font, check this to force the use of the plugin\'s original fonts.',
|
323 |
+
'id' => $prefix . 'original_font',
|
324 |
+
'type' => 'checkbox',
|
325 |
+
'row_classes' => 'de_hundred_side de_checkbox_side',
|
326 |
+
'default' => false,
|
327 |
+
));
|
328 |
+
|
329 |
+
$side_group->add_field( array(
|
330 |
'name' => 'Font sizes',
|
331 |
'id' => $prefix . 'font_sizes_desc',
|
332 |
'type' => 'title',
|
333 |
+
'row_classes' => 'de_hundred_side de_heading_side',
|
334 |
+
));
|
335 |
+
|
336 |
+
$side_group->add_field( array(
|
337 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Title',
|
338 |
'id' => $prefix . 'title_fontsize',
|
339 |
'type' => 'select',
|
340 |
'options' => array(
|
343 |
'normal' => 'Normal',
|
344 |
),
|
345 |
'default' => 'normal',
|
346 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
347 |
+
));
|
348 |
+
|
349 |
+
$side_group->add_field( array(
|
350 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Subtitle',
|
351 |
'id' => $prefix . 'subtitle_fontsize',
|
352 |
'type' => 'select',
|
353 |
'options' => array(
|
356 |
'normal' => 'Normal',
|
357 |
),
|
358 |
'default' => 'normal',
|
359 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
360 |
+
));
|
361 |
+
|
362 |
+
$side_group->add_field( array(
|
363 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Description',
|
364 |
'id' => $prefix . 'description_fontsize',
|
365 |
'type' => 'select',
|
366 |
'options' => array(
|
368 |
'normal' => 'Normal',
|
369 |
),
|
370 |
'default' => 'normal',
|
371 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
372 |
+
));
|
373 |
+
|
374 |
+
$side_group->add_field( array(
|
375 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Price',
|
376 |
'id' => $prefix . 'price_fontsize',
|
377 |
'type' => 'select',
|
378 |
'options' => array(
|
382 |
'normal' => 'Big',
|
383 |
),
|
384 |
'default' => 'normal',
|
385 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
386 |
+
));
|
387 |
+
|
388 |
+
$side_group->add_field( array(
|
389 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Recurrence',
|
390 |
'id' => $prefix . 'recurrence_fontsize',
|
391 |
'type' => 'select',
|
392 |
'options' => array(
|
394 |
'normal' => 'Normal',
|
395 |
),
|
396 |
'default' => 'normal',
|
397 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
398 |
+
));
|
399 |
+
|
400 |
+
$side_group->add_field( array(
|
401 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Button',
|
402 |
+
'id' => $prefix . 'button_fontsize',
|
403 |
'type' => 'select',
|
404 |
'options' => array(
|
405 |
'small' => 'Small',
|
406 |
'normal' => 'Normal',
|
407 |
),
|
408 |
'default' => 'normal',
|
409 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
410 |
+
));
|
411 |
+
|
412 |
+
$side_group->add_field( array(
|
413 |
+
'name' => '<span class="dashicons dashicons-arrow-down"></span> Features',
|
414 |
+
'id' => $prefix . 'features_fontsize',
|
415 |
'type' => 'select',
|
416 |
'options' => array(
|
417 |
'small' => 'Small',
|
418 |
'normal' => 'Normal',
|
419 |
),
|
420 |
'default' => 'normal',
|
421 |
+
'row_classes' => 'de_hundred_side de_text_side',
|
422 |
+
));
|
423 |
+
|
424 |
+
$main_group->add_field( array(
|
425 |
+
'name' => '<span style="font-weight:400; color:#8a7463;">Up to 5 plans</span>',
|
426 |
+
'desc' => '<span class="dashicons dashicons-flag"></span> You can add up to 5 plans per Pricing Table. <br/> Adding more than that will result in display issues.',
|
427 |
+
'id' => $prefix . 'max',
|
428 |
+
'type' => 'title',
|
429 |
+
'row_classes' => 'de_hundred de_instructions',
|
430 |
+
) );
|
431 |
+
|
432 |
+
// Help group
|
433 |
+
$help_group = new_cmb2_box( array(
|
434 |
+
'id' => $prefix . 'help_metabox',
|
435 |
+
'title' => '<span class="dashicons dashicons-sos"></span> Help & Support',
|
436 |
+
'object_types' => array( 'rpt_pricing_table' ),
|
437 |
+
'context' => 'side',
|
438 |
+
'priority' => 'high',
|
439 |
+
'closed' => true,
|
440 |
+
'row_classes' => 'de_hundred de_heading',
|
441 |
+
));
|
442 |
+
|
443 |
+
$help_group->add_field( array(
|
444 |
+
'name' => '',
|
445 |
+
'desc' => 'Plan\'s skeleton<br/><img src="'.$plan_skeleton_url.'"/><br/>Find help at WPdarko.com<br/><br/><a target="_blank" href="http://wpdarko.com/support/forum/plugins/responsive-pricing-table/"><span class="dashicons dashicons-arrow-right-alt2"></span> Support forum</a><br/><a target="_blank" href="http://wpdarko.com/support/documentation/get-started-responsive-pricing-table/"><span class="dashicons dashicons-arrow-right-alt2"></span> Documentation</a>',
|
446 |
+
'id' => $prefix . 'help_desc',
|
447 |
+
'type' => 'title',
|
448 |
+
'row_classes' => 'de_hundred de_info de_info_side',
|
449 |
+
));
|
450 |
+
|
451 |
+
// PRO group
|
452 |
+
$pro_group = new_cmb2_box( array(
|
453 |
+
'id' => $prefix . 'pro_metabox',
|
454 |
+
'title' => '<span class="dashicons dashicons-awards"></span> PRO version',
|
455 |
+
'object_types' => array( 'rpt_pricing_table' ),
|
456 |
+
'context' => 'side',
|
457 |
+
'priority' => 'high',
|
458 |
+
'closed' => true,
|
459 |
+
'row_classes' => 'de_hundred de_heading',
|
460 |
+
));
|
461 |
+
|
462 |
+
$pro_group->add_field( array(
|
463 |
+
'name' => '',
|
464 |
+
'desc' => 'This free version is <strong>not</strong> limited and does <strong>not</strong> contain any ad. Check out the PRO version for more great features.<br/><br/><a target="_blank" href="http://wpdarko.com/items/responsive-pricing-table-pro"><span class="dashicons dashicons-arrow-right-alt2"></span> See plugin\'s page</a>',
|
465 |
+
'id' => $prefix . 'pro_desc',
|
466 |
+
'type' => 'title',
|
467 |
+
'row_classes' => 'de_hundred de_info de_info_side',
|
468 |
+
));
|
469 |
}
|
470 |
|
471 |
+
add_action( 'cmb2_init', 'rpt_register_plan_group_metabox' );
|
|
|
472 |
|
473 |
+
// Shortcode column
|
474 |
function rpt_custom_columns( $column, $post_id ) {
|
475 |
switch ( $column ) {
|
476 |
case 'dk_shortcode' :
|
477 |
global $post;
|
478 |
$slug = '' ;
|
479 |
$slug = $post->post_name;
|
480 |
+
$shortcode = '<span style="border: solid 3px lightgray; background:white; padding:2px 7px 5px; font-size:18px; line-height:40px;">[rpt name="'.$slug.'"]</strong>';
|
|
|
|
|
481 |
echo $shortcode;
|
482 |
break;
|
483 |
}
|
484 |
}
|
485 |
|
486 |
+
add_action( 'manage_rpt_pricing_table_posts_custom_column' , 'rpt_custom_columns', 10, 2 );
|
487 |
+
|
488 |
function add_rpt_pricing_table_columns($columns) {
|
489 |
+
return array_merge($columns, array('dk_shortcode' => __('Shortcode'),));
|
|
|
|
|
490 |
}
|
491 |
+
|
492 |
add_filter('manage_rpt_pricing_table_posts_columns' , 'add_rpt_pricing_table_columns');
|
493 |
|
494 |
+
// Display Shortcode
|
495 |
function rpt_sc($atts) {
|
496 |
extract(shortcode_atts(array(
|
497 |
"name" => ''
|
498 |
), $atts));
|
|
|
499 |
$output2 = '';
|
500 |
|
501 |
global $post;
|
507 |
$entries = get_post_meta( $post->ID, '_rpt_plan_group', true );
|
508 |
|
509 |
$nb_entries = count($entries);;
|
510 |
+
|
511 |
+
// Forcing original fonts?
|
512 |
+
$original_font = get_post_meta( $post->ID, '_rpt_original_font', true );
|
513 |
+
if ($original_font == true){
|
514 |
+
$ori_f = 'rpt_plan_ori';
|
515 |
+
} else {
|
516 |
+
$ori_f = '';
|
517 |
+
}
|
518 |
|
519 |
+
// Get font sizes
|
520 |
$title_fontsize = get_post_meta( $post->ID, '_rpt_title_fontsize', true );
|
521 |
if ($title_fontsize == 'small') {
|
522 |
$title_fs_class = ' rpt_sm_title';
|
574 |
$button_fs_class = '';
|
575 |
}
|
576 |
|
577 |
+
// Opening rpt_pricr container
|
578 |
$output2 .= '<div id="rpt_pricr" class="rpt_plans rpt_'.$nb_entries .'_plans rpt_style_basic">';
|
579 |
|
580 |
+
// Opening rpt_pricr inner
|
581 |
$output2 .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
|
582 |
|
583 |
foreach ($entries as $key => $plans) {
|
584 |
|
585 |
if (!empty($plans['_rpt_recommended'])){
|
586 |
$is_reco = $plans['_rpt_recommended'];
|
587 |
+
|
588 |
+
//Opening plan
|
589 |
if ($is_reco == true ){
|
590 |
$reco = '<img class="rpt_recommended" src="' . plugins_url('img/rpt_recommended.png', __FILE__) . '"/>';
|
591 |
$reco_class = 'rpt_recommended_plan';
|
598 |
$reco_class = '';
|
599 |
}
|
600 |
|
601 |
+
$output2 .= '<div class="rpt_plan '.$ori_f.' rpt_plan_' . $key . ' ' . $reco_class . '">';
|
602 |
|
603 |
+
// Title
|
604 |
if (!empty($plans['_rpt_title'])){
|
605 |
$output2 .= '<div class="rpt_title rpt_title_' . $key . '">';
|
606 |
|
612 |
$output2 .= $reco . '</div>';
|
613 |
}
|
614 |
|
615 |
+
// Head
|
616 |
$output2 .= '<div class="rpt_head rpt_head_' . $key . '">';
|
617 |
|
618 |
+
// Recurrence
|
619 |
if (!empty($plans['_rpt_recurrence'])){
|
620 |
$output2 .= '<div class="rpt_recurrence rpt_recurrence_' . $key . '">' . $plans['_rpt_recurrence'] . '</div>';
|
621 |
}
|
622 |
|
623 |
+
// Price
|
624 |
if (!empty($plans['_rpt_price'])){
|
625 |
|
626 |
$output2 .= '<div class="rpt_price rpt_price_' . $key . '">';
|
627 |
|
628 |
if (!empty($plans['_rpt_free'])){
|
629 |
if ($plans['_rpt_free'] == true ){
|
630 |
+
$output2 .= '';
|
631 |
} else {
|
632 |
$output2 .= '<span class="rpt_currency"></span>' . $plans['_rpt_price'];
|
633 |
}
|
648 |
$output2 .= '</div>';
|
649 |
}
|
650 |
|
651 |
+
// Subtitle
|
652 |
if (!empty($plans['_rpt_subtitle'])){
|
653 |
$output2 .= '<div style="color:' . $plans['_rpt_color'] . ';" class="rpt_subtitle rpt_subtitle_' . $key . '">' . $plans['_rpt_subtitle'] . '</div>';
|
654 |
}
|
655 |
|
656 |
+
// Description
|
657 |
if (!empty($plans['_rpt_description'])){
|
658 |
$output2 .= '<div class="rpt_description rpt_description_' . $key . '">' . $plans['_rpt_description'] . '</div>';
|
659 |
}
|
660 |
|
661 |
+
// Closing plan head
|
662 |
$output2 .= '</div>';
|
663 |
|
664 |
|
670 |
|
671 |
$string = $plans['_rpt_features'];
|
672 |
$stringAr = explode("\n", $string);
|
673 |
+
$stringAr = array_filter($stringAr, 'trim');
|
674 |
|
675 |
$features = '';
|
676 |
|
677 |
foreach ($stringAr as $feature) {
|
678 |
+
$features[] .= strip_tags($feature,'<strong></strong><br><br/></br><img><a>');
|
679 |
}
|
680 |
|
681 |
foreach ($features as $small_key => $feature){
|
709 |
$btn_link = '#';
|
710 |
}
|
711 |
|
712 |
+
// Link option
|
713 |
$newcurrentwindow = get_post_meta( $post->ID, '_rpt_open_newwindow', true );
|
714 |
if ($newcurrentwindow == 'newwindow'){
|
715 |
$link_behavior = 'target="_blank"';
|
717 |
$link_behavior = 'target="_self"';
|
718 |
}
|
719 |
|
720 |
+
// Foot
|
721 |
if (!empty($plans['_rpt_btn_text'])){
|
722 |
$output2 .= '<a '. $link_behavior .' href="' . $btn_link . '" style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
|
723 |
} else {
|
724 |
$output2 .= '<a '. $link_behavior .' style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
|
725 |
}
|
726 |
+
|
727 |
+
$output2 .= $btn_text;
|
728 |
|
729 |
+
// Closing foot
|
|
|
|
|
|
|
730 |
$output2 .= '</a>';
|
731 |
|
732 |
+
$output2 .= '</div>';
|
733 |
+
|
734 |
}
|
735 |
|
736 |
+
// Closing rpt_inner
|
737 |
$output2 .= '</div>';
|
738 |
|
739 |
+
// Closing rpt_container
|
740 |
$output2 .= '</div>';
|
741 |
|
742 |
$output2 .= '<div style="clear:both;"></div>';
|
743 |
|
|
|
744 |
endforeach; wp_reset_query();
|
|
|
745 |
return $output2;
|
746 |
|
747 |
}
|
|
|
748 |
|
749 |
+
add_shortcode("rpt", "rpt_sc");
|
750 |
?>
|