Version Description
- added polish translation, thanks to Bartosz.
- changed the license key validation proces
- removed non-breaking-space-character from column output
Download this release
Release Info
Developer | codepress |
Plugin | Admin Columns |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.4.1
- assets/css/admin-column.css +332 -18
- assets/css/column.css +7 -0
- assets/images/addon_sortable_1.png +0 -0
- assets/images/arrows.png +0 -0
- assets/images/cross.png +0 -0
- assets/images/information.png +0 -0
- assets/images/loading.gif +0 -0
- assets/images/no.png +0 -0
- assets/images/reorder_arrow.png +0 -0
- assets/images/settings.png +0 -0
- assets/images/sort.png +0 -0
- assets/images/square.png +0 -0
- assets/js/admin-column.js +230 -6
- assets/js/jquery.qtip.js +19 -0
- assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- assets/ui-theme/images/ui-icons_222222_256x240.png +0 -0
- assets/ui-theme/images/ui-icons_2e83ff_256x240.png +0 -0
- assets/ui-theme/images/ui-icons_454545_256x240.png +0 -0
- assets/ui-theme/images/ui-icons_888888_256x240.png +0 -0
- assets/ui-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
- assets/ui-theme/jquery-ui-1.8.18.custom.css +120 -0
- classes/sortable.php +890 -0
- codepress-admin-columns.php +2533 -703
- languages/codepress-admin-columns-nl_NL.mo +0 -0
- languages/codepress-admin-columns-nl_NL.po +338 -188
- languages/codepress-admin-columns-pl_PL.mo +0 -0
- languages/codepress-admin-columns-pl_PL.po +567 -0
- readme.txt +152 -25
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
assets/css/admin-column.css
CHANGED
@@ -1,15 +1,58 @@
|
|
1 |
-
#
|
|
|
|
|
2 |
#cpac .postbox {
|
3 |
margin: 0 10px 10px 0;
|
4 |
}
|
5 |
#cpac .cpac-menu {
|
6 |
clear: both;
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
#icon-codepress-admin-columns {
|
11 |
background: transparent url('../images/icon.png') no-repeat 0 0;
|
12 |
}
|
|
|
|
|
|
|
13 |
#general-cpac-settings > .inside {
|
14 |
padding: 0;
|
15 |
margin: 0;
|
@@ -34,18 +77,30 @@
|
|
34 |
#general-cpac-settings table.form-table tr.bottom td {
|
35 |
border-bottom: none;
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
#general-cpac-settings .cpac-box {
|
38 |
position: relative;
|
39 |
}
|
40 |
#general-cpac-settings .cpac-option-list {
|
41 |
overflow: hidden;
|
42 |
-
width: 360px;
|
|
|
43 |
}
|
44 |
#general-cpac-settings .cpac-reorder-msg {
|
45 |
-
background: transparent url('../images/
|
46 |
margin-left: 5px;
|
47 |
height: 23px;
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
49 |
clear: both;
|
50 |
}
|
51 |
#general-cpac-settings .cpac-option-list li {
|
@@ -63,19 +118,9 @@
|
|
63 |
background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
|
64 |
background-image: linear-gradient(top, #f9f9f9, #ececec);
|
65 |
border-radius: 3px 3px 3px 3px;
|
66 |
-
border: 1px solid #
|
67 |
margin-top: 1px;
|
68 |
}
|
69 |
-
#general-cpac-settings .cpac-option-list li.active {
|
70 |
-
background-color: #d8d8d8;
|
71 |
-
background-image: -ms-linear-gradient(top, #f0f0f0, #d8d8d8);
|
72 |
-
background-image: -moz-linear-gradient(top, #f0f0f0, #d8d8d8);
|
73 |
-
background-image: -o-linear-gradient(top, #f0f0f0, #d8d8d8);
|
74 |
-
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0), to(#d8d8d8));
|
75 |
-
background-image: -webkit-linear-gradient(top, #f0f0f0, #d8d8d8);
|
76 |
-
background-image: linear-gradient(top, #f0f0f0, #d8d8d8);
|
77 |
-
border-color: #c5c5c5;
|
78 |
-
}
|
79 |
#general-cpac-settings .cpac-option-list li .cpac-sort-handle {
|
80 |
background: transparent url('../images/sort.png') no-repeat 5px 5px;
|
81 |
width: 20px;
|
@@ -109,7 +154,8 @@
|
|
109 |
display: block;
|
110 |
margin-right: 30px;
|
111 |
overflow: hidden;
|
112 |
-
height:
|
|
|
113 |
}
|
114 |
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
|
115 |
margin-top: 6px;
|
@@ -130,6 +176,11 @@
|
|
130 |
text-indent: -999em;
|
131 |
overflow: hidden;
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
133 |
#general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
|
134 |
display: inline-block;
|
135 |
margin: 5px 5px 0 0;
|
@@ -165,6 +216,31 @@
|
|
165 |
#general-cpac-settings .cpac-option-list li .cpac-type-inside select {
|
166 |
min-width: 184px;
|
167 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
#general-cpac-settings .cpac-add-column a {
|
169 |
display: block;
|
170 |
}
|
@@ -187,6 +263,123 @@
|
|
187 |
color: #832525;
|
188 |
text-shadow: none;
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
#restore-cpac-settings .inside {
|
191 |
padding: 10px;
|
192 |
}
|
@@ -206,4 +399,125 @@
|
|
206 |
}
|
207 |
#restore-cpac-settings .inside .description {
|
208 |
color: #832525;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
1 |
+
#cpac {
|
2 |
+
/* overflow: hidden; */
|
3 |
+
}
|
4 |
#cpac .postbox {
|
5 |
margin: 0 10px 10px 0;
|
6 |
}
|
7 |
#cpac .cpac-menu {
|
8 |
clear: both;
|
9 |
+
overflow: hidden;
|
10 |
+
margin-right: 276px;
|
11 |
+
}
|
12 |
+
#cpac .cpac-menu .subsubsub {
|
13 |
+
white-space: normal;
|
14 |
+
margin-right: 14px;
|
15 |
+
}
|
16 |
+
#cpac .cpac-settings-link {
|
17 |
+
float: right;
|
18 |
+
float: right;
|
19 |
+
margin: 12px 14px 5px 0;
|
20 |
+
background: transparent url('../images/settings.png') no-repeat 0 0;
|
21 |
+
padding-left: 20px;
|
22 |
+
text-decoration: none;
|
23 |
+
display: inline-block;
|
24 |
+
line-height: 16px;
|
25 |
+
}
|
26 |
+
#cpac .cpac-settings-link.current {
|
27 |
+
font-weight: bold;
|
28 |
+
}
|
29 |
+
#cpac .cpac-col-left {
|
30 |
+
/* width: 70%; */
|
31 |
+
clear: left;
|
32 |
+
float: left;
|
33 |
+
margin-right: -2000px;
|
34 |
+
width: 100%;
|
35 |
+
}
|
36 |
+
#cpac .cpac-col-left .metabox-holder {
|
37 |
+
margin-right: 276px;
|
38 |
+
}
|
39 |
+
#cpac .cpac-col-right {
|
40 |
+
/* width: 20%; */
|
41 |
+
margin-right: auto;
|
42 |
+
width: 266px;
|
43 |
+
float: right;
|
44 |
+
position: relative;
|
45 |
+
clear: right;
|
46 |
+
}
|
47 |
+
#cpac .cpac-col-right .inside {
|
48 |
+
padding: 0 10px;
|
49 |
}
|
50 |
#icon-codepress-admin-columns {
|
51 |
background: transparent url('../images/icon.png') no-repeat 0 0;
|
52 |
}
|
53 |
+
|
54 |
+
/* =General settings
|
55 |
+
-------------------------------------------------------------- */
|
56 |
#general-cpac-settings > .inside {
|
57 |
padding: 0;
|
58 |
margin: 0;
|
77 |
#general-cpac-settings table.form-table tr.bottom td {
|
78 |
border-bottom: none;
|
79 |
}
|
80 |
+
#general-cpac-settings a.go-to-screen {
|
81 |
+
display: block;
|
82 |
+
padding: 5px 0;
|
83 |
+
font-weight: normal;
|
84 |
+
text-decoration: none;
|
85 |
+
}
|
86 |
#general-cpac-settings .cpac-box {
|
87 |
position: relative;
|
88 |
}
|
89 |
#general-cpac-settings .cpac-option-list {
|
90 |
overflow: hidden;
|
91 |
+
width: 360px;
|
92 |
+
margin-bottom: 5px;
|
93 |
}
|
94 |
#general-cpac-settings .cpac-reorder-msg {
|
95 |
+
background: transparent url('../images/reorder_arrow.png') no-repeat scroll 0 0;
|
96 |
margin-left: 5px;
|
97 |
height: 23px;
|
98 |
+
line-height: 25px;
|
99 |
+
padding-left: 25px;
|
100 |
+
color: #727272;
|
101 |
+
font-size: 12px;
|
102 |
+
font-family: 'Trebuchet MS', Arial, Verdana;
|
103 |
+
font-style: italic;
|
104 |
clear: both;
|
105 |
}
|
106 |
#general-cpac-settings .cpac-option-list li {
|
118 |
background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
|
119 |
background-image: linear-gradient(top, #f9f9f9, #ececec);
|
120 |
border-radius: 3px 3px 3px 3px;
|
121 |
+
border: 1px solid #cbcbcb;
|
122 |
margin-top: 1px;
|
123 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
#general-cpac-settings .cpac-option-list li .cpac-sort-handle {
|
125 |
background: transparent url('../images/sort.png') no-repeat 5px 5px;
|
126 |
width: 20px;
|
154 |
display: block;
|
155 |
margin-right: 30px;
|
156 |
overflow: hidden;
|
157 |
+
height: 17px;
|
158 |
+
line-height: 17px;
|
159 |
}
|
160 |
#general-cpac-settings .cpac-option-list li .cpac-type-options input {
|
161 |
margin-top: 6px;
|
176 |
text-indent: -999em;
|
177 |
overflow: hidden;
|
178 |
}
|
179 |
+
#general-cpac-settings .cpac-option-list li.opened a.cpac-action {}
|
180 |
+
#general-cpac-settings .cpac-option-list li.active a.cpac-action {
|
181 |
+
background-position: 50% -66px;
|
182 |
+
}
|
183 |
+
#general-cpac-settings .cpac-option-list li.active.opened a.cpac-action {}
|
184 |
#general-cpac-settings .cpac-option-list li div.cpac-meta-title span {
|
185 |
display: inline-block;
|
186 |
margin: 5px 5px 0 0;
|
216 |
#general-cpac-settings .cpac-option-list li .cpac-type-inside select {
|
217 |
min-width: 184px;
|
218 |
}
|
219 |
+
#general-cpac-settings .cpac-option-list li .cpac-type-inside input.input-width {
|
220 |
+
min-width: 25px;
|
221 |
+
width: 25px;
|
222 |
+
border: none;
|
223 |
+
background: transparent;
|
224 |
+
padding: 0;
|
225 |
+
margin-left: 0px;
|
226 |
+
text-align: right;
|
227 |
+
}
|
228 |
+
#general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range {
|
229 |
+
display: inline-block;
|
230 |
+
min-width: 136px;
|
231 |
+
width: 136px;
|
232 |
+
margin: 8px 0 0;
|
233 |
+
position: relative;
|
234 |
+
}
|
235 |
+
#general-cpac-settings .cpac-option-list li .cpac-type-inside div.input-width-range .ui-slider-handle {
|
236 |
+
cursor:e-resize;
|
237 |
+
}
|
238 |
+
#general-cpac-settings .cpac-option-list li .cpac-type-inside div.description {
|
239 |
+
display: inline-block;
|
240 |
+
font-size: 11px;
|
241 |
+
padding: 0 4px 0 0;
|
242 |
+
width: 36px;
|
243 |
+
}
|
244 |
#general-cpac-settings .cpac-add-column a {
|
245 |
display: block;
|
246 |
}
|
263 |
color: #832525;
|
264 |
text-shadow: none;
|
265 |
}
|
266 |
+
#general-cpac-settings .cpac-option-list li.active {
|
267 |
+
background-color: #c7c7c7;
|
268 |
+
background-image: -ms-linear-gradient(top, #e9e9e9, #c7c7c7);
|
269 |
+
background-image: -moz-linear-gradient(top, #e9e9e9, #c7c7c7);
|
270 |
+
background-image: -o-linear-gradient(top, #e9e9e9, #c7c7c7);
|
271 |
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e9e9e9), to(#c7c7c7));
|
272 |
+
background-image: -webkit-linear-gradient(top, #e9e9e9, #c7c7c7);
|
273 |
+
background-image: linear-gradient(top, #e9e9e9, #c7c7c7);
|
274 |
+
border-color: #aeaeae;
|
275 |
+
}
|
276 |
+
#general-cpac-settings .cpac-option-list li.active .cpac-sort-handle {
|
277 |
+
background-position: 5px -19px;
|
278 |
+
}
|
279 |
+
#general-cpac-settings .cpac-option-list li.active div.cpac-meta-title {
|
280 |
+
color: #151515;
|
281 |
+
}
|
282 |
+
#general-cpac-settings .cpac-option-list li.active div.cpac-meta-title span {
|
283 |
+
color: #5c5c5c
|
284 |
+
}
|
285 |
+
|
286 |
+
/* =Plugin settings (Options)
|
287 |
+
-------------------------------------------------------------- */
|
288 |
+
#cpac-box-plugin_settings {}
|
289 |
+
#cpac-box-plugin_settings > td {
|
290 |
+
border: none;
|
291 |
+
padding: 0;
|
292 |
+
margin: 0;
|
293 |
+
}
|
294 |
+
#cpac-box-plugin_settings table.nopadding {
|
295 |
+
border-collapse: separate;
|
296 |
+
border-spacing: 0;
|
297 |
+
border: none;
|
298 |
+
width: 100%;
|
299 |
+
}
|
300 |
+
#cpac-box-plugin_settings table.nopadding tr.last > td {
|
301 |
+
border-bottom: none;
|
302 |
+
border-top: none;
|
303 |
+
}
|
304 |
+
#cpac-box-plugin_settings table.addons {
|
305 |
+
/* max-width: 620px; */
|
306 |
+
}
|
307 |
+
#cpac-box-plugin_settings table.addons th.activation_type {
|
308 |
+
width: 110px;
|
309 |
+
}
|
310 |
+
#cpac-box-plugin_settings table.addons th.activation_status {
|
311 |
+
width: 90px;
|
312 |
+
}
|
313 |
+
#cpac-box-plugin_settings table.addons th.activation_code {
|
314 |
+
/* width: auto; */
|
315 |
+
min-width: 260px;
|
316 |
+
}
|
317 |
+
#cpac-box-plugin_settings table.addons th.activation_more {
|
318 |
+
/* min-width: 120px; */
|
319 |
+
text-align: left;
|
320 |
+
width: auto;
|
321 |
+
}
|
322 |
+
#cpac-box-plugin_settings table.addons td.activation_type span {
|
323 |
+
font-size: 14px;
|
324 |
+
display: inline-block;
|
325 |
+
background: transparent url('../images/information.png') no-repeat right 50%;
|
326 |
+
padding-right: 20px;
|
327 |
+
}
|
328 |
+
#cpac-box-plugin_settings table.addons td {
|
329 |
+
background: #ffffff;
|
330 |
+
/* vertical-align: middle; */
|
331 |
+
padding: 18px 10px;
|
332 |
+
}
|
333 |
+
#cpac-box-plugin_settings table.addons td.activation_code input {
|
334 |
+
width: 176px;
|
335 |
+
color: #555555;
|
336 |
+
font-family: Arial;
|
337 |
+
font-size: 12px;
|
338 |
+
}
|
339 |
+
#cpac-box-plugin_settings table.addons td.activation_more {
|
340 |
+
text-align: left;
|
341 |
+
}
|
342 |
+
#cpac-box-plugin_settings table.addons td.activation_more a{
|
343 |
+
float: none;
|
344 |
+
display: inline-block;
|
345 |
+
margin-top: 1px;
|
346 |
+
}
|
347 |
+
#cpac-box-plugin_settings table.addons tr.last td {
|
348 |
+
border-bottom: none;
|
349 |
+
}
|
350 |
+
#cpac-box-plugin_settings table.addons .masked_key {
|
351 |
+
padding: 0;
|
352 |
+
}
|
353 |
+
#cpac-box-plugin_settings .cpac-options {}
|
354 |
+
#cpac-box-plugin_settings .cpac-options li {
|
355 |
+
overflow: hidden;
|
356 |
+
}
|
357 |
+
#cpac-box-plugin_settings .cpac-option-label {
|
358 |
+
float: left;
|
359 |
+
width: 140px;
|
360 |
+
}
|
361 |
+
#cpac-box-plugin_settings .cpac-option-inputs {
|
362 |
+
float: left;
|
363 |
+
width: 220px;
|
364 |
+
}
|
365 |
+
#cpac-box-plugin_settings table.addons .button {
|
366 |
+
position: relative;
|
367 |
+
}
|
368 |
+
#cpac-box-plugin_settings table.addons .button.loading {
|
369 |
+
padding-right: 25px;
|
370 |
+
}
|
371 |
+
#cpac-box-plugin_settings table.addons .button.loading span {
|
372 |
+
position: absolute;
|
373 |
+
top: 2px;
|
374 |
+
right: 6px;
|
375 |
+
background: transparent url('../images/loading.gif') no-repeat right 50%;
|
376 |
+
width: 16px;
|
377 |
+
height: 16px;
|
378 |
+
display: inline-block;
|
379 |
+
}
|
380 |
+
|
381 |
+
/* =Restore settings
|
382 |
+
-------------------------------------------------------------- */
|
383 |
#restore-cpac-settings .inside {
|
384 |
padding: 10px;
|
385 |
}
|
399 |
}
|
400 |
#restore-cpac-settings .inside .description {
|
401 |
color: #832525;
|
402 |
+
}
|
403 |
+
|
404 |
+
/* =Addons settings
|
405 |
+
-------------------------------------------------------------- */
|
406 |
+
#addons-cpac-settings {
|
407 |
+
overflow: hidden;
|
408 |
+
}
|
409 |
+
#addons-cpac-settings h2 {
|
410 |
+
font-size: 14px;
|
411 |
+
line-height: 14px;
|
412 |
+
margin-bottom: 0;
|
413 |
+
padding-bottom: 0;
|
414 |
+
}
|
415 |
+
#addons-cpac-settings a {
|
416 |
+
padding: 0 10px 10px;
|
417 |
+
text-decoration: none;
|
418 |
+
color: green;
|
419 |
+
text-decoration: underline;
|
420 |
+
}
|
421 |
+
#addons-cpac-settings a:hover {
|
422 |
+
color: darkgreen;
|
423 |
+
}
|
424 |
+
|
425 |
+
|
426 |
+
/* =Like this plugin settings
|
427 |
+
-------------------------------------------------------------- */
|
428 |
+
#likethisplugin-cpac-settings {
|
429 |
+
padding: 0;
|
430 |
+
}
|
431 |
+
#likethisplugin-cpac-settings ul {
|
432 |
+
margin-left: 20px;
|
433 |
+
}
|
434 |
+
#likethisplugin-cpac-settings li {
|
435 |
+
list-style: square;
|
436 |
+
line-height: 16px;
|
437 |
+
}
|
438 |
+
#likethisplugin-cpac-settings li a {
|
439 |
+
text-decoration: none;
|
440 |
+
}
|
441 |
+
#likethisplugin-cpac-settings li.donate_link a {
|
442 |
+
/* color: green;
|
443 |
+
text-decoration: underline; */
|
444 |
+
}
|
445 |
+
#likethisplugin-cpac-settings li.donate_link a:hover {
|
446 |
+
color: darkgreen;
|
447 |
+
}
|
448 |
+
|
449 |
+
/* =Activation
|
450 |
+
-------------------------------------------------------------- */
|
451 |
+
#cpac-box-plugin_settings .addons .activation_code .activate,
|
452 |
+
#cpac-box-plugin_settings .addons .activation_code .deactivate {
|
453 |
+
min-height: 25px;
|
454 |
+
}
|
455 |
+
#cpac-box-plugin_settings .activation_status .activate {
|
456 |
+
color: #CC0000;
|
457 |
+
}
|
458 |
+
#cpac-box-plugin_settings .activation_status .deactivate {
|
459 |
+
color: darkgreen;
|
460 |
+
}
|
461 |
+
#cpac-box-plugin_settings .activation-error-msg {
|
462 |
+
color: #CC0000;
|
463 |
+
line-height: 20px;
|
464 |
+
padding: 0 6px;
|
465 |
+
}
|
466 |
+
|
467 |
+
/* =Tooltip
|
468 |
+
-------------------------------------------------------------- */
|
469 |
+
.qtip .qtip-tip {
|
470 |
+
left: 74px !important;
|
471 |
+
top: 1px !important;
|
472 |
+
}
|
473 |
+
.qtip .qtip-wrapper {
|
474 |
+
background: #fff;
|
475 |
+
border-style: solid;
|
476 |
+
border-width: 1px;
|
477 |
+
border-color: #dfdfdf;
|
478 |
+
border-color: rgba(0,0,0,.125);
|
479 |
+
border-top: none;
|
480 |
+
-webkit-border-radius: 3px;
|
481 |
+
border-radius: 3px;
|
482 |
+
border-radius: 5px;
|
483 |
+
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,.19);
|
484 |
+
-moz-box-shadow: 0 2px 4px rgba(0,0,0,.19);
|
485 |
+
box-shadow: 0 2px 4px rgba(0,0,0,.19);
|
486 |
+
|
487 |
+
}
|
488 |
+
.qtip .qtip-wrapper .qtip_title {
|
489 |
+
padding: 15px 18px 14px 15px;
|
490 |
+
clear: both;
|
491 |
+
line-height: 1.4em;
|
492 |
+
font-size: 14px;
|
493 |
+
color: #fff;
|
494 |
+
border-radius: 3px 3px 0 0;
|
495 |
+
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
|
496 |
+
background-color: #8cc1e9;
|
497 |
+
background-image: -webkit-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
|
498 |
+
background-image: -moz-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
|
499 |
+
background-image: -ms-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
|
500 |
+
background-image: -o-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
|
501 |
+
background-image: linear-gradient(bottom, rgb(114,167,207) 0%, rgb(140,193,233) 100%);
|
502 |
+
}
|
503 |
+
.qtip .qtip-wrapper .qtip_content {
|
504 |
+
padding: 0 14px 14px;
|
505 |
+
margin: 0;
|
506 |
+
overflow: hidden;
|
507 |
+
clear: both;
|
508 |
+
min-height: 40px;
|
509 |
+
font-size: 13px;
|
510 |
+
background: #fff;
|
511 |
+
}
|
512 |
+
.qtip .qtip-wrapper .qtip_content .button-primary {
|
513 |
+
margin: 6px 0 0;
|
514 |
+
}
|
515 |
+
|
516 |
+
/* =Responsive Design
|
517 |
+
-------------------------------------------------------------- */
|
518 |
+
body.folded #cpac .cpac-col-left .metabox-holder {
|
519 |
+
margin-right: 0;
|
520 |
+
}
|
521 |
+
body.folded #cpac .cpac-col-right {
|
522 |
+
display: none;
|
523 |
}
|
assets/css/column.css
CHANGED
@@ -1,4 +1,11 @@
|
|
|
|
1 |
.column-column-attachment img {
|
2 |
padding-right: 5px;
|
3 |
padding-bottom: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
1 |
+
.cpac-column-value-image,
|
2 |
.column-column-attachment img {
|
3 |
padding-right: 5px;
|
4 |
padding-bottom: 4px;
|
5 |
+
}
|
6 |
+
.cpac-divider {
|
7 |
+
display: inline-block;
|
8 |
+
width: 14px;
|
9 |
+
height: 12px;
|
10 |
+
background: transparent url(../images/square.png) no-repeat 50% 7px;
|
11 |
}
|
assets/images/addon_sortable_1.png
ADDED
Binary file
|
assets/images/arrows.png
CHANGED
Binary file
|
assets/images/cross.png
ADDED
Binary file
|
assets/images/information.png
ADDED
Binary file
|
assets/images/loading.gif
ADDED
Binary file
|
assets/images/no.png
ADDED
Binary file
|
assets/images/reorder_arrow.png
ADDED
Binary file
|
assets/images/settings.png
ADDED
Binary file
|
assets/images/sort.png
CHANGED
Binary file
|
assets/images/square.png
ADDED
Binary file
|
assets/js/admin-column.js
CHANGED
@@ -2,12 +2,20 @@
|
|
2 |
* fires when the dom is ready
|
3 |
*
|
4 |
*/
|
5 |
-
jQuery(document).ready(function()
|
|
|
|
|
|
|
|
|
6 |
cpac_sortable();
|
7 |
cpac_checked();
|
8 |
cpac_box_events();
|
9 |
cpac_menu();
|
10 |
cpac_add_custom_column();
|
|
|
|
|
|
|
|
|
11 |
});
|
12 |
|
13 |
/**
|
@@ -15,7 +23,7 @@ jQuery(document).ready(function(){
|
|
15 |
*
|
16 |
*/
|
17 |
function cpac_sortable()
|
18 |
-
{
|
19 |
jQuery('ul.cpac-option-list').sortable({
|
20 |
handle: 'div.cpac-sort-handle',
|
21 |
placeholder: 'cpac-placeholder',
|
@@ -38,7 +46,7 @@ function cpac_checked()
|
|
38 |
// toggle on
|
39 |
if ( value != 'on') {
|
40 |
li.addClass('active');
|
41 |
-
state.attr('value', 'on');
|
42 |
}
|
43 |
|
44 |
// toggle off
|
@@ -59,7 +67,10 @@ function cpac_box_events()
|
|
59 |
// fold in/out
|
60 |
jQuery('#cpac .cpac-option-list .cpac-action').unbind('click').click(function(e){
|
61 |
e.preventDefault();
|
62 |
-
jQuery(this).closest('li')
|
|
|
|
|
|
|
63 |
});
|
64 |
|
65 |
// remove custom field box
|
@@ -72,8 +83,7 @@ function cpac_box_events()
|
|
72 |
height: 0
|
73 |
}, 350, function() {
|
74 |
el.remove();
|
75 |
-
});
|
76 |
-
|
77 |
});
|
78 |
}
|
79 |
|
@@ -189,4 +199,218 @@ function cpac_add_custom_column()
|
|
189 |
// retrigger click events
|
190 |
cpac_box_events();
|
191 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
2 |
* fires when the dom is ready
|
3 |
*
|
4 |
*/
|
5 |
+
jQuery(document).ready(function()
|
6 |
+
{
|
7 |
+
if (jQuery('#cpac').length == 0)
|
8 |
+
return false;
|
9 |
+
|
10 |
cpac_sortable();
|
11 |
cpac_checked();
|
12 |
cpac_box_events();
|
13 |
cpac_menu();
|
14 |
cpac_add_custom_column();
|
15 |
+
cpac_clear_input_defaults();
|
16 |
+
cpac_tooltips();
|
17 |
+
cpac_addon_activation();
|
18 |
+
cpac_width_range();
|
19 |
});
|
20 |
|
21 |
/**
|
23 |
*
|
24 |
*/
|
25 |
function cpac_sortable()
|
26 |
+
{
|
27 |
jQuery('ul.cpac-option-list').sortable({
|
28 |
handle: 'div.cpac-sort-handle',
|
29 |
placeholder: 'cpac-placeholder',
|
46 |
// toggle on
|
47 |
if ( value != 'on') {
|
48 |
li.addClass('active');
|
49 |
+
state.attr('value', 'on');
|
50 |
}
|
51 |
|
52 |
// toggle off
|
67 |
// fold in/out
|
68 |
jQuery('#cpac .cpac-option-list .cpac-action').unbind('click').click(function(e){
|
69 |
e.preventDefault();
|
70 |
+
var li = jQuery(this).closest('li');
|
71 |
+
li.find('.cpac-type-inside').slideToggle(150, function() {
|
72 |
+
li.toggleClass('opened');
|
73 |
+
});
|
74 |
});
|
75 |
|
76 |
// remove custom field box
|
83 |
height: 0
|
84 |
}, 350, function() {
|
85 |
el.remove();
|
86 |
+
});
|
|
|
87 |
});
|
88 |
}
|
89 |
|
199 |
// retrigger click events
|
200 |
cpac_box_events();
|
201 |
});
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Clear Input Defaults
|
206 |
+
*
|
207 |
+
*/
|
208 |
+
function cpac_clear_input_defaults()
|
209 |
+
{
|
210 |
+
jQuery.fn.cleardefault = function() {
|
211 |
+
return this.focus(function() {
|
212 |
+
if( this.value == this.defaultValue ) {
|
213 |
+
this.value = "";
|
214 |
+
}
|
215 |
+
}).blur(function() {
|
216 |
+
if( !this.value.length ) {
|
217 |
+
this.value = this.defaultValue;
|
218 |
+
}
|
219 |
+
});
|
220 |
+
};
|
221 |
+
jQuery("#cpac-box-plugin_settings .addons input").cleardefault();
|
222 |
+
}
|
223 |
+
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Tooltip
|
227 |
+
*
|
228 |
+
*/
|
229 |
+
function cpac_tooltips()
|
230 |
+
{
|
231 |
+
jQuery('#cpac .activation_type span').each(function() {
|
232 |
+
var info = jQuery(this).next('.cpac-tooltip').html();
|
233 |
+
|
234 |
+
if ( ! info )
|
235 |
+
return;
|
236 |
+
|
237 |
+
jQuery('#cpac .activation_type span').qtip({
|
238 |
+
content: info,
|
239 |
+
title: 'title',
|
240 |
+
style: {
|
241 |
+
width: 400,
|
242 |
+
padding: 0,
|
243 |
+
background: 'transparent',
|
244 |
+
color: 'black',
|
245 |
+
textAlign: 'left',
|
246 |
+
border: {
|
247 |
+
width: 0,
|
248 |
+
radius: 0
|
249 |
+
},
|
250 |
+
tip: {
|
251 |
+
corner: 'topMiddle',
|
252 |
+
color: '#8cc1e9',
|
253 |
+
size: {
|
254 |
+
x: 32,
|
255 |
+
y : 15
|
256 |
+
}
|
257 |
+
}
|
258 |
+
},
|
259 |
+
position: {
|
260 |
+
corner: {
|
261 |
+
target: 'bottomRight'
|
262 |
+
},
|
263 |
+
adjust: {
|
264 |
+
x: -80,
|
265 |
+
y: 0
|
266 |
+
}
|
267 |
+
},
|
268 |
+
hide: {
|
269 |
+
when: 'mouseout',
|
270 |
+
fixed: true ,
|
271 |
+
delay: 100
|
272 |
+
}
|
273 |
+
});
|
274 |
+
});
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Width range
|
279 |
+
*
|
280 |
+
*/
|
281 |
+
function cpac_width_range()
|
282 |
+
{
|
283 |
+
if ( jQuery('.input-width-range').length == false )
|
284 |
+
return;
|
285 |
+
|
286 |
+
jQuery('.input-width-range').each( function(){
|
287 |
+
|
288 |
+
var input = jQuery(this).closest('.cpac-type-inside').find('.input-width');
|
289 |
+
var descr = jQuery(this).closest('.cpac-type-inside').find('.width-decription');
|
290 |
+
var input_default = jQuery(input)[0].defaultValue;
|
291 |
+
var translation_default = descr.attr('title');
|
292 |
+
|
293 |
+
jQuery(this).slider({
|
294 |
+
range: 'min',
|
295 |
+
value: 1,
|
296 |
+
min: 0,
|
297 |
+
max: 100,
|
298 |
+
value: input_default,
|
299 |
+
slide: function( event, ui ) {
|
300 |
+
|
301 |
+
// set default
|
302 |
+
var descr_value = ui.value > 0 ? ui.value + '%' : translation_default;
|
303 |
+
|
304 |
+
jQuery(input).val( ui.value );
|
305 |
+
jQuery(descr).text( descr_value );
|
306 |
+
}
|
307 |
+
});
|
308 |
+
});
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Addon actviate/deactivate
|
313 |
+
*
|
314 |
+
*/
|
315 |
+
function cpac_addon_activation()
|
316 |
+
{
|
317 |
+
jQuery('#cpac-box-plugin_settings .addons .activation_code a.button').click(function(e) {
|
318 |
+
e.preventDefault();
|
319 |
+
|
320 |
+
// get input values
|
321 |
+
var row = jQuery(this).closest('tr');
|
322 |
+
var type = jQuery(row).attr('id').replace('cpac-activation-','');
|
323 |
+
var parent_class = jQuery(this).parent('div');
|
324 |
+
var msg = jQuery(row).find('.activation-error-msg');
|
325 |
+
|
326 |
+
// get translated string
|
327 |
+
var translations = jQuery('#cpac-box-plugin_settings .addon-translation-string');
|
328 |
+
var msg_fillin = jQuery('.tstring-fill-in',translations).text();
|
329 |
+
var msg_unrecognised = jQuery('.tstring-unrecognised',translations).text();
|
330 |
+
|
331 |
+
// reset
|
332 |
+
jQuery(msg).empty();
|
333 |
+
|
334 |
+
// Activate
|
335 |
+
if ( parent_class.hasClass('activate') ) {
|
336 |
+
|
337 |
+
// input values
|
338 |
+
var input = jQuery('.activate input', row);
|
339 |
+
var button = jQuery('.activate .button', row);
|
340 |
+
var key = input.val();
|
341 |
+
var default_val = jQuery(input)[0].defaultValue;
|
342 |
+
|
343 |
+
// make sure the input value has changed
|
344 |
+
if ( key == default_val ) {
|
345 |
+
jQuery(msg).text(msg_fillin).hide().fadeIn();
|
346 |
+
return false;
|
347 |
+
}
|
348 |
+
|
349 |
+
// set loading icon
|
350 |
+
button.addClass('loading');
|
351 |
+
|
352 |
+
// update key
|
353 |
+
jQuery.ajax({
|
354 |
+
url : ajaxurl,
|
355 |
+
type : 'POST',
|
356 |
+
dataType : 'json',
|
357 |
+
data : {
|
358 |
+
action : 'cpac_addon_activation',
|
359 |
+
type : 'sortable',
|
360 |
+
key : key
|
361 |
+
},
|
362 |
+
success: function(data) {
|
363 |
+
if ( data != null ) {
|
364 |
+
jQuery('div.activate', row).hide();
|
365 |
+
jQuery('div.deactivate', row).show();
|
366 |
+
jQuery('div.deactivate span.masked_key', row).text(data);
|
367 |
+
} else {
|
368 |
+
jQuery(msg).text(msg_unrecognised).hide().fadeIn();
|
369 |
+
}
|
370 |
+
},
|
371 |
+
error: function(xhr, ajaxOptions, thrownError) {
|
372 |
+
jQuery(msg).text(msg_unrecognised).hide().fadeIn();
|
373 |
+
},
|
374 |
+
complete: function() {
|
375 |
+
button.removeClass('loading');
|
376 |
+
}
|
377 |
+
});
|
378 |
+
}
|
379 |
+
|
380 |
+
// Deactivate
|
381 |
+
if ( parent_class.hasClass('deactivate') ) {
|
382 |
+
|
383 |
+
var button = jQuery('.deactivate .button', row);
|
384 |
+
var input = jQuery('.activate input', row);
|
385 |
+
|
386 |
+
// set loading icon
|
387 |
+
button.addClass('loading');
|
388 |
+
|
389 |
+
// update key
|
390 |
+
jQuery.ajax({
|
391 |
+
url : ajaxurl,
|
392 |
+
type : 'POST',
|
393 |
+
dataType : 'json',
|
394 |
+
data : {
|
395 |
+
action : 'cpac_addon_activation',
|
396 |
+
type : 'sortable',
|
397 |
+
key : 'remove'
|
398 |
+
},
|
399 |
+
success: function(data) {
|
400 |
+
jQuery('div.activate', row).show();
|
401 |
+
jQuery('div.deactivate', row).hide();
|
402 |
+
jQuery('div.deactivate span.masked_key', row).empty();
|
403 |
+
input.val('');
|
404 |
+
},
|
405 |
+
error: function(xhr, ajaxOptions, thrownError) {
|
406 |
+
//console.log(xhr);
|
407 |
+
//console.log(ajaxOptions);
|
408 |
+
//console.log(thrownError);
|
409 |
+
},
|
410 |
+
complete: function() {
|
411 |
+
button.removeClass('loading');
|
412 |
+
}
|
413 |
+
});
|
414 |
+
}
|
415 |
+
});
|
416 |
}
|
assets/js/jquery.qtip.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jquery.qtip. The jQuery tooltip plugin
|
3 |
+
*
|
4 |
+
* Copyright (c) 2009 Craig Thompson
|
5 |
+
* http://craigsworks.com
|
6 |
+
*
|
7 |
+
* Licensed under MIT
|
8 |
+
* http://www.opensource.org/licenses/mit-license.php
|
9 |
+
*
|
10 |
+
* Launch : February 2009
|
11 |
+
* Version : 1.0.0-rc3
|
12 |
+
* Released: Tuesday 12th May, 2009 - 00:00
|
13 |
+
* Debug: jquery.qtip.debug.js
|
14 |
+
*/
|
15 |
+
(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';"> <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> <div class="qtip-contentWrapper" style="overflow:hidden;"> <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
|
assets/ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_flat_75_ffffff_40x100.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_glass_65_ffffff_1x400.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_glass_75_dadada_1x400.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_glass_95_fef1ec_1x400.png
ADDED
Binary file
|
assets/ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png
ADDED
Binary file
|
assets/ui-theme/images/ui-icons_222222_256x240.png
ADDED
Binary file
|
assets/ui-theme/images/ui-icons_2e83ff_256x240.png
ADDED
Binary file
|
assets/ui-theme/images/ui-icons_454545_256x240.png
ADDED
Binary file
|
assets/ui-theme/images/ui-icons_888888_256x240.png
ADDED
Binary file
|
assets/ui-theme/images/ui-icons_cd0a0a_256x240.png
ADDED
Binary file
|
assets/ui-theme/jquery-ui-1.8.18.custom.css
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery UI CSS Framework 1.8.18
|
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 |
+
|
11 |
+
/* Layout helpers
|
12 |
+
----------------------------------*/
|
13 |
+
.ui-helper-hidden { display: none; }
|
14 |
+
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
15 |
+
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
16 |
+
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
17 |
+
.ui-helper-clearfix:after { clear: both; }
|
18 |
+
.ui-helper-clearfix { zoom: 1; }
|
19 |
+
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
20 |
+
|
21 |
+
|
22 |
+
/* Interaction Cues
|
23 |
+
----------------------------------*/
|
24 |
+
.ui-state-disabled { cursor: default !important; }
|
25 |
+
|
26 |
+
|
27 |
+
/* Icons
|
28 |
+
----------------------------------*/
|
29 |
+
|
30 |
+
/* states and images */
|
31 |
+
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
32 |
+
|
33 |
+
|
34 |
+
/* Misc visuals
|
35 |
+
----------------------------------*/
|
36 |
+
|
37 |
+
/* Overlays */
|
38 |
+
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
39 |
+
|
40 |
+
|
41 |
+
/*
|
42 |
+
* jQuery UI CSS Framework 1.8.18
|
43 |
+
*
|
44 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
45 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
46 |
+
* http://jquery.org/license
|
47 |
+
*
|
48 |
+
* http://docs.jquery.com/UI/Theming/API
|
49 |
+
*
|
50 |
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
51 |
+
*/
|
52 |
+
|
53 |
+
|
54 |
+
/* Component containers
|
55 |
+
----------------------------------*/
|
56 |
+
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
57 |
+
.ui-widget .ui-widget { font-size: 1em; }
|
58 |
+
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
59 |
+
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
60 |
+
.ui-widget-content a { color: #222222; }
|
61 |
+
.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; }
|
62 |
+
.ui-widget-header a { color: #222222; }
|
63 |
+
|
64 |
+
/* Interaction states
|
65 |
+
----------------------------------*/
|
66 |
+
.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; }
|
67 |
+
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
68 |
+
.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; }
|
69 |
+
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
70 |
+
.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; }
|
71 |
+
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
72 |
+
.ui-widget :active { outline: none; }
|
73 |
+
|
74 |
+
/* Interaction Cues
|
75 |
+
----------------------------------*/
|
76 |
+
.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; }
|
77 |
+
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
78 |
+
.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; }
|
79 |
+
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
80 |
+
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
81 |
+
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
82 |
+
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
83 |
+
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
84 |
+
|
85 |
+
|
86 |
+
/* Misc visuals
|
87 |
+
----------------------------------*/
|
88 |
+
|
89 |
+
/* Corner radius */
|
90 |
+
.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; }
|
91 |
+
.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; }
|
92 |
+
.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; }
|
93 |
+
.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; }
|
94 |
+
|
95 |
+
/* Overlays */
|
96 |
+
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
97 |
+
.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; }/*
|
98 |
+
* jQuery UI Slider 1.8.18
|
99 |
+
*
|
100 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
101 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
102 |
+
* http://jquery.org/license
|
103 |
+
*
|
104 |
+
* http://docs.jquery.com/UI/Slider#theming
|
105 |
+
*/
|
106 |
+
.ui-slider { position: relative; text-align: left; }
|
107 |
+
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 12px; height: 12px; cursor: default; }
|
108 |
+
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
109 |
+
|
110 |
+
.ui-slider-horizontal { height: 8px; }
|
111 |
+
.ui-slider-horizontal .ui-slider-handle { top: -3px; margin-left: -4px; }
|
112 |
+
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
113 |
+
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
114 |
+
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
115 |
+
|
116 |
+
.ui-slider-vertical { width: .8em; height: 100px; }
|
117 |
+
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
118 |
+
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
119 |
+
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
120 |
+
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
classes/sortable.php
ADDED
@@ -0,0 +1,890 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Coderess Sortable Columns Class
|
5 |
+
*
|
6 |
+
* @since 1.3
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class Codepress_Sortable_Columns extends Codepress_Admin_Columns
|
10 |
+
{
|
11 |
+
private $post_types,
|
12 |
+
$unlocked,
|
13 |
+
$show_all_results;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Constructor
|
17 |
+
*
|
18 |
+
* @since 1.0
|
19 |
+
*/
|
20 |
+
function __construct()
|
21 |
+
{
|
22 |
+
add_action( 'wp_loaded', array( $this, 'init') );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Initialize
|
27 |
+
*
|
28 |
+
* @since 1.0
|
29 |
+
*/
|
30 |
+
public function init()
|
31 |
+
{
|
32 |
+
// vars
|
33 |
+
$this->unlocked = $this->is_unlocked('sortable');
|
34 |
+
$this->post_types = $this->get_post_types();
|
35 |
+
$this->show_all_results = false;
|
36 |
+
|
37 |
+
add_action( 'admin_init', array( $this, 'register_sortable_columns' ) );
|
38 |
+
|
39 |
+
// handle requests for sorting columns
|
40 |
+
add_filter( 'request', array( $this, 'handle_requests_orderby_column'), 1 );
|
41 |
+
add_action( 'pre_user_query', array( $this, 'handle_requests_orderby_users_column'), 1 );
|
42 |
+
add_action( 'admin_init', array( $this, 'handle_requests_orderby_links_column'), 1 );
|
43 |
+
add_action( 'admin_init', array( $this, 'handle_requests_orderby_comments_column'), 1 );
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Register sortable columns
|
48 |
+
*
|
49 |
+
* Hooks into apply_filters( "manage_{$screen->id}_sortable_columns" ) which is found in class-wp-list-table.php
|
50 |
+
*
|
51 |
+
* @since 1.0
|
52 |
+
*/
|
53 |
+
function register_sortable_columns()
|
54 |
+
{
|
55 |
+
if ( ! $this->unlocked )
|
56 |
+
return false;
|
57 |
+
|
58 |
+
/** Posts */
|
59 |
+
foreach ( $this->post_types as $post_type )
|
60 |
+
add_filter( "manage_edit-{$post_type}_sortable_columns", array($this, 'callback_add_sortable_posts_column'));
|
61 |
+
|
62 |
+
/** Users */
|
63 |
+
add_filter( "manage_users_sortable_columns", array($this, 'callback_add_sortable_users_column'));
|
64 |
+
|
65 |
+
/** Media */
|
66 |
+
add_filter( "manage_upload_sortable_columns", array($this, 'callback_add_sortable_media_column'));
|
67 |
+
|
68 |
+
/** Links */
|
69 |
+
add_filter( "manage_link-manager_sortable_columns", array($this, 'callback_add_sortable_links_column'));
|
70 |
+
|
71 |
+
/** Comments */
|
72 |
+
add_filter( "manage_edit-comments_sortable_columns", array($this, 'callback_add_sortable_comments_column'));
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Callback add Posts sortable column
|
77 |
+
*
|
78 |
+
* @since 1.0
|
79 |
+
*/
|
80 |
+
public function callback_add_sortable_posts_column($columns)
|
81 |
+
{
|
82 |
+
global $post_type;
|
83 |
+
|
84 |
+
return $this->add_managed_sortable_columns($post_type, $columns);
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Callback add Users sortable column
|
89 |
+
*
|
90 |
+
* @since 1.1
|
91 |
+
*/
|
92 |
+
public function callback_add_sortable_users_column($columns)
|
93 |
+
{
|
94 |
+
return $this->add_managed_sortable_columns('wp-users', $columns);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Callback add Media sortable column
|
99 |
+
*
|
100 |
+
* @since 1.3
|
101 |
+
*/
|
102 |
+
public function callback_add_sortable_media_column($columns)
|
103 |
+
{
|
104 |
+
return $this->add_managed_sortable_columns('wp-media', $columns);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Callback add Links sortable column
|
109 |
+
*
|
110 |
+
* @since 1.3.1
|
111 |
+
*/
|
112 |
+
public function callback_add_sortable_links_column($columns)
|
113 |
+
{
|
114 |
+
return $this->add_managed_sortable_columns('wp-links', $columns);
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Callback add Comments sortable column
|
119 |
+
*
|
120 |
+
* @since 1.3.1
|
121 |
+
*/
|
122 |
+
public function callback_add_sortable_comments_column($columns)
|
123 |
+
{
|
124 |
+
return $this->add_managed_sortable_columns('wp-comments', $columns);
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Add managed sortable columns by Type
|
129 |
+
*
|
130 |
+
* @since 1.1
|
131 |
+
*/
|
132 |
+
private function add_managed_sortable_columns( $type = 'post', $columns )
|
133 |
+
{
|
134 |
+
$display_columns = $this->get_merged_columns($type);
|
135 |
+
|
136 |
+
if ( ! $display_columns )
|
137 |
+
return $columns;
|
138 |
+
|
139 |
+
foreach ( $display_columns as $id => $vars ) {
|
140 |
+
if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
|
141 |
+
|
142 |
+
// register format
|
143 |
+
$columns[$id] = $this->sanitize_string($vars['label']);
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
return $columns;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Admin requests for orderby column
|
152 |
+
*
|
153 |
+
* Only works for WP_Query objects ( such as posts and media )
|
154 |
+
*
|
155 |
+
* @since 1.0
|
156 |
+
*/
|
157 |
+
public function handle_requests_orderby_column( $vars )
|
158 |
+
{
|
159 |
+
if ( ! isset( $vars['orderby'] ) )
|
160 |
+
return $vars;
|
161 |
+
|
162 |
+
/** Users */
|
163 |
+
// You would expect to see get_orderby_users_vars(), but sorting for
|
164 |
+
// users is handled through a different filter. Not 'request', but 'pre_user_query'.
|
165 |
+
// See handle_requests_orderby_users_column().
|
166 |
+
|
167 |
+
/** Media */
|
168 |
+
elseif ( $this->request_uri_is('upload') )
|
169 |
+
$vars = $this->get_orderby_media_vars($vars);
|
170 |
+
|
171 |
+
/** Posts */
|
172 |
+
elseif ( !empty($vars['post_type']) )
|
173 |
+
$vars = $this->get_orderby_posts_vars($vars);
|
174 |
+
|
175 |
+
return $vars;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Orderby Users column
|
180 |
+
*
|
181 |
+
* @since 1.3
|
182 |
+
*/
|
183 |
+
public function handle_requests_orderby_users_column($user_query)
|
184 |
+
{
|
185 |
+
// query vars
|
186 |
+
$vars = $user_query->query_vars;
|
187 |
+
|
188 |
+
// Column
|
189 |
+
$column = $this->get_orderby_type( $vars['orderby'], 'wp-users' );
|
190 |
+
|
191 |
+
if ( empty($column) )
|
192 |
+
return $vars;
|
193 |
+
|
194 |
+
// id
|
195 |
+
$id = key($column);
|
196 |
+
|
197 |
+
// type
|
198 |
+
$type = $id;
|
199 |
+
|
200 |
+
// Check for user custom fields: column-meta-[customfieldname]
|
201 |
+
if ( $this->is_column_meta($type) )
|
202 |
+
$type = 'column-user-meta';
|
203 |
+
|
204 |
+
// Check for post count: column-user_postcount-[posttype]
|
205 |
+
if ( $this->get_posttype_by_postcount_column($type) )
|
206 |
+
$type = 'column-user_postcount';
|
207 |
+
|
208 |
+
// var
|
209 |
+
$cusers = array();
|
210 |
+
switch( $type ) :
|
211 |
+
|
212 |
+
case 'column-user_id':
|
213 |
+
$user_query->query_vars['orderby'] = 'ID';
|
214 |
+
break;
|
215 |
+
|
216 |
+
case 'column-user_registered':
|
217 |
+
$user_query->query_vars['orderby'] = 'registered';
|
218 |
+
break;
|
219 |
+
|
220 |
+
case 'column-nickname':
|
221 |
+
$user_query->query_vars['orderby'] = 'nickname';
|
222 |
+
break;
|
223 |
+
|
224 |
+
case 'column-first_name':
|
225 |
+
foreach ( $this->get_users_data() as $u )
|
226 |
+
if ($u->first_name || $this->show_all_results )
|
227 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($u->first_name);
|
228 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
229 |
+
break;
|
230 |
+
|
231 |
+
case 'column-last_name':
|
232 |
+
foreach ( $this->get_users_data() as $u )
|
233 |
+
if ($u->last_name || $this->show_all_results )
|
234 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($u->last_name);
|
235 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
236 |
+
break;
|
237 |
+
|
238 |
+
case 'column-user_url':
|
239 |
+
foreach ( $this->get_users_data() as $u )
|
240 |
+
if ($u->user_url || $this->show_all_results )
|
241 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($u->user_url);
|
242 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
243 |
+
break;
|
244 |
+
|
245 |
+
case 'column-user_description':
|
246 |
+
foreach ( $this->get_users_data() as $u )
|
247 |
+
if ($u->user_description || $this->show_all_results )
|
248 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($u->user_description);
|
249 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
250 |
+
break;
|
251 |
+
|
252 |
+
case 'column-user_postcount' :
|
253 |
+
$post_type = $this->get_posttype_by_postcount_column($id);
|
254 |
+
if ( $post_type ) {
|
255 |
+
foreach ( $this->get_users_data() as $u ) {
|
256 |
+
$count = $this->get_post_count( $post_type, $u->ID );
|
257 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($count);
|
258 |
+
}
|
259 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
260 |
+
}
|
261 |
+
break;
|
262 |
+
|
263 |
+
case 'role' :
|
264 |
+
foreach ( $this->get_users_data() as $u ) {
|
265 |
+
$role = !empty($u->roles[0]) ? $u->roles[0] : '';
|
266 |
+
if ($role || $this->show_all_results ) {
|
267 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($role);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
$this->set_users_query_vars( &$user_query, $cusers, SORT_REGULAR );
|
271 |
+
break;
|
272 |
+
|
273 |
+
case 'column-user-meta' :
|
274 |
+
$field = $column[$id]['field'];
|
275 |
+
if ( $field ) {
|
276 |
+
|
277 |
+
// order numeric or string
|
278 |
+
$order = SORT_REGULAR;
|
279 |
+
if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
|
280 |
+
$order = SORT_NUMERIC;
|
281 |
+
|
282 |
+
// sort by metavalue
|
283 |
+
foreach ( $this->get_users_data() as $u ) {
|
284 |
+
$value = get_metadata('user', $u->ID, $field, true);
|
285 |
+
$cusers[$u->ID] = $this->prepare_sort_string_value($value);
|
286 |
+
}
|
287 |
+
$this->set_users_query_vars( &$user_query, $cusers, $order );
|
288 |
+
}
|
289 |
+
break;
|
290 |
+
|
291 |
+
endswitch;
|
292 |
+
|
293 |
+
return $user_query;
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Orderby Links column
|
298 |
+
*
|
299 |
+
* Makes use of filter 'get_bookmarks' from bookmark.php to change the result set of the links
|
300 |
+
*
|
301 |
+
* @since 1.3.1
|
302 |
+
*/
|
303 |
+
public function handle_requests_orderby_links_column()
|
304 |
+
{
|
305 |
+
// fire only when we are in the admins link-manager
|
306 |
+
if ( $this->request_uri_is('link-manager') )
|
307 |
+
add_filter( 'get_bookmarks', array( $this, 'callback_requests_orderby_links_column'), 10, 2);
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Orderby Links column
|
312 |
+
*
|
313 |
+
* @since 1.3.1
|
314 |
+
*/
|
315 |
+
public function callback_requests_orderby_links_column($results, $vars)
|
316 |
+
{
|
317 |
+
global $wpdb;
|
318 |
+
|
319 |
+
// Column
|
320 |
+
$column = $this->get_orderby_type( $vars['orderby'], 'wp-links' );
|
321 |
+
|
322 |
+
if ( empty($column) )
|
323 |
+
return $results;
|
324 |
+
|
325 |
+
// id
|
326 |
+
$type = $id = key($column);
|
327 |
+
|
328 |
+
// var
|
329 |
+
$length = '';
|
330 |
+
switch( $type ) :
|
331 |
+
|
332 |
+
case 'column-link_id':
|
333 |
+
if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
|
334 |
+
$vars['orderby'] = 'link_id';
|
335 |
+
else
|
336 |
+
$vars['orderby'] = 'id';
|
337 |
+
break;
|
338 |
+
|
339 |
+
case 'column-owner':
|
340 |
+
$vars['orderby'] = 'link_owner';
|
341 |
+
break;
|
342 |
+
|
343 |
+
case 'column-length':
|
344 |
+
$vars['orderby'] = 'length';
|
345 |
+
$length = ", CHAR_LENGTH(link_name) AS length";
|
346 |
+
break;
|
347 |
+
|
348 |
+
case 'column-target':
|
349 |
+
$vars['orderby'] = 'link_target';
|
350 |
+
break;
|
351 |
+
|
352 |
+
case 'column-description':
|
353 |
+
$vars['orderby'] = 'link_description';
|
354 |
+
break;
|
355 |
+
|
356 |
+
case 'column-notes':
|
357 |
+
$vars['orderby'] = 'link_notes';
|
358 |
+
break;
|
359 |
+
|
360 |
+
case 'column-rss':
|
361 |
+
$vars['orderby'] = 'link_rss';
|
362 |
+
break;
|
363 |
+
|
364 |
+
/** native WP columns */
|
365 |
+
|
366 |
+
// Relationship
|
367 |
+
case 'rel':
|
368 |
+
$vars['orderby'] = 'link_rel';
|
369 |
+
break;
|
370 |
+
|
371 |
+
default:
|
372 |
+
$vars['orderby'] = '';
|
373 |
+
|
374 |
+
endswitch;
|
375 |
+
|
376 |
+
// get bookmarks by orderby vars
|
377 |
+
if ( $vars['orderby'] ) {
|
378 |
+
$vars['order'] = mysql_escape_string($vars['order']);
|
379 |
+
$sql = "SELECT * {$length} FROM {$wpdb->links} WHERE 1=1 ORDER BY {$vars['orderby']} {$vars['order']}";
|
380 |
+
$results = $wpdb->get_results($sql);
|
381 |
+
|
382 |
+
// check for errors
|
383 |
+
if( is_wp_error($results) )
|
384 |
+
return false;
|
385 |
+
}
|
386 |
+
|
387 |
+
return $results;
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Orderby Comments column
|
392 |
+
*
|
393 |
+
* @since 1.3.1
|
394 |
+
*/
|
395 |
+
public function callback_requests_orderby_comments_column($pieces, $ref_comment)
|
396 |
+
{
|
397 |
+
// get query vars
|
398 |
+
$vars = $ref_comment->query_vars;
|
399 |
+
|
400 |
+
// Column
|
401 |
+
$column = $this->get_orderby_type( $vars['orderby'], 'wp-comments' );
|
402 |
+
|
403 |
+
if ( empty($column) )
|
404 |
+
return $pieces;
|
405 |
+
|
406 |
+
// id
|
407 |
+
$type = $id = key($column);
|
408 |
+
|
409 |
+
// var
|
410 |
+
switch( $type ) :
|
411 |
+
|
412 |
+
case 'column-comment_id':
|
413 |
+
$pieces['orderby'] = 'comment_ID';
|
414 |
+
break;
|
415 |
+
|
416 |
+
case 'column-author_author':
|
417 |
+
$pieces['orderby'] = 'comment_author';
|
418 |
+
break;
|
419 |
+
|
420 |
+
case 'column-author_ip':
|
421 |
+
$pieces['orderby'] = 'comment_author_IP';
|
422 |
+
break;
|
423 |
+
|
424 |
+
case 'column-author_url':
|
425 |
+
$pieces['orderby'] = 'comment_author_url';
|
426 |
+
break;
|
427 |
+
|
428 |
+
case 'column-author_email':
|
429 |
+
$pieces['orderby'] = 'comment_author_email';
|
430 |
+
break;
|
431 |
+
|
432 |
+
case 'column-reply_to':
|
433 |
+
break;
|
434 |
+
|
435 |
+
case 'column-approved':
|
436 |
+
$pieces['orderby'] = 'comment_approved';
|
437 |
+
break;
|
438 |
+
|
439 |
+
case 'column-date':
|
440 |
+
$pieces['orderby'] = 'comment_date';
|
441 |
+
break;
|
442 |
+
|
443 |
+
case 'column-agent':
|
444 |
+
$pieces['orderby'] = 'comment_agent';
|
445 |
+
break;
|
446 |
+
|
447 |
+
case 'column-excerpt':
|
448 |
+
$pieces['orderby'] = 'comment_content';
|
449 |
+
break;
|
450 |
+
|
451 |
+
case 'column-date_gmt':
|
452 |
+
// is default
|
453 |
+
break;
|
454 |
+
|
455 |
+
/** native WP columns */
|
456 |
+
|
457 |
+
// Relationship
|
458 |
+
case 'comment':
|
459 |
+
$pieces['orderby'] = 'comment_content';
|
460 |
+
break;
|
461 |
+
|
462 |
+
default:
|
463 |
+
$vars['orderby'] = '';
|
464 |
+
|
465 |
+
endswitch;
|
466 |
+
|
467 |
+
return $pieces;
|
468 |
+
}
|
469 |
+
|
470 |
+
/**
|
471 |
+
* Orderby Comments column
|
472 |
+
*
|
473 |
+
* @since 1.3.1
|
474 |
+
*/
|
475 |
+
public function handle_requests_orderby_comments_column()
|
476 |
+
{
|
477 |
+
// fire only when we are in the admins edit-comments
|
478 |
+
if ( $this->request_uri_is('edit-comments') )
|
479 |
+
add_filter('comments_clauses', array( $this, 'callback_requests_orderby_comments_column'), 10, 2);
|
480 |
+
}
|
481 |
+
|
482 |
+
/**
|
483 |
+
* Set sorting vars in User Query Object
|
484 |
+
*
|
485 |
+
* @since 1.3
|
486 |
+
*/
|
487 |
+
private function set_users_query_vars(&$user_query, $sortusers, $sort_flags = SORT_REGULAR )
|
488 |
+
{
|
489 |
+
global $wpdb;
|
490 |
+
|
491 |
+
// vars
|
492 |
+
$vars = $user_query->query_vars;
|
493 |
+
|
494 |
+
// sorting
|
495 |
+
if ( $vars['order'] == 'ASC' )
|
496 |
+
asort($sortusers, $sort_flags);
|
497 |
+
else
|
498 |
+
arsort($sortusers, $sort_flags);
|
499 |
+
|
500 |
+
// alter orderby SQL
|
501 |
+
if ( ! empty ( $sortusers ) ) {
|
502 |
+
$ids = implode(',', array_keys($sortusers));
|
503 |
+
$user_query->query_where .= " AND {$wpdb->prefix}users.ID IN ({$ids})";
|
504 |
+
$user_query->query_orderby = "ORDER BY FIELD ({$wpdb->prefix}users.ID,{$ids})";
|
505 |
+
}
|
506 |
+
|
507 |
+
// cleanup the vars we dont need
|
508 |
+
$vars['order'] = '';
|
509 |
+
$vars['orderby'] = '';
|
510 |
+
|
511 |
+
$user_query->query_vars = $vars;
|
512 |
+
}
|
513 |
+
|
514 |
+
/**
|
515 |
+
* Orderby Media column
|
516 |
+
*
|
517 |
+
* @since 1.3
|
518 |
+
*/
|
519 |
+
private function get_orderby_media_vars($vars)
|
520 |
+
{
|
521 |
+
// Column
|
522 |
+
$column = $this->get_orderby_type( $vars['orderby'], 'wp-media' );
|
523 |
+
|
524 |
+
if ( empty($column) )
|
525 |
+
return $vars;
|
526 |
+
|
527 |
+
// var
|
528 |
+
$cposts = array();
|
529 |
+
switch( key($column) ) :
|
530 |
+
|
531 |
+
case 'column-mediaid' :
|
532 |
+
$vars['orderby'] = 'ID';
|
533 |
+
break;
|
534 |
+
|
535 |
+
case 'column-width' :
|
536 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
|
537 |
+
$meta = wp_get_attachment_metadata($p->ID);
|
538 |
+
$width = !empty($meta['width']) ? $meta['width'] : 0;
|
539 |
+
if ( $width || $this->show_all_results )
|
540 |
+
$cposts[$p->ID] = $width;
|
541 |
+
}
|
542 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
|
543 |
+
break;
|
544 |
+
|
545 |
+
case 'column-height' :
|
546 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
|
547 |
+
$meta = wp_get_attachment_metadata($p->ID);
|
548 |
+
$height = !empty($meta['height']) ? $meta['height'] : 0;
|
549 |
+
if ( $height || $this->show_all_results )
|
550 |
+
$cposts[$p->ID] = $height;
|
551 |
+
}
|
552 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
|
553 |
+
break;
|
554 |
+
|
555 |
+
case 'column-dimensions' :
|
556 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
|
557 |
+
$meta = wp_get_attachment_metadata($p->ID);
|
558 |
+
$height = !empty($meta['height']) ? $meta['height'] : 0;
|
559 |
+
$width = !empty($meta['width']) ? $meta['width'] : 0;
|
560 |
+
$surface = $height*$width;
|
561 |
+
|
562 |
+
if ( $surface || $this->show_all_results )
|
563 |
+
$cposts[$p->ID] = $surface;
|
564 |
+
}
|
565 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
|
566 |
+
break;
|
567 |
+
|
568 |
+
case 'column-caption' :
|
569 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
|
570 |
+
if ( $p->post_excerpt || $this->show_all_results )
|
571 |
+
$cposts[$p->ID] = $this->prepare_sort_string_value($p->post_excerpt);
|
572 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
|
573 |
+
break;
|
574 |
+
|
575 |
+
case 'column-description' :
|
576 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
|
577 |
+
if ( $p->post_content || $this->show_all_results )
|
578 |
+
$cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_content );
|
579 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
|
580 |
+
break;
|
581 |
+
|
582 |
+
case 'column-mime_type' :
|
583 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p )
|
584 |
+
if ( $p->post_mime_type || $this->show_all_results )
|
585 |
+
$cposts[$p->ID] = $this->prepare_sort_string_value( $p->post_mime_type );
|
586 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
|
587 |
+
break;
|
588 |
+
|
589 |
+
case 'column-file_name' :
|
590 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
|
591 |
+
$meta = get_post_meta($p->ID, '_wp_attached_file', true);
|
592 |
+
$file = !empty($meta) ? basename($meta) : '';
|
593 |
+
if ( $file || $this->show_all_results )
|
594 |
+
$cposts[$p->ID] = $file;
|
595 |
+
}
|
596 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
|
597 |
+
break;
|
598 |
+
|
599 |
+
case 'column-alternate_text' :
|
600 |
+
foreach ( (array) $this->get_any_posts_by_posttype('attachment') as $p ) {
|
601 |
+
$alt = get_post_meta($p->ID, '_wp_attachment_image_alt', true);
|
602 |
+
if ( $alt || $this->show_all_results ) {
|
603 |
+
$cposts[$p->ID] = $this->prepare_sort_string_value( $alt );
|
604 |
+
}
|
605 |
+
}
|
606 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING);
|
607 |
+
break;
|
608 |
+
|
609 |
+
endswitch;
|
610 |
+
|
611 |
+
return $vars;
|
612 |
+
}
|
613 |
+
|
614 |
+
/**
|
615 |
+
* Orderby Posts column
|
616 |
+
*
|
617 |
+
* @since 1.3
|
618 |
+
*/
|
619 |
+
private function get_orderby_posts_vars($vars)
|
620 |
+
{
|
621 |
+
$post_type = $vars['post_type'];
|
622 |
+
|
623 |
+
// Column
|
624 |
+
$column = $this->get_orderby_type( $vars['orderby'], $post_type );
|
625 |
+
|
626 |
+
if ( empty($column) )
|
627 |
+
return $vars;
|
628 |
+
|
629 |
+
// id
|
630 |
+
$id = key($column);
|
631 |
+
|
632 |
+
// type
|
633 |
+
$type = $id;
|
634 |
+
|
635 |
+
// custom fields
|
636 |
+
if ( $this->is_column_meta($type) )
|
637 |
+
$type = 'column-post-meta';
|
638 |
+
|
639 |
+
// attachments
|
640 |
+
if ( $type == 'column-attachment-count' )
|
641 |
+
$type = 'column-attachment';
|
642 |
+
|
643 |
+
// var
|
644 |
+
$cposts = array();
|
645 |
+
switch( $type ) :
|
646 |
+
|
647 |
+
case 'column-postid' :
|
648 |
+
$vars['orderby'] = 'ID';
|
649 |
+
break;
|
650 |
+
|
651 |
+
case 'column-order' :
|
652 |
+
$vars['orderby'] = 'menu_order';
|
653 |
+
break;
|
654 |
+
|
655 |
+
case 'column-post-meta' :
|
656 |
+
$field = $column[$id]['field'];
|
657 |
+
|
658 |
+
// orderby type
|
659 |
+
$field_type = 'meta_value';
|
660 |
+
if ( $column[$id]['field_type'] == 'numeric' || $column[$id]['field_type'] == 'library_id' )
|
661 |
+
$field_type = 'meta_value_num';
|
662 |
+
|
663 |
+
$vars = array_merge($vars, array(
|
664 |
+
'meta_key' => $field,
|
665 |
+
'orderby' => $field_type
|
666 |
+
));
|
667 |
+
break;
|
668 |
+
|
669 |
+
case 'column-excerpt' :
|
670 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
671 |
+
|
672 |
+
// add excerpt to the post ids
|
673 |
+
$cposts[$p->ID] = $this->prepare_sort_string_value($p->post_content);
|
674 |
+
}
|
675 |
+
// we will add the sorted post ids to vars['post__in'] and remove unused vars
|
676 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
|
677 |
+
break;
|
678 |
+
|
679 |
+
case 'column-word-count' :
|
680 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
|
681 |
+
$cposts[$p->ID] = str_word_count( $this->strip_trim( $p->post_content ) );
|
682 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
|
683 |
+
break;
|
684 |
+
|
685 |
+
case 'column-page-template' :
|
686 |
+
$templates = get_page_templates();
|
687 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
688 |
+
$page_template = get_post_meta($p->ID, '_wp_page_template', true);
|
689 |
+
$cposts[$p->ID] = array_search($page_template, $templates);
|
690 |
+
}
|
691 |
+
$this->set_vars_post__in( &$vars, $cposts );
|
692 |
+
break;
|
693 |
+
|
694 |
+
case 'column-post_formats' :
|
695 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
696 |
+
$cposts[$p->ID] = get_post_format($p->ID);
|
697 |
+
}
|
698 |
+
$this->set_vars_post__in( &$vars, $cposts );
|
699 |
+
break;
|
700 |
+
|
701 |
+
case 'column-attachment' :
|
702 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
|
703 |
+
$cposts[$p->ID] = count( $this->get_attachment_ids($p->ID) );
|
704 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_NUMERIC );
|
705 |
+
break;
|
706 |
+
|
707 |
+
|
708 |
+
case 'column-page-slug' :
|
709 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p )
|
710 |
+
$cposts[$p->ID] = $p->post_name;
|
711 |
+
$this->set_vars_post__in( &$vars, $cposts );
|
712 |
+
break;
|
713 |
+
|
714 |
+
case 'column-sticky' :
|
715 |
+
$stickies = get_option('sticky_posts');
|
716 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
717 |
+
$cposts[$p->ID] = $p->ID;
|
718 |
+
if ( !empty($stickies) && in_array($p->ID, $stickies ) ) {
|
719 |
+
$cposts[$p->ID] = 0;
|
720 |
+
}
|
721 |
+
}
|
722 |
+
$this->set_vars_post__in( &$vars, $cposts );
|
723 |
+
break;
|
724 |
+
|
725 |
+
case 'column-featured_image' :
|
726 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
727 |
+
$cposts[$p->ID] = $p->ID;
|
728 |
+
$thumb = get_the_post_thumbnail($p->ID);
|
729 |
+
if ( !empty($thumb) ) {
|
730 |
+
$cposts[$p->ID] = 0;
|
731 |
+
}
|
732 |
+
}
|
733 |
+
$this->set_vars_post__in( &$vars, $cposts );
|
734 |
+
break;
|
735 |
+
|
736 |
+
case 'column-roles' :
|
737 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
738 |
+
$cposts[$p->ID] = 0;
|
739 |
+
$userdata = get_userdata($p->post_author);
|
740 |
+
if ( !empty($userdata->roles[0]) ) {
|
741 |
+
$cposts[$p->ID] = $userdata->roles[0];
|
742 |
+
}
|
743 |
+
}
|
744 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
|
745 |
+
break;
|
746 |
+
|
747 |
+
case 'column-status' :
|
748 |
+
foreach ( (array) $this->get_any_posts_by_posttype($post_type) as $p ) {
|
749 |
+
$cposts[$p->ID] = $p->post_status.strtotime($p->post_date);
|
750 |
+
}
|
751 |
+
$this->set_vars_post__in( &$vars, $cposts, SORT_STRING );
|
752 |
+
break;
|
753 |
+
|
754 |
+
endswitch;
|
755 |
+
|
756 |
+
return $vars;
|
757 |
+
}
|
758 |
+
|
759 |
+
/**
|
760 |
+
* Set post__in for use in WP_Query
|
761 |
+
*
|
762 |
+
* This will order the ID's asc or desc and set the appropriate filters.
|
763 |
+
*
|
764 |
+
* @since 1.2.1
|
765 |
+
*/
|
766 |
+
private function set_vars_post__in( &$vars, $sortposts, $sort_flags = SORT_REGULAR )
|
767 |
+
{
|
768 |
+
// sort post ids by value
|
769 |
+
if ( $vars['order'] == 'asc' )
|
770 |
+
asort($sortposts, $sort_flags);
|
771 |
+
else
|
772 |
+
arsort($sortposts, $sort_flags);
|
773 |
+
|
774 |
+
// this will make sure WP_Query will use the order of the ids that we have just set in 'post__in'
|
775 |
+
add_filter('posts_orderby', array( $this, 'filter_orderby_post__in'), 10, 2 );
|
776 |
+
|
777 |
+
// cleanup the vars we dont need
|
778 |
+
$vars['order'] = '';
|
779 |
+
$vars['orderby'] = '';
|
780 |
+
|
781 |
+
// add the sorted post ids to the query with the use of post__in
|
782 |
+
$vars['post__in'] = array_keys($sortposts);
|
783 |
+
}
|
784 |
+
|
785 |
+
/**
|
786 |
+
* Get orderby type
|
787 |
+
*
|
788 |
+
* @since 1.1
|
789 |
+
*/
|
790 |
+
private function get_orderby_type($orderby, $type)
|
791 |
+
{
|
792 |
+
$db_columns = $this->get_stored_columns($type);
|
793 |
+
|
794 |
+
if ( $db_columns ) {
|
795 |
+
foreach ( $db_columns as $id => $vars ) {
|
796 |
+
|
797 |
+
// check which custom column was clicked
|
798 |
+
if ( isset( $vars['label'] ) && $orderby == $this->sanitize_string( $vars['label'] ) ) {
|
799 |
+
$column[$id] = $vars;
|
800 |
+
return $column;
|
801 |
+
}
|
802 |
+
}
|
803 |
+
}
|
804 |
+
return false;
|
805 |
+
}
|
806 |
+
|
807 |
+
/**
|
808 |
+
* Maintain order of ids that are set in the post__in var.
|
809 |
+
*
|
810 |
+
* This will force the returned posts to use the order of the ID's that
|
811 |
+
* have been set in post__in. Without this the ID's will be set in numeric order.
|
812 |
+
* See the WP_Query object for more info about the use of post__in.
|
813 |
+
*
|
814 |
+
* @since 1.2.1
|
815 |
+
*/
|
816 |
+
public function filter_orderby_post__in($orderby, $wp)
|
817 |
+
{
|
818 |
+
global $wpdb;
|
819 |
+
|
820 |
+
// we need the query vars
|
821 |
+
$vars = $wp->query_vars;
|
822 |
+
if ( ! empty ( $vars['post__in'] ) ) {
|
823 |
+
// now we can get the ids
|
824 |
+
$ids = implode(',', $vars['post__in']);
|
825 |
+
|
826 |
+
// by adding FIELD to the SQL query we are forcing the order of the ID's
|
827 |
+
return "FIELD ({$wpdb->prefix}posts.ID,{$ids})";
|
828 |
+
}
|
829 |
+
}
|
830 |
+
|
831 |
+
/**
|
832 |
+
* Get any posts by post_type
|
833 |
+
*
|
834 |
+
* @since 1.2.1
|
835 |
+
*/
|
836 |
+
private function get_any_posts_by_posttype( $post_type )
|
837 |
+
{
|
838 |
+
$allposts = get_posts(array(
|
839 |
+
'numberposts' => -1,
|
840 |
+
'post_status' => 'any',
|
841 |
+
'post_type' => $post_type
|
842 |
+
));
|
843 |
+
return $allposts;
|
844 |
+
}
|
845 |
+
|
846 |
+
/**
|
847 |
+
* Request URI is
|
848 |
+
*
|
849 |
+
* @since 1.3.1
|
850 |
+
*/
|
851 |
+
private function request_uri_is( $screen_id = '' )
|
852 |
+
{
|
853 |
+
if (strpos( $_SERVER['REQUEST_URI'], "/{$screen_id}.php" ) !== false )
|
854 |
+
return true;
|
855 |
+
|
856 |
+
return false;
|
857 |
+
}
|
858 |
+
|
859 |
+
/**
|
860 |
+
* Prepare the value for being by sorting
|
861 |
+
*
|
862 |
+
* @since 1.3
|
863 |
+
*/
|
864 |
+
private function prepare_sort_string_value($string)
|
865 |
+
{
|
866 |
+
// remove tags and only get the first 20 chars and force lowercase.
|
867 |
+
$string = strtolower( substr( $this->strip_trim($string),0 ,20 ) );
|
868 |
+
|
869 |
+
return $string;
|
870 |
+
}
|
871 |
+
|
872 |
+
/**
|
873 |
+
* Get users data
|
874 |
+
*
|
875 |
+
* @since 1.3
|
876 |
+
*/
|
877 |
+
function get_users_data()
|
878 |
+
{
|
879 |
+
$userdatas = array();
|
880 |
+
$wp_users = get_users( array(
|
881 |
+
'blog_id' => $GLOBALS['blog_id'],
|
882 |
+
));
|
883 |
+
foreach ( $wp_users as $u ) {
|
884 |
+
$userdatas[$u->ID] = get_userdata($u->ID);
|
885 |
+
}
|
886 |
+
return $userdatas;
|
887 |
+
}
|
888 |
+
}
|
889 |
+
|
890 |
+
?>
|
codepress-admin-columns.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Codepress Admin Columns
|
4 |
-
Version: 1.
|
5 |
-
Description: This plugin makes it easy to
|
6 |
-
Author:
|
7 |
Author URI: http://www.codepress.nl
|
8 |
Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
|
9 |
Text Domain: codepress-admin-columns
|
@@ -26,17 +26,21 @@ along with this program; if not, write to the Free Software
|
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
-
define( 'CPAC_VERSION', '1.
|
|
|
|
|
|
|
|
|
30 |
|
31 |
/**
|
32 |
-
*
|
33 |
*
|
34 |
-
* @since 1.
|
35 |
*/
|
36 |
-
|
37 |
|
38 |
/**
|
39 |
-
*
|
40 |
*
|
41 |
* @since 1.0
|
42 |
*
|
@@ -44,54 +48,82 @@ $cpac = new Codepress_Admin_Columns;
|
|
44 |
class Codepress_Admin_Columns
|
45 |
{
|
46 |
private $post_types,
|
47 |
-
$options,
|
48 |
-
$options_default,
|
49 |
$slug,
|
50 |
-
$textdomain
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
/**
|
53 |
-
*
|
54 |
*
|
55 |
* @since 1.0
|
56 |
*/
|
57 |
function __construct()
|
58 |
-
{
|
59 |
-
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
-
*
|
64 |
*
|
65 |
* Loading sequence is determined and intialized.
|
66 |
*
|
67 |
* @since 1.0
|
68 |
*/
|
69 |
-
function init()
|
70 |
{
|
71 |
// vars
|
72 |
$this->post_types = $this->get_post_types();
|
73 |
-
|
74 |
-
|
75 |
-
$this->options_default = get_option('cpac_options_default');
|
76 |
-
|
77 |
-
// slug
|
78 |
$this->slug = 'codepress-admin-columns';
|
79 |
$this->textdomain = 'codepress-admin-columns';
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
// translations
|
82 |
load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
83 |
|
84 |
-
//
|
85 |
-
add_action( 'admin_menu', array(
|
86 |
-
add_action( 'admin_init', array(
|
87 |
-
|
88 |
-
|
89 |
-
add_action( '
|
90 |
-
|
91 |
-
add_action( '
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
/**
|
97 |
* Admin Menu.
|
@@ -112,12 +144,19 @@ class Codepress_Admin_Columns
|
|
112 |
// Menu slug
|
113 |
$this->slug,
|
114 |
// Callback
|
115 |
-
array(
|
116 |
);
|
117 |
|
118 |
-
//
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
/**
|
123 |
* Add Settings link to plugin page
|
@@ -134,194 +173,194 @@ class Codepress_Admin_Columns
|
|
134 |
}
|
135 |
|
136 |
/**
|
137 |
-
* Register Columns
|
|
|
|
|
138 |
*
|
139 |
* @since 1.0
|
140 |
*/
|
141 |
public function register_columns()
|
142 |
{
|
143 |
-
|
144 |
-
|
|
|
145 |
// register column per post type
|
146 |
-
add_filter("manage_edit-{$post_type}_columns", array(
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
/**
|
154 |
-
* Callback
|
155 |
*
|
156 |
* @since 1.0
|
157 |
*/
|
158 |
-
public function
|
159 |
-
{
|
160 |
-
global $
|
161 |
-
|
162 |
-
|
163 |
-
return $columns;
|
164 |
}
|
165 |
|
166 |
/**
|
167 |
-
* Callback
|
168 |
*
|
169 |
-
* @since 1.
|
170 |
*/
|
171 |
-
public function
|
172 |
-
{
|
173 |
-
|
174 |
-
$columns = $this->set_sortable_filter($columns, $post_type);
|
175 |
-
|
176 |
-
return $columns;
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
-
*
|
181 |
*
|
182 |
-
*
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
*
|
186 |
-
*
|
187 |
*/
|
188 |
-
public function
|
189 |
{
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
<div id="general-cpac-settings" class="postbox">
|
232 |
-
<div title="Click to toggle" class="handlediv"><br></div>
|
233 |
-
<h3 class="hndle">
|
234 |
-
<span><?php _e('Admin Columns', $this->textdomain ); ?></span>
|
235 |
-
</h3>
|
236 |
-
<div class="inside">
|
237 |
-
<form method="post" action="options.php">
|
238 |
-
|
239 |
-
<?php settings_fields( 'cpac-settings-group' ); ?>
|
240 |
-
|
241 |
-
<table class="form-table">
|
242 |
-
|
243 |
-
<?php echo $rows ?>
|
244 |
-
|
245 |
-
<tr class="bottom" valign="top">
|
246 |
-
<th scope="row"></th>
|
247 |
-
<td>
|
248 |
-
<p class="submit">
|
249 |
-
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
250 |
-
</p>
|
251 |
-
</td>
|
252 |
-
</tr>
|
253 |
-
</table>
|
254 |
-
</form>
|
255 |
-
</div>
|
256 |
-
</div><!-- general-settings -->
|
257 |
-
|
258 |
-
<div id="restore-cpac-settings" class="postbox">
|
259 |
-
<div title="Click to toggle" class="handlediv"><br></div>
|
260 |
-
<h3 class="hndle">
|
261 |
-
<span><?php _e('Restore defaults', $this->textdomain) ?></span>
|
262 |
-
</h3>
|
263 |
-
<div class="inside">
|
264 |
-
<form method="post" action="">
|
265 |
-
<input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', $this->textdomain ) ?>" onclick="return confirm('<?php _e("Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", $this->textdomain); ?>');" />
|
266 |
-
</form>
|
267 |
-
<p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
|
268 |
-
</div>
|
269 |
-
</div><!-- restore-cpac-settings -->
|
270 |
-
|
271 |
-
</div>
|
272 |
-
</div>
|
273 |
-
</div><!-- .postbox-container -->
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
293 |
|
294 |
-
|
295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
}
|
297 |
-
|
298 |
/**
|
299 |
* Get a list of Column options per post type
|
300 |
*
|
301 |
* @since 1.0
|
302 |
*/
|
303 |
-
private function
|
304 |
{
|
305 |
// merge all columns
|
306 |
-
$display_columns = $this->get_merged_columns($
|
307 |
|
308 |
// define
|
309 |
$list = '';
|
310 |
|
311 |
// loop throught the active columns
|
312 |
if ( $display_columns ) {
|
313 |
-
foreach ( $display_columns as $
|
314 |
|
315 |
// add items to the list
|
316 |
-
$list .= $this->get_box($
|
317 |
|
318 |
}
|
319 |
}
|
320 |
|
321 |
// custom field button
|
322 |
$button_add_column = '';
|
323 |
-
if ( $this->
|
324 |
-
$button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column') . "</a>";
|
325 |
|
326 |
return "
|
327 |
<div class='cpac-box'>
|
@@ -329,7 +368,7 @@ class Codepress_Admin_Columns
|
|
329 |
{$list}
|
330 |
</ul>
|
331 |
{$button_add_column}
|
332 |
-
<div class='cpac-reorder-msg'
|
333 |
</div>
|
334 |
";
|
335 |
}
|
@@ -339,60 +378,118 @@ class Codepress_Admin_Columns
|
|
339 |
*
|
340 |
* @since 1.0
|
341 |
*/
|
342 |
-
|
343 |
-
{
|
344 |
-
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
|
347 |
-
|
348 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
|
350 |
-
//
|
351 |
-
$
|
352 |
|
353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
$default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
|
355 |
|
356 |
-
//
|
|
|
357 |
if ( $db_columns ) {
|
358 |
-
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
// get column meta options from custom columns
|
361 |
-
if (
|
362 |
-
$db_columns[$
|
363 |
|
364 |
// add static options
|
365 |
-
|
366 |
-
$db_columns[$
|
367 |
|
368 |
-
unset($default_columns[$
|
369 |
}
|
370 |
}
|
371 |
|
372 |
// merge all
|
373 |
-
|
374 |
-
|
375 |
-
return $display_columns;
|
376 |
}
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
/**
|
380 |
* Get checkbox
|
381 |
*
|
382 |
* @since 1.0
|
383 |
*/
|
384 |
-
private function get_box($
|
385 |
{
|
386 |
$classes = array();
|
387 |
|
388 |
// set state
|
389 |
$state = isset($values['state']) ? $values['state'] : '';
|
390 |
|
391 |
-
// set sortorder
|
392 |
-
$sortorder = isset($values['sortorder']) && $values['sortorder'] == 'on' ? 'on' : '';
|
393 |
-
|
394 |
// class
|
395 |
-
$classes[] = "cpac-box-{$
|
396 |
if ( $state )
|
397 |
$classes[] = 'active';
|
398 |
if ( ! empty($values['options']['class']) )
|
@@ -400,31 +497,44 @@ class Codepress_Admin_Columns
|
|
400 |
$class = implode(' ', $classes);
|
401 |
|
402 |
// more box options
|
403 |
-
$more_options = $this->get_additional_box_options($
|
404 |
$action = "<a class='cpac-action' href='#open'>open</a>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
|
406 |
// hide box options
|
407 |
-
|
408 |
-
|
|
|
409 |
}
|
410 |
|
411 |
$list = "
|
412 |
<li class='{$class}'>
|
413 |
-
<div class='cpac-sort-handle'></div>
|
414 |
-
<div class='cpac-type-options'>
|
415 |
-
|
416 |
<div class='cpac-checkbox'></div>
|
417 |
-
<input type='hidden' class='cpac-state' name='cpac_options[columns][{$
|
418 |
-
<
|
419 |
-
<label class='main-label'>{$values['label']}</label>
|
420 |
</div>
|
421 |
<div class='cpac-meta-title'>
|
422 |
{$action}
|
423 |
-
<span>{$
|
424 |
</div>
|
425 |
<div class='cpac-type-inside'>
|
426 |
-
<label for='cpac_options
|
427 |
-
<input type='text' name='cpac_options[columns][{$
|
|
|
|
|
|
|
|
|
428 |
<br/>
|
429 |
{$more_options}
|
430 |
</div>
|
@@ -439,13 +549,13 @@ class Codepress_Admin_Columns
|
|
439 |
*
|
440 |
* @since 1.0
|
441 |
*/
|
442 |
-
private function get_additional_box_options($
|
443 |
{
|
444 |
$fields = '';
|
445 |
|
446 |
-
// Custom Fields
|
447 |
-
if (
|
448 |
-
$fields
|
449 |
|
450 |
return $fields;
|
451 |
}
|
@@ -455,10 +565,10 @@ class Codepress_Admin_Columns
|
|
455 |
*
|
456 |
* @since 1.0
|
457 |
*/
|
458 |
-
private function get_box_options_customfields($
|
459 |
{
|
460 |
// get post meta fields
|
461 |
-
$fields = $this->
|
462 |
|
463 |
if ( empty($fields) )
|
464 |
return false;
|
@@ -485,10 +595,15 @@ class Codepress_Admin_Columns
|
|
485 |
'library_id' => __('Media Library Icon', $this->textdomain),
|
486 |
'excerpt' => __('Excerpt'),
|
487 |
'array' => __('Multiple Values', $this->textdomain),
|
|
|
|
|
|
|
488 |
);
|
489 |
|
490 |
-
// add
|
491 |
-
$fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
|
|
|
|
|
492 |
foreach ( $fieldtypes as $fkey => $fieldtype ) {
|
493 |
$fieldtype_options .= sprintf
|
494 |
(
|
@@ -499,12 +614,16 @@ class Codepress_Admin_Columns
|
|
499 |
);
|
500 |
}
|
501 |
|
|
|
|
|
|
|
|
|
502 |
if ( empty($field_options) )
|
503 |
return false;
|
504 |
|
505 |
// add remove button
|
506 |
$remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
|
507 |
-
if ( $
|
508 |
$remove = "
|
509 |
<p>
|
510 |
<a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
|
@@ -513,12 +632,18 @@ class Codepress_Admin_Columns
|
|
513 |
}
|
514 |
|
515 |
$inside = "
|
516 |
-
<label for='
|
517 |
-
<select name='cpac_options[columns][{$
|
518 |
<br/>
|
519 |
-
<label for='
|
520 |
-
<select name='cpac_options[columns][{$
|
521 |
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
{$remove}
|
523 |
";
|
524 |
|
@@ -526,17 +651,32 @@ class Codepress_Admin_Columns
|
|
526 |
}
|
527 |
|
528 |
/**
|
529 |
-
* Get post meta fields by post
|
530 |
*
|
531 |
* @since 1.0
|
532 |
*/
|
533 |
-
private function
|
534 |
{
|
535 |
global $wpdb;
|
536 |
-
|
537 |
-
|
538 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
// postmeta
|
541 |
if ( $fields ) {
|
542 |
$meta_fields = array();
|
@@ -546,9 +686,8 @@ class Codepress_Admin_Columns
|
|
546 |
$meta_fields[] = $field[0];
|
547 |
}
|
548 |
}
|
549 |
-
|
550 |
return $meta_fields;
|
551 |
-
}
|
552 |
|
553 |
return false;
|
554 |
}
|
@@ -558,19 +697,35 @@ class Codepress_Admin_Columns
|
|
558 |
*
|
559 |
* @since 1.0
|
560 |
*/
|
561 |
-
public function
|
562 |
{
|
563 |
-
wp_enqueue_script( '
|
564 |
-
wp_enqueue_script( '
|
565 |
-
wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'jquery-ui-sortable'), CPAC_VERSION );
|
566 |
}
|
567 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
/**
|
569 |
* Get post types
|
570 |
*
|
571 |
* @since 1.0
|
572 |
*/
|
573 |
-
|
574 |
{
|
575 |
$post_types = get_post_types(array(
|
576 |
'_builtin' => false
|
@@ -578,7 +733,7 @@ class Codepress_Admin_Columns
|
|
578 |
$post_types['post'] = 'post';
|
579 |
$post_types['page'] = 'page';
|
580 |
|
581 |
-
return $post_types;
|
582 |
}
|
583 |
|
584 |
/**
|
@@ -588,6 +743,7 @@ class Codepress_Admin_Columns
|
|
588 |
*/
|
589 |
public function admin_styles()
|
590 |
{
|
|
|
591 |
wp_enqueue_style( 'cpac-admin', $this->plugin_url('/assets/css/admin-column.css'), array(), CPAC_VERSION, 'all' );
|
592 |
}
|
593 |
|
@@ -609,10 +765,10 @@ class Codepress_Admin_Columns
|
|
609 |
public function register_settings()
|
610 |
{
|
611 |
// If we have no options in the database, let's add them now.
|
612 |
-
if ( false ===
|
613 |
-
add_option( 'cpac_options', array(
|
614 |
|
615 |
-
register_setting( 'cpac-settings-group', 'cpac_options', array(
|
616 |
}
|
617 |
|
618 |
/**
|
@@ -630,7 +786,7 @@ class Codepress_Admin_Columns
|
|
630 |
}
|
631 |
|
632 |
/**
|
633 |
-
*
|
634 |
*
|
635 |
* @since 1.0
|
636 |
*/
|
@@ -644,23 +800,49 @@ class Codepress_Admin_Columns
|
|
644 |
*
|
645 |
* @since 1.0
|
646 |
*/
|
647 |
-
|
648 |
{
|
649 |
// settings updated
|
650 |
-
if ( ! empty($_REQUEST['settings-updated']) )
|
651 |
-
|
652 |
-
// stores the default columns that are set by WP or set in the theme.
|
653 |
-
$wp_default_columns = array();
|
654 |
-
foreach ( $this->post_types as $post_type ) {
|
655 |
-
$wp_default_columns[$post_type] = $this->get_wp_default_columns($post_type);
|
656 |
-
}
|
657 |
-
update_option( 'cpac_options_default', $wp_default_columns );
|
658 |
-
}
|
659 |
|
660 |
// restore defaults
|
661 |
-
if ( ! empty($_REQUEST['cpac-restore-defaults']) )
|
662 |
$this->restore_defaults();
|
663 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
}
|
665 |
|
666 |
/**
|
@@ -671,7 +853,7 @@ class Codepress_Admin_Columns
|
|
671 |
private function restore_defaults()
|
672 |
{
|
673 |
delete_option( 'cpac_options' );
|
674 |
-
delete_option( 'cpac_options_default' );
|
675 |
}
|
676 |
|
677 |
/**
|
@@ -679,15 +861,16 @@ class Codepress_Admin_Columns
|
|
679 |
*
|
680 |
* @since 1.0
|
681 |
*/
|
682 |
-
private function get_post_excerpt($post_id
|
683 |
{
|
684 |
-
global $post;
|
|
|
685 |
$save_post = $post;
|
686 |
$post = get_post($post_id);
|
687 |
$excerpt = get_the_excerpt();
|
688 |
$post = $save_post;
|
689 |
|
690 |
-
$output = $this->get_shortened_string($excerpt, $
|
691 |
|
692 |
return $output;
|
693 |
}
|
@@ -697,22 +880,12 @@ class Codepress_Admin_Columns
|
|
697 |
*
|
698 |
* @since 1.0
|
699 |
*/
|
700 |
-
private function get_shortened_string($string = '', $
|
701 |
{
|
702 |
if (!$string)
|
703 |
return false;
|
704 |
|
705 |
-
$
|
706 |
-
if ( strlen($string) > $charlength ) {
|
707 |
-
$subex = substr($string,0,$charlength-5);
|
708 |
-
$exwords = explode(" ",$subex);
|
709 |
-
$excut = -(strlen($exwords[count($exwords)-1]));
|
710 |
-
$output .= $excut < 0 ? substr($subex,0,$excut) : $subex;
|
711 |
-
$output .= "[...]";
|
712 |
-
} else {
|
713 |
-
$output = $string;
|
714 |
-
}
|
715 |
-
return $output;
|
716 |
}
|
717 |
|
718 |
/**
|
@@ -720,20 +893,20 @@ class Codepress_Admin_Columns
|
|
720 |
*
|
721 |
* @since 1.0
|
722 |
*/
|
723 |
-
public function
|
724 |
{
|
725 |
-
$type = $
|
726 |
|
727 |
// Check for taxonomies, such as column-taxonomy-[taxname]
|
728 |
if ( strpos($type, 'column-taxonomy-') !== false )
|
729 |
$type = 'column-taxonomy';
|
730 |
|
731 |
// Check for custom fields, such as column-meta-[customfieldname]
|
732 |
-
if (
|
733 |
-
$type = 'column-meta';
|
734 |
|
735 |
// Hook
|
736 |
-
do_action('cpac-manage-column', $type, $
|
737 |
|
738 |
// Switch Types
|
739 |
$result = '';
|
@@ -751,15 +924,14 @@ class Codepress_Admin_Columns
|
|
751 |
|
752 |
// Featured Image
|
753 |
case "column-featured_image" :
|
754 |
-
|
|
|
755 |
break;
|
756 |
|
757 |
// Sticky Post
|
758 |
case "column-sticky" :
|
759 |
-
if ( is_sticky($post_id) )
|
760 |
-
$
|
761 |
-
$result = "<img alt='sticky' src='{$src}' />";
|
762 |
-
}
|
763 |
break;
|
764 |
|
765 |
// Order
|
@@ -776,595 +948,2253 @@ class Codepress_Admin_Columns
|
|
776 |
case "column-page-template" :
|
777 |
// file name
|
778 |
$page_template = get_post_meta($post_id, '_wp_page_template', true);
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
$result = array_search($page_template, $templates);
|
783 |
break;
|
784 |
|
785 |
// Slug
|
786 |
case "column-page-slug" :
|
787 |
-
$result = get_post($post_id)->post_name;
|
|
|
|
|
|
|
|
|
|
|
788 |
break;
|
789 |
|
790 |
// Taxonomy
|
791 |
case "column-taxonomy" :
|
792 |
-
$tax = str_replace('column-taxonomy-',''
|
793 |
$tags = get_the_terms($post_id, $tax);
|
794 |
$tarr = array();
|
|
|
|
|
795 |
if ( $tax == 'post_format' && empty($tags) ) {
|
796 |
$result = __('Standard');
|
797 |
}
|
798 |
-
|
799 |
-
|
800 |
-
|
|
|
|
|
|
|
|
|
|
|
801 |
}
|
802 |
$result = implode(', ', $tarr);
|
803 |
}
|
804 |
break;
|
805 |
|
806 |
// Custom Field
|
807 |
-
case "column-meta" :
|
808 |
-
$result = $this->get_column_value_custom_field($post_id, $
|
809 |
break;
|
810 |
|
811 |
// Attachment
|
812 |
case "column-attachment" :
|
813 |
$result = $this->get_column_value_attachments($post_id);
|
814 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
815 |
|
816 |
default :
|
817 |
-
$result = get_post_meta( $post_id, $
|
818 |
|
819 |
endswitch;
|
820 |
|
821 |
-
if ( empty($result) )
|
822 |
-
echo ' ';
|
823 |
-
|
824 |
echo $result;
|
825 |
}
|
826 |
-
|
827 |
/**
|
828 |
-
*
|
829 |
*
|
830 |
-
*
|
831 |
*/
|
832 |
-
|
833 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
$result = '';
|
835 |
-
$
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
846 |
return $result;
|
847 |
}
|
848 |
|
849 |
/**
|
850 |
-
*
|
851 |
*
|
852 |
-
*
|
853 |
*/
|
854 |
-
|
855 |
{
|
856 |
-
$
|
857 |
-
$field = isset($columns[$key]['field']) ? $columns[$key]['field'] : '';
|
858 |
-
$fieldtype = isset($columns[$key]['field_type']) ? $columns[$key]['field_type'] : '';
|
859 |
-
|
860 |
-
// Get meta field value
|
861 |
-
$meta = get_post_meta($post_id, $field, true);
|
862 |
|
863 |
-
|
864 |
-
|
865 |
-
$meta = get_post_meta($post_id, $field);
|
866 |
-
$meta = $this->recursive_implode(', ', $meta);
|
867 |
-
}
|
868 |
|
869 |
-
//
|
870 |
-
|
871 |
-
return false;
|
872 |
-
|
873 |
-
// handles each field type differently..
|
874 |
-
switch ($fieldtype) :
|
875 |
|
876 |
-
|
877 |
-
|
878 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
879 |
break;
|
880 |
|
881 |
-
//
|
882 |
-
case "
|
883 |
-
|
884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
885 |
break;
|
886 |
|
887 |
-
//
|
888 |
-
case "
|
889 |
-
$
|
|
|
|
|
890 |
break;
|
891 |
-
|
892 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
|
894 |
-
|
895 |
-
}
|
896 |
-
|
897 |
-
/**
|
898 |
-
* Implode for multi dimensional array
|
899 |
-
*
|
900 |
-
* @since 1.0
|
901 |
-
*/
|
902 |
-
private function recursive_implode( $glue, $pieces )
|
903 |
-
{
|
904 |
-
foreach( $pieces as $r_pieces ) {
|
905 |
-
if( is_array( $r_pieces ) ) {
|
906 |
-
$retVal[] = $this->recursive_implode( $glue, $r_pieces );
|
907 |
-
}
|
908 |
-
else {
|
909 |
-
$retVal[] = $r_pieces;
|
910 |
-
}
|
911 |
-
}
|
912 |
-
return implode( $glue, $retVal );
|
913 |
}
|
914 |
-
|
915 |
/**
|
916 |
-
*
|
917 |
*
|
918 |
-
*
|
919 |
*/
|
920 |
-
|
921 |
{
|
922 |
-
$
|
923 |
|
924 |
-
|
925 |
-
|
926 |
|
927 |
-
//
|
928 |
-
$
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
|
933 |
-
//
|
934 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
}
|
942 |
-
|
943 |
/**
|
944 |
-
*
|
945 |
*
|
946 |
-
* @since 1.
|
947 |
*/
|
948 |
-
|
949 |
{
|
950 |
-
$
|
951 |
|
952 |
-
|
953 |
-
|
954 |
|
955 |
-
//
|
956 |
-
|
|
|
957 |
|
958 |
-
//
|
959 |
-
$
|
960 |
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
968 |
|
969 |
-
|
970 |
}
|
971 |
|
972 |
/**
|
973 |
-
*
|
974 |
*
|
975 |
* @since 1.0
|
976 |
*/
|
977 |
-
private function
|
978 |
{
|
979 |
-
$
|
980 |
-
|
981 |
-
if (
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
foreach ( $db_columns as $key => $values ) {
|
986 |
-
|
987 |
-
// is active
|
988 |
-
if ( isset($values['sortorder']) && $values['sortorder'] == 'on' ){
|
989 |
-
|
990 |
-
// register format
|
991 |
-
$columns[$key] = $this->sanitize_string($values['label']);
|
992 |
}
|
993 |
-
}
|
994 |
-
return $
|
995 |
-
}
|
996 |
-
|
997 |
/**
|
998 |
-
*
|
999 |
*
|
1000 |
-
* @since 1.
|
1001 |
*/
|
1002 |
-
|
1003 |
{
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1011 |
$org_current_screen = $current_screen;
|
1012 |
|
1013 |
// overwrite current_screen global with our post type of choose...
|
1014 |
$current_screen->post_type = $post_type;
|
1015 |
|
1016 |
-
// ...so we can get its columns
|
1017 |
-
$columns = WP_Posts_List_Table::get_columns();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
|
1019 |
-
//
|
1020 |
-
|
1021 |
|
1022 |
-
//
|
1023 |
-
$
|
1024 |
-
|
1025 |
-
|
1026 |
-
$type_label = $label;
|
1027 |
-
|
1028 |
-
// comment exception
|
1029 |
-
if ( strpos( $label, 'comment-grey-bubble.png') ) {
|
1030 |
-
$type_label = __('Comments', $this->textdomain);
|
1031 |
-
$hide_options = true;
|
1032 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1033 |
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1043 |
}
|
1044 |
|
1045 |
-
|
1046 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1047 |
|
1048 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
}
|
1050 |
|
1051 |
/**
|
1052 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1053 |
*
|
1054 |
* @since 1.0
|
1055 |
*/
|
1056 |
-
|
1057 |
{
|
1058 |
-
|
|
|
1059 |
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
)
|
1072 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1073 |
|
1074 |
-
//
|
1075 |
-
|
1076 |
-
$custom_columns['column-featured_image'] = wp_parse_args( array(
|
1077 |
-
'label' => __('Featured Image', $this->textdomain),
|
1078 |
-
'options' => array(
|
1079 |
-
'type_label' => __('Image', $this->textdomain)
|
1080 |
-
)
|
1081 |
-
), $defaults);
|
1082 |
-
}
|
1083 |
|
1084 |
-
//
|
1085 |
-
if (
|
1086 |
-
$
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
|
|
|
|
|
|
1092 |
}
|
1093 |
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
|
|
|
|
1103 |
|
1104 |
-
//
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
'sortorder' => 'on',
|
1109 |
-
'options' => array(
|
1110 |
-
'type_label' => __('Order', $this->textdomain)
|
1111 |
-
)
|
1112 |
-
), $defaults);
|
1113 |
-
}
|
1114 |
|
1115 |
-
//
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
'
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1124 |
}
|
1125 |
|
1126 |
-
//
|
1127 |
-
if (
|
1128 |
-
$
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
|
|
|
|
|
|
1134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
|
1136 |
-
//
|
1137 |
-
$
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
|
|
1147 |
}
|
1148 |
}
|
1149 |
}
|
1150 |
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1159 |
|
1160 |
-
//
|
1161 |
-
|
1162 |
-
'
|
1163 |
-
|
1164 |
-
|
1165 |
-
'
|
1166 |
)
|
1167 |
-
)
|
1168 |
|
1169 |
-
//
|
1170 |
-
$
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1177 |
|
1178 |
-
//
|
1179 |
-
if ( $
|
1180 |
-
$
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
'type_label' => __('Field', $this->textdomain),
|
1186 |
-
'class' => 'cpac-box-metafield'
|
1187 |
-
)
|
1188 |
-
), $defaults);
|
1189 |
-
}
|
1190 |
|
1191 |
-
|
1192 |
-
|
|
|
|
|
|
|
|
|
1193 |
|
|
|
|
|
|
|
1194 |
/**
|
1195 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1196 |
*
|
1197 |
-
* @since 1.
|
1198 |
*/
|
1199 |
-
private function
|
1200 |
-
{
|
1201 |
-
|
1202 |
-
$options = $this->options;
|
1203 |
-
|
1204 |
-
// get saved columns
|
1205 |
-
if ( isset($options['columns'][$post_type]) )
|
1206 |
-
return $options['columns'][$post_type];
|
1207 |
-
|
1208 |
-
return false;
|
1209 |
}
|
1210 |
-
|
1211 |
/**
|
1212 |
-
*
|
1213 |
*
|
1214 |
-
* @since 1.
|
1215 |
*/
|
1216 |
-
private function
|
1217 |
{
|
1218 |
-
|
1219 |
-
$
|
1220 |
-
$count = 1;
|
1221 |
-
|
1222 |
-
// referer
|
1223 |
-
$referer = '';
|
1224 |
-
if ( isset($_REQUEST['cpac_type']) && $_REQUEST['cpac_type'] )
|
1225 |
-
$referer = $_REQUEST['cpac_type'];
|
1226 |
-
|
1227 |
-
// loop
|
1228 |
-
foreach ( $this->post_types as $post_type ) {
|
1229 |
-
$label = $this->get_singular_name($post_type);
|
1230 |
-
$clean_label = $this->sanitize_string($post_type);
|
1231 |
-
|
1232 |
-
// divider
|
1233 |
-
$divider = $count++ == 1 ? '' : ' | ';
|
1234 |
-
|
1235 |
-
// current
|
1236 |
-
$current = '';
|
1237 |
-
if ( $this->is_menu_type_current($post_type) )
|
1238 |
-
$current = ' class="current"';
|
1239 |
-
|
1240 |
-
// menu list
|
1241 |
-
$menu .= "
|
1242 |
-
<li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
|
1243 |
-
";
|
1244 |
-
}
|
1245 |
-
|
1246 |
-
return "
|
1247 |
-
<div class='cpac-menu'>
|
1248 |
-
<ul class='subsubsub'>
|
1249 |
-
{$menu}
|
1250 |
-
</ul>
|
1251 |
-
</div>
|
1252 |
-
";
|
1253 |
}
|
1254 |
-
|
1255 |
/**
|
1256 |
-
*
|
1257 |
*
|
1258 |
-
* @since 1.
|
1259 |
*/
|
1260 |
-
|
1261 |
{
|
1262 |
-
|
1263 |
-
|
1264 |
-
// referer
|
1265 |
-
$referer = '';
|
1266 |
-
if ( ! empty($_REQUEST['cpac_type']) )
|
1267 |
-
$referer = $_REQUEST['cpac_type'];
|
1268 |
-
|
1269 |
-
// get label
|
1270 |
-
$label = $this->get_singular_name($post_type);
|
1271 |
-
$clean_label = $this->sanitize_string($post_type);
|
1272 |
-
|
1273 |
-
// get first element from post-types
|
1274 |
-
$first = array_shift(array_values($this->post_types));
|
1275 |
-
|
1276 |
-
// display the page that was being viewed before saving
|
1277 |
-
if ( $referer ) {
|
1278 |
-
if ( $referer == 'cpac-box-'.$clean_label ) {
|
1279 |
-
return true;
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
// settings page has not yet been saved
|
1283 |
-
} elseif ( $first == $post_type ) {
|
1284 |
-
return true;
|
1285 |
-
}
|
1286 |
-
|
1287 |
-
return false;
|
1288 |
}
|
1289 |
-
|
1290 |
/**
|
1291 |
-
* Get
|
1292 |
*
|
1293 |
-
* @since 1.
|
1294 |
*/
|
1295 |
-
|
1296 |
{
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
|
|
|
|
|
|
|
|
1300 |
}
|
1301 |
-
|
1302 |
/**
|
1303 |
-
*
|
1304 |
*
|
1305 |
-
* @since 1.
|
1306 |
*/
|
1307 |
-
|
1308 |
{
|
1309 |
-
if (
|
1310 |
-
|
1311 |
-
$db_columns = $this->get_db_columns($vars['post_type']);
|
1312 |
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
$label = $this->sanitize_string($db_columns['column-order']['label']);
|
1318 |
-
|
1319 |
-
// Check for Page Order
|
1320 |
-
if ( $vars['orderby'] == $label ) {
|
1321 |
-
$vars['orderby'] = 'menu_order';
|
1322 |
-
}
|
1323 |
-
}
|
1324 |
-
}
|
1325 |
-
return $vars;
|
1326 |
}
|
1327 |
-
|
1328 |
/**
|
1329 |
-
*
|
1330 |
-
*
|
1331 |
-
* Uses intern wordpress function esc_url so it matches the label sorting url.
|
1332 |
*
|
1333 |
-
* @since 1.
|
1334 |
*/
|
1335 |
-
private function
|
1336 |
{
|
1337 |
-
$
|
1338 |
-
|
|
|
|
|
1339 |
}
|
1340 |
|
1341 |
/**
|
1342 |
-
*
|
1343 |
*
|
1344 |
-
* @since 1.
|
1345 |
*/
|
1346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1347 |
{
|
1348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1349 |
}
|
1350 |
|
1351 |
/**
|
1352 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1353 |
*
|
1354 |
* @since 1.0
|
1355 |
*/
|
1356 |
-
|
1357 |
-
{
|
1358 |
-
|
1359 |
-
|
|
|
|
|
1360 |
|
1361 |
-
|
1362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1363 |
|
1364 |
-
|
1365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1366 |
|
1367 |
-
|
1368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1369 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1370 |
?>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Codepress Admin Columns
|
4 |
+
Version: 1.4.1
|
5 |
+
Description: This plugin makes it easy to customise the columns on the administration screens for post(types), pages, media library and users.
|
6 |
+
Author: Codepress
|
7 |
Author URI: http://www.codepress.nl
|
8 |
Plugin URI: http://www.codepress.nl/plugins/codepress-admin-columns/
|
9 |
Text Domain: codepress-admin-columns
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
+
define( 'CPAC_VERSION', '1.4.1' );
|
30 |
+
|
31 |
+
// only run plugin in the admin interface
|
32 |
+
if ( !is_admin() )
|
33 |
+
return false;
|
34 |
|
35 |
/**
|
36 |
+
* Dependencies
|
37 |
*
|
38 |
+
* @since 1.3
|
39 |
*/
|
40 |
+
require_once dirname( __FILE__ ) . '/classes/sortable.php';
|
41 |
|
42 |
/**
|
43 |
+
* Codepress Admin Columns Class
|
44 |
*
|
45 |
* @since 1.0
|
46 |
*
|
48 |
class Codepress_Admin_Columns
|
49 |
{
|
50 |
private $post_types,
|
|
|
|
|
51 |
$slug,
|
52 |
+
$textdomain,
|
53 |
+
$codepress_url,
|
54 |
+
$wordpress_url,
|
55 |
+
$excerpt_length,
|
56 |
+
$admin_page,
|
57 |
+
$notice_message,
|
58 |
+
$notice_type,
|
59 |
+
$api_url;
|
60 |
|
61 |
/**
|
62 |
+
* Constructor
|
63 |
*
|
64 |
* @since 1.0
|
65 |
*/
|
66 |
function __construct()
|
67 |
+
{
|
68 |
+
$this->api_url = 'http://www.codepress.nl/';
|
69 |
+
|
70 |
+
// wp is loaded
|
71 |
+
add_action( 'wp_loaded', array( $this, 'init') );
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
+
* Initialize plugin.
|
76 |
*
|
77 |
* Loading sequence is determined and intialized.
|
78 |
*
|
79 |
* @since 1.0
|
80 |
*/
|
81 |
+
public function init()
|
82 |
{
|
83 |
// vars
|
84 |
$this->post_types = $this->get_post_types();
|
85 |
+
|
86 |
+
// set
|
|
|
|
|
|
|
87 |
$this->slug = 'codepress-admin-columns';
|
88 |
$this->textdomain = 'codepress-admin-columns';
|
89 |
+
$this->codepress_url = 'http://www.codepress.nl/plugins/codepress-admin-columns';
|
90 |
+
$this->wordpress_url = 'http://wordpress.org/tags/codepress-admin-columns';
|
91 |
+
|
92 |
+
// number of words
|
93 |
+
$this->excerpt_length = 20;
|
94 |
|
95 |
// translations
|
96 |
load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
97 |
|
98 |
+
// register settings
|
99 |
+
add_action( 'admin_menu', array( $this, 'settings_menu') );
|
100 |
+
add_action( 'admin_init', array( $this, 'register_settings') );
|
101 |
+
|
102 |
+
// styling & scripts
|
103 |
+
add_action( 'admin_enqueue_scripts' , array( $this, 'column_styles') );
|
104 |
+
add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
|
105 |
+
add_action( 'admin_head', array( $this, 'admin_css') );
|
106 |
+
|
107 |
+
// register column headers
|
108 |
+
add_action( 'admin_init', array( $this, 'register_columns' ) );
|
109 |
+
|
110 |
+
// actions columns
|
111 |
+
add_action( 'manage_pages_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
|
112 |
+
add_action( 'manage_posts_custom_column', array( $this, 'manage_posts_column_value'), 10, 2 );
|
113 |
+
add_filter( 'manage_users_custom_column', array( $this, 'manage_users_column_value'), 10, 3 );
|
114 |
+
add_action( 'manage_media_custom_column', array( $this, 'manage_media_column_value'), 10, 2 );
|
115 |
+
add_action( 'manage_link_custom_column', array( $this, 'manage_link_column_value'), 10, 2 );
|
116 |
+
add_action( 'manage_comments_custom_column', array( $this, 'manage_comments_column_value'), 10, 2 );
|
117 |
+
|
118 |
+
// action ajax
|
119 |
+
add_action( 'wp_ajax_cpac_addon_activation', array( $this, 'ajax_activation'));
|
120 |
+
|
121 |
+
// handle requests gets a low priority so it will trigger when all other plugins have loaded their columns
|
122 |
+
add_action( 'admin_init', array( $this, 'handle_requests' ), 1000 );
|
123 |
+
|
124 |
+
// filters
|
125 |
+
add_filter( 'plugin_action_links', array( $this, 'add_settings_link'), 1, 2);
|
126 |
+
}
|
127 |
|
128 |
/**
|
129 |
* Admin Menu.
|
144 |
// Menu slug
|
145 |
$this->slug,
|
146 |
// Callback
|
147 |
+
array( $this, 'plugin_settings_page')
|
148 |
);
|
149 |
|
150 |
+
// set admin page
|
151 |
+
$this->admin_page = $page;
|
152 |
+
|
153 |
+
// settings page specific styles and scripts
|
154 |
+
add_action( "admin_print_styles-$page", array( $this, 'admin_styles') );
|
155 |
+
add_action( "admin_print_scripts-$page", array( $this, 'admin_scripts') );
|
156 |
+
|
157 |
+
// add help tabs
|
158 |
+
add_action("load-$page", array( $this, 'help_tabs'));
|
159 |
+
}
|
160 |
|
161 |
/**
|
162 |
* Add Settings link to plugin page
|
173 |
}
|
174 |
|
175 |
/**
|
176 |
+
* Register Columns
|
177 |
+
*
|
178 |
+
* apply_filters location in includes/screen.php
|
179 |
*
|
180 |
* @since 1.0
|
181 |
*/
|
182 |
public function register_columns()
|
183 |
{
|
184 |
+
/** Posts */
|
185 |
+
foreach ( $this->post_types as $post_type ) {
|
186 |
+
|
187 |
// register column per post type
|
188 |
+
add_filter("manage_edit-{$post_type}_columns", array($this, 'callback_add_posts_column_headings'));
|
189 |
+
}
|
190 |
+
|
191 |
+
/** Users */
|
192 |
+
add_filter( "manage_users_columns", array($this, 'callback_add_users_column_headings'), 9);
|
193 |
+
// give higher priority, so it will load just before other plugins to prevent conflicts
|
194 |
+
|
195 |
+
/** Media */
|
196 |
+
add_filter( "manage_upload_columns", array($this, 'callback_add_media_column_headings'));
|
197 |
+
|
198 |
+
/** Links */
|
199 |
+
add_filter( "manage_link-manager_columns", array($this, 'callback_add_links_column_headings'));
|
200 |
+
|
201 |
+
/** Comments */
|
202 |
+
add_filter( "manage_edit-comments_columns", array($this, 'callback_add_comments_column_headings'));
|
203 |
}
|
204 |
|
205 |
/**
|
206 |
+
* Callback add Posts Column
|
207 |
*
|
208 |
* @since 1.0
|
209 |
*/
|
210 |
+
public function callback_add_posts_column_headings($columns)
|
211 |
+
{
|
212 |
+
global $post;
|
213 |
+
|
214 |
+
return $this->add_columns_headings($post->post_type, $columns);
|
|
|
215 |
}
|
216 |
|
217 |
/**
|
218 |
+
* Callback add Users column
|
219 |
*
|
220 |
+
* @since 1.1
|
221 |
*/
|
222 |
+
public function callback_add_users_column_headings($columns)
|
223 |
+
{
|
224 |
+
return $this->add_columns_headings('wp-users', $columns);
|
|
|
|
|
|
|
225 |
}
|
226 |
|
227 |
/**
|
228 |
+
* Callback add Media column
|
229 |
*
|
230 |
+
* @since 1.3
|
231 |
+
*/
|
232 |
+
public function callback_add_media_column_headings($columns)
|
233 |
+
{
|
234 |
+
return $this->add_columns_headings('wp-media', $columns);
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Callback add Links column
|
239 |
*
|
240 |
+
* @since 1.3.1
|
241 |
*/
|
242 |
+
public function callback_add_links_column_headings($columns)
|
243 |
{
|
244 |
+
return $this->add_columns_headings('wp-links', $columns);
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Callback add Comments column
|
249 |
+
*
|
250 |
+
* @since 1.3.1
|
251 |
+
*/
|
252 |
+
public function callback_add_comments_column_headings($columns)
|
253 |
+
{
|
254 |
+
return $this->add_columns_headings('wp-comments', $columns);
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Add managed columns by Type
|
259 |
+
*
|
260 |
+
* @since 1.1
|
261 |
+
*/
|
262 |
+
private function add_columns_headings( $type, $columns )
|
263 |
+
{
|
264 |
+
// only get stored columns.. the rest we don't need
|
265 |
+
$db_columns = $this->get_stored_columns($type);
|
266 |
+
|
267 |
+
if ( !$db_columns )
|
268 |
+
return $columns;
|
269 |
+
|
270 |
+
// filter already loaded columns by plugins
|
271 |
+
$set_columns = $this->filter_preset_columns( $type, $columns );
|
272 |
+
|
273 |
+
// loop through columns
|
274 |
+
foreach ( $db_columns as $id => $values ) {
|
275 |
+
// is active
|
276 |
+
if ( isset($values['state']) && $values['state'] == 'on' ){
|
277 |
+
|
278 |
+
// register format
|
279 |
+
$set_columns[$id] = $values['label'];
|
280 |
+
}
|
281 |
}
|
282 |
|
283 |
+
return $set_columns;
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Set columns. These columns apply either for every post or set by a plugin.
|
288 |
+
*
|
289 |
+
* @since 1.0
|
290 |
+
*/
|
291 |
+
private function filter_preset_columns( $type, $columns )
|
292 |
+
{
|
293 |
+
$options = get_option('cpac_options_default');
|
294 |
|
295 |
+
if ( !$options )
|
296 |
+
return $columns;
|
297 |
+
|
298 |
+
// we use the wp default columns for filtering...
|
299 |
+
$stored_wp_default_columns = $options[$type];
|
300 |
+
|
301 |
+
// ... the ones that are set by plugins, theme functions and such.
|
302 |
+
$dif_columns = array_diff(array_keys($columns), array_keys($stored_wp_default_columns));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
+
// we add those to the columns
|
305 |
+
$pre_columns = array();
|
306 |
+
if ( $dif_columns ) {
|
307 |
+
foreach ( $dif_columns as $column ) {
|
308 |
+
$pre_columns[$column] = $columns[$column];
|
309 |
+
}
|
310 |
+
}
|
311 |
+
|
312 |
+
return $pre_columns;
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Add managed sortable columns by Type
|
317 |
+
*
|
318 |
+
* @since 1.1
|
319 |
+
*/
|
320 |
+
private function add_managed_sortable_columns( $type, $columns )
|
321 |
+
{
|
322 |
+
$display_columns = $this->get_merged_columns($type);
|
323 |
|
324 |
+
if ( ! $display_columns )
|
325 |
+
return $columns;
|
326 |
+
|
327 |
+
foreach ( $display_columns as $id => $vars ) {
|
328 |
+
if ( isset($vars['options']['sortorder']) && $vars['options']['sortorder'] == 'on' ){
|
329 |
+
|
330 |
+
// register format
|
331 |
+
$columns[$id] = $this->sanitize_string($vars['label']);
|
332 |
+
}
|
333 |
+
}
|
334 |
+
return $columns;
|
335 |
}
|
336 |
+
|
337 |
/**
|
338 |
* Get a list of Column options per post type
|
339 |
*
|
340 |
* @since 1.0
|
341 |
*/
|
342 |
+
private function get_column_boxes($type)
|
343 |
{
|
344 |
// merge all columns
|
345 |
+
$display_columns = $this->get_merged_columns($type);
|
346 |
|
347 |
// define
|
348 |
$list = '';
|
349 |
|
350 |
// loop throught the active columns
|
351 |
if ( $display_columns ) {
|
352 |
+
foreach ( $display_columns as $id => $values ) {
|
353 |
|
354 |
// add items to the list
|
355 |
+
$list .= $this->get_box($type, $id, $values);
|
356 |
|
357 |
}
|
358 |
}
|
359 |
|
360 |
// custom field button
|
361 |
$button_add_column = '';
|
362 |
+
if ( $this->get_meta_by_type($type) )
|
363 |
+
$button_add_column = "<a href='javacript:;' class='cpac-add-customfield-column button'>+ " . __('Add Custom Field Column', $this->textdomain) . "</a>";
|
364 |
|
365 |
return "
|
366 |
<div class='cpac-box'>
|
368 |
{$list}
|
369 |
</ul>
|
370 |
{$button_add_column}
|
371 |
+
<div class='cpac-reorder-msg'>" . __('drag and drop to reorder', $this->textdomain) . "</div>
|
372 |
</div>
|
373 |
";
|
374 |
}
|
378 |
*
|
379 |
* @since 1.0
|
380 |
*/
|
381 |
+
protected function get_merged_columns( $type )
|
382 |
+
{
|
383 |
+
/** Comments */
|
384 |
+
if ( $type == 'wp-comments' ) {
|
385 |
+
$wp_default_columns = $this->get_wp_default_comments_columns();
|
386 |
+
$wp_custom_columns = $this->get_custom_comments_columns();
|
387 |
+
}
|
388 |
+
|
389 |
+
/** Links */
|
390 |
+
elseif ( $type == 'wp-links' ) {
|
391 |
+
$wp_default_columns = $this->get_wp_default_links_columns();
|
392 |
+
$wp_custom_columns = $this->get_custom_links_columns();
|
393 |
+
}
|
394 |
+
|
395 |
+
/** Users */
|
396 |
+
elseif ( $type == 'wp-users' ) {
|
397 |
+
$wp_default_columns = $this->get_wp_default_users_columns();
|
398 |
+
$wp_custom_columns = $this->get_custom_users_columns();
|
399 |
+
}
|
400 |
|
401 |
+
/** Media */
|
402 |
+
elseif ( $type == 'wp-media' ) {
|
403 |
+
$wp_default_columns = $this->get_wp_default_media_columns();
|
404 |
+
$wp_custom_columns = $this->get_custom_media_columns();
|
405 |
+
}
|
406 |
+
|
407 |
+
/** Posts */
|
408 |
+
else {
|
409 |
+
$wp_default_columns = $this->get_wp_default_posts_columns($type);
|
410 |
+
$wp_custom_columns = $this->get_custom_posts_columns($type);
|
411 |
+
}
|
412 |
|
413 |
+
// merge columns
|
414 |
+
$display_columns = $this->parse_columns($wp_custom_columns, $wp_default_columns, $type);
|
415 |
|
416 |
+
return $display_columns;
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Merge the default columns (set by WordPress) and the added custom columns (set by plugins, theme etc.)
|
421 |
+
*
|
422 |
+
* @since 1.3.3
|
423 |
+
*/
|
424 |
+
function parse_columns($wp_custom_columns, $wp_default_columns, $type) {
|
425 |
+
// merge columns
|
426 |
$default_columns = wp_parse_args($wp_custom_columns, $wp_default_columns);
|
427 |
|
428 |
+
//get saved database columns
|
429 |
+
$db_columns = $this->get_stored_columns($type);
|
430 |
if ( $db_columns ) {
|
431 |
+
|
432 |
+
// let's remove any unavailable columns.. such as disabled plugins
|
433 |
+
$db_columns = $this->remove_unavailable_columns($db_columns, $default_columns);
|
434 |
+
|
435 |
+
// loop throught the active columns
|
436 |
+
foreach ( $db_columns as $id => $values ) {
|
437 |
|
438 |
// get column meta options from custom columns
|
439 |
+
if ( $this->is_column_meta($id) )
|
440 |
+
$db_columns[$id]['options'] = $wp_custom_columns['column-meta-1']['options'];
|
441 |
|
442 |
// add static options
|
443 |
+
elseif ( isset($default_columns[$id]['options']) )
|
444 |
+
$db_columns[$id]['options'] = $default_columns[$id]['options'];
|
445 |
|
446 |
+
unset($default_columns[$id]);
|
447 |
}
|
448 |
}
|
449 |
|
450 |
// merge all
|
451 |
+
return wp_parse_args($db_columns, $default_columns);
|
|
|
|
|
452 |
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Remove deactivated (plugin) columns
|
456 |
+
*
|
457 |
+
* This will remove any columns that have been stored, but are no longer available. This happends
|
458 |
+
* when plugins are deactivated or when they are removed from the theme functions.
|
459 |
+
*
|
460 |
+
* @since 1.2
|
461 |
+
*/
|
462 |
+
private function remove_unavailable_columns( array $db_columns, array $default_columns)
|
463 |
+
{
|
464 |
+
// check or differences
|
465 |
+
$diff = array_diff( array_keys($db_columns), array_keys($default_columns) );
|
466 |
+
|
467 |
+
if ( ! empty($diff) && is_array($diff) ) {
|
468 |
+
foreach ( $diff as $column_name ){
|
469 |
+
// make an exception for column-meta-xxx
|
470 |
+
if ( ! $this->is_column_meta($column_name) ) {
|
471 |
+
unset($db_columns[$column_name]);
|
472 |
+
}
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
return $db_columns;
|
477 |
+
}
|
478 |
+
|
479 |
/**
|
480 |
* Get checkbox
|
481 |
*
|
482 |
* @since 1.0
|
483 |
*/
|
484 |
+
private function get_box($type, $id, $values)
|
485 |
{
|
486 |
$classes = array();
|
487 |
|
488 |
// set state
|
489 |
$state = isset($values['state']) ? $values['state'] : '';
|
490 |
|
|
|
|
|
|
|
491 |
// class
|
492 |
+
$classes[] = "cpac-box-{$id}";
|
493 |
if ( $state )
|
494 |
$classes[] = 'active';
|
495 |
if ( ! empty($values['options']['class']) )
|
497 |
$class = implode(' ', $classes);
|
498 |
|
499 |
// more box options
|
500 |
+
$more_options = $this->get_additional_box_options($type, $id, $values);
|
501 |
$action = "<a class='cpac-action' href='#open'>open</a>";
|
502 |
+
|
503 |
+
// type label
|
504 |
+
$type_label = isset($values['options']['type_label']) ? $values['options']['type_label'] : '';
|
505 |
+
|
506 |
+
// label
|
507 |
+
$label = isset($values['label']) ? str_replace("'", '"', $values['label']) : '';
|
508 |
+
|
509 |
+
// width
|
510 |
+
$width = isset($values['width']) ? $values['width'] : 0;
|
511 |
+
$width_descr = isset($values['width']) && $values['width'] > 0 ? $values['width'] . '%' : __('default', $this->textdomain);
|
512 |
|
513 |
// hide box options
|
514 |
+
$label_hidden = '';
|
515 |
+
if ( ! empty($values['options']['hide_options']) || strpos($label, '<img') !== false ) {
|
516 |
+
$label_hidden = ' style="display:none"';
|
517 |
}
|
518 |
|
519 |
$list = "
|
520 |
<li class='{$class}'>
|
521 |
+
<div class='cpac-sort-handle'></div>
|
522 |
+
<div class='cpac-type-options'>
|
|
|
523 |
<div class='cpac-checkbox'></div>
|
524 |
+
<input type='hidden' class='cpac-state' name='cpac_options[columns][{$type}][{$id}][state]' value='{$state}'/>
|
525 |
+
<label class='main-label'>{$values['label']}</label>
|
|
|
526 |
</div>
|
527 |
<div class='cpac-meta-title'>
|
528 |
{$action}
|
529 |
+
<span>{$type_label}</span>
|
530 |
</div>
|
531 |
<div class='cpac-type-inside'>
|
532 |
+
<label for='cpac_options-{$type}-{$id}-label'{$label_hidden}>Label: </label>
|
533 |
+
<input type='text' name='cpac_options[columns][{$type}][{$id}][label]' id='cpac_options-{$type}-{$id}-label' value='{$label}' class='text'{$label_hidden}/>
|
534 |
+
<label for='cpac_options-{$type}-{$id}-width'>".__('Width', $this->textdomain).":</label>
|
535 |
+
<input type='hidden' maxlength='4' class='input-width' name='cpac_options[columns][{$type}][{$id}][width]' id='cpac_options-{$type}-{$id}-width' value='{$width}' />
|
536 |
+
<div class='description width-decription' title='".__('default', $this->textdomain)."'>{$width_descr}</div>
|
537 |
+
<div class='input-width-range'></div>
|
538 |
<br/>
|
539 |
{$more_options}
|
540 |
</div>
|
549 |
*
|
550 |
* @since 1.0
|
551 |
*/
|
552 |
+
private function get_additional_box_options($type, $id, $values)
|
553 |
{
|
554 |
$fields = '';
|
555 |
|
556 |
+
// Custom Fields
|
557 |
+
if ( $this->is_column_meta($id) )
|
558 |
+
$fields = $this->get_box_options_customfields($type, $id, $values);
|
559 |
|
560 |
return $fields;
|
561 |
}
|
565 |
*
|
566 |
* @since 1.0
|
567 |
*/
|
568 |
+
private function get_box_options_customfields($type, $id, $values)
|
569 |
{
|
570 |
// get post meta fields
|
571 |
+
$fields = $this->get_meta_by_type($type);
|
572 |
|
573 |
if ( empty($fields) )
|
574 |
return false;
|
595 |
'library_id' => __('Media Library Icon', $this->textdomain),
|
596 |
'excerpt' => __('Excerpt'),
|
597 |
'array' => __('Multiple Values', $this->textdomain),
|
598 |
+
'numeric' => __('Numeric', $this->textdomain),
|
599 |
+
'date' => __('Date', $this->textdomain),
|
600 |
+
'title_by_id' => __('Post Title (Post ID\'s)', $this->textdomain),
|
601 |
);
|
602 |
|
603 |
+
// add filter
|
604 |
+
$fieldtypes = apply_filters('cpac-field-types', $fieldtypes );
|
605 |
+
|
606 |
+
// set select options
|
607 |
foreach ( $fieldtypes as $fkey => $fieldtype ) {
|
608 |
$fieldtype_options .= sprintf
|
609 |
(
|
614 |
);
|
615 |
}
|
616 |
|
617 |
+
// before and after string
|
618 |
+
$before = ! empty($values['before']) ? $values['before'] : '' ;
|
619 |
+
$after = ! empty($values['after']) ? $values['after'] : '' ;
|
620 |
+
|
621 |
if ( empty($field_options) )
|
622 |
return false;
|
623 |
|
624 |
// add remove button
|
625 |
$remove = '<p class="remove-description description">'.__('This field can not be removed', $this->textdomain).'</p>';
|
626 |
+
if ( $id != 'column-meta-1') {
|
627 |
$remove = "
|
628 |
<p>
|
629 |
<a href='javascript:;' class='cpac-delete-custom-field-box'>".__('Remove')."</a>
|
632 |
}
|
633 |
|
634 |
$inside = "
|
635 |
+
<label for='cpac-{$type}-{$id}-field'>Custom Field: </label>
|
636 |
+
<select name='cpac_options[columns][{$type}][{$id}][field]' id='cpac-{$type}-{$id}-field'>{$field_options}</select>
|
637 |
<br/>
|
638 |
+
<label for='cpac-{$type}-{$id}-field_type'>Field Type: </label>
|
639 |
+
<select name='cpac_options[columns][{$type}][{$id}][field_type]' id='cpac-{$type}-{$id}-field_type'>{$fieldtype_options}</select>
|
640 |
<br/>
|
641 |
+
<label for='cpac-{$type}-{$id}-before'>Before: </label>
|
642 |
+
<input type='text' class='cpac-before' name='cpac_options[columns][{$type}][{$id}][before]' id='cpac-{$type}-{$id}-before' value='{$before}'/>
|
643 |
+
<br/>
|
644 |
+
<label for='cpac-{$type}-{$id}-after'>After: </label>
|
645 |
+
<input type='text' class='cpac-after' name='cpac_options[columns][{$type}][{$id}][after]' id='cpac-{$type}-{$id}-after' value='{$after}'/>
|
646 |
+
<br/>
|
647 |
{$remove}
|
648 |
";
|
649 |
|
651 |
}
|
652 |
|
653 |
/**
|
654 |
+
* Get post meta fields by type; post(types) or users.
|
655 |
*
|
656 |
* @since 1.0
|
657 |
*/
|
658 |
+
private function get_meta_by_type($type = 'post')
|
659 |
{
|
660 |
global $wpdb;
|
661 |
+
|
662 |
+
/** Comments */
|
663 |
+
if ( $type == 'wp-comments') {
|
664 |
+
$sql = "SELECT DISTINCT meta_key FROM {$wpdb->commentmeta} ORDER BY 1";
|
665 |
+
}
|
666 |
+
|
667 |
+
/** Users */
|
668 |
+
elseif ( $type == 'wp-users') {
|
669 |
+
$sql = "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} ORDER BY 1";
|
670 |
+
}
|
671 |
|
672 |
+
/** Posts */
|
673 |
+
else {
|
674 |
+
$sql = $wpdb->prepare( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = %s ORDER BY 1", $type);
|
675 |
+
}
|
676 |
+
|
677 |
+
// run sql
|
678 |
+
$fields = $wpdb->get_results($sql, ARRAY_N);
|
679 |
+
|
680 |
// postmeta
|
681 |
if ( $fields ) {
|
682 |
$meta_fields = array();
|
686 |
$meta_fields[] = $field[0];
|
687 |
}
|
688 |
}
|
|
|
689 |
return $meta_fields;
|
690 |
+
}
|
691 |
|
692 |
return false;
|
693 |
}
|
697 |
*
|
698 |
* @since 1.0
|
699 |
*/
|
700 |
+
public function admin_scripts()
|
701 |
{
|
702 |
+
wp_enqueue_script( 'jquery-ui-slider' );
|
703 |
+
wp_enqueue_script( 'cpac-qtip2', $this->plugin_url('/assets/js/jquery.qtip.js'), array('jquery'), CPAC_VERSION );
|
704 |
+
wp_enqueue_script( 'cpac-admin', $this->plugin_url('/assets/js/admin-column.js'), array('jquery', 'dashboard', 'jquery-ui-sortable'), CPAC_VERSION );
|
705 |
}
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Get column types
|
709 |
+
*
|
710 |
+
* @since 1.1
|
711 |
+
*/
|
712 |
+
private function get_types()
|
713 |
+
{
|
714 |
+
$types = $this->post_types;
|
715 |
+
$types['wp-users'] = 'wp-users';
|
716 |
+
$types['wp-media'] = 'wp-media';
|
717 |
+
$types['wp-links'] = 'wp-links';
|
718 |
+
$types['wp-comments'] = 'wp-comments';
|
719 |
+
|
720 |
+
return $types;
|
721 |
+
}
|
722 |
+
|
723 |
/**
|
724 |
* Get post types
|
725 |
*
|
726 |
* @since 1.0
|
727 |
*/
|
728 |
+
protected function get_post_types()
|
729 |
{
|
730 |
$post_types = get_post_types(array(
|
731 |
'_builtin' => false
|
733 |
$post_types['post'] = 'post';
|
734 |
$post_types['page'] = 'page';
|
735 |
|
736 |
+
return apply_filters('cpac-get-post-types', $post_types);
|
737 |
}
|
738 |
|
739 |
/**
|
743 |
*/
|
744 |
public function admin_styles()
|
745 |
{
|
746 |
+
wp_enqueue_style( 'jquery-ui-lightness', $this->plugin_url('/assets/ui-theme/jquery-ui-1.8.18.custom.css'), array(), CPAC_VERSION, 'all' );
|
747 |
wp_enqueue_style( 'cpac-admin', $this->plugin_url('/assets/css/admin-column.css'), array(), CPAC_VERSION, 'all' );
|
748 |
}
|
749 |
|
765 |
public function register_settings()
|
766 |
{
|
767 |
// If we have no options in the database, let's add them now.
|
768 |
+
if ( false === get_option('cpac_options') )
|
769 |
+
add_option( 'cpac_options', array($this, 'get_default_plugin_options') );
|
770 |
|
771 |
+
register_setting( 'cpac-settings-group', 'cpac_options', array($this, 'options_callback') );
|
772 |
}
|
773 |
|
774 |
/**
|
786 |
}
|
787 |
|
788 |
/**
|
789 |
+
* Optional callback.
|
790 |
*
|
791 |
* @since 1.0
|
792 |
*/
|
800 |
*
|
801 |
* @since 1.0
|
802 |
*/
|
803 |
+
public function handle_requests()
|
804 |
{
|
805 |
// settings updated
|
806 |
+
if ( ! empty($_REQUEST['settings-updated']) )
|
807 |
+
$this->store_wp_default_columns();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
|
809 |
// restore defaults
|
810 |
+
if ( ! empty($_REQUEST['cpac-restore-defaults']) )
|
811 |
$this->restore_defaults();
|
812 |
+
|
813 |
+
}
|
814 |
+
|
815 |
+
/**
|
816 |
+
* Stores WP default columns
|
817 |
+
*
|
818 |
+
* This will store columns that are set by WordPress core or
|
819 |
+
* set by the theme for page, post(types) and user columns
|
820 |
+
*
|
821 |
+
* @since 1.2
|
822 |
+
*/
|
823 |
+
private function store_wp_default_columns()
|
824 |
+
{
|
825 |
+
// stores the default columns that are set by WP or set in the theme.
|
826 |
+
$wp_default_columns = array();
|
827 |
+
|
828 |
+
// Posts
|
829 |
+
foreach ( $this->post_types as $post_type ) {
|
830 |
+
$wp_default_columns[$post_type] = $this->get_wp_default_posts_columns($post_type);
|
831 |
+
}
|
832 |
+
|
833 |
+
// Users
|
834 |
+
$wp_default_columns['wp-users'] = $this->get_wp_default_users_columns();
|
835 |
+
|
836 |
+
// Media
|
837 |
+
$wp_default_columns['wp-media'] = $this->get_wp_default_media_columns();
|
838 |
+
|
839 |
+
// Links
|
840 |
+
$wp_default_columns['wp-links'] = $this->get_wp_default_links_columns();
|
841 |
+
|
842 |
+
// Comments
|
843 |
+
$wp_default_columns['wp-comments'] = $this->get_wp_default_comments_columns();
|
844 |
+
|
845 |
+
update_option( 'cpac_options_default', $wp_default_columns );
|
846 |
}
|
847 |
|
848 |
/**
|
853 |
private function restore_defaults()
|
854 |
{
|
855 |
delete_option( 'cpac_options' );
|
856 |
+
delete_option( 'cpac_options_default' );
|
857 |
}
|
858 |
|
859 |
/**
|
861 |
*
|
862 |
* @since 1.0
|
863 |
*/
|
864 |
+
private function get_post_excerpt($post_id)
|
865 |
{
|
866 |
+
global $post;
|
867 |
+
|
868 |
$save_post = $post;
|
869 |
$post = get_post($post_id);
|
870 |
$excerpt = get_the_excerpt();
|
871 |
$post = $save_post;
|
872 |
|
873 |
+
$output = $this->get_shortened_string($excerpt, $this->excerpt_length );
|
874 |
|
875 |
return $output;
|
876 |
}
|
880 |
*
|
881 |
* @since 1.0
|
882 |
*/
|
883 |
+
private function get_shortened_string($string = '', $num_words = 55, $more = null)
|
884 |
{
|
885 |
if (!$string)
|
886 |
return false;
|
887 |
|
888 |
+
return wp_trim_words( $string, $num_words, $more );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
}
|
890 |
|
891 |
/**
|
893 |
*
|
894 |
* @since 1.0
|
895 |
*/
|
896 |
+
public function manage_posts_column_value($column_name, $post_id)
|
897 |
{
|
898 |
+
$type = $column_name;
|
899 |
|
900 |
// Check for taxonomies, such as column-taxonomy-[taxname]
|
901 |
if ( strpos($type, 'column-taxonomy-') !== false )
|
902 |
$type = 'column-taxonomy';
|
903 |
|
904 |
// Check for custom fields, such as column-meta-[customfieldname]
|
905 |
+
if ( $this->is_column_meta($type) )
|
906 |
+
$type = 'column-post-meta';
|
907 |
|
908 |
// Hook
|
909 |
+
do_action('cpac-manage-posts-column', $type, $column_name, $post_id);
|
910 |
|
911 |
// Switch Types
|
912 |
$result = '';
|
924 |
|
925 |
// Featured Image
|
926 |
case "column-featured_image" :
|
927 |
+
if ( has_post_thumbnail($post_id) )
|
928 |
+
$result = get_the_post_thumbnail($post_id, array(80,80));
|
929 |
break;
|
930 |
|
931 |
// Sticky Post
|
932 |
case "column-sticky" :
|
933 |
+
if ( is_sticky($post_id) )
|
934 |
+
$result = $this->get_asset_image('checkmark.png');
|
|
|
|
|
935 |
break;
|
936 |
|
937 |
// Order
|
948 |
case "column-page-template" :
|
949 |
// file name
|
950 |
$page_template = get_post_meta($post_id, '_wp_page_template', true);
|
951 |
+
|
952 |
+
// get template nice name
|
953 |
+
$result = array_search($page_template, get_page_templates());
|
|
|
954 |
break;
|
955 |
|
956 |
// Slug
|
957 |
case "column-page-slug" :
|
958 |
+
$result = get_post($post_id)->post_name;
|
959 |
+
break;
|
960 |
+
|
961 |
+
// Slug
|
962 |
+
case "column-word-count" :
|
963 |
+
$result = str_word_count( $this->strip_trim( get_post($post_id)->post_content ) );
|
964 |
break;
|
965 |
|
966 |
// Taxonomy
|
967 |
case "column-taxonomy" :
|
968 |
+
$tax = str_replace('column-taxonomy-', '', $column_name);
|
969 |
$tags = get_the_terms($post_id, $tax);
|
970 |
$tarr = array();
|
971 |
+
|
972 |
+
// for post formats we will display standard instead of empty
|
973 |
if ( $tax == 'post_format' && empty($tags) ) {
|
974 |
$result = __('Standard');
|
975 |
}
|
976 |
+
|
977 |
+
// add name with link
|
978 |
+
elseif ( !empty($tags) ) {
|
979 |
+
$post_type = get_post_type($post_id);
|
980 |
+
foreach($tags as $tag) {
|
981 |
+
// sanatize title
|
982 |
+
$tax_title = esc_html(sanitize_term_field('name', $tag->name, $tag->term_id, $tag->taxonomy, 'edit'));
|
983 |
+
$tarr[] = "<a href='edit.php?post_type={$post_type}&{$tag->taxonomy}={$tag->slug}'>{$tax_title}</a>";
|
984 |
}
|
985 |
$result = implode(', ', $tarr);
|
986 |
}
|
987 |
break;
|
988 |
|
989 |
// Custom Field
|
990 |
+
case "column-post-meta" :
|
991 |
+
$result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
|
992 |
break;
|
993 |
|
994 |
// Attachment
|
995 |
case "column-attachment" :
|
996 |
$result = $this->get_column_value_attachments($post_id);
|
997 |
break;
|
998 |
+
|
999 |
+
// Attachment count
|
1000 |
+
case "column-attachment-count" :
|
1001 |
+
$result = count($this->get_attachment_ids($post_id));
|
1002 |
+
break;
|
1003 |
+
|
1004 |
+
// Roles
|
1005 |
+
case "column-roles" :
|
1006 |
+
$user_id = get_post($post_id)->post_author;
|
1007 |
+
$userdata = get_userdata( $user_id );
|
1008 |
+
if ( !empty($userdata->roles[0]) )
|
1009 |
+
echo implode(', ',$userdata->roles);
|
1010 |
+
break;
|
1011 |
+
|
1012 |
+
// Post status
|
1013 |
+
case "column-status" :
|
1014 |
+
$p = get_post($post_id);
|
1015 |
+
$result = $p->post_status;
|
1016 |
+
if ( $result == 'future')
|
1017 |
+
$result = $result . " <p class='description'>" . date_i18n( get_option('date_format') . ' ' . get_option('time_format') , strtotime($p->post_date) ) . "</p>";
|
1018 |
+
break;
|
1019 |
|
1020 |
default :
|
1021 |
+
$result = $this->strip_trim(get_post_meta( $post_id, $column_name, true ));
|
1022 |
|
1023 |
endswitch;
|
1024 |
|
|
|
|
|
|
|
1025 |
echo $result;
|
1026 |
}
|
1027 |
+
|
1028 |
/**
|
1029 |
+
* Manage custom column for Users.
|
1030 |
*
|
1031 |
+
* @since 1.1
|
1032 |
*/
|
1033 |
+
public function manage_users_column_value( $value, $column_name, $user_id )
|
1034 |
{
|
1035 |
+
$type = $column_name;
|
1036 |
+
|
1037 |
+
$userdata = get_userdata( $user_id );
|
1038 |
+
|
1039 |
+
if ( ! $userdata )
|
1040 |
+
return false;
|
1041 |
+
|
1042 |
+
// Check for user custom fields: column-meta-[customfieldname]
|
1043 |
+
if ( $this->is_column_meta($type) )
|
1044 |
+
$type = 'column-user-meta';
|
1045 |
+
|
1046 |
+
// Check for post count: column-user_postcount-[posttype]
|
1047 |
+
if ( $this->get_posttype_by_postcount_column($type) )
|
1048 |
+
$type = 'column-user_postcount';
|
1049 |
+
|
1050 |
+
// Hook
|
1051 |
+
do_action('cpac-manage-users-column', $type, $column_name, $user_id);
|
1052 |
+
|
1053 |
$result = '';
|
1054 |
+
switch ($type) :
|
1055 |
+
|
1056 |
+
// user id
|
1057 |
+
case "column-user_id" :
|
1058 |
+
$result = $user_id;
|
1059 |
+
break;
|
1060 |
+
|
1061 |
+
// first name
|
1062 |
+
case "column-nickname" :
|
1063 |
+
$result = $userdata->nickname;
|
1064 |
+
break;
|
1065 |
+
|
1066 |
+
// first name
|
1067 |
+
case "column-first_name" :
|
1068 |
+
$result = $userdata->first_name;
|
1069 |
+
break;
|
1070 |
+
|
1071 |
+
// last name
|
1072 |
+
case "column-last_name" :
|
1073 |
+
$result = $userdata->last_name;
|
1074 |
+
break;
|
1075 |
+
|
1076 |
+
// user url
|
1077 |
+
case "column-user_url" :
|
1078 |
+
$result = $userdata->user_url;
|
1079 |
+
break;
|
1080 |
+
|
1081 |
+
// user registration date
|
1082 |
+
case "column-user_registered" :
|
1083 |
+
$result = $userdata->user_registered;
|
1084 |
+
break;
|
1085 |
+
|
1086 |
+
// user description
|
1087 |
+
case "column-user_description" :
|
1088 |
+
$result = $this->get_shortened_string( get_the_author_meta('user_description', $user_id), $this->excerpt_length );
|
1089 |
+
break;
|
1090 |
+
|
1091 |
+
// user description
|
1092 |
+
case "column-user_postcount" :
|
1093 |
+
$post_type = $this->get_posttype_by_postcount_column($column_name);
|
1094 |
+
|
1095 |
+
// get post count
|
1096 |
+
$count = $this->get_post_count( $post_type, $user_id );
|
1097 |
+
|
1098 |
+
// set result
|
1099 |
+
$result = $count > 0 ? "<a href='edit.php?post_type={$post_type}&author={$user_id}'>{$count}</a>" : (string) $count;
|
1100 |
+
break;
|
1101 |
+
|
1102 |
+
// user meta data ( custom field )
|
1103 |
+
case "column-user-meta" :
|
1104 |
+
$result = $this->get_column_value_custom_field($user_id, $column_name, 'user');
|
1105 |
+
break;
|
1106 |
+
|
1107 |
+
default :
|
1108 |
+
$result = get_user_meta( $user_id, $column_name, true );
|
1109 |
+
|
1110 |
+
endswitch;
|
1111 |
+
|
1112 |
return $result;
|
1113 |
}
|
1114 |
|
1115 |
/**
|
1116 |
+
* Manage custom column for Media.
|
1117 |
*
|
1118 |
+
* @since 1.3
|
1119 |
*/
|
1120 |
+
public function manage_media_column_value( $column_name, $media_id )
|
1121 |
{
|
1122 |
+
$type = $column_name;
|
|
|
|
|
|
|
|
|
|
|
1123 |
|
1124 |
+
$meta = wp_get_attachment_metadata($media_id);
|
1125 |
+
$p = get_post($media_id);
|
|
|
|
|
|
|
1126 |
|
1127 |
+
// Hook
|
1128 |
+
do_action('cpac-manage-media-column', $type, $column_name, $media_id);
|
|
|
|
|
|
|
|
|
1129 |
|
1130 |
+
$result = '';
|
1131 |
+
switch ($type) :
|
1132 |
+
|
1133 |
+
// media id
|
1134 |
+
case "column-mediaid" :
|
1135 |
+
$result = $media_id;
|
1136 |
+
break;
|
1137 |
+
|
1138 |
+
// dimensions
|
1139 |
+
case "column-dimensions" :
|
1140 |
+
if ( !empty($meta['width']) && !empty($meta['height']) )
|
1141 |
+
$result = "{$meta['width']} x {$meta['height']}";
|
1142 |
+
break;
|
1143 |
+
|
1144 |
+
// width
|
1145 |
+
case "column-width" :
|
1146 |
+
$result = !empty($meta['width']) ? $meta['width'] : '';
|
1147 |
+
break;
|
1148 |
+
|
1149 |
+
// height
|
1150 |
+
case "column-height" :
|
1151 |
+
$result = !empty($meta['height']) ? $meta['height'] : '';
|
1152 |
+
break;
|
1153 |
+
|
1154 |
+
// description
|
1155 |
+
case "column-description" :
|
1156 |
+
$result = $p->post_content;
|
1157 |
break;
|
1158 |
|
1159 |
+
// caption
|
1160 |
+
case "column-caption" :
|
1161 |
+
$result = $p->post_excerpt;
|
1162 |
+
break;
|
1163 |
+
|
1164 |
+
// alternate text
|
1165 |
+
case "column-alternate_text" :
|
1166 |
+
$alt = get_post_meta($media_id, '_wp_attachment_image_alt', true);
|
1167 |
+
$result = $this->strip_trim($alt);
|
1168 |
+
break;
|
1169 |
+
|
1170 |
+
// mime type
|
1171 |
+
case "column-mime_type" :
|
1172 |
+
$result = $p->post_mime_type;
|
1173 |
break;
|
1174 |
|
1175 |
+
// file name
|
1176 |
+
case "column-file_name" :
|
1177 |
+
$file = wp_get_attachment_url($p->ID);
|
1178 |
+
$filename = basename($file);
|
1179 |
+
$result = "<a title='{$filename}' href='{$file}'>{$filename}</a>";
|
1180 |
break;
|
1181 |
+
|
1182 |
+
// file paths
|
1183 |
+
case "column-file_paths" :
|
1184 |
+
$sizes = get_intermediate_image_sizes();
|
1185 |
+
$url = wp_get_attachment_url($p->ID);
|
1186 |
+
$filename = basename($url);
|
1187 |
+
$paths[] = "<a title='{$filename}' href='{$url}'>" . __('original', $this->textdomain) . "</a>";
|
1188 |
+
if ( $sizes ) {
|
1189 |
+
foreach ( $sizes as $size ) {
|
1190 |
+
$src = wp_get_attachment_image_src( $media_id, $size );
|
1191 |
+
if (!empty($src[0])) {
|
1192 |
+
$filename = basename($src[0]);
|
1193 |
+
$paths[] = "<a title='{$filename}' href='{$src[0]}'>{$size}</a>";
|
1194 |
+
}
|
1195 |
+
}
|
1196 |
+
}
|
1197 |
+
$result = implode('<span class="cpac-divider"></span>', $paths);
|
1198 |
+
break;
|
1199 |
+
|
1200 |
+
default:
|
1201 |
+
$result = '';
|
1202 |
+
|
1203 |
+
endswitch;
|
1204 |
|
1205 |
+
echo $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1206 |
}
|
1207 |
+
|
1208 |
/**
|
1209 |
+
* Manage custom column for Links
|
1210 |
*
|
1211 |
+
* @since 1.3.1
|
1212 |
*/
|
1213 |
+
public function manage_link_column_value( $column_name, $link_id )
|
1214 |
{
|
1215 |
+
$type = $column_name;
|
1216 |
|
1217 |
+
// links object... called bookmark
|
1218 |
+
$bookmark = get_bookmark($link_id);
|
1219 |
|
1220 |
+
// Hook
|
1221 |
+
do_action('cpac-manage-link-column', $type, $column_name, $link_id);
|
1222 |
+
|
1223 |
+
$result = '';
|
1224 |
+
switch ($type) :
|
1225 |
|
1226 |
+
// link id
|
1227 |
+
case "column-link_id" :
|
1228 |
+
$result = $link_id;
|
1229 |
+
break;
|
1230 |
+
|
1231 |
+
// description
|
1232 |
+
case "column-description" :
|
1233 |
+
$result = $bookmark->link_description;
|
1234 |
+
break;
|
1235 |
+
|
1236 |
+
// target
|
1237 |
+
case "column-target" :
|
1238 |
+
$result = $bookmark->link_target;
|
1239 |
+
break;
|
1240 |
+
|
1241 |
+
// notes
|
1242 |
+
case "column-notes" :
|
1243 |
+
$result = $this->get_shortened_string($bookmark->link_notes, $this->excerpt_length);
|
1244 |
+
break;
|
1245 |
+
|
1246 |
+
// rss
|
1247 |
+
case "column-rss" :
|
1248 |
+
$result = $this->get_shorten_url($bookmark->link_rss);
|
1249 |
+
break;
|
1250 |
|
1251 |
+
// image
|
1252 |
+
case "column-image" :
|
1253 |
+
$result = $this->get_thumbnail($bookmark->link_image);
|
1254 |
+
break;
|
1255 |
+
|
1256 |
+
// name length
|
1257 |
+
case "column-length" :
|
1258 |
+
$result = strlen($bookmark->link_name);
|
1259 |
+
break;
|
1260 |
+
|
1261 |
+
// owner
|
1262 |
+
case "column-owner" :
|
1263 |
+
$result = $bookmark->link_owner;
|
1264 |
+
|
1265 |
+
// add user link
|
1266 |
+
$userdata = get_userdata( $bookmark->link_owner );
|
1267 |
+
if (!empty($userdata->data)) {
|
1268 |
+
$result = $userdata->data->user_nicename;
|
1269 |
+
//$result = "<a href='user-edit.php?user_id={$bookmark->link_owner}'>{$result}</a>";
|
1270 |
+
}
|
1271 |
+
break;
|
1272 |
+
|
1273 |
+
default:
|
1274 |
+
$result = '';
|
1275 |
+
|
1276 |
+
endswitch;
|
1277 |
+
|
1278 |
+
echo $result;
|
1279 |
}
|
1280 |
+
|
1281 |
/**
|
1282 |
+
* Manage custom column for Comments
|
1283 |
*
|
1284 |
+
* @since 1.3.1
|
1285 |
*/
|
1286 |
+
public function manage_comments_column_value( $column_name, $comment_id )
|
1287 |
{
|
1288 |
+
$type = $column_name;
|
1289 |
|
1290 |
+
// comments object
|
1291 |
+
$comment = get_comment($comment_id);
|
1292 |
|
1293 |
+
// Check for custom fields, such as column-meta-[customfieldname]
|
1294 |
+
if ( $this->is_column_meta($type) )
|
1295 |
+
$type = 'column-comment-meta';
|
1296 |
|
1297 |
+
// Hook
|
1298 |
+
do_action('cpac-manage-comments-column', $type, $column_name, $comment_id);
|
1299 |
|
1300 |
+
$result = '';
|
1301 |
+
switch ($type) :
|
1302 |
+
|
1303 |
+
// comment id
|
1304 |
+
case "column-comment_id" :
|
1305 |
+
$result = $comment_id;
|
1306 |
+
break;
|
1307 |
+
|
1308 |
+
// author
|
1309 |
+
case "column-author_author" :
|
1310 |
+
$result = $comment->comment_author;
|
1311 |
+
break;
|
1312 |
+
|
1313 |
+
// avatar
|
1314 |
+
case "column-author_avatar" :
|
1315 |
+
$result = get_avatar( $comment, 80 );
|
1316 |
+
break;
|
1317 |
+
|
1318 |
+
// url
|
1319 |
+
case "column-author_url" :
|
1320 |
+
$result = $this->get_shorten_url($comment->comment_author_url);
|
1321 |
+
break;
|
1322 |
+
|
1323 |
+
// ip
|
1324 |
+
case "column-author_ip" :
|
1325 |
+
$result = $comment->comment_author_IP;
|
1326 |
+
break;
|
1327 |
+
|
1328 |
+
// email
|
1329 |
+
case "column-author_email" :
|
1330 |
+
$result = $comment->comment_author_email;
|
1331 |
+
break;
|
1332 |
+
|
1333 |
+
// parent
|
1334 |
+
case "column-reply_to" :
|
1335 |
+
if ( $comment->comment_approved ) {
|
1336 |
+
$parent = get_comment( $comment->comment_parent );
|
1337 |
+
$parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
|
1338 |
+
$name = get_comment_author( $parent->comment_ID );
|
1339 |
+
$result = sprintf( '<a href="%1$s">%2$s</a>', $parent_link, $name );
|
1340 |
+
}
|
1341 |
+
break;
|
1342 |
+
|
1343 |
+
// approved
|
1344 |
+
case "column-approved" :
|
1345 |
+
$result = $this->get_asset_image('no.png');
|
1346 |
+
if ( $comment->comment_approved )
|
1347 |
+
$result = $this->get_asset_image('checkmark.png');
|
1348 |
+
break;
|
1349 |
+
|
1350 |
+
// date
|
1351 |
+
case "column-date" :
|
1352 |
+
$comment_url = esc_url( get_comment_link( $comment_id ) );
|
1353 |
+
$result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
|
1354 |
+
$comment_url,
|
1355 |
+
$this->get_date($comment->comment_date),
|
1356 |
+
$this->get_time($comment->comment_date)
|
1357 |
+
);
|
1358 |
+
$result = "<div class='submitted-on'>{$result}</div>";
|
1359 |
+
break;
|
1360 |
+
|
1361 |
+
// date GMT
|
1362 |
+
case "column-date_gmt" :
|
1363 |
+
$comment_url = esc_url( get_comment_link( $comment_id ) );
|
1364 |
+
$result = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
|
1365 |
+
$comment_url,
|
1366 |
+
$this->get_date($comment->comment_date_gmt),
|
1367 |
+
$this->get_time($comment->comment_date_gmt)
|
1368 |
+
);
|
1369 |
+
$result = "<div class='submitted-on'>{$result}</div>";
|
1370 |
+
break;
|
1371 |
+
|
1372 |
+
// custom field
|
1373 |
+
case "column-comment-meta" :
|
1374 |
+
$result = $this->get_column_value_custom_field($comment_id, $column_name, 'comment');
|
1375 |
+
break;
|
1376 |
+
|
1377 |
+
// agent
|
1378 |
+
case "column-agent" :
|
1379 |
+
$result = $comment->comment_agent;
|
1380 |
+
break;
|
1381 |
+
|
1382 |
+
// excerpt
|
1383 |
+
case "column-excerpt" :
|
1384 |
+
$comment = get_comment($comment_id);
|
1385 |
+
$result = $this->get_shortened_string($comment->comment_content, $this->excerpt_length);
|
1386 |
+
break;
|
1387 |
+
|
1388 |
+
default:
|
1389 |
+
$result = '';
|
1390 |
+
|
1391 |
+
endswitch;
|
1392 |
|
1393 |
+
echo $result;
|
1394 |
}
|
1395 |
|
1396 |
/**
|
1397 |
+
* Get column value of post attachments
|
1398 |
*
|
1399 |
* @since 1.0
|
1400 |
*/
|
1401 |
+
private function get_column_value_attachments( $post_id )
|
1402 |
{
|
1403 |
+
$result = '';
|
1404 |
+
$attachment_ids = $this->get_attachment_ids($post_id);
|
1405 |
+
if ( $attachment_ids ) {
|
1406 |
+
foreach ( $attachment_ids as $attach_id ) {
|
1407 |
+
if ( wp_get_attachment_image($attach_id) )
|
1408 |
+
$result .= wp_get_attachment_image( $attach_id, array(80,80), true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1409 |
}
|
1410 |
+
}
|
1411 |
+
return $result;
|
1412 |
+
}
|
1413 |
+
|
1414 |
/**
|
1415 |
+
* Get column value of post attachments
|
1416 |
*
|
1417 |
+
* @since 1.2.1
|
1418 |
*/
|
1419 |
+
protected function get_attachment_ids( $post_id )
|
1420 |
{
|
1421 |
+
return get_posts(array(
|
1422 |
+
'post_type' => 'attachment',
|
1423 |
+
'numberposts' => -1,
|
1424 |
+
'post_status' => null,
|
1425 |
+
'post_parent' => $post_id,
|
1426 |
+
'fields' => 'ids'
|
1427 |
+
));
|
1428 |
+
}
|
1429 |
+
|
1430 |
+
/**
|
1431 |
+
* Get post count
|
1432 |
+
*
|
1433 |
+
* @since 1.3.1
|
1434 |
+
*/
|
1435 |
+
protected function get_post_count( $post_type, $user_id )
|
1436 |
+
{
|
1437 |
+
if ( ! post_type_exists($post_type) || ! get_userdata($user_id) )
|
1438 |
+
return false;
|
1439 |
+
|
1440 |
+
$user_posts = get_posts(array(
|
1441 |
+
'post_type' => $post_type,
|
1442 |
+
'numberposts' => -1,
|
1443 |
+
'author' => $user_id,
|
1444 |
+
'post_status' => 'publish'
|
1445 |
+
));
|
1446 |
+
return count($user_posts);
|
1447 |
+
}
|
1448 |
+
|
1449 |
+
/**
|
1450 |
+
* Get checkmark image
|
1451 |
+
*
|
1452 |
+
* @since 1.3.1
|
1453 |
+
*/
|
1454 |
+
protected function get_asset_image($name = '')
|
1455 |
+
{
|
1456 |
+
if ( $name )
|
1457 |
+
return sprintf("<img alt='' src='%s' />", $this->plugin_url("assets/images/{$name}") );
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
/**
|
1461 |
+
* Shorten URL
|
1462 |
+
*
|
1463 |
+
* @since 1.3.1
|
1464 |
+
*/
|
1465 |
+
protected function get_shorten_url($url = '')
|
1466 |
+
{
|
1467 |
+
if ( !$url )
|
1468 |
+
return false;
|
1469 |
+
|
1470 |
+
// shorten url
|
1471 |
+
$short_url = url_shorten( $url );
|
1472 |
+
|
1473 |
+
return "<a title='{$url}' href='{$url}'>{$short_url}</a>";
|
1474 |
+
}
|
1475 |
+
/**
|
1476 |
+
* Get column value of Custom Field
|
1477 |
+
*
|
1478 |
+
* @since 1.0
|
1479 |
+
*/
|
1480 |
+
protected function get_column_value_custom_field($object_id, $column_name, $meta_type = 'post')
|
1481 |
+
{
|
1482 |
+
/** Users */
|
1483 |
+
if ( $meta_type == 'user' ) {
|
1484 |
+
$type = 'wp-users';
|
1485 |
+
}
|
1486 |
+
|
1487 |
+
/** Posts */
|
1488 |
+
else {
|
1489 |
+
$type = get_post_type($object_id);
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
// get column
|
1493 |
+
$columns = $this->get_stored_columns($type);
|
1494 |
+
|
1495 |
+
// inputs
|
1496 |
+
$field = isset($columns[$column_name]['field']) ? $columns[$column_name]['field'] : '';
|
1497 |
+
$fieldtype = isset($columns[$column_name]['field_type']) ? $columns[$column_name]['field_type'] : '';
|
1498 |
+
$before = isset($columns[$column_name]['before']) ? $columns[$column_name]['before'] : '';
|
1499 |
+
$after = isset($columns[$column_name]['after']) ? $columns[$column_name]['after'] : '';
|
1500 |
+
|
1501 |
+
// Get meta field value
|
1502 |
+
$meta = get_metadata($meta_type, $object_id, $field, true);
|
1503 |
+
|
1504 |
+
// multiple meta values
|
1505 |
+
if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
|
1506 |
+
$meta = get_metadata($meta_type, $object_id, $field, true);
|
1507 |
+
$meta = $this->recursive_implode(', ', $meta);
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
// make sure there are no serialized arrays or empty meta data
|
1511 |
+
if ( empty($meta) || !is_string($meta) )
|
1512 |
+
return false;
|
1513 |
+
|
1514 |
+
// handles each field type differently..
|
1515 |
+
switch ($fieldtype) :
|
1516 |
+
|
1517 |
+
// Image
|
1518 |
+
case "image" :
|
1519 |
+
$meta = $this->get_thumbnail($meta);
|
1520 |
+
break;
|
1521 |
+
|
1522 |
+
// Media Library ID
|
1523 |
+
case "library_id" :
|
1524 |
+
$meta = $this->get_media_thumbnails($meta);
|
1525 |
+
break;
|
1526 |
+
|
1527 |
+
// Excerpt
|
1528 |
+
case "excerpt" :
|
1529 |
+
$meta = $this->get_shortened_string($meta, $this->excerpt_length);
|
1530 |
+
break;
|
1531 |
+
|
1532 |
+
// Date
|
1533 |
+
case "date" :
|
1534 |
+
$meta = $this->get_date($meta);
|
1535 |
+
break;
|
1536 |
+
|
1537 |
+
// Title
|
1538 |
+
case "title_by_id" :
|
1539 |
+
$titles = $this->get_custom_field_value_title($meta);
|
1540 |
+
if ( $titles )
|
1541 |
+
$meta = $titles;
|
1542 |
+
break;
|
1543 |
+
|
1544 |
+
endswitch;
|
1545 |
+
|
1546 |
+
// add before and after string
|
1547 |
+
$meta = "{$before}{$meta}{$after}";
|
1548 |
+
|
1549 |
+
return $meta;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
/**
|
1553 |
+
* Get custom field value 'Title by ID'
|
1554 |
+
*
|
1555 |
+
* @since 1.3
|
1556 |
+
*/
|
1557 |
+
private function get_custom_field_value_title($meta)
|
1558 |
+
{
|
1559 |
+
//remove white spaces and strip tags
|
1560 |
+
$meta = $this->strip_trim( str_replace(' ','', $meta) );
|
1561 |
+
|
1562 |
+
// var
|
1563 |
+
$ids = $titles = array();
|
1564 |
+
|
1565 |
+
// check for multiple id's
|
1566 |
+
if ( strpos($meta, ',') !== false )
|
1567 |
+
$ids = explode(',',$meta);
|
1568 |
+
elseif ( is_numeric($meta) )
|
1569 |
+
$ids[] = $meta;
|
1570 |
+
|
1571 |
+
// display title with link
|
1572 |
+
if ( $ids && is_array($ids) ) {
|
1573 |
+
foreach ( $ids as $id ) {
|
1574 |
+
$title = is_numeric($id) ? get_the_title($id) : '';
|
1575 |
+
$link = get_edit_post_link($id);
|
1576 |
+
if ( $title )
|
1577 |
+
$titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
|
1578 |
+
}
|
1579 |
+
}
|
1580 |
+
|
1581 |
+
return implode('<span class="cpac-divider"></span>', $titles);
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
/**
|
1585 |
+
* Get column value of Custom Field
|
1586 |
+
*
|
1587 |
+
* @since 1.2
|
1588 |
+
*/
|
1589 |
+
private function get_user_column_value_custom_field($user_id, $id)
|
1590 |
+
{
|
1591 |
+
$columns = $this->get_stored_columns('wp-users');
|
1592 |
+
|
1593 |
+
// inputs
|
1594 |
+
$field = isset($columns[$id]['field']) ? $columns[$id]['field'] : '';
|
1595 |
+
$fieldtype = isset($columns[$id]['field_type']) ? $columns[$id]['field_type'] : '';
|
1596 |
+
$before = isset($columns[$id]['before']) ? $columns[$id]['before'] : '';
|
1597 |
+
$after = isset($columns[$id]['after']) ? $columns[$id]['after'] : '';
|
1598 |
+
|
1599 |
+
// Get meta field value
|
1600 |
+
$meta = get_user_meta($user_id, $field, true);
|
1601 |
+
|
1602 |
+
// multiple meta values
|
1603 |
+
if ( ( $fieldtype == 'array' && is_array($meta) ) || is_array($meta) ) {
|
1604 |
+
$meta = get_user_meta($user_id, $field);
|
1605 |
+
$meta = $this->recursive_implode(', ', $meta);
|
1606 |
+
}
|
1607 |
+
|
1608 |
+
// make sure there are no serialized arrays or empty meta data
|
1609 |
+
if ( empty($meta) || !is_string($meta) )
|
1610 |
+
return false;
|
1611 |
+
|
1612 |
+
// handles each field type differently..
|
1613 |
+
switch ($fieldtype) :
|
1614 |
+
|
1615 |
+
// Image
|
1616 |
+
case "image" :
|
1617 |
+
$meta = $this->get_thumbnail($meta);
|
1618 |
+
break;
|
1619 |
+
|
1620 |
+
// Media Library ID
|
1621 |
+
case "library_id" :
|
1622 |
+
$meta = $this->get_media_thumbnails($meta);
|
1623 |
+
break;
|
1624 |
+
|
1625 |
+
// Excerpt
|
1626 |
+
case "excerpt" :
|
1627 |
+
$meta = $this->get_shortened_string($meta, $this->excerpt_length);
|
1628 |
+
break;
|
1629 |
+
|
1630 |
+
endswitch;
|
1631 |
+
|
1632 |
+
// add before and after string
|
1633 |
+
$meta = "{$before}{$meta}{$after}";
|
1634 |
+
|
1635 |
+
return $meta;
|
1636 |
+
}
|
1637 |
+
|
1638 |
+
/**
|
1639 |
+
* Implode for multi dimensional array
|
1640 |
+
*
|
1641 |
+
* @since 1.0
|
1642 |
+
*/
|
1643 |
+
private function recursive_implode( $glue, $pieces )
|
1644 |
+
{
|
1645 |
+
foreach( $pieces as $r_pieces ) {
|
1646 |
+
if( is_array( $r_pieces ) ) {
|
1647 |
+
$retVal[] = $this->recursive_implode( $glue, $r_pieces );
|
1648 |
+
}
|
1649 |
+
else {
|
1650 |
+
$retVal[] = $r_pieces;
|
1651 |
+
}
|
1652 |
+
}
|
1653 |
+
if ( isset($retVal) && is_array($retVal) )
|
1654 |
+
return implode( $glue, $retVal );
|
1655 |
+
|
1656 |
+
return false;
|
1657 |
+
}
|
1658 |
+
|
1659 |
+
/**
|
1660 |
+
* Get WP default supported admin columns per post type.
|
1661 |
+
*
|
1662 |
+
* @since 1.0
|
1663 |
+
*/
|
1664 |
+
private function get_wp_default_posts_columns($post_type = 'post')
|
1665 |
+
{
|
1666 |
+
// load dependencies
|
1667 |
+
|
1668 |
+
// deprecated as of wp3.3
|
1669 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/template.php') )
|
1670 |
+
require_once(ABSPATH . 'wp-admin/includes/template.php');
|
1671 |
+
|
1672 |
+
// introduced since wp3.3
|
1673 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/screen.php') )
|
1674 |
+
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
1675 |
+
|
1676 |
+
// used for getting columns
|
1677 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1678 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1679 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php') )
|
1680 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
|
1681 |
+
|
1682 |
+
// we need to change the current screen
|
1683 |
+
global $current_screen;
|
1684 |
$org_current_screen = $current_screen;
|
1685 |
|
1686 |
// overwrite current_screen global with our post type of choose...
|
1687 |
$current_screen->post_type = $post_type;
|
1688 |
|
1689 |
+
// ...so we can get its columns
|
1690 |
+
$columns = WP_Posts_List_Table::get_columns();
|
1691 |
+
|
1692 |
+
if ( empty ( $columns ) )
|
1693 |
+
return false;
|
1694 |
+
|
1695 |
+
// change to uniform format
|
1696 |
+
$posts_columns = $this->get_uniform_format($columns);
|
1697 |
+
|
1698 |
+
// reset current screen
|
1699 |
+
$current_screen = $org_current_screen;
|
1700 |
+
|
1701 |
+
return $posts_columns;
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
/**
|
1705 |
+
* Get WP default users columns per post type.
|
1706 |
+
*
|
1707 |
+
* @since 1.1
|
1708 |
+
*/
|
1709 |
+
private function get_wp_default_users_columns()
|
1710 |
+
{
|
1711 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1712 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1713 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php') )
|
1714 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php');
|
1715 |
+
|
1716 |
+
// turn off site users
|
1717 |
+
$this->is_site_users = false;
|
1718 |
+
|
1719 |
+
// get users columns
|
1720 |
+
$columns = WP_Users_List_Table::get_columns();
|
1721 |
+
|
1722 |
+
// change to uniform format
|
1723 |
+
$columns = $this->get_uniform_format($columns);
|
1724 |
+
|
1725 |
+
// add sorting to some of the default links columns
|
1726 |
+
$columns = $this->set_sorting_to_default_users_columns($columns);
|
1727 |
+
|
1728 |
+
return apply_filters('cpac-default-users-columns', $columns);
|
1729 |
+
}
|
1730 |
+
|
1731 |
+
/**
|
1732 |
+
* Add Sorting to WP default Users columns
|
1733 |
+
*
|
1734 |
+
* @since 1.4
|
1735 |
+
*/
|
1736 |
+
private function set_sorting_to_default_users_columns($columns)
|
1737 |
+
{
|
1738 |
+
// Comment
|
1739 |
+
if ( !empty($columns['role']) ) {
|
1740 |
+
$columns['role']['options']['sortorder'] = 'on';
|
1741 |
+
}
|
1742 |
+
return $columns;
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
/**
|
1746 |
+
* Get WP default media columns.
|
1747 |
+
*
|
1748 |
+
* @since 1.2.1
|
1749 |
+
*/
|
1750 |
+
private function get_wp_default_media_columns()
|
1751 |
+
{
|
1752 |
+
// could use _get_list_table('WP_Media_List_Table') ?
|
1753 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1754 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1755 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php') )
|
1756 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php');
|
1757 |
+
|
1758 |
+
global $current_screen;
|
1759 |
+
$org_current_screen = $current_screen;
|
1760 |
+
|
1761 |
+
// overwrite current_screen global with our media id...
|
1762 |
+
$current_screen->id = 'upload';
|
1763 |
+
|
1764 |
+
// init media class
|
1765 |
+
$wp_media = new WP_Media_List_Table;
|
1766 |
+
|
1767 |
+
// get media columns
|
1768 |
+
$columns = $wp_media->get_columns();
|
1769 |
+
|
1770 |
+
// reset current screen
|
1771 |
+
$current_screen = $org_current_screen;
|
1772 |
+
|
1773 |
+
// change to uniform format
|
1774 |
+
return $this->get_uniform_format($columns);
|
1775 |
+
}
|
1776 |
+
|
1777 |
+
/**
|
1778 |
+
* Get WP default links columns.
|
1779 |
+
*
|
1780 |
+
* @since 1.3.1
|
1781 |
+
*/
|
1782 |
+
private function get_wp_default_links_columns()
|
1783 |
+
{
|
1784 |
+
// dependencies
|
1785 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1786 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1787 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php') )
|
1788 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-links-list-table.php');
|
1789 |
+
|
1790 |
+
// get links columns
|
1791 |
+
$columns = WP_Links_List_Table::get_columns();
|
1792 |
+
|
1793 |
+
// change to uniform format
|
1794 |
+
$columns = $this->get_uniform_format($columns);
|
1795 |
+
|
1796 |
+
// add sorting to some of the default links columns
|
1797 |
+
$columns = $this->set_sorting_to_default_links_columns($columns);
|
1798 |
+
|
1799 |
+
return apply_filters('cpac-default-links-columns', $columns);
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
/**
|
1803 |
+
* Add Sorting to WP default links columns
|
1804 |
+
*
|
1805 |
+
* @since 1.4
|
1806 |
+
*/
|
1807 |
+
private function set_sorting_to_default_links_columns($columns)
|
1808 |
+
{
|
1809 |
+
// Relationship
|
1810 |
+
if ( !empty($columns['rel']) ) {
|
1811 |
+
$columns['rel']['options']['sortorder'] = 'on';
|
1812 |
+
}
|
1813 |
+
return $columns;
|
1814 |
+
}
|
1815 |
+
|
1816 |
+
/**
|
1817 |
+
* Get WP default links columns.
|
1818 |
+
*
|
1819 |
+
* @since 1.3.1
|
1820 |
+
*/
|
1821 |
+
private function get_wp_default_comments_columns()
|
1822 |
+
{
|
1823 |
+
// dependencies
|
1824 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
|
1825 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
1826 |
+
if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php') )
|
1827 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php');
|
1828 |
+
|
1829 |
+
global $current_screen;
|
1830 |
+
$org_current_screen = $current_screen;
|
1831 |
+
|
1832 |
+
// overwrite current_screen global with our media id...
|
1833 |
+
$current_screen->id = 'edit-comments';
|
1834 |
+
|
1835 |
+
// init table object
|
1836 |
+
$wp_comment = new WP_Comments_List_Table;
|
1837 |
+
|
1838 |
+
// get comments
|
1839 |
+
$columns = $wp_comment->get_columns();
|
1840 |
+
|
1841 |
+
// reset current screen
|
1842 |
+
$current_screen = $org_current_screen;
|
1843 |
+
|
1844 |
+
// change to uniform format
|
1845 |
+
$columns = $this->get_uniform_format($columns);
|
1846 |
+
|
1847 |
+
// add sorting to some of the default links columns
|
1848 |
+
$columns = $this->set_sorting_to_default_comments_columns($columns);
|
1849 |
+
|
1850 |
+
return apply_filters('cpac-default-comments-columns', $columns);
|
1851 |
+
}
|
1852 |
+
|
1853 |
+
/**
|
1854 |
+
* Add Sorting to WP default comments columns
|
1855 |
+
*
|
1856 |
+
* @since 1.4
|
1857 |
+
*/
|
1858 |
+
private function set_sorting_to_default_comments_columns($columns)
|
1859 |
+
{
|
1860 |
+
// Comment
|
1861 |
+
if ( !empty($columns['comment']) ) {
|
1862 |
+
$columns['comment']['options']['sortorder'] = 'on';
|
1863 |
+
}
|
1864 |
+
return $columns;
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
/**
|
1868 |
+
* Build uniform format for all columns
|
1869 |
+
*
|
1870 |
+
* @since 1.0
|
1871 |
+
*/
|
1872 |
+
private function get_uniform_format($columns)
|
1873 |
+
{
|
1874 |
+
// we remove the checkbox column as an option...
|
1875 |
+
if ( isset($columns['cb']) )
|
1876 |
+
unset($columns['cb']);
|
1877 |
+
|
1878 |
+
// change to uniform format
|
1879 |
+
$uniform_columns = array();
|
1880 |
+
foreach ( (array) $columns as $id => $label ) {
|
1881 |
+
$hide_options = false;
|
1882 |
+
$type_label = $label;
|
1883 |
+
|
1884 |
+
// comment exception
|
1885 |
+
if ( strpos( $label, 'comment-grey-bubble.png') ) {
|
1886 |
+
$type_label = __('Comments', $this->textdomain);
|
1887 |
+
$hide_options = true;
|
1888 |
+
}
|
1889 |
+
|
1890 |
+
// user icon excerption
|
1891 |
+
if ( $id == 'icon' ) {
|
1892 |
+
$type_label = __('Icon', $this->textdomain);
|
1893 |
+
}
|
1894 |
+
|
1895 |
+
$uniform_colums[$id] = array(
|
1896 |
+
'label' => $label,
|
1897 |
+
'state' => 'on',
|
1898 |
+
'options' => array(
|
1899 |
+
'type_label' => $type_label,
|
1900 |
+
'hide_options' => $hide_options,
|
1901 |
+
'class' => 'cpac-box-wp-native',
|
1902 |
+
)
|
1903 |
+
);
|
1904 |
+
}
|
1905 |
+
return $uniform_colums;
|
1906 |
+
}
|
1907 |
+
|
1908 |
+
/**
|
1909 |
+
* Custom posts columns
|
1910 |
+
*
|
1911 |
+
* @since 1.0
|
1912 |
+
*/
|
1913 |
+
private function get_custom_posts_columns($post_type)
|
1914 |
+
{
|
1915 |
+
$custom_columns = array(
|
1916 |
+
'column-featured_image' => array(
|
1917 |
+
'label' => __('Featured Image', $this->textdomain)
|
1918 |
+
),
|
1919 |
+
'column-excerpt' => array(
|
1920 |
+
'label' => __('Excerpt', $this->textdomain)
|
1921 |
+
),
|
1922 |
+
'column-order' => array(
|
1923 |
+
'label' => __('Page Order', $this->textdomain)
|
1924 |
+
),
|
1925 |
+
'column-post_formats' => array(
|
1926 |
+
'label' => __('Post Format', $this->textdomain)
|
1927 |
+
),
|
1928 |
+
'column-postid' => array(
|
1929 |
+
'label' => __('ID', $this->textdomain)
|
1930 |
+
),
|
1931 |
+
'column-page-slug' => array(
|
1932 |
+
'label' => __('Slug', $this->textdomain)
|
1933 |
+
),
|
1934 |
+
'column-attachment' => array(
|
1935 |
+
'label' => __('Attachment', $this->textdomain)
|
1936 |
+
),
|
1937 |
+
'column-attachment-count' => array(
|
1938 |
+
'label' => __('No. of Attachments', $this->textdomain)
|
1939 |
+
),
|
1940 |
+
'column-roles' => array(
|
1941 |
+
'label' => __('Roles', $this->textdomain)
|
1942 |
+
),
|
1943 |
+
'column-status' => array(
|
1944 |
+
'label' => __('Status', $this->textdomain)
|
1945 |
+
),
|
1946 |
+
);
|
1947 |
+
|
1948 |
+
// Word count support
|
1949 |
+
if ( post_type_supports($post_type, 'editor') ) {
|
1950 |
+
$custom_columns['column-word-count'] = array(
|
1951 |
+
'label' => __('Word count', $this->textdomain)
|
1952 |
+
);
|
1953 |
+
}
|
1954 |
+
|
1955 |
+
// Sticky support
|
1956 |
+
if ( $post_type == 'post' ) {
|
1957 |
+
$custom_columns['column-sticky'] = array(
|
1958 |
+
'label' => __('Sticky', $this->textdomain)
|
1959 |
+
);
|
1960 |
+
}
|
1961 |
+
|
1962 |
+
// Order support
|
1963 |
+
if ( post_type_supports($post_type, 'page-attributes') ) {
|
1964 |
+
$custom_columns['column-order'] = array(
|
1965 |
+
'label' => __('Page Order', $this->textdomain),
|
1966 |
+
'options' => array(
|
1967 |
+
'type_label' => __('Order', $this->textdomain)
|
1968 |
+
)
|
1969 |
+
);
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
// Page Template
|
1973 |
+
if ( $post_type == 'page' ) {
|
1974 |
+
$custom_columns['column-page-template'] = array(
|
1975 |
+
'label' => __('Page Template', $this->textdomain)
|
1976 |
+
);
|
1977 |
+
}
|
1978 |
+
|
1979 |
+
// Post Formats
|
1980 |
+
if ( post_type_supports($post_type, 'post-formats') ) {
|
1981 |
+
$custom_columns['column-post_formats'] = array(
|
1982 |
+
'label' => __('Post Format', $this->textdomain)
|
1983 |
+
);
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
// Taxonomy support
|
1987 |
+
$taxonomies = get_object_taxonomies($post_type, 'objects');
|
1988 |
+
if ( $taxonomies ) {
|
1989 |
+
foreach ( $taxonomies as $tax_slug => $tax ) {
|
1990 |
+
if ( $tax_slug != 'post_tag' && $tax_slug != 'category' && $tax_slug != 'post_format' ) {
|
1991 |
+
$custom_columns['column-taxonomy-'.$tax->name] = array(
|
1992 |
+
'label' => $tax->label,
|
1993 |
+
'options' => array(
|
1994 |
+
'type_label' => __('Taxonomy', $this->textdomain),
|
1995 |
+
'sortorder' => false
|
1996 |
+
)
|
1997 |
+
);
|
1998 |
+
}
|
1999 |
+
}
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
// Custom Field support
|
2003 |
+
if ( $this->get_meta_by_type($post_type) ) {
|
2004 |
+
$custom_columns['column-meta-1'] = array(
|
2005 |
+
'label' => __('Custom Field', $this->textdomain),
|
2006 |
+
'field' => '',
|
2007 |
+
'field_type' => '',
|
2008 |
+
'before' => '',
|
2009 |
+
'after' => '',
|
2010 |
+
'options' => array(
|
2011 |
+
'type_label' => __('Field', $this->textdomain),
|
2012 |
+
'class' => 'cpac-box-metafield'
|
2013 |
+
)
|
2014 |
+
);
|
2015 |
+
}
|
2016 |
+
|
2017 |
+
// merge with defaults
|
2018 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
2019 |
+
|
2020 |
+
return apply_filters('cpac-custom-posts-columns', $custom_columns);
|
2021 |
+
}
|
2022 |
+
|
2023 |
+
/**
|
2024 |
+
* Custom users columns
|
2025 |
+
*
|
2026 |
+
* @since 1.1
|
2027 |
+
*/
|
2028 |
+
private function get_custom_users_columns()
|
2029 |
+
{
|
2030 |
+
$custom_columns = array(
|
2031 |
+
'column-user_id' => array(
|
2032 |
+
'label' => __('User ID', $this->textdomain)
|
2033 |
+
),
|
2034 |
+
'column-nickname' => array(
|
2035 |
+
'label' => __('Nickname', $this->textdomain)
|
2036 |
+
),
|
2037 |
+
'column-first_name' => array(
|
2038 |
+
'label' => __('First name', $this->textdomain)
|
2039 |
+
),
|
2040 |
+
'column-last_name' => array(
|
2041 |
+
'label' => __('Last name', $this->textdomain)
|
2042 |
+
),
|
2043 |
+
'column-user_url' => array(
|
2044 |
+
'label' => __('Url', $this->textdomain)
|
2045 |
+
),
|
2046 |
+
'column-user_registered' => array(
|
2047 |
+
'label' => __('Registered', $this->textdomain)
|
2048 |
+
),
|
2049 |
+
'column-user_description' => array(
|
2050 |
+
'label' => __('Description', $this->textdomain)
|
2051 |
+
),
|
2052 |
+
);
|
2053 |
+
|
2054 |
+
// User total number of posts
|
2055 |
+
if ($this->get_post_types()) {
|
2056 |
+
foreach ( $this->get_post_types() as $post_type ) {
|
2057 |
+
$label = $this->get_plural_name($post_type);
|
2058 |
+
$custom_columns['column-user_postcount-'.$post_type] = array(
|
2059 |
+
'label' => __( sprintf('No. of %s',$label), $this->textdomain),
|
2060 |
+
'options' => array(
|
2061 |
+
'type_label' => __('Postcount', $this->textdomain)
|
2062 |
+
)
|
2063 |
+
);
|
2064 |
+
}
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
// Custom Field support
|
2068 |
+
$custom_columns['column-meta-1'] = array(
|
2069 |
+
'label' => __('Custom Field', $this->textdomain),
|
2070 |
+
'field' => '',
|
2071 |
+
'field_type' => '',
|
2072 |
+
'before' => '',
|
2073 |
+
'after' => '',
|
2074 |
+
'options' => array(
|
2075 |
+
'type_label' => __('Field', $this->textdomain),
|
2076 |
+
'class' => 'cpac-box-metafield'
|
2077 |
+
)
|
2078 |
+
);
|
2079 |
+
|
2080 |
+
// merge with defaults
|
2081 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
2082 |
+
|
2083 |
+
return apply_filters('cpac-custom-users-columns', $custom_columns);
|
2084 |
+
}
|
2085 |
+
|
2086 |
+
/**
|
2087 |
+
* Custom media columns
|
2088 |
+
*
|
2089 |
+
* @since 1.3
|
2090 |
+
*/
|
2091 |
+
private function get_custom_media_columns()
|
2092 |
+
{
|
2093 |
+
$custom_columns = array(
|
2094 |
+
'column-mediaid' => array(
|
2095 |
+
'label' => __('ID', $this->textdomain)
|
2096 |
+
),
|
2097 |
+
'column-mime_type' => array(
|
2098 |
+
'label' => __('Mime type', $this->textdomain)
|
2099 |
+
),
|
2100 |
+
'column-file_name' => array(
|
2101 |
+
'label' => __('File name', $this->textdomain)
|
2102 |
+
),
|
2103 |
+
'column-dimensions' => array(
|
2104 |
+
'label' => __('Dimensions', $this->textdomain)
|
2105 |
+
),
|
2106 |
+
'column-height' => array(
|
2107 |
+
'label' => __('Height', $this->textdomain)
|
2108 |
+
),
|
2109 |
+
'column-width' => array(
|
2110 |
+
'label' => __('Width', $this->textdomain)
|
2111 |
+
),
|
2112 |
+
'column-caption' => array(
|
2113 |
+
'label' => __('Caption', $this->textdomain)
|
2114 |
+
),
|
2115 |
+
'column-description' => array(
|
2116 |
+
'label' => __('Description', $this->textdomain)
|
2117 |
+
),
|
2118 |
+
'column-alternate_text' => array(
|
2119 |
+
'label' => __('Alt', $this->textdomain)
|
2120 |
+
),
|
2121 |
+
'column-file_paths' => array(
|
2122 |
+
'label' => __('Upload paths', $this->textdomain),
|
2123 |
+
'options' => array(
|
2124 |
+
'sortorder' => false
|
2125 |
+
)
|
2126 |
+
),
|
2127 |
+
);
|
2128 |
+
|
2129 |
+
// merge with defaults
|
2130 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
2131 |
+
|
2132 |
+
return apply_filters('cpac-custom-media-columns', $custom_columns);
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
/**
|
2136 |
+
* Custom links columns
|
2137 |
+
*
|
2138 |
+
* @since 1.3.1
|
2139 |
+
*/
|
2140 |
+
private function get_custom_links_columns()
|
2141 |
+
{
|
2142 |
+
$custom_columns = array(
|
2143 |
+
'column-link_id' => array (
|
2144 |
+
'label' => __('ID', $this->textdomain)
|
2145 |
+
),
|
2146 |
+
'column-description' => array (
|
2147 |
+
'label' => __('Description', $this->textdomain)
|
2148 |
+
),
|
2149 |
+
'column-image' => array(
|
2150 |
+
'label' => __('Image', $this->textdomain)
|
2151 |
+
),
|
2152 |
+
'column-target' => array(
|
2153 |
+
'label' => __('Target', $this->textdomain)
|
2154 |
+
),
|
2155 |
+
'column-owner' => array(
|
2156 |
+
'label' => __('Owner', $this->textdomain)
|
2157 |
+
),
|
2158 |
+
'column-notes' => array(
|
2159 |
+
'label' => __('Notes', $this->textdomain)
|
2160 |
+
),
|
2161 |
+
'column-rss' => array(
|
2162 |
+
'label' => __('Rss', $this->textdomain)
|
2163 |
+
),
|
2164 |
+
'column-length' => array(
|
2165 |
+
'label' => __('Length', $this->textdomain)
|
2166 |
+
)
|
2167 |
+
);
|
2168 |
+
|
2169 |
+
// merge with defaults
|
2170 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
2171 |
+
|
2172 |
+
return apply_filters('cpac-custom-links-columns', $custom_columns);
|
2173 |
+
}
|
2174 |
+
|
2175 |
+
/**
|
2176 |
+
* Custom comments columns
|
2177 |
+
*
|
2178 |
+
* @since 1.3.1
|
2179 |
+
*/
|
2180 |
+
private function get_custom_comments_columns()
|
2181 |
+
{
|
2182 |
+
$custom_columns = array(
|
2183 |
+
'column-comment_id' => array(
|
2184 |
+
'label' => __('ID', $this->textdomain)
|
2185 |
+
),
|
2186 |
+
'column-author_author' => array(
|
2187 |
+
'label' => __('Author Name', $this->textdomain)
|
2188 |
+
),
|
2189 |
+
'column-author_avatar' => array(
|
2190 |
+
'label' => __('Avatar', $this->textdomain)
|
2191 |
+
),
|
2192 |
+
'column-author_url' => array(
|
2193 |
+
'label' => __('Author url', $this->textdomain)
|
2194 |
+
),
|
2195 |
+
'column-author_ip' => array(
|
2196 |
+
'label' => __('Author IP', $this->textdomain)
|
2197 |
+
),
|
2198 |
+
'column-author_email' => array(
|
2199 |
+
'label' => __('Author email', $this->textdomain)
|
2200 |
+
),
|
2201 |
+
'column-reply_to' => array(
|
2202 |
+
'label' => __('In Reply To', $this->textdomain),
|
2203 |
+
|
2204 |
+
// options
|
2205 |
+
'options' => array(
|
2206 |
+
'sortorder' => false
|
2207 |
+
)
|
2208 |
+
),
|
2209 |
+
'column-approved' => array(
|
2210 |
+
'label' => __('Approved', $this->textdomain)
|
2211 |
+
),
|
2212 |
+
'column-date' => array(
|
2213 |
+
'label' => __('Date', $this->textdomain)
|
2214 |
+
),
|
2215 |
+
'column-date_gmt' => array(
|
2216 |
+
'label' => __('Date GMT', $this->textdomain)
|
2217 |
+
),
|
2218 |
+
'column-agent' => array(
|
2219 |
+
'label' => __('Agent', $this->textdomain)
|
2220 |
+
),
|
2221 |
+
'column-excerpt' => array(
|
2222 |
+
'label' => __('Excerpt', $this->textdomain)
|
2223 |
+
)
|
2224 |
+
);
|
2225 |
+
|
2226 |
+
// Custom Field support
|
2227 |
+
if ( $this->get_meta_by_type('wp-comments') ) {
|
2228 |
+
$custom_columns['column-meta-1'] = array(
|
2229 |
+
'label' => __('Custom Field', $this->textdomain),
|
2230 |
+
'field' => '',
|
2231 |
+
'field_type' => '',
|
2232 |
+
'before' => '',
|
2233 |
+
'after' => '',
|
2234 |
+
'options' => array(
|
2235 |
+
'type_label' => __('Field', $this->textdomain),
|
2236 |
+
'class' => 'cpac-box-metafield',
|
2237 |
+
'sortorder' => false,
|
2238 |
+
)
|
2239 |
+
);
|
2240 |
+
}
|
2241 |
+
|
2242 |
+
// merge with defaults
|
2243 |
+
$custom_columns = $this->parse_defaults($custom_columns);
|
2244 |
+
|
2245 |
+
return apply_filters('cpac-custom-comments-columns', $custom_columns);
|
2246 |
+
}
|
2247 |
+
|
2248 |
+
/**
|
2249 |
+
* Parse defaults
|
2250 |
+
*
|
2251 |
+
* @since 1.1
|
2252 |
+
*/
|
2253 |
+
private function parse_defaults($columns)
|
2254 |
+
{
|
2255 |
+
// default arguments
|
2256 |
+
$defaults = array(
|
2257 |
+
|
2258 |
+
// stored values
|
2259 |
+
'label' => '',
|
2260 |
+
'state' => '',
|
2261 |
+
'width' => '',
|
2262 |
+
|
2263 |
+
// static values
|
2264 |
+
'options' => array(
|
2265 |
+
'type_label' => __('Custom', $this->textdomain),
|
2266 |
+
'hide_options' => false,
|
2267 |
+
'class' => 'cpac-box-custom',
|
2268 |
+
'sortorder' => 'on',
|
2269 |
+
)
|
2270 |
+
);
|
2271 |
+
|
2272 |
+
// parse args
|
2273 |
+
foreach ( $columns as $k => $column ) {
|
2274 |
+
$c[$k] = wp_parse_args( $column, $defaults);
|
2275 |
+
|
2276 |
+
// parse options args
|
2277 |
+
if ( isset($column['options']) )
|
2278 |
+
$c[$k]['options'] = wp_parse_args( $column['options'], $defaults['options']);
|
2279 |
+
|
2280 |
+
// set type label
|
2281 |
+
if ( empty($column['options']['type_label']) && !empty($column['label']) )
|
2282 |
+
$c[$k]['options']['type_label'] = $column['label'];
|
2283 |
+
}
|
2284 |
+
|
2285 |
+
return $c;
|
2286 |
+
}
|
2287 |
+
|
2288 |
+
/**
|
2289 |
+
* Admin requests for orderby column
|
2290 |
+
*
|
2291 |
+
* @since 1.0
|
2292 |
+
*/
|
2293 |
+
protected function get_stored_columns($type)
|
2294 |
+
{
|
2295 |
+
// get plugin options
|
2296 |
+
$options = get_option('cpac_options');
|
2297 |
+
|
2298 |
+
// get saved columns
|
2299 |
+
if ( isset($options['columns'][$type]) )
|
2300 |
+
return $options['columns'][$type];
|
2301 |
+
|
2302 |
+
return false;
|
2303 |
+
}
|
2304 |
+
|
2305 |
+
/**
|
2306 |
+
* Post Type Menu
|
2307 |
+
*
|
2308 |
+
* @since 1.0
|
2309 |
+
*/
|
2310 |
+
private function get_menu()
|
2311 |
+
{
|
2312 |
+
// set
|
2313 |
+
$menu = '';
|
2314 |
+
$count = 1;
|
2315 |
+
|
2316 |
+
// referer
|
2317 |
+
$referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
|
2318 |
+
|
2319 |
+
// loop
|
2320 |
+
foreach ( $this->get_types() as $type ) {
|
2321 |
+
$label = $this->get_singular_name($type);
|
2322 |
+
$clean_label = $this->sanitize_string($type);
|
2323 |
+
|
2324 |
+
// divider
|
2325 |
+
$divider = $count++ == 1 ? '' : ' | ';
|
2326 |
+
|
2327 |
+
// current
|
2328 |
+
$current = '';
|
2329 |
+
if ( $this->is_menu_type_current($type) )
|
2330 |
+
$current = ' class="current"';
|
2331 |
+
|
2332 |
+
// menu list
|
2333 |
+
$menu .= "
|
2334 |
+
<li>{$divider}<a{$current} href='#cpac-box-{$clean_label}'>{$label}</a></li>
|
2335 |
+
";
|
2336 |
+
}
|
2337 |
+
|
2338 |
+
// settings url
|
2339 |
+
$class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current': '';
|
2340 |
+
|
2341 |
+
// options button
|
2342 |
+
$options_btn = "<a href='#cpac-box-plugin_settings' class='cpac-settings-link{$class_current_settings}'>".__('Addons')."</a>";
|
2343 |
+
//$options_btn = '';
|
2344 |
+
|
2345 |
+
return "
|
2346 |
+
<div class='cpac-menu'>
|
2347 |
+
<ul class='subsubsub'>
|
2348 |
+
{$menu}
|
2349 |
+
</ul>
|
2350 |
+
{$options_btn}
|
2351 |
+
</div>
|
2352 |
+
";
|
2353 |
+
}
|
2354 |
+
|
2355 |
+
/**
|
2356 |
+
* Checks if menu type is currently viewed
|
2357 |
+
*
|
2358 |
+
* @since 1.0
|
2359 |
+
*/
|
2360 |
+
private function is_menu_type_current( $type )
|
2361 |
+
{
|
2362 |
+
// referer
|
2363 |
+
$referer = ! empty($_REQUEST['cpac_type']) ? $_REQUEST['cpac_type'] : '';
|
2364 |
+
|
2365 |
+
// get label
|
2366 |
+
$clean_label = $this->sanitize_string($type);
|
2367 |
|
2368 |
+
// get first element from post-types
|
2369 |
+
$first = array_shift( array_values($this->post_types) );
|
2370 |
|
2371 |
+
// display the page that was being viewed before saving
|
2372 |
+
if ( $referer ) {
|
2373 |
+
if ( $referer == 'cpac-box-'.$clean_label ) {
|
2374 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
2375 |
}
|
2376 |
+
|
2377 |
+
// settings page has not yet been saved
|
2378 |
+
} elseif ( $first == $type ) {
|
2379 |
+
return true;
|
2380 |
+
}
|
2381 |
+
|
2382 |
+
return false;
|
2383 |
+
}
|
2384 |
|
2385 |
+
/**
|
2386 |
+
* Get singular name of post type
|
2387 |
+
*
|
2388 |
+
* @since 1.0
|
2389 |
+
*/
|
2390 |
+
private function get_singular_name( $type )
|
2391 |
+
{
|
2392 |
+
// Links
|
2393 |
+
if ( $type == 'wp-links' )
|
2394 |
+
$label = 'Links';
|
2395 |
+
|
2396 |
+
// Comments
|
2397 |
+
elseif ( $type == 'wp-comments' )
|
2398 |
+
$label = 'Comments';
|
2399 |
+
|
2400 |
+
// Users
|
2401 |
+
elseif ( $type == 'wp-users' )
|
2402 |
+
$label = 'Users';
|
2403 |
+
|
2404 |
+
// Media
|
2405 |
+
elseif ( $type == 'wp-media' )
|
2406 |
+
$label = 'Media Library';
|
2407 |
+
|
2408 |
+
// Posts
|
2409 |
+
else {
|
2410 |
+
$posttype_obj = get_post_type_object($type);
|
2411 |
+
$label = $posttype_obj->labels->singular_name;
|
2412 |
}
|
2413 |
|
2414 |
+
return $label;
|
2415 |
+
}
|
2416 |
+
|
2417 |
+
/**
|
2418 |
+
* Get plural name of post type
|
2419 |
+
*
|
2420 |
+
* @since 1.3.1
|
2421 |
+
*/
|
2422 |
+
private function get_plural_name( $type )
|
2423 |
+
{
|
2424 |
+
$posttype_obj = get_post_type_object($type);
|
2425 |
+
if ( $posttype_obj )
|
2426 |
+
return $posttype_obj->labels->name;
|
2427 |
|
2428 |
+
return false;
|
2429 |
+
}
|
2430 |
+
|
2431 |
+
/**
|
2432 |
+
* Get screen link to overview screen
|
2433 |
+
*
|
2434 |
+
* @since 1.3.1
|
2435 |
+
*/
|
2436 |
+
private function get_type_screen_link( $type )
|
2437 |
+
{
|
2438 |
+
// Links
|
2439 |
+
if ( $type == 'wp-comments' )
|
2440 |
+
$link = get_admin_url() . 'edit-comments.php';
|
2441 |
+
|
2442 |
+
// Links
|
2443 |
+
if ( $type == 'wp-links' )
|
2444 |
+
$link = get_admin_url() . 'link-manager.php';
|
2445 |
+
|
2446 |
+
// Users
|
2447 |
+
if ( $type == 'wp-users' )
|
2448 |
+
$link = get_admin_url() . 'users.php';
|
2449 |
+
|
2450 |
+
// Media
|
2451 |
+
elseif ( $type == 'wp-media' )
|
2452 |
+
$link = get_admin_url() . 'upload.php';
|
2453 |
+
|
2454 |
+
// Posts
|
2455 |
+
else
|
2456 |
+
$link = get_admin_url() . "edit.php?post_type={$type}";
|
2457 |
+
|
2458 |
+
return $link;
|
2459 |
}
|
2460 |
|
2461 |
/**
|
2462 |
+
* Sanitize label
|
2463 |
+
*
|
2464 |
+
* Uses intern wordpress function esc_url so it matches the label sorting url.
|
2465 |
+
*
|
2466 |
+
* @since 1.0
|
2467 |
+
*/
|
2468 |
+
protected function sanitize_string($string)
|
2469 |
+
{
|
2470 |
+
$string = esc_url($string);
|
2471 |
+
$string = str_replace('http://','', $string);
|
2472 |
+
$string = str_replace('https://','', $string);
|
2473 |
+
|
2474 |
+
return $string;
|
2475 |
+
}
|
2476 |
+
|
2477 |
+
/**
|
2478 |
+
* Get plugin url.
|
2479 |
+
*
|
2480 |
+
* @since 1.0
|
2481 |
+
*/
|
2482 |
+
private function plugin_url( $file = '' )
|
2483 |
+
{
|
2484 |
+
return plugins_url($file, __FILE__);
|
2485 |
+
}
|
2486 |
+
|
2487 |
+
/**
|
2488 |
+
* Checks if column-meta key exists
|
2489 |
*
|
2490 |
* @since 1.0
|
2491 |
*/
|
2492 |
+
protected function is_column_meta( $id = '' )
|
2493 |
{
|
2494 |
+
if ( strpos($id, 'column-meta-') !== false )
|
2495 |
+
return true;
|
2496 |
|
2497 |
+
return false;
|
2498 |
+
}
|
2499 |
+
|
2500 |
+
/**
|
2501 |
+
* Get the posttype from columnname
|
2502 |
+
*
|
2503 |
+
* @since 1.3.1
|
2504 |
+
*/
|
2505 |
+
protected function get_posttype_by_postcount_column( $id = '' )
|
2506 |
+
{
|
2507 |
+
if ( strpos($id, 'column-user_postcount-') !== false )
|
2508 |
+
return str_replace('column-user_postcount-', '', $id);
|
2509 |
+
|
2510 |
+
return false;
|
2511 |
+
}
|
2512 |
+
|
2513 |
+
/**
|
2514 |
+
* Get a thumbnail
|
2515 |
+
*
|
2516 |
+
* @since 1.0
|
2517 |
+
*/
|
2518 |
+
private function get_thumbnail( $image = '' )
|
2519 |
+
{
|
2520 |
+
if ( empty($image) )
|
2521 |
+
return false;
|
2522 |
|
2523 |
+
// get correct image path
|
2524 |
+
$image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2525 |
|
2526 |
+
// resize image
|
2527 |
+
if ( file_exists($image_path) && $this->is_image($image_path) ) {
|
2528 |
+
$resized = image_resize( $image_path, 80, 80, true);
|
2529 |
+
|
2530 |
+
if ( ! is_wp_error( $resized ) ) {
|
2531 |
+
$image = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $resized);
|
2532 |
+
|
2533 |
+
return "<img src='{$image}' alt='' width='80' height='80' />";
|
2534 |
+
}
|
2535 |
+
|
2536 |
+
return $resized->get_error_message();
|
2537 |
}
|
2538 |
|
2539 |
+
return false;
|
2540 |
+
}
|
2541 |
+
|
2542 |
+
/**
|
2543 |
+
* Get a thumbnail
|
2544 |
+
*
|
2545 |
+
* @since 1.3.1
|
2546 |
+
*/
|
2547 |
+
private function get_media_thumbnails($meta)
|
2548 |
+
{
|
2549 |
+
$meta = $this->strip_trim( str_replace(' ','', $meta) );
|
2550 |
|
2551 |
+
// split media ids
|
2552 |
+
$media_ids = array($meta);
|
2553 |
+
if ( strpos($meta, ',') !== false )
|
2554 |
+
$media_ids = explode(',', $meta);
|
|
|
|
|
|
|
|
|
|
|
|
|
2555 |
|
2556 |
+
// check if media exists
|
2557 |
+
$thumbs = '';
|
2558 |
+
foreach ( $media_ids as $media_id )
|
2559 |
+
if ( is_numeric($media_id) )
|
2560 |
+
$thumbs .= wp_get_attachment_url($media_id) ? "<span class='cpac-column-value-image'>".wp_get_attachment_image( $media_id, array(80,80), true )."</span>" : '';
|
2561 |
+
|
2562 |
+
return $thumbs;
|
2563 |
+
}
|
2564 |
+
|
2565 |
+
/**
|
2566 |
+
* Checks an URL for image extension
|
2567 |
+
*
|
2568 |
+
* @since 1.2
|
2569 |
+
*/
|
2570 |
+
private function is_image($url)
|
2571 |
+
{
|
2572 |
+
$validExt = array('.jpg', '.jpeg', '.gif', '.png', '.bmp');
|
2573 |
+
$ext = strrchr($url, '.');
|
2574 |
+
|
2575 |
+
return in_array($ext, $validExt);
|
2576 |
+
}
|
2577 |
+
|
2578 |
+
/**
|
2579 |
+
* Admin body class
|
2580 |
+
*
|
2581 |
+
* @since 1.4
|
2582 |
+
*/
|
2583 |
+
function admin_class()
|
2584 |
+
{
|
2585 |
+
global $current_screen;
|
2586 |
+
|
2587 |
+
// we dont need the 'edit-' part
|
2588 |
+
$screen = str_replace('edit-', '', $current_screen->id);
|
2589 |
+
|
2590 |
+
// media library exception
|
2591 |
+
if ( $current_screen->base == 'upload' && $current_screen->id == 'upload' ) {
|
2592 |
+
$screen = 'media';
|
2593 |
}
|
2594 |
|
2595 |
+
// link exception
|
2596 |
+
if ( $current_screen->base == 'link-manager' && $current_screen->id == 'link-manager' ) {
|
2597 |
+
$screen = 'links';
|
2598 |
+
}
|
2599 |
+
|
2600 |
+
// loop the available types
|
2601 |
+
foreach ( $this->get_types() as $type => $label ) {
|
2602 |
+
|
2603 |
+
// match against screen or wp-screen
|
2604 |
+
if ( $type == $screen || $type == "wp-{$screen}" )
|
2605 |
+
return "cp-{$type}";
|
2606 |
}
|
2607 |
+
return false;
|
2608 |
+
}
|
2609 |
+
|
2610 |
+
/**
|
2611 |
+
* Admin CSS for Column width
|
2612 |
+
*
|
2613 |
+
* @since 1.4
|
2614 |
+
*/
|
2615 |
+
function admin_css()
|
2616 |
+
{
|
2617 |
+
$css = '';
|
2618 |
|
2619 |
+
// loop throug the available types...
|
2620 |
+
foreach ( $this->get_types() as $type ) {
|
2621 |
+
$cols = $this->get_stored_columns($type);
|
2622 |
+
if ( $cols ) {
|
2623 |
+
|
2624 |
+
// loop through each available column...
|
2625 |
+
foreach ( $cols as $col_name => $col ) {
|
2626 |
+
|
2627 |
+
// and check for stored width and add it to the css
|
2628 |
+
if (!empty($col['width']) && is_numeric($col['width']) && $col['width'] > 0 ) {
|
2629 |
+
$css .= ".cp-{$type} .wrap table th.column-{$col_name} { width: {$col['width']}% !important; }";
|
2630 |
+
}
|
2631 |
}
|
2632 |
}
|
2633 |
}
|
2634 |
|
2635 |
+
echo "<style type='text/css'>{$css}</style>";
|
2636 |
+
}
|
2637 |
+
|
2638 |
+
/**
|
2639 |
+
* Unlocks
|
2640 |
+
*
|
2641 |
+
* @since 1.3
|
2642 |
+
*/
|
2643 |
+
protected function is_unlocked($type)
|
2644 |
+
{
|
2645 |
+
return preg_match('/^[a-f0-9]{40}$/i', $this->get_license_key($type));
|
2646 |
+
}
|
2647 |
+
|
2648 |
+
/**
|
2649 |
+
* Check license key with API
|
2650 |
+
*
|
2651 |
+
* @since 1.3.3
|
2652 |
+
*/
|
2653 |
+
private function check_remote_key($type, $key)
|
2654 |
+
{
|
2655 |
+
if ( empty($type) || empty($key) )
|
2656 |
+
return false;
|
2657 |
|
2658 |
+
// check key with remote API
|
2659 |
+
$response = wp_remote_post( $this->api_url, array(
|
2660 |
+
'body' => array(
|
2661 |
+
'api' => 'addon',
|
2662 |
+
'key' => $key,
|
2663 |
+
'type' => $type
|
2664 |
)
|
2665 |
+
));
|
2666 |
|
2667 |
+
// license will be valid in case of WP error or succes
|
2668 |
+
if ( is_wp_error($response) || ( isset($response['body']) && json_decode($response['body']) == 'valid' ) )
|
2669 |
+
return true;
|
2670 |
+
|
2671 |
+
return false;
|
2672 |
+
}
|
2673 |
+
|
2674 |
+
/**
|
2675 |
+
* Set masked license key
|
2676 |
+
*
|
2677 |
+
* @since 1.3.1
|
2678 |
+
*/
|
2679 |
+
private function get_masked_license_key($type)
|
2680 |
+
{
|
2681 |
+
return '**************************'.substr( $this->get_license_key($type), -4 );
|
2682 |
+
}
|
2683 |
+
|
2684 |
+
/**
|
2685 |
+
* Ajax activation
|
2686 |
+
*
|
2687 |
+
* @since 1.3.1
|
2688 |
+
*/
|
2689 |
+
public function ajax_activation()
|
2690 |
+
{
|
2691 |
+
// keys
|
2692 |
+
$key = $_POST['key'];
|
2693 |
+
$type = $_POST['type'];
|
2694 |
|
2695 |
+
// update key
|
2696 |
+
if ( $key == 'remove' ) {
|
2697 |
+
$this->remove_license_key($type);
|
2698 |
+
}
|
2699 |
+
|
2700 |
+
// set license key
|
2701 |
+
elseif ( $this->check_remote_key($type, $key) ) {
|
|
|
|
|
|
|
|
|
|
|
2702 |
|
2703 |
+
// set key
|
2704 |
+
$this->set_license_key($type, $key);
|
2705 |
+
|
2706 |
+
// returned masked key
|
2707 |
+
echo json_encode( $this->get_masked_license_key($type) );
|
2708 |
+
}
|
2709 |
|
2710 |
+
exit;
|
2711 |
+
}
|
2712 |
+
|
2713 |
/**
|
2714 |
+
* Get license key
|
2715 |
+
*
|
2716 |
+
* @since 1.3
|
2717 |
+
*/
|
2718 |
+
private function get_license_key($type)
|
2719 |
+
{
|
2720 |
+
return get_option("cpac_{$type}_ac");
|
2721 |
+
}
|
2722 |
+
|
2723 |
+
/**
|
2724 |
+
* Set license key
|
2725 |
*
|
2726 |
+
* @since 1.3
|
2727 |
*/
|
2728 |
+
private function set_license_key($type, $key)
|
2729 |
+
{
|
2730 |
+
update_option( "cpac_{$type}_ac", $key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2731 |
}
|
2732 |
+
|
2733 |
/**
|
2734 |
+
* Remove license key
|
2735 |
*
|
2736 |
+
* @since 1.3.1
|
2737 |
*/
|
2738 |
+
private function remove_license_key($type)
|
2739 |
{
|
2740 |
+
delete_option( "cpac_{$type}_ac" );
|
2741 |
+
delete_transient("cpac_{$type}_trnsnt");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2742 |
}
|
2743 |
+
|
2744 |
/**
|
2745 |
+
* Strip tags and trim
|
2746 |
*
|
2747 |
+
* @since 1.3
|
2748 |
*/
|
2749 |
+
protected function strip_trim($string)
|
2750 |
{
|
2751 |
+
return trim(strip_tags($string));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2752 |
}
|
2753 |
+
|
2754 |
/**
|
2755 |
+
* Get date
|
2756 |
*
|
2757 |
+
* @since 1.3.1
|
2758 |
*/
|
2759 |
+
protected function get_date($date)
|
2760 |
{
|
2761 |
+
if ( ! $date )
|
2762 |
+
return false;
|
2763 |
+
|
2764 |
+
if ( ! is_numeric($date) )
|
2765 |
+
$date = strtotime($date);
|
2766 |
+
|
2767 |
+
return date_i18n( get_option('date_format'), $date );
|
2768 |
}
|
2769 |
+
|
2770 |
/**
|
2771 |
+
* Get time
|
2772 |
*
|
2773 |
+
* @since 1.3.1
|
2774 |
*/
|
2775 |
+
protected function get_time($date)
|
2776 |
{
|
2777 |
+
if ( ! $date )
|
2778 |
+
return false;
|
|
|
2779 |
|
2780 |
+
if ( ! is_numeric($date) )
|
2781 |
+
$date = strtotime($date);
|
2782 |
+
|
2783 |
+
return date_i18n( get_option('time_format'), $date );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2784 |
}
|
2785 |
+
|
2786 |
/**
|
2787 |
+
* Admin notices
|
|
|
|
|
2788 |
*
|
2789 |
+
* @since 1.3.1
|
2790 |
*/
|
2791 |
+
private function admin_notice($message = '', $type = 'updated')
|
2792 |
{
|
2793 |
+
$this->notice_message = $message;
|
2794 |
+
$this->notice_type = $type; // updated, error
|
2795 |
+
|
2796 |
+
add_action('admin_notices', array( $this, 'callback_admin_notice' ) );
|
2797 |
}
|
2798 |
|
2799 |
/**
|
2800 |
+
* Output Notice
|
2801 |
*
|
2802 |
+
* @since 1.3.1
|
2803 |
*/
|
2804 |
+
public function callback_admin_notice()
|
2805 |
+
{
|
2806 |
+
echo "<div class='{$this->notice_type}' id='message'><p>{$this->notice_message}</p></div>";
|
2807 |
+
}
|
2808 |
+
|
2809 |
+
/**
|
2810 |
+
* Add help tabs
|
2811 |
+
*
|
2812 |
+
* @since 1.3
|
2813 |
+
*/
|
2814 |
+
public function help_tabs($page)
|
2815 |
{
|
2816 |
+
$screen = get_current_screen();
|
2817 |
+
|
2818 |
+
if ( $screen->id != $this->admin_page || ! method_exists($screen,'add_help_tab') )
|
2819 |
+
return;
|
2820 |
+
|
2821 |
+
$admin_url = get_admin_url();
|
2822 |
+
|
2823 |
+
// add help content
|
2824 |
+
$tabs = array(
|
2825 |
+
array(
|
2826 |
+
'title' => 'Overview',
|
2827 |
+
'content' => "
|
2828 |
+
<h5>Codepress Admin Columns</h5>
|
2829 |
+
<p>
|
2830 |
+
This plugin is for adding and removing additional columns to the administration screens for post(types), pages, media library, comments, links and users. Change the column's label and reorder them.
|
2831 |
+
</p>
|
2832 |
+
|
2833 |
+
"
|
2834 |
+
),
|
2835 |
+
array(
|
2836 |
+
'title' => 'Basics',
|
2837 |
+
'content' => "
|
2838 |
+
<h5>Show / Hide</h5>
|
2839 |
+
<p>
|
2840 |
+
You can switch columns on or off by cliking on the checkbox. This will show or hide each column heading.
|
2841 |
+
</p>
|
2842 |
+
<h5>Change order</h5>
|
2843 |
+
<p>
|
2844 |
+
By dragging the columns you can change the order which they will appear in.
|
2845 |
+
</p>
|
2846 |
+
<h5>Change label</h5>
|
2847 |
+
<p>
|
2848 |
+
By clicking on the triangle you will see the column options. Here you can change each label of the columns heading.
|
2849 |
+
</p>
|
2850 |
+
<h5>Change coluimn width</h5>
|
2851 |
+
<p>
|
2852 |
+
By clicking on the triangle you will see the column options. By using the draggable slider yo can set the width of the columns in percentages.
|
2853 |
+
</p>
|
2854 |
+
"
|
2855 |
+
),
|
2856 |
+
array(
|
2857 |
+
'title' => 'Custom Field',
|
2858 |
+
'content' => "
|
2859 |
+
<h5>'Custom Field' column</h5>
|
2860 |
+
<p>
|
2861 |
+
The custom field colum uses the custom fields from posts and users. There are 8 types which you can set.
|
2862 |
+
</p>
|
2863 |
+
<ul>
|
2864 |
+
<li><strong>Default</strong><br/>Value: Can be either a string or array. Arrays will be flattened and values are seperated by a ',' comma.</li>
|
2865 |
+
<li><strong>Image</strong><br/>Value: should only contain an image URL.</li>
|
2866 |
+
<li><strong>Media Library Icon</strong><br/>Value: should only contain Attachment IDs ( seperated by ',' ).</li>
|
2867 |
+
<li><strong>Excerpt</strong><br/>Value: This will show the first 20 words of the Post content.</li>
|
2868 |
+
<li><strong>Multiple Values</strong><br/>Value: should be an array. This will flatten any ( multi dimensional ) array.</li>
|
2869 |
+
<li><strong>Numeric</strong><br/>Value: Integers only.<br/>If you have the 'sorting addon' this will be used for sorting, so you can sort your posts on numeric (custom field) values.</li>
|
2870 |
+
<li><strong>Date</strong><br/>Value: Can be unix time stamp of date format as described in the <a href='http://codex.wordpress.org/Formatting_Date_and_Time'>Codex</a>. You can change the outputted date format at the <a href='{$admin_url}options-general.php'>general settings</a> page.</li>
|
2871 |
+
<li><strong>Post Titles</strong><br/>Value: can be one or more Post ID's (seperated by ',').</li>
|
2872 |
+
</ul>
|
2873 |
+
"
|
2874 |
+
)
|
2875 |
+
);
|
2876 |
+
|
2877 |
+
foreach ( $tabs as $k => $tab ) {
|
2878 |
+
$screen->add_help_tab(array(
|
2879 |
+
'id' => 'cpac-tab-'.$k, // unique id
|
2880 |
+
'title' => $tab['title'], // label
|
2881 |
+
'content' => $tab['content'], // body
|
2882 |
+
));
|
2883 |
+
}
|
2884 |
}
|
2885 |
|
2886 |
/**
|
2887 |
+
* Activation settings
|
2888 |
+
*
|
2889 |
+
* @since 1.3.1
|
2890 |
+
*/
|
2891 |
+
private function activation_settings()
|
2892 |
+
{
|
2893 |
+
$class_current_settings = $this->is_menu_type_current('plugin_settings') ? ' current' : ' hidden'; '';
|
2894 |
+
|
2895 |
+
/** Sortable */
|
2896 |
+
$masked_key = '';
|
2897 |
+
$class_sortorder_activate = '';
|
2898 |
+
$class_sortorder_deactivate = ' hidden';
|
2899 |
+
|
2900 |
+
// is unlocked
|
2901 |
+
if ( $this->is_unlocked('sortable') ) {
|
2902 |
+
$masked_key = $this->get_masked_license_key('sortable');
|
2903 |
+
$class_sortorder_activate = ' hidden';
|
2904 |
+
$class_sortorder_deactivate = '';
|
2905 |
+
}
|
2906 |
+
|
2907 |
+
// find out more
|
2908 |
+
$find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='button-primary alignright' target='_blank'>".__('find out more', $this->textdomain)." »</a>";
|
2909 |
+
|
2910 |
+
// info box
|
2911 |
+
$sortable_tooltip = "
|
2912 |
+
<p>".__('This will make all of the new columns support sorting', $this->textdomain).".</p>
|
2913 |
+
<p>".__('By default WordPress let\'s you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>', $this->textdomain)."</p>
|
2914 |
+
<p>".__('Perfect for sorting your articles, media files, comments, links and users', $this->textdomain).".</p>
|
2915 |
+
<img src='" . $this->plugin_url('/assets/images/addon_sortable_1.png') . "' alt='' />
|
2916 |
+
{$find_out_more}
|
2917 |
+
";
|
2918 |
+
|
2919 |
+
// markup
|
2920 |
+
$sortable = "
|
2921 |
+
<tr id='cpac-activation-sortable' class='last'>
|
2922 |
+
<td class='activation_type'>
|
2923 |
+
<span>" . __('Sortorder', $this->textdomain) . "</span>
|
2924 |
+
<div class='cpac-tooltip hidden'>
|
2925 |
+
<div class='qtip_title'>" . __('Sortorder', $this->textdomain) . "</div>
|
2926 |
+
<div class='qtip_content'>
|
2927 |
+
<p>" . __($sortable_tooltip, $this->textdomain) . "</p>
|
2928 |
+
</div>
|
2929 |
+
</div>
|
2930 |
+
</td>
|
2931 |
+
<td class='activation_status'>
|
2932 |
+
<div class='activate{$class_sortorder_activate}'>
|
2933 |
+
" . __('Inactive', $this->textdomain) . "
|
2934 |
+
</div>
|
2935 |
+
<div class='deactivate{$class_sortorder_deactivate}'>
|
2936 |
+
" . __('Active', $this->textdomain) . "
|
2937 |
+
</div>
|
2938 |
+
</td>
|
2939 |
+
<td class='activation_code'>
|
2940 |
+
<div class='activate{$class_sortorder_activate}'>
|
2941 |
+
<input type='text' value='" . __('Fill in your activation code', $this->textdomain) . "' name='cpac-sortable-key'>
|
2942 |
+
<a href='javascript:;' class='button'>" . __('Activate', $this->textdomain) . "<span></span></a>
|
2943 |
+
</div>
|
2944 |
+
<div class='deactivate{$class_sortorder_deactivate}'>
|
2945 |
+
<span class='masked_key'>{$masked_key}</span>
|
2946 |
+
<a href='javascript:;' class='button'>" . __('Deactivate', $this->textdomain) . "<span></span></a>
|
2947 |
+
</div>
|
2948 |
+
<div class='activation-error-msg'></div>
|
2949 |
+
</td>
|
2950 |
+
<td class='activation_more'>{$find_out_more}</td>
|
2951 |
+
</tr><!-- #cpac-activation-sortable -->
|
2952 |
+
";
|
2953 |
+
|
2954 |
+
// settings
|
2955 |
+
$row = "
|
2956 |
+
<tr id='cpac-box-plugin_settings' valign='top' class='cpac-box-row {$class_current_settings}'>
|
2957 |
+
<td colspan='2'>
|
2958 |
+
<table class='nopadding'>
|
2959 |
+
<tr class='last'>
|
2960 |
+
<td>
|
2961 |
+
<h2>".__('Activate Add-ons', $this->textdomain)."</h2>
|
2962 |
+
<p>".__('Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites', $this->textdomain)." <a target='_blank' href='{$this->codepress_url}/sortorder-addon/'>Visit the Plugin Store</a>.</p>
|
2963 |
+
<table class='widefat addons'>
|
2964 |
+
<thead>
|
2965 |
+
<tr>
|
2966 |
+
<th class='activation_type'>".__('Addon', $this->textdomain)."</th>
|
2967 |
+
<th class='activation_status'>".__('Status', $this->textdomain)."</th>
|
2968 |
+
<th class='activation_code'>".__('Activation Code', $this->textdomain)."</th>
|
2969 |
+
<th class='activation_more'></th>
|
2970 |
+
</tr>
|
2971 |
+
</thead>
|
2972 |
+
<tbody>
|
2973 |
+
{$sortable}
|
2974 |
+
</tbody>
|
2975 |
+
</table>
|
2976 |
+
<div class='addon-translation-string hidden'>
|
2977 |
+
<span class='tstring-fill-in'>" . __('Enter your activation code', $this->textdomain) . "</span>
|
2978 |
+
<span class='tstring-unrecognised'>" . __('Activation code unrecognised', $this->textdomain) . "</span>
|
2979 |
+
</div>
|
2980 |
+
</td>
|
2981 |
+
</tr>
|
2982 |
+
<!--
|
2983 |
+
<tr class='last'>
|
2984 |
+
<td colspan='2'>
|
2985 |
+
<h2>Options</h2>
|
2986 |
+
<ul class='cpac-options'>
|
2987 |
+
<li>
|
2988 |
+
<div class='cpac-option-label'>Thumbnail size</div>
|
2989 |
+
<div class='cpac-option-inputs'>
|
2990 |
+
<input type='text' id='thumbnail_size_w' class='small-text' name='cpac_options[settings][thumb_width]' value='80'/>
|
2991 |
+
<label for='thumbnail_size_w'>Width</label>
|
2992 |
+
<br/>
|
2993 |
+
<input type='text' id='thumbnail_size_h' class='small-text' name='cpac_options[settings][thumb_height]' value='80'/>
|
2994 |
+
<label for='thumbnail_size_h'>Height</label>
|
2995 |
+
</div>
|
2996 |
+
</li>
|
2997 |
+
<li>
|
2998 |
+
<div class='cpac-option-label'>Excerpt length</div>
|
2999 |
+
<div class='cpac-option-inputs'>
|
3000 |
+
|
3001 |
+
<input type='text' id='excerpt_length' class='small-text' name='cpac_options[settings][excerpt_length]' value='15'/>
|
3002 |
+
<label for='excerpt_length'>Number of words</label>
|
3003 |
+
</div>
|
3004 |
+
</li>
|
3005 |
+
</ul>
|
3006 |
+
</td>
|
3007 |
+
</tr>
|
3008 |
+
-->
|
3009 |
+
</table>
|
3010 |
+
</td>
|
3011 |
+
</tr><!-- #cpac-box-plugin_settings -->
|
3012 |
+
";
|
3013 |
+
|
3014 |
+
return $row;
|
3015 |
+
}
|
3016 |
+
|
3017 |
+
/**
|
3018 |
+
* Settings Page Template.
|
3019 |
+
*
|
3020 |
+
* This function in conjunction with others usei the WordPress
|
3021 |
+
* Settings API to create a settings page where users can adjust
|
3022 |
+
* the behaviour of this plugin.
|
3023 |
*
|
3024 |
* @since 1.0
|
3025 |
*/
|
3026 |
+
public function plugin_settings_page()
|
3027 |
+
{
|
3028 |
+
|
3029 |
+
// loop through post types
|
3030 |
+
$rows = '';
|
3031 |
+
foreach ( $this->get_types() as $type ) {
|
3032 |
|
3033 |
+
// post type label
|
3034 |
+
$label = $this->get_singular_name($type);
|
3035 |
+
|
3036 |
+
// screen link
|
3037 |
+
$screen_link = '';
|
3038 |
+
//$screen_link = $this->get_type_screen_link($type);
|
3039 |
+
//$screen_link = "<a href='{$screen_link}' class='go-to-screen'>" . sprintf( __('go to %s screen'), strtolower($label) ) . "</a>";
|
3040 |
+
|
3041 |
+
// id
|
3042 |
+
$id = $this->sanitize_string($type);
|
3043 |
+
|
3044 |
+
// build draggable boxes
|
3045 |
+
$boxes = $this->get_column_boxes($type);
|
3046 |
+
|
3047 |
+
// class
|
3048 |
+
$class = $this->is_menu_type_current($type) ? ' current' : ' hidden';
|
3049 |
+
|
3050 |
+
$rows .= "
|
3051 |
+
<tr id='cpac-box-{$id}' valign='top' class='cpac-box-row{$class}'>
|
3052 |
+
<th class='cpac_post_type' scope='row'>
|
3053 |
+
{$label}{$screen_link}
|
3054 |
+
</th>
|
3055 |
+
<td>
|
3056 |
+
<h3 class='cpac_post_type hidden'>{$label}</h3>
|
3057 |
+
{$boxes}
|
3058 |
+
</td>
|
3059 |
+
</tr>
|
3060 |
+
";
|
3061 |
+
}
|
3062 |
+
|
3063 |
+
// Activation
|
3064 |
+
$activation_settings = $this->activation_settings();
|
3065 |
+
|
3066 |
+
// Post Type Menu
|
3067 |
+
$menu = $this->get_menu();
|
3068 |
|
3069 |
+
// Help screen message
|
3070 |
+
$help_text = '';
|
3071 |
+
if ( version_compare( get_bloginfo('version'), '3.2', '>' ) )
|
3072 |
+
$help_text = '<p>'.__('You will find a short overview at the <strong>Help</strong> section in the top-right screen.', $this->textdomain).'</p>';
|
3073 |
+
|
3074 |
+
// find out more
|
3075 |
+
$find_out_more = "<a href='{$this->codepress_url}/sortorder-addon/' class='alignright green' target='_blank'>".__('find out more', $this->textdomain)." »</a>";
|
3076 |
+
|
3077 |
+
?>
|
3078 |
+
<div id="cpac" class="wrap">
|
3079 |
+
<?php screen_icon($this->slug) ?>
|
3080 |
+
<h2><?php _e('Codepress Admin Columns', $this->textdomain); ?></h2>
|
3081 |
+
<?php echo $menu ?>
|
3082 |
|
3083 |
+
<div class="postbox-container cpac-col-right">
|
3084 |
+
<div class="metabox-holder">
|
3085 |
+
<div class="meta-box-sortables">
|
3086 |
+
|
3087 |
+
<div id="addons-cpac-settings" class="postbox">
|
3088 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
3089 |
+
<h3 class="hndle">
|
3090 |
+
<span><?php _e('Addons', $this->textdomain) ?></span>
|
3091 |
+
</h3>
|
3092 |
+
<div class="inside">
|
3093 |
+
<p><?php _e('By default WordPress let\'s you only sort by title, date, comments and author.', $this->textdomain) ?></p>
|
3094 |
+
<p><?php _e('Make <strong>all columns</strong> of <strong>all types</strong> support sorting — with the sorting addon.', $this->textdomain) ?></p>
|
3095 |
+
<?php echo $find_out_more ?>
|
3096 |
+
</div>
|
3097 |
+
</div><!-- addons-cpac-settings -->
|
3098 |
+
|
3099 |
+
<div id="likethisplugin-cpac-settings" class="postbox">
|
3100 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
3101 |
+
<h3 class="hndle">
|
3102 |
+
<span><?php _e('Like this plugin?', $this->textdomain) ?></span>
|
3103 |
+
</h3>
|
3104 |
+
<div class="inside">
|
3105 |
+
<p><?php _e('Why not do any or all of the following', $this->textdomain) ?>:</p>
|
3106 |
+
<ul>
|
3107 |
+
<li><a href="<?php echo $this->codepress_url ?>/"><?php _e('Link to it so other folks can find out about it.', $this->textdomain) ?></a></li>
|
3108 |
+
<li><a href="<?php echo $this->wordpress_url ?>"><?php _e('Give it a 5 star rating on WordPress.org.', $this->textdomain) ?></a></li>
|
3109 |
+
<li class="donate_link"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZDZRSYLQ4Z76J"><?php _e('Donate a token of your appreciation.', $this->textdomain) ?></a></li>
|
3110 |
+
</ul>
|
3111 |
+
</div>
|
3112 |
+
</div><!-- likethisplugin-cpac-settings -->
|
3113 |
+
|
3114 |
+
<div id="side-cpac-settings" class="postbox">
|
3115 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
3116 |
+
<h3 class="hndle">
|
3117 |
+
<span><?php _e('Need support?', $this->textdomain) ?></span>
|
3118 |
+
</h3>
|
3119 |
+
<div class="inside">
|
3120 |
+
<?php echo $help_text ?>
|
3121 |
+
<p><?php printf(__('If you are having problems with this plugin, please talk about them in the <a href="%s">Support forums</a> or send me an email %s.', $this->textdomain), 'http://wordpress.org/tags/codepress-admin-columns', '<a href="mailto:info@codepress.nl">info@codepress.nl</a>' );?></p>
|
3122 |
+
<p><?php printf(__("If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>.", $this->textdomain), "{$this->codepress_url}/feedback");?></p>
|
3123 |
+
</div>
|
3124 |
+
</div><!-- side-cpac-settings -->
|
3125 |
+
|
3126 |
+
</div>
|
3127 |
+
</div>
|
3128 |
+
</div><!-- .postbox-container -->
|
3129 |
+
|
3130 |
+
<div class="postbox-container cpac-col-left">
|
3131 |
+
<div class="metabox-holder">
|
3132 |
+
<div class="meta-box-sortables">
|
3133 |
+
|
3134 |
+
<div id="general-cpac-settings" class="postbox">
|
3135 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
3136 |
+
<h3 class="hndle">
|
3137 |
+
<span><?php _e('Admin Columns', $this->textdomain ); ?></span>
|
3138 |
+
</h3>
|
3139 |
+
<div class="inside">
|
3140 |
+
<form method="post" action="options.php">
|
3141 |
+
|
3142 |
+
<?php settings_fields( 'cpac-settings-group' ); ?>
|
3143 |
+
|
3144 |
+
<table class="form-table">
|
3145 |
+
<!-- columns -->
|
3146 |
+
<?php echo $rows; ?>
|
3147 |
+
|
3148 |
+
<!-- activation -->
|
3149 |
+
<?php echo $activation_settings; ?>
|
3150 |
+
|
3151 |
+
<tr class="bottom" valign="top">
|
3152 |
+
<th scope="row"></th>
|
3153 |
+
<td>
|
3154 |
+
<p class="submit">
|
3155 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
3156 |
+
</p>
|
3157 |
+
</td>
|
3158 |
+
</tr>
|
3159 |
+
</table>
|
3160 |
+
</form>
|
3161 |
+
</div>
|
3162 |
+
</div><!-- general-settings -->
|
3163 |
+
|
3164 |
+
<div id="restore-cpac-settings" class="postbox">
|
3165 |
+
<div title="Click to toggle" class="handlediv"><br></div>
|
3166 |
+
<h3 class="hndle">
|
3167 |
+
<span><?php _e('Restore defaults', $this->textdomain) ?></span>
|
3168 |
+
</h3>
|
3169 |
+
<div class="inside">
|
3170 |
+
<form method="post" action="">
|
3171 |
+
<input type="submit" class="button" name="cpac-restore-defaults" value="<?php _e('Restore default settings', $this->textdomain ) ?>" onclick="return confirm('<?php _e("Warning! ALL saved admin columns data will be deleted. This cannot be undone. \'OK\' to delete, \'Cancel\' to stop", $this->textdomain); ?>');" />
|
3172 |
+
</form>
|
3173 |
+
<p class="description"><?php _e('This will delete all column settings and restore the default settings.', $this->textdomain); ?></p>
|
3174 |
+
</div>
|
3175 |
+
</div><!-- restore-cpac-settings -->
|
3176 |
+
|
3177 |
+
</div>
|
3178 |
+
</div>
|
3179 |
+
</div><!-- .postbox-container -->
|
3180 |
+
</div>
|
3181 |
+
<?php
|
3182 |
+
}
|
3183 |
}
|
3184 |
+
|
3185 |
+
/**
|
3186 |
+
* Init Class Codepress_Admin_Columns
|
3187 |
+
*
|
3188 |
+
* @since 1.0
|
3189 |
+
*/
|
3190 |
+
new Codepress_Admin_Columns();
|
3191 |
+
|
3192 |
+
|
3193 |
+
/**
|
3194 |
+
* Init Class Codepress_Sortable_Columns
|
3195 |
+
*
|
3196 |
+
* @since 1.3
|
3197 |
+
*/
|
3198 |
+
new Codepress_Sortable_Columns();
|
3199 |
+
|
3200 |
?>
|
languages/codepress-admin-columns-nl_NL.mo
CHANGED
Binary file
|
languages/codepress-admin-columns-nl_NL.po
CHANGED
@@ -2,9 +2,9 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Codepress Admin Columns\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
"Language-Team: Codepress <info@codepress.nl>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
@@ -17,292 +17,442 @@ msgstr ""
|
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPath-1: ..\n"
|
19 |
|
20 |
-
#: ../codepress-admin-columns.php:
|
21 |
msgid "Settings"
|
22 |
msgstr "Instellingen"
|
23 |
|
24 |
-
#: ../codepress-admin-columns.php:
|
25 |
-
msgid "
|
26 |
-
msgstr ""
|
27 |
|
28 |
-
#: ../codepress-admin-columns.php:
|
29 |
-
msgid "
|
30 |
-
msgstr ""
|
31 |
|
32 |
-
#: ../codepress-admin-columns.php:
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
#: ../codepress-admin-columns.php:261
|
37 |
-
msgid "Restore defaults"
|
38 |
msgstr "Herstel instellingen"
|
39 |
|
40 |
-
#: ../codepress-admin-columns.php:
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
#: ../codepress-admin-columns.php:265
|
45 |
-
msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
|
46 |
-
msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
|
47 |
-
|
48 |
-
#: ../codepress-admin-columns.php:267
|
49 |
-
msgid "This will delete all column settings and restore the default settings."
|
50 |
-
msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
|
51 |
-
|
52 |
-
#: ../codepress-admin-columns.php:282
|
53 |
-
msgid "Need support?"
|
54 |
-
msgstr "Hulp nodig?"
|
55 |
-
|
56 |
-
#: ../codepress-admin-columns.php:285
|
57 |
-
#, php-format
|
58 |
-
msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a>."
|
59 |
-
msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a>."
|
60 |
-
|
61 |
-
#: ../codepress-admin-columns.php:286
|
62 |
-
#, php-format
|
63 |
-
msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
|
64 |
-
msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
|
65 |
-
|
66 |
-
#: ../codepress-admin-columns.php:324
|
67 |
-
msgid "Add Custom Field Column"
|
68 |
-
msgstr "Voeg custom field kolom toe"
|
69 |
|
70 |
-
#: ../codepress-admin-columns.php:
|
71 |
msgid "Default"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: ../codepress-admin-columns.php:
|
75 |
-
#: ../codepress-admin-columns.php:
|
76 |
msgid "Image"
|
77 |
msgstr "Afbeelding"
|
78 |
|
79 |
-
#: ../codepress-admin-columns.php:
|
80 |
msgid "Media Library Icon"
|
81 |
msgstr "Media bibliotheek Icoon"
|
82 |
|
83 |
-
#: ../codepress-admin-columns.php:
|
84 |
-
#: ../codepress-admin-columns.php:
|
85 |
-
#: ../codepress-admin-columns.php:
|
86 |
msgid "Excerpt"
|
87 |
msgstr "Samenvatting"
|
88 |
|
89 |
-
#: ../codepress-admin-columns.php:
|
90 |
msgid "Multiple Values"
|
91 |
msgstr "Meerdere waarden"
|
92 |
|
93 |
-
#: ../codepress-admin-columns.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
msgid "This field can not be removed"
|
95 |
msgstr "Dit veld kan niet worden verwijderd"
|
96 |
|
97 |
-
#: ../codepress-admin-columns.php:
|
98 |
msgid "Remove"
|
99 |
msgstr "Verwijder"
|
100 |
|
101 |
-
#: ../codepress-admin-columns.php:
|
102 |
msgid "Standard"
|
103 |
msgstr "Standaard"
|
104 |
|
105 |
-
#: ../codepress-admin-columns.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
msgid "Comments"
|
107 |
msgstr "Reacties"
|
108 |
|
109 |
-
#: ../codepress-admin-columns.php:
|
110 |
-
msgid "
|
111 |
-
msgstr ""
|
112 |
|
113 |
-
#: ../codepress-admin-columns.php:
|
114 |
msgid "Featured Image"
|
115 |
msgstr "Uitgelichte afbeelding"
|
116 |
|
117 |
-
#: ../codepress-admin-columns.php:
|
118 |
-
#: ../codepress-admin-columns.php:
|
119 |
-
msgid "Sticky"
|
120 |
-
msgstr "Sticky"
|
121 |
-
|
122 |
-
#: ../codepress-admin-columns.php:1107
|
123 |
msgid "Page Order"
|
124 |
msgstr "Pagina Volgorde"
|
125 |
|
126 |
-
#: ../codepress-admin-columns.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
msgid "Order"
|
128 |
msgstr "Volgorde"
|
129 |
|
130 |
-
#: ../codepress-admin-columns.php:
|
131 |
-
#: ../codepress-admin-columns.php:1121
|
132 |
msgid "Page Template"
|
133 |
msgstr "Pagina Template"
|
134 |
|
135 |
-
#: ../codepress-admin-columns.php:
|
136 |
-
|
137 |
-
msgid "Post Format"
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: ../codepress-admin-columns.php:
|
141 |
-
|
|
|
|
|
142 |
msgstr ""
|
143 |
|
144 |
-
#: ../codepress-admin-columns.php:
|
145 |
-
#: ../codepress-admin-columns.php:
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: ../codepress-admin-columns.php:
|
150 |
-
|
151 |
-
msgid "Attachment"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: ../codepress-admin-columns.php:
|
155 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: ../codepress-admin-columns.php:
|
159 |
-
msgid "
|
160 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
-
|
163 |
-
|
|
|
164 |
|
165 |
-
|
166 |
-
|
|
|
167 |
|
168 |
-
|
169 |
-
|
|
|
170 |
|
171 |
-
|
172 |
-
|
|
|
173 |
|
174 |
-
|
175 |
-
|
|
|
176 |
|
177 |
-
|
178 |
-
|
|
|
179 |
|
180 |
-
|
181 |
-
|
|
|
182 |
|
183 |
-
|
184 |
-
|
|
|
185 |
|
186 |
-
|
187 |
-
|
|
|
188 |
|
189 |
-
|
190 |
-
|
|
|
191 |
|
192 |
-
|
193 |
-
|
|
|
194 |
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
197 |
|
198 |
-
|
199 |
-
|
|
|
|
|
200 |
|
201 |
-
|
202 |
-
|
|
|
203 |
|
204 |
-
|
205 |
-
|
|
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
#~ msgstr ""
|
211 |
-
#~ "We konden geen gecode resultaten vinden voor de volgende%s berichten, pas "
|
212 |
-
#~ "deze handmatig aan wanneer nodig."
|
213 |
|
214 |
-
|
215 |
-
|
|
|
|
|
216 |
|
217 |
-
|
218 |
-
|
|
|
|
|
219 |
|
220 |
-
|
221 |
-
|
|
|
222 |
|
223 |
-
|
224 |
-
|
|
|
225 |
|
226 |
-
|
227 |
-
|
|
|
|
|
228 |
|
229 |
-
|
230 |
-
|
|
|
|
|
231 |
|
232 |
-
|
233 |
-
|
|
|
|
|
234 |
|
235 |
-
|
236 |
-
|
|
|
237 |
|
238 |
-
|
239 |
-
|
|
|
240 |
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
#~ "verwijderen."
|
245 |
|
246 |
-
|
247 |
-
|
|
|
248 |
|
249 |
-
|
250 |
-
|
|
|
251 |
|
252 |
-
|
253 |
-
|
|
|
254 |
|
255 |
-
|
256 |
-
|
|
|
257 |
|
258 |
-
|
259 |
-
|
|
|
260 |
|
261 |
-
|
262 |
-
|
|
|
263 |
|
264 |
-
|
265 |
-
|
|
|
266 |
|
267 |
-
|
268 |
-
|
|
|
269 |
|
270 |
-
|
271 |
-
|
|
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
#~ msgstr ""
|
277 |
-
#~ "Het ons veel uren werken gekost om deze plugin te ontwikkelen, als je het "
|
278 |
-
#~ "gebruikt, doneer a.u.b. voor je waardering!"
|
279 |
|
280 |
-
|
281 |
-
|
|
|
282 |
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
-
|
287 |
-
|
|
|
|
|
288 |
|
289 |
-
|
290 |
-
|
|
|
291 |
|
292 |
-
|
293 |
-
|
|
|
294 |
|
295 |
-
|
296 |
-
|
|
|
297 |
|
298 |
-
|
299 |
-
|
|
|
300 |
|
301 |
-
|
302 |
-
|
|
|
303 |
|
304 |
-
|
305 |
-
|
|
|
306 |
|
307 |
-
#~ msgid "Configuration"
|
308 |
-
#~ msgstr "Configuratie"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Codepress Admin Columns\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-03-27 12:13+0100\n"
|
6 |
+
"PO-Revision-Date: 2012-04-20 21:13+0100\n"
|
7 |
+
"Last-Translator: Codepress <info@codepress.nl>\n"
|
8 |
"Language-Team: Codepress <info@codepress.nl>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPath-1: ..\n"
|
19 |
|
20 |
+
#: ../codepress-admin-columns.php:171
|
21 |
msgid "Settings"
|
22 |
msgstr "Instellingen"
|
23 |
|
24 |
+
#: ../codepress-admin-columns.php:363
|
25 |
+
msgid "Add Custom Field Column"
|
26 |
+
msgstr "Voeg custom field kolom toe"
|
27 |
|
28 |
+
#: ../codepress-admin-columns.php:371
|
29 |
+
msgid "drag and drop to reorder"
|
30 |
+
msgstr "sleep om de volgorde te veranderen"
|
31 |
|
32 |
+
#: ../codepress-admin-columns.php:511
|
33 |
+
#: ../codepress-admin-columns.php:536
|
34 |
+
#, fuzzy
|
35 |
+
msgid "default"
|
|
|
|
|
36 |
msgstr "Herstel instellingen"
|
37 |
|
38 |
+
#: ../codepress-admin-columns.php:534
|
39 |
+
#: ../codepress-admin-columns.php:2125
|
40 |
+
msgid "Width"
|
41 |
+
msgstr "Breedte"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
#: ../codepress-admin-columns.php:593
|
44 |
msgid "Default"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: ../codepress-admin-columns.php:594
|
48 |
+
#: ../codepress-admin-columns.php:2165
|
49 |
msgid "Image"
|
50 |
msgstr "Afbeelding"
|
51 |
|
52 |
+
#: ../codepress-admin-columns.php:595
|
53 |
msgid "Media Library Icon"
|
54 |
msgstr "Media bibliotheek Icoon"
|
55 |
|
56 |
+
#: ../codepress-admin-columns.php:596
|
57 |
+
#: ../codepress-admin-columns.php:1935
|
58 |
+
#: ../codepress-admin-columns.php:2237
|
59 |
msgid "Excerpt"
|
60 |
msgstr "Samenvatting"
|
61 |
|
62 |
+
#: ../codepress-admin-columns.php:597
|
63 |
msgid "Multiple Values"
|
64 |
msgstr "Meerdere waarden"
|
65 |
|
66 |
+
#: ../codepress-admin-columns.php:598
|
67 |
+
msgid "Numeric"
|
68 |
+
msgstr "Numerieke"
|
69 |
+
|
70 |
+
#: ../codepress-admin-columns.php:599
|
71 |
+
#: ../codepress-admin-columns.php:2228
|
72 |
+
msgid "Date"
|
73 |
+
msgstr "Datum"
|
74 |
+
|
75 |
+
#: ../codepress-admin-columns.php:600
|
76 |
+
msgid "Post Title (Post ID's)"
|
77 |
+
msgstr "Post Titel (Post ID's)"
|
78 |
+
|
79 |
+
#: ../codepress-admin-columns.php:625
|
80 |
msgid "This field can not be removed"
|
81 |
msgstr "Dit veld kan niet worden verwijderd"
|
82 |
|
83 |
+
#: ../codepress-admin-columns.php:629
|
84 |
msgid "Remove"
|
85 |
msgstr "Verwijder"
|
86 |
|
87 |
+
#: ../codepress-admin-columns.php:974
|
88 |
msgid "Standard"
|
89 |
msgstr "Standaard"
|
90 |
|
91 |
+
#: ../codepress-admin-columns.php:1193
|
92 |
+
msgid "original"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: ../codepress-admin-columns.php:1365
|
96 |
+
#: ../codepress-admin-columns.php:1376
|
97 |
+
#, php-format
|
98 |
+
msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
|
99 |
+
msgstr "Verstuurd op <a href=\"%1$s\">%2$s op %3$s</a>"
|
100 |
+
|
101 |
+
#: ../codepress-admin-columns.php:1901
|
102 |
msgid "Comments"
|
103 |
msgstr "Reacties"
|
104 |
|
105 |
+
#: ../codepress-admin-columns.php:1907
|
106 |
+
msgid "Icon"
|
107 |
+
msgstr "icoon"
|
108 |
|
109 |
+
#: ../codepress-admin-columns.php:1932
|
110 |
msgid "Featured Image"
|
111 |
msgstr "Uitgelichte afbeelding"
|
112 |
|
113 |
+
#: ../codepress-admin-columns.php:1938
|
114 |
+
#: ../codepress-admin-columns.php:1980
|
|
|
|
|
|
|
|
|
115 |
msgid "Page Order"
|
116 |
msgstr "Pagina Volgorde"
|
117 |
|
118 |
+
#: ../codepress-admin-columns.php:1941
|
119 |
+
#: ../codepress-admin-columns.php:1997
|
120 |
+
msgid "Post Format"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: ../codepress-admin-columns.php:1944
|
124 |
+
#: ../codepress-admin-columns.php:2110
|
125 |
+
#: ../codepress-admin-columns.php:2159
|
126 |
+
#: ../codepress-admin-columns.php:2199
|
127 |
+
msgid "ID"
|
128 |
+
msgstr "ID"
|
129 |
+
|
130 |
+
#: ../codepress-admin-columns.php:1947
|
131 |
+
msgid "Slug"
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: ../codepress-admin-columns.php:1950
|
135 |
+
msgid "Attachment"
|
136 |
+
msgstr "Bijlage"
|
137 |
+
|
138 |
+
#: ../codepress-admin-columns.php:1953
|
139 |
+
msgid "No. of Attachments"
|
140 |
+
msgstr "Aantal attachments"
|
141 |
+
|
142 |
+
#: ../codepress-admin-columns.php:1956
|
143 |
+
msgid "Roles"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: ../codepress-admin-columns.php:1959
|
147 |
+
#: ../codepress-admin-columns.php:2982
|
148 |
+
msgid "Status"
|
149 |
+
msgstr "Status"
|
150 |
+
|
151 |
+
#: ../codepress-admin-columns.php:1966
|
152 |
+
msgid "Word count"
|
153 |
+
msgstr "Aantal woorden"
|
154 |
+
|
155 |
+
#: ../codepress-admin-columns.php:1973
|
156 |
+
msgid "Sticky"
|
157 |
+
msgstr "Sticky"
|
158 |
+
|
159 |
+
#: ../codepress-admin-columns.php:1982
|
160 |
msgid "Order"
|
161 |
msgstr "Volgorde"
|
162 |
|
163 |
+
#: ../codepress-admin-columns.php:1990
|
|
|
164 |
msgid "Page Template"
|
165 |
msgstr "Pagina Template"
|
166 |
|
167 |
+
#: ../codepress-admin-columns.php:2009
|
168 |
+
msgid "Taxonomy"
|
|
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: ../codepress-admin-columns.php:2020
|
172 |
+
#: ../codepress-admin-columns.php:2084
|
173 |
+
#: ../codepress-admin-columns.php:2244
|
174 |
+
msgid "Custom Field"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: ../codepress-admin-columns.php:2026
|
178 |
+
#: ../codepress-admin-columns.php:2090
|
179 |
+
#: ../codepress-admin-columns.php:2250
|
180 |
+
msgid "Field"
|
181 |
+
msgstr "Veld"
|
182 |
+
|
183 |
+
#: ../codepress-admin-columns.php:2047
|
184 |
+
msgid "User ID"
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: ../codepress-admin-columns.php:2050
|
188 |
+
msgid "Nickname"
|
|
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: ../codepress-admin-columns.php:2053
|
192 |
+
msgid "First name"
|
193 |
+
msgstr "Voornaam"
|
194 |
+
|
195 |
+
#: ../codepress-admin-columns.php:2056
|
196 |
+
msgid "Last name"
|
197 |
+
msgstr "Achternaam"
|
198 |
+
|
199 |
+
#: ../codepress-admin-columns.php:2059
|
200 |
+
msgid "Url"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: ../codepress-admin-columns.php:2062
|
204 |
+
msgid "Registered"
|
205 |
+
msgstr "Registratie"
|
206 |
+
|
207 |
+
#: ../codepress-admin-columns.php:2065
|
208 |
+
#: ../codepress-admin-columns.php:2131
|
209 |
+
#: ../codepress-admin-columns.php:2162
|
210 |
+
msgid "Description"
|
211 |
+
msgstr "Beschrijving"
|
212 |
+
|
213 |
+
#: ../codepress-admin-columns.php:2076
|
214 |
+
#, fuzzy
|
215 |
+
msgid "Postcount"
|
216 |
+
msgstr "Aantal woorden"
|
217 |
+
|
218 |
+
#: ../codepress-admin-columns.php:2113
|
219 |
+
msgid "Mime type"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: ../codepress-admin-columns.php:2116
|
223 |
+
#, fuzzy
|
224 |
+
msgid "File name"
|
225 |
+
msgstr "Voornaam"
|
226 |
+
|
227 |
+
#: ../codepress-admin-columns.php:2119
|
228 |
+
msgid "Dimensions"
|
229 |
+
msgstr "Afmetingen"
|
230 |
+
|
231 |
+
#: ../codepress-admin-columns.php:2122
|
232 |
+
msgid "Height"
|
233 |
+
msgstr "Hoogte"
|
234 |
+
|
235 |
+
#: ../codepress-admin-columns.php:2128
|
236 |
+
#, fuzzy
|
237 |
+
msgid "Caption"
|
238 |
+
msgstr "Locatie"
|
239 |
+
|
240 |
+
#: ../codepress-admin-columns.php:2134
|
241 |
+
msgid "Alt"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: ../codepress-admin-columns.php:2137
|
245 |
+
msgid "Upload paths"
|
246 |
+
msgstr "Bestands-URLs"
|
247 |
+
|
248 |
+
#: ../codepress-admin-columns.php:2168
|
249 |
+
msgid "Target"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: ../codepress-admin-columns.php:2171
|
253 |
+
#, fuzzy
|
254 |
+
msgid "Owner"
|
255 |
+
msgstr "Volgorde"
|
256 |
+
|
257 |
+
#: ../codepress-admin-columns.php:2174
|
258 |
+
msgid "Notes"
|
259 |
+
msgstr "Beschrijving"
|
260 |
+
|
261 |
+
#: ../codepress-admin-columns.php:2177
|
262 |
+
msgid "Rss"
|
263 |
+
msgstr ""
|
264 |
|
265 |
+
#: ../codepress-admin-columns.php:2180
|
266 |
+
msgid "Length"
|
267 |
+
msgstr "Lengte"
|
268 |
|
269 |
+
#: ../codepress-admin-columns.php:2202
|
270 |
+
msgid "Author Name"
|
271 |
+
msgstr "Auteur"
|
272 |
|
273 |
+
#: ../codepress-admin-columns.php:2205
|
274 |
+
msgid "Avatar"
|
275 |
+
msgstr ""
|
276 |
|
277 |
+
#: ../codepress-admin-columns.php:2208
|
278 |
+
msgid "Author url"
|
279 |
+
msgstr "Auteurs url"
|
280 |
|
281 |
+
#: ../codepress-admin-columns.php:2211
|
282 |
+
msgid "Author IP"
|
283 |
+
msgstr "Auteur IP"
|
284 |
|
285 |
+
#: ../codepress-admin-columns.php:2214
|
286 |
+
msgid "Author email"
|
287 |
+
msgstr "Auteurs email"
|
288 |
|
289 |
+
#: ../codepress-admin-columns.php:2217
|
290 |
+
msgid "In Reply To"
|
291 |
+
msgstr ""
|
292 |
|
293 |
+
#: ../codepress-admin-columns.php:2225
|
294 |
+
msgid "Approved"
|
295 |
+
msgstr "Geodgekeurd"
|
296 |
|
297 |
+
#: ../codepress-admin-columns.php:2231
|
298 |
+
msgid "Date GMT"
|
299 |
+
msgstr ""
|
300 |
|
301 |
+
#: ../codepress-admin-columns.php:2234
|
302 |
+
msgid "Agent"
|
303 |
+
msgstr ""
|
304 |
|
305 |
+
#: ../codepress-admin-columns.php:2280
|
306 |
+
msgid "Custom"
|
307 |
+
msgstr ""
|
308 |
|
309 |
+
#: ../codepress-admin-columns.php:2357
|
310 |
+
#: ../codepress-admin-columns.php:3105
|
311 |
+
#, fuzzy
|
312 |
+
msgid "Addons"
|
313 |
+
msgstr "Adres"
|
314 |
|
315 |
+
#: ../codepress-admin-columns.php:2923
|
316 |
+
#: ../codepress-admin-columns.php:3090
|
317 |
+
msgid "find out more"
|
318 |
+
msgstr "meer informatie"
|
319 |
|
320 |
+
#: ../codepress-admin-columns.php:2927
|
321 |
+
msgid "This will make all of the new columns support sorting"
|
322 |
+
msgstr "Dit maakt dat sorteren ondersteund wordt door alle nieuwe kolommen"
|
323 |
|
324 |
+
#: ../codepress-admin-columns.php:2928
|
325 |
+
msgid "By default WordPress let's you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>"
|
326 |
+
msgstr "Standaard laat WordPress je sorteren bij titel, datum, reakties en auteur. De addon zorgt ervoor dat je kunt sorteren bij <strong>alle kolommen van alle typen!</strong>"
|
327 |
|
328 |
+
#: ../codepress-admin-columns.php:2929
|
329 |
+
msgid "Perfect for sorting your articles, media files, comments, links and users"
|
330 |
+
msgstr "Perfect voor het sorteren van je artikelen, media bestanden, reakties, links en gebruikers"
|
|
|
|
|
|
|
331 |
|
332 |
+
#: ../codepress-admin-columns.php:2938
|
333 |
+
#: ../codepress-admin-columns.php:2940
|
334 |
+
msgid "Sortorder"
|
335 |
+
msgstr ""
|
336 |
|
337 |
+
#: ../codepress-admin-columns.php:2948
|
338 |
+
#, fuzzy
|
339 |
+
msgid "Inactive"
|
340 |
+
msgstr "Actief"
|
341 |
|
342 |
+
#: ../codepress-admin-columns.php:2951
|
343 |
+
msgid "Active"
|
344 |
+
msgstr "Actief"
|
345 |
|
346 |
+
#: ../codepress-admin-columns.php:2956
|
347 |
+
msgid "Fill in your activation code"
|
348 |
+
msgstr "Vul je activatiecode in"
|
349 |
|
350 |
+
#: ../codepress-admin-columns.php:2957
|
351 |
+
#, fuzzy
|
352 |
+
msgid "Activate"
|
353 |
+
msgstr "Actief"
|
354 |
|
355 |
+
#: ../codepress-admin-columns.php:2961
|
356 |
+
#, fuzzy
|
357 |
+
msgid "Deactivate"
|
358 |
+
msgstr "Actief"
|
359 |
|
360 |
+
#: ../codepress-admin-columns.php:2976
|
361 |
+
#, fuzzy
|
362 |
+
msgid "Activate Add-ons"
|
363 |
+
msgstr "Activeer Google Maps"
|
364 |
|
365 |
+
#: ../codepress-admin-columns.php:2977
|
366 |
+
msgid "Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites"
|
367 |
+
msgstr "Addons kunnen worden geactiveerd door een licentie sleutel aan te schaffen. De licentie sleutel kan gebruikt worden voor meerdere websites"
|
368 |
|
369 |
+
#: ../codepress-admin-columns.php:2981
|
370 |
+
msgid "Addon"
|
371 |
+
msgstr ""
|
372 |
|
373 |
+
#: ../codepress-admin-columns.php:2983
|
374 |
+
msgid "Activation Code"
|
375 |
+
msgstr "Activatie code"
|
|
|
376 |
|
377 |
+
#: ../codepress-admin-columns.php:2992
|
378 |
+
msgid "Enter your activation code"
|
379 |
+
msgstr "Vul je activatie code in"
|
380 |
|
381 |
+
#: ../codepress-admin-columns.php:2993
|
382 |
+
msgid "Activation code unrecognised"
|
383 |
+
msgstr "Activatie code niet herkend"
|
384 |
|
385 |
+
#: ../codepress-admin-columns.php:3087
|
386 |
+
msgid "You will find a short overview at the <strong>Help</strong> section in the top-right screen."
|
387 |
+
msgstr "Je vindt een korte samenvatting in de <strong>Help</strong> sectie in de rechter bovenkant van het scherm."
|
388 |
|
389 |
+
#: ../codepress-admin-columns.php:3095
|
390 |
+
msgid "Codepress Admin Columns"
|
391 |
+
msgstr ""
|
392 |
|
393 |
+
#: ../codepress-admin-columns.php:3108
|
394 |
+
msgid "By default WordPress let's you only sort by title, date, comments and author."
|
395 |
+
msgstr "Standaard laat WordPress je sorteren bij titel, datum, reakties en auteur."
|
396 |
|
397 |
+
#: ../codepress-admin-columns.php:3109
|
398 |
+
msgid "Make <strong>all columns</strong> of <strong>all types</strong> support sorting — with the sorting addon."
|
399 |
+
msgstr "Zorg ervoor dat <strong>alle kolommen</strong> van <strong>alle typen</strong> sorteren ondersteund — met de sorting addon."
|
400 |
|
401 |
+
#: ../codepress-admin-columns.php:3117
|
402 |
+
msgid "Like this plugin?"
|
403 |
+
msgstr "Leuke plugin?"
|
404 |
|
405 |
+
#: ../codepress-admin-columns.php:3120
|
406 |
+
msgid "Why not do any or all of the following"
|
407 |
+
msgstr "Waarom doe je niet één van de volgende dingen:"
|
408 |
|
409 |
+
#: ../codepress-admin-columns.php:3122
|
410 |
+
msgid "Link to it so other folks can find out about it."
|
411 |
+
msgstr "Link naar ons zodat anderen deze plugin ook ontdekken."
|
412 |
|
413 |
+
#: ../codepress-admin-columns.php:3123
|
414 |
+
msgid "Give it a 5 star rating on WordPress.org."
|
415 |
+
msgstr "Geef het een goede score op WordPress.org."
|
|
|
|
|
|
|
416 |
|
417 |
+
#: ../codepress-admin-columns.php:3124
|
418 |
+
msgid "Donate a token of your appreciation."
|
419 |
+
msgstr "Doneer een blijk van uw waardering."
|
420 |
|
421 |
+
#: ../codepress-admin-columns.php:3132
|
422 |
+
msgid "Need support?"
|
423 |
+
msgstr "Hulp nodig?"
|
424 |
+
|
425 |
+
#: ../codepress-admin-columns.php:3136
|
426 |
+
#, php-format
|
427 |
+
msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a> or send me an email %s."
|
428 |
+
msgstr "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s\">Support forums</a> of stuur me een email %s."
|
429 |
|
430 |
+
#: ../codepress-admin-columns.php:3137
|
431 |
+
#, php-format
|
432 |
+
msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
|
433 |
+
msgstr "Als een bug bent tegen gekomen, of een feature wil aanvragen, stuur ons dan <a href='%s'>je feedback</a>."
|
434 |
|
435 |
+
#: ../codepress-admin-columns.php:3152
|
436 |
+
msgid "Admin Columns"
|
437 |
+
msgstr ""
|
438 |
|
439 |
+
#: ../codepress-admin-columns.php:3170
|
440 |
+
msgid "Save Changes"
|
441 |
+
msgstr "Wijzigingen opslaan"
|
442 |
|
443 |
+
#: ../codepress-admin-columns.php:3182
|
444 |
+
msgid "Restore defaults"
|
445 |
+
msgstr "Herstel instellingen"
|
446 |
|
447 |
+
#: ../codepress-admin-columns.php:3186
|
448 |
+
msgid "Restore default settings"
|
449 |
+
msgstr "Herstel standaard instellingen"
|
450 |
|
451 |
+
#: ../codepress-admin-columns.php:3186
|
452 |
+
msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
|
453 |
+
msgstr "Waarschuwing! ALLE bewaarde instellingen worden verwijderd. Dit kan niet worden ongedaan. \\'OK\\' om te verwijderen, \\'Annuleren\\' om te stoppen"
|
454 |
|
455 |
+
#: ../codepress-admin-columns.php:3188
|
456 |
+
msgid "This will delete all column settings and restore the default settings."
|
457 |
+
msgstr "Hiermee worden alle kolommen instellingen verwijderd en de standaardinstellingen hersteld."
|
458 |
|
|
|
|
languages/codepress-admin-columns-pl_PL.mo
ADDED
Binary file
|
languages/codepress-admin-columns-pl_PL.po
ADDED
@@ -0,0 +1,567 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Codepress Admin Columns\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-03-23 13:35+0100\n"
|
6 |
+
"PO-Revision-Date: 2012-03-23 13:45+0100\n"
|
7 |
+
"Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
|
8 |
+
"Language-Team: Digital Factory <info@digitalfactory.pl>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-Language: Polish\n"
|
15 |
+
"X-Poedit-Country: POLAND\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
"X-Poedit-SearchPath-1: ..\n"
|
20 |
+
|
21 |
+
#: ../codepress-admin-columns.php:171
|
22 |
+
msgid "Settings"
|
23 |
+
msgstr "Ustawienia"
|
24 |
+
|
25 |
+
#: ../codepress-admin-columns.php:363
|
26 |
+
msgid "Add Custom Field Column"
|
27 |
+
msgstr "Dodaj kolumnę Własne pole"
|
28 |
+
|
29 |
+
#: ../codepress-admin-columns.php:371
|
30 |
+
msgid "drag and drop to reorder"
|
31 |
+
msgstr "przeciągnij i opuść aby zmienić kolejność"
|
32 |
+
|
33 |
+
#: ../codepress-admin-columns.php:511
|
34 |
+
#: ../codepress-admin-columns.php:536
|
35 |
+
msgid "default"
|
36 |
+
msgstr "domyśłny"
|
37 |
+
|
38 |
+
#: ../codepress-admin-columns.php:534
|
39 |
+
#: ../codepress-admin-columns.php:2125
|
40 |
+
msgid "Width"
|
41 |
+
msgstr "Szerokość"
|
42 |
+
|
43 |
+
#: ../codepress-admin-columns.php:593
|
44 |
+
msgid "Default"
|
45 |
+
msgstr "Domyślny"
|
46 |
+
|
47 |
+
#: ../codepress-admin-columns.php:594
|
48 |
+
#: ../codepress-admin-columns.php:2165
|
49 |
+
msgid "Image"
|
50 |
+
msgstr "Obrazek"
|
51 |
+
|
52 |
+
#: ../codepress-admin-columns.php:595
|
53 |
+
msgid "Media Library Icon"
|
54 |
+
msgstr "Ikona Biblioteki mediów"
|
55 |
+
|
56 |
+
#: ../codepress-admin-columns.php:596
|
57 |
+
#: ../codepress-admin-columns.php:1935
|
58 |
+
#: ../codepress-admin-columns.php:2237
|
59 |
+
msgid "Excerpt"
|
60 |
+
msgstr "Wypis"
|
61 |
+
|
62 |
+
#: ../codepress-admin-columns.php:597
|
63 |
+
msgid "Multiple Values"
|
64 |
+
msgstr "Wielokrotne wartości"
|
65 |
+
|
66 |
+
#: ../codepress-admin-columns.php:598
|
67 |
+
msgid "Numeric"
|
68 |
+
msgstr "Numeryczny"
|
69 |
+
|
70 |
+
#: ../codepress-admin-columns.php:599
|
71 |
+
#: ../codepress-admin-columns.php:2228
|
72 |
+
msgid "Date"
|
73 |
+
msgstr "Data"
|
74 |
+
|
75 |
+
#: ../codepress-admin-columns.php:600
|
76 |
+
msgid "Post Title (Post ID's)"
|
77 |
+
msgstr "Tytył wpisu (ID wpisu)"
|
78 |
+
|
79 |
+
#: ../codepress-admin-columns.php:625
|
80 |
+
msgid "This field can not be removed"
|
81 |
+
msgstr "To własne pole nie może być usunięte"
|
82 |
+
|
83 |
+
#: ../codepress-admin-columns.php:629
|
84 |
+
msgid "Remove"
|
85 |
+
msgstr "Usuń"
|
86 |
+
|
87 |
+
#: ../codepress-admin-columns.php:974
|
88 |
+
msgid "Standard"
|
89 |
+
msgstr "Standardowe"
|
90 |
+
|
91 |
+
#: ../codepress-admin-columns.php:1193
|
92 |
+
msgid "original"
|
93 |
+
msgstr "oryginalny"
|
94 |
+
|
95 |
+
#: ../codepress-admin-columns.php:1365
|
96 |
+
#: ../codepress-admin-columns.php:1376
|
97 |
+
#, php-format
|
98 |
+
msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
|
99 |
+
msgstr "Opublikowany dnia <a href=\"%1$s\">%2$s o godz. %3$s</a>"
|
100 |
+
|
101 |
+
#: ../codepress-admin-columns.php:1901
|
102 |
+
msgid "Comments"
|
103 |
+
msgstr "Komentarze"
|
104 |
+
|
105 |
+
#: ../codepress-admin-columns.php:1907
|
106 |
+
msgid "Icon"
|
107 |
+
msgstr "Ikona"
|
108 |
+
|
109 |
+
#: ../codepress-admin-columns.php:1932
|
110 |
+
msgid "Featured Image"
|
111 |
+
msgstr "Ikona wpisu"
|
112 |
+
|
113 |
+
#: ../codepress-admin-columns.php:1938
|
114 |
+
#: ../codepress-admin-columns.php:1980
|
115 |
+
msgid "Page Order"
|
116 |
+
msgstr "Kolejność stron"
|
117 |
+
|
118 |
+
#: ../codepress-admin-columns.php:1941
|
119 |
+
#: ../codepress-admin-columns.php:1997
|
120 |
+
msgid "Post Format"
|
121 |
+
msgstr "Format wpisu"
|
122 |
+
|
123 |
+
#: ../codepress-admin-columns.php:1944
|
124 |
+
#: ../codepress-admin-columns.php:2110
|
125 |
+
#: ../codepress-admin-columns.php:2159
|
126 |
+
#: ../codepress-admin-columns.php:2199
|
127 |
+
msgid "ID"
|
128 |
+
msgstr "ID"
|
129 |
+
|
130 |
+
#: ../codepress-admin-columns.php:1947
|
131 |
+
msgid "Slug"
|
132 |
+
msgstr "Bezpośredni odnośnik"
|
133 |
+
|
134 |
+
#: ../codepress-admin-columns.php:1950
|
135 |
+
msgid "Attachment"
|
136 |
+
msgstr "Załącznik"
|
137 |
+
|
138 |
+
#: ../codepress-admin-columns.php:1953
|
139 |
+
msgid "No. of Attachments"
|
140 |
+
msgstr "Liczba załączników"
|
141 |
+
|
142 |
+
#: ../codepress-admin-columns.php:1956
|
143 |
+
msgid "Roles"
|
144 |
+
msgstr "Role"
|
145 |
+
|
146 |
+
#: ../codepress-admin-columns.php:1959
|
147 |
+
#: ../codepress-admin-columns.php:2996
|
148 |
+
msgid "Status"
|
149 |
+
msgstr "Status"
|
150 |
+
|
151 |
+
#: ../codepress-admin-columns.php:1966
|
152 |
+
msgid "Word count"
|
153 |
+
msgstr "Liczba słów"
|
154 |
+
|
155 |
+
#: ../codepress-admin-columns.php:1973
|
156 |
+
msgid "Sticky"
|
157 |
+
msgstr "Przyklejone"
|
158 |
+
|
159 |
+
#: ../codepress-admin-columns.php:1982
|
160 |
+
msgid "Order"
|
161 |
+
msgstr "Kolejność"
|
162 |
+
|
163 |
+
#: ../codepress-admin-columns.php:1990
|
164 |
+
msgid "Page Template"
|
165 |
+
msgstr "Szablon strony"
|
166 |
+
|
167 |
+
#: ../codepress-admin-columns.php:2009
|
168 |
+
msgid "Taxonomy"
|
169 |
+
msgstr "Taksonomia"
|
170 |
+
|
171 |
+
#: ../codepress-admin-columns.php:2020
|
172 |
+
#: ../codepress-admin-columns.php:2084
|
173 |
+
#: ../codepress-admin-columns.php:2244
|
174 |
+
msgid "Custom Field"
|
175 |
+
msgstr "Własne pole"
|
176 |
+
|
177 |
+
#: ../codepress-admin-columns.php:2026
|
178 |
+
#: ../codepress-admin-columns.php:2090
|
179 |
+
#: ../codepress-admin-columns.php:2250
|
180 |
+
msgid "Field"
|
181 |
+
msgstr "Pole"
|
182 |
+
|
183 |
+
#: ../codepress-admin-columns.php:2047
|
184 |
+
msgid "User ID"
|
185 |
+
msgstr "ID użytkownika"
|
186 |
+
|
187 |
+
#: ../codepress-admin-columns.php:2050
|
188 |
+
msgid "Nickname"
|
189 |
+
msgstr "Ksywa"
|
190 |
+
|
191 |
+
#: ../codepress-admin-columns.php:2053
|
192 |
+
msgid "First name"
|
193 |
+
msgstr "Imię"
|
194 |
+
|
195 |
+
#: ../codepress-admin-columns.php:2056
|
196 |
+
msgid "Last name"
|
197 |
+
msgstr "Nazwisko"
|
198 |
+
|
199 |
+
#: ../codepress-admin-columns.php:2059
|
200 |
+
msgid "Url"
|
201 |
+
msgstr "Adres URL"
|
202 |
+
|
203 |
+
#: ../codepress-admin-columns.php:2062
|
204 |
+
msgid "Registered"
|
205 |
+
msgstr "Zarejestrowany"
|
206 |
+
|
207 |
+
#: ../codepress-admin-columns.php:2065
|
208 |
+
#: ../codepress-admin-columns.php:2131
|
209 |
+
#: ../codepress-admin-columns.php:2162
|
210 |
+
msgid "Description"
|
211 |
+
msgstr "Opis"
|
212 |
+
|
213 |
+
#: ../codepress-admin-columns.php:2076
|
214 |
+
msgid "Postcount"
|
215 |
+
msgstr "Liczba wpisów"
|
216 |
+
|
217 |
+
#: ../codepress-admin-columns.php:2113
|
218 |
+
msgid "Mime type"
|
219 |
+
msgstr "Typ pliku"
|
220 |
+
|
221 |
+
#: ../codepress-admin-columns.php:2116
|
222 |
+
msgid "File name"
|
223 |
+
msgstr "Nazwa pliku"
|
224 |
+
|
225 |
+
#: ../codepress-admin-columns.php:2119
|
226 |
+
msgid "Dimensions"
|
227 |
+
msgstr "Wymiary"
|
228 |
+
|
229 |
+
#: ../codepress-admin-columns.php:2122
|
230 |
+
msgid "Height"
|
231 |
+
msgstr "Wysokość"
|
232 |
+
|
233 |
+
#: ../codepress-admin-columns.php:2128
|
234 |
+
msgid "Caption"
|
235 |
+
msgstr "Tytuł"
|
236 |
+
|
237 |
+
#: ../codepress-admin-columns.php:2134
|
238 |
+
msgid "Alt"
|
239 |
+
msgstr "Tekst alternatywny"
|
240 |
+
|
241 |
+
#: ../codepress-admin-columns.php:2137
|
242 |
+
msgid "Upload paths"
|
243 |
+
msgstr "Ścieżki plików"
|
244 |
+
|
245 |
+
#: ../codepress-admin-columns.php:2168
|
246 |
+
msgid "Target"
|
247 |
+
msgstr "Cel"
|
248 |
+
|
249 |
+
#: ../codepress-admin-columns.php:2171
|
250 |
+
msgid "Owner"
|
251 |
+
msgstr "Właściciel"
|
252 |
+
|
253 |
+
#: ../codepress-admin-columns.php:2174
|
254 |
+
msgid "Notes"
|
255 |
+
msgstr "Notatki"
|
256 |
+
|
257 |
+
#: ../codepress-admin-columns.php:2177
|
258 |
+
msgid "Rss"
|
259 |
+
msgstr "Rss"
|
260 |
+
|
261 |
+
#: ../codepress-admin-columns.php:2180
|
262 |
+
msgid "Length"
|
263 |
+
msgstr "Długość"
|
264 |
+
|
265 |
+
#: ../codepress-admin-columns.php:2202
|
266 |
+
msgid "Author Name"
|
267 |
+
msgstr "Imię Autora"
|
268 |
+
|
269 |
+
#: ../codepress-admin-columns.php:2205
|
270 |
+
msgid "Avatar"
|
271 |
+
msgstr "Avatar"
|
272 |
+
|
273 |
+
#: ../codepress-admin-columns.php:2208
|
274 |
+
msgid "Author url"
|
275 |
+
msgstr "URL Autora"
|
276 |
+
|
277 |
+
#: ../codepress-admin-columns.php:2211
|
278 |
+
msgid "Author IP"
|
279 |
+
msgstr "IP Autora"
|
280 |
+
|
281 |
+
#: ../codepress-admin-columns.php:2214
|
282 |
+
msgid "Author email"
|
283 |
+
msgstr "Email Autora"
|
284 |
+
|
285 |
+
#: ../codepress-admin-columns.php:2217
|
286 |
+
msgid "In Reply To"
|
287 |
+
msgstr "W odpowiedzi na"
|
288 |
+
|
289 |
+
#: ../codepress-admin-columns.php:2225
|
290 |
+
msgid "Approved"
|
291 |
+
msgstr "Zatwierdzony"
|
292 |
+
|
293 |
+
#: ../codepress-admin-columns.php:2231
|
294 |
+
msgid "Date GMT"
|
295 |
+
msgstr "Data GMT"
|
296 |
+
|
297 |
+
#: ../codepress-admin-columns.php:2234
|
298 |
+
msgid "Agent"
|
299 |
+
msgstr "Agent"
|
300 |
+
|
301 |
+
#: ../codepress-admin-columns.php:2280
|
302 |
+
msgid "Custom"
|
303 |
+
msgstr "Włąsne"
|
304 |
+
|
305 |
+
#: ../codepress-admin-columns.php:2357
|
306 |
+
#: ../codepress-admin-columns.php:3119
|
307 |
+
msgid "Addons"
|
308 |
+
msgstr "Dodatki"
|
309 |
+
|
310 |
+
#: ../codepress-admin-columns.php:2937
|
311 |
+
#: ../codepress-admin-columns.php:3104
|
312 |
+
msgid "find out more"
|
313 |
+
msgstr "dowiedz się więcej"
|
314 |
+
|
315 |
+
#: ../codepress-admin-columns.php:2941
|
316 |
+
msgid "This will make all of the new columns support sorting"
|
317 |
+
msgstr "Dzięki temu wszystkie nowe kolumny będą sortowalne"
|
318 |
+
|
319 |
+
#: ../codepress-admin-columns.php:2942
|
320 |
+
msgid "By default WordPress let's you sort by title, date, comments and author. This will make you be able to <strong>sort by any column of any type!</strong>"
|
321 |
+
msgstr "Domyślnie, WordPress pozwala na sortowanie po tytule, dacie, komentarzu i autorze. Dzięi temu będziesz mógł <strong>sortować każdą kolumnę, każdego rodzaju!</strong>"
|
322 |
+
|
323 |
+
#: ../codepress-admin-columns.php:2943
|
324 |
+
msgid "Perfect for sorting your articles, media files, comments, links and users"
|
325 |
+
msgstr "Idealne rozwiązanie do sortowania wpisów, mediów, komentarzy, linków i użytkowników"
|
326 |
+
|
327 |
+
#: ../codepress-admin-columns.php:2952
|
328 |
+
#: ../codepress-admin-columns.php:2954
|
329 |
+
msgid "Sortorder"
|
330 |
+
msgstr "Kierunek sortowania"
|
331 |
+
|
332 |
+
#: ../codepress-admin-columns.php:2962
|
333 |
+
msgid "Inactive"
|
334 |
+
msgstr "Nieaktywny"
|
335 |
+
|
336 |
+
#: ../codepress-admin-columns.php:2965
|
337 |
+
msgid "Active"
|
338 |
+
msgstr "Actief"
|
339 |
+
|
340 |
+
#: ../codepress-admin-columns.php:2970
|
341 |
+
msgid "Fill in your activation code"
|
342 |
+
msgstr "Wpisz kod aktywacyjny"
|
343 |
+
|
344 |
+
#: ../codepress-admin-columns.php:2971
|
345 |
+
msgid "Activate"
|
346 |
+
msgstr "Aktywuj"
|
347 |
+
|
348 |
+
#: ../codepress-admin-columns.php:2975
|
349 |
+
msgid "Deactivate"
|
350 |
+
msgstr "Deaktywuj"
|
351 |
+
|
352 |
+
#: ../codepress-admin-columns.php:2990
|
353 |
+
msgid "Activate Add-ons"
|
354 |
+
msgstr "Aktywuj dodatki"
|
355 |
+
|
356 |
+
#: ../codepress-admin-columns.php:2991
|
357 |
+
msgid "Add-ons can be unlocked by purchasing a license key. Each key can be used on multiple sites"
|
358 |
+
msgstr "Dodatki mągą być aktywowane po zakupie licencji. Każdy klucz licencji może być sotsowany na wielu stronach"
|
359 |
+
|
360 |
+
#: ../codepress-admin-columns.php:2995
|
361 |
+
msgid "Addon"
|
362 |
+
msgstr "Dodatek"
|
363 |
+
|
364 |
+
#: ../codepress-admin-columns.php:2997
|
365 |
+
msgid "Activation Code"
|
366 |
+
msgstr "Kod aktywacyjny"
|
367 |
+
|
368 |
+
#: ../codepress-admin-columns.php:3006
|
369 |
+
msgid "Enter your activation code"
|
370 |
+
msgstr "Wpisz kod aktywacyjny"
|
371 |
+
|
372 |
+
#: ../codepress-admin-columns.php:3007
|
373 |
+
msgid "Activation code unrecognised"
|
374 |
+
msgstr "Kod aktywacyjny nie został rozpoznany"
|
375 |
+
|
376 |
+
#: ../codepress-admin-columns.php:3101
|
377 |
+
msgid "You will find a short overview at the <strong>Help</strong> section in the top-right screen."
|
378 |
+
msgstr "Krótkie podsumowanie znajdziesz w dziale <strong>Pomocy</strong>, w prawym, górnym rogu ekranu."
|
379 |
+
|
380 |
+
#: ../codepress-admin-columns.php:3109
|
381 |
+
msgid "Codepress Admin Columns"
|
382 |
+
msgstr "Edytor kolumn"
|
383 |
+
|
384 |
+
#: ../codepress-admin-columns.php:3122
|
385 |
+
msgid "By default WordPress let's you only sort by title, date, comments and author."
|
386 |
+
msgstr "Domyślnie WordPress pozwala na sortowanie po tytule, dacie, komentarzu i autorze."
|
387 |
+
|
388 |
+
#: ../codepress-admin-columns.php:3123
|
389 |
+
msgid "Make <strong>all columns</strong> of <strong>all types</strong> support sorting — with the sorting addon."
|
390 |
+
msgstr "Włącz sortowanie <strong>wszystkich kolumn, wszystkich typów</strong> — uaktywniając dodatek."
|
391 |
+
|
392 |
+
#: ../codepress-admin-columns.php:3131
|
393 |
+
msgid "Like this plugin?"
|
394 |
+
msgstr "Lubisz tę wtyczkę?"
|
395 |
+
|
396 |
+
#: ../codepress-admin-columns.php:3134
|
397 |
+
msgid "Why not do any or all of the following"
|
398 |
+
msgstr "Dlaczego by nie zrobić jednej lub wszystkich z poniższych rzeczy"
|
399 |
+
|
400 |
+
#: ../codepress-admin-columns.php:3136
|
401 |
+
msgid "Link to it so other folks can find out about it."
|
402 |
+
msgstr "Dodaj link aby inni mogli się o niej dowiedzieć."
|
403 |
+
|
404 |
+
#: ../codepress-admin-columns.php:3137
|
405 |
+
msgid "Give it a 5 star rating on WordPress.org."
|
406 |
+
msgstr "Przyznaj jej 5 gwaizdek na stronie WordPress.org."
|
407 |
+
|
408 |
+
#: ../codepress-admin-columns.php:3138
|
409 |
+
msgid "Donate a token of your appreciation."
|
410 |
+
msgstr "Wspomóż drobną dotacją."
|
411 |
+
|
412 |
+
#: ../codepress-admin-columns.php:3146
|
413 |
+
msgid "Need support?"
|
414 |
+
msgstr "Potrzebujesz pomocy?"
|
415 |
+
|
416 |
+
#: ../codepress-admin-columns.php:3150
|
417 |
+
#, php-format
|
418 |
+
msgid "If you are having problems with this plugin, please talk about them in the <a href=\"%s\">Support forums</a> or send me an email %s."
|
419 |
+
msgstr "Jeśli masz jakieś problemy z tą wtyczką, proszę napisz o tym na stronie <a href=\"%s\">Forum pomocy</a> lub wyślij do mnie maila na adres %s."
|
420 |
+
|
421 |
+
#: ../codepress-admin-columns.php:3151
|
422 |
+
#, php-format
|
423 |
+
msgid "If you're sure you've found a bug, or have a feature request, please <a href='%s'>submit your feedback</a>."
|
424 |
+
msgstr "Jeśli jeste przekonany, że znalazłeś bug'a lub masz prośbę o dodanie nowej funkcji, proszę <a href='%s'>wyślij do mnie maila.</a>."
|
425 |
+
|
426 |
+
#: ../codepress-admin-columns.php:3166
|
427 |
+
msgid "Admin Columns"
|
428 |
+
msgstr "Edytor kolumn"
|
429 |
+
|
430 |
+
#: ../codepress-admin-columns.php:3184
|
431 |
+
msgid "Save Changes"
|
432 |
+
msgstr "Zapisz zmiany"
|
433 |
+
|
434 |
+
#: ../codepress-admin-columns.php:3196
|
435 |
+
msgid "Restore defaults"
|
436 |
+
msgstr "Przywróć domyślne"
|
437 |
+
|
438 |
+
#: ../codepress-admin-columns.php:3200
|
439 |
+
msgid "Restore default settings"
|
440 |
+
msgstr "Przywróć ustawienia domyślne"
|
441 |
+
|
442 |
+
#: ../codepress-admin-columns.php:3200
|
443 |
+
msgid "Warning! ALL saved admin columns data will be deleted. This cannot be undone. \\'OK\\' to delete, \\'Cancel\\' to stop"
|
444 |
+
msgstr "Uwaga! WSZYSTKIE zapisane ustawienia kolumn zostaną usunięte. Tej operacji nie można przywrócić. Kliknij \\'OK\\' aby usunąć lub \\'Anuluj\\' aby przerwać."
|
445 |
+
|
446 |
+
#: ../codepress-admin-columns.php:3202
|
447 |
+
msgid "This will delete all column settings and restore the default settings."
|
448 |
+
msgstr "Ta operacja usunie wszystkie ustawienia kolumn u przywróci je do ustawień domyślnych."
|
449 |
+
|
450 |
+
#~ msgid "User Field"
|
451 |
+
#~ msgstr "Veld"
|
452 |
+
|
453 |
+
#~ msgid ""
|
454 |
+
#~ "If you are having problems with this plugin, please talk about them in "
|
455 |
+
#~ "the <a href=\"%s\">Support forums</a>."
|
456 |
+
#~ msgstr ""
|
457 |
+
#~ "Als je problem hebt met deze plugin, stel je vragen dan in de <a href=\"%s"
|
458 |
+
#~ "\">Support forums</a>."
|
459 |
+
|
460 |
+
#~ msgid "Title"
|
461 |
+
#~ msgstr "Titel"
|
462 |
+
|
463 |
+
#~ msgid "Latitude"
|
464 |
+
#~ msgstr "Breedtegraad"
|
465 |
+
|
466 |
+
#~ msgid "Longitude"
|
467 |
+
#~ msgstr "Lengtegraad"
|
468 |
+
|
469 |
+
#~ msgid "Dynamic"
|
470 |
+
#~ msgstr "Dynamisch"
|
471 |
+
|
472 |
+
#~ msgid "Geocoder - Pronamic Google Maps"
|
473 |
+
#~ msgstr "Geocoder - Pronamic Google Maps"
|
474 |
+
|
475 |
+
#~ msgid "Number posts to geocode: %s"
|
476 |
+
#~ msgstr "Aantel berichten te geocoderen: %s"
|
477 |
+
|
478 |
+
#~ msgid "Geocode"
|
479 |
+
#~ msgstr "Geocodeer"
|
480 |
+
|
481 |
+
#~ msgid "Zero results"
|
482 |
+
#~ msgstr "Geen resultaten"
|
483 |
+
|
484 |
+
#~ msgid ""
|
485 |
+
#~ "We found no geocoding results for the following %s posts, adjust them "
|
486 |
+
#~ "manually if needed."
|
487 |
+
#~ msgstr ""
|
488 |
+
#~ "We konden geen gecode resultaten vinden voor de volgende%s berichten, pas "
|
489 |
+
#~ "deze handmatig aan wanneer nodig."
|
490 |
+
|
491 |
+
#~ msgid "Configuration - Pronamic Google Maps"
|
492 |
+
#~ msgstr "Configuratie - Pronamic Google Maps"
|
493 |
+
|
494 |
+
#~ msgid "Show Google Maps"
|
495 |
+
#~ msgstr "Google Maps weergeven"
|
496 |
+
|
497 |
+
#~ msgid "Geocoder"
|
498 |
+
#~ msgstr "Geocoder"
|
499 |
+
|
500 |
+
#~ msgid "Geocode ↓"
|
501 |
+
#~ msgstr "Geocoderen ↓"
|
502 |
+
|
503 |
+
#~ msgid "Reverse Geocode ↑"
|
504 |
+
#~ msgstr "Omgekeerd geocoderen ↑"
|
505 |
+
|
506 |
+
#~ msgid "Tip: Change the zoom level and map type to your own wishes."
|
507 |
+
#~ msgstr "Tip: wijzig het zoomniveau en map type naar je eigen wens."
|
508 |
+
|
509 |
+
#~ msgid "Warning! This will delete all Pronamic Google Maps data and options."
|
510 |
+
#~ msgstr ""
|
511 |
+
#~ "Waarschuwing! Dit zal alle Pronamic Google Maps data en opties "
|
512 |
+
#~ "verwijderen."
|
513 |
+
|
514 |
+
#~ msgid "Uninstall"
|
515 |
+
#~ msgstr "Verwijderen"
|
516 |
+
|
517 |
+
#~ msgid "Google Maps"
|
518 |
+
#~ msgstr "Google Maps"
|
519 |
+
|
520 |
+
#~ msgid "General"
|
521 |
+
#~ msgstr "Algemeen"
|
522 |
+
|
523 |
+
#~ msgid "Use this widget to add an Google Maps as a widget."
|
524 |
+
#~ msgstr "Gebruik deze widget om Google Maps toe te voegen."
|
525 |
+
|
526 |
+
#~ msgid "pixels"
|
527 |
+
#~ msgstr "pixels"
|
528 |
+
|
529 |
+
#~ msgid "percent"
|
530 |
+
#~ msgstr "procent"
|
531 |
+
|
532 |
+
#~ msgid "Search"
|
533 |
+
#~ msgstr "Zoeken"
|
534 |
+
|
535 |
+
#~ msgid "Click to toggle"
|
536 |
+
#~ msgstr "Klik om te wisselen"
|
537 |
+
|
538 |
+
#~ msgid "Donate $10, $20 or $50!"
|
539 |
+
#~ msgstr "Doneer $10, $20 of $50!"
|
540 |
+
|
541 |
+
#~ msgid ""
|
542 |
+
#~ "This plugin has cost us countless hours of work, if you use it, please "
|
543 |
+
#~ "donate a token of your appreciation!"
|
544 |
+
#~ msgstr ""
|
545 |
+
#~ "Het ons veel uren werken gekost om deze plugin te ontwikkelen, als je het "
|
546 |
+
#~ "gebruikt, doneer a.u.b. voor je waardering!"
|
547 |
+
|
548 |
+
#~ msgid "Latest news from Pronamic"
|
549 |
+
#~ msgstr "Laatste nieuws van Pronamic"
|
550 |
+
|
551 |
+
#~ msgid "no news items, feed might be broken..."
|
552 |
+
#~ msgstr "geen nieuws items, feed is waarschijnlijk niet bereikbaar..."
|
553 |
+
|
554 |
+
#~ msgid "Subscribe with RSS"
|
555 |
+
#~ msgstr "Aanmelden voor RSS"
|
556 |
+
|
557 |
+
#~ msgid "Subscribe by e-mail"
|
558 |
+
#~ msgstr "Aanmelden via e-mail"
|
559 |
+
|
560 |
+
#~ msgid "Let other people know that it works with your WordPress setup."
|
561 |
+
#~ msgstr "Laat anderen weten dat het werk op je WordPress installatie."
|
562 |
+
|
563 |
+
#~ msgid "Found a bug?"
|
564 |
+
#~ msgstr "Bug gevonden?"
|
565 |
+
|
566 |
+
#~ msgid "Configuration"
|
567 |
+
#~ msgstr "Configuratie"
|
readme.txt
CHANGED
@@ -1,21 +1,19 @@
|
|
1 |
=== Codepress Admin Columns ===
|
2 |
Contributors: codepress, tschutter
|
3 |
-
Tags: plugins, wordpress, admin, column, columns, dashboard, sortable, filters, wp-admin
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
== Description ==
|
9 |
|
10 |
-
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
The following custom columns are supported:
|
19 |
|
20 |
* Featured Image
|
21 |
* Excerpt
|
@@ -27,27 +25,87 @@ The following custom columns are supported:
|
|
27 |
* ID
|
28 |
* Slug
|
29 |
* Sticky
|
|
|
|
|
|
|
|
|
30 |
* Custom Fields
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
= Custom Fields =
|
33 |
|
34 |
-
With the custom field column you can display custom field values. It
|
35 |
|
36 |
-
* Icons for Media Library items
|
37 |
* Image thumbnails
|
|
|
38 |
* Excerpt
|
39 |
* Multiple Values
|
|
|
40 |
|
41 |
-
= Sortable
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
* page template
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
**Related Links:**
|
53 |
|
@@ -59,25 +117,94 @@ I will be adding more in coming releases. You can leave any <a href='http://www.
|
|
59 |
2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
|
60 |
3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
|
61 |
|
62 |
-
|
63 |
== Frequently Asked Questions ==
|
64 |
|
65 |
= I have an idea for a great way to improve this plugin =
|
66 |
|
67 |
Great! I'd love to hear from you.
|
68 |
-
Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns
|
69 |
|
70 |
== Screenshots ==
|
71 |
|
72 |
-
1. Settings page
|
73 |
-
2.
|
74 |
-
3.
|
|
|
|
|
|
|
|
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
-
= 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
= 1.0 =
|
83 |
|
1 |
=== Codepress Admin Columns ===
|
2 |
Contributors: codepress, tschutter
|
3 |
+
Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 3.3.1
|
6 |
+
Stable tag: 1.4.1
|
7 |
|
8 |
== Description ==
|
9 |
|
10 |
+
Completely customise the columns on the administration screens with a nice drag and drop interface.
|
11 |
|
12 |
+
By default, WordPress only shows a few built-in columns. This plugin will give you many additional columns and you will have full control over all custom columns for pages, posts, posttypes, media and users. You can add or remove columns, change their label, change their width and reorder them..
|
13 |
|
14 |
+
= Post Types Columns =
|
15 |
|
16 |
+
The following custom columns are added:
|
|
|
|
|
17 |
|
18 |
* Featured Image
|
19 |
* Excerpt
|
25 |
* ID
|
26 |
* Slug
|
27 |
* Sticky
|
28 |
+
* Word count
|
29 |
+
* Roles
|
30 |
+
* Status
|
31 |
+
* Number of Attachments
|
32 |
* Custom Fields
|
33 |
|
34 |
+
= User Columns =
|
35 |
+
|
36 |
+
You can also change the User Columns. The following user columns are added:
|
37 |
+
|
38 |
+
* User ID
|
39 |
+
* First name
|
40 |
+
* Last name
|
41 |
+
* Url
|
42 |
+
* Register date
|
43 |
+
* Biographical Info ( description )
|
44 |
+
* User Custom Fields
|
45 |
+
* Number of Posts Types
|
46 |
+
|
47 |
+
Some of the user custom fields that are included: user level, capabilities, admin color, nickname... many more.
|
48 |
+
|
49 |
+
= Media Columns =
|
50 |
+
|
51 |
+
Customise the Media Library Columns. The following media columns are added:
|
52 |
+
|
53 |
+
* Media ID
|
54 |
+
* File name
|
55 |
+
* Height
|
56 |
+
* Width
|
57 |
+
* Dimensions ( width x height )
|
58 |
+
* Description, Caption and Alternate tekst
|
59 |
+
* Mime-Type
|
60 |
+
|
61 |
+
= Comment Columns =
|
62 |
+
|
63 |
+
A lot more comment colums are added, here are a few examples:
|
64 |
+
|
65 |
+
* Avatar
|
66 |
+
* Author IP
|
67 |
+
* Agent
|
68 |
+
* ID
|
69 |
+
* Comment excerpt
|
70 |
+
* Comment Meta data
|
71 |
+
|
72 |
+
= Link Columns =
|
73 |
+
|
74 |
+
A few examples of added Link columns:
|
75 |
+
|
76 |
+
* ID
|
77 |
+
* Target
|
78 |
+
* Description
|
79 |
+
* Notes
|
80 |
+
* Owner
|
81 |
+
|
82 |
= Custom Fields =
|
83 |
|
84 |
+
With the custom field column you can display any custom field values. It can show its default value but also handle it as an image or icon. Thsese types are added:
|
85 |
|
|
|
86 |
* Image thumbnails
|
87 |
+
* Icons for Media Library items
|
88 |
* Excerpt
|
89 |
* Multiple Values
|
90 |
+
* Numeric value ( this also works for sorting by meta_value_num )
|
91 |
|
92 |
+
= Sortable Custom Columns for all Screens =
|
93 |
|
94 |
+
All of the new columns will have support for sorting with the <a href="http://www.codepress.nl/plugins/codepress-admin-columns/sortorder-addon/">sorting addon</a>.
|
95 |
|
96 |
+
By default WordPress let's you only sort by Title, Date, Comments and Author. This will make you be able to <strong>sort by ALL columns of ANY type</strong>.
|
97 |
+
|
98 |
+
= Third party plugin support =
|
|
|
99 |
|
100 |
+
It will work nice with other plugins and support their additional custom columns. A few examples of plugins that are supported: WordPress SEO by Yoast (Robots Meta), Post Admin Shortcuts (Pin), WP Show IDs (ID) and User Access Manager (Access), Co-Authors Plus and Advanced Custom Fields.
|
101 |
+
|
102 |
+
= Upcoming releases =
|
103 |
+
|
104 |
+
The next upcoming release will have the option to set default sorting per screen.
|
105 |
+
|
106 |
+
**Feedback**
|
107 |
+
|
108 |
+
You can leave any <a href='http://www.codepress.nl/plugins/codepress-admin-columns/feedback'>requests or feedback</a>.
|
109 |
|
110 |
**Related Links:**
|
111 |
|
117 |
2. Activate Codepress Admin Columns through the 'Plugins' menu in WordPress
|
118 |
3. Configure the plugin by going to the Admin Column settings that appears under the Settings menu.
|
119 |
|
|
|
120 |
== Frequently Asked Questions ==
|
121 |
|
122 |
= I have an idea for a great way to improve this plugin =
|
123 |
|
124 |
Great! I'd love to hear from you.
|
125 |
+
Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns/feedback.
|
126 |
|
127 |
== Screenshots ==
|
128 |
|
129 |
+
1. Settings page for Post(type) columns.
|
130 |
+
2. Posts Screen with the customized sortable columns.
|
131 |
+
3. Settings page for the Media Library columns.
|
132 |
+
4. Media Screen with the customized sortable columns.
|
133 |
+
5. Settings page for Users columns.
|
134 |
+
6. Users Screen with the customized sortable columns.
|
135 |
+
7. Settings page showing the different displaying types for custom field.
|
136 |
|
137 |
== Changelog ==
|
138 |
|
139 |
+
= 1.4.1 =
|
140 |
+
* added polish translation, thanks to Bartosz.
|
141 |
+
* changed the license key validation proces
|
142 |
+
* removed non-breaking-space-character from column output
|
143 |
+
|
144 |
+
= 1.4 =
|
145 |
+
|
146 |
+
* added support for comment columns
|
147 |
+
* added support for link columns
|
148 |
+
* added links to taxonomies
|
149 |
+
* added sorting user custom fields
|
150 |
+
* added sorting to links columns
|
151 |
+
* added user columns so you can see how many articles an author has published of a certain post type
|
152 |
+
* added Textual help
|
153 |
+
* added the option to specify column width
|
154 |
+
* added role column to all posts screens
|
155 |
+
* added posts status column to all posts screens
|
156 |
+
* added image path to media library
|
157 |
+
* added added apply_filters('cpac-get-post-types', $post_types) to filter out certain post types
|
158 |
+
* added option to enter license key for activating sorting on ALL columns
|
159 |
+
* fixed a php5 warning
|
160 |
+
* fixed a conflict with the Co-Authors plugin
|
161 |
+
|
162 |
+
= 1.3 =
|
163 |
+
|
164 |
+
* added support for Media columns
|
165 |
+
* added Media columns: filename, width, height, dimensions, description, alt, caption and mime-type
|
166 |
+
* added date type to posts custom fields
|
167 |
+
* added title type to posts custom fields
|
168 |
+
* sorting has changed. when sorting; only results are shown which contain a value
|
169 |
+
* str_word_count is used for excerpts
|
170 |
+
|
171 |
+
= 1.2.1 =
|
172 |
+
|
173 |
+
* added word count sorting
|
174 |
+
* added attachment count sorting
|
175 |
+
* added template name sorting
|
176 |
+
* minor styling changes
|
177 |
+
* bug fix with sorting by slug
|
178 |
+
* bug fix with sorting by attachment
|
179 |
+
|
180 |
+
= 1.2 =
|
181 |
+
|
182 |
+
* added support for third party plugins
|
183 |
+
* added user custom fields
|
184 |
+
* added extra image check
|
185 |
+
* bug fix with javascript (jquery) enqueue
|
186 |
+
|
187 |
+
= 1.1.3 =
|
188 |
+
|
189 |
+
* added bug fix for WP3.3beta ( thanks to raonip and ronbme for pointing this out )
|
190 |
+
|
191 |
+
= 1.1.2 =
|
192 |
+
|
193 |
+
* added dutch translation
|
194 |
+
|
195 |
+
= 1.1.1 =
|
196 |
+
|
197 |
+
* Bug fix: path separator for require_once
|
198 |
+
* Added word count
|
199 |
+
|
200 |
+
= 1.1 =
|
201 |
|
202 |
+
* Added User Columns.
|
203 |
+
* Added before / after text for custom fields
|
204 |
+
* Added custom field type 'Numeric'.
|
205 |
+
* Added custom field sortables.
|
206 |
+
* Fixed domain path
|
207 |
+
* Fixed settings link
|
208 |
|
209 |
= 1.0 =
|
210 |
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
screenshot-5.png
ADDED
Binary file
|
screenshot-6.png
ADDED
Binary file
|
screenshot-7.png
ADDED
Binary file
|